@feedmepos/mf-connect 0.1.126-dev → 0.1.127-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-B_Yp6cvN.js → App-CLrxVFgX.js} +10 -10
- package/dist/{AuditLogs-C1U17evK.js → AuditLogs-DYlfToAk.js} +13 -13
- package/dist/{Bin-CmIpEIwe.js → Bin-C0CugBW4.js} +8 -8
- package/dist/{Broadcast-DkV4BdU_.js → Broadcast-DhVQa_WW.js} +12 -12
- package/dist/{CampaignAnalytic-Dkwo_lpB.js → CampaignAnalytic-6jeG5U90.js} +97 -97
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Ch8Gblw6.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cxydrkof.js} +9 -9
- package/dist/{Card-DXCkG34M.js → Card-cpLj34Oy.js} +23 -23
- package/dist/{Collections-CybPfSO4.js → Collections-CdRpJuHO.js} +8 -8
- package/dist/{Credit-B-KUzWsX.js → Credit-E_N_yfnJ.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CWHYeYVD.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Dq-2vUqT.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C86llTFR.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSXO2bYC.js} +1285 -1140
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-nMcH6y5e.js → EffectSheet.vue_vue_type_style_index_0_lang-BeQZjLIw.js} +6 -6
- package/dist/{Experience-Q2NHpa-V.js → Experience-D9i0ax4C.js} +13 -13
- package/dist/{FileSaver.min-CKw2rn-J.js → FileSaver.min-BOE2RBne.js} +1 -1
- package/dist/{Game-lZvkg04z.js → Game-CirwX_l1.js} +13 -13
- package/dist/{GiftCardSetup-CPRju80_.js → GiftCardSetup-DpJb_azW.js} +10 -10
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Ci686UoB.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-ff6Nfvxe.js} +140 -128
- package/dist/{Goals-asGsUeVv.js → Goals-TejbPs-I.js} +4 -4
- package/dist/{Grab-BjFLSMpE.js → Grab-CeUX-LlF.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-nk87zPWH.js → ImageInput.vue_vue_type_script_setup_true_lang-CnZzRDGS.js} +1 -1
- package/dist/{Index-DIasPS4Y.js → Index-gqWBDZBN.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DkOn8p1v.js → LocationPicker.vue_vue_type_script_setup_true_lang-CzobgD7L.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BdSkxiP-.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DgeD1RQq.js} +1 -1
- package/dist/{LoyaltyDashboard-DlCsZ3YX.js → LoyaltyDashboard-R22oQHTd.js} +82 -82
- package/dist/{MainLayout-DLObnTAA.js → MainLayout-pJBEBaM-.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-DigSZKt1.js → MainLayout.vue_vue_type_script_setup_true_lang-IX_utv2Z.js} +3 -3
- package/dist/{Marketing-JflPW-w9.js → Marketing-5gMwO1jV.js} +4 -4
- package/dist/{MarketingMaterialEdit-fSAB3YVb.js → MarketingMaterialEdit-BaHNX_qE.js} +6 -6
- package/dist/{Member-CzNahXTj.js → Member-Cd0oraEq.js} +7 -7
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DzyM1fW_.js +1322 -0
- package/dist/{MemberImportHistory--r_A_2Es.js → MemberImportHistory-C_RkY3fg.js} +7 -7
- package/dist/{MemberList-CQZQ4sN8.js → MemberList-CJK1akUC.js} +14 -14
- package/dist/{MemberTransactions-BPg9JaUA.js → MemberTransactions-DP6schuy.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BhIFChx-.js → MessageInput.vue_vue_type_script_setup_true_lang-BaivunRx.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CdGSNqEp.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DOdYyPp2.js} +1 -1
- package/dist/{Mission-CYCB3YQc.js → Mission-DJ40IcG9.js} +14 -14
- package/dist/{Overview-B5ylMBHT.js → Overview-CaQlLSBg.js} +4 -4
- package/dist/{Overview-DuNuUYYq.js → Overview-DXHjNmIO.js} +21 -21
- package/dist/{Point-DG-Uwj25.js → Point-D0Qqmgai.js} +14 -14
- package/dist/{Promotion-DqxBQ1yO.js → Promotion-CQU2-tpG.js} +14 -14
- package/dist/{Queue-Cy8LGt_Y.js → Queue-B-Uki3qh.js} +13 -13
- package/dist/{Record-CzXbu41w.js → Record-BvQ0nVja.js} +9 -9
- package/dist/{Review-7VL6gIqp.js → Review-DMfBPU_D.js} +2 -2
- package/dist/{ReviewFacebookCallback-BwzuPmrz.js → ReviewFacebookCallback-Bq6JQ7LR.js} +5 -5
- package/dist/{ReviewGoogleCallback-1JXR_f5O.js → ReviewGoogleCallback-Bg9PFxog.js} +5 -5
- package/dist/{Reward-BKhUDEu3.js → Reward-CNC0z98e.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DjjCytWF.js → RewardGroup.vue_vue_type_script_setup_true_lang-DXr-5wJE.js} +14 -14
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Vg7pRGIz.js → RuleGroup.vue_vue_type_script_setup_true_lang-OznhirAU.js} +15 -15
- package/dist/{Segment-DdHDJhaS.js → Segment-V0ZQJkN-.js} +27 -27
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-9kGUkHMi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BmFp2pst.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DeFw0px7.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C0IbEZMG.js} +4 -4
- package/dist/{Setting-DZKGXw-i.js → Setting-DCb6IIrk.js} +15 -15
- package/dist/{SettingAdvertisements-BBNs8tCw.js → SettingAdvertisements-Dc9XfzVl.js} +12 -12
- package/dist/{Settings-9v0hnBJZ.js → Settings-BIjIfmFI.js} +5 -5
- package/dist/{Store-C8IlE4IH.js → Store-DkoB_5IF.js} +27 -27
- package/dist/{StoreRewards-DWygRLR1.js → StoreRewards-a4ujLMfY.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CeYYws6P.js → StoreTransactions.vue_vue_type_script_setup_true_lang-UbMY0RzG.js} +25 -25
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BiN3uRJ_.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BWjb1wHV.js} +2 -2
- package/dist/{Tier-7RoxGHsP.js → Tier-1WKuUirS.js} +28 -28
- package/dist/{Title-0q2Z4HIe.js → Title-CznZg4jL.js} +23 -23
- package/dist/{Transaction-CFasERdg.js → Transaction-DBRQDmA3.js} +2 -2
- package/dist/{Upselling-DM9R6pYw.js → Upselling-CjZvUUqn.js} +3 -3
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BDjwcgnc.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DS4hdSE9.js} +6 -6
- package/dist/{Voucher-BkzW2hVV.js → Voucher-Di6VhoSM.js} +18 -18
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DaE4xa3x.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BjSzCnBw.js} +12 -12
- package/dist/{WhatsappAccount-C3WpDF9O.js → WhatsappAccount-DdXadlHI.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BxC_3h52.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Cnlvi-GG.js} +1 -1
- package/dist/WhatsappBot-DwhQmZLJ.js +882 -0
- package/dist/{WhatsappBotLogs--KskC32Z.js → WhatsappBotLogs-BAglKUAZ.js} +66 -66
- package/dist/{WhatsappBotSettings-Dns_PqVE.js → WhatsappBotSettings-DslJTj2X.js} +5 -5
- package/dist/{WhatsappLayout-NIrFGbId.js → WhatsappLayout-14847AOz.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BfD5hHc7.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-otzgv6Jh.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CJGxy7gf.js → ZodTextField.vue_vue_type_script_setup_true_lang-BEY-LOVu.js} +2 -2
- package/dist/{app-B9nLnoBt.js → app-KbxCI4gY.js} +107 -91
- package/dist/app.js +1 -1
- package/dist/{base.export-CBzNea0v.js → base.export-DH8OxNrx.js} +2 -2
- package/dist/business-DuKNr9P7.js +83 -0
- package/dist/{campaign-BDCLKFwN.js → campaign-DR5xHhgA.js} +2 -2
- package/dist/{campaign-B6nTwt17.js → campaign-Ddv-RZgo.js} +113 -99
- package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-DsaSpHDQ.js} +1 -1
- package/dist/{campaign.fn-Ck1t5C1T.js → campaign.fn-CJlEovlZ.js} +142 -142
- package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-CDHT9uk3.js} +1 -1
- package/dist/{collection.fn-CDna_VLD.js → collection.fn-DTZs-hUX.js} +2 -2
- package/dist/{currency-Baum67Wz.js → currency-1-Yhpyv5.js} +1 -1
- package/dist/{duplicateCampaign-BwrMZgaV.js → duplicateCampaign-BncSxYSg.js} +2 -2
- package/dist/{effect-CeJbflOK.js → effect-TTD5--LN.js} +1 -1
- package/dist/{email-addresses-Y3vF73J0.js → email-addresses-pxXp67Al.js} +2 -2
- package/dist/{feature-flag-zn6Ql9tv.js → feature-flag-CFVZl4ed.js} +1 -1
- package/dist/{helper-DZvnn-yx.js → helper-BC_Cl5VR.js} +1 -1
- package/dist/{index-Da0-7h2j.js → index-42Wl_5UE.js} +1 -1
- package/dist/{index-BYUEPfbP.js → index-BRl7Besd.js} +2 -2
- package/dist/{index-CPi3Qwmj.js → index-BxUMqeaY.js} +4 -4
- package/dist/{index-DHNhIloU.js → index-ByFFDLTo.js} +1 -1
- package/dist/{index-njg4JLa-.js → index-CBKbnJRo.js} +9 -9
- package/dist/index-CGtlXLTG.js +10767 -0
- package/dist/{index-B3LCTMwV.js → index-CRKdLbXL.js} +68 -60
- package/dist/{index-CMs3aIA6.js → index-CaHkqz0W.js} +3 -3
- package/dist/{index-DkBOM8za.js → index-CcXMYJxc.js} +8 -8
- package/dist/{index-DXyOBtgF.js → index-CkiP4iG6.js} +1 -1
- package/dist/{index-CDRTiAEu.js → index-D1iOPNg3.js} +1 -1
- package/dist/{index-DCR1GFCA.js → index-D2Nq0UoL.js} +6 -6
- package/dist/index-D4nA0Z7e.js +19528 -0
- package/dist/{index-r_T5o_hF.js → index-DHw8wo7T.js} +2 -2
- package/dist/{index-FgM7b2Sw.js → index-DKOoRHPf.js} +4 -4
- package/dist/{index-B20FfbEE.js → index-DcbPYZkw.js} +26 -19
- package/dist/{index-DXKJsqgW.js → index-DjwrfZk3.js} +18 -18
- package/dist/{index-DJIt5tXC.js → index-EuZfRdBT.js} +5 -5
- package/dist/{index-juXxYQ_a.js → index-H4XJDOoT.js} +6 -6
- package/dist/{index-B5H4znfe.js → index-ImU7YXN7.js} +1 -1
- package/dist/{index-B22ojkMy.js → index-N4EzkcEu.js} +2 -2
- package/dist/{index-BqniSMV6.js → index-j7eLKJK3.js} +4 -4
- package/dist/{index.esm2017-Dtk7BscN.js → index.esm2017-CBo4j3U1.js} +1 -1
- package/dist/{loading-PoODMkQD.js → loading-COAu2l7W.js} +1 -1
- package/dist/{lodash-TthNgH98.js → lodash-Bu1ipIkR.js} +1 -1
- package/dist/{member-import-D7zs0Jvh.js → member-import-CkiTJIqy.js} +2 -2
- package/dist/{membership-Cab-iWQ1.js → membership-BSEeYyiz.js} +3 -3
- package/dist/{money-9Q306M3g.js → money-BOaGQSGa.js} +1 -1
- package/dist/{number-D9M3D435.js → number-B2AC2EMT.js} +1 -1
- package/dist/{objectid-DKvQl6FD.js → objectid-BKw48v5L.js} +2 -2
- package/dist/{onboarding-D5LKUHVI.js → onboarding-ClA8xAnH.js} +3 -3
- package/dist/{onboardingSetup-D0jsS6w5.js → onboardingSetup-DHjnq0H1.js} +2 -2
- package/dist/{plugins-CDTKQ1Pg.js → plugins-DewN43sP.js} +3 -3
- package/dist/{reward-De3e9vYS.js → reward-deDdPQiR.js} +1 -1
- package/dist/{rule-trVJgEOe.js → rule-B8ifutnO.js} +10 -10
- package/dist/{template-Bj3Tb6bP.js → template-z3VMmWei.js} +6 -6
- package/dist/timezone-BxJDy-bY.js +19 -0
- package/dist/{transaction.fn-CPE-oQhA.js → transaction.fn-CBBhq01K.js} +2 -2
- package/dist/{trigger-C6oM-8pe.js → trigger-B_quLwWr.js} +5 -5
- package/dist/{useMarketingMaterialActions-C5scdJQp.js → useMarketingMaterialActions-DqoRLx1M.js} +4 -4
- package/dist/{usePagination-CIuTHSSG.js → usePagination-Q1fPttcp.js} +1 -1
- package/dist/{user-Bdlgn2yo.js → user-Bw6h9xn-.js} +1 -1
- package/dist/{vue-i18n-DEpDI-dt.js → vue-i18n-DpCS1FnK.js} +109 -109
- package/dist/{xlsx-CvecxUOG.js → xlsx--toeD6hC.js} +1 -1
- package/dist/{zod-bniyeWdY.js → zod-BkNAcpay.js} +1 -1
- package/package.json +1 -1
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-bqWUIbMG.js +0 -1300
- package/dist/WhatsappBot-DZb-Dn3s.js +0 -878
- package/dist/business-aT2zslwu.js +0 -82
- package/dist/index-BL2zQnXK.js +0 -27551
- package/dist/index-C_H8jFYf.js +0 -2743
- package/dist/timezone-DkuByUmb.js +0 -20
|
@@ -1,49 +1,49 @@
|
|
|
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, onBeforeUnmount, createSlots } from "vue";
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import {
|
|
4
|
-
import { z, S as S6, h as Zh } from "./app-
|
|
5
|
-
import { Z as ZodHelper } from "./zod-
|
|
6
|
-
import { z as z$1 } from "./index-
|
|
7
|
-
import { d as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, e as FdtoRunnableCampaign, f as FdoCreditLoyaltyReward, g as FdtoRandomReward, h as F_MISSION_TYPE, i as FdoThresholdCreditReward, j as FdtoThresholdReward, k as FdoMission } from "./index-
|
|
8
|
-
import { F as FdoObjectId } from "./index-
|
|
9
|
-
import { F as FdtoCollectibleConfig } from "./index-
|
|
10
|
-
import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-
|
|
11
|
-
import { A as APP_INBOX_BODY_LIMIT, g as FdoBroadcastUrl, h as F_PUSH_DESTINATION, t as toDelivery, i as toLegacyMessage } from "./index-
|
|
12
|
-
import { e as CHANNEL_DISPLAY_ORDER, i as isPaidChannel, f as isChannelComplete, h as setMode, j as addChannel, k as hasDraft, l as setPrimaryChannel, r as removeChannel, m as moveChannel, n as setChannelContent, o as getCampaignSummaryObject, p as normaliseBroadcastDelivery } from "./campaign-
|
|
13
|
-
import { u as useMembershipStore } from "./membership-
|
|
14
|
-
import { u as useBusinessStore } from "./business-
|
|
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, nextTick, onBeforeUnmount, createSlots } from "vue";
|
|
2
|
+
import { _ } from "./lodash-Bu1ipIkR.js";
|
|
3
|
+
import { f as axios, c as core, S as SvcConfig } from "./index-EuZfRdBT.js";
|
|
4
|
+
import { z, S as S6, h as Zh } from "./app-KbxCI4gY.js";
|
|
5
|
+
import { Z as ZodHelper } from "./zod-BkNAcpay.js";
|
|
6
|
+
import { z as z$1 } from "./index-CGtlXLTG.js";
|
|
7
|
+
import { d as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, e as FdtoRunnableCampaign, f as FdoCreditLoyaltyReward, g as FdtoRandomReward, h as F_MISSION_TYPE, i as FdoThresholdCreditReward, j as FdtoThresholdReward, k as FdoMission } from "./index-D2Nq0UoL.js";
|
|
8
|
+
import { F as FdoObjectId } from "./index-D4nA0Z7e.js";
|
|
9
|
+
import { F as FdtoCollectibleConfig } from "./index-BxUMqeaY.js";
|
|
10
|
+
import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-CcXMYJxc.js";
|
|
11
|
+
import { A as APP_INBOX_BODY_LIMIT, g as FdoBroadcastUrl, h as F_PUSH_DESTINATION, t as toDelivery, i as toLegacyMessage } from "./index-j7eLKJK3.js";
|
|
12
|
+
import { e as CHANNEL_DISPLAY_ORDER, i as isPaidChannel, f as isChannelComplete, h as setMode, j as addChannel, k as hasDraft, l as setPrimaryChannel, r as removeChannel, m as moveChannel, n as setChannelContent, o as getCampaignSummaryObject, p as normaliseBroadcastDelivery } from "./campaign-Ddv-RZgo.js";
|
|
13
|
+
import { u as useMembershipStore } from "./membership-BSEeYyiz.js";
|
|
14
|
+
import { u as useBusinessStore } from "./business-DuKNr9P7.js";
|
|
15
15
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
16
16
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
17
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
18
|
-
import { _ as _sfc_main$
|
|
19
|
-
import { _ as _sfc_main$
|
|
20
|
-
import { _ as _sfc_main$
|
|
21
|
-
import { p as prompt, f as firebaseStorage } from "./plugins-
|
|
17
|
+
import { f as featureVersionMapping } from "./campaign.enum-DsaSpHDQ.js";
|
|
18
|
+
import { _ as _sfc_main$D } from "./ImageInput.vue_vue_type_script_setup_true_lang-CnZzRDGS.js";
|
|
19
|
+
import { _ as _sfc_main$B, a as _sfc_main$E, b as _sfc_main$G } from "./EffectSheet.vue_vue_type_style_index_0_lang-BeQZjLIw.js";
|
|
20
|
+
import { _ as _sfc_main$F } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BWjb1wHV.js";
|
|
21
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-DewN43sP.js";
|
|
22
22
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
23
|
-
import { _ as _sfc_main$
|
|
24
|
-
import { a as _sfc_main$
|
|
25
|
-
import { u as useI18n } from "./vue-i18n-
|
|
26
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$
|
|
27
|
-
import { D as DEFAULT_MESSAGE_VARIABLES, a as _sfc_main$
|
|
23
|
+
import { _ as _sfc_main$H } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DS4hdSE9.js";
|
|
24
|
+
import { a as _sfc_main$v, _ as _sfc_main$z } from "./RuleGroup.vue_vue_type_script_setup_true_lang-OznhirAU.js";
|
|
25
|
+
import { u as useI18n } from "./vue-i18n-DpCS1FnK.js";
|
|
26
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$I, a as _sfc_main$J } from "./trigger-B_quLwWr.js";
|
|
27
|
+
import { D as DEFAULT_MESSAGE_VARIABLES, a as _sfc_main$w, g as getSmsMessageMetrics, _ as _sfc_main$x, b as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-BaivunRx.js";
|
|
28
28
|
import { useDialog } from "@feedmepos/ui-library";
|
|
29
29
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
30
|
-
import { c as campaignApi } from "./index-
|
|
31
|
-
import { m as membershipApi } from "./index-
|
|
32
|
-
import { a as useChannelFlag } from "./feature-flag-
|
|
33
|
-
import { m as moment } from "./index-
|
|
34
|
-
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-
|
|
35
|
-
import {
|
|
36
|
-
import { _ as _sfc_main$
|
|
37
|
-
import "./index-
|
|
38
|
-
import "./index-
|
|
39
|
-
import "./index-
|
|
40
|
-
import "./index-
|
|
41
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
42
|
-
import { u as useLoading } from "./loading-
|
|
43
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
44
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
30
|
+
import { c as campaignApi } from "./index-DHw8wo7T.js";
|
|
31
|
+
import { m as membershipApi } from "./index-CaHkqz0W.js";
|
|
32
|
+
import { a as useChannelFlag } from "./feature-flag-CFVZl4ed.js";
|
|
33
|
+
import { m as moment } from "./index-CkiP4iG6.js";
|
|
34
|
+
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-B8ifutnO.js";
|
|
35
|
+
import { F as F_COUNTRY_TIMEZONE } from "./timezone-BxJDy-bY.js";
|
|
36
|
+
import { _ as _sfc_main$A, a as _sfc_main$C } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BjSzCnBw.js";
|
|
37
|
+
import "./index-H4XJDOoT.js";
|
|
38
|
+
import "./index-DKOoRHPf.js";
|
|
39
|
+
import "./index-CRKdLbXL.js";
|
|
40
|
+
import "./index-DcbPYZkw.js";
|
|
41
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-CDHT9uk3.js";
|
|
42
|
+
import { u as useLoading } from "./loading-COAu2l7W.js";
|
|
43
|
+
import { i as initCollectibleConfig } from "./helper-BC_Cl5VR.js";
|
|
44
|
+
import { C as CollectionUtils } from "./collection.fn-DTZs-hUX.js";
|
|
45
45
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
46
|
-
import { u as useCampaignStore } from "./campaign-
|
|
46
|
+
import { u as useCampaignStore } from "./campaign-DR5xHhgA.js";
|
|
47
47
|
import { a as cleanPF } from "./object-BYyQ0PZp.js";
|
|
48
48
|
const publicClient = axios.create({ withCredentials: !1, timeout: 5e3 });
|
|
49
49
|
async function getNativeApp(e) {
|
|
@@ -58,12 +58,12 @@ async function getNativeApp(e) {
|
|
|
58
58
|
}).parse(o.data).native;
|
|
59
59
|
}
|
|
60
60
|
function campaignRefinement(e, r) {
|
|
61
|
-
var
|
|
61
|
+
var d, p;
|
|
62
62
|
if (console.log(e, r), !e) return;
|
|
63
63
|
const o = e.campaign;
|
|
64
64
|
if (!o) return;
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
65
|
+
const m = o.event.rule;
|
|
66
|
+
if (!m || !isRuleGroup(m)) {
|
|
67
67
|
r.addIssue({
|
|
68
68
|
code: "custom",
|
|
69
69
|
path: ["campaign", "event", "rule"],
|
|
@@ -87,7 +87,7 @@ function campaignRefinement(e, r) {
|
|
|
87
87
|
break;
|
|
88
88
|
}
|
|
89
89
|
case "CREDIT": {
|
|
90
|
-
const l = (
|
|
90
|
+
const l = (d = o.config) == null ? void 0 : d.validityOption;
|
|
91
91
|
(!l || ["validForDay", "validBefore"].every((a) => l[a] == null)) && r.addIssue({
|
|
92
92
|
code: "custom",
|
|
93
93
|
path: ["campaign", "config", "validityOption"],
|
|
@@ -107,7 +107,7 @@ function campaignRefinement(e, r) {
|
|
|
107
107
|
i18n: "connectZodCustom:campaign.reward_threshold_range"
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
-
}), (
|
|
110
|
+
}), (p = o.config) != null && p.validityOption.followFirstReceive || r.addIssue({
|
|
111
111
|
code: "custom",
|
|
112
112
|
path: ["campaign", "config", "validityOption"],
|
|
113
113
|
params: {
|
|
@@ -116,7 +116,7 @@ function campaignRefinement(e, r) {
|
|
|
116
116
|
}));
|
|
117
117
|
break;
|
|
118
118
|
case "SCHEDULE": {
|
|
119
|
-
if (!
|
|
119
|
+
if (!m.rules.g_schedule) {
|
|
120
120
|
r.addIssue({
|
|
121
121
|
code: "custom",
|
|
122
122
|
path: ["campaign", "event", "rule"],
|
|
@@ -128,7 +128,7 @@ function campaignRefinement(e, r) {
|
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
const l = RuleBuilder.getRules(
|
|
131
|
-
|
|
131
|
+
m.rules.g_schedule
|
|
132
132
|
), n = [
|
|
133
133
|
{
|
|
134
134
|
property: "trigger.date",
|
|
@@ -139,9 +139,9 @@ function campaignRefinement(e, r) {
|
|
|
139
139
|
operator: ["_isOnTime"]
|
|
140
140
|
}
|
|
141
141
|
];
|
|
142
|
-
n.length == l.length && n.every((
|
|
143
|
-
const f = RuleBuilder.simplify(
|
|
144
|
-
return f.property ===
|
|
142
|
+
n.length == l.length && n.every((u) => l.some((y) => {
|
|
143
|
+
const f = RuleBuilder.simplify(y);
|
|
144
|
+
return f.property === u.property && u.operator.includes(f.operator);
|
|
145
145
|
})) || r.addIssue({
|
|
146
146
|
code: "custom",
|
|
147
147
|
path: ["campaign", "event", "rule"],
|
|
@@ -166,20 +166,20 @@ function campaignRefinement(e, r) {
|
|
|
166
166
|
function campaignTransform(e) {
|
|
167
167
|
var o;
|
|
168
168
|
if (e.campaign.type === "VOUCHER" && "configs" in e) {
|
|
169
|
-
const
|
|
170
|
-
|
|
171
|
-
const
|
|
169
|
+
const m = e.configs;
|
|
170
|
+
m.extras.targetLocation = e.campaign.targetLocation;
|
|
171
|
+
const d = Math.max(
|
|
172
172
|
e.campaign.earningOption.amount,
|
|
173
|
-
|
|
173
|
+
m.options.maxUse ?? 1
|
|
174
174
|
);
|
|
175
|
-
e.campaign.earningOption.amount =
|
|
175
|
+
e.campaign.earningOption.amount = d, m.options.maxUse = d, e.campaign.earningOption = {
|
|
176
176
|
type: "FIXED",
|
|
177
177
|
amount: 1
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
if (e.campaign.type == "MISSION" && "configs" in e) {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const m = e.configs;
|
|
182
|
+
m.options.validityOption = (o = e.campaign.config) == null ? void 0 : o.validityOption;
|
|
183
183
|
}
|
|
184
184
|
const r = e.campaign.event;
|
|
185
185
|
return r.type != "BILL_COMPLETED" && r.rule && isRuleGroup(r.rule) && (r.rule = RuleBuilder.removeEntry(r.rule, "g_bill"), e.campaign.event = r), r.rule && isRuleGroup(r.rule) && (r.rule = stripRruleDtstartExceptSchedule(r.rule), e.campaign.event = r), e;
|
|
@@ -282,14 +282,14 @@ function summarizeGrabDiscount(e) {
|
|
|
282
282
|
case "order":
|
|
283
283
|
return "Bill discount";
|
|
284
284
|
case "items":
|
|
285
|
-
return l.type.startsWith("bundle") ?
|
|
285
|
+
return l.type.startsWith("bundle") ? m(l.type) : "Item discount";
|
|
286
286
|
case "categories":
|
|
287
287
|
return "Category discount";
|
|
288
288
|
default:
|
|
289
289
|
return "Discount";
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
function
|
|
292
|
+
function m(l) {
|
|
293
293
|
switch (l) {
|
|
294
294
|
case "bundleSameFixPrice":
|
|
295
295
|
return "Bundle (same item) - Fixed price";
|
|
@@ -307,7 +307,7 @@ function summarizeGrabDiscount(e) {
|
|
|
307
307
|
return "Bundle discount";
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function d(l) {
|
|
311
311
|
switch (l.type) {
|
|
312
312
|
case "percentage":
|
|
313
313
|
case "bundleSamePercentage":
|
|
@@ -328,19 +328,19 @@ function summarizeGrabDiscount(e) {
|
|
|
328
328
|
return `${r}${l.value} discount`;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
-
function
|
|
331
|
+
function p(l) {
|
|
332
332
|
return l.cap && l.cap > 0 ? `capped at ${r}${l.cap}` : null;
|
|
333
333
|
}
|
|
334
334
|
return {
|
|
335
335
|
type: o(e),
|
|
336
|
-
adjustment:
|
|
337
|
-
cap:
|
|
336
|
+
adjustment: d(e),
|
|
337
|
+
cap: p(e)
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
|
-
const _hoisted_1$
|
|
340
|
+
const _hoisted_1$s = {
|
|
341
341
|
key: 0,
|
|
342
342
|
class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
|
|
343
|
-
}, _hoisted_2$
|
|
343
|
+
}, _hoisted_2$o = { class: "flex items-center justify-between" }, _hoisted_3$l = { class: "flex items-center gap-8" }, _hoisted_4$l = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 p-16" }, _hoisted_5$i = { class: "flex justify-end gap-8 pt-8 border-t border-fm-color-neutral-gray-200" }, _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
344
344
|
__name: "GrabItemSelectionInline",
|
|
345
345
|
props: {
|
|
346
346
|
visible: { type: Boolean },
|
|
@@ -349,34 +349,34 @@ const _hoisted_1$r = {
|
|
|
349
349
|
},
|
|
350
350
|
emits: ["confirm", "cancel"],
|
|
351
351
|
setup(e, { emit: r }) {
|
|
352
|
-
const o = e,
|
|
352
|
+
const o = e, m = r, d = ref();
|
|
353
353
|
watch(
|
|
354
354
|
() => o.visible,
|
|
355
355
|
(a) => {
|
|
356
|
-
var
|
|
357
|
-
!a &&
|
|
356
|
+
var u, y;
|
|
357
|
+
!a && d.value && ((y = (u = d.value).setSelectedItems) == null || y.call(u, o.initialValue || []));
|
|
358
358
|
}
|
|
359
359
|
);
|
|
360
|
-
function
|
|
360
|
+
function p() {
|
|
361
361
|
var a;
|
|
362
|
-
(a =
|
|
362
|
+
(a = d.value) == null || a.onConfirm();
|
|
363
363
|
}
|
|
364
364
|
function l() {
|
|
365
|
-
|
|
365
|
+
m("cancel");
|
|
366
366
|
}
|
|
367
367
|
function n(a) {
|
|
368
|
-
|
|
368
|
+
m("confirm", a);
|
|
369
369
|
}
|
|
370
|
-
return (a,
|
|
371
|
-
const
|
|
372
|
-
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
373
|
-
createElementVNode("div", _hoisted_2$
|
|
374
|
-
createElementVNode("div", _hoisted_3$
|
|
375
|
-
createVNode(
|
|
370
|
+
return (a, u) => {
|
|
371
|
+
const y = resolveComponent("FmIcon"), f = resolveComponent("FmButton");
|
|
372
|
+
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
373
|
+
createElementVNode("div", _hoisted_2$o, [
|
|
374
|
+
createElementVNode("div", _hoisted_3$l, [
|
|
375
|
+
createVNode(y, {
|
|
376
376
|
name: "restaurant",
|
|
377
377
|
size: "md"
|
|
378
378
|
}),
|
|
379
|
-
|
|
379
|
+
u[0] || (u[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
|
|
380
380
|
]),
|
|
381
381
|
createVNode(f, {
|
|
382
382
|
icon: "close",
|
|
@@ -384,18 +384,18 @@ const _hoisted_1$r = {
|
|
|
384
384
|
onClick: l
|
|
385
385
|
})
|
|
386
386
|
]),
|
|
387
|
-
|
|
388
|
-
createElementVNode("div", _hoisted_4$
|
|
387
|
+
u[1] || (u[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. For bundle discounts, select multiple items that can be bundled together. ", -1)),
|
|
388
|
+
createElementVNode("div", _hoisted_4$l, [
|
|
389
389
|
createVNode(unref(S6), {
|
|
390
390
|
ref_key: "selectItemRef",
|
|
391
|
-
ref:
|
|
391
|
+
ref: d,
|
|
392
392
|
"initial-value": e.initialValue,
|
|
393
393
|
"filter-items": e.filterItems,
|
|
394
394
|
"on-complete": n,
|
|
395
395
|
"max-height": 300
|
|
396
396
|
}, null, 8, ["initial-value", "filter-items"])
|
|
397
397
|
]),
|
|
398
|
-
createElementVNode("div", _hoisted_5$
|
|
398
|
+
createElementVNode("div", _hoisted_5$i, [
|
|
399
399
|
createVNode(f, {
|
|
400
400
|
variant: "secondary",
|
|
401
401
|
label: "Cancel",
|
|
@@ -404,19 +404,19 @@ const _hoisted_1$r = {
|
|
|
404
404
|
createVNode(f, {
|
|
405
405
|
variant: "primary",
|
|
406
406
|
label: "Confirm Selection",
|
|
407
|
-
onClick:
|
|
407
|
+
onClick: p
|
|
408
408
|
})
|
|
409
409
|
])
|
|
410
410
|
])) : createCommentVNode("", !0);
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
-
}), _hoisted_1$
|
|
413
|
+
}), _hoisted_1$r = {
|
|
414
414
|
key: 0,
|
|
415
415
|
class: "bg-fm-color-neutral-gray-50 border border-fm-color-neutral-gray-200 rounded-8 p-16 space-y-16"
|
|
416
|
-
}, _hoisted_2$
|
|
416
|
+
}, _hoisted_2$n = { class: "flex items-center justify-between" }, _hoisted_3$k = { class: "flex items-center gap-8" }, _hoisted_4$k = { class: "flex gap-16 items-center flex-wrap" }, _hoisted_5$h = { class: "flex gap-8 items-center" }, _hoisted_6$d = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_7$b = { class: "bg-white border border-fm-color-neutral-gray-200 rounded-8 max-h-[300px] overflow-y-auto" }, _hoisted_8$a = { 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 = {
|
|
417
417
|
key: 1,
|
|
418
418
|
class: "p-24 text-center"
|
|
419
|
-
}, _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$
|
|
419
|
+
}, _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$t = /* @__PURE__ */ defineComponent({
|
|
420
420
|
__name: "GrabCategorySelectionInline",
|
|
421
421
|
props: {
|
|
422
422
|
visible: { type: Boolean },
|
|
@@ -424,99 +424,99 @@ const _hoisted_1$r = {
|
|
|
424
424
|
},
|
|
425
425
|
emits: ["confirm", "cancel"],
|
|
426
426
|
setup(e, { emit: r }) {
|
|
427
|
-
const o = e,
|
|
428
|
-
const
|
|
429
|
-
return
|
|
430
|
-
id:
|
|
431
|
-
name:
|
|
427
|
+
const o = e, m = r, d = Zh(), p = ref({}), l = ref(""), n = computed(() => {
|
|
428
|
+
const i = d.menu.value;
|
|
429
|
+
return i ? i.modules.category.map((c) => ({
|
|
430
|
+
id: c._id,
|
|
431
|
+
name: c.name
|
|
432
432
|
})) : [];
|
|
433
433
|
}), a = computed(() => {
|
|
434
434
|
if (!l.value) return n.value;
|
|
435
|
-
const
|
|
435
|
+
const i = l.value.toLowerCase();
|
|
436
436
|
return n.value.filter(
|
|
437
|
-
(
|
|
437
|
+
(c) => c.name.toLowerCase().includes(i)
|
|
438
438
|
);
|
|
439
|
-
}),
|
|
440
|
-
function
|
|
441
|
-
|
|
442
|
-
(
|
|
439
|
+
}), u = computed(() => Object.values(p.value).filter(Boolean).length);
|
|
440
|
+
function y() {
|
|
441
|
+
p.value = n.value.reduce(
|
|
442
|
+
(i, c) => (i[c.id] = o.initialValue.includes(c.id), i),
|
|
443
443
|
{}
|
|
444
444
|
);
|
|
445
445
|
}
|
|
446
446
|
watch([() => o.visible, () => o.initialValue], () => {
|
|
447
|
-
o.visible &&
|
|
447
|
+
o.visible && y();
|
|
448
448
|
}), onMounted(async () => {
|
|
449
|
-
await
|
|
449
|
+
await d.store.getMenu(), y();
|
|
450
450
|
});
|
|
451
|
-
function f(
|
|
452
|
-
|
|
451
|
+
function f(i) {
|
|
452
|
+
p.value[i] = !p.value[i];
|
|
453
453
|
}
|
|
454
|
-
function
|
|
455
|
-
const
|
|
456
|
-
a.value.forEach((
|
|
457
|
-
|
|
454
|
+
function s() {
|
|
455
|
+
const i = u.value === a.value.length;
|
|
456
|
+
a.value.forEach((c) => {
|
|
457
|
+
p.value[c.id] = !i;
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
|
-
function
|
|
461
|
-
Object.keys(
|
|
462
|
-
|
|
460
|
+
function k() {
|
|
461
|
+
Object.keys(p.value).forEach((i) => {
|
|
462
|
+
p.value[i] = !1;
|
|
463
463
|
});
|
|
464
464
|
}
|
|
465
465
|
function x() {
|
|
466
|
-
const
|
|
467
|
-
|
|
466
|
+
const i = Object.entries(p.value).filter(([, c]) => c).map(([c]) => c);
|
|
467
|
+
m("confirm", i);
|
|
468
468
|
}
|
|
469
|
-
function
|
|
470
|
-
|
|
469
|
+
function h() {
|
|
470
|
+
m("cancel");
|
|
471
471
|
}
|
|
472
472
|
const v = computed(() => a.value.length > 0 && a.value.every(
|
|
473
|
-
(
|
|
473
|
+
(i) => p.value[i.id]
|
|
474
474
|
));
|
|
475
|
-
return (
|
|
475
|
+
return (i, c) => {
|
|
476
476
|
const C = resolveComponent("FmIcon"), V = resolveComponent("FmButton"), $ = resolveComponent("FmTextField"), S = resolveComponent("FmCheckbox"), w = resolveComponent("FmListItem"), R = resolveComponent("FmList");
|
|
477
|
-
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
478
|
-
createElementVNode("div", _hoisted_2$
|
|
479
|
-
createElementVNode("div", _hoisted_3$
|
|
477
|
+
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$r, [
|
|
478
|
+
createElementVNode("div", _hoisted_2$n, [
|
|
479
|
+
createElementVNode("div", _hoisted_3$k, [
|
|
480
480
|
createVNode(C, {
|
|
481
481
|
name: "category",
|
|
482
482
|
size: "md"
|
|
483
483
|
}),
|
|
484
|
-
|
|
484
|
+
c[2] || (c[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
|
|
485
485
|
]),
|
|
486
486
|
createVNode(V, {
|
|
487
487
|
icon: "close",
|
|
488
488
|
variant: "tertiary",
|
|
489
|
-
onClick:
|
|
489
|
+
onClick: h
|
|
490
490
|
})
|
|
491
491
|
]),
|
|
492
|
-
|
|
493
|
-
createElementVNode("div", _hoisted_4$
|
|
494
|
-
createElementVNode("div", _hoisted_5$
|
|
492
|
+
c[3] || (c[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)),
|
|
493
|
+
createElementVNode("div", _hoisted_4$k, [
|
|
494
|
+
createElementVNode("div", _hoisted_5$h, [
|
|
495
495
|
createVNode(V, {
|
|
496
496
|
icon: "select_all",
|
|
497
497
|
variant: "tertiary",
|
|
498
498
|
size: "small",
|
|
499
499
|
label: `${v.value ? "Deselect" : "Select"} All`,
|
|
500
|
-
onClick:
|
|
500
|
+
onClick: s
|
|
501
501
|
}, null, 8, ["label"]),
|
|
502
502
|
createVNode(V, {
|
|
503
503
|
icon: "sync",
|
|
504
504
|
variant: "tertiary",
|
|
505
505
|
size: "small",
|
|
506
506
|
label: "Clear",
|
|
507
|
-
onClick:
|
|
507
|
+
onClick: k
|
|
508
508
|
}),
|
|
509
|
-
createElementVNode("span", _hoisted_6$
|
|
509
|
+
createElementVNode("span", _hoisted_6$d, toDisplayString(u.value) + " selected ", 1)
|
|
510
510
|
]),
|
|
511
511
|
createVNode($, {
|
|
512
512
|
modelValue: l.value,
|
|
513
|
-
"onUpdate:modelValue":
|
|
513
|
+
"onUpdate:modelValue": c[0] || (c[0] = (F) => l.value = F),
|
|
514
514
|
placeholder: "Search categories",
|
|
515
515
|
"leading-icon": { name: "search", color: "" },
|
|
516
516
|
class: "flex-1 min-w-[200px]"
|
|
517
517
|
}, null, 8, ["modelValue"])
|
|
518
518
|
]),
|
|
519
|
-
createElementVNode("div", _hoisted_7$
|
|
519
|
+
createElementVNode("div", _hoisted_7$b, [
|
|
520
520
|
a.value.length > 0 ? (openBlock(), createBlock(R, { key: 0 }, {
|
|
521
521
|
default: withCtx(() => [
|
|
522
522
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (F) => (openBlock(), createBlock(w, {
|
|
@@ -526,15 +526,15 @@ const _hoisted_1$r = {
|
|
|
526
526
|
}, {
|
|
527
527
|
leading: withCtx(() => [
|
|
528
528
|
createVNode(S, {
|
|
529
|
-
"model-value":
|
|
529
|
+
"model-value": p.value[F.id] || !1,
|
|
530
530
|
value: F.id,
|
|
531
531
|
"onUpdate:modelValue": (M) => f(F.id),
|
|
532
|
-
onClick:
|
|
532
|
+
onClick: c[1] || (c[1] = withModifiers(() => {
|
|
533
533
|
}, ["stop"]))
|
|
534
534
|
}, null, 8, ["model-value", "value", "onUpdate:modelValue"])
|
|
535
535
|
]),
|
|
536
536
|
default: withCtx(() => [
|
|
537
|
-
createElementVNode("div", _hoisted_8$
|
|
537
|
+
createElementVNode("div", _hoisted_8$a, [
|
|
538
538
|
createVNode(C, {
|
|
539
539
|
name: "category",
|
|
540
540
|
size: "sm",
|
|
@@ -558,32 +558,32 @@ const _hoisted_1$r = {
|
|
|
558
558
|
createVNode(V, {
|
|
559
559
|
variant: "secondary",
|
|
560
560
|
label: "Cancel",
|
|
561
|
-
onClick:
|
|
561
|
+
onClick: h
|
|
562
562
|
}),
|
|
563
563
|
createVNode(V, {
|
|
564
564
|
variant: "primary",
|
|
565
|
-
label: `Confirm Selection (${
|
|
566
|
-
disabled:
|
|
565
|
+
label: `Confirm Selection (${u.value})`,
|
|
566
|
+
disabled: u.value === 0,
|
|
567
567
|
onClick: x
|
|
568
568
|
}, null, 8, ["label", "disabled"])
|
|
569
569
|
])
|
|
570
570
|
])) : createCommentVNode("", !0);
|
|
571
571
|
};
|
|
572
572
|
}
|
|
573
|
-
}), _hoisted_1$
|
|
573
|
+
}), _hoisted_1$q = { class: "space-y-8" }, _hoisted_2$m = {
|
|
574
574
|
key: 1,
|
|
575
575
|
class: "border-1 rounded-md flex gap-16 items-center justify-between px-16 py-12"
|
|
576
|
-
}, _hoisted_3$
|
|
576
|
+
}, _hoisted_3$j = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$j = { class: "text-fm-color-typo-secondary" }, _hoisted_5$g = { key: 0 }, _hoisted_6$c = { class: "space-y-24" }, _hoisted_7$a = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$9 = { 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 = {
|
|
577
577
|
key: 0,
|
|
578
578
|
class: "mt-16 p-12 bg-fm-color-feedback-error-light rounded-8 border border-fm-color-feedback-error-main"
|
|
579
|
-
}, _hoisted_24$1 = { class: "flex items-center gap-8 mb-8 text-fm-color-system-error-300" }, _hoisted_25$1 = { class: "space-y-4" }, _hoisted_26$1 = { class: "flex gap-16" }, _sfc_main$
|
|
579
|
+
}, _hoisted_24$1 = { class: "flex items-center gap-8 mb-8 text-fm-color-system-error-300" }, _hoisted_25$1 = { class: "space-y-4" }, _hoisted_26$1 = { class: "flex gap-16" }, _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
580
580
|
__name: "GrabEffectSheet",
|
|
581
581
|
props: {
|
|
582
582
|
modelValue: { type: Object }
|
|
583
583
|
},
|
|
584
584
|
emits: ["update:model-value"],
|
|
585
585
|
setup(e, { emit: r }) {
|
|
586
|
-
const o = e,
|
|
586
|
+
const o = e, m = r, d = Zh(), p = ref(!1), l = ref(!1), n = ref(!1), a = ref({
|
|
587
587
|
type: "net",
|
|
588
588
|
value: 0,
|
|
589
589
|
scope: {
|
|
@@ -592,71 +592,71 @@ const _hoisted_1$r = {
|
|
|
592
592
|
});
|
|
593
593
|
watch(
|
|
594
594
|
() => o.modelValue,
|
|
595
|
-
(
|
|
596
|
-
|
|
595
|
+
(b) => {
|
|
596
|
+
b && (a.value = { ...b });
|
|
597
597
|
},
|
|
598
598
|
{ immediate: !0 }
|
|
599
599
|
), onMounted(async () => {
|
|
600
|
-
await
|
|
600
|
+
await d.store.getMenu();
|
|
601
601
|
});
|
|
602
|
-
const
|
|
603
|
-
var
|
|
604
|
-
return !(!a.value.type || !((
|
|
602
|
+
const u = computed(() => {
|
|
603
|
+
var b;
|
|
604
|
+
return !(!a.value.type || !((b = a.value.scope) != null && b.type) || s(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));
|
|
605
605
|
});
|
|
606
|
-
async function
|
|
607
|
-
|
|
606
|
+
async function y(b) {
|
|
607
|
+
b.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && m("update:model-value", null);
|
|
608
608
|
}
|
|
609
609
|
function f() {
|
|
610
|
-
var
|
|
611
|
-
return C(((
|
|
610
|
+
var b;
|
|
611
|
+
return C(((b = a.value.scope) == null ? void 0 : b.type) || "order");
|
|
612
612
|
}
|
|
613
|
-
function
|
|
614
|
-
return
|
|
613
|
+
function s(b) {
|
|
614
|
+
return b && !["freeItem", "delivery"].includes(b);
|
|
615
615
|
}
|
|
616
|
-
function b
|
|
617
|
-
return
|
|
618
|
-
|
|
616
|
+
function k(b) {
|
|
617
|
+
return b && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
|
|
618
|
+
b
|
|
619
619
|
);
|
|
620
620
|
}
|
|
621
|
-
function x(
|
|
622
|
-
return
|
|
621
|
+
function x(b) {
|
|
622
|
+
return b != null && b.includes("Percentage") ? "Discount percentage" : b != null && b.includes("FixPrice") ? "Bundle fixed price" : b === "percentage" ? "Discount percentage" : "Discount amount";
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
return
|
|
624
|
+
function h(b) {
|
|
625
|
+
return b != null && b.includes("Percentage") || b === "percentage" ? "10" : "5.00";
|
|
626
626
|
}
|
|
627
|
-
function v(
|
|
628
|
-
return
|
|
627
|
+
function v(b) {
|
|
628
|
+
return b != null && b.includes("Percentage") || b === "percentage" ? "%" : "$";
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function i(b, B) {
|
|
631
631
|
a.value = {
|
|
632
632
|
...a.value,
|
|
633
|
-
[
|
|
633
|
+
[b]: B
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
var
|
|
636
|
+
function c(b, B) {
|
|
637
|
+
var O;
|
|
638
638
|
const D = {
|
|
639
639
|
...a.value.scope,
|
|
640
|
-
[
|
|
640
|
+
[b]: B
|
|
641
641
|
};
|
|
642
642
|
if (a.value = {
|
|
643
643
|
...a.value,
|
|
644
644
|
scope: D
|
|
645
|
-
},
|
|
646
|
-
const
|
|
647
|
-
|
|
645
|
+
}, b === "type") {
|
|
646
|
+
const A = C(B);
|
|
647
|
+
A.some(
|
|
648
648
|
(j) => j.value === a.value.type
|
|
649
649
|
) || (a.value = {
|
|
650
650
|
...a.value,
|
|
651
|
-
type: ((
|
|
651
|
+
type: ((O = A[0]) == null ? void 0 : O.value) || "net",
|
|
652
652
|
// Reset value and cap when changing to incompatible type
|
|
653
653
|
value: 0,
|
|
654
654
|
cap: void 0
|
|
655
655
|
});
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
function C(
|
|
659
|
-
switch (
|
|
658
|
+
function C(b) {
|
|
659
|
+
switch (b) {
|
|
660
660
|
case "order":
|
|
661
661
|
return [
|
|
662
662
|
{ label: "Amount off", value: "net" },
|
|
@@ -702,8 +702,8 @@ const _hoisted_1$r = {
|
|
|
702
702
|
];
|
|
703
703
|
}
|
|
704
704
|
}
|
|
705
|
-
function V(
|
|
706
|
-
switch (
|
|
705
|
+
function V(b) {
|
|
706
|
+
switch (b) {
|
|
707
707
|
case "order":
|
|
708
708
|
return "Applies to entire order. Available: Amount off, Percentage off, Delivery fee discount.";
|
|
709
709
|
case "category":
|
|
@@ -715,34 +715,34 @@ const _hoisted_1$r = {
|
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
717
|
function $() {
|
|
718
|
-
var
|
|
719
|
-
return ((
|
|
718
|
+
var b;
|
|
719
|
+
return ((b = a.value.scope) == null ? void 0 : b.type) === "items";
|
|
720
720
|
}
|
|
721
721
|
function S() {
|
|
722
|
-
var
|
|
723
|
-
return ((
|
|
722
|
+
var b;
|
|
723
|
+
return ((b = a.value.scope) == null ? void 0 : b.type) === "category";
|
|
724
724
|
}
|
|
725
725
|
function w() {
|
|
726
726
|
var D;
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
727
|
+
const b = (D = a.value.scope) == null ? void 0 : D.objectIDs;
|
|
728
|
+
if (!b || b.length === 0)
|
|
729
729
|
return "No items selected";
|
|
730
|
-
const B =
|
|
731
|
-
return B &&
|
|
732
|
-
const P = B.modules.item.find((j) => j._id ===
|
|
733
|
-
return P ? (P.name2 || P.name).trim() : `Item ${
|
|
734
|
-
}).join(", ") :
|
|
730
|
+
const B = d.menu.value;
|
|
731
|
+
return B && b.length <= 3 ? b.map((A) => {
|
|
732
|
+
const P = B.modules.item.find((j) => j._id === A);
|
|
733
|
+
return P ? (P.name2 || P.name).trim() : `Item ${A}`;
|
|
734
|
+
}).join(", ") : b.length === 1 ? "1 item selected" : `${b.length} items selected`;
|
|
735
735
|
}
|
|
736
736
|
function R() {
|
|
737
737
|
var D;
|
|
738
|
-
const
|
|
739
|
-
if (!
|
|
738
|
+
const b = (D = a.value.scope) == null ? void 0 : D.objectIDs;
|
|
739
|
+
if (!b || b.length === 0)
|
|
740
740
|
return "No categories selected";
|
|
741
|
-
const B =
|
|
742
|
-
return B &&
|
|
743
|
-
const P = B.modules.category.find((j) => j._id ===
|
|
744
|
-
return P ? P.name : `Category ${
|
|
745
|
-
}).join(", ") :
|
|
741
|
+
const B = d.menu.value;
|
|
742
|
+
return B && b.length <= 3 ? b.map((A) => {
|
|
743
|
+
const P = B.modules.category.find((j) => j._id === A);
|
|
744
|
+
return P ? P.name : `Category ${A}`;
|
|
745
|
+
}).join(", ") : b.length === 1 ? "1 category selected" : `${b.length} categories selected`;
|
|
746
746
|
}
|
|
747
747
|
function F() {
|
|
748
748
|
l.value = !0;
|
|
@@ -750,11 +750,11 @@ const _hoisted_1$r = {
|
|
|
750
750
|
function M() {
|
|
751
751
|
n.value = !0;
|
|
752
752
|
}
|
|
753
|
-
function H(
|
|
754
|
-
|
|
753
|
+
function H(b) {
|
|
754
|
+
c("objectIDs", b), l.value = !1;
|
|
755
755
|
}
|
|
756
|
-
function I(
|
|
757
|
-
|
|
756
|
+
function I(b) {
|
|
757
|
+
c("objectIDs", b), n.value = !1;
|
|
758
758
|
}
|
|
759
759
|
function X() {
|
|
760
760
|
l.value = !1;
|
|
@@ -763,47 +763,47 @@ const _hoisted_1$r = {
|
|
|
763
763
|
n.value = !1;
|
|
764
764
|
}
|
|
765
765
|
const Z = computed(() => {
|
|
766
|
-
var B, D,
|
|
767
|
-
const
|
|
768
|
-
return a.value.type ||
|
|
766
|
+
var B, D, O;
|
|
767
|
+
const b = [];
|
|
768
|
+
return a.value.type || b.push("Discount type is required"), (B = a.value.scope) != null && B.type || b.push("Scope type is required"), s(a.value.type) && (!a.value.value || a.value.value <= 0) && b.push("Discount amount must be greater than 0"), ((D = a.value.scope) == null ? void 0 : D.type) === "items" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one item"), ((O = a.value.scope) == null ? void 0 : O.type) === "category" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one category"), b;
|
|
769
769
|
});
|
|
770
770
|
function J() {
|
|
771
|
-
|
|
771
|
+
m("update:model-value", a.value), p.value = !1;
|
|
772
772
|
}
|
|
773
773
|
const W = [
|
|
774
774
|
{ label: "Bill discount", value: "order" },
|
|
775
775
|
{ label: "Item discount", value: "items" },
|
|
776
776
|
{ label: "Category discount", value: "category" }
|
|
777
777
|
];
|
|
778
|
-
return (
|
|
779
|
-
const D = resolveComponent("FmButton"),
|
|
778
|
+
return (b, B) => {
|
|
779
|
+
const D = resolveComponent("FmButton"), O = resolveComponent("FmSelect"), A = resolveComponent("FmStepperField"), P = resolveComponent("FmIcon"), j = resolveComponent("FmSideSheet");
|
|
780
780
|
return openBlock(), createBlock(j, {
|
|
781
781
|
"max-width": 550,
|
|
782
782
|
header: "Apply discount",
|
|
783
|
-
modelValue: unref(
|
|
783
|
+
modelValue: unref(p),
|
|
784
784
|
"onUpdate:modelValue": [
|
|
785
|
-
B[5] || (B[5] = (U) => isRef(
|
|
786
|
-
B[6] || (B[6] = (U) =>
|
|
785
|
+
B[5] || (B[5] = (U) => isRef(p) ? p.value = U : null),
|
|
786
|
+
B[6] || (B[6] = (U) => p.value = U)
|
|
787
787
|
]
|
|
788
788
|
}, {
|
|
789
789
|
"side-sheet-button": withCtx(() => {
|
|
790
790
|
var U, G, Y, q;
|
|
791
791
|
return [
|
|
792
|
-
createElementVNode("div", _hoisted_1$
|
|
792
|
+
createElementVNode("div", _hoisted_1$q, [
|
|
793
793
|
B[7] || (B[7] = createElementVNode("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the Grab campaign discount you want to offer your customers. ", -1)),
|
|
794
|
-
e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
795
|
-
createElementVNode("div", _hoisted_3$
|
|
794
|
+
e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$m, [
|
|
795
|
+
createElementVNode("div", _hoisted_3$j, [
|
|
796
796
|
createElementVNode("div", null, toDisplayString((U = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : U.type), 1),
|
|
797
|
-
createElementVNode("div", _hoisted_4$
|
|
797
|
+
createElementVNode("div", _hoisted_4$j, [
|
|
798
798
|
createTextVNode(toDisplayString((G = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : G.adjustment) + " ", 1),
|
|
799
|
-
(Y = unref(summarizeGrabDiscount)(e.modelValue)) != null && Y.cap ? (openBlock(), createElementBlock("span", _hoisted_5$
|
|
799
|
+
(Y = unref(summarizeGrabDiscount)(e.modelValue)) != null && Y.cap ? (openBlock(), createElementBlock("span", _hoisted_5$g, toDisplayString((q = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : q.cap), 1)) : createCommentVNode("", !0)
|
|
800
800
|
])
|
|
801
801
|
]),
|
|
802
802
|
createVNode(D, {
|
|
803
803
|
icon: "delete",
|
|
804
804
|
"icon-color": "neutral-gray-400",
|
|
805
805
|
variant: "tertiary",
|
|
806
|
-
onClick:
|
|
806
|
+
onClick: y
|
|
807
807
|
})
|
|
808
808
|
])) : (openBlock(), createBlock(D, {
|
|
809
809
|
key: 0,
|
|
@@ -822,13 +822,13 @@ const _hoisted_1$r = {
|
|
|
822
822
|
variant: "secondary",
|
|
823
823
|
label: "Cancel",
|
|
824
824
|
class: "flex-1",
|
|
825
|
-
onClick: B[4] || (B[4] = (U) =>
|
|
825
|
+
onClick: B[4] || (B[4] = (U) => p.value = !1)
|
|
826
826
|
}),
|
|
827
827
|
createVNode(D, {
|
|
828
828
|
variant: "primary",
|
|
829
|
-
label: unref(
|
|
829
|
+
label: unref(u) ? "Confirm" : "Complete Required Fields",
|
|
830
830
|
class: "flex-1",
|
|
831
|
-
disabled: !unref(
|
|
831
|
+
disabled: !unref(u),
|
|
832
832
|
onClick: J
|
|
833
833
|
}, null, 8, ["label", "disabled"])
|
|
834
834
|
])
|
|
@@ -836,41 +836,41 @@ const _hoisted_1$r = {
|
|
|
836
836
|
default: withCtx(() => {
|
|
837
837
|
var U, G, Y, q;
|
|
838
838
|
return [
|
|
839
|
-
createElementVNode("div", _hoisted_6$
|
|
839
|
+
createElementVNode("div", _hoisted_6$c, [
|
|
840
840
|
createElementVNode("div", null, [
|
|
841
841
|
B[8] || (B[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
|
|
842
|
-
createVNode(
|
|
842
|
+
createVNode(O, {
|
|
843
843
|
"model-value": ((U = unref(a).scope) == null ? void 0 : U.type) || "order",
|
|
844
|
-
"onUpdate:modelValue": B[0] || (B[0] = (
|
|
844
|
+
"onUpdate:modelValue": B[0] || (B[0] = (g) => c("type", g)),
|
|
845
845
|
placeholder: "Select campaign type",
|
|
846
846
|
items: W
|
|
847
847
|
}, null, 8, ["model-value"]),
|
|
848
|
-
createElementVNode("div", _hoisted_7$
|
|
848
|
+
createElementVNode("div", _hoisted_7$a, toDisplayString(V((G = unref(a).scope) == null ? void 0 : G.type)), 1)
|
|
849
849
|
]),
|
|
850
850
|
createElementVNode("div", null, [
|
|
851
851
|
B[9] || (B[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
|
|
852
|
-
createVNode(
|
|
852
|
+
createVNode(O, {
|
|
853
853
|
"model-value": unref(a).type,
|
|
854
|
-
"onUpdate:modelValue": B[1] || (B[1] = (
|
|
854
|
+
"onUpdate:modelValue": B[1] || (B[1] = (g) => i("type", g)),
|
|
855
855
|
placeholder: "Select discount type",
|
|
856
856
|
items: f()
|
|
857
857
|
}, null, 8, ["model-value", "items"])
|
|
858
858
|
]),
|
|
859
|
-
|
|
859
|
+
s(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_8$9, [
|
|
860
860
|
createElementVNode("label", _hoisted_9$8, toDisplayString(x(unref(a).type)), 1),
|
|
861
|
-
createVNode(
|
|
861
|
+
createVNode(A, {
|
|
862
862
|
modelValue: unref(a).value,
|
|
863
|
-
"onUpdate:modelValue": B[2] || (B[2] = (
|
|
864
|
-
placeholder:
|
|
863
|
+
"onUpdate:modelValue": B[2] || (B[2] = (g) => unref(a).value = g),
|
|
864
|
+
placeholder: h(unref(a).type),
|
|
865
865
|
suffix: v(unref(a).type),
|
|
866
866
|
type: "number"
|
|
867
867
|
}, null, 8, ["modelValue", "placeholder", "suffix"])
|
|
868
868
|
])) : createCommentVNode("", !0),
|
|
869
|
-
|
|
869
|
+
k(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_10$7, [
|
|
870
870
|
B[10] || (B[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
|
|
871
|
-
createVNode(
|
|
871
|
+
createVNode(A, {
|
|
872
872
|
modelValue: unref(a).cap,
|
|
873
|
-
"onUpdate:modelValue": B[3] || (B[3] = (
|
|
873
|
+
"onUpdate:modelValue": B[3] || (B[3] = (g) => unref(a).cap = g),
|
|
874
874
|
placeholder: "Maximum discount amount",
|
|
875
875
|
type: "number"
|
|
876
876
|
}, null, 8, ["modelValue"])
|
|
@@ -897,7 +897,7 @@ const _hoisted_1$r = {
|
|
|
897
897
|
B[11] || (B[11] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. Bundle discounts require multiple items. ", -1))
|
|
898
898
|
])
|
|
899
899
|
])),
|
|
900
|
-
createVNode(_sfc_main$
|
|
900
|
+
createVNode(_sfc_main$u, {
|
|
901
901
|
visible: unref(l),
|
|
902
902
|
"initial-value": ((Y = unref(a).scope) == null ? void 0 : Y.objectIDs) || [],
|
|
903
903
|
onConfirm: H,
|
|
@@ -926,7 +926,7 @@ const _hoisted_1$r = {
|
|
|
926
926
|
B[13] || (B[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
|
|
927
927
|
])
|
|
928
928
|
])),
|
|
929
|
-
createVNode(_sfc_main$
|
|
929
|
+
createVNode(_sfc_main$t, {
|
|
930
930
|
visible: unref(n),
|
|
931
931
|
"initial-value": ((q = unref(a).scope) == null ? void 0 : q.objectIDs) || [],
|
|
932
932
|
onConfirm: I,
|
|
@@ -940,12 +940,12 @@ const _hoisted_1$r = {
|
|
|
940
940
|
B[15] || (B[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
|
|
941
941
|
]),
|
|
942
942
|
createElementVNode("ul", _hoisted_25$1, [
|
|
943
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(Z), (
|
|
944
|
-
key:
|
|
943
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(Z), (g) => (openBlock(), createElementBlock("li", {
|
|
944
|
+
key: g,
|
|
945
945
|
class: "fm-typo-en-body-sm-400 text-fm-color-feedback-error-main flex items-start gap-8"
|
|
946
946
|
}, [
|
|
947
947
|
B[16] || (B[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
|
|
948
|
-
createTextVNode(" " + toDisplayString(
|
|
948
|
+
createTextVNode(" " + toDisplayString(g), 1)
|
|
949
949
|
]))), 128))
|
|
950
950
|
])
|
|
951
951
|
])) : createCommentVNode("", !0)
|
|
@@ -955,7 +955,7 @@ const _hoisted_1$r = {
|
|
|
955
955
|
}, 8, ["modelValue"]);
|
|
956
956
|
};
|
|
957
957
|
}
|
|
958
|
-
}), GrabEffectSheet = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
958
|
+
}), GrabEffectSheet = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-cf604dd7"]]), _hoisted_1$p = { class: "space-y-24" }, _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
959
959
|
__name: "TimeRuleGroup",
|
|
960
960
|
props: {
|
|
961
961
|
modelValue: {
|
|
@@ -966,43 +966,43 @@ const _hoisted_1$r = {
|
|
|
966
966
|
},
|
|
967
967
|
emits: ["update:model-value"],
|
|
968
968
|
setup(e, { emit: r }) {
|
|
969
|
-
const { t: o } = useI18n(),
|
|
970
|
-
!
|
|
969
|
+
const { t: o } = useI18n(), m = e, d = r, p = ref(
|
|
970
|
+
!m.modelValue || !m.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(m.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
971
971
|
);
|
|
972
|
-
watch(
|
|
973
|
-
var
|
|
974
|
-
if (a == "custom" && n == "all_time" && RuleBuilder.getRules((
|
|
975
|
-
const
|
|
972
|
+
watch(p, async (n, a) => {
|
|
973
|
+
var u;
|
|
974
|
+
if (a == "custom" && n == "all_time" && RuleBuilder.getRules((u = m.modelValue) == null ? void 0 : u.rules.g_time).length > 0) {
|
|
975
|
+
const y = await prompt.confirm(
|
|
976
976
|
o("connect.template.rule.time.confirm_remove"),
|
|
977
977
|
o("connect.common.confirm"),
|
|
978
978
|
o("connect.common.confirm"),
|
|
979
979
|
o("connect.common.cancel")
|
|
980
980
|
);
|
|
981
|
-
|
|
981
|
+
y && d(
|
|
982
982
|
"update:model-value",
|
|
983
983
|
RuleBuilder.setRuleToGroup(
|
|
984
|
-
|
|
984
|
+
m.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
985
985
|
RuleBuilder.scaffoldGroup("g_time")
|
|
986
986
|
)
|
|
987
|
-
),
|
|
987
|
+
), p.value = y ? n : a;
|
|
988
988
|
}
|
|
989
989
|
});
|
|
990
990
|
async function l(n) {
|
|
991
991
|
var a;
|
|
992
|
-
if (n == "custom" && RuleBuilder.getRules((a =
|
|
992
|
+
if (n == "custom" && RuleBuilder.getRules((a = m.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
993
993
|
if (!await prompt.confirm(
|
|
994
994
|
o("connect.template.rule.time.confirm_remove"),
|
|
995
995
|
o("connect.common.confirm"),
|
|
996
996
|
o("connect.common.confirm"),
|
|
997
997
|
o("connect.common.cancel")
|
|
998
998
|
)) {
|
|
999
|
-
|
|
999
|
+
p.value = "all_time";
|
|
1000
1000
|
return;
|
|
1001
1001
|
}
|
|
1002
|
-
|
|
1002
|
+
d(
|
|
1003
1003
|
"update:model-value",
|
|
1004
1004
|
RuleBuilder.setRuleToGroup(
|
|
1005
|
-
|
|
1005
|
+
m.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
1006
1006
|
RuleBuilder.scaffoldGroup("g_time")
|
|
1007
1007
|
)
|
|
1008
1008
|
);
|
|
@@ -1010,38 +1010,38 @@ const _hoisted_1$r = {
|
|
|
1010
1010
|
}
|
|
1011
1011
|
return (n, a) => {
|
|
1012
1012
|
var f;
|
|
1013
|
-
const
|
|
1014
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1015
|
-
createVNode(
|
|
1016
|
-
modelValue: unref(
|
|
1013
|
+
const u = resolveComponent("FmRadio"), y = resolveComponent("FmRadioGroup");
|
|
1014
|
+
return openBlock(), createElementBlock("div", _hoisted_1$p, [
|
|
1015
|
+
createVNode(y, {
|
|
1016
|
+
modelValue: unref(p),
|
|
1017
1017
|
"onUpdate:modelValue": [
|
|
1018
|
-
a[0] || (a[0] = (
|
|
1019
|
-
a[1] || (a[1] = (
|
|
1018
|
+
a[0] || (a[0] = (s) => isRef(p) ? p.value = s : null),
|
|
1019
|
+
a[1] || (a[1] = (s) => l(s))
|
|
1020
1020
|
]
|
|
1021
1021
|
}, {
|
|
1022
1022
|
default: withCtx(() => [
|
|
1023
|
-
createVNode(
|
|
1023
|
+
createVNode(u, {
|
|
1024
1024
|
label: unref(o)("connect.template.rule.time.all_time"),
|
|
1025
1025
|
value: "all_time"
|
|
1026
1026
|
}, null, 8, ["label"]),
|
|
1027
|
-
createVNode(
|
|
1027
|
+
createVNode(u, {
|
|
1028
1028
|
label: unref(o)("connect.template.rule.time.custom"),
|
|
1029
1029
|
value: "custom"
|
|
1030
1030
|
}, null, 8, ["label"])
|
|
1031
1031
|
]),
|
|
1032
1032
|
_: 1
|
|
1033
1033
|
}, 8, ["modelValue"]),
|
|
1034
|
-
unref(
|
|
1034
|
+
unref(p) == "custom" ? (openBlock(), createBlock(_sfc_main$v, {
|
|
1035
1035
|
key: 0,
|
|
1036
1036
|
class: "!mt-[0px]",
|
|
1037
1037
|
"include-only": "trigger",
|
|
1038
1038
|
"trigger-type": "SCHEDULE",
|
|
1039
1039
|
"model-value": ((f = e.modelValue) == null ? void 0 : f.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
1040
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
1040
|
+
"onUpdate:modelValue": a[2] || (a[2] = (s) => d(
|
|
1041
1041
|
"update:model-value",
|
|
1042
1042
|
unref(RuleBuilder).setRuleToGroup(
|
|
1043
1043
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
1044
|
-
|
|
1044
|
+
s,
|
|
1045
1045
|
"&&"
|
|
1046
1046
|
)
|
|
1047
1047
|
))
|
|
@@ -1049,7 +1049,7 @@ const _hoisted_1$r = {
|
|
|
1049
1049
|
]);
|
|
1050
1050
|
};
|
|
1051
1051
|
}
|
|
1052
|
-
}), _sfc_main$
|
|
1052
|
+
}), _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
1053
1053
|
__name: "BirthdayInput",
|
|
1054
1054
|
props: {
|
|
1055
1055
|
modelValue: {
|
|
@@ -1058,9 +1058,9 @@ const _hoisted_1$r = {
|
|
|
1058
1058
|
},
|
|
1059
1059
|
emits: ["update:model-value"],
|
|
1060
1060
|
setup(e, { emit: r }) {
|
|
1061
|
-
const { t: o } = useI18n(),
|
|
1061
|
+
const { t: o } = useI18n(), m = e, d = r, p = computed(() => {
|
|
1062
1062
|
const { property: l, operator: n, equator: a } = RuleBuilder.simplify(
|
|
1063
|
-
|
|
1063
|
+
m.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
1064
1064
|
op: "before",
|
|
1065
1065
|
x: 1
|
|
1066
1066
|
})
|
|
@@ -1072,14 +1072,14 @@ const _hoisted_1$r = {
|
|
|
1072
1072
|
};
|
|
1073
1073
|
});
|
|
1074
1074
|
return (l, n) => {
|
|
1075
|
-
const a = resolveComponent("FmRadio"),
|
|
1075
|
+
const a = resolveComponent("FmRadio"), u = resolveComponent("FmStepperField");
|
|
1076
1076
|
return openBlock(), createElementBlock("div", null, [
|
|
1077
1077
|
createVNode(a, {
|
|
1078
1078
|
label: unref(o)("connect.template.rule.birthday.on_birthday"),
|
|
1079
1079
|
value: "_isRange-day",
|
|
1080
|
-
"model-value": `${unref(
|
|
1080
|
+
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
1081
1081
|
"onUpdate:modelValue": n[0] || (n[0] = () => {
|
|
1082
|
-
|
|
1082
|
+
d(
|
|
1083
1083
|
"update:model-value",
|
|
1084
1084
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
1085
1085
|
op: "this",
|
|
@@ -1092,9 +1092,9 @@ const _hoisted_1$r = {
|
|
|
1092
1092
|
createVNode(a, {
|
|
1093
1093
|
label: unref(o)("connect.template.rule.birthday.days_before"),
|
|
1094
1094
|
value: "_isDay",
|
|
1095
|
-
"model-value": unref(
|
|
1095
|
+
"model-value": unref(p).operator,
|
|
1096
1096
|
"onUpdate:modelValue": n[1] || (n[1] = () => {
|
|
1097
|
-
|
|
1097
|
+
d(
|
|
1098
1098
|
"update:model-value",
|
|
1099
1099
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
1100
1100
|
op: "after",
|
|
@@ -1104,16 +1104,16 @@ const _hoisted_1$r = {
|
|
|
1104
1104
|
);
|
|
1105
1105
|
})
|
|
1106
1106
|
}, null, 8, ["label", "model-value"]),
|
|
1107
|
-
unref(
|
|
1107
|
+
unref(p).operator == "_isDay" ? (openBlock(), createBlock(u, {
|
|
1108
1108
|
key: 0,
|
|
1109
1109
|
label: unref(o)("connect.template.rule.birthday.days_before_label"),
|
|
1110
1110
|
"show-steppers": !1,
|
|
1111
|
-
"model-value": unref(
|
|
1112
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
1111
|
+
"model-value": unref(p).equator.x,
|
|
1112
|
+
"onUpdate:modelValue": n[2] || (n[2] = (y) => d(
|
|
1113
1113
|
"update:model-value",
|
|
1114
1114
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
1115
1115
|
op: "after",
|
|
1116
|
-
x:
|
|
1116
|
+
x: y,
|
|
1117
1117
|
ignoreYear: !0
|
|
1118
1118
|
})
|
|
1119
1119
|
))
|
|
@@ -1121,9 +1121,9 @@ const _hoisted_1$r = {
|
|
|
1121
1121
|
createVNode(a, {
|
|
1122
1122
|
label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
|
|
1123
1123
|
value: "_isRange-week",
|
|
1124
|
-
"model-value": `${unref(
|
|
1124
|
+
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
1125
1125
|
"onUpdate:modelValue": n[3] || (n[3] = () => {
|
|
1126
|
-
|
|
1126
|
+
d(
|
|
1127
1127
|
"update:model-value",
|
|
1128
1128
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
1129
1129
|
op: "this",
|
|
@@ -1136,9 +1136,9 @@ const _hoisted_1$r = {
|
|
|
1136
1136
|
createVNode(a, {
|
|
1137
1137
|
label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
|
|
1138
1138
|
value: "_isRange-month",
|
|
1139
|
-
"model-value": `${unref(
|
|
1139
|
+
"model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
|
|
1140
1140
|
"onUpdate:modelValue": n[4] || (n[4] = () => {
|
|
1141
|
-
|
|
1141
|
+
d(
|
|
1142
1142
|
"update:model-value",
|
|
1143
1143
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
1144
1144
|
op: "this",
|
|
@@ -1151,7 +1151,7 @@ const _hoisted_1$r = {
|
|
|
1151
1151
|
]);
|
|
1152
1152
|
};
|
|
1153
1153
|
}
|
|
1154
|
-
}), _hoisted_1$
|
|
1154
|
+
}), _hoisted_1$o = { class: "space-y-16" }, _hoisted_2$l = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$i = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$i = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$f = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
1155
1155
|
__name: "CampaignTriggerInput",
|
|
1156
1156
|
props: {
|
|
1157
1157
|
campaignType: {
|
|
@@ -1168,30 +1168,30 @@ const _hoisted_1$r = {
|
|
|
1168
1168
|
},
|
|
1169
1169
|
emits: ["update:model-value"],
|
|
1170
1170
|
setup(e, { emit: r }) {
|
|
1171
|
-
const { t: o } = useI18n(),
|
|
1172
|
-
(l) => l.value ==
|
|
1173
|
-
) : TypeToTriggerOptions[
|
|
1171
|
+
const { t: o } = useI18n(), m = e, d = r, p = computed(() => m.disabled ? TypeToTriggerOptions[m.campaignType].filter(
|
|
1172
|
+
(l) => l.value == m.modelValue
|
|
1173
|
+
) : TypeToTriggerOptions[m.campaignType]);
|
|
1174
1174
|
return (l, n) => {
|
|
1175
1175
|
const a = resolveComponent("FmCard");
|
|
1176
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1177
|
-
createElementVNode("div", _hoisted_2$
|
|
1178
|
-
createElementVNode("div", _hoisted_3$
|
|
1179
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1176
|
+
return openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
1177
|
+
createElementVNode("div", _hoisted_2$l, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
|
|
1178
|
+
createElementVNode("div", _hoisted_3$i, [
|
|
1179
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (u) => (openBlock(), createBlock(a, {
|
|
1180
1180
|
variant: "outlined",
|
|
1181
|
-
disabled:
|
|
1181
|
+
disabled: m.disabled,
|
|
1182
1182
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1183
|
-
"col-span-3": unref(
|
|
1184
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1185
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1183
|
+
"col-span-3": unref(p).length == 1,
|
|
1184
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == u.value,
|
|
1185
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != u.value
|
|
1186
1186
|
}]),
|
|
1187
1187
|
onClick: () => {
|
|
1188
|
-
|
|
1188
|
+
m.modelValue != u.value && !m.disabled && d("update:model-value", u.value);
|
|
1189
1189
|
},
|
|
1190
|
-
key:
|
|
1190
|
+
key: u.name
|
|
1191
1191
|
}, {
|
|
1192
1192
|
default: withCtx(() => [
|
|
1193
|
-
createElementVNode("div", _hoisted_4$
|
|
1194
|
-
createElementVNode("div", _hoisted_5$
|
|
1193
|
+
createElementVNode("div", _hoisted_4$i, toDisplayString(u.name), 1),
|
|
1194
|
+
createElementVNode("div", _hoisted_5$f, toDisplayString(u.description), 1)
|
|
1195
1195
|
]),
|
|
1196
1196
|
_: 2
|
|
1197
1197
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -1199,7 +1199,7 @@ const _hoisted_1$r = {
|
|
|
1199
1199
|
]);
|
|
1200
1200
|
};
|
|
1201
1201
|
}
|
|
1202
|
-
}), _sfc_main$
|
|
1202
|
+
}), _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
1203
1203
|
__name: "DateInput",
|
|
1204
1204
|
props: {
|
|
1205
1205
|
label: {
|
|
@@ -1214,12 +1214,12 @@ const _hoisted_1$r = {
|
|
|
1214
1214
|
emits: ["update:model-value"],
|
|
1215
1215
|
setup(e, { emit: r }) {
|
|
1216
1216
|
const o = r;
|
|
1217
|
-
return (
|
|
1218
|
-
const
|
|
1217
|
+
return (m, d) => {
|
|
1218
|
+
const p = resolveComponent("FmButton"), l = resolveComponent("FmField"), n = resolveComponent("FmDatePicker");
|
|
1219
1219
|
return openBlock(), createBlock(n, {
|
|
1220
1220
|
label: e.label,
|
|
1221
1221
|
"model-value": e.modelValue || "",
|
|
1222
|
-
"onUpdate:modelValue":
|
|
1222
|
+
"onUpdate:modelValue": d[1] || (d[1] = (a) => o("update:model-value", a))
|
|
1223
1223
|
}, {
|
|
1224
1224
|
"trigger-button": withCtx(({ opened: a }) => [
|
|
1225
1225
|
createVNode(l, {
|
|
@@ -1228,11 +1228,11 @@ const _hoisted_1$r = {
|
|
|
1228
1228
|
"icon-outlined": !a
|
|
1229
1229
|
}, {
|
|
1230
1230
|
append: withCtx(() => [
|
|
1231
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
1231
|
+
e.modelValue ? (openBlock(), createBlock(p, {
|
|
1232
1232
|
key: 0,
|
|
1233
1233
|
variant: "tertiary",
|
|
1234
1234
|
icon: "clear",
|
|
1235
|
-
onClick:
|
|
1235
|
+
onClick: d[0] || (d[0] = (u) => (u.stopPropagation(), o("update:model-value", null)))
|
|
1236
1236
|
})) : createCommentVNode("", !0)
|
|
1237
1237
|
]),
|
|
1238
1238
|
default: withCtx(() => [
|
|
@@ -1247,7 +1247,7 @@ const _hoisted_1$r = {
|
|
|
1247
1247
|
}, 8, ["label", "model-value"]);
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
|
-
}), _hoisted_1$
|
|
1250
|
+
}), _hoisted_1$n = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$k = { class: "flex-1 xs:w-full" }, _hoisted_3$h = { class: "mt-5 xs:hidden" }, _hoisted_4$h = { class: "flex-1 xs:w-full" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
1251
1251
|
__name: "DateRangeInput",
|
|
1252
1252
|
props: {
|
|
1253
1253
|
modelValue: {
|
|
@@ -1257,32 +1257,32 @@ const _hoisted_1$r = {
|
|
|
1257
1257
|
},
|
|
1258
1258
|
emits: ["update:model-value"],
|
|
1259
1259
|
setup(e, { emit: r }) {
|
|
1260
|
-
const { t: o } = useI18n(),
|
|
1261
|
-
return (
|
|
1260
|
+
const { t: o } = useI18n(), m = r;
|
|
1261
|
+
return (d, p) => {
|
|
1262
1262
|
var l, n;
|
|
1263
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1264
|
-
createElementVNode("div", _hoisted_2$
|
|
1265
|
-
createVNode(_sfc_main$
|
|
1263
|
+
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
1264
|
+
createElementVNode("div", _hoisted_2$k, [
|
|
1265
|
+
createVNode(_sfc_main$o, {
|
|
1266
1266
|
"model-value": ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
|
|
1267
1267
|
label: unref(o)("connect.common.startDate"),
|
|
1268
|
-
"onUpdate:modelValue":
|
|
1269
|
-
var
|
|
1270
|
-
return
|
|
1268
|
+
"onUpdate:modelValue": p[0] || (p[0] = (a) => {
|
|
1269
|
+
var u;
|
|
1270
|
+
return m("update:model-value", {
|
|
1271
1271
|
startDate: a,
|
|
1272
|
-
endDate: ((
|
|
1272
|
+
endDate: ((u = e.modelValue) == null ? void 0 : u.endDate) ?? null
|
|
1273
1273
|
});
|
|
1274
1274
|
})
|
|
1275
1275
|
}, null, 8, ["model-value", "label"])
|
|
1276
1276
|
]),
|
|
1277
|
-
createElementVNode("div", _hoisted_3$
|
|
1278
|
-
createElementVNode("div", _hoisted_4$
|
|
1279
|
-
createVNode(_sfc_main$
|
|
1277
|
+
createElementVNode("div", _hoisted_3$h, toDisplayString(unref(o)("connect.common.to")), 1),
|
|
1278
|
+
createElementVNode("div", _hoisted_4$h, [
|
|
1279
|
+
createVNode(_sfc_main$o, {
|
|
1280
1280
|
"model-value": ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null,
|
|
1281
1281
|
label: unref(o)("connect.common.endDate"),
|
|
1282
|
-
"onUpdate:modelValue":
|
|
1283
|
-
var
|
|
1284
|
-
return
|
|
1285
|
-
startDate: ((
|
|
1282
|
+
"onUpdate:modelValue": p[1] || (p[1] = (a) => {
|
|
1283
|
+
var u;
|
|
1284
|
+
return m("update:model-value", {
|
|
1285
|
+
startDate: ((u = e.modelValue) == null ? void 0 : u.startDate) ?? null,
|
|
1286
1286
|
endDate: a
|
|
1287
1287
|
});
|
|
1288
1288
|
})
|
|
@@ -1291,7 +1291,7 @@ const _hoisted_1$r = {
|
|
|
1291
1291
|
]);
|
|
1292
1292
|
};
|
|
1293
1293
|
}
|
|
1294
|
-
}), _hoisted_1$
|
|
1294
|
+
}), _hoisted_1$m = { class: "flex flex-col gap-16" }, _hoisted_2$j = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$g = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$g = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$e = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$b = { class: "flex items-center justify-between gap-8" }, _hoisted_7$9 = { class: "fm-typo-en-body-lg-400" }, _hoisted_8$8 = { 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$m = /* @__PURE__ */ defineComponent({
|
|
1295
1295
|
__name: "AppInboxInput",
|
|
1296
1296
|
props: {
|
|
1297
1297
|
modelValue: {
|
|
@@ -1310,75 +1310,75 @@ const _hoisted_1$r = {
|
|
|
1310
1310
|
},
|
|
1311
1311
|
emits: ["update:model-value"],
|
|
1312
1312
|
setup(e, { emit: r }) {
|
|
1313
|
-
const { t: o } = useI18n(),
|
|
1314
|
-
function
|
|
1315
|
-
|
|
1313
|
+
const { t: o } = useI18n(), m = e, d = r;
|
|
1314
|
+
function p(k) {
|
|
1315
|
+
d("update:model-value", { ...m.modelValue, ...k });
|
|
1316
1316
|
}
|
|
1317
|
-
function l(
|
|
1318
|
-
return
|
|
1317
|
+
function l(k, x) {
|
|
1318
|
+
return k >= x ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
1319
1319
|
}
|
|
1320
|
-
const n = computed(() =>
|
|
1321
|
-
var
|
|
1322
|
-
return ((
|
|
1320
|
+
const n = computed(() => m.modelValue.buttons ?? []), a = computed(() => {
|
|
1321
|
+
var k;
|
|
1322
|
+
return ((k = m.modelValue.content) == null ? void 0 : k.length) ?? 0;
|
|
1323
1323
|
});
|
|
1324
|
-
function
|
|
1325
|
-
|
|
1324
|
+
function u(k, x) {
|
|
1325
|
+
p({
|
|
1326
1326
|
buttons: n.value.map(
|
|
1327
|
-
(
|
|
1327
|
+
(h, v) => v === k ? { ...h, ...x } : h
|
|
1328
1328
|
)
|
|
1329
1329
|
});
|
|
1330
1330
|
}
|
|
1331
|
-
function
|
|
1332
|
-
n.value.length >= MAX_BUTTONS ||
|
|
1331
|
+
function y() {
|
|
1332
|
+
n.value.length >= MAX_BUTTONS || p({ buttons: [...n.value, { label: "", url: "" }] });
|
|
1333
1333
|
}
|
|
1334
|
-
function f(
|
|
1334
|
+
function f(k) {
|
|
1335
1335
|
var v;
|
|
1336
|
-
if (!
|
|
1337
|
-
const x = (v =
|
|
1338
|
-
let
|
|
1339
|
-
return x ? FdoBroadcastUrl.safeParse(x).success || (
|
|
1340
|
-
label:
|
|
1341
|
-
url:
|
|
1336
|
+
if (!m.showValidation) return { label: void 0, url: void 0 };
|
|
1337
|
+
const x = (v = k.url) == null ? void 0 : v.trim();
|
|
1338
|
+
let h;
|
|
1339
|
+
return x ? FdoBroadcastUrl.safeParse(x).success || (h = o("connect.campaign.push.linkUrlInvalid")) : h = o("connect.campaign.appInbox.buttonUrlRequired"), {
|
|
1340
|
+
label: k.label.trim() ? void 0 : o("connect.campaign.appInbox.buttonLabelRequired"),
|
|
1341
|
+
url: h
|
|
1342
1342
|
};
|
|
1343
1343
|
}
|
|
1344
|
-
function
|
|
1345
|
-
|
|
1344
|
+
function s(k) {
|
|
1345
|
+
p({ buttons: n.value.filter((x, h) => h !== k) });
|
|
1346
1346
|
}
|
|
1347
|
-
return (
|
|
1348
|
-
const
|
|
1349
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1347
|
+
return (k, x) => {
|
|
1348
|
+
const h = resolveComponent("FmTextField"), v = resolveComponent("FmButton");
|
|
1349
|
+
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
1350
1350
|
createElementVNode("div", null, [
|
|
1351
|
-
createElementVNode("div", _hoisted_2$
|
|
1352
|
-
createElementVNode("span", _hoisted_3$
|
|
1351
|
+
createElementVNode("div", _hoisted_2$j, [
|
|
1352
|
+
createElementVNode("span", _hoisted_3$g, toDisplayString(unref(o)("connect.campaign.appInbox.title")), 1),
|
|
1353
1353
|
createElementVNode("span", {
|
|
1354
1354
|
class: normalizeClass(["fm-typo-en-body-sm-400", l(e.modelValue.title.length, TITLE_WARN_AT$1)])
|
|
1355
1355
|
}, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT$1), 3)
|
|
1356
1356
|
]),
|
|
1357
|
-
createVNode(
|
|
1357
|
+
createVNode(h, {
|
|
1358
1358
|
"model-value": e.modelValue.title,
|
|
1359
1359
|
"max-length": TITLE_LIMIT$1,
|
|
1360
1360
|
placeholder: unref(o)("connect.campaign.appInbox.titlePlaceholder"),
|
|
1361
|
-
"onUpdate:modelValue": x[0] || (x[0] = (
|
|
1361
|
+
"onUpdate:modelValue": x[0] || (x[0] = (i) => p({ title: i }))
|
|
1362
1362
|
}, null, 8, ["model-value", "placeholder"])
|
|
1363
1363
|
]),
|
|
1364
1364
|
createElementVNode("div", null, [
|
|
1365
|
-
createElementVNode("div", _hoisted_4$
|
|
1366
|
-
createElementVNode("span", _hoisted_5$
|
|
1365
|
+
createElementVNode("div", _hoisted_4$g, [
|
|
1366
|
+
createElementVNode("span", _hoisted_5$e, toDisplayString(unref(o)("connect.campaign.appInbox.previewText")), 1),
|
|
1367
1367
|
createElementVNode("span", {
|
|
1368
1368
|
class: normalizeClass(["fm-typo-en-body-sm-400", l(e.modelValue.previewText.length, PREVIEW_WARN_AT)])
|
|
1369
1369
|
}, toDisplayString(e.modelValue.previewText.length) + " / " + toDisplayString(PREVIEW_LIMIT), 3)
|
|
1370
1370
|
]),
|
|
1371
|
-
createVNode(
|
|
1371
|
+
createVNode(h, {
|
|
1372
1372
|
"model-value": e.modelValue.previewText,
|
|
1373
1373
|
"max-length": PREVIEW_LIMIT,
|
|
1374
1374
|
placeholder: unref(o)("connect.campaign.appInbox.previewTextPlaceholder"),
|
|
1375
|
-
"onUpdate:modelValue": x[1] || (x[1] = (
|
|
1375
|
+
"onUpdate:modelValue": x[1] || (x[1] = (i) => p({ previewText: i }))
|
|
1376
1376
|
}, null, 8, ["model-value", "placeholder"])
|
|
1377
1377
|
]),
|
|
1378
|
-
createElementVNode("div", _hoisted_6$
|
|
1378
|
+
createElementVNode("div", _hoisted_6$b, [
|
|
1379
1379
|
createElementVNode("div", null, [
|
|
1380
|
-
createElementVNode("div", _hoisted_7$
|
|
1381
|
-
createElementVNode("div", _hoisted_8$
|
|
1380
|
+
createElementVNode("div", _hoisted_7$9, toDisplayString(unref(o)("connect.campaign.appInbox.bodyMessage")), 1),
|
|
1381
|
+
createElementVNode("div", _hoisted_8$8, toDisplayString(unref(o)("connect.campaign.appInbox.bodyMessageDescription")), 1),
|
|
1382
1382
|
createElementVNode("div", {
|
|
1383
1383
|
class: normalizeClass([
|
|
1384
1384
|
"mt-[2px] fm-typo-en-body-sm-400",
|
|
@@ -1386,12 +1386,12 @@ const _hoisted_1$r = {
|
|
|
1386
1386
|
])
|
|
1387
1387
|
}, toDisplayString(unref(a)) + " / " + toDisplayString(unref(APP_INBOX_BODY_LIMIT)), 3)
|
|
1388
1388
|
]),
|
|
1389
|
-
createVNode(_sfc_main$
|
|
1389
|
+
createVNode(_sfc_main$w, {
|
|
1390
1390
|
html: e.modelValue.content,
|
|
1391
1391
|
variables: e.variables,
|
|
1392
1392
|
"media-limit": 1,
|
|
1393
1393
|
"button-label": unref(o)("connect.campaign.appInbox.editBodyMessage"),
|
|
1394
|
-
"onUpdate:html": x[2] || (x[2] = (
|
|
1394
|
+
"onUpdate:html": x[2] || (x[2] = (i) => p({ content: i.html }))
|
|
1395
1395
|
}, null, 8, ["html", "variables", "button-label"])
|
|
1396
1396
|
]),
|
|
1397
1397
|
createElementVNode("div", _hoisted_9$7, [
|
|
@@ -1399,35 +1399,35 @@ const _hoisted_1$r = {
|
|
|
1399
1399
|
createElementVNode("span", _hoisted_11$4, toDisplayString(unref(o)("connect.campaign.appInbox.buttons")), 1),
|
|
1400
1400
|
createElementVNode("span", _hoisted_12$3, toDisplayString(unref(n).length) + " / " + toDisplayString(MAX_BUTTONS), 1)
|
|
1401
1401
|
]),
|
|
1402
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (
|
|
1403
|
-
key:
|
|
1402
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (i, c) => (openBlock(), createElementBlock("div", {
|
|
1403
|
+
key: c,
|
|
1404
1404
|
class: "flex flex-wrap items-start gap-8"
|
|
1405
1405
|
}, [
|
|
1406
1406
|
createElementVNode("div", _hoisted_13$3, [
|
|
1407
|
-
createVNode(
|
|
1408
|
-
"model-value":
|
|
1407
|
+
createVNode(h, {
|
|
1408
|
+
"model-value": i.label,
|
|
1409
1409
|
"max-length": 20,
|
|
1410
1410
|
placeholder: unref(o)("connect.campaign.appInbox.buttonLabel"),
|
|
1411
|
-
"helper-state": f(
|
|
1412
|
-
"helper-text": f(
|
|
1413
|
-
"onUpdate:modelValue": (C) =>
|
|
1411
|
+
"helper-state": f(i).label ? "error" : "none",
|
|
1412
|
+
"helper-text": f(i).label,
|
|
1413
|
+
"onUpdate:modelValue": (C) => u(c, { label: C })
|
|
1414
1414
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
1415
1415
|
]),
|
|
1416
1416
|
createElementVNode("div", _hoisted_14$3, [
|
|
1417
|
-
createVNode(
|
|
1418
|
-
"model-value":
|
|
1417
|
+
createVNode(h, {
|
|
1418
|
+
"model-value": i.url ?? "",
|
|
1419
1419
|
inputmode: "url",
|
|
1420
1420
|
placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
|
|
1421
|
-
"helper-state": f(
|
|
1422
|
-
"helper-text": f(
|
|
1423
|
-
"onUpdate:modelValue": (C) =>
|
|
1421
|
+
"helper-state": f(i).url ? "error" : "none",
|
|
1422
|
+
"helper-text": f(i).url,
|
|
1423
|
+
"onUpdate:modelValue": (C) => u(c, { url: C.trim() })
|
|
1424
1424
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
1425
1425
|
]),
|
|
1426
1426
|
createVNode(v, {
|
|
1427
1427
|
icon: "delete",
|
|
1428
1428
|
"icon-color": "neutral-gray-400",
|
|
1429
1429
|
variant: "tertiary",
|
|
1430
|
-
onClick: (C) => c
|
|
1430
|
+
onClick: (C) => s(c)
|
|
1431
1431
|
}, null, 8, ["onClick"])
|
|
1432
1432
|
]))), 128)),
|
|
1433
1433
|
unref(n).length < MAX_BUTTONS ? (openBlock(), createBlock(v, {
|
|
@@ -1435,19 +1435,19 @@ const _hoisted_1$r = {
|
|
|
1435
1435
|
variant: "tertiary",
|
|
1436
1436
|
icon: "add",
|
|
1437
1437
|
label: unref(o)("connect.campaign.appInbox.addButton"),
|
|
1438
|
-
onClick:
|
|
1438
|
+
onClick: y
|
|
1439
1439
|
}, null, 8, ["label"])) : createCommentVNode("", !0)
|
|
1440
1440
|
])
|
|
1441
1441
|
]);
|
|
1442
1442
|
};
|
|
1443
1443
|
}
|
|
1444
|
-
}), _hoisted_1$
|
|
1444
|
+
}), _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$f = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$d = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$a = { class: "mb-[6px] fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_7$8 = {
|
|
1445
1445
|
key: 0,
|
|
1446
1446
|
class: "mt-4 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1447
|
-
}, _hoisted_8$
|
|
1447
|
+
}, _hoisted_8$7 = {
|
|
1448
1448
|
key: 1,
|
|
1449
1449
|
class: "mt-12"
|
|
1450
|
-
}, _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$
|
|
1450
|
+
}, _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$l = /* @__PURE__ */ defineComponent({
|
|
1451
1451
|
__name: "PushInput",
|
|
1452
1452
|
props: {
|
|
1453
1453
|
modelValue: {
|
|
@@ -1462,83 +1462,83 @@ const _hoisted_1$r = {
|
|
|
1462
1462
|
},
|
|
1463
1463
|
emits: ["update:model-value"],
|
|
1464
1464
|
setup(e, { emit: r }) {
|
|
1465
|
-
const { t: o } = useI18n(),
|
|
1466
|
-
var
|
|
1467
|
-
if (!
|
|
1468
|
-
const f = (
|
|
1465
|
+
const { t: o } = useI18n(), m = e, d = r, p = F_PUSH_DESTINATION.options, l = computed(() => m.modelValue.destination === "EXTERNAL"), n = computed(() => {
|
|
1466
|
+
var s;
|
|
1467
|
+
if (!m.showValidation || !l.value) return;
|
|
1468
|
+
const f = (s = m.modelValue.url) == null ? void 0 : s.trim();
|
|
1469
1469
|
return f ? FdoBroadcastUrl.safeParse(f).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.push.linkUrlRequired");
|
|
1470
1470
|
});
|
|
1471
1471
|
function a(f) {
|
|
1472
|
-
|
|
1472
|
+
d("update:model-value", { ...m.modelValue, ...f });
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function u(f) {
|
|
1475
1475
|
a(f === "EXTERNAL" ? { destination: f } : { destination: f, url: null });
|
|
1476
1476
|
}
|
|
1477
|
-
function
|
|
1478
|
-
return f >=
|
|
1477
|
+
function y(f, s) {
|
|
1478
|
+
return f >= s ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
1479
1479
|
}
|
|
1480
|
-
return (f,
|
|
1481
|
-
const
|
|
1482
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1480
|
+
return (f, s) => {
|
|
1481
|
+
const k = resolveComponent("FmTextField"), x = resolveComponent("FmTextarea"), h = resolveComponent("FmSelect");
|
|
1482
|
+
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
1483
1483
|
createElementVNode("div", null, [
|
|
1484
|
-
createElementVNode("div", _hoisted_2$
|
|
1485
|
-
createElementVNode("span", _hoisted_3$
|
|
1484
|
+
createElementVNode("div", _hoisted_2$i, [
|
|
1485
|
+
createElementVNode("span", _hoisted_3$f, toDisplayString(unref(o)("connect.campaign.push.title")), 1),
|
|
1486
1486
|
createElementVNode("span", {
|
|
1487
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
1487
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", y(e.modelValue.title.length, TITLE_WARN_AT)])
|
|
1488
1488
|
}, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT), 3)
|
|
1489
1489
|
]),
|
|
1490
|
-
createVNode(
|
|
1490
|
+
createVNode(k, {
|
|
1491
1491
|
"model-value": e.modelValue.title,
|
|
1492
1492
|
"max-length": TITLE_LIMIT,
|
|
1493
1493
|
placeholder: unref(o)("connect.campaign.push.titlePlaceholder"),
|
|
1494
|
-
"onUpdate:modelValue":
|
|
1494
|
+
"onUpdate:modelValue": s[0] || (s[0] = (v) => a({ title: v }))
|
|
1495
1495
|
}, null, 8, ["model-value", "placeholder"])
|
|
1496
1496
|
]),
|
|
1497
1497
|
createElementVNode("div", null, [
|
|
1498
|
-
createElementVNode("div", _hoisted_4$
|
|
1499
|
-
createElementVNode("span", _hoisted_5$
|
|
1498
|
+
createElementVNode("div", _hoisted_4$f, [
|
|
1499
|
+
createElementVNode("span", _hoisted_5$d, toDisplayString(unref(o)("connect.campaign.push.body")), 1),
|
|
1500
1500
|
createElementVNode("span", {
|
|
1501
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
1501
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", y(e.modelValue.body.length, BODY_WARN_AT)])
|
|
1502
1502
|
}, toDisplayString(e.modelValue.body.length) + " / " + toDisplayString(BODY_LIMIT), 3)
|
|
1503
1503
|
]),
|
|
1504
1504
|
createVNode(x, {
|
|
1505
1505
|
"model-value": e.modelValue.body,
|
|
1506
1506
|
"max-length": BODY_LIMIT,
|
|
1507
1507
|
placeholder: unref(o)("connect.campaign.push.bodyPlaceholder"),
|
|
1508
|
-
"onUpdate:modelValue":
|
|
1508
|
+
"onUpdate:modelValue": s[1] || (s[1] = (v) => a({ body: v }))
|
|
1509
1509
|
}, null, 8, ["model-value", "placeholder"])
|
|
1510
1510
|
]),
|
|
1511
1511
|
createElementVNode("div", null, [
|
|
1512
|
-
createElementVNode("div", _hoisted_6$
|
|
1513
|
-
createVNode(
|
|
1512
|
+
createElementVNode("div", _hoisted_6$a, toDisplayString(unref(o)("connect.campaign.push.link")), 1),
|
|
1513
|
+
createVNode(h, {
|
|
1514
1514
|
"model-value": e.modelValue.destination ?? "NONE",
|
|
1515
|
-
items: unref(
|
|
1515
|
+
items: unref(p).map((v) => ({
|
|
1516
1516
|
label: unref(o)(`connect.campaign.appInbox.destination.${v}`),
|
|
1517
1517
|
value: v
|
|
1518
1518
|
})),
|
|
1519
|
-
"onUpdate:modelValue":
|
|
1519
|
+
"onUpdate:modelValue": s[2] || (s[2] = (v) => u(v))
|
|
1520
1520
|
}, null, 8, ["model-value", "items"]),
|
|
1521
|
-
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$
|
|
1522
|
-
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_8$
|
|
1521
|
+
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$8, toDisplayString(unref(o)("connect.campaign.push.linkHelper")), 1)),
|
|
1522
|
+
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_8$7, [
|
|
1523
1523
|
createElementVNode("div", _hoisted_9$6, toDisplayString(unref(o)("connect.campaign.push.linkUrl")), 1),
|
|
1524
|
-
createVNode(
|
|
1524
|
+
createVNode(k, {
|
|
1525
1525
|
"model-value": e.modelValue.url ?? "",
|
|
1526
1526
|
inputmode: "url",
|
|
1527
1527
|
placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
|
|
1528
1528
|
"helper-state": unref(n) ? "error" : "none",
|
|
1529
1529
|
"helper-text": unref(n),
|
|
1530
|
-
"onUpdate:modelValue":
|
|
1530
|
+
"onUpdate:modelValue": s[3] || (s[3] = (v) => a({ url: v.trim() || null }))
|
|
1531
1531
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text"])
|
|
1532
1532
|
])) : createCommentVNode("", !0)
|
|
1533
1533
|
])
|
|
1534
1534
|
]);
|
|
1535
1535
|
};
|
|
1536
1536
|
}
|
|
1537
|
-
}), _hoisted_1$
|
|
1537
|
+
}), _hoisted_1$k = { class: "flex items-stretch overflow-x-auto pb-4" }, _hoisted_2$h = {
|
|
1538
1538
|
key: 0,
|
|
1539
1539
|
class: "flex flex-none items-center px-8 fm-typo-en-body-lg-600 text-fm-color-neutral-gray-300",
|
|
1540
1540
|
"aria-hidden": "true"
|
|
1541
|
-
}, _hoisted_3$
|
|
1541
|
+
}, _hoisted_3$e = ["aria-current", "onClick"], _hoisted_4$e = { class: "flex items-center gap-[6px]" }, _hoisted_5$c = ["title"], _hoisted_6$9 = { class: "mt-[3px] block text-[11px] leading-[1.3] text-fm-color-typo-secondary" }, _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
1542
1542
|
__name: "ChannelContentTabs",
|
|
1543
1543
|
props: {
|
|
1544
1544
|
tabs: {},
|
|
@@ -1547,53 +1547,53 @@ const _hoisted_1$r = {
|
|
|
1547
1547
|
emits: ["update:model-value"],
|
|
1548
1548
|
setup(e) {
|
|
1549
1549
|
const { t: r } = useI18n();
|
|
1550
|
-
return (o,
|
|
1551
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (
|
|
1552
|
-
key:
|
|
1550
|
+
return (o, m) => (openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
1551
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (d) => (openBlock(), createElementBlock("div", {
|
|
1552
|
+
key: d.key,
|
|
1553
1553
|
class: "flex flex-none items-center"
|
|
1554
1554
|
}, [
|
|
1555
|
-
|
|
1555
|
+
d.connector ? (openBlock(), createElementBlock("span", _hoisted_2$h, toDisplayString(d.connector), 1)) : createCommentVNode("", !0),
|
|
1556
1556
|
createElementVNode("button", {
|
|
1557
1557
|
type: "button",
|
|
1558
1558
|
class: normalizeClass([
|
|
1559
1559
|
"min-w-[132px] flex-none rounded-[10px] border px-[14px] py-[10px] text-left transition-colors",
|
|
1560
|
-
e.modelValue ===
|
|
1560
|
+
e.modelValue === d.key ? "border-fm-color-primary bg-fm-color-system-warning-100" : "border-fm-color-neutral-gray-100 bg-fm-color-neutral-white hover:border-fm-color-neutral-gray-200"
|
|
1561
1561
|
]),
|
|
1562
|
-
"aria-current": e.modelValue ===
|
|
1563
|
-
onClick: (
|
|
1562
|
+
"aria-current": e.modelValue === d.key ? "true" : void 0,
|
|
1563
|
+
onClick: (p) => o.$emit("update:model-value", d.key)
|
|
1564
1564
|
}, [
|
|
1565
|
-
createElementVNode("span", _hoisted_4$
|
|
1566
|
-
|
|
1565
|
+
createElementVNode("span", _hoisted_4$e, [
|
|
1566
|
+
d.step ? (openBlock(), createElementBlock("span", {
|
|
1567
1567
|
key: 0,
|
|
1568
1568
|
class: normalizeClass([
|
|
1569
1569
|
"flex h-[18px] w-[18px] flex-none items-center justify-center rounded-full text-[10.5px] font-semibold leading-[18px]",
|
|
1570
|
-
e.modelValue ===
|
|
1570
|
+
e.modelValue === d.key ? "bg-fm-color-primary text-fm-color-typo-white" : "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
|
|
1571
1571
|
])
|
|
1572
|
-
}, toDisplayString(
|
|
1572
|
+
}, toDisplayString(d.step), 3)) : createCommentVNode("", !0),
|
|
1573
1573
|
createElementVNode("span", {
|
|
1574
1574
|
class: normalizeClass([
|
|
1575
1575
|
"truncate text-[12.5px] font-semibold leading-[1.3]",
|
|
1576
|
-
e.modelValue ===
|
|
1576
|
+
e.modelValue === d.key ? "text-fm-color-primary" : "text-fm-color-typo-primary"
|
|
1577
1577
|
])
|
|
1578
|
-
}, toDisplayString(
|
|
1579
|
-
|
|
1578
|
+
}, toDisplayString(d.label), 3),
|
|
1579
|
+
d.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", {
|
|
1580
1580
|
key: 1,
|
|
1581
1581
|
class: "h-[7px] w-[7px] flex-none rounded-full bg-fm-color-system-error-400",
|
|
1582
1582
|
title: unref(r)("connect.campaign.broadcast.messageMissing")
|
|
1583
|
-
}, null, 8, _hoisted_5$
|
|
1583
|
+
}, null, 8, _hoisted_5$c))
|
|
1584
1584
|
]),
|
|
1585
|
-
createElementVNode("span", _hoisted_6$
|
|
1586
|
-
], 10, _hoisted_3$
|
|
1585
|
+
createElementVNode("span", _hoisted_6$9, toDisplayString(d.sub), 1)
|
|
1586
|
+
], 10, _hoisted_3$e)
|
|
1587
1587
|
]))), 128))
|
|
1588
1588
|
]));
|
|
1589
1589
|
}
|
|
1590
|
-
}), _hoisted_1$
|
|
1590
|
+
}), _hoisted_1$j = {
|
|
1591
1591
|
key: 0,
|
|
1592
1592
|
class: "flex w-[264px] shrink-0 flex-col gap-8"
|
|
1593
|
-
}, _hoisted_2$
|
|
1593
|
+
}, _hoisted_2$g = { class: "fm-typo-en-body-md-600" }, _hoisted_3$d = { class: "flex justify-center py-8" }, _hoisted_4$d = {
|
|
1594
1594
|
key: 0,
|
|
1595
1595
|
class: "px-12 pb-16 pt-16"
|
|
1596
|
-
}, _hoisted_5$
|
|
1596
|
+
}, _hoisted_5$b = { class: "mb-12 text-center text-[11px] text-[rgba(255,255,255,0.6)]" }, _hoisted_6$8 = { class: "rounded-[14px] border border-[rgba(255,255,255,0.12)] bg-[rgba(255,255,255,0.14)] p-12 backdrop-blur" }, _hoisted_7$7 = { class: "fm-typo-en-body-md-600 text-fm-color-typo-white line-clamp-2" }, _hoisted_8$6 = { class: "mt-[2px] fm-typo-en-body-sm-400 text-[rgba(255,255,255,0.72)] line-clamp-3" }, _hoisted_9$5 = {
|
|
1597
1597
|
key: 1,
|
|
1598
1598
|
class: "px-12 pb-16"
|
|
1599
1599
|
}, _hoisted_10$5 = { class: "fm-typo-en-body-md-600 mb-8" }, _hoisted_11$3 = { class: "rounded-[12px] border border-fm-color-neutral-gray-100 p-12" }, _hoisted_12$2 = { class: "fm-typo-en-body-md-600 line-clamp-2" }, _hoisted_13$2 = { class: "mt-[2px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary line-clamp-3" }, _hoisted_14$2 = ["src"], _hoisted_15$2 = ["srcdoc", "title"], _hoisted_16$1 = {
|
|
@@ -1602,7 +1602,7 @@ const _hoisted_1$r = {
|
|
|
1602
1602
|
}, _hoisted_17$1 = {
|
|
1603
1603
|
key: 2,
|
|
1604
1604
|
class: "px-12 pb-16"
|
|
1605
|
-
}, _hoisted_18$1 = { class: "fm-typo-en-body-md-600 mb-8" }, _hoisted_19$1 = { class: "whitespace-pre-wrap break-words rounded-[12px] bg-fm-color-neutral-gray-100 p-12 fm-typo-en-body-sm-400" }, _hoisted_20$1 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _sfc_main$
|
|
1605
|
+
}, _hoisted_18$1 = { class: "fm-typo-en-body-md-600 mb-8" }, _hoisted_19$1 = { class: "whitespace-pre-wrap break-words rounded-[12px] bg-fm-color-neutral-gray-100 p-12 fm-typo-en-body-sm-400" }, _hoisted_20$1 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
1606
1606
|
__name: "ChannelPreview",
|
|
1607
1607
|
props: {
|
|
1608
1608
|
target: {},
|
|
@@ -1610,45 +1610,45 @@ const _hoisted_1$r = {
|
|
|
1610
1610
|
senderPrefix: {}
|
|
1611
1611
|
},
|
|
1612
1612
|
setup(e) {
|
|
1613
|
-
const { t: r } = useI18n(), o = e,
|
|
1613
|
+
const { t: r } = useI18n(), o = e, m = computed(
|
|
1614
1614
|
() => o.target === "PUSH" ? o.content : void 0
|
|
1615
|
-
),
|
|
1615
|
+
), d = computed(
|
|
1616
1616
|
() => o.target === "APP_INBOX" ? o.content : void 0
|
|
1617
|
-
),
|
|
1617
|
+
), p = computed(
|
|
1618
1618
|
() => o.target === "SMS" || o.target === "WHATSAPP" ? o.content : void 0
|
|
1619
1619
|
), l = computed(() => {
|
|
1620
|
-
var f,
|
|
1621
|
-
const
|
|
1622
|
-
return
|
|
1620
|
+
var f, s;
|
|
1621
|
+
const y = (s = (f = p.value) == null ? void 0 : f.content) == null ? void 0 : s.trim();
|
|
1622
|
+
return y ? o.senderPrefix ? `${o.senderPrefix}${y}` : y : r("connect.campaign.broadcast.preview.emptyText");
|
|
1623
1623
|
}), n = computed(() => {
|
|
1624
1624
|
var f;
|
|
1625
|
-
const
|
|
1626
|
-
return
|
|
1625
|
+
const y = ((f = d.value) == null ? void 0 : f.content) ?? "";
|
|
1626
|
+
return y.trim() ? `<!doctype html><meta charset="utf-8"><base target="_blank"><style>
|
|
1627
1627
|
html,body{margin:0;font:400 12px/1.5 Inter,system-ui,sans-serif;color:#1C1C1E;word-break:break-word}
|
|
1628
1628
|
img{max-width:100%;height:auto}
|
|
1629
|
-
</style>${
|
|
1629
|
+
</style>${y}` : "";
|
|
1630
1630
|
}), a = computed(() => {
|
|
1631
|
-
const
|
|
1631
|
+
const y = /* @__PURE__ */ new Date(), f = y.toLocaleDateString(void 0, {
|
|
1632
1632
|
weekday: "short",
|
|
1633
1633
|
day: "2-digit",
|
|
1634
1634
|
month: "short"
|
|
1635
|
-
}),
|
|
1635
|
+
}), s = y.toLocaleTimeString(void 0, {
|
|
1636
1636
|
hour: "2-digit",
|
|
1637
1637
|
minute: "2-digit"
|
|
1638
1638
|
});
|
|
1639
|
-
return `${f} · ${
|
|
1640
|
-
}),
|
|
1641
|
-
return (
|
|
1642
|
-
var
|
|
1643
|
-
return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1644
|
-
createElementVNode("div", _hoisted_2$
|
|
1639
|
+
return `${f} · ${s}`;
|
|
1640
|
+
}), u = computed(() => o.target === "PUSH" ? r("connect.campaign.broadcast.preview.note.push") : o.target === "APP_INBOX" ? r("connect.campaign.broadcast.preview.note.inbox") : r("connect.campaign.broadcast.preview.note.text"));
|
|
1641
|
+
return (y, f) => {
|
|
1642
|
+
var s, k, x, h, v, i, c, C, V, $, S;
|
|
1643
|
+
return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
1644
|
+
createElementVNode("div", _hoisted_2$g, toDisplayString(unref(r)("connect.campaign.broadcast.preview.title")), 1),
|
|
1645
1645
|
createElementVNode("div", {
|
|
1646
1646
|
class: normalizeClass([
|
|
1647
1647
|
"overflow-hidden rounded-[22px] border border-fm-color-neutral-gray-100",
|
|
1648
1648
|
e.target === "PUSH" ? "bg-fm-color-neutral-black" : "bg-fm-color-neutral-white"
|
|
1649
1649
|
])
|
|
1650
1650
|
}, [
|
|
1651
|
-
createElementVNode("div", _hoisted_3$
|
|
1651
|
+
createElementVNode("div", _hoisted_3$d, [
|
|
1652
1652
|
createElementVNode("div", {
|
|
1653
1653
|
class: normalizeClass([
|
|
1654
1654
|
"h-4 w-40 rounded-full",
|
|
@@ -1656,20 +1656,20 @@ const _hoisted_1$r = {
|
|
|
1656
1656
|
])
|
|
1657
1657
|
}, null, 2)
|
|
1658
1658
|
]),
|
|
1659
|
-
e.target === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
1660
|
-
createElementVNode("div", _hoisted_5$
|
|
1661
|
-
createElementVNode("div", _hoisted_6$
|
|
1662
|
-
createElementVNode("div", _hoisted_7$
|
|
1663
|
-
createElementVNode("div", _hoisted_8$
|
|
1659
|
+
e.target === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_4$d, [
|
|
1660
|
+
createElementVNode("div", _hoisted_5$b, toDisplayString(unref(a)), 1),
|
|
1661
|
+
createElementVNode("div", _hoisted_6$8, [
|
|
1662
|
+
createElementVNode("div", _hoisted_7$7, toDisplayString(((k = (s = unref(m)) == null ? void 0 : s.title) == null ? void 0 : k.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
1663
|
+
createElementVNode("div", _hoisted_8$6, toDisplayString(((h = (x = unref(m)) == null ? void 0 : x.body) == null ? void 0 : h.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyBody")), 1)
|
|
1664
1664
|
])
|
|
1665
1665
|
])) : e.target === "APP_INBOX" ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
|
|
1666
1666
|
createElementVNode("div", _hoisted_10$5, toDisplayString(unref(r)("connect.campaign.broadcast.preview.inboxHeading")), 1),
|
|
1667
1667
|
createElementVNode("div", _hoisted_11$3, [
|
|
1668
|
-
createElementVNode("div", _hoisted_12$2, toDisplayString(((
|
|
1669
|
-
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (
|
|
1670
|
-
(V = unref(
|
|
1668
|
+
createElementVNode("div", _hoisted_12$2, toDisplayString(((i = (v = unref(d)) == null ? void 0 : v.title) == null ? void 0 : i.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
1669
|
+
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (c = unref(d)) == null ? void 0 : c.previewText) == null ? void 0 : C.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyBody")), 1),
|
|
1670
|
+
(V = unref(d)) != null && V.imageUrl ? (openBlock(), createElementBlock("img", {
|
|
1671
1671
|
key: 0,
|
|
1672
|
-
src: unref(
|
|
1672
|
+
src: unref(d).imageUrl,
|
|
1673
1673
|
alt: "",
|
|
1674
1674
|
class: "mt-8 w-full rounded-[8px]"
|
|
1675
1675
|
}, null, 8, _hoisted_14$2)) : createCommentVNode("", !0),
|
|
@@ -1681,8 +1681,8 @@ const _hoisted_1$r = {
|
|
|
1681
1681
|
class: "mt-8 h-[120px] w-full border-0",
|
|
1682
1682
|
title: unref(r)("connect.campaign.broadcast.preview.bodyFrameTitle")
|
|
1683
1683
|
}, null, 8, _hoisted_15$2)) : createCommentVNode("", !0),
|
|
1684
|
-
(S = ($ = unref(
|
|
1685
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1684
|
+
(S = ($ = unref(d)) == null ? void 0 : $.buttons) != null && S.length ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
|
|
1685
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(d).buttons, (w, R) => (openBlock(), createElementBlock("div", {
|
|
1686
1686
|
key: R,
|
|
1687
1687
|
class: "rounded-[8px] bg-fm-color-primary px-12 py-8 text-center fm-typo-en-body-sm-400 text-fm-color-typo-white"
|
|
1688
1688
|
}, toDisplayString(w.label || unref(r)("connect.campaign.appInbox.buttonLabel")), 1))), 128))
|
|
@@ -1693,11 +1693,11 @@ const _hoisted_1$r = {
|
|
|
1693
1693
|
createElementVNode("div", _hoisted_19$1, toDisplayString(unref(l)), 1)
|
|
1694
1694
|
]))
|
|
1695
1695
|
], 2),
|
|
1696
|
-
createElementVNode("div", _hoisted_20$1, toDisplayString(unref(
|
|
1696
|
+
createElementVNode("div", _hoisted_20$1, toDisplayString(unref(u)), 1)
|
|
1697
1697
|
])) : createCommentVNode("", !0);
|
|
1698
1698
|
};
|
|
1699
1699
|
}
|
|
1700
|
-
}), _hoisted_1$
|
|
1700
|
+
}), _hoisted_1$i = { class: "flex flex-col gap-12 pt-8" }, _hoisted_2$f = { class: "flex flex-wrap items-baseline justify-between gap-16" }, _hoisted_3$c = { class: "fm-typo-en-body-lg-600" }, _hoisted_4$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_5$a = { class: "h-24 w-24 flex-none rounded-full bg-fm-color-neutral-gray-100 text-center fm-typo-en-body-sm-400 leading-[24px]" }, _hoisted_6$7 = { class: "min-w-0 flex-1" }, _hoisted_7$6 = { class: "flex flex-wrap items-center gap-[10px]" }, _hoisted_8$5 = { class: "fm-typo-en-body-md-600" }, _hoisted_9$4 = {
|
|
1701
1701
|
key: 0,
|
|
1702
1702
|
class: "inline-flex items-center gap-[5px] fm-typo-en-body-sm-400 text-fm-color-system-error-400"
|
|
1703
1703
|
}, _hoisted_10$4 = { class: "ml-auto flex flex-none items-center gap-[2px] border-l border-fm-color-neutral-gray-100 pl-4" }, _hoisted_11$2 = ["title"], _hoisted_12$1 = ["title"], _hoisted_13$1 = ["title"], _hoisted_14$1 = {
|
|
@@ -1706,7 +1706,7 @@ const _hoisted_1$r = {
|
|
|
1706
1706
|
}, _hoisted_15$1 = {
|
|
1707
1707
|
key: 1,
|
|
1708
1708
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1709
|
-
}, _sfc_main$
|
|
1709
|
+
}, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
1710
1710
|
__name: "FallbackChannelList",
|
|
1711
1711
|
props: {
|
|
1712
1712
|
rows: {},
|
|
@@ -1714,24 +1714,24 @@ const _hoisted_1$r = {
|
|
|
1714
1714
|
},
|
|
1715
1715
|
emits: ["move", "remove", "add"],
|
|
1716
1716
|
setup(e) {
|
|
1717
|
-
const { t: r } = useI18n(), o = e,
|
|
1718
|
-
return (
|
|
1717
|
+
const { t: r } = useI18n(), o = e, m = computed(() => o.addable.length > 0);
|
|
1718
|
+
return (d, p) => {
|
|
1719
1719
|
const l = resolveComponent("FmButton"), n = resolveComponent("FmMenuItem"), a = resolveComponent("FmMenu");
|
|
1720
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1721
|
-
createElementVNode("div", _hoisted_2$
|
|
1722
|
-
createElementVNode("span", _hoisted_3$
|
|
1723
|
-
createElementVNode("span", _hoisted_4$
|
|
1720
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
1721
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
1722
|
+
createElementVNode("span", _hoisted_3$c, toDisplayString(unref(r)("connect.campaign.broadcast.fallbackChannels")), 1),
|
|
1723
|
+
createElementVNode("span", _hoisted_4$c, toDisplayString(unref(r)("connect.campaign.broadcast.fallbackChannelsHint")), 1)
|
|
1724
1724
|
]),
|
|
1725
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (
|
|
1726
|
-
key:
|
|
1725
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (u, y) => (openBlock(), createElementBlock("div", {
|
|
1726
|
+
key: u.channel,
|
|
1727
1727
|
class: "flex flex-wrap items-center gap-12 rounded-[8px] border border-fm-color-neutral-gray-100 px-16 py-[14px]"
|
|
1728
1728
|
}, [
|
|
1729
|
-
createElementVNode("span", _hoisted_5$
|
|
1730
|
-
createElementVNode("span", _hoisted_6$
|
|
1731
|
-
createElementVNode("span", _hoisted_7$
|
|
1732
|
-
createElementVNode("span", _hoisted_8$
|
|
1733
|
-
|
|
1734
|
-
|
|
1729
|
+
createElementVNode("span", _hoisted_5$a, toDisplayString(u.position), 1),
|
|
1730
|
+
createElementVNode("span", _hoisted_6$7, [
|
|
1731
|
+
createElementVNode("span", _hoisted_7$6, [
|
|
1732
|
+
createElementVNode("span", _hoisted_8$5, toDisplayString(u.label), 1),
|
|
1733
|
+
u.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_9$4, [
|
|
1734
|
+
p[0] || (p[0] = createElementVNode("span", { class: "h-[6px] w-[6px] rounded-full bg-fm-color-system-error-400" }, null, -1)),
|
|
1735
1735
|
createTextVNode(" " + toDisplayString(unref(r)("connect.campaign.broadcast.messageMissing")), 1)
|
|
1736
1736
|
]))
|
|
1737
1737
|
])
|
|
@@ -1745,8 +1745,8 @@ const _hoisted_1$r = {
|
|
|
1745
1745
|
icon: "arrow_upward",
|
|
1746
1746
|
"icon-color": "neutral-gray-400",
|
|
1747
1747
|
variant: "tertiary",
|
|
1748
|
-
disabled:
|
|
1749
|
-
onClick: (f) =>
|
|
1748
|
+
disabled: y === 0,
|
|
1749
|
+
onClick: (f) => d.$emit("move", u.channel, -1)
|
|
1750
1750
|
}, null, 8, ["disabled", "onClick"])
|
|
1751
1751
|
], 8, _hoisted_11$2),
|
|
1752
1752
|
createElementVNode("span", {
|
|
@@ -1757,8 +1757,8 @@ const _hoisted_1$r = {
|
|
|
1757
1757
|
icon: "arrow_downward",
|
|
1758
1758
|
"icon-color": "neutral-gray-400",
|
|
1759
1759
|
variant: "tertiary",
|
|
1760
|
-
disabled:
|
|
1761
|
-
onClick: (f) =>
|
|
1760
|
+
disabled: y === e.rows.length - 1,
|
|
1761
|
+
onClick: (f) => d.$emit("move", u.channel, 1)
|
|
1762
1762
|
}, null, 8, ["disabled", "onClick"])
|
|
1763
1763
|
], 8, _hoisted_12$1),
|
|
1764
1764
|
createElementVNode("span", {
|
|
@@ -1769,12 +1769,12 @@ const _hoisted_1$r = {
|
|
|
1769
1769
|
icon: "delete",
|
|
1770
1770
|
"icon-color": "neutral-gray-400",
|
|
1771
1771
|
variant: "tertiary",
|
|
1772
|
-
onClick: (f) =>
|
|
1772
|
+
onClick: (f) => d.$emit("remove", u.channel)
|
|
1773
1773
|
}, null, 8, ["onClick"])
|
|
1774
1774
|
], 8, _hoisted_13$1)
|
|
1775
1775
|
])
|
|
1776
1776
|
]))), 128)),
|
|
1777
|
-
unref(
|
|
1777
|
+
unref(m) ? (openBlock(), createBlock(a, {
|
|
1778
1778
|
key: 0,
|
|
1779
1779
|
placement: "bottom-start"
|
|
1780
1780
|
}, {
|
|
@@ -1782,10 +1782,10 @@ const _hoisted_1$r = {
|
|
|
1782
1782
|
createElementVNode("button", _hoisted_14$1, " + " + toDisplayString(unref(r)("connect.campaign.broadcast.addFallbackChannel")), 1)
|
|
1783
1783
|
]),
|
|
1784
1784
|
default: withCtx(() => [
|
|
1785
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (
|
|
1786
|
-
key:
|
|
1787
|
-
label:
|
|
1788
|
-
onClick: (
|
|
1785
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (u) => (openBlock(), createBlock(n, {
|
|
1786
|
+
key: u.channel,
|
|
1787
|
+
label: u.label,
|
|
1788
|
+
onClick: (y) => d.$emit("add", u.channel)
|
|
1789
1789
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
1790
1790
|
]),
|
|
1791
1791
|
_: 1
|
|
@@ -1795,7 +1795,7 @@ const _hoisted_1$r = {
|
|
|
1795
1795
|
}
|
|
1796
1796
|
});
|
|
1797
1797
|
var define_appEndpoint_default = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
|
|
1798
|
-
const _hoisted_1$
|
|
1798
|
+
const _hoisted_1$h = { class: "flex flex-col gap-[28px]" }, _hoisted_2$e = { class: "flex flex-col gap-[14px]" }, _hoisted_3$b = { class: "fm-typo-en-body-lg-600" }, _hoisted_4$b = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$9 = { class: "grid gap-12 md:grid-cols-2 lg:grid-cols-2" }, _hoisted_6$6 = { class: "flex items-start justify-between gap-12" }, _hoisted_7$5 = { class: "fm-typo-en-title-sm-800" }, _hoisted_8$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
|
|
1799
1799
|
key: 0,
|
|
1800
1800
|
class: "flex items-start gap-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1801
1801
|
}, _hoisted_10$3 = { class: "flex flex-col gap-12" }, _hoisted_11$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_12 = { class: "grid items-stretch gap-12 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-4" }, _hoisted_13 = { class: "flex items-start justify-between gap-12" }, _hoisted_14 = {
|
|
@@ -1825,7 +1825,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1825
1825
|
}, _hoisted_25 = { class: "min-w-0 flex-1 basis-[340px]" }, _hoisted_26 = {
|
|
1826
1826
|
key: 1,
|
|
1827
1827
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1828
|
-
}, _sfc_main$
|
|
1828
|
+
}, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1829
1829
|
__name: "BroadcastDeliveryInput",
|
|
1830
1830
|
props: {
|
|
1831
1831
|
pushAvailability: {
|
|
@@ -1856,12 +1856,12 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1856
1856
|
},
|
|
1857
1857
|
emits: ["retry-push", "update:model-value"],
|
|
1858
1858
|
setup(e, { emit: r }) {
|
|
1859
|
-
const { t: o } = useI18n(),
|
|
1860
|
-
let
|
|
1861
|
-
return a.pushAvailability === "checking" ?
|
|
1859
|
+
const { t: o } = useI18n(), m = useDialog(), d = computed(() => {
|
|
1860
|
+
let g = "unavailable";
|
|
1861
|
+
return a.pushAvailability === "checking" ? g = "checking" : a.pushAvailability === "non-native" && (g = "requiresNativeApp"), o("connect.campaign.broadcast.pushAvailability." + g);
|
|
1862
1862
|
});
|
|
1863
|
-
function
|
|
1864
|
-
|
|
1863
|
+
function p() {
|
|
1864
|
+
m.open({
|
|
1865
1865
|
title: o("connect.campaign.broadcast.pushAvailability.contactSales"),
|
|
1866
1866
|
message: o("connect.campaign.broadcast.pushAvailability.dialogMessage"),
|
|
1867
1867
|
primaryActions: {
|
|
@@ -1870,42 +1870,42 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1870
1870
|
}
|
|
1871
1871
|
});
|
|
1872
1872
|
}
|
|
1873
|
-
const l = useCoreStore(), n = useMembershipStore(), a = e,
|
|
1874
|
-
const
|
|
1875
|
-
return
|
|
1873
|
+
const l = useCoreStore(), n = useMembershipStore(), a = e, u = r, y = ref(!1), f = ref("SMS"), s = computed(() => {
|
|
1874
|
+
const g = a.modelValue;
|
|
1875
|
+
return g && "channels" in g ? g : toDelivery({ message: g });
|
|
1876
1876
|
});
|
|
1877
|
-
function
|
|
1878
|
-
|
|
1877
|
+
function k(g) {
|
|
1878
|
+
u("update:model-value", g);
|
|
1879
1879
|
}
|
|
1880
|
-
function x(
|
|
1881
|
-
return o(`connect.campaign.broadcast.channel.${
|
|
1880
|
+
function x(g) {
|
|
1881
|
+
return o(`connect.campaign.broadcast.channel.${g}`);
|
|
1882
1882
|
}
|
|
1883
|
-
const
|
|
1883
|
+
const h = {
|
|
1884
1884
|
SMS: "chat",
|
|
1885
1885
|
WHATSAPP: "chat",
|
|
1886
1886
|
EMAIL: "mail",
|
|
1887
1887
|
APP_INBOX: "inbox",
|
|
1888
1888
|
PUSH: "notifications"
|
|
1889
1889
|
};
|
|
1890
|
-
function v(
|
|
1891
|
-
return
|
|
1890
|
+
function v(g) {
|
|
1891
|
+
return h[g];
|
|
1892
1892
|
}
|
|
1893
|
-
const
|
|
1893
|
+
const i = computed(() => s.value.mode === "fallback"), c = computed(
|
|
1894
1894
|
() => a.variables.filter(
|
|
1895
|
-
(
|
|
1895
|
+
(g) => a.triggerType == "SCHEDULE" ? !g.startsWith("transaction.") : !0
|
|
1896
1896
|
)
|
|
1897
1897
|
), C = useChannelFlag();
|
|
1898
|
-
function V(
|
|
1899
|
-
return C(
|
|
1898
|
+
function V(g) {
|
|
1899
|
+
return C(g) === "off" ? !1 : g === "PUSH" ? a.pushAvailability === "native" : g === "WHATSAPP" ? y.value : !0;
|
|
1900
1900
|
}
|
|
1901
1901
|
const $ = ["fallback", "all"];
|
|
1902
|
-
function S(
|
|
1903
|
-
|
|
1902
|
+
function S(g) {
|
|
1903
|
+
g !== s.value.mode && k(setMode(s.value, g));
|
|
1904
1904
|
}
|
|
1905
1905
|
const w = ref(null);
|
|
1906
|
-
function R(
|
|
1906
|
+
function R(g) {
|
|
1907
1907
|
var T;
|
|
1908
|
-
const E = (T = w.value) == null ? void 0 : T[
|
|
1908
|
+
const E = (T = w.value) == null ? void 0 : T[g];
|
|
1909
1909
|
return E ? new Intl.NumberFormat(void 0, {
|
|
1910
1910
|
style: "currency",
|
|
1911
1911
|
currency: E.currency,
|
|
@@ -1917,171 +1917,171 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1917
1917
|
() => (
|
|
1918
1918
|
// A flagged-off channel stays visible while selected, so it can be removed.
|
|
1919
1919
|
CHANNEL_DISPLAY_ORDER.filter(
|
|
1920
|
-
(
|
|
1921
|
-
).map((
|
|
1922
|
-
const E =
|
|
1920
|
+
(g) => C(g) === "on" || s.value.channels.includes(g)
|
|
1921
|
+
).map((g) => {
|
|
1922
|
+
const E = s.value.channels.includes(g), T = R(g);
|
|
1923
1923
|
let L = o("connect.campaign.broadcast.freeChannel");
|
|
1924
|
-
return isPaidChannel(
|
|
1925
|
-
channel:
|
|
1926
|
-
label: x(
|
|
1924
|
+
return isPaidChannel(g) && (L = T ? o("connect.campaign.broadcast.perMessage", { price: T }) : null), {
|
|
1925
|
+
channel: g,
|
|
1926
|
+
label: x(g),
|
|
1927
1927
|
selected: E,
|
|
1928
|
-
available: V(
|
|
1928
|
+
available: V(g),
|
|
1929
1929
|
rateNote: L,
|
|
1930
1930
|
// In fallback mode the grid is a radio for the primary channel, so only
|
|
1931
1931
|
// the primary reads as checked; a fallback is tagged instead.
|
|
1932
|
-
checked:
|
|
1933
|
-
usedAsFallback:
|
|
1932
|
+
checked: i.value ? s.value.channels[0] === g : E,
|
|
1933
|
+
usedAsFallback: i.value && s.value.channels.indexOf(g) > 0
|
|
1934
1934
|
};
|
|
1935
1935
|
})
|
|
1936
1936
|
)
|
|
1937
1937
|
);
|
|
1938
|
-
async function M(
|
|
1939
|
-
if (
|
|
1940
|
-
await H(
|
|
1938
|
+
async function M(g) {
|
|
1939
|
+
if (i.value) {
|
|
1940
|
+
await H(g);
|
|
1941
1941
|
return;
|
|
1942
1942
|
}
|
|
1943
|
-
if (
|
|
1944
|
-
await I(
|
|
1943
|
+
if (s.value.channels.includes(g)) {
|
|
1944
|
+
await I(g);
|
|
1945
1945
|
return;
|
|
1946
1946
|
}
|
|
1947
|
-
V(
|
|
1947
|
+
V(g) && k(addChannel(s.value, g, c.value));
|
|
1948
1948
|
}
|
|
1949
|
-
async function H(
|
|
1950
|
-
if (!V(
|
|
1951
|
-
const E =
|
|
1952
|
-
E !==
|
|
1949
|
+
async function H(g) {
|
|
1950
|
+
if (!V(g)) return;
|
|
1951
|
+
const E = s.value.channels[0];
|
|
1952
|
+
E !== g && (E && hasDraft(s.value, E) && !await prompt.remove(
|
|
1953
1953
|
o("connect.campaign.broadcast.replaceChannelConfirm", {
|
|
1954
1954
|
channel: x(E),
|
|
1955
|
-
next: x(
|
|
1955
|
+
next: x(g)
|
|
1956
1956
|
})
|
|
1957
|
-
) || V(
|
|
1957
|
+
) || V(g) && (k(setPrimaryChannel(s.value, g, c.value)), f.value = g));
|
|
1958
1958
|
}
|
|
1959
|
-
async function I(
|
|
1960
|
-
if (hasDraft(
|
|
1959
|
+
async function I(g) {
|
|
1960
|
+
if (hasDraft(s.value, g) && !await prompt.remove(
|
|
1961
1961
|
o("connect.campaign.broadcast.removeChannelConfirm", {
|
|
1962
|
-
channel: x(
|
|
1962
|
+
channel: x(g)
|
|
1963
1963
|
})
|
|
1964
1964
|
))
|
|
1965
1965
|
return;
|
|
1966
|
-
const E = removeChannel(
|
|
1967
|
-
|
|
1966
|
+
const E = removeChannel(s.value, g);
|
|
1967
|
+
k(E), f.value === g && (f.value = E.channels[0] ?? "SMS");
|
|
1968
1968
|
}
|
|
1969
|
-
function X(
|
|
1970
|
-
|
|
1969
|
+
function X(g, E) {
|
|
1970
|
+
k(moveChannel(s.value, g, E));
|
|
1971
1971
|
}
|
|
1972
|
-
function K(
|
|
1973
|
-
V(
|
|
1972
|
+
function K(g) {
|
|
1973
|
+
V(g) && k(addChannel(s.value, g, c.value));
|
|
1974
1974
|
}
|
|
1975
1975
|
const Z = computed(
|
|
1976
|
-
() =>
|
|
1977
|
-
channel:
|
|
1978
|
-
label: x(
|
|
1976
|
+
() => s.value.channels.slice(1).map((g, E) => ({
|
|
1977
|
+
channel: g,
|
|
1978
|
+
label: x(g),
|
|
1979
1979
|
position: E + 2,
|
|
1980
|
-
complete: !a.showValidation || isChannelComplete(
|
|
1980
|
+
complete: !a.showValidation || isChannelComplete(s.value, g)
|
|
1981
1981
|
}))
|
|
1982
1982
|
), J = computed(
|
|
1983
1983
|
() => CHANNEL_DISPLAY_ORDER.filter(
|
|
1984
|
-
(
|
|
1985
|
-
).map((
|
|
1986
|
-
channel:
|
|
1987
|
-
label: x(
|
|
1984
|
+
(g) => !s.value.channels.includes(g) && V(g)
|
|
1985
|
+
).map((g) => ({
|
|
1986
|
+
channel: g,
|
|
1987
|
+
label: x(g)
|
|
1988
1988
|
}))
|
|
1989
1989
|
), W = computed(
|
|
1990
|
-
() =>
|
|
1990
|
+
() => s.value.channels.map((g, E) => {
|
|
1991
1991
|
let T = o("connect.campaign.broadcast.tab.sendsToEligible");
|
|
1992
|
-
|
|
1992
|
+
i.value && (T = o(
|
|
1993
1993
|
E === 0 ? "connect.campaign.broadcast.tab.firstAttempt" : "connect.campaign.broadcast.tab.ifNotReached"
|
|
1994
1994
|
));
|
|
1995
1995
|
let L;
|
|
1996
|
-
return E > 0 && (L =
|
|
1997
|
-
key:
|
|
1998
|
-
label: x(
|
|
1996
|
+
return E > 0 && (L = i.value ? "→" : "+"), {
|
|
1997
|
+
key: g,
|
|
1998
|
+
label: x(g),
|
|
1999
1999
|
sub: T,
|
|
2000
|
-
complete: !a.showValidation || isChannelComplete(
|
|
2001
|
-
step:
|
|
2000
|
+
complete: !a.showValidation || isChannelComplete(s.value, g),
|
|
2001
|
+
step: i.value ? E + 1 : void 0,
|
|
2002
2002
|
connector: L
|
|
2003
2003
|
};
|
|
2004
2004
|
})
|
|
2005
2005
|
);
|
|
2006
2006
|
watchEffect(() => {
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2007
|
+
const g = W.value.map((E) => E.key);
|
|
2008
|
+
g.length && !g.includes(f.value) && (f.value = g[0]);
|
|
2009
2009
|
});
|
|
2010
|
-
const
|
|
2011
|
-
const
|
|
2012
|
-
if (!(
|
|
2013
|
-
return
|
|
2010
|
+
const b = computed(() => f.value), B = computed(() => {
|
|
2011
|
+
const g = b.value;
|
|
2012
|
+
if (!(g === "APP_INBOX" || g === "PUSH"))
|
|
2013
|
+
return s.value.content[g];
|
|
2014
2014
|
}), D = computed(
|
|
2015
|
-
() =>
|
|
2016
|
-
),
|
|
2017
|
-
() =>
|
|
2015
|
+
() => s.value.content.APP_INBOX
|
|
2016
|
+
), O = computed(
|
|
2017
|
+
() => s.value.content.PUSH
|
|
2018
2018
|
);
|
|
2019
|
-
function
|
|
2020
|
-
|
|
2019
|
+
function A(g) {
|
|
2020
|
+
k(setChannelContent(s.value, "APP_INBOX", g));
|
|
2021
2021
|
}
|
|
2022
|
-
function P(
|
|
2023
|
-
V("PUSH") &&
|
|
2022
|
+
function P(g) {
|
|
2023
|
+
V("PUSH") && k(setChannelContent(s.value, "PUSH", g));
|
|
2024
2024
|
}
|
|
2025
|
-
function j(
|
|
2026
|
-
|
|
2025
|
+
function j(g, E) {
|
|
2026
|
+
g === "APP_INBOX" || g === "PUSH" || k(setChannelContent(s.value, g, { ...E, channel: g }));
|
|
2027
2027
|
}
|
|
2028
2028
|
const U = computed(
|
|
2029
|
-
() =>
|
|
2029
|
+
() => s.value.channels.filter(isPaidChannel)
|
|
2030
2030
|
), G = computed(() => {
|
|
2031
2031
|
var E, T, L;
|
|
2032
|
-
const
|
|
2033
|
-
return getSmsMessageMetrics({ brandName:
|
|
2032
|
+
const g = ((E = n.membership) == null ? void 0 : E.brand) || ((L = (T = l.currentBusiness) == null ? void 0 : T.value) == null ? void 0 : L.name) || "";
|
|
2033
|
+
return getSmsMessageMetrics({ brandName: g, content: "" }).prefix;
|
|
2034
2034
|
}), Y = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
|
|
2035
2035
|
async function q() {
|
|
2036
2036
|
try {
|
|
2037
|
-
const
|
|
2038
|
-
|
|
2037
|
+
const g = await membershipApi.getWhatsappNumbers();
|
|
2038
|
+
y.value = g.some(
|
|
2039
2039
|
(E) => {
|
|
2040
2040
|
var T;
|
|
2041
2041
|
return (T = E == null ? void 0 : E.default) == null ? void 0 : T.includes("Marketing");
|
|
2042
2042
|
}
|
|
2043
2043
|
);
|
|
2044
|
-
} catch (
|
|
2045
|
-
console.error("Failed to fetch WhatsApp numbers:",
|
|
2044
|
+
} catch (g) {
|
|
2045
|
+
console.error("Failed to fetch WhatsApp numbers:", g);
|
|
2046
2046
|
}
|
|
2047
2047
|
}
|
|
2048
2048
|
return onMounted(async () => {
|
|
2049
|
-
const
|
|
2050
|
-
|
|
2051
|
-
}), (
|
|
2049
|
+
const g = s.value.channels[0];
|
|
2050
|
+
g && (f.value = g), campaignApi.readBroadcastCreditSummary().then((E) => w.value = E.prices).catch(() => w.value = null), await q();
|
|
2051
|
+
}), (g, E) => {
|
|
2052
2052
|
const T = resolveComponent("FmIcon"), L = resolveComponent("FmCard"), Q = resolveComponent("FmButton");
|
|
2053
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2054
|
-
createElementVNode("div", _hoisted_2$
|
|
2053
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
2054
|
+
createElementVNode("div", _hoisted_2$e, [
|
|
2055
2055
|
createElementVNode("div", null, [
|
|
2056
|
-
createElementVNode("div", _hoisted_3$
|
|
2057
|
-
createElementVNode("div", _hoisted_4$
|
|
2056
|
+
createElementVNode("div", _hoisted_3$b, toDisplayString(unref(o)("connect.campaign.broadcast.delivery")), 1),
|
|
2057
|
+
createElementVNode("div", _hoisted_4$b, toDisplayString(unref(o)("connect.campaign.broadcast.deliveryDescription")), 1)
|
|
2058
2058
|
]),
|
|
2059
|
-
createElementVNode("div", _hoisted_5$
|
|
2059
|
+
createElementVNode("div", _hoisted_5$9, [
|
|
2060
2060
|
(openBlock(), createElementBlock(Fragment, null, renderList($, (N) => createVNode(L, {
|
|
2061
2061
|
key: N,
|
|
2062
2062
|
variant: "outlined",
|
|
2063
2063
|
class: normalizeClass(["h-full cursor-pointer select-none p-16 space-y-8", {
|
|
2064
|
-
"border-fm-color-primary bg-fm-color-system-warning-100": unref(
|
|
2065
|
-
"hover:bg-fm-color-opacity-sm": unref(
|
|
2064
|
+
"border-fm-color-primary bg-fm-color-system-warning-100": unref(s).mode === N,
|
|
2065
|
+
"hover:bg-fm-color-opacity-sm": unref(s).mode !== N
|
|
2066
2066
|
}]),
|
|
2067
2067
|
onClick: (ee) => S(N)
|
|
2068
2068
|
}, {
|
|
2069
2069
|
default: withCtx(() => [
|
|
2070
|
-
createElementVNode("div", _hoisted_6$
|
|
2071
|
-
createElementVNode("div", _hoisted_7$
|
|
2072
|
-
unref(
|
|
2070
|
+
createElementVNode("div", _hoisted_6$6, [
|
|
2071
|
+
createElementVNode("div", _hoisted_7$5, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${N}.label`)), 1),
|
|
2072
|
+
unref(s).mode === N ? (openBlock(), createBlock(T, {
|
|
2073
2073
|
key: 0,
|
|
2074
2074
|
name: "check_circle",
|
|
2075
2075
|
size: "md",
|
|
2076
2076
|
class: "shrink-0 text-fm-color-primary"
|
|
2077
2077
|
})) : createCommentVNode("", !0)
|
|
2078
2078
|
]),
|
|
2079
|
-
createElementVNode("div", _hoisted_8$
|
|
2079
|
+
createElementVNode("div", _hoisted_8$4, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${N}.description`)), 1)
|
|
2080
2080
|
]),
|
|
2081
2081
|
_: 2
|
|
2082
2082
|
}, 1032, ["class", "onClick"])), 64))
|
|
2083
2083
|
]),
|
|
2084
|
-
unref(
|
|
2084
|
+
unref(s).channels.length < 2 ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
2085
2085
|
createVNode(T, {
|
|
2086
2086
|
name: "info",
|
|
2087
2087
|
size: "sm",
|
|
@@ -2091,7 +2091,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2091
2091
|
])) : createCommentVNode("", !0)
|
|
2092
2092
|
]),
|
|
2093
2093
|
createElementVNode("div", _hoisted_10$3, [
|
|
2094
|
-
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(
|
|
2094
|
+
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(i) ? unref(o)("connect.campaign.broadcast.primaryChannel") : unref(o)("connect.campaign.broadcast.channels")), 1),
|
|
2095
2095
|
createElementVNode("div", _hoisted_12, [
|
|
2096
2096
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(F), (N) => (openBlock(), createBlock(L, {
|
|
2097
2097
|
key: N.channel,
|
|
@@ -2119,11 +2119,11 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2119
2119
|
N.available ? (openBlock(), createElementBlock("span", {
|
|
2120
2120
|
key: 0,
|
|
2121
2121
|
class: normalizeClass(["flex h-[22px] w-[22px] flex-none items-center justify-center border-2 transition-colors", [
|
|
2122
|
-
unref(
|
|
2122
|
+
unref(i) ? "rounded-full" : "rounded-[4px]",
|
|
2123
2123
|
N.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"
|
|
2124
2124
|
]])
|
|
2125
2125
|
}, [
|
|
2126
|
-
N.checked && !unref(
|
|
2126
|
+
N.checked && !unref(i) ? (openBlock(), createBlock(T, {
|
|
2127
2127
|
key: 0,
|
|
2128
2128
|
name: "check",
|
|
2129
2129
|
size: "sm"
|
|
@@ -2135,7 +2135,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2135
2135
|
class: normalizeClass(["fm-typo-en-body-md-600", N.available ? "" : "text-fm-color-typo-disabled"])
|
|
2136
2136
|
}, toDisplayString(N.label), 3),
|
|
2137
2137
|
N.available && N.rateNote ? (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(N.rateNote), 1)) : createCommentVNode("", !0),
|
|
2138
|
-
N.available ? N.usedAsFallback ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(unref(o)("connect.campaign.broadcast.usedAsFallback")), 1)) : createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(N.channel === "PUSH" ? unref(
|
|
2138
|
+
N.available ? N.usedAsFallback ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(unref(o)("connect.campaign.broadcast.usedAsFallback")), 1)) : createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(N.channel === "PUSH" ? unref(d) : unref(o)("connect.campaign.broadcast.notSetUp")), 1))
|
|
2139
2139
|
]),
|
|
2140
2140
|
N.channel === "WHATSAPP" && !N.available ? (openBlock(), createElementBlock("a", {
|
|
2141
2141
|
key: 0,
|
|
@@ -2149,12 +2149,12 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2149
2149
|
e.pushAvailability === "non-native" ? (openBlock(), createBlock(Q, {
|
|
2150
2150
|
key: 0,
|
|
2151
2151
|
label: unref(o)("connect.campaign.broadcast.pushAvailability.contactSales"),
|
|
2152
|
-
onClick: withModifiers(
|
|
2152
|
+
onClick: withModifiers(p, ["stop"])
|
|
2153
2153
|
}, null, 8, ["label"])) : createCommentVNode("", !0),
|
|
2154
2154
|
e.pushAvailability === "failed" ? (openBlock(), createBlock(Q, {
|
|
2155
2155
|
key: 1,
|
|
2156
2156
|
label: unref(o)("connect.campaign.broadcast.pushAvailability.retry"),
|
|
2157
|
-
onClick: E[1] || (E[1] = withModifiers((ee) =>
|
|
2157
|
+
onClick: E[1] || (E[1] = withModifiers((ee) => u("retry-push"), ["stop"]))
|
|
2158
2158
|
}, null, 8, ["label"])) : createCommentVNode("", !0),
|
|
2159
2159
|
N.selected ? (openBlock(), createBlock(Q, {
|
|
2160
2160
|
key: 2,
|
|
@@ -2166,9 +2166,9 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2166
2166
|
_: 2
|
|
2167
2167
|
}, 1032, ["class", "aria-disabled", "onClick"]))), 128))
|
|
2168
2168
|
]),
|
|
2169
|
-
unref(
|
|
2170
|
-
e.showValidation && !unref(
|
|
2171
|
-
unref(
|
|
2169
|
+
unref(s).channels.includes("PUSH") && !V("PUSH") ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.pushAvailability.removeBeforeSave")), 1)) : createCommentVNode("", !0),
|
|
2170
|
+
e.showValidation && !unref(s).channels.length ? (openBlock(), createElementBlock("div", _hoisted_19, toDisplayString(unref(o)("connect.campaign.broadcast.selectChannelRequired")), 1)) : createCommentVNode("", !0),
|
|
2171
|
+
unref(i) && unref(s).channels.length ? (openBlock(), createBlock(_sfc_main$i, {
|
|
2172
2172
|
key: 2,
|
|
2173
2173
|
rows: unref(Z),
|
|
2174
2174
|
addable: unref(J),
|
|
@@ -2182,45 +2182,45 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2182
2182
|
createElementVNode("div", _hoisted_21, toDisplayString(unref(o)("connect.campaign.broadcast.content")), 1),
|
|
2183
2183
|
createElementVNode("div", _hoisted_22, toDisplayString(unref(o)("connect.campaign.broadcast.contentDescription")), 1)
|
|
2184
2184
|
]),
|
|
2185
|
-
unref(U).length ? (openBlock(), createBlock(_sfc_main$
|
|
2185
|
+
unref(U).length ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2186
2186
|
key: 0,
|
|
2187
2187
|
channels: unref(U)
|
|
2188
2188
|
}, null, 8, ["channels"])) : createCommentVNode("", !0),
|
|
2189
|
-
unref(
|
|
2190
|
-
unref(
|
|
2189
|
+
unref(s).channels.length ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_23, toDisplayString(unref(o)("connect.campaign.broadcast.noChannelContent")), 1)),
|
|
2190
|
+
unref(s).channels.length ? (openBlock(), createBlock(_sfc_main$k, {
|
|
2191
2191
|
key: 2,
|
|
2192
2192
|
modelValue: unref(f),
|
|
2193
2193
|
"onUpdate:modelValue": E[3] || (E[3] = (N) => isRef(f) ? f.value = N : null),
|
|
2194
2194
|
tabs: unref(W)
|
|
2195
2195
|
}, null, 8, ["modelValue", "tabs"])) : createCommentVNode("", !0),
|
|
2196
|
-
unref(
|
|
2196
|
+
unref(s).channels.includes(unref(f)) ? (openBlock(), createElementBlock("div", _hoisted_24, [
|
|
2197
2197
|
createElementVNode("div", _hoisted_25, [
|
|
2198
|
-
unref(f) === "PUSH" && unref(
|
|
2198
|
+
unref(f) === "PUSH" && unref(O) && V("PUSH") ? (openBlock(), createBlock(_sfc_main$l, {
|
|
2199
2199
|
key: 0,
|
|
2200
|
-
"model-value": unref(
|
|
2200
|
+
"model-value": unref(O),
|
|
2201
2201
|
"show-validation": e.showValidation,
|
|
2202
2202
|
"onUpdate:modelValue": P
|
|
2203
|
-
}, null, 8, ["model-value", "show-validation"])) : unref(f) === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_26, toDisplayString(unref(
|
|
2203
|
+
}, null, 8, ["model-value", "show-validation"])) : unref(f) === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_26, toDisplayString(unref(d)), 1)) : unref(f) === "APP_INBOX" && unref(D) ? (openBlock(), createBlock(_sfc_main$m, {
|
|
2204
2204
|
key: 2,
|
|
2205
2205
|
"model-value": unref(D),
|
|
2206
|
-
variables: unref(
|
|
2206
|
+
variables: unref(c),
|
|
2207
2207
|
"show-validation": e.showValidation,
|
|
2208
|
-
"onUpdate:modelValue":
|
|
2209
|
-
}, null, 8, ["model-value", "variables", "show-validation"])) : unref(f) !== "APP_INBOX" ? (openBlock(), createBlock(_sfc_main$
|
|
2208
|
+
"onUpdate:modelValue": A
|
|
2209
|
+
}, null, 8, ["model-value", "variables", "show-validation"])) : unref(f) !== "APP_INBOX" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
2210
2210
|
key: unref(f),
|
|
2211
2211
|
"model-value": unref(B),
|
|
2212
2212
|
"allow-email": !1,
|
|
2213
2213
|
"allow-whatsapp": !1,
|
|
2214
2214
|
"hide-credit-card": !0,
|
|
2215
2215
|
"trigger-type": e.triggerType,
|
|
2216
|
-
variables: unref(
|
|
2216
|
+
variables: unref(c),
|
|
2217
2217
|
placeholder: e.placeholder,
|
|
2218
|
-
"onUpdate:modelValue": E[4] || (E[4] = (N) => j(unref(
|
|
2218
|
+
"onUpdate:modelValue": E[4] || (E[4] = (N) => j(unref(b), N))
|
|
2219
2219
|
}, null, 8, ["model-value", "trigger-type", "variables", "placeholder"])) : createCommentVNode("", !0)
|
|
2220
2220
|
]),
|
|
2221
|
-
createVNode(_sfc_main$
|
|
2221
|
+
createVNode(_sfc_main$j, {
|
|
2222
2222
|
target: unref(f),
|
|
2223
|
-
content: unref(
|
|
2223
|
+
content: unref(s).content[unref(b)],
|
|
2224
2224
|
"sender-prefix": unref(G)
|
|
2225
2225
|
}, null, 8, ["target", "content", "sender-prefix"])
|
|
2226
2226
|
])) : createCommentVNode("", !0)
|
|
@@ -2228,10 +2228,10 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2228
2228
|
]);
|
|
2229
2229
|
};
|
|
2230
2230
|
}
|
|
2231
|
-
}), _hoisted_1$
|
|
2231
|
+
}), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$a = {
|
|
2232
2232
|
key: 0,
|
|
2233
2233
|
class: "space-y-4"
|
|
2234
|
-
}, _hoisted_4$
|
|
2234
|
+
}, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$8 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
2235
2235
|
__name: "ScheduleRuleInput",
|
|
2236
2236
|
props: {
|
|
2237
2237
|
modelValue: {
|
|
@@ -2247,60 +2247,60 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2247
2247
|
},
|
|
2248
2248
|
emits: ["update:model-value"],
|
|
2249
2249
|
setup(e, { emit: r }) {
|
|
2250
|
-
const { t: o } = useI18n(),
|
|
2251
|
-
() =>
|
|
2250
|
+
const { t: o } = useI18n(), m = e, d = r, p = useCoreStore(), l = computed(
|
|
2251
|
+
() => F_COUNTRY_TIMEZONE[p.currentCountry.value || "MY"]
|
|
2252
2252
|
);
|
|
2253
2253
|
function n() {
|
|
2254
|
-
const
|
|
2255
|
-
return
|
|
2256
|
-
(
|
|
2254
|
+
const i = RuleBuilder.getRules(m.modelValue);
|
|
2255
|
+
return i.length == 0 ? "fixed" : i.some(
|
|
2256
|
+
(c) => isRuleEntry(c) && RuleBuilder.simplify(c).operator == "_rrule"
|
|
2257
2257
|
) ? "repeating" : "fixed";
|
|
2258
2258
|
}
|
|
2259
|
-
const a = ref(n()),
|
|
2259
|
+
const a = ref(n()), u = ref(!1), y = ref(!1), f = computed(() => [
|
|
2260
2260
|
{ label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
2261
2261
|
{ label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
2262
|
-
]),
|
|
2263
|
-
const
|
|
2262
|
+
]), s = computed(() => {
|
|
2263
|
+
const i = RuleBuilder.getRules(m.modelValue), c = i.find(
|
|
2264
2264
|
(V) => isRuleEntry(V) && RuleBuilder.simplify(V).property == "trigger.date"
|
|
2265
|
-
), C =
|
|
2265
|
+
), C = i.find(
|
|
2266
2266
|
(V) => isRuleEntry(V) && RuleBuilder.simplify(V).property == "trigger.time"
|
|
2267
2267
|
);
|
|
2268
2268
|
return {
|
|
2269
|
-
date:
|
|
2269
|
+
date: c ? RuleBuilder.simplify(c).equator : null,
|
|
2270
2270
|
time: C ? RuleBuilder.simplify(C).equator : null
|
|
2271
2271
|
};
|
|
2272
|
-
}),
|
|
2272
|
+
}), k = computed(
|
|
2273
2273
|
() => calculateNextScheduleAt(
|
|
2274
|
-
|
|
2274
|
+
m.modelValue,
|
|
2275
2275
|
/* @__PURE__ */ new Date(),
|
|
2276
|
-
|
|
2277
|
-
|
|
2276
|
+
m.startDate ? new Date(m.startDate) : /* @__PURE__ */ new Date(),
|
|
2277
|
+
m.endDate ? new Date(m.endDate) : void 0
|
|
2278
2278
|
)
|
|
2279
2279
|
);
|
|
2280
|
-
function x(
|
|
2281
|
-
|
|
2280
|
+
function x(i, c) {
|
|
2281
|
+
d(
|
|
2282
2282
|
"update:model-value",
|
|
2283
2283
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
2284
|
-
RuleBuilder.constructEntry("trigger.date", "_rrule",
|
|
2285
|
-
RuleBuilder.constructEntry("trigger.time", "_isOnTime",
|
|
2284
|
+
RuleBuilder.constructEntry("trigger.date", "_rrule", i),
|
|
2285
|
+
RuleBuilder.constructEntry("trigger.time", "_isOnTime", c ?? "00:00")
|
|
2286
2286
|
])
|
|
2287
2287
|
);
|
|
2288
2288
|
}
|
|
2289
2289
|
watch(
|
|
2290
|
-
() =>
|
|
2291
|
-
(
|
|
2292
|
-
if (!
|
|
2293
|
-
const C = RRule.fromString(
|
|
2290
|
+
() => m.startDate,
|
|
2291
|
+
(i, c) => {
|
|
2292
|
+
if (!i || i === c || a.value !== "repeating" || !s.value.date) return;
|
|
2293
|
+
const C = RRule.fromString(s.value.date), V = new RRule({
|
|
2294
2294
|
...C.origOptions,
|
|
2295
|
-
dtstart: new Date(
|
|
2295
|
+
dtstart: new Date(i)
|
|
2296
2296
|
}).toString();
|
|
2297
|
-
V !==
|
|
2297
|
+
V !== s.value.date && (x(V, s.value.time), y.value = !0);
|
|
2298
2298
|
}
|
|
2299
2299
|
);
|
|
2300
|
-
function
|
|
2301
|
-
const
|
|
2302
|
-
startDate:
|
|
2303
|
-
}), V =
|
|
2300
|
+
function h(i) {
|
|
2301
|
+
const c = i.value, C = getRruleAnchorDate({
|
|
2302
|
+
startDate: m.startDate ? new Date(m.startDate) : void 0
|
|
2303
|
+
}), V = c == "fixed" ? [
|
|
2304
2304
|
RuleBuilder.constructEntry(
|
|
2305
2305
|
"trigger.date",
|
|
2306
2306
|
"_isOnDate",
|
|
@@ -2323,56 +2323,56 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2323
2323
|
),
|
|
2324
2324
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
2325
2325
|
];
|
|
2326
|
-
|
|
2326
|
+
d(
|
|
2327
2327
|
"update:model-value",
|
|
2328
2328
|
RuleBuilder.setRuleToGroup(
|
|
2329
2329
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2330
2330
|
V
|
|
2331
2331
|
)
|
|
2332
|
-
), a.value =
|
|
2332
|
+
), a.value = c, y.value = !1;
|
|
2333
2333
|
}
|
|
2334
|
-
function v(
|
|
2335
|
-
a.value == "fixed" ?
|
|
2334
|
+
function v(i) {
|
|
2335
|
+
a.value == "fixed" ? d(
|
|
2336
2336
|
"update:model-value",
|
|
2337
2337
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
2338
2338
|
RuleBuilder.constructEntry(
|
|
2339
2339
|
"trigger.date",
|
|
2340
2340
|
"_isOnDate",
|
|
2341
|
-
|
|
2341
|
+
i.date
|
|
2342
2342
|
),
|
|
2343
2343
|
RuleBuilder.constructEntry(
|
|
2344
2344
|
"trigger.time",
|
|
2345
2345
|
"_isOnTime",
|
|
2346
|
-
|
|
2346
|
+
i.time
|
|
2347
2347
|
)
|
|
2348
2348
|
])
|
|
2349
|
-
) : x(
|
|
2349
|
+
) : x(i.date, i.time), y.value = !1;
|
|
2350
2350
|
}
|
|
2351
|
-
return (
|
|
2351
|
+
return (i, c) => {
|
|
2352
2352
|
const C = resolveComponent("FmButtonGroup"), V = resolveComponent("FmTimePicker"), $ = resolveComponent("FmIcon"), S = resolveComponent("FmTooltip"), w = resolveComponent("FmField"), R = resolveComponent("FmCard"), F = resolveComponent("FmPopover"), M = resolveComponent("FmDatePicker"), H = resolveComponent("FmHelperText");
|
|
2353
2353
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2354
2354
|
createVNode(C, {
|
|
2355
2355
|
items: unref(f),
|
|
2356
2356
|
"model-value": unref(f).find((I) => I.value === unref(a)) ?? null,
|
|
2357
|
-
"onUpdate:modelValue":
|
|
2357
|
+
"onUpdate:modelValue": h,
|
|
2358
2358
|
class: "mb-8"
|
|
2359
2359
|
}, null, 8, ["items", "model-value"]),
|
|
2360
|
-
createElementVNode("div", _hoisted_1$
|
|
2361
|
-
createElementVNode("div", _hoisted_2$
|
|
2360
|
+
createElementVNode("div", _hoisted_1$g, [
|
|
2361
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
2362
2362
|
createVNode(V, {
|
|
2363
2363
|
label: unref(o)("connect.template.rule.schedule.notify_time"),
|
|
2364
|
-
"model-value": unref(
|
|
2365
|
-
"onUpdate:modelValue":
|
|
2366
|
-
"helper-text": unref(
|
|
2367
|
-
"helper-state": unref(
|
|
2364
|
+
"model-value": unref(s).time,
|
|
2365
|
+
"onUpdate:modelValue": c[0] || (c[0] = (I) => v({ date: unref(s).date, time: I })),
|
|
2366
|
+
"helper-text": unref(s).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
|
|
2367
|
+
"helper-state": unref(s).time ? void 0 : "error"
|
|
2368
2368
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
2369
|
-
unref(a) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
2370
|
-
createElementVNode("div", _hoisted_4$
|
|
2369
|
+
unref(a) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
|
|
2370
|
+
createElementVNode("div", _hoisted_4$a, [
|
|
2371
2371
|
createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
|
|
2372
|
-
unref(
|
|
2372
|
+
unref(s).date ? (openBlock(), createBlock(S, {
|
|
2373
2373
|
key: 0,
|
|
2374
2374
|
"z-index": 9999,
|
|
2375
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
2375
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options)
|
|
2376
2376
|
}, {
|
|
2377
2377
|
default: withCtx(() => [
|
|
2378
2378
|
createVNode($, {
|
|
@@ -2385,17 +2385,17 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2385
2385
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
2386
2386
|
]),
|
|
2387
2387
|
createVNode(F, {
|
|
2388
|
-
"show-popover": unref(
|
|
2389
|
-
onPopoverChanged:
|
|
2388
|
+
"show-popover": unref(u),
|
|
2389
|
+
onPopoverChanged: c[3] || (c[3] = (I) => u.value = I)
|
|
2390
2390
|
}, {
|
|
2391
2391
|
"popover-button": withCtx(() => [
|
|
2392
2392
|
createVNode(w, {
|
|
2393
2393
|
class: "cursor-pointer",
|
|
2394
|
-
"helper-text": unref(
|
|
2395
|
-
"helper-state": unref(
|
|
2394
|
+
"helper-text": unref(s).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
2395
|
+
"helper-state": unref(s).date ? void 0 : "error"
|
|
2396
2396
|
}, {
|
|
2397
2397
|
default: withCtx(() => [
|
|
2398
|
-
createElementVNode("div", _hoisted_5$
|
|
2398
|
+
createElementVNode("div", _hoisted_5$8, toDisplayString(unref(s).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
|
|
2399
2399
|
]),
|
|
2400
2400
|
_: 1
|
|
2401
2401
|
}, 8, ["helper-text", "helper-state"])
|
|
@@ -2403,12 +2403,12 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2403
2403
|
default: withCtx(() => [
|
|
2404
2404
|
createVNode(R, { class: "elevated p-8 w-[450px]" }, {
|
|
2405
2405
|
default: withCtx(() => [
|
|
2406
|
-
createVNode(_sfc_main$
|
|
2406
|
+
createVNode(_sfc_main$z, {
|
|
2407
2407
|
"apply-button": !0,
|
|
2408
|
-
"model-value": unref(
|
|
2408
|
+
"model-value": unref(s).date || "",
|
|
2409
2409
|
"start-date": e.startDate ? new Date(e.startDate) : /* @__PURE__ */ new Date(),
|
|
2410
|
-
onCancel:
|
|
2411
|
-
"onUpdate:modelValue":
|
|
2410
|
+
onCancel: c[1] || (c[1] = (I) => u.value = !1),
|
|
2411
|
+
"onUpdate:modelValue": c[2] || (c[2] = (I) => (v({ date: I, time: unref(s).time }), u.value = !1))
|
|
2412
2412
|
}, null, 8, ["model-value", "start-date"])
|
|
2413
2413
|
]),
|
|
2414
2414
|
_: 1
|
|
@@ -2419,18 +2419,18 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2419
2419
|
])) : (openBlock(), createBlock(M, {
|
|
2420
2420
|
key: 1,
|
|
2421
2421
|
label: unref(o)("connect.template.rule.schedule.notify_date"),
|
|
2422
|
-
"model-value": unref(
|
|
2423
|
-
"onUpdate:modelValue":
|
|
2424
|
-
"helper-text": unref(
|
|
2425
|
-
"helper-state": unref(
|
|
2422
|
+
"model-value": unref(s).date || "",
|
|
2423
|
+
"onUpdate:modelValue": c[4] || (c[4] = (I) => v({ date: I, time: unref(s).time })),
|
|
2424
|
+
"helper-text": unref(s).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
2425
|
+
"helper-state": unref(s).date ? void 0 : "error"
|
|
2426
2426
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
2427
2427
|
]),
|
|
2428
|
-
unref(
|
|
2428
|
+
unref(s).date && unref(s).time && unref(k) ? (openBlock(), createBlock(H, {
|
|
2429
2429
|
key: 0,
|
|
2430
|
-
text: `${unref(moment)(unref(
|
|
2431
|
-
${unref(moment)(unref(
|
|
2430
|
+
text: `${unref(moment)(unref(k)).isAfter(unref(moment)()) ? unref(o)("connect.template.rule.schedule.next_notification") : unref(o)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(k)).format("dddd, DD MMM YYYY")} at
|
|
2431
|
+
${unref(moment)(unref(k)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(k)).fromNow()})`
|
|
2432
2432
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2433
|
-
unref(
|
|
2433
|
+
unref(y) ? (openBlock(), createBlock(H, {
|
|
2434
2434
|
key: 1,
|
|
2435
2435
|
text: "Repeating schedule was updated to stay anchored to the campaign start date.",
|
|
2436
2436
|
state: "warning"
|
|
@@ -2439,7 +2439,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2439
2439
|
], 64);
|
|
2440
2440
|
};
|
|
2441
2441
|
}
|
|
2442
|
-
}), _hoisted_1$
|
|
2442
|
+
}), _hoisted_1$f = { class: "space-y-16" }, _hoisted_2$c = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$9 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
2443
2443
|
__name: "GameTypeInput",
|
|
2444
2444
|
props: {
|
|
2445
2445
|
modelValue: {
|
|
@@ -2448,7 +2448,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2448
2448
|
},
|
|
2449
2449
|
emits: ["update:model-value"],
|
|
2450
2450
|
setup(e, { emit: r }) {
|
|
2451
|
-
const { t: o } = useI18n(),
|
|
2451
|
+
const { t: o } = useI18n(), m = e, d = r, p = computed(
|
|
2452
2452
|
() => [
|
|
2453
2453
|
{
|
|
2454
2454
|
label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -2466,24 +2466,24 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2466
2466
|
);
|
|
2467
2467
|
return (l, n) => {
|
|
2468
2468
|
const a = resolveComponent("FmCard");
|
|
2469
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2470
|
-
createElementVNode("div", _hoisted_2$
|
|
2471
|
-
createElementVNode("div", _hoisted_3$
|
|
2472
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2469
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
2470
|
+
createElementVNode("div", _hoisted_2$c, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
2471
|
+
createElementVNode("div", _hoisted_3$9, [
|
|
2472
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (u) => (openBlock(), createBlock(a, {
|
|
2473
2473
|
variant: "outlined",
|
|
2474
2474
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2475
|
-
"col-span-2": unref(
|
|
2476
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
2477
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
2475
|
+
"col-span-2": unref(p).length == 1,
|
|
2476
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == u.value,
|
|
2477
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != u.value
|
|
2478
2478
|
}]),
|
|
2479
2479
|
onClick: () => {
|
|
2480
|
-
|
|
2480
|
+
m.modelValue != u.value && d("update:model-value", u.value);
|
|
2481
2481
|
},
|
|
2482
|
-
key:
|
|
2482
|
+
key: u.value
|
|
2483
2483
|
}, {
|
|
2484
2484
|
default: withCtx(() => [
|
|
2485
|
-
createElementVNode("div", _hoisted_4$
|
|
2486
|
-
createElementVNode("div", _hoisted_5$
|
|
2485
|
+
createElementVNode("div", _hoisted_4$9, toDisplayString(u.label), 1),
|
|
2486
|
+
createElementVNode("div", _hoisted_5$7, toDisplayString(u.description), 1)
|
|
2487
2487
|
]),
|
|
2488
2488
|
_: 2
|
|
2489
2489
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -2491,41 +2491,41 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2491
2491
|
]);
|
|
2492
2492
|
};
|
|
2493
2493
|
}
|
|
2494
|
-
}), _hoisted_1$
|
|
2494
|
+
}), _hoisted_1$e = {
|
|
2495
2495
|
key: 0,
|
|
2496
2496
|
class: "flex flex-col gap-y-24"
|
|
2497
|
-
}, _hoisted_2$
|
|
2497
|
+
}, _hoisted_2$b = { class: "flex gap-8 items-center justify-start" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
2498
2498
|
__name: "EditRewardPoolSheet",
|
|
2499
2499
|
emits: ["update:model-value"],
|
|
2500
2500
|
setup(e, { expose: r, emit: o }) {
|
|
2501
|
-
const
|
|
2501
|
+
const m = useMembershipStore(), { minor: d } = useLoading, p = ref(!1), l = ref(), n = ref(), a = ref(0), u = computed(
|
|
2502
2502
|
() => {
|
|
2503
2503
|
var v;
|
|
2504
|
-
return (v =
|
|
2505
|
-
(
|
|
2506
|
-
var
|
|
2507
|
-
return
|
|
2504
|
+
return (v = m.loyaltyRewards.items.find(
|
|
2505
|
+
(i) => {
|
|
2506
|
+
var c;
|
|
2507
|
+
return i.value === ((c = l.value) == null ? void 0 : c.collectible);
|
|
2508
2508
|
}
|
|
2509
2509
|
)) == null ? void 0 : v.raw.type;
|
|
2510
2510
|
}
|
|
2511
|
-
),
|
|
2511
|
+
), y = computed(
|
|
2512
2512
|
() => {
|
|
2513
2513
|
var v;
|
|
2514
|
-
return ((v = l.value) == null ? void 0 : v.type) === "LOYALTY" && (
|
|
2514
|
+
return ((v = l.value) == null ? void 0 : v.type) === "LOYALTY" && (u.value === "CREDIT" || u.value === "TITLE");
|
|
2515
2515
|
}
|
|
2516
2516
|
), f = computed(
|
|
2517
|
-
() =>
|
|
2518
|
-
),
|
|
2517
|
+
() => y.value ? FdoCreditLoyaltyReward : FdtoRandomReward
|
|
2518
|
+
), s = computed(() => {
|
|
2519
2519
|
const v = f.value.safeParse(l.value);
|
|
2520
2520
|
return v.success ? [] : v.error.errors;
|
|
2521
2521
|
});
|
|
2522
|
-
function
|
|
2523
|
-
v && (l.value =
|
|
2522
|
+
function k(v, i, c) {
|
|
2523
|
+
v && (l.value = i, a.value = c), p.value = v;
|
|
2524
2524
|
}
|
|
2525
2525
|
const x = o;
|
|
2526
|
-
async function
|
|
2526
|
+
async function h() {
|
|
2527
2527
|
const v = f.value.safeParse(l.value);
|
|
2528
|
-
v.success && (await
|
|
2528
|
+
v.success && (await d(
|
|
2529
2529
|
async () => {
|
|
2530
2530
|
v.data.type === "VOUCHER" && n.value && (v.data.collectibleConfig.image = await firebaseStorage.update(
|
|
2531
2531
|
v.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
@@ -2539,41 +2539,41 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2539
2539
|
), x("update:model-value", v.data, a.value));
|
|
2540
2540
|
}
|
|
2541
2541
|
return r({
|
|
2542
|
-
showSheet:
|
|
2543
|
-
}), (v,
|
|
2544
|
-
const
|
|
2542
|
+
showSheet: k
|
|
2543
|
+
}), (v, i) => {
|
|
2544
|
+
const c = resolveComponent("FmSelect"), C = resolveComponent("FmStepperField"), V = resolveComponent("FmButton"), $ = resolveComponent("FmSideSheet");
|
|
2545
2545
|
return openBlock(), createBlock($, {
|
|
2546
2546
|
"max-width": 560,
|
|
2547
|
-
modelValue: unref(
|
|
2547
|
+
modelValue: unref(p),
|
|
2548
2548
|
"onUpdate:modelValue": [
|
|
2549
|
-
|
|
2550
|
-
|
|
2549
|
+
i[9] || (i[9] = (S) => isRef(p) ? p.value = S : null),
|
|
2550
|
+
i[10] || (i[10] = (S) => p.value = S)
|
|
2551
2551
|
],
|
|
2552
2552
|
header: "Edit reward",
|
|
2553
2553
|
"dismiss-away": ""
|
|
2554
2554
|
}, {
|
|
2555
2555
|
"side-sheet-footer": withCtx(() => [
|
|
2556
|
-
createElementVNode("div", _hoisted_2$
|
|
2556
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
2557
2557
|
createVNode(V, {
|
|
2558
2558
|
variant: "primary",
|
|
2559
2559
|
type: "button",
|
|
2560
|
-
disabled: unref(
|
|
2560
|
+
disabled: unref(s).length > 0,
|
|
2561
2561
|
label: "Confirm",
|
|
2562
|
-
onClick:
|
|
2562
|
+
onClick: i[7] || (i[7] = (S) => h())
|
|
2563
2563
|
}, null, 8, ["disabled"]),
|
|
2564
2564
|
createVNode(V, {
|
|
2565
2565
|
variant: "secondary",
|
|
2566
2566
|
type: "button",
|
|
2567
2567
|
label: "Cancel",
|
|
2568
|
-
onClick:
|
|
2568
|
+
onClick: i[8] || (i[8] = (S) => p.value = !1)
|
|
2569
2569
|
})
|
|
2570
2570
|
])
|
|
2571
2571
|
]),
|
|
2572
2572
|
default: withCtx(() => {
|
|
2573
2573
|
var S;
|
|
2574
2574
|
return [
|
|
2575
|
-
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2576
|
-
createVNode(
|
|
2575
|
+
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
2576
|
+
createVNode(c, {
|
|
2577
2577
|
label: "Reward Type",
|
|
2578
2578
|
items: [
|
|
2579
2579
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -2581,7 +2581,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2581
2581
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2582
2582
|
],
|
|
2583
2583
|
"model-value": unref(l).type,
|
|
2584
|
-
"onUpdate:modelValue":
|
|
2584
|
+
"onUpdate:modelValue": i[0] || (i[0] = (w) => {
|
|
2585
2585
|
w == "NO_REWARD" ? l.value = {
|
|
2586
2586
|
type: "NO_REWARD",
|
|
2587
2587
|
collectible: null,
|
|
@@ -2601,7 +2601,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2601
2601
|
},
|
|
2602
2602
|
weight: 1
|
|
2603
2603
|
} : l.value = {
|
|
2604
|
-
collectible: unref(
|
|
2604
|
+
collectible: unref(m).loyaltyRewards.raw[0]._id,
|
|
2605
2605
|
type: "LOYALTY",
|
|
2606
2606
|
earningOption: {
|
|
2607
2607
|
amount: 1,
|
|
@@ -2614,65 +2614,65 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2614
2614
|
};
|
|
2615
2615
|
})
|
|
2616
2616
|
}, null, 8, ["model-value"]),
|
|
2617
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
2617
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(c, {
|
|
2618
2618
|
key: 0,
|
|
2619
2619
|
label: "Loyalty type",
|
|
2620
2620
|
rules: [unref(ZodHelper).ruleAtPath(unref(f), "collectible", [unref(l).type])],
|
|
2621
|
-
items: unref(
|
|
2621
|
+
items: unref(m).loyaltyRewards.items,
|
|
2622
2622
|
"model-value": unref(l).collectible,
|
|
2623
|
-
"onUpdate:modelValue":
|
|
2623
|
+
"onUpdate:modelValue": i[1] || (i[1] = (w) => unref(l).collectible = w)
|
|
2624
2624
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2625
2625
|
createVNode(C, {
|
|
2626
2626
|
label: "Weight",
|
|
2627
2627
|
rules: [unref(ZodHelper).ruleAtPath(unref(f), "weight", [unref(l).type])],
|
|
2628
2628
|
"model-value": unref(l).weight,
|
|
2629
|
-
"onUpdate:modelValue":
|
|
2629
|
+
"onUpdate:modelValue": i[2] || (i[2] = (w) => l.value = {
|
|
2630
2630
|
...unref(l),
|
|
2631
2631
|
weight: w
|
|
2632
2632
|
})
|
|
2633
2633
|
}, null, 8, ["rules", "model-value"]),
|
|
2634
2634
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2635
|
-
unref(
|
|
2636
|
-
|
|
2637
|
-
createVNode(_sfc_main$
|
|
2635
|
+
unref(u) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2636
|
+
i[11] || (i[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
2637
|
+
createVNode(_sfc_main$A, {
|
|
2638
2638
|
class: "mt-[-8px]",
|
|
2639
2639
|
rules: [
|
|
2640
2640
|
unref(ZodHelper).ruleAtPath(unref(f), "earningOption", [unref(l).type])
|
|
2641
2641
|
],
|
|
2642
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2643
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
2642
|
+
"helper-state": unref(ZodHelper).helperState(unref(s), "earningOption"),
|
|
2643
|
+
"error-text": unref(ZodHelper).helperText(unref(s), "earningOption"),
|
|
2644
2644
|
"fixed-type": !0,
|
|
2645
2645
|
"model-value": unref(l).earningOption,
|
|
2646
|
-
"onUpdate:modelValue":
|
|
2646
|
+
"onUpdate:modelValue": i[3] || (i[3] = (w) => l.value = {
|
|
2647
2647
|
...unref(l),
|
|
2648
2648
|
earningOption: w
|
|
2649
2649
|
})
|
|
2650
2650
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
2651
2651
|
], 64)) : createCommentVNode("", !0),
|
|
2652
|
-
|
|
2653
|
-
createVNode(_sfc_main$
|
|
2652
|
+
i[12] || (i[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
2653
|
+
createVNode(_sfc_main$B, {
|
|
2654
2654
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
2655
|
-
"for-credit": unref(
|
|
2655
|
+
"for-credit": unref(y),
|
|
2656
2656
|
class: "!gap-24",
|
|
2657
2657
|
rules: [unref(ZodHelper).ruleAtPath(unref(f), "validityOption", [unref(l).type])],
|
|
2658
2658
|
"model-value": unref(l).validityOption,
|
|
2659
|
-
"onUpdate:modelValue":
|
|
2659
|
+
"onUpdate:modelValue": i[4] || (i[4] = (w) => l.value = {
|
|
2660
2660
|
...unref(l),
|
|
2661
2661
|
validityOption: w
|
|
2662
2662
|
})
|
|
2663
2663
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
2664
2664
|
], 64)) : createCommentVNode("", !0),
|
|
2665
|
-
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$
|
|
2665
|
+
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$C, {
|
|
2666
2666
|
key: 2,
|
|
2667
2667
|
"reward-image": unref(n),
|
|
2668
2668
|
"model-value": ((S = unref(l)) == null ? void 0 : S.collectibleConfig) ?? void 0,
|
|
2669
|
-
"onUpdate:modelValue":
|
|
2669
|
+
"onUpdate:modelValue": i[5] || (i[5] = (w) => l.value = {
|
|
2670
2670
|
...unref(l),
|
|
2671
2671
|
collectibleConfig: w
|
|
2672
2672
|
}),
|
|
2673
|
-
"onUpdate:rewardImage":
|
|
2673
|
+
"onUpdate:rewardImage": i[6] || (i[6] = (w) => n.value = w)
|
|
2674
2674
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2675
|
-
createVNode(JsonViewer, { json: unref(
|
|
2675
|
+
createVNode(JsonViewer, { json: unref(s) }, null, 8, ["json"])
|
|
2676
2676
|
])) : createCommentVNode("", !0)
|
|
2677
2677
|
];
|
|
2678
2678
|
}),
|
|
@@ -2684,7 +2684,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2684
2684
|
function isNullOrEmpty(e) {
|
|
2685
2685
|
return e == null || e === "";
|
|
2686
2686
|
}
|
|
2687
|
-
const _hoisted_1$
|
|
2687
|
+
const _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$8 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$8 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
2688
2688
|
__name: "RewardPoolInput",
|
|
2689
2689
|
props: {
|
|
2690
2690
|
modelValue: {
|
|
@@ -2700,36 +2700,36 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2700
2700
|
},
|
|
2701
2701
|
emits: ["update:model-value"],
|
|
2702
2702
|
setup(e, { emit: r }) {
|
|
2703
|
-
const o = e,
|
|
2704
|
-
const
|
|
2705
|
-
return
|
|
2706
|
-
}),
|
|
2707
|
-
function
|
|
2708
|
-
var
|
|
2709
|
-
const
|
|
2710
|
-
|
|
2703
|
+
const o = e, m = r, d = useMembershipStore(), { t: p } = useI18n(), l = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), n = computed(() => o.modelValue ?? []), a = computed(() => {
|
|
2704
|
+
const h = l.safeParse(n.value);
|
|
2705
|
+
return h.success ? [] : h.error.errors;
|
|
2706
|
+
}), u = ref();
|
|
2707
|
+
function y(h, v) {
|
|
2708
|
+
var c;
|
|
2709
|
+
const i = [...n.value];
|
|
2710
|
+
i[v] = h, (c = u.value) == null || c.showSheet(!1), m("update:model-value", i);
|
|
2711
2711
|
}
|
|
2712
|
-
function f(
|
|
2713
|
-
const v =
|
|
2714
|
-
(C) => C._id.toString() ==
|
|
2715
|
-
),
|
|
2712
|
+
function f(h) {
|
|
2713
|
+
const v = h.type == "VOUCHER" ? h.collectibleConfig : d.collectibles.find(
|
|
2714
|
+
(C) => C._id.toString() == h.collectible
|
|
2715
|
+
), i = CollectionUtils.formattedType((v == null ? void 0 : v.name) || ""), c = h.weight;
|
|
2716
2716
|
return {
|
|
2717
|
-
label: isNullOrEmpty(
|
|
2718
|
-
sublabel: `${
|
|
2717
|
+
label: isNullOrEmpty(i) ? "NO REWARD" : i,
|
|
2718
|
+
sublabel: `${c} (${(c / n.value.reduce((C, V) => C + V.weight, 0) * 100).toFixed(2)}%)`
|
|
2719
2719
|
};
|
|
2720
2720
|
}
|
|
2721
|
-
function
|
|
2722
|
-
var
|
|
2721
|
+
function s(h) {
|
|
2722
|
+
var i;
|
|
2723
2723
|
const v = [...n.value];
|
|
2724
|
-
(
|
|
2724
|
+
(i = u.value) == null || i.showSheet(!0, v[h], h);
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2726
|
+
function k(h) {
|
|
2727
2727
|
const v = [...n.value];
|
|
2728
|
-
v.splice(
|
|
2728
|
+
v.splice(h, 1), m("update:model-value", v);
|
|
2729
2729
|
}
|
|
2730
2730
|
function x() {
|
|
2731
|
-
var
|
|
2732
|
-
(
|
|
2731
|
+
var h;
|
|
2732
|
+
(h = u.value) == null || h.showSheet(
|
|
2733
2733
|
!0,
|
|
2734
2734
|
{
|
|
2735
2735
|
type: "NO_REWARD",
|
|
@@ -2739,33 +2739,33 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2739
2739
|
n.value.length
|
|
2740
2740
|
);
|
|
2741
2741
|
}
|
|
2742
|
-
return (
|
|
2743
|
-
const
|
|
2744
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2745
|
-
createElementVNode("div", _hoisted_2$
|
|
2746
|
-
createVNode(
|
|
2747
|
-
label: unref(
|
|
2742
|
+
return (h, v) => {
|
|
2743
|
+
const i = resolveComponent("FmButton"), c = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2744
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
2745
|
+
createElementVNode("div", _hoisted_2$a, toDisplayString(unref(p)("connect.template.configure_reward_type")), 1),
|
|
2746
|
+
createVNode(i, {
|
|
2747
|
+
label: unref(p)("connect.campaign.rewardPool.addReward"),
|
|
2748
2748
|
onClick: v[0] || (v[0] = (V) => x()),
|
|
2749
2749
|
variant: "plain",
|
|
2750
2750
|
icon: "add"
|
|
2751
2751
|
}, null, 8, ["label"]),
|
|
2752
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (V, $) => (openBlock(), createBlock(
|
|
2752
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (V, $) => (openBlock(), createBlock(c, {
|
|
2753
2753
|
key: $,
|
|
2754
2754
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2755
2755
|
variant: "outlined",
|
|
2756
|
-
onClick: (S) =>
|
|
2756
|
+
onClick: (S) => s($)
|
|
2757
2757
|
}, {
|
|
2758
2758
|
default: withCtx(() => {
|
|
2759
2759
|
var S;
|
|
2760
2760
|
return [
|
|
2761
2761
|
createElementVNode("div", null, [
|
|
2762
|
-
createElementVNode("div", _hoisted_3$
|
|
2763
|
-
createElementVNode("div", _hoisted_4$
|
|
2762
|
+
createElementVNode("div", _hoisted_3$8, toDisplayString(V.type == "LOYALTY" ? (S = V == null ? void 0 : V.earningOption) == null ? void 0 : S.amount : "") + " " + toDisplayString(f(V).label), 1),
|
|
2763
|
+
createElementVNode("div", _hoisted_4$8, toDisplayString(f(V).sublabel), 1)
|
|
2764
2764
|
]),
|
|
2765
|
-
createVNode(
|
|
2765
|
+
createVNode(i, {
|
|
2766
2766
|
icon: "delete",
|
|
2767
2767
|
variant: "tertiary",
|
|
2768
|
-
onClick: (w) => (w.stopPropagation(),
|
|
2768
|
+
onClick: (w) => (w.stopPropagation(), k($))
|
|
2769
2769
|
}, null, 8, ["onClick"])
|
|
2770
2770
|
];
|
|
2771
2771
|
}),
|
|
@@ -2776,18 +2776,18 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2776
2776
|
text: V.message,
|
|
2777
2777
|
state: "error"
|
|
2778
2778
|
}, null, 8, ["text"]))), 128)),
|
|
2779
|
-
createVNode(_sfc_main$
|
|
2779
|
+
createVNode(_sfc_main$e, {
|
|
2780
2780
|
ref_key: "sheetRef",
|
|
2781
|
-
ref:
|
|
2782
|
-
"onUpdate:modelValue":
|
|
2781
|
+
ref: u,
|
|
2782
|
+
"onUpdate:modelValue": y
|
|
2783
2783
|
}, null, 512)
|
|
2784
2784
|
]);
|
|
2785
2785
|
};
|
|
2786
2786
|
}
|
|
2787
|
-
}), _hoisted_1$
|
|
2787
|
+
}), _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = {
|
|
2788
2788
|
key: 0,
|
|
2789
2789
|
class: "grid grid-cols-2 gap-16"
|
|
2790
|
-
}, _hoisted_3$
|
|
2790
|
+
}, _hoisted_3$7 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
2791
2791
|
__name: "PromotionGameTypeInput",
|
|
2792
2792
|
props: {
|
|
2793
2793
|
modelValue: {
|
|
@@ -2796,7 +2796,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2796
2796
|
},
|
|
2797
2797
|
emits: ["update:model-value"],
|
|
2798
2798
|
setup(e, { emit: r }) {
|
|
2799
|
-
const { t: o } = useI18n(),
|
|
2799
|
+
const { t: o } = useI18n(), m = e, d = r, p = computed(() => [
|
|
2800
2800
|
{
|
|
2801
2801
|
label: o("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
2802
2802
|
description: o("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -2804,39 +2804,39 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2804
2804
|
}
|
|
2805
2805
|
]);
|
|
2806
2806
|
return (l, n) => {
|
|
2807
|
-
var f,
|
|
2808
|
-
const a = resolveComponent("FmSwitch"),
|
|
2809
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2807
|
+
var f, s, k;
|
|
2808
|
+
const a = resolveComponent("FmSwitch"), u = resolveComponent("FmCard"), y = resolveComponent("FmHelperText");
|
|
2809
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2810
2810
|
createVNode(a, {
|
|
2811
2811
|
label: unref(o)("connect.template.promotion_game.enable"),
|
|
2812
2812
|
"model-value": !!((f = e.modelValue) != null && f.gameType),
|
|
2813
|
-
"onUpdate:modelValue": n[0] || (n[0] = (x) => x ?
|
|
2813
|
+
"onUpdate:modelValue": n[0] || (n[0] = (x) => x ? d("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : d("update:model-value", null))
|
|
2814
2814
|
}, null, 8, ["label", "model-value"]),
|
|
2815
|
-
((
|
|
2816
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2817
|
-
var
|
|
2818
|
-
return openBlock(), createBlock(
|
|
2815
|
+
((s = e.modelValue) == null ? void 0 : s.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$9, [
|
|
2816
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (x) => {
|
|
2817
|
+
var h, v;
|
|
2818
|
+
return openBlock(), createBlock(u, {
|
|
2819
2819
|
variant: "outlined",
|
|
2820
2820
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2821
|
-
"col-span-2": unref(
|
|
2822
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
2821
|
+
"col-span-2": unref(p).length == 1,
|
|
2822
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((h = e.modelValue) == null ? void 0 : h.gameType) == x.value,
|
|
2823
2823
|
"hover:bg-fm-color-opacity-sm": ((v = e.modelValue) == null ? void 0 : v.gameType) != x.value
|
|
2824
2824
|
}]),
|
|
2825
2825
|
onClick: () => {
|
|
2826
|
-
var
|
|
2827
|
-
((
|
|
2826
|
+
var i;
|
|
2827
|
+
((i = m.modelValue) == null ? void 0 : i.gameType) != x.value && d("update:model-value", { gameType: x.value });
|
|
2828
2828
|
},
|
|
2829
2829
|
key: x.value
|
|
2830
2830
|
}, {
|
|
2831
2831
|
default: withCtx(() => [
|
|
2832
|
-
createElementVNode("div", _hoisted_3$
|
|
2833
|
-
createElementVNode("div", _hoisted_4$
|
|
2832
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(x.label), 1),
|
|
2833
|
+
createElementVNode("div", _hoisted_4$7, toDisplayString(x.description), 1)
|
|
2834
2834
|
]),
|
|
2835
2835
|
_: 2
|
|
2836
2836
|
}, 1032, ["class", "onClick"]);
|
|
2837
2837
|
}), 128))
|
|
2838
2838
|
])) : createCommentVNode("", !0),
|
|
2839
|
-
((
|
|
2839
|
+
((k = e.modelValue) == null ? void 0 : k.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(y, {
|
|
2840
2840
|
key: 1,
|
|
2841
2841
|
text: unref(o)("connect.template.promotion_game.rock_paper_scissors.warning"),
|
|
2842
2842
|
state: "warning"
|
|
@@ -2844,10 +2844,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2844
2844
|
]);
|
|
2845
2845
|
};
|
|
2846
2846
|
}
|
|
2847
|
-
}), _hoisted_1$
|
|
2847
|
+
}), _hoisted_1$b = { class: "space-y-8" }, _hoisted_2$8 = { class: "grid gap-16 grid-cols-2" }, _hoisted_3$6 = { class: "space-y-6" }, _hoisted_4$6 = { class: "space-y-8" }, _hoisted_5$6 = { class: "fm-typo-en-body-lg-600" }, _hoisted_6$5 = { class: "flex items-center space-x-3" }, _hoisted_7$4 = {
|
|
2848
2848
|
key: 0,
|
|
2849
2849
|
class: "ml-6 space-y-2"
|
|
2850
|
-
}, _sfc_main$
|
|
2850
|
+
}, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2851
2851
|
__name: "GrabConditionsInput",
|
|
2852
2852
|
props: {
|
|
2853
2853
|
modelValue: {
|
|
@@ -2860,12 +2860,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2860
2860
|
},
|
|
2861
2861
|
emits: ["update:model-value"],
|
|
2862
2862
|
setup(e, { emit: r }) {
|
|
2863
|
-
const { t: o } = useI18n(),
|
|
2863
|
+
const { t: o } = useI18n(), m = e, d = r, p = ref(m.modelValue ?? {}), l = ref(
|
|
2864
2864
|
(() => {
|
|
2865
2865
|
const f = {};
|
|
2866
|
-
return
|
|
2867
|
-
const
|
|
2868
|
-
|
|
2866
|
+
return p.value.workingHour && Object.keys(p.value.workingHour).forEach((s) => {
|
|
2867
|
+
const k = p.value.workingHour[s];
|
|
2868
|
+
k && "periods" in k && Array.isArray(k.periods) ? f[s] = k.periods : Array.isArray(k) && (f[s] = k);
|
|
2869
2869
|
}), f;
|
|
2870
2870
|
})()
|
|
2871
2871
|
), n = [
|
|
@@ -2880,26 +2880,26 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2880
2880
|
l.value[f] || (l.value[f] = []), l.value[f].push({
|
|
2881
2881
|
startTime: "00:00",
|
|
2882
2882
|
endTime: "23:59"
|
|
2883
|
-
}),
|
|
2884
|
-
},
|
|
2885
|
-
l.value[f] && l.value[f].length >
|
|
2886
|
-
},
|
|
2883
|
+
}), y();
|
|
2884
|
+
}, u = (f, s) => {
|
|
2885
|
+
l.value[f] && l.value[f].length > s && (l.value[f].splice(s, 1), l.value[f].length === 0 && delete l.value[f], y());
|
|
2886
|
+
}, y = () => {
|
|
2887
2887
|
const f = Object.keys(l.value).reduce(
|
|
2888
|
-
(
|
|
2889
|
-
periods: l.value[
|
|
2890
|
-
}),
|
|
2888
|
+
(s, k) => (l.value[k] && l.value[k].length > 0 && (s[k] = {
|
|
2889
|
+
periods: l.value[k]
|
|
2890
|
+
}), s),
|
|
2891
2891
|
{}
|
|
2892
2892
|
);
|
|
2893
|
-
|
|
2893
|
+
p.value.workingHour = Object.keys(f).length > 0 ? f : void 0;
|
|
2894
2894
|
};
|
|
2895
|
-
return watch(
|
|
2896
|
-
const
|
|
2897
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2898
|
-
createElementVNode("div", _hoisted_2$
|
|
2899
|
-
createVNode(
|
|
2895
|
+
return watch(p, () => d("update:model-value", p.value), { deep: !0 }), watch(l, y, { deep: !0 }), (f, s) => {
|
|
2896
|
+
const k = resolveComponent("FmSelect"), x = resolveComponent("FmStepperField"), h = resolveComponent("FmCheckbox"), v = resolveComponent("FmTimePicker"), i = resolveComponent("FmButton");
|
|
2897
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
2898
|
+
createElementVNode("div", _hoisted_2$8, [
|
|
2899
|
+
createVNode(k, {
|
|
2900
2900
|
label: unref(o)("connect.template.eaterType"),
|
|
2901
|
-
modelValue: unref(
|
|
2902
|
-
"onUpdate:modelValue":
|
|
2901
|
+
modelValue: unref(p).eaterType,
|
|
2902
|
+
"onUpdate:modelValue": s[0] || (s[0] = (c) => unref(p).eaterType = c),
|
|
2903
2903
|
items: [
|
|
2904
2904
|
{ label: unref(o)("connect.template.allEaters"), value: "all" },
|
|
2905
2905
|
{ label: unref(o)("connect.template.newEatersOnly"), value: "new" },
|
|
@@ -2911,8 +2911,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2911
2911
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
|
|
2912
2912
|
}, null, 8, ["label", "modelValue", "items", "rules"]),
|
|
2913
2913
|
createVNode(x, {
|
|
2914
|
-
modelValue: unref(
|
|
2915
|
-
"onUpdate:modelValue":
|
|
2914
|
+
modelValue: unref(p).minBasketAmount,
|
|
2915
|
+
"onUpdate:modelValue": s[1] || (s[1] = (c) => unref(p).minBasketAmount = c),
|
|
2916
2916
|
"show-steppers": !1,
|
|
2917
2917
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
|
|
2918
2918
|
}, {
|
|
@@ -2927,8 +2927,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2927
2927
|
_: 1
|
|
2928
2928
|
}, 8, ["modelValue", "rules"]),
|
|
2929
2929
|
createVNode(x, {
|
|
2930
|
-
modelValue: unref(
|
|
2931
|
-
"onUpdate:modelValue":
|
|
2930
|
+
modelValue: unref(p).bundleQuantity,
|
|
2931
|
+
"onUpdate:modelValue": s[2] || (s[2] = (c) => unref(p).bundleQuantity = c),
|
|
2932
2932
|
"show-steppers": !1,
|
|
2933
2933
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
|
|
2934
2934
|
}, {
|
|
@@ -2943,49 +2943,49 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2943
2943
|
_: 1
|
|
2944
2944
|
}, 8, ["modelValue", "rules"])
|
|
2945
2945
|
]),
|
|
2946
|
-
createElementVNode("div", _hoisted_3$
|
|
2947
|
-
createElementVNode("div", _hoisted_4$
|
|
2948
|
-
createElementVNode("div", _hoisted_5$
|
|
2949
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(n, (
|
|
2950
|
-
key:
|
|
2946
|
+
createElementVNode("div", _hoisted_3$6, [
|
|
2947
|
+
createElementVNode("div", _hoisted_4$6, [
|
|
2948
|
+
createElementVNode("div", _hoisted_5$6, toDisplayString(unref(o)("connect.template.operationHours")), 1),
|
|
2949
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(n, (c) => createElementVNode("div", {
|
|
2950
|
+
key: c.key,
|
|
2951
2951
|
class: "space-y-2"
|
|
2952
2952
|
}, [
|
|
2953
|
-
createElementVNode("div", _hoisted_6$
|
|
2954
|
-
createVNode(
|
|
2955
|
-
label:
|
|
2956
|
-
"model-value": !!(unref(l)[
|
|
2953
|
+
createElementVNode("div", _hoisted_6$5, [
|
|
2954
|
+
createVNode(h, {
|
|
2955
|
+
label: c.label,
|
|
2956
|
+
"model-value": !!(unref(l)[c.key] && unref(l)[c.key].length > 0),
|
|
2957
2957
|
"onUpdate:modelValue": (C) => {
|
|
2958
|
-
C ? a(
|
|
2958
|
+
C ? a(c.key) : (unref(l)[c.key] = [], delete unref(l)[c.key], y());
|
|
2959
2959
|
}
|
|
2960
2960
|
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])
|
|
2961
2961
|
]),
|
|
2962
|
-
unref(l)[
|
|
2963
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[
|
|
2962
|
+
unref(l)[c.key] && unref(l)[c.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$4, [
|
|
2963
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[c.key] || [], (C, V) => (openBlock(), createElementBlock("div", {
|
|
2964
2964
|
key: V,
|
|
2965
2965
|
class: "flex items-center space-x-2 w-100"
|
|
2966
2966
|
}, [
|
|
2967
2967
|
createVNode(v, {
|
|
2968
2968
|
"model-value": C.startTime || "",
|
|
2969
2969
|
"onUpdate:modelValue": ($) => {
|
|
2970
|
-
unref(l)[
|
|
2970
|
+
unref(l)[c.key] && unref(l)[c.key][V] && (unref(l)[c.key][V].startTime = $ || "", y());
|
|
2971
2971
|
}
|
|
2972
2972
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2973
|
-
|
|
2973
|
+
s[3] || (s[3] = createElementVNode("span", null, "to", -1)),
|
|
2974
2974
|
createVNode(v, {
|
|
2975
2975
|
"model-value": C.endTime || "",
|
|
2976
2976
|
"onUpdate:modelValue": ($) => {
|
|
2977
|
-
unref(l)[
|
|
2977
|
+
unref(l)[c.key] && unref(l)[c.key][V] && (unref(l)[c.key][V].endTime = $ || "", y());
|
|
2978
2978
|
}
|
|
2979
2979
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2980
|
-
createVNode(
|
|
2980
|
+
createVNode(i, {
|
|
2981
2981
|
variant: "tertiary",
|
|
2982
2982
|
size: "sm",
|
|
2983
|
-
onClick: ($) =>
|
|
2983
|
+
onClick: ($) => u(c.key, V),
|
|
2984
2984
|
icon: "close"
|
|
2985
2985
|
}, null, 8, ["onClick"]),
|
|
2986
|
-
V === 0 ? (openBlock(), createBlock(
|
|
2986
|
+
V === 0 ? (openBlock(), createBlock(i, {
|
|
2987
2987
|
key: 0,
|
|
2988
|
-
onClick: ($) => a(
|
|
2988
|
+
onClick: ($) => a(c.key),
|
|
2989
2989
|
icon: "add",
|
|
2990
2990
|
variant: "plain"
|
|
2991
2991
|
}, null, 8, ["onClick"])) : createCommentVNode("", !0)
|
|
@@ -2997,7 +2997,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2997
2997
|
]);
|
|
2998
2998
|
};
|
|
2999
2999
|
}
|
|
3000
|
-
}), GrabConditionsInput = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3000
|
+
}), GrabConditionsInput = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-7f17ebe8"]]), _hoisted_1$a = { class: "space-y-8" }, _hoisted_2$7 = { class: "grid gap-16 grid-cols-2" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
3001
3001
|
__name: "GrabQuotaInput",
|
|
3002
3002
|
props: {
|
|
3003
3003
|
modelValue: {
|
|
@@ -3010,14 +3010,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3010
3010
|
},
|
|
3011
3011
|
emits: ["update:model-value"],
|
|
3012
3012
|
setup(e, { emit: r }) {
|
|
3013
|
-
const { t: o } = useI18n(),
|
|
3014
|
-
return watch(
|
|
3013
|
+
const { t: o } = useI18n(), m = e, d = r, p = ref(m.modelValue ?? {});
|
|
3014
|
+
return watch(p, () => d("update:model-value", p.value)), (l, n) => {
|
|
3015
3015
|
const a = resolveComponent("FmStepperField");
|
|
3016
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3017
|
-
createElementVNode("div", _hoisted_2$
|
|
3016
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
3017
|
+
createElementVNode("div", _hoisted_2$7, [
|
|
3018
3018
|
createVNode(a, {
|
|
3019
|
-
modelValue: unref(
|
|
3020
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
3019
|
+
modelValue: unref(p).totalCount,
|
|
3020
|
+
"onUpdate:modelValue": n[0] || (n[0] = (u) => unref(p).totalCount = u),
|
|
3021
3021
|
"show-steppers": !1,
|
|
3022
3022
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCount")]
|
|
3023
3023
|
}, {
|
|
@@ -3032,8 +3032,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3032
3032
|
_: 1
|
|
3033
3033
|
}, 8, ["modelValue", "rules"]),
|
|
3034
3034
|
createVNode(a, {
|
|
3035
|
-
modelValue: unref(
|
|
3036
|
-
"onUpdate:modelValue": n[1] || (n[1] = (
|
|
3035
|
+
modelValue: unref(p).totalCountPerUser,
|
|
3036
|
+
"onUpdate:modelValue": n[1] || (n[1] = (u) => unref(p).totalCountPerUser = u),
|
|
3037
3037
|
"show-steppers": !1,
|
|
3038
3038
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCountPerUser")]
|
|
3039
3039
|
}, {
|
|
@@ -3051,7 +3051,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3051
3051
|
]);
|
|
3052
3052
|
};
|
|
3053
3053
|
}
|
|
3054
|
-
}), _hoisted_1$
|
|
3054
|
+
}), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$5 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
3055
3055
|
__name: "MissionTypeInput",
|
|
3056
3056
|
props: {
|
|
3057
3057
|
modelValue: {
|
|
@@ -3060,7 +3060,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3060
3060
|
},
|
|
3061
3061
|
emits: ["update:model-value"],
|
|
3062
3062
|
setup(e, { emit: r }) {
|
|
3063
|
-
const { t: o } = useI18n(),
|
|
3063
|
+
const { t: o } = useI18n(), m = e, d = r, p = computed(() => [
|
|
3064
3064
|
{
|
|
3065
3065
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
3066
3066
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -3074,24 +3074,24 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3074
3074
|
]);
|
|
3075
3075
|
return (l, n) => {
|
|
3076
3076
|
const a = resolveComponent("FmCard");
|
|
3077
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3078
|
-
createElementVNode("div", _hoisted_2$
|
|
3079
|
-
createElementVNode("div", _hoisted_3$
|
|
3080
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3077
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
3078
|
+
createElementVNode("div", _hoisted_2$6, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
3079
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
3080
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (u) => (openBlock(), createBlock(a, {
|
|
3081
3081
|
variant: "outlined",
|
|
3082
3082
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
3083
|
-
"col-span-2": unref(
|
|
3084
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
3085
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
3083
|
+
"col-span-2": unref(p).length == 1,
|
|
3084
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == u.value,
|
|
3085
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != u.value
|
|
3086
3086
|
}]),
|
|
3087
3087
|
onClick: () => {
|
|
3088
|
-
|
|
3088
|
+
m.modelValue != u.value && d("update:model-value", u.value);
|
|
3089
3089
|
},
|
|
3090
|
-
key:
|
|
3090
|
+
key: u.value
|
|
3091
3091
|
}, {
|
|
3092
3092
|
default: withCtx(() => [
|
|
3093
|
-
createElementVNode("div", _hoisted_4$
|
|
3094
|
-
createElementVNode("div", _hoisted_5$
|
|
3093
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(u.label), 1),
|
|
3094
|
+
createElementVNode("div", _hoisted_5$5, toDisplayString(u.description), 1)
|
|
3095
3095
|
]),
|
|
3096
3096
|
_: 2
|
|
3097
3097
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -3099,7 +3099,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3099
3099
|
]);
|
|
3100
3100
|
};
|
|
3101
3101
|
}
|
|
3102
|
-
}), _hoisted_1$
|
|
3102
|
+
}), _hoisted_1$8 = { class: "space-y-16" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
3103
3103
|
__name: "MissionEndInput",
|
|
3104
3104
|
props: {
|
|
3105
3105
|
modelValue: {
|
|
@@ -3115,21 +3115,21 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3115
3115
|
emits: ["update:model-value"],
|
|
3116
3116
|
setup(e, { emit: r }) {
|
|
3117
3117
|
const o = r;
|
|
3118
|
-
return (
|
|
3119
|
-
const
|
|
3120
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3121
|
-
|
|
3122
|
-
createVNode(
|
|
3118
|
+
return (m, d) => {
|
|
3119
|
+
const p = resolveComponent("FmStepperField");
|
|
3120
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
3121
|
+
d[1] || (d[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
|
|
3122
|
+
createVNode(p, {
|
|
3123
3123
|
label: "Maximum to collect",
|
|
3124
3124
|
"model-value": e.modelValue || null,
|
|
3125
|
-
"onUpdate:modelValue":
|
|
3125
|
+
"onUpdate:modelValue": d[0] || (d[0] = (l) => o("update:model-value", l)),
|
|
3126
3126
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
3127
3127
|
"helper-state": e.helperState || "none"
|
|
3128
3128
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
3129
3129
|
]);
|
|
3130
3130
|
};
|
|
3131
3131
|
}
|
|
3132
|
-
}), _hoisted_1$
|
|
3132
|
+
}), _hoisted_1$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
3133
3133
|
__name: "EditMissionPoolSheet",
|
|
3134
3134
|
props: {
|
|
3135
3135
|
maxThreshold: {
|
|
@@ -3139,31 +3139,31 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3139
3139
|
},
|
|
3140
3140
|
emits: ["update:model-value"],
|
|
3141
3141
|
setup(e, { expose: r, emit: o }) {
|
|
3142
|
-
const
|
|
3143
|
-
var
|
|
3144
|
-
const
|
|
3142
|
+
const m = e, d = useMembershipStore(), { minor: p } = useLoading, l = ref(!1), n = ref(), a = ref(), u = ref(0), y = computed(() => {
|
|
3143
|
+
var c, C;
|
|
3144
|
+
const i = (c = d.loyaltyRewards.items.find(
|
|
3145
3145
|
(V) => {
|
|
3146
3146
|
var $;
|
|
3147
3147
|
return V.value === (($ = n.value) == null ? void 0 : $.collectible);
|
|
3148
3148
|
}
|
|
3149
|
-
)) == null ? void 0 :
|
|
3150
|
-
return ((C = n.value) == null ? void 0 : C.type) === "LOYALTY" && (
|
|
3149
|
+
)) == null ? void 0 : c.raw.type;
|
|
3150
|
+
return ((C = n.value) == null ? void 0 : C.type) === "LOYALTY" && (i === "CREDIT" || i === "TITLE");
|
|
3151
3151
|
}), f = computed(
|
|
3152
|
-
() =>
|
|
3153
|
-
),
|
|
3154
|
-
const
|
|
3155
|
-
return
|
|
3152
|
+
() => y.value ? FdoThresholdCreditReward : FdtoThresholdReward
|
|
3153
|
+
), s = computed(() => {
|
|
3154
|
+
const i = f.value.safeParse(n.value);
|
|
3155
|
+
return i.success ? [] : i.error.errors;
|
|
3156
3156
|
});
|
|
3157
|
-
function
|
|
3158
|
-
|
|
3157
|
+
function k(i, c, C) {
|
|
3158
|
+
i && (n.value = c, u.value = C), l.value = i;
|
|
3159
3159
|
}
|
|
3160
3160
|
const x = o;
|
|
3161
|
-
async function
|
|
3162
|
-
const
|
|
3163
|
-
|
|
3161
|
+
async function h() {
|
|
3162
|
+
const i = f.value.safeParse(n.value);
|
|
3163
|
+
i.success && (await p(
|
|
3164
3164
|
async () => {
|
|
3165
|
-
|
|
3166
|
-
|
|
3165
|
+
i.data.type === "VOUCHER" && a.value && (i.data.collectibleConfig.image = await firebaseStorage.update(
|
|
3166
|
+
i.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
3167
3167
|
a.value
|
|
3168
3168
|
));
|
|
3169
3169
|
},
|
|
@@ -3171,31 +3171,31 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3171
3171
|
message: "Uploading reward image",
|
|
3172
3172
|
successMessage: "Reward image updated"
|
|
3173
3173
|
}
|
|
3174
|
-
), x("update:model-value",
|
|
3174
|
+
), x("update:model-value", i.data, u.value));
|
|
3175
3175
|
}
|
|
3176
3176
|
const v = ref();
|
|
3177
3177
|
return r({
|
|
3178
|
-
showSheet:
|
|
3179
|
-
}), (
|
|
3178
|
+
showSheet: k
|
|
3179
|
+
}), (i, c) => {
|
|
3180
3180
|
const C = resolveComponent("FmStepperField"), V = resolveComponent("FmSelect"), $ = resolveComponent("FmForm"), S = resolveComponent("FmButton"), w = resolveComponent("FmSideSheet");
|
|
3181
3181
|
return openBlock(), createBlock(w, {
|
|
3182
3182
|
"max-width": 560,
|
|
3183
3183
|
modelValue: unref(l),
|
|
3184
3184
|
"onUpdate:modelValue": [
|
|
3185
|
-
|
|
3186
|
-
|
|
3185
|
+
c[10] || (c[10] = (R) => isRef(l) ? l.value = R : null),
|
|
3186
|
+
c[11] || (c[11] = (R) => l.value = R)
|
|
3187
3187
|
],
|
|
3188
3188
|
header: "Edit reward",
|
|
3189
3189
|
"dismiss-away": ""
|
|
3190
3190
|
}, {
|
|
3191
3191
|
"side-sheet-footer": withCtx(() => [
|
|
3192
|
-
createElementVNode("div", _hoisted_1$
|
|
3192
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
3193
3193
|
createVNode(S, {
|
|
3194
3194
|
variant: "primary",
|
|
3195
3195
|
type: "button",
|
|
3196
3196
|
label: "Confirm",
|
|
3197
|
-
disabled: unref(
|
|
3198
|
-
onClick:
|
|
3197
|
+
disabled: unref(s).length > 0,
|
|
3198
|
+
onClick: c[8] || (c[8] = async () => {
|
|
3199
3199
|
var R;
|
|
3200
3200
|
return (R = unref(v)) == null ? void 0 : R.validateInputs();
|
|
3201
3201
|
})
|
|
@@ -3204,7 +3204,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3204
3204
|
variant: "secondary",
|
|
3205
3205
|
type: "button",
|
|
3206
3206
|
label: "Cancel",
|
|
3207
|
-
onClick:
|
|
3207
|
+
onClick: c[9] || (c[9] = (R) => l.value = !1)
|
|
3208
3208
|
})
|
|
3209
3209
|
])
|
|
3210
3210
|
]),
|
|
@@ -3215,7 +3215,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3215
3215
|
class: "flex flex-col gap-y-24",
|
|
3216
3216
|
ref_key: "formRef",
|
|
3217
3217
|
ref: v,
|
|
3218
|
-
onValidationSuccess:
|
|
3218
|
+
onValidationSuccess: c[7] || (c[7] = (R) => h())
|
|
3219
3219
|
}, {
|
|
3220
3220
|
default: withCtx(() => {
|
|
3221
3221
|
var R;
|
|
@@ -3226,13 +3226,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3226
3226
|
rules: [
|
|
3227
3227
|
unref(ZodHelper).toRule(
|
|
3228
3228
|
unref(z).number().min(1).max(
|
|
3229
|
-
|
|
3230
|
-
`Number cannot be more than ${
|
|
3229
|
+
m.maxThreshold,
|
|
3230
|
+
`Number cannot be more than ${m.maxThreshold}`
|
|
3231
3231
|
)
|
|
3232
3232
|
)
|
|
3233
3233
|
],
|
|
3234
3234
|
"model-value": unref(n).threshold,
|
|
3235
|
-
"onUpdate:modelValue":
|
|
3235
|
+
"onUpdate:modelValue": c[0] || (c[0] = (F) => n.value = {
|
|
3236
3236
|
...unref(n),
|
|
3237
3237
|
threshold: F
|
|
3238
3238
|
})
|
|
@@ -3244,7 +3244,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3244
3244
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
3245
3245
|
],
|
|
3246
3246
|
"model-value": unref(n).type,
|
|
3247
|
-
"onUpdate:modelValue":
|
|
3247
|
+
"onUpdate:modelValue": c[1] || (c[1] = (F) => {
|
|
3248
3248
|
var M, H;
|
|
3249
3249
|
F === "VOUCHER" ? n.value = {
|
|
3250
3250
|
collectible: null,
|
|
@@ -3261,7 +3261,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3261
3261
|
},
|
|
3262
3262
|
threshold: (M = unref(n)) == null ? void 0 : M.threshold
|
|
3263
3263
|
} : n.value = {
|
|
3264
|
-
collectible: unref(
|
|
3264
|
+
collectible: unref(d).loyaltyRewards.raw[0]._id,
|
|
3265
3265
|
type: "LOYALTY",
|
|
3266
3266
|
earningOption: {
|
|
3267
3267
|
amount: 1,
|
|
@@ -3278,47 +3278,47 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3278
3278
|
key: 1,
|
|
3279
3279
|
label: "Loyalty type",
|
|
3280
3280
|
rules: [unref(ZodHelper).ruleAtPath(unref(f), "collectible", [unref(n).type])],
|
|
3281
|
-
items: unref(
|
|
3281
|
+
items: unref(d).loyaltyRewards.items,
|
|
3282
3282
|
"model-value": unref(n).collectible,
|
|
3283
|
-
"onUpdate:modelValue":
|
|
3283
|
+
"onUpdate:modelValue": c[2] || (c[2] = (F) => unref(n).collectible = F)
|
|
3284
3284
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
3285
3285
|
unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3286
|
-
|
|
3287
|
-
createVNode(_sfc_main$
|
|
3286
|
+
c[12] || (c[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
3287
|
+
createVNode(_sfc_main$A, {
|
|
3288
3288
|
class: "mt-[-8px]",
|
|
3289
3289
|
rules: [unref(ZodHelper).ruleAtPath(unref(f), "earningOption", [unref(n).type])],
|
|
3290
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
3291
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
3290
|
+
"helper-state": unref(ZodHelper).helperState(unref(s), "earningOption"),
|
|
3291
|
+
"error-text": unref(ZodHelper).helperText(unref(s), "earningOption"),
|
|
3292
3292
|
"fixed-type": !0,
|
|
3293
3293
|
"model-value": unref(n).earningOption,
|
|
3294
|
-
"onUpdate:modelValue":
|
|
3294
|
+
"onUpdate:modelValue": c[3] || (c[3] = (F) => n.value = {
|
|
3295
3295
|
...unref(n),
|
|
3296
3296
|
earningOption: F
|
|
3297
3297
|
})
|
|
3298
3298
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
3299
|
-
createVNode(_sfc_main$
|
|
3299
|
+
createVNode(_sfc_main$B, {
|
|
3300
3300
|
class: "!gap-24",
|
|
3301
3301
|
type: unref(n).type === "LOYALTY" ? "custom" : "range",
|
|
3302
|
-
"for-credit": unref(
|
|
3302
|
+
"for-credit": unref(y),
|
|
3303
3303
|
rules: [unref(ZodHelper).ruleAtPath(unref(f), "validityOption", [unref(n).type])],
|
|
3304
3304
|
"model-value": unref(n).validityOption,
|
|
3305
|
-
"onUpdate:modelValue":
|
|
3305
|
+
"onUpdate:modelValue": c[4] || (c[4] = (F) => n.value = {
|
|
3306
3306
|
...unref(n),
|
|
3307
3307
|
validityOption: F
|
|
3308
3308
|
})
|
|
3309
3309
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
3310
3310
|
], 64)) : createCommentVNode("", !0),
|
|
3311
|
-
unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$
|
|
3311
|
+
unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$C, {
|
|
3312
3312
|
key: 3,
|
|
3313
3313
|
"reward-image": unref(a),
|
|
3314
3314
|
"model-value": ((R = unref(n)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
3315
|
-
"onUpdate:modelValue":
|
|
3315
|
+
"onUpdate:modelValue": c[5] || (c[5] = (F) => n.value = {
|
|
3316
3316
|
...unref(n),
|
|
3317
3317
|
collectibleConfig: F
|
|
3318
3318
|
}),
|
|
3319
|
-
"onUpdate:rewardImage":
|
|
3319
|
+
"onUpdate:rewardImage": c[6] || (c[6] = (F) => a.value = F)
|
|
3320
3320
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
3321
|
-
createVNode(JsonViewer, { json: unref(
|
|
3321
|
+
createVNode(JsonViewer, { json: unref(s) }, null, 8, ["json"])
|
|
3322
3322
|
];
|
|
3323
3323
|
}),
|
|
3324
3324
|
_: 1
|
|
@@ -3328,10 +3328,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3328
3328
|
}, 8, ["modelValue"]);
|
|
3329
3329
|
};
|
|
3330
3330
|
}
|
|
3331
|
-
}), _hoisted_1$
|
|
3331
|
+
}), _hoisted_1$6 = {
|
|
3332
3332
|
key: 0,
|
|
3333
3333
|
class: "grid grid-cols-5 text-center gap-8 justify-between items-center w-full"
|
|
3334
|
-
}, _hoisted_2$
|
|
3334
|
+
}, _hoisted_2$5 = { class: "flex flex-col gap-0 items-center justify-center" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
3335
3335
|
__name: "MissionProgress",
|
|
3336
3336
|
props: {
|
|
3337
3337
|
type: {
|
|
@@ -3352,19 +3352,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3352
3352
|
}
|
|
3353
3353
|
},
|
|
3354
3354
|
setup(e) {
|
|
3355
|
-
const r = e, { maxRange: o, currentRange:
|
|
3356
|
-
() => Math.min(
|
|
3355
|
+
const r = e, { maxRange: o, currentRange: m, markers: d } = toRefs(r), p = computed(
|
|
3356
|
+
() => Math.min(m.value / o.value * 100, 100)
|
|
3357
3357
|
), l = (n) => n / o.value * 100;
|
|
3358
3358
|
return (n, a) => {
|
|
3359
|
-
const
|
|
3360
|
-
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
3361
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (
|
|
3359
|
+
const u = resolveComponent("FmIcon");
|
|
3360
|
+
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
3361
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (y) => (openBlock(), createBlock(u, {
|
|
3362
3362
|
class: normalizeClass(
|
|
3363
|
-
unref(
|
|
3363
|
+
unref(m) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
3364
3364
|
),
|
|
3365
|
-
outline: unref(
|
|
3366
|
-
key:
|
|
3367
|
-
name: unref(
|
|
3365
|
+
outline: unref(m) < y,
|
|
3366
|
+
key: y,
|
|
3367
|
+
name: unref(d).some((f) => f === y) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
3368
3368
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
3369
3369
|
])) : (openBlock(), createElementBlock("div", {
|
|
3370
3370
|
key: 1,
|
|
@@ -3372,14 +3372,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3372
3372
|
}, [
|
|
3373
3373
|
createElementVNode("div", {
|
|
3374
3374
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
3375
|
-
style: normalizeStyle({ width: unref(
|
|
3375
|
+
style: normalizeStyle({ width: unref(p) + "%" })
|
|
3376
3376
|
}, null, 4),
|
|
3377
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3377
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(d), (y, f) => (openBlock(), createElementBlock("div", {
|
|
3378
3378
|
key: f,
|
|
3379
3379
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
3380
|
-
style: normalizeStyle({ left: l(
|
|
3380
|
+
style: normalizeStyle({ left: l(y) + "%" })
|
|
3381
3381
|
}, [
|
|
3382
|
-
createElementVNode("div", _hoisted_2$
|
|
3382
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
3383
3383
|
createElementVNode("div", {
|
|
3384
3384
|
class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
|
|
3385
3385
|
}),
|
|
@@ -3391,19 +3391,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3391
3391
|
}
|
|
3392
3392
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
3393
3393
|
function changeKeysFactory(e) {
|
|
3394
|
-
return function r(o,
|
|
3395
|
-
if (
|
|
3394
|
+
return function r(o, m = 1, d) {
|
|
3395
|
+
if (m === 0 || !isObject(o))
|
|
3396
3396
|
return o;
|
|
3397
3397
|
if (Array.isArray(o))
|
|
3398
|
-
return o.map((l) => r(l,
|
|
3399
|
-
const
|
|
3398
|
+
return o.map((l) => r(l, m - 1, d));
|
|
3399
|
+
const p = Object.create(Object.getPrototypeOf(o));
|
|
3400
3400
|
return Object.keys(o).forEach((l) => {
|
|
3401
|
-
const n = o[l], a = e(l,
|
|
3402
|
-
|
|
3403
|
-
}),
|
|
3401
|
+
const n = o[l], a = e(l, d), u = r(n, m - 1, d);
|
|
3402
|
+
p[a] = u;
|
|
3403
|
+
}), p;
|
|
3404
3404
|
};
|
|
3405
3405
|
}
|
|
3406
|
-
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$
|
|
3406
|
+
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$5 = { class: "space-y-16" }, _hoisted_2$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$4 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$4 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_6$4 = { class: "flex items-center gap-4" }, _hoisted_7$3 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$3 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
3407
3407
|
__name: "MissionPoolInput",
|
|
3408
3408
|
props: {
|
|
3409
3409
|
modelValue: {
|
|
@@ -3417,21 +3417,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3417
3417
|
},
|
|
3418
3418
|
emits: ["update:model-value"],
|
|
3419
3419
|
setup(e, { emit: r }) {
|
|
3420
|
-
const { t: o } = useI18n(),
|
|
3421
|
-
() =>
|
|
3420
|
+
const { t: o } = useI18n(), m = e, d = r, p = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), n = computed(
|
|
3421
|
+
() => m.modelValue.sort((v, i) => v.threshold - i.threshold) ?? []
|
|
3422
3422
|
), a = computed(() => {
|
|
3423
3423
|
const v = l.safeParse(n.value);
|
|
3424
3424
|
return v.success ? [] : v.error.errors;
|
|
3425
|
-
}),
|
|
3426
|
-
function
|
|
3425
|
+
}), u = ref();
|
|
3426
|
+
function y(v, i) {
|
|
3427
3427
|
var C;
|
|
3428
|
-
const
|
|
3429
|
-
i
|
|
3428
|
+
const c = [...n.value];
|
|
3429
|
+
c[i] = v, (C = u.value) == null || C.showSheet(!1), d("update:model-value", c);
|
|
3430
3430
|
}
|
|
3431
3431
|
function f(v) {
|
|
3432
|
-
const
|
|
3432
|
+
const i = v.type == "VOUCHER" ? v.collectibleConfig : p.collectibles.find(
|
|
3433
3433
|
(V) => V._id.toString() == v.collectible
|
|
3434
|
-
),
|
|
3434
|
+
), c = CollectionUtils.formattedType((i == null ? void 0 : i.name) || ""), C = v.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
3435
3435
|
threshold: v.threshold,
|
|
3436
3436
|
amount: v.earningOption.amount
|
|
3437
3437
|
}) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
@@ -3440,26 +3440,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3440
3440
|
every: v.earningOption.every
|
|
3441
3441
|
});
|
|
3442
3442
|
return {
|
|
3443
|
-
label: isNullOrEmpty(
|
|
3443
|
+
label: isNullOrEmpty(c) ? o("connect.template.mission_pool.no_reward") : c,
|
|
3444
3444
|
sublabel: C
|
|
3445
3445
|
};
|
|
3446
3446
|
}
|
|
3447
|
-
function
|
|
3448
|
-
var
|
|
3449
|
-
const
|
|
3450
|
-
(
|
|
3447
|
+
function s(v) {
|
|
3448
|
+
var c;
|
|
3449
|
+
const i = [...n.value];
|
|
3450
|
+
(c = u.value) == null || c.showSheet(!0, i[v], v);
|
|
3451
3451
|
}
|
|
3452
|
-
function
|
|
3453
|
-
const
|
|
3454
|
-
|
|
3452
|
+
function k(v) {
|
|
3453
|
+
const i = [...n.value];
|
|
3454
|
+
i.splice(v, 1), d("update:model-value", i);
|
|
3455
3455
|
}
|
|
3456
3456
|
function x() {
|
|
3457
3457
|
var v;
|
|
3458
|
-
(v =
|
|
3458
|
+
(v = u.value) == null || v.showSheet(
|
|
3459
3459
|
!0,
|
|
3460
3460
|
{
|
|
3461
3461
|
type: "LOYALTY",
|
|
3462
|
-
collectible:
|
|
3462
|
+
collectible: p.loyaltyRewards.items[0].value,
|
|
3463
3463
|
threshold: null,
|
|
3464
3464
|
validityOption: {
|
|
3465
3465
|
validForDay: 7
|
|
@@ -3472,21 +3472,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3472
3472
|
n.value.length
|
|
3473
3473
|
);
|
|
3474
3474
|
}
|
|
3475
|
-
function
|
|
3476
|
-
var
|
|
3477
|
-
return v.type == "VOUCHER" ? (
|
|
3478
|
-
((
|
|
3475
|
+
function h(v) {
|
|
3476
|
+
var i, c;
|
|
3477
|
+
return v.type == "VOUCHER" ? (i = v.collectibleConfig) == null ? void 0 : i.name : sentenceCase(
|
|
3478
|
+
((c = p.loyaltyRewards.items.find(
|
|
3479
3479
|
(C) => C.value == v.collectible
|
|
3480
|
-
)) == null ? void 0 :
|
|
3480
|
+
)) == null ? void 0 : c.label) || ""
|
|
3481
3481
|
);
|
|
3482
3482
|
}
|
|
3483
|
-
return (v,
|
|
3484
|
-
const
|
|
3485
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3486
|
-
createElementVNode("div", _hoisted_2$
|
|
3487
|
-
createVNode(
|
|
3483
|
+
return (v, i) => {
|
|
3484
|
+
const c = resolveComponent("FmButton"), C = resolveComponent("FmCard"), V = resolveComponent("FmHelperText");
|
|
3485
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
3486
|
+
createElementVNode("div", _hoisted_2$4, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
|
|
3487
|
+
createVNode(c, {
|
|
3488
3488
|
label: unref(o)("connect.template.mission_pool.add_reward"),
|
|
3489
|
-
onClick:
|
|
3489
|
+
onClick: i[0] || (i[0] = ($) => x()),
|
|
3490
3490
|
variant: "plain",
|
|
3491
3491
|
icon: "add"
|
|
3492
3492
|
}, null, 8, ["label"]),
|
|
@@ -3494,17 +3494,17 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3494
3494
|
key: S,
|
|
3495
3495
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
3496
3496
|
variant: "outlined",
|
|
3497
|
-
onClick: (w) =>
|
|
3497
|
+
onClick: (w) => s(S)
|
|
3498
3498
|
}, {
|
|
3499
3499
|
default: withCtx(() => [
|
|
3500
3500
|
createElementVNode("div", null, [
|
|
3501
|
-
createElementVNode("div", _hoisted_3$
|
|
3502
|
-
createElementVNode("div", _hoisted_4$
|
|
3501
|
+
createElementVNode("div", _hoisted_3$4, toDisplayString(f($).label), 1),
|
|
3502
|
+
createElementVNode("div", _hoisted_4$4, toDisplayString(f($).sublabel), 1)
|
|
3503
3503
|
]),
|
|
3504
|
-
createVNode(
|
|
3504
|
+
createVNode(c, {
|
|
3505
3505
|
icon: "delete",
|
|
3506
3506
|
variant: "tertiary",
|
|
3507
|
-
onClick: (w) => (w.stopPropagation(),
|
|
3507
|
+
onClick: (w) => (w.stopPropagation(), k(S))
|
|
3508
3508
|
}, null, 8, ["onClick"])
|
|
3509
3509
|
]),
|
|
3510
3510
|
_: 2
|
|
@@ -3514,7 +3514,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3514
3514
|
text: $.message,
|
|
3515
3515
|
state: "error"
|
|
3516
3516
|
}, null, 8, ["text"]))), 128)),
|
|
3517
|
-
createElementVNode("div", _hoisted_5$
|
|
3517
|
+
createElementVNode("div", _hoisted_5$4, toDisplayString(unref(o)("connect.template.mission_pool.preview")), 1),
|
|
3518
3518
|
(openBlock(), createBlock(C, {
|
|
3519
3519
|
key: 0,
|
|
3520
3520
|
variant: "outlined",
|
|
@@ -3523,14 +3523,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3523
3523
|
default: withCtx(() => {
|
|
3524
3524
|
var $, S;
|
|
3525
3525
|
return [
|
|
3526
|
-
createElementVNode("div", _hoisted_6$
|
|
3526
|
+
createElementVNode("div", _hoisted_6$4, [
|
|
3527
3527
|
createElementVNode("div", null, [
|
|
3528
|
-
createElementVNode("div", _hoisted_7$
|
|
3529
|
-
createElementVNode("div", _hoisted_8$
|
|
3528
|
+
createElementVNode("div", _hoisted_7$3, 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 ? (S = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : S.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? h(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
3529
|
+
createElementVNode("div", _hoisted_8$3, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
|
|
3530
3530
|
])
|
|
3531
3531
|
]),
|
|
3532
3532
|
createElementVNode("div", _hoisted_9$2, [
|
|
3533
|
-
createVNode(_sfc_main$
|
|
3533
|
+
createVNode(_sfc_main$6, {
|
|
3534
3534
|
type: e.mission.type,
|
|
3535
3535
|
"max-range": e.mission.end,
|
|
3536
3536
|
currentRange: e.mission.end / 4,
|
|
@@ -3542,26 +3542,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3542
3542
|
}),
|
|
3543
3543
|
_: 1
|
|
3544
3544
|
})),
|
|
3545
|
-
createVNode(_sfc_main$
|
|
3545
|
+
createVNode(_sfc_main$7, {
|
|
3546
3546
|
ref_key: "sheetRef",
|
|
3547
|
-
ref:
|
|
3548
|
-
"onUpdate:modelValue":
|
|
3547
|
+
ref: u,
|
|
3548
|
+
"onUpdate:modelValue": y,
|
|
3549
3549
|
"max-threshold": e.mission.end
|
|
3550
3550
|
}, null, 8, ["max-threshold"])
|
|
3551
3551
|
]);
|
|
3552
3552
|
};
|
|
3553
3553
|
}
|
|
3554
|
-
}), _hoisted_1$
|
|
3554
|
+
}), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "space-y-8" }, _hoisted_3$3 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$3 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$3 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$2 = { class: "space-y-8" }, _hoisted_9$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_10$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
3555
3555
|
__name: "MissionInput",
|
|
3556
3556
|
props: {
|
|
3557
3557
|
modelValue: Object
|
|
3558
3558
|
},
|
|
3559
3559
|
emits: ["update:model-value"],
|
|
3560
3560
|
setup(e, { emit: r }) {
|
|
3561
|
-
const { t: o } = useI18n(),
|
|
3562
|
-
const n = FdoMission.safeParse(
|
|
3561
|
+
const { t: o } = useI18n(), m = e, d = computed(() => {
|
|
3562
|
+
const n = FdoMission.safeParse(m.modelValue);
|
|
3563
3563
|
return n.success ? [] : n.error.errors;
|
|
3564
|
-
}),
|
|
3564
|
+
}), p = computed(() => [
|
|
3565
3565
|
{
|
|
3566
3566
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
3567
3567
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -3575,56 +3575,56 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3575
3575
|
]), l = r;
|
|
3576
3576
|
return (n, a) => {
|
|
3577
3577
|
var f;
|
|
3578
|
-
const
|
|
3579
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3580
|
-
createElementVNode("div", _hoisted_2$
|
|
3581
|
-
createElementVNode("div", _hoisted_3$
|
|
3582
|
-
createElementVNode("div", _hoisted_4$
|
|
3583
|
-
createElementVNode("div", _hoisted_5$
|
|
3584
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3585
|
-
var
|
|
3586
|
-
return openBlock(), createBlock(
|
|
3578
|
+
const u = resolveComponent("FmCard"), y = resolveComponent("FmStepperField");
|
|
3579
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
3580
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
3581
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
|
|
3582
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
3583
|
+
createElementVNode("div", _hoisted_5$3, [
|
|
3584
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (s) => {
|
|
3585
|
+
var k, x;
|
|
3586
|
+
return openBlock(), createBlock(u, {
|
|
3587
3587
|
variant: "outlined",
|
|
3588
3588
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
3589
|
-
"col-span-2": unref(
|
|
3590
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
3591
|
-
"hover:bg-fm-color-opacity-sm": ((x = e.modelValue) == null ? void 0 : x.type) !=
|
|
3589
|
+
"col-span-2": unref(p).length == 1,
|
|
3590
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((k = e.modelValue) == null ? void 0 : k.type) == s.value,
|
|
3591
|
+
"hover:bg-fm-color-opacity-sm": ((x = e.modelValue) == null ? void 0 : x.type) != s.value
|
|
3592
3592
|
}]),
|
|
3593
3593
|
onClick: () => {
|
|
3594
|
-
var
|
|
3595
|
-
((
|
|
3594
|
+
var h, v;
|
|
3595
|
+
((h = e.modelValue) == null ? void 0 : h.type) != s.value && l("update:model-value", {
|
|
3596
3596
|
...e.modelValue,
|
|
3597
|
-
type:
|
|
3597
|
+
type: s.value,
|
|
3598
3598
|
end: ((v = e.modelValue) == null ? void 0 : v.end) || 1
|
|
3599
3599
|
});
|
|
3600
3600
|
},
|
|
3601
|
-
key:
|
|
3601
|
+
key: s.value
|
|
3602
3602
|
}, {
|
|
3603
3603
|
default: withCtx(() => [
|
|
3604
|
-
createElementVNode("div", _hoisted_6$
|
|
3605
|
-
createElementVNode("div", _hoisted_7$
|
|
3604
|
+
createElementVNode("div", _hoisted_6$3, toDisplayString(s.label), 1),
|
|
3605
|
+
createElementVNode("div", _hoisted_7$2, toDisplayString(s.description), 1)
|
|
3606
3606
|
]),
|
|
3607
3607
|
_: 2
|
|
3608
3608
|
}, 1032, ["class", "onClick"]);
|
|
3609
3609
|
}), 128))
|
|
3610
3610
|
])
|
|
3611
3611
|
]),
|
|
3612
|
-
createElementVNode("div", _hoisted_8$
|
|
3612
|
+
createElementVNode("div", _hoisted_8$2, [
|
|
3613
3613
|
createElementVNode("div", _hoisted_9$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequired")), 1),
|
|
3614
3614
|
createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
|
|
3615
|
-
createVNode(
|
|
3615
|
+
createVNode(y, {
|
|
3616
3616
|
label: unref(o)("connect.campaign.mission.maximumToCollect"),
|
|
3617
3617
|
"model-value": ((f = e.modelValue) == null ? void 0 : f.end) || null,
|
|
3618
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
3619
|
-
var
|
|
3618
|
+
"onUpdate:modelValue": a[0] || (a[0] = (s) => {
|
|
3619
|
+
var k;
|
|
3620
3620
|
return l("update:model-value", {
|
|
3621
3621
|
...e.modelValue,
|
|
3622
|
-
type: ((
|
|
3623
|
-
end:
|
|
3622
|
+
type: ((k = e.modelValue) == null ? void 0 : k.type) || "STAMP",
|
|
3623
|
+
end: s
|
|
3624
3624
|
});
|
|
3625
3625
|
}),
|
|
3626
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
3627
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
3626
|
+
"helper-text": unref(ZodHelper).helperText(unref(d), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
|
|
3627
|
+
"helper-state": unref(ZodHelper).helperState(unref(d), "end") || "none"
|
|
3628
3628
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"])
|
|
3629
3629
|
])
|
|
3630
3630
|
]);
|
|
@@ -3633,12 +3633,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3633
3633
|
});
|
|
3634
3634
|
function useLocaleText() {
|
|
3635
3635
|
const { locale: e, t: r } = useI18n();
|
|
3636
|
-
function o(
|
|
3637
|
-
return
|
|
3636
|
+
function o(m, d) {
|
|
3637
|
+
return m ? m[e.value] ?? m["en-US"] ?? r(d) : r(d);
|
|
3638
3638
|
}
|
|
3639
3639
|
return { getLocaleText: o };
|
|
3640
3640
|
}
|
|
3641
|
-
const _hoisted_1$
|
|
3641
|
+
const _hoisted_1$3 = { key: 29 }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3642
3642
|
__name: "TemplateInput",
|
|
3643
3643
|
props: {
|
|
3644
3644
|
pushAvailability: {
|
|
@@ -3674,110 +3674,110 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3674
3674
|
},
|
|
3675
3675
|
emits: ["retry-push", "update:model-value", "update:file"],
|
|
3676
3676
|
setup(e, { emit: r }) {
|
|
3677
|
-
const { t: o } = useI18n(), { getLocaleText:
|
|
3678
|
-
function l(
|
|
3679
|
-
switch (
|
|
3677
|
+
const { t: o } = useI18n(), { getLocaleText: m } = useLocaleText(), d = e, p = r;
|
|
3678
|
+
function l(y) {
|
|
3679
|
+
switch (d.field.type) {
|
|
3680
3680
|
case "timeframe":
|
|
3681
|
-
const f =
|
|
3682
|
-
|
|
3681
|
+
const f = y.startDate ? hooks(y.startDate).startOf("day").toISOString() : void 0, s = y.endDate ? hooks(y.endDate).endOf("day").toISOString() : void 0;
|
|
3682
|
+
p("update:model-value", {
|
|
3683
3683
|
type: "timeframe",
|
|
3684
3684
|
property: "__now",
|
|
3685
3685
|
start: f,
|
|
3686
|
-
end:
|
|
3686
|
+
end: s
|
|
3687
3687
|
});
|
|
3688
3688
|
break;
|
|
3689
3689
|
case "image": {
|
|
3690
|
-
|
|
3690
|
+
p(
|
|
3691
3691
|
"update:file",
|
|
3692
|
-
|
|
3693
|
-
n.value || firebaseStorage.collectibleImagePath(void 0,
|
|
3692
|
+
y,
|
|
3693
|
+
n.value || firebaseStorage.collectibleImagePath(void 0, y)
|
|
3694
3694
|
);
|
|
3695
3695
|
break;
|
|
3696
3696
|
}
|
|
3697
3697
|
default:
|
|
3698
|
-
|
|
3698
|
+
p("update:model-value", y);
|
|
3699
3699
|
break;
|
|
3700
3700
|
}
|
|
3701
3701
|
}
|
|
3702
3702
|
const n = computed(() => {
|
|
3703
|
-
switch (
|
|
3703
|
+
switch (d.field.type) {
|
|
3704
3704
|
case "timeframe": {
|
|
3705
|
-
const
|
|
3705
|
+
const y = d.modelValue;
|
|
3706
3706
|
return {
|
|
3707
|
-
startDate:
|
|
3708
|
-
endDate:
|
|
3707
|
+
startDate: y != null && y.start ? hooks(y == null ? void 0 : y.start).format("YYYY-MM-DD") : null,
|
|
3708
|
+
endDate: y != null && y.end ? hooks(y == null ? void 0 : y.end).format("YYYY-MM-DD") : null
|
|
3709
3709
|
};
|
|
3710
3710
|
}
|
|
3711
3711
|
default:
|
|
3712
|
-
return
|
|
3712
|
+
return d.modelValue;
|
|
3713
3713
|
}
|
|
3714
3714
|
});
|
|
3715
3715
|
function a() {
|
|
3716
|
-
if (!
|
|
3717
|
-
const
|
|
3718
|
-
return
|
|
3716
|
+
if (!u.value.schema) return [];
|
|
3717
|
+
const y = u.value.schema.safeParse(d.modelValue);
|
|
3718
|
+
return y.success ? [] : y.error.errors;
|
|
3719
3719
|
}
|
|
3720
|
-
const
|
|
3721
|
-
schema:
|
|
3722
|
-
unwrapped:
|
|
3723
|
-
rules:
|
|
3724
|
-
labelMark:
|
|
3725
|
-
zodLabel:
|
|
3726
|
-
|
|
3727
|
-
|
|
3720
|
+
const u = computed(() => ({
|
|
3721
|
+
schema: d.schema,
|
|
3722
|
+
unwrapped: d.schema ? ZodHelper.unwrap(d.schema) : void 0,
|
|
3723
|
+
rules: d.schema ? [ZodHelper.ruleAtPath(d.schema, "")] : void 0,
|
|
3724
|
+
labelMark: d.schema && ZodHelper.isRequired(d.schema) == !1 ? "optional" : void 0,
|
|
3725
|
+
zodLabel: d.schema ? ZodHelper.toInputLabel(
|
|
3726
|
+
d.schema,
|
|
3727
|
+
m(d.field.label_locale, d.field.label ?? "")
|
|
3728
3728
|
) : void 0
|
|
3729
3729
|
}));
|
|
3730
|
-
return (
|
|
3731
|
-
var
|
|
3732
|
-
const
|
|
3733
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
3730
|
+
return (y, f) => {
|
|
3731
|
+
var i, c, C, V, $;
|
|
3732
|
+
const s = resolveComponent("FmTextField"), k = resolveComponent("FmStepperField"), x = resolveComponent("FmTextarea"), h = resolveComponent("FmHelperText"), v = resolveComponent("FmSwitch");
|
|
3733
|
+
return e.field.type === "text" ? (openBlock(), createBlock(s, {
|
|
3734
3734
|
key: 0,
|
|
3735
|
-
label: unref(
|
|
3736
|
-
"label-mark": unref(
|
|
3737
|
-
rules: unref(
|
|
3735
|
+
label: unref(m)(e.field.label_locale, e.field.label ?? ""),
|
|
3736
|
+
"label-mark": unref(u).labelMark,
|
|
3737
|
+
rules: unref(u).rules,
|
|
3738
3738
|
"model-value": unref(n),
|
|
3739
3739
|
"onUpdate:modelValue": l,
|
|
3740
3740
|
"helper-state": e.helperText ? "error" : void 0,
|
|
3741
3741
|
"helper-text": e.helperText
|
|
3742
3742
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3743
3743
|
createVNode(JsonViewer, {
|
|
3744
|
-
json: { schema: unref(
|
|
3744
|
+
json: { schema: unref(u).unwrapped, props: d }
|
|
3745
3745
|
}, null, 8, ["json"]),
|
|
3746
|
-
createVNode(
|
|
3747
|
-
label: unref(
|
|
3748
|
-
"label-mark": e.field.isRuleChildren ? void 0 : unref(
|
|
3746
|
+
createVNode(k, {
|
|
3747
|
+
label: unref(m)(e.field.label_locale, e.field.label ?? ""),
|
|
3748
|
+
"label-mark": e.field.isRuleChildren ? void 0 : unref(u).labelMark,
|
|
3749
3749
|
"model-value": unref(n),
|
|
3750
|
-
rules: e.field.isRuleChildren ? [] : unref(
|
|
3750
|
+
rules: e.field.isRuleChildren ? [] : unref(u).rules,
|
|
3751
3751
|
"onUpdate:modelValue": l,
|
|
3752
3752
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
3753
3753
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
3754
3754
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
3755
3755
|
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(x, {
|
|
3756
3756
|
key: 2,
|
|
3757
|
-
label: unref(
|
|
3758
|
-
"label-mark": unref(
|
|
3759
|
-
rules: unref(
|
|
3757
|
+
label: unref(m)(e.field.label_locale, e.field.label ?? ""),
|
|
3758
|
+
"label-mark": unref(u).labelMark,
|
|
3759
|
+
rules: unref(u).rules,
|
|
3760
3760
|
"model-value": unref(n),
|
|
3761
3761
|
"onUpdate:modelValue": l,
|
|
3762
3762
|
"show-word-count": "",
|
|
3763
|
-
"max-length": ($ = (V = (C = (
|
|
3764
|
-
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$
|
|
3763
|
+
"max-length": ($ = (V = (C = (c = (i = unref(u)) == null ? void 0 : i.unwrapped) == null ? void 0 : c._def) == null ? void 0 : C.checks) == null ? void 0 : V.find((S) => S.kind == "max")) == null ? void 0 : $.value
|
|
3764
|
+
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$p, {
|
|
3765
3765
|
key: 3,
|
|
3766
3766
|
"campaign-type": e.extras,
|
|
3767
3767
|
"model-value": unref(n),
|
|
3768
3768
|
disabled: e.disabled,
|
|
3769
3769
|
"onUpdate:modelValue": l
|
|
3770
3770
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
3771
|
-
createVNode(_sfc_main$
|
|
3771
|
+
createVNode(_sfc_main$n, {
|
|
3772
3772
|
"model-value": unref(n),
|
|
3773
3773
|
"onUpdate:modelValue": l
|
|
3774
3774
|
}, null, 8, ["model-value"]),
|
|
3775
|
-
createVNode(
|
|
3775
|
+
createVNode(h, {
|
|
3776
3776
|
class: "!mt-[8px]",
|
|
3777
3777
|
text: unref(ZodHelper).helperText(a(), ""),
|
|
3778
3778
|
state: unref(ZodHelper).helperState(a(), "")
|
|
3779
3779
|
}, null, 8, ["text", "state"])
|
|
3780
|
-
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$
|
|
3780
|
+
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$D, {
|
|
3781
3781
|
key: 5,
|
|
3782
3782
|
thumbnail: unref(n),
|
|
3783
3783
|
"aspect-ratio": "16 / 9",
|
|
@@ -3785,46 +3785,46 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3785
3785
|
"onUpdate:file": l
|
|
3786
3786
|
}, {
|
|
3787
3787
|
label: withCtx(() => [
|
|
3788
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
3788
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(u).zodLabel)))
|
|
3789
3789
|
]),
|
|
3790
3790
|
_: 1
|
|
3791
3791
|
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(v, {
|
|
3792
3792
|
key: 6,
|
|
3793
|
-
label: unref(
|
|
3793
|
+
label: unref(m)(e.field.label_locale, e.field.label ?? ""),
|
|
3794
3794
|
"label-placement": "right",
|
|
3795
3795
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
3796
|
-
"label-mark": unref(
|
|
3797
|
-
rules: unref(
|
|
3796
|
+
"label-mark": unref(u).labelMark,
|
|
3797
|
+
rules: unref(u).rules,
|
|
3798
3798
|
"model-value": unref(n),
|
|
3799
3799
|
"onUpdate:modelValue": l
|
|
3800
|
-
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$
|
|
3800
|
+
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$E, {
|
|
3801
3801
|
key: 7,
|
|
3802
3802
|
"model-value": unref(n),
|
|
3803
3803
|
"onUpdate:modelValue": l,
|
|
3804
3804
|
"no-campaign": !1,
|
|
3805
|
-
schema: unref(
|
|
3805
|
+
schema: unref(u).schema,
|
|
3806
3806
|
"is-mission": e.extras === "MISSION"
|
|
3807
3807
|
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "grab_conditions" ? (openBlock(), createBlock(GrabConditionsInput, {
|
|
3808
3808
|
key: 8,
|
|
3809
3809
|
"model-value": unref(n),
|
|
3810
3810
|
"onUpdate:modelValue": l,
|
|
3811
|
-
schema: unref(
|
|
3812
|
-
}, null, 8, ["model-value", "schema"])) : e.field.type === "grab_quota" ? (openBlock(), createBlock(_sfc_main$
|
|
3811
|
+
schema: unref(u).schema
|
|
3812
|
+
}, null, 8, ["model-value", "schema"])) : e.field.type === "grab_quota" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
3813
3813
|
key: 9,
|
|
3814
3814
|
"model-value": unref(n),
|
|
3815
3815
|
"onUpdate:modelValue": l,
|
|
3816
|
-
schema: unref(
|
|
3817
|
-
}, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$
|
|
3816
|
+
schema: unref(u).schema
|
|
3817
|
+
}, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$F, {
|
|
3818
3818
|
key: 10,
|
|
3819
3819
|
"model-value": unref(n),
|
|
3820
3820
|
"onUpdate:modelValue": l
|
|
3821
3821
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 11 }, [
|
|
3822
|
-
createVNode(_sfc_main$
|
|
3822
|
+
createVNode(_sfc_main$G, {
|
|
3823
3823
|
"model-value": unref(n),
|
|
3824
3824
|
"onUpdate:modelValue": l,
|
|
3825
3825
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
3826
3826
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
3827
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
3827
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(h, {
|
|
3828
3828
|
key: 0,
|
|
3829
3829
|
class: "!mt-[8px]",
|
|
3830
3830
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
@@ -3835,24 +3835,24 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3835
3835
|
"model-value": unref(n),
|
|
3836
3836
|
"onUpdate:modelValue": l
|
|
3837
3837
|
}, null, 8, ["model-value"]),
|
|
3838
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
3838
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(h, {
|
|
3839
3839
|
key: 0,
|
|
3840
3840
|
class: "!mt-[8px]",
|
|
3841
3841
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
3842
3842
|
state: "error"
|
|
3843
3843
|
}, null, 8, ["text"]))
|
|
3844
3844
|
], 64)) : e.field.type === "message" ? (openBlock(), createElementBlock(Fragment, { key: 13 }, [
|
|
3845
|
-
e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$
|
|
3845
|
+
e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$h, {
|
|
3846
3846
|
key: 0,
|
|
3847
3847
|
"push-availability": e.pushAvailability,
|
|
3848
|
-
onRetryPush: f[0] || (f[0] = (S) =>
|
|
3848
|
+
onRetryPush: f[0] || (f[0] = (S) => p("retry-push")),
|
|
3849
3849
|
"show-validation": e.showValidation,
|
|
3850
3850
|
"model-value": unref(n),
|
|
3851
3851
|
"onUpdate:modelValue": l,
|
|
3852
3852
|
"helper-text": unref(ZodHelper).helperText(a(), ""),
|
|
3853
3853
|
"trigger-type": e.field.extras,
|
|
3854
3854
|
"helper-state": unref(ZodHelper).helperState(a(), "")
|
|
3855
|
-
}, null, 8, ["push-availability", "show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$
|
|
3855
|
+
}, null, 8, ["push-availability", "show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$y, {
|
|
3856
3856
|
key: 1,
|
|
3857
3857
|
"allow-email": !0,
|
|
3858
3858
|
"allow-whatsapp": !0,
|
|
@@ -3862,162 +3862,306 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3862
3862
|
"trigger-type": e.field.extras,
|
|
3863
3863
|
"helper-state": unref(ZodHelper).helperState(a(), "")
|
|
3864
3864
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"]))
|
|
3865
|
-
], 64)) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$
|
|
3865
|
+
], 64)) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$A, {
|
|
3866
3866
|
key: 14,
|
|
3867
3867
|
"model-value": unref(n),
|
|
3868
3868
|
"onUpdate:modelValue": l,
|
|
3869
3869
|
extras: e.extras,
|
|
3870
3870
|
"error-text": e.helperText
|
|
3871
|
-
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$
|
|
3871
|
+
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$B, {
|
|
3872
3872
|
key: 15,
|
|
3873
3873
|
type: "custom",
|
|
3874
3874
|
"model-value": unref(n),
|
|
3875
3875
|
"onUpdate:modelValue": l,
|
|
3876
3876
|
"helper-text": e.helperText || unref(ZodHelper).helperText(a(), ""),
|
|
3877
|
-
"for-credit":
|
|
3878
|
-
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$
|
|
3877
|
+
"for-credit": d.campaignType === "CREDIT"
|
|
3878
|
+
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$f, {
|
|
3879
3879
|
key: 16,
|
|
3880
3880
|
"model-value": unref(n),
|
|
3881
3881
|
"onUpdate:modelValue": l
|
|
3882
|
-
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$
|
|
3882
|
+
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$d, {
|
|
3883
3883
|
key: 17,
|
|
3884
3884
|
"model-value": unref(n),
|
|
3885
3885
|
"onUpdate:modelValue": l
|
|
3886
|
-
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$
|
|
3886
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
3887
3887
|
key: 18,
|
|
3888
3888
|
"model-value": unref(n),
|
|
3889
3889
|
"onUpdate:modelValue": l
|
|
3890
|
-
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$
|
|
3890
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$9, {
|
|
3891
3891
|
key: 19,
|
|
3892
3892
|
"model-value": unref(n),
|
|
3893
3893
|
"onUpdate:modelValue": l
|
|
3894
|
-
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$
|
|
3894
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
3895
3895
|
key: 20,
|
|
3896
3896
|
"model-value": unref(n),
|
|
3897
3897
|
"onUpdate:modelValue": l,
|
|
3898
3898
|
"helper-text": unref(ZodHelper).helperText(a(), ""),
|
|
3899
3899
|
"helper-state": unref(ZodHelper).helperState(a(), "")
|
|
3900
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$
|
|
3900
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$5, {
|
|
3901
3901
|
key: 21,
|
|
3902
3902
|
"model-value": unref(n),
|
|
3903
3903
|
"onUpdate:modelValue": l,
|
|
3904
3904
|
mission: e.extras.mission
|
|
3905
3905
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
3906
|
-
createVNode(_sfc_main$
|
|
3906
|
+
createVNode(_sfc_main$g, {
|
|
3907
3907
|
"model-value": unref(n),
|
|
3908
3908
|
"onUpdate:modelValue": l,
|
|
3909
3909
|
"start-date": e.extras.start,
|
|
3910
3910
|
"end-date": e.extras.end
|
|
3911
3911
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
3912
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3912
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3913
3913
|
key: 0,
|
|
3914
3914
|
class: "!mt-[8px]",
|
|
3915
3915
|
text: e.helperText,
|
|
3916
3916
|
state: "error"
|
|
3917
3917
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3918
3918
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
3919
|
-
createVNode(_sfc_main$
|
|
3919
|
+
createVNode(_sfc_main$H, {
|
|
3920
3920
|
"model-value": unref(n),
|
|
3921
3921
|
"onUpdate:modelValue": l
|
|
3922
3922
|
}, null, 8, ["model-value"]),
|
|
3923
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3923
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3924
3924
|
key: 0,
|
|
3925
3925
|
class: "!mt-[8px]",
|
|
3926
3926
|
text: e.helperText,
|
|
3927
3927
|
state: "error"
|
|
3928
3928
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3929
3929
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
3930
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
3930
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(h, {
|
|
3931
3931
|
key: 0,
|
|
3932
3932
|
state: "warning",
|
|
3933
3933
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
3934
3934
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
3935
|
-
createVNode(_sfc_main$
|
|
3935
|
+
createVNode(_sfc_main$r, {
|
|
3936
3936
|
"model-value": unref(n),
|
|
3937
3937
|
"onUpdate:modelValue": l
|
|
3938
3938
|
}, null, 8, ["model-value"]),
|
|
3939
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3939
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3940
3940
|
key: 1,
|
|
3941
3941
|
class: "!mt-[8px]",
|
|
3942
3942
|
text: e.helperText,
|
|
3943
3943
|
state: "error"
|
|
3944
3944
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3945
3945
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
3946
|
-
createVNode(_sfc_main$
|
|
3946
|
+
createVNode(_sfc_main$I, {
|
|
3947
3947
|
"model-value": unref(n),
|
|
3948
3948
|
"onUpdate:modelValue": l
|
|
3949
3949
|
}, null, 8, ["model-value"]),
|
|
3950
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3950
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3951
3951
|
key: 0,
|
|
3952
3952
|
class: "!mt-[8px]",
|
|
3953
3953
|
text: e.helperText,
|
|
3954
3954
|
state: "error"
|
|
3955
3955
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3956
3956
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 26 }, [
|
|
3957
|
-
createVNode(_sfc_main$
|
|
3957
|
+
createVNode(_sfc_main$J, {
|
|
3958
3958
|
"model-value": unref(n),
|
|
3959
3959
|
"onUpdate:modelValue": l
|
|
3960
3960
|
}, null, 8, ["model-value"]),
|
|
3961
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3961
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3962
3962
|
key: 0,
|
|
3963
3963
|
class: "!mt-[8px]",
|
|
3964
3964
|
text: e.helperText,
|
|
3965
3965
|
state: "error"
|
|
3966
3966
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3967
3967
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 27 }, [
|
|
3968
|
-
createVNode(_sfc_main$
|
|
3968
|
+
createVNode(_sfc_main$q, {
|
|
3969
3969
|
"model-value": unref(n),
|
|
3970
3970
|
"onUpdate:modelValue": l
|
|
3971
3971
|
}, null, 8, ["model-value"]),
|
|
3972
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3972
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3973
3973
|
key: 0,
|
|
3974
3974
|
class: "!mt-[8px]",
|
|
3975
3975
|
text: e.helperText,
|
|
3976
3976
|
state: "error"
|
|
3977
3977
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3978
3978
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 28 }, [
|
|
3979
|
-
createVNode(_sfc_main$
|
|
3979
|
+
createVNode(_sfc_main$c, {
|
|
3980
3980
|
"model-value": unref(n),
|
|
3981
3981
|
"onUpdate:modelValue": l
|
|
3982
3982
|
}, null, 8, ["model-value"]),
|
|
3983
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3983
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3984
3984
|
key: 0,
|
|
3985
3985
|
class: "!mt-[8px]",
|
|
3986
3986
|
text: e.helperText,
|
|
3987
3987
|
state: "error"
|
|
3988
3988
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3989
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$
|
|
3989
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$3, toDisplayString(d.field), 1));
|
|
3990
3990
|
};
|
|
3991
3991
|
}
|
|
3992
|
-
}), _hoisted_1$
|
|
3992
|
+
}), _hoisted_1$2 = { class: "space-y-4" }, _hoisted_2$2 = {
|
|
3993
|
+
id: "location-list-title",
|
|
3994
|
+
class: "fm-typo-en-title-sm-800"
|
|
3995
|
+
}, _hoisted_3$2 = { class: "block fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_4$2 = ["aria-label"], _hoisted_5$2 = ["title"], _hoisted_6$2 = ["title"], _hoisted_7$1 = {
|
|
3996
|
+
key: 1,
|
|
3997
|
+
class: "p-16 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
3998
|
+
}, _hoisted_8$1 = { class: "flex justify-end" }, ROW_HEIGHT = 44, VIEWPORT_HEIGHT = 352, OVERSCAN = 6, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3999
|
+
__name: "LocationListDialog",
|
|
4000
|
+
props: {
|
|
4001
|
+
rows: {},
|
|
4002
|
+
total: {},
|
|
4003
|
+
unavailable: {}
|
|
4004
|
+
},
|
|
4005
|
+
setup(e) {
|
|
4006
|
+
const r = e, o = useDialog(), { t: m } = useI18n(), d = ref(""), p = ref(0), l = ref(), n = computed(() => {
|
|
4007
|
+
const y = d.value.trim().toLowerCase();
|
|
4008
|
+
return y ? r.rows.filter(
|
|
4009
|
+
(f) => {
|
|
4010
|
+
var s;
|
|
4011
|
+
return f.name.toLowerCase().includes(y) || ((s = f.code) == null ? void 0 : s.toLowerCase().includes(y));
|
|
4012
|
+
}
|
|
4013
|
+
) : r.rows;
|
|
4014
|
+
}), a = computed(
|
|
4015
|
+
() => Math.max(0, Math.floor(p.value / ROW_HEIGHT) - OVERSCAN)
|
|
4016
|
+
), u = computed(() => {
|
|
4017
|
+
const y = Math.ceil((p.value + VIEWPORT_HEIGHT) / ROW_HEIGHT);
|
|
4018
|
+
return n.value.slice(a.value, y + OVERSCAN);
|
|
4019
|
+
});
|
|
4020
|
+
return watch(d, () => {
|
|
4021
|
+
p.value = 0, l.value && (l.value.scrollTop = 0);
|
|
4022
|
+
}), (y, f) => {
|
|
4023
|
+
const s = resolveComponent("FmTextField"), k = resolveComponent("FmButton"), x = resolveComponent("FmCard");
|
|
4024
|
+
return openBlock(), createBlock(x, {
|
|
4025
|
+
class: "flex flex-col gap-12 p-24 xs:p-16 w-[640px] max-w-[calc(100vw-32px)] min-w-0",
|
|
4026
|
+
role: "dialog",
|
|
4027
|
+
"aria-labelledby": "location-list-title"
|
|
4028
|
+
}, {
|
|
4029
|
+
default: withCtx(() => [
|
|
4030
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
4031
|
+
createElementVNode("h2", _hoisted_2$2, toDisplayString(unref(m)("connect.campaign.common.available_at")), 1),
|
|
4032
|
+
createElementVNode("output", _hoisted_3$2, [
|
|
4033
|
+
createTextVNode(toDisplayString(unref(d).trim() ? unref(m)("connect.campaign.common.locations_match", {
|
|
4034
|
+
count: unref(n).length.toLocaleString(),
|
|
4035
|
+
total: e.total.toLocaleString()
|
|
4036
|
+
}) : unref(m)("connect.campaign.common.locations_count", {
|
|
4037
|
+
count: e.rows.length.toLocaleString(),
|
|
4038
|
+
total: e.total.toLocaleString()
|
|
4039
|
+
})) + " ", 1),
|
|
4040
|
+
e.unavailable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4041
|
+
createTextVNode(" , " + toDisplayString(unref(m)("connect.campaign.common.locations_unavailable", {
|
|
4042
|
+
count: e.unavailable.toLocaleString()
|
|
4043
|
+
})), 1)
|
|
4044
|
+
], 64)) : createCommentVNode("", !0)
|
|
4045
|
+
])
|
|
4046
|
+
]),
|
|
4047
|
+
createVNode(s, {
|
|
4048
|
+
modelValue: unref(d),
|
|
4049
|
+
"onUpdate:modelValue": f[0] || (f[0] = (h) => isRef(d) ? d.value = h : null),
|
|
4050
|
+
label: unref(m)("connect.setting.location.searchLocations"),
|
|
4051
|
+
placeholder: unref(m)("connect.setting.location.searchLocations")
|
|
4052
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
4053
|
+
createElementVNode("div", {
|
|
4054
|
+
ref_key: "listEl",
|
|
4055
|
+
ref: l,
|
|
4056
|
+
class: "overflow-y-auto border-y border-fm-color-neutral-gray-100",
|
|
4057
|
+
style: normalizeStyle({ height: `min(${VIEWPORT_HEIGHT}px, 50vh)` }),
|
|
4058
|
+
onScrollPassive: f[1] || (f[1] = (h) => p.value = h.target.scrollTop)
|
|
4059
|
+
}, [
|
|
4060
|
+
unref(n).length ? (openBlock(), createElementBlock("ul", {
|
|
4061
|
+
key: 0,
|
|
4062
|
+
class: "relative m-0 p-0 list-none",
|
|
4063
|
+
"aria-label": unref(m)("connect.campaign.common.available_at"),
|
|
4064
|
+
style: normalizeStyle({ height: `${unref(n).length * ROW_HEIGHT}px` })
|
|
4065
|
+
}, [
|
|
4066
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (h, v) => (openBlock(), createElementBlock("li", {
|
|
4067
|
+
key: h.id,
|
|
4068
|
+
class: "absolute left-0 right-0 flex items-center gap-12 px-8 border-b border-fm-color-neutral-gray-100 fm-typo-en-body-md-400",
|
|
4069
|
+
style: normalizeStyle({
|
|
4070
|
+
height: `${ROW_HEIGHT}px`,
|
|
4071
|
+
top: `${(unref(a) + v) * ROW_HEIGHT}px`
|
|
4072
|
+
})
|
|
4073
|
+
}, [
|
|
4074
|
+
h.code ? (openBlock(), createElementBlock("span", {
|
|
4075
|
+
key: 0,
|
|
4076
|
+
title: h.code,
|
|
4077
|
+
class: "w-[72px] shrink-0 truncate text-fm-color-typo-secondary"
|
|
4078
|
+
}, toDisplayString(h.code), 9, _hoisted_5$2)) : createCommentVNode("", !0),
|
|
4079
|
+
createElementVNode("span", {
|
|
4080
|
+
class: "min-w-0 truncate fm-typo-en-body-md-600",
|
|
4081
|
+
title: h.name
|
|
4082
|
+
}, toDisplayString(h.name), 9, _hoisted_6$2)
|
|
4083
|
+
], 4))), 128))
|
|
4084
|
+
], 12, _hoisted_4$2)) : (openBlock(), createElementBlock("div", _hoisted_7$1, toDisplayString(e.rows.length ? unref(m)("connect.campaign.common.locations_no_match") : unref(m)("connect.campaign.common.no_location")), 1))
|
|
4085
|
+
], 36),
|
|
4086
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
4087
|
+
createVNode(k, {
|
|
4088
|
+
label: unref(m)("connect.campaign.common.locations_close"),
|
|
4089
|
+
onClick: f[2] || (f[2] = (h) => unref(o).close())
|
|
4090
|
+
}, null, 8, ["label"])
|
|
4091
|
+
])
|
|
4092
|
+
]),
|
|
4093
|
+
_: 1
|
|
4094
|
+
});
|
|
4095
|
+
};
|
|
4096
|
+
}
|
|
4097
|
+
}), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$1 = {
|
|
4098
|
+
key: 0,
|
|
4099
|
+
class: "flex flex-wrap items-baseline gap-12"
|
|
4100
|
+
}, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_5$1 = ["onClick"], _hoisted_6$1 = {
|
|
4101
|
+
key: 1,
|
|
4102
|
+
class: "fm-typo-en-body-lg-600"
|
|
4103
|
+
}, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3993
4104
|
__name: "CampaignSummary",
|
|
3994
4105
|
props: {
|
|
4106
|
+
inDialog: {
|
|
4107
|
+
type: Boolean,
|
|
4108
|
+
default: !1
|
|
4109
|
+
},
|
|
3995
4110
|
data: {
|
|
3996
4111
|
type: Object,
|
|
3997
4112
|
required: !0
|
|
3998
4113
|
}
|
|
3999
4114
|
},
|
|
4000
4115
|
setup(e) {
|
|
4001
|
-
const { t: r, te: o } = useI18n();
|
|
4002
|
-
function
|
|
4003
|
-
|
|
4116
|
+
const { t: r, te: o } = useI18n(), m = useDialog();
|
|
4117
|
+
async function d(n) {
|
|
4118
|
+
l.inDialog && (m.close(), await nextTick()), m.open({
|
|
4119
|
+
title: "",
|
|
4120
|
+
dialogComponent: _sfc_main$2,
|
|
4121
|
+
dialogComponentProps: {
|
|
4122
|
+
rows: n.rows,
|
|
4123
|
+
total: n.total,
|
|
4124
|
+
unavailable: n.unavailable
|
|
4125
|
+
}
|
|
4126
|
+
});
|
|
4004
4127
|
}
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4128
|
+
function p(n) {
|
|
4129
|
+
return o(n) || o(n, "en-US");
|
|
4130
|
+
}
|
|
4131
|
+
const l = e;
|
|
4132
|
+
return (n, a) => {
|
|
4133
|
+
const u = resolveComponent("FmCard");
|
|
4134
|
+
return openBlock(), createBlock(u, {
|
|
4008
4135
|
variant: "outlined",
|
|
4009
4136
|
class: "p-16 space-y-8"
|
|
4010
4137
|
}, {
|
|
4011
4138
|
default: withCtx(() => [
|
|
4012
4139
|
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(r)("connect.campaign.common.summary")), 1),
|
|
4013
|
-
|
|
4014
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
4140
|
+
a[0] || (a[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
4141
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (y, f) => (openBlock(), createElementBlock("div", {
|
|
4015
4142
|
class: "space-y-4",
|
|
4016
|
-
key:
|
|
4143
|
+
key: f
|
|
4017
4144
|
}, [
|
|
4018
|
-
|
|
4019
|
-
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(r)(`${
|
|
4020
|
-
|
|
4145
|
+
y ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4146
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(r)(`${f}`)), 1),
|
|
4147
|
+
typeof y == "object" ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
4148
|
+
createElementVNode("span", _hoisted_4$1, [
|
|
4149
|
+
createTextVNode(toDisplayString(unref(r)("connect.campaign.common.locations_count", {
|
|
4150
|
+
count: y.rows.length.toLocaleString(),
|
|
4151
|
+
total: y.total.toLocaleString()
|
|
4152
|
+
})) + " ", 1),
|
|
4153
|
+
y.unavailable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
4154
|
+
createTextVNode(" , " + toDisplayString(unref(r)("connect.campaign.common.locations_unavailable", {
|
|
4155
|
+
count: y.unavailable.toLocaleString()
|
|
4156
|
+
})), 1)
|
|
4157
|
+
], 64)) : createCommentVNode("", !0)
|
|
4158
|
+
]),
|
|
4159
|
+
createElementVNode("button", {
|
|
4160
|
+
type: "button",
|
|
4161
|
+
class: "fm-typo-en-body-lg-600 text-fm-color-primary py-12 -my-12 px-8 -mx-8 underline underline-offset-2 hover:opacity-80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-fm-color-primary rounded-sm",
|
|
4162
|
+
onClick: (s) => d(y)
|
|
4163
|
+
}, toDisplayString(unref(r)("connect.campaign.common.locations_view")), 9, _hoisted_5$1)
|
|
4164
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_6$1, toDisplayString(p(`${y}`) ? unref(r)(`${y}`) : y), 1))
|
|
4021
4165
|
], 64)) : createCommentVNode("", !0)
|
|
4022
4166
|
]))), 128))
|
|
4023
4167
|
]),
|
|
@@ -4041,8 +4185,8 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4041
4185
|
pushAvailability.value = "checking";
|
|
4042
4186
|
try {
|
|
4043
4187
|
if (!r) throw new Error("Business ID is unavailable");
|
|
4044
|
-
const
|
|
4045
|
-
o() && (pushAvailability.value =
|
|
4188
|
+
const m = await getNativeApp(r);
|
|
4189
|
+
o() && (pushAvailability.value = m ? "native" : "non-native");
|
|
4046
4190
|
} catch {
|
|
4047
4191
|
o() && (pushAvailability.value = "failed");
|
|
4048
4192
|
}
|
|
@@ -4073,15 +4217,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4073
4217
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
4074
4218
|
} catch {
|
|
4075
4219
|
} finally {
|
|
4076
|
-
await new Promise((
|
|
4220
|
+
await new Promise((m) => setTimeout(m, 120)), isLoading.value = !1;
|
|
4077
4221
|
}
|
|
4078
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
4079
|
-
var
|
|
4080
|
-
if (
|
|
4081
|
-
const l = (
|
|
4222
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((m, d) => {
|
|
4223
|
+
var p;
|
|
4224
|
+
if (m.campaign.type === "VOUCHER" && m.campaign.code) {
|
|
4225
|
+
const l = (p = m.campaign._id) == null ? void 0 : p.toString();
|
|
4082
4226
|
useCampaignStore().campaigns.voucher.some(
|
|
4083
|
-
(n) => n.code ===
|
|
4084
|
-
) &&
|
|
4227
|
+
(n) => n.code === m.campaign.code && n._id.toString() !== l
|
|
4228
|
+
) && d.addIssue({
|
|
4085
4229
|
code: "custom",
|
|
4086
4230
|
message: "Code already exists, please use another code",
|
|
4087
4231
|
path: ["campaign", "code"]
|
|
@@ -4126,10 +4270,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4126
4270
|
});
|
|
4127
4271
|
function stepErrors(e = currentStep.value - 1) {
|
|
4128
4272
|
const r = template.value.steps[e].groups.flatMap(
|
|
4129
|
-
(o) => o.fields.map((
|
|
4273
|
+
(o) => o.fields.map((m) => schemaPathForField(m.property))
|
|
4130
4274
|
);
|
|
4131
4275
|
return errors.value.filter(
|
|
4132
|
-
(o) => r.some((
|
|
4276
|
+
(o) => r.some((m) => o.path.join(".").includes(m))
|
|
4133
4277
|
);
|
|
4134
4278
|
}
|
|
4135
4279
|
const validateOnSubmit = computed(() => campaignType.value === "BROADCAST"), submitAttempted = ref(!1), showValidation = computed(
|
|
@@ -4156,7 +4300,8 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4156
4300
|
title: "",
|
|
4157
4301
|
dialogComponent: _sfc_main$1,
|
|
4158
4302
|
dialogComponentProps: {
|
|
4159
|
-
data: data.value
|
|
4303
|
+
data: data.value,
|
|
4304
|
+
inDialog: !0
|
|
4160
4305
|
}
|
|
4161
4306
|
});
|
|
4162
4307
|
}
|
|
@@ -4173,22 +4318,22 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4173
4318
|
return e === "campaign.message" ? "campaign.delivery" : e;
|
|
4174
4319
|
}
|
|
4175
4320
|
function onUpdateProperty(e, r) {
|
|
4176
|
-
var o,
|
|
4321
|
+
var o, m, d, p, l, n, a, u;
|
|
4177
4322
|
if (e === "campaign.message" && r && "channels" in r) {
|
|
4178
4323
|
_.set(data.value, "campaign.delivery", r);
|
|
4179
|
-
const
|
|
4180
|
-
|
|
4324
|
+
const y = toLegacyMessage(r);
|
|
4325
|
+
y ? _.set(data.value, "campaign.message", y) : delete data.value.campaign.message;
|
|
4181
4326
|
return;
|
|
4182
4327
|
}
|
|
4183
4328
|
if (_.set(data.value, e, r), e == "campaign.event.type") {
|
|
4184
|
-
const f = ((
|
|
4185
|
-
...(
|
|
4329
|
+
const f = ((p = (d = (m = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : m.campaign) == null ? void 0 : d.event) == null ? void 0 : p.rule) ? _.cloneDeep({
|
|
4330
|
+
...(u = (a = (n = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : n.campaign) == null ? void 0 : a.event) == null ? void 0 : u.rule
|
|
4186
4331
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
4187
4332
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
4188
4333
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
4189
4334
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
4190
4335
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
4191
|
-
]),
|
|
4336
|
+
]), s = RuleBuilder.setRuleToGroup(
|
|
4192
4337
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
4193
4338
|
[
|
|
4194
4339
|
RuleBuilder.constructEntry(
|
|
@@ -4207,7 +4352,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4207
4352
|
_.set(
|
|
4208
4353
|
data.value,
|
|
4209
4354
|
"campaign.event.rule",
|
|
4210
|
-
RuleBuilder.setRuleToGroup(f,
|
|
4355
|
+
RuleBuilder.setRuleToGroup(f, s)
|
|
4211
4356
|
);
|
|
4212
4357
|
}
|
|
4213
4358
|
e == "campaign.notify" && r == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
@@ -4239,7 +4384,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4239
4384
|
(r || r === void 0) && (sheetVisible.value = !1);
|
|
4240
4385
|
}
|
|
4241
4386
|
return (e, r) => {
|
|
4242
|
-
const o = resolveComponent("FmButton"),
|
|
4387
|
+
const o = resolveComponent("FmButton"), m = resolveComponent("FmStep"), d = resolveComponent("FmStepper"), p = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
4243
4388
|
return openBlock(), createBlock(l, {
|
|
4244
4389
|
"fullscreen-size": "lg",
|
|
4245
4390
|
modelValue: unref(sheetVisible),
|
|
@@ -4295,7 +4440,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4295
4440
|
])
|
|
4296
4441
|
])
|
|
4297
4442
|
], -1)),
|
|
4298
|
-
createVNode(
|
|
4443
|
+
createVNode(p, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
4299
4444
|
])
|
|
4300
4445
|
])
|
|
4301
4446
|
])
|
|
@@ -4305,14 +4450,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4305
4450
|
name: "default",
|
|
4306
4451
|
fn: withCtx(() => [
|
|
4307
4452
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
4308
|
-
createVNode(
|
|
4453
|
+
createVNode(d, {
|
|
4309
4454
|
modelValue: unref(currentStep),
|
|
4310
4455
|
"onUpdate:modelValue": r[1] || (r[1] = (n) => isRef(currentStep) ? currentStep.value = n : null),
|
|
4311
4456
|
orientation: "horizontal",
|
|
4312
4457
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
4313
4458
|
}, {
|
|
4314
4459
|
default: withCtx(() => [
|
|
4315
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(
|
|
4460
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(m, {
|
|
4316
4461
|
key: n.name,
|
|
4317
4462
|
title: unref(getLocaleText)(n.name_locale, n.name),
|
|
4318
4463
|
value: a + 1,
|
|
@@ -4328,14 +4473,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4328
4473
|
variant: "tertiary",
|
|
4329
4474
|
onClick: r[2] || (r[2] = (n) => sheetVisible.value = !1)
|
|
4330
4475
|
}),
|
|
4331
|
-
createVNode(
|
|
4476
|
+
createVNode(d, {
|
|
4332
4477
|
modelValue: unref(currentStep),
|
|
4333
4478
|
"onUpdate:modelValue": r[3] || (r[3] = (n) => isRef(currentStep) ? currentStep.value = n : null),
|
|
4334
4479
|
orientation: "horizontal",
|
|
4335
4480
|
class: "flex-1"
|
|
4336
4481
|
}, {
|
|
4337
4482
|
default: withCtx(() => [
|
|
4338
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(
|
|
4483
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(m, {
|
|
4339
4484
|
key: n.name,
|
|
4340
4485
|
title: unref(sheetTitle),
|
|
4341
4486
|
description: unref(getLocaleText)(n.name_locale, n.name),
|
|
@@ -4373,35 +4518,35 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4373
4518
|
class: "space-y-24"
|
|
4374
4519
|
}, [
|
|
4375
4520
|
createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(n.name_locale, n.name ?? "")), 1),
|
|
4376
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (
|
|
4377
|
-
(openBlock(), createBlock(_sfc_main$
|
|
4378
|
-
key:
|
|
4379
|
-
field:
|
|
4380
|
-
modelValue: valueForField(
|
|
4381
|
-
disabled: isDisable(
|
|
4521
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (u, y) => (openBlock(), createElementBlock("div", { key: y }, [
|
|
4522
|
+
(openBlock(), createBlock(_sfc_main$3, {
|
|
4523
|
+
key: y,
|
|
4524
|
+
field: u,
|
|
4525
|
+
modelValue: valueForField(u.property),
|
|
4526
|
+
disabled: isDisable(u),
|
|
4382
4527
|
"campaign-type": unref(campaignType),
|
|
4383
4528
|
"show-validation": unref(showValidation),
|
|
4384
4529
|
"push-availability": unref(pushAvailability),
|
|
4385
4530
|
onRetryPush: checkPushAvailability,
|
|
4386
|
-
"onUpdate:modelValue": (f) => onUpdateProperty(
|
|
4387
|
-
"onUpdate:file": async (f,
|
|
4388
|
-
const
|
|
4389
|
-
onUpdateProperty(
|
|
4531
|
+
"onUpdate:modelValue": (f) => onUpdateProperty(u.property, f),
|
|
4532
|
+
"onUpdate:file": async (f, s) => {
|
|
4533
|
+
const k = await onUpdateFile(f, s);
|
|
4534
|
+
onUpdateProperty(u.property, k || "");
|
|
4390
4535
|
},
|
|
4391
4536
|
schema: unref(ZodHelper).typeAtPath(
|
|
4392
4537
|
unref(schema),
|
|
4393
|
-
schemaPathForField(
|
|
4538
|
+
schemaPathForField(u.property),
|
|
4394
4539
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
4395
4540
|
),
|
|
4396
4541
|
"helper-state": unref(ZodHelper).helperState(
|
|
4397
4542
|
unref(visibleErrors),
|
|
4398
|
-
schemaPathForField(
|
|
4543
|
+
schemaPathForField(u.property)
|
|
4399
4544
|
),
|
|
4400
4545
|
"helper-text": unref(ZodHelper).helperText(
|
|
4401
4546
|
unref(visibleErrors),
|
|
4402
|
-
schemaPathForField(
|
|
4547
|
+
schemaPathForField(u.property)
|
|
4403
4548
|
),
|
|
4404
|
-
extras:
|
|
4549
|
+
extras: u.extras != null ? u.extras == "" ? unref(data) : unref(_).get(unref(data), u.extras) : void 0
|
|
4405
4550
|
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "show-validation", "push-availability", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
4406
4551
|
]))), 128))
|
|
4407
4552
|
]))), 128)),
|