@feedmepos/mf-connect 0.0.9 → 0.0.11-prod
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/{Analytic-CwaN0mge.js → Analytic-CpXLcGWV.js} +7 -7
- package/dist/{Broadcast-Cjx5xzUC.js → Broadcast-CEMQS5PI.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4mO5aik.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0Kvpl_V.js} +8 -8
- package/dist/{Card-DbY6YaXk.js → Card-BqX-aRK9.js} +182 -187
- package/dist/{Collections-DRN2gzwh.js → Collections-SRmluAj0.js} +102 -84
- package/dist/{Credit-DOcrzykJ.js → Credit-DdBKFsII.js} +7 -7
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYNpBySQ.js +2600 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-EF_rHfwT.js → EffectSheet.vue_vue_type_style_index_0_lang-admNNBWu.js} +1864 -1830
- package/dist/{Experience-aQj-3H2Y.js → Experience-CSfRrWqI.js} +7 -7
- package/dist/Game-BV--qn0e.js +250 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js → ImageInput.vue_vue_type_script_setup_true_lang-DpYjrT3G.js} +1 -1
- package/dist/{MainLayout-Cxl9yLPs.js → MainLayout-B_ZXQrMD.js} +1 -1
- package/dist/{Marketing-BYUcbcMU.js → Marketing-Bac3EbOu.js} +16 -16
- package/dist/{Member-D7K9fm_Q.js → Member-CGMRVEuI.js} +2 -2
- package/dist/{MemberList-DbXkxUzF.js → MemberList-CSyb4bNE.js} +196 -195
- package/dist/{MemberTransactions-DED1SYwX.js → MemberTransactions-BdraBHg6.js} +2 -2
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js → MessageInput.vue_vue_type_script_setup_true_lang-BvAFOoym.js} +2 -2
- package/dist/Mission-D8-D99g-.js +248 -0
- package/dist/Point-BOI4mT-K.js +220 -0
- package/dist/{Promotion-DzVXy_C9.js → Promotion-D0MLMo9m.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js → RuleGroup.vue_vue_type_script_setup_true_lang-1L68zx5t.js} +58 -58
- package/dist/Segment-BeUbkVj7.js +444 -0
- package/dist/{Setting-pCzenLoL.js → Setting-uM4iKdyM.js} +386 -379
- package/dist/{Store-DEwEIFYD.js → Store-BkccNTnM.js} +432 -413
- package/dist/{StoreRewards-D7vnZN4f.js → StoreRewards-BLgP6Mfv.js} +9 -9
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-ALzQU3th.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Z0nqQyi8.js} +39 -38
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C771jjYx.js} +1 -1
- package/dist/{Tier-BJbX5CPB.js → Tier-DwKAfz6f.js} +17 -16
- package/dist/{Title-C9xV6rBg.js → Title-B1_yd9pC.js} +16 -15
- package/dist/{Transaction-C8OHlhzR.js → Transaction-DcVCMUY4.js} +1 -1
- package/dist/{Voucher-eZwm7N1D.js → Voucher-Djvai5vL.js} +30 -30
- package/dist/{app-DgbDbhL-.js → app-BvizV9z5.js} +3192 -3178
- package/dist/app.js +1 -1
- package/dist/{campaign-BkvrUTEJ.js → campaign-BdSwq7MJ.js} +31 -27
- package/dist/dto-CkH5Zama.js +1150 -0
- package/dist/{effect-f7DAPYC8.js → effect-DT4ivttr.js} +1 -1
- package/dist/{export-BXbCXTfd.js → export-BAJL8_2G.js} +3 -3
- package/dist/{helper-BhvQ9m6d.js → helper-CiIZ1pUo.js} +21 -8
- package/dist/{index-CdtrQ9tR.js → index-7uOMMdXt.js} +245 -184
- package/dist/{index-Cfo2A0Se.js → index-8nrxC9d5.js} +1 -1
- package/dist/{index-FWp9M1yS.js → index-B5gJ6P15.js} +269 -21
- package/dist/{index-BhacKx5B.js → index-BLWw_MlC.js} +1363 -1341
- package/dist/{index-VmFlM704.js → index-C5N8jeJ1.js} +1 -1
- package/dist/{index-Cz5RZlYh.js → index-C8dIiNQb.js} +1 -1
- package/dist/{index-Dd3hrFcQ.js → index-Ccn7PGoB.js} +268 -267
- package/dist/{index-oQLJE4Uw.js → index-CjZxaXvZ.js} +69 -64
- package/dist/{index-DQC_1tRF.js → index-DCs4-zXS.js} +7 -17
- package/dist/{index-BsEqtUmY.js → index-DMyaEjMn.js} +26 -20
- package/dist/{loading-DQaawbHE.js → loading-C1IzY-n2.js} +1312 -1312
- package/dist/{lodash-DzdmTD20.js → lodash-BMQ4xbjY.js} +1 -1
- package/dist/membership-D3I4udu3.js +221 -0
- package/dist/{money-vzwOUBrp.js → money-BQEcWGhZ.js} +1 -1
- package/dist/{number-CBzs6rfW.js → number-DGx2QPUy.js} +1 -1
- package/dist/{rule-BR5rrmUV.js → rule-CvlhLEGy.js} +2 -2
- package/dist/{rule-builder-7GBNrPXt.js → rule-builder-Di3qiIBb.js} +1 -1
- package/dist/{template-CETJ6lkf.js → template-D6Abrya4.js} +5 -5
- package/dist/{usePagination-DdZeE4Tt.js → usePagination-MhbjQgN7.js} +1 -1
- package/dist/{xlsx-CDAKxZE_.js → xlsx-mL_3T1k3.js} +226 -226
- package/package.json +3 -3
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js +0 -2002
- package/dist/Game-Cnje-m_M.js +0 -242
- package/dist/Point-CQm8whVQ.js +0 -211
- package/dist/Segment-D3o0D3Uv.js +0 -407
- package/dist/dto-YYVhW73A.js +0 -1092
- package/dist/libs/packages/core/src/bill/bill.dto.d.ts +0 -75
- package/dist/libs/packages/core/src/bill/index.d.ts +0 -115
- package/dist/libs/packages/core/src/business/index.d.ts +0 -21
- package/dist/libs/packages/core/src/campaign/broadcast/index.d.ts +0 -36
- package/dist/libs/packages/core/src/campaign/campaign.enum.d.ts +0 -9
- package/dist/libs/packages/core/src/campaign/campaign.fn.d.ts +0 -7
- package/dist/libs/packages/core/src/campaign/dto.d.ts +0 -5517
- package/dist/libs/packages/core/src/campaign/group.d.ts +0 -25
- package/dist/libs/packages/core/src/campaign/index.d.ts +0 -33988
- package/dist/libs/packages/core/src/collectible/collectible.dto.d.ts +0 -21
- package/dist/libs/packages/core/src/collectible/collectible.enum.d.ts +0 -14
- package/dist/libs/packages/core/src/collectible/helper.d.ts +0 -195
- package/dist/libs/packages/core/src/collectible/index.d.ts +0 -1588
- package/dist/libs/packages/core/src/collectible/pool/index.d.ts +0 -1381
- package/dist/libs/packages/core/src/collection/collection.fn.d.ts +0 -5
- package/dist/libs/packages/core/src/collection/index.d.ts +0 -1014
- package/dist/libs/packages/core/src/collection/transaction.d.ts +0 -845
- package/dist/libs/packages/core/src/collection/transaction.fn.d.ts +0 -10
- package/dist/libs/packages/core/src/common/array.d.ts +0 -2
- package/dist/libs/packages/core/src/common/hash.d.ts +0 -10
- package/dist/libs/packages/core/src/common/index.d.ts +0 -42
- package/dist/libs/packages/core/src/common/number.d.ts +0 -7
- package/dist/libs/packages/core/src/common/object.d.ts +0 -5
- package/dist/libs/packages/core/src/common/objectId.d.ts +0 -2
- package/dist/libs/packages/core/src/common/string.d.ts +0 -4
- package/dist/libs/packages/core/src/counter/counter.dto.d.ts +0 -767
- package/dist/libs/packages/core/src/counter/index.d.ts +0 -1
- package/dist/libs/packages/core/src/event/index.d.ts +0 -4246
- package/dist/libs/packages/core/src/feedback/index.d.ts +0 -24
- package/dist/libs/packages/core/src/game/index.d.ts +0 -32
- package/dist/libs/packages/core/src/index.d.ts +0 -21
- package/dist/libs/packages/core/src/internal/index.d.ts +0 -56
- package/dist/libs/packages/core/src/legacy/setting/index.d.ts +0 -89
- package/dist/libs/packages/core/src/location/index.d.ts +0 -44
- package/dist/libs/packages/core/src/loyalty/card/index.d.ts +0 -1296
- package/dist/libs/packages/core/src/loyalty/index.d.ts +0 -3
- package/dist/libs/packages/core/src/loyalty/tier/helper.d.ts +0 -2
- package/dist/libs/packages/core/src/loyalty/tier/index.d.ts +0 -251
- package/dist/libs/packages/core/src/loyalty/title/index.d.ts +0 -4
- package/dist/libs/packages/core/src/marketing-material/index.d.ts +0 -186
- package/dist/libs/packages/core/src/marketing-material/marketing-material.enum.d.ts +0 -3
- package/dist/libs/packages/core/src/notification/index.d.ts +0 -130
- package/dist/libs/packages/core/src/pagination/index.d.ts +0 -25
- package/dist/libs/packages/core/src/permission/index.d.ts +0 -243
- package/dist/libs/packages/core/src/service/index.d.ts +0 -10
- package/dist/libs/packages/core/src/store/dto.d.ts +0 -1069
- package/dist/libs/packages/core/src/store/index.d.ts +0 -3942
- package/dist/libs/packages/core/src/store/store.fn.d.ts +0 -104
- package/dist/libs/packages/core/src/template/index.d.ts +0 -880
- package/dist/libs/packages/core/src/template/templates.d.ts +0 -1239
- package/dist/libs/packages/core/src/user/index.d.ts +0 -245
- package/dist/libs/packages/core/src/user/segment.dto.d.ts +0 -27
- package/dist/libs/packages/core/src/user/segmentation.d.ts +0 -28
- package/dist/libs/packages/core/src/user/user.dto.d.ts +0 -873
- package/dist/libs/packages/core/src/validation/index.d.ts +0 -1
- package/dist/libs/packages/core/src/validation/rule/builder.d.ts +0 -36
- package/dist/libs/packages/core/src/validation/rule/index.d.ts +0 -45
- package/dist/libs/packages/core/src/validation/rule/operator.enum.d.ts +0 -405
- package/dist/libs/packages/core/src/validation/rule/rule.fn.d.ts +0 -6
- package/dist/libs/packages/validation/src/index.d.ts +0 -3
- package/dist/libs/packages/validation/src/rule/rule-builder.d.ts +0 -19
- package/dist/libs/packages/validation/src/rule/rule.d.ts +0 -52
- package/dist/libs/packages/validation/src/rule/validate.d.ts +0 -2
- package/dist/membership-Dq2-b-S_.js +0 -210
- package/dist/packages/connect/src/App.vue.d.ts +0 -2
- package/dist/packages/connect/src/Entry.vue.d.ts +0 -2
- package/dist/packages/connect/src/api/auth/index.d.ts +0 -3
- package/dist/packages/connect/src/api/campaign/index.d.ts +0 -30
- package/dist/packages/connect/src/api/campaign/template.d.ts +0 -5
- package/dist/packages/connect/src/api/index.d.ts +0 -29
- package/dist/packages/connect/src/api/location/index.d.ts +0 -7
- package/dist/packages/connect/src/api/marketing-material/index.d.ts +0 -7
- package/dist/packages/connect/src/api/member/index.d.ts +0 -12
- package/dist/packages/connect/src/api/membership/index.d.ts +0 -28
- package/dist/packages/connect/src/api/segments/index.d.ts +0 -13
- package/dist/packages/connect/src/api/settings/index.d.ts +0 -4
- package/dist/packages/connect/src/api/transaction/index.d.ts +0 -9
- package/dist/packages/connect/src/api/users/index.d.ts +0 -8
- package/dist/packages/connect/src/app.d.ts +0 -16
- package/dist/packages/connect/src/components/NavigationTab.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/analytic/CampaignCard.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/analytic/CampaignChip.vue.d.ts +0 -47
- package/dist/packages/connect/src/components/analytic/CampaignGroup.vue.d.ts +0 -25
- package/dist/packages/connect/src/components/analytic/CampaignStat.vue.d.ts +0 -31
- package/dist/packages/connect/src/components/analytic/LinkCampaign.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/campaign/CampaignChip.vue.d.ts +0 -13
- package/dist/packages/connect/src/components/campaign/CampaignSummary.vue.d.ts +0 -13
- package/dist/packages/connect/src/components/campaign/CampaignTriggerInput.vue.d.ts +0 -34
- package/dist/packages/connect/src/components/campaign/EarningOptionInput.vue.d.ts +0 -50
- package/dist/packages/connect/src/components/campaign/GameTypeInput.vue.d.ts +0 -15
- package/dist/packages/connect/src/components/campaign/MessageInput.vue.d.ts +0 -64
- package/dist/packages/connect/src/components/campaign/PromotionGameTypeInput.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/campaign/ScheduleRuleInput.vue.d.ts +0 -29
- package/dist/packages/connect/src/components/campaign/TargetLocationInput.vue.d.ts +0 -32
- package/dist/packages/connect/src/components/campaign/ValidityInput.vue.d.ts +0 -59
- package/dist/packages/connect/src/components/collectible/CollectibleChip.vue.d.ts +0 -13
- package/dist/packages/connect/src/components/collectible/CollectibleOptionInput.vue.d.ts +0 -59
- package/dist/packages/connect/src/components/collection/Collections.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/common/BaseTable.vue.d.ts +0 -80
- package/dist/packages/connect/src/components/common/FmTableSelection.vue.d.ts +0 -22
- package/dist/packages/connect/src/components/custom/ChipMenu.vue.d.ts +0 -96
- package/dist/packages/connect/src/components/custom/CustomSelect.vue.d.ts +0 -68
- package/dist/packages/connect/src/components/custom/DateInput.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/custom/DateRangeChip.vue.d.ts +0 -25
- package/dist/packages/connect/src/components/custom/DateRangeInput.vue.d.ts +0 -28
- package/dist/packages/connect/src/components/custom/FilterChip.vue.d.ts +0 -90
- package/dist/packages/connect/src/components/custom/ImageInput.vue.d.ts +0 -115
- package/dist/packages/connect/src/components/custom/json/JsonNode.vue.d.ts +0 -36
- package/dist/packages/connect/src/components/custom/json/JsonViewer.vue.d.ts +0 -22
- package/dist/packages/connect/src/components/custom/zod/ZodTextField.vue.d.ts +0 -52
- package/dist/packages/connect/src/components/loading/ImageLoading.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/loading/LottieAnimation.vue.d.ts +0 -39
- package/dist/packages/connect/src/components/loading/Splash.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/loyalty/CampaignTypeDialog.vue.d.ts +0 -13
- package/dist/packages/connect/src/components/loyalty/CreditCoinDialog.vue.d.ts +0 -29
- package/dist/packages/connect/src/components/loyalty/TierExpression.vue.d.ts +0 -32
- package/dist/packages/connect/src/components/marketing/HeadlineStyleSideSheet.vue.d.ts +0 -42
- package/dist/packages/connect/src/components/marketing/ImageSideSheet.vue.d.ts +0 -40
- package/dist/packages/connect/src/components/marketing/LinkRewardSideSheet.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/marketing/MarketingSheet.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/marketing/RewardDropDown.vue.d.ts +0 -26
- package/dist/packages/connect/src/components/marketing/RightSheet.vue.d.ts +0 -66
- package/dist/packages/connect/src/components/marketing/SlideUpDown.vue.d.ts +0 -27
- package/dist/packages/connect/src/components/marketing/platform/BrandAppImage.vue.d.ts +0 -103
- package/dist/packages/connect/src/components/marketing/platform/FacebookPost.vue.d.ts +0 -103
- package/dist/packages/connect/src/components/marketing/platform/FacebookStory.vue.d.ts +0 -103
- package/dist/packages/connect/src/components/marketing/platform/ImageCanvas.vue.d.ts +0 -81
- package/dist/packages/connect/src/components/marketing/platform/InstagramPost.vue.d.ts +0 -102
- package/dist/packages/connect/src/components/marketing/platform/InstagramReel.vue.d.ts +0 -102
- package/dist/packages/connect/src/components/marketing/platform/InstagramStory.vue.d.ts +0 -102
- package/dist/packages/connect/src/components/marketing/platform/TvImage.vue.d.ts +0 -103
- package/dist/packages/connect/src/components/member/MemberDetail.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/member/MemberList.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/member/MemberOverview.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/member/MemberStatsDialog.vue.d.ts +0 -21
- package/dist/packages/connect/src/components/rule/BillRuleGroup.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/CustomRuleDialog.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/rule/FeedbackRuleGroup.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/PresetRuleDialog.vue.d.ts +0 -20
- package/dist/packages/connect/src/components/rule/RuleConfigurator.vue.d.ts +0 -37
- package/dist/packages/connect/src/components/rule/RuleEntry.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/RuleEquator.vue.d.ts +0 -31
- package/dist/packages/connect/src/components/rule/RuleGroup.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/rule/SegmentConfigurator.vue.d.ts +0 -17
- package/dist/packages/connect/src/components/rule/TimeRuleGroup.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/UserRuleGroup.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/equators/BirthdayInput.vue.d.ts +0 -15
- package/dist/packages/connect/src/components/rule/equators/IsDayInput.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/rule/equators/IsInMonthInput.vue.d.ts +0 -16
- package/dist/packages/connect/src/components/rule/equators/IsRangeInput.vue.d.ts +0 -55
- package/dist/packages/connect/src/components/rule/equators/RruleInput.vue.d.ts +0 -37
- package/dist/packages/connect/src/components/rule/presets.d.ts +0 -18
- package/dist/packages/connect/src/components/segment/ReviewSegment.vue.d.ts +0 -16
- package/dist/packages/connect/src/components/setting/LinkDeviceDialog.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/store/AddBundleCard.vue.d.ts +0 -6
- package/dist/packages/connect/src/components/store/CategoryDialog.vue.d.ts +0 -23
- package/dist/packages/connect/src/components/store/StoreBundleCard.vue.d.ts +0 -20
- package/dist/packages/connect/src/components/store/StoreTransactions.vue.d.ts +0 -10
- package/dist/packages/connect/src/components/stripe/StripeSetting.vue.d.ts +0 -21
- package/dist/packages/connect/src/components/tax/TaxInclusiveSetting.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/tax/TaxVariantSetting.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/template/TemplateDialog.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/template/TemplateInput.vue.d.ts +0 -54
- package/dist/packages/connect/src/components/tier/TierCard.vue.d.ts +0 -39
- package/dist/packages/connect/src/components/transactions/CollectionTransactions.vue.d.ts +0 -10
- package/dist/packages/connect/src/components/transactions/MemberTransactions.vue.d.ts +0 -2
- package/dist/packages/connect/src/composables/export.d.ts +0 -11
- package/dist/packages/connect/src/composables/index.d.ts +0 -2
- package/dist/packages/connect/src/composables/loading.d.ts +0 -19
- package/dist/packages/connect/src/composables/template.d.ts +0 -7
- package/dist/packages/connect/src/composables/usePagination.d.ts +0 -32
- package/dist/packages/connect/src/export/base.export.d.ts +0 -7
- package/dist/packages/connect/src/export/card.export.d.ts +0 -9
- package/dist/packages/connect/src/export/collection-transaction.export.d.ts +0 -14
- package/dist/packages/connect/src/export/collection.export.d.ts +0 -9
- package/dist/packages/connect/src/export/index.d.ts +0 -11
- package/dist/packages/connect/src/export/member.export.d.ts +0 -33
- package/dist/packages/connect/src/export/store-transaction.export.d.ts +0 -14
- package/dist/packages/connect/src/helpers/campaign.d.ts +0 -94
- package/dist/packages/connect/src/helpers/collectible.d.ts +0 -58
- package/dist/packages/connect/src/helpers/common.d.ts +0 -1
- package/dist/packages/connect/src/helpers/country.d.ts +0 -21
- package/dist/packages/connect/src/helpers/currency.d.ts +0 -2
- package/dist/packages/connect/src/helpers/effect.d.ts +0 -7
- package/dist/packages/connect/src/helpers/message.d.ts +0 -32
- package/dist/packages/connect/src/helpers/number.d.ts +0 -3
- package/dist/packages/connect/src/helpers/qr.d.ts +0 -7
- package/dist/packages/connect/src/helpers/rrule.d.ts +0 -26
- package/dist/packages/connect/src/helpers/rule.d.ts +0 -91
- package/dist/packages/connect/src/helpers/string.d.ts +0 -16
- package/dist/packages/connect/src/helpers/tax.d.ts +0 -74
- package/dist/packages/connect/src/helpers/trigger.d.ts +0 -59
- package/dist/packages/connect/src/helpers/user.d.ts +0 -6
- package/dist/packages/connect/src/helpers/zod.d.ts +0 -27
- package/dist/packages/connect/src/layouts/MainLayout.vue.d.ts +0 -2
- package/dist/packages/connect/src/main.d.ts +0 -2
- package/dist/packages/connect/src/router/index.d.ts +0 -5
- package/dist/packages/connect/src/router/name.d.ts +0 -2
- package/dist/packages/connect/src/router/shared.d.ts +0 -11
- package/dist/packages/connect/src/sheets/analytic/AnalyticSheet.vue.d.ts +0 -12
- package/dist/packages/connect/src/sheets/campaign/EditCampaignSheet.vue.d.ts +0 -11
- package/dist/packages/connect/src/sheets/campaign/SendVoucherSheet.vue.d.ts +0 -13
- package/dist/packages/connect/src/sheets/card/CardDesignSheet.vue.d.ts +0 -9
- package/dist/packages/connect/src/sheets/card/CreateCardSheet.vue.d.ts +0 -11
- package/dist/packages/connect/src/sheets/collectible/EditRewardSheet.vue.d.ts +0 -15
- package/dist/packages/connect/src/sheets/collectible/EditTitleSheet.vue.d.ts +0 -15
- package/dist/packages/connect/src/sheets/collection/CreateCollectionSheet.vue.d.ts +0 -9
- package/dist/packages/connect/src/sheets/effect/EffectSheet.vue.d.ts +0 -135
- package/dist/packages/connect/src/sheets/member/MemberDetailSheet.vue.d.ts +0 -22
- package/dist/packages/connect/src/sheets/store/StoreSettingSheet.vue.d.ts +0 -80
- package/dist/packages/connect/src/types/index.d.ts +0 -4
- package/dist/packages/connect/src/views/Analytic.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/Marketing.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/Setting.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/Transaction.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/campaign/Broadcast.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/campaign/Promotion.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/campaign/Voucher.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/loyalty/Card.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/loyalty/Member.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/loyalty/Segment.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Credit.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Experience.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Game.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Point.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Tier.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Title.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/store/Store.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/store/StoreRewards.vue.d.ts +0 -2
|
@@ -1,2002 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, createTextVNode, resolveDynamicComponent, createSlots } from "vue";
|
|
2
|
-
import { _ } from "./lodash-DzdmTD20.js";
|
|
3
|
-
import { d as core, J as JsonViewer, z, a as useBusinessStore, S as SvcConfig } from "./app-DgbDbhL-.js";
|
|
4
|
-
import { Z as ZodHelper, _ as _sfc_main$m } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
5
|
-
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-YYVhW73A.js";
|
|
6
|
-
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-Dq2-b-S_.js";
|
|
7
|
-
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-BhacKx5B.js";
|
|
8
|
-
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-7GBNrPXt.js";
|
|
9
|
-
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
10
|
-
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdtoRandomReward, f as featureVersionMapping } from "./index-CdtrQ9tR.js";
|
|
11
|
-
import { _ as _sfc_main$n } from "./ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js";
|
|
12
|
-
import { _ as _sfc_main$o, a as _sfc_main$p, b as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-EF_rHfwT.js";
|
|
13
|
-
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js";
|
|
14
|
-
import { _ as _sfc_main$k, a as _sfc_main$l } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js";
|
|
15
|
-
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-DQaawbHE.js";
|
|
16
|
-
import { _ as _sfc_main$j, T as TEMPLATES } from "./index-FWp9M1yS.js";
|
|
17
|
-
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js";
|
|
18
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BR5rrmUV.js";
|
|
19
|
-
import "./index-BsEqtUmY.js";
|
|
20
|
-
import "./index-Dd3hrFcQ.js";
|
|
21
|
-
import "./index-oQLJE4Uw.js";
|
|
22
|
-
import "./index-Cfo2A0Se.js";
|
|
23
|
-
import { useCoreStore } from "@feedmepos/mf-common";
|
|
24
|
-
import { i as initCollectibleConfig } from "./helper-BhvQ9m6d.js";
|
|
25
|
-
import { C as CollectionUtils } from "./collection.fn-DHlfGYAC.js";
|
|
26
|
-
import { useDialog } from "@feedmepos/ui-library";
|
|
27
|
-
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
28
|
-
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
29
|
-
__name: "SegmentConfigurator",
|
|
30
|
-
props: {
|
|
31
|
-
modelValue: {
|
|
32
|
-
type: Object,
|
|
33
|
-
required: !0
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
emits: ["update:model-value"],
|
|
37
|
-
setup(e, { emit: u }) {
|
|
38
|
-
const o = e, r = computed(() => {
|
|
39
|
-
var t;
|
|
40
|
-
const [s] = isRuleGroup(o.modelValue) ? Object.values(((t = o.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
|
|
41
|
-
return (s ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
|
|
42
|
-
}), a = u;
|
|
43
|
-
return (s, n) => (openBlock(), createBlock(_sfc_main$j, {
|
|
44
|
-
multiselect: !0,
|
|
45
|
-
items: unref(useMembershipStore)().segmentOptions,
|
|
46
|
-
"model-value": unref(r),
|
|
47
|
-
"onUpdate:modelValue": n[0] || (n[0] = (t) => a(
|
|
48
|
-
"update:model-value",
|
|
49
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
50
|
-
unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
51
|
-
unref(RuleBuilder).constructEntry("user.segment", "_hasAny", t)
|
|
52
|
-
)
|
|
53
|
-
)),
|
|
54
|
-
label: "Select segment(s) to match"
|
|
55
|
-
}, null, 8, ["items", "model-value"]));
|
|
56
|
-
}
|
|
57
|
-
}), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$b = { key: 0 }, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
58
|
-
__name: "UserRuleGroup",
|
|
59
|
-
props: {
|
|
60
|
-
modelValue: {
|
|
61
|
-
type: Object,
|
|
62
|
-
default: () => {
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
emits: ["update:model-value"],
|
|
67
|
-
setup(e, { emit: u }) {
|
|
68
|
-
const o = e, r = u, a = ref(
|
|
69
|
-
o.modelValue ? RuleBuilder.getRules(o.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(o.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
|
|
70
|
-
), s = [
|
|
71
|
-
{
|
|
72
|
-
value: "all_users",
|
|
73
|
-
label: "All audience"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
value: "segment",
|
|
77
|
-
label: "Member segment"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
value: "custom",
|
|
81
|
-
label: "Custom audience"
|
|
82
|
-
}
|
|
83
|
-
];
|
|
84
|
-
return watch(a, async (n, t) => {
|
|
85
|
-
var l;
|
|
86
|
-
if (t != "all_users" && t != n && RuleBuilder.getRules(
|
|
87
|
-
(l = o.modelValue) == null ? void 0 : l.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
88
|
-
).length > 0) {
|
|
89
|
-
const c = await prompt.confirm(
|
|
90
|
-
"Are you sure you want to change the audience type? This will remove all the rules you have set."
|
|
91
|
-
);
|
|
92
|
-
c && r(
|
|
93
|
-
"update:model-value",
|
|
94
|
-
RuleBuilder.setRuleToGroup(
|
|
95
|
-
o.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
96
|
-
RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
97
|
-
)
|
|
98
|
-
), a.value = c ? n : t;
|
|
99
|
-
}
|
|
100
|
-
}), (n, t) => {
|
|
101
|
-
var c, y;
|
|
102
|
-
const l = resolveComponent("FmRadio");
|
|
103
|
-
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
104
|
-
createElementVNode("div", null, [
|
|
105
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(s, (m) => createVNode(l, {
|
|
106
|
-
key: m.value,
|
|
107
|
-
value: m.value,
|
|
108
|
-
label: m.label,
|
|
109
|
-
modelValue: unref(a),
|
|
110
|
-
"onUpdate:modelValue": t[0] || (t[0] = (f) => isRef(a) ? a.value = f : null)
|
|
111
|
-
}, null, 8, ["value", "label", "modelValue"])), 64))
|
|
112
|
-
]),
|
|
113
|
-
unref(a) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$b, [
|
|
114
|
-
createVNode(_sfc_main$i, {
|
|
115
|
-
modelValue: ((c = e.modelValue) == null ? void 0 : c.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
116
|
-
"onUpdate:modelValue": t[1] || (t[1] = (m) => r(
|
|
117
|
-
"update:model-value",
|
|
118
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
119
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
120
|
-
m,
|
|
121
|
-
"&&"
|
|
122
|
-
)
|
|
123
|
-
))
|
|
124
|
-
}, null, 8, ["modelValue"])
|
|
125
|
-
])) : createCommentVNode("", !0),
|
|
126
|
-
unref(a) == "custom" ? (openBlock(), createBlock(_sfc_main$k, {
|
|
127
|
-
key: 1,
|
|
128
|
-
"include-only": "user",
|
|
129
|
-
"trigger-type": "MEMBERSHIP_JOINED",
|
|
130
|
-
"model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
|
|
131
|
-
"onUpdate:modelValue": t[2] || (t[2] = (m) => r(
|
|
132
|
-
"update:model-value",
|
|
133
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
134
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
135
|
-
m,
|
|
136
|
-
"&&"
|
|
137
|
-
)
|
|
138
|
-
))
|
|
139
|
-
}, null, 8, ["model-value"])) : createCommentVNode("", !0)
|
|
140
|
-
]);
|
|
141
|
-
};
|
|
142
|
-
}
|
|
143
|
-
}), _hoisted_1$c = { class: "space-y-24" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
144
|
-
__name: "TimeRuleGroup",
|
|
145
|
-
props: {
|
|
146
|
-
modelValue: {
|
|
147
|
-
type: Object,
|
|
148
|
-
default: () => {
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
},
|
|
152
|
-
emits: ["update:model-value"],
|
|
153
|
-
setup(e, { emit: u }) {
|
|
154
|
-
const o = e, r = u, a = ref(
|
|
155
|
-
!o.modelValue || !o.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(o.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
156
|
-
);
|
|
157
|
-
watch(a, async (n, t) => {
|
|
158
|
-
var l;
|
|
159
|
-
if (t == "custom" && n == "all_time" && RuleBuilder.getRules((l = o.modelValue) == null ? void 0 : l.rules.g_time).length > 0) {
|
|
160
|
-
const c = await prompt.confirm(
|
|
161
|
-
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
162
|
-
);
|
|
163
|
-
c && r(
|
|
164
|
-
"update:model-value",
|
|
165
|
-
RuleBuilder.setRuleToGroup(
|
|
166
|
-
o.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
167
|
-
RuleBuilder.scaffoldGroup("g_time")
|
|
168
|
-
)
|
|
169
|
-
), a.value = c ? n : t;
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
async function s(n) {
|
|
173
|
-
var t;
|
|
174
|
-
if (n == "custom" && RuleBuilder.getRules((t = o.modelValue) == null ? void 0 : t.rules.g_time).length > 0) {
|
|
175
|
-
if (!await prompt.confirm(
|
|
176
|
-
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
177
|
-
)) {
|
|
178
|
-
a.value = "all_time";
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
r(
|
|
182
|
-
"update:model-value",
|
|
183
|
-
RuleBuilder.setRuleToGroup(
|
|
184
|
-
o.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
185
|
-
RuleBuilder.scaffoldGroup("g_time")
|
|
186
|
-
)
|
|
187
|
-
);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return (n, t) => {
|
|
191
|
-
var y;
|
|
192
|
-
const l = resolveComponent("FmRadio"), c = resolveComponent("FmRadioGroup");
|
|
193
|
-
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
194
|
-
createVNode(c, {
|
|
195
|
-
modelValue: unref(a),
|
|
196
|
-
"onUpdate:modelValue": [
|
|
197
|
-
t[0] || (t[0] = (m) => isRef(a) ? a.value = m : null),
|
|
198
|
-
t[1] || (t[1] = (m) => s(m))
|
|
199
|
-
]
|
|
200
|
-
}, {
|
|
201
|
-
default: withCtx(() => [
|
|
202
|
-
createVNode(l, {
|
|
203
|
-
label: "All time",
|
|
204
|
-
value: "all_time"
|
|
205
|
-
}),
|
|
206
|
-
createVNode(l, {
|
|
207
|
-
label: "Custom date/time",
|
|
208
|
-
value: "custom"
|
|
209
|
-
})
|
|
210
|
-
]),
|
|
211
|
-
_: 1
|
|
212
|
-
}, 8, ["modelValue"]),
|
|
213
|
-
unref(a) == "custom" ? (openBlock(), createBlock(_sfc_main$k, {
|
|
214
|
-
key: 0,
|
|
215
|
-
class: "!mt-[0px]",
|
|
216
|
-
"include-only": "trigger",
|
|
217
|
-
"trigger-type": "SCHEDULE",
|
|
218
|
-
"model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
219
|
-
"onUpdate:modelValue": t[2] || (t[2] = (m) => r(
|
|
220
|
-
"update:model-value",
|
|
221
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
222
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
223
|
-
m,
|
|
224
|
-
"&&"
|
|
225
|
-
)
|
|
226
|
-
))
|
|
227
|
-
}, null, 8, ["model-value"])) : createCommentVNode("", !0)
|
|
228
|
-
]);
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
}), _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
232
|
-
__name: "BillRuleGroup",
|
|
233
|
-
props: {
|
|
234
|
-
modelValue: {
|
|
235
|
-
type: Object,
|
|
236
|
-
default: () => {
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
emits: ["update:model-value"],
|
|
241
|
-
setup(e, { emit: u }) {
|
|
242
|
-
const o = u;
|
|
243
|
-
return (r, a) => {
|
|
244
|
-
var s;
|
|
245
|
-
return openBlock(), createBlock(_sfc_main$k, {
|
|
246
|
-
"include-only": "bill",
|
|
247
|
-
"trigger-type": "BILL_COMPLETED",
|
|
248
|
-
"model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
|
|
249
|
-
"onUpdate:modelValue": a[0] || (a[0] = (n) => o(
|
|
250
|
-
"update:model-value",
|
|
251
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
252
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
253
|
-
n,
|
|
254
|
-
"&&"
|
|
255
|
-
)
|
|
256
|
-
))
|
|
257
|
-
}, null, 8, ["model-value"]);
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
}), _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
261
|
-
__name: "BirthdayInput",
|
|
262
|
-
props: {
|
|
263
|
-
modelValue: {
|
|
264
|
-
type: Object
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
emits: ["update:model-value"],
|
|
268
|
-
setup(e, { emit: u }) {
|
|
269
|
-
const o = e, r = u, a = computed(() => {
|
|
270
|
-
const { property: s, operator: n, equator: t } = RuleBuilder.simplify(
|
|
271
|
-
o.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
272
|
-
op: "before",
|
|
273
|
-
x: 1
|
|
274
|
-
})
|
|
275
|
-
);
|
|
276
|
-
return {
|
|
277
|
-
property: s,
|
|
278
|
-
operator: n,
|
|
279
|
-
equator: t
|
|
280
|
-
};
|
|
281
|
-
});
|
|
282
|
-
return (s, n) => {
|
|
283
|
-
const t = resolveComponent("FmRadio"), l = resolveComponent("FmStepperField");
|
|
284
|
-
return openBlock(), createElementBlock("div", null, [
|
|
285
|
-
createVNode(t, {
|
|
286
|
-
label: "On birthday",
|
|
287
|
-
value: "_isRange-day",
|
|
288
|
-
"model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
|
|
289
|
-
"onUpdate:modelValue": n[0] || (n[0] = () => {
|
|
290
|
-
r(
|
|
291
|
-
"update:model-value",
|
|
292
|
-
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
293
|
-
op: "this",
|
|
294
|
-
unit: "day",
|
|
295
|
-
ignoreYear: !0
|
|
296
|
-
})
|
|
297
|
-
);
|
|
298
|
-
})
|
|
299
|
-
}, null, 8, ["model-value"]),
|
|
300
|
-
createVNode(t, {
|
|
301
|
-
label: "N days before birthday",
|
|
302
|
-
value: "_isDay",
|
|
303
|
-
"model-value": unref(a).operator,
|
|
304
|
-
"onUpdate:modelValue": n[1] || (n[1] = () => {
|
|
305
|
-
r(
|
|
306
|
-
"update:model-value",
|
|
307
|
-
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
308
|
-
op: "after",
|
|
309
|
-
x: 1,
|
|
310
|
-
ignoreYear: !0
|
|
311
|
-
})
|
|
312
|
-
);
|
|
313
|
-
})
|
|
314
|
-
}, null, 8, ["model-value"]),
|
|
315
|
-
unref(a).operator == "_isDay" ? (openBlock(), createBlock(l, {
|
|
316
|
-
key: 0,
|
|
317
|
-
label: "Days before birthday",
|
|
318
|
-
"show-steppers": !1,
|
|
319
|
-
"model-value": unref(a).equator.x,
|
|
320
|
-
"onUpdate:modelValue": n[2] || (n[2] = (c) => r(
|
|
321
|
-
"update:model-value",
|
|
322
|
-
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
323
|
-
op: "after",
|
|
324
|
-
x: c,
|
|
325
|
-
ignoreYear: !0
|
|
326
|
-
})
|
|
327
|
-
))
|
|
328
|
-
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
329
|
-
createVNode(t, {
|
|
330
|
-
label: "In birthday week",
|
|
331
|
-
value: "_isRange-week",
|
|
332
|
-
"model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
|
|
333
|
-
"onUpdate:modelValue": n[3] || (n[3] = () => {
|
|
334
|
-
r(
|
|
335
|
-
"update:model-value",
|
|
336
|
-
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
337
|
-
op: "this",
|
|
338
|
-
unit: "week",
|
|
339
|
-
ignoreYear: !0
|
|
340
|
-
})
|
|
341
|
-
);
|
|
342
|
-
})
|
|
343
|
-
}, null, 8, ["model-value"]),
|
|
344
|
-
createVNode(t, {
|
|
345
|
-
label: "In birthday month",
|
|
346
|
-
value: "_isRange-month",
|
|
347
|
-
"model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
|
|
348
|
-
"onUpdate:modelValue": n[4] || (n[4] = () => {
|
|
349
|
-
r(
|
|
350
|
-
"update:model-value",
|
|
351
|
-
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
352
|
-
op: "this",
|
|
353
|
-
unit: "month",
|
|
354
|
-
ignoreYear: !0
|
|
355
|
-
})
|
|
356
|
-
);
|
|
357
|
-
})
|
|
358
|
-
}, null, 8, ["model-value"])
|
|
359
|
-
]);
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
}), _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
363
|
-
__name: "FeedbackRuleGroup",
|
|
364
|
-
props: {
|
|
365
|
-
modelValue: {
|
|
366
|
-
type: Object,
|
|
367
|
-
default: () => {
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
},
|
|
371
|
-
emits: ["update:model-value"],
|
|
372
|
-
setup(e, { emit: u }) {
|
|
373
|
-
const o = u;
|
|
374
|
-
return (r, a) => {
|
|
375
|
-
var s;
|
|
376
|
-
return openBlock(), createBlock(_sfc_main$k, {
|
|
377
|
-
"include-only": "feedback",
|
|
378
|
-
"trigger-type": "FEEDBACK",
|
|
379
|
-
"model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
|
|
380
|
-
"onUpdate:modelValue": a[0] || (a[0] = (n) => o(
|
|
381
|
-
"update:model-value",
|
|
382
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
383
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
384
|
-
n,
|
|
385
|
-
"&&"
|
|
386
|
-
)
|
|
387
|
-
))
|
|
388
|
-
}, null, 8, ["model-value"]);
|
|
389
|
-
};
|
|
390
|
-
}
|
|
391
|
-
}), TriggerOptions = {
|
|
392
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.BILL_COMPLETED]: {
|
|
393
|
-
name: "Bill complete",
|
|
394
|
-
description: "Reward customers upon the completion of their bill.",
|
|
395
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.BILL_COMPLETED,
|
|
396
|
-
hidden: !1
|
|
397
|
-
},
|
|
398
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.FEEDBACK]: {
|
|
399
|
-
name: "Feedback",
|
|
400
|
-
description: "Reward customers for providing feedback.",
|
|
401
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.FEEDBACK,
|
|
402
|
-
hidden: !1
|
|
403
|
-
},
|
|
404
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.GAME_COMPLETED]: {
|
|
405
|
-
name: "Game complete",
|
|
406
|
-
description: "Reward customers upon the completion of a game.",
|
|
407
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.GAME_COMPLETED,
|
|
408
|
-
hidden: !1
|
|
409
|
-
},
|
|
410
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.MAKING_ORDER]: {
|
|
411
|
-
name: "Making order",
|
|
412
|
-
description: "Reward customers upon the creation of their order.",
|
|
413
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.MAKING_ORDER,
|
|
414
|
-
hidden: !1
|
|
415
|
-
},
|
|
416
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.MEMBERSHIP_JOINED]: {
|
|
417
|
-
name: "Member joined ",
|
|
418
|
-
description: "Trigger rewards when customers join your membership program.",
|
|
419
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.MEMBERSHIP_JOINED,
|
|
420
|
-
hidden: !1
|
|
421
|
-
},
|
|
422
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.SCHEDULE]: {
|
|
423
|
-
name: "Schedule",
|
|
424
|
-
description: "Set rewards to be triggered at specific times or dates.",
|
|
425
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.SCHEDULE,
|
|
426
|
-
hidden: !1
|
|
427
|
-
},
|
|
428
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.SIMPLE_CLAIM]: {
|
|
429
|
-
name: "Simple claim",
|
|
430
|
-
description: "Activate rewards when customers claim an offer",
|
|
431
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.SIMPLE_CLAIM,
|
|
432
|
-
hidden: !1
|
|
433
|
-
},
|
|
434
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.TIER_UPGRADED]: {
|
|
435
|
-
name: "Tier upgrade",
|
|
436
|
-
description: "Activate rewards when their membership tier gets upgraded.",
|
|
437
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.TIER_UPGRADED,
|
|
438
|
-
hidden: !1
|
|
439
|
-
},
|
|
440
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.ISSUE_REWARD]: {
|
|
441
|
-
name: "Issue reward",
|
|
442
|
-
description: "Triggers whenever customer receives a reward in any kind.",
|
|
443
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.ISSUE_REWARD,
|
|
444
|
-
hidden: !0
|
|
445
|
-
}
|
|
446
|
-
}, TypeToTriggerOptions = Object.fromEntries(
|
|
447
|
-
[
|
|
448
|
-
"VOUCHER",
|
|
449
|
-
"PROMOTION",
|
|
450
|
-
"POINT",
|
|
451
|
-
"CREDIT",
|
|
452
|
-
"MEMBERSHIP",
|
|
453
|
-
"BROADCAST",
|
|
454
|
-
"COIN",
|
|
455
|
-
"REWARD_POOL",
|
|
456
|
-
"GAME"
|
|
457
|
-
].map((e) => {
|
|
458
|
-
const u = CAMPAIGN_TRIGGER[e];
|
|
459
|
-
return [
|
|
460
|
-
e,
|
|
461
|
-
(u == null ? void 0 : u.map((o) => TriggerOptions[o]).filter((o) => !o.hidden)) ?? []
|
|
462
|
-
];
|
|
463
|
-
})
|
|
464
|
-
), _hoisted_1$b = { class: "space-y-16" }, _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1), _hoisted_3$a = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$a = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
465
|
-
__name: "CampaignTriggerInput",
|
|
466
|
-
props: {
|
|
467
|
-
campaignType: {
|
|
468
|
-
type: String,
|
|
469
|
-
required: !0
|
|
470
|
-
},
|
|
471
|
-
modelValue: {
|
|
472
|
-
type: String
|
|
473
|
-
},
|
|
474
|
-
disabled: {
|
|
475
|
-
type: Boolean,
|
|
476
|
-
default: !1
|
|
477
|
-
}
|
|
478
|
-
},
|
|
479
|
-
emits: ["update:model-value"],
|
|
480
|
-
setup(e, { emit: u }) {
|
|
481
|
-
const o = e, r = u, a = computed(() => o.disabled ? TypeToTriggerOptions[o.campaignType].filter(
|
|
482
|
-
(s) => s.value == o.modelValue
|
|
483
|
-
) : TypeToTriggerOptions[o.campaignType]);
|
|
484
|
-
return (s, n) => {
|
|
485
|
-
const t = resolveComponent("FmCard");
|
|
486
|
-
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
487
|
-
_hoisted_2$a,
|
|
488
|
-
createElementVNode("div", _hoisted_3$a, [
|
|
489
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (l) => (openBlock(), createBlock(t, {
|
|
490
|
-
variant: "outlined",
|
|
491
|
-
disabled: o.disabled,
|
|
492
|
-
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
493
|
-
"col-span-3": unref(a).length == 1,
|
|
494
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == l.value,
|
|
495
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue != l.value
|
|
496
|
-
}]),
|
|
497
|
-
onClick: () => {
|
|
498
|
-
o.modelValue != l.value && !o.disabled && r("update:model-value", l.value);
|
|
499
|
-
},
|
|
500
|
-
key: l.name
|
|
501
|
-
}, {
|
|
502
|
-
default: withCtx(() => [
|
|
503
|
-
createElementVNode("div", _hoisted_4$a, toDisplayString(l.name), 1),
|
|
504
|
-
createElementVNode("div", _hoisted_5$5, toDisplayString(l.description), 1)
|
|
505
|
-
]),
|
|
506
|
-
_: 2
|
|
507
|
-
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
508
|
-
])
|
|
509
|
-
]);
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
}), _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
513
|
-
__name: "DateInput",
|
|
514
|
-
props: {
|
|
515
|
-
label: {
|
|
516
|
-
type: String,
|
|
517
|
-
required: !1
|
|
518
|
-
},
|
|
519
|
-
modelValue: {
|
|
520
|
-
type: Object,
|
|
521
|
-
required: !1
|
|
522
|
-
}
|
|
523
|
-
},
|
|
524
|
-
emits: ["update:model-value"],
|
|
525
|
-
setup(e, { emit: u }) {
|
|
526
|
-
const o = u;
|
|
527
|
-
return (r, a) => {
|
|
528
|
-
const s = resolveComponent("FmButton"), n = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
|
|
529
|
-
return openBlock(), createBlock(t, {
|
|
530
|
-
label: e.label,
|
|
531
|
-
"model-value": e.modelValue || "",
|
|
532
|
-
"onUpdate:modelValue": a[1] || (a[1] = (l) => o("update:model-value", l))
|
|
533
|
-
}, {
|
|
534
|
-
"trigger-button": withCtx(({ opened: l }) => [
|
|
535
|
-
createVNode(n, {
|
|
536
|
-
class: "flex items-center",
|
|
537
|
-
"prepend-icon": "calendar_month",
|
|
538
|
-
"icon-outlined": !l
|
|
539
|
-
}, {
|
|
540
|
-
append: withCtx(() => [
|
|
541
|
-
e.modelValue ? (openBlock(), createBlock(s, {
|
|
542
|
-
key: 0,
|
|
543
|
-
variant: "tertiary",
|
|
544
|
-
icon: "clear",
|
|
545
|
-
onClick: a[0] || (a[0] = (c) => (c.stopPropagation(), o("update:model-value", null)))
|
|
546
|
-
})) : createCommentVNode("", !0)
|
|
547
|
-
]),
|
|
548
|
-
default: withCtx(() => [
|
|
549
|
-
createElementVNode("div", {
|
|
550
|
-
class: normalizeClass(["fm-typo-en-body-lg-400", { "text-fm-color-typo-secondary": !e.modelValue }])
|
|
551
|
-
}, toDisplayString(e.modelValue ? unref(hooks)(e.modelValue).format("DD MMM YYYY") : "DD MM YYYY"), 3)
|
|
552
|
-
]),
|
|
553
|
-
_: 2
|
|
554
|
-
}, 1032, ["icon-outlined"])
|
|
555
|
-
]),
|
|
556
|
-
_: 1
|
|
557
|
-
}, 8, ["label", "model-value"]);
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
}), _hoisted_1$a = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$9 = { class: "flex-1 xs:w-full" }, _hoisted_3$9 = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$9 = { class: "flex-1 xs:w-full" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
561
|
-
__name: "DateRangeInput",
|
|
562
|
-
props: {
|
|
563
|
-
modelValue: {
|
|
564
|
-
type: Object,
|
|
565
|
-
required: !1
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
emits: ["update:model-value"],
|
|
569
|
-
setup(e, { emit: u }) {
|
|
570
|
-
const o = u;
|
|
571
|
-
return (r, a) => {
|
|
572
|
-
var s, n;
|
|
573
|
-
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
574
|
-
createElementVNode("div", _hoisted_2$9, [
|
|
575
|
-
createVNode(_sfc_main$b, {
|
|
576
|
-
"model-value": ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
|
|
577
|
-
label: "Start date",
|
|
578
|
-
"onUpdate:modelValue": a[0] || (a[0] = (t) => {
|
|
579
|
-
var l;
|
|
580
|
-
return o("update:model-value", {
|
|
581
|
-
startDate: t,
|
|
582
|
-
endDate: ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null
|
|
583
|
-
});
|
|
584
|
-
})
|
|
585
|
-
}, null, 8, ["model-value"])
|
|
586
|
-
]),
|
|
587
|
-
_hoisted_3$9,
|
|
588
|
-
createElementVNode("div", _hoisted_4$9, [
|
|
589
|
-
createVNode(_sfc_main$b, {
|
|
590
|
-
"model-value": ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null,
|
|
591
|
-
label: "End date",
|
|
592
|
-
"onUpdate:modelValue": a[1] || (a[1] = (t) => {
|
|
593
|
-
var l;
|
|
594
|
-
return o("update:model-value", {
|
|
595
|
-
startDate: ((l = e.modelValue) == null ? void 0 : l.startDate) ?? null,
|
|
596
|
-
endDate: t
|
|
597
|
-
});
|
|
598
|
-
})
|
|
599
|
-
}, null, 8, ["model-value"])
|
|
600
|
-
])
|
|
601
|
-
]);
|
|
602
|
-
};
|
|
603
|
-
}
|
|
604
|
-
}), _hoisted_1$9 = { class: "space-y-8" }, _hoisted_2$8 = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$8 = {
|
|
605
|
-
key: 0,
|
|
606
|
-
class: "space-y-4"
|
|
607
|
-
}, _hoisted_4$8 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$4 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$2 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
608
|
-
__name: "ScheduleRuleInput",
|
|
609
|
-
props: {
|
|
610
|
-
modelValue: {
|
|
611
|
-
type: Object,
|
|
612
|
-
required: !0
|
|
613
|
-
},
|
|
614
|
-
startDate: {
|
|
615
|
-
type: String
|
|
616
|
-
},
|
|
617
|
-
endDate: {
|
|
618
|
-
type: String
|
|
619
|
-
}
|
|
620
|
-
},
|
|
621
|
-
emits: ["update:model-value"],
|
|
622
|
-
setup(e, { emit: u }) {
|
|
623
|
-
const o = e, r = u;
|
|
624
|
-
function a() {
|
|
625
|
-
const m = RuleBuilder.getRules(o.modelValue);
|
|
626
|
-
return m.length == 0 ? "fixed" : m.some(
|
|
627
|
-
(f) => isRuleEntry(f) && RuleBuilder.simplify(f).operator == "_rrule"
|
|
628
|
-
) ? "repeating" : "fixed";
|
|
629
|
-
}
|
|
630
|
-
const s = ref(a()), n = ref(!1), t = computed(() => {
|
|
631
|
-
const m = RuleBuilder.getRules(o.modelValue), f = m.find(
|
|
632
|
-
(i) => isRuleEntry(i) && RuleBuilder.simplify(i).property == "trigger.date"
|
|
633
|
-
), p = m.find(
|
|
634
|
-
(i) => isRuleEntry(i) && RuleBuilder.simplify(i).property == "trigger.time"
|
|
635
|
-
);
|
|
636
|
-
return {
|
|
637
|
-
date: f ? RuleBuilder.simplify(f).equator : null,
|
|
638
|
-
time: p ? RuleBuilder.simplify(p).equator : null
|
|
639
|
-
};
|
|
640
|
-
}), l = computed(
|
|
641
|
-
() => calculateNextScheduleAt(
|
|
642
|
-
o.modelValue,
|
|
643
|
-
/* @__PURE__ */ new Date(),
|
|
644
|
-
o.startDate ? new Date(o.startDate) : void 0,
|
|
645
|
-
o.endDate ? new Date(o.endDate) : void 0
|
|
646
|
-
)
|
|
647
|
-
);
|
|
648
|
-
function c(m) {
|
|
649
|
-
const f = m.label.toLowerCase(), p = f == "fixed" ? [
|
|
650
|
-
RuleBuilder.constructEntry(
|
|
651
|
-
"trigger.date",
|
|
652
|
-
"_isOnDate",
|
|
653
|
-
(/* @__PURE__ */ new Date()).toISOString()
|
|
654
|
-
),
|
|
655
|
-
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
656
|
-
] : [
|
|
657
|
-
RuleBuilder.constructEntry(
|
|
658
|
-
"trigger.date",
|
|
659
|
-
"_rrule",
|
|
660
|
-
"RRULE:FREQ=DAILY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU"
|
|
661
|
-
),
|
|
662
|
-
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
663
|
-
];
|
|
664
|
-
r(
|
|
665
|
-
"update:model-value",
|
|
666
|
-
RuleBuilder.setRuleToGroup(
|
|
667
|
-
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
668
|
-
p
|
|
669
|
-
)
|
|
670
|
-
), s.value = f;
|
|
671
|
-
}
|
|
672
|
-
function y(m) {
|
|
673
|
-
s.value == "fixed" ? r(
|
|
674
|
-
"update:model-value",
|
|
675
|
-
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
676
|
-
RuleBuilder.constructEntry(
|
|
677
|
-
"trigger.date",
|
|
678
|
-
"_isOnDate",
|
|
679
|
-
m.date
|
|
680
|
-
),
|
|
681
|
-
RuleBuilder.constructEntry(
|
|
682
|
-
"trigger.time",
|
|
683
|
-
"_isOnTime",
|
|
684
|
-
m.time
|
|
685
|
-
)
|
|
686
|
-
])
|
|
687
|
-
) : r(
|
|
688
|
-
"update:model-value",
|
|
689
|
-
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
690
|
-
RuleBuilder.constructEntry(
|
|
691
|
-
"trigger.date",
|
|
692
|
-
"_rrule",
|
|
693
|
-
m.date
|
|
694
|
-
),
|
|
695
|
-
RuleBuilder.constructEntry(
|
|
696
|
-
"trigger.time",
|
|
697
|
-
"_isOnTime",
|
|
698
|
-
m.time
|
|
699
|
-
)
|
|
700
|
-
])
|
|
701
|
-
);
|
|
702
|
-
}
|
|
703
|
-
return (m, f) => {
|
|
704
|
-
const p = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), d = resolveComponent("FmIcon"), g = resolveComponent("FmTooltip"), h = resolveComponent("FmField"), b = resolveComponent("FmCard"), V = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), B = resolveComponent("FmHelperText");
|
|
705
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
706
|
-
createVNode(p, {
|
|
707
|
-
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
708
|
-
"model-value": { label: unref(cases).title(unref(s)) },
|
|
709
|
-
"onUpdate:modelValue": c,
|
|
710
|
-
class: "mb-8"
|
|
711
|
-
}, null, 8, ["model-value"]),
|
|
712
|
-
createElementVNode("div", _hoisted_1$9, [
|
|
713
|
-
createElementVNode("div", _hoisted_2$8, [
|
|
714
|
-
createVNode(i, {
|
|
715
|
-
label: "Notify time",
|
|
716
|
-
"model-value": unref(t).time,
|
|
717
|
-
"onUpdate:modelValue": f[0] || (f[0] = (v) => y({ date: unref(t).date, time: v })),
|
|
718
|
-
"helper-text": unref(t).time ? void 0 : "Time is required",
|
|
719
|
-
"helper-state": unref(t).time ? void 0 : "error"
|
|
720
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
721
|
-
unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
|
|
722
|
-
createElementVNode("div", _hoisted_4$8, [
|
|
723
|
-
_hoisted_5$4,
|
|
724
|
-
unref(t).date ? (openBlock(), createBlock(g, {
|
|
725
|
-
key: 0,
|
|
726
|
-
"z-index": 9999,
|
|
727
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
|
|
728
|
-
}, {
|
|
729
|
-
default: withCtx(() => [
|
|
730
|
-
createVNode(d, {
|
|
731
|
-
name: "info",
|
|
732
|
-
size: "sm",
|
|
733
|
-
outline: !0
|
|
734
|
-
})
|
|
735
|
-
]),
|
|
736
|
-
_: 1
|
|
737
|
-
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
738
|
-
]),
|
|
739
|
-
createVNode(V, {
|
|
740
|
-
"show-popover": unref(n),
|
|
741
|
-
onPopoverChanged: f[3] || (f[3] = (v) => n.value = v)
|
|
742
|
-
}, {
|
|
743
|
-
"popover-button": withCtx(() => [
|
|
744
|
-
createVNode(h, {
|
|
745
|
-
class: "cursor-pointer",
|
|
746
|
-
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
747
|
-
"helper-state": unref(t).date ? void 0 : "error"
|
|
748
|
-
}, {
|
|
749
|
-
default: withCtx(() => [
|
|
750
|
-
createElementVNode("div", _hoisted_6$2, toDisplayString(unref(t).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options) : "Set a repeating date"), 1)
|
|
751
|
-
]),
|
|
752
|
-
_: 1
|
|
753
|
-
}, 8, ["helper-text", "helper-state"])
|
|
754
|
-
]),
|
|
755
|
-
default: withCtx(() => [
|
|
756
|
-
createVNode(b, { class: "elevated p-8 w-[450px]" }, {
|
|
757
|
-
default: withCtx(() => [
|
|
758
|
-
createVNode(_sfc_main$l, {
|
|
759
|
-
"apply-button": !0,
|
|
760
|
-
"model-value": unref(t).date || "",
|
|
761
|
-
onCancel: f[1] || (f[1] = (v) => n.value = !1),
|
|
762
|
-
"onUpdate:modelValue": f[2] || (f[2] = (v) => (y({ date: v, time: unref(t).time }), n.value = !1))
|
|
763
|
-
}, null, 8, ["model-value"])
|
|
764
|
-
]),
|
|
765
|
-
_: 1
|
|
766
|
-
})
|
|
767
|
-
]),
|
|
768
|
-
_: 1
|
|
769
|
-
}, 8, ["show-popover"])
|
|
770
|
-
])) : (openBlock(), createBlock(k, {
|
|
771
|
-
key: 1,
|
|
772
|
-
label: "Notify date",
|
|
773
|
-
"model-value": unref(t).date || "",
|
|
774
|
-
"onUpdate:modelValue": f[4] || (f[4] = (v) => y({ date: v, time: unref(t).time })),
|
|
775
|
-
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
776
|
-
"helper-state": unref(t).date ? void 0 : "error"
|
|
777
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
778
|
-
]),
|
|
779
|
-
unref(t).date && unref(t).time && unref(l) ? (openBlock(), createBlock(B, {
|
|
780
|
-
key: 0,
|
|
781
|
-
text: `${unref(hooks)(unref(l)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(l)).format("dddd, DD MMM YYYY")} at
|
|
782
|
-
${unref(hooks)(unref(l)).format("hh:mmA")} (${unref(hooks)(unref(l)).fromNow()})`
|
|
783
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
784
|
-
])
|
|
785
|
-
], 64);
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
}), _hoisted_1$8 = { class: "space-y-24" }, _hoisted_2$7 = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$7 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$3 = { class: "flex items-center gap-16" }, _hoisted_6$1 = {
|
|
789
|
-
key: 0,
|
|
790
|
-
class: "mr-32"
|
|
791
|
-
}, _hoisted_7$1 = /* @__PURE__ */ createElementVNode("div", null, "to every", -1), _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
792
|
-
__name: "EarningOptionInput",
|
|
793
|
-
props: {
|
|
794
|
-
modelValue: {
|
|
795
|
-
type: Object
|
|
796
|
-
},
|
|
797
|
-
extras: {
|
|
798
|
-
type: Object
|
|
799
|
-
},
|
|
800
|
-
fixedType: {
|
|
801
|
-
type: Boolean
|
|
802
|
-
},
|
|
803
|
-
errorText: {
|
|
804
|
-
type: String
|
|
805
|
-
}
|
|
806
|
-
},
|
|
807
|
-
emits: ["update:model-value"],
|
|
808
|
-
setup(e, { emit: u }) {
|
|
809
|
-
const o = e, r = u, a = [
|
|
810
|
-
{
|
|
811
|
-
label: "Based on spending",
|
|
812
|
-
sublabel: "Customers earn rewards based on how much they spend.",
|
|
813
|
-
value: "PROPORTIONAL"
|
|
814
|
-
},
|
|
815
|
-
{
|
|
816
|
-
label: "Fixed amount",
|
|
817
|
-
sublabel: "Customers earn a set amount of rewards for specific actions.",
|
|
818
|
-
value: "FIXED"
|
|
819
|
-
}
|
|
820
|
-
].filter((t) => {
|
|
821
|
-
var l;
|
|
822
|
-
return o.fixedType || ((l = o.extras) == null ? void 0 : l.event.type) != "BILL_COMPLETED" ? t.value == "FIXED" : !0;
|
|
823
|
-
}), s = computed(() => {
|
|
824
|
-
const t = FdoEarningOption.safeParse(o.modelValue);
|
|
825
|
-
return t.success ? [] : t.error.errors;
|
|
826
|
-
});
|
|
827
|
-
function n(t) {
|
|
828
|
-
var l;
|
|
829
|
-
t != ((l = o.modelValue) == null ? void 0 : l.type) && r(
|
|
830
|
-
"update:model-value",
|
|
831
|
-
t === "FIXED" ? {
|
|
832
|
-
type: "FIXED",
|
|
833
|
-
amount: 1
|
|
834
|
-
} : {
|
|
835
|
-
type: "PROPORTIONAL",
|
|
836
|
-
amount: 1,
|
|
837
|
-
every: 1
|
|
838
|
-
}
|
|
839
|
-
);
|
|
840
|
-
}
|
|
841
|
-
return (t, l) => {
|
|
842
|
-
var f, p, i;
|
|
843
|
-
const c = resolveComponent("FmCard"), y = resolveComponent("FmStepperField"), m = resolveComponent("FmHelperText");
|
|
844
|
-
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
845
|
-
createElementVNode("div", _hoisted_2$7, [
|
|
846
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (d) => {
|
|
847
|
-
var g, h;
|
|
848
|
-
return openBlock(), createBlock(c, {
|
|
849
|
-
variant: "outlined",
|
|
850
|
-
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
851
|
-
"col-span-2": unref(a).length == 1,
|
|
852
|
-
"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.type) === d.value,
|
|
853
|
-
"hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != d.value
|
|
854
|
-
}]),
|
|
855
|
-
onClick: (b) => n(d.value),
|
|
856
|
-
key: d.value
|
|
857
|
-
}, {
|
|
858
|
-
default: withCtx(() => [
|
|
859
|
-
createElementVNode("div", _hoisted_3$7, toDisplayString(d.label), 1),
|
|
860
|
-
createElementVNode("div", _hoisted_4$7, toDisplayString(d.sublabel), 1)
|
|
861
|
-
]),
|
|
862
|
-
_: 2
|
|
863
|
-
}, 1032, ["class", "onClick"]);
|
|
864
|
-
}), 128))
|
|
865
|
-
]),
|
|
866
|
-
createElementVNode("div", _hoisted_5$3, [
|
|
867
|
-
createVNode(y, {
|
|
868
|
-
label: "Receive amount",
|
|
869
|
-
class: "flex-1",
|
|
870
|
-
"model-value": ((f = e.modelValue) == null ? void 0 : f.amount) ?? null,
|
|
871
|
-
"onUpdate:modelValue": l[0] || (l[0] = (d) => r("update:model-value", {
|
|
872
|
-
...e.modelValue ?? { type: "FIXED" },
|
|
873
|
-
amount: d
|
|
874
|
-
}))
|
|
875
|
-
}, {
|
|
876
|
-
append: withCtx(() => {
|
|
877
|
-
var d;
|
|
878
|
-
return [
|
|
879
|
-
e.extras ? (openBlock(), createElementBlock("div", _hoisted_6$1, toDisplayString(unref(CollectibleOptions)[(d = e.extras) == null ? void 0 : d.type].name.toLowerCase()) + "(s) ", 1)) : createCommentVNode("", !0)
|
|
880
|
-
];
|
|
881
|
-
}),
|
|
882
|
-
_: 1
|
|
883
|
-
}, 8, ["model-value"]),
|
|
884
|
-
((p = e.modelValue) == null ? void 0 : p.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
885
|
-
_hoisted_7$1,
|
|
886
|
-
createVNode(y, {
|
|
887
|
-
label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
888
|
-
class: "flex-1",
|
|
889
|
-
"model-value": ((i = e.modelValue) == null ? void 0 : i.every) ?? null,
|
|
890
|
-
"onUpdate:modelValue": l[1] || (l[1] = (d) => r("update:model-value", { ...e.modelValue, every: d }))
|
|
891
|
-
}, {
|
|
892
|
-
prepend: withCtx(() => [
|
|
893
|
-
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
894
|
-
]),
|
|
895
|
-
_: 1
|
|
896
|
-
}, 8, ["label", "model-value"])
|
|
897
|
-
], 64)) : createCommentVNode("", !0)
|
|
898
|
-
]),
|
|
899
|
-
e.errorText || unref(s).length > 0 ? (openBlock(), createBlock(m, {
|
|
900
|
-
key: 0,
|
|
901
|
-
class: "!mt-4",
|
|
902
|
-
text: e.errorText || unref(ZodHelper).helperText(unref(s), ""),
|
|
903
|
-
state: "error"
|
|
904
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
905
|
-
]);
|
|
906
|
-
};
|
|
907
|
-
}
|
|
908
|
-
}), _hoisted_1$7 = { class: "space-y-16" }, _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$6 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$2 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
909
|
-
__name: "GameTypeInput",
|
|
910
|
-
props: {
|
|
911
|
-
modelValue: {
|
|
912
|
-
type: String
|
|
913
|
-
}
|
|
914
|
-
},
|
|
915
|
-
emits: ["update:model-value"],
|
|
916
|
-
setup(e, { emit: u }) {
|
|
917
|
-
const o = e, r = u, a = computed(
|
|
918
|
-
() => [
|
|
919
|
-
{
|
|
920
|
-
label: "Fortune Wheel",
|
|
921
|
-
description: "Allow customers to spin the Fortune Wheel to win various rewards.",
|
|
922
|
-
value: F_GAME_TYPE.enum.FORTUNE_WHEEL,
|
|
923
|
-
hidden: !1
|
|
924
|
-
},
|
|
925
|
-
{
|
|
926
|
-
label: "Rock paper scissor",
|
|
927
|
-
description: "Customers play a game of Rock Paper Scissors against the cashier.",
|
|
928
|
-
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
929
|
-
hidden: !0
|
|
930
|
-
}
|
|
931
|
-
].filter((s) => !s.hidden)
|
|
932
|
-
);
|
|
933
|
-
return (s, n) => {
|
|
934
|
-
const t = resolveComponent("FmCard");
|
|
935
|
-
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
936
|
-
_hoisted_2$6,
|
|
937
|
-
createElementVNode("div", _hoisted_3$6, [
|
|
938
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (l) => (openBlock(), createBlock(t, {
|
|
939
|
-
variant: "outlined",
|
|
940
|
-
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
941
|
-
"col-span-2": unref(a).length == 1,
|
|
942
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == l.value,
|
|
943
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue != l.value
|
|
944
|
-
}]),
|
|
945
|
-
onClick: () => {
|
|
946
|
-
o.modelValue != l.value && r("update:model-value", l.value);
|
|
947
|
-
},
|
|
948
|
-
key: l.value
|
|
949
|
-
}, {
|
|
950
|
-
default: withCtx(() => [
|
|
951
|
-
createElementVNode("div", _hoisted_4$6, toDisplayString(l.label), 1),
|
|
952
|
-
createElementVNode("div", _hoisted_5$2, toDisplayString(l.description), 1)
|
|
953
|
-
]),
|
|
954
|
-
_: 2
|
|
955
|
-
}, 1032, ["class", "onClick"]))), 128))
|
|
956
|
-
])
|
|
957
|
-
]);
|
|
958
|
-
};
|
|
959
|
-
}
|
|
960
|
-
}), _hoisted_1$6 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _hoisted_2$5 = /* @__PURE__ */ createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1), _hoisted_3$5 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _hoisted_4$5 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), _hoisted_5$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
961
|
-
__name: "VoucherEditor",
|
|
962
|
-
props: {
|
|
963
|
-
modelValue: {
|
|
964
|
-
type: Object
|
|
965
|
-
},
|
|
966
|
-
rewardImage: {
|
|
967
|
-
type: Object
|
|
968
|
-
}
|
|
969
|
-
},
|
|
970
|
-
emits: ["update:model-value", "update:reward-image"],
|
|
971
|
-
setup(e, { emit: u }) {
|
|
972
|
-
const r = ref(
|
|
973
|
-
e.modelValue ?? initCollectibleConfig("VOUCHER", {
|
|
974
|
-
business: useCoreStore().currentBusiness.value._id,
|
|
975
|
-
name: ""
|
|
976
|
-
})
|
|
977
|
-
), a = FdtoCollectibleConfig, s = u;
|
|
978
|
-
return (n, t) => {
|
|
979
|
-
var m, f, p;
|
|
980
|
-
const l = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), y = resolveComponent("FmSwitch");
|
|
981
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
982
|
-
createVNode(_sfc_main$m, {
|
|
983
|
-
modelValue: unref(r).name,
|
|
984
|
-
"onUpdate:modelValue": t[0] || (t[0] = (i) => unref(r).name = i),
|
|
985
|
-
label: "Voucher name",
|
|
986
|
-
schema: unref(ZodHelper).typeAtPath(unref(a), "name", [unref(r).type])
|
|
987
|
-
}, null, 8, ["modelValue", "schema"]),
|
|
988
|
-
createVNode(l, {
|
|
989
|
-
class: "!mb-[-16px]",
|
|
990
|
-
modelValue: unref(r).description,
|
|
991
|
-
"onUpdate:modelValue": t[1] || (t[1] = (i) => unref(r).description = i),
|
|
992
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(a), "description", [unref(r).type])]
|
|
993
|
-
}, {
|
|
994
|
-
label: withCtx(() => [
|
|
995
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
996
|
-
unref(ZodHelper).toInputLabel(
|
|
997
|
-
unref(ZodHelper).typeAtPath(unref(a), "description", [unref(r).type]),
|
|
998
|
-
"Voucher description"
|
|
999
|
-
)
|
|
1000
|
-
)))
|
|
1001
|
-
]),
|
|
1002
|
-
_: 1
|
|
1003
|
-
}, 8, ["modelValue", "rules"]),
|
|
1004
|
-
createElementVNode("div", _hoisted_1$6, [
|
|
1005
|
-
_hoisted_2$5,
|
|
1006
|
-
createElementVNode("div", null, toDisplayString(((m = unref(r).description) == null ? void 0 : m.length) ?? 0) + "/200", 1)
|
|
1007
|
-
]),
|
|
1008
|
-
createVNode(_sfc_main$n, {
|
|
1009
|
-
class: "w-1/2 xs:w-2/3",
|
|
1010
|
-
"aspect-ratio": "16/9",
|
|
1011
|
-
file: e.rewardImage ?? void 0,
|
|
1012
|
-
thumbnail: unref(r).image ?? void 0,
|
|
1013
|
-
"onUpdate:file": t[2] || (t[2] = async (i) => {
|
|
1014
|
-
s("update:reward-image", i), i || (unref(r).image = null);
|
|
1015
|
-
})
|
|
1016
|
-
}, {
|
|
1017
|
-
label: withCtx(() => [
|
|
1018
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1019
|
-
unref(ZodHelper).toInputLabel(
|
|
1020
|
-
unref(ZodHelper).typeAtPath(unref(a), "image", [unref(r).type]),
|
|
1021
|
-
"Voucher image"
|
|
1022
|
-
)
|
|
1023
|
-
)))
|
|
1024
|
-
]),
|
|
1025
|
-
_: 1
|
|
1026
|
-
}, 8, ["file", "thumbnail"]),
|
|
1027
|
-
_hoisted_3$5,
|
|
1028
|
-
createVNode(_sfc_main$o, {
|
|
1029
|
-
"model-value": unref(r).extras.effect,
|
|
1030
|
-
"onUpdate:modelValue": t[3] || (t[3] = (i) => unref(r).extras.effect = i)
|
|
1031
|
-
}, null, 8, ["model-value"]),
|
|
1032
|
-
unref(r).extras.effect == null ? (openBlock(), createBlock(c, {
|
|
1033
|
-
key: 0,
|
|
1034
|
-
class: "!mt-8",
|
|
1035
|
-
text: "Effect is required",
|
|
1036
|
-
state: "error"
|
|
1037
|
-
})) : createCommentVNode("", !0),
|
|
1038
|
-
_hoisted_4$5,
|
|
1039
|
-
createVNode(_sfc_main$p, {
|
|
1040
|
-
"model-value": unref(r).options,
|
|
1041
|
-
"no-campaign": unref(r).noCampaign,
|
|
1042
|
-
"onUpdate:modelValue": t[4] || (t[4] = (i) => unref(r).options = i),
|
|
1043
|
-
schema: unref(ZodHelper).typeAtPath(unref(a), "options", ["VOUCHER"])
|
|
1044
|
-
}, null, 8, ["model-value", "no-campaign", "schema"]),
|
|
1045
|
-
_hoisted_5$1,
|
|
1046
|
-
unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
1047
|
-
key: 1,
|
|
1048
|
-
"model-value": ((p = (f = unref(r).extras) == null ? void 0 : f.targetLocation) == null ? void 0 : p.map(String)) ?? null,
|
|
1049
|
-
type: "select",
|
|
1050
|
-
"onUpdate:modelValue": t[5] || (t[5] = (i) => {
|
|
1051
|
-
unref(r).extras.targetLocation = i;
|
|
1052
|
-
}),
|
|
1053
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(a), "extras.targetLocation")]
|
|
1054
|
-
}, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0),
|
|
1055
|
-
createVNode(y, {
|
|
1056
|
-
modelValue: unref(r).internal,
|
|
1057
|
-
"onUpdate:modelValue": t[6] || (t[6] = (i) => unref(r).internal = i),
|
|
1058
|
-
"label-placement": "right",
|
|
1059
|
-
label: "Internal only",
|
|
1060
|
-
sublabel: "Voucher will not be shown to customer"
|
|
1061
|
-
}, null, 8, ["modelValue"])
|
|
1062
|
-
], 64);
|
|
1063
|
-
};
|
|
1064
|
-
}
|
|
1065
|
-
}), _hoisted_1$5 = {
|
|
1066
|
-
key: 0,
|
|
1067
|
-
class: "flex flex-col gap-y-24"
|
|
1068
|
-
}, _hoisted_2$4 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1), _hoisted_4$4 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1069
|
-
__name: "EditRewardPoolSheet",
|
|
1070
|
-
emits: ["update:model-value"],
|
|
1071
|
-
setup(e, { expose: u, emit: o }) {
|
|
1072
|
-
const r = useMembershipStore(), { minor: a } = useLoading, s = ref(!1), n = ref(), t = ref(), l = ref(0), c = FdtoRandomReward, y = computed(() => {
|
|
1073
|
-
const i = c.safeParse(n.value);
|
|
1074
|
-
return i.success ? [] : i.error.errors;
|
|
1075
|
-
});
|
|
1076
|
-
function m(i, d, g) {
|
|
1077
|
-
i && (n.value = d, l.value = g), s.value = i;
|
|
1078
|
-
}
|
|
1079
|
-
const f = o;
|
|
1080
|
-
async function p() {
|
|
1081
|
-
const i = c.safeParse(n.value);
|
|
1082
|
-
i.success && (await a(
|
|
1083
|
-
async () => {
|
|
1084
|
-
i.data.type === "VOUCHER" && t.value && (i.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1085
|
-
i.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
|
|
1086
|
-
t.value
|
|
1087
|
-
));
|
|
1088
|
-
},
|
|
1089
|
-
{
|
|
1090
|
-
message: "Uploading reward image",
|
|
1091
|
-
successMessage: "Reward image updated"
|
|
1092
|
-
}
|
|
1093
|
-
), f("update:model-value", i.data, l.value));
|
|
1094
|
-
}
|
|
1095
|
-
return u({
|
|
1096
|
-
showSheet: m
|
|
1097
|
-
}), (i, d) => {
|
|
1098
|
-
const g = resolveComponent("FmSelect"), h = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), V = resolveComponent("FmSideSheet");
|
|
1099
|
-
return openBlock(), createBlock(V, {
|
|
1100
|
-
"max-width": 560,
|
|
1101
|
-
modelValue: unref(s),
|
|
1102
|
-
"onUpdate:modelValue": [
|
|
1103
|
-
d[9] || (d[9] = (k) => isRef(s) ? s.value = k : null),
|
|
1104
|
-
d[10] || (d[10] = (k) => s.value = k)
|
|
1105
|
-
],
|
|
1106
|
-
header: "Edit reward",
|
|
1107
|
-
"dismiss-away": ""
|
|
1108
|
-
}, {
|
|
1109
|
-
"side-sheet-footer": withCtx(() => [
|
|
1110
|
-
createElementVNode("div", _hoisted_4$4, [
|
|
1111
|
-
createVNode(b, {
|
|
1112
|
-
variant: "primary",
|
|
1113
|
-
type: "button",
|
|
1114
|
-
disabled: unref(y).length > 0,
|
|
1115
|
-
label: "Confirm",
|
|
1116
|
-
onClick: d[7] || (d[7] = (k) => p())
|
|
1117
|
-
}, null, 8, ["disabled"]),
|
|
1118
|
-
createVNode(b, {
|
|
1119
|
-
variant: "secondary",
|
|
1120
|
-
type: "button",
|
|
1121
|
-
label: "Cancel",
|
|
1122
|
-
onClick: d[8] || (d[8] = (k) => s.value = !1)
|
|
1123
|
-
})
|
|
1124
|
-
])
|
|
1125
|
-
]),
|
|
1126
|
-
default: withCtx(() => {
|
|
1127
|
-
var k, B;
|
|
1128
|
-
return [
|
|
1129
|
-
unref(n) ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1130
|
-
createVNode(g, {
|
|
1131
|
-
label: "Reward Type",
|
|
1132
|
-
items: [
|
|
1133
|
-
{ label: "No Reward", value: "NO_REWARD" },
|
|
1134
|
-
{ label: "Voucher", value: "VOUCHER" },
|
|
1135
|
-
{ label: "Loyalty", value: "LOYALTY" }
|
|
1136
|
-
],
|
|
1137
|
-
"model-value": unref(n).type,
|
|
1138
|
-
"onUpdate:modelValue": d[0] || (d[0] = (v) => {
|
|
1139
|
-
v == "NO_REWARD" ? n.value = {
|
|
1140
|
-
type: "NO_REWARD",
|
|
1141
|
-
collectible: null,
|
|
1142
|
-
weight: 1
|
|
1143
|
-
} : v === "VOUCHER" ? n.value = {
|
|
1144
|
-
collectible: null,
|
|
1145
|
-
type: "VOUCHER",
|
|
1146
|
-
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
1147
|
-
business: unref(useCoreStore)().currentBusiness.value._id
|
|
1148
|
-
}),
|
|
1149
|
-
earningOption: {
|
|
1150
|
-
amount: 1,
|
|
1151
|
-
type: "FIXED"
|
|
1152
|
-
},
|
|
1153
|
-
validityOption: {
|
|
1154
|
-
validForDay: 7
|
|
1155
|
-
},
|
|
1156
|
-
weight: 1
|
|
1157
|
-
} : n.value = {
|
|
1158
|
-
collectible: unref(r).loyaltyRewards.raw[0]._id,
|
|
1159
|
-
type: "LOYALTY",
|
|
1160
|
-
earningOption: {
|
|
1161
|
-
amount: 1,
|
|
1162
|
-
type: "FIXED"
|
|
1163
|
-
},
|
|
1164
|
-
validityOption: {
|
|
1165
|
-
validForDay: 7
|
|
1166
|
-
},
|
|
1167
|
-
weight: 1
|
|
1168
|
-
};
|
|
1169
|
-
})
|
|
1170
|
-
}, null, 8, ["model-value"]),
|
|
1171
|
-
unref(n).type == "LOYALTY" ? (openBlock(), createBlock(g, {
|
|
1172
|
-
key: 0,
|
|
1173
|
-
label: "Loyalty type",
|
|
1174
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(n).type])],
|
|
1175
|
-
items: unref(r).loyaltyRewards.items,
|
|
1176
|
-
"model-value": unref(n).collectible,
|
|
1177
|
-
"onUpdate:modelValue": d[1] || (d[1] = (v) => unref(n).collectible = v)
|
|
1178
|
-
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1179
|
-
createVNode(h, {
|
|
1180
|
-
label: "Weight",
|
|
1181
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(n).type])],
|
|
1182
|
-
"model-value": unref(n).weight,
|
|
1183
|
-
"onUpdate:modelValue": d[2] || (d[2] = (v) => n.value = {
|
|
1184
|
-
...unref(n),
|
|
1185
|
-
weight: v
|
|
1186
|
-
})
|
|
1187
|
-
}, null, 8, ["rules", "model-value"]),
|
|
1188
|
-
unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1189
|
-
((k = unref(r).loyaltyRewards.items.find(
|
|
1190
|
-
(v) => {
|
|
1191
|
-
var E;
|
|
1192
|
-
return v.value === ((E = unref(n)) == null ? void 0 : E.collectible);
|
|
1193
|
-
}
|
|
1194
|
-
)) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1195
|
-
_hoisted_2$4,
|
|
1196
|
-
createVNode(_sfc_main$8, {
|
|
1197
|
-
class: "mt-[-8px]",
|
|
1198
|
-
rules: [
|
|
1199
|
-
unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(n).type])
|
|
1200
|
-
],
|
|
1201
|
-
"helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
|
|
1202
|
-
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
1203
|
-
"fixed-type": !0,
|
|
1204
|
-
"model-value": unref(n).earningOption,
|
|
1205
|
-
"onUpdate:modelValue": d[3] || (d[3] = (v) => n.value = {
|
|
1206
|
-
...unref(n),
|
|
1207
|
-
earningOption: v
|
|
1208
|
-
})
|
|
1209
|
-
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1210
|
-
], 64)) : createCommentVNode("", !0),
|
|
1211
|
-
_hoisted_3$4,
|
|
1212
|
-
createVNode(_sfc_main$r, {
|
|
1213
|
-
class: "!gap-24",
|
|
1214
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(n).type])],
|
|
1215
|
-
"model-value": unref(n).validityOption,
|
|
1216
|
-
"onUpdate:modelValue": d[4] || (d[4] = (v) => n.value = {
|
|
1217
|
-
...unref(n),
|
|
1218
|
-
validityOption: v
|
|
1219
|
-
})
|
|
1220
|
-
}, null, 8, ["rules", "model-value"])
|
|
1221
|
-
], 64)) : createCommentVNode("", !0),
|
|
1222
|
-
unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$6, {
|
|
1223
|
-
key: 2,
|
|
1224
|
-
"reward-image": unref(t),
|
|
1225
|
-
"model-value": ((B = unref(n)) == null ? void 0 : B.collectibleConfig) ?? void 0,
|
|
1226
|
-
"onUpdate:modelValue": d[5] || (d[5] = (v) => n.value = {
|
|
1227
|
-
...unref(n),
|
|
1228
|
-
collectibleConfig: v
|
|
1229
|
-
}),
|
|
1230
|
-
"onUpdate:rewardImage": d[6] || (d[6] = (v) => t.value = v)
|
|
1231
|
-
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1232
|
-
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
1233
|
-
])) : createCommentVNode("", !0)
|
|
1234
|
-
];
|
|
1235
|
-
}),
|
|
1236
|
-
_: 1
|
|
1237
|
-
}, 8, ["modelValue"]);
|
|
1238
|
-
};
|
|
1239
|
-
}
|
|
1240
|
-
});
|
|
1241
|
-
function isNullOrEmpty(e) {
|
|
1242
|
-
return e == null || e === "";
|
|
1243
|
-
}
|
|
1244
|
-
const _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1), _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1245
|
-
__name: "RewardPoolInput",
|
|
1246
|
-
props: {
|
|
1247
|
-
modelValue: {
|
|
1248
|
-
type: Array,
|
|
1249
|
-
default: () => [
|
|
1250
|
-
{
|
|
1251
|
-
collectible: null,
|
|
1252
|
-
type: "NO_REWARD",
|
|
1253
|
-
weight: 1
|
|
1254
|
-
}
|
|
1255
|
-
]
|
|
1256
|
-
}
|
|
1257
|
-
},
|
|
1258
|
-
emits: ["update:model-value"],
|
|
1259
|
-
setup(e, { emit: u }) {
|
|
1260
|
-
const o = e, r = u, a = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), n = computed(() => o.modelValue ?? []), t = computed(() => {
|
|
1261
|
-
const i = s.safeParse(n.value);
|
|
1262
|
-
return i.success ? [] : i.error.errors;
|
|
1263
|
-
}), l = ref();
|
|
1264
|
-
function c(i, d) {
|
|
1265
|
-
var h;
|
|
1266
|
-
const g = [...n.value];
|
|
1267
|
-
g[d] = i, (h = l.value) == null || h.showSheet(!1), r("update:model-value", g);
|
|
1268
|
-
}
|
|
1269
|
-
function y(i) {
|
|
1270
|
-
const d = i.type == "VOUCHER" ? i.collectibleConfig : a.collectibles.find(
|
|
1271
|
-
(b) => b._id.toString() == i.collectible
|
|
1272
|
-
), g = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), h = i.weight;
|
|
1273
|
-
return {
|
|
1274
|
-
label: isNullOrEmpty(g) ? "NO REWARD" : g,
|
|
1275
|
-
sublabel: `${h} (${(h / n.value.reduce((b, V) => b + V.weight, 0) * 100).toFixed(2)}%)`
|
|
1276
|
-
};
|
|
1277
|
-
}
|
|
1278
|
-
function m(i) {
|
|
1279
|
-
var g;
|
|
1280
|
-
const d = [...n.value];
|
|
1281
|
-
(g = l.value) == null || g.showSheet(!0, d[i], i);
|
|
1282
|
-
}
|
|
1283
|
-
function f(i) {
|
|
1284
|
-
const d = [...n.value];
|
|
1285
|
-
d.splice(i, 1), r("update:model-value", d);
|
|
1286
|
-
}
|
|
1287
|
-
function p() {
|
|
1288
|
-
var i;
|
|
1289
|
-
(i = l.value) == null || i.showSheet(
|
|
1290
|
-
!0,
|
|
1291
|
-
{
|
|
1292
|
-
type: "NO_REWARD",
|
|
1293
|
-
collectible: null,
|
|
1294
|
-
weight: 1
|
|
1295
|
-
},
|
|
1296
|
-
n.value.length
|
|
1297
|
-
);
|
|
1298
|
-
}
|
|
1299
|
-
return (i, d) => {
|
|
1300
|
-
const g = resolveComponent("FmButton"), h = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
1301
|
-
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
1302
|
-
_hoisted_2$3,
|
|
1303
|
-
createVNode(g, {
|
|
1304
|
-
label: "Add Reward",
|
|
1305
|
-
onClick: d[0] || (d[0] = (V) => p()),
|
|
1306
|
-
variant: "plain",
|
|
1307
|
-
icon: "add"
|
|
1308
|
-
}),
|
|
1309
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (V, k) => (openBlock(), createBlock(h, {
|
|
1310
|
-
key: k,
|
|
1311
|
-
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1312
|
-
variant: "outlined",
|
|
1313
|
-
onClick: (B) => m(k)
|
|
1314
|
-
}, {
|
|
1315
|
-
default: withCtx(() => [
|
|
1316
|
-
createElementVNode("div", null, [
|
|
1317
|
-
createElementVNode("div", _hoisted_3$3, toDisplayString(y(V).label), 1),
|
|
1318
|
-
createElementVNode("div", _hoisted_4$3, toDisplayString(y(V).sublabel), 1)
|
|
1319
|
-
]),
|
|
1320
|
-
createVNode(g, {
|
|
1321
|
-
icon: "delete",
|
|
1322
|
-
variant: "tertiary",
|
|
1323
|
-
onClick: (B) => (B.stopPropagation(), f(k))
|
|
1324
|
-
}, null, 8, ["onClick"])
|
|
1325
|
-
]),
|
|
1326
|
-
_: 2
|
|
1327
|
-
}, 1032, ["onClick"]))), 128)),
|
|
1328
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(b, {
|
|
1329
|
-
key: V.message,
|
|
1330
|
-
text: V.message,
|
|
1331
|
-
state: "error"
|
|
1332
|
-
}, null, 8, ["text"]))), 128)),
|
|
1333
|
-
createVNode(_sfc_main$5, {
|
|
1334
|
-
ref_key: "sheetRef",
|
|
1335
|
-
ref: l,
|
|
1336
|
-
"onUpdate:modelValue": c
|
|
1337
|
-
}, null, 512)
|
|
1338
|
-
]);
|
|
1339
|
-
};
|
|
1340
|
-
}
|
|
1341
|
-
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = {
|
|
1342
|
-
key: 0,
|
|
1343
|
-
class: "grid grid-cols-2 gap-16"
|
|
1344
|
-
}, _hoisted_3$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$2 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1345
|
-
__name: "PromotionGameTypeInput",
|
|
1346
|
-
props: {
|
|
1347
|
-
modelValue: {
|
|
1348
|
-
type: Object
|
|
1349
|
-
}
|
|
1350
|
-
},
|
|
1351
|
-
emits: ["update:model-value"],
|
|
1352
|
-
setup(e, { emit: u }) {
|
|
1353
|
-
const o = e, r = u, a = computed(() => [
|
|
1354
|
-
{
|
|
1355
|
-
label: "Rock paper scissor",
|
|
1356
|
-
description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
|
|
1357
|
-
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
1358
|
-
}
|
|
1359
|
-
]);
|
|
1360
|
-
return (s, n) => {
|
|
1361
|
-
var y, m, f;
|
|
1362
|
-
const t = resolveComponent("FmSwitch"), l = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
|
|
1363
|
-
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
1364
|
-
createVNode(t, {
|
|
1365
|
-
label: "Enable game",
|
|
1366
|
-
"model-value": !!((y = e.modelValue) != null && y.gameType),
|
|
1367
|
-
"onUpdate:modelValue": n[0] || (n[0] = (p) => p ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
|
|
1368
|
-
}, null, 8, ["model-value"]),
|
|
1369
|
-
((m = e.modelValue) == null ? void 0 : m.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
1370
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (p) => {
|
|
1371
|
-
var i, d;
|
|
1372
|
-
return openBlock(), createBlock(l, {
|
|
1373
|
-
variant: "outlined",
|
|
1374
|
-
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1375
|
-
"col-span-2": unref(a).length == 1,
|
|
1376
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((i = e.modelValue) == null ? void 0 : i.gameType) == p.value,
|
|
1377
|
-
"hover:bg-fm-color-opacity-sm": ((d = e.modelValue) == null ? void 0 : d.gameType) != p.value
|
|
1378
|
-
}]),
|
|
1379
|
-
onClick: () => {
|
|
1380
|
-
var g;
|
|
1381
|
-
((g = o.modelValue) == null ? void 0 : g.gameType) != p.value && r("update:model-value", { gameType: p.value });
|
|
1382
|
-
},
|
|
1383
|
-
key: p.value
|
|
1384
|
-
}, {
|
|
1385
|
-
default: withCtx(() => [
|
|
1386
|
-
createElementVNode("div", _hoisted_3$2, toDisplayString(p.label), 1),
|
|
1387
|
-
createElementVNode("div", _hoisted_4$2, toDisplayString(p.description), 1)
|
|
1388
|
-
]),
|
|
1389
|
-
_: 2
|
|
1390
|
-
}, 1032, ["class", "onClick"]);
|
|
1391
|
-
}), 128))
|
|
1392
|
-
])) : createCommentVNode("", !0),
|
|
1393
|
-
((f = e.modelValue) == null ? void 0 : f.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
|
|
1394
|
-
key: 1,
|
|
1395
|
-
text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
|
|
1396
|
-
state: "warning"
|
|
1397
|
-
})) : createCommentVNode("", !0)
|
|
1398
|
-
]);
|
|
1399
|
-
};
|
|
1400
|
-
}
|
|
1401
|
-
}), _hoisted_1$2 = { key: 22 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1402
|
-
__name: "TemplateInput",
|
|
1403
|
-
props: {
|
|
1404
|
-
field: { type: Object, required: !0 },
|
|
1405
|
-
modelValue: {
|
|
1406
|
-
type: Object
|
|
1407
|
-
},
|
|
1408
|
-
schema: {
|
|
1409
|
-
type: Object
|
|
1410
|
-
},
|
|
1411
|
-
extras: {
|
|
1412
|
-
type: Object
|
|
1413
|
-
},
|
|
1414
|
-
helperText: {
|
|
1415
|
-
type: String
|
|
1416
|
-
},
|
|
1417
|
-
disabled: {
|
|
1418
|
-
type: Boolean,
|
|
1419
|
-
default: !1
|
|
1420
|
-
}
|
|
1421
|
-
},
|
|
1422
|
-
emits: ["update:model-value", "update:file"],
|
|
1423
|
-
setup(e, { emit: u }) {
|
|
1424
|
-
const o = e, r = u;
|
|
1425
|
-
function a(l) {
|
|
1426
|
-
switch (o.field.type) {
|
|
1427
|
-
case "timeframe":
|
|
1428
|
-
const c = l.startDate ? hooks(l.startDate).startOf("day").toISOString() : void 0, y = l.endDate ? hooks(l.endDate).endOf("day").toISOString() : void 0;
|
|
1429
|
-
r("update:model-value", {
|
|
1430
|
-
type: "timeframe",
|
|
1431
|
-
property: "__now",
|
|
1432
|
-
start: c,
|
|
1433
|
-
end: y
|
|
1434
|
-
});
|
|
1435
|
-
break;
|
|
1436
|
-
case "image": {
|
|
1437
|
-
r(
|
|
1438
|
-
"update:file",
|
|
1439
|
-
l,
|
|
1440
|
-
s.value || firebaseStorage.collectibleImagePath(void 0, l)
|
|
1441
|
-
);
|
|
1442
|
-
break;
|
|
1443
|
-
}
|
|
1444
|
-
default:
|
|
1445
|
-
r("update:model-value", l);
|
|
1446
|
-
break;
|
|
1447
|
-
}
|
|
1448
|
-
}
|
|
1449
|
-
const s = computed(() => {
|
|
1450
|
-
switch (o.field.type) {
|
|
1451
|
-
case "timeframe": {
|
|
1452
|
-
const l = o.modelValue;
|
|
1453
|
-
return {
|
|
1454
|
-
startDate: l != null && l.start ? hooks(l == null ? void 0 : l.start).format("YYYY-MM-DD") : null,
|
|
1455
|
-
endDate: l != null && l.end ? hooks(l == null ? void 0 : l.end).format("YYYY-MM-DD") : null
|
|
1456
|
-
};
|
|
1457
|
-
}
|
|
1458
|
-
default:
|
|
1459
|
-
return o.modelValue;
|
|
1460
|
-
}
|
|
1461
|
-
});
|
|
1462
|
-
function n() {
|
|
1463
|
-
if (!t.value.schema) return [];
|
|
1464
|
-
const l = t.value.schema.safeParse(o.modelValue);
|
|
1465
|
-
return l.success ? [] : l.error.errors;
|
|
1466
|
-
}
|
|
1467
|
-
const t = computed(() => ({
|
|
1468
|
-
schema: o.schema,
|
|
1469
|
-
unwrapped: o.schema ? ZodHelper.unwrap(o.schema) : void 0,
|
|
1470
|
-
rules: o.schema ? [ZodHelper.ruleAtPath(o.schema, "")] : void 0,
|
|
1471
|
-
labelMark: o.schema && ZodHelper.isRequired(o.schema) == !1 ? "optional" : void 0,
|
|
1472
|
-
zodLabel: o.schema ? ZodHelper.toInputLabel(o.schema, o.field.label) : void 0
|
|
1473
|
-
}));
|
|
1474
|
-
return (l, c) => {
|
|
1475
|
-
var d, g, h, b, V;
|
|
1476
|
-
const y = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), f = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), i = resolveComponent("FmSwitch");
|
|
1477
|
-
return e.field.type === "text" ? (openBlock(), createBlock(y, {
|
|
1478
|
-
key: 0,
|
|
1479
|
-
label: e.field.label,
|
|
1480
|
-
"label-mark": unref(t).labelMark,
|
|
1481
|
-
rules: unref(t).rules,
|
|
1482
|
-
"model-value": unref(s),
|
|
1483
|
-
"onUpdate:modelValue": a
|
|
1484
|
-
}, null, 8, ["label", "label-mark", "rules", "model-value"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1485
|
-
createVNode(JsonViewer, {
|
|
1486
|
-
json: { schema: unref(t).unwrapped, props: o }
|
|
1487
|
-
}, null, 8, ["json"]),
|
|
1488
|
-
createVNode(m, {
|
|
1489
|
-
label: e.field.label,
|
|
1490
|
-
"label-mark": e.field.isRuleChildren ? void 0 : unref(t).labelMark,
|
|
1491
|
-
"model-value": unref(s),
|
|
1492
|
-
rules: e.field.isRuleChildren ? [] : unref(t).rules,
|
|
1493
|
-
"onUpdate:modelValue": a,
|
|
1494
|
-
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
1495
|
-
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
1496
|
-
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
1497
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(f, {
|
|
1498
|
-
key: 2,
|
|
1499
|
-
label: e.field.label,
|
|
1500
|
-
"label-mark": unref(t).labelMark,
|
|
1501
|
-
rules: unref(t).rules,
|
|
1502
|
-
"model-value": unref(s),
|
|
1503
|
-
"onUpdate:modelValue": a,
|
|
1504
|
-
"show-word-count": "",
|
|
1505
|
-
"max-length": (V = (b = (h = (g = (d = unref(t)) == null ? void 0 : d.unwrapped) == null ? void 0 : g._def) == null ? void 0 : h.checks) == null ? void 0 : b.find((k) => k.kind == "max")) == null ? void 0 : V.value
|
|
1506
|
-
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1507
|
-
key: 3,
|
|
1508
|
-
"campaign-type": e.extras,
|
|
1509
|
-
"model-value": unref(s),
|
|
1510
|
-
disabled: e.disabled,
|
|
1511
|
-
"onUpdate:modelValue": a
|
|
1512
|
-
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1513
|
-
createVNode(_sfc_main$a, {
|
|
1514
|
-
"model-value": unref(s),
|
|
1515
|
-
"onUpdate:modelValue": a
|
|
1516
|
-
}, null, 8, ["model-value"]),
|
|
1517
|
-
createVNode(p, {
|
|
1518
|
-
class: "!mt-[8px]",
|
|
1519
|
-
text: unref(ZodHelper).helperText(n(), ""),
|
|
1520
|
-
state: unref(ZodHelper).helperState(n(), "")
|
|
1521
|
-
}, null, 8, ["text", "state"])
|
|
1522
|
-
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
1523
|
-
key: 5,
|
|
1524
|
-
thumbnail: unref(s),
|
|
1525
|
-
"aspect-ratio": "16 / 9",
|
|
1526
|
-
class: "w-1/2 xs:w-2/3",
|
|
1527
|
-
"onUpdate:file": a
|
|
1528
|
-
}, {
|
|
1529
|
-
label: withCtx(() => [
|
|
1530
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
|
|
1531
|
-
]),
|
|
1532
|
-
_: 1
|
|
1533
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(i, {
|
|
1534
|
-
key: 6,
|
|
1535
|
-
label: e.field.label,
|
|
1536
|
-
"label-placement": "right",
|
|
1537
|
-
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
1538
|
-
"label-mark": unref(t).labelMark,
|
|
1539
|
-
rules: unref(t).rules,
|
|
1540
|
-
"model-value": unref(s),
|
|
1541
|
-
"onUpdate:modelValue": a
|
|
1542
|
-
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
|
|
1543
|
-
key: 7,
|
|
1544
|
-
"model-value": unref(s),
|
|
1545
|
-
"onUpdate:modelValue": a,
|
|
1546
|
-
"no-campaign": !1,
|
|
1547
|
-
schema: unref(t).schema
|
|
1548
|
-
}, null, 8, ["model-value", "schema"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
1549
|
-
key: 8,
|
|
1550
|
-
"model-value": unref(s),
|
|
1551
|
-
"onUpdate:modelValue": a
|
|
1552
|
-
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
1553
|
-
createVNode(_sfc_main$o, {
|
|
1554
|
-
"model-value": unref(s),
|
|
1555
|
-
"onUpdate:modelValue": a,
|
|
1556
|
-
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
1557
|
-
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
1558
|
-
unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
|
|
1559
|
-
key: 0,
|
|
1560
|
-
class: "!mt-[8px]",
|
|
1561
|
-
text: "Effect is required",
|
|
1562
|
-
state: "error"
|
|
1563
|
-
}))
|
|
1564
|
-
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$s, {
|
|
1565
|
-
key: 10,
|
|
1566
|
-
"model-value": unref(s),
|
|
1567
|
-
"onUpdate:modelValue": a,
|
|
1568
|
-
"helper-text": unref(ZodHelper).helperText(n(), ""),
|
|
1569
|
-
"trigger-type": e.field.extras,
|
|
1570
|
-
"helper-state": unref(ZodHelper).helperState(n(), "")
|
|
1571
|
-
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
1572
|
-
key: 11,
|
|
1573
|
-
"model-value": unref(s),
|
|
1574
|
-
"onUpdate:modelValue": a,
|
|
1575
|
-
extras: e.extras
|
|
1576
|
-
}, null, 8, ["model-value", "extras"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$r, {
|
|
1577
|
-
key: 12,
|
|
1578
|
-
type: "custom",
|
|
1579
|
-
"model-value": unref(s),
|
|
1580
|
-
"onUpdate:modelValue": a,
|
|
1581
|
-
"helper-text": unref(ZodHelper).helperText(n(), ""),
|
|
1582
|
-
"helper-state": unref(ZodHelper).helperState(n(), "")
|
|
1583
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
1584
|
-
key: 13,
|
|
1585
|
-
"model-value": unref(s),
|
|
1586
|
-
"onUpdate:modelValue": a
|
|
1587
|
-
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
1588
|
-
key: 14,
|
|
1589
|
-
"model-value": unref(s),
|
|
1590
|
-
"onUpdate:modelValue": a
|
|
1591
|
-
}, null, 8, ["model-value"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 15 }, [
|
|
1592
|
-
createVNode(_sfc_main$9, {
|
|
1593
|
-
"model-value": unref(s),
|
|
1594
|
-
"onUpdate:modelValue": a,
|
|
1595
|
-
"start-date": e.extras.start,
|
|
1596
|
-
"end-date": e.extras.end
|
|
1597
|
-
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
1598
|
-
e.helperText ? (openBlock(), createBlock(p, {
|
|
1599
|
-
key: 0,
|
|
1600
|
-
class: "!mt-[8px]",
|
|
1601
|
-
text: e.helperText,
|
|
1602
|
-
state: "error"
|
|
1603
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1604
|
-
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 16 }, [
|
|
1605
|
-
createVNode(_sfc_main$h, {
|
|
1606
|
-
"model-value": unref(s),
|
|
1607
|
-
"onUpdate:modelValue": a
|
|
1608
|
-
}, null, 8, ["model-value"]),
|
|
1609
|
-
e.helperText ? (openBlock(), createBlock(p, {
|
|
1610
|
-
key: 0,
|
|
1611
|
-
class: "!mt-[8px]",
|
|
1612
|
-
text: e.helperText,
|
|
1613
|
-
state: "error"
|
|
1614
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1615
|
-
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 17 }, [
|
|
1616
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
|
|
1617
|
-
key: 0,
|
|
1618
|
-
state: "warning",
|
|
1619
|
-
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
1620
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
1621
|
-
createVNode(_sfc_main$g, {
|
|
1622
|
-
"model-value": unref(s),
|
|
1623
|
-
"onUpdate:modelValue": a
|
|
1624
|
-
}, null, 8, ["model-value"]),
|
|
1625
|
-
e.helperText ? (openBlock(), createBlock(p, {
|
|
1626
|
-
key: 1,
|
|
1627
|
-
class: "!mt-[8px]",
|
|
1628
|
-
text: e.helperText,
|
|
1629
|
-
state: "error"
|
|
1630
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1631
|
-
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 18 }, [
|
|
1632
|
-
createVNode(_sfc_main$f, {
|
|
1633
|
-
"model-value": unref(s),
|
|
1634
|
-
"onUpdate:modelValue": a
|
|
1635
|
-
}, null, 8, ["model-value"]),
|
|
1636
|
-
e.helperText ? (openBlock(), createBlock(p, {
|
|
1637
|
-
key: 0,
|
|
1638
|
-
class: "!mt-[8px]",
|
|
1639
|
-
text: e.helperText,
|
|
1640
|
-
state: "error"
|
|
1641
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1642
|
-
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
1643
|
-
createVNode(_sfc_main$d, {
|
|
1644
|
-
"model-value": unref(s),
|
|
1645
|
-
"onUpdate:modelValue": a
|
|
1646
|
-
}, null, 8, ["model-value"]),
|
|
1647
|
-
e.helperText ? (openBlock(), createBlock(p, {
|
|
1648
|
-
key: 0,
|
|
1649
|
-
class: "!mt-[8px]",
|
|
1650
|
-
text: e.helperText,
|
|
1651
|
-
state: "error"
|
|
1652
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1653
|
-
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
1654
|
-
createVNode(_sfc_main$e, {
|
|
1655
|
-
"model-value": unref(s),
|
|
1656
|
-
"onUpdate:modelValue": a
|
|
1657
|
-
}, null, 8, ["model-value"]),
|
|
1658
|
-
e.helperText ? (openBlock(), createBlock(p, {
|
|
1659
|
-
key: 0,
|
|
1660
|
-
class: "!mt-[8px]",
|
|
1661
|
-
text: e.helperText,
|
|
1662
|
-
state: "error"
|
|
1663
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1664
|
-
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
1665
|
-
createVNode(_sfc_main$3, {
|
|
1666
|
-
"model-value": unref(s),
|
|
1667
|
-
"onUpdate:modelValue": a
|
|
1668
|
-
}, null, 8, ["model-value"]),
|
|
1669
|
-
e.helperText ? (openBlock(), createBlock(p, {
|
|
1670
|
-
key: 0,
|
|
1671
|
-
class: "!mt-[8px]",
|
|
1672
|
-
text: e.helperText,
|
|
1673
|
-
state: "error"
|
|
1674
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1675
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(o.field), 1));
|
|
1676
|
-
};
|
|
1677
|
-
}
|
|
1678
|
-
}), _hoisted_1$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Campaign summary", -1), _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1), _hoisted_3$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1679
|
-
__name: "CampaignSummary",
|
|
1680
|
-
props: {
|
|
1681
|
-
data: {
|
|
1682
|
-
type: Object,
|
|
1683
|
-
required: !0
|
|
1684
|
-
}
|
|
1685
|
-
},
|
|
1686
|
-
setup(e) {
|
|
1687
|
-
return (u, o) => {
|
|
1688
|
-
const r = resolveComponent("FmCard");
|
|
1689
|
-
return openBlock(), createBlock(r, {
|
|
1690
|
-
variant: "outlined",
|
|
1691
|
-
class: "p-16 space-y-8"
|
|
1692
|
-
}, {
|
|
1693
|
-
default: withCtx(() => [
|
|
1694
|
-
_hoisted_1$1,
|
|
1695
|
-
_hoisted_2$1,
|
|
1696
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (a, s) => (openBlock(), createElementBlock("div", {
|
|
1697
|
-
class: "space-y-4",
|
|
1698
|
-
key: s
|
|
1699
|
-
}, [
|
|
1700
|
-
a ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1701
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(s), 1),
|
|
1702
|
-
createElementVNode("div", _hoisted_4$1, toDisplayString(a), 1)
|
|
1703
|
-
], 64)) : createCommentVNode("", !0)
|
|
1704
|
-
]))), 128))
|
|
1705
|
-
]),
|
|
1706
|
-
_: 1
|
|
1707
|
-
});
|
|
1708
|
-
};
|
|
1709
|
-
}
|
|
1710
|
-
}), _hoisted_1 = { class: "xs:hidden px-24 pb-[14px] pt-[22px] flex items-center justify-between w-full border-b" }, _hoisted_2 = { class: "flex items-center gap-8" }, _hoisted_3 = {
|
|
1711
|
-
key: 0,
|
|
1712
|
-
class: "max-w-6xl mx-auto"
|
|
1713
|
-
}, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" }, _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
|
|
1714
|
-
/* @__PURE__ */ createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
|
|
1715
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
1716
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
1717
|
-
/* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
|
|
1718
|
-
/* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
1719
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
1720
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
1721
|
-
]),
|
|
1722
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
1723
|
-
]),
|
|
1724
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
1725
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
1726
|
-
/* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
|
|
1727
|
-
/* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
1728
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
1729
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
1730
|
-
]),
|
|
1731
|
-
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
1732
|
-
])
|
|
1733
|
-
])
|
|
1734
|
-
], -1), _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1735
|
-
__name: "EditCampaignSheet",
|
|
1736
|
-
emits: ["submit:model-value"],
|
|
1737
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
1738
|
-
const Dialog = useDialog(), sheetVisible = ref(!1), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
1739
|
-
TEMPLATES.VOUCHER
|
|
1740
|
-
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
|
|
1741
|
-
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
1742
|
-
var e, u;
|
|
1743
|
-
if (sheetVisible.value = visible, visible == !0) {
|
|
1744
|
-
try {
|
|
1745
|
-
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
1746
|
-
} catch {
|
|
1747
|
-
} finally {
|
|
1748
|
-
await new Promise((o) => setTimeout(o, 120)), isLoading.value = !1;
|
|
1749
|
-
}
|
|
1750
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
1751
|
-
...(u = template.value) == null ? void 0 : u.defaultValue
|
|
1752
|
-
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? `Edit ${CampaignOptions[type].name} Campaign` : `Create ${CampaignOptions[type].name} Campaign`;
|
|
1753
|
-
}
|
|
1754
|
-
}
|
|
1755
|
-
async function hideSheet() {
|
|
1756
|
-
Dialog.open({
|
|
1757
|
-
title: "Unsaved Changes",
|
|
1758
|
-
message: "Are you sure you want to discard this changes?",
|
|
1759
|
-
primaryActions: { text: "Discard", close: !0 },
|
|
1760
|
-
secondaryActions: { text: "Cancel", close: !1 }
|
|
1761
|
-
}).onPrimary(() => {
|
|
1762
|
-
sheetVisible.value = !1;
|
|
1763
|
-
}).onSecondary(() => {
|
|
1764
|
-
Dialog.close();
|
|
1765
|
-
});
|
|
1766
|
-
}
|
|
1767
|
-
const emits = __emit, errors = computed(() => {
|
|
1768
|
-
const e = schema.value.superRefine(campaignRefinement).safeParse(data.value);
|
|
1769
|
-
return e.success ? [] : e.error.errors;
|
|
1770
|
-
});
|
|
1771
|
-
function stepErrors(e = currentStep.value - 1) {
|
|
1772
|
-
const u = template.value.steps[e].groups.flatMap(
|
|
1773
|
-
(o) => o.fields.map((r) => r.property)
|
|
1774
|
-
);
|
|
1775
|
-
return errors.value.filter((o) => u.includes(o.path.join(".")));
|
|
1776
|
-
}
|
|
1777
|
-
__expose({ showSheet });
|
|
1778
|
-
function showSummaryDialog() {
|
|
1779
|
-
Dialog.open({
|
|
1780
|
-
title: "",
|
|
1781
|
-
dialogComponent: _sfc_main$1,
|
|
1782
|
-
dialogComponentProps: {
|
|
1783
|
-
data: data.value
|
|
1784
|
-
}
|
|
1785
|
-
});
|
|
1786
|
-
}
|
|
1787
|
-
function onUpdateProperty(e, u) {
|
|
1788
|
-
if (_.set(data.value, e, u), e == "campaign.event.type") {
|
|
1789
|
-
const o = RuleBuilder.setRuleToGroup(
|
|
1790
|
-
RuleBuilder.scaffoldGroup(),
|
|
1791
|
-
[
|
|
1792
|
-
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1793
|
-
RuleBuilder.scaffoldGroup("g_time"),
|
|
1794
|
-
RuleBuilder.scaffoldGroup("g_user"),
|
|
1795
|
-
RuleBuilder.scaffoldGroup("g_bill")
|
|
1796
|
-
]
|
|
1797
|
-
), r = RuleBuilder.setRuleToGroup(
|
|
1798
|
-
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1799
|
-
[
|
|
1800
|
-
RuleBuilder.constructEntry(
|
|
1801
|
-
"trigger.date",
|
|
1802
|
-
"_rrule",
|
|
1803
|
-
"RRULE:FREQ=DAILY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU"
|
|
1804
|
-
),
|
|
1805
|
-
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
1806
|
-
],
|
|
1807
|
-
"&&"
|
|
1808
|
-
);
|
|
1809
|
-
if (u != "SCHEDULE") {
|
|
1810
|
-
_.set(data.value, "campaign.event.rule", o);
|
|
1811
|
-
return;
|
|
1812
|
-
}
|
|
1813
|
-
_.set(
|
|
1814
|
-
data.value,
|
|
1815
|
-
"campaign.event.rule",
|
|
1816
|
-
RuleBuilder.setRuleToGroup(o, r)
|
|
1817
|
-
);
|
|
1818
|
-
}
|
|
1819
|
-
e == "campaign.notify" && u == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
1820
|
-
}
|
|
1821
|
-
async function onUpdateFile(e, u) {
|
|
1822
|
-
return e ? await minor(async () => firebaseStorage.update(u, e), {
|
|
1823
|
-
message: `${e ? "Uploading" : "Removing"} file`,
|
|
1824
|
-
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
1825
|
-
}) : "";
|
|
1826
|
-
}
|
|
1827
|
-
function isDisable(e) {
|
|
1828
|
-
var u, o;
|
|
1829
|
-
switch (e == null ? void 0 : e.property) {
|
|
1830
|
-
case "campaign.event.type":
|
|
1831
|
-
return ((o = (u = data.value) == null ? void 0 : u.campaign) == null ? void 0 : o._id) || !1;
|
|
1832
|
-
default:
|
|
1833
|
-
return !1;
|
|
1834
|
-
}
|
|
1835
|
-
}
|
|
1836
|
-
function onSubmit() {
|
|
1837
|
-
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
1838
|
-
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
1839
|
-
}
|
|
1840
|
-
return (e, u) => {
|
|
1841
|
-
const o = resolveComponent("FmButton"), r = resolveComponent("FmStep"), a = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), n = resolveComponent("FmTopSheet");
|
|
1842
|
-
return openBlock(), createBlock(n, {
|
|
1843
|
-
"fullscreen-size": "lg",
|
|
1844
|
-
modelValue: unref(sheetVisible),
|
|
1845
|
-
"onUpdate:modelValue": [
|
|
1846
|
-
u[7] || (u[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
|
|
1847
|
-
u[8] || (u[8] = (t) => sheetVisible.value = t)
|
|
1848
|
-
]
|
|
1849
|
-
}, createSlots({
|
|
1850
|
-
"top-sheet-header": withCtx(() => [
|
|
1851
|
-
createElementVNode("div", _hoisted_1, [
|
|
1852
|
-
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
1853
|
-
createElementVNode("div", _hoisted_2, [
|
|
1854
|
-
createVNode(o, {
|
|
1855
|
-
onClick: u[0] || (u[0] = (t) => hideSheet()),
|
|
1856
|
-
label: "Cancel",
|
|
1857
|
-
variant: "tertiary"
|
|
1858
|
-
}),
|
|
1859
|
-
createVNode(o, {
|
|
1860
|
-
onClick: onSubmit,
|
|
1861
|
-
label: "Save",
|
|
1862
|
-
disabled: unref(errors).length > 0
|
|
1863
|
-
}, null, 8, ["disabled"])
|
|
1864
|
-
])
|
|
1865
|
-
])
|
|
1866
|
-
]),
|
|
1867
|
-
_: 2
|
|
1868
|
-
}, [
|
|
1869
|
-
unref(isLoading) ? {
|
|
1870
|
-
name: "default",
|
|
1871
|
-
fn: withCtx(() => [
|
|
1872
|
-
createElementVNode("div", _hoisted_9, [
|
|
1873
|
-
createElementVNode("div", _hoisted_10, [
|
|
1874
|
-
createElementVNode("div", _hoisted_11, [
|
|
1875
|
-
_hoisted_12,
|
|
1876
|
-
createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
1877
|
-
])
|
|
1878
|
-
])
|
|
1879
|
-
])
|
|
1880
|
-
]),
|
|
1881
|
-
key: "1"
|
|
1882
|
-
} : {
|
|
1883
|
-
name: "default",
|
|
1884
|
-
fn: withCtx(() => [
|
|
1885
|
-
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
1886
|
-
createVNode(a, {
|
|
1887
|
-
modelValue: unref(currentStep),
|
|
1888
|
-
"onUpdate:modelValue": u[1] || (u[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
1889
|
-
orientation: "horizontal",
|
|
1890
|
-
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
1891
|
-
}, {
|
|
1892
|
-
default: withCtx(() => [
|
|
1893
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, l) => (openBlock(), createBlock(r, {
|
|
1894
|
-
key: t.name,
|
|
1895
|
-
title: t.name,
|
|
1896
|
-
value: l + 1,
|
|
1897
|
-
error: () => stepErrors(l).length > 0,
|
|
1898
|
-
complete: () => l + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
1899
|
-
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
1900
|
-
]),
|
|
1901
|
-
_: 1
|
|
1902
|
-
}, 8, ["modelValue"]),
|
|
1903
|
-
createElementVNode("div", _hoisted_4, [
|
|
1904
|
-
createVNode(o, {
|
|
1905
|
-
icon: "close",
|
|
1906
|
-
variant: "tertiary",
|
|
1907
|
-
onClick: u[2] || (u[2] = (t) => sheetVisible.value = !1)
|
|
1908
|
-
}),
|
|
1909
|
-
createVNode(a, {
|
|
1910
|
-
modelValue: unref(currentStep),
|
|
1911
|
-
"onUpdate:modelValue": u[3] || (u[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
1912
|
-
orientation: "horizontal",
|
|
1913
|
-
class: "flex-1"
|
|
1914
|
-
}, {
|
|
1915
|
-
default: withCtx(() => [
|
|
1916
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, l) => (openBlock(), createBlock(r, {
|
|
1917
|
-
key: t.name,
|
|
1918
|
-
title: unref(sheetTitle),
|
|
1919
|
-
description: t.name,
|
|
1920
|
-
value: l + 1,
|
|
1921
|
-
error: () => stepErrors(l).length > 0,
|
|
1922
|
-
complete: () => l + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
1923
|
-
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
1924
|
-
]),
|
|
1925
|
-
_: 1
|
|
1926
|
-
}, 8, ["modelValue"]),
|
|
1927
|
-
createVNode(o, {
|
|
1928
|
-
icon: "info",
|
|
1929
|
-
variant: "tertiary",
|
|
1930
|
-
onClick: u[4] || (u[4] = () => showSummaryDialog())
|
|
1931
|
-
})
|
|
1932
|
-
]),
|
|
1933
|
-
createElementVNode("div", _hoisted_5, [
|
|
1934
|
-
createElementVNode("div", _hoisted_6, [
|
|
1935
|
-
createVNode(JsonViewer, {
|
|
1936
|
-
json: {
|
|
1937
|
-
data: unref(data),
|
|
1938
|
-
errors: unref(errors).map(
|
|
1939
|
-
(t) => `${t.path.join(".")} - ${t.message}`
|
|
1940
|
-
),
|
|
1941
|
-
stepErrors: stepErrors().map(
|
|
1942
|
-
(t) => `${t.path.join(".")} - ${t.message}`
|
|
1943
|
-
),
|
|
1944
|
-
schema: unref(schema)
|
|
1945
|
-
}
|
|
1946
|
-
}, null, 8, ["json"]),
|
|
1947
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
1948
|
-
(t) => t.fields.length && (!t.condition || unref(_).get(unref(data), t.condition.property) == t.condition.value == (t.condition.not != !0))
|
|
1949
|
-
), (t, l) => (openBlock(), createElementBlock("div", {
|
|
1950
|
-
key: l,
|
|
1951
|
-
class: "space-y-24"
|
|
1952
|
-
}, [
|
|
1953
|
-
createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
|
|
1954
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (c, y) => (openBlock(), createElementBlock("div", { key: y }, [
|
|
1955
|
-
(openBlock(), createBlock(_sfc_main$2, {
|
|
1956
|
-
key: y,
|
|
1957
|
-
field: c,
|
|
1958
|
-
modelValue: unref(_).get(unref(data), c.property),
|
|
1959
|
-
disabled: isDisable(c),
|
|
1960
|
-
"onUpdate:modelValue": (m) => onUpdateProperty(c.property, m),
|
|
1961
|
-
"onUpdate:file": async (m, f) => {
|
|
1962
|
-
const p = await onUpdateFile(m, f);
|
|
1963
|
-
onUpdateProperty(c.property, p || "");
|
|
1964
|
-
},
|
|
1965
|
-
schema: unref(ZodHelper).typeAtPath(unref(schema), c.property, [
|
|
1966
|
-
unref(data).campaign.type
|
|
1967
|
-
]),
|
|
1968
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors), c.property),
|
|
1969
|
-
extras: c.extras ? unref(_).get(unref(data), c.extras) : void 0
|
|
1970
|
-
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
|
|
1971
|
-
]))), 128))
|
|
1972
|
-
]))), 128)),
|
|
1973
|
-
createElementVNode("div", _hoisted_8, [
|
|
1974
|
-
createVNode(o, {
|
|
1975
|
-
label: "Back",
|
|
1976
|
-
variant: "tertiary",
|
|
1977
|
-
disabled: unref(currentStep) == 1,
|
|
1978
|
-
onClick: u[5] || (u[5] = (t) => currentStep.value--)
|
|
1979
|
-
}, null, 8, ["disabled"]),
|
|
1980
|
-
createVNode(o, {
|
|
1981
|
-
disabled: stepErrors().length > 0,
|
|
1982
|
-
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
|
|
1983
|
-
onClick: u[6] || (u[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
1984
|
-
}, null, 8, ["disabled", "label"])
|
|
1985
|
-
])
|
|
1986
|
-
]),
|
|
1987
|
-
createVNode(_sfc_main$1, {
|
|
1988
|
-
data: unref(data),
|
|
1989
|
-
class: "xs:hidden"
|
|
1990
|
-
}, null, 8, ["data"])
|
|
1991
|
-
])
|
|
1992
|
-
])) : createCommentVNode("", !0)
|
|
1993
|
-
]),
|
|
1994
|
-
key: "0"
|
|
1995
|
-
}
|
|
1996
|
-
]), 1032, ["modelValue"]);
|
|
1997
|
-
};
|
|
1998
|
-
}
|
|
1999
|
-
});
|
|
2000
|
-
export {
|
|
2001
|
-
_sfc_main as _
|
|
2002
|
-
};
|