@feedmepos/mf-connect 0.1.98-beta.78 → 0.1.98-beta.79
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-Ddo6B0cR.js → App-BffPZGzn.js} +9 -9
- package/dist/{AuditLogs-CTW4pKS6.js → AuditLogs-D3MEmFSx.js} +12 -12
- package/dist/{Bin-54ynGToX.js → Bin-Jw_wcgsC.js} +8 -8
- package/dist/{Broadcast-Bwnrmqhh.js → Broadcast-DOw7z6bn.js} +12 -12
- package/dist/{CampaignAnalytic-Q_IRT5AD.js → CampaignAnalytic-XXjhRtfl.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BioWaVBq.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DkWeDf14.js} +7 -7
- package/dist/{Card-DVfhElpd.js → Card-D_rB1X9o.js} +22 -22
- package/dist/{Collections-D1ncD8Mx.js → Collections-Da1I5--J.js} +8 -8
- package/dist/{Credit-DXPNdUJ_.js → Credit-DJuBjxVe.js} +12 -12
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DiR_5MgW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CowFIZ3q.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-wfV6zhMB.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-pI1jnJn4.js} +1330 -1227
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-NqbdAsJM.js → EffectSheet.vue_vue_type_style_index_0_lang-BrBy93g0.js} +6 -6
- package/dist/{Experience-B-ksR_d_.js → Experience-F4_hPy4x.js} +13 -13
- package/dist/{FileSaver.min-DcsYCTzs.js → FileSaver.min-C-nhkwVc.js} +1 -1
- package/dist/{Game-CPgjDM23.js → Game-Cfe5gux2.js} +13 -13
- package/dist/{GiftCardSetup-DdH3wEOH.js → GiftCardSetup-CGJCg8-o.js} +10 -10
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BmskpBdL.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-DTHFJbl8.js} +7 -7
- package/dist/{Goals-xDLeFx_e.js → Goals-WWe3kZ3W.js} +4 -4
- package/dist/{Grab-CggkOy8j.js → Grab-Dr49Cz71.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Cm-g1p_m.js → ImageInput.vue_vue_type_script_setup_true_lang-CPB7kKVu.js} +1 -1
- package/dist/{Index-DcJNte9-.js → Index-TsViXhvK.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Ba2mtWTj.js → LocationPicker.vue_vue_type_script_setup_true_lang-DmXKvvvk.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-xQYvmoY2.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BgRr2Bu5.js} +1 -1
- package/dist/{LoyaltyDashboard-BMmC9kTo.js → LoyaltyDashboard-D-sVA0uB.js} +15 -15
- package/dist/{MainLayout-5V9aP_OW.js → MainLayout-gSvcU53G.js} +3 -3
- package/dist/{Marketing-C-7HoFsr.js → Marketing-BUsNL2jQ.js} +4 -4
- package/dist/{MarketingMaterialEdit-DKQrW2w-.js → MarketingMaterialEdit-DtubIpnt.js} +6 -6
- package/dist/{Member-BT-tGIGu.js → Member-9ng7QgMa.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CMc423yy.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-qOMNiTrI.js} +23 -23
- package/dist/{MemberImportHistory-4hgNWaYG.js → MemberImportHistory-BsW3XNAv.js} +7 -7
- package/dist/{MemberList-CHToXvvZ.js → MemberList-DUky4ceB.js} +14 -14
- package/dist/{MemberTransactions-sF8tlSLx.js → MemberTransactions-Bu-la_J4.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CX5N4HN8.js → MessageInput.vue_vue_type_script_setup_true_lang-BfLVofJG.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-B9xthwp-.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CYqH-qT-.js} +1 -1
- package/dist/{Mission-DeRwazDk.js → Mission-47XKDAIr.js} +14 -14
- package/dist/{Overview-CGHc1dGA.js → Overview-SDSNOe1_.js} +20 -20
- package/dist/{Overview-D1BfB0go.js → Overview-fPy87ZWK.js} +4 -4
- package/dist/{Point-DLbz1o1i.js → Point-Biql3Qi5.js} +14 -14
- package/dist/{Promotion-ND7k0GAt.js → Promotion-CBbBWtke.js} +14 -14
- package/dist/{Queue-DSZ6SHw8.js → Queue-DJgqg-cC.js} +12 -12
- package/dist/{Record-Cgl4Okdd.js → Record-C6Uzc6pD.js} +9 -9
- package/dist/{Review-CQYHHkrB.js → Review-C2pjn38Z.js} +2 -2
- package/dist/{ReviewFacebookCallback-D-5cP6tF.js → ReviewFacebookCallback-USPINa9z.js} +5 -5
- package/dist/{ReviewGoogleCallback-BqS0lbMq.js → ReviewGoogleCallback-Br_CV3Pq.js} +5 -5
- package/dist/{Reward-CEP9NauM.js → Reward-Bl6TyJoX.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B3A5Vl9M.js → RewardGroup.vue_vue_type_script_setup_true_lang-DVu2-HRI.js} +13 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Dx4fbmfw.js → RuleGroup.vue_vue_type_script_setup_true_lang-DqnvglII.js} +14 -14
- package/dist/{Segment-DVptqzgz.js → Segment-BKBNrfz8.js} +25 -25
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-oGVnY7GQ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DLskCbGj.js} +14 -14
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BTAWB1BA.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BT3-tDl-.js} +4 -4
- package/dist/{Setting-Cz0VvOFH.js → Setting-BqbtEU61.js} +15 -14
- package/dist/{SettingAdvertisements-D60yC83d.js → SettingAdvertisements-DoHnZG47.js} +12 -12
- package/dist/{Settings-BrfX54vL.js → Settings-HlQyk7g8.js} +5 -5
- package/dist/{Store-9RdTlgUo.js → Store-uexWJZhp.js} +26 -26
- package/dist/{StoreRewards-Cutn32ZD.js → StoreRewards-BbkTRt3c.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CJKQBlfI.js → StoreTransactions.vue_vue_type_script_setup_true_lang-K6q2obBY.js} +24 -24
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-I-fIH-8N.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CRfwFvlQ.js} +2 -2
- package/dist/{Tier-DQBr9R7i.js → Tier-DN6l1PvI.js} +26 -26
- package/dist/{Title-Ci9aPFLz.js → Title-4w7I9PNy.js} +22 -22
- package/dist/{Transaction-DqbHdcPo.js → Transaction-BypZ5Cbs.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CTmiqIwm.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CVaOiG6q.js} +6 -6
- package/dist/{Voucher-4lhxhd9C.js → Voucher-_kyZ6H17.js} +18 -18
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CFi6-VKK.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DbrNDu2d.js} +12 -12
- package/dist/{WhatsappBot-D38goJxM.js → WhatsappBot-CgLUjd8a.js} +2 -2
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Dgge7-H4.js → ZodTextField.vue_vue_type_script_setup_true_lang-B3BOd7wE.js} +2 -2
- package/dist/{app-Bb2tSOqF.js → app-BUdfgxte.js} +221 -166
- package/dist/app.js +1 -1
- package/dist/{base.export-BBOmcZxx.js → base.export-gSYuTgGq.js} +2 -2
- package/dist/{business-CjXvFAZn.js → business-CjYxENvr.js} +1 -1
- package/dist/{campaign-D2R8I06-.js → campaign-CNYzUQiR.js} +2 -2
- package/dist/{campaign-G0f6ljXi.js → campaign-yvttY7Iz.js} +10 -10
- package/dist/{campaign.fn-D-rMF_4s.js → campaign.fn-Bsb9ItkF.js} +2 -2
- package/dist/{collection.fn-Bvg6FCJb.js → collection.fn-0klvp7AD.js} +2 -2
- package/dist/{currency-BeiHwq_q.js → currency-UZt1QX64.js} +1 -1
- package/dist/{duplicateCampaign-Byxy6FXH.js → duplicateCampaign-CCr4vLrU.js} +2 -2
- package/dist/{effect-DqYtqvaw.js → effect-Dx3ZJxHs.js} +1 -1
- package/dist/{email-addresses-xIlBl9IU.js → email-addresses-C0cqEsI0.js} +2 -2
- package/dist/{helper-TqUK4r0b.js → helper-C_jOIHaL.js} +1 -1
- package/dist/{index-BvjcosEc.js → index--qbL3r5K.js} +3 -3
- package/dist/{index-7guDU5qb.js → index-9LJ75jOS.js} +7 -7
- package/dist/{index-B1L4q1L0.js → index-BLn35ij4.js} +1 -1
- package/dist/{index-9FJqvQeE.js → index-BWnVV310.js} +3 -3
- package/dist/{index-BxEshHrE.js → index-BhP7DpQu.js} +8 -8
- package/dist/{index-BDt914jM.js → index-Bru3cF21.js} +1 -1
- package/dist/{index-BFHYshPb.js → index-C4cDk-o7.js} +1 -1
- package/dist/{index-BvHzJVnj.js → index-Cb9hrU0J.js} +1 -1
- package/dist/{index-XqDLmdvl.js → index-ChgrDBj1.js} +2 -2
- package/dist/{index-CSI31fuh.js → index-D3wRc-GN.js} +4 -4
- package/dist/{index-DNcisv5D.js → index-D8i3eZnu.js} +1 -1
- package/dist/{index-Dt8H5FKD.js → index-DWdVixHn.js} +4 -4
- package/dist/{index-t-aeCJQI.js → index-Dr0sT8uH.js} +2 -2
- package/dist/{index-B44CZDQD.js → index-Dwrv-CFH.js} +2 -2
- package/dist/{index-nuIbpzmL.js → index-DyaRNZLw.js} +1 -1
- package/dist/{index-D_ix7k3A.js → index-U9Y--r1N.js} +3 -2
- package/dist/{index-DMWHB3Zu.js → index-kwMMiU8Z.js} +2 -2
- package/dist/{index-DG8fSuaM.js → index-tS9a8fVh.js} +1 -1
- package/dist/{index-C7V7AtVf.js → index-uNe9XFEK.js} +2 -2
- package/dist/{index.esm2017-Byww7zVy.js → index.esm2017-DqDs52qt.js} +1 -1
- package/dist/{loading-pAf2o94t.js → loading-DbSZrkUs.js} +1 -1
- package/dist/{lodash-CnCxUFbR.js → lodash-DqWWo2-K.js} +1 -1
- package/dist/{member-import-D5RxoWpQ.js → member-import-CoVI5_0P.js} +1 -1
- package/dist/{membership--1r5zMgb.js → membership-SQa4SZUq.js} +2 -2
- package/dist/{money-YS0nj9Vy.js → money-Cl_T-LaY.js} +1 -1
- package/dist/{number-DpfYNS77.js → number-BOrgnhwZ.js} +1 -1
- package/dist/{objectid-CzMdDxLC.js → objectid-CsDYQ9eX.js} +10 -10
- package/dist/{onboarding-XAuEF8Fv.js → onboarding-BLU2SSrI.js} +3 -3
- package/dist/{onboardingSetup-CKQDFlu9.js → onboardingSetup-jyeouaTv.js} +2 -2
- package/dist/{plugins-CO0TBKil.js → plugins-t_9JTEIa.js} +3 -3
- package/dist/{reward-CfKDiCkk.js → reward-BWunDF4U.js} +1 -1
- package/dist/{rule-BuuHD_-S.js → rule-DyUt0gcn.js} +9 -9
- package/dist/{template-DYbZtKQg.js → template-DNh14IvS.js} +6 -6
- package/dist/{timezone-C64owf7o.js → timezone-DpCfnolZ.js} +1 -1
- package/dist/{transaction.fn-ClQ1jH9V.js → transaction.fn-D8JhcKmt.js} +2 -2
- package/dist/{trigger-DUkCFrPG.js → trigger-DYyQ4d7Z.js} +5 -5
- package/dist/{useMarketingMaterialActions-CA2iWa32.js → useMarketingMaterialActions-BVzjD61l.js} +3 -3
- package/dist/{usePagination-BZmMaVcI.js → usePagination-jqXEShKi.js} +1 -1
- package/dist/{user-beTdsIEQ.js → user-Bb-YcUvV.js} +1 -1
- package/dist/{vue-i18n-Cfu8S_JC.js → vue-i18n-Bud-ZmQ_.js} +109 -109
- package/dist/{xlsx-BMeHM9By.js → xlsx-NzYW6kUX.js} +1 -1
- package/dist/{zod-DTSByurx.js → zod-DK9AcJ_Q.js} +1 -1
- package/package.json +1 -1
|
@@ -1,57 +1,69 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, isRef, createTextVNode, normalizeClass, watchEffect, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { F as
|
|
8
|
-
import { F as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { u as
|
|
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-DqWWo2-K.js";
|
|
3
|
+
import { h as axios, c as core, S as SvcConfig } from "./index-U9Y--r1N.js";
|
|
4
|
+
import { z, S as S6, f as Zh } from "./app-BUdfgxte.js";
|
|
5
|
+
import { Z as ZodHelper } from "./zod-DK9AcJ_Q.js";
|
|
6
|
+
import { z as z$1 } from "./index-C_H8jFYf.js";
|
|
7
|
+
import { e as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, f as FdtoRunnableCampaign, g as FdoCreditLoyaltyReward, h as FdtoRandomReward, i as F_MISSION_TYPE, j as FdoThresholdCreditReward, k as FdtoThresholdReward, l as FdoMission } from "./index-DWdVixHn.js";
|
|
8
|
+
import { F as FdoObjectId } from "./index-BWnVV310.js";
|
|
9
|
+
import { F as FdtoCollectibleConfig } from "./index-kwMMiU8Z.js";
|
|
10
|
+
import { a as isRuleGroup, R as RuleBuilder, s as stripRruleDtstartExceptSchedule, i as isRuleEntry, T as TEMPLATES } from "./index-9LJ75jOS.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--qbL3r5K.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-yvttY7Iz.js";
|
|
13
|
+
import { u as useMembershipStore } from "./membership-SQa4SZUq.js";
|
|
14
|
+
import { u as useBusinessStore } from "./business-CjYxENvr.js";
|
|
14
15
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
15
16
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
16
17
|
import { f as featureVersionMapping } from "./campaign.enum-Dx-Zo68Q.js";
|
|
17
|
-
import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { b as _sfc_main$A, a as _sfc_main$D, _ as _sfc_main$F } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
19
|
-
import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
20
|
-
import {
|
|
21
|
-
import { p as prompt, f as firebaseStorage } from "./plugins-CO0TBKil.js";
|
|
18
|
+
import { _ as _sfc_main$C } from "./ImageInput.vue_vue_type_script_setup_true_lang-CPB7kKVu.js";
|
|
19
|
+
import { b as _sfc_main$A, a as _sfc_main$D, _ as _sfc_main$F } from "./EffectSheet.vue_vue_type_style_index_0_lang-BrBy93g0.js";
|
|
20
|
+
import { _ as _sfc_main$E } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CRfwFvlQ.js";
|
|
21
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-t_9JTEIa.js";
|
|
22
22
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
23
|
-
import { _ as _sfc_main$G } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
24
|
-
import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
25
|
-
import { u as useI18n } from "./vue-i18n-
|
|
26
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-
|
|
27
|
-
import { D as DEFAULT_MESSAGE_VARIABLES, b as _sfc_main$v, g as getSmsMessageMetrics, _ as _sfc_main$w, a as _sfc_main$x } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
23
|
+
import { _ as _sfc_main$G } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CVaOiG6q.js";
|
|
24
|
+
import { a as _sfc_main$u, _ as _sfc_main$y } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DqnvglII.js";
|
|
25
|
+
import { u as useI18n } from "./vue-i18n-Bud-ZmQ_.js";
|
|
26
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$H, b as _sfc_main$I } from "./trigger-DYyQ4d7Z.js";
|
|
27
|
+
import { D as DEFAULT_MESSAGE_VARIABLES, b as _sfc_main$v, g as getSmsMessageMetrics, _ as _sfc_main$w, a as _sfc_main$x } from "./MessageInput.vue_vue_type_script_setup_true_lang-BfLVofJG.js";
|
|
28
|
+
import { useDialog } from "@feedmepos/ui-library";
|
|
28
29
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
29
|
-
import { c as campaignApi } from "./index-
|
|
30
|
-
import { m as membershipApi } from "./index-
|
|
31
|
-
import { m as moment } from "./index-
|
|
32
|
-
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-
|
|
33
|
-
import { C as CountryTimezone } from "./timezone-
|
|
34
|
-
import { _ as _sfc_main$z, a as _sfc_main$B } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
35
|
-
import "./index-
|
|
36
|
-
import "./index-
|
|
37
|
-
import "./index-
|
|
30
|
+
import { c as campaignApi } from "./index-Dwrv-CFH.js";
|
|
31
|
+
import { m as membershipApi } from "./index-uNe9XFEK.js";
|
|
32
|
+
import { m as moment } from "./index-DyaRNZLw.js";
|
|
33
|
+
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-DyUt0gcn.js";
|
|
34
|
+
import { C as CountryTimezone } from "./timezone-DpCfnolZ.js";
|
|
35
|
+
import { _ as _sfc_main$z, a as _sfc_main$B } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DbrNDu2d.js";
|
|
36
|
+
import "./index-D3wRc-GN.js";
|
|
37
|
+
import "./index-Dr0sT8uH.js";
|
|
38
|
+
import "./index-BLn35ij4.js";
|
|
38
39
|
import "./index-BgECjFM0.js";
|
|
39
40
|
import { a as F_GAME_TYPE } from "./collectible.enum-Liy2wH3s.js";
|
|
40
|
-
import { u as useLoading } from "./loading-
|
|
41
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
42
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
41
|
+
import { u as useLoading } from "./loading-DbSZrkUs.js";
|
|
42
|
+
import { i as initCollectibleConfig } from "./helper-C_jOIHaL.js";
|
|
43
|
+
import { C as CollectionUtils } from "./collection.fn-0klvp7AD.js";
|
|
43
44
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
44
|
-
import {
|
|
45
|
-
import { u as useCampaignStore } from "./campaign-D2R8I06-.js";
|
|
45
|
+
import { u as useCampaignStore } from "./campaign-CNYzUQiR.js";
|
|
46
46
|
import { a as cleanPF } from "./object-BYyQ0PZp.js";
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const publicClient = axios.create({ withCredentials: !1, timeout: 5e3 });
|
|
48
|
+
async function getNativeApp(e) {
|
|
49
|
+
z.string().length(24).parse(e);
|
|
50
|
+
const o = await publicClient.get(
|
|
51
|
+
`https://api.feedmedev.vip/metadata/${encodeURIComponent(e)}/native-app`
|
|
52
|
+
);
|
|
53
|
+
return z.object({
|
|
54
|
+
businessId: z.literal(e),
|
|
55
|
+
native: z.boolean(),
|
|
56
|
+
platforms: z.array(z.string())
|
|
57
|
+
}).parse(o.data).native;
|
|
58
|
+
}
|
|
59
|
+
function campaignRefinement(e, r) {
|
|
60
|
+
var i, u;
|
|
61
|
+
if (console.log(e, r), !e) return;
|
|
50
62
|
const o = e.campaign;
|
|
51
63
|
if (!o) return;
|
|
52
|
-
const
|
|
53
|
-
if (!
|
|
54
|
-
|
|
64
|
+
const m = o.event.rule;
|
|
65
|
+
if (!m || !isRuleGroup(m)) {
|
|
66
|
+
r.addIssue({
|
|
55
67
|
code: "custom",
|
|
56
68
|
path: ["campaign", "event", "rule"],
|
|
57
69
|
params: {
|
|
@@ -63,7 +75,7 @@ function campaignRefinement(e, s) {
|
|
|
63
75
|
}
|
|
64
76
|
switch (o.type) {
|
|
65
77
|
case "MISSION": {
|
|
66
|
-
o.earningOption.amount > o.mission.end &&
|
|
78
|
+
o.earningOption.amount > o.mission.end && r.addIssue({
|
|
67
79
|
code: "custom",
|
|
68
80
|
path: ["campaign", "earningOption"],
|
|
69
81
|
params: {
|
|
@@ -75,7 +87,7 @@ function campaignRefinement(e, s) {
|
|
|
75
87
|
}
|
|
76
88
|
case "CREDIT": {
|
|
77
89
|
const l = (i = o.config) == null ? void 0 : i.validityOption;
|
|
78
|
-
(!l || ["validForDay", "validBefore"].every((a) => l[a] == null)) &&
|
|
90
|
+
(!l || ["validForDay", "validBefore"].every((a) => l[a] == null)) && r.addIssue({
|
|
79
91
|
code: "custom",
|
|
80
92
|
path: ["campaign", "config", "validityOption"],
|
|
81
93
|
params: {
|
|
@@ -87,14 +99,14 @@ function campaignRefinement(e, s) {
|
|
|
87
99
|
switch (o.event.type) {
|
|
88
100
|
case "BILL_COMPLETED":
|
|
89
101
|
o.type === "MISSION" && o.rewards.length && (o.rewards.forEach((l, n) => {
|
|
90
|
-
(l.threshold < 0 || l.threshold > o.mission.end) &&
|
|
102
|
+
(l.threshold < 0 || l.threshold > o.mission.end) && r.addIssue({
|
|
91
103
|
code: "custom",
|
|
92
104
|
path: ["campaign", "rewards", n, "threshold"],
|
|
93
105
|
params: {
|
|
94
106
|
i18n: "connectZodCustom:campaign.reward_threshold_range"
|
|
95
107
|
}
|
|
96
108
|
});
|
|
97
|
-
}), (
|
|
109
|
+
}), (u = o.config) != null && u.validityOption.followFirstReceive || r.addIssue({
|
|
98
110
|
code: "custom",
|
|
99
111
|
path: ["campaign", "config", "validityOption"],
|
|
100
112
|
params: {
|
|
@@ -103,8 +115,8 @@ function campaignRefinement(e, s) {
|
|
|
103
115
|
}));
|
|
104
116
|
break;
|
|
105
117
|
case "SCHEDULE": {
|
|
106
|
-
if (!
|
|
107
|
-
|
|
118
|
+
if (!m.rules.g_schedule) {
|
|
119
|
+
r.addIssue({
|
|
108
120
|
code: "custom",
|
|
109
121
|
path: ["campaign", "event", "rule"],
|
|
110
122
|
params: {
|
|
@@ -115,7 +127,7 @@ function campaignRefinement(e, s) {
|
|
|
115
127
|
return;
|
|
116
128
|
}
|
|
117
129
|
const l = RuleBuilder.getRules(
|
|
118
|
-
|
|
130
|
+
m.rules.g_schedule
|
|
119
131
|
), n = [
|
|
120
132
|
{
|
|
121
133
|
property: "trigger.date",
|
|
@@ -126,10 +138,10 @@ function campaignRefinement(e, s) {
|
|
|
126
138
|
operator: ["_isOnTime"]
|
|
127
139
|
}
|
|
128
140
|
];
|
|
129
|
-
n.length == l.length && n.every((
|
|
130
|
-
const
|
|
131
|
-
return
|
|
132
|
-
})) ||
|
|
141
|
+
n.length == l.length && n.every((s) => l.some((y) => {
|
|
142
|
+
const f = RuleBuilder.simplify(y);
|
|
143
|
+
return f.property === s.property && s.operator.includes(f.operator);
|
|
144
|
+
})) || r.addIssue({
|
|
133
145
|
code: "custom",
|
|
134
146
|
path: ["campaign", "event", "rule"],
|
|
135
147
|
params: {
|
|
@@ -139,7 +151,7 @@ function campaignRefinement(e, s) {
|
|
|
139
151
|
break;
|
|
140
152
|
}
|
|
141
153
|
default: {
|
|
142
|
-
"earningOption" in o && o.earningOption.type != "FIXED" &&
|
|
154
|
+
"earningOption" in o && o.earningOption.type != "FIXED" && r.addIssue({
|
|
143
155
|
code: "custom",
|
|
144
156
|
path: ["campaign", "earningOption"],
|
|
145
157
|
params: {
|
|
@@ -153,89 +165,89 @@ function campaignRefinement(e, s) {
|
|
|
153
165
|
function campaignTransform(e) {
|
|
154
166
|
var o;
|
|
155
167
|
if (e.campaign.type === "VOUCHER" && "configs" in e) {
|
|
156
|
-
const
|
|
157
|
-
|
|
168
|
+
const m = e.configs;
|
|
169
|
+
m.extras.targetLocation = e.campaign.targetLocation;
|
|
158
170
|
const i = Math.max(
|
|
159
171
|
e.campaign.earningOption.amount,
|
|
160
|
-
|
|
172
|
+
m.options.maxUse ?? 1
|
|
161
173
|
);
|
|
162
|
-
e.campaign.earningOption.amount = i,
|
|
174
|
+
e.campaign.earningOption.amount = i, m.options.maxUse = i, e.campaign.earningOption = {
|
|
163
175
|
type: "FIXED",
|
|
164
176
|
amount: 1
|
|
165
177
|
};
|
|
166
178
|
}
|
|
167
179
|
if (e.campaign.type == "MISSION" && "configs" in e) {
|
|
168
|
-
const
|
|
169
|
-
|
|
180
|
+
const m = e.configs;
|
|
181
|
+
m.options.validityOption = (o = e.campaign.config) == null ? void 0 : o.validityOption;
|
|
170
182
|
}
|
|
171
|
-
const
|
|
172
|
-
return
|
|
183
|
+
const r = e.campaign.event;
|
|
184
|
+
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;
|
|
173
185
|
}
|
|
174
186
|
function GenerateCampaignReq(e) {
|
|
175
|
-
const
|
|
187
|
+
const r = FdtoRunnableCampaign.optionsMap.get(e).extend({
|
|
176
188
|
_id: FdoObjectId.optional(),
|
|
177
|
-
collectible: z.string().nullish()
|
|
189
|
+
collectible: z$1.string().nullish()
|
|
178
190
|
});
|
|
179
191
|
switch (e) {
|
|
180
192
|
case "VOUCHER":
|
|
181
|
-
return z.object({
|
|
182
|
-
campaign:
|
|
193
|
+
return z$1.object({
|
|
194
|
+
campaign: r,
|
|
183
195
|
templateId: FdoObjectId,
|
|
184
196
|
configs: FdtoCollectibleConfig,
|
|
185
|
-
updateCollections: z.boolean().optional(),
|
|
186
|
-
code: z.string().optional()
|
|
197
|
+
updateCollections: z$1.boolean().optional(),
|
|
198
|
+
code: z$1.string().optional()
|
|
187
199
|
});
|
|
188
200
|
case "PROMOTION":
|
|
189
|
-
return z.object({
|
|
190
|
-
campaign:
|
|
201
|
+
return z$1.object({
|
|
202
|
+
campaign: r,
|
|
191
203
|
templateId: FdoObjectId
|
|
192
204
|
});
|
|
193
205
|
case "POINT":
|
|
194
|
-
return z.object({
|
|
195
|
-
campaign:
|
|
206
|
+
return z$1.object({
|
|
207
|
+
campaign: r,
|
|
196
208
|
templateId: FdoObjectId
|
|
197
209
|
});
|
|
198
210
|
case "CREDIT":
|
|
199
|
-
return z.object({
|
|
200
|
-
campaign:
|
|
211
|
+
return z$1.object({
|
|
212
|
+
campaign: r,
|
|
201
213
|
templateId: FdoObjectId
|
|
202
214
|
});
|
|
203
215
|
case "BROADCAST":
|
|
204
|
-
return z.object({
|
|
205
|
-
campaign:
|
|
216
|
+
return z$1.object({
|
|
217
|
+
campaign: r.refine((o) => !!o.delivery || !!o.message, {
|
|
206
218
|
path: ["delivery"],
|
|
207
219
|
message: "A broadcast requires a message or delivery configuration."
|
|
208
220
|
}),
|
|
209
221
|
templateId: FdoObjectId
|
|
210
222
|
});
|
|
211
223
|
case "COIN":
|
|
212
|
-
return z.object({
|
|
213
|
-
campaign:
|
|
224
|
+
return z$1.object({
|
|
225
|
+
campaign: r,
|
|
214
226
|
templateId: FdoObjectId
|
|
215
227
|
});
|
|
216
228
|
case "REWARD_POOL":
|
|
217
|
-
return z.object({
|
|
218
|
-
campaign:
|
|
229
|
+
return z$1.object({
|
|
230
|
+
campaign: r,
|
|
219
231
|
templateId: FdoObjectId,
|
|
220
|
-
updateCollections: z.boolean().optional()
|
|
232
|
+
updateCollections: z$1.boolean().optional()
|
|
221
233
|
});
|
|
222
234
|
case "GAME":
|
|
223
|
-
return z.object({
|
|
224
|
-
campaign:
|
|
235
|
+
return z$1.object({
|
|
236
|
+
campaign: r,
|
|
225
237
|
configs: FdtoCollectibleConfig,
|
|
226
238
|
templateId: FdoObjectId,
|
|
227
|
-
updateCollections: z.boolean().optional()
|
|
239
|
+
updateCollections: z$1.boolean().optional()
|
|
228
240
|
});
|
|
229
241
|
case "MISSION":
|
|
230
|
-
return z.object({
|
|
231
|
-
campaign:
|
|
242
|
+
return z$1.object({
|
|
243
|
+
campaign: r,
|
|
232
244
|
configs: FdtoCollectibleConfig,
|
|
233
245
|
templateId: FdoObjectId,
|
|
234
|
-
updateCollections: z.boolean().optional()
|
|
246
|
+
updateCollections: z$1.boolean().optional()
|
|
235
247
|
});
|
|
236
248
|
case "GRAB":
|
|
237
|
-
return z.object({
|
|
238
|
-
campaign:
|
|
249
|
+
return z$1.object({
|
|
250
|
+
campaign: r,
|
|
239
251
|
templateId: FdoObjectId
|
|
240
252
|
});
|
|
241
253
|
default:
|
|
@@ -244,9 +256,9 @@ function GenerateCampaignReq(e) {
|
|
|
244
256
|
}
|
|
245
257
|
FdoGroup.extend({
|
|
246
258
|
_id: FdoObjectId.optional(),
|
|
247
|
-
name: z.string().min(1).max(300),
|
|
259
|
+
name: z$1.string().min(1).max(300),
|
|
248
260
|
business: FdoObjectId.optional(),
|
|
249
|
-
campaigns: z.array(FdoObjectId).optional()
|
|
261
|
+
campaigns: z$1.array(FdoObjectId).optional()
|
|
250
262
|
});
|
|
251
263
|
const CampaignDtos = {
|
|
252
264
|
[F_RUNNABLE_CAMPAIGN_TYPE.enum.VOUCHER]: GenerateCampaignReq("VOUCHER"),
|
|
@@ -263,20 +275,20 @@ const CampaignDtos = {
|
|
|
263
275
|
function summarizeGrabDiscount(e) {
|
|
264
276
|
if (!e)
|
|
265
277
|
return null;
|
|
266
|
-
const
|
|
278
|
+
const r = core.Config.getCountry().currency.symbol;
|
|
267
279
|
function o(l) {
|
|
268
280
|
switch (l.scope.type) {
|
|
269
281
|
case "order":
|
|
270
282
|
return "Bill discount";
|
|
271
283
|
case "items":
|
|
272
|
-
return l.type.startsWith("bundle") ?
|
|
284
|
+
return l.type.startsWith("bundle") ? m(l.type) : "Item discount";
|
|
273
285
|
case "categories":
|
|
274
286
|
return "Category discount";
|
|
275
287
|
default:
|
|
276
288
|
return "Discount";
|
|
277
289
|
}
|
|
278
290
|
}
|
|
279
|
-
function
|
|
291
|
+
function m(l) {
|
|
280
292
|
switch (l) {
|
|
281
293
|
case "bundleSameFixPrice":
|
|
282
294
|
return "Bundle (same item) - Fixed price";
|
|
@@ -303,25 +315,25 @@ function summarizeGrabDiscount(e) {
|
|
|
303
315
|
case "net":
|
|
304
316
|
case "bundleSameNet":
|
|
305
317
|
case "bundleDiffNet":
|
|
306
|
-
return `${
|
|
318
|
+
return `${r}${l.value} discount`;
|
|
307
319
|
case "bundleSameFixPrice":
|
|
308
320
|
case "bundleDiffFixPrice":
|
|
309
|
-
return `${
|
|
321
|
+
return `${r}${l.value} fixed price`;
|
|
310
322
|
case "delivery":
|
|
311
323
|
return "Delivery fee discount";
|
|
312
324
|
case "freeItem":
|
|
313
325
|
return "Free item";
|
|
314
326
|
default:
|
|
315
|
-
return `${
|
|
327
|
+
return `${r}${l.value} discount`;
|
|
316
328
|
}
|
|
317
329
|
}
|
|
318
|
-
function
|
|
319
|
-
return l.cap && l.cap > 0 ? `capped at ${
|
|
330
|
+
function u(l) {
|
|
331
|
+
return l.cap && l.cap > 0 ? `capped at ${r}${l.cap}` : null;
|
|
320
332
|
}
|
|
321
333
|
return {
|
|
322
334
|
type: o(e),
|
|
323
335
|
adjustment: i(e),
|
|
324
|
-
cap:
|
|
336
|
+
cap: u(e)
|
|
325
337
|
};
|
|
326
338
|
}
|
|
327
339
|
const _hoisted_1$r = {
|
|
@@ -335,43 +347,43 @@ const _hoisted_1$r = {
|
|
|
335
347
|
filterItems: { type: Function }
|
|
336
348
|
},
|
|
337
349
|
emits: ["confirm", "cancel"],
|
|
338
|
-
setup(e, { emit:
|
|
339
|
-
const o = e,
|
|
350
|
+
setup(e, { emit: r }) {
|
|
351
|
+
const o = e, m = r, i = ref();
|
|
340
352
|
watch(
|
|
341
353
|
() => o.visible,
|
|
342
354
|
(a) => {
|
|
343
|
-
var
|
|
344
|
-
!a && i.value && ((
|
|
355
|
+
var s, y;
|
|
356
|
+
!a && i.value && ((y = (s = i.value).setSelectedItems) == null || y.call(s, o.initialValue || []));
|
|
345
357
|
}
|
|
346
358
|
);
|
|
347
|
-
function
|
|
359
|
+
function u() {
|
|
348
360
|
var a;
|
|
349
361
|
(a = i.value) == null || a.onConfirm();
|
|
350
362
|
}
|
|
351
363
|
function l() {
|
|
352
|
-
|
|
364
|
+
m("cancel");
|
|
353
365
|
}
|
|
354
366
|
function n(a) {
|
|
355
|
-
|
|
367
|
+
m("confirm", a);
|
|
356
368
|
}
|
|
357
|
-
return (a,
|
|
358
|
-
const
|
|
369
|
+
return (a, s) => {
|
|
370
|
+
const y = resolveComponent("FmIcon"), f = resolveComponent("FmButton");
|
|
359
371
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$r, [
|
|
360
372
|
createElementVNode("div", _hoisted_2$n, [
|
|
361
373
|
createElementVNode("div", _hoisted_3$k, [
|
|
362
|
-
createVNode(
|
|
374
|
+
createVNode(y, {
|
|
363
375
|
name: "restaurant",
|
|
364
376
|
size: "md"
|
|
365
377
|
}),
|
|
366
|
-
|
|
378
|
+
s[0] || (s[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
|
|
367
379
|
]),
|
|
368
|
-
createVNode(
|
|
380
|
+
createVNode(f, {
|
|
369
381
|
icon: "close",
|
|
370
382
|
variant: "tertiary",
|
|
371
383
|
onClick: l
|
|
372
384
|
})
|
|
373
385
|
]),
|
|
374
|
-
|
|
386
|
+
s[1] || (s[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)),
|
|
375
387
|
createElementVNode("div", _hoisted_4$j, [
|
|
376
388
|
createVNode(unref(S6), {
|
|
377
389
|
ref_key: "selectItemRef",
|
|
@@ -383,15 +395,15 @@ const _hoisted_1$r = {
|
|
|
383
395
|
}, null, 8, ["initial-value", "filter-items"])
|
|
384
396
|
]),
|
|
385
397
|
createElementVNode("div", _hoisted_5$g, [
|
|
386
|
-
createVNode(
|
|
398
|
+
createVNode(f, {
|
|
387
399
|
variant: "secondary",
|
|
388
400
|
label: "Cancel",
|
|
389
401
|
onClick: l
|
|
390
402
|
}),
|
|
391
|
-
createVNode(
|
|
403
|
+
createVNode(f, {
|
|
392
404
|
variant: "primary",
|
|
393
405
|
label: "Confirm Selection",
|
|
394
|
-
onClick:
|
|
406
|
+
onClick: u
|
|
395
407
|
})
|
|
396
408
|
])
|
|
397
409
|
])) : createCommentVNode("", !0);
|
|
@@ -410,57 +422,57 @@ const _hoisted_1$r = {
|
|
|
410
422
|
initialValue: {}
|
|
411
423
|
},
|
|
412
424
|
emits: ["confirm", "cancel"],
|
|
413
|
-
setup(e, { emit:
|
|
414
|
-
const o = e,
|
|
415
|
-
const
|
|
416
|
-
return
|
|
417
|
-
id:
|
|
418
|
-
name:
|
|
425
|
+
setup(e, { emit: r }) {
|
|
426
|
+
const o = e, m = r, i = Zh(), u = ref({}), l = ref(""), n = computed(() => {
|
|
427
|
+
const d = i.menu.value;
|
|
428
|
+
return d ? d.modules.category.map((p) => ({
|
|
429
|
+
id: p._id,
|
|
430
|
+
name: p.name
|
|
419
431
|
})) : [];
|
|
420
432
|
}), a = computed(() => {
|
|
421
433
|
if (!l.value) return n.value;
|
|
422
|
-
const
|
|
434
|
+
const d = l.value.toLowerCase();
|
|
423
435
|
return n.value.filter(
|
|
424
|
-
(
|
|
436
|
+
(p) => p.name.toLowerCase().includes(d)
|
|
425
437
|
);
|
|
426
|
-
}),
|
|
427
|
-
function
|
|
428
|
-
|
|
429
|
-
(
|
|
438
|
+
}), s = computed(() => Object.values(u.value).filter(Boolean).length);
|
|
439
|
+
function y() {
|
|
440
|
+
u.value = n.value.reduce(
|
|
441
|
+
(d, p) => (d[p.id] = o.initialValue.includes(p.id), d),
|
|
430
442
|
{}
|
|
431
443
|
);
|
|
432
444
|
}
|
|
433
445
|
watch([() => o.visible, () => o.initialValue], () => {
|
|
434
|
-
o.visible &&
|
|
446
|
+
o.visible && y();
|
|
435
447
|
}), onMounted(async () => {
|
|
436
|
-
await i.store.getMenu(),
|
|
448
|
+
await i.store.getMenu(), y();
|
|
437
449
|
});
|
|
438
|
-
function
|
|
439
|
-
|
|
450
|
+
function f(d) {
|
|
451
|
+
u.value[d] = !u.value[d];
|
|
440
452
|
}
|
|
441
|
-
function
|
|
442
|
-
const
|
|
443
|
-
a.value.forEach((
|
|
444
|
-
|
|
453
|
+
function c() {
|
|
454
|
+
const d = s.value === a.value.length;
|
|
455
|
+
a.value.forEach((p) => {
|
|
456
|
+
u.value[p.id] = !d;
|
|
445
457
|
});
|
|
446
458
|
}
|
|
447
|
-
function
|
|
448
|
-
Object.keys(
|
|
449
|
-
|
|
459
|
+
function k() {
|
|
460
|
+
Object.keys(u.value).forEach((d) => {
|
|
461
|
+
u.value[d] = !1;
|
|
450
462
|
});
|
|
451
463
|
}
|
|
452
|
-
function
|
|
453
|
-
const
|
|
454
|
-
|
|
464
|
+
function V() {
|
|
465
|
+
const d = Object.entries(u.value).filter(([, p]) => p).map(([p]) => p);
|
|
466
|
+
m("confirm", d);
|
|
455
467
|
}
|
|
456
|
-
function
|
|
457
|
-
|
|
468
|
+
function g() {
|
|
469
|
+
m("cancel");
|
|
458
470
|
}
|
|
459
|
-
const
|
|
460
|
-
(
|
|
471
|
+
const v = computed(() => a.value.length > 0 && a.value.every(
|
|
472
|
+
(d) => u.value[d.id]
|
|
461
473
|
));
|
|
462
|
-
return (
|
|
463
|
-
const C = resolveComponent("FmIcon"), x = resolveComponent("FmButton"),
|
|
474
|
+
return (d, p) => {
|
|
475
|
+
const C = resolveComponent("FmIcon"), x = resolveComponent("FmButton"), N = resolveComponent("FmTextField"), w = resolveComponent("FmCheckbox"), $ = resolveComponent("FmListItem"), T = resolveComponent("FmList");
|
|
464
476
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$q, [
|
|
465
477
|
createElementVNode("div", _hoisted_2$m, [
|
|
466
478
|
createElementVNode("div", _hoisted_3$j, [
|
|
@@ -468,55 +480,55 @@ const _hoisted_1$r = {
|
|
|
468
480
|
name: "category",
|
|
469
481
|
size: "md"
|
|
470
482
|
}),
|
|
471
|
-
|
|
483
|
+
p[2] || (p[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
|
|
472
484
|
]),
|
|
473
485
|
createVNode(x, {
|
|
474
486
|
icon: "close",
|
|
475
487
|
variant: "tertiary",
|
|
476
|
-
onClick:
|
|
488
|
+
onClick: g
|
|
477
489
|
})
|
|
478
490
|
]),
|
|
479
|
-
|
|
491
|
+
p[3] || (p[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)),
|
|
480
492
|
createElementVNode("div", _hoisted_4$i, [
|
|
481
493
|
createElementVNode("div", _hoisted_5$f, [
|
|
482
494
|
createVNode(x, {
|
|
483
495
|
icon: "select_all",
|
|
484
496
|
variant: "tertiary",
|
|
485
497
|
size: "small",
|
|
486
|
-
label: `${
|
|
487
|
-
onClick:
|
|
498
|
+
label: `${v.value ? "Deselect" : "Select"} All`,
|
|
499
|
+
onClick: c
|
|
488
500
|
}, null, 8, ["label"]),
|
|
489
501
|
createVNode(x, {
|
|
490
502
|
icon: "sync",
|
|
491
503
|
variant: "tertiary",
|
|
492
504
|
size: "small",
|
|
493
505
|
label: "Clear",
|
|
494
|
-
onClick:
|
|
506
|
+
onClick: k
|
|
495
507
|
}),
|
|
496
|
-
createElementVNode("span", _hoisted_6$b, toDisplayString(
|
|
508
|
+
createElementVNode("span", _hoisted_6$b, toDisplayString(s.value) + " selected ", 1)
|
|
497
509
|
]),
|
|
498
|
-
createVNode(
|
|
510
|
+
createVNode(N, {
|
|
499
511
|
modelValue: l.value,
|
|
500
|
-
"onUpdate:modelValue":
|
|
512
|
+
"onUpdate:modelValue": p[0] || (p[0] = (R) => l.value = R),
|
|
501
513
|
placeholder: "Search categories",
|
|
502
514
|
"leading-icon": { name: "search", color: "" },
|
|
503
515
|
class: "flex-1 min-w-[200px]"
|
|
504
516
|
}, null, 8, ["modelValue"])
|
|
505
517
|
]),
|
|
506
518
|
createElementVNode("div", _hoisted_7$a, [
|
|
507
|
-
a.value.length > 0 ? (openBlock(), createBlock(
|
|
519
|
+
a.value.length > 0 ? (openBlock(), createBlock(T, { key: 0 }, {
|
|
508
520
|
default: withCtx(() => [
|
|
509
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (
|
|
510
|
-
key:
|
|
521
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(a.value, (R) => (openBlock(), createBlock($, {
|
|
522
|
+
key: R.id,
|
|
511
523
|
clickable: !0,
|
|
512
|
-
onClick: (
|
|
524
|
+
onClick: (A) => f(R.id)
|
|
513
525
|
}, {
|
|
514
526
|
leading: withCtx(() => [
|
|
515
|
-
createVNode(
|
|
516
|
-
"model-value":
|
|
517
|
-
value:
|
|
518
|
-
"onUpdate:modelValue": (
|
|
519
|
-
onClick:
|
|
527
|
+
createVNode(w, {
|
|
528
|
+
"model-value": u.value[R.id] || !1,
|
|
529
|
+
value: R.id,
|
|
530
|
+
"onUpdate:modelValue": (A) => f(R.id),
|
|
531
|
+
onClick: p[1] || (p[1] = withModifiers(() => {
|
|
520
532
|
}, ["stop"]))
|
|
521
533
|
}, null, 8, ["model-value", "value", "onUpdate:modelValue"])
|
|
522
534
|
]),
|
|
@@ -528,8 +540,8 @@ const _hoisted_1$r = {
|
|
|
528
540
|
class: "text-fm-color-typo-secondary"
|
|
529
541
|
}),
|
|
530
542
|
createElementVNode("div", null, [
|
|
531
|
-
createElementVNode("div", _hoisted_9$9, toDisplayString(
|
|
532
|
-
createElementVNode("div", _hoisted_10$8, " ID: " + toDisplayString(
|
|
543
|
+
createElementVNode("div", _hoisted_9$9, toDisplayString(R.name), 1),
|
|
544
|
+
createElementVNode("div", _hoisted_10$8, " ID: " + toDisplayString(R.id), 1)
|
|
533
545
|
])
|
|
534
546
|
])
|
|
535
547
|
]),
|
|
@@ -545,13 +557,13 @@ const _hoisted_1$r = {
|
|
|
545
557
|
createVNode(x, {
|
|
546
558
|
variant: "secondary",
|
|
547
559
|
label: "Cancel",
|
|
548
|
-
onClick:
|
|
560
|
+
onClick: g
|
|
549
561
|
}),
|
|
550
562
|
createVNode(x, {
|
|
551
563
|
variant: "primary",
|
|
552
|
-
label: `Confirm Selection (${
|
|
553
|
-
disabled:
|
|
554
|
-
onClick:
|
|
564
|
+
label: `Confirm Selection (${s.value})`,
|
|
565
|
+
disabled: s.value === 0,
|
|
566
|
+
onClick: V
|
|
555
567
|
}, null, 8, ["label", "disabled"])
|
|
556
568
|
])
|
|
557
569
|
])) : createCommentVNode("", !0);
|
|
@@ -563,14 +575,14 @@ const _hoisted_1$r = {
|
|
|
563
575
|
}, _hoisted_3$i = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$h = { class: "text-fm-color-typo-secondary" }, _hoisted_5$e = { key: 0 }, _hoisted_6$a = { class: "space-y-24" }, _hoisted_7$9 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mt-4" }, _hoisted_8$8 = { key: 0 }, _hoisted_9$8 = { class: "fm-typo-en-body-md-600 mb-8 block" }, _hoisted_10$7 = { key: 1 }, _hoisted_11$5 = { key: 2 }, _hoisted_12$4 = { key: 0 }, _hoisted_13$4 = { class: "space-y-8" }, _hoisted_14$4 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_15$3 = { class: "flex items-center gap-8" }, _hoisted_16$2 = { class: "fm-typo-en-body-md-400" }, _hoisted_17$2 = { key: 3 }, _hoisted_18$2 = { key: 0 }, _hoisted_19$2 = { class: "space-y-8" }, _hoisted_20$2 = { class: "flex items-center justify-between p-12 border border-fm-color-neutral-gray-200 fm-corner-radius-md" }, _hoisted_21$1 = { class: "flex items-center gap-8" }, _hoisted_22$1 = { class: "fm-typo-en-body-md-400" }, _hoisted_23$1 = {
|
|
564
576
|
key: 0,
|
|
565
577
|
class: "mt-16 p-12 bg-fm-color-feedback-error-light rounded-8 border border-fm-color-feedback-error-main"
|
|
566
|
-
}, _hoisted_24$1 = { class: "flex items-center gap-8 mb-8 text-fm-color-system-error-300" }, _hoisted_25 = { class: "space-y-4" }, _hoisted_26 = { class: "flex gap-16" }, _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
578
|
+
}, _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$r = /* @__PURE__ */ defineComponent({
|
|
567
579
|
__name: "GrabEffectSheet",
|
|
568
580
|
props: {
|
|
569
581
|
modelValue: { type: Object }
|
|
570
582
|
},
|
|
571
583
|
emits: ["update:model-value"],
|
|
572
|
-
setup(e, { emit:
|
|
573
|
-
const o = e,
|
|
584
|
+
setup(e, { emit: r }) {
|
|
585
|
+
const o = e, m = r, i = Zh(), u = ref(!1), l = ref(!1), n = ref(!1), a = ref({
|
|
574
586
|
type: "net",
|
|
575
587
|
value: 0,
|
|
576
588
|
scope: {
|
|
@@ -586,56 +598,56 @@ const _hoisted_1$r = {
|
|
|
586
598
|
), onMounted(async () => {
|
|
587
599
|
await i.store.getMenu();
|
|
588
600
|
});
|
|
589
|
-
const
|
|
601
|
+
const s = computed(() => {
|
|
590
602
|
var b;
|
|
591
|
-
return !(!a.value.type || !((b = a.value.scope) != null && b.type) ||
|
|
603
|
+
return !(!a.value.type || !((b = a.value.scope) != null && b.type) || c(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));
|
|
592
604
|
});
|
|
593
|
-
async function
|
|
594
|
-
b.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") &&
|
|
605
|
+
async function y(b) {
|
|
606
|
+
b.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && m("update:model-value", null);
|
|
595
607
|
}
|
|
596
|
-
function
|
|
608
|
+
function f() {
|
|
597
609
|
var b;
|
|
598
610
|
return C(((b = a.value.scope) == null ? void 0 : b.type) || "order");
|
|
599
611
|
}
|
|
600
|
-
function
|
|
612
|
+
function c(b) {
|
|
601
613
|
return b && !["freeItem", "delivery"].includes(b);
|
|
602
614
|
}
|
|
603
|
-
function
|
|
615
|
+
function k(b) {
|
|
604
616
|
return b && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
|
|
605
617
|
b
|
|
606
618
|
);
|
|
607
619
|
}
|
|
608
|
-
function
|
|
620
|
+
function V(b) {
|
|
609
621
|
return b != null && b.includes("Percentage") ? "Discount percentage" : b != null && b.includes("FixPrice") ? "Bundle fixed price" : b === "percentage" ? "Discount percentage" : "Discount amount";
|
|
610
622
|
}
|
|
611
|
-
function
|
|
623
|
+
function g(b) {
|
|
612
624
|
return b != null && b.includes("Percentage") || b === "percentage" ? "10" : "5.00";
|
|
613
625
|
}
|
|
614
|
-
function
|
|
626
|
+
function v(b) {
|
|
615
627
|
return b != null && b.includes("Percentage") || b === "percentage" ? "%" : "$";
|
|
616
628
|
}
|
|
617
|
-
function
|
|
629
|
+
function d(b, E) {
|
|
618
630
|
a.value = {
|
|
619
631
|
...a.value,
|
|
620
|
-
[b]:
|
|
632
|
+
[b]: E
|
|
621
633
|
};
|
|
622
634
|
}
|
|
623
|
-
function
|
|
635
|
+
function p(b, E) {
|
|
624
636
|
var U;
|
|
625
|
-
const
|
|
637
|
+
const F = {
|
|
626
638
|
...a.value.scope,
|
|
627
|
-
[b]:
|
|
639
|
+
[b]: E
|
|
628
640
|
};
|
|
629
641
|
if (a.value = {
|
|
630
642
|
...a.value,
|
|
631
|
-
scope:
|
|
643
|
+
scope: F
|
|
632
644
|
}, b === "type") {
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
(
|
|
645
|
+
const O = C(E);
|
|
646
|
+
O.some(
|
|
647
|
+
(H) => H.value === a.value.type
|
|
636
648
|
) || (a.value = {
|
|
637
649
|
...a.value,
|
|
638
|
-
type: ((U =
|
|
650
|
+
type: ((U = O[0]) == null ? void 0 : U.value) || "net",
|
|
639
651
|
// Reset value and cap when changing to incompatible type
|
|
640
652
|
value: 0,
|
|
641
653
|
cap: void 0
|
|
@@ -701,98 +713,98 @@ const _hoisted_1$r = {
|
|
|
701
713
|
return "Select how you want to apply the discount.";
|
|
702
714
|
}
|
|
703
715
|
}
|
|
704
|
-
function
|
|
716
|
+
function N() {
|
|
705
717
|
var b;
|
|
706
718
|
return ((b = a.value.scope) == null ? void 0 : b.type) === "items";
|
|
707
719
|
}
|
|
708
|
-
function
|
|
720
|
+
function w() {
|
|
709
721
|
var b;
|
|
710
722
|
return ((b = a.value.scope) == null ? void 0 : b.type) === "category";
|
|
711
723
|
}
|
|
712
|
-
function
|
|
713
|
-
var
|
|
714
|
-
const b = (
|
|
724
|
+
function $() {
|
|
725
|
+
var F;
|
|
726
|
+
const b = (F = a.value.scope) == null ? void 0 : F.objectIDs;
|
|
715
727
|
if (!b || b.length === 0)
|
|
716
728
|
return "No items selected";
|
|
717
|
-
const
|
|
718
|
-
return
|
|
719
|
-
const
|
|
720
|
-
return
|
|
729
|
+
const E = i.menu.value;
|
|
730
|
+
return E && b.length <= 3 ? b.map((O) => {
|
|
731
|
+
const P = E.modules.item.find((H) => H._id === O);
|
|
732
|
+
return P ? (P.name2 || P.name).trim() : `Item ${O}`;
|
|
721
733
|
}).join(", ") : b.length === 1 ? "1 item selected" : `${b.length} items selected`;
|
|
722
734
|
}
|
|
723
|
-
function
|
|
724
|
-
var
|
|
725
|
-
const b = (
|
|
735
|
+
function T() {
|
|
736
|
+
var F;
|
|
737
|
+
const b = (F = a.value.scope) == null ? void 0 : F.objectIDs;
|
|
726
738
|
if (!b || b.length === 0)
|
|
727
739
|
return "No categories selected";
|
|
728
|
-
const
|
|
729
|
-
return
|
|
730
|
-
const
|
|
731
|
-
return
|
|
740
|
+
const E = i.menu.value;
|
|
741
|
+
return E && b.length <= 3 ? b.map((O) => {
|
|
742
|
+
const P = E.modules.category.find((H) => H._id === O);
|
|
743
|
+
return P ? P.name : `Category ${O}`;
|
|
732
744
|
}).join(", ") : b.length === 1 ? "1 category selected" : `${b.length} categories selected`;
|
|
733
745
|
}
|
|
734
|
-
function
|
|
746
|
+
function R() {
|
|
735
747
|
l.value = !0;
|
|
736
748
|
}
|
|
737
|
-
function
|
|
749
|
+
function A() {
|
|
738
750
|
n.value = !0;
|
|
739
751
|
}
|
|
740
|
-
function
|
|
741
|
-
|
|
752
|
+
function M(b) {
|
|
753
|
+
p("objectIDs", b), l.value = !1;
|
|
742
754
|
}
|
|
743
755
|
function I(b) {
|
|
744
|
-
|
|
756
|
+
p("objectIDs", b), n.value = !1;
|
|
745
757
|
}
|
|
746
|
-
function
|
|
758
|
+
function X() {
|
|
747
759
|
l.value = !1;
|
|
748
760
|
}
|
|
749
|
-
function
|
|
761
|
+
function K() {
|
|
750
762
|
n.value = !1;
|
|
751
763
|
}
|
|
752
|
-
const
|
|
753
|
-
var
|
|
764
|
+
const Z = computed(() => {
|
|
765
|
+
var E, F, U;
|
|
754
766
|
const b = [];
|
|
755
|
-
return a.value.type || b.push("Discount type is required"), (
|
|
767
|
+
return a.value.type || b.push("Discount type is required"), (E = a.value.scope) != null && E.type || b.push("Scope type is required"), c(a.value.type) && (!a.value.value || a.value.value <= 0) && b.push("Discount amount must be greater than 0"), ((F = a.value.scope) == null ? void 0 : F.type) === "items" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one item"), ((U = a.value.scope) == null ? void 0 : U.type) === "category" && (!a.value.scope.objectIDs || a.value.scope.objectIDs.length === 0) && b.push("Please select at least one category"), b;
|
|
756
768
|
});
|
|
757
|
-
function
|
|
758
|
-
|
|
769
|
+
function W() {
|
|
770
|
+
m("update:model-value", a.value), u.value = !1;
|
|
759
771
|
}
|
|
760
|
-
const
|
|
772
|
+
const Y = [
|
|
761
773
|
{ label: "Bill discount", value: "order" },
|
|
762
774
|
{ label: "Item discount", value: "items" },
|
|
763
775
|
{ label: "Category discount", value: "category" }
|
|
764
776
|
];
|
|
765
|
-
return (b,
|
|
766
|
-
const
|
|
767
|
-
return openBlock(), createBlock(
|
|
777
|
+
return (b, E) => {
|
|
778
|
+
const F = resolveComponent("FmButton"), U = resolveComponent("FmSelect"), O = resolveComponent("FmStepperField"), P = resolveComponent("FmIcon"), H = resolveComponent("FmSideSheet");
|
|
779
|
+
return openBlock(), createBlock(H, {
|
|
768
780
|
"max-width": 550,
|
|
769
781
|
header: "Apply discount",
|
|
770
|
-
modelValue: unref(
|
|
782
|
+
modelValue: unref(u),
|
|
771
783
|
"onUpdate:modelValue": [
|
|
772
|
-
|
|
773
|
-
|
|
784
|
+
E[5] || (E[5] = (L) => isRef(u) ? u.value = L : null),
|
|
785
|
+
E[6] || (E[6] = (L) => u.value = L)
|
|
774
786
|
]
|
|
775
787
|
}, {
|
|
776
788
|
"side-sheet-button": withCtx(() => {
|
|
777
|
-
var
|
|
789
|
+
var L, j, G, h;
|
|
778
790
|
return [
|
|
779
791
|
createElementVNode("div", _hoisted_1$p, [
|
|
780
|
-
|
|
792
|
+
E[7] || (E[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)),
|
|
781
793
|
e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$l, [
|
|
782
794
|
createElementVNode("div", _hoisted_3$i, [
|
|
783
|
-
createElementVNode("div", null, toDisplayString((
|
|
795
|
+
createElementVNode("div", null, toDisplayString((L = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : L.type), 1),
|
|
784
796
|
createElementVNode("div", _hoisted_4$h, [
|
|
785
|
-
createTextVNode(toDisplayString((
|
|
786
|
-
(
|
|
797
|
+
createTextVNode(toDisplayString((j = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : j.adjustment) + " ", 1),
|
|
798
|
+
(G = unref(summarizeGrabDiscount)(e.modelValue)) != null && G.cap ? (openBlock(), createElementBlock("span", _hoisted_5$e, toDisplayString((h = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : h.cap), 1)) : createCommentVNode("", !0)
|
|
787
799
|
])
|
|
788
800
|
]),
|
|
789
|
-
createVNode(
|
|
801
|
+
createVNode(F, {
|
|
790
802
|
icon: "delete",
|
|
791
803
|
"icon-color": "neutral-gray-400",
|
|
792
804
|
variant: "tertiary",
|
|
793
|
-
onClick:
|
|
805
|
+
onClick: y
|
|
794
806
|
})
|
|
795
|
-
])) : (openBlock(), createBlock(
|
|
807
|
+
])) : (openBlock(), createBlock(F, {
|
|
796
808
|
key: 0,
|
|
797
809
|
label: "Apply Grab discount",
|
|
798
810
|
icon: "add",
|
|
@@ -804,135 +816,135 @@ const _hoisted_1$r = {
|
|
|
804
816
|
];
|
|
805
817
|
}),
|
|
806
818
|
"side-sheet-footer": withCtx(() => [
|
|
807
|
-
createElementVNode("div", _hoisted_26, [
|
|
808
|
-
createVNode(
|
|
819
|
+
createElementVNode("div", _hoisted_26$1, [
|
|
820
|
+
createVNode(F, {
|
|
809
821
|
variant: "secondary",
|
|
810
822
|
label: "Cancel",
|
|
811
823
|
class: "flex-1",
|
|
812
|
-
onClick:
|
|
824
|
+
onClick: E[4] || (E[4] = (L) => u.value = !1)
|
|
813
825
|
}),
|
|
814
|
-
createVNode(
|
|
826
|
+
createVNode(F, {
|
|
815
827
|
variant: "primary",
|
|
816
|
-
label: unref(
|
|
828
|
+
label: unref(s) ? "Confirm" : "Complete Required Fields",
|
|
817
829
|
class: "flex-1",
|
|
818
|
-
disabled: !unref(
|
|
819
|
-
onClick:
|
|
830
|
+
disabled: !unref(s),
|
|
831
|
+
onClick: W
|
|
820
832
|
}, null, 8, ["label", "disabled"])
|
|
821
833
|
])
|
|
822
834
|
]),
|
|
823
835
|
default: withCtx(() => {
|
|
824
|
-
var
|
|
836
|
+
var L, j, G, h;
|
|
825
837
|
return [
|
|
826
838
|
createElementVNode("div", _hoisted_6$a, [
|
|
827
839
|
createElementVNode("div", null, [
|
|
828
|
-
|
|
840
|
+
E[8] || (E[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
|
|
829
841
|
createVNode(U, {
|
|
830
|
-
"model-value": ((
|
|
831
|
-
"onUpdate:modelValue":
|
|
842
|
+
"model-value": ((L = unref(a).scope) == null ? void 0 : L.type) || "order",
|
|
843
|
+
"onUpdate:modelValue": E[0] || (E[0] = (B) => p("type", B)),
|
|
832
844
|
placeholder: "Select campaign type",
|
|
833
|
-
items:
|
|
845
|
+
items: Y
|
|
834
846
|
}, null, 8, ["model-value"]),
|
|
835
|
-
createElementVNode("div", _hoisted_7$9, toDisplayString(x((
|
|
847
|
+
createElementVNode("div", _hoisted_7$9, toDisplayString(x((j = unref(a).scope) == null ? void 0 : j.type)), 1)
|
|
836
848
|
]),
|
|
837
849
|
createElementVNode("div", null, [
|
|
838
|
-
|
|
850
|
+
E[9] || (E[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
|
|
839
851
|
createVNode(U, {
|
|
840
852
|
"model-value": unref(a).type,
|
|
841
|
-
"onUpdate:modelValue":
|
|
853
|
+
"onUpdate:modelValue": E[1] || (E[1] = (B) => d("type", B)),
|
|
842
854
|
placeholder: "Select discount type",
|
|
843
|
-
items:
|
|
855
|
+
items: f()
|
|
844
856
|
}, null, 8, ["model-value", "items"])
|
|
845
857
|
]),
|
|
846
|
-
|
|
847
|
-
createElementVNode("label", _hoisted_9$8, toDisplayString(
|
|
848
|
-
createVNode(
|
|
858
|
+
c(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_8$8, [
|
|
859
|
+
createElementVNode("label", _hoisted_9$8, toDisplayString(V(unref(a).type)), 1),
|
|
860
|
+
createVNode(O, {
|
|
849
861
|
modelValue: unref(a).value,
|
|
850
|
-
"onUpdate:modelValue":
|
|
851
|
-
placeholder:
|
|
852
|
-
suffix:
|
|
862
|
+
"onUpdate:modelValue": E[2] || (E[2] = (B) => unref(a).value = B),
|
|
863
|
+
placeholder: g(unref(a).type),
|
|
864
|
+
suffix: v(unref(a).type),
|
|
853
865
|
type: "number"
|
|
854
866
|
}, null, 8, ["modelValue", "placeholder", "suffix"])
|
|
855
867
|
])) : createCommentVNode("", !0),
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
createVNode(
|
|
868
|
+
k(unref(a).type) ? (openBlock(), createElementBlock("div", _hoisted_10$7, [
|
|
869
|
+
E[10] || (E[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
|
|
870
|
+
createVNode(O, {
|
|
859
871
|
modelValue: unref(a).cap,
|
|
860
|
-
"onUpdate:modelValue":
|
|
872
|
+
"onUpdate:modelValue": E[3] || (E[3] = (B) => unref(a).cap = B),
|
|
861
873
|
placeholder: "Maximum discount amount",
|
|
862
874
|
type: "number"
|
|
863
875
|
}, null, 8, ["modelValue"])
|
|
864
876
|
])) : createCommentVNode("", !0),
|
|
865
|
-
|
|
877
|
+
N() ? (openBlock(), createElementBlock("div", _hoisted_11$5, [
|
|
866
878
|
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12$4, [
|
|
867
|
-
|
|
879
|
+
E[12] || (E[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
|
|
868
880
|
createElementVNode("div", _hoisted_13$4, [
|
|
869
881
|
createElementVNode("div", _hoisted_14$4, [
|
|
870
882
|
createElementVNode("div", _hoisted_15$3, [
|
|
871
|
-
createVNode(
|
|
883
|
+
createVNode(P, {
|
|
872
884
|
name: "restaurant",
|
|
873
885
|
size: "md"
|
|
874
886
|
}),
|
|
875
|
-
createElementVNode("span", _hoisted_16$2, toDisplayString(
|
|
887
|
+
createElementVNode("span", _hoisted_16$2, toDisplayString($()), 1)
|
|
876
888
|
]),
|
|
877
|
-
createVNode(
|
|
889
|
+
createVNode(F, {
|
|
878
890
|
variant: "secondary",
|
|
879
891
|
label: "Select Items",
|
|
880
892
|
icon: "chevron_right",
|
|
881
|
-
onClick:
|
|
893
|
+
onClick: R
|
|
882
894
|
})
|
|
883
895
|
]),
|
|
884
|
-
|
|
896
|
+
E[11] || (E[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))
|
|
885
897
|
])
|
|
886
898
|
])),
|
|
887
899
|
createVNode(_sfc_main$t, {
|
|
888
900
|
visible: unref(l),
|
|
889
|
-
"initial-value": ((
|
|
890
|
-
onConfirm:
|
|
891
|
-
onCancel:
|
|
901
|
+
"initial-value": ((G = unref(a).scope) == null ? void 0 : G.objectIDs) || [],
|
|
902
|
+
onConfirm: M,
|
|
903
|
+
onCancel: X
|
|
892
904
|
}, null, 8, ["visible", "initial-value"])
|
|
893
905
|
])) : createCommentVNode("", !0),
|
|
894
|
-
|
|
906
|
+
w() ? (openBlock(), createElementBlock("div", _hoisted_17$2, [
|
|
895
907
|
unref(n) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_18$2, [
|
|
896
|
-
|
|
908
|
+
E[14] || (E[14] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Categories", -1)),
|
|
897
909
|
createElementVNode("div", _hoisted_19$2, [
|
|
898
910
|
createElementVNode("div", _hoisted_20$2, [
|
|
899
911
|
createElementVNode("div", _hoisted_21$1, [
|
|
900
|
-
createVNode(
|
|
912
|
+
createVNode(P, {
|
|
901
913
|
name: "category",
|
|
902
914
|
size: "md"
|
|
903
915
|
}),
|
|
904
|
-
createElementVNode("span", _hoisted_22$1, toDisplayString(
|
|
916
|
+
createElementVNode("span", _hoisted_22$1, toDisplayString(T()), 1)
|
|
905
917
|
]),
|
|
906
|
-
createVNode(
|
|
918
|
+
createVNode(F, {
|
|
907
919
|
variant: "secondary",
|
|
908
920
|
label: "Select Categories",
|
|
909
921
|
icon: "chevron_right",
|
|
910
|
-
onClick:
|
|
922
|
+
onClick: A
|
|
911
923
|
})
|
|
912
924
|
]),
|
|
913
|
-
|
|
925
|
+
E[13] || (E[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
|
|
914
926
|
])
|
|
915
927
|
])),
|
|
916
928
|
createVNode(_sfc_main$s, {
|
|
917
929
|
visible: unref(n),
|
|
918
|
-
"initial-value": ((
|
|
930
|
+
"initial-value": ((h = unref(a).scope) == null ? void 0 : h.objectIDs) || [],
|
|
919
931
|
onConfirm: I,
|
|
920
|
-
onCancel:
|
|
932
|
+
onCancel: K
|
|
921
933
|
}, null, 8, ["visible", "initial-value"])
|
|
922
934
|
])) : createCommentVNode("", !0)
|
|
923
935
|
]),
|
|
924
|
-
unref(
|
|
936
|
+
unref(Z).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23$1, [
|
|
925
937
|
createElementVNode("div", _hoisted_24$1, [
|
|
926
|
-
createVNode(
|
|
927
|
-
|
|
938
|
+
createVNode(P, { name: "warning" }),
|
|
939
|
+
E[15] || (E[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
|
|
928
940
|
]),
|
|
929
|
-
createElementVNode("ul", _hoisted_25, [
|
|
930
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
931
|
-
key:
|
|
941
|
+
createElementVNode("ul", _hoisted_25$1, [
|
|
942
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(Z), (B) => (openBlock(), createElementBlock("li", {
|
|
943
|
+
key: B,
|
|
932
944
|
class: "fm-typo-en-body-sm-400 text-fm-color-feedback-error-main flex items-start gap-8"
|
|
933
945
|
}, [
|
|
934
|
-
|
|
935
|
-
createTextVNode(" " + toDisplayString(
|
|
946
|
+
E[16] || (E[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
|
|
947
|
+
createTextVNode(" " + toDisplayString(B), 1)
|
|
936
948
|
]))), 128))
|
|
937
949
|
])
|
|
938
950
|
])) : createCommentVNode("", !0)
|
|
@@ -952,83 +964,83 @@ const _hoisted_1$r = {
|
|
|
952
964
|
}
|
|
953
965
|
},
|
|
954
966
|
emits: ["update:model-value"],
|
|
955
|
-
setup(e, { emit:
|
|
956
|
-
const { t: o } = useI18n(),
|
|
957
|
-
!
|
|
967
|
+
setup(e, { emit: r }) {
|
|
968
|
+
const { t: o } = useI18n(), m = e, i = r, u = ref(
|
|
969
|
+
!m.modelValue || !m.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(m.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
958
970
|
);
|
|
959
|
-
watch(
|
|
960
|
-
var
|
|
961
|
-
if (a == "custom" && n == "all_time" && RuleBuilder.getRules((
|
|
962
|
-
const
|
|
971
|
+
watch(u, async (n, a) => {
|
|
972
|
+
var s;
|
|
973
|
+
if (a == "custom" && n == "all_time" && RuleBuilder.getRules((s = m.modelValue) == null ? void 0 : s.rules.g_time).length > 0) {
|
|
974
|
+
const y = await prompt.confirm(
|
|
963
975
|
o("connect.template.rule.time.confirm_remove"),
|
|
964
976
|
o("connect.common.confirm"),
|
|
965
977
|
o("connect.common.confirm"),
|
|
966
978
|
o("connect.common.cancel")
|
|
967
979
|
);
|
|
968
|
-
|
|
980
|
+
y && i(
|
|
969
981
|
"update:model-value",
|
|
970
982
|
RuleBuilder.setRuleToGroup(
|
|
971
|
-
|
|
983
|
+
m.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
972
984
|
RuleBuilder.scaffoldGroup("g_time")
|
|
973
985
|
)
|
|
974
|
-
),
|
|
986
|
+
), u.value = y ? n : a;
|
|
975
987
|
}
|
|
976
988
|
});
|
|
977
989
|
async function l(n) {
|
|
978
990
|
var a;
|
|
979
|
-
if (n == "custom" && RuleBuilder.getRules((a =
|
|
991
|
+
if (n == "custom" && RuleBuilder.getRules((a = m.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
980
992
|
if (!await prompt.confirm(
|
|
981
993
|
o("connect.template.rule.time.confirm_remove"),
|
|
982
994
|
o("connect.common.confirm"),
|
|
983
995
|
o("connect.common.confirm"),
|
|
984
996
|
o("connect.common.cancel")
|
|
985
997
|
)) {
|
|
986
|
-
|
|
998
|
+
u.value = "all_time";
|
|
987
999
|
return;
|
|
988
1000
|
}
|
|
989
1001
|
i(
|
|
990
1002
|
"update:model-value",
|
|
991
1003
|
RuleBuilder.setRuleToGroup(
|
|
992
|
-
|
|
1004
|
+
m.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
993
1005
|
RuleBuilder.scaffoldGroup("g_time")
|
|
994
1006
|
)
|
|
995
1007
|
);
|
|
996
1008
|
}
|
|
997
1009
|
}
|
|
998
1010
|
return (n, a) => {
|
|
999
|
-
var
|
|
1000
|
-
const
|
|
1011
|
+
var f;
|
|
1012
|
+
const s = resolveComponent("FmRadio"), y = resolveComponent("FmRadioGroup");
|
|
1001
1013
|
return openBlock(), createElementBlock("div", _hoisted_1$o, [
|
|
1002
|
-
createVNode(
|
|
1003
|
-
modelValue: unref(
|
|
1014
|
+
createVNode(y, {
|
|
1015
|
+
modelValue: unref(u),
|
|
1004
1016
|
"onUpdate:modelValue": [
|
|
1005
|
-
a[0] || (a[0] = (
|
|
1006
|
-
a[1] || (a[1] = (
|
|
1017
|
+
a[0] || (a[0] = (c) => isRef(u) ? u.value = c : null),
|
|
1018
|
+
a[1] || (a[1] = (c) => l(c))
|
|
1007
1019
|
]
|
|
1008
1020
|
}, {
|
|
1009
1021
|
default: withCtx(() => [
|
|
1010
|
-
createVNode(
|
|
1022
|
+
createVNode(s, {
|
|
1011
1023
|
label: unref(o)("connect.template.rule.time.all_time"),
|
|
1012
1024
|
value: "all_time"
|
|
1013
1025
|
}, null, 8, ["label"]),
|
|
1014
|
-
createVNode(
|
|
1026
|
+
createVNode(s, {
|
|
1015
1027
|
label: unref(o)("connect.template.rule.time.custom"),
|
|
1016
1028
|
value: "custom"
|
|
1017
1029
|
}, null, 8, ["label"])
|
|
1018
1030
|
]),
|
|
1019
1031
|
_: 1
|
|
1020
1032
|
}, 8, ["modelValue"]),
|
|
1021
|
-
unref(
|
|
1033
|
+
unref(u) == "custom" ? (openBlock(), createBlock(_sfc_main$u, {
|
|
1022
1034
|
key: 0,
|
|
1023
1035
|
class: "!mt-[0px]",
|
|
1024
1036
|
"include-only": "trigger",
|
|
1025
1037
|
"trigger-type": "SCHEDULE",
|
|
1026
|
-
"model-value": ((
|
|
1027
|
-
"onUpdate:modelValue": a[2] || (a[2] = (
|
|
1038
|
+
"model-value": ((f = e.modelValue) == null ? void 0 : f.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
1039
|
+
"onUpdate:modelValue": a[2] || (a[2] = (c) => i(
|
|
1028
1040
|
"update:model-value",
|
|
1029
1041
|
unref(RuleBuilder).setRuleToGroup(
|
|
1030
1042
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
1031
|
-
|
|
1043
|
+
c,
|
|
1032
1044
|
"&&"
|
|
1033
1045
|
)
|
|
1034
1046
|
))
|
|
@@ -1044,10 +1056,10 @@ const _hoisted_1$r = {
|
|
|
1044
1056
|
}
|
|
1045
1057
|
},
|
|
1046
1058
|
emits: ["update:model-value"],
|
|
1047
|
-
setup(e, { emit:
|
|
1048
|
-
const { t: o } = useI18n(),
|
|
1059
|
+
setup(e, { emit: r }) {
|
|
1060
|
+
const { t: o } = useI18n(), m = e, i = r, u = computed(() => {
|
|
1049
1061
|
const { property: l, operator: n, equator: a } = RuleBuilder.simplify(
|
|
1050
|
-
|
|
1062
|
+
m.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
1051
1063
|
op: "before",
|
|
1052
1064
|
x: 1
|
|
1053
1065
|
})
|
|
@@ -1059,12 +1071,12 @@ const _hoisted_1$r = {
|
|
|
1059
1071
|
};
|
|
1060
1072
|
});
|
|
1061
1073
|
return (l, n) => {
|
|
1062
|
-
const a = resolveComponent("FmRadio"),
|
|
1074
|
+
const a = resolveComponent("FmRadio"), s = resolveComponent("FmStepperField");
|
|
1063
1075
|
return openBlock(), createElementBlock("div", null, [
|
|
1064
1076
|
createVNode(a, {
|
|
1065
1077
|
label: unref(o)("connect.template.rule.birthday.on_birthday"),
|
|
1066
1078
|
value: "_isRange-day",
|
|
1067
|
-
"model-value": `${unref(
|
|
1079
|
+
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
1068
1080
|
"onUpdate:modelValue": n[0] || (n[0] = () => {
|
|
1069
1081
|
i(
|
|
1070
1082
|
"update:model-value",
|
|
@@ -1079,7 +1091,7 @@ const _hoisted_1$r = {
|
|
|
1079
1091
|
createVNode(a, {
|
|
1080
1092
|
label: unref(o)("connect.template.rule.birthday.days_before"),
|
|
1081
1093
|
value: "_isDay",
|
|
1082
|
-
"model-value": unref(
|
|
1094
|
+
"model-value": unref(u).operator,
|
|
1083
1095
|
"onUpdate:modelValue": n[1] || (n[1] = () => {
|
|
1084
1096
|
i(
|
|
1085
1097
|
"update:model-value",
|
|
@@ -1091,16 +1103,16 @@ const _hoisted_1$r = {
|
|
|
1091
1103
|
);
|
|
1092
1104
|
})
|
|
1093
1105
|
}, null, 8, ["label", "model-value"]),
|
|
1094
|
-
unref(
|
|
1106
|
+
unref(u).operator == "_isDay" ? (openBlock(), createBlock(s, {
|
|
1095
1107
|
key: 0,
|
|
1096
1108
|
label: unref(o)("connect.template.rule.birthday.days_before_label"),
|
|
1097
1109
|
"show-steppers": !1,
|
|
1098
|
-
"model-value": unref(
|
|
1099
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
1110
|
+
"model-value": unref(u).equator.x,
|
|
1111
|
+
"onUpdate:modelValue": n[2] || (n[2] = (y) => i(
|
|
1100
1112
|
"update:model-value",
|
|
1101
1113
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
1102
1114
|
op: "after",
|
|
1103
|
-
x:
|
|
1115
|
+
x: y,
|
|
1104
1116
|
ignoreYear: !0
|
|
1105
1117
|
})
|
|
1106
1118
|
))
|
|
@@ -1108,7 +1120,7 @@ const _hoisted_1$r = {
|
|
|
1108
1120
|
createVNode(a, {
|
|
1109
1121
|
label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
|
|
1110
1122
|
value: "_isRange-week",
|
|
1111
|
-
"model-value": `${unref(
|
|
1123
|
+
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
1112
1124
|
"onUpdate:modelValue": n[3] || (n[3] = () => {
|
|
1113
1125
|
i(
|
|
1114
1126
|
"update:model-value",
|
|
@@ -1123,7 +1135,7 @@ const _hoisted_1$r = {
|
|
|
1123
1135
|
createVNode(a, {
|
|
1124
1136
|
label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
|
|
1125
1137
|
value: "_isRange-month",
|
|
1126
|
-
"model-value": `${unref(
|
|
1138
|
+
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
1127
1139
|
"onUpdate:modelValue": n[4] || (n[4] = () => {
|
|
1128
1140
|
i(
|
|
1129
1141
|
"update:model-value",
|
|
@@ -1154,31 +1166,31 @@ const _hoisted_1$r = {
|
|
|
1154
1166
|
}
|
|
1155
1167
|
},
|
|
1156
1168
|
emits: ["update:model-value"],
|
|
1157
|
-
setup(e, { emit:
|
|
1158
|
-
const { t: o } = useI18n(),
|
|
1159
|
-
(l) => l.value ==
|
|
1160
|
-
) : TypeToTriggerOptions[
|
|
1169
|
+
setup(e, { emit: r }) {
|
|
1170
|
+
const { t: o } = useI18n(), m = e, i = r, u = computed(() => m.disabled ? TypeToTriggerOptions[m.campaignType].filter(
|
|
1171
|
+
(l) => l.value == m.modelValue
|
|
1172
|
+
) : TypeToTriggerOptions[m.campaignType]);
|
|
1161
1173
|
return (l, n) => {
|
|
1162
1174
|
const a = resolveComponent("FmCard");
|
|
1163
1175
|
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
1164
1176
|
createElementVNode("div", _hoisted_2$k, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
|
|
1165
1177
|
createElementVNode("div", _hoisted_3$h, [
|
|
1166
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1178
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (s) => (openBlock(), createBlock(a, {
|
|
1167
1179
|
variant: "outlined",
|
|
1168
|
-
disabled:
|
|
1180
|
+
disabled: m.disabled,
|
|
1169
1181
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1170
|
-
"col-span-3": unref(
|
|
1171
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1172
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1182
|
+
"col-span-3": unref(u).length == 1,
|
|
1183
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == s.value,
|
|
1184
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != s.value
|
|
1173
1185
|
}]),
|
|
1174
1186
|
onClick: () => {
|
|
1175
|
-
|
|
1187
|
+
m.modelValue != s.value && !m.disabled && i("update:model-value", s.value);
|
|
1176
1188
|
},
|
|
1177
|
-
key:
|
|
1189
|
+
key: s.name
|
|
1178
1190
|
}, {
|
|
1179
1191
|
default: withCtx(() => [
|
|
1180
|
-
createElementVNode("div", _hoisted_4$g, toDisplayString(
|
|
1181
|
-
createElementVNode("div", _hoisted_5$d, toDisplayString(
|
|
1192
|
+
createElementVNode("div", _hoisted_4$g, toDisplayString(s.name), 1),
|
|
1193
|
+
createElementVNode("div", _hoisted_5$d, toDisplayString(s.description), 1)
|
|
1182
1194
|
]),
|
|
1183
1195
|
_: 2
|
|
1184
1196
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -1199,10 +1211,10 @@ const _hoisted_1$r = {
|
|
|
1199
1211
|
}
|
|
1200
1212
|
},
|
|
1201
1213
|
emits: ["update:model-value"],
|
|
1202
|
-
setup(e, { emit:
|
|
1203
|
-
const o =
|
|
1204
|
-
return (
|
|
1205
|
-
const
|
|
1214
|
+
setup(e, { emit: r }) {
|
|
1215
|
+
const o = r;
|
|
1216
|
+
return (m, i) => {
|
|
1217
|
+
const u = resolveComponent("FmButton"), l = resolveComponent("FmField"), n = resolveComponent("FmDatePicker");
|
|
1206
1218
|
return openBlock(), createBlock(n, {
|
|
1207
1219
|
label: e.label,
|
|
1208
1220
|
"model-value": e.modelValue || "",
|
|
@@ -1215,11 +1227,11 @@ const _hoisted_1$r = {
|
|
|
1215
1227
|
"icon-outlined": !a
|
|
1216
1228
|
}, {
|
|
1217
1229
|
append: withCtx(() => [
|
|
1218
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
1230
|
+
e.modelValue ? (openBlock(), createBlock(u, {
|
|
1219
1231
|
key: 0,
|
|
1220
1232
|
variant: "tertiary",
|
|
1221
1233
|
icon: "clear",
|
|
1222
|
-
onClick: i[0] || (i[0] = (
|
|
1234
|
+
onClick: i[0] || (i[0] = (s) => (s.stopPropagation(), o("update:model-value", null)))
|
|
1223
1235
|
})) : createCommentVNode("", !0)
|
|
1224
1236
|
]),
|
|
1225
1237
|
default: withCtx(() => [
|
|
@@ -1243,20 +1255,20 @@ const _hoisted_1$r = {
|
|
|
1243
1255
|
}
|
|
1244
1256
|
},
|
|
1245
1257
|
emits: ["update:model-value"],
|
|
1246
|
-
setup(e, { emit:
|
|
1247
|
-
const { t: o } = useI18n(),
|
|
1248
|
-
return (i,
|
|
1258
|
+
setup(e, { emit: r }) {
|
|
1259
|
+
const { t: o } = useI18n(), m = r;
|
|
1260
|
+
return (i, u) => {
|
|
1249
1261
|
var l, n;
|
|
1250
1262
|
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
1251
1263
|
createElementVNode("div", _hoisted_2$j, [
|
|
1252
1264
|
createVNode(_sfc_main$n, {
|
|
1253
1265
|
"model-value": ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
|
|
1254
1266
|
label: unref(o)("connect.common.startDate"),
|
|
1255
|
-
"onUpdate:modelValue":
|
|
1256
|
-
var
|
|
1257
|
-
return
|
|
1267
|
+
"onUpdate:modelValue": u[0] || (u[0] = (a) => {
|
|
1268
|
+
var s;
|
|
1269
|
+
return m("update:model-value", {
|
|
1258
1270
|
startDate: a,
|
|
1259
|
-
endDate: ((
|
|
1271
|
+
endDate: ((s = e.modelValue) == null ? void 0 : s.endDate) ?? null
|
|
1260
1272
|
});
|
|
1261
1273
|
})
|
|
1262
1274
|
}, null, 8, ["model-value", "label"])
|
|
@@ -1266,10 +1278,10 @@ const _hoisted_1$r = {
|
|
|
1266
1278
|
createVNode(_sfc_main$n, {
|
|
1267
1279
|
"model-value": ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null,
|
|
1268
1280
|
label: unref(o)("connect.common.endDate"),
|
|
1269
|
-
"onUpdate:modelValue":
|
|
1270
|
-
var
|
|
1271
|
-
return
|
|
1272
|
-
startDate: ((
|
|
1281
|
+
"onUpdate:modelValue": u[1] || (u[1] = (a) => {
|
|
1282
|
+
var s;
|
|
1283
|
+
return m("update:model-value", {
|
|
1284
|
+
startDate: ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
|
|
1273
1285
|
endDate: a
|
|
1274
1286
|
});
|
|
1275
1287
|
})
|
|
@@ -1296,42 +1308,42 @@ const _hoisted_1$r = {
|
|
|
1296
1308
|
}
|
|
1297
1309
|
},
|
|
1298
1310
|
emits: ["update:model-value"],
|
|
1299
|
-
setup(e, { emit:
|
|
1300
|
-
const { t: o } = useI18n(),
|
|
1301
|
-
function
|
|
1302
|
-
i("update:model-value", { ...
|
|
1311
|
+
setup(e, { emit: r }) {
|
|
1312
|
+
const { t: o } = useI18n(), m = e, i = r;
|
|
1313
|
+
function u(k) {
|
|
1314
|
+
i("update:model-value", { ...m.modelValue, ...k });
|
|
1303
1315
|
}
|
|
1304
|
-
function l(
|
|
1305
|
-
return
|
|
1316
|
+
function l(k, V) {
|
|
1317
|
+
return k >= V ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
1306
1318
|
}
|
|
1307
|
-
const n = computed(() =>
|
|
1308
|
-
var
|
|
1309
|
-
return ((
|
|
1319
|
+
const n = computed(() => m.modelValue.buttons ?? []), a = computed(() => {
|
|
1320
|
+
var k;
|
|
1321
|
+
return ((k = m.modelValue.content) == null ? void 0 : k.length) ?? 0;
|
|
1310
1322
|
});
|
|
1311
|
-
function
|
|
1312
|
-
|
|
1323
|
+
function s(k, V) {
|
|
1324
|
+
u({
|
|
1313
1325
|
buttons: n.value.map(
|
|
1314
|
-
(
|
|
1326
|
+
(g, v) => v === k ? { ...g, ...V } : g
|
|
1315
1327
|
)
|
|
1316
1328
|
});
|
|
1317
1329
|
}
|
|
1318
|
-
function
|
|
1319
|
-
n.value.length >= MAX_BUTTONS ||
|
|
1330
|
+
function y() {
|
|
1331
|
+
n.value.length >= MAX_BUTTONS || u({ buttons: [...n.value, { label: "", url: "" }] });
|
|
1320
1332
|
}
|
|
1321
|
-
function
|
|
1322
|
-
var
|
|
1323
|
-
if (!
|
|
1324
|
-
const
|
|
1333
|
+
function f(k) {
|
|
1334
|
+
var g;
|
|
1335
|
+
if (!m.showValidation) return { label: void 0, url: void 0 };
|
|
1336
|
+
const V = (g = k.url) == null ? void 0 : g.trim();
|
|
1325
1337
|
return {
|
|
1326
|
-
label:
|
|
1327
|
-
url:
|
|
1338
|
+
label: k.label.trim() ? void 0 : o("connect.campaign.appInbox.buttonLabelRequired"),
|
|
1339
|
+
url: V ? FdoBroadcastUrl.safeParse(V).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.appInbox.buttonUrlRequired")
|
|
1328
1340
|
};
|
|
1329
1341
|
}
|
|
1330
|
-
function
|
|
1331
|
-
|
|
1342
|
+
function c(k) {
|
|
1343
|
+
u({ buttons: n.value.filter((V, g) => g !== k) });
|
|
1332
1344
|
}
|
|
1333
|
-
return (
|
|
1334
|
-
const
|
|
1345
|
+
return (k, V) => {
|
|
1346
|
+
const g = resolveComponent("FmTextField"), v = resolveComponent("FmButton");
|
|
1335
1347
|
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
1336
1348
|
createElementVNode("div", null, [
|
|
1337
1349
|
createElementVNode("div", _hoisted_2$i, [
|
|
@@ -1340,11 +1352,11 @@ const _hoisted_1$r = {
|
|
|
1340
1352
|
class: normalizeClass(["fm-typo-en-body-sm-400", l(e.modelValue.title.length, TITLE_WARN_AT$1)])
|
|
1341
1353
|
}, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT$1), 3)
|
|
1342
1354
|
]),
|
|
1343
|
-
createVNode(
|
|
1355
|
+
createVNode(g, {
|
|
1344
1356
|
"model-value": e.modelValue.title,
|
|
1345
1357
|
"max-length": TITLE_LIMIT$1,
|
|
1346
1358
|
placeholder: unref(o)("connect.campaign.appInbox.titlePlaceholder"),
|
|
1347
|
-
"onUpdate:modelValue":
|
|
1359
|
+
"onUpdate:modelValue": V[0] || (V[0] = (d) => u({ title: d }))
|
|
1348
1360
|
}, null, 8, ["model-value", "placeholder"])
|
|
1349
1361
|
]),
|
|
1350
1362
|
createElementVNode("div", null, [
|
|
@@ -1354,11 +1366,11 @@ const _hoisted_1$r = {
|
|
|
1354
1366
|
class: normalizeClass(["fm-typo-en-body-sm-400", l(e.modelValue.previewText.length, PREVIEW_WARN_AT)])
|
|
1355
1367
|
}, toDisplayString(e.modelValue.previewText.length) + " / " + toDisplayString(PREVIEW_LIMIT), 3)
|
|
1356
1368
|
]),
|
|
1357
|
-
createVNode(
|
|
1369
|
+
createVNode(g, {
|
|
1358
1370
|
"model-value": e.modelValue.previewText,
|
|
1359
1371
|
"max-length": PREVIEW_LIMIT,
|
|
1360
1372
|
placeholder: unref(o)("connect.campaign.appInbox.previewTextPlaceholder"),
|
|
1361
|
-
"onUpdate:modelValue":
|
|
1373
|
+
"onUpdate:modelValue": V[1] || (V[1] = (d) => u({ previewText: d }))
|
|
1362
1374
|
}, null, 8, ["model-value", "placeholder"])
|
|
1363
1375
|
]),
|
|
1364
1376
|
createElementVNode("div", _hoisted_6$9, [
|
|
@@ -1377,7 +1389,7 @@ const _hoisted_1$r = {
|
|
|
1377
1389
|
variables: e.variables,
|
|
1378
1390
|
"media-limit": 1,
|
|
1379
1391
|
"button-label": unref(o)("connect.campaign.appInbox.editBodyMessage"),
|
|
1380
|
-
"onUpdate:html":
|
|
1392
|
+
"onUpdate:html": V[2] || (V[2] = (d) => u({ content: d.html }))
|
|
1381
1393
|
}, null, 8, ["html", "variables", "button-label"])
|
|
1382
1394
|
]),
|
|
1383
1395
|
createElementVNode("div", _hoisted_9$7, [
|
|
@@ -1385,43 +1397,43 @@ const _hoisted_1$r = {
|
|
|
1385
1397
|
createElementVNode("span", _hoisted_11$4, toDisplayString(unref(o)("connect.campaign.appInbox.buttons")), 1),
|
|
1386
1398
|
createElementVNode("span", _hoisted_12$3, toDisplayString(unref(n).length) + " / " + toDisplayString(MAX_BUTTONS), 1)
|
|
1387
1399
|
]),
|
|
1388
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (
|
|
1389
|
-
key:
|
|
1400
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (d, p) => (openBlock(), createElementBlock("div", {
|
|
1401
|
+
key: p,
|
|
1390
1402
|
class: "flex flex-wrap items-start gap-8"
|
|
1391
1403
|
}, [
|
|
1392
1404
|
createElementVNode("div", _hoisted_13$3, [
|
|
1393
|
-
createVNode(
|
|
1394
|
-
"model-value":
|
|
1405
|
+
createVNode(g, {
|
|
1406
|
+
"model-value": d.label,
|
|
1395
1407
|
"max-length": 20,
|
|
1396
1408
|
placeholder: unref(o)("connect.campaign.appInbox.buttonLabel"),
|
|
1397
|
-
"helper-state":
|
|
1398
|
-
"helper-text":
|
|
1399
|
-
"onUpdate:modelValue": (C) =>
|
|
1409
|
+
"helper-state": f(d).label ? "error" : "none",
|
|
1410
|
+
"helper-text": f(d).label,
|
|
1411
|
+
"onUpdate:modelValue": (C) => s(p, { label: C })
|
|
1400
1412
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
1401
1413
|
]),
|
|
1402
1414
|
createElementVNode("div", _hoisted_14$3, [
|
|
1403
|
-
createVNode(
|
|
1404
|
-
"model-value":
|
|
1415
|
+
createVNode(g, {
|
|
1416
|
+
"model-value": d.url ?? "",
|
|
1405
1417
|
inputmode: "url",
|
|
1406
1418
|
placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
|
|
1407
|
-
"helper-state":
|
|
1408
|
-
"helper-text":
|
|
1409
|
-
"onUpdate:modelValue": (C) =>
|
|
1419
|
+
"helper-state": f(d).url ? "error" : "none",
|
|
1420
|
+
"helper-text": f(d).url,
|
|
1421
|
+
"onUpdate:modelValue": (C) => s(p, { url: C.trim() })
|
|
1410
1422
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
1411
1423
|
]),
|
|
1412
|
-
createVNode(
|
|
1424
|
+
createVNode(v, {
|
|
1413
1425
|
icon: "delete",
|
|
1414
1426
|
"icon-color": "neutral-gray-400",
|
|
1415
1427
|
variant: "tertiary",
|
|
1416
|
-
onClick: (C) =>
|
|
1428
|
+
onClick: (C) => c(p)
|
|
1417
1429
|
}, null, 8, ["onClick"])
|
|
1418
1430
|
]))), 128)),
|
|
1419
|
-
unref(n).length < MAX_BUTTONS ? (openBlock(), createBlock(
|
|
1431
|
+
unref(n).length < MAX_BUTTONS ? (openBlock(), createBlock(v, {
|
|
1420
1432
|
key: 0,
|
|
1421
1433
|
variant: "tertiary",
|
|
1422
1434
|
icon: "add",
|
|
1423
1435
|
label: unref(o)("connect.campaign.appInbox.addButton"),
|
|
1424
|
-
onClick:
|
|
1436
|
+
onClick: y
|
|
1425
1437
|
}, null, 8, ["label"])) : createCommentVNode("", !0)
|
|
1426
1438
|
])
|
|
1427
1439
|
]);
|
|
@@ -1447,73 +1459,73 @@ const _hoisted_1$r = {
|
|
|
1447
1459
|
}
|
|
1448
1460
|
},
|
|
1449
1461
|
emits: ["update:model-value"],
|
|
1450
|
-
setup(e, { emit:
|
|
1451
|
-
const { t: o } = useI18n(),
|
|
1452
|
-
var
|
|
1453
|
-
if (!
|
|
1454
|
-
const
|
|
1455
|
-
return
|
|
1462
|
+
setup(e, { emit: r }) {
|
|
1463
|
+
const { t: o } = useI18n(), m = e, i = r, u = F_PUSH_DESTINATION.options, l = computed(() => m.modelValue.destination === "EXTERNAL"), n = computed(() => {
|
|
1464
|
+
var c;
|
|
1465
|
+
if (!m.showValidation || !l.value) return;
|
|
1466
|
+
const f = (c = m.modelValue.url) == null ? void 0 : c.trim();
|
|
1467
|
+
return f ? FdoBroadcastUrl.safeParse(f).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.push.linkUrlRequired");
|
|
1456
1468
|
});
|
|
1457
|
-
function a(
|
|
1458
|
-
i("update:model-value", { ...
|
|
1469
|
+
function a(f) {
|
|
1470
|
+
i("update:model-value", { ...m.modelValue, ...f });
|
|
1459
1471
|
}
|
|
1460
|
-
function
|
|
1461
|
-
a(
|
|
1472
|
+
function s(f) {
|
|
1473
|
+
a(f === "EXTERNAL" ? { destination: f } : { destination: f, url: null });
|
|
1462
1474
|
}
|
|
1463
|
-
function
|
|
1464
|
-
return
|
|
1475
|
+
function y(f, c) {
|
|
1476
|
+
return f >= c ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
1465
1477
|
}
|
|
1466
|
-
return (
|
|
1467
|
-
const
|
|
1478
|
+
return (f, c) => {
|
|
1479
|
+
const k = resolveComponent("FmTextField"), V = resolveComponent("FmTextarea"), g = resolveComponent("FmSelect");
|
|
1468
1480
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
1469
1481
|
createElementVNode("div", null, [
|
|
1470
1482
|
createElementVNode("div", _hoisted_2$h, [
|
|
1471
1483
|
createElementVNode("span", _hoisted_3$e, toDisplayString(unref(o)("connect.campaign.push.title")), 1),
|
|
1472
1484
|
createElementVNode("span", {
|
|
1473
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
1485
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", y(e.modelValue.title.length, TITLE_WARN_AT)])
|
|
1474
1486
|
}, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT), 3)
|
|
1475
1487
|
]),
|
|
1476
|
-
createVNode(
|
|
1488
|
+
createVNode(k, {
|
|
1477
1489
|
"model-value": e.modelValue.title,
|
|
1478
1490
|
"max-length": TITLE_LIMIT,
|
|
1479
1491
|
placeholder: unref(o)("connect.campaign.push.titlePlaceholder"),
|
|
1480
|
-
"onUpdate:modelValue":
|
|
1492
|
+
"onUpdate:modelValue": c[0] || (c[0] = (v) => a({ title: v }))
|
|
1481
1493
|
}, null, 8, ["model-value", "placeholder"])
|
|
1482
1494
|
]),
|
|
1483
1495
|
createElementVNode("div", null, [
|
|
1484
1496
|
createElementVNode("div", _hoisted_4$d, [
|
|
1485
1497
|
createElementVNode("span", _hoisted_5$b, toDisplayString(unref(o)("connect.campaign.push.body")), 1),
|
|
1486
1498
|
createElementVNode("span", {
|
|
1487
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
1499
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", y(e.modelValue.body.length, BODY_WARN_AT)])
|
|
1488
1500
|
}, toDisplayString(e.modelValue.body.length) + " / " + toDisplayString(BODY_LIMIT), 3)
|
|
1489
1501
|
]),
|
|
1490
|
-
createVNode(
|
|
1502
|
+
createVNode(V, {
|
|
1491
1503
|
"model-value": e.modelValue.body,
|
|
1492
1504
|
"max-length": BODY_LIMIT,
|
|
1493
1505
|
placeholder: unref(o)("connect.campaign.push.bodyPlaceholder"),
|
|
1494
|
-
"onUpdate:modelValue":
|
|
1506
|
+
"onUpdate:modelValue": c[1] || (c[1] = (v) => a({ body: v }))
|
|
1495
1507
|
}, null, 8, ["model-value", "placeholder"])
|
|
1496
1508
|
]),
|
|
1497
1509
|
createElementVNode("div", null, [
|
|
1498
1510
|
createElementVNode("div", _hoisted_6$8, toDisplayString(unref(o)("connect.campaign.push.link")), 1),
|
|
1499
|
-
createVNode(
|
|
1511
|
+
createVNode(g, {
|
|
1500
1512
|
"model-value": e.modelValue.destination ?? "NONE",
|
|
1501
|
-
items: unref(
|
|
1502
|
-
label: unref(o)(`connect.campaign.appInbox.destination.${
|
|
1503
|
-
value:
|
|
1513
|
+
items: unref(u).map((v) => ({
|
|
1514
|
+
label: unref(o)(`connect.campaign.appInbox.destination.${v}`),
|
|
1515
|
+
value: v
|
|
1504
1516
|
})),
|
|
1505
|
-
"onUpdate:modelValue":
|
|
1517
|
+
"onUpdate:modelValue": c[2] || (c[2] = (v) => s(v))
|
|
1506
1518
|
}, null, 8, ["model-value", "items"]),
|
|
1507
1519
|
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$7, toDisplayString(unref(o)("connect.campaign.push.linkHelper")), 1)),
|
|
1508
1520
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_8$6, [
|
|
1509
1521
|
createElementVNode("div", _hoisted_9$6, toDisplayString(unref(o)("connect.campaign.push.linkUrl")), 1),
|
|
1510
|
-
createVNode(
|
|
1522
|
+
createVNode(k, {
|
|
1511
1523
|
"model-value": e.modelValue.url ?? "",
|
|
1512
1524
|
inputmode: "url",
|
|
1513
1525
|
placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
|
|
1514
1526
|
"helper-state": unref(n) ? "error" : "none",
|
|
1515
1527
|
"helper-text": unref(n),
|
|
1516
|
-
"onUpdate:modelValue":
|
|
1528
|
+
"onUpdate:modelValue": c[3] || (c[3] = (v) => a({ url: v.trim() || null }))
|
|
1517
1529
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text"])
|
|
1518
1530
|
])) : createCommentVNode("", !0)
|
|
1519
1531
|
])
|
|
@@ -1532,8 +1544,8 @@ const _hoisted_1$r = {
|
|
|
1532
1544
|
},
|
|
1533
1545
|
emits: ["update:model-value"],
|
|
1534
1546
|
setup(e) {
|
|
1535
|
-
const { t:
|
|
1536
|
-
return (o,
|
|
1547
|
+
const { t: r } = useI18n();
|
|
1548
|
+
return (o, m) => (openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
1537
1549
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (i) => (openBlock(), createElementBlock("div", {
|
|
1538
1550
|
key: i.key,
|
|
1539
1551
|
class: "flex flex-none items-center"
|
|
@@ -1546,7 +1558,7 @@ const _hoisted_1$r = {
|
|
|
1546
1558
|
e.modelValue === i.key ? "border-fm-color-primary bg-fm-color-system-warning-100" : "border-fm-color-neutral-gray-100 bg-fm-color-neutral-white hover:border-fm-color-neutral-gray-200"
|
|
1547
1559
|
]),
|
|
1548
1560
|
"aria-current": e.modelValue === i.key ? "true" : void 0,
|
|
1549
|
-
onClick: (
|
|
1561
|
+
onClick: (u) => o.$emit("update:model-value", i.key)
|
|
1550
1562
|
}, [
|
|
1551
1563
|
createElementVNode("span", _hoisted_4$c, [
|
|
1552
1564
|
i.step ? (openBlock(), createElementBlock("span", {
|
|
@@ -1565,7 +1577,7 @@ const _hoisted_1$r = {
|
|
|
1565
1577
|
i.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", {
|
|
1566
1578
|
key: 1,
|
|
1567
1579
|
class: "h-[7px] w-[7px] flex-none rounded-full bg-fm-color-system-error-400",
|
|
1568
|
-
title: unref(
|
|
1580
|
+
title: unref(r)("connect.campaign.broadcast.messageMissing")
|
|
1569
1581
|
}, null, 8, _hoisted_5$a))
|
|
1570
1582
|
]),
|
|
1571
1583
|
createElementVNode("span", _hoisted_6$7, toDisplayString(i.sub), 1)
|
|
@@ -1596,38 +1608,38 @@ const _hoisted_1$r = {
|
|
|
1596
1608
|
senderPrefix: {}
|
|
1597
1609
|
},
|
|
1598
1610
|
setup(e) {
|
|
1599
|
-
const { t:
|
|
1611
|
+
const { t: r } = useI18n(), o = e, m = computed(
|
|
1600
1612
|
() => o.target === "PUSH" ? o.content : void 0
|
|
1601
1613
|
), i = computed(
|
|
1602
1614
|
() => o.target === "APP_INBOX" ? o.content : void 0
|
|
1603
|
-
),
|
|
1615
|
+
), u = computed(
|
|
1604
1616
|
() => o.target === "SMS" || o.target === "WHATSAPP" ? o.content : void 0
|
|
1605
1617
|
), l = computed(() => {
|
|
1606
|
-
var
|
|
1607
|
-
const
|
|
1608
|
-
return
|
|
1618
|
+
var f, c;
|
|
1619
|
+
const y = (c = (f = u.value) == null ? void 0 : f.content) == null ? void 0 : c.trim();
|
|
1620
|
+
return y ? o.senderPrefix ? `${o.senderPrefix}${y}` : y : r("connect.campaign.broadcast.preview.emptyText");
|
|
1609
1621
|
}), n = computed(() => {
|
|
1610
|
-
var
|
|
1611
|
-
const
|
|
1612
|
-
return
|
|
1622
|
+
var f;
|
|
1623
|
+
const y = ((f = i.value) == null ? void 0 : f.content) ?? "";
|
|
1624
|
+
return y.trim() ? `<!doctype html><meta charset="utf-8"><base target="_blank"><style>
|
|
1613
1625
|
html,body{margin:0;font:400 12px/1.5 Inter,system-ui,sans-serif;color:#1C1C1E;word-break:break-word}
|
|
1614
1626
|
img{max-width:100%;height:auto}
|
|
1615
|
-
</style>${
|
|
1627
|
+
</style>${y}` : "";
|
|
1616
1628
|
}), a = computed(() => {
|
|
1617
|
-
const
|
|
1629
|
+
const y = /* @__PURE__ */ new Date(), f = y.toLocaleDateString(void 0, {
|
|
1618
1630
|
weekday: "short",
|
|
1619
1631
|
day: "2-digit",
|
|
1620
1632
|
month: "short"
|
|
1621
|
-
}),
|
|
1633
|
+
}), c = y.toLocaleTimeString(void 0, {
|
|
1622
1634
|
hour: "2-digit",
|
|
1623
1635
|
minute: "2-digit"
|
|
1624
1636
|
});
|
|
1625
|
-
return `${
|
|
1626
|
-
}),
|
|
1627
|
-
return (
|
|
1628
|
-
var
|
|
1637
|
+
return `${f} · ${c}`;
|
|
1638
|
+
}), s = 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"));
|
|
1639
|
+
return (y, f) => {
|
|
1640
|
+
var c, k, V, g, v, d, p, C, x, N, w;
|
|
1629
1641
|
return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
1630
|
-
createElementVNode("div", _hoisted_2$f, toDisplayString(unref(
|
|
1642
|
+
createElementVNode("div", _hoisted_2$f, toDisplayString(unref(r)("connect.campaign.broadcast.preview.title")), 1),
|
|
1631
1643
|
createElementVNode("div", {
|
|
1632
1644
|
class: normalizeClass([
|
|
1633
1645
|
"overflow-hidden rounded-[22px] border border-fm-color-neutral-gray-100",
|
|
@@ -1645,14 +1657,14 @@ const _hoisted_1$r = {
|
|
|
1645
1657
|
e.target === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_4$b, [
|
|
1646
1658
|
createElementVNode("div", _hoisted_5$9, toDisplayString(unref(a)), 1),
|
|
1647
1659
|
createElementVNode("div", _hoisted_6$6, [
|
|
1648
|
-
createElementVNode("div", _hoisted_7$6, toDisplayString(((
|
|
1649
|
-
createElementVNode("div", _hoisted_8$5, toDisplayString(((
|
|
1660
|
+
createElementVNode("div", _hoisted_7$6, toDisplayString(((k = (c = unref(m)) == null ? void 0 : c.title) == null ? void 0 : k.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
1661
|
+
createElementVNode("div", _hoisted_8$5, toDisplayString(((g = (V = unref(m)) == null ? void 0 : V.body) == null ? void 0 : g.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyBody")), 1)
|
|
1650
1662
|
])
|
|
1651
1663
|
])) : e.target === "APP_INBOX" ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
|
|
1652
|
-
createElementVNode("div", _hoisted_10$5, toDisplayString(unref(
|
|
1664
|
+
createElementVNode("div", _hoisted_10$5, toDisplayString(unref(r)("connect.campaign.broadcast.preview.inboxHeading")), 1),
|
|
1653
1665
|
createElementVNode("div", _hoisted_11$3, [
|
|
1654
|
-
createElementVNode("div", _hoisted_12$2, toDisplayString(((
|
|
1655
|
-
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (
|
|
1666
|
+
createElementVNode("div", _hoisted_12$2, toDisplayString(((d = (v = unref(i)) == null ? void 0 : v.title) == null ? void 0 : d.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
1667
|
+
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (p = unref(i)) == null ? void 0 : p.previewText) == null ? void 0 : C.trim()) || unref(r)("connect.campaign.broadcast.preview.emptyBody")), 1),
|
|
1656
1668
|
(x = unref(i)) != null && x.imageUrl ? (openBlock(), createElementBlock("img", {
|
|
1657
1669
|
key: 0,
|
|
1658
1670
|
src: unref(i).imageUrl,
|
|
@@ -1665,21 +1677,21 @@ const _hoisted_1$r = {
|
|
|
1665
1677
|
sandbox: "",
|
|
1666
1678
|
referrerpolicy: "no-referrer",
|
|
1667
1679
|
class: "mt-8 h-[120px] w-full border-0",
|
|
1668
|
-
title: unref(
|
|
1680
|
+
title: unref(r)("connect.campaign.broadcast.preview.bodyFrameTitle")
|
|
1669
1681
|
}, null, 8, _hoisted_15$2)) : createCommentVNode("", !0),
|
|
1670
|
-
(
|
|
1671
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).buttons, (
|
|
1672
|
-
key:
|
|
1682
|
+
(w = (N = unref(i)) == null ? void 0 : N.buttons) != null && w.length ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
|
|
1683
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).buttons, ($, T) => (openBlock(), createElementBlock("div", {
|
|
1684
|
+
key: T,
|
|
1673
1685
|
class: "rounded-[8px] bg-fm-color-primary px-12 py-8 text-center fm-typo-en-body-sm-400 text-fm-color-typo-white"
|
|
1674
|
-
}, toDisplayString(
|
|
1686
|
+
}, toDisplayString($.label || unref(r)("connect.campaign.appInbox.buttonLabel")), 1))), 128))
|
|
1675
1687
|
])) : createCommentVNode("", !0)
|
|
1676
1688
|
])
|
|
1677
1689
|
])) : (openBlock(), createElementBlock("div", _hoisted_17$1, [
|
|
1678
|
-
createElementVNode("div", _hoisted_18$1, toDisplayString(unref(
|
|
1690
|
+
createElementVNode("div", _hoisted_18$1, toDisplayString(unref(r)(`connect.campaign.broadcast.channel.${e.target}`)), 1),
|
|
1679
1691
|
createElementVNode("div", _hoisted_19$1, toDisplayString(unref(l)), 1)
|
|
1680
1692
|
]))
|
|
1681
1693
|
], 2),
|
|
1682
|
-
createElementVNode("div", _hoisted_20$1, toDisplayString(unref(
|
|
1694
|
+
createElementVNode("div", _hoisted_20$1, toDisplayString(unref(s)), 1)
|
|
1683
1695
|
])) : createCommentVNode("", !0);
|
|
1684
1696
|
};
|
|
1685
1697
|
}
|
|
@@ -1700,82 +1712,82 @@ const _hoisted_1$r = {
|
|
|
1700
1712
|
},
|
|
1701
1713
|
emits: ["move", "remove", "add"],
|
|
1702
1714
|
setup(e) {
|
|
1703
|
-
const { t:
|
|
1704
|
-
return (i,
|
|
1715
|
+
const { t: r } = useI18n(), o = e, m = computed(() => o.addable.length > 0);
|
|
1716
|
+
return (i, u) => {
|
|
1705
1717
|
const l = resolveComponent("FmButton"), n = resolveComponent("FmMenuItem"), a = resolveComponent("FmMenu");
|
|
1706
1718
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
1707
1719
|
createElementVNode("div", _hoisted_2$e, [
|
|
1708
|
-
createElementVNode("span", _hoisted_3$b, toDisplayString(unref(
|
|
1709
|
-
createElementVNode("span", _hoisted_4$a, toDisplayString(unref(
|
|
1720
|
+
createElementVNode("span", _hoisted_3$b, toDisplayString(unref(r)("connect.campaign.broadcast.fallbackChannels")), 1),
|
|
1721
|
+
createElementVNode("span", _hoisted_4$a, toDisplayString(unref(r)("connect.campaign.broadcast.fallbackChannelsHint")), 1)
|
|
1710
1722
|
]),
|
|
1711
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (
|
|
1712
|
-
key:
|
|
1723
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (s, y) => (openBlock(), createElementBlock("div", {
|
|
1724
|
+
key: s.channel,
|
|
1713
1725
|
class: "flex flex-wrap items-center gap-12 rounded-[8px] border border-fm-color-neutral-gray-100 px-16 py-[14px]"
|
|
1714
1726
|
}, [
|
|
1715
|
-
createElementVNode("span", _hoisted_5$8, toDisplayString(
|
|
1727
|
+
createElementVNode("span", _hoisted_5$8, toDisplayString(s.position), 1),
|
|
1716
1728
|
createElementVNode("span", _hoisted_6$5, [
|
|
1717
1729
|
createElementVNode("span", _hoisted_7$5, [
|
|
1718
|
-
createElementVNode("span", _hoisted_8$4, toDisplayString(
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
createTextVNode(" " + toDisplayString(unref(
|
|
1730
|
+
createElementVNode("span", _hoisted_8$4, toDisplayString(s.label), 1),
|
|
1731
|
+
s.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_9$4, [
|
|
1732
|
+
u[0] || (u[0] = createElementVNode("span", { class: "h-[6px] w-[6px] rounded-full bg-fm-color-system-error-400" }, null, -1)),
|
|
1733
|
+
createTextVNode(" " + toDisplayString(unref(r)("connect.campaign.broadcast.messageMissing")), 1)
|
|
1722
1734
|
]))
|
|
1723
1735
|
])
|
|
1724
1736
|
]),
|
|
1725
1737
|
createElementVNode("span", _hoisted_10$4, [
|
|
1726
1738
|
createElementVNode("span", {
|
|
1727
|
-
title: unref(
|
|
1739
|
+
title: unref(r)("connect.campaign.broadcast.moveUp"),
|
|
1728
1740
|
class: "flex"
|
|
1729
1741
|
}, [
|
|
1730
1742
|
createVNode(l, {
|
|
1731
1743
|
icon: "arrow_upward",
|
|
1732
1744
|
"icon-color": "neutral-gray-400",
|
|
1733
1745
|
variant: "tertiary",
|
|
1734
|
-
disabled:
|
|
1735
|
-
onClick: (
|
|
1746
|
+
disabled: y === 0,
|
|
1747
|
+
onClick: (f) => i.$emit("move", s.channel, -1)
|
|
1736
1748
|
}, null, 8, ["disabled", "onClick"])
|
|
1737
1749
|
], 8, _hoisted_11$2),
|
|
1738
1750
|
createElementVNode("span", {
|
|
1739
|
-
title: unref(
|
|
1751
|
+
title: unref(r)("connect.campaign.broadcast.moveDown"),
|
|
1740
1752
|
class: "flex"
|
|
1741
1753
|
}, [
|
|
1742
1754
|
createVNode(l, {
|
|
1743
1755
|
icon: "arrow_downward",
|
|
1744
1756
|
"icon-color": "neutral-gray-400",
|
|
1745
1757
|
variant: "tertiary",
|
|
1746
|
-
disabled:
|
|
1747
|
-
onClick: (
|
|
1758
|
+
disabled: y === e.rows.length - 1,
|
|
1759
|
+
onClick: (f) => i.$emit("move", s.channel, 1)
|
|
1748
1760
|
}, null, 8, ["disabled", "onClick"])
|
|
1749
1761
|
], 8, _hoisted_12$1),
|
|
1750
1762
|
createElementVNode("span", {
|
|
1751
|
-
title: unref(
|
|
1763
|
+
title: unref(r)("connect.campaign.broadcast.removeChannel"),
|
|
1752
1764
|
class: "flex"
|
|
1753
1765
|
}, [
|
|
1754
1766
|
createVNode(l, {
|
|
1755
1767
|
icon: "delete",
|
|
1756
1768
|
"icon-color": "neutral-gray-400",
|
|
1757
1769
|
variant: "tertiary",
|
|
1758
|
-
onClick: (
|
|
1770
|
+
onClick: (f) => i.$emit("remove", s.channel)
|
|
1759
1771
|
}, null, 8, ["onClick"])
|
|
1760
1772
|
], 8, _hoisted_13$1)
|
|
1761
1773
|
])
|
|
1762
1774
|
]))), 128)),
|
|
1763
|
-
unref(
|
|
1775
|
+
unref(m) ? (openBlock(), createBlock(a, {
|
|
1764
1776
|
key: 0,
|
|
1765
1777
|
placement: "bottom-start"
|
|
1766
1778
|
}, {
|
|
1767
1779
|
"menu-button": withCtx(() => [
|
|
1768
|
-
createElementVNode("button", _hoisted_14$1, " + " + toDisplayString(unref(
|
|
1780
|
+
createElementVNode("button", _hoisted_14$1, " + " + toDisplayString(unref(r)("connect.campaign.broadcast.addFallbackChannel")), 1)
|
|
1769
1781
|
]),
|
|
1770
1782
|
default: withCtx(() => [
|
|
1771
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (
|
|
1772
|
-
key:
|
|
1773
|
-
label:
|
|
1774
|
-
onClick: (
|
|
1783
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (s) => (openBlock(), createBlock(n, {
|
|
1784
|
+
key: s.channel,
|
|
1785
|
+
label: s.label,
|
|
1786
|
+
onClick: (y) => i.$emit("add", s.channel)
|
|
1775
1787
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
1776
1788
|
]),
|
|
1777
1789
|
_: 1
|
|
1778
|
-
})) : (openBlock(), createElementBlock("div", _hoisted_15$1, toDisplayString(unref(
|
|
1790
|
+
})) : (openBlock(), createElementBlock("div", _hoisted_15$1, toDisplayString(unref(r)("connect.campaign.broadcast.allChannelsAdded")), 1))
|
|
1779
1791
|
]);
|
|
1780
1792
|
};
|
|
1781
1793
|
}
|
|
@@ -1798,16 +1810,26 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1798
1810
|
class: "mt-[6px] inline-flex rounded-[6px] bg-fm-color-neutral-gray-100 px-8 py-[3px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1799
1811
|
}, _hoisted_18 = {
|
|
1800
1812
|
key: 0,
|
|
1813
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-system-warning-400"
|
|
1814
|
+
}, _hoisted_19 = {
|
|
1815
|
+
key: 1,
|
|
1801
1816
|
class: "fm-typo-en-body-sm-400 text-fm-color-system-error-400"
|
|
1802
|
-
},
|
|
1817
|
+
}, _hoisted_20 = { class: "flex flex-col gap-[14px]" }, _hoisted_21 = { class: "fm-typo-en-body-lg-600" }, _hoisted_22 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_23 = {
|
|
1803
1818
|
key: 1,
|
|
1804
1819
|
class: "rounded-[8px] border border-dashed border-fm-color-neutral-gray-200 p-24 text-center fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1805
|
-
},
|
|
1820
|
+
}, _hoisted_24 = {
|
|
1806
1821
|
key: 3,
|
|
1807
1822
|
class: "flex flex-wrap items-start gap-24"
|
|
1808
|
-
},
|
|
1823
|
+
}, _hoisted_25 = { class: "min-w-0 flex-1 basis-[340px]" }, _hoisted_26 = {
|
|
1824
|
+
key: 1,
|
|
1825
|
+
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1826
|
+
}, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1809
1827
|
__name: "BroadcastDeliveryInput",
|
|
1810
1828
|
props: {
|
|
1829
|
+
pushAvailability: {
|
|
1830
|
+
type: String,
|
|
1831
|
+
default: "checking"
|
|
1832
|
+
},
|
|
1811
1833
|
/** Either the new delivery shape or a legacy single-channel message. */
|
|
1812
1834
|
modelValue: {
|
|
1813
1835
|
type: Object,
|
|
@@ -1830,162 +1852,181 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1830
1852
|
helperState: { type: String },
|
|
1831
1853
|
placeholder: { type: String }
|
|
1832
1854
|
},
|
|
1833
|
-
emits: ["update:model-value"],
|
|
1834
|
-
setup(e, { emit:
|
|
1835
|
-
const { t: o } = useI18n(),
|
|
1836
|
-
|
|
1855
|
+
emits: ["retry-push", "update:model-value"],
|
|
1856
|
+
setup(e, { emit: r }) {
|
|
1857
|
+
const { t: o } = useI18n(), m = useDialog(), i = computed(
|
|
1858
|
+
() => o(
|
|
1859
|
+
"connect.campaign.broadcast.pushAvailability." + (a.pushAvailability === "checking" ? "checking" : a.pushAvailability === "non-native" ? "requiresNativeApp" : "unavailable")
|
|
1860
|
+
)
|
|
1861
|
+
);
|
|
1862
|
+
function u() {
|
|
1863
|
+
m.open({
|
|
1864
|
+
title: o("connect.campaign.broadcast.pushAvailability.contactSales"),
|
|
1865
|
+
message: o("connect.campaign.broadcast.pushAvailability.dialogMessage"),
|
|
1866
|
+
primaryActions: {
|
|
1867
|
+
text: o("connect.campaign.broadcast.pushAvailability.close"),
|
|
1868
|
+
close: !0
|
|
1869
|
+
}
|
|
1870
|
+
});
|
|
1871
|
+
}
|
|
1872
|
+
const l = useCoreStore(), n = useMembershipStore(), a = e, s = r, y = ref(!1), f = ref("SMS"), c = computed(() => {
|
|
1873
|
+
const h = a.modelValue;
|
|
1837
1874
|
return h && "channels" in h ? h : toDelivery({ message: h });
|
|
1838
1875
|
});
|
|
1839
|
-
function
|
|
1840
|
-
|
|
1876
|
+
function k(h) {
|
|
1877
|
+
s("update:model-value", h);
|
|
1841
1878
|
}
|
|
1842
|
-
function
|
|
1879
|
+
function V(h) {
|
|
1843
1880
|
return o(`connect.campaign.broadcast.channel.${h}`);
|
|
1844
1881
|
}
|
|
1845
|
-
const
|
|
1882
|
+
const g = {
|
|
1846
1883
|
SMS: "chat",
|
|
1847
1884
|
WHATSAPP: "chat",
|
|
1848
1885
|
EMAIL: "mail",
|
|
1849
1886
|
APP_INBOX: "inbox",
|
|
1850
1887
|
PUSH: "notifications"
|
|
1851
1888
|
};
|
|
1852
|
-
function
|
|
1853
|
-
return
|
|
1889
|
+
function v(h) {
|
|
1890
|
+
return g[h];
|
|
1854
1891
|
}
|
|
1855
|
-
const
|
|
1856
|
-
() =>
|
|
1857
|
-
(h) =>
|
|
1892
|
+
const d = computed(() => c.value.mode === "fallback"), p = computed(
|
|
1893
|
+
() => a.variables.filter(
|
|
1894
|
+
(h) => a.triggerType == "SCHEDULE" ? !h.startsWith("transaction.") : !0
|
|
1858
1895
|
)
|
|
1859
1896
|
);
|
|
1860
|
-
function
|
|
1861
|
-
return h === "WHATSAPP" ?
|
|
1897
|
+
function C(h) {
|
|
1898
|
+
return h === "PUSH" ? a.pushAvailability === "native" : h === "WHATSAPP" ? y.value : !0;
|
|
1862
1899
|
}
|
|
1863
|
-
const
|
|
1864
|
-
function
|
|
1865
|
-
h !==
|
|
1900
|
+
const x = ["fallback", "all"];
|
|
1901
|
+
function N(h) {
|
|
1902
|
+
h !== c.value.mode && k(setMode(c.value, h));
|
|
1866
1903
|
}
|
|
1867
|
-
const
|
|
1868
|
-
function
|
|
1869
|
-
var
|
|
1870
|
-
const
|
|
1871
|
-
return
|
|
1904
|
+
const w = ref(null);
|
|
1905
|
+
function $(h) {
|
|
1906
|
+
var D;
|
|
1907
|
+
const B = (D = w.value) == null ? void 0 : D[h];
|
|
1908
|
+
return B ? new Intl.NumberFormat(void 0, {
|
|
1872
1909
|
style: "currency",
|
|
1873
|
-
currency:
|
|
1874
|
-
minimumFractionDigits:
|
|
1875
|
-
maximumFractionDigits:
|
|
1876
|
-
}).format(
|
|
1910
|
+
currency: B.currency,
|
|
1911
|
+
minimumFractionDigits: B.precision,
|
|
1912
|
+
maximumFractionDigits: B.precision
|
|
1913
|
+
}).format(B.amount / 10 ** B.precision) : null;
|
|
1877
1914
|
}
|
|
1878
|
-
const
|
|
1915
|
+
const T = computed(
|
|
1879
1916
|
() => CHANNEL_DISPLAY_ORDER.map((h) => {
|
|
1880
|
-
const
|
|
1917
|
+
const B = c.value.channels.includes(h), D = $(h);
|
|
1881
1918
|
return {
|
|
1882
1919
|
channel: h,
|
|
1883
|
-
label:
|
|
1884
|
-
selected:
|
|
1885
|
-
available:
|
|
1886
|
-
rateNote: isPaidChannel(h) ?
|
|
1920
|
+
label: V(h),
|
|
1921
|
+
selected: B,
|
|
1922
|
+
available: C(h),
|
|
1923
|
+
rateNote: isPaidChannel(h) ? D ? o("connect.campaign.broadcast.perMessage", { price: D }) : null : o("connect.campaign.broadcast.freeChannel"),
|
|
1887
1924
|
// In fallback mode the grid is a radio for the primary channel, so only
|
|
1888
1925
|
// the primary reads as checked; a fallback is tagged instead.
|
|
1889
|
-
checked:
|
|
1890
|
-
usedAsFallback:
|
|
1926
|
+
checked: d.value ? c.value.channels[0] === h : B,
|
|
1927
|
+
usedAsFallback: d.value && c.value.channels.indexOf(h) > 0
|
|
1891
1928
|
};
|
|
1892
1929
|
})
|
|
1893
1930
|
);
|
|
1894
|
-
async function
|
|
1895
|
-
if (
|
|
1896
|
-
if (
|
|
1897
|
-
await
|
|
1931
|
+
async function R(h) {
|
|
1932
|
+
if (C(h)) {
|
|
1933
|
+
if (d.value) {
|
|
1934
|
+
await A(h);
|
|
1898
1935
|
return;
|
|
1899
1936
|
}
|
|
1900
|
-
if (
|
|
1901
|
-
await
|
|
1937
|
+
if (c.value.channels.includes(h)) {
|
|
1938
|
+
await M(h);
|
|
1902
1939
|
return;
|
|
1903
1940
|
}
|
|
1904
|
-
|
|
1941
|
+
k(addChannel(c.value, h, p.value));
|
|
1905
1942
|
}
|
|
1906
1943
|
}
|
|
1907
|
-
async function
|
|
1908
|
-
|
|
1909
|
-
|
|
1944
|
+
async function A(h) {
|
|
1945
|
+
if (!C(h)) return;
|
|
1946
|
+
const B = c.value.channels[0];
|
|
1947
|
+
B !== h && (B && hasDraft(c.value, B) && !await prompt.remove(
|
|
1910
1948
|
o("connect.campaign.broadcast.replaceChannelConfirm", {
|
|
1911
|
-
channel:
|
|
1912
|
-
next:
|
|
1949
|
+
channel: V(B),
|
|
1950
|
+
next: V(h)
|
|
1913
1951
|
})
|
|
1914
|
-
) || (
|
|
1952
|
+
) || C(h) && (k(setPrimaryChannel(c.value, h, p.value)), f.value = h));
|
|
1915
1953
|
}
|
|
1916
|
-
async function
|
|
1917
|
-
if (hasDraft(
|
|
1954
|
+
async function M(h) {
|
|
1955
|
+
if (hasDraft(c.value, h) && !await prompt.remove(
|
|
1918
1956
|
o("connect.campaign.broadcast.removeChannelConfirm", {
|
|
1919
|
-
channel:
|
|
1957
|
+
channel: V(h)
|
|
1920
1958
|
})
|
|
1921
1959
|
))
|
|
1922
1960
|
return;
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1961
|
+
const B = removeChannel(c.value, h);
|
|
1962
|
+
k(B), f.value === h && (f.value = B.channels[0] ?? "SMS");
|
|
1963
|
+
}
|
|
1964
|
+
function I(h, B) {
|
|
1965
|
+
k(moveChannel(c.value, h, B));
|
|
1925
1966
|
}
|
|
1926
|
-
function
|
|
1927
|
-
|
|
1967
|
+
function X(h) {
|
|
1968
|
+
C(h) && k(addChannel(c.value, h, p.value));
|
|
1928
1969
|
}
|
|
1929
|
-
const
|
|
1930
|
-
() =>
|
|
1970
|
+
const K = computed(
|
|
1971
|
+
() => c.value.channels.slice(1).map((h, B) => ({
|
|
1931
1972
|
channel: h,
|
|
1932
|
-
label:
|
|
1933
|
-
position:
|
|
1934
|
-
complete: !
|
|
1973
|
+
label: V(h),
|
|
1974
|
+
position: B + 2,
|
|
1975
|
+
complete: !a.showValidation || isChannelComplete(c.value, h)
|
|
1935
1976
|
}))
|
|
1936
|
-
),
|
|
1977
|
+
), Z = computed(
|
|
1937
1978
|
() => CHANNEL_DISPLAY_ORDER.filter(
|
|
1938
|
-
(h) => !
|
|
1979
|
+
(h) => !c.value.channels.includes(h) && C(h)
|
|
1939
1980
|
).map((h) => ({
|
|
1940
1981
|
channel: h,
|
|
1941
|
-
label:
|
|
1982
|
+
label: V(h)
|
|
1942
1983
|
}))
|
|
1943
|
-
),
|
|
1944
|
-
() =>
|
|
1984
|
+
), W = computed(
|
|
1985
|
+
() => c.value.channels.map((h, B) => ({
|
|
1945
1986
|
key: h,
|
|
1946
|
-
label:
|
|
1947
|
-
sub:
|
|
1948
|
-
complete: !
|
|
1949
|
-
step:
|
|
1950
|
-
connector:
|
|
1987
|
+
label: V(h),
|
|
1988
|
+
sub: d.value ? o(B === 0 ? "connect.campaign.broadcast.tab.firstAttempt" : "connect.campaign.broadcast.tab.ifNotReached") : o("connect.campaign.broadcast.tab.sendsToEligible"),
|
|
1989
|
+
complete: !a.showValidation || isChannelComplete(c.value, h),
|
|
1990
|
+
step: d.value ? B + 1 : void 0,
|
|
1991
|
+
connector: B === 0 ? void 0 : d.value ? "→" : "+"
|
|
1951
1992
|
}))
|
|
1952
1993
|
);
|
|
1953
1994
|
watchEffect(() => {
|
|
1954
|
-
const h =
|
|
1955
|
-
h.length && !h.includes(
|
|
1995
|
+
const h = W.value.map((B) => B.key);
|
|
1996
|
+
h.length && !h.includes(f.value) && (f.value = h[0]);
|
|
1956
1997
|
});
|
|
1957
|
-
const
|
|
1958
|
-
const h =
|
|
1998
|
+
const Y = computed(() => f.value), b = computed(() => {
|
|
1999
|
+
const h = Y.value;
|
|
1959
2000
|
if (!(h === "APP_INBOX" || h === "PUSH"))
|
|
1960
|
-
return
|
|
1961
|
-
}),
|
|
1962
|
-
() =>
|
|
1963
|
-
),
|
|
1964
|
-
() =>
|
|
2001
|
+
return c.value.content[h];
|
|
2002
|
+
}), E = computed(
|
|
2003
|
+
() => c.value.content.APP_INBOX
|
|
2004
|
+
), F = computed(
|
|
2005
|
+
() => c.value.content.PUSH
|
|
1965
2006
|
);
|
|
1966
|
-
function
|
|
1967
|
-
|
|
2007
|
+
function U(h) {
|
|
2008
|
+
k(setChannelContent(c.value, "APP_INBOX", h));
|
|
1968
2009
|
}
|
|
1969
|
-
function
|
|
1970
|
-
|
|
2010
|
+
function O(h) {
|
|
2011
|
+
C("PUSH") && k(setChannelContent(c.value, "PUSH", h));
|
|
1971
2012
|
}
|
|
1972
|
-
function
|
|
1973
|
-
h === "APP_INBOX" || h === "PUSH" ||
|
|
2013
|
+
function P(h, B) {
|
|
2014
|
+
h === "APP_INBOX" || h === "PUSH" || k(setChannelContent(c.value, h, { ...B, channel: h }));
|
|
1974
2015
|
}
|
|
1975
|
-
const
|
|
1976
|
-
() =>
|
|
1977
|
-
),
|
|
1978
|
-
var
|
|
1979
|
-
const h = ((
|
|
2016
|
+
const H = computed(
|
|
2017
|
+
() => c.value.channels.filter(isPaidChannel)
|
|
2018
|
+
), L = computed(() => {
|
|
2019
|
+
var B, D, q;
|
|
2020
|
+
const h = ((B = n.membership) == null ? void 0 : B.brand) || ((q = (D = l.currentBusiness) == null ? void 0 : D.value) == null ? void 0 : q.name) || "";
|
|
1980
2021
|
return getSmsMessageMetrics({ brandName: h, content: "" }).prefix;
|
|
1981
|
-
}),
|
|
1982
|
-
async function
|
|
2022
|
+
}), j = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
|
|
2023
|
+
async function G() {
|
|
1983
2024
|
try {
|
|
1984
2025
|
const h = await membershipApi.getWhatsappNumbers();
|
|
1985
|
-
|
|
1986
|
-
(
|
|
1987
|
-
var
|
|
1988
|
-
return (
|
|
2026
|
+
y.value = h.some(
|
|
2027
|
+
(B) => {
|
|
2028
|
+
var D;
|
|
2029
|
+
return (D = B == null ? void 0 : B.default) == null ? void 0 : D.includes("Marketing");
|
|
1989
2030
|
}
|
|
1990
2031
|
);
|
|
1991
2032
|
} catch (h) {
|
|
@@ -1993,10 +2034,10 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
1993
2034
|
}
|
|
1994
2035
|
}
|
|
1995
2036
|
return onMounted(async () => {
|
|
1996
|
-
const h =
|
|
1997
|
-
h && (
|
|
1998
|
-
}), (h,
|
|
1999
|
-
const
|
|
2037
|
+
const h = c.value.channels[0];
|
|
2038
|
+
h && (f.value = h), campaignApi.readBroadcastCreditSummary().then((B) => w.value = B.prices).catch(() => w.value = null), await G();
|
|
2039
|
+
}), (h, B) => {
|
|
2040
|
+
const D = resolveComponent("FmIcon"), q = resolveComponent("FmCard"), J = resolveComponent("FmButton");
|
|
2000
2041
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
2001
2042
|
createElementVNode("div", _hoisted_2$d, [
|
|
2002
2043
|
createElementVNode("div", null, [
|
|
@@ -2004,19 +2045,19 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2004
2045
|
createElementVNode("div", _hoisted_4$9, toDisplayString(unref(o)("connect.campaign.broadcast.deliveryDescription")), 1)
|
|
2005
2046
|
]),
|
|
2006
2047
|
createElementVNode("div", _hoisted_5$7, [
|
|
2007
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(
|
|
2048
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(x, (S) => createVNode(q, {
|
|
2008
2049
|
key: S,
|
|
2009
2050
|
variant: "outlined",
|
|
2010
2051
|
class: normalizeClass(["h-full cursor-pointer select-none p-16 space-y-8", {
|
|
2011
|
-
"border-fm-color-primary bg-fm-color-system-warning-100": unref(
|
|
2012
|
-
"hover:bg-fm-color-opacity-sm": unref(
|
|
2052
|
+
"border-fm-color-primary bg-fm-color-system-warning-100": unref(c).mode === S,
|
|
2053
|
+
"hover:bg-fm-color-opacity-sm": unref(c).mode !== S
|
|
2013
2054
|
}]),
|
|
2014
|
-
onClick: (
|
|
2055
|
+
onClick: (Q) => N(S)
|
|
2015
2056
|
}, {
|
|
2016
2057
|
default: withCtx(() => [
|
|
2017
2058
|
createElementVNode("div", _hoisted_6$4, [
|
|
2018
2059
|
createElementVNode("div", _hoisted_7$4, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${S}.label`)), 1),
|
|
2019
|
-
unref(
|
|
2060
|
+
unref(c).mode === S ? (openBlock(), createBlock(D, {
|
|
2020
2061
|
key: 0,
|
|
2021
2062
|
name: "check_circle",
|
|
2022
2063
|
size: "md",
|
|
@@ -2028,8 +2069,8 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2028
2069
|
_: 2
|
|
2029
2070
|
}, 1032, ["class", "onClick"])), 64))
|
|
2030
2071
|
]),
|
|
2031
|
-
unref(
|
|
2032
|
-
createVNode(
|
|
2072
|
+
unref(c).channels.length < 2 ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
2073
|
+
createVNode(D, {
|
|
2033
2074
|
name: "info",
|
|
2034
2075
|
size: "sm",
|
|
2035
2076
|
class: "mt-[2px]"
|
|
@@ -2038,17 +2079,17 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2038
2079
|
])) : createCommentVNode("", !0)
|
|
2039
2080
|
]),
|
|
2040
2081
|
createElementVNode("div", _hoisted_10$3, [
|
|
2041
|
-
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(
|
|
2082
|
+
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(d) ? unref(o)("connect.campaign.broadcast.primaryChannel") : unref(o)("connect.campaign.broadcast.channels")), 1),
|
|
2042
2083
|
createElementVNode("div", _hoisted_12, [
|
|
2043
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2084
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(T), (S) => (openBlock(), createBlock(q, {
|
|
2044
2085
|
key: S.channel,
|
|
2045
2086
|
variant: "outlined",
|
|
2046
2087
|
class: normalizeClass(["flex h-full flex-col gap-12 p-16", [
|
|
2047
2088
|
S.checked ? "!border-fm-color-primary bg-fm-color-system-warning-100" : "",
|
|
2048
2089
|
S.available ? "cursor-pointer" : "cursor-not-allowed bg-fm-color-neutral-gray-100"
|
|
2049
2090
|
]]),
|
|
2050
|
-
"aria-disabled": !S.available,
|
|
2051
|
-
onClick: (
|
|
2091
|
+
"aria-disabled": S.channel === "PUSH" ? void 0 : !S.available,
|
|
2092
|
+
onClick: (Q) => R(S.channel)
|
|
2052
2093
|
}, {
|
|
2053
2094
|
default: withCtx(() => [
|
|
2054
2095
|
createElementVNode("div", _hoisted_13, [
|
|
@@ -2058,19 +2099,19 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2058
2099
|
S.available ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-200 text-fm-color-neutral-gray-400"
|
|
2059
2100
|
])
|
|
2060
2101
|
}, [
|
|
2061
|
-
createVNode(
|
|
2062
|
-
name:
|
|
2102
|
+
createVNode(D, {
|
|
2103
|
+
name: v(S.channel),
|
|
2063
2104
|
size: "md"
|
|
2064
2105
|
}, null, 8, ["name"])
|
|
2065
2106
|
], 2),
|
|
2066
2107
|
S.available ? (openBlock(), createElementBlock("span", {
|
|
2067
2108
|
key: 0,
|
|
2068
2109
|
class: normalizeClass(["flex h-[22px] w-[22px] flex-none items-center justify-center border-2 transition-colors", [
|
|
2069
|
-
unref(
|
|
2110
|
+
unref(d) ? "rounded-full" : "rounded-[4px]",
|
|
2070
2111
|
S.checked ? "border-fm-color-primary bg-fm-color-primary text-fm-color-typo-white" : "border-fm-color-neutral-gray-300 bg-fm-color-neutral-white"
|
|
2071
2112
|
]])
|
|
2072
2113
|
}, [
|
|
2073
|
-
S.checked && !unref(
|
|
2114
|
+
S.checked && !unref(d) ? (openBlock(), createBlock(D, {
|
|
2074
2115
|
key: 0,
|
|
2075
2116
|
name: "check",
|
|
2076
2117
|
size: "sm"
|
|
@@ -2082,75 +2123,93 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2082
2123
|
class: normalizeClass(["fm-typo-en-body-md-600", S.available ? "" : "text-fm-color-typo-disabled"])
|
|
2083
2124
|
}, toDisplayString(S.label), 3),
|
|
2084
2125
|
S.available && S.rateNote ? (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(S.rateNote), 1)) : createCommentVNode("", !0),
|
|
2085
|
-
S.available ? S.usedAsFallback ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(unref(o)("connect.campaign.broadcast.usedAsFallback")), 1)) : createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(unref(o)("connect.campaign.broadcast.notSetUp")), 1))
|
|
2126
|
+
S.available ? S.usedAsFallback ? (openBlock(), createElementBlock("div", _hoisted_17, toDisplayString(unref(o)("connect.campaign.broadcast.usedAsFallback")), 1)) : createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_16, toDisplayString(S.channel === "PUSH" ? unref(i) : unref(o)("connect.campaign.broadcast.notSetUp")), 1))
|
|
2086
2127
|
]),
|
|
2087
|
-
S.
|
|
2128
|
+
S.channel === "WHATSAPP" && !S.available ? (openBlock(), createElementBlock("a", {
|
|
2088
2129
|
key: 0,
|
|
2089
|
-
href:
|
|
2130
|
+
href: j,
|
|
2090
2131
|
target: "_blank",
|
|
2091
2132
|
class: "mt-auto fm-typo-en-body-sm-400 text-fm-color-secondary-blueberry underline",
|
|
2092
|
-
onClick:
|
|
2133
|
+
onClick: B[0] || (B[0] = withModifiers(() => {
|
|
2093
2134
|
}, ["stop"]))
|
|
2094
|
-
}, toDisplayString(unref(o)("connect.campaign.messageInput.manageWhatsappChannel")), 1))
|
|
2135
|
+
}, toDisplayString(unref(o)("connect.campaign.messageInput.manageWhatsappChannel")), 1)) : createCommentVNode("", !0),
|
|
2136
|
+
S.channel === "PUSH" && !S.available ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2137
|
+
e.pushAvailability === "non-native" ? (openBlock(), createBlock(J, {
|
|
2138
|
+
key: 0,
|
|
2139
|
+
label: unref(o)("connect.campaign.broadcast.pushAvailability.contactSales"),
|
|
2140
|
+
onClick: withModifiers(u, ["stop"])
|
|
2141
|
+
}, null, 8, ["label"])) : createCommentVNode("", !0),
|
|
2142
|
+
e.pushAvailability === "failed" ? (openBlock(), createBlock(J, {
|
|
2143
|
+
key: 1,
|
|
2144
|
+
label: unref(o)("connect.campaign.broadcast.pushAvailability.retry"),
|
|
2145
|
+
onClick: B[1] || (B[1] = withModifiers((Q) => s("retry-push"), ["stop"]))
|
|
2146
|
+
}, null, 8, ["label"])) : createCommentVNode("", !0),
|
|
2147
|
+
S.selected ? (openBlock(), createBlock(J, {
|
|
2148
|
+
key: 2,
|
|
2149
|
+
label: unref(o)("connect.campaign.broadcast.pushAvailability.removePush"),
|
|
2150
|
+
onClick: B[2] || (B[2] = withModifiers((Q) => M("PUSH"), ["stop"]))
|
|
2151
|
+
}, null, 8, ["label"])) : createCommentVNode("", !0)
|
|
2152
|
+
], 64)) : createCommentVNode("", !0)
|
|
2095
2153
|
]),
|
|
2096
2154
|
_: 2
|
|
2097
2155
|
}, 1032, ["class", "aria-disabled", "onClick"]))), 128))
|
|
2098
2156
|
]),
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2157
|
+
unref(c).channels.includes("PUSH") && !C("PUSH") ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.pushAvailability.removeBeforeSave")), 1)) : createCommentVNode("", !0),
|
|
2158
|
+
e.showValidation && !unref(c).channels.length ? (openBlock(), createElementBlock("div", _hoisted_19, toDisplayString(unref(o)("connect.campaign.broadcast.selectChannelRequired")), 1)) : createCommentVNode("", !0),
|
|
2159
|
+
unref(d) && unref(c).channels.length ? (openBlock(), createBlock(_sfc_main$h, {
|
|
2160
|
+
key: 2,
|
|
2161
|
+
rows: unref(K),
|
|
2162
|
+
addable: unref(Z),
|
|
2163
|
+
onMove: I,
|
|
2164
|
+
onRemove: M,
|
|
2165
|
+
onAdd: X
|
|
2107
2166
|
}, null, 8, ["rows", "addable"])) : createCommentVNode("", !0)
|
|
2108
2167
|
]),
|
|
2109
|
-
createElementVNode("div",
|
|
2168
|
+
createElementVNode("div", _hoisted_20, [
|
|
2110
2169
|
createElementVNode("div", null, [
|
|
2111
|
-
createElementVNode("div",
|
|
2112
|
-
createElementVNode("div",
|
|
2170
|
+
createElementVNode("div", _hoisted_21, toDisplayString(unref(o)("connect.campaign.broadcast.content")), 1),
|
|
2171
|
+
createElementVNode("div", _hoisted_22, toDisplayString(unref(o)("connect.campaign.broadcast.contentDescription")), 1)
|
|
2113
2172
|
]),
|
|
2114
|
-
unref(
|
|
2173
|
+
unref(H).length ? (openBlock(), createBlock(_sfc_main$w, {
|
|
2115
2174
|
key: 0,
|
|
2116
|
-
channels: unref(
|
|
2175
|
+
channels: unref(H)
|
|
2117
2176
|
}, null, 8, ["channels"])) : createCommentVNode("", !0),
|
|
2118
|
-
unref(
|
|
2119
|
-
unref(
|
|
2177
|
+
unref(c).channels.length ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_23, toDisplayString(unref(o)("connect.campaign.broadcast.noChannelContent")), 1)),
|
|
2178
|
+
unref(c).channels.length ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2120
2179
|
key: 2,
|
|
2121
|
-
modelValue: unref(
|
|
2122
|
-
"onUpdate:modelValue":
|
|
2123
|
-
tabs: unref(
|
|
2180
|
+
modelValue: unref(f),
|
|
2181
|
+
"onUpdate:modelValue": B[3] || (B[3] = (S) => isRef(f) ? f.value = S : null),
|
|
2182
|
+
tabs: unref(W)
|
|
2124
2183
|
}, null, 8, ["modelValue", "tabs"])) : createCommentVNode("", !0),
|
|
2125
|
-
unref(
|
|
2126
|
-
createElementVNode("div",
|
|
2127
|
-
unref(
|
|
2184
|
+
unref(c).channels.includes(unref(f)) ? (openBlock(), createElementBlock("div", _hoisted_24, [
|
|
2185
|
+
createElementVNode("div", _hoisted_25, [
|
|
2186
|
+
unref(f) === "PUSH" && unref(F) && C("PUSH") ? (openBlock(), createBlock(_sfc_main$k, {
|
|
2128
2187
|
key: 0,
|
|
2129
|
-
"model-value": unref(
|
|
2188
|
+
"model-value": unref(F),
|
|
2130
2189
|
"show-validation": e.showValidation,
|
|
2131
|
-
"onUpdate:modelValue":
|
|
2132
|
-
}, null, 8, ["model-value", "show-validation"])) : unref(
|
|
2133
|
-
key:
|
|
2134
|
-
"model-value": unref(
|
|
2135
|
-
variables: unref(
|
|
2190
|
+
"onUpdate:modelValue": O
|
|
2191
|
+
}, null, 8, ["model-value", "show-validation"])) : unref(f) === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_26, toDisplayString(unref(i)), 1)) : unref(f) === "APP_INBOX" && unref(E) ? (openBlock(), createBlock(_sfc_main$l, {
|
|
2192
|
+
key: 2,
|
|
2193
|
+
"model-value": unref(E),
|
|
2194
|
+
variables: unref(p),
|
|
2136
2195
|
"show-validation": e.showValidation,
|
|
2137
|
-
"onUpdate:modelValue":
|
|
2138
|
-
}, null, 8, ["model-value", "variables", "show-validation"])) : unref(
|
|
2139
|
-
key: unref(
|
|
2140
|
-
"model-value": unref(
|
|
2196
|
+
"onUpdate:modelValue": U
|
|
2197
|
+
}, null, 8, ["model-value", "variables", "show-validation"])) : unref(f) !== "APP_INBOX" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2198
|
+
key: unref(f),
|
|
2199
|
+
"model-value": unref(b),
|
|
2141
2200
|
"allow-email": !1,
|
|
2142
2201
|
"allow-whatsapp": !1,
|
|
2143
2202
|
"hide-credit-card": !0,
|
|
2144
2203
|
"trigger-type": e.triggerType,
|
|
2145
|
-
variables: unref(
|
|
2204
|
+
variables: unref(p),
|
|
2146
2205
|
placeholder: e.placeholder,
|
|
2147
|
-
"onUpdate:modelValue":
|
|
2206
|
+
"onUpdate:modelValue": B[4] || (B[4] = (S) => P(unref(Y), S))
|
|
2148
2207
|
}, null, 8, ["model-value", "trigger-type", "variables", "placeholder"])) : createCommentVNode("", !0)
|
|
2149
2208
|
]),
|
|
2150
2209
|
createVNode(_sfc_main$i, {
|
|
2151
|
-
target: unref(
|
|
2152
|
-
content: unref(
|
|
2153
|
-
"sender-prefix": unref(
|
|
2210
|
+
target: unref(f),
|
|
2211
|
+
content: unref(c).content[unref(Y)],
|
|
2212
|
+
"sender-prefix": unref(L)
|
|
2154
2213
|
}, null, 8, ["target", "content", "sender-prefix"])
|
|
2155
2214
|
])) : createCommentVNode("", !0)
|
|
2156
2215
|
])
|
|
@@ -2175,61 +2234,61 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2175
2234
|
}
|
|
2176
2235
|
},
|
|
2177
2236
|
emits: ["update:model-value"],
|
|
2178
|
-
setup(e, { emit:
|
|
2179
|
-
const { t: o } = useI18n(),
|
|
2180
|
-
() => CountryTimezone[
|
|
2237
|
+
setup(e, { emit: r }) {
|
|
2238
|
+
const { t: o } = useI18n(), m = e, i = r, u = useCoreStore(), l = computed(
|
|
2239
|
+
() => CountryTimezone[u.currentCountry.value || "MY"]
|
|
2181
2240
|
);
|
|
2182
2241
|
function n() {
|
|
2183
|
-
const
|
|
2184
|
-
return
|
|
2185
|
-
(
|
|
2242
|
+
const d = RuleBuilder.getRules(m.modelValue);
|
|
2243
|
+
return d.length == 0 ? "fixed" : d.some(
|
|
2244
|
+
(p) => isRuleEntry(p) && RuleBuilder.simplify(p).operator == "_rrule"
|
|
2186
2245
|
) ? "repeating" : "fixed";
|
|
2187
2246
|
}
|
|
2188
|
-
const a = ref(n()),
|
|
2247
|
+
const a = ref(n()), s = ref(!1), y = ref(!1), f = computed(() => [
|
|
2189
2248
|
{ label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
2190
2249
|
{ label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
2191
|
-
]),
|
|
2192
|
-
const
|
|
2250
|
+
]), c = computed(() => {
|
|
2251
|
+
const d = RuleBuilder.getRules(m.modelValue), p = d.find(
|
|
2193
2252
|
(x) => isRuleEntry(x) && RuleBuilder.simplify(x).property == "trigger.date"
|
|
2194
|
-
), C =
|
|
2253
|
+
), C = d.find(
|
|
2195
2254
|
(x) => isRuleEntry(x) && RuleBuilder.simplify(x).property == "trigger.time"
|
|
2196
2255
|
);
|
|
2197
2256
|
return {
|
|
2198
|
-
date:
|
|
2257
|
+
date: p ? RuleBuilder.simplify(p).equator : null,
|
|
2199
2258
|
time: C ? RuleBuilder.simplify(C).equator : null
|
|
2200
2259
|
};
|
|
2201
|
-
}),
|
|
2260
|
+
}), k = computed(
|
|
2202
2261
|
() => calculateNextScheduleAt(
|
|
2203
|
-
|
|
2262
|
+
m.modelValue,
|
|
2204
2263
|
/* @__PURE__ */ new Date(),
|
|
2205
|
-
|
|
2206
|
-
|
|
2264
|
+
m.startDate ? new Date(m.startDate) : /* @__PURE__ */ new Date(),
|
|
2265
|
+
m.endDate ? new Date(m.endDate) : void 0
|
|
2207
2266
|
)
|
|
2208
2267
|
);
|
|
2209
|
-
function
|
|
2268
|
+
function V(d, p) {
|
|
2210
2269
|
i(
|
|
2211
2270
|
"update:model-value",
|
|
2212
2271
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
2213
|
-
RuleBuilder.constructEntry("trigger.date", "_rrule",
|
|
2214
|
-
RuleBuilder.constructEntry("trigger.time", "_isOnTime",
|
|
2272
|
+
RuleBuilder.constructEntry("trigger.date", "_rrule", d),
|
|
2273
|
+
RuleBuilder.constructEntry("trigger.time", "_isOnTime", p ?? "00:00")
|
|
2215
2274
|
])
|
|
2216
2275
|
);
|
|
2217
2276
|
}
|
|
2218
2277
|
watch(
|
|
2219
|
-
() =>
|
|
2220
|
-
(
|
|
2221
|
-
if (!
|
|
2222
|
-
const C = RRule.fromString(
|
|
2278
|
+
() => m.startDate,
|
|
2279
|
+
(d, p) => {
|
|
2280
|
+
if (!d || d === p || a.value !== "repeating" || !c.value.date) return;
|
|
2281
|
+
const C = RRule.fromString(c.value.date), x = new RRule({
|
|
2223
2282
|
...C.origOptions,
|
|
2224
|
-
dtstart: new Date(
|
|
2283
|
+
dtstart: new Date(d)
|
|
2225
2284
|
}).toString();
|
|
2226
|
-
x !==
|
|
2285
|
+
x !== c.value.date && (V(x, c.value.time), y.value = !0);
|
|
2227
2286
|
}
|
|
2228
2287
|
);
|
|
2229
|
-
function
|
|
2230
|
-
const
|
|
2231
|
-
startDate:
|
|
2232
|
-
}), x =
|
|
2288
|
+
function g(d) {
|
|
2289
|
+
const p = d.value, C = getRruleAnchorDate({
|
|
2290
|
+
startDate: m.startDate ? new Date(m.startDate) : void 0
|
|
2291
|
+
}), x = p == "fixed" ? [
|
|
2233
2292
|
RuleBuilder.constructEntry(
|
|
2234
2293
|
"trigger.date",
|
|
2235
2294
|
"_isOnDate",
|
|
@@ -2258,53 +2317,53 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2258
2317
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2259
2318
|
x
|
|
2260
2319
|
)
|
|
2261
|
-
), a.value =
|
|
2320
|
+
), a.value = p, y.value = !1;
|
|
2262
2321
|
}
|
|
2263
|
-
function
|
|
2322
|
+
function v(d) {
|
|
2264
2323
|
a.value == "fixed" ? i(
|
|
2265
2324
|
"update:model-value",
|
|
2266
2325
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
2267
2326
|
RuleBuilder.constructEntry(
|
|
2268
2327
|
"trigger.date",
|
|
2269
2328
|
"_isOnDate",
|
|
2270
|
-
|
|
2329
|
+
d.date
|
|
2271
2330
|
),
|
|
2272
2331
|
RuleBuilder.constructEntry(
|
|
2273
2332
|
"trigger.time",
|
|
2274
2333
|
"_isOnTime",
|
|
2275
|
-
|
|
2334
|
+
d.time
|
|
2276
2335
|
)
|
|
2277
2336
|
])
|
|
2278
|
-
) :
|
|
2337
|
+
) : V(d.date, d.time), y.value = !1;
|
|
2279
2338
|
}
|
|
2280
|
-
return (
|
|
2281
|
-
const C = resolveComponent("FmButtonGroup"), x = resolveComponent("FmTimePicker"),
|
|
2339
|
+
return (d, p) => {
|
|
2340
|
+
const C = resolveComponent("FmButtonGroup"), x = resolveComponent("FmTimePicker"), N = resolveComponent("FmIcon"), w = resolveComponent("FmTooltip"), $ = resolveComponent("FmField"), T = resolveComponent("FmCard"), R = resolveComponent("FmPopover"), A = resolveComponent("FmDatePicker"), M = resolveComponent("FmHelperText");
|
|
2282
2341
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2283
2342
|
createVNode(C, {
|
|
2284
|
-
items: unref(
|
|
2285
|
-
"model-value": unref(
|
|
2286
|
-
"onUpdate:modelValue":
|
|
2343
|
+
items: unref(f),
|
|
2344
|
+
"model-value": unref(f).find((I) => I.value === unref(a)) ?? null,
|
|
2345
|
+
"onUpdate:modelValue": g,
|
|
2287
2346
|
class: "mb-8"
|
|
2288
2347
|
}, null, 8, ["items", "model-value"]),
|
|
2289
2348
|
createElementVNode("div", _hoisted_1$f, [
|
|
2290
2349
|
createElementVNode("div", _hoisted_2$c, [
|
|
2291
2350
|
createVNode(x, {
|
|
2292
2351
|
label: unref(o)("connect.template.rule.schedule.notify_time"),
|
|
2293
|
-
"model-value": unref(
|
|
2294
|
-
"onUpdate:modelValue":
|
|
2295
|
-
"helper-text": unref(
|
|
2296
|
-
"helper-state": unref(
|
|
2352
|
+
"model-value": unref(c).time,
|
|
2353
|
+
"onUpdate:modelValue": p[0] || (p[0] = (I) => v({ date: unref(c).date, time: I })),
|
|
2354
|
+
"helper-text": unref(c).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
|
|
2355
|
+
"helper-state": unref(c).time ? void 0 : "error"
|
|
2297
2356
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
2298
2357
|
unref(a) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
2299
2358
|
createElementVNode("div", _hoisted_4$8, [
|
|
2300
2359
|
createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
|
|
2301
|
-
unref(
|
|
2360
|
+
unref(c).date ? (openBlock(), createBlock(w, {
|
|
2302
2361
|
key: 0,
|
|
2303
2362
|
"z-index": 9999,
|
|
2304
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
2363
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(c).date).options)
|
|
2305
2364
|
}, {
|
|
2306
2365
|
default: withCtx(() => [
|
|
2307
|
-
createVNode(
|
|
2366
|
+
createVNode(N, {
|
|
2308
2367
|
name: "info",
|
|
2309
2368
|
size: "sm",
|
|
2310
2369
|
outline: !0
|
|
@@ -2313,31 +2372,31 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2313
2372
|
_: 1
|
|
2314
2373
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
2315
2374
|
]),
|
|
2316
|
-
createVNode(
|
|
2317
|
-
"show-popover": unref(
|
|
2318
|
-
onPopoverChanged:
|
|
2375
|
+
createVNode(R, {
|
|
2376
|
+
"show-popover": unref(s),
|
|
2377
|
+
onPopoverChanged: p[3] || (p[3] = (I) => s.value = I)
|
|
2319
2378
|
}, {
|
|
2320
2379
|
"popover-button": withCtx(() => [
|
|
2321
|
-
createVNode(
|
|
2380
|
+
createVNode($, {
|
|
2322
2381
|
class: "cursor-pointer",
|
|
2323
|
-
"helper-text": unref(
|
|
2324
|
-
"helper-state": unref(
|
|
2382
|
+
"helper-text": unref(c).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
2383
|
+
"helper-state": unref(c).date ? void 0 : "error"
|
|
2325
2384
|
}, {
|
|
2326
2385
|
default: withCtx(() => [
|
|
2327
|
-
createElementVNode("div", _hoisted_5$6, toDisplayString(unref(
|
|
2386
|
+
createElementVNode("div", _hoisted_5$6, toDisplayString(unref(c).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(c).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
|
|
2328
2387
|
]),
|
|
2329
2388
|
_: 1
|
|
2330
2389
|
}, 8, ["helper-text", "helper-state"])
|
|
2331
2390
|
]),
|
|
2332
2391
|
default: withCtx(() => [
|
|
2333
|
-
createVNode(
|
|
2392
|
+
createVNode(T, { class: "elevated p-8 w-[450px]" }, {
|
|
2334
2393
|
default: withCtx(() => [
|
|
2335
2394
|
createVNode(_sfc_main$y, {
|
|
2336
2395
|
"apply-button": !0,
|
|
2337
|
-
"model-value": unref(
|
|
2396
|
+
"model-value": unref(c).date || "",
|
|
2338
2397
|
"start-date": e.startDate ? new Date(e.startDate) : /* @__PURE__ */ new Date(),
|
|
2339
|
-
onCancel:
|
|
2340
|
-
"onUpdate:modelValue":
|
|
2398
|
+
onCancel: p[1] || (p[1] = (I) => s.value = !1),
|
|
2399
|
+
"onUpdate:modelValue": p[2] || (p[2] = (I) => (v({ date: I, time: unref(c).time }), s.value = !1))
|
|
2341
2400
|
}, null, 8, ["model-value", "start-date"])
|
|
2342
2401
|
]),
|
|
2343
2402
|
_: 1
|
|
@@ -2345,21 +2404,21 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2345
2404
|
]),
|
|
2346
2405
|
_: 1
|
|
2347
2406
|
}, 8, ["show-popover"])
|
|
2348
|
-
])) : (openBlock(), createBlock(
|
|
2407
|
+
])) : (openBlock(), createBlock(A, {
|
|
2349
2408
|
key: 1,
|
|
2350
2409
|
label: unref(o)("connect.template.rule.schedule.notify_date"),
|
|
2351
|
-
"model-value": unref(
|
|
2352
|
-
"onUpdate:modelValue":
|
|
2353
|
-
"helper-text": unref(
|
|
2354
|
-
"helper-state": unref(
|
|
2410
|
+
"model-value": unref(c).date || "",
|
|
2411
|
+
"onUpdate:modelValue": p[4] || (p[4] = (I) => v({ date: I, time: unref(c).time })),
|
|
2412
|
+
"helper-text": unref(c).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
2413
|
+
"helper-state": unref(c).date ? void 0 : "error"
|
|
2355
2414
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
2356
2415
|
]),
|
|
2357
|
-
unref(
|
|
2416
|
+
unref(c).date && unref(c).time && unref(k) ? (openBlock(), createBlock(M, {
|
|
2358
2417
|
key: 0,
|
|
2359
|
-
text: `${unref(moment)(unref(
|
|
2360
|
-
${unref(moment)(unref(
|
|
2418
|
+
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
|
|
2419
|
+
${unref(moment)(unref(k)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(k)).fromNow()})`
|
|
2361
2420
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2362
|
-
unref(
|
|
2421
|
+
unref(y) ? (openBlock(), createBlock(M, {
|
|
2363
2422
|
key: 1,
|
|
2364
2423
|
text: "Repeating schedule was updated to stay anchored to the campaign start date.",
|
|
2365
2424
|
state: "warning"
|
|
@@ -2376,8 +2435,8 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2376
2435
|
}
|
|
2377
2436
|
},
|
|
2378
2437
|
emits: ["update:model-value"],
|
|
2379
|
-
setup(e, { emit:
|
|
2380
|
-
const { t: o } = useI18n(),
|
|
2438
|
+
setup(e, { emit: r }) {
|
|
2439
|
+
const { t: o } = useI18n(), m = e, i = r, u = computed(
|
|
2381
2440
|
() => [
|
|
2382
2441
|
{
|
|
2383
2442
|
label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -2398,21 +2457,21 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2398
2457
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
2399
2458
|
createElementVNode("div", _hoisted_2$b, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
2400
2459
|
createElementVNode("div", _hoisted_3$8, [
|
|
2401
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2460
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (s) => (openBlock(), createBlock(a, {
|
|
2402
2461
|
variant: "outlined",
|
|
2403
2462
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2404
|
-
"col-span-2": unref(
|
|
2405
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
2406
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
2463
|
+
"col-span-2": unref(u).length == 1,
|
|
2464
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == s.value,
|
|
2465
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != s.value
|
|
2407
2466
|
}]),
|
|
2408
2467
|
onClick: () => {
|
|
2409
|
-
|
|
2468
|
+
m.modelValue != s.value && i("update:model-value", s.value);
|
|
2410
2469
|
},
|
|
2411
|
-
key:
|
|
2470
|
+
key: s.value
|
|
2412
2471
|
}, {
|
|
2413
2472
|
default: withCtx(() => [
|
|
2414
|
-
createElementVNode("div", _hoisted_4$7, toDisplayString(
|
|
2415
|
-
createElementVNode("div", _hoisted_5$5, toDisplayString(
|
|
2473
|
+
createElementVNode("div", _hoisted_4$7, toDisplayString(s.label), 1),
|
|
2474
|
+
createElementVNode("div", _hoisted_5$5, toDisplayString(s.description), 1)
|
|
2416
2475
|
]),
|
|
2417
2476
|
_: 2
|
|
2418
2477
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -2426,29 +2485,29 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2426
2485
|
}, _hoisted_2$a = { class: "flex gap-8 items-center justify-start" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
2427
2486
|
__name: "EditRewardPoolSheet",
|
|
2428
2487
|
emits: ["update:model-value"],
|
|
2429
|
-
setup(e, { expose:
|
|
2430
|
-
const
|
|
2431
|
-
var
|
|
2432
|
-
return ((
|
|
2433
|
-
(
|
|
2434
|
-
var
|
|
2435
|
-
return
|
|
2488
|
+
setup(e, { expose: r, emit: o }) {
|
|
2489
|
+
const m = useMembershipStore(), { minor: i } = useLoading, u = ref(!1), l = ref(), n = ref(), a = ref(0), s = computed(() => {
|
|
2490
|
+
var g;
|
|
2491
|
+
return ((g = m.loyaltyRewards.items.find(
|
|
2492
|
+
(v) => {
|
|
2493
|
+
var d;
|
|
2494
|
+
return v.value === ((d = l.value) == null ? void 0 : d.collectible);
|
|
2436
2495
|
}
|
|
2437
|
-
)) == null ? void 0 :
|
|
2438
|
-
}),
|
|
2439
|
-
const
|
|
2440
|
-
return
|
|
2496
|
+
)) == null ? void 0 : g.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
2497
|
+
}), y = computed(() => {
|
|
2498
|
+
const V = s.value.safeParse(l.value);
|
|
2499
|
+
return V.success ? [] : V.error.errors;
|
|
2441
2500
|
});
|
|
2442
|
-
function
|
|
2443
|
-
|
|
2501
|
+
function f(V, g, v) {
|
|
2502
|
+
V && (l.value = g, a.value = v), u.value = V;
|
|
2444
2503
|
}
|
|
2445
|
-
const
|
|
2446
|
-
async function
|
|
2447
|
-
const
|
|
2448
|
-
|
|
2504
|
+
const c = o;
|
|
2505
|
+
async function k() {
|
|
2506
|
+
const V = s.value.safeParse(l.value);
|
|
2507
|
+
V.success && (await i(
|
|
2449
2508
|
async () => {
|
|
2450
|
-
|
|
2451
|
-
|
|
2509
|
+
V.data.type === "VOUCHER" && n.value && (V.data.collectibleConfig.image = await firebaseStorage.update(
|
|
2510
|
+
V.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
2452
2511
|
n.value
|
|
2453
2512
|
));
|
|
2454
2513
|
},
|
|
@@ -2456,44 +2515,44 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2456
2515
|
message: "Uploading reward image",
|
|
2457
2516
|
successMessage: "Reward image updated"
|
|
2458
2517
|
}
|
|
2459
|
-
),
|
|
2518
|
+
), c("update:model-value", V.data, a.value));
|
|
2460
2519
|
}
|
|
2461
|
-
return
|
|
2462
|
-
showSheet:
|
|
2463
|
-
}), (
|
|
2464
|
-
const
|
|
2520
|
+
return r({
|
|
2521
|
+
showSheet: f
|
|
2522
|
+
}), (V, g) => {
|
|
2523
|
+
const v = resolveComponent("FmSelect"), d = resolveComponent("FmStepperField"), p = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
2465
2524
|
return openBlock(), createBlock(C, {
|
|
2466
2525
|
"max-width": 560,
|
|
2467
|
-
modelValue: unref(
|
|
2526
|
+
modelValue: unref(u),
|
|
2468
2527
|
"onUpdate:modelValue": [
|
|
2469
|
-
|
|
2470
|
-
|
|
2528
|
+
g[9] || (g[9] = (x) => isRef(u) ? u.value = x : null),
|
|
2529
|
+
g[10] || (g[10] = (x) => u.value = x)
|
|
2471
2530
|
],
|
|
2472
2531
|
header: "Edit reward",
|
|
2473
2532
|
"dismiss-away": ""
|
|
2474
2533
|
}, {
|
|
2475
2534
|
"side-sheet-footer": withCtx(() => [
|
|
2476
2535
|
createElementVNode("div", _hoisted_2$a, [
|
|
2477
|
-
createVNode(
|
|
2536
|
+
createVNode(p, {
|
|
2478
2537
|
variant: "primary",
|
|
2479
2538
|
type: "button",
|
|
2480
|
-
disabled: unref(
|
|
2539
|
+
disabled: unref(y).length > 0,
|
|
2481
2540
|
label: "Confirm",
|
|
2482
|
-
onClick:
|
|
2541
|
+
onClick: g[7] || (g[7] = (x) => k())
|
|
2483
2542
|
}, null, 8, ["disabled"]),
|
|
2484
|
-
createVNode(
|
|
2543
|
+
createVNode(p, {
|
|
2485
2544
|
variant: "secondary",
|
|
2486
2545
|
type: "button",
|
|
2487
2546
|
label: "Cancel",
|
|
2488
|
-
onClick:
|
|
2547
|
+
onClick: g[8] || (g[8] = (x) => u.value = !1)
|
|
2489
2548
|
})
|
|
2490
2549
|
])
|
|
2491
2550
|
]),
|
|
2492
2551
|
default: withCtx(() => {
|
|
2493
|
-
var x,
|
|
2552
|
+
var x, N, w;
|
|
2494
2553
|
return [
|
|
2495
2554
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
2496
|
-
createVNode(
|
|
2555
|
+
createVNode(v, {
|
|
2497
2556
|
label: "Reward Type",
|
|
2498
2557
|
items: [
|
|
2499
2558
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -2501,12 +2560,12 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2501
2560
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2502
2561
|
],
|
|
2503
2562
|
"model-value": unref(l).type,
|
|
2504
|
-
"onUpdate:modelValue":
|
|
2505
|
-
|
|
2563
|
+
"onUpdate:modelValue": g[0] || (g[0] = ($) => {
|
|
2564
|
+
$ == "NO_REWARD" ? l.value = {
|
|
2506
2565
|
type: "NO_REWARD",
|
|
2507
2566
|
collectible: null,
|
|
2508
2567
|
weight: 1
|
|
2509
|
-
} :
|
|
2568
|
+
} : $ === "VOUCHER" ? l.value = {
|
|
2510
2569
|
collectible: null,
|
|
2511
2570
|
type: "VOUCHER",
|
|
2512
2571
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -2521,7 +2580,7 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2521
2580
|
},
|
|
2522
2581
|
weight: 1
|
|
2523
2582
|
} : l.value = {
|
|
2524
|
-
collectible: unref(
|
|
2583
|
+
collectible: unref(m).loyaltyRewards.raw[0]._id,
|
|
2525
2584
|
type: "LOYALTY",
|
|
2526
2585
|
earningOption: {
|
|
2527
2586
|
amount: 1,
|
|
@@ -2534,75 +2593,75 @@ const _hoisted_1$g = { class: "flex flex-col gap-[28px]" }, _hoisted_2$d = { cla
|
|
|
2534
2593
|
};
|
|
2535
2594
|
})
|
|
2536
2595
|
}, null, 8, ["model-value"]),
|
|
2537
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
2596
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(v, {
|
|
2538
2597
|
key: 0,
|
|
2539
2598
|
label: "Loyalty type",
|
|
2540
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2541
|
-
items: unref(
|
|
2599
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(s), "collectible", [unref(l).type])],
|
|
2600
|
+
items: unref(m).loyaltyRewards.items,
|
|
2542
2601
|
"model-value": unref(l).collectible,
|
|
2543
|
-
"onUpdate:modelValue":
|
|
2602
|
+
"onUpdate:modelValue": g[1] || (g[1] = ($) => unref(l).collectible = $)
|
|
2544
2603
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2545
|
-
createVNode(
|
|
2604
|
+
createVNode(d, {
|
|
2546
2605
|
label: "Weight",
|
|
2547
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2606
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(s), "weight", [unref(l).type])],
|
|
2548
2607
|
"model-value": unref(l).weight,
|
|
2549
|
-
"onUpdate:modelValue":
|
|
2608
|
+
"onUpdate:modelValue": g[2] || (g[2] = ($) => l.value = {
|
|
2550
2609
|
...unref(l),
|
|
2551
|
-
weight:
|
|
2610
|
+
weight: $
|
|
2552
2611
|
})
|
|
2553
2612
|
}, null, 8, ["rules", "model-value"]),
|
|
2554
2613
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2555
|
-
((x = unref(
|
|
2556
|
-
(
|
|
2557
|
-
var
|
|
2558
|
-
return
|
|
2614
|
+
((x = unref(m).loyaltyRewards.items.find(
|
|
2615
|
+
($) => {
|
|
2616
|
+
var T;
|
|
2617
|
+
return $.value === ((T = unref(l)) == null ? void 0 : T.collectible);
|
|
2559
2618
|
}
|
|
2560
2619
|
)) == null ? void 0 : x.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2561
|
-
|
|
2620
|
+
g[11] || (g[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
2562
2621
|
createVNode(_sfc_main$z, {
|
|
2563
2622
|
class: "mt-[-8px]",
|
|
2564
2623
|
rules: [
|
|
2565
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
2624
|
+
unref(ZodHelper).ruleAtPath(unref(s), "earningOption", [unref(l).type])
|
|
2566
2625
|
],
|
|
2567
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2568
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
2626
|
+
"helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
|
|
2627
|
+
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
2569
2628
|
"fixed-type": !0,
|
|
2570
2629
|
"model-value": unref(l).earningOption,
|
|
2571
|
-
"onUpdate:modelValue":
|
|
2630
|
+
"onUpdate:modelValue": g[3] || (g[3] = ($) => l.value = {
|
|
2572
2631
|
...unref(l),
|
|
2573
|
-
earningOption:
|
|
2632
|
+
earningOption: $
|
|
2574
2633
|
})
|
|
2575
2634
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
2576
2635
|
], 64)) : createCommentVNode("", !0),
|
|
2577
|
-
|
|
2636
|
+
g[12] || (g[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
2578
2637
|
createVNode(_sfc_main$A, {
|
|
2579
2638
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
2580
|
-
"for-credit": unref(l).type === "LOYALTY" && ((
|
|
2581
|
-
(
|
|
2582
|
-
var
|
|
2583
|
-
return
|
|
2639
|
+
"for-credit": unref(l).type === "LOYALTY" && ((N = unref(m).loyaltyRewards.items.find(
|
|
2640
|
+
($) => {
|
|
2641
|
+
var T;
|
|
2642
|
+
return $.value === ((T = unref(l)) == null ? void 0 : T.collectible);
|
|
2584
2643
|
}
|
|
2585
|
-
)) == null ? void 0 :
|
|
2644
|
+
)) == null ? void 0 : N.raw.type) === "CREDIT",
|
|
2586
2645
|
class: "!gap-24",
|
|
2587
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2646
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(s), "validityOption", [unref(l).type])],
|
|
2588
2647
|
"model-value": unref(l).validityOption,
|
|
2589
|
-
"onUpdate:modelValue":
|
|
2648
|
+
"onUpdate:modelValue": g[4] || (g[4] = ($) => l.value = {
|
|
2590
2649
|
...unref(l),
|
|
2591
|
-
validityOption:
|
|
2650
|
+
validityOption: $
|
|
2592
2651
|
})
|
|
2593
2652
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
2594
2653
|
], 64)) : createCommentVNode("", !0),
|
|
2595
2654
|
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$B, {
|
|
2596
2655
|
key: 2,
|
|
2597
2656
|
"reward-image": unref(n),
|
|
2598
|
-
"model-value": ((
|
|
2599
|
-
"onUpdate:modelValue":
|
|
2657
|
+
"model-value": ((w = unref(l)) == null ? void 0 : w.collectibleConfig) ?? void 0,
|
|
2658
|
+
"onUpdate:modelValue": g[5] || (g[5] = ($) => l.value = {
|
|
2600
2659
|
...unref(l),
|
|
2601
|
-
collectibleConfig:
|
|
2660
|
+
collectibleConfig: $
|
|
2602
2661
|
}),
|
|
2603
|
-
"onUpdate:rewardImage":
|
|
2662
|
+
"onUpdate:rewardImage": g[6] || (g[6] = ($) => n.value = $)
|
|
2604
2663
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2605
|
-
createVNode(JsonViewer, { json: unref(
|
|
2664
|
+
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
2606
2665
|
])) : createCommentVNode("", !0)
|
|
2607
2666
|
];
|
|
2608
2667
|
}),
|
|
@@ -2629,37 +2688,37 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2629
2688
|
}
|
|
2630
2689
|
},
|
|
2631
2690
|
emits: ["update:model-value"],
|
|
2632
|
-
setup(e, { emit:
|
|
2633
|
-
const o = e,
|
|
2634
|
-
const
|
|
2635
|
-
return
|
|
2636
|
-
}),
|
|
2637
|
-
function
|
|
2638
|
-
var
|
|
2639
|
-
const
|
|
2640
|
-
|
|
2691
|
+
setup(e, { emit: r }) {
|
|
2692
|
+
const o = e, m = r, i = useMembershipStore(), { t: u } = useI18n(), l = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), n = computed(() => o.modelValue ?? []), a = computed(() => {
|
|
2693
|
+
const g = l.safeParse(n.value);
|
|
2694
|
+
return g.success ? [] : g.error.errors;
|
|
2695
|
+
}), s = ref();
|
|
2696
|
+
function y(g, v) {
|
|
2697
|
+
var p;
|
|
2698
|
+
const d = [...n.value];
|
|
2699
|
+
d[v] = g, (p = s.value) == null || p.showSheet(!1), m("update:model-value", d);
|
|
2641
2700
|
}
|
|
2642
|
-
function
|
|
2643
|
-
const
|
|
2644
|
-
(C) => C._id.toString() ==
|
|
2645
|
-
),
|
|
2701
|
+
function f(g) {
|
|
2702
|
+
const v = g.type == "VOUCHER" ? g.collectibleConfig : i.collectibles.find(
|
|
2703
|
+
(C) => C._id.toString() == g.collectible
|
|
2704
|
+
), d = CollectionUtils.formattedType((v == null ? void 0 : v.name) || ""), p = g.weight;
|
|
2646
2705
|
return {
|
|
2647
|
-
label: isNullOrEmpty(
|
|
2648
|
-
sublabel: `${
|
|
2706
|
+
label: isNullOrEmpty(d) ? "NO REWARD" : d,
|
|
2707
|
+
sublabel: `${p} (${(p / n.value.reduce((C, x) => C + x.weight, 0) * 100).toFixed(2)}%)`
|
|
2649
2708
|
};
|
|
2650
2709
|
}
|
|
2651
|
-
function
|
|
2652
|
-
var
|
|
2653
|
-
const
|
|
2654
|
-
(
|
|
2710
|
+
function c(g) {
|
|
2711
|
+
var d;
|
|
2712
|
+
const v = [...n.value];
|
|
2713
|
+
(d = s.value) == null || d.showSheet(!0, v[g], g);
|
|
2655
2714
|
}
|
|
2656
|
-
function
|
|
2657
|
-
const
|
|
2658
|
-
|
|
2715
|
+
function k(g) {
|
|
2716
|
+
const v = [...n.value];
|
|
2717
|
+
v.splice(g, 1), m("update:model-value", v);
|
|
2659
2718
|
}
|
|
2660
|
-
function
|
|
2661
|
-
var
|
|
2662
|
-
(
|
|
2719
|
+
function V() {
|
|
2720
|
+
var g;
|
|
2721
|
+
(g = s.value) == null || g.showSheet(
|
|
2663
2722
|
!0,
|
|
2664
2723
|
{
|
|
2665
2724
|
type: "NO_REWARD",
|
|
@@ -2669,33 +2728,33 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2669
2728
|
n.value.length
|
|
2670
2729
|
);
|
|
2671
2730
|
}
|
|
2672
|
-
return (
|
|
2673
|
-
const
|
|
2731
|
+
return (g, v) => {
|
|
2732
|
+
const d = resolveComponent("FmButton"), p = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2674
2733
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
2675
|
-
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(
|
|
2676
|
-
createVNode(
|
|
2677
|
-
label: unref(
|
|
2678
|
-
onClick:
|
|
2734
|
+
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(u)("connect.template.configure_reward_type")), 1),
|
|
2735
|
+
createVNode(d, {
|
|
2736
|
+
label: unref(u)("connect.campaign.rewardPool.addReward"),
|
|
2737
|
+
onClick: v[0] || (v[0] = (x) => V()),
|
|
2679
2738
|
variant: "plain",
|
|
2680
2739
|
icon: "add"
|
|
2681
2740
|
}, null, 8, ["label"]),
|
|
2682
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (x,
|
|
2683
|
-
key:
|
|
2741
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (x, N) => (openBlock(), createBlock(p, {
|
|
2742
|
+
key: N,
|
|
2684
2743
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2685
2744
|
variant: "outlined",
|
|
2686
|
-
onClick: (
|
|
2745
|
+
onClick: (w) => c(N)
|
|
2687
2746
|
}, {
|
|
2688
2747
|
default: withCtx(() => {
|
|
2689
|
-
var
|
|
2748
|
+
var w;
|
|
2690
2749
|
return [
|
|
2691
2750
|
createElementVNode("div", null, [
|
|
2692
|
-
createElementVNode("div", _hoisted_3$7, toDisplayString(x.type == "LOYALTY" ? (
|
|
2693
|
-
createElementVNode("div", _hoisted_4$6, toDisplayString(
|
|
2751
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(x.type == "LOYALTY" ? (w = x == null ? void 0 : x.earningOption) == null ? void 0 : w.amount : "") + " " + toDisplayString(f(x).label), 1),
|
|
2752
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(f(x).sublabel), 1)
|
|
2694
2753
|
]),
|
|
2695
|
-
createVNode(
|
|
2754
|
+
createVNode(d, {
|
|
2696
2755
|
icon: "delete",
|
|
2697
2756
|
variant: "tertiary",
|
|
2698
|
-
onClick: (
|
|
2757
|
+
onClick: ($) => ($.stopPropagation(), k(N))
|
|
2699
2758
|
}, null, 8, ["onClick"])
|
|
2700
2759
|
];
|
|
2701
2760
|
}),
|
|
@@ -2708,8 +2767,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2708
2767
|
}, null, 8, ["text"]))), 128)),
|
|
2709
2768
|
createVNode(_sfc_main$d, {
|
|
2710
2769
|
ref_key: "sheetRef",
|
|
2711
|
-
ref:
|
|
2712
|
-
"onUpdate:modelValue":
|
|
2770
|
+
ref: s,
|
|
2771
|
+
"onUpdate:modelValue": y
|
|
2713
2772
|
}, null, 512)
|
|
2714
2773
|
]);
|
|
2715
2774
|
};
|
|
@@ -2725,8 +2784,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2725
2784
|
}
|
|
2726
2785
|
},
|
|
2727
2786
|
emits: ["update:model-value"],
|
|
2728
|
-
setup(e, { emit:
|
|
2729
|
-
const { t: o } = useI18n(),
|
|
2787
|
+
setup(e, { emit: r }) {
|
|
2788
|
+
const { t: o } = useI18n(), m = e, i = r, u = computed(() => [
|
|
2730
2789
|
{
|
|
2731
2790
|
label: o("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
2732
2791
|
description: o("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -2734,39 +2793,39 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2734
2793
|
}
|
|
2735
2794
|
]);
|
|
2736
2795
|
return (l, n) => {
|
|
2737
|
-
var
|
|
2738
|
-
const a = resolveComponent("FmSwitch"),
|
|
2796
|
+
var f, c, k;
|
|
2797
|
+
const a = resolveComponent("FmSwitch"), s = resolveComponent("FmCard"), y = resolveComponent("FmHelperText");
|
|
2739
2798
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
2740
2799
|
createVNode(a, {
|
|
2741
2800
|
label: unref(o)("connect.template.promotion_game.enable"),
|
|
2742
|
-
"model-value": !!((
|
|
2743
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
2801
|
+
"model-value": !!((f = e.modelValue) != null && f.gameType),
|
|
2802
|
+
"onUpdate:modelValue": n[0] || (n[0] = (V) => V ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
|
|
2744
2803
|
}, null, 8, ["label", "model-value"]),
|
|
2745
|
-
((
|
|
2746
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2747
|
-
var
|
|
2748
|
-
return openBlock(), createBlock(
|
|
2804
|
+
((c = e.modelValue) == null ? void 0 : c.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
2805
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (V) => {
|
|
2806
|
+
var g, v;
|
|
2807
|
+
return openBlock(), createBlock(s, {
|
|
2749
2808
|
variant: "outlined",
|
|
2750
2809
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2751
|
-
"col-span-2": unref(
|
|
2752
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
2753
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
2810
|
+
"col-span-2": unref(u).length == 1,
|
|
2811
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.gameType) == V.value,
|
|
2812
|
+
"hover:bg-fm-color-opacity-sm": ((v = e.modelValue) == null ? void 0 : v.gameType) != V.value
|
|
2754
2813
|
}]),
|
|
2755
2814
|
onClick: () => {
|
|
2756
|
-
var
|
|
2757
|
-
((
|
|
2815
|
+
var d;
|
|
2816
|
+
((d = m.modelValue) == null ? void 0 : d.gameType) != V.value && i("update:model-value", { gameType: V.value });
|
|
2758
2817
|
},
|
|
2759
|
-
key:
|
|
2818
|
+
key: V.value
|
|
2760
2819
|
}, {
|
|
2761
2820
|
default: withCtx(() => [
|
|
2762
|
-
createElementVNode("div", _hoisted_3$6, toDisplayString(
|
|
2763
|
-
createElementVNode("div", _hoisted_4$5, toDisplayString(
|
|
2821
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(V.label), 1),
|
|
2822
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(V.description), 1)
|
|
2764
2823
|
]),
|
|
2765
2824
|
_: 2
|
|
2766
2825
|
}, 1032, ["class", "onClick"]);
|
|
2767
2826
|
}), 128))
|
|
2768
2827
|
])) : createCommentVNode("", !0),
|
|
2769
|
-
((
|
|
2828
|
+
((k = e.modelValue) == null ? void 0 : k.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(y, {
|
|
2770
2829
|
key: 1,
|
|
2771
2830
|
text: unref(o)("connect.template.promotion_game.rock_paper_scissors.warning"),
|
|
2772
2831
|
state: "warning"
|
|
@@ -2785,18 +2844,18 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2785
2844
|
},
|
|
2786
2845
|
schema: {
|
|
2787
2846
|
type: Object,
|
|
2788
|
-
default: () => z
|
|
2847
|
+
default: () => z.any()
|
|
2789
2848
|
}
|
|
2790
2849
|
},
|
|
2791
2850
|
emits: ["update:model-value"],
|
|
2792
|
-
setup(e, { emit:
|
|
2793
|
-
const { t: o } = useI18n(),
|
|
2851
|
+
setup(e, { emit: r }) {
|
|
2852
|
+
const { t: o } = useI18n(), m = e, i = r, u = ref(m.modelValue ?? {}), l = ref(
|
|
2794
2853
|
(() => {
|
|
2795
|
-
const
|
|
2796
|
-
return
|
|
2797
|
-
const
|
|
2798
|
-
|
|
2799
|
-
}),
|
|
2854
|
+
const f = {};
|
|
2855
|
+
return u.value.workingHour && Object.keys(u.value.workingHour).forEach((c) => {
|
|
2856
|
+
const k = u.value.workingHour[c];
|
|
2857
|
+
k && "periods" in k && Array.isArray(k.periods) ? f[c] = k.periods : Array.isArray(k) && (f[c] = k);
|
|
2858
|
+
}), f;
|
|
2800
2859
|
})()
|
|
2801
2860
|
), n = [
|
|
2802
2861
|
{ key: "mon", label: "Monday" },
|
|
@@ -2806,30 +2865,30 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2806
2865
|
{ key: "fri", label: "Friday" },
|
|
2807
2866
|
{ key: "sat", label: "Saturday" },
|
|
2808
2867
|
{ key: "sun", label: "Sunday" }
|
|
2809
|
-
], a = (
|
|
2810
|
-
l.value[
|
|
2868
|
+
], a = (f) => {
|
|
2869
|
+
l.value[f] || (l.value[f] = []), l.value[f].push({
|
|
2811
2870
|
startTime: "00:00",
|
|
2812
2871
|
endTime: "23:59"
|
|
2813
|
-
}),
|
|
2814
|
-
},
|
|
2815
|
-
l.value[
|
|
2816
|
-
},
|
|
2817
|
-
const
|
|
2818
|
-
(
|
|
2819
|
-
periods: l.value[
|
|
2820
|
-
}),
|
|
2872
|
+
}), y();
|
|
2873
|
+
}, s = (f, c) => {
|
|
2874
|
+
l.value[f] && l.value[f].length > c && (l.value[f].splice(c, 1), l.value[f].length === 0 && delete l.value[f], y());
|
|
2875
|
+
}, y = () => {
|
|
2876
|
+
const f = Object.keys(l.value).reduce(
|
|
2877
|
+
(c, k) => (l.value[k] && l.value[k].length > 0 && (c[k] = {
|
|
2878
|
+
periods: l.value[k]
|
|
2879
|
+
}), c),
|
|
2821
2880
|
{}
|
|
2822
2881
|
);
|
|
2823
|
-
|
|
2882
|
+
u.value.workingHour = Object.keys(f).length > 0 ? f : void 0;
|
|
2824
2883
|
};
|
|
2825
|
-
return watch(
|
|
2826
|
-
const
|
|
2884
|
+
return watch(u, () => i("update:model-value", u.value), { deep: !0 }), watch(l, y, { deep: !0 }), (f, c) => {
|
|
2885
|
+
const k = resolveComponent("FmSelect"), V = resolveComponent("FmStepperField"), g = resolveComponent("FmCheckbox"), v = resolveComponent("FmTimePicker"), d = resolveComponent("FmButton");
|
|
2827
2886
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
2828
2887
|
createElementVNode("div", _hoisted_2$7, [
|
|
2829
|
-
createVNode(
|
|
2888
|
+
createVNode(k, {
|
|
2830
2889
|
label: unref(o)("connect.template.eaterType"),
|
|
2831
|
-
modelValue: unref(
|
|
2832
|
-
"onUpdate:modelValue":
|
|
2890
|
+
modelValue: unref(u).eaterType,
|
|
2891
|
+
"onUpdate:modelValue": c[0] || (c[0] = (p) => unref(u).eaterType = p),
|
|
2833
2892
|
items: [
|
|
2834
2893
|
{ label: unref(o)("connect.template.allEaters"), value: "all" },
|
|
2835
2894
|
{ label: unref(o)("connect.template.newEatersOnly"), value: "new" },
|
|
@@ -2840,9 +2899,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2840
2899
|
],
|
|
2841
2900
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
|
|
2842
2901
|
}, null, 8, ["label", "modelValue", "items", "rules"]),
|
|
2843
|
-
createVNode(
|
|
2844
|
-
modelValue: unref(
|
|
2845
|
-
"onUpdate:modelValue":
|
|
2902
|
+
createVNode(V, {
|
|
2903
|
+
modelValue: unref(u).minBasketAmount,
|
|
2904
|
+
"onUpdate:modelValue": c[1] || (c[1] = (p) => unref(u).minBasketAmount = p),
|
|
2846
2905
|
"show-steppers": !1,
|
|
2847
2906
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
|
|
2848
2907
|
}, {
|
|
@@ -2856,9 +2915,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2856
2915
|
]),
|
|
2857
2916
|
_: 1
|
|
2858
2917
|
}, 8, ["modelValue", "rules"]),
|
|
2859
|
-
createVNode(
|
|
2860
|
-
modelValue: unref(
|
|
2861
|
-
"onUpdate:modelValue":
|
|
2918
|
+
createVNode(V, {
|
|
2919
|
+
modelValue: unref(u).bundleQuantity,
|
|
2920
|
+
"onUpdate:modelValue": c[2] || (c[2] = (p) => unref(u).bundleQuantity = p),
|
|
2862
2921
|
"show-steppers": !1,
|
|
2863
2922
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
|
|
2864
2923
|
}, {
|
|
@@ -2876,46 +2935,46 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2876
2935
|
createElementVNode("div", _hoisted_3$5, [
|
|
2877
2936
|
createElementVNode("div", _hoisted_4$4, [
|
|
2878
2937
|
createElementVNode("div", _hoisted_5$4, toDisplayString(unref(o)("connect.template.operationHours")), 1),
|
|
2879
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(n, (
|
|
2880
|
-
key:
|
|
2938
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(n, (p) => createElementVNode("div", {
|
|
2939
|
+
key: p.key,
|
|
2881
2940
|
class: "space-y-2"
|
|
2882
2941
|
}, [
|
|
2883
2942
|
createElementVNode("div", _hoisted_6$3, [
|
|
2884
|
-
createVNode(
|
|
2885
|
-
label:
|
|
2886
|
-
"model-value": !!(unref(l)[
|
|
2943
|
+
createVNode(g, {
|
|
2944
|
+
label: p.label,
|
|
2945
|
+
"model-value": !!(unref(l)[p.key] && unref(l)[p.key].length > 0),
|
|
2887
2946
|
"onUpdate:modelValue": (C) => {
|
|
2888
|
-
C ? a(
|
|
2947
|
+
C ? a(p.key) : (unref(l)[p.key] = [], delete unref(l)[p.key], y());
|
|
2889
2948
|
}
|
|
2890
2949
|
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])
|
|
2891
2950
|
]),
|
|
2892
|
-
unref(l)[
|
|
2893
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[
|
|
2951
|
+
unref(l)[p.key] && unref(l)[p.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
|
|
2952
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[p.key] || [], (C, x) => (openBlock(), createElementBlock("div", {
|
|
2894
2953
|
key: x,
|
|
2895
2954
|
class: "flex items-center space-x-2 w-100"
|
|
2896
2955
|
}, [
|
|
2897
|
-
createVNode(
|
|
2956
|
+
createVNode(v, {
|
|
2898
2957
|
"model-value": C.startTime || "",
|
|
2899
|
-
"onUpdate:modelValue": (
|
|
2900
|
-
unref(l)[
|
|
2958
|
+
"onUpdate:modelValue": (N) => {
|
|
2959
|
+
unref(l)[p.key] && unref(l)[p.key][x] && (unref(l)[p.key][x].startTime = N || "", y());
|
|
2901
2960
|
}
|
|
2902
2961
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2903
|
-
|
|
2904
|
-
createVNode(
|
|
2962
|
+
c[3] || (c[3] = createElementVNode("span", null, "to", -1)),
|
|
2963
|
+
createVNode(v, {
|
|
2905
2964
|
"model-value": C.endTime || "",
|
|
2906
|
-
"onUpdate:modelValue": (
|
|
2907
|
-
unref(l)[
|
|
2965
|
+
"onUpdate:modelValue": (N) => {
|
|
2966
|
+
unref(l)[p.key] && unref(l)[p.key][x] && (unref(l)[p.key][x].endTime = N || "", y());
|
|
2908
2967
|
}
|
|
2909
2968
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
2910
|
-
createVNode(
|
|
2969
|
+
createVNode(d, {
|
|
2911
2970
|
variant: "tertiary",
|
|
2912
2971
|
size: "sm",
|
|
2913
|
-
onClick: (
|
|
2972
|
+
onClick: (N) => s(p.key, x),
|
|
2914
2973
|
icon: "close"
|
|
2915
2974
|
}, null, 8, ["onClick"]),
|
|
2916
|
-
x === 0 ? (openBlock(), createBlock(
|
|
2975
|
+
x === 0 ? (openBlock(), createBlock(d, {
|
|
2917
2976
|
key: 0,
|
|
2918
|
-
onClick: (
|
|
2977
|
+
onClick: (N) => a(p.key),
|
|
2919
2978
|
icon: "add",
|
|
2920
2979
|
variant: "plain"
|
|
2921
2980
|
}, null, 8, ["onClick"])) : createCommentVNode("", !0)
|
|
@@ -2935,19 +2994,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2935
2994
|
},
|
|
2936
2995
|
schema: {
|
|
2937
2996
|
type: Object,
|
|
2938
|
-
default: () => z
|
|
2997
|
+
default: () => z.any()
|
|
2939
2998
|
}
|
|
2940
2999
|
},
|
|
2941
3000
|
emits: ["update:model-value"],
|
|
2942
|
-
setup(e, { emit:
|
|
2943
|
-
const { t: o } = useI18n(),
|
|
2944
|
-
return watch(
|
|
3001
|
+
setup(e, { emit: r }) {
|
|
3002
|
+
const { t: o } = useI18n(), m = e, i = r, u = ref(m.modelValue ?? {});
|
|
3003
|
+
return watch(u, () => i("update:model-value", u.value)), (l, n) => {
|
|
2945
3004
|
const a = resolveComponent("FmStepperField");
|
|
2946
3005
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2947
3006
|
createElementVNode("div", _hoisted_2$6, [
|
|
2948
3007
|
createVNode(a, {
|
|
2949
|
-
modelValue: unref(
|
|
2950
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
3008
|
+
modelValue: unref(u).totalCount,
|
|
3009
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => unref(u).totalCount = s),
|
|
2951
3010
|
"show-steppers": !1,
|
|
2952
3011
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCount")]
|
|
2953
3012
|
}, {
|
|
@@ -2962,8 +3021,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2962
3021
|
_: 1
|
|
2963
3022
|
}, 8, ["modelValue", "rules"]),
|
|
2964
3023
|
createVNode(a, {
|
|
2965
|
-
modelValue: unref(
|
|
2966
|
-
"onUpdate:modelValue": n[1] || (n[1] = (
|
|
3024
|
+
modelValue: unref(u).totalCountPerUser,
|
|
3025
|
+
"onUpdate:modelValue": n[1] || (n[1] = (s) => unref(u).totalCountPerUser = s),
|
|
2967
3026
|
"show-steppers": !1,
|
|
2968
3027
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "totalCountPerUser")]
|
|
2969
3028
|
}, {
|
|
@@ -2989,8 +3048,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2989
3048
|
}
|
|
2990
3049
|
},
|
|
2991
3050
|
emits: ["update:model-value"],
|
|
2992
|
-
setup(e, { emit:
|
|
2993
|
-
const { t: o } = useI18n(),
|
|
3051
|
+
setup(e, { emit: r }) {
|
|
3052
|
+
const { t: o } = useI18n(), m = e, i = r, u = computed(() => [
|
|
2994
3053
|
{
|
|
2995
3054
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
2996
3055
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -3007,21 +3066,21 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3007
3066
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
3008
3067
|
createElementVNode("div", _hoisted_2$5, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
3009
3068
|
createElementVNode("div", _hoisted_3$4, [
|
|
3010
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3069
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (s) => (openBlock(), createBlock(a, {
|
|
3011
3070
|
variant: "outlined",
|
|
3012
3071
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
3013
|
-
"col-span-2": unref(
|
|
3014
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
3015
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
3072
|
+
"col-span-2": unref(u).length == 1,
|
|
3073
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == s.value,
|
|
3074
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != s.value
|
|
3016
3075
|
}]),
|
|
3017
3076
|
onClick: () => {
|
|
3018
|
-
|
|
3077
|
+
m.modelValue != s.value && i("update:model-value", s.value);
|
|
3019
3078
|
},
|
|
3020
|
-
key:
|
|
3079
|
+
key: s.value
|
|
3021
3080
|
}, {
|
|
3022
3081
|
default: withCtx(() => [
|
|
3023
|
-
createElementVNode("div", _hoisted_4$3, toDisplayString(
|
|
3024
|
-
createElementVNode("div", _hoisted_5$3, toDisplayString(
|
|
3082
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(s.label), 1),
|
|
3083
|
+
createElementVNode("div", _hoisted_5$3, toDisplayString(s.description), 1)
|
|
3025
3084
|
]),
|
|
3026
3085
|
_: 2
|
|
3027
3086
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -3043,13 +3102,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3043
3102
|
}
|
|
3044
3103
|
},
|
|
3045
3104
|
emits: ["update:model-value"],
|
|
3046
|
-
setup(e, { emit:
|
|
3047
|
-
const o =
|
|
3048
|
-
return (
|
|
3049
|
-
const
|
|
3105
|
+
setup(e, { emit: r }) {
|
|
3106
|
+
const o = r;
|
|
3107
|
+
return (m, i) => {
|
|
3108
|
+
const u = resolveComponent("FmStepperField");
|
|
3050
3109
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
3051
3110
|
i[1] || (i[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
|
|
3052
|
-
createVNode(
|
|
3111
|
+
createVNode(u, {
|
|
3053
3112
|
label: "Maximum to collect",
|
|
3054
3113
|
"model-value": e.modelValue || null,
|
|
3055
3114
|
"onUpdate:modelValue": i[0] || (i[0] = (l) => o("update:model-value", l)),
|
|
@@ -3068,29 +3127,29 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3068
3127
|
}
|
|
3069
3128
|
},
|
|
3070
3129
|
emits: ["update:model-value"],
|
|
3071
|
-
setup(e, { expose:
|
|
3072
|
-
const
|
|
3073
|
-
var
|
|
3074
|
-
return ((
|
|
3075
|
-
(
|
|
3130
|
+
setup(e, { expose: r, emit: o }) {
|
|
3131
|
+
const m = e, i = useMembershipStore(), { minor: u } = useLoading, l = ref(!1), n = ref(), a = ref(), s = ref(0), y = computed(() => {
|
|
3132
|
+
var d;
|
|
3133
|
+
return ((d = i.loyaltyRewards.items.find(
|
|
3134
|
+
(p) => {
|
|
3076
3135
|
var C;
|
|
3077
|
-
return
|
|
3136
|
+
return p.value === ((C = n.value) == null ? void 0 : C.collectible);
|
|
3078
3137
|
}
|
|
3079
|
-
)) == null ? void 0 :
|
|
3080
|
-
}),
|
|
3081
|
-
const
|
|
3082
|
-
return
|
|
3138
|
+
)) == null ? void 0 : d.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
3139
|
+
}), f = computed(() => {
|
|
3140
|
+
const v = y.value.safeParse(n.value);
|
|
3141
|
+
return v.success ? [] : v.error.errors;
|
|
3083
3142
|
});
|
|
3084
|
-
function
|
|
3085
|
-
|
|
3143
|
+
function c(v, d, p) {
|
|
3144
|
+
v && (n.value = d, s.value = p), l.value = v;
|
|
3086
3145
|
}
|
|
3087
|
-
const
|
|
3088
|
-
async function
|
|
3089
|
-
const
|
|
3090
|
-
|
|
3146
|
+
const k = o;
|
|
3147
|
+
async function V() {
|
|
3148
|
+
const v = y.value.safeParse(n.value);
|
|
3149
|
+
v.success && (await u(
|
|
3091
3150
|
async () => {
|
|
3092
|
-
|
|
3093
|
-
|
|
3151
|
+
v.data.type === "VOUCHER" && a.value && (v.data.collectibleConfig.image = await firebaseStorage.update(
|
|
3152
|
+
v.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
3094
3153
|
a.value
|
|
3095
3154
|
));
|
|
3096
3155
|
},
|
|
@@ -3098,40 +3157,40 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3098
3157
|
message: "Uploading reward image",
|
|
3099
3158
|
successMessage: "Reward image updated"
|
|
3100
3159
|
}
|
|
3101
|
-
),
|
|
3160
|
+
), k("update:model-value", v.data, s.value));
|
|
3102
3161
|
}
|
|
3103
|
-
const
|
|
3104
|
-
return
|
|
3105
|
-
showSheet:
|
|
3106
|
-
}), (
|
|
3107
|
-
const
|
|
3108
|
-
return openBlock(), createBlock(
|
|
3162
|
+
const g = ref();
|
|
3163
|
+
return r({
|
|
3164
|
+
showSheet: c
|
|
3165
|
+
}), (v, d) => {
|
|
3166
|
+
const p = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), x = resolveComponent("FmForm"), N = resolveComponent("FmButton"), w = resolveComponent("FmSideSheet");
|
|
3167
|
+
return openBlock(), createBlock(w, {
|
|
3109
3168
|
"max-width": 560,
|
|
3110
3169
|
modelValue: unref(l),
|
|
3111
3170
|
"onUpdate:modelValue": [
|
|
3112
|
-
|
|
3113
|
-
|
|
3171
|
+
d[10] || (d[10] = ($) => isRef(l) ? l.value = $ : null),
|
|
3172
|
+
d[11] || (d[11] = ($) => l.value = $)
|
|
3114
3173
|
],
|
|
3115
3174
|
header: "Edit reward",
|
|
3116
3175
|
"dismiss-away": ""
|
|
3117
3176
|
}, {
|
|
3118
3177
|
"side-sheet-footer": withCtx(() => [
|
|
3119
3178
|
createElementVNode("div", _hoisted_1$6, [
|
|
3120
|
-
createVNode(
|
|
3179
|
+
createVNode(N, {
|
|
3121
3180
|
variant: "primary",
|
|
3122
3181
|
type: "button",
|
|
3123
3182
|
label: "Confirm",
|
|
3124
|
-
disabled: unref(
|
|
3125
|
-
onClick:
|
|
3126
|
-
var
|
|
3127
|
-
return (
|
|
3183
|
+
disabled: unref(f).length > 0,
|
|
3184
|
+
onClick: d[8] || (d[8] = async () => {
|
|
3185
|
+
var $;
|
|
3186
|
+
return ($ = unref(g)) == null ? void 0 : $.validateInputs();
|
|
3128
3187
|
})
|
|
3129
3188
|
}, null, 8, ["disabled"]),
|
|
3130
|
-
createVNode(
|
|
3189
|
+
createVNode(N, {
|
|
3131
3190
|
variant: "secondary",
|
|
3132
3191
|
type: "button",
|
|
3133
3192
|
label: "Cancel",
|
|
3134
|
-
onClick:
|
|
3193
|
+
onClick: d[9] || (d[9] = ($) => l.value = !1)
|
|
3135
3194
|
})
|
|
3136
3195
|
])
|
|
3137
3196
|
]),
|
|
@@ -3141,27 +3200,27 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3141
3200
|
key: 0,
|
|
3142
3201
|
class: "flex flex-col gap-y-24",
|
|
3143
3202
|
ref_key: "formRef",
|
|
3144
|
-
ref:
|
|
3145
|
-
onValidationSuccess:
|
|
3203
|
+
ref: g,
|
|
3204
|
+
onValidationSuccess: d[7] || (d[7] = ($) => V())
|
|
3146
3205
|
}, {
|
|
3147
3206
|
default: withCtx(() => {
|
|
3148
|
-
var
|
|
3207
|
+
var $, T;
|
|
3149
3208
|
return [
|
|
3150
|
-
unref(n).type ? (openBlock(), createBlock(
|
|
3209
|
+
unref(n).type ? (openBlock(), createBlock(p, {
|
|
3151
3210
|
key: 0,
|
|
3152
3211
|
label: "Threshold",
|
|
3153
3212
|
rules: [
|
|
3154
3213
|
unref(ZodHelper).toRule(
|
|
3155
|
-
unref(z
|
|
3156
|
-
|
|
3157
|
-
`Number cannot be more than ${
|
|
3214
|
+
unref(z).number().min(1).max(
|
|
3215
|
+
m.maxThreshold,
|
|
3216
|
+
`Number cannot be more than ${m.maxThreshold}`
|
|
3158
3217
|
)
|
|
3159
3218
|
)
|
|
3160
3219
|
],
|
|
3161
3220
|
"model-value": unref(n).threshold,
|
|
3162
|
-
"onUpdate:modelValue":
|
|
3221
|
+
"onUpdate:modelValue": d[0] || (d[0] = (R) => n.value = {
|
|
3163
3222
|
...unref(n),
|
|
3164
|
-
threshold:
|
|
3223
|
+
threshold: R
|
|
3165
3224
|
})
|
|
3166
3225
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
3167
3226
|
createVNode(C, {
|
|
@@ -3171,9 +3230,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3171
3230
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
3172
3231
|
],
|
|
3173
3232
|
"model-value": unref(n).type,
|
|
3174
|
-
"onUpdate:modelValue":
|
|
3175
|
-
var
|
|
3176
|
-
|
|
3233
|
+
"onUpdate:modelValue": d[1] || (d[1] = (R) => {
|
|
3234
|
+
var A, M;
|
|
3235
|
+
R === "VOUCHER" ? n.value = {
|
|
3177
3236
|
collectible: null,
|
|
3178
3237
|
type: "VOUCHER",
|
|
3179
3238
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -3186,7 +3245,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3186
3245
|
validityOption: {
|
|
3187
3246
|
validForDay: 7
|
|
3188
3247
|
},
|
|
3189
|
-
threshold: (
|
|
3248
|
+
threshold: (A = unref(n)) == null ? void 0 : A.threshold
|
|
3190
3249
|
} : n.value = {
|
|
3191
3250
|
collectible: unref(i).loyaltyRewards.raw[0]._id,
|
|
3192
3251
|
type: "LOYALTY",
|
|
@@ -3197,60 +3256,60 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3197
3256
|
validityOption: {
|
|
3198
3257
|
validForDay: 7
|
|
3199
3258
|
},
|
|
3200
|
-
threshold: (
|
|
3259
|
+
threshold: (M = unref(n)) == null ? void 0 : M.threshold
|
|
3201
3260
|
};
|
|
3202
3261
|
})
|
|
3203
3262
|
}, null, 8, ["model-value"]),
|
|
3204
3263
|
unref(n).type == "LOYALTY" ? (openBlock(), createBlock(C, {
|
|
3205
3264
|
key: 1,
|
|
3206
3265
|
label: "Loyalty type",
|
|
3207
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
3266
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(n).type])],
|
|
3208
3267
|
items: unref(i).loyaltyRewards.items,
|
|
3209
3268
|
"model-value": unref(n).collectible,
|
|
3210
|
-
"onUpdate:modelValue":
|
|
3269
|
+
"onUpdate:modelValue": d[2] || (d[2] = (R) => unref(n).collectible = R)
|
|
3211
3270
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
3212
3271
|
unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3213
|
-
|
|
3272
|
+
d[12] || (d[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
3214
3273
|
createVNode(_sfc_main$z, {
|
|
3215
3274
|
class: "mt-[-8px]",
|
|
3216
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
3217
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
3218
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
3275
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(n).type])],
|
|
3276
|
+
"helper-state": unref(ZodHelper).helperState(unref(f), "earningOption"),
|
|
3277
|
+
"error-text": unref(ZodHelper).helperText(unref(f), "earningOption"),
|
|
3219
3278
|
"fixed-type": !0,
|
|
3220
3279
|
"model-value": unref(n).earningOption,
|
|
3221
|
-
"onUpdate:modelValue":
|
|
3280
|
+
"onUpdate:modelValue": d[3] || (d[3] = (R) => n.value = {
|
|
3222
3281
|
...unref(n),
|
|
3223
|
-
earningOption:
|
|
3282
|
+
earningOption: R
|
|
3224
3283
|
})
|
|
3225
3284
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
3226
3285
|
createVNode(_sfc_main$A, {
|
|
3227
3286
|
class: "!gap-24",
|
|
3228
3287
|
type: unref(n).type === "LOYALTY" ? "custom" : "range",
|
|
3229
|
-
"for-credit": unref(n).type === "LOYALTY" && ((
|
|
3230
|
-
(
|
|
3231
|
-
var
|
|
3232
|
-
return
|
|
3288
|
+
"for-credit": unref(n).type === "LOYALTY" && (($ = unref(i).loyaltyRewards.items.find(
|
|
3289
|
+
(R) => {
|
|
3290
|
+
var A;
|
|
3291
|
+
return R.value === ((A = unref(n)) == null ? void 0 : A.collectible);
|
|
3233
3292
|
}
|
|
3234
|
-
)) == null ? void 0 :
|
|
3235
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
3293
|
+
)) == null ? void 0 : $.raw.type) === "CREDIT",
|
|
3294
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(n).type])],
|
|
3236
3295
|
"model-value": unref(n).validityOption,
|
|
3237
|
-
"onUpdate:modelValue":
|
|
3296
|
+
"onUpdate:modelValue": d[4] || (d[4] = (R) => n.value = {
|
|
3238
3297
|
...unref(n),
|
|
3239
|
-
validityOption:
|
|
3298
|
+
validityOption: R
|
|
3240
3299
|
})
|
|
3241
3300
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
3242
3301
|
], 64)) : createCommentVNode("", !0),
|
|
3243
3302
|
unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$B, {
|
|
3244
3303
|
key: 3,
|
|
3245
3304
|
"reward-image": unref(a),
|
|
3246
|
-
"model-value": ((
|
|
3247
|
-
"onUpdate:modelValue":
|
|
3305
|
+
"model-value": ((T = unref(n)) == null ? void 0 : T.collectibleConfig) ?? void 0,
|
|
3306
|
+
"onUpdate:modelValue": d[5] || (d[5] = (R) => n.value = {
|
|
3248
3307
|
...unref(n),
|
|
3249
|
-
collectibleConfig:
|
|
3308
|
+
collectibleConfig: R
|
|
3250
3309
|
}),
|
|
3251
|
-
"onUpdate:rewardImage":
|
|
3310
|
+
"onUpdate:rewardImage": d[6] || (d[6] = (R) => a.value = R)
|
|
3252
3311
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
3253
|
-
createVNode(JsonViewer, { json: unref(
|
|
3312
|
+
createVNode(JsonViewer, { json: unref(f) }, null, 8, ["json"])
|
|
3254
3313
|
];
|
|
3255
3314
|
}),
|
|
3256
3315
|
_: 1
|
|
@@ -3284,19 +3343,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3284
3343
|
}
|
|
3285
3344
|
},
|
|
3286
3345
|
setup(e) {
|
|
3287
|
-
const
|
|
3288
|
-
() => Math.min(
|
|
3346
|
+
const r = e, { maxRange: o, currentRange: m, markers: i } = toRefs(r), u = computed(
|
|
3347
|
+
() => Math.min(m.value / o.value * 100, 100)
|
|
3289
3348
|
), l = (n) => n / o.value * 100;
|
|
3290
3349
|
return (n, a) => {
|
|
3291
|
-
const
|
|
3350
|
+
const s = resolveComponent("FmIcon");
|
|
3292
3351
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
3293
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (
|
|
3352
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (y) => (openBlock(), createBlock(s, {
|
|
3294
3353
|
class: normalizeClass(
|
|
3295
|
-
unref(
|
|
3354
|
+
unref(m) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
3296
3355
|
),
|
|
3297
|
-
outline: unref(
|
|
3298
|
-
key:
|
|
3299
|
-
name: unref(i).some((
|
|
3356
|
+
outline: unref(m) < y,
|
|
3357
|
+
key: y,
|
|
3358
|
+
name: unref(i).some((f) => f === y) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
3300
3359
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
3301
3360
|
])) : (openBlock(), createElementBlock("div", {
|
|
3302
3361
|
key: 1,
|
|
@@ -3304,12 +3363,12 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3304
3363
|
}, [
|
|
3305
3364
|
createElementVNode("div", {
|
|
3306
3365
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
3307
|
-
style: normalizeStyle({ width: unref(
|
|
3366
|
+
style: normalizeStyle({ width: unref(u) + "%" })
|
|
3308
3367
|
}, null, 4),
|
|
3309
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (
|
|
3310
|
-
key:
|
|
3368
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (y, f) => (openBlock(), createElementBlock("div", {
|
|
3369
|
+
key: f,
|
|
3311
3370
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
3312
|
-
style: normalizeStyle({ left: l(
|
|
3371
|
+
style: normalizeStyle({ left: l(y) + "%" })
|
|
3313
3372
|
}, [
|
|
3314
3373
|
createElementVNode("div", _hoisted_2$4, [
|
|
3315
3374
|
createElementVNode("div", {
|
|
@@ -3323,16 +3382,16 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
3323
3382
|
}
|
|
3324
3383
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
3325
3384
|
function changeKeysFactory(e) {
|
|
3326
|
-
return function
|
|
3327
|
-
if (
|
|
3385
|
+
return function r(o, m = 1, i) {
|
|
3386
|
+
if (m === 0 || !isObject(o))
|
|
3328
3387
|
return o;
|
|
3329
3388
|
if (Array.isArray(o))
|
|
3330
|
-
return o.map((l) =>
|
|
3331
|
-
const
|
|
3389
|
+
return o.map((l) => r(l, m - 1, i));
|
|
3390
|
+
const u = Object.create(Object.getPrototypeOf(o));
|
|
3332
3391
|
return Object.keys(o).forEach((l) => {
|
|
3333
|
-
const n = o[l], a = e(l, i),
|
|
3334
|
-
|
|
3335
|
-
}),
|
|
3392
|
+
const n = o[l], a = e(l, i), s = r(n, m - 1, i);
|
|
3393
|
+
u[a] = s;
|
|
3394
|
+
}), u;
|
|
3336
3395
|
};
|
|
3337
3396
|
}
|
|
3338
3397
|
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$2 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
@@ -3348,50 +3407,50 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3348
3407
|
}
|
|
3349
3408
|
},
|
|
3350
3409
|
emits: ["update:model-value"],
|
|
3351
|
-
setup(e, { emit:
|
|
3352
|
-
const { t: o } = useI18n(),
|
|
3353
|
-
() =>
|
|
3410
|
+
setup(e, { emit: r }) {
|
|
3411
|
+
const { t: o } = useI18n(), m = e, i = r, u = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), n = computed(
|
|
3412
|
+
() => m.modelValue.sort((v, d) => v.threshold - d.threshold) ?? []
|
|
3354
3413
|
), a = computed(() => {
|
|
3355
|
-
const
|
|
3356
|
-
return
|
|
3357
|
-
}),
|
|
3358
|
-
function
|
|
3414
|
+
const v = l.safeParse(n.value);
|
|
3415
|
+
return v.success ? [] : v.error.errors;
|
|
3416
|
+
}), s = ref();
|
|
3417
|
+
function y(v, d) {
|
|
3359
3418
|
var C;
|
|
3360
|
-
const
|
|
3361
|
-
|
|
3419
|
+
const p = [...n.value];
|
|
3420
|
+
p[d] = v, (C = s.value) == null || C.showSheet(!1), i("update:model-value", p);
|
|
3362
3421
|
}
|
|
3363
|
-
function v
|
|
3364
|
-
const
|
|
3365
|
-
(x) => x._id.toString() ==
|
|
3366
|
-
),
|
|
3367
|
-
threshold:
|
|
3368
|
-
amount:
|
|
3422
|
+
function f(v) {
|
|
3423
|
+
const d = v.type == "VOUCHER" ? v.collectibleConfig : u.collectibles.find(
|
|
3424
|
+
(x) => x._id.toString() == v.collectible
|
|
3425
|
+
), p = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), C = v.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
3426
|
+
threshold: v.threshold,
|
|
3427
|
+
amount: v.earningOption.amount
|
|
3369
3428
|
}) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
3370
|
-
threshold:
|
|
3371
|
-
amount:
|
|
3372
|
-
every:
|
|
3429
|
+
threshold: v.threshold,
|
|
3430
|
+
amount: v.earningOption.amount,
|
|
3431
|
+
every: v.earningOption.every
|
|
3373
3432
|
});
|
|
3374
3433
|
return {
|
|
3375
|
-
label: isNullOrEmpty(
|
|
3434
|
+
label: isNullOrEmpty(p) ? o("connect.template.mission_pool.no_reward") : p,
|
|
3376
3435
|
sublabel: C
|
|
3377
3436
|
};
|
|
3378
3437
|
}
|
|
3379
|
-
function
|
|
3380
|
-
var
|
|
3381
|
-
const
|
|
3382
|
-
(
|
|
3438
|
+
function c(v) {
|
|
3439
|
+
var p;
|
|
3440
|
+
const d = [...n.value];
|
|
3441
|
+
(p = s.value) == null || p.showSheet(!0, d[v], v);
|
|
3383
3442
|
}
|
|
3384
|
-
function
|
|
3385
|
-
const
|
|
3386
|
-
|
|
3443
|
+
function k(v) {
|
|
3444
|
+
const d = [...n.value];
|
|
3445
|
+
d.splice(v, 1), i("update:model-value", d);
|
|
3387
3446
|
}
|
|
3388
|
-
function
|
|
3389
|
-
var
|
|
3390
|
-
(
|
|
3447
|
+
function V() {
|
|
3448
|
+
var v;
|
|
3449
|
+
(v = s.value) == null || v.showSheet(
|
|
3391
3450
|
!0,
|
|
3392
3451
|
{
|
|
3393
3452
|
type: "LOYALTY",
|
|
3394
|
-
collectible:
|
|
3453
|
+
collectible: u.loyaltyRewards.items[0].value,
|
|
3395
3454
|
threshold: null,
|
|
3396
3455
|
validityOption: {
|
|
3397
3456
|
validForDay: 7
|
|
@@ -3404,46 +3463,46 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3404
3463
|
n.value.length
|
|
3405
3464
|
);
|
|
3406
3465
|
}
|
|
3407
|
-
function
|
|
3408
|
-
var
|
|
3409
|
-
return
|
|
3410
|
-
((
|
|
3411
|
-
(C) => C.value ==
|
|
3412
|
-
)) == null ? void 0 :
|
|
3466
|
+
function g(v) {
|
|
3467
|
+
var d, p;
|
|
3468
|
+
return v.type == "VOUCHER" ? (d = v.collectibleConfig) == null ? void 0 : d.name : sentenceCase(
|
|
3469
|
+
((p = u.loyaltyRewards.items.find(
|
|
3470
|
+
(C) => C.value == v.collectible
|
|
3471
|
+
)) == null ? void 0 : p.label) || ""
|
|
3413
3472
|
);
|
|
3414
3473
|
}
|
|
3415
|
-
return (
|
|
3416
|
-
const
|
|
3474
|
+
return (v, d) => {
|
|
3475
|
+
const p = resolveComponent("FmButton"), C = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
|
|
3417
3476
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
3418
3477
|
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
|
|
3419
|
-
createVNode(
|
|
3478
|
+
createVNode(p, {
|
|
3420
3479
|
label: unref(o)("connect.template.mission_pool.add_reward"),
|
|
3421
|
-
onClick:
|
|
3480
|
+
onClick: d[0] || (d[0] = (N) => V()),
|
|
3422
3481
|
variant: "plain",
|
|
3423
3482
|
icon: "add"
|
|
3424
3483
|
}, null, 8, ["label"]),
|
|
3425
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (
|
|
3426
|
-
key:
|
|
3484
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (N, w) => (openBlock(), createBlock(C, {
|
|
3485
|
+
key: w,
|
|
3427
3486
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
3428
3487
|
variant: "outlined",
|
|
3429
|
-
onClick: (
|
|
3488
|
+
onClick: ($) => c(w)
|
|
3430
3489
|
}, {
|
|
3431
3490
|
default: withCtx(() => [
|
|
3432
3491
|
createElementVNode("div", null, [
|
|
3433
|
-
createElementVNode("div", _hoisted_3$3, toDisplayString(
|
|
3434
|
-
createElementVNode("div", _hoisted_4$2, toDisplayString(
|
|
3492
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(f(N).label), 1),
|
|
3493
|
+
createElementVNode("div", _hoisted_4$2, toDisplayString(f(N).sublabel), 1)
|
|
3435
3494
|
]),
|
|
3436
|
-
createVNode(
|
|
3495
|
+
createVNode(p, {
|
|
3437
3496
|
icon: "delete",
|
|
3438
3497
|
variant: "tertiary",
|
|
3439
|
-
onClick: (
|
|
3498
|
+
onClick: ($) => ($.stopPropagation(), k(w))
|
|
3440
3499
|
}, null, 8, ["onClick"])
|
|
3441
3500
|
]),
|
|
3442
3501
|
_: 2
|
|
3443
3502
|
}, 1032, ["onClick"]))), 128)),
|
|
3444
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((
|
|
3445
|
-
key:
|
|
3446
|
-
text:
|
|
3503
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a).filter((N) => N.path.join(".") == ""), (N) => (openBlock(), createBlock(x, {
|
|
3504
|
+
key: N.message,
|
|
3505
|
+
text: N.message,
|
|
3447
3506
|
state: "error"
|
|
3448
3507
|
}, null, 8, ["text"]))), 128)),
|
|
3449
3508
|
createElementVNode("div", _hoisted_5$2, toDisplayString(unref(o)("connect.template.mission_pool.preview")), 1),
|
|
@@ -3453,11 +3512,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3453
3512
|
class: "p-24 space-y-16 w-fit"
|
|
3454
3513
|
}, {
|
|
3455
3514
|
default: withCtx(() => {
|
|
3456
|
-
var
|
|
3515
|
+
var N, w;
|
|
3457
3516
|
return [
|
|
3458
3517
|
createElementVNode("div", _hoisted_6$2, [
|
|
3459
3518
|
createElementVNode("div", null, [
|
|
3460
|
-
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((
|
|
3519
|
+
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((N = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : N.earningOption.amount) > 1 ? (w = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : w.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? g(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
3461
3520
|
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
|
|
3462
3521
|
])
|
|
3463
3522
|
]),
|
|
@@ -3466,7 +3525,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3466
3525
|
type: e.mission.type,
|
|
3467
3526
|
"max-range": e.mission.end,
|
|
3468
3527
|
currentRange: e.mission.end / 4,
|
|
3469
|
-
markers: e.modelValue.map((
|
|
3528
|
+
markers: e.modelValue.map(($) => $.threshold)
|
|
3470
3529
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
3471
3530
|
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
3472
3531
|
])
|
|
@@ -3476,8 +3535,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3476
3535
|
})),
|
|
3477
3536
|
createVNode(_sfc_main$6, {
|
|
3478
3537
|
ref_key: "sheetRef",
|
|
3479
|
-
ref:
|
|
3480
|
-
"onUpdate:modelValue":
|
|
3538
|
+
ref: s,
|
|
3539
|
+
"onUpdate:modelValue": y,
|
|
3481
3540
|
"max-threshold": e.mission.end
|
|
3482
3541
|
}, null, 8, ["max-threshold"])
|
|
3483
3542
|
]);
|
|
@@ -3489,11 +3548,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3489
3548
|
modelValue: Object
|
|
3490
3549
|
},
|
|
3491
3550
|
emits: ["update:model-value"],
|
|
3492
|
-
setup(e, { emit:
|
|
3493
|
-
const { t: o } = useI18n(),
|
|
3494
|
-
const n = FdoMission.safeParse(
|
|
3551
|
+
setup(e, { emit: r }) {
|
|
3552
|
+
const { t: o } = useI18n(), m = e, i = computed(() => {
|
|
3553
|
+
const n = FdoMission.safeParse(m.modelValue);
|
|
3495
3554
|
return n.success ? [] : n.error.errors;
|
|
3496
|
-
}),
|
|
3555
|
+
}), u = computed(() => [
|
|
3497
3556
|
{
|
|
3498
3557
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
3499
3558
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -3504,37 +3563,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3504
3563
|
description: o("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
|
|
3505
3564
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
3506
3565
|
}
|
|
3507
|
-
]), l =
|
|
3566
|
+
]), l = r;
|
|
3508
3567
|
return (n, a) => {
|
|
3509
|
-
var
|
|
3510
|
-
const
|
|
3568
|
+
var f;
|
|
3569
|
+
const s = resolveComponent("FmCard"), y = resolveComponent("FmStepperField");
|
|
3511
3570
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
3512
3571
|
createElementVNode("div", _hoisted_2$2, [
|
|
3513
3572
|
createElementVNode("div", _hoisted_3$2, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
|
|
3514
3573
|
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
3515
3574
|
createElementVNode("div", _hoisted_5$1, [
|
|
3516
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
3517
|
-
var
|
|
3518
|
-
return openBlock(), createBlock(
|
|
3575
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (c) => {
|
|
3576
|
+
var k, V;
|
|
3577
|
+
return openBlock(), createBlock(s, {
|
|
3519
3578
|
variant: "outlined",
|
|
3520
3579
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
3521
|
-
"col-span-2": unref(
|
|
3522
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
3523
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
3580
|
+
"col-span-2": unref(u).length == 1,
|
|
3581
|
+
"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) == c.value,
|
|
3582
|
+
"hover:bg-fm-color-opacity-sm": ((V = e.modelValue) == null ? void 0 : V.type) != c.value
|
|
3524
3583
|
}]),
|
|
3525
3584
|
onClick: () => {
|
|
3526
|
-
var
|
|
3527
|
-
((
|
|
3585
|
+
var g, v;
|
|
3586
|
+
((g = e.modelValue) == null ? void 0 : g.type) != c.value && l("update:model-value", {
|
|
3528
3587
|
...e.modelValue,
|
|
3529
|
-
type:
|
|
3530
|
-
end: ((
|
|
3588
|
+
type: c.value,
|
|
3589
|
+
end: ((v = e.modelValue) == null ? void 0 : v.end) || 1
|
|
3531
3590
|
});
|
|
3532
3591
|
},
|
|
3533
|
-
key:
|
|
3592
|
+
key: c.value
|
|
3534
3593
|
}, {
|
|
3535
3594
|
default: withCtx(() => [
|
|
3536
|
-
createElementVNode("div", _hoisted_6$1, toDisplayString(
|
|
3537
|
-
createElementVNode("div", _hoisted_7$1, toDisplayString(
|
|
3595
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(c.label), 1),
|
|
3596
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(c.description), 1)
|
|
3538
3597
|
]),
|
|
3539
3598
|
_: 2
|
|
3540
3599
|
}, 1032, ["class", "onClick"]);
|
|
@@ -3544,15 +3603,15 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3544
3603
|
createElementVNode("div", _hoisted_8$1, [
|
|
3545
3604
|
createElementVNode("div", _hoisted_9$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequired")), 1),
|
|
3546
3605
|
createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
|
|
3547
|
-
createVNode(
|
|
3606
|
+
createVNode(y, {
|
|
3548
3607
|
label: unref(o)("connect.campaign.mission.maximumToCollect"),
|
|
3549
|
-
"model-value": ((
|
|
3550
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
3551
|
-
var
|
|
3608
|
+
"model-value": ((f = e.modelValue) == null ? void 0 : f.end) || null,
|
|
3609
|
+
"onUpdate:modelValue": a[0] || (a[0] = (c) => {
|
|
3610
|
+
var k;
|
|
3552
3611
|
return l("update:model-value", {
|
|
3553
3612
|
...e.modelValue,
|
|
3554
|
-
type: ((
|
|
3555
|
-
end:
|
|
3613
|
+
type: ((k = e.modelValue) == null ? void 0 : k.type) || "STAMP",
|
|
3614
|
+
end: c
|
|
3556
3615
|
});
|
|
3557
3616
|
}),
|
|
3558
3617
|
"helper-text": unref(ZodHelper).helperText(unref(i), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
|
|
@@ -3564,15 +3623,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
3564
3623
|
}
|
|
3565
3624
|
});
|
|
3566
3625
|
function useLocaleText() {
|
|
3567
|
-
const { locale: e, t:
|
|
3568
|
-
function o(
|
|
3569
|
-
return
|
|
3626
|
+
const { locale: e, t: r } = useI18n();
|
|
3627
|
+
function o(m, i) {
|
|
3628
|
+
return m ? m[e.value] ?? m["en-US"] ?? r(i) : r(i);
|
|
3570
3629
|
}
|
|
3571
3630
|
return { getLocaleText: o };
|
|
3572
3631
|
}
|
|
3573
3632
|
const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3574
3633
|
__name: "TemplateInput",
|
|
3575
3634
|
props: {
|
|
3635
|
+
pushAvailability: {
|
|
3636
|
+
type: String,
|
|
3637
|
+
default: "checking"
|
|
3638
|
+
},
|
|
3576
3639
|
field: { type: Object, required: !0 },
|
|
3577
3640
|
modelValue: {
|
|
3578
3641
|
type: Object
|
|
@@ -3600,40 +3663,40 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3600
3663
|
default: !0
|
|
3601
3664
|
}
|
|
3602
3665
|
},
|
|
3603
|
-
emits: ["update:model-value", "update:file"],
|
|
3604
|
-
setup(e, { emit:
|
|
3605
|
-
const { t: o } = useI18n(), { getLocaleText:
|
|
3606
|
-
function l(
|
|
3666
|
+
emits: ["retry-push", "update:model-value", "update:file"],
|
|
3667
|
+
setup(e, { emit: r }) {
|
|
3668
|
+
const { t: o } = useI18n(), { getLocaleText: m } = useLocaleText(), i = e, u = r;
|
|
3669
|
+
function l(y) {
|
|
3607
3670
|
switch (i.field.type) {
|
|
3608
3671
|
case "timeframe":
|
|
3609
|
-
const
|
|
3610
|
-
|
|
3672
|
+
const f = y.startDate ? hooks(y.startDate).startOf("day").toISOString() : void 0, c = y.endDate ? hooks(y.endDate).endOf("day").toISOString() : void 0;
|
|
3673
|
+
u("update:model-value", {
|
|
3611
3674
|
type: "timeframe",
|
|
3612
3675
|
property: "__now",
|
|
3613
|
-
start:
|
|
3614
|
-
end:
|
|
3676
|
+
start: f,
|
|
3677
|
+
end: c
|
|
3615
3678
|
});
|
|
3616
3679
|
break;
|
|
3617
3680
|
case "image": {
|
|
3618
|
-
|
|
3681
|
+
u(
|
|
3619
3682
|
"update:file",
|
|
3620
|
-
|
|
3621
|
-
n.value || firebaseStorage.collectibleImagePath(void 0,
|
|
3683
|
+
y,
|
|
3684
|
+
n.value || firebaseStorage.collectibleImagePath(void 0, y)
|
|
3622
3685
|
);
|
|
3623
3686
|
break;
|
|
3624
3687
|
}
|
|
3625
3688
|
default:
|
|
3626
|
-
|
|
3689
|
+
u("update:model-value", y);
|
|
3627
3690
|
break;
|
|
3628
3691
|
}
|
|
3629
3692
|
}
|
|
3630
3693
|
const n = computed(() => {
|
|
3631
3694
|
switch (i.field.type) {
|
|
3632
3695
|
case "timeframe": {
|
|
3633
|
-
const
|
|
3696
|
+
const y = i.modelValue;
|
|
3634
3697
|
return {
|
|
3635
|
-
startDate:
|
|
3636
|
-
endDate:
|
|
3698
|
+
startDate: y != null && y.start ? hooks(y == null ? void 0 : y.start).format("YYYY-MM-DD") : null,
|
|
3699
|
+
endDate: y != null && y.end ? hooks(y == null ? void 0 : y.end).format("YYYY-MM-DD") : null
|
|
3637
3700
|
};
|
|
3638
3701
|
}
|
|
3639
3702
|
default:
|
|
@@ -3641,54 +3704,54 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3641
3704
|
}
|
|
3642
3705
|
});
|
|
3643
3706
|
function a() {
|
|
3644
|
-
if (!
|
|
3645
|
-
const
|
|
3646
|
-
return
|
|
3707
|
+
if (!s.value.schema) return [];
|
|
3708
|
+
const y = s.value.schema.safeParse(i.modelValue);
|
|
3709
|
+
return y.success ? [] : y.error.errors;
|
|
3647
3710
|
}
|
|
3648
|
-
const
|
|
3711
|
+
const s = computed(() => ({
|
|
3649
3712
|
schema: i.schema,
|
|
3650
3713
|
unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
|
|
3651
3714
|
rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
|
|
3652
3715
|
labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
|
|
3653
3716
|
zodLabel: i.schema ? ZodHelper.toInputLabel(
|
|
3654
3717
|
i.schema,
|
|
3655
|
-
|
|
3718
|
+
m(i.field.label_locale, i.field.label ?? "")
|
|
3656
3719
|
) : void 0
|
|
3657
3720
|
}));
|
|
3658
|
-
return (
|
|
3659
|
-
var
|
|
3660
|
-
const
|
|
3661
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
3721
|
+
return (y, f) => {
|
|
3722
|
+
var d, p, C, x, N;
|
|
3723
|
+
const c = resolveComponent("FmTextField"), k = resolveComponent("FmStepperField"), V = resolveComponent("FmTextarea"), g = resolveComponent("FmHelperText"), v = resolveComponent("FmSwitch");
|
|
3724
|
+
return e.field.type === "text" ? (openBlock(), createBlock(c, {
|
|
3662
3725
|
key: 0,
|
|
3663
|
-
label: unref(
|
|
3664
|
-
"label-mark": unref(
|
|
3665
|
-
rules: unref(
|
|
3726
|
+
label: unref(m)(e.field.label_locale, e.field.label ?? ""),
|
|
3727
|
+
"label-mark": unref(s).labelMark,
|
|
3728
|
+
rules: unref(s).rules,
|
|
3666
3729
|
"model-value": unref(n),
|
|
3667
3730
|
"onUpdate:modelValue": l,
|
|
3668
3731
|
"helper-state": e.helperText ? "error" : void 0,
|
|
3669
3732
|
"helper-text": e.helperText
|
|
3670
3733
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
3671
3734
|
createVNode(JsonViewer, {
|
|
3672
|
-
json: { schema: unref(
|
|
3735
|
+
json: { schema: unref(s).unwrapped, props: i }
|
|
3673
3736
|
}, null, 8, ["json"]),
|
|
3674
|
-
createVNode(
|
|
3675
|
-
label: unref(
|
|
3676
|
-
"label-mark": e.field.isRuleChildren ? void 0 : unref(
|
|
3737
|
+
createVNode(k, {
|
|
3738
|
+
label: unref(m)(e.field.label_locale, e.field.label ?? ""),
|
|
3739
|
+
"label-mark": e.field.isRuleChildren ? void 0 : unref(s).labelMark,
|
|
3677
3740
|
"model-value": unref(n),
|
|
3678
|
-
rules: e.field.isRuleChildren ? [] : unref(
|
|
3741
|
+
rules: e.field.isRuleChildren ? [] : unref(s).rules,
|
|
3679
3742
|
"onUpdate:modelValue": l,
|
|
3680
3743
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
3681
3744
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
3682
3745
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
3683
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
3746
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(V, {
|
|
3684
3747
|
key: 2,
|
|
3685
|
-
label: unref(
|
|
3686
|
-
"label-mark": unref(
|
|
3687
|
-
rules: unref(
|
|
3748
|
+
label: unref(m)(e.field.label_locale, e.field.label ?? ""),
|
|
3749
|
+
"label-mark": unref(s).labelMark,
|
|
3750
|
+
rules: unref(s).rules,
|
|
3688
3751
|
"model-value": unref(n),
|
|
3689
3752
|
"onUpdate:modelValue": l,
|
|
3690
3753
|
"show-word-count": "",
|
|
3691
|
-
"max-length": (
|
|
3754
|
+
"max-length": (N = (x = (C = (p = (d = unref(s)) == null ? void 0 : d.unwrapped) == null ? void 0 : p._def) == null ? void 0 : C.checks) == null ? void 0 : x.find((w) => w.kind == "max")) == null ? void 0 : N.value
|
|
3692
3755
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
3693
3756
|
key: 3,
|
|
3694
3757
|
"campaign-type": e.extras,
|
|
@@ -3700,7 +3763,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3700
3763
|
"model-value": unref(n),
|
|
3701
3764
|
"onUpdate:modelValue": l
|
|
3702
3765
|
}, null, 8, ["model-value"]),
|
|
3703
|
-
createVNode(
|
|
3766
|
+
createVNode(g, {
|
|
3704
3767
|
class: "!mt-[8px]",
|
|
3705
3768
|
text: unref(ZodHelper).helperText(a(), ""),
|
|
3706
3769
|
state: unref(ZodHelper).helperState(a(), "")
|
|
@@ -3713,16 +3776,16 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3713
3776
|
"onUpdate:file": l
|
|
3714
3777
|
}, {
|
|
3715
3778
|
label: withCtx(() => [
|
|
3716
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
3779
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(s).zodLabel)))
|
|
3717
3780
|
]),
|
|
3718
3781
|
_: 1
|
|
3719
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
3782
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(v, {
|
|
3720
3783
|
key: 6,
|
|
3721
|
-
label: unref(
|
|
3784
|
+
label: unref(m)(e.field.label_locale, e.field.label ?? ""),
|
|
3722
3785
|
"label-placement": "right",
|
|
3723
3786
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
3724
|
-
"label-mark": unref(
|
|
3725
|
-
rules: unref(
|
|
3787
|
+
"label-mark": unref(s).labelMark,
|
|
3788
|
+
rules: unref(s).rules,
|
|
3726
3789
|
"model-value": unref(n),
|
|
3727
3790
|
"onUpdate:modelValue": l
|
|
3728
3791
|
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$D, {
|
|
@@ -3730,18 +3793,18 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3730
3793
|
"model-value": unref(n),
|
|
3731
3794
|
"onUpdate:modelValue": l,
|
|
3732
3795
|
"no-campaign": !1,
|
|
3733
|
-
schema: unref(
|
|
3796
|
+
schema: unref(s).schema,
|
|
3734
3797
|
"is-mission": e.extras === "MISSION"
|
|
3735
3798
|
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "grab_conditions" ? (openBlock(), createBlock(GrabConditionsInput, {
|
|
3736
3799
|
key: 8,
|
|
3737
3800
|
"model-value": unref(n),
|
|
3738
3801
|
"onUpdate:modelValue": l,
|
|
3739
|
-
schema: unref(
|
|
3802
|
+
schema: unref(s).schema
|
|
3740
3803
|
}, null, 8, ["model-value", "schema"])) : e.field.type === "grab_quota" ? (openBlock(), createBlock(_sfc_main$9, {
|
|
3741
3804
|
key: 9,
|
|
3742
3805
|
"model-value": unref(n),
|
|
3743
3806
|
"onUpdate:modelValue": l,
|
|
3744
|
-
schema: unref(
|
|
3807
|
+
schema: unref(s).schema
|
|
3745
3808
|
}, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$E, {
|
|
3746
3809
|
key: 10,
|
|
3747
3810
|
"model-value": unref(n),
|
|
@@ -3752,7 +3815,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3752
3815
|
"onUpdate:modelValue": l,
|
|
3753
3816
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
3754
3817
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
3755
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
3818
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(g, {
|
|
3756
3819
|
key: 0,
|
|
3757
3820
|
class: "!mt-[8px]",
|
|
3758
3821
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
@@ -3763,7 +3826,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3763
3826
|
"model-value": unref(n),
|
|
3764
3827
|
"onUpdate:modelValue": l
|
|
3765
3828
|
}, null, 8, ["model-value"]),
|
|
3766
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
3829
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(g, {
|
|
3767
3830
|
key: 0,
|
|
3768
3831
|
class: "!mt-[8px]",
|
|
3769
3832
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
@@ -3772,13 +3835,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3772
3835
|
], 64)) : e.field.type === "message" ? (openBlock(), createElementBlock(Fragment, { key: 13 }, [
|
|
3773
3836
|
e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$g, {
|
|
3774
3837
|
key: 0,
|
|
3838
|
+
"push-availability": e.pushAvailability,
|
|
3839
|
+
onRetryPush: f[0] || (f[0] = (w) => u("retry-push")),
|
|
3775
3840
|
"show-validation": e.showValidation,
|
|
3776
3841
|
"model-value": unref(n),
|
|
3777
3842
|
"onUpdate:modelValue": l,
|
|
3778
3843
|
"helper-text": unref(ZodHelper).helperText(a(), ""),
|
|
3779
3844
|
"trigger-type": e.field.extras,
|
|
3780
3845
|
"helper-state": unref(ZodHelper).helperState(a(), "")
|
|
3781
|
-
}, null, 8, ["show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
|
|
3846
|
+
}, null, 8, ["push-availability", "show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$x, {
|
|
3782
3847
|
key: 1,
|
|
3783
3848
|
"allow-email": !0,
|
|
3784
3849
|
"allow-whatsapp": !0,
|
|
@@ -3835,7 +3900,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3835
3900
|
"start-date": e.extras.start,
|
|
3836
3901
|
"end-date": e.extras.end
|
|
3837
3902
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
3838
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3903
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
3839
3904
|
key: 0,
|
|
3840
3905
|
class: "!mt-[8px]",
|
|
3841
3906
|
text: e.helperText,
|
|
@@ -3846,14 +3911,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3846
3911
|
"model-value": unref(n),
|
|
3847
3912
|
"onUpdate:modelValue": l
|
|
3848
3913
|
}, null, 8, ["model-value"]),
|
|
3849
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3914
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
3850
3915
|
key: 0,
|
|
3851
3916
|
class: "!mt-[8px]",
|
|
3852
3917
|
text: e.helperText,
|
|
3853
3918
|
state: "error"
|
|
3854
3919
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3855
3920
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
3856
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
3921
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(g, {
|
|
3857
3922
|
key: 0,
|
|
3858
3923
|
state: "warning",
|
|
3859
3924
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
@@ -3862,7 +3927,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3862
3927
|
"model-value": unref(n),
|
|
3863
3928
|
"onUpdate:modelValue": l
|
|
3864
3929
|
}, null, 8, ["model-value"]),
|
|
3865
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3930
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
3866
3931
|
key: 1,
|
|
3867
3932
|
class: "!mt-[8px]",
|
|
3868
3933
|
text: e.helperText,
|
|
@@ -3873,7 +3938,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3873
3938
|
"model-value": unref(n),
|
|
3874
3939
|
"onUpdate:modelValue": l
|
|
3875
3940
|
}, null, 8, ["model-value"]),
|
|
3876
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3941
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
3877
3942
|
key: 0,
|
|
3878
3943
|
class: "!mt-[8px]",
|
|
3879
3944
|
text: e.helperText,
|
|
@@ -3884,7 +3949,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3884
3949
|
"model-value": unref(n),
|
|
3885
3950
|
"onUpdate:modelValue": l
|
|
3886
3951
|
}, null, 8, ["model-value"]),
|
|
3887
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3952
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
3888
3953
|
key: 0,
|
|
3889
3954
|
class: "!mt-[8px]",
|
|
3890
3955
|
text: e.helperText,
|
|
@@ -3895,7 +3960,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3895
3960
|
"model-value": unref(n),
|
|
3896
3961
|
"onUpdate:modelValue": l
|
|
3897
3962
|
}, null, 8, ["model-value"]),
|
|
3898
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3963
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
3899
3964
|
key: 0,
|
|
3900
3965
|
class: "!mt-[8px]",
|
|
3901
3966
|
text: e.helperText,
|
|
@@ -3906,7 +3971,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3906
3971
|
"model-value": unref(n),
|
|
3907
3972
|
"onUpdate:modelValue": l
|
|
3908
3973
|
}, null, 8, ["model-value"]),
|
|
3909
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3974
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
3910
3975
|
key: 0,
|
|
3911
3976
|
class: "!mt-[8px]",
|
|
3912
3977
|
text: e.helperText,
|
|
@@ -3924,26 +3989,26 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3924
3989
|
}
|
|
3925
3990
|
},
|
|
3926
3991
|
setup(e) {
|
|
3927
|
-
const { t:
|
|
3928
|
-
function
|
|
3992
|
+
const { t: r, te: o } = useI18n();
|
|
3993
|
+
function m(i) {
|
|
3929
3994
|
return o(i) || o(i, "en-US");
|
|
3930
3995
|
}
|
|
3931
|
-
return (i,
|
|
3996
|
+
return (i, u) => {
|
|
3932
3997
|
const l = resolveComponent("FmCard");
|
|
3933
3998
|
return openBlock(), createBlock(l, {
|
|
3934
3999
|
variant: "outlined",
|
|
3935
4000
|
class: "p-16 space-y-8"
|
|
3936
4001
|
}, {
|
|
3937
4002
|
default: withCtx(() => [
|
|
3938
|
-
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(
|
|
3939
|
-
|
|
4003
|
+
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(r)("connect.campaign.common.summary")), 1),
|
|
4004
|
+
u[0] || (u[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
3940
4005
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (n, a) => (openBlock(), createElementBlock("div", {
|
|
3941
4006
|
class: "space-y-4",
|
|
3942
4007
|
key: a
|
|
3943
4008
|
}, [
|
|
3944
4009
|
n ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3945
|
-
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(
|
|
3946
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(
|
|
4010
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(r)(`${a}`)), 1),
|
|
4011
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(m(`${n}`) ? unref(r)(`${n}`) : n), 1)
|
|
3947
4012
|
], 64)) : createCommentVNode("", !0)
|
|
3948
4013
|
]))), 128))
|
|
3949
4014
|
]),
|
|
@@ -3958,27 +4023,57 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3958
4023
|
__name: "EditCampaignSheet",
|
|
3959
4024
|
emits: ["submit:model-value"],
|
|
3960
4025
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
3961
|
-
const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), { getLocaleText } = useLocaleText(), currentStep = ref(1), data = ref(), schema = ref(z
|
|
4026
|
+
const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), { getLocaleText } = useLocaleText(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
3962
4027
|
TEMPLATES.VOUCHER
|
|
3963
|
-
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
|
|
4028
|
+
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER"), pushAvailability = ref("checking");
|
|
4029
|
+
let availabilityRequest = 0;
|
|
4030
|
+
async function checkPushAvailability() {
|
|
4031
|
+
const e = ++availabilityRequest, r = SvcConfig.getBusinessId();
|
|
4032
|
+
pushAvailability.value = "checking";
|
|
4033
|
+
try {
|
|
4034
|
+
if (!r) throw new Error("Business ID is unavailable");
|
|
4035
|
+
const m = await getNativeApp(r);
|
|
4036
|
+
o() && (pushAvailability.value = m ? "native" : "non-native");
|
|
4037
|
+
} catch {
|
|
4038
|
+
o() && (pushAvailability.value = "failed");
|
|
4039
|
+
}
|
|
4040
|
+
function o() {
|
|
4041
|
+
return e === availabilityRequest && sheetVisible.value && campaignType.value === "BROADCAST" && SvcConfig.getBusinessId() === r;
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
watch(
|
|
4045
|
+
sheetVisible,
|
|
4046
|
+
(e) => {
|
|
4047
|
+
e || ++availabilityRequest;
|
|
4048
|
+
},
|
|
4049
|
+
{ flush: "sync" }
|
|
4050
|
+
), onBeforeUnmount(() => {
|
|
4051
|
+
++availabilityRequest;
|
|
4052
|
+
});
|
|
4053
|
+
const pushBlocked = computed(
|
|
4054
|
+
() => {
|
|
4055
|
+
var e;
|
|
4056
|
+
return campaignType.value === "BROADCAST" && toDelivery(((e = data.value) == null ? void 0 : e.campaign) ?? {}).channels.includes("PUSH") && pushAvailability.value !== "native";
|
|
4057
|
+
}
|
|
4058
|
+
);
|
|
3964
4059
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
3965
|
-
var e,
|
|
3966
|
-
if (sheetVisible.value = visible, campaignType.value = type, visible == !0) {
|
|
4060
|
+
var e, r, o;
|
|
4061
|
+
if (sheetVisible.value = visible, campaignType.value = type, ++availabilityRequest, visible && type === "BROADCAST" && checkPushAvailability(), visible == !0) {
|
|
3967
4062
|
try {
|
|
3968
4063
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
3969
4064
|
} catch {
|
|
3970
4065
|
} finally {
|
|
3971
|
-
await new Promise((
|
|
4066
|
+
await new Promise((m) => setTimeout(m, 120)), isLoading.value = !1;
|
|
3972
4067
|
}
|
|
3973
4068
|
console.log(
|
|
3974
4069
|
TEMPLATES[type],
|
|
3975
4070
|
"base template"
|
|
3976
|
-
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
3977
|
-
var
|
|
3978
|
-
if (
|
|
3979
|
-
const l = (
|
|
4071
|
+
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((m, i) => {
|
|
4072
|
+
var u;
|
|
4073
|
+
if (m.campaign.type === "VOUCHER" && m.campaign.code) {
|
|
4074
|
+
const l = (u = m.campaign._id) == null ? void 0 : u.toString();
|
|
3980
4075
|
useCampaignStore().campaigns.voucher.some(
|
|
3981
|
-
(n) => n.code ===
|
|
4076
|
+
(n) => n.code === m.campaign.code && n._id.toString() !== l
|
|
3982
4077
|
) && i.addIssue({
|
|
3983
4078
|
code: "custom",
|
|
3984
4079
|
message: "Code already exists, please use another code",
|
|
@@ -3986,7 +4081,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3986
4081
|
});
|
|
3987
4082
|
}
|
|
3988
4083
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
3989
|
-
...(
|
|
4084
|
+
...(r = template.value) == null ? void 0 : r.defaultValue
|
|
3990
4085
|
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), type === "BROADCAST" && normaliseBroadcastDelivery(data.value.campaign), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, submitAttempted.value = !1, sheetTitle.value = (o = campaign == null ? void 0 : campaign.campaign) != null && o._id ? t("connect.campaign.common.edit_campaign_title", {
|
|
3991
4086
|
typeName: t(`connect.campaign.common.typeName.${type}`)
|
|
3992
4087
|
}) : t("connect.campaign.common.create_campaign_title", {
|
|
@@ -4013,15 +4108,21 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4013
4108
|
});
|
|
4014
4109
|
}
|
|
4015
4110
|
const emits = __emit, errors = computed(() => {
|
|
4016
|
-
const e = schema.value.superRefine(campaignRefinement).safeParse(data.value);
|
|
4017
|
-
return
|
|
4111
|
+
const e = schema.value.superRefine(campaignRefinement).safeParse(data.value), r = e.success ? [] : [...e.error.errors];
|
|
4112
|
+
return pushBlocked.value && r.push({
|
|
4113
|
+
code: "custom",
|
|
4114
|
+
path: ["campaign", "delivery", "channels"],
|
|
4115
|
+
message: t(
|
|
4116
|
+
"connect.campaign.broadcast.pushAvailability.removeBeforeSave"
|
|
4117
|
+
)
|
|
4118
|
+
}), r;
|
|
4018
4119
|
});
|
|
4019
4120
|
function stepErrors(e = currentStep.value - 1) {
|
|
4020
|
-
const
|
|
4021
|
-
(o) => o.fields.map((
|
|
4121
|
+
const r = template.value.steps[e].groups.flatMap(
|
|
4122
|
+
(o) => o.fields.map((m) => schemaPathForField(m.property))
|
|
4022
4123
|
);
|
|
4023
4124
|
return errors.value.filter(
|
|
4024
|
-
(o) =>
|
|
4125
|
+
(o) => r.some((m) => o.path.join(".").includes(m))
|
|
4025
4126
|
);
|
|
4026
4127
|
}
|
|
4027
4128
|
const validateOnSubmit = computed(() => campaignType.value === "BROADCAST"), submitAttempted = ref(!1), showValidation = computed(
|
|
@@ -4064,23 +4165,23 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4064
4165
|
function schemaPathForField(e) {
|
|
4065
4166
|
return e === "campaign.message" ? "campaign.delivery" : e;
|
|
4066
4167
|
}
|
|
4067
|
-
function onUpdateProperty(e,
|
|
4068
|
-
var o,
|
|
4069
|
-
if (e === "campaign.message" &&
|
|
4070
|
-
_.set(data.value, "campaign.delivery",
|
|
4071
|
-
const
|
|
4072
|
-
|
|
4168
|
+
function onUpdateProperty(e, r) {
|
|
4169
|
+
var o, m, i, u, l, n, a, s;
|
|
4170
|
+
if (e === "campaign.message" && r && "channels" in r) {
|
|
4171
|
+
_.set(data.value, "campaign.delivery", r);
|
|
4172
|
+
const y = toLegacyMessage(r);
|
|
4173
|
+
y ? _.set(data.value, "campaign.message", y) : delete data.value.campaign.message;
|
|
4073
4174
|
return;
|
|
4074
4175
|
}
|
|
4075
|
-
if (_.set(data.value, e,
|
|
4076
|
-
const
|
|
4077
|
-
...(
|
|
4176
|
+
if (_.set(data.value, e, r), e == "campaign.event.type") {
|
|
4177
|
+
const f = ((u = (i = (m = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : m.campaign) == null ? void 0 : i.event) == null ? void 0 : u.rule) ? _.cloneDeep({
|
|
4178
|
+
...(s = (a = (n = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : n.campaign) == null ? void 0 : a.event) == null ? void 0 : s.rule
|
|
4078
4179
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
4079
4180
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
4080
4181
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
4081
4182
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
4082
4183
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
4083
|
-
]),
|
|
4184
|
+
]), c = RuleBuilder.setRuleToGroup(
|
|
4084
4185
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
4085
4186
|
[
|
|
4086
4187
|
RuleBuilder.constructEntry(
|
|
@@ -4092,52 +4193,52 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4092
4193
|
],
|
|
4093
4194
|
"&&"
|
|
4094
4195
|
);
|
|
4095
|
-
if (
|
|
4096
|
-
_.set(data.value, "campaign.event.rule",
|
|
4196
|
+
if (r != "SCHEDULE") {
|
|
4197
|
+
_.set(data.value, "campaign.event.rule", f);
|
|
4097
4198
|
return;
|
|
4098
4199
|
}
|
|
4099
4200
|
_.set(
|
|
4100
4201
|
data.value,
|
|
4101
4202
|
"campaign.event.rule",
|
|
4102
|
-
RuleBuilder.setRuleToGroup(
|
|
4203
|
+
RuleBuilder.setRuleToGroup(f, c)
|
|
4103
4204
|
);
|
|
4104
4205
|
}
|
|
4105
|
-
e == "campaign.notify" &&
|
|
4206
|
+
e == "campaign.notify" && r == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
4106
4207
|
}
|
|
4107
|
-
async function onUpdateFile(e,
|
|
4108
|
-
return e ? await minor(async () => firebaseStorage.update(
|
|
4208
|
+
async function onUpdateFile(e, r) {
|
|
4209
|
+
return e ? await minor(async () => firebaseStorage.update(r, e), {
|
|
4109
4210
|
message: `${e ? "Uploading" : "Removing"} file`,
|
|
4110
4211
|
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
4111
4212
|
}) : "";
|
|
4112
4213
|
}
|
|
4113
4214
|
function isDisable(e) {
|
|
4114
|
-
var
|
|
4215
|
+
var r, o;
|
|
4115
4216
|
switch (e == null ? void 0 : e.property) {
|
|
4116
4217
|
case "campaign.event.type":
|
|
4117
|
-
return ((o = (
|
|
4218
|
+
return ((o = (r = data.value) == null ? void 0 : r.campaign) == null ? void 0 : o._id) || !1;
|
|
4118
4219
|
default:
|
|
4119
4220
|
return !1;
|
|
4120
4221
|
}
|
|
4121
4222
|
}
|
|
4122
4223
|
async function onSubmit() {
|
|
4123
|
-
submitAttempted.value = !0;
|
|
4224
|
+
if (submitAttempted.value = !0, pushBlocked.value) return;
|
|
4124
4225
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
4125
4226
|
if (!e.success)
|
|
4126
4227
|
return;
|
|
4127
|
-
const
|
|
4228
|
+
const r = await emits(
|
|
4128
4229
|
"submit:model-value",
|
|
4129
4230
|
cleanPF(JSON.parse(JSON.stringify(e.data)))
|
|
4130
4231
|
);
|
|
4131
|
-
(
|
|
4232
|
+
(r || r === void 0) && (sheetVisible.value = !1);
|
|
4132
4233
|
}
|
|
4133
|
-
return (e,
|
|
4134
|
-
const o = resolveComponent("FmButton"),
|
|
4234
|
+
return (e, r) => {
|
|
4235
|
+
const o = resolveComponent("FmButton"), m = resolveComponent("FmStep"), i = resolveComponent("FmStepper"), u = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
4135
4236
|
return openBlock(), createBlock(l, {
|
|
4136
4237
|
"fullscreen-size": "lg",
|
|
4137
4238
|
modelValue: unref(sheetVisible),
|
|
4138
4239
|
"onUpdate:modelValue": [
|
|
4139
|
-
|
|
4140
|
-
|
|
4240
|
+
r[7] || (r[7] = (n) => isRef(sheetVisible) ? sheetVisible.value = n : null),
|
|
4241
|
+
r[8] || (r[8] = (n) => sheetVisible.value = n)
|
|
4141
4242
|
]
|
|
4142
4243
|
}, createSlots({
|
|
4143
4244
|
"top-sheet-header": withCtx(() => [
|
|
@@ -4145,7 +4246,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4145
4246
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
4146
4247
|
createElementVNode("div", _hoisted_2, [
|
|
4147
4248
|
createVNode(o, {
|
|
4148
|
-
onClick:
|
|
4249
|
+
onClick: r[0] || (r[0] = (n) => hideSheet()),
|
|
4149
4250
|
label: unref(t)("connect.campaign.common.cancel"),
|
|
4150
4251
|
variant: "tertiary"
|
|
4151
4252
|
}, null, 8, ["label"]),
|
|
@@ -4165,7 +4266,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4165
4266
|
createElementVNode("div", _hoisted_9, [
|
|
4166
4267
|
createElementVNode("div", _hoisted_10, [
|
|
4167
4268
|
createElementVNode("div", _hoisted_11, [
|
|
4168
|
-
|
|
4269
|
+
r[9] || (r[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
|
|
4169
4270
|
createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
|
|
4170
4271
|
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
4171
4272
|
createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
@@ -4187,7 +4288,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4187
4288
|
])
|
|
4188
4289
|
])
|
|
4189
4290
|
], -1)),
|
|
4190
|
-
createVNode(
|
|
4291
|
+
createVNode(u, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
4191
4292
|
])
|
|
4192
4293
|
])
|
|
4193
4294
|
])
|
|
@@ -4199,12 +4300,12 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4199
4300
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
4200
4301
|
createVNode(i, {
|
|
4201
4302
|
modelValue: unref(currentStep),
|
|
4202
|
-
"onUpdate:modelValue":
|
|
4303
|
+
"onUpdate:modelValue": r[1] || (r[1] = (n) => isRef(currentStep) ? currentStep.value = n : null),
|
|
4203
4304
|
orientation: "horizontal",
|
|
4204
4305
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
4205
4306
|
}, {
|
|
4206
4307
|
default: withCtx(() => [
|
|
4207
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(
|
|
4308
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(m, {
|
|
4208
4309
|
key: n.name,
|
|
4209
4310
|
title: unref(getLocaleText)(n.name_locale, n.name),
|
|
4210
4311
|
value: a + 1,
|
|
@@ -4218,16 +4319,16 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4218
4319
|
createVNode(o, {
|
|
4219
4320
|
icon: "close",
|
|
4220
4321
|
variant: "tertiary",
|
|
4221
|
-
onClick:
|
|
4322
|
+
onClick: r[2] || (r[2] = (n) => sheetVisible.value = !1)
|
|
4222
4323
|
}),
|
|
4223
4324
|
createVNode(i, {
|
|
4224
4325
|
modelValue: unref(currentStep),
|
|
4225
|
-
"onUpdate:modelValue":
|
|
4326
|
+
"onUpdate:modelValue": r[3] || (r[3] = (n) => isRef(currentStep) ? currentStep.value = n : null),
|
|
4226
4327
|
orientation: "horizontal",
|
|
4227
4328
|
class: "flex-1"
|
|
4228
4329
|
}, {
|
|
4229
4330
|
default: withCtx(() => [
|
|
4230
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(
|
|
4331
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, a) => (openBlock(), createBlock(m, {
|
|
4231
4332
|
key: n.name,
|
|
4232
4333
|
title: unref(sheetTitle),
|
|
4233
4334
|
description: unref(getLocaleText)(n.name_locale, n.name),
|
|
@@ -4241,7 +4342,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4241
4342
|
createVNode(o, {
|
|
4242
4343
|
icon: "info",
|
|
4243
4344
|
variant: "tertiary",
|
|
4244
|
-
onClick:
|
|
4345
|
+
onClick: r[4] || (r[4] = () => showSummaryDialog())
|
|
4245
4346
|
})
|
|
4246
4347
|
]),
|
|
4247
4348
|
createElementVNode("div", _hoisted_5, [
|
|
@@ -4265,34 +4366,36 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4265
4366
|
class: "space-y-24"
|
|
4266
4367
|
}, [
|
|
4267
4368
|
createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(n.name_locale, n.name ?? "")), 1),
|
|
4268
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (
|
|
4369
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (s, y) => (openBlock(), createElementBlock("div", { key: y }, [
|
|
4269
4370
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
4270
|
-
key:
|
|
4271
|
-
field:
|
|
4272
|
-
modelValue: valueForField(
|
|
4273
|
-
disabled: isDisable(
|
|
4371
|
+
key: y,
|
|
4372
|
+
field: s,
|
|
4373
|
+
modelValue: valueForField(s.property),
|
|
4374
|
+
disabled: isDisable(s),
|
|
4274
4375
|
"campaign-type": unref(campaignType),
|
|
4275
4376
|
"show-validation": unref(showValidation),
|
|
4276
|
-
"
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4377
|
+
"push-availability": unref(pushAvailability),
|
|
4378
|
+
onRetryPush: checkPushAvailability,
|
|
4379
|
+
"onUpdate:modelValue": (f) => onUpdateProperty(s.property, f),
|
|
4380
|
+
"onUpdate:file": async (f, c) => {
|
|
4381
|
+
const k = await onUpdateFile(f, c);
|
|
4382
|
+
onUpdateProperty(s.property, k || "");
|
|
4280
4383
|
},
|
|
4281
4384
|
schema: unref(ZodHelper).typeAtPath(
|
|
4282
4385
|
unref(schema),
|
|
4283
|
-
schemaPathForField(
|
|
4386
|
+
schemaPathForField(s.property),
|
|
4284
4387
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
4285
4388
|
),
|
|
4286
4389
|
"helper-state": unref(ZodHelper).helperState(
|
|
4287
4390
|
unref(visibleErrors),
|
|
4288
|
-
schemaPathForField(
|
|
4391
|
+
schemaPathForField(s.property)
|
|
4289
4392
|
),
|
|
4290
4393
|
"helper-text": unref(ZodHelper).helperText(
|
|
4291
4394
|
unref(visibleErrors),
|
|
4292
|
-
schemaPathForField(
|
|
4395
|
+
schemaPathForField(s.property)
|
|
4293
4396
|
),
|
|
4294
|
-
extras:
|
|
4295
|
-
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "show-validation", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
4397
|
+
extras: s.extras != null ? s.extras == "" ? unref(data) : unref(_).get(unref(data), s.extras) : void 0
|
|
4398
|
+
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "show-validation", "push-availability", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
4296
4399
|
]))), 128))
|
|
4297
4400
|
]))), 128)),
|
|
4298
4401
|
createElementVNode("div", _hoisted_8, [
|
|
@@ -4300,12 +4403,12 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
4300
4403
|
label: unref(t)("connect.common.back"),
|
|
4301
4404
|
variant: "tertiary",
|
|
4302
4405
|
disabled: unref(currentStep) == 1,
|
|
4303
|
-
onClick:
|
|
4406
|
+
onClick: r[5] || (r[5] = (n) => currentStep.value--)
|
|
4304
4407
|
}, null, 8, ["label", "disabled"]),
|
|
4305
4408
|
createVNode(o, {
|
|
4306
4409
|
disabled: isNextDisabled(),
|
|
4307
4410
|
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? unref(t)("connect.common.next") : unref(t)("connect.common.submit"),
|
|
4308
|
-
onClick:
|
|
4411
|
+
onClick: r[6] || (r[6] = (n) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? onNext() : onSubmit())
|
|
4309
4412
|
}, null, 8, ["disabled", "label"])
|
|
4310
4413
|
])
|
|
4311
4414
|
]),
|