@feedmepos/mf-connect 0.0.3-beta.0
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/README.md +31 -0
- package/dist/Analytic-Dljae6Yl.js +614 -0
- package/dist/Broadcast-CejuUG-1.js +216 -0
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DAxAfdPe.js +117 -0
- package/dist/Card-BqgQuGNe.js +775 -0
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +97 -0
- package/dist/Collections-CmIFQQxo.js +437 -0
- package/dist/Credit-Bi7zJdvK.js +214 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DLb_mc7S.js +1952 -0
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BN9vbCIU.js +309 -0
- package/dist/Experience-CndnSCnn.js +211 -0
- package/dist/Game-CDctToIr.js +242 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-DMsxZkxf.js +144 -0
- package/dist/JsonViewer-CDb_cQJh.js +87 -0
- package/dist/MainLayout-5NCcYKPh.js +18770 -0
- package/dist/Marketing-DcRex89D.js +309 -0
- package/dist/Member-KDAOZ4y7.js +90 -0
- package/dist/MemberList-7cfMhvnU.js +1752 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/MemberTransactions-Dd1NNP_h.js +38 -0
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bniz5T6m.js +163 -0
- package/dist/Point-B-Yo0tOQ.js +211 -0
- package/dist/Promotion-B2t2rOB2.js +219 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ml889DRQ.js +1461 -0
- package/dist/Segment-quTtfnsL.js +392 -0
- package/dist/Setting-BMQkU33O.js +1862 -0
- package/dist/Store-C0JEZe6U.js +1415 -0
- package/dist/StoreRewards-CozvYaoP.js +432 -0
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BHaiBpBC.js +640 -0
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CASpFDTp.js +124 -0
- package/dist/Tier-DU0ptI0I.js +821 -0
- package/dist/Title-BPvcg94P.js +496 -0
- package/dist/Transaction-Cgs5H5Vg.js +34 -0
- package/dist/Voucher-CMLmRUp5.js +448 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-DRUbn5GO.js +31282 -0
- package/dist/app.js +5 -0
- package/dist/campaign-CpzFl8Vr.js +4 -0
- package/dist/campaign-DmbniSEP.js +93 -0
- package/dist/collection.fn-DHlfGYAC.js +24 -0
- package/dist/dto-ts2Lkngs.js +353 -0
- package/dist/effect-BTYIMeYm.js +61 -0
- package/dist/feedme.ico +0 -0
- package/dist/helper-CRmH0_yS.js +58 -0
- package/dist/index-BTanTa5F.js +64 -0
- package/dist/index-BZbepUcT.js +104 -0
- package/dist/index-C4AxDwBx.js +674 -0
- package/dist/index-CKhgwiA8.js +234 -0
- package/dist/index-ChAaKnz9.js +99 -0
- package/dist/index-CuvNtC_M.js +61 -0
- package/dist/index-DGFTGZj1.js +190 -0
- package/dist/index-Dbd4WA4r.js +61 -0
- package/dist/index-DkxEfDKI.js +1757 -0
- package/dist/index-DzrgTguB.js +38 -0
- package/dist/index-Iej6yAF2.js +8796 -0
- package/dist/index-Ix0P1Q7X.js +1742 -0
- package/dist/index-y3taWZm8.js +29565 -0
- package/dist/libs/packages/core/src/bill/bill.dto.d.ts +75 -0
- package/dist/libs/packages/core/src/bill/index.d.ts +115 -0
- package/dist/libs/packages/core/src/business/index.d.ts +21 -0
- package/dist/libs/packages/core/src/campaign/broadcast/index.d.ts +36 -0
- package/dist/libs/packages/core/src/campaign/campaign.enum.d.ts +3 -0
- package/dist/libs/packages/core/src/campaign/campaign.fn.d.ts +5 -0
- package/dist/libs/packages/core/src/campaign/group.d.ts +25 -0
- package/dist/libs/packages/core/src/campaign/index.d.ts +33448 -0
- package/dist/libs/packages/core/src/collectible/collectible.dto.d.ts +15 -0
- package/dist/libs/packages/core/src/collectible/collectible.enum.d.ts +14 -0
- package/dist/libs/packages/core/src/collectible/helper.d.ts +195 -0
- package/dist/libs/packages/core/src/collectible/index.d.ts +1588 -0
- package/dist/libs/packages/core/src/collectible/pool/index.d.ts +1381 -0
- package/dist/libs/packages/core/src/collection/collection.fn.d.ts +5 -0
- package/dist/libs/packages/core/src/collection/index.d.ts +901 -0
- package/dist/libs/packages/core/src/collection/transaction.d.ts +845 -0
- package/dist/libs/packages/core/src/collection/transaction.fn.d.ts +10 -0
- package/dist/libs/packages/core/src/common/array.d.ts +2 -0
- package/dist/libs/packages/core/src/common/hash.d.ts +10 -0
- package/dist/libs/packages/core/src/common/index.d.ts +42 -0
- package/dist/libs/packages/core/src/common/number.d.ts +7 -0
- package/dist/libs/packages/core/src/common/object.d.ts +5 -0
- package/dist/libs/packages/core/src/common/objectId.d.ts +2 -0
- package/dist/libs/packages/core/src/common/string.d.ts +4 -0
- package/dist/libs/packages/core/src/counter/counter.dto.d.ts +767 -0
- package/dist/libs/packages/core/src/counter/index.d.ts +1 -0
- package/dist/libs/packages/core/src/event/index.d.ts +4246 -0
- package/dist/libs/packages/core/src/feedback/index.d.ts +24 -0
- package/dist/libs/packages/core/src/game/index.d.ts +32 -0
- package/dist/libs/packages/core/src/index.d.ts +21 -0
- package/dist/libs/packages/core/src/internal/index.d.ts +56 -0
- package/dist/libs/packages/core/src/legacy/setting/index.d.ts +89 -0
- package/dist/libs/packages/core/src/location/index.d.ts +44 -0
- package/dist/libs/packages/core/src/loyalty/card/index.d.ts +1287 -0
- package/dist/libs/packages/core/src/loyalty/index.d.ts +3 -0
- package/dist/libs/packages/core/src/loyalty/tier/helper.d.ts +2 -0
- package/dist/libs/packages/core/src/loyalty/tier/index.d.ts +251 -0
- package/dist/libs/packages/core/src/loyalty/title/index.d.ts +4 -0
- package/dist/libs/packages/core/src/marketing-material/index.d.ts +186 -0
- package/dist/libs/packages/core/src/marketing-material/marketing-material.enum.d.ts +3 -0
- package/dist/libs/packages/core/src/notification/index.d.ts +130 -0
- package/dist/libs/packages/core/src/pagination/index.d.ts +25 -0
- package/dist/libs/packages/core/src/permission/index.d.ts +243 -0
- package/dist/libs/packages/core/src/service/index.d.ts +10 -0
- package/dist/libs/packages/core/src/store/dto.d.ts +1060 -0
- package/dist/libs/packages/core/src/store/index.d.ts +3894 -0
- package/dist/libs/packages/core/src/store/store.fn.d.ts +103 -0
- package/dist/libs/packages/core/src/template/index.d.ts +880 -0
- package/dist/libs/packages/core/src/template/templates.d.ts +1217 -0
- package/dist/libs/packages/core/src/user/index.d.ts +245 -0
- package/dist/libs/packages/core/src/user/segment.dto.d.ts +27 -0
- package/dist/libs/packages/core/src/user/segmentation.d.ts +28 -0
- package/dist/libs/packages/core/src/user/user.dto.d.ts +873 -0
- package/dist/libs/packages/core/src/validation/index.d.ts +1 -0
- package/dist/libs/packages/core/src/validation/rule/builder.d.ts +36 -0
- package/dist/libs/packages/core/src/validation/rule/index.d.ts +45 -0
- package/dist/libs/packages/core/src/validation/rule/operator.enum.d.ts +405 -0
- package/dist/libs/packages/core/src/validation/rule/rule.fn.d.ts +6 -0
- package/dist/libs/packages/validation/src/index.d.ts +3 -0
- package/dist/libs/packages/validation/src/rule/rule-builder.d.ts +19 -0
- package/dist/libs/packages/validation/src/rule/rule.d.ts +52 -0
- package/dist/libs/packages/validation/src/rule/validate.d.ts +2 -0
- package/dist/loading-Dy-VtOFu.js +3131 -0
- package/dist/lodash-BnddClG8.js +3678 -0
- package/dist/membership-28vBGpTw.js +213 -0
- package/dist/moment-BWErdI6_.js +2578 -0
- package/dist/money-Ch7o4R5s.js +15 -0
- package/dist/number-BgOMhVX5.js +12 -0
- package/dist/object-qECH92oz.js +26 -0
- package/dist/objectId-dwaoBfJX.js +7 -0
- package/dist/packages/connect/src/App.vue.d.ts +2 -0
- package/dist/packages/connect/src/Entry.vue.d.ts +2 -0
- package/dist/packages/connect/src/api/auth/index.d.ts +3 -0
- package/dist/packages/connect/src/api/campaign/index.d.ts +30 -0
- package/dist/packages/connect/src/api/campaign/template.d.ts +5 -0
- package/dist/packages/connect/src/api/index.d.ts +24 -0
- package/dist/packages/connect/src/api/location/index.d.ts +7 -0
- package/dist/packages/connect/src/api/marketing-material/index.d.ts +7 -0
- package/dist/packages/connect/src/api/member/index.d.ts +12 -0
- package/dist/packages/connect/src/api/membership/index.d.ts +31 -0
- package/dist/packages/connect/src/api/segments/index.d.ts +13 -0
- package/dist/packages/connect/src/api/settings/index.d.ts +4 -0
- package/dist/packages/connect/src/api/transaction/index.d.ts +9 -0
- package/dist/packages/connect/src/api/users/index.d.ts +8 -0
- package/dist/packages/connect/src/app.d.ts +16 -0
- package/dist/packages/connect/src/components/NavigationTab.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/analytic/CampaignCard.vue.d.ts +24 -0
- package/dist/packages/connect/src/components/analytic/CampaignChip.vue.d.ts +47 -0
- package/dist/packages/connect/src/components/analytic/CampaignGroup.vue.d.ts +25 -0
- package/dist/packages/connect/src/components/analytic/CampaignStat.vue.d.ts +31 -0
- package/dist/packages/connect/src/components/analytic/LinkCampaign.vue.d.ts +30 -0
- package/dist/packages/connect/src/components/campaign/CampaignChip.vue.d.ts +13 -0
- package/dist/packages/connect/src/components/campaign/CampaignTriggerInput.vue.d.ts +34 -0
- package/dist/packages/connect/src/components/campaign/EarningOptionInput.vue.d.ts +50 -0
- package/dist/packages/connect/src/components/campaign/GameTypeInput.vue.d.ts +15 -0
- package/dist/packages/connect/src/components/campaign/MessageInput.vue.d.ts +58 -0
- package/dist/packages/connect/src/components/campaign/PromotionGameTypeInput.vue.d.ts +19 -0
- package/dist/packages/connect/src/components/campaign/ScheduleRuleInput.vue.d.ts +29 -0
- package/dist/packages/connect/src/components/campaign/TargetLocationInput.vue.d.ts +32 -0
- package/dist/packages/connect/src/components/campaign/ValidityInput.vue.d.ts +59 -0
- package/dist/packages/connect/src/components/collectible/CollectibleChip.vue.d.ts +13 -0
- package/dist/packages/connect/src/components/collectible/CollectibleOptionInput.vue.d.ts +59 -0
- package/dist/packages/connect/src/components/collection/Collections.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/custom/ChipMenu.vue.d.ts +96 -0
- package/dist/packages/connect/src/components/custom/CustomSelect.vue.d.ts +68 -0
- package/dist/packages/connect/src/components/custom/DateInput.vue.d.ts +24 -0
- package/dist/packages/connect/src/components/custom/DateRangeChip.vue.d.ts +25 -0
- package/dist/packages/connect/src/components/custom/DateRangeInput.vue.d.ts +28 -0
- package/dist/packages/connect/src/components/custom/FilterChip.vue.d.ts +90 -0
- package/dist/packages/connect/src/components/custom/ImageInput.vue.d.ts +115 -0
- package/dist/packages/connect/src/components/custom/json/JsonNode.vue.d.ts +36 -0
- package/dist/packages/connect/src/components/custom/json/JsonViewer.vue.d.ts +22 -0
- package/dist/packages/connect/src/components/custom/zod/ZodTextField.vue.d.ts +52 -0
- package/dist/packages/connect/src/components/loading/ImageLoading.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/loading/LottieAnimation.vue.d.ts +39 -0
- package/dist/packages/connect/src/components/loading/Splash.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/loyalty/CampaignTypeDialog.vue.d.ts +13 -0
- package/dist/packages/connect/src/components/loyalty/CreditCoinDialog.vue.d.ts +29 -0
- package/dist/packages/connect/src/components/loyalty/TierExpression.vue.d.ts +32 -0
- package/dist/packages/connect/src/components/marketing/HeadlineStyleSideSheet.vue.d.ts +42 -0
- package/dist/packages/connect/src/components/marketing/ImageSideSheet.vue.d.ts +40 -0
- package/dist/packages/connect/src/components/marketing/LinkRewardSideSheet.vue.d.ts +30 -0
- package/dist/packages/connect/src/components/marketing/MarketingSheet.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/marketing/RewardDropDown.vue.d.ts +26 -0
- package/dist/packages/connect/src/components/marketing/RightSheet.vue.d.ts +66 -0
- package/dist/packages/connect/src/components/marketing/SlideUpDown.vue.d.ts +27 -0
- package/dist/packages/connect/src/components/marketing/platform/BrandAppImage.vue.d.ts +103 -0
- package/dist/packages/connect/src/components/marketing/platform/FacebookPost.vue.d.ts +103 -0
- package/dist/packages/connect/src/components/marketing/platform/FacebookStory.vue.d.ts +103 -0
- package/dist/packages/connect/src/components/marketing/platform/ImageCanvas.vue.d.ts +81 -0
- package/dist/packages/connect/src/components/marketing/platform/InstagramPost.vue.d.ts +102 -0
- package/dist/packages/connect/src/components/marketing/platform/InstagramReel.vue.d.ts +102 -0
- package/dist/packages/connect/src/components/marketing/platform/InstagramStory.vue.d.ts +102 -0
- package/dist/packages/connect/src/components/marketing/platform/TvImage.vue.d.ts +103 -0
- package/dist/packages/connect/src/components/member/MemberDetail.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/member/MemberList.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/member/MemberOverview.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/member/MemberStatsDialog.vue.d.ts +21 -0
- package/dist/packages/connect/src/components/rule/BillRuleGroup.vue.d.ts +19 -0
- package/dist/packages/connect/src/components/rule/CustomRuleDialog.vue.d.ts +30 -0
- package/dist/packages/connect/src/components/rule/FeedbackRuleGroup.vue.d.ts +19 -0
- package/dist/packages/connect/src/components/rule/PresetRuleDialog.vue.d.ts +20 -0
- package/dist/packages/connect/src/components/rule/RuleConfigurator.vue.d.ts +37 -0
- package/dist/packages/connect/src/components/rule/RuleEntry.vue.d.ts +19 -0
- package/dist/packages/connect/src/components/rule/RuleEquator.vue.d.ts +31 -0
- package/dist/packages/connect/src/components/rule/RuleGroup.vue.d.ts +30 -0
- package/dist/packages/connect/src/components/rule/SegmentConfigurator.vue.d.ts +17 -0
- package/dist/packages/connect/src/components/rule/TimeRuleGroup.vue.d.ts +19 -0
- package/dist/packages/connect/src/components/rule/UserRuleGroup.vue.d.ts +19 -0
- package/dist/packages/connect/src/components/rule/equators/BirthdayInput.vue.d.ts +15 -0
- package/dist/packages/connect/src/components/rule/equators/IsDayInput.vue.d.ts +24 -0
- package/dist/packages/connect/src/components/rule/equators/IsInMonthInput.vue.d.ts +16 -0
- package/dist/packages/connect/src/components/rule/equators/IsRangeInput.vue.d.ts +55 -0
- package/dist/packages/connect/src/components/rule/equators/RruleInput.vue.d.ts +37 -0
- package/dist/packages/connect/src/components/rule/presets.d.ts +18 -0
- package/dist/packages/connect/src/components/segment/ReviewSegment.vue.d.ts +16 -0
- package/dist/packages/connect/src/components/setting/LinkDeviceDialog.vue.d.ts +2 -0
- package/dist/packages/connect/src/components/store/AddBundleCard.vue.d.ts +6 -0
- package/dist/packages/connect/src/components/store/CategoryDialog.vue.d.ts +23 -0
- package/dist/packages/connect/src/components/store/StoreBundleCard.vue.d.ts +20 -0
- package/dist/packages/connect/src/components/store/StoreTransactions.vue.d.ts +10 -0
- package/dist/packages/connect/src/components/stripe/StripeSetting.vue.d.ts +21 -0
- package/dist/packages/connect/src/components/tax/TaxInclusiveSetting.vue.d.ts +30 -0
- package/dist/packages/connect/src/components/tax/TaxVariantSetting.vue.d.ts +24 -0
- package/dist/packages/connect/src/components/template/TemplateDialog.vue.d.ts +24 -0
- package/dist/packages/connect/src/components/template/TemplateInput.vue.d.ts +54 -0
- package/dist/packages/connect/src/components/tier/TierCard.vue.d.ts +39 -0
- package/dist/packages/connect/src/components/transactions/CollectionTransactions.vue.d.ts +10 -0
- package/dist/packages/connect/src/components/transactions/MemberTransactions.vue.d.ts +2 -0
- package/dist/packages/connect/src/composables/index.d.ts +2 -0
- package/dist/packages/connect/src/composables/loading.d.ts +19 -0
- package/dist/packages/connect/src/composables/template.d.ts +7 -0
- package/dist/packages/connect/src/export/collection.export.d.ts +9 -0
- package/dist/packages/connect/src/export/index.d.ts +9 -0
- package/dist/packages/connect/src/export/member.export.d.ts +33 -0
- package/dist/packages/connect/src/helpers/campaign.d.ts +94 -0
- package/dist/packages/connect/src/helpers/collectible.d.ts +58 -0
- package/dist/packages/connect/src/helpers/common.d.ts +1 -0
- package/dist/packages/connect/src/helpers/country.d.ts +21 -0
- package/dist/packages/connect/src/helpers/currency.d.ts +2 -0
- package/dist/packages/connect/src/helpers/effect.d.ts +7 -0
- package/dist/packages/connect/src/helpers/message.d.ts +32 -0
- package/dist/packages/connect/src/helpers/number.d.ts +3 -0
- package/dist/packages/connect/src/helpers/qr.d.ts +7 -0
- package/dist/packages/connect/src/helpers/rrule.d.ts +26 -0
- package/dist/packages/connect/src/helpers/rule.d.ts +91 -0
- package/dist/packages/connect/src/helpers/string.d.ts +16 -0
- package/dist/packages/connect/src/helpers/tax.d.ts +74 -0
- package/dist/packages/connect/src/helpers/trigger.d.ts +59 -0
- package/dist/packages/connect/src/helpers/zod.d.ts +27 -0
- package/dist/packages/connect/src/layouts/MainLayout.vue.d.ts +2 -0
- package/dist/packages/connect/src/main.d.ts +2 -0
- package/dist/packages/connect/src/router/index.d.ts +4 -0
- package/dist/packages/connect/src/router/name.d.ts +3 -0
- package/dist/packages/connect/src/router/shared.d.ts +11 -0
- package/dist/packages/connect/src/sheets/analytic/AnalyticSheet.vue.d.ts +12 -0
- package/dist/packages/connect/src/sheets/campaign/EditCampaignSheet.vue.d.ts +11 -0
- package/dist/packages/connect/src/sheets/campaign/SendVoucherSheet.vue.d.ts +13 -0
- package/dist/packages/connect/src/sheets/card/CardDesignSheet.vue.d.ts +9 -0
- package/dist/packages/connect/src/sheets/card/CreateCardSheet.vue.d.ts +9 -0
- package/dist/packages/connect/src/sheets/collectible/EditRewardSheet.vue.d.ts +15 -0
- package/dist/packages/connect/src/sheets/collectible/EditTitleSheet.vue.d.ts +15 -0
- package/dist/packages/connect/src/sheets/collection/CreateCollectionSheet.vue.d.ts +9 -0
- package/dist/packages/connect/src/sheets/effect/EffectSheet.vue.d.ts +135 -0
- package/dist/packages/connect/src/sheets/member/MemberDetailSheet.vue.d.ts +22 -0
- package/dist/packages/connect/src/sheets/store/StoreSettingSheet.vue.d.ts +80 -0
- package/dist/packages/connect/src/types/index.d.ts +4 -0
- package/dist/packages/connect/src/views/Analytic.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/Marketing.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/Setting.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/Transaction.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/campaign/Broadcast.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/campaign/Promotion.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/campaign/Voucher.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/loyalty/Card.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/loyalty/Member.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/loyalty/Segment.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/program/Credit.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/program/Experience.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/program/Game.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/program/Point.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/program/Tier.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/program/Title.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/store/Store.vue.d.ts +2 -0
- package/dist/packages/connect/src/views/store/StoreRewards.vue.d.ts +2 -0
- package/dist/rule-ByvLGHt_.js +1966 -0
- package/dist/rule-builder-C2aRGLCt.js +89 -0
- package/dist/style.css +1 -0
- package/dist/template-xUeXMsdp.js +190 -0
- package/dist/tier-BJDhpH6X.js +4 -0
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/xlsx-CxXT5AXI.js +15491 -0
- package/package.json +67 -0
|
@@ -0,0 +1,1461 @@
|
|
|
1
|
+
import { defineComponent as A, computed as B, resolveComponent as g, openBlock as r, createElementBlock as T, createElementVNode as x, createVNode as y, unref as e, createTextVNode as ee, toDisplayString as j, withCtx as M, onMounted as Z, createBlock as E, createCommentVNode as q, ref as K, Fragment as D, renderList as N, normalizeClass as P, resolveDynamicComponent as oe, onBeforeMount as ne, isRef as ie, createSlots as me } from "vue";
|
|
2
|
+
import { c as de, C as pe, d as ye, e as ce, f as ve } from "./index-Iej6yAF2.js";
|
|
3
|
+
import { R as Y, a as be } from "./rule-builder-C2aRGLCt.js";
|
|
4
|
+
import { a as fe, R, S as ge, C as $, W as ke, T as ae, O as Ee } from "./rule-ByvLGHt_.js";
|
|
5
|
+
import { p as Te } from "./loading-Dy-VtOFu.js";
|
|
6
|
+
import { useDialog as te, useDialogChild as ue } from "@feedmepos/ui-library";
|
|
7
|
+
import { h as J } from "./moment-BWErdI6_.js";
|
|
8
|
+
import { z as Se, a as re } from "./app-DRUbn5GO.js";
|
|
9
|
+
import { u as Q } from "./membership-28vBGpTw.js";
|
|
10
|
+
import "./index-y3taWZm8.js";
|
|
11
|
+
import { _ as w } from "./index-DkxEfDKI.js";
|
|
12
|
+
import { c as se } from "./object-qECH92oz.js";
|
|
13
|
+
import { Z as z } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
14
|
+
import "./index-DGFTGZj1.js";
|
|
15
|
+
import "./index-C4AxDwBx.js";
|
|
16
|
+
import "./index-Ix0P1Q7X.js";
|
|
17
|
+
import "./index-CKhgwiA8.js";
|
|
18
|
+
import "./index-DzrgTguB.js";
|
|
19
|
+
const Fe = { class: "flex items-center justify-between" }, Ve = { class: "flex items-center gap-8 xs:flex-wrap" }, Ue = /* @__PURE__ */ x("div", { class: "h-[26px] border-l-2 rounded-md border-fm-color-neutral-gray-100" }, null, -1), xe = { class: "text-fm-color-primary line-clamp-1 text-ellipsis" }, Ce = /* @__PURE__ */ A({
|
|
20
|
+
__name: "RuleEntry",
|
|
21
|
+
props: {
|
|
22
|
+
modelValue: {
|
|
23
|
+
type: Object,
|
|
24
|
+
required: !0
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
emits: ["edit", "remove"],
|
|
28
|
+
setup(o, { emit: C }) {
|
|
29
|
+
const c = o, s = B(() => {
|
|
30
|
+
const [i, v] = Object.entries(c.modelValue.conditions)[0];
|
|
31
|
+
return {
|
|
32
|
+
negated: c.modelValue.negated == !0,
|
|
33
|
+
property: c.modelValue.property,
|
|
34
|
+
operator: i,
|
|
35
|
+
equator: v
|
|
36
|
+
};
|
|
37
|
+
}), l = C, d = B(
|
|
38
|
+
() => fe(
|
|
39
|
+
s.value.property,
|
|
40
|
+
s.value.operator,
|
|
41
|
+
s.value.equator,
|
|
42
|
+
s.value.negated
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
async function t(i) {
|
|
46
|
+
i.stopPropagation(), await Te.remove("Are you sure you want to remove this rule?") && l("remove", c.modelValue);
|
|
47
|
+
}
|
|
48
|
+
return (i, v) => {
|
|
49
|
+
var k;
|
|
50
|
+
const p = g("FmChip"), m = g("FmTooltip"), b = g("FmIcon");
|
|
51
|
+
return r(), T("div", Fe, [
|
|
52
|
+
x("div", Ve, [
|
|
53
|
+
y(p, {
|
|
54
|
+
label: (k = e(de).find((f) => f.property === c.modelValue.property)) == null ? void 0 : k.name,
|
|
55
|
+
class: "!text-fm-color-typo-info !bg-fm-color-system-info-100"
|
|
56
|
+
}, null, 8, ["label"]),
|
|
57
|
+
Ue,
|
|
58
|
+
x("div", {
|
|
59
|
+
onClick: v[0] || (v[0] = (f) => l("edit", c.modelValue)),
|
|
60
|
+
class: "inline-flex rounded-md items-center gap-4 justify-center h-[30px] px-8 py-4 text-fm-color-typo-primary !bg-transparent border-dashed border-2 fm-typo-en-body-md-600 cursor-pointer"
|
|
61
|
+
}, [
|
|
62
|
+
ee(j(e(d)[0]) + " ", 1),
|
|
63
|
+
y(m, {
|
|
64
|
+
"z-index": 1e3,
|
|
65
|
+
content: e(d)[1]
|
|
66
|
+
}, {
|
|
67
|
+
default: M(() => [
|
|
68
|
+
x("div", xe, j(e(d)[1]), 1)
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
}, 8, ["content"])
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
y(b, {
|
|
75
|
+
name: "close",
|
|
76
|
+
size: "md",
|
|
77
|
+
class: "cursor-pointer hover:bg-neutral-300 rounded-lg",
|
|
78
|
+
onClick: t
|
|
79
|
+
})
|
|
80
|
+
]);
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
Se.enum([
|
|
85
|
+
"MIN_SPEND",
|
|
86
|
+
"SPECIFIC_DATE",
|
|
87
|
+
"SPECIFIC_TIMERANGE",
|
|
88
|
+
"WEEKLY",
|
|
89
|
+
"MONTHLY",
|
|
90
|
+
"BIRTHDAY",
|
|
91
|
+
"TIER",
|
|
92
|
+
"TITLE",
|
|
93
|
+
"CUSTOM"
|
|
94
|
+
]);
|
|
95
|
+
const Re = [
|
|
96
|
+
{
|
|
97
|
+
type: "MIN_SPEND",
|
|
98
|
+
name: "Minimum spend",
|
|
99
|
+
for: ["bill"],
|
|
100
|
+
rules: []
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: "SPECIFIC_DATE",
|
|
104
|
+
name: "Specific date",
|
|
105
|
+
for: ["trigger"],
|
|
106
|
+
rules: []
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: "SPECIFIC_TIMERANGE",
|
|
110
|
+
name: "Specific time range",
|
|
111
|
+
for: ["trigger"],
|
|
112
|
+
rules: []
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
type: "WEEKLY",
|
|
116
|
+
name: "Weekly",
|
|
117
|
+
for: ["trigger"],
|
|
118
|
+
rules: [
|
|
119
|
+
{
|
|
120
|
+
property: "trigger.date",
|
|
121
|
+
operator: "_rrule",
|
|
122
|
+
equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: "MONTHLY",
|
|
128
|
+
name: "Monthly",
|
|
129
|
+
for: ["trigger"],
|
|
130
|
+
rules: [
|
|
131
|
+
{
|
|
132
|
+
property: "trigger.date",
|
|
133
|
+
operator: "_rrule",
|
|
134
|
+
equator: "RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
type: "BIRTHDAY",
|
|
140
|
+
name: "Birthday",
|
|
141
|
+
for: ["user"],
|
|
142
|
+
rules: [
|
|
143
|
+
{
|
|
144
|
+
property: "user.birthday",
|
|
145
|
+
operator: "_isDay",
|
|
146
|
+
equator: {
|
|
147
|
+
op: "this",
|
|
148
|
+
unit: "day",
|
|
149
|
+
ignoreYear: !0
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: "TIER",
|
|
156
|
+
name: "Specific tier",
|
|
157
|
+
for: ["user"],
|
|
158
|
+
rules: [
|
|
159
|
+
{
|
|
160
|
+
property: "user.tier",
|
|
161
|
+
operator: "_equal",
|
|
162
|
+
equator: 1
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
type: "TITLE",
|
|
168
|
+
name: "Specific title",
|
|
169
|
+
for: ["user"],
|
|
170
|
+
rules: [
|
|
171
|
+
{
|
|
172
|
+
property: "user.titles",
|
|
173
|
+
operator: "_hasAny",
|
|
174
|
+
equator: []
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
type: "CUSTOM",
|
|
180
|
+
name: "Weekday special",
|
|
181
|
+
for: ["trigger"],
|
|
182
|
+
rules: [
|
|
183
|
+
{
|
|
184
|
+
property: "trigger.date",
|
|
185
|
+
operator: "_rrule",
|
|
186
|
+
equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=MO,TU,WE,TH,FR;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
type: "CUSTOM",
|
|
192
|
+
name: "Weekend special",
|
|
193
|
+
for: ["trigger"],
|
|
194
|
+
rules: [
|
|
195
|
+
{
|
|
196
|
+
property: "trigger.date",
|
|
197
|
+
operator: "_rrule",
|
|
198
|
+
equator: "RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU,SA;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
type: "CUSTOM",
|
|
204
|
+
name: "Happy hour",
|
|
205
|
+
for: ["trigger"],
|
|
206
|
+
rules: [
|
|
207
|
+
{
|
|
208
|
+
property: "trigger.time",
|
|
209
|
+
operator: "_isBetweenTime",
|
|
210
|
+
equator: [
|
|
211
|
+
{
|
|
212
|
+
start: "21:00",
|
|
213
|
+
end: "23:59"
|
|
214
|
+
}
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: "CUSTOM",
|
|
221
|
+
name: "Mother's day special",
|
|
222
|
+
for: ["trigger"],
|
|
223
|
+
rules: [
|
|
224
|
+
{
|
|
225
|
+
property: "trigger.date",
|
|
226
|
+
operator: "_rrule",
|
|
227
|
+
equator: "RRULE:FREQ=YEARLY;WKST=SU;BYDAY=+2SU;BYMONTH=5;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
type: "CUSTOM",
|
|
233
|
+
name: "Father's day special",
|
|
234
|
+
for: ["trigger"],
|
|
235
|
+
rules: [
|
|
236
|
+
{
|
|
237
|
+
property: "trigger.date",
|
|
238
|
+
operator: "_rrule",
|
|
239
|
+
equator: "RRULE:FREQ=YEARLY;WKST=SU;BYDAY=+3SU;BYMONTH=6;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
type: "CUSTOM",
|
|
245
|
+
name: "Christmas",
|
|
246
|
+
for: ["trigger"],
|
|
247
|
+
rules: [
|
|
248
|
+
{
|
|
249
|
+
property: "trigger.date",
|
|
250
|
+
operator: "_rrule",
|
|
251
|
+
equator: "RRULE:FREQ=YEARLY;WKST=SU;BYMONTH=12;BYMONTHDAY=25;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
type: "CUSTOM",
|
|
257
|
+
name: "Feedback rating",
|
|
258
|
+
for: ["feedback"],
|
|
259
|
+
rules: [
|
|
260
|
+
{
|
|
261
|
+
property: "feedback.rating",
|
|
262
|
+
operator: "_lessThanOrEqual",
|
|
263
|
+
equator: 5
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
type: "CUSTOM",
|
|
269
|
+
name: "Custom",
|
|
270
|
+
for: ["trigger", "user", "bill", "feedback"],
|
|
271
|
+
rules: [
|
|
272
|
+
{
|
|
273
|
+
property: "trigger.date",
|
|
274
|
+
operator: "_isOnDate",
|
|
275
|
+
equator: J().format("YYYY-MM-DD")
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
], he = { class: "flex flex-nowrap gap-x-4 items-center" }, Ye = /* @__PURE__ */ A({
|
|
280
|
+
__name: "IsDayInput",
|
|
281
|
+
props: {
|
|
282
|
+
modelValue: {
|
|
283
|
+
type: Object
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
emits: ["update:model-value"],
|
|
287
|
+
setup(o, { emit: C }) {
|
|
288
|
+
const c = o, s = C;
|
|
289
|
+
Z(() => {
|
|
290
|
+
c.modelValue || s("update:model-value", {
|
|
291
|
+
op: "before",
|
|
292
|
+
x: 1
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
function l(d) {
|
|
296
|
+
const t = se(
|
|
297
|
+
c.modelValue ?? {
|
|
298
|
+
op: "before",
|
|
299
|
+
x: 1
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
s("update:model-value", {
|
|
303
|
+
...t,
|
|
304
|
+
...d
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
return (d, t) => {
|
|
308
|
+
var v, p, m;
|
|
309
|
+
const i = g("FmStepperField");
|
|
310
|
+
return r(), T("div", he, [
|
|
311
|
+
y(i, {
|
|
312
|
+
class: "w-1/3",
|
|
313
|
+
"model-value": ((v = o.modelValue) == null ? void 0 : v.x) ?? null,
|
|
314
|
+
max: 365,
|
|
315
|
+
"show-steppers": !1,
|
|
316
|
+
"append-text": "days",
|
|
317
|
+
"onUpdate:modelValue": t[0] || (t[0] = (b) => l({ x: b }))
|
|
318
|
+
}, null, 8, ["model-value"]),
|
|
319
|
+
y(w, {
|
|
320
|
+
"model-value": ((p = o.modelValue) == null ? void 0 : p.op) ?? void 0,
|
|
321
|
+
items: [
|
|
322
|
+
{ label: "before", value: "before" },
|
|
323
|
+
{ label: "after", value: "after" }
|
|
324
|
+
],
|
|
325
|
+
"onUpdate:modelValue": t[1] || (t[1] = (b) => l({ op: b }))
|
|
326
|
+
}, null, 8, ["model-value"]),
|
|
327
|
+
y(w, {
|
|
328
|
+
"model-value": ((m = o.modelValue) == null ? void 0 : m.ignoreYear) ?? !1,
|
|
329
|
+
items: [
|
|
330
|
+
{ label: "same year", value: !1 },
|
|
331
|
+
{ label: "ignore year", value: !0 }
|
|
332
|
+
],
|
|
333
|
+
required: !0,
|
|
334
|
+
"onUpdate:modelValue": t[2] || (t[2] = (b) => l({ ignoreYear: b == !0 }))
|
|
335
|
+
}, null, 8, ["model-value"])
|
|
336
|
+
]);
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}), Oe = { class: "grid grid-cols-4 gap-x-4 items-center" }, De = /* @__PURE__ */ A({
|
|
340
|
+
__name: "IsRangeInput",
|
|
341
|
+
props: {
|
|
342
|
+
modelValue: {
|
|
343
|
+
type: Object,
|
|
344
|
+
default: () => ({
|
|
345
|
+
op: "this",
|
|
346
|
+
unit: "day",
|
|
347
|
+
ignoreYear: !0
|
|
348
|
+
})
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
emits: ["update:model-value"],
|
|
352
|
+
setup(o, { emit: C }) {
|
|
353
|
+
const c = o, s = C;
|
|
354
|
+
Z(() => {
|
|
355
|
+
c.modelValue || s("update:model-value", {
|
|
356
|
+
op: "this",
|
|
357
|
+
unit: "day",
|
|
358
|
+
ignoreYear: !0
|
|
359
|
+
});
|
|
360
|
+
});
|
|
361
|
+
const l = [
|
|
362
|
+
{ label: "day", value: "day" },
|
|
363
|
+
{ label: "week", value: "week" },
|
|
364
|
+
{ label: "month", value: "month" },
|
|
365
|
+
{ label: "quarter", value: "quarter" },
|
|
366
|
+
{ label: "year", value: "year" }
|
|
367
|
+
], d = [
|
|
368
|
+
{
|
|
369
|
+
label: "this",
|
|
370
|
+
value: "this"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
label: "last",
|
|
374
|
+
value: "last"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
label: "next",
|
|
378
|
+
value: "next"
|
|
379
|
+
}
|
|
380
|
+
];
|
|
381
|
+
return (t, i) => {
|
|
382
|
+
var p, m, b, k, f;
|
|
383
|
+
const v = g("FmStepperField");
|
|
384
|
+
return r(), T("div", Oe, [
|
|
385
|
+
y(w, {
|
|
386
|
+
"model-value": (p = o.modelValue) == null ? void 0 : p.op,
|
|
387
|
+
label: "",
|
|
388
|
+
items: d,
|
|
389
|
+
required: !0,
|
|
390
|
+
"onUpdate:modelValue": i[0] || (i[0] = (n) => s("update:model-value", { op: n, unit: "day", ignoreYear: !1 }))
|
|
391
|
+
}, null, 8, ["model-value"]),
|
|
392
|
+
((m = o.modelValue) == null ? void 0 : m.op) != "this" ? (r(), E(v, {
|
|
393
|
+
key: 0,
|
|
394
|
+
"model-value": ((b = o.modelValue) == null ? void 0 : b.x) || 0,
|
|
395
|
+
max: 365,
|
|
396
|
+
"show-steppers": !1,
|
|
397
|
+
"onUpdate:modelValue": i[1] || (i[1] = (n) => s("update:model-value", {
|
|
398
|
+
op: o.modelValue.op,
|
|
399
|
+
unit: o.modelValue.unit,
|
|
400
|
+
ignoreYear: o.modelValue.ignoreYear == !0,
|
|
401
|
+
x: n
|
|
402
|
+
}))
|
|
403
|
+
}, null, 8, ["model-value"])) : q("", !0),
|
|
404
|
+
y(w, {
|
|
405
|
+
"model-value": (k = o.modelValue) == null ? void 0 : k.unit,
|
|
406
|
+
label: "",
|
|
407
|
+
items: l,
|
|
408
|
+
required: !0,
|
|
409
|
+
"onUpdate:modelValue": i[2] || (i[2] = (n) => s("update:model-value", { ...c.modelValue, unit: n }))
|
|
410
|
+
}, null, 8, ["model-value"]),
|
|
411
|
+
y(w, {
|
|
412
|
+
label: "",
|
|
413
|
+
"model-value": (f = o.modelValue) == null ? void 0 : f.ignoreYear,
|
|
414
|
+
items: [
|
|
415
|
+
{ label: "same", value: !1 },
|
|
416
|
+
{ label: "ignore", value: !0 }
|
|
417
|
+
],
|
|
418
|
+
required: !0,
|
|
419
|
+
"onUpdate:modelValue": i[3] || (i[3] = (n) => s("update:model-value", {
|
|
420
|
+
...c.modelValue,
|
|
421
|
+
ignoreYear: n == !0
|
|
422
|
+
}))
|
|
423
|
+
}, null, 8, ["model-value"])
|
|
424
|
+
]);
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
}), we = { class: "space-y-8" }, Me = { class: "text-fm-color-primary rounded-md border-dashed border-2 p-8" }, qe = {
|
|
428
|
+
key: 0,
|
|
429
|
+
class: "flex items-center gap-8"
|
|
430
|
+
}, Be = /* @__PURE__ */ x("div", null, "Repeat every", -1), Ie = /* @__PURE__ */ x("div", null, "Repeat on", -1), Ne = { class: "flex gap-4" }, Ae = {
|
|
431
|
+
key: 0,
|
|
432
|
+
class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
|
|
433
|
+
}, $e = ["onClick"], Pe = {
|
|
434
|
+
key: 1,
|
|
435
|
+
class: "flex items-center gap-8"
|
|
436
|
+
}, _e = { class: "flex gap-4 xs:gap-[2px]" }, Le = /* @__PURE__ */ x("div", null, "Month", -1), He = { class: "grid grid-cols-6 gap-8" }, We = {
|
|
437
|
+
key: 0,
|
|
438
|
+
class: "grid grid-cols-7 overflow-hidden rounded-md border-1"
|
|
439
|
+
}, je = ["onClick"], Ke = {
|
|
440
|
+
key: 1,
|
|
441
|
+
class: "grid grid-cols-2 items-center gap-8"
|
|
442
|
+
}, Ge = { class: "flex gap-4" }, Qe = {
|
|
443
|
+
key: 4,
|
|
444
|
+
class: "flex items-center justify-end gap-8"
|
|
445
|
+
}, X = /* @__PURE__ */ A({
|
|
446
|
+
__name: "RruleInput",
|
|
447
|
+
props: {
|
|
448
|
+
modelValue: {
|
|
449
|
+
type: String
|
|
450
|
+
},
|
|
451
|
+
startDate: {
|
|
452
|
+
type: Object
|
|
453
|
+
},
|
|
454
|
+
applyButton: {
|
|
455
|
+
type: Boolean
|
|
456
|
+
},
|
|
457
|
+
fixedFrequency: {
|
|
458
|
+
type: Boolean
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
emits: ["update:model-value", "cancel"],
|
|
462
|
+
setup(o, { emit: C }) {
|
|
463
|
+
const c = o, s = C, l = K(
|
|
464
|
+
c.modelValue ? R.fromString(c.modelValue) : new R({
|
|
465
|
+
dtstart: c.startDate,
|
|
466
|
+
freq: R.DAILY,
|
|
467
|
+
wkst: R.SU,
|
|
468
|
+
interval: 1,
|
|
469
|
+
byhour: 0,
|
|
470
|
+
byminute: 0,
|
|
471
|
+
bysecond: 0
|
|
472
|
+
})
|
|
473
|
+
);
|
|
474
|
+
function d(t) {
|
|
475
|
+
var i;
|
|
476
|
+
"freq" in t && (l.value = new R({
|
|
477
|
+
dtstart: c.startDate,
|
|
478
|
+
freq: t.freq,
|
|
479
|
+
interval: 1,
|
|
480
|
+
byhour: 0,
|
|
481
|
+
byminute: 0,
|
|
482
|
+
bysecond: 0,
|
|
483
|
+
wkst: R.SU
|
|
484
|
+
})), t.interval && t.interval > 0 && (l.value = new R({
|
|
485
|
+
...l.value.origOptions,
|
|
486
|
+
dtstart: c.startDate,
|
|
487
|
+
interval: t.interval
|
|
488
|
+
})), "byweekday" in t && t.byweekday && Array.isArray(t.byweekday) && t.byweekday.length > 0 && (l.value.options.bymonthday.length > 0 && l.value.options.freq == R.MONTHLY && (l.value.options.bymonthday = []), l.value = new R({
|
|
489
|
+
...l.value.origOptions,
|
|
490
|
+
dtstart: c.startDate,
|
|
491
|
+
bymonthday: [],
|
|
492
|
+
byweekday: t.byweekday
|
|
493
|
+
})), "bysetpos" in t && t.bysetpos != null && (l.value = new R({
|
|
494
|
+
...l.value.origOptions,
|
|
495
|
+
dtstart: c.startDate,
|
|
496
|
+
bymonthday: [],
|
|
497
|
+
bysetpos: t.bysetpos,
|
|
498
|
+
byweekday: ((i = l.value.options.byweekday) == null ? void 0 : i.length) > 0 ? l.value.options.byweekday : [6]
|
|
499
|
+
})), "bymonthday" in t && t.bymonthday && Array.isArray(t.bymonthday) && t.bymonthday.length > 0 && (l.value = new R({
|
|
500
|
+
...l.value.origOptions,
|
|
501
|
+
dtstart: c.startDate,
|
|
502
|
+
bysetpos: [],
|
|
503
|
+
byweekday: [],
|
|
504
|
+
bymonthday: t.bymonthday
|
|
505
|
+
})), "bymonth" in t && t.bymonth && Array.isArray(t.bymonth) && t.bymonth.length > 0 && (l.value = new R({
|
|
506
|
+
...l.value.origOptions,
|
|
507
|
+
dtstart: c.startDate,
|
|
508
|
+
bysetpos: [],
|
|
509
|
+
bymonth: t.bymonth
|
|
510
|
+
})), "bynweekday" in t && t.bynweekday && (l.value = new R({
|
|
511
|
+
...l.value.origOptions,
|
|
512
|
+
dtstart: c.startDate,
|
|
513
|
+
bysetpos: [],
|
|
514
|
+
byweekday: new ke(
|
|
515
|
+
t.bynweekday[0][0],
|
|
516
|
+
t.bynweekday[0][1]
|
|
517
|
+
)
|
|
518
|
+
})), c.applyButton || s("update:model-value", l.value.toString());
|
|
519
|
+
}
|
|
520
|
+
return Z(() => {
|
|
521
|
+
c.modelValue || s(
|
|
522
|
+
"update:model-value",
|
|
523
|
+
new R({
|
|
524
|
+
dtstart: c.startDate,
|
|
525
|
+
freq: R.DAILY,
|
|
526
|
+
wkst: R.SU,
|
|
527
|
+
interval: 1,
|
|
528
|
+
byhour: 0,
|
|
529
|
+
byminute: 0,
|
|
530
|
+
bysecond: 0
|
|
531
|
+
}).toString()
|
|
532
|
+
);
|
|
533
|
+
}), (t, i) => {
|
|
534
|
+
var k, f, n;
|
|
535
|
+
const v = g("FmStepperField"), p = g("FmChip"), m = g("FmButtonGroup"), b = g("FmButton");
|
|
536
|
+
return r(), T("div", we, [
|
|
537
|
+
x("div", Me, j(e(ge)(e(l).options)), 1),
|
|
538
|
+
o.fixedFrequency ? q("", !0) : (r(), T("div", qe, [
|
|
539
|
+
Be,
|
|
540
|
+
y(v, {
|
|
541
|
+
class: "w-[100px]",
|
|
542
|
+
"model-value": e(l).options.interval,
|
|
543
|
+
"onUpdate:modelValue": i[0] || (i[0] = (a) => d({ interval: a > 0 ? a : e(l).options.interval })),
|
|
544
|
+
min: 1
|
|
545
|
+
}, null, 8, ["model-value"]),
|
|
546
|
+
y(w, {
|
|
547
|
+
class: "w-min",
|
|
548
|
+
items: e($).frequencies,
|
|
549
|
+
"model-value": e(l).origOptions.freq,
|
|
550
|
+
"onUpdate:modelValue": i[1] || (i[1] = (a) => d({ freq: a }))
|
|
551
|
+
}, null, 8, ["items", "model-value"])
|
|
552
|
+
])),
|
|
553
|
+
e(l).options.freq === e(R).WEEKLY ? (r(), T(D, { key: 1 }, [
|
|
554
|
+
Ie,
|
|
555
|
+
x("div", Ne, [
|
|
556
|
+
(r(!0), T(D, null, N(e($).weekdays, (a) => {
|
|
557
|
+
var V;
|
|
558
|
+
return r(), E(p, {
|
|
559
|
+
class: P(["cursor-pointer", `${(V = e(l).options.byweekday) != null && V.includes(a.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
560
|
+
label: a.label[0],
|
|
561
|
+
key: a.value,
|
|
562
|
+
compact: !0,
|
|
563
|
+
onClick: () => {
|
|
564
|
+
var U, O;
|
|
565
|
+
d({
|
|
566
|
+
byweekday: (U = e(l).options.byweekday) != null && U.includes(a.value) ? ((O = e(l).options.byweekday) == null ? void 0 : O.filter((F) => F !== a.value)) || [] : [...e(l).options.byweekday || [], a.value]
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
570
|
+
}), 128))
|
|
571
|
+
])
|
|
572
|
+
], 64)) : q("", !0),
|
|
573
|
+
e(l).options.freq == e(R).MONTHLY ? (r(), T(D, { key: 2 }, [
|
|
574
|
+
y(m, {
|
|
575
|
+
"model-value": e(l).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
|
|
576
|
+
items: [
|
|
577
|
+
{
|
|
578
|
+
label: "Each"
|
|
579
|
+
},
|
|
580
|
+
{
|
|
581
|
+
label: "On the"
|
|
582
|
+
}
|
|
583
|
+
],
|
|
584
|
+
"onUpdate:modelValue": i[2] || (i[2] = (a) => {
|
|
585
|
+
a.label == "Each" ? d({ bymonthday: [1] }) : d({ bysetpos: 1 });
|
|
586
|
+
})
|
|
587
|
+
}, null, 8, ["model-value"]),
|
|
588
|
+
e(l).options.bymonthday.length > 0 ? (r(), T("div", Ae, [
|
|
589
|
+
(r(!0), T(D, null, N(e($).dates, (a) => (r(), T("div", {
|
|
590
|
+
key: a.value,
|
|
591
|
+
class: P(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(l).options.bymonthday.includes(a.value) ? "bg-fm-color-primary text-fm-color-typo-white outline-transparent" : "bg-transparent text-fm-color-typo-primary"} ${a.value == 31 ? "border-r" : ""}`]),
|
|
592
|
+
onClick: (V) => d({
|
|
593
|
+
bymonthday: e(l).options.bymonthday.includes(a.value) ? e(l).options.bymonthday.filter((U) => U !== a.value) : [...e(l).options.bymonthday, a.value]
|
|
594
|
+
})
|
|
595
|
+
}, j(a.value), 11, $e))), 128))
|
|
596
|
+
])) : (r(), T("div", Pe, [
|
|
597
|
+
y(w, {
|
|
598
|
+
items: e($).ordinals,
|
|
599
|
+
"model-value": (k = e(l).options.bysetpos) == null ? void 0 : k[0],
|
|
600
|
+
"onUpdate:modelValue": i[3] || (i[3] = (a) => d({ bysetpos: a }))
|
|
601
|
+
}, null, 8, ["items", "model-value"]),
|
|
602
|
+
x("div", _e, [
|
|
603
|
+
(r(!0), T(D, null, N(e($).weekdays, (a) => {
|
|
604
|
+
var V;
|
|
605
|
+
return r(), E(p, {
|
|
606
|
+
class: P(["cursor-pointer", `${(V = e(l).options.byweekday) != null && V.includes(a.value) ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
607
|
+
label: a.label[0],
|
|
608
|
+
key: a.value,
|
|
609
|
+
compact: !0,
|
|
610
|
+
onClick: () => {
|
|
611
|
+
d({
|
|
612
|
+
byweekday: [a.value]
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
616
|
+
}), 128))
|
|
617
|
+
])
|
|
618
|
+
]))
|
|
619
|
+
], 64)) : q("", !0),
|
|
620
|
+
e(l).options.freq == e(R).YEARLY ? (r(), T(D, { key: 3 }, [
|
|
621
|
+
Le,
|
|
622
|
+
x("div", He, [
|
|
623
|
+
(r(!0), T(D, null, N(e($).months, (a) => {
|
|
624
|
+
var V, U;
|
|
625
|
+
return r(), E(p, {
|
|
626
|
+
key: a.value,
|
|
627
|
+
class: P(["cursor-pointer", {
|
|
628
|
+
"bg-fm-color-primary text-white": (V = e(l).options.bymonth) == null ? void 0 : V.includes(
|
|
629
|
+
a.value
|
|
630
|
+
),
|
|
631
|
+
"bg-fm-color-gray-200 text-fm-color-gray-800": !((U = e(l).options.bymonth) != null && U.includes(a.value))
|
|
632
|
+
}]),
|
|
633
|
+
label: a.shortName,
|
|
634
|
+
compact: !0,
|
|
635
|
+
onClick: (O) => d({
|
|
636
|
+
bymonth: (e(l).options.bymonth ?? []).includes(a.value) ? (e(l).options.bymonth ?? []).filter((F) => F !== a.value) : [...e(l).options.bymonth ?? [], a.value]
|
|
637
|
+
})
|
|
638
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
639
|
+
}), 128))
|
|
640
|
+
]),
|
|
641
|
+
y(m, {
|
|
642
|
+
"model-value": e(l).options.bymonthday.length ? { label: "Each" } : { label: "On the" },
|
|
643
|
+
items: [
|
|
644
|
+
{
|
|
645
|
+
label: "Each"
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
label: "On the"
|
|
649
|
+
}
|
|
650
|
+
],
|
|
651
|
+
"onUpdate:modelValue": i[4] || (i[4] = (a) => {
|
|
652
|
+
a.label == "Each" ? d({
|
|
653
|
+
bymonthday: [1],
|
|
654
|
+
bymonth: e(l).options.bymonth ?? [1]
|
|
655
|
+
}) : d({
|
|
656
|
+
byweekday: [e(R).SU.nth(1)],
|
|
657
|
+
bymonth: e(l).options.bymonth ?? [1]
|
|
658
|
+
});
|
|
659
|
+
})
|
|
660
|
+
}, null, 8, ["model-value"]),
|
|
661
|
+
e(l).options.bymonthday.length > 0 ? (r(), T("div", We, [
|
|
662
|
+
(r(!0), T(D, null, N(Array(31).fill(null).map((a, V) => V + 1), (a) => (r(), T("div", {
|
|
663
|
+
key: a,
|
|
664
|
+
class: P(["cursor-pointer text-center outline-1 outline-fm-color-neutral-gray-100 outline", `${e(l).options.bymonthday.includes(a) ? "bg-fm-color-primary text-fm-color-typo-white outline-transparent" : "bg-transparent text-fm-color-typo-primary"} ${a == 31 ? "border-r" : ""}`]),
|
|
665
|
+
onClick: (V) => d({
|
|
666
|
+
bymonthday: e(l).options.bymonthday.includes(a) ? e(l).options.bymonthday.filter((U) => U !== a) : [...e(l).options.bymonthday, a]
|
|
667
|
+
})
|
|
668
|
+
}, j(a), 11, je))), 128))
|
|
669
|
+
])) : (r(), T("div", Ke, [
|
|
670
|
+
y(w, {
|
|
671
|
+
items: e($).ordinals,
|
|
672
|
+
"model-value": (n = (f = e(l).options.bynweekday) == null ? void 0 : f[0]) == null ? void 0 : n[1],
|
|
673
|
+
"onUpdate:modelValue": i[5] || (i[5] = (a) => {
|
|
674
|
+
var V, U;
|
|
675
|
+
return d({
|
|
676
|
+
bynweekday: [[((U = (V = e(l).options.bynweekday) == null ? void 0 : V[0]) == null ? void 0 : U[0]) ?? 1, a]]
|
|
677
|
+
});
|
|
678
|
+
})
|
|
679
|
+
}, null, 8, ["items", "model-value"]),
|
|
680
|
+
x("div", Ge, [
|
|
681
|
+
(r(!0), T(D, null, N(e($).weekdays, (a) => {
|
|
682
|
+
var V, U;
|
|
683
|
+
return r(), E(p, {
|
|
684
|
+
class: P(["cursor-pointer", `${((U = (V = e(l).options.bynweekday) == null ? void 0 : V[0]) == null ? void 0 : U[0]) === a.value ? "bg-fm-color-primary text-white" : "bg-fm-color-neutral-gray-200 text-black"}`]),
|
|
685
|
+
label: a.label[0],
|
|
686
|
+
key: a.value,
|
|
687
|
+
compact: !0,
|
|
688
|
+
onClick: () => {
|
|
689
|
+
var O, F;
|
|
690
|
+
d({
|
|
691
|
+
bynweekday: [
|
|
692
|
+
[a.value, ((F = (O = e(l).options.bynweekday) == null ? void 0 : O[0]) == null ? void 0 : F[1]) ?? 1]
|
|
693
|
+
]
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
697
|
+
}), 128))
|
|
698
|
+
])
|
|
699
|
+
]))
|
|
700
|
+
], 64)) : q("", !0),
|
|
701
|
+
o.applyButton ? (r(), T("div", Qe, [
|
|
702
|
+
y(b, {
|
|
703
|
+
label: "Cancel",
|
|
704
|
+
variant: "tertiary",
|
|
705
|
+
onClick: i[6] || (i[6] = (a) => s("cancel"))
|
|
706
|
+
}),
|
|
707
|
+
y(b, {
|
|
708
|
+
label: "Apply",
|
|
709
|
+
onClick: i[7] || (i[7] = (a) => s("update:model-value", e(l).toString()))
|
|
710
|
+
})
|
|
711
|
+
])) : q("", !0)
|
|
712
|
+
]);
|
|
713
|
+
};
|
|
714
|
+
}
|
|
715
|
+
}), ze = { class: "grid grid-cols-4 gap-8 w-full flex-wrap py-16" }, Ze = /* @__PURE__ */ A({
|
|
716
|
+
__name: "IsInMonthInput",
|
|
717
|
+
props: {
|
|
718
|
+
modelValue: {
|
|
719
|
+
type: Object,
|
|
720
|
+
required: !0
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
emits: ["update:model-value"],
|
|
724
|
+
setup(o, { emit: C }) {
|
|
725
|
+
const c = o, s = C, l = J.months().map((d, t) => ({
|
|
726
|
+
name: d,
|
|
727
|
+
shortName: J().month(t).format("MMM"),
|
|
728
|
+
value: t
|
|
729
|
+
}));
|
|
730
|
+
return Z(() => {
|
|
731
|
+
c.modelValue || s("update:model-value", []);
|
|
732
|
+
}), (d, t) => {
|
|
733
|
+
const i = g("FmChip");
|
|
734
|
+
return r(), T("div", ze, [
|
|
735
|
+
(r(!0), T(D, null, N(e(l), (v) => {
|
|
736
|
+
var p, m;
|
|
737
|
+
return r(), E(i, {
|
|
738
|
+
class: P(["cursor-pointer", {
|
|
739
|
+
"bg-fm-color-primary text-white": (p = o.modelValue) == null ? void 0 : p.includes(v.value),
|
|
740
|
+
"bg-fm-color-gray-200 text-fm-color-gray-800": !((m = o.modelValue) != null && m.includes(
|
|
741
|
+
v.value
|
|
742
|
+
))
|
|
743
|
+
}]),
|
|
744
|
+
label: v.name,
|
|
745
|
+
key: v.value,
|
|
746
|
+
compact: !0,
|
|
747
|
+
onClick: (b) => s(
|
|
748
|
+
"update:model-value",
|
|
749
|
+
o.modelValue.includes(v.value) ? o.modelValue.filter((k) => k !== v.value) : [...o.modelValue, v.value]
|
|
750
|
+
)
|
|
751
|
+
}, null, 8, ["class", "label", "onClick"]);
|
|
752
|
+
}), 128))
|
|
753
|
+
]);
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
}), Je = {
|
|
757
|
+
key: 14,
|
|
758
|
+
class: "text-fm-color-typo-error"
|
|
759
|
+
}, Xe = /* @__PURE__ */ A({
|
|
760
|
+
__name: "RuleEquator",
|
|
761
|
+
props: {
|
|
762
|
+
type: {
|
|
763
|
+
type: String,
|
|
764
|
+
required: !0
|
|
765
|
+
},
|
|
766
|
+
operator: {
|
|
767
|
+
type: String,
|
|
768
|
+
required: !0
|
|
769
|
+
},
|
|
770
|
+
modelValue: {
|
|
771
|
+
type: Object
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
emits: ["update:model-value"],
|
|
775
|
+
setup(o, { emit: C }) {
|
|
776
|
+
const c = o, s = C, l = B(() => {
|
|
777
|
+
const d = pe[c.operator].safeParse(c.modelValue);
|
|
778
|
+
return d.success ? [] : d.error.errors;
|
|
779
|
+
});
|
|
780
|
+
return (d, t) => {
|
|
781
|
+
var n, a, V, U, O, F;
|
|
782
|
+
const i = g("FmTextField"), v = g("FmStepperField"), p = g("FmSimpleDatePicker"), m = g("FmSimpleDateRangePicker"), b = g("FmTimeRangePicker"), k = g("FmTimePicker"), f = g("FmHelperText");
|
|
783
|
+
return r(), T("div", {
|
|
784
|
+
class: P({ "pb-4": e(l).length })
|
|
785
|
+
}, [
|
|
786
|
+
o.type === "text" ? (r(), E(i, {
|
|
787
|
+
key: 0,
|
|
788
|
+
"model-value": o.modelValue,
|
|
789
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => s("update:model-value", u))
|
|
790
|
+
}, null, 8, ["model-value"])) : o.type === "number" ? (r(), E(v, {
|
|
791
|
+
key: 1,
|
|
792
|
+
"model-value": o.modelValue,
|
|
793
|
+
"onUpdate:modelValue": t[1] || (t[1] = (u) => s("update:model-value", u))
|
|
794
|
+
}, null, 8, ["model-value"])) : o.operator == "_isDay" ? (r(), E(oe(Ye), {
|
|
795
|
+
key: 2,
|
|
796
|
+
"model-value": o.modelValue,
|
|
797
|
+
"onUpdate:modelValue": t[2] || (t[2] = (u) => s("update:model-value", u))
|
|
798
|
+
}, null, 8, ["model-value"])) : o.operator == "_isRange" ? (r(), E(oe(De), {
|
|
799
|
+
key: 3,
|
|
800
|
+
"model-value": o.modelValue,
|
|
801
|
+
"onUpdate:modelValue": t[3] || (t[3] = (u) => s("update:model-value", u))
|
|
802
|
+
}, null, 8, ["model-value"])) : o.operator == "_isOnDate" ? (r(), E(p, {
|
|
803
|
+
key: 4,
|
|
804
|
+
"model-value": o.modelValue,
|
|
805
|
+
"onUpdate:modelValue": t[4] || (t[4] = (u) => s("update:model-value", u))
|
|
806
|
+
}, null, 8, ["model-value"])) : o.operator == "_isBetween" ? (r(), E(m, {
|
|
807
|
+
key: 5,
|
|
808
|
+
"model-value": {
|
|
809
|
+
startDate: (n = o.modelValue) == null ? void 0 : n.start,
|
|
810
|
+
endDate: (a = o.modelValue) == null ? void 0 : a.end
|
|
811
|
+
},
|
|
812
|
+
"onUpdate:modelValue": t[5] || (t[5] = (u) => {
|
|
813
|
+
s("update:model-value", {
|
|
814
|
+
start: u.startDate,
|
|
815
|
+
end: u.endDate
|
|
816
|
+
});
|
|
817
|
+
})
|
|
818
|
+
}, null, 8, ["model-value"])) : o.operator == "_isInMonth" ? (r(), E(Ze, {
|
|
819
|
+
key: 6,
|
|
820
|
+
"model-value": o.modelValue,
|
|
821
|
+
"onUpdate:modelValue": t[6] || (t[6] = (u) => s("update:model-value", u))
|
|
822
|
+
}, null, 8, ["model-value"])) : o.operator == "_rrule" ? (r(), E(X, {
|
|
823
|
+
key: 7,
|
|
824
|
+
"model-value": o.modelValue,
|
|
825
|
+
"onUpdate:modelValue": t[7] || (t[7] = (u) => s("update:model-value", u))
|
|
826
|
+
}, null, 8, ["model-value"])) : o.operator == "_isBetweenTime" ? (r(), E(b, {
|
|
827
|
+
key: 8,
|
|
828
|
+
"model-value": [(U = (V = o.modelValue) == null ? void 0 : V[0]) == null ? void 0 : U.start, (F = (O = o.modelValue) == null ? void 0 : O[0]) == null ? void 0 : F.end],
|
|
829
|
+
"onUpdate:modelValue": t[8] || (t[8] = (u) => s("update:model-value", [
|
|
830
|
+
{
|
|
831
|
+
start: u[0],
|
|
832
|
+
end: u[1]
|
|
833
|
+
}
|
|
834
|
+
]))
|
|
835
|
+
}, null, 8, ["model-value"])) : o.operator == "_isOnTime" ? (r(), E(k, {
|
|
836
|
+
key: 9,
|
|
837
|
+
"model-value": o.modelValue,
|
|
838
|
+
"onUpdate:modelValue": t[9] || (t[9] = (u) => s("update:model-value", u))
|
|
839
|
+
}, null, 8, ["model-value"])) : o.type == "tier" ? (r(), E(w, {
|
|
840
|
+
key: 10,
|
|
841
|
+
items: (e(Q)().sortedTiers ?? []).map((u, I) => ({
|
|
842
|
+
label: `Tier ${I + 1} - ${u.name}`,
|
|
843
|
+
value: I + 1
|
|
844
|
+
})),
|
|
845
|
+
"model-value": o.modelValue,
|
|
846
|
+
"onUpdate:modelValue": t[10] || (t[10] = (u) => s("update:model-value", u))
|
|
847
|
+
}, null, 8, ["items", "model-value"])) : o.type == "boolean" ? (r(), E(w, {
|
|
848
|
+
key: 11,
|
|
849
|
+
multiselect: !0,
|
|
850
|
+
items: [
|
|
851
|
+
{ label: "true", value: !0 },
|
|
852
|
+
{ label: "false", value: !1 }
|
|
853
|
+
],
|
|
854
|
+
"model-value": o.modelValue ?? [],
|
|
855
|
+
"onUpdate:modelValue": t[11] || (t[11] = (u) => s("update:model-value", u))
|
|
856
|
+
}, null, 8, ["model-value"])) : o.type == "gender" ? (r(), E(w, {
|
|
857
|
+
key: 12,
|
|
858
|
+
multiselect: !0,
|
|
859
|
+
items: [
|
|
860
|
+
{ label: "Male", value: "MALE" },
|
|
861
|
+
{ label: "Female", value: "FEMALE" }
|
|
862
|
+
],
|
|
863
|
+
"model-value": o.modelValue ?? [],
|
|
864
|
+
"onUpdate:modelValue": t[12] || (t[12] = (u) => s("update:model-value", u))
|
|
865
|
+
}, null, 8, ["model-value"])) : o.type == "collectible" ? (r(), E(w, {
|
|
866
|
+
key: 13,
|
|
867
|
+
multiselect: !0,
|
|
868
|
+
items: [],
|
|
869
|
+
"model-value": o.modelValue ?? [],
|
|
870
|
+
"onUpdate:modelValue": t[13] || (t[13] = (u) => s("update:model-value", u))
|
|
871
|
+
}, null, 8, ["model-value"])) : o.type == "segment" ? (r(), T("div", Je, "Not implemented")) : o.type == "title" ? (r(), E(w, {
|
|
872
|
+
key: 15,
|
|
873
|
+
multiselect: !0,
|
|
874
|
+
items: (e(Q)().sortedTitles ?? []).map((u) => ({
|
|
875
|
+
label: u.name,
|
|
876
|
+
value: u._id
|
|
877
|
+
})),
|
|
878
|
+
"model-value": o.modelValue ?? [],
|
|
879
|
+
"onUpdate:modelValue": t[14] || (t[14] = (u) => s("update:model-value", u))
|
|
880
|
+
}, null, 8, ["items", "model-value"])) : (r(), T(D, { key: 16 }, [
|
|
881
|
+
ee(" Not implemented ")
|
|
882
|
+
], 64)),
|
|
883
|
+
y(f, {
|
|
884
|
+
class: "items-end",
|
|
885
|
+
state: e(z).helperState(e(l), ""),
|
|
886
|
+
text: e(z).helperText(e(l), "")
|
|
887
|
+
}, null, 8, ["state", "text"])
|
|
888
|
+
], 2);
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
}), et = { class: "space-y-4" }, tt = /* @__PURE__ */ x("div", { class: "fm-typo-en-body-lg-400" }, "Property", -1), lt = /* @__PURE__ */ x("div", { class: "fm-typo-en-body-lg-400" }, "Check to perform", -1), ot = { class: "flex items-center gap-8" }, at = /* @__PURE__ */ x("div", { class: "fm-typo-en-body-lg-400" }, "Criteria", -1), rt = { class: "flex items-center justify-end gap-8 pt-16 w-full" }, nt = /* @__PURE__ */ A({
|
|
892
|
+
__name: "CustomRuleDialog",
|
|
893
|
+
props: {
|
|
894
|
+
triggerType: {
|
|
895
|
+
type: String,
|
|
896
|
+
required: !0
|
|
897
|
+
},
|
|
898
|
+
includeOnly: {
|
|
899
|
+
type: String
|
|
900
|
+
},
|
|
901
|
+
modelValue: {
|
|
902
|
+
type: Object,
|
|
903
|
+
default: () => {
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
},
|
|
907
|
+
setup(o) {
|
|
908
|
+
const C = te(), c = Q(), { emitData: s, emitAction: l } = ue(), d = o, t = B(
|
|
909
|
+
() => ye(d.triggerType, d.includeOnly)
|
|
910
|
+
), i = (F) => ae[t.value.find((u) => u.property === F).type], v = B(() => {
|
|
911
|
+
if (!k.value) return [];
|
|
912
|
+
const F = t.value.find(
|
|
913
|
+
(u) => u.property === k.value.property
|
|
914
|
+
);
|
|
915
|
+
return F ? ae[F.type].map((u) => ({
|
|
916
|
+
label: Ee[u].name,
|
|
917
|
+
value: u
|
|
918
|
+
})) : [];
|
|
919
|
+
}), p = ce, m = B(() => {
|
|
920
|
+
const F = p.safeParse(k.value);
|
|
921
|
+
return F.success ? [] : F.error.errors;
|
|
922
|
+
}), b = K(!1), k = K(
|
|
923
|
+
se(d.modelValue) ?? Y.constructEntry(
|
|
924
|
+
t.value[0].property,
|
|
925
|
+
i(t.value[0].property)[0],
|
|
926
|
+
null
|
|
927
|
+
)
|
|
928
|
+
), f = B(() => {
|
|
929
|
+
var _;
|
|
930
|
+
const { property: F, negated: u, conditions: I } = k.value, L = Object.keys(I || {})[0], H = Object.values(I || {})[0];
|
|
931
|
+
return {
|
|
932
|
+
property: F,
|
|
933
|
+
negated: u == !0,
|
|
934
|
+
type: (_ = t.value.find((W) => W.property === F)) == null ? void 0 : _.type,
|
|
935
|
+
operator: L,
|
|
936
|
+
equator: H
|
|
937
|
+
};
|
|
938
|
+
});
|
|
939
|
+
function n(F) {
|
|
940
|
+
k.value = Y.constructEntry(
|
|
941
|
+
F,
|
|
942
|
+
i(F)[0],
|
|
943
|
+
null
|
|
944
|
+
);
|
|
945
|
+
}
|
|
946
|
+
function a(F) {
|
|
947
|
+
k.value = { ...k.value, negated: F == !0 };
|
|
948
|
+
}
|
|
949
|
+
function V(F) {
|
|
950
|
+
k.value = {
|
|
951
|
+
...k.value,
|
|
952
|
+
conditions: { [F]: null }
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
function U(F) {
|
|
956
|
+
k.value.conditions = {
|
|
957
|
+
[f.value.operator]: F
|
|
958
|
+
};
|
|
959
|
+
}
|
|
960
|
+
function O() {
|
|
961
|
+
s(k.value), l("primary"), C.close();
|
|
962
|
+
}
|
|
963
|
+
return ne(async () => {
|
|
964
|
+
await c.readMembership();
|
|
965
|
+
}), (F, u) => {
|
|
966
|
+
const I = g("FmIcon"), L = g("FmField"), H = g("FmChip"), _ = g("FmMenuItem"), W = g("FmMenu"), G = g("FmButton");
|
|
967
|
+
return r(), T("div", et, [
|
|
968
|
+
tt,
|
|
969
|
+
y(W, {
|
|
970
|
+
shift: !0,
|
|
971
|
+
placement: "top-start",
|
|
972
|
+
modelValue: e(b),
|
|
973
|
+
"onUpdate:modelValue": u[0] || (u[0] = (h) => ie(b) ? b.value = h : null),
|
|
974
|
+
onMenuChanged: u[1] || (u[1] = (h) => b.value = h)
|
|
975
|
+
}, {
|
|
976
|
+
"menu-button": M(() => [
|
|
977
|
+
y(L, null, {
|
|
978
|
+
append: M(() => [
|
|
979
|
+
y(I, {
|
|
980
|
+
name: e(b) ? "expand_less" : "expand_more"
|
|
981
|
+
}, null, 8, ["name"])
|
|
982
|
+
]),
|
|
983
|
+
default: M(() => {
|
|
984
|
+
var h;
|
|
985
|
+
return [
|
|
986
|
+
ee(j((h = e(t).find((S) => S.property == e(k).property)) == null ? void 0 : h.name) + " ", 1)
|
|
987
|
+
];
|
|
988
|
+
}),
|
|
989
|
+
_: 1
|
|
990
|
+
})
|
|
991
|
+
]),
|
|
992
|
+
default: M(() => [
|
|
993
|
+
(r(!0), T(D, null, N(e(t), (h) => (r(), E(_, {
|
|
994
|
+
key: h.property,
|
|
995
|
+
"model-value": e(k).property == h.property,
|
|
996
|
+
label: h.name,
|
|
997
|
+
disabled: h.premium && !e(re)().isPremium,
|
|
998
|
+
onClick: (S) => h.premium && !e(re)().isPremium ? null : n(h.property)
|
|
999
|
+
}, me({ _: 2 }, [
|
|
1000
|
+
h.premium ? {
|
|
1001
|
+
name: "append",
|
|
1002
|
+
fn: M(() => [
|
|
1003
|
+
y(H, { label: "Premium" })
|
|
1004
|
+
]),
|
|
1005
|
+
key: "0"
|
|
1006
|
+
} : void 0
|
|
1007
|
+
]), 1032, ["model-value", "label", "disabled", "onClick"]))), 128))
|
|
1008
|
+
]),
|
|
1009
|
+
_: 1
|
|
1010
|
+
}, 8, ["modelValue"]),
|
|
1011
|
+
lt,
|
|
1012
|
+
x("div", ot, [
|
|
1013
|
+
y(w, {
|
|
1014
|
+
class: "w-1/4",
|
|
1015
|
+
items: [
|
|
1016
|
+
{ label: "is", value: !1 },
|
|
1017
|
+
{ label: "is not", value: !0 }
|
|
1018
|
+
],
|
|
1019
|
+
"model-value": e(k).negated ?? !1,
|
|
1020
|
+
"onUpdate:modelValue": a
|
|
1021
|
+
}, null, 8, ["model-value"]),
|
|
1022
|
+
y(w, {
|
|
1023
|
+
class: "flex-1",
|
|
1024
|
+
items: e(v),
|
|
1025
|
+
"model-value": e(f).operator,
|
|
1026
|
+
"onUpdate:modelValue": V
|
|
1027
|
+
}, null, 8, ["items", "model-value"])
|
|
1028
|
+
]),
|
|
1029
|
+
x("div", null, [
|
|
1030
|
+
at,
|
|
1031
|
+
e(f).type ? (r(), E(Xe, {
|
|
1032
|
+
key: 0,
|
|
1033
|
+
type: e(f).type,
|
|
1034
|
+
operator: e(f).operator,
|
|
1035
|
+
"model-value": e(f).equator,
|
|
1036
|
+
"onUpdate:modelValue": U
|
|
1037
|
+
}, null, 8, ["type", "operator", "model-value"])) : q("", !0)
|
|
1038
|
+
]),
|
|
1039
|
+
x("div", rt, [
|
|
1040
|
+
y(G, {
|
|
1041
|
+
onClick: u[2] || (u[2] = (h) => e(C).close()),
|
|
1042
|
+
label: "Cancel",
|
|
1043
|
+
variant: "tertiary"
|
|
1044
|
+
}),
|
|
1045
|
+
y(G, {
|
|
1046
|
+
onClick: u[3] || (u[3] = (h) => O()),
|
|
1047
|
+
disabled: e(m).length > 0,
|
|
1048
|
+
label: "Save"
|
|
1049
|
+
}, null, 8, ["disabled"])
|
|
1050
|
+
])
|
|
1051
|
+
]);
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
}), ut = { class: "flex flex-col gap-8" }, st = { class: "grid grid-cols-2 items-center" }, it = { class: "flex items-center gap-8" }, mt = { class: "pt-16 flex items-center self-end gap-8" }, dt = /* @__PURE__ */ A({
|
|
1055
|
+
__name: "PresetRuleDialog",
|
|
1056
|
+
props: {
|
|
1057
|
+
preset: {
|
|
1058
|
+
type: String,
|
|
1059
|
+
required: !0
|
|
1060
|
+
},
|
|
1061
|
+
modelValue: {
|
|
1062
|
+
type: Object
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
setup(o) {
|
|
1066
|
+
const C = te(), { emitData: c, emitAction: s } = ue(), l = Q(), d = o;
|
|
1067
|
+
function t() {
|
|
1068
|
+
const { operator: f, equator: n } = p.value;
|
|
1069
|
+
switch (d.preset) {
|
|
1070
|
+
case "MIN_SPEND":
|
|
1071
|
+
case "SPECIFIC_DATE":
|
|
1072
|
+
case "SPECIFIC_TIMERANGE":
|
|
1073
|
+
case "WEEKLY":
|
|
1074
|
+
case "MONTHLY":
|
|
1075
|
+
case "BIRTHDAY":
|
|
1076
|
+
case "TIER":
|
|
1077
|
+
return `Applies to ${l.sortedTiers.filter((V, U) => f == "_equal" ? U + 1 == n : f == "_moreThanOrEqual" ? U + 1 >= n : U + 1 <= n).map((V) => V.name).join(", ")}`;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function i() {
|
|
1081
|
+
var f, n;
|
|
1082
|
+
switch (d.preset) {
|
|
1083
|
+
case "MIN_SPEND":
|
|
1084
|
+
return Y.constructEntry("bill.amount", "_moreThanOrEqual", 0);
|
|
1085
|
+
case "SPECIFIC_DATE":
|
|
1086
|
+
return Y.constructEntry("trigger.date", "_isOnDate", "");
|
|
1087
|
+
case "SPECIFIC_TIMERANGE":
|
|
1088
|
+
return Y.constructEntry("trigger.date", "_isBetweenTime", [
|
|
1089
|
+
{ start: "00:00", end: "23:59" }
|
|
1090
|
+
]);
|
|
1091
|
+
case "WEEKLY":
|
|
1092
|
+
return Y.constructEntry(
|
|
1093
|
+
"trigger.date",
|
|
1094
|
+
"_rrule",
|
|
1095
|
+
"RRULE:FREQ=WEEKLY;WKST=SU;BYDAY=SU;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
1096
|
+
);
|
|
1097
|
+
case "MONTHLY":
|
|
1098
|
+
return Y.constructEntry(
|
|
1099
|
+
"trigger.date",
|
|
1100
|
+
"_rrule",
|
|
1101
|
+
"RRULE:FREQ=MONTHLY;WKST=SU;BYMONTHDAY=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0"
|
|
1102
|
+
);
|
|
1103
|
+
case "BIRTHDAY":
|
|
1104
|
+
return Y.constructEntry("user.birthday", "_isDay", {
|
|
1105
|
+
op: "after",
|
|
1106
|
+
x: 1,
|
|
1107
|
+
ignoreYear: !0
|
|
1108
|
+
});
|
|
1109
|
+
case "TIER":
|
|
1110
|
+
return Y.constructEntry("user.tier", "_equal", 1);
|
|
1111
|
+
case "TITLE":
|
|
1112
|
+
return Y.constructEntry("user.titles", "_hasAny", [
|
|
1113
|
+
(n = (f = l.sortedTitles) == null ? void 0 : f[0]) == null ? void 0 : n._id
|
|
1114
|
+
]);
|
|
1115
|
+
case "CUSTOM":
|
|
1116
|
+
throw new Error("Not implemented");
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
const v = K(i()), p = B(() => {
|
|
1120
|
+
const f = Y.simplify(v.value);
|
|
1121
|
+
return {
|
|
1122
|
+
...f,
|
|
1123
|
+
equator: f.equator
|
|
1124
|
+
};
|
|
1125
|
+
});
|
|
1126
|
+
function m(f, n) {
|
|
1127
|
+
const a = p.value;
|
|
1128
|
+
v.value = Y.constructEntry(
|
|
1129
|
+
a.property,
|
|
1130
|
+
n ?? a.operator,
|
|
1131
|
+
f,
|
|
1132
|
+
v.value.name
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
function b() {
|
|
1136
|
+
c(v.value), s("primary"), C.close();
|
|
1137
|
+
}
|
|
1138
|
+
const k = B(() => {
|
|
1139
|
+
const f = ve.safeParse(v.value);
|
|
1140
|
+
return f.success ? [] : f.error.errors;
|
|
1141
|
+
});
|
|
1142
|
+
return ne(async () => {
|
|
1143
|
+
await l.readMembership();
|
|
1144
|
+
}), (f, n) => {
|
|
1145
|
+
var H, _, W, G, h;
|
|
1146
|
+
const a = g("FmStepperField"), V = g("FmDatePicker"), U = g("FmTimeRangePicker"), O = g("FmRadio"), F = g("FmSelect"), u = g("FmRadioGroup"), I = g("FmHelperText"), L = g("FmButton");
|
|
1147
|
+
return r(), T("div", ut, [
|
|
1148
|
+
o.preset == "MIN_SPEND" ? (r(), E(a, {
|
|
1149
|
+
key: 0,
|
|
1150
|
+
label: "Minimum spend",
|
|
1151
|
+
"model-value": e(p).equator,
|
|
1152
|
+
"onUpdate:modelValue": n[0] || (n[0] = (S) => m(S))
|
|
1153
|
+
}, null, 8, ["model-value"])) : o.preset == "SPECIFIC_DATE" ? (r(), E(V, {
|
|
1154
|
+
key: 1,
|
|
1155
|
+
label: "Specific Date",
|
|
1156
|
+
"model-value": e(p).equator,
|
|
1157
|
+
"onUpdate:modelValue": n[1] || (n[1] = (S) => m(S))
|
|
1158
|
+
}, null, 8, ["model-value"])) : o.preset == "SPECIFIC_TIMERANGE" ? (r(), E(U, {
|
|
1159
|
+
key: 2,
|
|
1160
|
+
label: "Time is between",
|
|
1161
|
+
"model-value": [(_ = (H = e(p).equator) == null ? void 0 : H[0]) == null ? void 0 : _.start, (G = (W = e(p).equator) == null ? void 0 : W[0]) == null ? void 0 : G.end],
|
|
1162
|
+
"onUpdate:modelValue": n[2] || (n[2] = (S) => m([
|
|
1163
|
+
{
|
|
1164
|
+
start: S[0],
|
|
1165
|
+
end: S[1]
|
|
1166
|
+
}
|
|
1167
|
+
]))
|
|
1168
|
+
}, null, 8, ["model-value"])) : o.preset == "WEEKLY" ? (r(), E(X, {
|
|
1169
|
+
key: 3,
|
|
1170
|
+
label: "Weekly",
|
|
1171
|
+
"fixed-frequency": !0,
|
|
1172
|
+
"model-value": e(p).equator,
|
|
1173
|
+
"onUpdate:modelValue": n[3] || (n[3] = (S) => m(S))
|
|
1174
|
+
}, null, 8, ["model-value"])) : o.preset == "MONTHLY" ? (r(), E(X, {
|
|
1175
|
+
key: 4,
|
|
1176
|
+
label: "Weekly",
|
|
1177
|
+
"fixed-frequency": !0,
|
|
1178
|
+
"model-value": e(p).equator,
|
|
1179
|
+
"onUpdate:modelValue": n[4] || (n[4] = (S) => m(S))
|
|
1180
|
+
}, null, 8, ["model-value"])) : o.preset == "BIRTHDAY" ? (r(), T(D, { key: 5 }, [
|
|
1181
|
+
x("div", st, [
|
|
1182
|
+
y(O, {
|
|
1183
|
+
label: "N days before birthday",
|
|
1184
|
+
value: "_isDay",
|
|
1185
|
+
"model-value": e(p).operator,
|
|
1186
|
+
"onUpdate:modelValue": n[5] || (n[5] = () => {
|
|
1187
|
+
m(
|
|
1188
|
+
{
|
|
1189
|
+
op: "after",
|
|
1190
|
+
x: 1,
|
|
1191
|
+
ignoreYear: !0
|
|
1192
|
+
},
|
|
1193
|
+
"_isDay"
|
|
1194
|
+
);
|
|
1195
|
+
})
|
|
1196
|
+
}, null, 8, ["model-value"]),
|
|
1197
|
+
x("div", it, [
|
|
1198
|
+
y(O, {
|
|
1199
|
+
label: "Is in this",
|
|
1200
|
+
value: "_isRange",
|
|
1201
|
+
"model-value": e(p).operator,
|
|
1202
|
+
"onUpdate:modelValue": n[6] || (n[6] = () => {
|
|
1203
|
+
m(
|
|
1204
|
+
{
|
|
1205
|
+
op: "this",
|
|
1206
|
+
unit: "day",
|
|
1207
|
+
ignoreYear: !0
|
|
1208
|
+
},
|
|
1209
|
+
"_isRange"
|
|
1210
|
+
);
|
|
1211
|
+
})
|
|
1212
|
+
}, null, 8, ["model-value"]),
|
|
1213
|
+
e(p).operator == "_isRange" ? (r(), E(F, {
|
|
1214
|
+
key: 0,
|
|
1215
|
+
items: ["day", "week", "month"].map((S) => ({ label: S, value: S })),
|
|
1216
|
+
"model-value": e(p).equator.unit,
|
|
1217
|
+
"onUpdate:modelValue": n[7] || (n[7] = (S) => m(
|
|
1218
|
+
{
|
|
1219
|
+
op: "this",
|
|
1220
|
+
unit: S,
|
|
1221
|
+
ignoreYear: !0
|
|
1222
|
+
},
|
|
1223
|
+
"_isRange"
|
|
1224
|
+
))
|
|
1225
|
+
}, null, 8, ["items", "model-value"])) : q("", !0)
|
|
1226
|
+
])
|
|
1227
|
+
]),
|
|
1228
|
+
e(p).operator == "_isDay" ? (r(), E(a, {
|
|
1229
|
+
key: 0,
|
|
1230
|
+
label: "Days before birthday",
|
|
1231
|
+
"show-steppers": !1,
|
|
1232
|
+
"model-value": e(p).equator.x,
|
|
1233
|
+
"onUpdate:modelValue": n[8] || (n[8] = (S) => m({
|
|
1234
|
+
op: "after",
|
|
1235
|
+
x: S,
|
|
1236
|
+
ignoreYear: !0
|
|
1237
|
+
}))
|
|
1238
|
+
}, null, 8, ["model-value"])) : q("", !0)
|
|
1239
|
+
], 64)) : o.preset == "TIER" ? (r(), T(D, { key: 6 }, [
|
|
1240
|
+
y(u, {
|
|
1241
|
+
inline: !0,
|
|
1242
|
+
"model-value": e(p).operator,
|
|
1243
|
+
"onUpdate:modelValue": n[9] || (n[9] = (S) => m(e(p).equator, S))
|
|
1244
|
+
}, {
|
|
1245
|
+
default: M(() => [
|
|
1246
|
+
y(O, {
|
|
1247
|
+
value: "_moreThanOrEqual",
|
|
1248
|
+
label: "At least"
|
|
1249
|
+
}),
|
|
1250
|
+
y(O, {
|
|
1251
|
+
value: "_equal",
|
|
1252
|
+
label: "Equal"
|
|
1253
|
+
}),
|
|
1254
|
+
y(O, {
|
|
1255
|
+
value: "_lessThanOrEqual",
|
|
1256
|
+
label: "At most"
|
|
1257
|
+
})
|
|
1258
|
+
]),
|
|
1259
|
+
_: 1
|
|
1260
|
+
}, 8, ["model-value"]),
|
|
1261
|
+
y(w, {
|
|
1262
|
+
items: (e(l).sortedTiers ?? []).map((S, le) => ({
|
|
1263
|
+
label: `Tier ${le + 1} - ${S.name}`,
|
|
1264
|
+
value: le + 1
|
|
1265
|
+
})),
|
|
1266
|
+
"model-value": e(p).equator,
|
|
1267
|
+
"onUpdate:modelValue": n[10] || (n[10] = (S) => m(S))
|
|
1268
|
+
}, null, 8, ["items", "model-value"]),
|
|
1269
|
+
y(I, {
|
|
1270
|
+
text: t()
|
|
1271
|
+
}, null, 8, ["text"])
|
|
1272
|
+
], 64)) : o.preset == "TITLE" ? (r(), E(w, {
|
|
1273
|
+
key: 7,
|
|
1274
|
+
label: "User has title",
|
|
1275
|
+
items: (e(l).sortedTitles ?? []).map((S) => ({
|
|
1276
|
+
label: S.name,
|
|
1277
|
+
value: S._id
|
|
1278
|
+
})),
|
|
1279
|
+
"model-value": (h = e(p).equator) == null ? void 0 : h[0],
|
|
1280
|
+
"onUpdate:modelValue": n[11] || (n[11] = (S) => m([S]))
|
|
1281
|
+
}, null, 8, ["items", "model-value"])) : q("", !0),
|
|
1282
|
+
y(I, {
|
|
1283
|
+
class: "mt-[-8px]",
|
|
1284
|
+
text: e(z).helperText(e(k), ""),
|
|
1285
|
+
state: e(z).helperState(e(k), "")
|
|
1286
|
+
}, null, 8, ["text", "state"]),
|
|
1287
|
+
x("div", mt, [
|
|
1288
|
+
y(L, {
|
|
1289
|
+
onClick: n[12] || (n[12] = (S) => e(C).close()),
|
|
1290
|
+
label: "Cancel",
|
|
1291
|
+
variant: "tertiary"
|
|
1292
|
+
}),
|
|
1293
|
+
y(L, {
|
|
1294
|
+
onClick: n[13] || (n[13] = (S) => b()),
|
|
1295
|
+
disabled: e(k).length > 0,
|
|
1296
|
+
label: "Save"
|
|
1297
|
+
}, null, 8, ["disabled"])
|
|
1298
|
+
])
|
|
1299
|
+
]);
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
}), pt = /* @__PURE__ */ A({
|
|
1303
|
+
__name: "RuleConfigurator",
|
|
1304
|
+
props: {
|
|
1305
|
+
triggerType: {
|
|
1306
|
+
type: String,
|
|
1307
|
+
required: !0
|
|
1308
|
+
},
|
|
1309
|
+
includeOnly: {
|
|
1310
|
+
type: String
|
|
1311
|
+
},
|
|
1312
|
+
modelValue: {
|
|
1313
|
+
type: Object,
|
|
1314
|
+
default: () => {
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
emits: ["update:model-value"],
|
|
1319
|
+
setup(o, { expose: C, emit: c }) {
|
|
1320
|
+
const s = o, l = c, d = te(), t = K();
|
|
1321
|
+
function i(m) {
|
|
1322
|
+
d.open({
|
|
1323
|
+
title: m.name,
|
|
1324
|
+
closeButton: !1,
|
|
1325
|
+
dismissAway: !1,
|
|
1326
|
+
contentComponent: dt,
|
|
1327
|
+
contentComponentProps: {
|
|
1328
|
+
preset: m.type,
|
|
1329
|
+
modelValue: s.modelValue
|
|
1330
|
+
}
|
|
1331
|
+
}).onPrimary((b) => l("update:model-value", b));
|
|
1332
|
+
}
|
|
1333
|
+
function v(m) {
|
|
1334
|
+
d.open({
|
|
1335
|
+
title: "Edit rule",
|
|
1336
|
+
closeButton: !1,
|
|
1337
|
+
dismissAway: !1,
|
|
1338
|
+
contentComponent: nt,
|
|
1339
|
+
contentComponentProps: {
|
|
1340
|
+
triggerType: s.triggerType,
|
|
1341
|
+
includeOnly: s.includeOnly,
|
|
1342
|
+
modelValue: m
|
|
1343
|
+
}
|
|
1344
|
+
}).onPrimary((b) => l("update:model-value", b));
|
|
1345
|
+
}
|
|
1346
|
+
function p(m) {
|
|
1347
|
+
if (m.type == "CUSTOM") {
|
|
1348
|
+
const [b] = m.rules;
|
|
1349
|
+
return v(
|
|
1350
|
+
Y.constructEntry(b.property, b.operator, b.equator)
|
|
1351
|
+
);
|
|
1352
|
+
}
|
|
1353
|
+
return i(m);
|
|
1354
|
+
}
|
|
1355
|
+
return C({
|
|
1356
|
+
showCustomDialog: v
|
|
1357
|
+
}), (m, b) => {
|
|
1358
|
+
const k = g("FmButton"), f = g("FmMenuItem"), n = g("FmMenu");
|
|
1359
|
+
return r(), E(n, {
|
|
1360
|
+
shift: !0,
|
|
1361
|
+
placement: "top-start"
|
|
1362
|
+
}, {
|
|
1363
|
+
"menu-button": M(() => [
|
|
1364
|
+
y(k, {
|
|
1365
|
+
label: "Add condition",
|
|
1366
|
+
icon: "add",
|
|
1367
|
+
class: "text-fm-color-primary border-fm-color-primary",
|
|
1368
|
+
"icon-color": "primary",
|
|
1369
|
+
variant: "secondary"
|
|
1370
|
+
})
|
|
1371
|
+
]),
|
|
1372
|
+
default: M(() => [
|
|
1373
|
+
(r(!0), T(D, null, N(e(Re).filter(
|
|
1374
|
+
(a) => !o.includeOnly || a.for.includes(o.includeOnly)
|
|
1375
|
+
), (a) => (r(), E(f, {
|
|
1376
|
+
key: a.name,
|
|
1377
|
+
"model-value": a.name == e(t),
|
|
1378
|
+
label: a.name,
|
|
1379
|
+
onClick: (V) => p(a)
|
|
1380
|
+
}, null, 8, ["model-value", "label", "onClick"]))), 128))
|
|
1381
|
+
]),
|
|
1382
|
+
_: 1
|
|
1383
|
+
});
|
|
1384
|
+
};
|
|
1385
|
+
}
|
|
1386
|
+
}), yt = /* @__PURE__ */ x("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " When ", -1), Dt = /* @__PURE__ */ A({
|
|
1387
|
+
__name: "RuleGroup",
|
|
1388
|
+
props: {
|
|
1389
|
+
triggerType: {
|
|
1390
|
+
type: String,
|
|
1391
|
+
required: !0
|
|
1392
|
+
},
|
|
1393
|
+
includeOnly: {
|
|
1394
|
+
type: String
|
|
1395
|
+
},
|
|
1396
|
+
modelValue: {
|
|
1397
|
+
type: Object
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
emits: ["update:model-value"],
|
|
1401
|
+
setup(o, { emit: C }) {
|
|
1402
|
+
const c = o, s = C, l = B(
|
|
1403
|
+
() => c.modelValue ?? Y.scaffoldGroup()
|
|
1404
|
+
), d = B(() => Y.getLogic(l.value)), t = K();
|
|
1405
|
+
return (i, v) => {
|
|
1406
|
+
const p = g("FmButtonGroup"), m = g("FmCard");
|
|
1407
|
+
return r(), E(m, { variant: "outlined" }, {
|
|
1408
|
+
default: M(() => [
|
|
1409
|
+
y(m, { class: "border-l-4 border-fm-color-primary p-16 space-y-16" }, {
|
|
1410
|
+
default: M(() => [
|
|
1411
|
+
yt,
|
|
1412
|
+
y(pt, {
|
|
1413
|
+
ref_key: "configuratorRef",
|
|
1414
|
+
ref: t,
|
|
1415
|
+
"include-only": o.includeOnly,
|
|
1416
|
+
"trigger-type": o.triggerType,
|
|
1417
|
+
"onUpdate:modelValue": v[0] || (v[0] = (b) => s("update:model-value", e(Y).setRuleToGroup(e(l), b)))
|
|
1418
|
+
}, null, 8, ["include-only", "trigger-type"]),
|
|
1419
|
+
(r(!0), T(D, null, N(e(l).rules, (b, k) => {
|
|
1420
|
+
var f;
|
|
1421
|
+
return r(), T(D, null, [
|
|
1422
|
+
e(be)(b) ? (r(), E(Ce, {
|
|
1423
|
+
"model-value": b,
|
|
1424
|
+
key: k,
|
|
1425
|
+
onEdit: (f = e(t)) == null ? void 0 : f.showCustomDialog,
|
|
1426
|
+
onRemove: v[1] || (v[1] = (n) => {
|
|
1427
|
+
s(
|
|
1428
|
+
"update:model-value",
|
|
1429
|
+
e(Y).removeEntry(e(l), n.name)
|
|
1430
|
+
);
|
|
1431
|
+
})
|
|
1432
|
+
}, null, 8, ["model-value", "onEdit"])) : q("", !0),
|
|
1433
|
+
y(p, {
|
|
1434
|
+
class: "w-[200px]",
|
|
1435
|
+
disabled: Object.keys(e(l).rules).length < 2,
|
|
1436
|
+
items: [{ label: "And" }, { label: "Or" }],
|
|
1437
|
+
"model-value": e(d) === "&&" ? { label: "And" } : { label: "Or" },
|
|
1438
|
+
"onUpdate:modelValue": v[2] || (v[2] = (n) => s(
|
|
1439
|
+
"update:model-value",
|
|
1440
|
+
e(Y).setRuleToGroup(
|
|
1441
|
+
e(l),
|
|
1442
|
+
[],
|
|
1443
|
+
n.label === "And" ? "&&" : "||"
|
|
1444
|
+
)
|
|
1445
|
+
))
|
|
1446
|
+
}, null, 8, ["disabled", "model-value"])
|
|
1447
|
+
], 64);
|
|
1448
|
+
}), 256))
|
|
1449
|
+
]),
|
|
1450
|
+
_: 1
|
|
1451
|
+
})
|
|
1452
|
+
]),
|
|
1453
|
+
_: 1
|
|
1454
|
+
});
|
|
1455
|
+
};
|
|
1456
|
+
}
|
|
1457
|
+
});
|
|
1458
|
+
export {
|
|
1459
|
+
Dt as _,
|
|
1460
|
+
X as a
|
|
1461
|
+
};
|