{"version":3,"sources":["styles/tag_input.module.scss","styles/button_select.module.scss","styles/notifications.module.scss","styles/charge_approval.module.scss","styles/sidebar.module.scss","context/NotifyContext.js","context/ShopContext.js","context/UserContext.js","context/PreviewContext.js","lib/mutations.js","Queries/GET_SINGLE_CAMPAIGN.js","Queries/LIST_SHOP_CAMPAIGNS.js","Queries/GET_SHOP_SETTINGS.js","lib/mixpanel.js","screens/campaigns/List.js","lib/countries.js","screens/campaigns/settings/CampaignTarget.js","screens/campaigns/settings/FirstStep.js","screens/campaigns/settings/ExtraModules/Module.js","screens/campaigns/settings/ExtraModules/RandomText.js","screens/campaigns/settings/ExtraModules/OrderNote.js","screens/campaigns/settings/ExtraModules/CheckoutButton.js","reducers/CampaignReducer.js","screens/campaigns/settings/ExtraModules/index.js","screens/campaigns/settings/GeoTargeting.js","reducers/SetItemReducer.js","context/EmbeddedContext.js","components/ShopifyResourcePicker.js","context/SidebarContext.js","components/Sidebar.js","screens/campaigns/settings/Types/atu_goals/Gift.js","screens/campaigns/settings/Types/atu_goals/Discount.js","screens/campaigns/settings/Types/atu_goals/GoalImage.js","screens/campaigns/settings/Types/AddToUnlock.js","screens/campaigns/settings/Types/Bundle.js","screens/campaigns/settings/Types/Bundles.js","screens/campaigns/settings/Types/OneCheckUpSell.js","screens/campaigns/settings/Types/MultiOneCheckUpSell.js","screens/campaigns/settings/SecondStep.js","lib/removeTypeName.js","lib/validate.js","svgs/not_found.svg","Constraints/CampaignConstraints.js","Constraints/ShopConstraints.js","context/CampaignContext.js","screens/campaigns/Create.js","screens/campaigns/Update.js","screens/campaigns/Duplicate.js","screens/ErrorScreen.js","screens/NotFoundScreen.js","svgs/dots.svg","svgs/rotate.svg","screens/LogoutScreen.js","context/PageScrollContext.js","screens/settings/scarcity.js","screens/settings/badges.js","screens/settings/terms.js","screens/settings/announcement.js","svgs/check.svg","svgs/warning.svg","lib/afterPayLogos.js","screens/settings/afterPaySelector.js","screens/settings/afterPay.js","screens/CartScreen.js","components/Page.js","screens/CodCheckout.js","svgs/empty.svg","screens/DashboardScreen.js","screens/FaqScreen.js","screens/PrivacyPolicy.js","screens/ManualSetup.js","lib/getPlans.js","screens/PlanScreen.js","screens/StickyCartSettings.js","screens/InvitationScreen.js","screens/Affiliation.js","screens/ReferralScreen.js","screens/NewLoginScreen.js","screens/Integrations.js","screens/index.js","components/Modal.js","components/chargeApproval.js","components/Embedded.js","lib/AppLocalStorage.js","svgs/no_data.svg","components/Authenticator.js","hooks/useShop.js","components/Rehydrated.js","components/EmptyState.js","components/ItemsList_item.js","components/ItemsList.js","components/Carousel.js","components/FormGroup.js","components/ErrorsList.js","components/FormControl.js","components/Tag.js","components/ColorPicker.js","components/Dropdown.js","components/Input.js","components/Textarea.js","components/TagInput.js","components/ButtonSelect.js","components/stickyCart/index.js","components/Preview.js","components/ActionsButtons.js","components/Notifications.js","components/Range.js","components/ProductSelector.js","components/ImagePicker.js","components/DragAndDrop.js","components/RichEditor.js","components/Bindings.js","components/CustomText.js","components/DateRange.js","components/Calendar.js","components/Alert.js","components/MultiCurrencyModeAlerts.js","components/GuideContainer.js","components/GuideLink.js","components/GuideVideo.js","components/SetupStep.js","components/SetupGuide.js","components/CodeEditor.js","lib/wrappers.js","components/TutorialModal.js","components/TallyModal.js","screens/SetupScreen.js","App.js","index.js","components/cart/Api.js","styles/page.module.scss","styles/calendar.module.scss","components/cart/partials/CheckoutButton.js","styles/product_selector.module.scss","components/Switch.js","styles/campaign_settings_second_step.module.scss","styles/tutorial.module.scss","styles/modal.module.scss","components/Button.js","styles/dashboard.module.scss","styles/image_picker.module.scss","styles/date_range.module.scss","styles/button.module.scss","styles/carousel.module.scss","lib/translations.js","lib/translations/english.js","lib/translations/french.js","lib/translations/arabic.js","lib/translations/german.js","lib/globals.js","styles/preview.module.scss","styles/actions_buttons.module.scss","components/Spinner.js","components/cart/partials/CustomScroll.js","lib/classNames.js","aws-exports.js","components/cart/partials/CartItemsList.js","styles/items_list.module.scss","styles/empty_state.module.scss","styles/sticky_cart_feature_preview.module.scss","components/cart/Utils.js","components/cart/partials/Product.js","components/cart/partials/AddToUnlock.js","styles/drag_and_drop.module.scss","styles/campaign_settings_first_step.module.scss","svgs/logo_v2.png","assets/redeemly-logo.jpeg","styles/custom_scroll.module.scss","svgs/monster_logo.png","styles/display_text.module.scss","svgs/yt-clothing.jpeg","svgs/yt-designing.jpeg","svgs/yt-dropshipping.jpeg","svgs/yt-free-gift.jpeg","svgs/yt-free-shipping.jpeg","svgs/yt-shipping-protection.jpeg","components/cart/machines/HeaderMachine.js","components/cart/partials/GoalImages.js","components/cart/partials/Header_ATU.js","lib/addPrefix.js","hooks/useRefState.js","hooks/useBindToContext.js","components/cart/partials/Header.js","components/cart/partials/ExtraModule.js","components/cart/partials/EmptyState.js","reducers/CartItemsReducer.js","shopify_script_tags/cart.js","components/cart/index.js","assets/image_placeholder.png","styles/bundle.module.scss","styles/review_widget.module.scss","components/Icon.js","hooks/useCampaign.js","styles/extra_modules.module.scss","styles/cart_screen.module.scss","styles/form_group.module.scss"],"names":["module","exports","NotifyContext","React","createContext","NotifyProvider","Provider","ShopContext","ShopProvider","UserContext","UserProvider","Consumer","PreviewContext","PreviewProvider","UPDATE_SHOP_PROP","gql","SWITCH_CAMPAIGN_STATUS","CREATE_CAMPAIGN_MUTATION","UPDATE_CAMPAIGN_MUTATION","REMOVE_CAMPAIGN_MUTATION","SAVE_SHOP_SETTINGS","GET_SINGLE_CAMPAIGN","LIST_SHOP_CAMPAIGNS","GET_SHOP_SETTINGS","trackMixPanelEvent","eventKey","shopName","properties","mixpanel","init","process","debug","track","unique_id","distinct_id","List","setIsOpen","useState","updateState","analytics","setAnalytics","popovers","setPopOvers","hidePopOver","id","Object","assign","forceUpdate","useCallback","user","useContext","collapsed","previewCampaign","preview_active_campaign","shopContext","AppLocalStorage","state","multiCurrencyMode","settings","money_format","BREAK_POINTS","useReactRouter","history","location","showConfirmDelete","setShowConfirmDelete","formatWithDelimiters","number","precision","thousands","decimal","isNaN","parts","toFixed","split","dollars","replace","cents","formatMoney","n","numberFormat","Intl","NumberFormat","maximumSignificantDigits","format","useQuery","variables","userId","attributes","sub","fetchPolicy","includes","ListCampaignsData","data","queryLoading","loading","queryError","error","fetchMore","useMutation","SetCampaignActiveMutation","SetCampaignActiveMutation_loading","SetCampaignActiveMutation_error","SetCampaignActiveMutation_data","RemoveCampaignMutation","RemoveCampaignMutation_loading","RemoveCampaignMutation_error","RemoveCampaignMutation_data","isBeingPreviewed","campaign","useEffect","index","_","findIndex","campaigns","list","updateCampaign","filter","removeCampaign","fetchStatistics","a","campaigns_list","type","map","one_tick_campaigns","multi_one_check_upsell","one_check_up_sell","product","variants","price","products","Boolean","reduce","acc","cur","Array","isArray","forEach","v","push","body","API","post","processedData","entries","states","UpsellsGenerated","upsellsTotalAmount","Error","JSON","stringify","content","duration","onDismiss","header","title","actions","text","icon","faPlus","onClick","getItem","setItem","length","console","log","search","status","onChange","active","input","update","cache","writeQuery","query","nextToken","__typename","setCampaignActive","value","name","add_to_unlock","target","isGlobalBundles","isMonsterFreeShippingAddToUnlock","goals","reward_type","free_shipping","manual","isVirtualOneCheck","product_type","isNotDelivering","className","classNames","Icon","size","href","rel","BOX_CHECK_ICON","CAMPAIGN_TARGETS","find","label","Spinner","updateDay","Date","isNewCampaign","parseInt","createdAt","dangerouslySetInnerHTML","__html","revenue","fbt_sub_total","fbt","subtotal_sum","fbt_upsells_generated","Popover","isOpen","padding","reposition","onClickOutside","onMouseEnter","onMouseLeave","color","method","duplicate","disabled","edit","confirmDelete","items","emptyState","action","url","Button","updateQuery","previousResult","fetchMoreResult","message","open","primaryAction","destructive","onAction","secondaryActions","COUNTRIES_LIST","CampaignTarget","context","validationErrors","validate","info","options","BindToContext","newValue","allowMultiple","trigger","style","width","borderPosition","iconSize","customStyle","FirstStep","killDraftBreakPoint","keys","e","key","k","i","tutorial_styles","button","autofocus","placeholder","CAMPAIGN_TYPES","link","showSeparator","fontSize","window","Module","SortableElement","reset","switchButton","resetModule","moduleKey","children","styles","data-active","data-has-children","header_wrapper","ml_4","Switch","overflow","inner","Grip","defaultProps","sortableHandle","grip","RandomText","props","marginBottom","hasError","OrderNote","CheckoutButton","setCheckoutButtonLoadingEdit","fullWidth","hasColor","path","hasWeight","withSwitch","hasNumber","onFocus","onBlur","modules","checkout_button","active_continue_shopping_button","cod_settings","is_active","beta","CampaignReducer","default_language","default_currency","goal_index","pathParts","updatedState","current","undefined","setIn","bundles","concat","uuid","reward","quantity","DEFAULT_GOAL","specific_goals","currency","goal","newGoals","slice","splice","default_one_check_upsell","newProducts","new_state","ModulesList","SortableContainer","hasCheckout","order","ExtraModules","theme","primary","secondary","background","font","useDragHandle","onSortEnd","oldIndex","newIndex","newOrder","arrayMove","dispatch","NEW_CAMPAIGN_INITIAL_STATE","font_color","GeoTargeting","countries","include_active","isMulti","first","exclude_active","SetItemReducer","removeIn","EmbeddedContext","EmbeddedProvider","ShopifyResourcePicker","reducer","showVariants","initialSelectionIds","showHidden","verifySelection","initialQuery","isOpened","useBindToContext","BindedValue","BindedOnChange","idFilterRegex","tags","close","item","removeItem","resourceType","onSelection","selection","formatIds","outputObject","match","RESOURCE_PICKER_DEFAULT_REDUCERS","uniqueItems","obj","onCancel","SidebarContext","SidebarProvider","MenuItem","pathto","activeRoutes","badge","newApp","pathname","menu_item","new_app","SideBarBadge","SideBar","setCollapsed","campaignActive","dataLoading","setDataLoading","designActive","setDesignActive","completedTasks","setCompletedTasks","setup","cartActive","cartLoading","app_first_turn_on","sidebar","logo","src","Logo","menu","menu_setup","data-completed","div","marginTop","counter","faChartLine","faCog","faBullhorn","faCartPlus","spacer","faHandshake","COMMENT_DOLLAR","faUsers","faLightbulb","SACK_DOLLAR_ICON","faQuestionCircle","USER_SHIELD_ICON","attach","faThumbtack","Gift","resourcesArray","pattern","setCurrentState","setGiftCurrentPreview","AppBridgeToast","setCurrent","currentGoal","gift","isRandom","multi_gift_select","previousGift","hasMultipleGiftFeature","hasMoreThanOneGift","isSingleCol","GIFT_WITH_PURCHASE_PRODUCT_REDUCER","isGift","productType","toLowerCase","isError","imageEmoji","Bindings","only","widget","bindings","custom","top","right","simplified","before","multi_gift_image","Discount","min","max","discount","withDropdown","DISCOUNT_TYPES","GoalImage","show_badges","setBadgeType","setBadgeImage","previewImage","setPreviewImage","image","uploadedImage","setUploadedImage","hasPreview","setHasPreview","isUploading","setIsUploading","file","files","reader","FileReader","onload","result","attachment","fileName","response","public_url","readAsDataURL","Circle","htmlFor","backgroundImage","opacity","hidden","height","viewBox","fill","xmlns","d","aria-hidden","focusable","data-icon","role","Option","selected","strokeWidth","stroke","strokeLinecap","strokeLinejoin","AddToUnlock","setShowATUAfterText","setEditingProductDetails","getError","getIn","enabled_presentment_currencies","old_add_to_unlock","isActive","hasSpecificGoals","goalPAth","isQuantityGoal","multi_goal_type","added_currencies","all_currencies_are_selected","deleteGoal","Footer","newSpecificGoal","specific_goal","specific_goal_index","main","removeSpecificGoal","ADD_TO_UNLOCK_REWARD_OPTIONS","keyPrefix","redeemlyLogo","goal_text","newGoal","show_goal_text","campaignGoal","currentIndex","show_suggestions","isVertical","recommendation_type","ADD_TO_UNLOCK_PRODUCTS_PICKER_REDUCER","isCreatable","focusCondition","event","productDetails","document","getElementById","contains","Summary","goal_type","rewardType","isDiscount","free_shipping_text","sortByProp","formatter_reward","Bundle","bundle","specificValidation","isFlex","deleteBundle","Bundles","previewBundlesVariantsPicker","newBundle","useRefState","visiblePickerColorPickers","setVisiblePickerColorPickers","visiblePickerColorPickers_ref","handleColorPickerVisibleChange","visible","set","Set","add","focusWithinProps","useFocusWithin","onFocusWithin","onBlurWithin","group","step","position","variantsPicker","confirm","textColor","onVisibleChange","dropdownTextColor","dropdownBackground","confirmBackground","confirmTextColor","product_name","substring","trim","must_truncated","isLast","formatted_reward","OneCheckUpSell","updateOldOCU","hiddenProducts","setHiddenProducts","newHiddenProductLoading","setNewHiddenProductLoading","productsFetchLoading","setProductsFetchLoading","showHiddenProductSelector","setShowHiddenProductSelector","productImage","setProductImage","productTitle","setProductTitle","productPrice","setProductPrice","bodyHtml","setBodyHtml","setProps","PRESET_HIDDEN_PRODUCTS","p","body_html","get","queryStringParameters","limit","then","catch","indicator","ONE_CHECK_UP_SELL_PRODUCT_TYPE_OPTIONS","ONE_CHECK_UP_SELL_PRODUCT_REDUCER","onClose","setTitle","tab","contents","setActiveTab","showCreate","presets","controlsPosition","controls","next","createProduct","MultiOneCheckUpSell","rtl","isSwitch","variant","disableAlpha","deleteOneCheckUpsellProduct","productError","exists","newOneCheckUpsellProduct","box","t","SecondStep","stickyHeaderPosition","stickyHeader","is_OCU","isOld_OCU","removeByType","condition","prototype","toString","call","newObj","removeFalsyErrors","isFalsyArray","isFalsy","Number","isInteger","array","every","removeTypeName","validators","arrayItems","itemConstraints","isRequired","fieldName","constraints","RegExp","test","rules","parse","entry","arrayItemErrors","errors","isString","join","r","int","g","b","float","val","_title","_circle","_path","_polygon","_path2","_polygon2","_ellipse","_ellipse2","_ellipse3","_ellipse4","_circle2","_rect","_rect2","_ellipse5","_ellipse6","_circle3","_circle4","_path3","_path4","_path5","_circle5","_rect3","_rect4","_ellipse7","_ellipse8","_circle6","_circle7","_path6","_path7","_path8","_path9","_path10","_ellipse9","_ellipse10","Field","required","inArray","output","presence","Value","allowEmpty","capitalize","minimum","tooShort","maximum","tooLong","inclusion","within","numericality","onlyInteger","greaterThanOrEqualTo","lessThanOrEqualTo","strict","notValid","notGreaterThanOrEqualTo","notLessThanOrEqualTo","defaultValue","Integer","Float","Text","Bool","Num","Run","specific","setErrors","silent","filteredConstraints","Collection","toObject","newErrors","oldErrors","outputErrors","add_to_unlock_product","handle","add_to_unlock_goal","confetti","confetti_length","one_check_up_sell_product_variants","one_check_up_sell_product","is_ticked_by_default","include_in_atu","target_selected","CampaignConstraints","ShopConstraints","CampaignContext","CampaignProvider","withCampaignProvider","ChildComponent","duplication","order_note","product_details","highlight","progress_primary","progress_secondary","progress_complete","upsell_add_button","originalCampaign","setValidationErrors","originalState","setOriginalState","showValidationError","setShowValidationError","useReducer","CreateCampaignMutation","CreateCampaignMutation_Loading","CreateCampaignMutation_Error","CreateCampaignMutation_Data","UpdateCampaignMutation","UpdateCampaignMutation_Loading","UpdateCampaignMutation_Error","UpdateCampaignMutation_Data","saveCampaign","overrides","flatErrors","values","flat","Infinity","errorMessage","goalsErrors","nextGoal","truthyErrors","ids","saveState","refetchQueries","createCampaign","discard","rest","align","border","border_color","switch_on","switch_off","Create","showConfirmCancel","setShowConfirmCancel","newCampaignContext","useRef","setStickyHeaderPosition","transitions","useTransition","isEqual","from","enter","leave","onScroll","scrollTop","offsetTop","TopContent","render","paddingX","Update","params","labelColor","UpdateCampaign","Duplicate","campaignData","campaignId","DuplicateCampaign","_extends","arguments","source","hasOwnProperty","apply","this","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","_ref","svgRef","createElement","ref","cx","cy","transform","points","rx","ry","x","y","ForwardRef","forwardRef","ErrorScreen","setState","heading","Illustration","NotFound","whiteSpace","componentStack","Component","NotFoundScreen","LogoutScreen","Auth","signOut","APP_NAME","to","PageScrollContext","PageScrollProvider","WithPageScrollProvider","pageScroll","ScarcitySettings","scary","handleCheck","checked","handleRadio","gridTemplateColumns","checkboxControl","isDaysActive","checkbox","isHoursActive","isMinutesActive","isSecondsActive","radioDiv","endAction","placement","BadgesSettings","BADGES_POSITIONS","TermsSettings","checkout_condition_text","AnnouncementSettings","ANNOUNCEMENT_POSITIONS","_defs","clipPath","maskType","maskUnits","mask","LOGOS","AfterPaySelector","afterPay","isExternal","handleImageSelect","selectedImage","faCheckCircle","AfterPay","CartScreen","setCartIsEmpty","setAutoDiscount","setShowSubscription","stickyAlert","campaign_preview_types","setScrollTop","scrollTopRef","cartActivateLoading","setCartActivateLoading","googleFonts","setGoogleFonts","hideTopBar","setHideTopBar","showConfirmActivate","setShowConfirmActivate","showInstallationModel","setShowInstallationModel","subscriptionTab","setSubscriptionTab","cartType","setCartType","cartTextPrimary","setCartTextPrimary","cartTextSecondary","setCartTextSecondary","cartButtonText","setCartButtonText","cartButtonType","setCartButtonType","campaign_preview_visible","setCampaign_preview_visible","campaign_preview_content_ref","app","AppBridgeRedirect","setCartLoading","filterSettings","draft_checkout_alerted","multi_currency_checkout_alerted","fromEntries","website","saveShopSettings","original_settings","config","save","campaign_data","activateCart","confirmed","disableLoading","settingsSaved","SHOP_DEFAULT_SETTINGS","success","handleOutSideClick","addEventListener","removeEventListener","Axios","family","getGoogleFonts","sticky_path","lower_path","lower_checkout_container","getCheckoutPosition","checkoutPosition","setCheckoutPosition","updateShopProps","getSessionToken","authToken","graphql","graphqlOperation","APP_DEV","timeout","setTimeout","clearTimeout","checkout_mode","getScrollTop","customSvg","activateAppId","deepLink","Redirect","Action","ADMIN_PATH","newContext","REMOTE","origin","MultiCurrencyModeAlerts","redirectToCheckoutSettings","preventDefault","parseFloat","getComputedStyle","documentElement","md5","closest","IUnderstand","collapsable","autoFocus","language","savings","subtotal","button_text","buttonColor","char","isSticky","isLower","checkout_text","new_text","editor","activeElement","subscription","infoHtml","PageHeader","page_header","Page","additional_classes","scrollbars_ref","setError","buttonLoading","setButtonLoading","app_container","topBarWrapper","customScrollbars","page_content","form","deleteModule","setSelectedModule","setEditModalVisibility","itemIndex","extrastyles","data-one-row","EditModal","editModalVisibility","selectedModule","editModule","setModule","handleChange","attribute","AddModal","addModalVisibility","setAddModalVisibility","addModule","setLabel","setIsRequired","setType","setOptions","setPlaceholder","showOptions","CodCheckout","setComfirmOrderButtonLoadingEdit","editingProductDetails","checkRTL","newForm","mo","moment","defaultStateCards","CartsDisplayed","SalesGenerated","SalesAmount","AverageOrderSize","CartConversionRate","UpsellsTotalAmount","TotalROI","StateCard","suf","pre","clickable","startCase","DashboardScreen","activeChart","setActiveChart","setLoading","campaignsFilter","dateRangeFilter","setDateRangeFilter","chartSeries","setChartSeries","count","setCount","getChart","newActiveChart","dateFilter","start","getTime","end","point","getCount","throttle","keyword","range","maxDate","stateCards","stateCard","chartOptions","opts","series","animation","FaqScreen","PrivacyPolicy","ManualSetup","activePreviewDevice","setActivePreviewDevice","is","currentAction","setCurrentAction","unsaved","setUnsaved","API_GATEWAY_NEW","iframeSrc","iframe","selectorOverlay","custom_links","shopCustomLinks","setShopCustomLinks","custom_atcs","shopCustomATCs","setShopCustomATCs","customCartLinks","setCustomCartLinks","cclRef","customATCs","setCustomATCs","catcRef","setSaveLoading","sendMessage","contentWindow","postMessage","handleMessage","selector","elementPickerEnabled","l","onLoad","display","oldPlans","description","transactions","real_price","newPlans","newPlansStartsAt","thirdPlansStartsAt","getPlans","installationTime","hasSecondPricing","plan","currentPlan","getNewPlans","getBasePrice","PlanScreen","setPlan","setCurrentPlan","shop","plans","installedAt","invitation","applyDiscount","getPlan","planResponse","balance_used","billing_on","StickyCartSettings","setIsStickyActVariantFocused","sticky_cart","STICKY_CART_OPTIONS","btnStyles","colorType","visibilityOptions","btnPosition","mobile_show_variants","show_btn_atc_txt_variant_active","hasBU","addDays","date","days","copy","setDate","getDate","InvitationScreen","useHistory","useParams","fetchInvitation","API_GATEWAY2","redirect","expiry","ShowCode","aff_code","setIsEditingCode","handleLinkCopy","AUTH_COOKIE_DOMAIN","disabledBgColor","faCopy","faEdit","ShowCoupon","EditCode","handleCodeEdit","code","setCode","faUndo","faSave","ShowPaypal","paypal","setIsEditingPaypal","EditPaypal","handlePaypalEdit","localPaypal","setLocalPaypal","Affiliation","setSettings","eventsList","setEventsList","stats","setStats","isEditingCode","isEditingPaypal","setMessage","getAffiliationSettings","responseSettings","handleSubmitSettings","settingsTosave","codeTosave","getEvents","paypal_email","responseError","commission","views","active_referrals","referral","earnings","ReferralScreen","handleReferral","host","NewLoginScreen","API_GATEWAY","Integrations","frameborder","Campaigns","CampaignsList","create","CreateCampaign","Modal","footer","subTitle","stateTitle","onRequestClose","modal","meta","head","wrapper","ChargeApproval","chargeConfirmationUrl","redirectToChargeApproval","isModalVisible","setIsModalVisible","orderSize","setOrderSize","isExpanded","setIsExpanded","couponOpened","setCouponOpened","couponCode","setCouponCode","discountLoading","setDiscountLoading","setDiscount","discountMessage","setDiscountMessage","discountedChargeUrl","setDiscountedChargeUrl","handleDiscountApply","coupon","found","tabIndex","blue_color","bg_blue_color","flex","minWidth","minHeight","navy_color","table","hidden_pricing","bg_lighter_blue_color","calculatePrice","faCheckSquare","withRouter","newPlanRedirect","queryString","createNotification","deleteNotification","URLSearchParams","apiKey","SHOPIFY_API_KEY","shopOrigin","forceRedirect","SHOPIFY_EMBEDDED_FORCE_REDIRECT","btoa","createApp","setupModalAutoSizing","AppBridgeHistory","History","$crisp","fbq","APP","toastOptions","toast","Toast","SHOW","_rect5","_rect6","_rect7","_rect8","_g3","_g4","shopSetItem","db_keys","WithShopProvider","useShop","setCartActive","scope","SCOPE","version","checkScope","default_settings","shop_settings","coupon_alert_text","upgradingText","downgradingText","loadingBackground","loadingBorder","subscribedText","subscribedBackground","subscribedBorder","continue_shopping_button","active_continue_shopping_underlined","checkout_condition_color","desktop_quantity","mobile_quantity","cart_name","badges","announcement","auto_discount","font_size","font_weight","chargeAccepted","checkStatus","intervalId","setInterval","clearInterval","getScriptStatus","Rehydrated","client","getApolloContext","rehydrated","AWSAppSyncClient","hydrated","EmptyState","secondaryAction","illustration","details","getValue","cell","Function","Item","toDateString","x1","y1","x2","y2","gradientTransform","gradientUnits","offset","stopColor","stopOpacity","xlinkHref","ItemsList","cellSpacing","cellPadding","NoData","noIcon","CarouselControls","activeTab","control","StepperControls","stepperControls","Carousel","ACTIVE_IS_NOT_SET","bindedSetActiveTab","REPLACE","carousel","isFunction","FormGroup","noBorderBottom","groupContent","maxHeight","setMaxHeight","handleClick","container","focusWithIn","querySelectorAll","picker","offsetHeight","transition","ErrorsList","showFirstOnly","FormControl","showError","childrenWidth","singleChildWidth","isErrorArray","hasErrors","getErrors","containerClasses","Children","labelClasses","infoClasses","backgroundColor","child","Tag","alt","ColorPicker","color_type","data_input","contentRef","_setVisible","setVisible","Manager","Reference","Popper","positionFixed","modifiers","preventOverflow","enabled","arrowProps","zIndex","data-placement","DropdownIndicator","colourStyles","inInput","option","isDisabled","isFocused","isSelected","cursor","textTransform","isHovered","boxShadow","borderColor","borderRadius","fontWeight","singleValue","dropdownIndicator","indicatorSeparator","valueContainer","Dropdown","validation","closeMenuOnSelect","selectedOption","op","createdOptions","isClearable","classNamePrefix","components","Input","withNumber","withWeight","withColor","inputRef","iconFirst","placeholder_color","hasTags","hasLeftNeighbor","data-tags","rounded","switch","onEnter","onKeyDown","Textarea","row","TagInput","tag","Or","ButtonSelect","onSelect","showCheckedIcon","inlineIcon","noIconBG","disabledClick","isLastButton","onKeyPress","spin","StickyCart","device","isPreview","SC","isUnavailableFocused","isStickyActVariantFocused","setVariants","qte","setQte","oldPrice","compare_at_price","formatColor","selectedVariants","select","dataset","mobile_show_quantity","toggleOpen","element","currentTarget","mobile_cart_position","mobile_location","Styles","desktopStickyCartContainar","btn_style","curvy","background_color","bottom","visibility","desktop_active","detailsSection","desktop_product_preview","images","desktop_show_product_name","desktop_show_compared_price","btn_color","actionsSection","desktop_show_variants","map_select_containar","map_select","data-open","data-value","data-display","desktop_show_quantity","minus","atc","txt_color","btn_text_unavailable","btn_text","mobileStickyCartContainar","cart","txt","fill-rule","clip-rule","infos","mobile_show_compared_price","mobile_show_title","mobile_show_price","mobile_atc_height","btn_text_variant_active","btn_atc_txt_variant_active","Preview","openByDefault","noCampaign","compareAtMap","setCompareAtMap","setCampaign","cartItems","setCartItems","setCampaigns","previewError","setPreviewError","lastCampaign","setLastCampaign","cartIsEmpty","bundlesVariantPickerPreview","setBundlesVariantPickerPreview","autoDiscount","giftCurrentPreview","checkoutButtonLoadingEdit","showSubscription","comfirmOrderButtonLoadingEdit","showATUAfterText","setProduct","orderCodForm","setOrderCodForm","isCodFormSubmitted","setIsCodFormSubmitted","setCampaign_preview_types","PREVIEW_CAN_RENDER_ONLY_WITH_CAMPAIGN","PREVIEW_CAN_RENDER_WITHOUT_CAMPAIGN","CAN_RENDER_CART","isStickyPreview","generateFakeCartItems","isSpecificWithNoSelected","collection_id","prd","featured_image","fakePreviewProducts","cartItemQuantity","product_title","discounts","amount","line_level_discount_allocations","discount_application","discounted_price","variant_id","count_compare_at","product_id","fakeCampaigns","openPreview","preview","countStartAt","onConfirm","data-collapsed","data-curved","curved","campaignModules","getSettings","shop_url","cart_items","cart_currency","showCheckoutLoading","showComfirmOrderLoading","forcePreview","showAddCartButton","mobileContainar","ActionsButtons","getProperValue","button_ref","actions_ref","useResponsive","xs","sm","md","screenIsAtMost","orientation","screenIsAtLeast","actions_wrapper","data-popover","action_button_menu","react_ref","margin","flexShrink","action_button","Notification","closeable","Notifications","notifications","uniqNotifications","uniqBy","exclude","notification","Range","formatter","maxValue","minValue","ProductSelector","selectedProduct","tile","data-selected","priceTag","inside","ImagePicker2","useMemo","setPreview","previewRef","uploading","setUploading","uploadingRef","readImage","OnLoad","handleDrop","f","dots","DragAndDrop","noClass","drag","dropRef","handleDrag","handleDragIn","dataTransfer","handleDragOut","clearData","dragAndDrop","dragging","RichEditor","editorRef","getColors","setAttribute","onchange","getEditor","insertEmbed","getSelection","toolbar","handlers","click","prompt","quill","amount_left","binding","tooltip","xmlSpace","CustomText","textPAth","fontSizePath","fontWeightPath","colorPath","extendMoment","Moment","defaultPeriods","startOf","endOf","subtract","closable","DateRange","minDate","tagRef","formatTagText","isLabeled","isSame","formateUnLabeledRange","DateRangePicker","periods","toDate","Calendar","activePicker","setActivePicker","dateObject","setDateObject","month","setMonth","year","setYear","lastMonth","setLastMonth","nextMonth","setNextMonth","last_month","next_month","calendar","selects","DaysPicker","selectedRange","setSelectedRangeState","isSliding","setIsSliding","setSelectedRange","fireOnChange","formatRange","tempRange","setTempRange","previewRange","setPreviewRange","mouseIsDown","setMouseIsDown","weekDayShort","weekdaysShort","monthDaysCount","daysInMonth","firstDayOfMonth","lastMonthDaysCount","handleMouseDown","newSelectedRange","sort","handleMouseUp","handleMouseOver","isOnRange","isFirst","startDate","endDate","isOnPreviewRange","momentRange","blankDays","onMouseDown","onMouseUp","onMouseOver","empty","reverse","totalSlots","weekDays","day","Day","isFirst_p","isLast_p","data-preview","data-first","data-last","onTouchStart","onTouchEnd","data-empty","MonthPicker","months","attrs","YearsPicker","years","Alert","desc","iconColor","warning","warning_secondary","save_settings","GuideContainer","linkLabel","itemsClassName","itemsStyles","paddingBottom","textDecoration","lineHeight","GuideLink","GuideVideo","backgroundRepeat","backgroundPosition","backgroundSize","SetupStep","recommended","actionText","done","SetupGuide","total","CodeEditor","isEmbedded","previewOpenByDefault","TutorialModal","overlay","marginRight","maxWidth","justifyContent","YtFreeGift","YtFreeShipping","YtShippingProtection","YtDropshipping","YtClothing","YtDesigning","TallyModal","marginheight","marginwidth","SetupScreen","frameBorder","allowFullScreen","allow","App","Routes","voucher","setVoucher","setNewPlanRedirect","component","confirmation_url","app_wrapper","Sidebar","exact","Shopify","rate","Amplify","configure","endpoints","endpoint","custom_header","shopifyApp","Authorization","aws_appsync_graphqlEndpoint","aws_appsync_region","aws_appsync_authenticationType","InMemoryCache","Client","auth","token","region","disableOffline","ReactDOM","axios","interceptors","request","use","Api","maxCacheSize","ttl","__addFilter","loadable","Scary","Badges","Announcement","NewOneCheckUpSell","ConditionCheck","CouponCodeForm","InfoItem","negative","infoClass","CartContext","Utils","cart_settings","em","AnimatedNumber","formatValue","mu_stop_negative","getAllOCUProducts","isOCUProduct","is_example","canRenderOCU","get_total","cart_level_discount_applications","shopify_cart_items","shopify_cart_upsells","productAddedToCart","discountCode","cartNote","hasAutoDiscount","slider","setPreviewed_product","update_cart_item","rechargeSettings","cartLevelAutoDiscount","GetCartLevelAutoDiscount","checkoutLoading","setCheckoutLoading","setPreviewCheckoutToast","isTermsAccepted","setIsTermsAccepted","shakeClass","setShakeClass","DefaultAutoDiscountSettings","show_coupon","show_coupon_alert_text","is_checkout_condition_active","generateCheckoutUrl","esid","wheelioDiscount","Cookies","encodeURIComponent","getLangPath","setNote","note","useCampaign","one_check_up_sell_product_id","ocu_campaign","ocu_isGlobal","add_to_unlock_product_id","isGlobal","CAN_RENDER_ADD_TO_UNLOCK","CAN_RENDER_ONE_CHECK_UP_SELL","ocuHasProduct","redirectToCheckout","addShipProtect","checkoutUrl","mu_checkoutHook","generateReChargeCheckout","checkout","isRechargeCheckout","shipping_interval_frequency","shipping_interval_unit_type","mu_custom_checkout","ttq","mu_disable_tiktok_tracking","content_type","content_name","content_id","selling_plan_allocation","sp","selling_plan","schema","campaign_key","invoice_url","remove","mu_keep_checkout_loading","mu_filter_discount_items","price_adjustments_value","price_adjustments_value_type","mu_get_discount","mu_terms_accepted","fix_checkout_container","textAlign","total_allocated_amount","formatAutoDiscount","show_subtotal","ocu","checkout_as_link","fontFamily","button_text_loading","hoverBackground","data-loading","mu_checkout_img","mu_stop_checkout_loading","moneyHtml","DOMParser","parseFromString","textContent","formatCheckout","mu_continue_shopping_logic","closeCart","fbt_position","fbt_below","handleDiameter","onColor","offColor","onHandleColor","offHandleColor","noText","uncheckedIcon","checkedIcon","StyledButton","styled","hover_background","iconSizes","default","small","medium","ButtonLoading","ButtonText","loadingContainer","english","empty_cart","shipping_option","sold_out","atcButton","readMore","use_coupon_code","enter_coupon_code","apply_coupon_code","edit_coupon_code","close_coupon_code","random_text","prefix","show_product_details","upsell_confirm_button","after","separator","offer_highlight","selecting","variant_selector_text","variant_change_text","inventory_quantity","french","arabic","german","kill_draft","Product","originalSrc","ADD_TO_UNLOCK_PRODUCTS_VARIANTS_MAP","compareAtPrice","variant_price","default_background","default_primary","default_secondary","default_font_color","default_danger","danger","__","translate","Languages","applied_discount_title","activeBackground","activeColor","show_all_locked_goals","product_price","products_length","exclude_tags","show_text","previous_gift","compare_at_price_active","outline","variant_button_background","atcButton_background","atcButton_hoverBackground","external","truncate","truncate_length","active_background","active_color","include","open_cart","grow","image_size","error_message","is_form_in_cart","confirm_button","loading_button","atc_action","desktop_visibility","desktop_location","mobile_active","mobile_visibility","hours","minutes","seconds","textAlignement","splits","show","curve","lineCap","colors","dashArray","dropShadow","left","blur","xaxis","yaxis","dataLabels","enabledOnSeries","iconName","atcActions","CustomScroll","isMobile","trackBg","thumbBg","scrollRef","finalClassName","custom_scrollbar","addPrefix","require","isObject","variable","cssClasses","cssClass","c","APPSYNC_ENDPOINT","APPSYNC_REGION","AUTH_TOKEN_KEY","GiftWithPurchaseWidget","MultiGiftWithPurchaseWidget","CartItem","cartItem","giftGoals","line","line_quantity","itemSoldOut","variant_title","variant_options","soldOut","setSoldOut","maxQuantity","setMaxQuantity","selectedSellingPlanID","setSelectedSellingPlanID","plansData","setPlansData","loadingPlan","setLoadingPlan","removeFBTUpsell","selectedVariant","IS_EXAMPLE","IS_ONE_CHECK_PRODUCT","IS_GIFT_PRODUCT","updateItem","newQuantity","formatText","getPrice","original","hasCompareAt","finalPrice","mu_handle_compareAt","GetCartLineItemDiscount","single_price","mu_show_single_price","original_line_price","productQuantity","selectedBundle","sortByQuantity","getBundleDiscount","plain","formatBundleLabel","sortBundles","getPlansData","checkForAppScript","scriptKeyword","scripts","getElementsByTagName","fetchData","formatSubsciptionUpgrade","plans_group_name","selling_plan_name","subscriptions","external_plan_name","data-product-id","data-variant-id","mu_display_product_image","mu_title_unclickable","hide_variant_title","mu_variants_join_char","mu_show_discount_when_code_only","fillRule","clipRule","show_item_properties","startsWith","show_private_properties","data-key","lighterColor","aria-label","data-state","appearance","selling_plan_id","updateCartItem","retry","Promise","resolve","reject","onetime","groupLabel","external_plan_id","labels","itemQuantity","CartItemsList","ocu_products","filteredItems","ocu_product","byQuantity","bundlesDiscounts","getDiscount","getBundlesOnly","totalItems","mu_stop_shopify_rate","CAN_RENDER_GIFT_WIDGET","gifts","updates","handleGiftCampaignChange","paddingTop","GetPresentableItemsList","mu_dont_reverse_items","getCartItems","hasManyGifts","previous_goal","some","goalObject","oldGoal","getGoal","inCents","getTotal","giftGoal","get_product_by_handle","product_handle","multiplier","langPath","routes","root","types","GetDiscountFromCheckoutPage","serializedGraphqlString","ParsedGraphql","session","negotiate","sellerProposal","localizedMessage","subtotalBeforeReductions","runningTotal","merchandiseDiscount","lines","OriginalTotal","Decimal","mul","toNumber","NewTotal","discountValue","CartHasAutoDiscount","hasItemLevelAutoDiscount","hasCartLevelAutoDiscount","getCartLink","mu_use_cart_json","addToCart","formData","hasFile","entriesIsFunction","File","mu_form_files","formHasFile","parseVariantId","image_id","singleId","findItem","newItems","discounted","calculateDiscount","formatted","prop","navigator","userAgent","vendor","opera","substr","Math","abs","floor","noMarketsRounding","mu_market_rounding","ceil","formattedMoney","mu_after_format_money","logError","getVariantPrice","selected_variant","subscription_first","requires_selling_plan","mu_fbt_sub_first","selling_plan_allocations","unformattedPrice","activeCurrency","presentmentPrices","presentment_prices","foundPrice","currency_code","mu_stop_presentment","getAddedGifts","productHasOneVariant","variantIsOnStock","inventory_management","inventory_policy","getMaxQuantity","parseProductId","string","initialValue","mu_shipProtectSelected","mu_shipProtectPrice","BundlesIndexMap","quantityDeference","extractContent","s","span","innerHTML","innerText","getCompareAtDiscount","mu_exclude_free_gift_price","compare_at","times","checkAgainst","FilterAtuGoals","itemHasAutoDiscount","existingItemIndex","existingItem","getAutoDiscounts","ItemLevelAutoDiscount","CartLevelAutoDiscount","totalAutoDiscount","filteredItemsTotal","ItemLevelTotalDiscount","mu_use_new_discount_calculation","total_discount","CartLevelDiscountCode","totalAppliedDiscounts","mu_use_totalAppliedDiscounts","countedBundles","product_bundles_campaign","productItems","productTotal","bundlesIndexMap","calculateReward","getCampaign","atuDiscount","totalWithBundlesDiscount","quantityCount","unlocked","add_to_unlock_discount","round_atuDiscount","round","getModules","alpha","formatColorHex","rgbaToHex","RGBToHex","colorAutoBlend","percentage","sqrt","lightOrDark","darkerColor","blend","pSBC","isExample","old_inventory_quantity","hasParentWithMatchingSelector","el","callback","isScript","getShopProducts","mu_stop_json_products","totalPages","mu_get_all_products","requests","page","all","responses","flatMap","getRechargeSubscriptionsData","productId","fetch","ok","json","groupedPlans","discountLabel","discount_amount","getDefaultSubscriptionsData","productUrl","appId","variantId","hostname","selling_plan_groups","filteredSubscriptions","app_id","subscriptionGroup","selling_plans","price_adjustments","priceAdjustment","value_type","oneTimePrice","mu_money_format","spa","charge_interval_frequency","discount_type","external_plan_group_id","appType","memo","product_info","preview_product","add_to_cart","productNotAddedToCart","setVariantPickerOptions","setVariantsPickerShow","addFBTUpsell","hasWriteDiscountsScope","subscriptionObject","HAS_SUBSCRIPTION","widget_settings","published","sodOut","setSodOut","dataFetched","setDataFetched","mu_fbt_set_default_variant","option1","option2","option3","selectedOptions","selectedValues","variantOptions","setOriginal","addToCartInit","fetched","skip_picker","mu_custom_fbt_logic","mu_filter_fbt_subscription","buttonText","sellingPlanId","priceText","mu_fbt_custom_atc","fetchProductInfo","newOriginal","calculateOriginal","updateProduct","updatedVariants","newProduct","updatedProduct","mu_fbt_use_fetched_product","formattedText","formattedPrice","mu_fbt_title_unclickable","mu_fbt_replace_show_details","elm","productsInMemory","cartContext","monster_static","upSells","setUpSells","filterUpsells","storefront_purchase_options","subscription_options","allProducts","setAllProducts","handleSetAllProducts","tmpProducts","fetchProducts","upsells","cancel","toBeFetched","cancelToken","fetchedProducts","pro","notAdded","mu_custom_fbt_filter","prod","checkTags","tmpUpsel","parseProducts","recoEndpoint","CancelToken","String","isUnlocked","calculateGoals","campaign_id","autoDiscountGifts","contextCache","setShowConfetti","ascGoals","dir","isDesc","toLocaleUpperCase","sortGoals","goalValue","discountedValue","mu_include_sub_full_price","totalPrice","wasLocked","goalsLength","1","2","3","4","badgeProgressLength","isDescending","previousGoal","textKey","labelKey","previousIsUnlocked","HeaderMachine","createMachine","GoalImageContent","HeaderATU","onlyOneItemAddedToCart","shipProtectState","setContextCache","hasImage","handleGifts","showConfettiPreview","hasLongBadgePrice","matches","extractedText","data-offset","progress_background","data-quantity","otherUnlockedDiscounts","progress_thick","data-goal","ProgressBar","formattedGoal","hasUploadedImage","roundedFirst","roundedLast","completed","GoalText","notTheHighestDiscount","html","textIsEmpty","formateText","replacedReward","replacedAmount","replacedQuantity","pickRandomGift","cachedVariant","generateVariant","random","cached_at","now","getVariants","addedVariants","next_goal","giftsCount","GiftMustBeAddedManually","randomVariant","handleGiftProduct","initialState","stateRef","newState","inlineOnChange","returnValue","Header","slickGoTo","active_slide","back","add_to_unlock_campaign","shadow","headerRef","ExtraModule","fixItemPrice","line_price","updateBagCounter","item_count","dawn_icon","querySelector","dawn_counter","envy_counters","cart_svg","outerHTML","cart_bubble","appendChild","envy_counter","classList","mu_bag_selecor","mu_bag_selector","formatted_count","mu_cart_count_formatter","child_nodes","sendCartUpdatedEvent","mu_disable_cart_update","mu_stop_cart_updated_event","CustomEvent","detail","dispatchEvent","onSubmit","upsellCartStopped","DelayedEvents","manualSetupCartLinks","mu_origin","mu_custom_links","fetchProductDetails","productData","mu_cart_with_compares","variant_data","cartItemsWithComparedPrices","thankYouPageCleanup","localStorage","refreshCart","res","monster_setCartItems","mu_productionAddToCartCallBack","openCart","monster_addToCart","headers","serializeForm","FormData","serialized","monster_submit","tagName","mu_custom_atc_logic","mu_product","monster_getCartItems","monster_refresh","monster_submitAddToCartForm","clearCart","monster_clearCart","ProductDetails","CodForm","VariantsPicker","BundlesVariantsPicker","Confetti","CartProvider","Cart","getCampaigns","mergeCampaigns","mergeCompareAtMap","setShopSettings","onInit","cart_ref","header_ref","setHasAutoDiscount","variantsPickerShow","variantsPickerShow_ref","variantPickerOptions","viewCartTracked","setViewCartTracked","showConfetti","previewed_product","setDiscountCode","setRechargeSettings","userIsTabbing","setUserIsTabbing","setShipProtectState","variantsPickerOverlay_ref","bundlesVariantsPickerOverlay_ref","bundlesVariantsPickerShow","setBundlesVariantsPickerShow","bundlesVariantsPickerOptions","setBundlesVariantsPickerOptions","new_items","filtered_items","added_items","newUpsells","fbtUpsells","finalUpsells","CartItemsReducer","shopify_cart_state","monster_loading","productionAddToCartCallBack","NonUndefinedCampaigns","campaignsKeys","shouldBeActive","productCampaigns","fromCampaign","mergedModules","currentQuantity","trackEvent","byVariant","productAddedToCartByVariant","onlyOneItemAddedToCartByVariant","compareAt","finalDiscount","mu_cartSummary","monster_getTotal","productionAddToCart","sameId","sameProperties","sameSellingPlane","gfFileUpload","requiredFields","requestSubmit","hasFont","handleFirstTab","keyCode","nonGiftsItems","deleteGifts","notifyMonsterUpsells","WebFont","load","google","families","fetchCampaigns","mergeCartItem","removeCartItem","setCartNote","monster_addCartItem","monster_mergeCartItem","monster_removeCartItem","monster_setCartNote","getRechargeSettings","recharge_installed","recharge_active","ReCharge","is_installed","removeAttribute","campaignsIds","addCartItem","direction","offsetwidth","recycle","numberOfPieces","gravity","onConfettiComplete","initialVelocityX","parentRef","iconRef","campaign_type","bundles_product_id","getFullCampaign","product_campaign","global_campaigns","bundles_campaign","itemsIds","type_campaign","product_campaigns","productGlobalCampaigns","productIsAddedToCart"],"mappings":"0FACAA,EAAOC,QAAU,CAAC,UAAY,+B,qBCA9BD,EAAOC,QAAU,CAAC,aAAe,oCAAoC,GAAK,0BAA0B,QAAU,+BAA+B,KAAO,8B,qBCApJD,EAAOC,QAAU,CAAC,aAAe,oCAAoC,KAAO,4BAA4B,QAAU,+BAA+B,QAAU,+BAA+B,MAAQ,+B,2CCAlMD,EAAOC,QAAU,CAAC,WAAa,oCAAoC,cAAgB,uCAAuC,kBAAoB,2CAA2C,WAAa,oCAAoC,oBAAsB,6CAA6C,sBAAwB,+CAA+C,cAAgB,uCAAuC,MAAQ,+BAA+B,eAAiB,0C,oBCAneD,EAAOC,QAAU,CAAC,MAAQ,uBAAuB,QAAU,yBAAyB,OAAS,wBAAwB,OAAS,wBAAwB,KAAO,sBAAsB,KAAO,sBAAsB,OAAS,wBAAwB,WAAa,4BAA4B,IAAM,qBAAqB,KAAO,sBAAsB,QAAU,yBAAyB,UAAY,2BAA2B,QAAU,2B,8MCAhaC,EAAgBC,IAAMC,cAAc,MAC7BC,EAAiBH,EAAcI,SAC7BJ,ICDTK,EAAcJ,IAAMC,cAAc,M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OAAoB8jF,SAElJ,GAAIO,EAAe,CAClB,kBAAoBA,EAApB,GACAJ,EAAmB,CADnB,UAC8Bp/E,MAAK,qBAAG7E,OAAoB8jF,OAG5D,MAA+BG,EAA/B,mBAAO/lC,EAAP,KAAmB/+C,EAAnB,KACA,OAAO++C,EAAa,CAACA,EAAY8lC,EAAkB7kF,EAAWA,EAAS2kF,GAAgB3kF,EAASwzD,UAAYtX,K,uCCnC7G/iD,EAAOC,QAAU,CAAC,KAAO,4BAA4B,OAAS,8BAA8B,OAAS,8BAA8B,eAAiB,sCAAsC,KAAO,4BAA4B,KAAO,4BAA4B,KAAO,8B,mBCAvQD,EAAOC,QAAU,CAAC,iBAAmB,sCAAsC,SAAW,8BAA8B,SAAW,8BAA8B,eAAiB,oCAAoC,gBAAkB,qCAAqC,SAAW,gC,oBCApRD,EAAOC,QAAU,CAAC,MAAQ,0BAA0B,MAAQ,0BAA0B,QAAU,+B","file":"static/js/main.7308aa20.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"tag_input\":\"tag_input_tag_input__2h8uO\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"buttonSelect\":\"button_select_buttonSelect__LHhVw\",\"or\":\"button_select_or__2V9JI\",\"wrapper\":\"button_select_wrapper__1mvtL\",\"line\":\"button_select_line__3yJ-u\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"notification\":\"notifications_notification__gB97s\",\"icon\":\"notifications_icon__2unUY\",\"content\":\"notifications_content__3Fv1w\",\"actions\":\"notifications_actions__2efjC\",\"close\":\"notifications_close__2Flnr\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"navy_color\":\"charge_approval_navy_color__1QEUU\",\"bg_blue_color\":\"charge_approval_bg_blue_color__2UUzz\",\"border_blue_color\":\"charge_approval_border_blue_color__2Hlac\",\"blue_color\":\"charge_approval_blue_color__2iY8N\",\"bg_light_blue_color\":\"charge_approval_bg_light_blue_color__3n0_N\",\"bg_lighter_blue_color\":\"charge_approval_bg_lighter_blue_color__1M7-Q\",\"table_rounded\":\"charge_approval_table_rounded__1uMbq\",\"table\":\"charge_approval_table__1tTAA\",\"hidden_pricing\":\"charge_approval_hidden_pricing__3II4x\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"badge\":\"sidebar_badge__3tLl5\",\"sidebar\":\"sidebar_sidebar__31FrF\",\"widget\":\"sidebar_widget__-uUjg\",\"attach\":\"sidebar_attach__1d91n\",\"logo\":\"sidebar_logo__37BqK\",\"menu\":\"sidebar_menu__2ZjLW\",\"spacer\":\"sidebar_spacer__135V8\",\"menu_setup\":\"sidebar_menu_setup__3eQxJ\",\"div\":\"sidebar_div__3m1qx\",\"text\":\"sidebar_text__2ikgg\",\"counter\":\"sidebar_counter__1Epiv\",\"menu_item\":\"sidebar_menu_item__MjEAI\",\"new_app\":\"sidebar_new_app__1AFMt\"};","import React from 'react';\r\nconst NotifyContext = React.createContext(null);\r\nexport const NotifyProvider = NotifyContext.Provider;\r\nexport default NotifyContext;\r\n","import React from 'react';\r\n\r\nconst ShopContext = React.createContext(null);\r\nexport const ShopProvider = ShopContext.Provider;\r\nexport default ShopContext;","import React from 'react';\r\n\r\nconst UserContext = React.createContext(null);\r\nexport const UserProvider = UserContext.Provider;\r\nexport const UserConsumer = UserContext.Consumer;\r\nexport default UserContext;\r\n","import React from 'react';\r\n\r\nconst PreviewContext = React.createContext(null);\r\nexport const PreviewProvider = PreviewContext.Provider;\r\n\r\nexport default PreviewContext;\r\n","import gql from 'graphql-tag';\r\n\r\nexport const UPDATE_SHOP_PROP = gql`\r\n\tmutation updateShopProp($id: ID!, $input: updateShopProp__input!) {\r\n\t\tupdateShopProp(id: $id, input: $input) {\r\n\t\t\tid\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport const SWITCH_CAMPAIGN_STATUS = gql`\r\n\tmutation SwitchCampaignStatus($id: ID!, $input: UpdateCampaignInput!) {\r\n\t\tupdateCampaign(id: $id, input: $input) {\r\n\t\t\tid\r\n\t\t\tname\r\n\t\t\tactive\r\n\t\t\ttarget {\r\n\t\t\t\ttype\r\n\t\t\t}\r\n\t\t\tsettings {\r\n\t\t\t\ttype\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport const CREATE_CAMPAIGN_MUTATION = gql`\r\n\tmutation CreateCampaign($input: NewCampaignInput!) {\r\n\t\tcreateCampaign(input: $input) {\r\n\t\t\tid\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport const UPDATE_CAMPAIGN_MUTATION = gql`\r\n\tmutation UpdateCampaign($id: ID!, $input: UpdateCampaignInput!) {\r\n\t\tupdateCampaign(id: $id, input: $input) {\r\n\t\t\tid\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport const REMOVE_CAMPAIGN_MUTATION = gql`\r\n\tmutation RemoveCampaign($id: ID!) {\r\n\t\tremoveCampaign(id: $id) {\r\n\t\t\tid\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport const SAVE_SHOP_SETTINGS = gql`\r\n\tmutation SaveShopSettings($id: ID!, $input: ShopSettings__input!) {\r\n\t\tupdateShopSettings(id: $id, input: $input) {\r\n\t\t\tid\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport const SAVE_PLAN_SETTINGS = gql`\r\n\tmutation SavePlanSettings($id: ID!, $input: PlanSettings__input!) {\r\n\t\tupdatePlanSettings(id: $id, input: $input) {\r\n\t\t\tid\r\n\t\t}\r\n\t}\r\n`;\r\n","import gql from 'graphql-tag';\r\n\r\nconst GET_SINGLE_CAMPAIGN = gql`\r\n query GetSingleCampaign($id: ID!) {\r\n campaign(id: $id) {\r\n id\r\n name\r\n active\r\n target {\r\n type\r\n selected {\r\n id\r\n image\r\n title\r\n handle\r\n }\r\n ids\r\n countries {\r\n include_active\r\n include\r\n exclude_active\r\n exclude\r\n }\r\n }\r\n settings {\r\n type\r\n applied_discount_title\r\n bundles {\r\n text\r\n prefix\r\n font_size\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n activeBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n activeColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n list {\r\n id\r\n type\r\n quantity\r\n reward\r\n }\r\n style\r\n labelColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n badge {\r\n text {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n border {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n variantsPicker {\r\n active\r\n label\r\n confirm\r\n textColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n dropdownTextColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n dropdownBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n confirmTextColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n confirmBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n }\r\n add_to_unlock {\r\n fbt_position\r\n fbt_below\r\n separator {\r\n text\r\n active\r\n }\r\n progress_thick\r\n progress_background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n progress_primary {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n progress_secondary {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n progress_complete {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n # reward_type\r\n title {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n borderColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n show_product_details {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n product_details {\r\n atcButton {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n atcButton_background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n atcButton_hoverBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n readMore {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n truncate\r\n truncate_length\r\n external\r\n }\r\n product_title {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n product_price {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n upsell_add_button {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n upsell_confirm_button {\r\n text\r\n font_size\r\n font_weight\r\n }\r\n show_suggestions\r\n recommendation_type\r\n products_length\r\n exclude_tags\r\n products {\r\n id\r\n image\r\n title\r\n price\r\n handle\r\n variants {\r\n id\r\n title\r\n price\r\n image\r\n }\r\n options {\r\n id\r\n name\r\n position\r\n values\r\n }\r\n }\r\n isActive\r\n show_all_locked_goals\r\n multi_goal_type\r\n show_badges\r\n goals {\r\n goal\r\n badge {\r\n type\r\n image\r\n show_text\r\n text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n }\r\n specific_goals {\r\n goal\r\n currency\r\n main\r\n }\r\n reward_type\r\n goal_type\r\n goal_text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n show_goal_text\r\n confetti\r\n confetti_length\r\n discount {\r\n type\r\n before\r\n after\r\n reward\r\n }\r\n free_shipping {\r\n before\r\n after\r\n manual\r\n }\r\n manual {\r\n before\r\n after\r\n }\r\n gift {\r\n before\r\n after\r\n product {\r\n id\r\n image\r\n title\r\n variant_id\r\n variant_price\r\n }\r\n products {\r\n id\r\n image\r\n title\r\n variant_id\r\n variant_price\r\n options {\r\n id\r\n name\r\n position\r\n values\r\n }\r\n variants {\r\n id\r\n title\r\n price\r\n image\r\n }\r\n }\r\n previous_gift\r\n multi_gift_select\r\n widget {\r\n active\r\n compare_at_price_active\r\n compare_at_price {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n before {\r\n header\r\n product_name\r\n offer_highlight {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n outline {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n multi_gift_image\r\n }\r\n selecting {\r\n header\r\n product_name\r\n offer_highlight {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n variant_selector_text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n outline {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n variant_button_background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n after {\r\n header\r\n product_name\r\n offer_highlight {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n variant_change_text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n outline {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n }\r\n # inventory_quantity {\r\n # active\r\n # text\r\n # }\r\n }\r\n }\r\n # goal\r\n # goal_type\r\n # discount {\r\n # \ttype\r\n # \tbefore\r\n # \tafter\r\n # \treward\r\n # }\r\n # free_shipping {\r\n # \tbefore\r\n # \tafter\r\n # \tmanual\r\n # }\r\n }\r\n one_check_up_sell {\r\n text\r\n is_ticked_by_default\r\n include_in_atu\r\n highlight {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n product_type\r\n truncate\r\n truncate_length\r\n product {\r\n id\r\n image\r\n price\r\n title\r\n handle\r\n body_html\r\n images {\r\n id\r\n src\r\n }\r\n options {\r\n id\r\n name\r\n product_id\r\n position\r\n values\r\n }\r\n variant_id\r\n variants {\r\n id\r\n title\r\n price\r\n image\r\n }\r\n }\r\n }\r\n multi_one_check_upsell {\r\n variant\r\n align\r\n border\r\n border_color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n highlight {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n switch_on {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n switch_off {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n products {\r\n text\r\n is_ticked_by_default\r\n include_in_atu\r\n product_type\r\n truncate\r\n truncate_length\r\n product {\r\n id\r\n image\r\n price\r\n title\r\n handle\r\n body_html\r\n images {\r\n id\r\n src\r\n }\r\n options {\r\n id\r\n name\r\n product_id\r\n position\r\n values\r\n }\r\n variant_id\r\n variants {\r\n id\r\n title\r\n price\r\n image\r\n }\r\n }\r\n }\r\n }\r\n modules {\r\n order\r\n random_text {\r\n text\r\n active\r\n }\r\n order_note {\r\n text\r\n active\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport default GET_SINGLE_CAMPAIGN;\r\n","import gql from 'graphql-tag';\r\n\r\nconst LIST_SHOP_CAMPAIGNS = gql`\r\n query ListShopCampaigns($userId: ID!, $nextToken: String) {\r\n campaigns(userId: $userId, nextToken: $nextToken) {\r\n nextToken\r\n list {\r\n id\r\n name\r\n active\r\n createdAt\r\n updatedAt\r\n target {\r\n type\r\n selected {\r\n id\r\n image\r\n title\r\n handle\r\n }\r\n ids\r\n countries {\r\n include_active\r\n include\r\n exclude_active\r\n exclude\r\n }\r\n }\r\n settings {\r\n type\r\n applied_discount_title\r\n bundles {\r\n text\r\n prefix\r\n font_size\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n activeBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n activeColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n list {\r\n id\r\n type\r\n quantity\r\n reward\r\n }\r\n style\r\n labelColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n badge {\r\n text {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n border {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n variantsPicker {\r\n active\r\n label\r\n confirm\r\n textColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n dropdownTextColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n dropdownBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n confirmTextColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n confirmBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n }\r\n add_to_unlock {\r\n fbt_position\r\n fbt_below\r\n separator {\r\n text\r\n active\r\n }\r\n progress_thick\r\n progress_background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n progress_primary {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n progress_secondary {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n progress_complete {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n title {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n borderColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n show_product_details {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n product_details {\r\n atcButton {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n atcButton_background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n atcButton_hoverBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n readMore {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n truncate\r\n truncate_length\r\n external\r\n }\r\n product_title {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n product_price {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n upsell_add_button {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n upsell_confirm_button {\r\n text\r\n font_size\r\n }\r\n # reward_type\r\n show_suggestions\r\n recommendation_type\r\n exclude_tags\r\n products_length\r\n products {\r\n id\r\n image\r\n title\r\n price\r\n handle\r\n variants {\r\n id\r\n title\r\n price\r\n image\r\n }\r\n options {\r\n id\r\n name\r\n position\r\n values\r\n }\r\n }\r\n isActive\r\n show_all_locked_goals\r\n multi_goal_type\r\n show_badges\r\n goals {\r\n goal\r\n badge {\r\n type\r\n image\r\n show_text\r\n text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n }\r\n specific_goals {\r\n goal\r\n currency\r\n main\r\n }\r\n reward_type\r\n goal_type\r\n goal_text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n show_goal_text\r\n confetti\r\n confetti_length\r\n discount {\r\n type\r\n before\r\n after\r\n reward\r\n }\r\n free_shipping {\r\n before\r\n after\r\n manual\r\n }\r\n manual {\r\n before\r\n after\r\n }\r\n gift {\r\n before\r\n after\r\n product {\r\n id\r\n image\r\n title\r\n variant_id\r\n variant_price\r\n }\r\n products {\r\n id\r\n image\r\n title\r\n options {\r\n id\r\n name\r\n position\r\n values\r\n }\r\n variants {\r\n id\r\n title\r\n price\r\n image\r\n }\r\n }\r\n previous_gift\r\n multi_gift_select\r\n widget {\r\n active\r\n compare_at_price_active\r\n compare_at_price {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n before {\r\n header\r\n product_name\r\n offer_highlight {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n outline {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n multi_gift_image\r\n }\r\n selecting {\r\n header\r\n product_name\r\n offer_highlight {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n variant_selector_text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n outline {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n variant_button_background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n after {\r\n header\r\n product_name\r\n offer_highlight {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n variant_change_text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n outline {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n }\r\n # inventory_quantity {\r\n # active\r\n # text\r\n # }\r\n }\r\n }\r\n # goal\r\n # discount {\r\n # \ttype\r\n # \tbefore\r\n # \tafter\r\n # \treward\r\n # }\r\n # free_shipping {\r\n # \tbefore\r\n # \tafter\r\n # \tmanual\r\n # }\r\n }\r\n one_check_up_sell {\r\n text\r\n is_ticked_by_default\r\n include_in_atu\r\n highlight {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n product_type\r\n truncate\r\n truncate_length\r\n product {\r\n id\r\n image\r\n price\r\n title\r\n handle\r\n variant_id\r\n body_html\r\n images {\r\n id\r\n src\r\n }\r\n options {\r\n id\r\n name\r\n position\r\n values\r\n }\r\n variants {\r\n id\r\n title\r\n price\r\n image\r\n }\r\n }\r\n }\r\n multi_one_check_upsell {\r\n variant\r\n align\r\n border\r\n border_color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n highlight {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n switch_on {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n switch_off {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n products {\r\n text\r\n is_ticked_by_default\r\n include_in_atu\r\n product_type\r\n truncate\r\n truncate_length\r\n product {\r\n id\r\n image\r\n price\r\n title\r\n handle\r\n body_html\r\n images {\r\n id\r\n src\r\n }\r\n options {\r\n id\r\n name\r\n product_id\r\n position\r\n values\r\n }\r\n variant_id\r\n variants {\r\n id\r\n title\r\n price\r\n image\r\n }\r\n }\r\n }\r\n }\r\n modules {\r\n order\r\n random_text {\r\n text\r\n active\r\n }\r\n order_note {\r\n text\r\n active\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport default LIST_SHOP_CAMPAIGNS;\r\n","import gql from 'graphql-tag';\r\n\r\nconst GET_SHOP_SETTINGS = gql`\r\n query GetShopSettings($userId: ID!) {\r\n shop(id: $userId) {\r\n id\r\n userId\r\n active\r\n invitation {\r\n type\r\n value\r\n }\r\n static_file_eligible\r\n static_file_status\r\n static_file_mode\r\n review_clicked\r\n welcome_video_watched\r\n first_cart_turn_on\r\n first_new_campaign_click\r\n first_new_campaign\r\n scope\r\n transactions\r\n auto_upgrade\r\n current_plan\r\n multi_currency_checkout_alerted\r\n draft_checkout_alerted\r\n custom_links {\r\n selector\r\n action\r\n }\r\n custom_atcs {\r\n button\r\n id {\r\n type\r\n name\r\n selector\r\n }\r\n }\r\n installedAt\r\n version\r\n money_format\r\n currency\r\n campaigns {\r\n id\r\n }\r\n settings {\r\n multiCurrencyMode\r\n default_language\r\n active\r\n open_cart\r\n rtl\r\n curved\r\n empty_cart\r\n custom_css\r\n theme {\r\n textColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n buttonColor {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n primary {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n secondary {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n font {\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n size\r\n family\r\n custom\r\n }\r\n header {\r\n title {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n product {\r\n title {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n price {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n image_size\r\n grow\r\n sold_out\r\n }\r\n product_details {\r\n atcButton {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n atcButton_background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n atcButton_hoverBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n readMore {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n truncate\r\n truncate_length\r\n external\r\n }\r\n show_coupon\r\n show_coupon_alert_text\r\n is_checkout_condition_active\r\n checkout_condition_text\r\n active_continue_shopping_button\r\n active_continue_shopping_underlined\r\n continue_shopping_button {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n checkout_condition_color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n modules {\r\n order\r\n random_text {\r\n text\r\n active\r\n }\r\n order_note {\r\n text\r\n active\r\n }\r\n checkout_button {\r\n checkout_as_link\r\n show_subtotal\r\n fix_checkout_container\r\n active_continue_shopping_button\r\n active_continue_shopping_underlined\r\n continue_shopping_button {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n button_text {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n button_text_loading {\r\n text\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n hoverBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n coupon {\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n hoverBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n active_background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n active_color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n coupon_alert_text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n use_coupon_code {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n enter_coupon_code {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n apply_coupon_code {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n edit_coupon_code {\r\n text\r\n font_size\r\n }\r\n close_coupon_code {\r\n text\r\n font_size\r\n }\r\n subtotal {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n savings {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n }\r\n }\r\n cod_settings {\r\n is_active\r\n is_form_in_cart\r\n error_message\r\n checkout_mode\r\n checkout_button {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n hoverBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n confirm_button {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n hoverBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n loading_button {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n hoverBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n form {\r\n label\r\n placeholder\r\n isRequired\r\n type\r\n options\r\n }\r\n }\r\n sticky_cart {\r\n isActive\r\n btn_style\r\n btn_text\r\n btn_text_unavailable\r\n btn_text_variant_active\r\n btn_color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n txt_color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n background_color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n atc_action\r\n desktop_active\r\n desktop_show_quantity\r\n desktop_show_variants\r\n desktop_product_preview\r\n desktop_show_product_name\r\n desktop_show_compared_price\r\n desktop_visibility\r\n desktop_location\r\n desktop_quantity {\r\n text\r\n }\r\n mobile_quantity {\r\n text\r\n }\r\n cart_name {\r\n text\r\n }\r\n mobile_active\r\n mobile_show_variants\r\n mobile_show_quantity\r\n mobile_show_compared_price\r\n mobile_visibility\r\n mobile_location\r\n mobile_show_title\r\n mobile_show_price\r\n mobile_atc_height {\r\n font_size\r\n text\r\n }\r\n show_btn_atc_txt_variant_active\r\n btn_atc_txt_variant_active\r\n }\r\n badges {\r\n isActive\r\n position\r\n value\r\n }\r\n auto_discount {\r\n text {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n border {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n subscription {\r\n isActive\r\n text {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n border {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n upgradingText {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n downgradingText {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n loadingBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n loadingBorder {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n subscribedText {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n subscribedBackground {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n subscribedBorder {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n scary {\r\n isActive\r\n text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n style\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n border {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n isDaysActive\r\n isHoursActive\r\n isMinutesActive\r\n isSecondsActive\r\n days\r\n hours\r\n minutes\r\n seconds\r\n endAction\r\n placement\r\n textAlignement\r\n }\r\n afterPay {\r\n isActive\r\n splits\r\n image\r\n isExternal\r\n text {\r\n text\r\n font_size\r\n font_weight\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n }\r\n announcement {\r\n isActive\r\n text {\r\n text\r\n font_size\r\n color {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n }\r\n style\r\n background {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n border {\r\n r\r\n g\r\n b\r\n a\r\n }\r\n position\r\n textAlignement\r\n }\r\n count_compare_at\r\n }\r\n chargeCreated\r\n chargeConfirmationUrl\r\n chargeAccepted\r\n snippetCreated\r\n enabled_presentment_currencies\r\n }\r\n }\r\n`;\r\n\r\nexport default GET_SHOP_SETTINGS;\r\n","\r\nimport mixpanel from 'mixpanel-browser';\r\n\r\n\r\nexport const trackMixPanelEvent = (eventKey, shopName, properties = {}) => {\r\n if(process.env.REACT_APP_MIXPANEL_APIKEY){\r\n mixpanel.init(process.env.REACT_APP_MIXPANEL_APIKEY, {debug: false }); \r\n // eventKey = process.env.REACT_APP_MIXPANEL_TEST ? `TEST - ${eventKey}` : eventKey\r\n eventKey = eventKey\r\n mixpanel.track(eventKey, {\r\n unique_id:shopName,\r\n distinct_id: shopName,\r\n ...properties\r\n });\r\n }\r\n}","import React, { useContext, useEffect, useState, useCallback } from 'react';\r\nimport { Page, ItemsList, Icon, Spinner, Button } from 'components';\r\nimport UserContext from 'context/UserContext';\r\nimport PreviewContext from 'context/PreviewContext';\r\nimport useReactRouter from 'use-react-router';\r\nimport { useMutation } from '@apollo/react-hooks';\r\nimport { faPlus } from '@fortawesome/fontawesome-pro-solid';\r\nimport _ from 'lodash';\r\nimport { Loading, Toast, Modal } from '@shopify/app-bridge-react';\r\nimport { SWITCH_CAMPAIGN_STATUS, REMOVE_CAMPAIGN_MUTATION } from 'lib/mutations';\r\nimport { LIST_SHOP_CAMPAIGNS } from 'Queries';\r\nimport { BOX_CHECK_ICON, CAMPAIGN_TARGETS, BREAK_POINTS } from 'lib/globals';\r\nimport classNames from 'lib/classNames';\r\nimport ShopContext from 'context/ShopContext';\r\nimport API from '@aws-amplify/api';\r\nimport { Popover } from 'react-tiny-popover';\r\nimport { useQuery } from '@apollo/react-hooks';\r\nimport { trackMixPanelEvent } from 'lib/mixpanel';\r\n\r\nconst List = ({ setIsOpen }) => {\r\n const limitCampaigns = 35;\r\n const [, updateState] = useState();\r\n const [analytics, setAnalytics] = useState([]);\r\n const [popovers, setPopOvers] = useState({});\r\n const showPopOver = (id) => setPopOvers(Object.assign({}, popovers, { [id]: true }));\r\n const hidePopOver = (id) => setPopOvers(Object.assign({}, popovers, { [id]: false }));\r\n const forceUpdate = useCallback(() => updateState({}), []);\r\n const user = useContext(UserContext);\r\n const { collapsed, previewCampaign, preview_active_campaign } = useContext(PreviewContext);\r\n const shopContext = useContext(ShopContext);\r\n const {\r\n AppLocalStorage,\r\n state: {\r\n id: shopName,\r\n settings: { multiCurrencyMode },\r\n money_format\r\n }\r\n } = shopContext;\r\n const killDraftBreakPoint = BREAK_POINTS['kill_draft'](shopContext);\r\n\r\n const { history, location } = useReactRouter();\r\n const [showConfirmDelete, setShowConfirmDelete] = useState(false);\r\n const formatWithDelimiters = (number, precision = 2, thousands = ',', decimal = '.') => {\r\n if (isNaN(number) || number == null) {\r\n return 0;\r\n }\r\n\r\n number = (number / 100.0).toFixed(precision);\r\n\r\n var parts = number.split('.'),\r\n dollars = parts[0].replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '$1' + thousands),\r\n cents = parts[1] ? decimal + parts[1] : '';\r\n\r\n return dollars + cents;\r\n };\r\n const formatMoney = (n) => {\r\n n *= 100;\r\n return money_format\r\n .replace(/{{\\s*?amount\\s*?}}/g, formatWithDelimiters(n, 2))\r\n .replace(/{{\\s*?amount_no_decimals\\s*?}}/g, formatWithDelimiters(n, 0))\r\n .replace(\r\n /{{\\s*?amount_with_comma_separator\\s*?}}/g,\r\n formatWithDelimiters(n, 2, '.', ',')\r\n )\r\n .replace(\r\n /{{\\s*?amount_no_decimals_with_comma_separator\\s*?}}/g,\r\n formatWithDelimiters(n, 0, '.', ',')\r\n )\r\n .replace(\r\n /{{\\s*?amount_with_apostrophe_separator\\s*? }}/g,\r\n formatWithDelimiters(n, 2, \"'\", '.')\r\n );\r\n };\r\n const numberFormat = new Intl.NumberFormat('en-US', {\r\n maximumSignificantDigits: 3\r\n }).format;\r\n let {\r\n data: ListCampaignsData,\r\n loading: queryLoading,\r\n error: queryError,\r\n fetchMore\r\n } = useQuery(LIST_SHOP_CAMPAIGNS, {\r\n variables: {\r\n userId: user.attributes.sub\r\n },\r\n fetchPolicy: ['tentsile.myshopify.com', 'bobaboxes.myshopify.com'].includes(shopName) ? 'no-cache' : 'cache-and-network'\r\n });\r\n let [\r\n SetCampaignActiveMutation,\r\n {\r\n loading: SetCampaignActiveMutation_loading,\r\n error: SetCampaignActiveMutation_error,\r\n data: SetCampaignActiveMutation_data\r\n }\r\n ] = useMutation(SWITCH_CAMPAIGN_STATUS);\r\n let [\r\n RemoveCampaignMutation,\r\n {\r\n loading: RemoveCampaignMutation_loading,\r\n error: RemoveCampaignMutation_error,\r\n data: RemoveCampaignMutation_data\r\n }\r\n ] = useMutation(REMOVE_CAMPAIGN_MUTATION);\r\n const setCampaignActive = (id, active) => {\r\n SetCampaignActiveMutation({\r\n variables: { id, input: { active } },\r\n update: (cache, { data: { updateCampaign } }) => {\r\n cache.writeQuery({\r\n query: LIST_SHOP_CAMPAIGNS,\r\n variables: {\r\n userId: user.attributes.sub\r\n },\r\n data: {\r\n campaigns: {\r\n list: ListCampaignsData.campaigns.list.map((campaign) => {\r\n if (campaign.id === id) {\r\n return updateCampaign;\r\n }\r\n return campaign;\r\n }),\r\n nextToken: ListCampaignsData.campaigns.nextToken,\r\n __typename: ListCampaignsData.campaigns.__typename\r\n }\r\n }\r\n });\r\n }\r\n });\r\n };\r\n const confirmDelete = (id) => {\r\n setShowConfirmDelete(id); //store campaign id\r\n };\r\n\r\n const isBeingPreviewed = (campaign) => campaign == preview_active_campaign && !collapsed;\r\n\r\n const edit = (id) => history.push(`/campaigns/${id}` + location.search);\r\n const duplicate = (id) => {\r\n if (ListCampaignsData?.campaigns?.list.length >= limitCampaigns) {\r\n console.log('limited');\r\n } else {\r\n history.push(`/campaigns/create/${id}` + location.search);\r\n }\r\n };\r\n\r\n const handleNewCampaign = () => {\r\n if (!AppLocalStorage.getItem('first_new_campaign_click')) {\r\n AppLocalStorage.setItem('first_new_campaign_click', true);\r\n trackMixPanelEvent('First new campaign click', shopName);\r\n }\r\n if (ListCampaignsData?.campaigns?.list.length >= limitCampaigns) {\r\n console.log('limited');\r\n } else {\r\n history.push('campaigns/create' + location.search);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (SetCampaignActiveMutation_data) {\r\n let index = _.findIndex(ListCampaignsData?.campaigns?.list, {\r\n id: SetCampaignActiveMutation_data.updateCampaign.id\r\n });\r\n ListCampaignsData.campaigns.list[index] = SetCampaignActiveMutation_data.updateCampaign;\r\n forceUpdate();\r\n }\r\n }, [SetCampaignActiveMutation_data]);\r\n\r\n useEffect(() => {\r\n if (RemoveCampaignMutation_data) {\r\n ListCampaignsData.campaigns.list = ListCampaignsData?.campaigns?.list.filter(\r\n ({ id }) => id !== RemoveCampaignMutation_data.removeCampaign.id\r\n );\r\n forceUpdate();\r\n }\r\n }, [RemoveCampaignMutation_data]);\r\n\r\n const fetchStatistics = async (campaigns) => {\r\n const campaigns_list = campaigns\r\n .filter(({ settings }) => settings?.type !== 'one_check_up_sell')\r\n .map(({ id }) => id);\r\n const one_tick_campaigns = campaigns\r\n .filter(({ settings }) => settings?.type === 'one_check_up_sell')\r\n .map(({ id, settings }) => {\r\n const isOld_OCU = !settings.multi_one_check_upsell;\r\n if (isOld_OCU)\r\n return [\r\n id,\r\n settings?.one_check_up_sell?.product?.id,\r\n settings?.one_check_up_sell?.product?.variants[0].price\r\n ];\r\n return settings.multi_one_check_upsell.products\r\n .filter(({ product }) => Boolean(product?.id))\r\n .map(({ product }) => [id, product?.id, product?.variants[0].price]);\r\n })\r\n .reduce((acc, cur) => {\r\n if (Array.isArray(cur[0])) {\r\n cur.forEach((v) => acc.push(v));\r\n } else {\r\n acc.push(cur);\r\n }\r\n return acc;\r\n }, []);\r\n const body = {\r\n campaigns: campaigns_list,\r\n one_tick_campaigns\r\n };\r\n const data = await API.post('API_GATEWAY_NEW', '/analytics/campaigns', {\r\n body\r\n });\r\n const processedData = Object.assign(\r\n {},\r\n ...Object.entries(data).map(([id, states]) => {\r\n if (Array.isArray(states)) {\r\n const { UpsellsGenerated, upsellsTotalAmount } = states.reduce(\r\n (acc, cur) => {\r\n acc.UpsellsGenerated += cur.UpsellsGenerated;\r\n acc.upsellsTotalAmount += cur.upsellsTotalAmount;\r\n return acc;\r\n },\r\n { UpsellsGenerated: 0, upsellsTotalAmount: 0 }\r\n );\r\n return { [id]: { UpsellsGenerated, upsellsTotalAmount } };\r\n }\r\n return { [id]: states };\r\n })\r\n );\r\n setAnalytics(processedData);\r\n };\r\n const callLoadMore = () => {\r\n fetchMore({\r\n variables: {\r\n userId: user.attributes.sub,\r\n nextToken: ListCampaignsData?.campaigns?.nextToken\r\n },\r\n updateQuery(previousResult, { fetchMoreResult }) {\r\n if (!fetchMoreResult) return previousResult;\r\n return {\r\n campaigns: {\r\n __typename: fetchMoreResult.campaigns.__typename,\r\n nextToken: fetchMoreResult.campaigns.nextToken,\r\n list: [...previousResult.campaigns.list, ...fetchMoreResult.campaigns.list]\r\n }\r\n };\r\n }\r\n });\r\n };\r\n useEffect(() => {\r\n if (ListCampaignsData) {\r\n fetchStatistics(ListCampaignsData.campaigns.list);\r\n }\r\n }, [ListCampaignsData]);\r\n\r\n if (queryError || SetCampaignActiveMutation_error || RemoveCampaignMutation_error) {\r\n throw new Error(\r\n JSON.stringify({\r\n queryError,\r\n SetCampaignActiveMutation_error,\r\n RemoveCampaignMutation_error\r\n })\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n {(SetCampaignActiveMutation_loading || RemoveCampaignMutation_loading) && <Loading />}\r\n {SetCampaignActiveMutation_data && (\r\n <Toast\r\n content={`Campaign has been updated`}\r\n duration={3000}\r\n onDismiss={() => {\r\n SetCampaignActiveMutation_data = null;\r\n }}\r\n />\r\n )}\r\n {RemoveCampaignMutation_data && (\r\n <Toast\r\n content={`Campaign has been removed`}\r\n duration={3000}\r\n onDismiss={() => {\r\n RemoveCampaignMutation_data = null;\r\n }}\r\n />\r\n )}\r\n <Page\r\n header={{\r\n title: 'Campaign Dashboard',\r\n actions: [\r\n {\r\n type: 'link-info',\r\n text: 'New Campaign',\r\n icon: faPlus,\r\n onClick: handleNewCampaign\r\n }\r\n ]\r\n }}\r\n loading={{\r\n text: 'Fetching campaigns',\r\n status: queryLoading && !ListCampaignsData?.campaigns?.list.length\r\n }}\r\n >\r\n <ItemsList\r\n header={[\r\n {\r\n title: 'Active',\r\n onChange: ({ id }, active) => setCampaignActive(id, active)\r\n },\r\n {\r\n title: 'Campaign',\r\n value: (campaign) => {\r\n const {\r\n name,\r\n settings: { type, add_to_unlock, one_check_up_sell },\r\n target\r\n } = campaign;\r\n const isGlobalBundles =\r\n type === 'bundles' && target.type === 'all_products';\r\n const isMonsterFreeShippingAddToUnlock =\r\n type === 'add_to_unlock' &&\r\n add_to_unlock?.goals?.length === 1 &&\r\n add_to_unlock?.goals[0].reward_type === 'free_shipping' &&\r\n add_to_unlock?.goals[0].free_shipping.manual === false;\r\n const isVirtualOneCheck =\r\n type === 'one_check_up_sell' &&\r\n one_check_up_sell?.product_type === 'hidden';\r\n\r\n const isNotDelivering =\r\n multiCurrencyMode && (isGlobalBundles || isVirtualOneCheck);\r\n\r\n return (\r\n <div className={classNames('px-2')}>\r\n <h2\r\n className={classNames(\r\n 'font-bold text-gray-700 text-sm'\r\n )}\r\n >\r\n {campaign.name}\r\n </h2>\r\n {isNotDelivering && (\r\n <div className={classNames('mt-1 text-gray text-xs')}>\r\n <h4\r\n className={classNames(\r\n 'font-semibold flex items-center text-orange-500 leading-none'\r\n )}\r\n >\r\n <Icon\r\n icon=\"exclamation-square\"\r\n className=\"mr-1\"\r\n size=\"lg\"\r\n />\r\n Not delivering\r\n </h4>\r\n <p className={classNames('text-gray-600')}>\r\n due to 16th May checkout upgrade. Please edit\r\n this campaign to fix this.\r\n <a\r\n className={classNames(\r\n 'ml-2 underline cursor-pointer font-semibold'\r\n )}\r\n href=\"https://monsterapps.crisp.help/en/article/draft-checkout-removed-16th-may-update-de3y6j/\"\r\n target=\"_blank\" rel=\"noreferrer\"\r\n >\r\n Learn More\r\n </a>\r\n </p>\r\n </div>\r\n )}\r\n {isMonsterFreeShippingAddToUnlock && (\r\n <div className={classNames('mt-1 text-gray text-xs')}>\r\n <h4\r\n className={classNames(\r\n 'font-semibold flex items-center text-orange-500 leading-none'\r\n )}\r\n >\r\n <Icon\r\n icon=\"exclamation-square\"\r\n className=\"mr-1\"\r\n size=\"lg\"\r\n />\r\n Out of date\r\n </h4>\r\n <p className={classNames('text-gray-600')}>\r\n This add to unlock version is out of date.\r\n Please make new campaign.\r\n {/* <a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ml-2 underline cursor-pointer font-semibold\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\thref=\"https://monsterapps.crisp.help/en/article/draft-checkout-removed-16th-may-update-de3y6j/\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLearn More\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</a> */}\r\n </p>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n },\r\n // { title: 'Name' },\r\n {\r\n title: 'Type',\r\n value: (campaign) => {\r\n switch (campaign.settings.type) {\r\n case 'bundles':\r\n return (\r\n <div className={classNames('flex items-center')}>\r\n <span className={classNames('mr-1 primary-icon')}>\r\n <Icon icon=\"bars\" />\r\n </span>\r\n <span className={classNames('hidden-sm')}>\r\n Buy More Save More\r\n </span>\r\n </div>\r\n );\r\n case 'add_to_unlock':\r\n return (\r\n <div className={classNames('flex items-center')}>\r\n <span className={classNames('mr-1 primary-icon')}>\r\n <Icon icon=\"unlock\" />\r\n </span>\r\n <span className={classNames('hidden-sm')}>\r\n Add To Unlock\r\n </span>\r\n </div>\r\n );\r\n case 'one_check_up_sell':\r\n return (\r\n <div className={classNames('flex items-center')}>\r\n <span className={classNames('mr-1 primary-icon')}>\r\n <Icon icon={BOX_CHECK_ICON} />\r\n </span>\r\n <span className={classNames('hidden-sm')}>\r\n One Check Upsell\r\n </span>\r\n </div>\r\n );\r\n default:\r\n return null;\r\n }\r\n }\r\n },\r\n {\r\n title: 'Trigger',\r\n value: (campaign) =>\r\n CAMPAIGN_TARGETS.find(({ value }) => value === campaign.target.type)\r\n .label\r\n },\r\n // { title: \"Created At\", value: \"createdAt\" },\r\n // { title: \"Updated At\", value: \"updatedAt\" },\r\n {\r\n title: 'Added Products',\r\n value: (campaign) =>\r\n analytics ? (\r\n numberFormat(analytics[campaign.id]?.UpsellsGenerated || 0)\r\n ) : (\r\n <Spinner size={3} />\r\n )\r\n },\r\n {\r\n title: 'Campaign Revenue',\r\n value: (campaign) => {\r\n const updateDay = new Date('2024-04-20')\r\n const isNewCampaign = new Date(parseInt(campaign.createdAt)) >= updateDay;\r\n if (!analytics) return <Spinner size={3} />;\r\n if (!analytics[campaign.id])\r\n return (\r\n <span\r\n dangerouslySetInnerHTML={{\r\n __html: formatMoney(0)\r\n }}\r\n />\r\n );\r\n const data = analytics[campaign.id];\r\n const revenue = data?.upsellsTotalAmount || 0;\r\n\r\n if (campaign.settings.type !== \"add_to_unlock\")\r\n return (\r\n <span\r\n dangerouslySetInnerHTML={{\r\n __html: formatMoney(revenue)\r\n }}\r\n />\r\n );\r\n\r\n const fbt_sub_total = data?.fbt?.subtotal_sum || 0;\r\n const fbt_upsells_generated = data?.fbt?.UpsellsGenerated || 0;\r\n return (\r\n <Popover\r\n isOpen={isNewCampaign && (popovers[campaign.id] || false)}\r\n // positions={[\"center\", \"center\"]}\r\n padding={10}\r\n reposition={false}\r\n onClickOutside={() => hidePopOver(campaign.id)}\r\n content={() => (\r\n <div className=\"campaigns-popover\">\r\n <h2>Frequent Bought Module</h2>\r\n <div className=\"flex-container\">\r\n <div>\r\n <h4>Products Added</h4>\r\n <p>{fbt_upsells_generated}</p>\r\n </div>\r\n <div>\r\n <h4>Revenue Added</h4>\r\n <p\r\n dangerouslySetInnerHTML={{\r\n __html: formatMoney(fbt_sub_total)\r\n }}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n >\r\n <span\r\n className=\"campaigns-popover-trigger\"\r\n onMouseEnter={() => showPopOver(campaign.id)}\r\n onMouseLeave={() => hidePopOver(campaign.id)}\r\n >\r\n <span\r\n dangerouslySetInnerHTML={{\r\n __html: formatMoney(revenue)\r\n }}\r\n />{\" \"}\r\n <Icon\r\n icon=\"info-circle\"\r\n className={`campaigns-popover-info ${isNewCampaign ? '' : 'hidden'}`}\r\n size=\"sm\"\r\n />\r\n </span>\r\n </Popover>\r\n );\r\n }\r\n },\r\n\r\n { title: 'Actions' }\r\n ]}\r\n actions={[\r\n {\r\n name: 'Preview',\r\n icon: (campaign) => (isBeingPreviewed(campaign) ? 'eye-slash' : 'eye'),\r\n color: (campaign) =>\r\n isBeingPreviewed(campaign) ? 'primary' : 'secondary',\r\n method: (campaign) => previewCampaign(campaign)\r\n },\r\n {\r\n name: 'Duplicate',\r\n icon: 'clone',\r\n color: 'success',\r\n method: ({ id }) => duplicate(id),\r\n disabled: (campaign) => {\r\n const {\r\n settings: { type, add_to_unlock }\r\n } = campaign;\r\n const isMonsterFreeShippingAddToUnlock =\r\n type === 'add_to_unlock' &&\r\n add_to_unlock?.goals?.length === 1 &&\r\n add_to_unlock?.goals[0].reward_type === 'free_shipping' &&\r\n add_to_unlock?.goals[0].free_shipping.manual === false;\r\n return isMonsterFreeShippingAddToUnlock;\r\n }\r\n },\r\n {\r\n name: 'Edit',\r\n icon: 'pencil-alt',\r\n color: 'warning',\r\n method: ({ id }) => edit(id),\r\n disabled: (campaign) => {\r\n const {\r\n settings: { type, add_to_unlock }\r\n } = campaign;\r\n const isMonsterFreeShippingAddToUnlock =\r\n type === 'add_to_unlock' &&\r\n add_to_unlock?.goals?.length === 1 &&\r\n add_to_unlock?.goals[0].reward_type === 'free_shipping' &&\r\n add_to_unlock?.goals[0].free_shipping.manual === false;\r\n return isMonsterFreeShippingAddToUnlock;\r\n }\r\n },\r\n {\r\n name: 'Remove',\r\n icon: 'trash',\r\n color: 'danger',\r\n method: ({ id }) => confirmDelete(id)\r\n }\r\n ]}\r\n items={ListCampaignsData?.campaigns?.list || []}\r\n emptyState={{\r\n action: {\r\n text: 'New Campaign',\r\n url: '/campaigns/create'\r\n },\r\n text: \"You don't have any campaigns, Create you first campaign.\"\r\n }}\r\n />\r\n\r\n {ListCampaignsData?.campaigns?.nextToken && (\r\n <div className={classNames('p-2 text-center')}>\r\n <Button\r\n type=\"link-info\"\r\n loading={queryLoading && ListCampaignsData?.campaigns?.list.length}\r\n text=\"Load More\"\r\n onClick={callLoadMore}\r\n />\r\n </div>\r\n )}\r\n <p\r\n className={classNames(\r\n 'w-full cursor-pointer hover:underline flex-1 text-gray-600 text-md font-bold pt-6 mt-6 border-t'\r\n )}\r\n onClick={() => setIsOpen(true)}\r\n >\r\n Need help setting up campaigns or want best practices? Click here\r\n </p>\r\n </Page>\r\n <Modal\r\n title=\"Deleting a campaign\"\r\n message=\"Are you sure you want to delete this campaign\"\r\n open={!!showConfirmDelete} //cast string id to string\r\n primaryAction={{\r\n content: 'Delete',\r\n destructive: true,\r\n onAction: () => {\r\n //call remove mutation\r\n RemoveCampaignMutation({\r\n variables: { id: showConfirmDelete },\r\n update: (cache, { data: { removeCampaign } }) => {\r\n cache.writeQuery({\r\n query: LIST_SHOP_CAMPAIGNS,\r\n variables: {\r\n userId: user.attributes.sub\r\n },\r\n data: {\r\n campaigns: {\r\n list: ListCampaignsData.campaigns.list.filter(\r\n ({ id }) => id !== removeCampaign.id\r\n ),\r\n nextToken: ListCampaignsData.campaigns.nextToken,\r\n __typename: ListCampaignsData.campaigns.__typename\r\n }\r\n }\r\n });\r\n }\r\n });\r\n setShowConfirmDelete(false);\r\n }\r\n }}\r\n secondaryActions={[\r\n {\r\n content: 'Close',\r\n onAction: () => setShowConfirmDelete(false)\r\n }\r\n ]}\r\n />\r\n </>\r\n );\r\n};\r\n\r\nexport default List;\r\n","export const COUNTRIES_LIST = [\r\n {\"value\":\"worldwide\",\"label\":\"World Wide\"},\r\n {\"value\":\"AF\",\"label\":\"Afghanistan\"},\r\n {\"value\":\"AX\",\"label\":\"Ã…land Islands\"},\r\n {\"value\":\"AL\",\"label\":\"Albania\"},\r\n {\"value\":\"DZ\",\"label\":\"Algeria\"},\r\n {\"value\":\"AD\",\"label\":\"Andorra\"},\r\n {\"value\":\"AO\",\"label\":\"Angola\"},\r\n {\"value\":\"AI\",\"label\":\"Anguilla\"},\r\n {\"value\":\"AG\",\"label\":\"Antigua, Barbuda\"},\r\n {\"value\":\"AR\",\"label\":\"Argentina\"},\r\n {\"value\":\"AM\",\"label\":\"Armenia\"},\r\n {\"value\":\"AW\",\"label\":\"Aruba\"},\r\n {\"value\":\"AU\",\"label\":\"Australia\"},\r\n {\"value\":\"AT\",\"label\":\"Austria\"},\r\n {\"value\":\"AZ\",\"label\":\"Azerbaijan\"},\r\n {\"value\":\"BS\",\"label\":\"Bahamas\"},\r\n {\"value\":\"BH\",\"label\":\"Bahrain\"},\r\n {\"value\":\"BD\",\"label\":\"Bangladesh\"},\r\n {\"value\":\"BB\",\"label\":\"Barbados\"},\r\n {\"value\":\"BY\",\"label\":\"Belarus\"},\r\n {\"value\":\"BE\",\"label\":\"Belgium\"},\r\n {\"value\":\"BZ\",\"label\":\"Belize\"},\r\n {\"value\":\"BJ\",\"label\":\"Benin\"},\r\n {\"value\":\"BM\",\"label\":\"Bermuda\"},\r\n {\"value\":\"BT\",\"label\":\"Bhutan\"},\r\n {\"value\":\"BO\",\"label\":\"Bolivia\"},\r\n {\"value\":\"BA\",\"label\":\"Bosnia, Herzegovina\"},\r\n {\"value\":\"BW\",\"label\":\"Botswana\"},\r\n {\"value\":\"BV\",\"label\":\"Bouvet Island\"},\r\n {\"value\":\"BR\",\"label\":\"Brazil\"},\r\n {\"value\":\"IO\",\"label\":\"British Indian Ocean Territory\"},\r\n {\"value\":\"VG\",\"label\":\"British Virgin Islands\"},\r\n {\"value\":\"BN\",\"label\":\"Brunei\"},\r\n {\"value\":\"BG\",\"label\":\"Bulgaria\"},\r\n {\"value\":\"BF\",\"label\":\"Burkina Faso\"},\r\n {\"value\":\"BI\",\"label\":\"Burundi\"},\r\n {\"value\":\"KH\",\"label\":\"Cambodia\"},\r\n {\"value\":\"CM\",\"label\":\"Cameroon\"},\r\n {\"value\":\"CA\",\"label\":\"Canada\"},\r\n {\"value\":\"CV\",\"label\":\"Cape Verde\"},\r\n {\"value\":\"BQ\",\"label\":\"Caribbean Netherlands\"},\r\n {\"value\":\"KY\",\"label\":\"Cayman Islands\"},\r\n {\"value\":\"CF\",\"label\":\"Central African Republic\"},\r\n {\"value\":\"TD\",\"label\":\"Chad\"},\r\n {\"value\":\"CL\",\"label\":\"Chile\"},\r\n {\"value\":\"CN\",\"label\":\"China\"},\r\n {\"value\":\"CX\",\"label\":\"Christmas Island\"},\r\n {\"value\":\"CC\",\"label\":\"Cocos (Keeling) Islands\"},\r\n {\"value\":\"CO\",\"label\":\"Colombia\"},\r\n {\"value\":\"KM\",\"label\":\"Comoros\"},\r\n {\"value\":\"CG\",\"label\":\"Congo - Brazzaville\"},\r\n {\"value\":\"CD\",\"label\":\"Congo - Kinshasa\"},\r\n {\"value\":\"CK\",\"label\":\"Cook Islands\"},\r\n {\"value\":\"CR\",\"label\":\"Costa Rica\"},\r\n {\"value\":\"CI\",\"label\":\"Côte d’Ivoire\"},\r\n {\"value\":\"HR\",\"label\":\"Croatia\"},\r\n {\"value\":\"CU\",\"label\":\"Cuba\"},\r\n {\"value\":\"CW\",\"label\":\"Curaçao\"},\r\n {\"value\":\"CY\",\"label\":\"Cyprus\"},\r\n {\"value\":\"CZ\",\"label\":\"Czechia\"},\r\n {\"value\":\"DK\",\"label\":\"Denmark\"},\r\n {\"value\":\"DJ\",\"label\":\"Djibouti\"},\r\n {\"value\":\"DM\",\"label\":\"Dominica\"},\r\n {\"value\":\"DO\",\"label\":\"Dominican Republic\"},\r\n {\"value\":\"EC\",\"label\":\"Ecuador\"},\r\n {\"value\":\"EG\",\"label\":\"Egypt\"},\r\n {\"value\":\"SV\",\"label\":\"El Salvador\"},\r\n {\"value\":\"GQ\",\"label\":\"Equatorial Guinea\"},\r\n {\"value\":\"ER\",\"label\":\"Eritrea\"},\r\n {\"value\":\"EE\",\"label\":\"Estonia\"},\r\n {\"value\":\"SZ\",\"label\":\"Eswatini\"},\r\n {\"value\":\"ET\",\"label\":\"Ethiopia\"},\r\n {\"value\":\"FK\",\"label\":\"Falkland Islands\"},\r\n {\"value\":\"FO\",\"label\":\"Faroe Islands\"},\r\n {\"value\":\"FJ\",\"label\":\"Fiji\"},\r\n {\"value\":\"FI\",\"label\":\"Finland\"},\r\n {\"value\":\"FR\",\"label\":\"France\"},\r\n {\"value\":\"GF\",\"label\":\"French Guiana\"},\r\n {\"value\":\"PF\",\"label\":\"French Polynesia\"},\r\n {\"value\":\"TF\",\"label\":\"French Southern Territories\"},\r\n {\"value\":\"GA\",\"label\":\"Gabon\"},\r\n {\"value\":\"GM\",\"label\":\"Gambia\"},\r\n {\"value\":\"GE\",\"label\":\"Georgia\"},\r\n {\"value\":\"DE\",\"label\":\"Germany\"},\r\n {\"value\":\"GH\",\"label\":\"Ghana\"},\r\n {\"value\":\"GI\",\"label\":\"Gibraltar\"},\r\n {\"value\":\"GR\",\"label\":\"Greece\"},\r\n {\"value\":\"GL\",\"label\":\"Greenland\"},\r\n {\"value\":\"GD\",\"label\":\"Grenada\"},\r\n {\"value\":\"GP\",\"label\":\"Guadeloupe\"},\r\n {\"value\":\"GT\",\"label\":\"Guatemala\"},\r\n {\"value\":\"GG\",\"label\":\"Guernsey\"},\r\n {\"value\":\"GN\",\"label\":\"Guinea\"},\r\n {\"value\":\"GW\",\"label\":\"Guinea-Bissau\"},\r\n {\"value\":\"GY\",\"label\":\"Guyana\"},\r\n {\"value\":\"HT\",\"label\":\"Haiti\"},\r\n {\"value\":\"HM\",\"label\":\"Heard, McDonald Islands\"},\r\n {\"value\":\"HN\",\"label\":\"Honduras\"},\r\n {\"value\":\"HK\",\"label\":\"Hong Kong SAR China\"},\r\n {\"value\":\"HU\",\"label\":\"Hungary\"},\r\n {\"value\":\"IS\",\"label\":\"Iceland\"},\r\n {\"value\":\"IN\",\"label\":\"India\"},\r\n {\"value\":\"ID\",\"label\":\"Indonesia\"},\r\n {\"value\":\"IR\",\"label\":\"Iran\"},\r\n {\"value\":\"IQ\",\"label\":\"Iraq\"},\r\n {\"value\":\"IE\",\"label\":\"Ireland\"},\r\n {\"value\":\"IM\",\"label\":\"Isle of Man\"},\r\n {\"value\":\"IL\",\"label\":\"Israel\"},\r\n {\"value\":\"IT\",\"label\":\"Italy\"},\r\n {\"value\":\"JM\",\"label\":\"Jamaica\"},\r\n {\"value\":\"JP\",\"label\":\"Japan\"},\r\n {\"value\":\"JE\",\"label\":\"Jersey\"},\r\n {\"value\":\"JO\",\"label\":\"Jordan\"},\r\n {\"value\":\"KZ\",\"label\":\"Kazakhstan\"},\r\n {\"value\":\"KE\",\"label\":\"Kenya\"},\r\n {\"value\":\"KI\",\"label\":\"Kiribati\"},\r\n {\"value\":\"XK\",\"label\":\"Kosovo\"},\r\n {\"value\":\"KW\",\"label\":\"Kuwait\"},\r\n {\"value\":\"KG\",\"label\":\"Kyrgyzstan\"},\r\n {\"value\":\"LA\",\"label\":\"Laos\"},\r\n {\"value\":\"LV\",\"label\":\"Latvia\"},\r\n {\"value\":\"LB\",\"label\":\"Lebanon\"},\r\n {\"value\":\"LS\",\"label\":\"Lesotho\"},\r\n {\"value\":\"LR\",\"label\":\"Liberia\"},\r\n {\"value\":\"LY\",\"label\":\"Libya\"},\r\n {\"value\":\"LI\",\"label\":\"Liechtenstein\"},\r\n {\"value\":\"LT\",\"label\":\"Lithuania\"},\r\n {\"value\":\"LU\",\"label\":\"Luxembourg\"},\r\n {\"value\":\"MO\",\"label\":\"Macao SAR China\"},\r\n {\"value\":\"MG\",\"label\":\"Madagascar\"},\r\n {\"value\":\"MW\",\"label\":\"Malawi\"},\r\n {\"value\":\"MY\",\"label\":\"Malaysia\"},\r\n {\"value\":\"MV\",\"label\":\"Maldives\"},\r\n {\"value\":\"ML\",\"label\":\"Mali\"},\r\n {\"value\":\"MT\",\"label\":\"Malta\"},\r\n {\"value\":\"MQ\",\"label\":\"Martinique\"},\r\n {\"value\":\"MR\",\"label\":\"Mauritania\"},\r\n {\"value\":\"MU\",\"label\":\"Mauritius\"},\r\n {\"value\":\"YT\",\"label\":\"Mayotte\"},\r\n {\"value\":\"MX\",\"label\":\"Mexico\"},\r\n {\"value\":\"MD\",\"label\":\"Moldova\"},\r\n {\"value\":\"MC\",\"label\":\"Monaco\"},\r\n {\"value\":\"MN\",\"label\":\"Mongolia\"},\r\n {\"value\":\"ME\",\"label\":\"Montenegro\"},\r\n {\"value\":\"MS\",\"label\":\"Montserrat\"},\r\n {\"value\":\"MA\",\"label\":\"Morocco\"},\r\n {\"value\":\"MZ\",\"label\":\"Mozambique\"},\r\n {\"value\":\"MM\",\"label\":\"Myanmar (Burma)\"},\r\n {\"value\":\"NA\",\"label\":\"Namibia\"},\r\n {\"value\":\"NR\",\"label\":\"Nauru\"},\r\n {\"value\":\"NP\",\"label\":\"Nepal\"},\r\n {\"value\":\"NL\",\"label\":\"Netherlands\"},\r\n {\"value\":\"AN\",\"label\":\"Netherlands Antilles\"},\r\n {\"value\":\"NC\",\"label\":\"New Caledonia\"},\r\n {\"value\":\"NZ\",\"label\":\"New Zealand\"},\r\n {\"value\":\"NI\",\"label\":\"Nicaragua\"},\r\n {\"value\":\"NE\",\"label\":\"Niger\"},\r\n {\"value\":\"NG\",\"label\":\"Nigeria\"},\r\n {\"value\":\"NU\",\"label\":\"Niue\"},\r\n {\"value\":\"NF\",\"label\":\"Norfolk Island\"},\r\n {\"value\":\"KP\",\"label\":\"North Korea\"},\r\n {\"value\":\"MK\",\"label\":\"North Macedonia\"},\r\n {\"value\":\"NO\",\"label\":\"Norway\"},\r\n {\"value\":\"OM\",\"label\":\"Oman\"},\r\n {\"value\":\"PK\",\"label\":\"Pakistan\"},\r\n {\"value\":\"PS\",\"label\":\"Palestinian Territories\"},\r\n {\"value\":\"PA\",\"label\":\"Panama\"},\r\n {\"value\":\"PG\",\"label\":\"Papua New Guinea\"},\r\n {\"value\":\"PY\",\"label\":\"Paraguay\"},\r\n {\"value\":\"PE\",\"label\":\"Peru\"},\r\n {\"value\":\"PH\",\"label\":\"Philippines\"},\r\n {\"value\":\"PN\",\"label\":\"Pitcairn Islands\"},\r\n {\"value\":\"PL\",\"label\":\"Poland\"},\r\n {\"value\":\"PT\",\"label\":\"Portugal\"},\r\n {\"value\":\"QA\",\"label\":\"Qatar\"},\r\n {\"value\":\"RE\",\"label\":\"Réunion\"},\r\n {\"value\":\"RO\",\"label\":\"Romania\"},\r\n {\"value\":\"RU\",\"label\":\"Russia\"},\r\n {\"value\":\"RW\",\"label\":\"Rwanda\"},\r\n {\"value\":\"WS\",\"label\":\"Samoa\"},\r\n {\"value\":\"SM\",\"label\":\"San Marino\"},\r\n {\"value\":\"ST\",\"label\":\"São Tomé, PrÃncipe\"},\r\n {\"value\":\"SA\",\"label\":\"Saudi Arabia\"},\r\n {\"value\":\"SN\",\"label\":\"Senegal\"},\r\n {\"value\":\"RS\",\"label\":\"Serbia\"},\r\n {\"value\":\"SC\",\"label\":\"Seychelles\"},\r\n {\"value\":\"SL\",\"label\":\"Sierra Leone\"},\r\n {\"value\":\"SG\",\"label\":\"Singapore\"},\r\n {\"value\":\"SX\",\"label\":\"Sint Maarten\"},\r\n {\"value\":\"SK\",\"label\":\"Slovakia\"},\r\n {\"value\":\"SI\",\"label\":\"Slovenia\"},\r\n {\"value\":\"SB\",\"label\":\"Solomon Islands\"},\r\n {\"value\":\"SO\",\"label\":\"Somalia\"},\r\n {\"value\":\"ZA\",\"label\":\"South Africa\"},\r\n {\"value\":\"GS\",\"label\":\"South Georgia, South Sandwich Islands\"},\r\n {\"value\":\"KR\",\"label\":\"South Korea\"},\r\n {\"value\":\"SS\",\"label\":\"South Sudan\"},\r\n {\"value\":\"ES\",\"label\":\"Spain\"},\r\n {\"value\":\"LK\",\"label\":\"Sri Lanka\"},\r\n {\"value\":\"BL\",\"label\":\"St Barthélemy\"},\r\n {\"value\":\"SH\",\"label\":\"St Helena\"},\r\n {\"value\":\"KN\",\"label\":\"St Kitts, Nevis\"},\r\n {\"value\":\"LC\",\"label\":\"St Lucia\"},\r\n {\"value\":\"MF\",\"label\":\"St Martin\"},\r\n {\"value\":\"PM\",\"label\":\"St Pierre, Miquelon\"},\r\n {\"value\":\"VC\",\"label\":\"St Vincent, Grenadines\"},\r\n {\"value\":\"SD\",\"label\":\"Sudan\"},\r\n {\"value\":\"SR\",\"label\":\"Surivalue\"},\r\n {\"value\":\"SJ\",\"label\":\"Svalbard, Jan Mayen\"},\r\n {\"value\":\"SE\",\"label\":\"Sweden\"},\r\n {\"value\":\"CH\",\"label\":\"Switzerland\"},\r\n {\"value\":\"SY\",\"label\":\"Syria\"},\r\n {\"value\":\"TW\",\"label\":\"Taiwan\"},\r\n {\"value\":\"TJ\",\"label\":\"Tajikistan\"},\r\n {\"value\":\"TZ\",\"label\":\"Tanzania\"},\r\n {\"value\":\"TH\",\"label\":\"Thailand\"},\r\n {\"value\":\"TL\",\"label\":\"Timor-Leste\"},\r\n {\"value\":\"TG\",\"label\":\"Togo\"},\r\n {\"value\":\"TK\",\"label\":\"Tokelau\"},\r\n {\"value\":\"TO\",\"label\":\"Tonga\"},\r\n {\"value\":\"TT\",\"label\":\"Trinidad, Tobago\"},\r\n {\"value\":\"TN\",\"label\":\"Tunisia\"},\r\n {\"value\":\"TR\",\"label\":\"Turkey\"},\r\n {\"value\":\"TM\",\"label\":\"Turkmenistan\"},\r\n {\"value\":\"TC\",\"label\":\"Turks, Caicos Islands\"},\r\n {\"value\":\"TV\",\"label\":\"Tuvalu\"},\r\n {\"value\":\"UM\",\"label\":\"US Outlying Islands\"},\r\n {\"value\":\"UG\",\"label\":\"Uganda\"},\r\n {\"value\":\"UA\",\"label\":\"Ukraine\"},\r\n {\"value\":\"AE\",\"label\":\"United Arab Emirates\"},\r\n {\"value\":\"GB\",\"label\":\"United Kingdom\"},\r\n {\"value\":\"US\",\"label\":\"United States\"},\r\n {\"value\":\"UY\",\"label\":\"Uruguay\"},\r\n {\"value\":\"UZ\",\"label\":\"Uzbekistan\"},\r\n {\"value\":\"VU\",\"label\":\"Vanuatu\"},\r\n {\"value\":\"VA\",\"label\":\"Vatican City\"},\r\n {\"value\":\"VE\",\"label\":\"Venezuela\"},\r\n {\"value\":\"VN\",\"label\":\"Vietnam\"},\r\n {\"value\":\"WF\",\"label\":\"Wallis, Futuna\"},\r\n {\"value\":\"EH\",\"label\":\"Western Sahara\"},\r\n {\"value\":\"YE\",\"label\":\"Yemen\"},\r\n {\"value\":\"ZM\",\"label\":\"Zambia\"},\r\n {\"value\":\"ZW\",\"label\":\"Zimbabwe\"}\r\n ]\r\n ","import { CAMPAIGN_TARGETS } from 'lib/globals';\r\nimport ShopContext from 'context/ShopContext';\r\nimport React,{ useContext } from 'react';\r\nimport { Alert, Button, ButtonSelect, FormControl, ShopifyResourcePicker } from 'components';\r\n\r\nexport default function CampaignTarget({ context }) {\r\n const { state: campaign, validationErrors, validate,setItem } = context;\r\n const shopContext = useContext(ShopContext);\r\n return (\r\n <>\r\n {campaign.settings.type &&\r\n <FormControl\r\n label=\"choose products you want to trigger this campaign\"\r\n error={validationErrors['target.type']}\r\n info={\r\n campaign.settings.type === 'bundles'\r\n ? 'This campaign will show up on the products you choose below. you can show it on specific products or collections'\r\n : 'This campaign will show up on the products you choose below. you can show it on all products or specific'\r\n }\r\n >\r\n <ButtonSelect\r\n options={CAMPAIGN_TARGETS.filter(\r\n target => {\r\n const isAllProductsBundles = target.value === 'all_products' && campaign.settings.type === 'bundles'\r\n return !isAllProductsBundles\r\n }\r\n )}\r\n shopContext={shopContext}\r\n BindToContext={[\r\n context,\r\n 'target.type',\r\n newValue =>\r\n {\r\n if(['specific_products','specific_collections'].includes(newValue)){\r\n setItem('target.selected', [])\r\n }\r\n }\r\n ]}\r\n />\r\n </FormControl>}\r\n\r\n {campaign.target.type === 'specific_products' &&\r\n <FormControl\r\n label=\"Specify the products\"\r\n error={validationErrors['target.selected']}\r\n >\r\n <ShopifyResourcePicker\r\n allowMultiple={20}\r\n BindToContext={[context, 'target.selected']}\r\n >\r\n {trigger =>\r\n <Button\r\n text=\"Select Products\"\r\n type={\r\n validationErrors['target.selected'] &&\r\n !!validationErrors['target.selected'][0]\r\n ? 'danger'\r\n : 'primary'\r\n }\r\n onClick={trigger}\r\n style={{ width: '100%' }}\r\n />}\r\n </ShopifyResourcePicker>\r\n </FormControl>}\r\n {campaign.target.type === 'specific_collections' &&\r\n <FormControl\r\n label=\"Specify the collections\"\r\n error={validationErrors['target.selected']}\r\n >\r\n <ShopifyResourcePicker\r\n allowMultiple={2}\r\n BindToContext={[context, 'target.selected']}\r\n type=\"Collection\"\r\n >\r\n {trigger =>\r\n <Button\r\n text=\"Select Collections\"\r\n type={\r\n validationErrors['target.selected'] &&\r\n !!validationErrors['target.selected'][0]\r\n ? 'danger'\r\n : 'primary'\r\n }\r\n onClick={trigger}\r\n style={{ width: '100%' }}\r\n />}\r\n </ShopifyResourcePicker>\r\n </FormControl>}\r\n {campaign.settings.type === 'add_to_unlock' &&\r\n (campaign.target.type === 'specific_products' ||\r\n campaign.target.type === 'specific_collections') &&\r\n <Alert\r\n {...{\r\n type: 'warning',\r\n borderPosition: 'border-l-4',\r\n iconSize: '2x', // title: \"Add To Unlock - Limitation\",\r\n icon: 'exclamation-circle',\r\n customStyle: { icon: 'text-orange-400 self-start mt-1' }\r\n }}\r\n className=\"my-6 z-5\"\r\n >\r\n <p>\r\n Once activated this offer is SITEWIDE. All products in cart will contribute\r\n to the unlock goal.\r\n </p>\r\n </Alert>}\r\n </>\r\n );\r\n}\r\n","import React, { useContext, useEffect } from \"react\";\r\nimport {\r\n FormGroup,\r\n FormControl,\r\n Input,\r\n Icon,\r\n Button,\r\n ButtonSelect,\r\n ShopifyResourcePicker,\r\n Alert,\r\n Dropdown,\r\n} from \"components\";\r\nimport styles from \"styles/campaign_settings_first_step.module.scss\";\r\nimport tutorial_styles from \"styles/tutorial.module.scss\";\r\nimport {\r\n BOX_CHECK_ICON,\r\n CAMPAIGN_TYPES,\r\n CAMPAIGN_TARGETS,\r\n BREAK_POINTS,\r\n} from \"lib/globals\";\r\nimport { COUNTRIES_LIST } from \"lib/countries\";\r\nimport classNames from \"lib/classNames\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport CampaignTarget from \"./CampaignTarget\";\r\n// import compareVersions from 'compare-versions';\r\n\r\nconst FirstStep = ({ context, setIsOpen }) => {\r\n const { state: campaign, setItem, validationErrors, validate } = context;\r\n const shopContext = useContext(ShopContext);\r\n const {\r\n state: {\r\n settings: { multiCurrencyMode },\r\n },\r\n } = shopContext;\r\n const select = (type) => setItem(\"settings.type\", type);\r\n const killDraftBreakPoint = BREAK_POINTS[\"kill_draft\"](shopContext);\r\n\r\n useEffect(() => {\r\n if (\r\n campaign.settings.type === \"bundles\" &&\r\n campaign.target.type === \"all_products\"\r\n ) {\r\n setItem(\"target.type\", \"specific_products\");\r\n }\r\n // if (\r\n // campaign.settings.type !== \"bundles\" &&\r\n // campaign.target.type !== \"all_products\"\r\n // ) {\r\n // setItem(\"target.type\", \"all_products\");\r\n // }\r\n }, [campaign.settings.type]);\r\n\r\n // useEffect(() => {\r\n // \tsetItem('target.selected', []);\r\n // }, [campaign.target.type]);\r\n\r\n return (\r\n <>\r\n {!!Object.keys(validationErrors).filter(\r\n (e) => typeof validationErrors[e] === \"string\"\r\n ).length && (\r\n <Alert type=\"error\" title=\"Errors\">\r\n <ul className={classNames(\"list-disc list-inside\")}>\r\n {Object.keys(validationErrors).map((key) => {\r\n const error = validationErrors[key];\r\n return Array.isArray(error) ? (\r\n error\r\n .filter((e) => typeof e === \"string\")\r\n .map((k, i) => <li key={i}>{k}</li>)\r\n ) : (\r\n <li key={key}>{error}</li>\r\n );\r\n })}\r\n </ul>\r\n </Alert>\r\n )}\r\n <p\r\n className={\r\n classNames(\"flex-1 text-gray-600 text-sm font-bold mb-3\") +\r\n \" \" +\r\n tutorial_styles.button\r\n }\r\n onClick={() => setIsOpen(true)}\r\n >\r\n Need help setting up campaigns or want best practices? Click here\r\n </p>\r\n <FormGroup\r\n label=\"Basic Settings\"\r\n info={`Setup the campaign triggers and the type of campaign.\r\n\t\t\tTip: Most stores can setup an Add to unlock campaign with a free shipping goal that targets all products in store`}\r\n >\r\n <FormControl\r\n label=\"choose a name for the campaign\"\r\n error={validationErrors.name}\r\n >\r\n <Input\r\n autofocus\r\n placeholder=\"Name\"\r\n BindToContext={[context, \"name\"]}\r\n />\r\n </FormControl>\r\n {multiCurrencyMode && !killDraftBreakPoint && (\r\n <Alert\r\n {...{\r\n type: \"warning\",\r\n borderPosition: \"border-l-4\",\r\n iconSize: \"2x\",\r\n title: \"Some campaign types are not supported\",\r\n icon: \"exclamation-circle\",\r\n customStyle: {\r\n icon: \"text-orange-400 self-start mt-1\",\r\n },\r\n }}\r\n className=\"my-6 z-5\"\r\n >\r\n <p>Shopify native checkout doesn't support all campaign types.</p>\r\n <div className={classNames(\"flex space-x-3 pt-3 justify-start\")}>\r\n <a\r\n className={classNames(\r\n \"text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded\"\r\n )}\r\n href=\"https://monsterapps.crisp.help/en/article/reasons-a-campaign-might-not-be-working-jzsza7/\"\r\n target=\"_blank\"\r\n >\r\n <Icon icon=\"info-circle\" className=\"mr-2\" size=\"1x\" />\r\n <span className={classNames(\"text-xs\")}>Learn More</span>\r\n </a>\r\n </div>\r\n </Alert>\r\n )}\r\n <FormControl\r\n label=\"select a campaign type\"\r\n error={validationErrors[\"settings.type\"]}\r\n >\r\n <ButtonSelect\r\n options={[\r\n {\r\n value: \"add_to_unlock\",\r\n label: CAMPAIGN_TYPES[\"add_to_unlock\"],\r\n icon: \"unlock\",\r\n title: \"(Free gifts, Free shipping, Discount)\",\r\n info: \"Offer customers a reward when a purchase goal is hit and suggest products to add to cart.\",\r\n link: {\r\n href: \"https://monsterapps.crisp.help/en/article/add-to-unlock-frequently-bought-together-campaign-free-shipping-free-gift-discount-1x7xy1r/\",\r\n text: \"Watch tutorial\",\r\n },\r\n },\r\n {\r\n value: \"bundles\",\r\n label: CAMPAIGN_TYPES[\"bundles\"],\r\n // disabled: ({ state }) => {\r\n // \treturn BREAK_POINTS['kill_draft'](shopContext)\r\n // \t\t? state.target.type === 'all_products'\r\n // \t\t: !!multiCurrencyMode;\r\n // },\r\n icon: \"bars\",\r\n info: \"Offer customers quick discounts on bulk orders.\",\r\n link: {\r\n href: \"https://monsterapps.crisp.help/en/article/buy-more-save-more-campaign-135cfea/\",\r\n text: \"Watch tutorial\",\r\n },\r\n },\r\n {\r\n value: \"one_check_up_sell\",\r\n label: CAMPAIGN_TYPES[\"one_check_up_sell\"],\r\n title:\r\n \"(Shipping protection, Priority processing, Extended warranty, Gift wrapping)\",\r\n icon: BOX_CHECK_ICON,\r\n info: \"A quick one-click upsell.\",\r\n link: {\r\n href: \"https://monsterapps.crisp.help/en/article/one-tick-upsell-campaign-vfswak/\",\r\n text: \"Watch tutorial\",\r\n },\r\n },\r\n ]}\r\n showSeparator={false}\r\n BindToContext={[context, \"settings.type\"]}\r\n />\r\n\r\n {/* <div style={{ textAlign: 'center' }}>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\ttext={`Customize ${CAMPAIGN_TYPES[campaign.settings.type]}`}\r\n\t\t\t\t\t\ticon=\"sliders-v-square\"\r\n\t\t\t\t\t\tonClick={() => next()}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div> */}\r\n </FormControl>\r\n {!campaign.settings.type && (\r\n <div\r\n className={classNames(\r\n `mb-3${\r\n !campaign.settings.type ||\r\n campaign.settings.type === \"add_to_unlock\"\r\n ? \"\"\r\n : \" border-gray-300 border-b pb-4\"\r\n }`\r\n )}\r\n >\r\n <label\r\n className={classNames(\r\n \"block flex-1 flex-grow capitalize text-sm font-bold text-gray-600 flex items-center\"\r\n )}\r\n >\r\n <span>(NEW) Buy X, Get Y Free Feature</span>\r\n <div\r\n className={classNames(\r\n \"flex-center bg-orange-500 p-1 rounded text-white font-extrabold ml-2\"\r\n )}\r\n style={{ fontSize: 10, padding: \"3px 8px\" }}\r\n >\r\n Beta\r\n </div>\r\n </label>\r\n <div\r\n className={classNames(\r\n \"text-gray-600 text-xs font-semibold underline cursor-pointer\"\r\n )}\r\n onClick={() =>\r\n window.open(\r\n \"https://monsterapps.crisp.help/en/article/buy-x-get-y-beta-feature-1pm496b/\",\r\n \"_blank\"\r\n )\r\n }\r\n >\r\n Learn more about this feature\r\n </div>\r\n </div>\r\n )}\r\n {campaign.settings.type === \"bundles\" && (\r\n <div className={classNames(`mb-3 border-gray-300 border-b pb-4`)}>\r\n <label\r\n className={classNames(\r\n \"block flex-1 flex-grow capitalize text-sm font-bold text-gray-600 flex items-center\"\r\n )}\r\n >\r\n <span>(NEW) Buy More Save More Product Page Widget</span>\r\n <div\r\n className={classNames(\r\n \"flex-center bg-orange-500 p-1 rounded text-white font-extrabold ml-2\"\r\n )}\r\n style={{ fontSize: 10, padding: \"3px 8px\" }}\r\n >\r\n Beta\r\n </div>\r\n </label>\r\n <div\r\n className={classNames(\r\n \"text-gray-600 text-xs font-semibold underline cursor-pointer\"\r\n )}\r\n onClick={() =>\r\n window.open(\r\n \"https://monsterapps.crisp.help/en/article/buy-more-save-more-product-page-widget-ubnm6h\",\r\n \"_blank\"\r\n )\r\n }\r\n >\r\n Learn how to show this on product pages\r\n </div>\r\n </div>\r\n )}\r\n\r\n {/* {!campaign.settings.type && (\r\n <div\r\n className={classNames(\r\n \"relative flex flex-col flex-1 text-gray-500 bg-gray-200 p-2 border-2 focus:outline-none border-gray-600 justify-start cursor-not-allowed\"\r\n )}\r\n >\r\n <p\r\n className={classNames(\r\n \"text-gray-600 text-sm font-semibold mb-1 italic\"\r\n )}\r\n >\r\n Coming Soon\r\n </p>\r\n <h3\r\n className={classNames(\r\n \"capitalize font-bold text-sm relative text-left mb-1 text-gray-600\"\r\n )}\r\n >\r\n Buy X, Get Y\r\n </h3>\r\n <p className={classNames(\"text-gray-500 text-xs italic h-full\")}>\r\n We are creating a new campaign for this, however you can achieve\r\n Buy X Get Y using Shopify Automatic discounts.\r\n </p>\r\n <div\r\n className={classNames(\r\n \"text-gray-600 text-xs font-semibold underline mt-2 cursor-pointer\"\r\n )}\r\n onClick={() =>\r\n window.open(\r\n \"https://monsterapps.crisp.help/en/article/buy-x-get-y-best-practices-1pm496b/\",\r\n \"_blank\"\r\n )\r\n }\r\n >\r\n Watch tutorial\r\n </div>\r\n </div>\r\n )} */}\r\n {/* {campaign.settings.type === \"add_to_unlock\" && (\r\n <Alert\r\n {...{\r\n type: \"warning\",\r\n borderPosition: \"border-l-4\",\r\n iconSize: \"2x\",\r\n // title: \"Add To Unlock - Limitation\",\r\n icon: \"exclamation-circle\",\r\n customStyle: {\r\n icon: \"text-orange-400 self-start mt-1\",\r\n },\r\n }}\r\n className=\"my-6 z-5\"\r\n >\r\n <p>\r\n Once activated this offer is SITEWIDE. All products in cart will\r\n contribute to the unlock goal.\r\n </p>\r\n </Alert>\r\n )} */}\r\n {campaign.settings.type === \"bundles\" && (\r\n <Alert\r\n {...{\r\n type: \"warning\",\r\n borderPosition: \"border-l-4\",\r\n iconSize: \"2x\",\r\n title: \"Buy more save more - Limitation\",\r\n icon: \"exclamation-circle\",\r\n customStyle: {\r\n icon: \"text-orange-400 self-start mt-1\",\r\n },\r\n }}\r\n className=\"my-6 z-5\"\r\n >\r\n <p>\r\n Works on volume of same exact product (Not mixing with other\r\n products)\r\n </p>\r\n <p>Fully compatible with product variants.</p>\r\n </Alert>\r\n )}\r\n {campaign.settings.type !== \"add_to_unlock\" && (\r\n <CampaignTarget context={context} />\r\n )}\r\n </FormGroup>\r\n </>\r\n );\r\n};\r\n\r\nconst Tile = (props) => {\r\n const { active, type, select, icon, title, description } = props;\r\n return (\r\n <div\r\n className={styles.tile}\r\n data-selected={active}\r\n onClick={() => {\r\n if (!active) select(type);\r\n }}\r\n >\r\n <Icon\r\n icon={icon}\r\n type={active ? \"primary\" : \"secondary\"}\r\n style={{ marginBottom: \"16px\" }}\r\n size={38}\r\n />\r\n <b>{CAMPAIGN_TYPES[type]}</b>\r\n <p>{description}</p>\r\n </div>\r\n );\r\n};\r\n\r\nexport default FirstStep;\r\n","import React from 'react';\r\nimport { SortableElement, sortableHandle } from 'react-sortable-hoc';\r\nimport { Switch, Button, Icon } from 'components';\r\nimport styles from 'styles/extra_modules.module.scss';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst Module = SortableElement(\r\n\t({ module, name, reset, switchButton = true, resetModule, moduleKey, children, context, info }) => {\r\n\t\tconst active = module && typeof module.active === 'boolean' ? module.active : true;\r\n\r\n\t\treturn (\r\n\t\t\t<div className={styles.module} data-active={active}>\r\n\t\t\t\t<div className={styles.header} data-has-children={!!children}>\r\n\t\t\t\t\t<div className={styles.header_wrapper}>\r\n\t\t\t\t\t\t<b className={styles.name}>{name}</b>\r\n\t\t\t\t\t\t{reset && (\r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\ttext=\"Reset\"\r\n\t\t\t\t\t\t\t\ticon=\"undo\"\r\n\t\t\t\t\t\t\t\ttype=\"link\"\r\n\t\t\t\t\t\t\t\tsize=\"small\"\r\n\t\t\t\t\t\t\t\tclassName={styles.ml_4}\r\n\t\t\t\t\t\t\t\tonClick={() => resetModule(moduleKey)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t{switchButton && (\r\n\t\t\t\t\t\t\t<Switch\r\n\t\t\t\t\t\t\t\tclassName={styles.ml_4}\r\n\t\t\t\t\t\t\t\tBindToContext={[context, `settings.modules.${moduleKey}.active`]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t{!!info && <p className={styles.info}>{info}</p>}\r\n\t\t\t\t</div>\r\n\t\t\t\t{!!children && (\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclassName={`${styles.content} ${!active ? styles.collapsed : ''}`}\r\n\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\toverflow: active ? 'initial' : 'hidden',\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<div className={styles.inner}>{children}</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t\t<Grip active={active} />\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n);\r\n\r\nModule.defaultProps = {\r\n\tswitchButton: true,\r\n\treset: true,\r\n};\r\n\r\nconst Grip = sortableHandle(({ active }) => {\r\n\treturn (\r\n\t\t<div className={styles.grip} data-active={active}>\r\n\t\t\t<Icon icon=\"angle-up\" />\r\n\t\t\t<Icon icon=\"angle-down\" />\r\n\t\t</div>\r\n\t);\r\n});\r\n\r\nexport default Module;\r\n","import React from 'react';\r\nimport Module from './Module';\r\nimport { FormControl, Input, RichEditor } from 'components';\r\n\r\nconst RandomText = (props) => {\r\n\tconst { context } = props;\r\n\tconst { validationErrors, state } = context;\r\n\r\n\treturn (\r\n\t\t<Module name=\"Random Text\" {...props}>\r\n\t\t\t<FormControl\r\n\t\t\t\tlabel=\"Text :\"\r\n\t\t\t\tmarginBottom=\"mb-0\"\r\n\t\t\t\terror={validationErrors['settings.modules.random_text.text']}\r\n\t\t\t>\r\n\t\t\t\t<RichEditor\r\n\t\t\t\t\tplaceholder=\"Enter your sold here!\"\r\n\t\t\t\t\tBindToContext={[context, 'settings.modules.random_text.text']}\r\n\t\t\t\t\thasError={!!validationErrors['settings.modules.random_text.text']}\r\n\t\t\t\t/>\r\n\t\t\t</FormControl>\r\n\t\t</Module>\r\n\t);\r\n};\r\n\r\nexport default RandomText;\r\n","import React from 'react';\r\nimport Module from './Module';\r\nimport { FormControl, Input, RichEditor } from 'components';\r\nimport useReactRouter from 'use-react-router';\r\n\r\nconst OrderNote = (props) => {\r\n\tconst { context } = props;\r\n\tconst { validationErrors, state } = context;\r\n\tconst { history } = useReactRouter();\r\n\r\n\t// if(history.location.pathname.indexOf(\"settings\") === -1) return null\r\n\r\n\treturn (\r\n\t\t<Module name=\"Order Note\" {...props}>\r\n\t\t\t<FormControl\r\n\t\t\t\tlabel=\"Text :\"\r\n\t\t\t\tmarginBottom=\"mb-0\"\r\n\t\t\t\terror={validationErrors['settings.modules.order_note.text']}\r\n\t\t\t>\r\n\t\t\t\t<RichEditor\r\n\t\t\t\t\tplaceholder=\"Enter your text here!\"\r\n\t\t\t\t\tBindToContext={[context, 'settings.modules.order_note.text']}\r\n\t\t\t\t\thasError={!!validationErrors['settings.modules.order_note.text']}\r\n\t\t\t\t/>\r\n\t\t\t</FormControl>\r\n\t\t</Module>\r\n\t);\r\n};\r\n\r\nexport default OrderNote;\r\n","import React from \"react\";\r\nimport Module from \"./Module\";\r\nimport {\r\n FormControl,\r\n FormGroup,\r\n Input,\r\n ColorPicker,\r\n CustomText,\r\n Icon,\r\n Switch,\r\n} from \"components\";\r\nimport classNames from \"lib/classNames\";\r\nconst CheckoutButton = (props) => {\r\n const { context, setCheckoutButtonLoadingEdit } = props;\r\n const { state, validationErrors } = context;\r\n // <Module name=\"Checkout Section\" {...{ ...props, reset: !!hasCheckout }}>\r\n // \t<>\r\n // \t\t{!!hasCheckout && (\r\n return (\r\n <>\r\n <FormGroup\r\n label=\"Checkout Button\"\r\n info=\"Keep these settings simple and to the point\"\r\n fullWidth\r\n >\r\n <CustomText\r\n context={context}\r\n label=\"Subtotal\"\r\n hasColor={true}\r\n path=\"settings.modules.checkout_button.subtotal\"\r\n hasWeight=\"700\"\r\n />\r\n <CustomText\r\n context={context}\r\n label=\"Savings\"\r\n hasColor={true}\r\n path=\"settings.modules.checkout_button.savings\"\r\n hasWeight=\"700\"\r\n />\r\n <FormControl\r\n label=\"Checkout as Link\"\r\n withSwitch={[\r\n context,\r\n \"settings.modules.checkout_button.checkout_as_link\",\r\n ]}\r\n info=\"Turn the checkout button into a link\"\r\n className={\"mb-6\"}\r\n />\r\n <CustomText\r\n context={context}\r\n placeholder=\"checkout\"\r\n hasColor={true}\r\n label=\"checkout button text\"\r\n path=\"settings.modules.checkout_button.button_text\"\r\n hasWeight=\"700\"\r\n />\r\n <CustomText\r\n context={context}\r\n placeholder=\"processing\"\r\n hasColor={true}\r\n hasNumber={false}\r\n onFocus={() => setCheckoutButtonLoadingEdit(true)}\r\n onBlur={() => setCheckoutButtonLoadingEdit(false)}\r\n label=\"checkout button loading text\"\r\n path=\"settings.modules.checkout_button.button_text_loading\"\r\n />\r\n <FormControl label=\"checkout button colors\">\r\n <ColorPicker\r\n text=\"background\"\r\n BindToContext={[\r\n context,\r\n \"settings.modules.checkout_button.background\",\r\n ]}\r\n />\r\n {/* <ColorPicker\r\n\t\t\t\t\t\ttext=\"hover background\"\r\n\t\t\t\t\t\tBindToContext={[context, 'settings.modules.checkout_button.hoverBackground']}\r\n\t\t\t\t\t/> */}\r\n </FormControl>\r\n <FormControl\r\n label=\"Continue Shopping Button\"\r\n info=\"Make it easy for customers to continue shopping\"\r\n withSwitch={[\r\n context,\r\n \"settings.modules.checkout_button.active_continue_shopping_button\",\r\n ]}\r\n >\r\n {state.settings.modules.checkout_button\r\n .active_continue_shopping_button && (\r\n <CustomText\r\n context={context}\r\n placeholder=\"Continue shopping\"\r\n hasColor={true}\r\n path=\"settings.modules.checkout_button.continue_shopping_button\"\r\n />\r\n )}\r\n </FormControl>\r\n {state.settings.modules.checkout_button\r\n .active_continue_shopping_button && (\r\n <FormControl\r\n label=\"Underline link\"\r\n withSwitch={[\r\n context,\r\n \"settings.modules.checkout_button.active_continue_shopping_underlined\",\r\n ]}\r\n ></FormControl>\r\n )}\r\n\r\n {state.settings.cod_settings.is_active && (\r\n <>\r\n <FormControl label=\"COD checkout button colors\">\r\n <ColorPicker\r\n text=\"background\"\r\n BindToContext={[\r\n context,\r\n \"settings.cod_settings.checkout_button.background\",\r\n ]}\r\n />\r\n {/* <ColorPicker\r\n\t\t\t\t\t\t\t\ttext=\"hover background\"\r\n\t\t\t\t\t\t\t\tBindToContext={[context, 'settings.cod_settings.checkout_button.hoverBackground']}\r\n\t\t\t\t\t\t\t/> */}\r\n </FormControl>\r\n <CustomText\r\n context={context}\r\n label=\"COD checkout button\"\r\n hasColor={true}\r\n path=\"settings.cod_settings.checkout_button\"\r\n />\r\n </>\r\n )}\r\n </FormGroup>\r\n <FormGroup\r\n label=\"coupon code form\"\r\n info={`The cart allows discounts codes to be entered.\r\n\t\t\t\tIf a discount code is activated all other cart discounts are dismissed.`}\r\n fullWidth\r\n >\r\n <CustomText\r\n context={context}\r\n label=\"Use Coupon Code\"\r\n hasColor={true}\r\n path=\"settings.modules.checkout_button.use_coupon_code\"\r\n withSwitch={[context, \"settings.show_coupon\"]}\r\n marginBottom=\"mb-4\"\r\n beta\r\n />\r\n <div className={classNames(\"flex flex-wrap -mx-2\")}>\r\n <CustomText\r\n context={context}\r\n className=\"px-2 flex-1 w-auto\"\r\n label=\"Edit Coupon Code\"\r\n path=\"settings.modules.checkout_button.edit_coupon_code\"\r\n />\r\n <CustomText\r\n context={context}\r\n className=\"px-2 flex-1 w-auto\"\r\n label=\"Close Coupon Code\"\r\n path=\"settings.modules.checkout_button.close_coupon_code\"\r\n />\r\n </div>\r\n <CustomText\r\n context={context}\r\n label=\"Enter Coupon Code\"\r\n hasColor={true}\r\n path=\"settings.modules.checkout_button.enter_coupon_code\"\r\n />\r\n <CustomText\r\n context={context}\r\n label=\"Apply Coupon Code\"\r\n hasColor={true}\r\n path=\"settings.modules.checkout_button.apply_coupon_code\"\r\n />\r\n <CustomText\r\n context={context}\r\n label=\"Coupon Code Alert\"\r\n withSwitch={[context, \"settings.show_coupon_alert_text\"]}\r\n hasColor={true}\r\n path=\"settings.modules.checkout_button.coupon_alert_text\"\r\n />\r\n <FormControl label=\"apply coupon button colors\">\r\n <ColorPicker\r\n text=\"background\"\r\n BindToContext={[\r\n context,\r\n \"settings.modules.checkout_button.coupon.background\",\r\n ]}\r\n />\r\n {/* <ColorPicker\r\n text=\"hover background\"\r\n BindToContext={[\r\n context,\r\n 'settings.modules.checkout_button.coupon.hoverBackground'\r\n ]}\r\n /> */}\r\n </FormControl>\r\n </FormGroup>\r\n </>\r\n );\r\n};\r\n\r\nexport default CheckoutButton;\r\n","import { setIn } from 'immutable';\r\nimport uuid from 'uuid/v1';\r\nimport { DEFAULT_GOAL, default_one_check_upsell } from 'lib/globals';\r\n\r\nexport const SET_ITEM = 'SET_ITEM';\r\nexport const NEW_GOAL = 'NEW_GOAL';\r\nexport const NEW_SPECIFIC_GOAL = 'NEW_SPECIFIC_GOAL';\r\nexport const REMOVE_SPECIFIC_GOAL = 'REMOVE_SPECIFIC_GOAL';\r\nexport const DELETE_GOAL = 'DELETE_GOAL';\r\nexport const NEW_OCU_PRODUCT = 'NEW_OCU_PRODUCT';\r\nexport const DELETE_OCU_PRODUCT = 'DELETE_OCU_PRODUCT';\r\nexport const NEW_BUNDLE = 'NEW_BUNDLE';\r\nexport const DELETE_BUNDLE = 'DELETE_BUNDLE';\r\nexport const DISCARD = 'DISCARD';\r\nexport const UPDATE_OLD_OCU = 'UPDATE_OLD_OCU';\r\nexport const CampaignReducer = (default_language = 'english', default_currency = 'USD') => {\r\n return (state, { type, path, value, goal_index }) => {\r\n switch (type) {\r\n case DISCARD:\r\n return { ...value };\r\n case SET_ITEM: {\r\n // Ensure intermediate structures exist\r\n const pathParts = path.split(\".\");\r\n let updatedState = state;\r\n let current = updatedState;\r\n\r\n // Traverse the path and ensure non-existing keys are initialized\r\n for (let i = 0; i < pathParts.length - 1; i++) {\r\n const key = pathParts[i];\r\n if (current[key] === undefined || current[key] === null) {\r\n current[key] = {}; // Ensure it's an object\r\n }\r\n current = current[key];\r\n }\r\n\r\n // Finally, apply setIn\r\n return setIn(updatedState, pathParts, value);\r\n }\r\n case NEW_BUNDLE:\r\n return setIn(\r\n state,\r\n [\"settings\", \"bundles\", \"list\"],\r\n state.settings.bundles.list.concat([\r\n {\r\n id: uuid(),\r\n type: \"percentage\",\r\n reward: \"\",\r\n quantity: \"\",\r\n },\r\n ])\r\n );\r\n case DELETE_BUNDLE:\r\n return setIn(\r\n state,\r\n [\"settings\", \"bundles\", \"list\"],\r\n state.settings.bundles.list.filter(({ id }) => id !== value)\r\n );\r\n case NEW_GOAL:\r\n return setIn(\r\n state,\r\n [\"settings\", \"add_to_unlock\", \"goals\"],\r\n state.settings.add_to_unlock.goals.concat(\r\n DEFAULT_GOAL(\r\n state.settings.add_to_unlock,\r\n default_language,\r\n default_currency\r\n )\r\n )\r\n );\r\n case NEW_SPECIFIC_GOAL:\r\n return setIn(\r\n state,\r\n [\"settings\", \"add_to_unlock\", \"goals\", value, \"specific_goals\"],\r\n state.settings.add_to_unlock.goals[value].specific_goals.concat({\r\n currency: \"\",\r\n goal: \"\",\r\n })\r\n );\r\n case REMOVE_SPECIFIC_GOAL:\r\n return setIn(\r\n state,\r\n [\r\n \"settings\",\r\n \"add_to_unlock\",\r\n \"goals\",\r\n goal_index,\r\n \"specific_goals\",\r\n ],\r\n state.settings.add_to_unlock.goals[\r\n goal_index\r\n ].specific_goals.filter((_, index) => index !== value)\r\n );\r\n case DELETE_GOAL:\r\n let newGoals = state.settings.add_to_unlock.goals.slice(0);\r\n newGoals.splice(value, 1);\r\n return setIn(\r\n state,\r\n [\"settings\", \"add_to_unlock\", \"goals\"],\r\n newGoals\r\n );\r\n case NEW_OCU_PRODUCT:\r\n return setIn(\r\n state,\r\n [\"settings\", \"multi_one_check_upsell\", \"products\"],\r\n state.settings.multi_one_check_upsell.products.concat([\r\n default_one_check_upsell(default_language),\r\n ])\r\n );\r\n case DELETE_OCU_PRODUCT:\r\n let newProducts =\r\n state.settings.multi_one_check_upsell.products.slice(0);\r\n newProducts.splice(value, 1);\r\n return setIn(\r\n state,\r\n [\"settings\", \"multi_one_check_upsell\", \"products\"],\r\n newProducts\r\n );\r\n case UPDATE_OLD_OCU:\r\n const new_state = setIn(\r\n state,\r\n [\"settings\", \"multi_one_check_upsell\"],\r\n value\r\n );\r\n return setIn(\r\n new_state,\r\n [\"settings\", \"one_check_up_sell\"],\r\n undefined\r\n );\r\n default:\r\n return state;\r\n }\r\n };\r\n};\r\n","import React, { Component, useContext } from 'react';\r\nimport { FormGroup, FormControl, Input } from 'components';\r\nimport { SortableContainer } from 'react-sortable-hoc';\r\nimport arrayMove from 'array-move';\r\nimport RandomText from './RandomText';\r\nimport OrderNote from './OrderNote';\r\nimport CheckoutButton from './CheckoutButton';\r\nimport Module from './Module';\r\nimport { RESET_EXTRA_MODULE, SET_ITEM } from 'reducers/CampaignReducer';\r\nimport { NEW_CAMPAIGN_INITIAL_STATE } from 'lib/globals';\r\nimport ShopContext from 'context/ShopContext';\r\n\r\nconst ExtraModules = ({ context, label = 'Extra Modules', hasCheckout = true }) => {\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\tsettings: {\r\n\t\t\t\ttheme: { primary, secondary, background },\r\n\t\t\t\tfont,\r\n\t\t\t\tmodules: { checkout_button },\r\n\t\t\t},\r\n\t\t},\r\n\t} = useContext(ShopContext);\r\n\tconst modules = context.state.settings.modules;\r\n\tconst onSortEnd = ({ oldIndex, newIndex }) => {\r\n\t\tconst newOrder = arrayMove(modules.order, oldIndex, newIndex);\r\n\t\t// this.props.edit('modules', 'order', newOrder);\r\n\t\tcontext.dispatch({\r\n\t\t\ttype: SET_ITEM,\r\n\t\t\tpath: 'settings.modules.order',\r\n\t\t\tvalue: newOrder,\r\n\t\t});\r\n\t};\r\n\tconst resetModule = (module) => {\r\n\t\tcontext.dispatch({\r\n\t\t\ttype: SET_ITEM,\r\n\t\t\tpath: `settings.modules.${module}`,\r\n\t\t\tvalue: NEW_CAMPAIGN_INITIAL_STATE({\r\n\t\t\t\tcheckout_button,\r\n\t\t\t\tprimary,\r\n\t\t\t\tsecondary,\r\n\t\t\t\tfont_color: font.color,\r\n\t\t\t\tbackground,\r\n\t\t\t}).settings.modules[module],\r\n\t\t});\r\n\t};\r\n\treturn <ModulesList useDragHandle {...{ context, modules, onSortEnd, resetModule, label, hasCheckout }} />;\r\n};\r\n\r\nconst ModulesList = SortableContainer(({ context, resetModule, modules, label, hasCheckout }) => {\r\n\treturn (\r\n\t\t<FormGroup label={label} info=\"Move around and edit extra modules. More modules coming soon...\">\r\n\t\t\t<div>\r\n\t\t\t\t{modules.order.map((key, index) => {\r\n\t\t\t\t\tswitch (key) {\r\n\t\t\t\t\t\tcase 'random_text':\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<RandomText\r\n\t\t\t\t\t\t\t\t\tkey={key}\r\n\t\t\t\t\t\t\t\t\t{...{\r\n\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\tindex,\r\n\t\t\t\t\t\t\t\t\t\tmoduleKey: key,\r\n\t\t\t\t\t\t\t\t\t\tmodule: modules[key],\r\n\t\t\t\t\t\t\t\t\t\tresetModule,\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\tcase 'checkout_button':\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<Module\r\n\t\t\t\t\t\t\t\t\tname=\"Checkout Section\"\r\n\t\t\t\t\t\t\t\t\tkey={key}\r\n\t\t\t\t\t\t\t\t\t{...{\r\n\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\tindex,\r\n\t\t\t\t\t\t\t\t\t\tswitchButton: false,\r\n\t\t\t\t\t\t\t\t\t\tmoduleKey: key,\r\n\t\t\t\t\t\t\t\t\t\tmodule: modules[key],\r\n\t\t\t\t\t\t\t\t\t\tresetModule,\r\n\t\t\t\t\t\t\t\t\t\thasCheckout,\r\n\t\t\t\t\t\t\t\t\t\treset: false,\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\tcase 'order_note':\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<OrderNote\r\n\t\t\t\t\t\t\t\t\tname=\"Order Note Section\"\r\n\t\t\t\t\t\t\t\t\tkey={key}\r\n\t\t\t\t\t\t\t\t\t{...{\r\n\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\tindex,\r\n\t\t\t\t\t\t\t\t\t\tswitchButton: true,\r\n\t\t\t\t\t\t\t\t\t\tmoduleKey: key,\r\n\t\t\t\t\t\t\t\t\t\tmodule: modules[key],\r\n\t\t\t\t\t\t\t\t\t\tresetModule,\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t}\r\n\t\t\t\t})}\r\n\t\t\t</div>\r\n\t\t</FormGroup>\r\n\t);\r\n});\r\n\r\nexport default ExtraModules;\r\n","import React, { useContext } from 'react';\r\nimport { COUNTRIES_LIST } from 'lib/countries';\r\n\r\nimport {\r\n FormGroup,\r\n FormControl,\r\n Dropdown,\r\n Alert,\r\n ButtonSelect,\r\n ShopifyResourcePicker,\r\n Button\r\n} from 'components';\r\nimport { CAMPAIGN_TARGETS } from 'lib/globals';\r\nimport ShopContext from 'context/ShopContext';\r\nimport CampaignTarget from './CampaignTarget';\r\nconst GeoTargeting = ({ context }) => {\r\n const { state: campaign, validationErrors, validate } = context;\r\n const shopContext = useContext(ShopContext);\r\n\r\n return (\r\n <FormGroup\r\n label=\"Targeting\"\r\n info=\"Target specific products you would like to include/exclude for this campaign. (If no countries have been selected campaign will show to all users.\"\r\n >\r\n {campaign.settings.type === 'add_to_unlock' && <CampaignTarget context={context} />}\r\n <FormControl\r\n label=\"Target specific countries\"\r\n withSwitch={[context, 'target.countries.include_active']}\r\n info={\r\n campaign.target.countries.include_active\r\n ? 'Choose countries you would like to show your campaign too.'\r\n : ''\r\n }\r\n >\r\n {campaign.target.countries.include_active &&\r\n <Dropdown\r\n disabled={!campaign.target.countries.include_active}\r\n options={COUNTRIES_LIST}\r\n isMulti={true}\r\n first\r\n BindToContext={[context, 'target.countries.include']}\r\n />}\r\n </FormControl>\r\n <FormControl\r\n label=\"Exclude countries\"\r\n withSwitch={[context, 'target.countries.exclude_active']}\r\n info={\r\n campaign.target.countries.exclude_active\r\n ? 'Hide this campaign from these countries.'\r\n : ''\r\n }\r\n >\r\n {campaign.target.countries.exclude_active &&\r\n <Dropdown\r\n disabled={!campaign.target.countries.exclude_active}\r\n options={COUNTRIES_LIST}\r\n isMulti={true}\r\n first\r\n BindToContext={[context, 'target.countries.exclude']}\r\n />}\r\n </FormControl>\r\n </FormGroup>\r\n );\r\n};\r\n\r\nexport default GeoTargeting;\r\n","import { setIn, removeIn } from 'immutable';\r\n\r\nexport const SET_ITEM = 'SET_ITEM';\r\nexport const DELETE_ITEM = 'DELETE_ITEM';\r\nexport const SET_ALL = 'SET_ALL';\r\n\r\nexport const SetItemReducer = (state, { type, path, value }) => {\r\n\ttry {\r\n\t\tswitch (type) {\r\n\t\t\tcase SET_ITEM:\r\n\t\t\t\treturn setIn(state, path.split('.'), value);\r\n\t\t\tcase SET_ALL:\r\n\t\t\t\treturn value;\r\n\t\t\tcase DELETE_ITEM:\r\n\t\t\t\treturn removeIn(state, path.split('.'));\r\n\t\t\tdefault:\r\n\t\t\t\treturn state;\r\n\t\t}\r\n\t} catch (error) {\r\n\t\tconsole.log('Reducer error', { state, path, value });\r\n\t\treturn state;\r\n\t}\r\n};\r\n","import React from 'react';\r\nconst EmbeddedContext = React.createContext(null);\r\nexport const EmbeddedProvider = EmbeddedContext.Provider;\r\nexport default EmbeddedContext;\r\n","import React, { useState, useEffect } from 'react';\r\nimport { Button, TagInput } from 'components';\r\nimport { ResourcePicker } from '@shopify/app-bridge-react';\r\nimport { RESOURCE_PICKER_DEFAULT_REDUCERS } from 'lib/globals';\r\nimport useBindToContext from 'hooks/useBindToContext';\r\n\r\nexport function InitialSelectionIds(resourcesArray, pattern) {\r\n return resourcesArray.map(({ id }) => ({ id: pattern.replace('{id}', id) }));\r\n}\r\nconst ShopifyResourcePicker = ({\r\n value,\r\n type = 'Product',\r\n children,\r\n onChange,\r\n reducer = false,\r\n allowMultiple = true,\r\n BindToContext = null,\r\n showVariants = false,\r\n initialSelectionIds,\r\n showHidden = false,\r\n verifySelection,\r\n initialQuery\r\n}) => {\r\n const [isOpened, setIsOpen] = useState(false);\r\n const [BindedValue, BindedOnChange, _, onRender] = useBindToContext(\r\n BindToContext,\r\n value,\r\n onChange\r\n );\r\n const idFilterRegex = /gid:\\/\\/shopify\\/.*\\/([0-9]+)?.*/;\r\n const formatIds = (value) => {\r\n if (Array.isArray(value)) {\r\n return value.map((item) => {\r\n return formatIds(item);\r\n });\r\n } else if (value === Object(value)) {\r\n let outputObject = {};\r\n Object.keys(value).forEach((key) => {\r\n outputObject[key] = formatIds(value[key]);\r\n });\r\n return outputObject;\r\n } else if (typeof value === 'string') {\r\n const match = value.match(idFilterRegex);\r\n return match ? match[1] : value;\r\n }\r\n return value;\r\n };\r\n\r\n const onSelection = ({ selection }) => {\r\n setIsOpen(false);\r\n if (verifySelection && !verifySelection(selection)) {\r\n return;\r\n }\r\n let value = formatIds(selection.map(reducer || RESOURCE_PICKER_DEFAULT_REDUCERS[type]));\r\n if (!allowMultiple) return BindedOnChange(value[0]);\r\n let mergedItems = BindedValue.concat(value || []);\r\n let uniqueItems = mergedItems.reduce((acc, obj) => {\r\n const foundIndex = acc.findIndex((item) => item.id === obj.id);\r\n if (foundIndex === -1) {\r\n acc.push(obj);\r\n }\r\n return acc;\r\n }, []);\r\n BindedOnChange(uniqueItems);\r\n };\r\n\r\n const removeItem = (id) => {\r\n BindedOnChange(allowMultiple ? BindedValue.filter((item) => item.id != id) : null);\r\n };\r\n\r\n const tags = allowMultiple\r\n ? BindedValue\r\n : BindedValue && !!Object.keys(BindedValue).length\r\n ? [BindedValue]\r\n : [];\r\n \r\n return (\r\n <>\r\n <div>\r\n {/* pass trigger function to children */}\r\n {children(() => setIsOpen(true))}\r\n {!!tags.length && <TagInput tags={tags} close={(id) => removeItem(id)} />}\r\n </div>\r\n <ResourcePicker\r\n showVariants={showVariants}\r\n showHidden={showHidden}\r\n resourceType={type}\r\n initialSelectionIds={initialSelectionIds}\r\n open={isOpened}\r\n allowMultiple={allowMultiple}\r\n onSelection={onSelection}\r\n onCancel={() => setIsOpen(false)}\r\n initialQuery={initialQuery}\r\n />\r\n </>\r\n );\r\n};\r\n\r\nexport default ShopifyResourcePicker;\r\n","import React from 'react';\r\n\r\nconst SidebarContext = React.createContext(null);\r\nexport const SidebarProvider = SidebarContext.Provider;\r\nexport default SidebarContext;\r\n","import React, { useContext, useEffect, useState } from \"react\";\r\nimport { Icon } from \"components\";\r\nimport styles from \"styles/sidebar.module.scss\";\r\nimport {\r\n faChartLine,\r\n faBullhorn,\r\n faCog,\r\n faCartPlus,\r\n faQuestionCircle,\r\n faThumbtack,\r\n faLightbulb,\r\n faUsers,\r\n faHandshake,\r\n} from \"@fortawesome/fontawesome-pro-solid\";\r\nimport { Reviewing } from \"components\";\r\nimport UserContext from \"context/UserContext\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport useReactRouter from \"use-react-router\";\r\nimport SidebarContext from \"context/SidebarContext\";\r\nimport {\r\n USER_SHIELD_ICON,\r\n SACK_DOLLAR_ICON,\r\n COMMENT_DOLLAR,\r\n} from \"lib/globals\";\r\nimport Logo from \"svgs/logo_v2.png\";\r\nimport { LIST_SHOP_CAMPAIGNS } from \"Queries\";\r\nimport { useQuery } from \"@apollo/react-hooks\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nconst SideBar = () => {\r\n const { collapsed, setCollapsed } = useContext(SidebarContext);\r\n const { history, location } = useReactRouter();\r\n\r\n const [campaignActive, setCampaignActive] = useState(false);\r\n const [dataLoading, setDataLoading] = useState(true);\r\n const [designActive, setDesignActive] = useState(false);\r\n const [completedTasks, setCompletedTasks] = useState(0);\r\n\r\n const user = useContext(UserContext);\r\n const shopContext = useContext(ShopContext);\r\n const {\r\n AppLocalStorage,\r\n setup: { cartActive, cartLoading },\r\n } = shopContext;\r\n let { data } = useQuery(LIST_SHOP_CAMPAIGNS, {\r\n variables: {\r\n userId: user.attributes.sub,\r\n },\r\n fetchPolicy: \"network-only\",\r\n });\r\n\r\n useEffect(() => {\r\n const app_first_turn_on = AppLocalStorage.getItem(\"first_cart_turn_on\");\r\n setDesignActive(app_first_turn_on);\r\n }, [AppLocalStorage]);\r\n\r\n useEffect(() => {\r\n if (data) {\r\n if (data.campaigns?.list?.length) {\r\n setCampaignActive(\r\n !!data.campaigns.list.find((campaign) => campaign.active)\r\n );\r\n }\r\n setDataLoading(false);\r\n }\r\n }, [data]);\r\n\r\n useEffect(() => {\r\n if (!dataLoading && !cartLoading) {\r\n setCompletedTasks(+cartActive + +designActive + +campaignActive);\r\n }\r\n }, [cartActive, designActive, campaignActive, cartLoading, dataLoading]);\r\n\r\n return (\r\n <div className={styles.sidebar} collapsed={collapsed ? 1 : 0}>\r\n <div className={styles.logo}>\r\n <img src={Logo} />\r\n </div>\r\n <div className={styles.menu}>\r\n <div\r\n className={styles.menu_setup}\r\n data-active={location.pathname === \"/\"}\r\n data-completed={completedTasks === 3}\r\n pathto={\"/\"}\r\n onClick={() => {\r\n if (location.pathname !== \"/\") history.push(\"/\" + location.search);\r\n }}\r\n >\r\n <div\r\n className={`${styles.div} ${classNames(\r\n \"flex flex-col items-start\"\r\n )}`}\r\n >\r\n <span className={styles.text}>Getting started</span>\r\n <div\r\n className={classNames(\r\n \"flex flex-row items-center justify-start w-full\"\r\n )}\r\n style={{\r\n marginTop: 3,\r\n }}\r\n >\r\n <div\r\n className={classNames(\r\n \"flex w-3/4 h-3 rounded-md relative overflow-hidden mix-blend-darken bg-white items-start\"\r\n )}\r\n style={{\r\n background: \"rgba(93, 120, 240, 0.2)\",\r\n }}\r\n >\r\n <div\r\n className={classNames(\r\n \"block transition-width absolute inset-0 duration-500 ease-out z-10 items-start rounded-md\"\r\n )}\r\n style={{\r\n background: completedTasks < 3 ? \"#5D78F0\" : \"#48bb78\",\r\n width: `${\r\n completedTasks ? (completedTasks * 100) / 3 : 10\r\n }%`,\r\n }}\r\n ></div>\r\n </div>\r\n <span\r\n className={`${styles.counter} ${classNames(\r\n \"text-gray-600 font-bold ml-2\"\r\n )}`}\r\n >\r\n {completedTasks}/3\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <MenuItem\r\n pathto=\"/dashboard\"\r\n activeRoutes={[\"/dashboard\"]}\r\n icon={faChartLine}\r\n >\r\n Dashboard\r\n </MenuItem>\r\n <MenuItem pathto=\"/settings\" activeRoutes={[\"/settings\"]} icon={faCog}>\r\n Cart Setup\r\n </MenuItem>\r\n <MenuItem\r\n pathto=\"/campaigns\"\r\n activeRoutes={[\"/campaigns\"]}\r\n icon={faBullhorn}\r\n >\r\n Upsell Campaigns\r\n </MenuItem>\r\n <MenuItem pathto=\"/sticky\" activeRoutes={[\"/sticky\"]} icon={faCartPlus}>\r\n Sticky cart\r\n </MenuItem>\r\n <div className={styles.spacer}></div>\r\n {data?.campaigns?.list?.length ? (\r\n <MenuItem\r\n onClick={() => {\r\n window.open(\r\n \"https://monsterapps.crisp.help/en/article/redeemly-cashback-loyalty-store-credit-special-offer-apooev/\"\r\n );\r\n }}\r\n badge=\"NEW APP\"\r\n newApp\r\n >\r\n CashBack Loyalty App\r\n <br />\r\n (BONUS FREE OFFER)\r\n </MenuItem>\r\n ) : (\r\n <></>\r\n )}\r\n <MenuItem\r\n pathto=\"/integrations\"\r\n activeRoutes={[\"/integrations\"]}\r\n icon={faHandshake}\r\n >\r\n Integrations\r\n </MenuItem>\r\n <MenuItem\r\n icon={COMMENT_DOLLAR}\r\n onClick={() => {\r\n window.open(\r\n \"https://platform.shoffi.app/signup/affiliate?app=Il_7GsC6qzi\"\r\n );\r\n }}\r\n >\r\n Referral Program\r\n </MenuItem>\r\n {/* <MenuItem onClick={() => {window.open(\"https://monsterapps.shop/partner-program/\")}}>\r\n\t\t\t\t\tAffiliate Signup\r\n\t\t\t\t</MenuItem> */}\r\n <MenuItem\r\n icon={faUsers}\r\n onClick={() => {\r\n window.open(\"https://www.facebook.com/groups/ecom.monsterapps\");\r\n }}\r\n >\r\n Facebook Group\r\n </MenuItem>\r\n <MenuItem\r\n icon={faLightbulb}\r\n onClick={() => {\r\n window.open(\r\n \"https://monsterupsells.feedbear.com/boards/feature-requests\"\r\n );\r\n }}\r\n >\r\n Feature Suggestion\r\n </MenuItem>\r\n <MenuItem pathto=\"/plan\" icon={SACK_DOLLAR_ICON}>\r\n Your Plan\r\n </MenuItem>\r\n <MenuItem\r\n icon={faQuestionCircle}\r\n onClick={() => {\r\n window.open(\r\n \"https://monsterapps.crisp.help/en/category/monsterupsells-48n04z\"\r\n );\r\n }}\r\n >\r\n Faq\r\n </MenuItem>\r\n <MenuItem\r\n icon={USER_SHIELD_ICON}\r\n onClick={() => {\r\n window.open(\r\n \"https://monsterapps.crisp.help/en/article/privacy-policy-monsterupsells-76n8in\"\r\n );\r\n }}\r\n >\r\n Privacy Policy\r\n </MenuItem>\r\n </div>\r\n <div className={styles.attach} active={collapsed ? 0 : 1}>\r\n <Icon\r\n icon={faThumbtack}\r\n size=\"xs\"\r\n onClick={() => setCollapsed(!collapsed)}\r\n />\r\n </div>\r\n {/* <div className={styles.widget}>\r\n <Reviewing {...{ user, shopContext }} />\r\n </div> */}\r\n </div>\r\n );\r\n};\r\n\r\nconst MenuItem = ({\r\n pathto,\r\n activeRoutes = false,\r\n children,\r\n icon,\r\n onClick,\r\n badge,\r\n newApp,\r\n}) => {\r\n const { history, location } = useReactRouter();\r\n const active = (activeRoutes || [pathto]).includes(location.pathname);\r\n return (\r\n <div\r\n className={`${styles.menu_item}${newApp ? \" \" + styles.new_app : \"\"}`}\r\n data-active={active}\r\n pathto={pathto}\r\n onClick={() => {\r\n if (onClick) onClick();\r\n else if (!active) history.push(pathto + location.search);\r\n }}\r\n >\r\n <div>\r\n {icon && <Icon icon={icon} size=\"lg\" />}\r\n <span className={styles.text}>{children}</span>\r\n </div>\r\n {badge && <SideBarBadge>{badge}</SideBarBadge>}\r\n </div>\r\n );\r\n};\r\n\r\nexport const SideBarBadge = ({ children, style, className = \"\" }) => (\r\n <div className={`${styles.badge} ${className}`} style={style}>\r\n {children}\r\n </div>\r\n);\r\n\r\nexport default SideBar;\r\n","import { Bindings, FormControl, RichEditor, ShopifyResourcePicker, Button, Alert, Icon, CustomText, ColorPicker, ButtonSelect, ImagePicker } from \"components\"\r\nimport PreviewContext from \"context/PreviewContext\";\r\nimport classNames from \"lib/classNames\";\r\nimport { GIFT_WITH_PURCHASE_PRODUCT_REDUCER } from \"lib/globals\";\r\nimport React, { Fragment, useContext, useState } from \"react\"\r\nimport { Toast } from '@shopify/app-bridge/actions';\r\nimport EmbeddedContext from \"context/EmbeddedContext\";\r\nimport imagePlaceholder from \"assets/image_placeholder.png\"\r\nimport { InitialSelectionIds } from \"components/ShopifyResourcePicker\";\r\nimport { SideBarBadge } from \"components/Sidebar\";\r\n\r\nexport default function Gift ({ context, index, validationErrors }) {\r\n const [current, setCurrentState] = useState(\"before\")\r\n const { setGiftCurrentPreview } = useContext(PreviewContext)\r\n const { AppBridgeToast } = useContext(EmbeddedContext);\r\n const setCurrent = state => {\r\n setGiftCurrentPreview(state)\r\n setCurrentState(state)\r\n }\r\n const { goals } = context.state.settings.add_to_unlock\r\n const currentGoal = goals[index].gift\r\n const isRandom = currentGoal.multi_gift_select === \"random\"\r\n const previousGift = index > 0 ? goals[index - 1].reward_type === \"gift\" : false\r\n const hasMultipleGiftFeature = !!currentGoal.products //((currentGoal.products || []).concat([currentGoal.product]).filter(Boolean)).length > 1\r\n const hasMoreThanOneGift = currentGoal.products?.length > 1\r\n return (\r\n <Fragment>\r\n {!hasMultipleGiftFeature && <FormControl\r\n label=\"Select free gift\"\r\n error={\r\n validationErrors[`settings.add_to_unlock.goals.${index}.gift.product`]\r\n }\r\n info=\"Select the gift you would like to offer when goal is unlocked.\"\r\n isSingleCol\r\n >\r\n <ShopifyResourcePicker\r\n allowMultiple={false}\r\n initialQuery=\"product_type:free_gift\"\r\n reducer={GIFT_WITH_PURCHASE_PRODUCT_REDUCER}\r\n verifySelection={([{ productType }]) => {\r\n const isGift = productType.toLowerCase() === \"free_gift\"\r\n if (!isGift) {\r\n AppBridgeToast({\r\n message: 'Select products with type: free_gift',\r\n isError: true\r\n }).open()\r\n }\r\n return isGift\r\n }}\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.product`]}\r\n >\r\n {(trigger) => (\r\n <Button\r\n className={classNames(\"w-full mt-3\")}\r\n text=\"Select a free product\"\r\n type={\r\n validationErrors[\r\n `settings.add_to_unlock.goals.${index}.gift.product`\r\n ] &&\r\n !!validationErrors[\r\n `settings.add_to_unlock.goals.${index}.gift.product`\r\n ][0]\r\n ? \"danger\"\r\n : \"primary\"\r\n }\r\n onClick={trigger}\r\n />\r\n )}\r\n </ShopifyResourcePicker>\r\n </FormControl>}\r\n {\r\n hasMultipleGiftFeature && <FormControl\r\n label=\"Select free gifts\"\r\n error={\r\n validationErrors[`settings.add_to_unlock.goals.${index}.gift.products`]\r\n }\r\n info=\"Select the gifts you would like to offer when goal is unlocked. You can select multiple products however only 1 will be rewarded to customer.\"\r\n isSingleCol\r\n >\r\n <ShopifyResourcePicker\r\n allowMultiple={hasMultipleGiftFeature}\r\n initialSelectionIds={hasMultipleGiftFeature ? InitialSelectionIds(currentGoal.products, \"gid://shopify/Product/{id}\") : undefined}\r\n initialQuery=\"product_type:free_gift\"\r\n reducer={GIFT_WITH_PURCHASE_PRODUCT_REDUCER}\r\n verifySelection={(selection) => {\r\n const hasNoGiftProduct = selection.find(({ productType }) => productType.toLowerCase() !== \"free_gift\")\r\n if (hasNoGiftProduct) {\r\n AppBridgeToast({\r\n message: 'Select products with type: free_gift',\r\n isError: true\r\n }).open()\r\n return false\r\n }\r\n return true\r\n }}\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.products`]}\r\n >\r\n {(trigger) => (\r\n <Button\r\n className={classNames(\"w-full mt-3\")}\r\n text=\"Select Free Products\"\r\n type={\r\n validationErrors[\r\n `settings.add_to_unlock.goals.${index}.gift.product`\r\n ] &&\r\n !!validationErrors[\r\n `settings.add_to_unlock.goals.${index}.gift.product`\r\n ][0]\r\n ? \"danger\"\r\n : \"primary\"\r\n }\r\n onClick={trigger}\r\n />\r\n )}\r\n </ShopifyResourcePicker>\r\n </FormControl>\r\n }\r\n <Alert\r\n {...{\r\n type: 'warning',\r\n borderPosition: 'border-l-4',\r\n iconSize: '2x',\r\n title: 'Free Gift Products Must Be Created Within Shopify With Product Type: free_gift.',\r\n icon: 'exclamation-circle',\r\n customStyle: {\r\n icon: 'text-orange-400 self-start mt-1',\r\n }\r\n }}\r\n className=\"my-6 z-5\"\r\n >\r\n <p>This campaign will not discount products for you. It will add a $0 product you created within shopify. We suggest hiding $0 products from your site search.</p>\r\n <div className={classNames('flex space-x-3 pt-3 justify-start')}>\r\n <a\r\n className={classNames(\r\n 'text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded'\r\n )}\r\n href=\"https://monsterapps.crisp.help/en/article/gift-with-purchase-setup-qt2dwa/\"\r\n target=\"_blank\"\r\n >\r\n <Icon icon=\"info-circle\" className=\"mr-2\" size=\"1x\" />\r\n <span className={classNames('text-xs')}>Learn to make free gift product</span>\r\n </a>\r\n </div>\r\n </Alert>\r\n {\r\n previousGift &&\r\n <FormControl error={validationErrors[`settings.add_to_unlock.goals.${index}.gift.previous_gift`]}>\r\n <ButtonSelect\r\n options={[\r\n {\r\n value: \"keep\",\r\n label: \"Keep previous gift\",\r\n info: \"Previous unlocked gifts will stay in the cart\"\r\n },\r\n {\r\n value: \"remove\",\r\n label: \"Remove previous gift\",\r\n info: \"Previously unlocked gifts will be replaced by this gift\",\r\n beta: true\r\n }\r\n ]}\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.previous_gift`]} />\r\n </FormControl>\r\n }\r\n {\r\n hasMoreThanOneGift &&\r\n <FormControl error={validationErrors[`settings.add_to_unlock.goals.${index}.gift.multi_gift_select`]}>\r\n <ButtonSelect\r\n options={[\r\n {\r\n value: \"select\",\r\n label: \"Customer choose gift\",\r\n info: \"Give a choice of free products when cart goals are met\"\r\n },\r\n {\r\n value: \"random\",\r\n label: \"Select random gift\",\r\n info: \"Reward random gift from select products when cart goals are met\",\r\n beta: true\r\n }\r\n ]}\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.multi_gift_select`]} />\r\n </FormControl>\r\n }\r\n <FormControl\r\n label=\"text before hitting the goal\"\r\n info=\"We recommend using emoji's to draw attention\"\r\n // error={validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n isSingleCol\r\n >\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.before`\r\n ]}\r\n placeholder=\"add {{amount}} to unlock free shipping !\"\r\n // hasError={!!validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n />\r\n <Bindings only={[\"goal\", \"amount_left\"]} />\r\n </FormControl>\r\n <FormControl\r\n label=\"text after hitting the goal\"\r\n info=\"We recommend using emoji's to draw attention. (You can leave this blank.)\"\r\n // error={validationErrors['settings.add_to_unlock.discount.after']}\r\n isSingleCol\r\n >\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.after`\r\n ]}\r\n placeholder=\"you've unlocked a Free Gift\"\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Unlock Widget\"\r\n isSingleCol\r\n withSwitch={[context, `settings.add_to_unlock.goals.${index}.gift.widget.active`]}\r\n />\r\n <div className={classNames({\r\n \"hidden\": !context.state.settings.add_to_unlock.goals[index].gift.widget.active\r\n })}>\r\n <CustomText\r\n context={context}\r\n label=\"Compare at price\"\r\n path={`settings.add_to_unlock.goals.${index}.gift.widget.compare_at_price`}\r\n hasColor={true}\r\n isSingleCol\r\n bindings={{\r\n custom: [\"compare_at_price\", \"compare at price\"]\r\n }}\r\n withSwitch={[context, `settings.add_to_unlock.goals.${index}.gift.widget.compare_at_price_active`]}\r\n />\r\n\r\n <FormControl label=\"Design gift widget\" info=\"select gift will appear when gift uses variants or customer needs to choose from multiple gifts\">\r\n <div>\r\n <div className={classNames(\"flex-center pt-5\")}>\r\n <button className={classNames(\"text-sm focus:outline-none py-2 px-3 font-semibold border-2 rounded-l border-r-none border-blue-500\", {\r\n \"bg-blue-500 text-white\": current === \"before\",\r\n \"bg-white text-blue-500\": current !== \"before\",\r\n })} onClick={() => setCurrent(\"before\")}>Before hitting the goal</button>\r\n {hasMultipleGiftFeature && !isRandom &&\r\n <button className={classNames(\"relative text-sm focus:outline-none py-2 px-3 font-semibold border-t-2 border-b-2 border-blue-500\", {\r\n \"bg-blue-500 text-white\": current === \"selecting\",\r\n \"bg-white text-blue-500\": current !== \"selecting\",\r\n })} onClick={() => setCurrent(\"selecting\")}>Selecting gift\r\n <span className={classNames('absolute flex-center bg-orange-500 tracking-wider py-1 px-2 rounded-lg text-white text-xxs font-bold')} style={{ top: -14, right: 5 }}>Beta</span>\r\n </button>\r\n }\r\n <button className={classNames(\"text-sm focus:outline-none py-2 px-3 font-semibold border-2 rounded-r border-l-none border-blue-500\", {\r\n \"bg-blue-500 text-white\": current === \"after\",\r\n \"bg-white text-blue-500\": current !== \"after\",\r\n })} onClick={() => setCurrent(\"after\")}>After hitting the goal</button>\r\n </div>\r\n <div className={classNames(\"py-5\")}>\r\n <div className={classNames({ \"hidden\": current !== \"before\" })}>\r\n {hasMoreThanOneGift &&\r\n <FormControl\r\n label=\"Gift image\"\r\n isSingleCol\r\n >\r\n <ImagePicker\r\n simplified\r\n value={context.state.settings.add_to_unlock.goals[index].gift.widget.before.multi_gift_image}\r\n onChange={(value) => {\r\n context.setItem(`settings.add_to_unlock.goals.${index}.gift.widget.before.multi_gift_image`, value)\r\n }}\r\n />\r\n </FormControl>\r\n }\r\n <FormControl\r\n label=\"header\"\r\n info=\"We recommend using emoji's to draw attention\"\r\n isSingleCol\r\n >\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.widget.before.header`\r\n ]}\r\n placeholder=\"Spend {{goal}} Get A Free Gift\"\r\n />\r\n <Bindings only={[\"goal\", \"amount_left\"]} />\r\n </FormControl>\r\n <FormControl\r\n label=\"Product name\" isSingleCol>\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.widget.before.product_name`\r\n ]}\r\n placeholder=\"Free Gift: {{product_name}}\"\r\n // hasError={!!validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n />\r\n {!hasMoreThanOneGift && <Bindings custom={[\"product_name\", \"product name\"]} />}\r\n </FormControl>\r\n <CustomText\r\n context={context}\r\n label=\"Offer Highlight\"\r\n path={`settings.add_to_unlock.goals.${index}.gift.widget.before.offer_highlight`}\r\n hasColor\r\n />\r\n <FormControl\r\n label=\"Design\"\r\n >\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.before.background`]}\r\n />\r\n <ColorPicker\r\n text=\"Outline\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.before.outline`]}\r\n />\r\n </FormControl>\r\n {/* {!hasMultipleGiftProducts && <Fragment>\r\n <CustomText\r\n context={context}\r\n label=\"Variant picker options\"\r\n info=\"This will appear if free product has variants. (color, sizing ect.)\"\r\n path={`settings.add_to_unlock.goals.${index}.gift.widget.before.variant_selector_text`}\r\n hasColor\r\n />\r\n <FormControl>\r\n <ColorPicker\r\n text=\"Button background\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.before.variant_button_background`]}\r\n />\r\n </FormControl>\r\n </Fragment>} */}\r\n </div>\r\n {hasMultipleGiftFeature && <div className={classNames({ \"hidden\": current !== \"selecting\" })}>\r\n <FormControl\r\n label=\"header\"\r\n info=\"We recommend using emoji's to draw attention\"\r\n isSingleCol\r\n >\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.widget.selecting.header`\r\n ]}\r\n placeholder=\"Spend {{goal}} Get A Free Gift\"\r\n />\r\n <Bindings only={[\"goal\", \"amount_left\"]} />\r\n </FormControl>\r\n <FormControl\r\n label=\"Product name\" isSingleCol>\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.widget.selecting.product_name`\r\n ]}\r\n placeholder=\"Free Gift: {{product_name}}\"\r\n // hasError={!!validationErrors['settings.add_to_unlock.free_shipping.selecting']}\r\n />\r\n <Bindings custom={[\"product_name\", \"product name\"]} />\r\n </FormControl>\r\n <CustomText\r\n context={context}\r\n label=\"Offer Highlight\"\r\n path={`settings.add_to_unlock.goals.${index}.gift.widget.selecting.offer_highlight`}\r\n hasColor\r\n />\r\n <CustomText\r\n context={context}\r\n label=\"Add to cart button\"\r\n path={`settings.add_to_unlock.goals.${index}.gift.widget.selecting.variant_selector_text`}\r\n hasColor\r\n beta\r\n />\r\n <FormControl\r\n label=\"Design\"\r\n >\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.selecting.background`]}\r\n />\r\n <ColorPicker\r\n text=\"Outline\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.selecting.outline`]}\r\n />\r\n <ColorPicker\r\n text=\"Add to cart button background\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.selecting.variant_button_background`]}\r\n />\r\n </FormControl>\r\n </div>}\r\n <div className={classNames({ \"hidden\": current !== \"after\" })}>\r\n <FormControl\r\n label=\"header\"\r\n info=\"We recommend using emoji's to draw attention\"\r\n // error={validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n isSingleCol\r\n >\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.widget.after.header`\r\n ]}\r\n placeholder=\"Spend {{goal}} Get A Free Gift\"\r\n // hasError={!!validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Product name\" isSingleCol>\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.widget.after.product_name`\r\n ]}\r\n placeholder=\"Free Gift: {{product_name}}\"\r\n // hasError={!!validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n />\r\n <Bindings custom={[\"product_name\", \"product name\"]} />\r\n </FormControl>\r\n <CustomText\r\n context={context}\r\n label=\"Offer Highlight\"\r\n path={`settings.add_to_unlock.goals.${index}.gift.widget.after.offer_highlight`}\r\n hasColor={true}\r\n />\r\n <FormControl\r\n label=\"Design\"\r\n >\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.after.background`]}\r\n />\r\n <ColorPicker\r\n text=\"Outline\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.after.outline`]}\r\n />\r\n {/* <ColorPicker\r\n text=\"Tick\"\r\n BindToContext={[context, `settings.add_to_unlock.goals.${index}.gift.widget.after.tick`]}\r\n /> */}\r\n </FormControl>\r\n <CustomText\r\n context={context}\r\n beta\r\n label=\"Change to other gift\"\r\n path={`settings.add_to_unlock.goals.${index}.gift.widget.after.variant_change_text`}\r\n hasColor={true}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n </FormControl>\r\n {/* <FormControl label=\"Show inventory amount left\" info=\"When inventory is zero reward will be hidden\" withSwitch={[context, `settings.add_to_unlock.goals.${index}.gift.inventory_quantity.active`]}>\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.gift.inventory_quantity.text`\r\n ]}\r\n placeholder=\"Only {{inventory_quantity}} left\"\r\n />\r\n </FormControl> */}\r\n </div>\r\n </Fragment >\r\n )\r\n}\r\n\r\n","import { Bindings, FormControl, Input, RichEditor } from \"components\"\r\nimport { DISCOUNT_TYPES } from \"lib/globals\"\r\nimport React, { Fragment } from \"react\"\r\n\r\nexport default function Discount ({ context, index, currency, validationErrors, campaign, styles }) {\r\n return (\r\n <Fragment>\r\n <FormControl\r\n label=\"Discount\"\r\n className={styles.input}\r\n error={\r\n validationErrors[\r\n `settings.add_to_unlock.goals.${index}.discount.reward`\r\n ]\r\n }\r\n >\r\n <Input\r\n type=\"number\"\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.discount.reward`\r\n ]}\r\n min=\"0\"\r\n max={\r\n campaign.settings.add_to_unlock.goals[index].discount.type ===\r\n \"percentage\"\r\n ? 100\r\n : undefined\r\n }\r\n withDropdown={{\r\n BindToContext: [\r\n context,\r\n `settings.add_to_unlock.goals.${index}.discount.type`\r\n ],\r\n options: DISCOUNT_TYPES(currency)\r\n }}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"text before hitting the goal\"\r\n info=\"We recommend using emoji's to draw attention\"\r\n // error={validationErrors['settings.add_to_unlock.discount.before']}\r\n isSingleCol\r\n >\r\n <RichEditor\r\n imageEmoji={true}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.discount.before`\r\n ]}\r\n placeholder=\"add {{amount}} to unlock {{reward}} off\"\r\n // hasError={!!validationErrors['settings.add_to_unlock.discount.before']}\r\n />\r\n <Bindings />\r\n </FormControl>\r\n <FormControl\r\n label=\"text after hitting the goal\"\r\n info=\"We recommend using emoji's to draw attention. (You can leave this blank.)\"\r\n // error={validationErrors['settings.add_to_unlock.discount.after']}\r\n isSingleCol\r\n >\r\n <RichEditor\r\n imageEmoji={true}\r\n // onFocus={() => setShowATUAfterText(true)}\r\n // onBlur={() => setShowATUAfterText(false)}\r\n // hasError={!!validationErrors['settings.add_to_unlock.discount.after']}\r\n // BindToContext={[context, 'settings.add_to_unlock.discount.after']}\r\n BindToContext={[\r\n context,\r\n `settings.add_to_unlock.goals.${index}.discount.after`\r\n ]}\r\n placeholder=\"you've unlocked {{reward}} off\"\r\n />\r\n <Bindings />\r\n </FormControl>\r\n </Fragment>\r\n )\r\n}","import { API } from 'aws-amplify';\r\nimport Axios from 'axios';\r\nimport { CustomText, FormControl } from 'components';\r\nimport classNames from 'lib/classNames';\r\nimport { set } from 'lodash';\r\nimport React, { useEffect, useState, Fragment } from 'react';\r\n\r\nexport default function GoalImage({ context, goal,show_badges, setBadgeType, setBadgeImage, index }) {\r\n const { reward_type } = goal;\r\n const id = `goal-badge-${index}`;\r\n const [previewImage, setPreviewImage] = useState(null);\r\n const [uploadedImage, setUploadedImage] = useState(goal.badge?.image || null);\r\n const [hasPreview, setHasPreview] = useState(false);\r\n const [isUploading, setIsUploading] = useState(false);\r\n async function uploadImage(e) {\r\n const file = e.target.files[0];\r\n if(!file) return;\r\n setIsUploading(true);\r\n const reader = new FileReader();\r\n reader.onload = async () => {\r\n try {\r\n setPreviewImage(reader.result);\r\n setUploadedImage(reader.result);\r\n const attachment = reader.result;\r\n const fileName = file.name;\r\n const response = await API.post('API_GATEWAY_NEW', '/uploadImage', {\r\n body: { fileName, attachment }\r\n });\r\n setBadgeImage(response.public_url);\r\n setIsUploading(false);\r\n } catch (error) {\r\n setPreviewImage(null);\r\n setUploadedImage(null);\r\n setIsUploading(false);\r\n }\r\n };\r\n reader.readAsDataURL(file);\r\n }\r\n\r\n useEffect(\r\n () => {\r\n setHasPreview(previewImage || uploadedImage);\r\n },\r\n [previewImage, uploadedImage]\r\n );\r\n\r\n return (\r\n <Fragment>\r\n <FormControl\r\n className={!show_badges && 'hidden'}\r\n // withSwitch={[context, `settings.add_to_unlock.goals.${index}.badge.enabled`]}\r\n label=\"badge\"\r\n info=\"Add add an eye catching image to display for the reward. Selected option will automatically adopt primary bar colors\"\r\n >\r\n <div\r\n className={classNames('flex space-x-2 items-center')}\r\n >\r\n <Circle goal={goal} setBadgeType={setBadgeType} index={1}>\r\n <label\r\n htmlFor={id}\r\n className={classNames(\r\n 'flex flex-col items-center justify-center w-full h-full cursor-pointer bg-cover bg-center rounded-full'\r\n )}\r\n style={{\r\n backgroundImage: hasPreview\r\n ? `url(${uploadedImage || previewImage})`\r\n : undefined,\r\n opacity: isUploading ? 0.5 : 1\r\n }}\r\n >\r\n <span\r\n style={{ fontSize: '10px' }}\r\n className={classNames('mb-1', {\r\n hidden: hasPreview || isUploading\r\n })}\r\n >\r\n Upload Image\r\n </span>\r\n <svg\r\n width=\"14\"\r\n className={classNames({\r\n hidden: hasPreview || isUploading\r\n })}\r\n height=\"17\"\r\n viewBox=\"0 0 14 17\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M0 17H14V15H0V17ZM0 7H4V13H10V7H14L7 0L0 7Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-icon=\"spinner-third\"\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 512 512\"\r\n className={classNames('w-5 h-5 fa-spin', { hidden: !isUploading })}\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M456.433 371.72l-27.79-16.045c-7.192-4.152-10.052-13.136-6.487-20.636 25.82-54.328 23.566-118.602-6.768-171.03-30.265-52.529-84.802-86.621-144.76-91.424C262.35 71.922 256 64.953 256 56.649V24.56c0-9.31 7.916-16.609 17.204-15.96 81.795 5.717 156.412 51.902 197.611 123.408 41.301 71.385 43.99 159.096 8.042 232.792-4.082 8.369-14.361 11.575-22.424 6.92z\"\r\n />\r\n </svg>\r\n </label>\r\n <input\r\n type=\"file\"\r\n id={id}\r\n className={classNames('hidden')}\r\n onChange={uploadImage}\r\n />\r\n </Circle>\r\n <Option goal={goal} setBadgeType={setBadgeType} />\r\n </div>\r\n </FormControl>\r\n <CustomText\r\n className={!show_badges && 'hidden'}\r\n withSwitch={[context, `settings.add_to_unlock.goals.${index}.badge.show_text`]}\r\n context={context}\r\n label=\"Goal text\"\r\n path={`settings.add_to_unlock.goals.${index}.badge.text`}\r\n text={goal.badge?.text}\r\n hasColor={true}\r\n />\r\n </Fragment>\r\n );\r\n}\r\n\r\nfunction Circle({ children, className, goal, setBadgeType, index }) {\r\n const selected = goal.badge?.type === index;\r\n\r\n return (\r\n <button\r\n style={{ fontSize: '11px', color: !selected && '#A3AEBE' }}\r\n onClick={() => setBadgeType(index)}\r\n className={classNames(\r\n 'cursor-pointer w-16 h-16 outline-none focus:outline-none flex flex-col items-center justify-center rounded-full text-sm font-semibold text-center',\r\n className,\r\n selected ? 'border-2' : 'border',\r\n { 'border-blue-500 text-blue-500': selected }\r\n )}\r\n >\r\n {children}\r\n </button>\r\n );\r\n}\r\n\r\nfunction Option({ goal, setBadgeType }) {\r\n const { reward_type } = goal;\r\n switch (reward_type) {\r\n case 'discount':\r\n return (\r\n <Circle goal={goal} setBadgeType={setBadgeType} index={2}>\r\n <span>..%</span>\r\n <span>Off</span>\r\n </Circle>\r\n );\r\n case 'free_shipping':\r\n return (\r\n <Fragment>\r\n <Circle goal={goal} setBadgeType={setBadgeType} index={2}>\r\n <span style={{ fontSize: '8px' }} className={classNames('mb-1')}>\r\n Free shipping\r\n </span>\r\n <svg\r\n width=\"22\"\r\n height=\"14.67\"\r\n viewBox=\"0 0 33 22\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M3.82105 13.0625L2.77895 11H10.0737L9.24 8.9375H2.43158L1.38947 6.875H12.2274L11.3937 4.8125H1.19495L0 2.75H5.21053C5.21053 2.02065 5.50331 1.32118 6.02446 0.805456C6.54561 0.289731 7.25245 0 7.98947 0H24.6632V5.5H28.8316L33 11V17.875H30.2211C30.2211 18.969 29.7819 20.0182 29.0002 20.7918C28.2184 21.5654 27.1582 22 26.0526 22C24.9471 22 23.8868 21.5654 23.1051 20.7918C22.3234 20.0182 21.8842 18.969 21.8842 17.875H16.3263C16.3263 18.969 15.8871 20.0182 15.1054 20.7918C14.3237 21.5654 13.2634 22 12.1579 22C11.0524 22 9.99211 21.5654 9.21038 20.7918C8.42865 20.0182 7.98947 18.969 7.98947 17.875H5.21053V13.0625H3.82105ZM26.0526 19.9375C26.6054 19.9375 27.1355 19.7202 27.5264 19.3334C27.9173 18.9466 28.1368 18.422 28.1368 17.875C28.1368 17.328 27.9173 16.8034 27.5264 16.4166C27.1355 16.0298 26.6054 15.8125 26.0526 15.8125C25.4999 15.8125 24.9697 16.0298 24.5789 16.4166C24.188 16.8034 23.9684 17.328 23.9684 17.875C23.9684 18.422 24.188 18.9466 24.5789 19.3334C24.9697 19.7202 25.4999 19.9375 26.0526 19.9375ZM28.1368 7.5625H24.6632V11H30.8602L28.1368 7.5625ZM12.1579 19.9375C12.7107 19.9375 13.2408 19.7202 13.6317 19.3334C14.0225 18.9466 14.2421 18.422 14.2421 17.875C14.2421 17.328 14.0225 16.8034 13.6317 16.4166C13.2408 16.0298 12.7107 15.8125 12.1579 15.8125C11.6051 15.8125 11.075 16.0298 10.6841 16.4166C10.2933 16.8034 10.0737 17.328 10.0737 17.875C10.0737 18.422 10.2933 18.9466 10.6841 19.3334C11.075 19.7202 11.6051 19.9375 12.1579 19.9375Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n </Circle>\r\n <Circle goal={goal} setBadgeType={setBadgeType} index={3}>\r\n <svg\r\n width=\"33\"\r\n height=\"22\"\r\n viewBox=\"0 0 33 22\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M3.82105 13.0625L2.77895 11H10.0737L9.24 8.9375H2.43158L1.38947 6.875H12.2274L11.3937 4.8125H1.19495L0 2.75H5.21053C5.21053 2.02065 5.50331 1.32118 6.02446 0.805456C6.54561 0.289731 7.25245 0 7.98947 0H24.6632V5.5H28.8316L33 11V17.875H30.2211C30.2211 18.969 29.7819 20.0182 29.0002 20.7918C28.2184 21.5654 27.1582 22 26.0526 22C24.9471 22 23.8868 21.5654 23.1051 20.7918C22.3234 20.0182 21.8842 18.969 21.8842 17.875H16.3263C16.3263 18.969 15.8871 20.0182 15.1054 20.7918C14.3237 21.5654 13.2634 22 12.1579 22C11.0524 22 9.99211 21.5654 9.21038 20.7918C8.42865 20.0182 7.98947 18.969 7.98947 17.875H5.21053V13.0625H3.82105ZM26.0526 19.9375C26.6054 19.9375 27.1355 19.7202 27.5264 19.3334C27.9173 18.9466 28.1368 18.422 28.1368 17.875C28.1368 17.328 27.9173 16.8034 27.5264 16.4166C27.1355 16.0298 26.6054 15.8125 26.0526 15.8125C25.4999 15.8125 24.9697 16.0298 24.5789 16.4166C24.188 16.8034 23.9684 17.328 23.9684 17.875C23.9684 18.422 24.188 18.9466 24.5789 19.3334C24.9697 19.7202 25.4999 19.9375 26.0526 19.9375ZM28.1368 7.5625H24.6632V11H30.8602L28.1368 7.5625ZM12.1579 19.9375C12.7107 19.9375 13.2408 19.7202 13.6317 19.3334C14.0225 18.9466 14.2421 18.422 14.2421 17.875C14.2421 17.328 14.0225 16.8034 13.6317 16.4166C13.2408 16.0298 12.7107 15.8125 12.1579 15.8125C11.6051 15.8125 11.075 16.0298 10.6841 16.4166C10.2933 16.8034 10.0737 17.328 10.0737 17.875C10.0737 18.422 10.2933 18.9466 10.6841 19.3334C11.075 19.7202 11.6051 19.9375 12.1579 19.9375Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n </Circle>\r\n </Fragment>\r\n );\r\n case 'manual':\r\n return (\r\n <Fragment>\r\n <Circle goal={goal} setBadgeType={setBadgeType} index={2}>\r\n <span style={{ fontSize: '8px' }} className={classNames('mb-1')}>\r\n Express shipping\r\n </span>\r\n <svg\r\n width=\"22\"\r\n height=\"14.67\"\r\n viewBox=\"0 0 33 22\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M3.82105 13.0625L2.77895 11H10.0737L9.24 8.9375H2.43158L1.38947 6.875H12.2274L11.3937 4.8125H1.19495L0 2.75H5.21053C5.21053 2.02065 5.50331 1.32118 6.02446 0.805456C6.54561 0.289731 7.25245 0 7.98947 0H24.6632V5.5H28.8316L33 11V17.875H30.2211C30.2211 18.969 29.7819 20.0182 29.0002 20.7918C28.2184 21.5654 27.1582 22 26.0526 22C24.9471 22 23.8868 21.5654 23.1051 20.7918C22.3234 20.0182 21.8842 18.969 21.8842 17.875H16.3263C16.3263 18.969 15.8871 20.0182 15.1054 20.7918C14.3237 21.5654 13.2634 22 12.1579 22C11.0524 22 9.99211 21.5654 9.21038 20.7918C8.42865 20.0182 7.98947 18.969 7.98947 17.875H5.21053V13.0625H3.82105ZM26.0526 19.9375C26.6054 19.9375 27.1355 19.7202 27.5264 19.3334C27.9173 18.9466 28.1368 18.422 28.1368 17.875C28.1368 17.328 27.9173 16.8034 27.5264 16.4166C27.1355 16.0298 26.6054 15.8125 26.0526 15.8125C25.4999 15.8125 24.9697 16.0298 24.5789 16.4166C24.188 16.8034 23.9684 17.328 23.9684 17.875C23.9684 18.422 24.188 18.9466 24.5789 19.3334C24.9697 19.7202 25.4999 19.9375 26.0526 19.9375ZM28.1368 7.5625H24.6632V11H30.8602L28.1368 7.5625ZM12.1579 19.9375C12.7107 19.9375 13.2408 19.7202 13.6317 19.3334C14.0225 18.9466 14.2421 18.422 14.2421 17.875C14.2421 17.328 14.0225 16.8034 13.6317 16.4166C13.2408 16.0298 12.7107 15.8125 12.1579 15.8125C11.6051 15.8125 11.075 16.0298 10.6841 16.4166C10.2933 16.8034 10.0737 17.328 10.0737 17.875C10.0737 18.422 10.2933 18.9466 10.6841 19.3334C11.075 19.7202 11.6051 19.9375 12.1579 19.9375Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n </Circle>\r\n <Circle goal={goal} setBadgeType={setBadgeType} index={3}>\r\n <svg\r\n width=\"33\"\r\n height=\"22\"\r\n viewBox=\"0 0 33 22\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M3.82105 13.0625L2.77895 11H10.0737L9.24 8.9375H2.43158L1.38947 6.875H12.2274L11.3937 4.8125H1.19495L0 2.75H5.21053C5.21053 2.02065 5.50331 1.32118 6.02446 0.805456C6.54561 0.289731 7.25245 0 7.98947 0H24.6632V5.5H28.8316L33 11V17.875H30.2211C30.2211 18.969 29.7819 20.0182 29.0002 20.7918C28.2184 21.5654 27.1582 22 26.0526 22C24.9471 22 23.8868 21.5654 23.1051 20.7918C22.3234 20.0182 21.8842 18.969 21.8842 17.875H16.3263C16.3263 18.969 15.8871 20.0182 15.1054 20.7918C14.3237 21.5654 13.2634 22 12.1579 22C11.0524 22 9.99211 21.5654 9.21038 20.7918C8.42865 20.0182 7.98947 18.969 7.98947 17.875H5.21053V13.0625H3.82105ZM26.0526 19.9375C26.6054 19.9375 27.1355 19.7202 27.5264 19.3334C27.9173 18.9466 28.1368 18.422 28.1368 17.875C28.1368 17.328 27.9173 16.8034 27.5264 16.4166C27.1355 16.0298 26.6054 15.8125 26.0526 15.8125C25.4999 15.8125 24.9697 16.0298 24.5789 16.4166C24.188 16.8034 23.9684 17.328 23.9684 17.875C23.9684 18.422 24.188 18.9466 24.5789 19.3334C24.9697 19.7202 25.4999 19.9375 26.0526 19.9375ZM28.1368 7.5625H24.6632V11H30.8602L28.1368 7.5625ZM12.1579 19.9375C12.7107 19.9375 13.2408 19.7202 13.6317 19.3334C14.0225 18.9466 14.2421 18.422 14.2421 17.875C14.2421 17.328 14.0225 16.8034 13.6317 16.4166C13.2408 16.0298 12.7107 15.8125 12.1579 15.8125C11.6051 15.8125 11.075 16.0298 10.6841 16.4166C10.2933 16.8034 10.0737 17.328 10.0737 17.875C10.0737 18.422 10.2933 18.9466 10.6841 19.3334C11.075 19.7202 11.6051 19.9375 12.1579 19.9375Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n </Circle>\r\n </Fragment>\r\n );\r\n case 'gift':\r\n return (\r\n <Fragment>\r\n <Circle goal={goal} setBadgeType={setBadgeType} index={2}>\r\n <span style={{ fontSize: '9px' }} className={classNames('mb-1')}>\r\n Free Gift\r\n </span>\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n strokeWidth={1.5}\r\n stroke=\"currentColor\"\r\n className={classNames('w-4 h-4')}\r\n >\r\n <path\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n d=\"M21 11.25v8.25a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 109.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1114.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z\"\r\n />\r\n </svg>\r\n </Circle>\r\n <Circle goal={goal} setBadgeType={setBadgeType} index={3}>\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n strokeWidth={1.5}\r\n stroke=\"currentColor\"\r\n className={classNames('w-6 h-6')}\r\n >\r\n <path\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n d=\"M21 11.25v8.25a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 109.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1114.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z\"\r\n />\r\n </svg>\r\n </Circle>\r\n </Fragment>\r\n );\r\n default:\r\n return null;\r\n }\r\n}\r\n","import React, { Fragment, useContext, useState } from \"react\";\r\nimport {\r\n\tADD_TO_UNLOCK_REWARD_OPTIONS,\r\n\tADD_TO_UNLOCK_PRODUCTS_PICKER_REDUCER\r\n} from \"lib/globals\";\r\nimport {\r\n\tFormGroup,\r\n\tFormControl,\r\n\tDropdown,\r\n\tShopifyResourcePicker,\r\n\tButton,\r\n\tInput,\r\n\tButtonSelect,\r\n\tColorPicker,\r\n\tRichEditor,\r\n\tRange,\r\n\tCustomText,\r\n\tAlert,\r\n\tBindings,\r\n\tSwitch\r\n} from \"components\";\r\nimport styles from \"styles/campaign_settings_second_step.module.scss\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport PreviewContext from \"context/PreviewContext\";\r\nimport classNames from \"lib/classNames\";\r\nimport { sortByProp } from \"components/cart/Utils\";\r\nimport { SetItemReducer } from \"reducers/SetItemReducer\";\r\nimport { getIn } from \"immutable\";\r\nimport Gift from \"./atu_goals/Gift\";\r\nimport Discount from \"./atu_goals/Discount\";\r\nimport GoalImage from \"./atu_goals/GoalImage\";\r\nimport redeemlyLogo from \"assets/redeemly-logo.jpeg\";\r\nconst AddToUnlock = ({ context, validationErrors, setShowATUAfterText }) => {\r\n\tconst { state: campaign, setItem } = context;\r\n\tconst {\r\n\t\tsettings: { add_to_unlock },\r\n\t\ttarget\r\n\t} = campaign;\r\n\tconst { setEditingProductDetails } = useContext(PreviewContext);\r\n\tconst getError = (key, index) => getIn(validationErrors, [\"settings.add_to_unlock.goals\", index, key], false);\r\n\tconst {\r\n\t\tstate: {\r\n\t\t\tcurrency,\r\n\t\t\tenabled_presentment_currencies\r\n\t\t}\r\n\t} = useContext(ShopContext);\r\n\tconst [old_add_to_unlock, set_old_add_to_unlock] = useState(add_to_unlock);\r\n\t\r\n\treturn (\r\n\t\t<Fragment>\r\n\t\t\t<FormGroup\r\n\t\t\t\tlabel=\"Add To Unlock\"\r\n\t\t\t\tinfo={`Create spend goals that will unlock rewards.\r\n\t\t\t\tTip: If you don’t want to add a discount at least create a free shipping goal.\r\n\t\t\t\tNote: Discount do not stack on to of each other.\r\n\t\t\t\t<a href=\"https://monsterapps.crisp.help/en/article/add-to-unlock-frequently-bought-together-campaign-1x7xy1r/\" target=\"_blank\">(Click to learn more)</a>\r\n\t\t\t\t`}\r\n\t\t\t>\r\n\t\t\t\t<FormControl\r\n\t\t\t\t\tlabel=\"Enable\"\r\n\t\t\t\t\tclassName=\"mb-6\"\r\n\t\t\t\t\twithSwitch={[context, \"settings.add_to_unlock.isActive\"]}\r\n\t\t\t\t/>\r\n\t\t\t\t{add_to_unlock.isActive && (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<FormControl error={validationErrors[\"settings.add_to_unlock.multi_goal_type\"]}>\r\n\t\t\t\t\t\t\t<ButtonSelect\r\n\t\t\t\t\t\t\t\toptions={[\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvalue: \"amount\",\r\n\t\t\t\t\t\t\t\t\t\tlabel: \"$ Amount in Cart\",\r\n\t\t\t\t\t\t\t\t\t\t// icon: 'unlock',\r\n\t\t\t\t\t\t\t\t\t\tinfo: \"Unlock rewards depending on how much $ are in cart.\"\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tvalue: \"quantity\",\r\n\t\t\t\t\t\t\t\t\t\tlabel: \"Product Quantity\",\r\n\t\t\t\t\t\t\t\t\t\t// icon: BOX_CHECK_ICON,\r\n\t\t\t\t\t\t\t\t\t\tinfo: \"Unlock reward based on how many products are in the cart.\"\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\tshowSeparator={false}\r\n\t\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\"settings.add_to_unlock.multi_goal_type\",\r\n\t\t\t\t\t\t\t\t\t(newValue) => {\r\n\t\t\t\t\t\t\t\t\t\tfor (const index in add_to_unlock?.goals) {\r\n\t\t\t\t\t\t\t\t\t\t\tconst goal = newValue === \"quantity\" ? 2 + 2 * index : 40 + 20 * index;\r\n\t\t\t\t\t\t\t\t\t\t\tconst reward = 10 + 5 * index;\r\n\t\t\t\t\t\t\t\t\t\t\tconst hasSpecificGoals = add_to_unlock.goals[index].specific_goals || old_add_to_unlock.goals[index].specific_goals;\r\n\t\t\t\t\t\t\t\t\t\t\tconst goalPAth = hasSpecificGoals ? 'specific_goals.0.goal' : 'goal'\r\n\t\t\t\t\t\t\t\t\t\t\tif (newValue === \"quantity\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\tsetItem(`settings.add_to_unlock.goals.${index}.goal`, goal);\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (hasSpecificGoals) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetItem(`settings.add_to_unlock.goals.${index}.specific_goals`, undefined);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (hasSpecificGoals) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetItem(`settings.add_to_unlock.goals.${index}.specific_goals`, hasSpecificGoals);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetItem(`settings.add_to_unlock.goals.${index}.goal`, undefined);\r\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsetItem(`settings.add_to_unlock.goals.${index}.${goalPAth}`, goal);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tsetItem(`settings.add_to_unlock.goals.${index}.discount.reward`, reward);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\tlabel=\"Show all locked goals\"\r\n\t\t\t\t\t\t\tclassName=\"mb-6\"\r\n\t\t\t\t\t\t\twithSwitch={[context, \"settings.add_to_unlock.show_all_locked_goals\"]}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t<div className={classNames('flex items-center mb-3', {\r\n\t\t\t\t\t\thidden: add_to_unlock?.goals?.filter(({badge}) => !badge).length !== 0\r\n\t\t\t\t\t})}>\r\n \t<label className={classNames('text-gray-600 block flex-1 flex-grow capitalize text-sm font-bold')}>Show badges</label>\r\n\t\t\t\t\t\t<Switch BindToContext={[context, \"settings.add_to_unlock.show_badges\"]} />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t\t{/* mu-block mu-flex-1 mu-flex-grow mu-capitalize mu-text-sm mu-font-bold mu-text-gray-600 */}\r\n\t\t\t\t\t\t{add_to_unlock?.goals?.map((goal, index) => {\r\n\t\t\t\t\t\t\tconst isQuantityGoal = add_to_unlock.multi_goal_type === \"quantity\"\r\n\t\t\t\t\t\t\tconst added_currencies = goal.specific_goals?.map(({ currency }) => currency) || []\r\n\t\t\t\t\t\t\tconst all_currencies_are_selected = enabled_presentment_currencies.filter(currency => !added_currencies.includes(currency)).length === 0\r\n\t\t\t\t\t\t\tconsole.log(\"goal:\");\r\n\t\t\t\t\t\t\tconsole.log(goal);\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<div key={`goal_${index}`} className={classNames(\"mb-5 p-4 rounded bg-white relative\")}>\r\n\t\t\t\t\t\t\t\t\t{add_to_unlock.goals.length > 1 && index !== 0 && (\r\n\t\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"absolute top-0 right-0 -translate-y-1/2 transform translate-x-1/2\"\r\n\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\ticon=\"times\"\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"circle-danger\"\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => context.deleteGoal(index)}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t<div className={classNames(\" font-bold text-gray-600 mb-3\")}>\r\n\t\t\t\t\t\t\t\t\t\t{`Reward ${index + 1}`}\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t{(goal.goal || isQuantityGoal) && <FormControl\r\n\t\t\t\t\t\t\t\t\t\tlabel=\"spend goal\"\r\n\t\t\t\t\t\t\t\t\t\tinfo={\r\n\t\t\t\t\t\t\t\t\t\t\tisQuantityGoal\r\n\t\t\t\t\t\t\t\t\t\t\t\t? \"Choose how many products need to be added to the cart to unlock the reward.\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t: \"Choose what $ amount will need to be added to the cart to unlock the reward.\"\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tclassName={styles.input}\r\n\t\t\t\t\t\t\t\t\t\terror={getError(\"goal\", index)}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tBindToContext={[context, `settings.add_to_unlock.goals.${index}.goal`]}\r\n\t\t\t\t\t\t\t\t\t\t\tmin={index > 0 ? add_to_unlock.goals[index - 1].goal : 0}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</FormControl>}\r\n\t\t\t\t\t\t\t\t\t{goal.specific_goals && <FormControl label=\"spend goal\"\r\n\t\t\t\t\t\t\t\t\t\tisSingleCol\r\n\t\t\t\t\t\t\t\t\t\tinfo={!isQuantityGoal && \"Specify goals for multiple currencies. The goal on currencies that are not specified here will be the store default currency goal multiplied by the currency exchange rate determined by Shopify Markets.\"}\r\n\t\t\t\t\t\t\t\t\t\tFooter={!isQuantityGoal ? () => {\r\n\t\t\t\t\t\t\t\t\t\t\treturn <div className={classNames(\"flex justify-end p-2\")}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Button beta type=\"info\" text=\"Specific currency goal\" disabled={all_currencies_are_selected} onClick={() => context.newSpecificGoal(index)} icon=\"plus\" />\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t} : undefined}>\r\n\t\t\t\t\t\t\t\t\t\t{!isQuantityGoal && goal.specific_goals?.map((specific_goal, specific_goal_index) => (\r\n\t\t\t\t\t\t\t\t\t\t\t<div className={classNames('flex relative bg-white rounded mb-4')} key={`specific_goal_${specific_goal.currency}`}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel=\"Currency\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName='flex-1 mr-2'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmarginBottom=\"mb-0\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t// error={!!getError('quantity')}\r\n\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Dropdown options={enabled_presentment_currencies.filter(currency => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (specific_goal.main || currency === specific_goal.currency) return true\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn !added_currencies.includes(currency)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}).map(currency => ({ value: currency, label: currency }))} disabled={specific_goal.main} BindToContext={[context, `settings.add_to_unlock.goals.${index}.specific_goals.${specific_goal_index}.currency`]} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={`Goal in ${specific_goal.currency}`}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName='flex-1'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tmarginBottom=\"mb-0\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\taction={!specific_goal.main && (() => context.removeSpecificGoal(index, specific_goal_index))}\r\n\t\t\t\t\t\t\t\t\t\t\t\t// error={!!getError('quantity')}\r\n\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tBindToContext={[context, `settings.add_to_unlock.goals.${index}.specific_goals.${specific_goal_index}.goal`]}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmin={index > 0 ? add_to_unlock.goals[index - 1].goal : 0}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t\t\t{isQuantityGoal && <Input\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tBindToContext={[context, `settings.add_to_unlock.goals.${index}.specific_goals.0.goal`]}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t</FormControl>}\r\n\r\n\r\n\t\t\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\t\t\tlabel=\"Show confetti on unlock\"\r\n\t\t\t\t\t\t\t\t\t\tinfo=\"This will display a celebration when unlock has been achieved.\"\r\n\t\t\t\t\t\t\t\t\t\thasError={\r\n\t\t\t\t\t\t\t\t\t\t\t!!validationErrors[`settings.add_to_unlock.goals.${index}.confetti`] ||\r\n\t\t\t\t\t\t\t\t\t\t\t!!validationErrors[`settings.add_to_unlock.goals.${index}.confetti_length`]\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\t\t\t\tmax={600}\r\n\t\t\t\t\t\t\t\t\t\t\tmin={200}\r\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"Confetti count\"\r\n\t\t\t\t\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.confetti_length`\r\n\t\t\t\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\t\t\t\twithSwitch={[context, `settings.add_to_unlock.goals.${index}.confetti`]}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</FormControl>\r\n\r\n\t\t\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\t\t\tlabel=\"When goal is reached what will you give them?\"\r\n\t\t\t\t\t\t\t\t\t// error={validationErrors['settings.add_to_unlock.reward_type']}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t<ButtonSelect\r\n\t\t\t\t\t\t\t\t\t\t\toptions={ADD_TO_UNLOCK_REWARD_OPTIONS(add_to_unlock.goals, index)}\r\n\t\t\t\t\t\t\t\t\t\t\tkeyPrefix={`settings.add_to_unlock.goals.${index}.reward_type`}\r\n\t\t\t\t\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.reward_type`,\r\n\t\t\t\t\t\t\t\t\t\t\t\t(newValue) => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (newValue === \"free_shipping\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetItem(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.goal_text.text`,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Free Shipping\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else if (newValue === \"discount\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst { type, reward } = add_to_unlock.goals[index].discount;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst text =\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype === \"percentage\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? `${reward}% Off`\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: `${currency} ${reward} Off`;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetItem(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.goal_text.text`,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttext\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\telse if (newValue === \"gift\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsetItem(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.goal_text.text`,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"Free Gift\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\t\t\t\tfirst\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t\t\t{goal.reward_type === \"manual\" && (\r\n\t\t\t\t\t\t\t\t\t\t<div className={classNames(\"mt-4 mb-6\")}>\r\n\t\t\t\t\t\t\t\t\t\t\t<div className={classNames(\"flex items-start\")}>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span className={classNames(\"font-medium text-sm\")}>Store credit / cashback is in partnership with Shopify App</span>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<img src={redeemlyLogo} style={{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\theight: 24,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// width: 96\r\n\t\t\t\t\t\t\t\t\t\t\t\t}} className={classNames(\"ml-2\")} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t<span className={classNames(\"ml-2 flex-center bg-orange-500 tracking-wider py-1 px-2 rounded-lg text-white text-xxs font-bold\")}>Beta</span>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t<a \r\n\t\t\t\t\t\t\t\t\t\t\thref=\"https://monsterapps.crisp.help/en/article/store-credits-monster-cart-redeemly-guide-1pott89/\" \r\n\t\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\" \r\n\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\" \r\n\t\t\t\t\t\t\t\t\t\t\tclassName={classNames(\"text-blue-600 hover:text-blue-800 underline font-medium text-sm\")}\r\n\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\tLearn how to set this up here\r\n\t\t\t\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t<GoalImage goal={goal} index={index} \r\n\t\t\t\t\t\t\t\t\tshow_badges={!!goal.badge && add_to_unlock.show_badges}\r\n\t\t\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\t\t\tsetBadgeType={(selected) => setItem(`settings.add_to_unlock.goals.${index}.badge.type`, selected)} \r\n\t\t\t\t\t\t\t\t\tsetBadgeImage={(selected) => setItem(`settings.add_to_unlock.goals.${index}.badge.image`, selected)} \r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\t\t\t\tclassName={add_to_unlock.show_badges ? 'hidden': ''}\r\n\t\t\t\t\t\t\t\t\t\twithSwitch={[context, `settings.add_to_unlock.goals.${index}.show_goal_text`]}\r\n\t\t\t\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\t\t\t\tlabel=\"Goal text\"\r\n\t\t\t\t\t\t\t\t\t\tpath={`settings.add_to_unlock.goals.${index}.goal_text`}\r\n\t\t\t\t\t\t\t\t\t\ttext={add_to_unlock.goals[index].goal_text.text}\r\n\t\t\t\t\t\t\t\t\t\thasColor={true}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tgoal.reward_type === \"free_shipping\" && (\r\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel=\"text before hitting the goal\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tinfo=\"We recommend using emoji's to draw attention\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// error={validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisSingleCol\r\n\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<RichEditor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timageEmoji={true}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.free_shipping.before`\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"add {{amount}} to unlock free shipping !\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// hasError={!!validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Bindings only={[\"goal\", \"amount_left\"]} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel=\"text after hitting the goal\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tinfo=\"We recommend using emoji's to draw attention. (You can leave this blank.)\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// error={validationErrors['settings.add_to_unlock.discount.after']}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisSingleCol\r\n\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<RichEditor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timageEmoji={true}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// onFocus={() => setShowATUAfterText(true)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// onBlur={() => setShowATUAfterText(false)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// hasError={!!validationErrors['settings.add_to_unlock.discount.after']}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// BindToContext={[context, 'settings.add_to_unlock.discount.after']}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.free_shipping.after`\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"you've unlocked {{reward}} off\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Bindings />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tgoal.reward_type === \"discount\" && (\r\n\t\t\t\t\t\t\t\t\t\t\t<Discount {...{ campaign, context, currency, index, validationErrors, styles }} />\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tgoal.reward_type === \"manual\" && (\r\n\t\t\t\t\t\t\t\t\t\t\t<Fragment>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel=\"text before hitting the goal\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tinfo=\"We recommend using emoji's to draw attention\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// error={validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisSingleCol\r\n\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<RichEditor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timageEmoji={true}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.manual.before`\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"add {{amount}} to unlock free shipping !\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// hasError={!!validationErrors['settings.add_to_unlock.free_shipping.before']}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Bindings only={[\"goal\", \"amount_left\"]} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel=\"text after hitting the goal\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tinfo=\"We recommend using emoji's to draw attention. (You can leave this blank.)\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t// error={validationErrors['settings.add_to_unlock.discount.after']}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisSingleCol\r\n\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<RichEditor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timageEmoji={true}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`settings.add_to_unlock.goals.${index}.manual.after`\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"you've unlocked {{reward}} off\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Bindings />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t\t\t\t\t</Fragment>\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t{goal.reward_type === \"gift\" && <Gift {...{ context, index, validationErrors }} />}\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t<FormControl>\r\n\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\ttext={\r\n\t\t\t\t\t\t\t\t\t\tadd_to_unlock?.goals?.length < 4\r\n\t\t\t\t\t\t\t\t\t\t\t? \"+ Add another reward\"\r\n\t\t\t\t\t\t\t\t\t\t\t: \"Only 4 rewards are available\"\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tcontext.newGoal();\r\n\t\t\t\t\t\t\t\t\t\tif (add_to_unlock.goals[0].show_goal_text === false) {\r\n\t\t\t\t\t\t\t\t\t\t\tsetItem(\"settings.add_to_unlock.goals.0.show_goal_text\", true);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tstyle={{ width: \"100%\" }}\r\n\t\t\t\t\t\t\t\t\tdisabled={add_to_unlock?.goals?.length >= 4}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t<FormControl>\r\n\t\t\t\t\t\t\t<Alert type=\"info\" icon=\"info-circle\" title=\"campaign summary\">\r\n\t\t\t\t\t\t\t\t{add_to_unlock?.goals?.map((campaignGoal, currentIndex) => (\r\n\t\t\t\t\t\t\t\t\t<Summary\r\n\t\t\t\t\t\t\t\t\t\t{...{\r\n\t\t\t\t\t\t\t\t\t\t\tkey: `atu_summary_${currentIndex}`,\r\n\t\t\t\t\t\t\t\t\t\t\tcampaignGoal,\r\n\t\t\t\t\t\t\t\t\t\t\ttarget,\r\n\t\t\t\t\t\t\t\t\t\t\tgoals: add_to_unlock.goals,\r\n\t\t\t\t\t\t\t\t\t\t\tcurrentIndex,\r\n\t\t\t\t\t\t\t\t\t\t\tcurrency,\r\n\t\t\t\t\t\t\t\t\t\t\tmulti_goal_type: add_to_unlock.multi_goal_type\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t</Alert>\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t<FormControl label=\"Progress bar thickness\">\r\n\t\t\t\t\t\t\t<ButtonSelect\r\n\t\t\t\t\t\t\t\toptions={[\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tlabel: \"Thin\",\r\n\t\t\t\t\t\t\t\t\t\tvalue: false,\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tlabel: \"Thick\",\r\n\t\t\t\t\t\t\t\t\t\tvalue: true,\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.progress_thick\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t<FormControl label=\"Progress bar colors\">\r\n\t\t\t\t\t\t\t<ColorPicker\r\n\t\t\t\t\t\t\t\ttext=\"Primary\"\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.progress_primary\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t<ColorPicker\r\n\t\t\t\t\t\t\t\ttext=\"Secondary\"\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.progress_secondary\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t<ColorPicker\r\n\t\t\t\t\t\t\t\ttext=\"Goal complete\"\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.progress_complete\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t<ColorPicker\r\n\t\t\t\t\t\t\t\ttext=\"Background\"\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.progress_background\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\t\t\t</FormGroup>\r\n\t\t\t<FormGroup label=\"Frequently bought Together\">\r\n\t\t\t\t<FormControl\r\n\t\t\t\t\tlabel=\"Enable\"\r\n\t\t\t\t\tclassName=\"mb-6\"\r\n\t\t\t\t\twithSwitch={[context, \"settings.add_to_unlock.show_suggestions\"]}\r\n\t\t\t\t/>\r\n\t\t\t\t{!!campaign.settings.add_to_unlock.show_suggestions && (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\tlabel=\"products to suggest\"\r\n\t\t\t\t\t\t\tinfo=\"Suggest products that are likely to be added. We recommend choosing products that are easy to understand without learning more.\"\r\n\t\t\t\t\t\t\terror={validationErrors[\"settings.add_to_unlock.products\"]}\r\n\t\t\t\t\t\t\tisSingleCol={true}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<div className={classNames(\"mb-4\")}>\r\n\t\t\t\t\t\t\t\t<ButtonSelect\r\n\t\t\t\t\t\t\t\t\tisVertical={false}\r\n\t\t\t\t\t\t\t\t\toptions={[\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tlabel: \"Specific Products\",\r\n\t\t\t\t\t\t\t\t\t\t\tvalue: \"custom_recommendation\",\r\n\t\t\t\t\t\t\t\t\t\t\t// infoHtml: true,\r\n\t\t\t\t\t\t\t\t\t\t\tinfo: `When you want very specific products to appear depending on what is in the cart`\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tlabel: \"Shopify Recomendations\",\r\n\t\t\t\t\t\t\t\t\t\t\tvalue: \"shopify_recommendation\",\r\n\t\t\t\t\t\t\t\t\t\t\t// infoHtml: true,\r\n\t\t\t\t\t\t\t\t\t\t\tinfo: ` Use Shopify’s powerful machine learning to suggest commonly purchased products or products in related collections.`\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.recommendation_type\"]}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t\t{campaign.settings.add_to_unlock.recommendation_type === \"custom_recommendation\" && (\r\n\t\t\t\t\t\t\t\t// (\r\n\t\t\t\t\t\t\t\t// \t!campaign.settings.add_to_unlock.recommendation_type ||\r\n\t\t\t\t\t\t\t\t// \tcampaign.settings.add_to_unlock.recommendation_type === \"custom_recommendation\"\r\n\t\t\t\t\t\t\t\t// ) &&\r\n\t\t\t\t\t\t\t\t<ShopifyResourcePicker\r\n\t\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.products\"]}\r\n\t\t\t\t\t\t\t\t\treducer={ADD_TO_UNLOCK_PRODUCTS_PICKER_REDUCER}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{(trigger) => {\r\n\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttext=\"Select Products\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype={\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidationErrors[\"settings.add_to_unlock.products\"] &&\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t!!validationErrors[\"settings.add_to_unlock.products\"][0]\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? \"danger\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: \"primary\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={trigger}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: \"100%\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{!!campaign.settings.add_to_unlock.show_suggestions &&\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t!campaign.settings.add_to_unlock.products.length && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"text-center text-gray-500 text-xs italic mt-2\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSelect a product to expand more settings\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t</ShopifyResourcePicker>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t{campaign.settings.add_to_unlock.recommendation_type === \"shopify_recommendation\" && (\r\n\t\t\t\t\t\t\t<div className={classNames(\"mb-4\")}>\r\n\t\t\t\t\t\t\t\t<Alert type=\"info\" icon=\"info-circle\" title=\"Please note\">\r\n\t\t\t\t\t\t\t\t\t<p>Products in preview cart have been randomly selected.</p>\r\n\t\t\t\t\t\t\t\t</Alert>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t{campaign.settings.add_to_unlock.recommendation_type === \"shopify_recommendation\" && (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t<FormControl label=\"Number of products displayed\">\r\n\t\t\t\t\t\t\t\t\t<Range\r\n\t\t\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.products_length\"]}\r\n\t\t\t\t\t\t\t\t\t\tmin={1}\r\n\t\t\t\t\t\t\t\t\t\tmax={5}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t\t<FormControl label=\"Exclusion tags\" info=\"Hide products with these tags\">\r\n\t\t\t\t\t\t\t\t\t<Dropdown\r\n\t\t\t\t\t\t\t\t\t\tisCreatable={true}\r\n\t\t\t\t\t\t\t\t\t\tisMulti={true}\r\n\t\t\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.exclude_tags\"]}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\tlabel=\"Separator\"\r\n\t\t\t\t\t\t\tinfo=\"This separator can help you communicate your suggested products. It disappears when no suggested products are available.\"\r\n\t\t\t\t\t\t\terror={\r\n\t\t\t\t\t\t\t\tvalidationErrors[\"settings.add_to_unlock.separator.text\"] ||\r\n\t\t\t\t\t\t\t\tvalidationErrors[\"settings.add_to_unlock.separator.active\"]\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\t\tplaceholder=\"Or\"\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.separator.text\"]}\r\n\t\t\t\t\t\t\t\twithSwitch={[context, \"settings.add_to_unlock.separator.active\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</FormControl>\r\n\r\n\t\t\t\t\t\t<div className={classNames(\"flex\")}>\r\n\t\t\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\t\t\tclassName={classNames(\"flex-1 mr-2\")}\r\n\t\t\t\t\t\t\t\tlabel=\"Background color\"\r\n\t\t\t\t\t\t\t\t// info=\"Header background color\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<ColorPicker BindToContext={[context, \"settings.add_to_unlock.background\"]} />\r\n\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t\t<FormControl className={classNames(\"flex-1\")} label=\"Border color\"\r\n\t\t\t\t\t\t\t\t// info=\"Box border color\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<ColorPicker BindToContext={[context, \"settings.add_to_unlock.borderColor\"]} />\r\n\t\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\tlabel=\"Title\"\r\n\t\t\t\t\t\t\tplaceholder=\"Frequently Bought Together\"\r\n\t\t\t\t\t\t\thasColor={true}\r\n\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\tpath=\"settings.add_to_unlock.title\"\r\n\t\t\t\t\t\t\thasWeight=\"600\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\tlabel=\"Show Product Details\"\r\n\t\t\t\t\t\t\tplaceholder=\"Show Details\"\r\n\t\t\t\t\t\t\thasColor={true}\r\n\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\tpath=\"settings.add_to_unlock.show_product_details\"\r\n\t\t\t\t\t\t\thasWeight=\"600\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\tlabel=\"Add To Cart Button\"\r\n\t\t\t\t\t\t\tplaceholder=\"Add To Cart\"\r\n\t\t\t\t\t\t\thasColor={true}\r\n\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\tpath=\"settings.add_to_unlock.upsell_add_button\"\r\n\t\t\t\t\t\t\thasWeight=\"600\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\tlabel=\"Confirm Button\"\r\n\t\t\t\t\t\t\tplaceholder=\"Confirm\"\r\n\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\tpath=\"settings.add_to_unlock.upsell_confirm_button\"\r\n\t\t\t\t\t\t\thasWeight=\"600\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\tlabel=\"Product title\"\r\n\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\thasColor={true}\r\n\t\t\t\t\t\t\tpath=\"settings.add_to_unlock.product_title\"\r\n\t\t\t\t\t\t\thasWeight=\"600\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\tlabel=\"Product Price\"\r\n\t\t\t\t\t\t\tplaceholder=\"Confirm\"\r\n\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\thasColor={true}\r\n\t\t\t\t\t\t\tpath=\"settings.add_to_unlock.product_price\"\r\n\t\t\t\t\t\t\thasWeight=\"600\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t{/* <FormControl\r\n\t\t\t\t\t\t\tlabel=\"Display above checkout\"\r\n\t\t\t\t\t\t\tclassName=\"mb-4\"\r\n\t\t\t\t\t\t\twithSwitch={[context, \"settings.add_to_unlock.fbt_below\"]}\r\n\t\t\t\t\t\t/> */}\r\n \t\t\t\t<FormControl label=\"Display\">\r\n\t\t\t\t\t\t\t<Dropdown\r\n\t\t\t\t\t\t\t\toptions={[\r\n\t\t\t\t\t\t\t\t\t{ value: \"under_products\", label: \"Under products\" },\r\n\t\t\t\t\t\t\t\t\t{ value: \"above_checkout\", label: \"Above checkout\" },\r\n\t\t\t\t\t\t\t\t\t{ value: \"below_checkout\", label: \"Below checkout\" },\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\t\"settings.add_to_unlock.fbt_position\"\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t \t\t\t\t</FormControl>\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\t\t\t</FormGroup>\r\n\r\n\t\t\t{/* from settings */}\r\n\t\t\t{\r\n\t\t\t\t!!campaign.settings.add_to_unlock.show_suggestions && (\r\n\t\t\t\t\t// (!!campaign.settings.add_to_unlock.products.length ||\r\n\t\t\t\t\t// \tcampaign.settings.add_to_unlock.recommendation_type === \"shopify_recommendation\" )\r\n\t\t\t\t\t// &&\r\n\t\t\t\t\t<FormGroup\r\n\t\t\t\t\t\tlabel=\"show details\"\r\n\t\t\t\t\t\tinfo={`This is used when someone clicks read more on campaigns.\r\n\t\t\t\t\t\t\tTip: If you have a long descriptions make the read more button send users straight to the product page for a better experience.`}\r\n\t\t\t\t\t\tonFocus={() => setEditingProductDetails(true)}\r\n\t\t\t\t\t\tonBlur={() => setEditingProductDetails(false)}\r\n\t\t\t\t\t\tfocusCondition={({ event }) => {\r\n\t\t\t\t\t\t\tconst productDetails = document.getElementById(\"monster_product_details\");\r\n\t\t\t\t\t\t\treturn productDetails\r\n\t\t\t\t\t\t\t\t? productDetails === event.target || productDetails.contains(event.target)\r\n\t\t\t\t\t\t\t\t: false;\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\t// onFocus={() => setEditingProductDetails(true)}\r\n\t\t\t\t\t\t\t// onBlur={() => setEditingProductDetails(false)}\r\n\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\tlabel=\"Add to cart button\"\r\n\t\t\t\t\t\t\tpath=\"settings.add_to_unlock.product_details.atcButton\"\r\n\t\t\t\t\t\t\thasColor={true}\r\n\t\t\t\t\t\t\thasWeight=\"700\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<FormControl label=\"add to cart button colors\">\r\n\t\t\t\t\t\t\t<ColorPicker\r\n\t\t\t\t\t\t\t\t// onFocus={() => setEditingProductDetails(true)}\r\n\t\t\t\t\t\t\t\t// onBlur={() => setEditingProductDetails(false)}\r\n\t\t\t\t\t\t\t\ttext=\"Background\"\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.product_details.atcButton_background\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t{/* <ColorPicker\r\n\t\t\t\t\t\t\t// onFocus={() => setEditingProductDetails(true)}\r\n\t\t\t\t\t\t\t// onBlur={() => setEditingProductDetails(false)}\r\n\t\t\t\t\t\t\ttext=\"hover background\"\r\n\t\t\t\t\t\t\tBindToContext={[\r\n\t\t\t\t\t\t\t\tcontext,\r\n\t\t\t\t\t\t\t\t\"settings.add_to_unlock.product_details.atcButton_hoverBackground\"\r\n\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t/> */}\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t<FormControl label=\"Limit product description length\">\r\n\t\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\t\t// onFocus={() => setEditingProductDetails(true)}\r\n\t\t\t\t\t\t\t\t// onBlur={() => setEditingProductDetails(false)}\r\n\t\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\t\tplaceholder=\"Characters length\"\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.product_details.truncate_length\"]}\r\n\t\t\t\t\t\t\t\twithSwitch={[context, \"settings.add_to_unlock.product_details.truncate\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t\t<CustomText\r\n\t\t\t\t\t\t\t// onFocus={() => setEditingProductDetails(true)}\r\n\t\t\t\t\t\t\t// onBlur={() => setEditingProductDetails(false)}\r\n\t\t\t\t\t\t\tcontext={context}\r\n\t\t\t\t\t\t\tlabel=\"Read more button\"\r\n\t\t\t\t\t\t\tpath=\"settings.add_to_unlock.product_details.readMore\"\r\n\t\t\t\t\t\t\thasColor={true}\r\n\t\t\t\t\t\t\thasWeight=\"700\"\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<FormControl error={validationErrors[\"settings.add_to_unlock.product_details.external\"]}>\r\n\t\t\t\t\t\t\t<ButtonSelect\r\n\t\t\t\t\t\t\t\toptions={[\r\n\t\t\t\t\t\t\t\t\t{ label: \"Open product page\", value: true },\r\n\t\t\t\t\t\t\t\t\t{ label: \"Expand description\", value: false }\r\n\t\t\t\t\t\t\t\t]}\r\n\t\t\t\t\t\t\t\tBindToContext={[context, \"settings.add_to_unlock.product_details.external\"]}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</FormControl>\r\n\t\t\t\t\t</FormGroup>\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t</Fragment >\r\n\t);\r\n};\r\n\r\nexport default AddToUnlock;\r\n\r\nconst Summary = ({ campaignGoal, target, goals, currentIndex, currency, multi_goal_type }) => {\r\n\tconst { reward_type, goal, goal_type } = campaignGoal;\r\n\tconst rewardType = campaignGoal[reward_type];\r\n\tconst isDiscount = reward_type === \"discount\";\r\n\tconst isGift = reward_type === \"gift\";\r\n\tconst { type, reward } = rewardType;\r\n\t//TODO: i need show money formatting here\r\n\tlet free_shipping_text = \"\";\r\n\tif (isDiscount) {\r\n\t\t//check if the previous goals has free shipping\r\n\t\tconst sortedGoalsAsc = sortByProp(\"goal\", \"asc\")(goals);\r\n\t\tconst previousGoals = [...goals].splice(0, currentIndex);\r\n\t\tconst hasFreeShipping = !!previousGoals.find((goal) => goal.reward_type === \"free_shipping\");\r\n\t\tif (hasFreeShipping) {\r\n\t\t\tfree_shipping_text = \"Free Shipping + \";\r\n\t\t}\r\n\t}\r\n\r\n\tif (\r\n\t\t(target.type === \"specific_products\" && !target.selected.length) ||\r\n\t\t(!!isDiscount && !type) ||\r\n\t\t!goal ||\r\n\t\t!goal_type ||\r\n\t\t(!!isDiscount && !reward)\r\n\t) {\r\n\t\treturn null;\r\n\t}\r\n\t// const must_truncated = (text) => text.length > 25;\r\n\t// const truncate_name = (text) => `\"${text.substring(0, 25).trim()}${must_truncated(text) ? \"...\" : \"\"}\"`;\r\n\t// const product_name = target.type === \"specific_products\" ? truncate_name(target.selected[0].title) : \"any product\";\r\n\tconst formatter_reward = isDiscount\r\n\t\t? type === \"percentage\"\r\n\t\t\t? `${reward}% off`\r\n\t\t\t: `$${reward} off`\r\n\t\t: isGift ? \"a Free Gift\" : \"Free Shipping\";\r\n\r\n\tif (multi_goal_type === \"amount\") {\r\n\t\treturn (\r\n\t\t\t<p\r\n\t\t\t\tclassName={classNames(\"mb-2\")}\r\n\t\t\t>{`Spend ${currency} ${goal}+ and get ${free_shipping_text}${formatter_reward}.`}</p>\r\n\t\t);\r\n\t} else if (multi_goal_type === \"quantity\") {\r\n\t\treturn (\r\n\t\t\t<p\r\n\t\t\t\tclassName={classNames(\"mb-2\")}\r\n\t\t\t>{`Buy ${goal} products and get ${free_shipping_text}${formatter_reward}.`}</p>\r\n\t\t);\r\n\t}\r\n};\r\n","import React, { Component } from 'react';\r\nimport { Dropdown, FormControl, Input, Button } from 'components';\r\nimport { DISCOUNT_TYPES, PERCENTAGE_ICON } from 'lib/globals';\r\nimport styles from 'styles/bundle.module.scss';\r\nimport { getIn } from 'immutable';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst Bundle = ({ bundle, index, context, shopContext }) => {\r\n\tconst { validationErrors } = context;\r\n\tconst { state: { currency } } = shopContext\r\n\tconst getError = (key) => getIn(validationErrors, ['settings.bundles.list', index, key], false);\r\n\r\n\treturn (\r\n\t\t<div className={classNames('flex relative bg-white rounded p-3 pr-6 mb-4')}>\r\n\t\t\t<FormControl\r\n\t\t\t\tlabel=\"quantity\"\r\n\t\t\t\tclassName='flex-1 mr-2'\r\n\t\t\t\tmarginBottom=\"mb-0\"\r\n\t\t\t\terror={!!getError('quantity')}\r\n\t\t\t>\r\n\t\t\t\t<Input\r\n\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\tBindToContext={[context, `settings.bundles.list.${index}.quantity`]}\r\n\t\t\t\t\tgetError={!!getError('quantity')}\r\n\t\t\t\t\tspecificValidation={'settings.bundles.list'}\r\n\t\t\t\t\tmin=\"2\"\r\n\t\t\t\t\tisFlex\r\n\t\t\t\t\tclassName={classNames('w-20')}\r\n\t\t\t\t/>\r\n\t\t\t</FormControl>\r\n\t\t\t<FormControl\r\n\t\t\t\tlabel=\"discount\"\r\n\t\t\t\tclassName='flex-1 flex-grow'\r\n\t\t\t\tmarginBottom=\"mb-0\"\r\n\t\t\t\terror={!!getError('reward')}\r\n\t\t\t>\r\n\t\t\t\t<Input\r\n\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\tBindToContext={[context, `settings.bundles.list.${index}.reward`]}\r\n\t\t\t\t\tgetError={!!getError('reward')}\r\n\t\t\t\t\tspecificValidation={'settings.bundles.list'}\r\n\t\t\t\t\tmin=\"0\"\r\n\t\t\t\t\tmax=\"100\"\r\n\t\t\t\t\tmax={context.state.settings.bundles.list[index].type === 'percentage' ? 100 : undefined}\r\n\t\t\t\t\twithDropdown={{\r\n\t\t\t\t\t\tBindToContext: [context, `settings.bundles.list.${index}.type`],\r\n\t\t\t\t\t\toptions: DISCOUNT_TYPES(currency),\r\n\t\t\t\t\t\tgetError: !!getError('type'),\r\n\t\t\t\t\t\tspecificValidation: 'settings.bundles.list',\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tfullWidth\r\n\t\t\t\t/>\r\n\t\t\t</FormControl>\r\n\t\t\t<Button\r\n\t\t\t\tclassName={classNames('absolute top-1/2 right-0 -translate-y-1/2 transform translate-x-1/2')}\r\n\t\t\t\ticon=\"times\"\r\n\t\t\t\ttype=\"circle-danger\"\r\n\t\t\t\tonClick={() => context.deleteBundle(bundle.id)}\r\n\t\t\t/>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default Bundle;\r\n","import React, { useContext, useState } from 'react';\r\nimport {\r\n FormGroup,\r\n FormControl,\r\n Button,\r\n Input,\r\n ColorPicker,\r\n Alert,\r\n ButtonSelect\r\n} from 'components';\r\nimport styles from 'styles/campaign_settings_second_step.module.scss';\r\nimport Bundle from './Bundle';\r\nimport { CAMPAIGN_TYPES } from 'lib/globals';\r\nimport classNames from 'lib/classNames';\r\nimport { getIn } from 'immutable';\r\nimport PreviewContext from 'context/PreviewContext';\r\nimport { useFocusWithin } from 'react-aria';\r\nimport useRefState from 'hooks/useRefState';\r\n\r\nconst Bundles = ({ context, validationErrors, shopContext }) => {\r\n const { previewBundlesVariantsPicker } = useContext(PreviewContext);\r\n const { state: campaign, newBundle } = context;\r\n const [\r\n visiblePickerColorPickers,\r\n setVisiblePickerColorPickers,\r\n visiblePickerColorPickers_ref\r\n ] = useRefState([]);\r\n const handleColorPickerVisibleChange = name => visible => {\r\n if (visible) {\r\n const set = new Set(...visiblePickerColorPickers).add(name);\r\n setVisiblePickerColorPickers([...set]);\r\n } else {\r\n const v = visiblePickerColorPickers.filter(n => n !== name);\r\n setVisiblePickerColorPickers(v);\r\n }\r\n };\r\n let { focusWithinProps } = useFocusWithin({\r\n onFocusWithin: () => previewBundlesVariantsPicker(true, context.state.settings.bundles),\r\n onBlurWithin: event => {\r\n if (!visiblePickerColorPickers_ref.current.length) previewBundlesVariantsPicker(false);\r\n }\r\n });\r\n return (\r\n <FormGroup\r\n className={styles.group}\r\n label={CAMPAIGN_TYPES['bundles']}\r\n info=\"Create rewards for when a customer buys more of certain products.\"\r\n >\r\n <FormControl label=\"style\" error={validationErrors['settings.bundles.style']}>\r\n <ButtonSelect\r\n options={[\r\n { value: 'vertical', label: 'Vertical' },\r\n { value: 'horizontal', label: 'Horizontal' }\r\n ]}\r\n showSeparator={false}\r\n BindToContext={[context, 'settings.bundles.style']}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Create offer\" marginBottom=\"mb-0\">\r\n <div className={classNames('flex flex-col')}>\r\n {campaign.settings.bundles.list.map((bundle, index) =>\r\n <Bundle\r\n bundle={bundle}\r\n key={index}\r\n index={index}\r\n context={context}\r\n shopContext={shopContext}\r\n />\r\n )}\r\n </div>\r\n </FormControl>\r\n <div className={classNames('flex justify-end mb-4')}>\r\n <Button text=\"New offer\" icon=\"plus\" onClick={() => newBundle()} type=\"info\" />\r\n </div>\r\n <Summary campaign={context.state} />\r\n <FormControl\r\n label=\"offer description\"\r\n error={validationErrors['settings.bundles.text']}\r\n >\r\n <Input\r\n BindToContext={[context, 'settings.bundles.text']}\r\n placeholder=\"offer description\"\r\n />\r\n </FormControl>\r\n <FormControl label=\"pricing\" error={validationErrors['settings.bundles.prefix']}>\r\n <Input BindToContext={[context, 'settings.bundles.prefix']} placeholder=\"pricing\" />\r\n </FormControl>\r\n <FormControl label=\"font size\" error={validationErrors['settings.bundles.font_size']}>\r\n <Input\r\n BindToContext={[context, 'settings.bundles.font_size']}\r\n type=\"number\"\r\n min={0.5}\r\n max={2}\r\n step={0.1}\r\n placeholder=\"font size\"\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Offer colors\"\r\n error={\r\n validationErrors['settings.bundles.background'] ||\r\n validationErrors['settings.bundles.color']\r\n }\r\n >\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[context, 'settings.bundles.background']}\r\n />\r\n <ColorPicker\r\n text=\"Color\"\r\n position=\"bottom right\"\r\n BindToContext={[context, 'settings.bundles.color']}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"badge colors\"\r\n error={\r\n validationErrors['settings.bundles.badge.text'] ||\r\n validationErrors['settings.bundles.badge.background'] ||\r\n validationErrors['settings.bundles.badge.text']\r\n }\r\n >\r\n <ColorPicker\r\n text=\"text\"\r\n BindToContext={[context, 'settings.bundles.badge.text']}\r\n />\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[context, 'settings.bundles.badge.background']}\r\n />\r\n <ColorPicker\r\n text=\"board\"\r\n BindToContext={[context, 'settings.bundles.badge.border']}\r\n />\r\n </FormControl> \r\n <FormControl\r\n beta\r\n label=\"variant picker\"\r\n info=\"Appears when product has variants and customer clicks volume increase buttons in cart.\"\r\n withSwitch={[context, 'settings.bundles.variantsPicker.active']}\r\n >\r\n <span />\r\n </FormControl>\r\n <div\r\n className={classNames({\r\n hidden: !context.state.settings.bundles.variantsPicker?.active\r\n })}\r\n {...focusWithinProps}\r\n >\r\n <FormControl\r\n label=\"Multi Product Label\"\r\n className=\"mt-5\"\r\n info=\"Appears when customer has to add more than 1 product with a variant.\"\r\n >\r\n <Input\r\n placeholder=\"Multi Product Label\"\r\n BindToContext={[\r\n context,\r\n 'settings.bundles.variantsPicker.label',\r\n value => {\r\n const { bundles } = context.state.settings;\r\n bundles.variantsPicker.label = value;\r\n previewBundlesVariantsPicker(true, bundles);\r\n }\r\n ]}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Confirm Product Label\">\r\n <Input\r\n placeholder=\"Confirm Product Label\"\r\n BindToContext={[\r\n context,\r\n 'settings.bundles.variantsPicker.confirm',\r\n value => {\r\n const { bundles } = context.state.settings;\r\n bundles.variantsPicker.confirm = value;\r\n previewBundlesVariantsPicker(true, campaign.settings.bundles);\r\n }\r\n ]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Picker colors\"\r\n isSingleCol\r\n error={validationErrors['settings.bundles.variantsPicker.textColor']}\r\n >\r\n <ColorPicker\r\n text=\"Text\"\r\n BindToContext={[\r\n context,\r\n 'settings.bundles.variantsPicker.textColor',\r\n value => {\r\n const { bundles } = context.state.settings;\r\n bundles.variantsPicker.textColor = value;\r\n previewBundlesVariantsPicker(true, campaign.settings.bundles);\r\n }\r\n ]}\r\n onVisibleChange={handleColorPickerVisibleChange('textColor')}\r\n />\r\n <div className={classNames('flex')}>\r\n <ColorPicker\r\n className=\"py-3 w-1/2\"\r\n text=\"Dropdown text\"\r\n BindToContext={[\r\n context,\r\n 'settings.bundles.variantsPicker.dropdownTextColor',\r\n value => {\r\n const { bundles } = context.state.settings;\r\n bundles.variantsPicker.dropdownTextColor = value;\r\n previewBundlesVariantsPicker(true, campaign.settings.bundles);\r\n }\r\n ]}\r\n onVisibleChange={handleColorPickerVisibleChange('dropdownTextColor')}\r\n />\r\n <ColorPicker\r\n className=\"w-1/2\"\r\n text=\"Dropdown background\"\r\n BindToContext={[\r\n context,\r\n 'settings.bundles.variantsPicker.dropdownBackground',\r\n value => {\r\n const { bundles } = context.state.settings;\r\n bundles.variantsPicker.dropdownBackground = value;\r\n previewBundlesVariantsPicker(true, campaign.settings.bundles);\r\n }\r\n ]}\r\n onVisibleChange={handleColorPickerVisibleChange('dropdownBackground')}\r\n />\r\n </div>\r\n <div className={classNames('flex')}>\r\n <ColorPicker\r\n className=\"py-3 w-1/2\"\r\n text=\"Confirm Button Background\"\r\n BindToContext={[\r\n context,\r\n 'settings.bundles.variantsPicker.confirmBackground',\r\n value => {\r\n const { bundles } = context.state.settings;\r\n bundles.variantsPicker.confirmBackground = value;\r\n previewBundlesVariantsPicker(true, campaign.settings.bundles);\r\n }\r\n ]}\r\n onVisibleChange={handleColorPickerVisibleChange('confirmBackground')}\r\n />\r\n <ColorPicker\r\n className=\"w-1/2\"\r\n text=\"Confirm Button Text\"\r\n BindToContext={[\r\n context,\r\n 'settings.bundles.variantsPicker.confirmTextColor',\r\n value => {\r\n const { bundles } = context.state.settings;\r\n bundles.variantsPicker.confirmTextColor = value;\r\n previewBundlesVariantsPicker(true, campaign.settings.bundles);\r\n }\r\n ]}\r\n onVisibleChange={handleColorPickerVisibleChange('confirmTextColor')}\r\n />\r\n </div>\r\n </FormControl>\r\n </div>\r\n {/* <FormControl label=\"discount title\" error={validationErrors['settings.applied_discount_title']}>\r\n <Input placeholder=\"discount title\" BindToContext={[context, 'settings.applied_discount_title']} />\r\n </FormControl> */}\r\n </FormGroup>\r\n );\r\n};\r\n\r\nexport default Bundles;\r\n\r\nconst Summary = ({ campaign }) => {\r\n const { target, settings: { bundles } } = campaign;\r\n //TODO: i need show money formatting here\r\n if ((target.type === 'specific_products' && !target.selected.length) || !bundles.list.length)\r\n return null;\r\n const must_truncated = text => text.length > 25;\r\n const truncate_name = text =>\r\n `\"${text.substring(0, 25).trim()}${must_truncated(text) ? '...' : ''}\"`;\r\n const product_name =\r\n target.type === 'specific_products'\r\n ? truncate_name(target.selected[0].title)\r\n : 'any product';\r\n\r\n return (\r\n <Alert\r\n type=\"info\"\r\n icon=\"info-circle\"\r\n title=\"campaign summary\"\r\n className={classNames('mb-6')}\r\n >\r\n {bundles.list.map(({ quantity, type, reward }, i) => {\r\n if (!quantity || !type || !reward) return null;\r\n const isLast = i === bundles.list.length - 1;\r\n const formatted_reward = type === 'percentage' ? `${reward}%` : `$${reward}`;\r\n return (\r\n <p key={i}>\r\n {`Buy ${quantity} ${isLast\r\n ? ' or more'\r\n : ''} of ${product_name} and get ${formatted_reward} off.`}\r\n </p>\r\n );\r\n })}\r\n </Alert>\r\n );\r\n};\r\n","import React, { Fragment, useState, useEffect, useContext } from \"react\";\r\nimport {\r\n FormGroup,\r\n FormControl,\r\n ShopifyResourcePicker,\r\n Button,\r\n ButtonSelect,\r\n Input,\r\n ProductSelector,\r\n ImagePicker,\r\n Modal,\r\n Carousel,\r\n RichEditor,\r\n Alert,\r\n ColorPicker\r\n} from \"components\";\r\nimport {\r\n ONE_CHECK_UP_SELL_PRODUCT_TYPE_OPTIONS,\r\n ONE_CHECK_UP_SELL_PRODUCT_REDUCER,\r\n PRESET_HIDDEN_PRODUCTS,\r\n CAMPAIGN_TYPES,\r\n BREAK_POINTS\r\n} from \"lib/globals\";\r\nimport { API } from \"aws-amplify\";\r\nimport styles from \"styles/campaign_settings_second_step.module.scss\";\r\nimport { CartContext } from \"components/cart\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport classNames from \"lib/classNames\";\r\nimport useRefState from \"hooks/useRefState\";\r\n\r\nconst OneCheckUpSell = ({ context, validationErrors }) => {\r\n const { state: campaign, setItem, updateOldOCU } = context;\r\n const shopContext = useContext(ShopContext);\r\n const {\r\n state: {\r\n settings: { theme },\r\n currency\r\n }\r\n } = shopContext;\r\n const [hiddenProducts, setHiddenProducts] = useState([]);\r\n const newHiddenProductDefault = { title: \"\", image: \"\", price: \"\" };\r\n // const [newHiddenProduct, setNewHiddenProduct, newHiddenProductRef] = useRefState(newHiddenProductDefault);\r\n const [newHiddenProductLoading, setNewHiddenProductLoading] = useState(false);\r\n const [productsFetchLoading, setProductsFetchLoading] = useState(true);\r\n const [showHiddenProductSelector, setShowHiddenProductSelector] =\r\n useState(false);\r\n const [activeTab, setActiveTab] = useState(0);\r\n // const setProp = (value) => setNewHiddenProduct(Object.assign({}, newHiddenProduct, value));\r\n\r\n const [productImage, setProductImage] = useState(\"\");\r\n const [productTitle, setProductTitle] = useState(\"\");\r\n const [productPrice, setProductPrice] = useState(\"\");\r\n const [bodyHtml, setBodyHtml] = useState(\"\");\r\n\r\n const setProps = (id) => {\r\n const selected = PRESET_HIDDEN_PRODUCTS.find((p) => p.id === id);\r\n setProductImage(selected.image);\r\n setProductTitle(selected.title);\r\n setProductPrice(selected.price);\r\n setBodyHtml(selected.body_html);\r\n };\r\n const createProduct = (setActiveTab) => {\r\n if (\r\n productImage === \"\" ||\r\n productTitle === \"\" ||\r\n productPrice === \"\" ||\r\n bodyHtml === \"\"\r\n )\r\n return;\r\n setNewHiddenProductLoading(true);\r\n API.post(\"API_GATEWAY_NEW\", \"/products\", {\r\n body: {\r\n price: productPrice,\r\n title: productTitle,\r\n image: productImage,\r\n body_html: bodyHtml\r\n }\r\n })\r\n .then(({ product }) => {\r\n setHiddenProducts(hiddenProducts.concat([product]));\r\n setProductImage(\"\");\r\n setProductTitle(\"\");\r\n setProductPrice(\"\");\r\n setBodyHtml(\"\");\r\n setActiveTab(0);\r\n setNewHiddenProductLoading(false);\r\n })\r\n .catch(console.log);\r\n };\r\n\r\n useEffect(() => {\r\n setProductsFetchLoading(true);\r\n API.get(\"API_GATEWAY_NEW\", \"/products\", {\r\n queryStringParameters: {\r\n type: \"hidden\",\r\n limit: 4\r\n }\r\n })\r\n .then(({ products }) => {\r\n setHiddenProducts(products);\r\n setProductsFetchLoading(false);\r\n })\r\n .catch(console.log);\r\n }, []);\r\n\r\n // useEffect(() => {\r\n // \tconsole.log(!!Object.values(newHiddenProduct).filter((value) => value === '').length || bodyHtml === '');\r\n // }, [newHiddenProduct, bodyHtml]);\r\n\r\n return (\r\n <>\r\n <FormGroup\r\n label={CAMPAIGN_TYPES[\"one_check_up_sell\"]}\r\n info=\"Create a tick box that adds a little extra product to the cart.\"\r\n >\r\n <Alert type=\"info\" icon=\"info-circle\" className=\"mb-6\" title=\"New one tick upsell version is now available\" actions={[{\r\n text: \"update\",\r\n onClick: updateOldOCU\r\n }]} />\r\n <FormControl\r\n label=\"Ticked by default\"\r\n info=\"When campaign is active it will auto tick the box and add one tick upsell product to the cart.\"\r\n withSwitch={[\r\n context,\r\n \"settings.one_check_up_sell.is_ticked_by_default\"\r\n ]}\r\n disabled\r\n >\r\n <div>\r\n <a\r\n href=\"https://monsterapps.crisp.help/en/article/auto-select-tick-box-deprecated-15wrgud/\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className={classNames(\"underline text-sm font-medium\")}\r\n >\r\n Learn more\r\n </a>\r\n </div>\r\n {/* <div className={classNames(\"border border-orange-100 rounded-lg p-4 mt-2 mb-6\")} style={{ backgroundColor: \"#FFF2E2\" }}>\r\n <div className={classNames(\"flex\")}>\r\n <div className={classNames(\"flex-shrink-0\")}>\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 16 16\" className={classNames(\"h-5 w-5\")}>\r\n <path d=\"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566M8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2\" />\r\n </svg>\r\n </div>\r\n <div className={classNames(\"ml-3\")}>\r\n <h3 className={classNames(\"text-sm font-medium\")}>\r\n We have removed \"Ticked by default\"\r\n </h3>\r\n <div className={classNames(\"mt-1 text-sm\")}>\r\n <p>\r\n To provide more trustworthy buyer experiences, Shopify is prohibiting apps from automatically adding non-free items. Buyers will need to explicitly accept add-ons by clicking the toggle. To learn more, see{' '}\r\n <a \r\n href=\"https://shopify.dev/docs/apps/launch/app-requirements-checklist#1-prohibited-and-restricted-app-configurations\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className={classNames(\"underline\")}\r\n >\r\n Section 1.19\r\n </a>\r\n {' '}of Shopify's app requirements.\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n </div> */}\r\n </FormControl>\r\n <FormControl\r\n label=\"Include in add to unlock goal\"\r\n info=\"The one tick product amount will count towards Add To Unlock reward goals.\"\r\n withSwitch={[context, \"settings.one_check_up_sell.include_in_atu\"]}\r\n >\r\n <div></div>\r\n </FormControl>\r\n <FormControl label=\"Text\">\r\n <RichEditor\r\n placeholder=\"Enter your sold here!\"\r\n BindToContext={[context, \"settings.one_check_up_sell.text\"]}\r\n indicator=\"You can use {{title}} {{price}}\"\r\n />\r\n </FormControl>\r\n <FormControl\r\n error={validationErrors[\"settings.one_check_up_sell.highlight\"]}\r\n >\r\n {/*label=\"Highlight color\" */}\r\n <ColorPicker\r\n text=\"Highlight color\"\r\n BindToContext={[context, \"settings.one_check_up_sell.highlight\"]}\r\n />\r\n </FormControl>\r\n\r\n <FormControl label=\"Limit product name length\">\r\n <Input\r\n // onFocus={() => setEditingProductDetails(true)}\r\n // onBlur={() => setEditingProductDetails(false)}\r\n type=\"number\"\r\n placeholder=\"Characters length\"\r\n BindToContext={[\r\n context,\r\n \"settings.one_check_up_sell.truncate_length\"\r\n ]}\r\n withSwitch={[context, \"settings.one_check_up_sell.truncate\"]}\r\n />\r\n </FormControl>\r\n\r\n <FormControl\r\n label=\"Product\"\r\n error={\r\n validationErrors[\"settings.one_check_up_sell.product.variants\"]\r\n }\r\n info={`Choose the product you want tick box to add to the cart.${!BREAK_POINTS[\"kill_draft\"](shopContext)\r\n ? \" Virtual products are invisible on your storefront, And existing products are not.\"\r\n : \"\"\r\n }`}\r\n isSingleCol\r\n >\r\n {!BREAK_POINTS[\"kill_draft\"](shopContext) && (\r\n <ButtonSelect\r\n options={ONE_CHECK_UP_SELL_PRODUCT_TYPE_OPTIONS}\r\n BindToContext={[\r\n context,\r\n \"settings.one_check_up_sell.product_type\"\r\n ]}\r\n first\r\n loading={[productsFetchLoading]}\r\n />\r\n )}\r\n <ShopifyResourcePicker\r\n allowMultiple={false}\r\n reducer={ONE_CHECK_UP_SELL_PRODUCT_REDUCER}\r\n BindToContext={[context, \"settings.one_check_up_sell.product\"]}\r\n >\r\n {(trigger) => (\r\n <Button\r\n className={classNames(\"w-full mt-3\")}\r\n text=\"Select a product\"\r\n type={\r\n validationErrors[\r\n \"settings.one_check_up_sell.product.variants\"\r\n ] &&\r\n !!validationErrors[\r\n \"settings.one_check_up_sell.product.variants\"\r\n ][0]\r\n ? \"danger\"\r\n : \"primary\"\r\n }\r\n onClick={() => {\r\n switch (campaign.settings.one_check_up_sell.product_type) {\r\n case \"existing\":\r\n return trigger();\r\n case \"hidden\":\r\n return setShowHiddenProductSelector(true);\r\n }\r\n }}\r\n />\r\n )}\r\n </ShopifyResourcePicker>\r\n </FormControl>\r\n <FormControl>\r\n <Summary campaign={context.state} />\r\n </FormControl>\r\n </FormGroup>\r\n <Modal\r\n visible={showHiddenProductSelector}\r\n title=\"Select Hidden product\"\r\n onClose={() => setShowHiddenProductSelector(false)}\r\n >\r\n {(close, setTitle) => (\r\n <Carousel\r\n onChange={(tab) =>\r\n setTitle(\r\n tab === 0\r\n ? \"Select a hidden product\"\r\n : \"Create a hidden product\"\r\n )\r\n }\r\n contents={[\r\n (setActiveTab) => (\r\n <FormControl label=\"Hidden Products\">\r\n <ProductSelector\r\n reducer={ONE_CHECK_UP_SELL_PRODUCT_REDUCER}\r\n products={hiddenProducts}\r\n BindToContext={[\r\n context,\r\n \"settings.one_check_up_sell.product\"\r\n ]}\r\n showCreate={() => setActiveTab(1)}\r\n />\r\n </FormControl>\r\n ),\r\n <Fragment>\r\n <FormControl label=\"select example product\">\r\n <ProductSelector\r\n presets={true}\r\n reducer={ONE_CHECK_UP_SELL_PRODUCT_REDUCER}\r\n products={PRESET_HIDDEN_PRODUCTS}\r\n // BindToContext={[context, 'settings.one_check_up_sell.product']}\r\n onChange={setProps}\r\n // showCreate={() => setActiveTab(1)}\r\n />\r\n </FormControl>\r\n <FormControl label=\"image\">\r\n <ImagePicker\r\n // type=\"image\"\r\n value={productImage}\r\n onChange={setProductImage}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Title\">\r\n <Input\r\n placeholder=\"Gift Wrapping\"\r\n value={productTitle}\r\n onChange={setProductTitle}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Price\">\r\n <Input\r\n placeholder=\"Price\"\r\n type=\"number\"\r\n value={productPrice}\r\n onChange={setProductPrice}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Description\">\r\n <RichEditor\r\n placeholder=\"Description\"\r\n value={bodyHtml}\r\n onChange={setBodyHtml}\r\n />\r\n </FormControl>\r\n </Fragment>\r\n ]}\r\n controlsPosition=\"bottom\"\r\n active={0}\r\n controls={[\r\n {\r\n text: \"Close\",\r\n type: \"secondary\",\r\n current: 0,\r\n next: () => close()\r\n },\r\n {\r\n text: hiddenProducts.length ? \"Cancel\" : \"Close\",\r\n type: \"secondary\",\r\n current: 1,\r\n next: (setActiveTab) =>\r\n hiddenProducts.length ? setActiveTab(0) : close()\r\n },\r\n {\r\n text: \"Create\",\r\n loading: newHiddenProductLoading,\r\n current: 1,\r\n disabled:\r\n productImage === \"\" ||\r\n productTitle === \"\" ||\r\n productPrice === \"\" ||\r\n bodyHtml === \"\",\r\n next: (setActiveTab) => createProduct(setActiveTab)\r\n }\r\n ]}\r\n />\r\n )}\r\n </Modal>\r\n </>\r\n );\r\n};\r\n\r\nexport default OneCheckUpSell;\r\n\r\nconst Summary = ({ campaign }) => {\r\n const {\r\n target,\r\n settings: { one_check_up_sell }\r\n } = campaign;\r\n const { product } = one_check_up_sell;\r\n if (!Object.keys(product || {}).length) return null;\r\n if (\r\n (target.type === \"specific_products\" && !target.selected.length) ||\r\n !product\r\n )\r\n return null;\r\n const must_truncated = (text) => text.length > 25;\r\n const truncate_name = (text) =>\r\n `\"${text.substring(0, 25).trim()}${must_truncated(text) ? \"...\" : \"\"}\"`;\r\n const product_name =\r\n target.type === \"specific_products\"\r\n ? truncate_name(target.selected[0].title)\r\n : \"any product\";\r\n if (!product.title) return null;\r\n\r\n return (\r\n <Alert type=\"info\" icon=\"info-circle\" title=\"campaign summary\">\r\n <p>\r\n {`If ${product_name} is on the cart, Then you can add \"${product.title\r\n .substring(0, 25)\r\n .trim()}\r\n\t\t\t\t\t${must_truncated(product.title) ? \"...\" : \"\"}\" with one tick.`}\r\n </p>\r\n </Alert>\r\n );\r\n};\r\n","import React, { Fragment, useState, useEffect, useContext } from \"react\";\r\nimport {\r\n FormGroup,\r\n FormControl,\r\n ShopifyResourcePicker,\r\n Button,\r\n ButtonSelect,\r\n Input,\r\n ProductSelector,\r\n ImagePicker,\r\n Modal,\r\n Carousel,\r\n RichEditor,\r\n Alert,\r\n ColorPicker,\r\n Dropdown\r\n} from \"components\";\r\nimport {\r\n ONE_CHECK_UP_SELL_PRODUCT_TYPE_OPTIONS,\r\n ONE_CHECK_UP_SELL_PRODUCT_REDUCER,\r\n CAMPAIGN_TYPES,\r\n BREAK_POINTS\r\n} from \"lib/globals\";\r\nimport { API } from \"aws-amplify\";\r\nimport styles from \"styles/campaign_settings_second_step.module.scss\";\r\nimport { CartContext } from \"components/cart\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport classNames from \"lib/classNames\";\r\nimport useRefState from \"hooks/useRefState\";\r\nimport EmbeddedContext from \"context/EmbeddedContext\";\r\n\r\nconst MultiOneCheckUpSell = ({ context, validationErrors }) => {\r\n const { state: campaign, setItem } = context;\r\n const { AppBridgeToast } = useContext(EmbeddedContext);\r\n const shopContext = useContext(ShopContext);\r\n const {\r\n state: {\r\n settings: { theme, rtl },\r\n currency\r\n }\r\n } = shopContext;\r\n const [hiddenProducts, setHiddenProducts] = useState([]);\r\n const newHiddenProductDefault = { title: \"\", image: \"\", price: \"\" };\r\n // const [newHiddenProduct, setNewHiddenProduct, newHiddenProductRef] = useRefState(newHiddenProductDefault);\r\n const [newHiddenProductLoading, setNewHiddenProductLoading] = useState(false);\r\n const [productsFetchLoading, setProductsFetchLoading] = useState(true);\r\n const [showHiddenProductSelector, setShowHiddenProductSelector] =\r\n useState(false);\r\n const [activeTab, setActiveTab] = useState(0);\r\n\r\n useEffect(() => {\r\n setProductsFetchLoading(true);\r\n API.get(\"API_GATEWAY_NEW\", \"/products\", {\r\n queryStringParameters: {\r\n type: \"hidden\",\r\n limit: 4\r\n }\r\n })\r\n .then(({ products }) => {\r\n setHiddenProducts(products);\r\n setProductsFetchLoading(false);\r\n })\r\n .catch(console.log);\r\n }, []);\r\n\r\n const products = campaign.settings.multi_one_check_upsell.products;\r\n const isSwitch = campaign.settings.multi_one_check_upsell.variant === \"switch\"\r\n return (\r\n <FormGroup\r\n label={CAMPAIGN_TYPES[\"one_check_up_sell\"]}\r\n info=\"Create a tick box that adds a little extra product to the cart.\"\r\n >\r\n <FormControl label=\"Variant\">\r\n <Dropdown\r\n options={[\r\n { value: \"switch\", label: \"Switch\" },\r\n { value: \"square\", label: \"Square\" },\r\n { value: \"circle\", label: \"Circle\" }\r\n ]}\r\n first\r\n BindToContext={[context, \"settings.multi_one_check_upsell.variant\"]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Align\"\r\n info=\"Align center works good with a single product\"\r\n >\r\n <Dropdown\r\n options={[\r\n { value: \"natural\", label: rtl ? \"Right\" : \"Left\" },\r\n { value: \"center\", label: \"Center\" }\r\n ]}\r\n first\r\n BindToContext={[context, \"settings.multi_one_check_upsell.align\"]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Border\"\r\n isSingleCol\r\n withSwitch={[context, \"settings.multi_one_check_upsell.border\"]}\r\n />\r\n <FormControl label=\"Colors\">\r\n <ColorPicker\r\n text=\"Highlight\"\r\n BindToContext={[\r\n context,\r\n \"settings.multi_one_check_upsell.highlight\"\r\n ]}\r\n />\r\n <ColorPicker\r\n text=\"Border\"\r\n BindToContext={[\r\n context,\r\n \"settings.multi_one_check_upsell.border_color\"\r\n ]}\r\n />\r\n {isSwitch && (\r\n <ColorPicker\r\n text=\"Switch ON\"\r\n disableAlpha\r\n BindToContext={[\r\n context,\r\n \"settings.multi_one_check_upsell.switch_on\"\r\n ]}\r\n />\r\n )}\r\n {isSwitch && (\r\n <ColorPicker\r\n text=\"Switch OFF\"\r\n disableAlpha\r\n BindToContext={[\r\n context,\r\n \"settings.multi_one_check_upsell.switch_off\"\r\n ]}\r\n />\r\n )}\r\n </FormControl>\r\n {products.map((product, index) => (\r\n <div\r\n key={`product_${index}`}\r\n className={classNames(\"mb-5 p-4 rounded bg-white relative\")}\r\n >\r\n {products.length > 1 && index !== 0 && (\r\n <Button\r\n className={classNames(\r\n \"absolute top-0 right-0 -translate-y-1/2 transform translate-x-1/2\"\r\n )}\r\n icon=\"times\"\r\n type=\"circle-danger\"\r\n onClick={() => context.deleteOneCheckUpsellProduct(index)}\r\n />\r\n )}\r\n <FormControl\r\n label=\"Ticked by default\"\r\n info=\"When campaign is active it will auto tick the box and add one tick upsell product to the cart.\"\r\n withSwitch={[\r\n context,\r\n `settings.multi_one_check_upsell.products.${index}.is_ticked_by_default`\r\n ]}\r\n disabled\r\n >\r\n <div>\r\n <a\r\n href=\"https://monsterapps.crisp.help/en/article/auto-select-tick-box-deprecated-15wrgud/\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className={classNames(\"underline text-sm font-medium\")}\r\n >\r\n Learn more\r\n </a>\r\n </div>\r\n {/* <div className={classNames(\"border border-orange-100 rounded-lg p-4 mt-2 mb-6\")} style={{ backgroundColor: \"#FFF2E2\" }}>\r\n <div className={classNames(\"flex\")}>\r\n <div className={classNames(\"flex-shrink-0\")}>\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 16 16\" className={classNames(\"h-5 w-5\")}>\r\n <path d=\"M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566M8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5m.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2\" />\r\n </svg>\r\n </div>\r\n <div className={classNames(\"ml-3\")}>\r\n <h3 className={classNames(\"text-sm font-medium\")}>\r\n We have removed \"Ticked by default\"\r\n </h3>\r\n <div className={classNames(\"mt-1 text-sm\")}>\r\n <p>\r\n To provide more trustworthy buyer experiences, Shopify is prohibiting apps from automatically adding non-free items. Buyers will need to explicitly accept add-ons by clicking the toggle. To learn more, see{' '}\r\n <a \r\n href=\"https://shopify.dev/docs/apps/launch/app-requirements-checklist#1-prohibited-and-restricted-app-configurations\"\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n className={classNames(\"underline\")}\r\n >\r\n Section 1.19\r\n </a>\r\n {' '}of Shopify's app requirements.\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n </div> */}\r\n </FormControl>\r\n <FormControl\r\n label=\"Include in add to unlock goal\"\r\n info=\"The one tick product amount will count towards Add To Unlock reward goals.\"\r\n withSwitch={[\r\n context,\r\n `settings.multi_one_check_upsell.products.${index}.include_in_atu`\r\n ]}\r\n >\r\n <div></div>\r\n </FormControl>\r\n <FormControl label=\"Text\">\r\n <RichEditor\r\n placeholder=\"Enter your sold here!\"\r\n BindToContext={[\r\n context,\r\n `settings.multi_one_check_upsell.products.${index}.text`\r\n ]}\r\n indicator=\"You can use {{title}} {{price}}\"\r\n error={productError(validationErrors, index)}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Limit product name length\">\r\n <Input\r\n // onFocus={() => setEditingProductDetails(true)}\r\n // onBlur={() => setEditingProductDetails(false)}\r\n type=\"number\"\r\n placeholder=\"Characters length\"\r\n BindToContext={[\r\n context,\r\n `settings.multi_one_check_upsell.products.${index}.truncate_length`\r\n ]}\r\n withSwitch={[\r\n context,\r\n `settings.multi_one_check_upsell.products.${index}.truncate`\r\n ]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Product\"\r\n error={productError(validationErrors, index)}\r\n info={`Choose the product you want tick box to add to the cart.${!BREAK_POINTS[\"kill_draft\"](shopContext)\r\n ? \" Virtual products are invisible on your storefront, And existing products are not.\"\r\n : \"\"\r\n }`}\r\n isSingleCol\r\n >\r\n {!BREAK_POINTS[\"kill_draft\"](shopContext) && (\r\n <ButtonSelect\r\n options={ONE_CHECK_UP_SELL_PRODUCT_TYPE_OPTIONS}\r\n BindToContext={[\r\n context,\r\n `settings.multi_one_check_upsell.products.${index}.product_type`\r\n ]}\r\n first\r\n loading={[productsFetchLoading]}\r\n />\r\n )}\r\n <ShopifyResourcePicker\r\n allowMultiple={false}\r\n reducer={ONE_CHECK_UP_SELL_PRODUCT_REDUCER}\r\n verifySelection={([{ id, title }]) => {\r\n id = id.replace(\"gid://shopify/Product/\", \"\");\r\n const exists = products\r\n .filter(({ product }) => !!product)\r\n .find(({ product }) => id === product.id);\r\n if (exists) {\r\n AppBridgeToast({\r\n message: `\"${title}\" is already selected`,\r\n isError: true\r\n }).open();\r\n }\r\n return !exists;\r\n }}\r\n BindToContext={[\r\n context,\r\n `settings.multi_one_check_upsell.products.${index}.product`\r\n ]}\r\n >\r\n {(trigger) => (\r\n <Button\r\n className={classNames(\"w-full mt-3\")}\r\n text=\"Select a product\"\r\n type={\r\n productError(validationErrors, index)\r\n ? \"danger\"\r\n : \"primary\"\r\n }\r\n onClick={() => {\r\n switch (product.product_type) {\r\n case \"existing\":\r\n return trigger();\r\n case \"hidden\":\r\n return setShowHiddenProductSelector(true);\r\n }\r\n }}\r\n />\r\n )}\r\n </ShopifyResourcePicker>\r\n </FormControl>\r\n <FormControl>\r\n <Summary campaign={context.state} product={product.product} />\r\n </FormControl>\r\n </div>\r\n ))}\r\n <FormControl>\r\n <div>\r\n <Button\r\n text={\r\n products.length < 4\r\n ? \"+ Add another product\"\r\n : \"Only 3 products are available\"\r\n }\r\n onClick={context.newOneCheckUpsellProduct}\r\n style={{ width: \"100%\" }}\r\n disabled={products.length >= 3}\r\n />\r\n </div>\r\n </FormControl>\r\n </FormGroup>\r\n );\r\n};\r\n\r\nexport default MultiOneCheckUpSell;\r\n\r\nconst Summary = ({ campaign, product }) => {\r\n const { target } = campaign;\r\n if (!Object.keys(product || {}).length) return null;\r\n if (\r\n (target.type === \"specific_products\" && !target.selected.length) ||\r\n !product\r\n )\r\n return null;\r\n const must_truncated = (text) => text.length > 25;\r\n const truncate_name = (text) =>\r\n `${text.substring(0, 25).trim()}${must_truncated(text) ? \"...\" : \"\"}\"`;\r\n const product_name =\r\n target.type === \"specific_products\"\r\n ? truncate_name(target.selected[0].title)\r\n : \"any product\";\r\n if (!product.title) return null;\r\n\r\n return (\r\n <Alert\r\n customStyle={{ box: \"bg-gray-200\" }}\r\n t\r\n type=\"info\"\r\n icon=\"info-circle\"\r\n title=\"campaign summary\"\r\n >\r\n <p>\r\n {`If ${product_name} is on the cart, Then you can add \"${product.title\r\n .substring(0, 25)\r\n .trim()}\r\n\t\t\t\t\t${must_truncated(product.title) ? \"...\" : \"\"}\" with one tick.`}\r\n </p>\r\n </Alert>\r\n );\r\n};\r\n\r\nfunction productError (validationErrors, index) {\r\n const products = validationErrors[`settings.multi_one_check_upsell.products`];\r\n return products && products[index] ? products[index][\"product.id\"] : false;\r\n}\r\n","import React from 'react';\r\nimport { Button, Icon, Switch, FormGroup, FormControl } from 'components';\r\nimport styles from 'styles/campaign_settings_second_step.module.scss';\r\nimport ExtraModules from './ExtraModules/index';\r\nimport GeoTargeting from './GeoTargeting';\r\nimport { AddToUnlock, Bundles, OneCheckUpSell, MultiOneCheckUpSell } from './Types';\r\n\r\nconst SecondStep = ({\r\n context,\r\n setActiveTab,\r\n stickyHeaderPosition: headerPosition,\r\n stickyHeader,\r\n setShowATUAfterText,\r\n shopContext\r\n}) => {\r\n const { state: campaign, setItem, validationErrors } = context;\r\n const is_OCU = campaign.settings.type === 'one_check_up_sell';\r\n const isOld_OCU = is_OCU && !campaign.settings.multi_one_check_upsell;\r\n return (\r\n <>\r\n {campaign.settings.type === 'bundles' && (\r\n <Bundles {...{ context, shopContext, validationErrors }} />\r\n )}\r\n {campaign.settings.type === 'add_to_unlock' && (\r\n <AddToUnlock {...{ context, validationErrors, setShowATUAfterText }} />\r\n )}\r\n {isOld_OCU && <OneCheckUpSell {...{ context, validationErrors }} />}\r\n {is_OCU && !isOld_OCU && <MultiOneCheckUpSell {...{ context, validationErrors }} />}\r\n {campaign.settings.type && (\r\n <>\r\n <GeoTargeting context={context} />\r\n <ExtraModules context={context} hasCheckout={false} />\r\n </>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport default SecondStep;\r\n","const removeTypeName = (value) => {\r\n\tif (value === null || value === undefined) {\r\n\t\treturn value;\r\n\t} else if (Array.isArray(value)) {\r\n\t\treturn value.map((v) => removeTypeName(v));\r\n\t} else if (typeof value === 'object') {\r\n\t\tconst newObj = {};\r\n\t\tObject.entries(value).forEach(([key, v]) => {\r\n\t\t\tif (key !== '__typename') {\r\n\t\t\t\tnewObj[key] = removeTypeName(v);\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn newObj;\r\n\t}\r\n\treturn value;\r\n};\r\n\r\nexport const removeByType = (value, condition = (v) => typeof v !== 'undefined') => {\r\n\tif (Array.isArray(value)) {\r\n\t\treturn value.map((v) => removeByType(v, condition));\r\n\t} else if (Object.prototype.toString.call(value) === '[object Object]') {\r\n\t\tconst newObj = {};\r\n\t\tObject.entries(value).forEach(([key, v]) => {\r\n\t\t\tif (condition(v)) {\r\n\t\t\t\tnewObj[key] = removeByType(v, condition);\r\n\t\t\t}\r\n\t\t});\r\n\t\treturn newObj;\r\n\t}\r\n\treturn value;\r\n};\r\n\r\nexport const removeFalsyErrors = (value) => {\r\n\tif (value === null || value === undefined) {\r\n\t\treturn value;\r\n\t} else if (Array.isArray(value)) {\r\n\t\treturn value.map((v) => removeFalsyErrors(v));\r\n\t} else if (typeof value === 'object') {\r\n\t\tconst newObj = {};\r\n\t\tObject.entries(value).forEach(([key, v]) => {\r\n\t\t\tif (!!v && !isFalsyArray(v)) newObj[key] = removeFalsyErrors(v);\r\n\t\t});\r\n\t\treturn Object.keys(newObj).length ? newObj : null;\r\n\t}\r\n\treturn value;\r\n};\r\n\r\nconst isFalsy = (value) => Number.isInteger(value) && value < 1;\r\n\r\nconst isFalsyArray = (array) => array.every(isFalsy);\r\n\r\nexport default removeTypeName;\r\n","import validate, { capitalize, isString } from 'validate.js/validate';\r\nimport { removeByType, removeFalsyErrors } from 'lib/removeTypeName';\r\nimport { Collection, getIn } from 'immutable';\r\n\r\nvalidate.validators.array = (arrayItems, itemConstraints, key, attributes) => {\r\n\tconst { isRequired, fieldName, ...constraints } = itemConstraints;\r\n\tif (isRequired === false && !arrayItems) return null;\r\n\tif (isRequired === true && !arrayItems.length) return `^A ${fieldName || ''} is required`;\r\n\tif (typeof isRequired === 'string' && RegExp('if:(.*)').test(isRequired)) {\r\n\t\tconst rules = isRequired\r\n\t\t\t.split(':')[1]\r\n\t\t\t.split(',')\r\n\t\t\t.reduce((acc, cur) => {\r\n\t\t\t\tconst [path, value] = cur.split('=');\r\n\t\t\t\ttry {\r\n\t\t\t\t\tacc[path] = JSON.parse(value);\r\n\t\t\t\t} catch {\r\n\t\t\t\t\tacc[path] = value;\r\n\t\t\t\t}\r\n\t\t\t\treturn acc;\r\n\t\t\t}, {});\r\n\t\tif (\r\n\t\t\tObject.entries(rules)\r\n\t\t\t\t.map(([path, value]) => {\r\n\t\t\t\t\treturn getIn(attributes, path.split('.')) === value;\r\n\t\t\t\t})\r\n\t\t\t\t.every((entry) => entry === true) &&\r\n\t\t\t!(arrayItems || []).length\r\n\t\t)\r\n\t\t\treturn `^${fieldName || ''} is required`;\r\n\t}\r\n\tconst arrayItemErrors = (arrayItems || []).reduce((errors, item, index) => {\r\n\t\tconst error = validate(isString(item) ? { value: item } : item, constraints);\r\n\t\t//if error is undefined we return a unique falsy variable because validate js will make the errors array unique and we'll lose errors order\r\n\t\terrors[index] = error || -index;\r\n\t\treturn errors;\r\n\t}, []);\r\n\treturn arrayItemErrors.length ? arrayItemErrors : null;\r\n};\r\n\r\nvalidate.validators.color = function (value) {\r\n\tconst isRGBA = ['rgba', 'rgba__typename', 'abgr'].includes(Object.keys(value).join(''));\r\n\tif (!isRGBA) return 'must be an rgba object';\r\n\r\n\tconst rules = {\r\n\t\tr: (int) => Number.isInteger(int) && int >= 0 && int <= 255,\r\n\t\tg: (int) => Number.isInteger(int) && int >= 0 && int <= 255,\r\n\t\tb: (int) => Number.isInteger(int) && int >= 0 && int <= 255,\r\n\t\ta: (float) => typeof float === 'number' && float >= 0 && float <= 1,\r\n\t};\r\n\tconst valuesAreValid = Object.entries(value).reduce((acc, [key, val]) => {\r\n\t\tif (key === '__typename') return acc;\r\n\t\tacc += rules[key](val) ? 0 : -1;\r\n\t\treturn acc;\r\n\t}, 0);\r\n\treturn valuesAreValid < 0 ? 'is not valid' : null;\r\n};\r\n\r\nexport const Field = ({ required, min, max, inArray, type, name, debug } = {}) => {\r\n\tconst output = removeByType({\r\n\t\tpresence: Value(required)({\r\n\t\t\tallowEmpty: false,\r\n\t\t\tmessage: Value(name)(`^${capitalize(name)} can't be blank`),\r\n\t\t}),\r\n\t\tlength: Value(type === 'string' && (min || max))({\r\n\t\t\tminimum: required ? min || 1 : 0,\r\n\t\t\ttooShort: Value(min && name)(`${capitalize(name)} is too short (minimum is ${min} characters)`),\r\n\t\t\tmaximum: max,\r\n\t\t\ttooLong: Value(max && name)(`${capitalize(name)} is too long (maximum is ${max} characters)`),\r\n\t\t}),\r\n\t\tinclusion: Value(inArray)({\r\n\t\t\twithin: inArray,\r\n\t\t\tmessage: Value(name)(`^${capitalize(name)} value is not valid`),\r\n\t\t}),\r\n\t\tnumericality: Value(['integer', 'float'].includes(type))({\r\n\t\t\tonlyInteger: type === 'integer',\r\n\t\t\tgreaterThanOrEqualTo: Value(min)(),\r\n\t\t\tlessThanOrEqualTo: Value(max)(),\r\n\t\t\tstrict: true,\r\n\t\t\tnotValid: Value(name)(`^${capitalize(name)} value is not valid`, `must be a valid ${type}`),\r\n\t\t\tnotGreaterThanOrEqualTo: Value(name)(`^${capitalize(name)} must be greater than or equal to ${min}`),\r\n\t\t\tnotLessThanOrEqualTo: Value(name)(`^${capitalize(name)} must be less than or equal to ${max}`),\r\n\t\t}),\r\n\t\ttype: type !== 'float' ? type : undefined,\r\n\t\t// type: Value(type && type !== 'float', type),\r\n\t});\r\n\tif (!!debug) console.log(output);\r\n\treturn output;\r\n};\r\nconst Value = (condition) => (value = condition, defaultValue = undefined) => (!!condition ? value : defaultValue);\r\n\r\nexport const Integer = ({ required = true, ...options } = {}) => Field({ required, type: 'integer', ...options });\r\nexport const Float = ({ required = true, ...options } = {}) => Field({ required, type: 'float', ...options });\r\nexport const Text = ({ required = true, ...options } = {}) => Field({ required, type: 'string', ...options });\r\nexport const Bool = ({ required = true, ...options } = {}) => Field({ required, type: 'boolean', ...options });\r\nexport const Num = ({ required = true, ...options } = {}) => Field({ required, type: 'number', ...options });\r\n\r\nexport const Run = (state, specific, { errors, setErrors, constraints }, silent = false) => {\r\n\tlet filteredConstraints = Collection(constraints)\r\n\t\t.filter((value, key) => (specific.length ? specific.includes(key) : true))\r\n\t\t.toObject();\r\n\tlet newErrors = validate(state, filteredConstraints);\r\n\tlet oldErrors = Object.assign({}, errors);\r\n\tlet outputErrors = newErrors;\r\n\tif (specific.length && Object.keys(oldErrors).length) {\r\n\t\tObject.keys(oldErrors).forEach((key) => {\r\n\t\t\tif ((!newErrors && specific.includes(key)) || !specific.includes(key)) {\r\n\t\t\t\t//no errors, we should remove the specified keys from old errors\r\n\t\t\t\tdelete oldErrors[key];\r\n\t\t\t} else if (specific.includes(key) && !!newErrors[key]) {\r\n\t\t\t\t// new errors, we should replace old errors with new ones\r\n\t\t\t\toldErrors[key] = newErrors[key];\r\n\t\t\t}\r\n\t\t});\r\n\t\toutputErrors = oldErrors;\r\n\t}\r\n\tif (!silent) setErrors(outputErrors || {});\r\n\treturn removeFalsyErrors(outputErrors);\r\n};\r\n\r\nexport default validate;\r\n","var _title, _circle, _path, _polygon, _path2, _polygon2, _ellipse, _ellipse2, _ellipse3, _ellipse4, _circle2, _rect, _rect2, _ellipse5, _ellipse6, _circle3, _circle4, _path3, _path4, _path5, _circle5, _rect3, _rect4, _ellipse7, _ellipse8, _circle6, _circle7, _path6, _path7, _path8, _path9, _path10, _ellipse9, _ellipse10;\n\nvar _excluded = [\"svgRef\", \"title\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar SvgNotFound = function SvgNotFound(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"a706cf1c-1654-439b-8fcf-310eb7aa0e00\",\n \"data-name\": \"Layer 1\",\n width: 1120.59226,\n height: 777.91584,\n viewBox: \"0 0 1120.59226 777.91584\",\n ref: svgRef\n }, props), title === undefined ? _title || (_title = /*#__PURE__*/React.createElement(\"title\", null, \"not found\")) : title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 212.59226,\n cy: 103,\n r: 64,\n fill: \"#ff6584\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M563.68016,404.16381c0,151.01141-89.77389,203.73895-200.51559,203.73895S162.649,555.17522,162.649,404.16381,363.16457,61.04208,363.16457,61.04208,563.68016,253.1524,563.68016,404.16381Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#f2f2f2\"\n })), _polygon || (_polygon = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"316.156 523.761 318.21 397.378 403.674 241.024 318.532 377.552 319.455 320.725 378.357 207.605 319.699 305.687 319.699 305.687 321.359 203.481 384.433 113.423 321.621 187.409 322.658 0 316.138 248.096 316.674 237.861 252.547 139.704 315.646 257.508 309.671 371.654 309.493 368.625 235.565 265.329 309.269 379.328 308.522 393.603 308.388 393.818 308.449 394.99 293.29 684.589 313.544 684.589 315.974 535.005 389.496 421.285 316.156 523.761\",\n fill: \"#3f3d56\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1160.29613,466.01367c0,123.61-73.4842,166.77-164.13156,166.77s-164.13156-43.16-164.13156-166.77S996.16457,185.15218,996.16457,185.15218,1160.29613,342.40364,1160.29613,466.01367Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#f2f2f2\"\n })), _polygon2 || (_polygon2 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"950.482 552.833 952.162 449.383 1022.119 321.4 952.426 433.154 953.182 386.639 1001.396 294.044 953.382 374.329 953.382 374.329 954.741 290.669 1006.369 216.952 954.954 277.514 955.804 124.11 950.467 327.188 950.906 318.811 898.414 238.464 950.064 334.893 945.173 428.327 945.027 425.847 884.514 341.294 944.844 434.608 944.232 446.293 944.123 446.469 944.173 447.428 931.764 684.478 948.343 684.478 950.332 562.037 1010.514 468.952 950.482 552.833\",\n fill: \"#3f3d56\"\n })), _ellipse || (_ellipse = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 554.59226,\n cy: 680.47903,\n rx: 554.59226,\n ry: 28.03433,\n fill: \"#3f3d56\"\n })), _ellipse2 || (_ellipse2 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 892.44491,\n cy: 726.79663,\n rx: 94.98858,\n ry: 4.80162,\n fill: \"#3f3d56\"\n })), _ellipse3 || (_ellipse3 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 548.71959,\n cy: 773.11422,\n rx: 94.98858,\n ry: 4.80162,\n fill: \"#3f3d56\"\n })), _ellipse4 || (_ellipse4 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 287.94432,\n cy: 734.27887,\n rx: 217.01436,\n ry: 10.96996,\n fill: \"#3f3d56\"\n })), _circle2 || (_circle2 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 97.08375,\n cy: 566.26982,\n r: 79,\n fill: \"#2f2e41\"\n })), _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n x: 99.80546,\n y: 689.02332,\n width: 24,\n height: 43,\n transform: \"translate(-31.32451 -62.31008) rotate(0.67509)\",\n fill: \"#2f2e41\"\n })), _rect2 || (_rect2 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 147.80213,\n y: 689.58887,\n width: 24,\n height: 43,\n transform: \"translate(-31.31452 -62.87555) rotate(0.67509)\",\n fill: \"#2f2e41\"\n })), _ellipse5 || (_ellipse5 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 119.54569,\n cy: 732.61606,\n rx: 7.5,\n ry: 20,\n transform: \"translate(-654.1319 782.47948) rotate(-89.32491)\",\n fill: \"#2f2e41\"\n })), _ellipse6 || (_ellipse6 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 167.55414,\n cy: 732.18168,\n rx: 7.5,\n ry: 20,\n transform: \"translate(-606.25475 830.05533) rotate(-89.32491)\",\n fill: \"#2f2e41\"\n })), _circle3 || (_circle3 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 99.31925,\n cy: 546.29477,\n r: 27,\n fill: \"#fff\"\n })), _circle4 || (_circle4 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 99.31925,\n cy: 546.29477,\n r: 9,\n fill: \"#3f3d56\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M61.02588,552.94636c-6.04185-28.64075,14.68758-57.26483,46.30049-63.93367s62.13813,11.14292,68.18,39.78367-14.97834,38.93-46.59124,45.59886S67.06774,581.58712,61.02588,552.94636Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#536dfe\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M257.29613,671.38411c0,55.07585-32.73985,74.3063-73.13,74.3063q-1.40351,0-2.80255-.0312c-1.87139-.04011-3.72494-.1292-5.55619-.254-36.45135-2.57979-64.77127-22.79937-64.77127-74.02113,0-53.00843,67.73872-119.89612,72.827-124.84633l.00892-.00889c.19608-.19159.29409-.28516.29409-.28516S257.29613,616.30827,257.29613,671.38411Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#536dfe\"\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M181.50168,737.26482l26.747-37.37367-26.81386,41.4773-.07125,4.29076c-1.87139-.04011-3.72494-.1292-5.55619-.254l2.88282-55.10258-.0223-.42775.049-.0802.27179-5.20415-26.88076-41.5798,26.96539,37.67668.06244,1.105,2.17874-41.63324-23.0132-42.96551,23.29391,35.6583,2.26789-86.31419.00892-.294v.28516l-.37871,68.064,22.91079-26.98321-23.00435,32.84678-.60595,37.27566L204.18523,621.958l-21.4805,41.259-.33863,20.723,31.05561-49.79149-31.17146,57.023Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#3f3d56\"\n })), _circle5 || (_circle5 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 712.48505,\n cy: 565.41532,\n r: 79,\n fill: \"#2f2e41\"\n })), _rect3 || (_rect3 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 741.77716,\n y: 691.82355,\n width: 24,\n height: 43,\n transform: \"translate(-215.99457 191.86399) rotate(-17.08345)\",\n fill: \"#2f2e41\"\n })), _rect4 || (_rect4 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 787.6593,\n y: 677.72286,\n width: 24,\n height: 43,\n transform: \"matrix(0.95588, -0.29376, 0.29376, 0.95588, -209.82788, 204.72037)\",\n fill: \"#2f2e41\"\n })), _ellipse7 || (_ellipse7 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 767.887,\n cy: 732.00275,\n rx: 20,\n ry: 7.5,\n transform: \"translate(-220.8593 196.83312) rotate(-17.08345)\",\n fill: \"#2f2e41\"\n })), _ellipse8 || (_ellipse8 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 813.47537,\n cy: 716.94619,\n rx: 20,\n ry: 7.5,\n transform: \"translate(-214.42477 209.56103) rotate(-17.08345)\",\n fill: \"#2f2e41\"\n })), _circle6 || (_circle6 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 708.52153,\n cy: 545.71023,\n r: 27,\n fill: \"#fff\"\n })), _circle7 || (_circle7 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 708.52153,\n cy: 545.71023,\n r: 9,\n fill: \"#3f3d56\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M657.35526,578.74316c-14.48957-25.43323-3.47841-59.016,24.59412-75.0092s62.57592-8.34055,77.06549,17.09268-2.39072,41.6435-30.46325,57.63671S671.84483,604.17639,657.35526,578.74316Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#536dfe\"\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M611.29613,661.29875c0,50.55711-30.05368,68.20979-67.13,68.20979q-1.28835,0-2.57261-.02864c-1.71785-.03682-3.41933-.1186-5.10033-.23313-33.46068-2.36813-59.45707-20.92878-59.45707-67.948,0-48.65932,62.18106-110.05916,66.85186-114.60322l.00819-.00817c.18-.17587.27-.26177.27-.26177S611.29613,610.74164,611.29613,661.29875Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#536dfe\"\n })), _path8 || (_path8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M541.72029,721.77424l24.55253-34.30732-24.6139,38.07426-.0654,3.93872c-1.71785-.03682-3.41933-.1186-5.10033-.23313l2.6463-50.58165-.02047-.39266.045-.07361.24949-4.77718-24.67531-38.16836,24.753,34.58547.05731,1.01433,2-38.21741-21.12507-39.44039L541.80616,625.928l2.08182-79.23247.00819-.26994v.26177l-.34764,62.47962,21.031-24.76934-21.11693,30.15184-.55624,34.21735,19.63634-32.839-19.71812,37.87389-.31085,19.0228,28.50763-45.70631-28.614,52.34448Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#3f3d56\"\n })), _path9 || (_path9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M875.29613,682.38411c0,55.07585-32.73985,74.3063-73.13,74.3063q-1.4035,0-2.80255-.0312c-1.87139-.04011-3.72494-.1292-5.55619-.254-36.45135-2.57979-64.77127-22.79937-64.77127-74.02113,0-53.00843,67.73872-119.89612,72.827-124.84633l.00892-.00889c.19608-.19159.29409-.28516.29409-.28516S875.29613,627.30827,875.29613,682.38411Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#536dfe\"\n })), _path10 || (_path10 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M799.50168,748.26482l26.747-37.37367-26.81386,41.4773-.07125,4.29076c-1.87139-.04011-3.72494-.1292-5.55619-.254l2.88282-55.10258-.0223-.42775.049-.0802.27179-5.20415L770.108,654.01076l26.96539,37.67668.06244,1.105,2.17874-41.63324-23.0132-42.96551,23.29391,35.6583,2.26789-86.31419.00892-.294v.28516l-.37871,68.064,22.91079-26.98321-23.00435,32.84678-.606,37.27566L822.18523,632.958l-21.4805,41.259-.33863,20.723,31.05561-49.79149-31.17146,57.023Z\",\n transform: \"translate(-39.70387 -61.04208)\",\n fill: \"#3f3d56\"\n })), _ellipse9 || (_ellipse9 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 721.51694,\n cy: 656.82212,\n rx: 12.40027,\n ry: 39.5,\n transform: \"translate(-220.83517 966.22323) rotate(-64.62574)\",\n fill: \"#2f2e41\"\n })), _ellipse10 || (_ellipse10 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 112.51694,\n cy: 651.82212,\n rx: 12.40027,\n ry: 39.5,\n transform: \"translate(-574.07936 452.71367) rotate(-68.15829)\",\n fill: \"#2f2e41\"\n })));\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgNotFound, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/not_found.71c89504.svg\";\nexport { ForwardRef as ReactComponent };","import { Integer, Text, Bool, Num, Float } from 'lib/validate';\r\n\r\nconst bundle = {\r\n id: Text(),\r\n type: Text({ inArray: ['percentage', 'fixed_amount'] }),\r\n quantity: Integer({ min: 1 }),\r\n reward: Num()\r\n};\r\n\r\nconst bundles = {\r\n 'settings.bundles.text': Text({ max: 55, name: 'offer description' }),\r\n 'settings.bundles.prefix': Text({ max: 45, name: 'pricing' }),\r\n 'settings.bundles.font_size': Float({ min: 0.5, max: 2, name: 'font size' }),\r\n 'settings.bundles.background': { color: true },\r\n 'settings.bundles.color': { color: true },\r\n 'settings.bundles.activeBackground': { color: true },\r\n 'settings.bundles.activeColor': { color: true },\r\n 'settings.bundles.list': { array: bundle }\r\n};\r\n\r\nconst add_to_unlock_product = {\r\n isRequired:\r\n 'if:settings.type=add_to_unlock,settings.add_to_unlock.show_suggestions=true,settings.add_to_unlock.recommendation_type=custom_recommendation',\r\n fieldName: 'suggested product',\r\n id: Text(),\r\n title: Text(),\r\n handle: Text(),\r\n image: Text({ required: false })\r\n};\r\n\r\nconst specific_goal = {\r\n currency: Text({ name: 'goal currency' }),\r\n goal: Num({ name: 'spend goal' })\r\n};\r\n\r\nconst add_to_unlock_goal = {\r\n reward_type: Text({\r\n name: 'reward type',\r\n inArray: ['discount', 'free_shipping', 'manual', 'gift']\r\n }),\r\n goal: Num({ name: 'spend goal', required: false }),\r\n specific_goals: { array: specific_goal },\r\n goal_type: Text({ inArray: ['relative', 'fixed'] }),\r\n 'goal_text.text': Text({ max: 35, min: 3, name: 'text' }),\r\n 'goal_text.font_size': Float({ max: 1.2, min: 0.5, name: 'font size' }),\r\n 'goal_text.color': { color: true },\r\n show_goal_text: Bool({ name: 'show goal text' }),\r\n confetti: Bool({ name: 'Confetti' }),\r\n confetti_length: Num({ name: 'Confetti count', min: 200, max: 600 }),\r\n 'discount.before': Text({ name: 'text before', max: 600 }),\r\n 'discount.type': Text({ name: 'discount type', inArray: ['percentage', 'fixed_amount'] }),\r\n 'discount.after': Text({ name: 'text after', max: 600 }),\r\n 'discount.reward': Num({ name: 'reward' }),\r\n\r\n 'free_shipping.before': Text({ name: 'text before', max: 600 }),\r\n 'free_shipping.after': Text({ name: 'text after', max: 600 }),\r\n 'free_shipping.manual': Bool({ required: false, name: 'free shipping offer handler' }),\r\n\r\n 'manual.before': Text({ name: 'text before', max: 600 }),\r\n 'manual.after': Text({ name: 'text after', max: 600 })\r\n};\r\n\r\nconst add_to_unlock = {\r\n 'settings.add_to_unlock.title.text': Text({ max: 40, min: 3, name: 'text' }),\r\n 'settings.add_to_unlock.title.font_size': Float({ min: 0.5, max: 2, name: 'font size' }),\r\n 'settings.add_to_unlock.title.color': { color: true },\r\n\r\n 'settings.add_to_unlock.background': { color: true },\r\n 'settings.add_to_unlock.borderColor': { color: true },\r\n\r\n 'settings.add_to_unlock.show_product_details.text': Text({ max: 30, min: 3, name: 'text' }),\r\n 'settings.add_to_unlock.show_product_details.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.add_to_unlock.show_product_details.color': { color: true },\r\n\r\n 'settings.add_to_unlock.upsell_add_button.text': Text({ max: 40, min: 3, name: 'text' }),\r\n // 'settings.add_to_unlock.upsell_add_button.color': { color: true },\r\n 'settings.add_to_unlock.upsell_add_button.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.add_to_unlock.show_suggestions': Bool({ name: 'Show suggestions' }),\r\n\r\n 'settings.add_to_unlock.upsell_confirm_button.text': Text({ max: 40, min: 3, name: 'text' }),\r\n 'settings.add_to_unlock.upsell_confirm_button.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n\r\n //TODO: validate shopify product-\r\n 'settings.add_to_unlock.products': { array: add_to_unlock_product },\r\n\r\n 'settings.add_to_unlock.goals': { array: add_to_unlock_goal },\r\n\r\n 'settings.add_to_unlock.separator.active': Bool({ name: 'separator active' }),\r\n 'settings.add_to_unlock.separator.text': Text({ max: 50, name: 'separator text' }),\r\n 'settings.add_to_unlock.isActive': Bool({ name: 'enable progress bar' })\r\n};\r\n\r\nconst one_check_up_sell_product_options = {\r\n values: {\r\n array: {\r\n value: Text()\r\n }\r\n }\r\n};\r\nconst one_check_up_sell_product_variants = {\r\n isRequired: 'if:settings.type=one_check_up_sell',\r\n fieldName: 'one tick upsell product',\r\n id: Text(),\r\n title: Text(),\r\n price: Text(),\r\n image: Text({ required: false })\r\n};\r\n\r\nconst one_check_up_sell_product = {\r\n 'product.id': Text({ required: false }),\r\n 'product.title': Text({ required: false }),\r\n 'product.handle': Text({ required: false }),\r\n 'product.variant_id': Text({ required: false }),\r\n 'product.image': Text({ required: false }),\r\n 'product.variants': { array: one_check_up_sell_product_variants }\r\n // 'settings.one_check_up_sell.product.options': { array: one_check_up_sell_product_options },\r\n};\r\n\r\nconst one_check_up_sell = {\r\n is_ticked_by_default: Bool({ required: false }),\r\n include_in_atu: Bool({ required: false }),\r\n text: Text({ required: true, name: 'text', max: 250 }),\r\n product_type: Text({\r\n inArray: ['existing', 'hidden']\r\n }),\r\n ...one_check_up_sell_product\r\n};\r\n\r\nconst multi_one_check_upsell = {\r\n 'settings.multi_one_check_upsell.products': {\r\n array: one_check_up_sell\r\n }\r\n};\r\n\r\nexport const modules = {\r\n 'settings.modules.order': {\r\n array: {\r\n value: Text({ inArray: ['order_note', 'random_text', 'checkout_button'] })\r\n }\r\n },\r\n 'settings.modules.random_text.text': Text({ max: 6000 }),\r\n 'settings.modules.random_text.active': Bool()\r\n // 'settings.modules.order_note.text': Text({ max: 300, required: false }),\r\n // 'settings.modules.order_note.active': Bool(),\r\n};\r\n\r\nconst settings = {\r\n 'settings.type': Text({\r\n inArray: ['bundles', 'add_to_unlock', 'one_check_up_sell'],\r\n name: 'campaign type'\r\n }),\r\n 'settings.applied_discount_title': Text({\r\n required: false,\r\n name: 'discount title'\r\n }),\r\n ...bundles,\r\n ...add_to_unlock,\r\n // ...one_check_up_sell,\r\n ...multi_one_check_upsell,\r\n ...modules\r\n};\r\n\r\nconst target_selected = {\r\n isRequired: 'if:target.type=specific_products',\r\n fieldName: 'target product',\r\n id: Text(),\r\n title: Text(),\r\n handle: Text(),\r\n image: Text({ required: false })\r\n};\r\n\r\nconst target = {\r\n 'target.type': Text({ inArray: ['all_products', 'specific_products', 'specific_collections'] }),\r\n // \"target.selected.*\" : Required({inArray: [\"all_products\", 'specific_products']})\r\n 'target.selected': { array: target_selected }\r\n // countries\r\n};\r\n\r\nconst CampaignConstraints = {\r\n name: Text({ min: 1, max: 50 }),\r\n ...target,\r\n ...settings\r\n};\r\n\r\nexport default CampaignConstraints;\r\n","import { Integer, Text, Float, Bool } from 'lib/validate';\r\nimport { modules } from './CampaignConstraints';\r\n\r\nconst theme = {\r\n 'settings.theme.primary': { color: true },\r\n 'settings.theme.secondary': { color: true },\r\n 'settings.theme.background': { color: true }\r\n};\r\nconst font = {\r\n 'settings.font.color': { color: true },\r\n 'settings.font.size': Integer({ min: 12, max: 18 }),\r\n 'settings.font.family': Text({ required: false }),\r\n 'settings.font.custom': Bool()\r\n};\r\nconst checkout_button = {\r\n 'settings.modules.checkout_button.button_text.text': Text({ max: 50, min: 3, name: 'text' }),\r\n 'settings.modules.checkout_button.button_text.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.modules.checkout_button.button_text.color': { color: true },\r\n 'settings.modules.checkout_button.button_text_loading.text': Text({\r\n max: 20,\r\n min: 3,\r\n name: 'text'\r\n }),\r\n 'settings.modules.checkout_button.button_text_loading.color': { color: true },\r\n 'settings.modules.checkout_button.background': { color: true },\r\n // 'settings.modules.checkout_button.hoverBackground': { color: true },\r\n 'settings.modules.checkout_button.coupon.background': { color: true },\r\n // 'settings.modules.checkout_button.coupon.hoverBackground': { color: true },\r\n 'settings.modules.checkout_button.use_coupon_code.text': Text({\r\n max: 40,\r\n min: 3,\r\n name: 'text'\r\n }),\r\n 'settings.modules.checkout_button.use_coupon_code.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.modules.checkout_button.use_coupon_code.color': { color: true },\r\n 'settings.modules.checkout_button.enter_coupon_code.text': Text({\r\n max: 40,\r\n min: 3,\r\n name: 'text'\r\n }),\r\n 'settings.modules.checkout_button.enter_coupon_code.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.modules.checkout_button.enter_coupon_code.color': { color: true },\r\n 'settings.modules.checkout_button.apply_coupon_code.text': Text({\r\n max: 15,\r\n min: 3,\r\n name: 'text'\r\n }),\r\n 'settings.modules.checkout_button.apply_coupon_code.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.modules.checkout_button.apply_coupon_code.color': { color: true },\r\n 'settings.modules.checkout_button.edit_coupon_code.text': Text({\r\n max: 35,\r\n min: 3,\r\n name: 'text'\r\n }),\r\n 'settings.modules.checkout_button.edit_coupon_code.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.modules.checkout_button.close_coupon_code.text': Text({\r\n max: 35,\r\n min: 3,\r\n name: 'text'\r\n }),\r\n 'settings.modules.checkout_button.close_coupon_code.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.modules.checkout_button.subtotal.text': Text({ max: 35, min: 3, name: 'text' }),\r\n 'settings.modules.checkout_button.subtotal.font_size': Float({\r\n min: 0.5,\r\n max: 2,\r\n name: 'font size'\r\n }),\r\n 'settings.modules.checkout_button.subtotal.color': { color: true }\r\n};\r\n\r\nconst header = {\r\n 'settings.header.title.text': Text({ max: 35, min: 3 }),\r\n 'settings.header.title.font_size': Float({ max: 2, min: 0.5, name: 'cart title font size' }),\r\n 'settings.header.title.color': { color: true },\r\n 'settings.header.background': { color: true }\r\n};\r\n\r\nconst product = {\r\n 'settings.product.title.text': Text({ max: 35, min: 3, name: 'text' }),\r\n 'settings.product.title.font_size': Float({ max: 2, min: 0.5, name: 'font size' }),\r\n 'settings.product.title.color': { color: true },\r\n 'settings.product.price.text': Text({ max: 35, min: 3, name: 'text' }),\r\n 'settings.product.price.font_size': Float({ max: 2, min: 0.5, name: 'font size' }),\r\n 'settings.product.sold_out': Text({ name: 'sold out' }),\r\n 'settings.product.price.color': { color: true },\r\n 'settings.product.image_size': Integer({ min: 50, max: 120, name: 'product image size' })\r\n};\r\n\r\n// const product_details = {\r\n// \t'settings.product_details.atcButton.text': Text({ max: 35, min: 3, name: 'text' }),\r\n// \t'settings.product_details.atcButton.font_size': Float({ max: 2, min: 0.5, name: 'font size' }),\r\n// \t'settings.product_details.atcButton.color': { color: true },\r\n// \t'settings.product_details.readMore.text': Text({ max: 35, min: 3, name: 'text' }),\r\n// \t'settings.product_details.readMore.font_size': Float({ max: 2, min: 0.5, name: 'font size' }),\r\n// \t'settings.product_details.readMore.color': { color: true },\r\n// \t'settings.product_details.truncate_length': Integer({ min: 50, max: 500, name: 'description length' }),\r\n// \t'settings.product_details.truncate': Bool(),\r\n// \t'settings.product_details.atcButton_background': { color: true },\r\n// \t'settings.product_details.atcButton_hoverBackground': { color: true },\r\n// };\r\n\r\nconst settings = {\r\n 'settings.multiCurrencyMode': Bool(),\r\n 'settings.empty_cart': Text(),\r\n ...theme,\r\n ...font,\r\n ...{ ...modules, ...checkout_button },\r\n ...header,\r\n ...product\r\n // ...product_details,\r\n};\r\n\r\nconst ShopConstraints = {\r\n ...settings\r\n};\r\n\r\nexport default ShopConstraints;\r\n","import React, { useState, useReducer, useContext } from \"react\";\r\nimport {\r\n CampaignReducer,\r\n SET_ITEM,\r\n NEW_BUNDLE,\r\n DELETE_BUNDLE,\r\n DELETE_GOAL,\r\n DELETE_OCU_PRODUCT,\r\n NEW_GOAL,\r\n DISCARD,\r\n NEW_OCU_PRODUCT,\r\n UPDATE_OLD_OCU,\r\n NEW_SPECIFIC_GOAL,\r\n REMOVE_SPECIFIC_GOAL\r\n} from \"reducers/CampaignReducer\";\r\nimport { useMutation } from \"@apollo/react-hooks\";\r\nimport useReactRouter from \"use-react-router\";\r\nimport { Loading, Toast } from \"@shopify/app-bridge-react\";\r\nimport {\r\n CREATE_CAMPAIGN_MUTATION,\r\n UPDATE_CAMPAIGN_MUTATION\r\n} from \"lib/mutations\";\r\nimport { LIST_SHOP_CAMPAIGNS, GET_SINGLE_CAMPAIGN } from \"Queries\";\r\nimport { SHOPIFY_API_KEY, SHOPIFY_EMBEDDED_FORCE_REDIRECT } from \"aws-exports\";\r\nimport { NEW_CAMPAIGN_INITIAL_STATE } from \"lib/globals\";\r\nimport { Run } from \"lib/validate\";\r\nimport { CampaignConstraints } from \"Constraints\";\r\nimport removeTypeName, { removeByType } from \"lib/removeTypeName\";\r\nimport UserContext from \"context/UserContext\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport _ from \"lodash\";\r\n\r\nconst CampaignContext = React.createContext(null);\r\nexport const CampaignProvider = CampaignContext.Provider;\r\n\r\nexport const withCampaignProvider = (\r\n ChildComponent,\r\n campaign = null,\r\n duplication = false,\r\n setIsOpen=()=>{}\r\n) => {\r\n return () => {\r\n const user = useContext(UserContext);\r\n const {\r\n state: {\r\n settings: {\r\n theme: { primary, secondary, background },\r\n font,\r\n modules: { checkout_button, order_note },\r\n default_language,\r\n multiCurrencyMode,\r\n product_details\r\n },\r\n currency\r\n }\r\n } = useContext(ShopContext);\r\n\r\n if (!campaign)\r\n campaign = NEW_CAMPAIGN_INITIAL_STATE(\r\n {\r\n checkout_button,\r\n primary,\r\n secondary,\r\n font_color: font.color,\r\n background,\r\n multiCurrencyMode\r\n },\r\n default_language,\r\n currency\r\n );\r\n else {\r\n if (!campaign.settings.modules.order_note) {\r\n campaign.settings.modules.order_note = order_note;\r\n campaign.settings.modules.order = [\r\n ...campaign.settings.modules.order,\r\n \"order_note\"\r\n ];\r\n }\r\n if (!campaign.target.countries) {\r\n campaign.target.countries =\r\n NEW_CAMPAIGN_INITIAL_STATE().target.countries;\r\n }\r\n\r\n // migrations\r\n if (!campaign.settings.add_to_unlock.product_details) {\r\n campaign.settings.add_to_unlock.product_details = product_details;\r\n }\r\n\r\n if (!campaign.settings.one_check_up_sell?.highlight && !campaign.settings.multi_one_check_upsell) {\r\n campaign.settings.one_check_up_sell.highlight = primary;\r\n }\r\n if (!campaign.settings.add_to_unlock.progress_primary) {\r\n campaign.settings.add_to_unlock.progress_primary = primary;\r\n campaign.settings.add_to_unlock.progress_secondary = secondary;\r\n campaign.settings.add_to_unlock.progress_complete = primary;\r\n }\r\n if (!campaign.settings.add_to_unlock.upsell_add_button.color) {\r\n campaign.settings.add_to_unlock.upsell_add_button.color = primary;\r\n }\r\n }\r\n let originalCampaign = { ...campaign };\r\n if (duplication) {\r\n originalCampaign.name = originalCampaign.name + \" \";\r\n }\r\n const [validationErrors, setValidationErrors] = useState({});\r\n const [originalState, setOriginalState] = useState(originalCampaign);\r\n const [showValidationError, setShowValidationError] = useState(\"\");\r\n const [state, dispatch] = useReducer(\r\n CampaignReducer(default_language, currency),\r\n campaign\r\n );\r\n const { history } = useReactRouter();\r\n let [\r\n CreateCampaignMutation,\r\n {\r\n loading: CreateCampaignMutation_Loading,\r\n error: CreateCampaignMutation_Error,\r\n data: CreateCampaignMutation_Data\r\n }\r\n ] = useMutation(CREATE_CAMPAIGN_MUTATION);\r\n\r\n let [\r\n UpdateCampaignMutation,\r\n {\r\n loading: UpdateCampaignMutation_Loading,\r\n error: UpdateCampaignMutation_Error,\r\n data: UpdateCampaignMutation_Data\r\n }\r\n ] = useMutation(UPDATE_CAMPAIGN_MUTATION);\r\n\r\n const setItem = (path, value) => dispatch({ type: SET_ITEM, path, value });\r\n const newBundle = () => dispatch({ type: NEW_BUNDLE });\r\n const deleteBundle = (value) => dispatch({ type: DELETE_BUNDLE, value });\r\n\r\n const newGoal = () => dispatch({ type: NEW_GOAL });\r\n const newSpecificGoal = (index) => dispatch({ type: NEW_SPECIFIC_GOAL, value: index });\r\n const removeSpecificGoal = (goal_index, specific_goal_index) => dispatch({ type: REMOVE_SPECIFIC_GOAL, value: specific_goal_index, goal_index });\r\n const deleteGoal = (value) => dispatch({ type: DELETE_GOAL, value });\r\n const newOneCheckUpsellProduct = () => dispatch({ type: NEW_OCU_PRODUCT });\r\n const deleteOneCheckUpsellProduct = (value) => dispatch({ type: DELETE_OCU_PRODUCT, value });\r\n const updateOldOCU = () => {\r\n const { highlight, ...rest } = campaign.settings.one_check_up_sell\r\n const value = {\r\n variant: \"switch\",\r\n align: \"natural\",\r\n border: false,\r\n border_color: { r: 226, g: 232, b: 240, a: 1 },\r\n switch_on: primary,\r\n switch_off: secondary,\r\n highlight,\r\n products: [rest]\r\n }\r\n dispatch({ type: UPDATE_OLD_OCU, value });\r\n }\r\n\r\n const discard = () => {\r\n dispatch({ type: DISCARD, value: originalState });\r\n };\r\n const validate = (state, specific = [], silent = false) => {\r\n return Run(\r\n state,\r\n specific,\r\n {\r\n errors: validationErrors,\r\n setErrors: setValidationErrors,\r\n constraints: CampaignConstraints\r\n },\r\n silent\r\n );\r\n };\r\n\r\n const saveCampaign = async (overrides = {}) => {\r\n const errors = validate(state);\r\n if (errors) {\r\n const flatErrors = Object.values(errors)\r\n .map((error) => error.filter(Boolean))\r\n .flat(Infinity);\r\n const errorMessage =\r\n typeof flatErrors[0] === \"object\"\r\n ? Object.values(flatErrors[0]).flat(Infinity)[0]\r\n : flatErrors[0];\r\n if (errorMessage) setShowValidationError(errorMessage);\r\n if (flatErrors.length && errorMessage) return errors;\r\n }\r\n if (state.settings.type === \"add_to_unlock\") {\r\n // making sure one of [progress,recommendations] is enabled\r\n const { add_to_unlock } = state.settings;\r\n if (!add_to_unlock.isActive && !add_to_unlock.show_suggestions) {\r\n setShowValidationError(\r\n \"Please enable add to unlock or products to suggest.\"\r\n );\r\n const newErrors = {\r\n \"settings.add_to_unlock.isActive\": [\r\n \"Please enable add to unlock or products to suggest.\"\r\n ],\r\n \"settings.add_to_unlock.show_suggestions\": [\r\n \"Please enable add to unlock or products to suggest.\"\r\n ]\r\n };\r\n setValidationErrors(newErrors);\r\n return newErrors;\r\n }\r\n\r\n const goals = add_to_unlock.goals.map(({ goal }) => goal);\r\n const goalsErrors = {\r\n \"settings.add_to_unlock.goals\": []\r\n };\r\n goals.forEach((goal, index) => {\r\n const nextGoal = goals[index + 1];\r\n if (nextGoal && nextGoal <= goal) {\r\n goalsErrors[\"settings.add_to_unlock.goals\"].push({\r\n goal: `Spend goal must be greater than ${goal} on \"Reward ${index + 2\r\n }\"`\r\n });\r\n } else {\r\n goalsErrors[\"settings.add_to_unlock.goals\"].push(-index);\r\n }\r\n });\r\n const truthyErrors = goalsErrors[\"settings.add_to_unlock.goals\"].filter(\r\n (e) => typeof e === \"object\"\r\n );\r\n if (truthyErrors.length) {\r\n setShowValidationError(truthyErrors[0].goal);\r\n setValidationErrors(goalsErrors);\r\n return goalsErrors;\r\n }\r\n }\r\n state.target.ids = state.target.selected.map(({ id }) => id);\r\n //remove empty strings because dynamodb doesn't allow it\r\n //and null values because there may be some new settings\r\n // const saveState = _.merge(\r\n // \t{},\r\n // \tNEW_CAMPAIGN_INITIAL_STATE(),\r\n // \tremoveByType(removeTypeName(state), (v) => v !== '' && v !== null)\r\n // );\r\n\r\n // const saveState = _.mergeWith(\r\n // \tNEW_CAMPAIGN_INITIAL_STATE(),\r\n // \tremoveByType(removeTypeName(state), (v) => v !== '' && v !== null),\r\n // \t(objValue, srcValue) => srcValue && _.isArray(srcValue) ? srcValue : undefined\r\n // );\r\n\r\n const saveState = removeByType(\r\n removeTypeName(state),\r\n (v) => v !== \"\" && v !== null\r\n );\r\n if (!state.id) {\r\n const {\r\n data: { createCampaign }\r\n } = await CreateCampaignMutation({\r\n variables: {\r\n input: {\r\n ...saveState,\r\n ...{ ...overrides, active: true }\r\n }\r\n },\r\n refetchQueries: [\r\n {\r\n query: LIST_SHOP_CAMPAIGNS,\r\n variables: {\r\n userId: user.attributes.sub\r\n }\r\n }\r\n ]\r\n });\r\n history.push(\"/campaigns/\" + createCampaign.id);\r\n } else {\r\n const { id, ...input } = { ...saveState, ...overrides };\r\n await UpdateCampaignMutation({\r\n variables: { id, input },\r\n refetchQueries: [\r\n {\r\n query: LIST_SHOP_CAMPAIGNS,\r\n variables: {\r\n userId: user.attributes.sub\r\n }\r\n },\r\n {\r\n query: GET_SINGLE_CAMPAIGN,\r\n variables: {\r\n id\r\n }\r\n }\r\n ]\r\n });\r\n }\r\n setOriginalState(state);\r\n };\r\n\r\n return (\r\n <CampaignProvider\r\n value={{\r\n originalState,\r\n discard,\r\n state,\r\n setItem,\r\n newBundle,\r\n newGoal,\r\n newSpecificGoal,\r\n removeSpecificGoal,\r\n newOneCheckUpsellProduct,\r\n deleteGoal,\r\n deleteBundle,\r\n deleteOneCheckUpsellProduct,\r\n dispatch,\r\n saveCampaign,\r\n validate,\r\n validationErrors,\r\n updateOldOCU,\r\n }}\r\n >\r\n {(CreateCampaignMutation_Loading || UpdateCampaignMutation_Loading) && (\r\n <Loading />\r\n )}\r\n {(CreateCampaignMutation_Error || UpdateCampaignMutation_Error) && (\r\n <Toast\r\n content={`Something went wrong`}\r\n duration={3000}\r\n error\r\n onDismiss={() => {\r\n UpdateCampaignMutation_Error = null;\r\n CreateCampaignMutation_Error = null;\r\n }}\r\n />\r\n )}\r\n {(CreateCampaignMutation_Data || UpdateCampaignMutation_Data) && (\r\n <Toast\r\n content={`Campaign has been ${state.id ? \"updated\" : \"saved\"}`}\r\n duration={3000}\r\n onDismiss={() => {}}\r\n />\r\n )}\r\n {showValidationError && (\r\n <Toast\r\n content={showValidationError}\r\n error={true}\r\n duration={3000}\r\n onDismiss={() => setShowValidationError(\"\")}\r\n />\r\n )}\r\n <ChildComponent setIsOpen={setIsOpen} />\r\n </CampaignProvider>\r\n );\r\n };\r\n};\r\nexport default CampaignContext;\r\n","import React, { useState, useContext, useEffect, useRef } from 'react';\r\nimport { Page, Carousel, Button, Alert } from 'components';\r\nimport useReactRouter from 'use-react-router';\r\nimport { Modal } from '@shopify/app-bridge-react';\r\nimport FirstStep from './settings/FirstStep';\r\nimport ShopContext from 'context/ShopContext';\r\nimport SecondStep from './settings/SecondStep';\r\nimport CampaignContext from 'context/CampaignContext';\r\nimport PreviewContext from 'context/PreviewContext';\r\nimport { useTransition, animated } from 'react-spring';\r\nimport _ from 'lodash';\r\nimport { trackMixPanelEvent } from \"lib/mixpanel\"\r\n\r\nconst Create = ({ setIsOpen }) => {\r\n\tconst { history } = useReactRouter();\r\n\tconst [showConfirmCancel, setShowConfirmCancel] = useState(false);\r\n\tconst [scrollTop, setScrollTop] = useState(0);\r\n\tconst newCampaignContext = useContext(CampaignContext);\r\n\tconst shopContext = useContext(ShopContext);\r\n\tconst { AppLocalStorage } = shopContext\r\n\tconst { validate, state, originalState, discard, validationErrors } = newCampaignContext;\r\n\tconst { previewCampaign, setShowATUAfterText } = useContext(PreviewContext);\r\n\tconst [activeTab, setActiveTab] = useState(0);\r\n\tconst stickyHeader = useRef(null);\r\n\tconst [stickyHeaderPosition, setStickyHeaderPosition] = useState(0);\r\n\tconst transitions = useTransition(!_.isEqual(originalState, state), null, {\r\n\t\tfrom: { position: 'absolute', opacity: 0 },\r\n\t\tenter: { opacity: 1 },\r\n\t\tleave: { opacity: 0 },\r\n\t});\r\n\r\n\t// console.log(\"shopContext\")\r\n\t// console.log(shopContext)\r\n\tuseEffect(() => {\r\n\t\tpreviewCampaign(state);\r\n\t}, [state]);\r\n\r\n\treturn (\r\n\t\t<Page\r\n\t\t\tpadding={0}\r\n\t\t\tonScroll={(scrollTop) => {\r\n\t\t\t\tif (!stickyHeader.current) {\r\n\t\t\t\t\tsetStickyHeaderPosition(0);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (scrollTop > stickyHeader.current.offsetTop + 15)\r\n\t\t\t\t\tsetStickyHeaderPosition(scrollTop - stickyHeader.current.offsetTop - 15);\r\n\t\t\t\telse setStickyHeaderPosition(0);\r\n\t\t\t}}\r\n\t\t\theader={{\r\n\t\t\t\ttitle: state.id ? state.name.substring(0, 25) : 'New Campaign',\r\n\t\t\t}}\r\n\t\t\tTopContent={{\r\n\t\t\t\ttransitions,\r\n\t\t\t\trender: ({ error, loading }) => (\r\n\t\t\t\t\t<Alert\r\n\t\t\t\t\t\ttype=\"save_settings\"\r\n\t\t\t\t\t\ttitle=\"unsaved changes\"\r\n\t\t\t\t\t\tborderPosition=\"none\"\r\n\t\t\t\t\t\tpaddingX=\"px-6\"\r\n\t\t\t\t\t\tactions={[\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\ttext: 'Discard',\r\n\t\t\t\t\t\t\t\ttype: 'secondary',\r\n\t\t\t\t\t\t\t\tloading: false,\r\n\t\t\t\t\t\t\t\tonClick: () => discard(),\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\ttext: newCampaignContext.originalState.active ? 'Save' : 'Save & Activate',\r\n\t\t\t\t\t\t\t\ttype: Object.values(validationErrors)\r\n\t\t\t\t\t\t\t\t\t.map((error) => error.filter(Boolean))\r\n\t\t\t\t\t\t\t\t\t.flat(Infinity)\r\n\t\t\t\t\t\t\t\t\t.filter(Boolean).length\r\n\t\t\t\t\t\t\t\t\t? 'danger'\r\n\t\t\t\t\t\t\t\t\t: 'primary',\r\n\t\t\t\t\t\t\t\t// disabled: Object.keys(validationErrors).length,\r\n\t\t\t\t\t\t\t\tonClick: () => {\r\n\t\t\t\t\t\t\t\t\tif (!AppLocalStorage.getItem('first_new_campaign')) {\r\n\t\t\t\t\t\t\t\t\t\tAppLocalStorage.setItem('first_new_campaign', true)\r\n\t\t\t\t\t\t\t\t\t\ttrackMixPanelEvent('First new campaign', shopContext.state?.id)\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tnewCampaignContext.saveCampaign(\r\n\t\t\t\t\t\t\t\t\t\t!newCampaignContext.originalState.active ? { active: true } : {}\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t]}\r\n\t\t\t\t\t/>\r\n\t\t\t\t),\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{/* <Carousel\r\n\t\t\t\tactive={activeTab}\r\n\t\t\t\tcontents={[\r\n\t\t\t\t\t<FirstStep context={newCampaignContext} setActiveTab={setActiveTab} />,\r\n\t\t\t\t\t<SecondStep\r\n\t\t\t\t\t\tsetActiveTab={setActiveTab}\r\n\t\t\t\t\t\tcontext={newCampaignContext}\r\n\t\t\t\t\t\tstickyHeaderPosition={stickyHeaderPosition}\r\n\t\t\t\t\t\tstickyHeader={stickyHeader}\r\n\t\t\t\t\t/>,\r\n\t\t\t\t]}\r\n\t\t\t/> */}\r\n\t\t\t<FirstStep context={newCampaignContext} setActiveTab={setActiveTab} setIsOpen={setIsOpen} />\r\n\t\t\t<SecondStep\r\n\t\t\t\tsetActiveTab={setActiveTab}\r\n\t\t\t\tcontext={newCampaignContext}\r\n\t\t\t\tshopContext={shopContext}\r\n\t\t\t\tstickyHeaderPosition={stickyHeaderPosition}\r\n\t\t\t\tstickyHeader={stickyHeader}\r\n\t\t\t\tsetShowATUAfterText={setShowATUAfterText}\r\n\t\t\t/>\r\n\t\t\t<Modal\r\n\t\t\t\ttitle=\"Confirm Cancel\"\r\n\t\t\t\tmessage=\"Are you sure, You want to cancel\"\r\n\t\t\t\topen={showConfirmCancel}\r\n\t\t\t\tprimaryAction={{\r\n\t\t\t\t\tcontent: 'Yes, Cancel',\r\n\t\t\t\t\tonAction: () => {\r\n\t\t\t\t\t\tsetShowConfirmCancel(false);\r\n\t\t\t\t\t\thistory.push('/campaigns');\r\n\t\t\t\t\t},\r\n\t\t\t\t}}\r\n\t\t\t\tsecondaryActions={[\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcontent: 'No',\r\n\t\t\t\t\t\tonAction: () => setShowConfirmCancel(false),\r\n\t\t\t\t\t},\r\n\t\t\t\t]}\r\n\t\t\t/>\r\n\t\t</Page>\r\n\t);\r\n};\r\n\r\nexport default Create;\r\n","import React, { useContext } from 'react';\r\nimport { withCampaignProvider } from 'context/CampaignContext';\r\nimport Create from './Create';\r\nimport { GET_SINGLE_CAMPAIGN } from 'Queries';\r\nimport { useQuery } from '@apollo/react-hooks';\r\nimport { Spinner } from 'components';\r\nimport useReactRouter from 'use-react-router';\r\nimport ShopContext from 'context/ShopContext';\r\n\r\nconst Update = ({ setIsOpen }) => {\r\n const { match } = useReactRouter();\r\n const { id } = match.params;\r\n const { data, loading, error } = useQuery(GET_SINGLE_CAMPAIGN, {\r\n variables: {\r\n id\r\n },\r\n fetchPolicy: 'no-cache'\r\n });\r\n const { state: { settings: { theme: { primary, secondary, background } } } } = useContext(\r\n ShopContext\r\n );\r\n if (error) throw new Error(error);\r\n if (loading) return <Spinner />;\r\n if (data) {\r\n if (\r\n data.campaign?.settings.type === 'bundles' &&\r\n !data.campaign?.settings.bundles.variantsPicker\r\n ) {\r\n const default_font_color = { r: 22, g: 37, b: 67, a: 1 };\r\n data.campaign.settings.bundles = Object.assign({}, data.campaign.settings.bundles, {\r\n style: 'vertical',\r\n labelColor: primary,\r\n variantsPicker: {\r\n active: false,\r\n label: 'Product #{{number}}',\r\n confirm: 'Confirm',\r\n textColor: default_font_color,\r\n dropdownTextColor: primary,\r\n dropdownBackground: secondary,\r\n confirmTextColor: background,\r\n confirmBackground: primary\r\n }\r\n });\r\n }\r\n if (\r\n data.campaign?.settings.type === 'bundles' &&\r\n !data.campaign?.settings.bundles.badge\r\n ) {\r\n data.campaign.settings.bundles = Object.assign({}, data.campaign.settings.bundles, {\r\n badge: {\r\n text: {\r\n a: 1,\r\n r: 0,\r\n g: 45,\r\n b: 255\r\n },\r\n background: {\r\n a: 1,\r\n r: 240,\r\n g: 242,\r\n b: 255\r\n },\r\n border: {\r\n a: 1,\r\n r: 161,\r\n g: 178,\r\n b: 255\r\n }\r\n }\r\n });\r\n }\r\n const UpdateCampaign = withCampaignProvider(Create, data.campaign, null, setIsOpen);\r\n return <UpdateCampaign />;\r\n }\r\n};\r\n\r\nexport default Update;\r\n","import React from 'react';\r\nimport { withCampaignProvider } from 'context/CampaignContext';\r\nimport Create from './Create';\r\nimport { GET_SINGLE_CAMPAIGN } from 'Queries';\r\nimport { useQuery } from '@apollo/react-hooks';\r\nimport { Spinner } from 'components';\r\nimport useReactRouter from 'use-react-router';\r\n\r\nconst Duplicate = ({ setIsOpen }) => {\r\n\tconst { match } = useReactRouter();\r\n\tconst { id } = match.params;\r\n\tconst { data, loading, error } = useQuery(GET_SINGLE_CAMPAIGN, {\r\n\t\tvariables: {\r\n\t\t\tid,\r\n\t\t},\r\n\t\tfetchPolicy: 'cache-first',\r\n\t});\r\n\r\n\tif (error) throw new Error(error);\r\n\tif (loading) return <Spinner />;\r\n\r\n\tlet campaignData = null\r\n\tif(data.campaign){\r\n\t\tlet {id:{campaignId}, name, ...other} = data.campaign\r\n\t\tcampaignData = other\r\n\t\tcampaignData.name = `${name} (copy)`\r\n\t}\r\n\t\r\n\tif (data) {\r\n\t\tconst DuplicateCampaign = withCampaignProvider(Create, campaignData, true, setIsOpen); //duplication = true\r\n\t\treturn <DuplicateCampaign />;\r\n\t}\r\n};\r\n\r\nexport default Duplicate;\r\n","import React, { Component } from 'react';\r\nimport { EmptyState } from 'components';\r\nimport { ReactComponent as NotFound } from 'svgs/not_found.svg';\r\n\r\nclass ErrorScreen extends Component {\r\n\tstate = {\r\n\t\thasError: false,\r\n\t\terror: null,\r\n\t\tinfo: null,\r\n\t};\r\n\r\n\tcomponentDidCatch(error, info) {\r\n\t\tconsole.log('ERROR', error);\r\n\t\tconsole.log('INFO', info);\r\n\t\tthis.setState({ hasError: true, error, info });\r\n\t}\r\n\r\n\trender() {\r\n\t\tif (!this.state.hasError) return this.props.children;\r\n\r\n\t\treturn (\r\n\t\t\t<EmptyState\r\n\t\t\t\theading=\"Something went wrong.\"\r\n\t\t\t\tIllustration={NotFound}\r\n\t\t\t\taction={{\r\n\t\t\t\t\ttext: 'Go to Dashboard',\r\n\t\t\t\t\turl: '/',\r\n\t\t\t\t}}\r\n\t\t\t\tbackground='#f6f7fb'\r\n\t\t\t>\r\n\t\t\t\t<details style={{ whiteSpace: 'pre-wrap' }}>\r\n\t\t\t\t\t{this.state.error.toString()}\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t{this.state.info.componentStack}\r\n\t\t\t\t</details>\r\n\t\t\t</EmptyState>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default ErrorScreen;\r\n","import React from 'react';\r\nimport { Embedded, EmptyState } from 'components';\r\nimport { ReactComponent as NotFound } from 'svgs/not_found.svg';\r\n\r\nconst NotFoundScreen = () => {\r\n\treturn (\r\n\t\t<EmptyState\r\n\t\t\theading=\"Page Not Found\"\r\n\t\t\tIllustration={NotFound}\r\n\t\t\taction={{\r\n\t\t\t\ttext: 'Go to Dashboard',\r\n\t\t\t\turl: '/',\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t<p>Oh no! We could not find the page you were looking for.</p>\r\n\t\t</EmptyState>\r\n\t);\r\n};\r\n\r\nexport default NotFoundScreen;\r\n","var _metadata, _g;\n\nvar _excluded = [\"svgRef\", \"title\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar SvgDots = function SvgDots(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: \"140px\",\n height: \"140px\",\n viewBox: \"0 0 1280.000000 1280.000000\",\n preserveAspectRatio: \"xMidYMid meet\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _metadata || (_metadata = /*#__PURE__*/React.createElement(\"metadata\", null, \"\\r\\nCreated by potrace 1.15, written by Peter Selinger 2001-2017\\r\\n\")), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n transform: \"translate(0.000000,1280.000000) scale(0.100000,-0.100000)\",\n fill: \"#e1f7ff\",\n stroke: \"none\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 12465 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 12465 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 254 -255 194 -41 395 142 375 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 12465 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 12465 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 12465 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 12465 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 12465 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 12465 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 12465 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 12465 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 11185 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 11185 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 254 -255 194 -41 395 142 375 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 11185 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 11185 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 11185 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 11185 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 11185 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 11185 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 11185 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 11185 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 9905 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 8625 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 7345 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 6065 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 4785 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 4785 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 4785 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 4785 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 4785 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 255 -255 193 -41 394 142 374 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 4785 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 255 -255 193 -41 394 142 374 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 4785 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 255 -255 193 -41 394 142 374 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 4785 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 255 -255 193 -41 394 142 374 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 4785 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 4785 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 3505 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 3505 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 3505 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 3505 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 3505 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 255 -255 193 -41 394 142 374 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 3505 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 255 -255 193 -41 394 142 374 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 3505 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 255 -255 193 -41 394 142 374 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 3505 c-151 -50 -253 -216 -222 -362 25 -119 136 -230 255 -255 193 -41 394 142 374 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 3505 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 3505 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 2225 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 2225 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 2225 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 2225 c-105 -35 -200 -141 -222 -248 -25 -117 32 -244 142 -319 107 -74 229 -75 337 -3 177 118 201 338 53 485 -85 86 -207 119 -310 85z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 2225 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 2225 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 2225 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 2225 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 2225 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 2225 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1830 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3110 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4390 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M5670 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M6950 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8230 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9510 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M10790 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12070 945 c-105 -35 -200 -141 -222 -248 -43 -206 163 -412 369 -369 155 32 275 190 260 339 -11 105 -90 213 -190 262 -61 29 -155 36 -217 16z\"\n }))));\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgDots, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/dots.5e63ec14.svg\";\nexport { ForwardRef as ReactComponent };","var _path, _path2, _path3;\n\nvar _excluded = [\"svgRef\", \"title\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar SvgRotate = function SvgRotate(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 33,\n height: 31,\n viewBox: \"0 0 33 31\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M25.625 20L30.125 18.875L31.25 23.375\",\n stroke: \"#748094\",\n strokeWidth: 3,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M30.125 18.875C29.1256 21.7069 27.3103 24.1796 24.9079 25.9814C22.5055 27.7832 19.6234 28.8335 16.625 29C13.8533 29.0005 11.1485 28.1478 8.87821 26.5578C6.60789 24.9678 4.88201 22.7174 3.935 20.1125M7.625 11L3.125 12.125L2 7.625\",\n stroke: \"#748094\",\n strokeWidth: 3,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M3.125 12.125C5.015 6.95 10.82 2 16.625 2C19.4102 2.00783 22.1249 2.87695 24.3968 4.48822C26.6687 6.09949 28.3866 8.37403 29.315 11\",\n stroke: \"#748094\",\n strokeWidth: 3,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n })));\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgRotate, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/rotate.d02e519b.svg\";\nexport { ForwardRef as ReactComponent };","import React from 'react';\r\nimport { Auth } from 'aws-amplify';\r\nimport { RouteComponentProps } from 'react-router';\r\nimport { Redirect } from 'react-router-dom';\r\nimport { APP_NAME } from 'aws-exports';\r\n\r\nconst LogoutScreen = () => {\r\n\tAuth.signOut();\r\n\tdocument.title = `${APP_NAME} — Logout`;\r\n\treturn <Redirect push={true} to=\"/login\" />;\r\n};\r\nexport default LogoutScreen;\r\n","import React from 'react';\r\n\r\nconst PageScrollContext = React.createContext(null);\r\nexport const PageScrollProvider = PageScrollContext.Provider;\r\n\r\nexport const WithPageScrollProvider = ({ pageScroll, children }) => {\r\n\tconst value = pageScroll.current || {};\r\n\treturn <PageScrollProvider value={value}>{children}</PageScrollProvider>;\r\n};\r\nexport default PageScrollContext;\r\n","import React from 'react';\r\nimport {\r\n\tColorPicker,\r\n\tFormGroup,\r\n\tInput,\r\n\tFormControl,\r\n\tDropdown,\r\n\tCustomText,\r\n\tIcon,\r\n ButtonSelect,\r\n} from 'components';\r\n\r\nimport styles from 'styles/cart_screen.module.scss';\r\n\r\n\r\nconst ScarcitySettings = ({shopContext, }) => {\r\n\r\n\tconst { state, setItem } = shopContext;\r\n\tconst { scary } = state.settings\r\n\r\n const handleCheck = (event, name) => {\r\n\t\tsetItem( `settings.scary.${name}`, event.target.checked);\r\n\t}\r\n\r\n\tconst handleRadio = (value, name) => {\r\n\t\tsetItem( `settings.scary.${name}`, value);\r\n\t}\r\n\r\n return (\r\n <FormGroup\r\n label=\"Scarcity Timer\"\r\n info=\"Create a sense of urgency for your customers to checkout using a scarcity timer.\"\r\n fullWidth\r\n >\r\n <FormControl\r\n label=\"Timer Setup\"\r\n isSingleCol=\"false\"\r\n withSwitch={[shopContext, \"settings.scary.isActive\"]}\r\n marginBottom=\"\"\r\n >\r\n <div\r\n className=\"row four-columns\"\r\n style={{ gridTemplateColumns: \"repeat(4, 1fr)\" }}\r\n >\r\n <div className={styles.checkboxControl}>\r\n <input\r\n type=\"checkbox\"\r\n id=\"daysCheck\"\r\n value={\"days\"}\r\n checked={scary.isDaysActive}\r\n onChange={(e) => handleCheck(e, \"isDaysActive\")}\r\n />\r\n <label htmlFor=\"daysCheck\" className={styles.checkbox}>\r\n <Icon icon=\"check\" size=\"xs\" />\r\n </label>\r\n <p>Days</p>\r\n </div>\r\n <div className={styles.checkboxControl}>\r\n <input\r\n type=\"checkbox\"\r\n id=\"hoursCheck\"\r\n value={\"hours\"}\r\n checked={scary.isHoursActive}\r\n onChange={(e) => handleCheck(e, \"isHoursActive\")}\r\n />\r\n <label htmlFor=\"hoursCheck\" className={styles.checkbox}>\r\n <Icon icon=\"check\" size=\"xs\" />\r\n </label>\r\n <p>Hours</p>\r\n </div>\r\n <div className={styles.checkboxControl}>\r\n <input\r\n type=\"checkbox\"\r\n id=\"minutesCheck\"\r\n value={\"minutes\"}\r\n checked={scary.isMinutesActive}\r\n onChange={(e) => handleCheck(e, \"isMinutesActive\")}\r\n />\r\n <label htmlFor=\"minutesCheck\" className={styles.checkbox}>\r\n <Icon icon=\"check\" size=\"xs\" />\r\n </label>\r\n <p>Minutes</p>\r\n </div>\r\n <div className={styles.checkboxControl}>\r\n <input\r\n type=\"checkbox\"\r\n id=\"secondsCheck\"\r\n value={\"seconds\"}\r\n checked={scary.isSecondsActive}\r\n onChange={(e) => handleCheck(e, \"isSecondsActive\")}\r\n />\r\n <label htmlFor=\"secondsCheck\" className={styles.checkbox}>\r\n <Icon icon=\"check\" size=\"xs\" />\r\n </label>\r\n <p>Seconds</p>\r\n </div>\r\n </div>\r\n </FormControl>\r\n <FormControl isSingleCol=\"false\" className=\"flex\">\r\n <div\r\n className=\"row four-columns\"\r\n style={{ gridTemplateColumns: \"repeat(4, 1fr)\" }}\r\n >\r\n <Input\r\n type=\"number\"\r\n min={0}\r\n BindToContext={[shopContext, \"settings.scary.days\"]}\r\n />\r\n <Input\r\n type=\"number\"\r\n max={23}\r\n min={0}\r\n BindToContext={[shopContext, \"settings.scary.hours\"]}\r\n />\r\n <Input\r\n type=\"number\"\r\n max={59}\r\n min={0}\r\n BindToContext={[shopContext, \"settings.scary.minutes\"]}\r\n />\r\n <Input\r\n type=\"number\"\r\n max={59}\r\n min={0}\r\n BindToContext={[shopContext, \"settings.scary.seconds\"]}\r\n />\r\n </div>\r\n </FormControl>\r\n\r\n <CustomText\r\n context={shopContext}\r\n label=\"Customize\"\r\n path=\"settings.scary.text\"\r\n hasColor={true}\r\n />\r\n <FormControl label=\"Alignement\">\r\n <Dropdown\r\n options={[\r\n { value: \"left\", label: \"Left\" },\r\n { value: \"center\", label: \"Center\" },\r\n { value: \"right\", label: \"Right\" },\r\n ]}\r\n first\r\n BindToContext={[shopContext, \"settings.scary.textAlignement\"]}\r\n />\r\n </FormControl>\r\n\r\n <FormControl label=\"Timer style\">\r\n <ButtonSelect\r\n options={[\r\n {\r\n value: \"rounded\",\r\n label: \"Rounded\",\r\n },\r\n {\r\n value: \"full\",\r\n label: \"Full width\",\r\n },\r\n ]}\r\n showSeparator={true}\r\n BindToContext={[shopContext, \"settings.scary.style\"]}\r\n />\r\n </FormControl>\r\n <FormControl>\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[shopContext, \"settings.scary.background\"]}\r\n />\r\n <ColorPicker\r\n text=\"Border\"\r\n BindToContext={[shopContext, \"settings.scary.border\"]}\r\n />\r\n </FormControl>\r\n <FormControl label=\"When timeout I want to:\" isSingleCol=\"false\">\r\n <div className={styles.radioDiv}>\r\n <input\r\n type=\"radio\"\r\n id=\"timerhide\"\r\n value={\"hide\"}\r\n checked={scary.endAction === \"hide\"}\r\n onChange={(e) => handleRadio(\"hide\", \"endAction\")}\r\n />\r\n <label onClick={() => handleRadio(\"hide\", \"endAction\")}>\r\n Hide timer\r\n </label>\r\n </div>\r\n <div className={styles.radioDiv}>\r\n <input\r\n type=\"radio\"\r\n id=\"timerrestart\"\r\n value={\"restart\"}\r\n checked={scary.endAction === \"restart\"}\r\n onChange={(e) => handleRadio(\"restart\", \"endAction\")}\r\n />\r\n <label onClick={() => handleRadio(\"restart\", \"endAction\")}>\r\n Restart Timer\r\n </label>\r\n </div>\r\n </FormControl>\r\n <FormControl label=\"Timer Placement\" isSingleCol=\"false\">\r\n <div className={styles.radioDiv}>\r\n <input\r\n type=\"radio\"\r\n id=\"timerplacementtop\"\r\n value={\"top\"}\r\n checked={scary.placement === \"top\"}\r\n onChange={(e) => handleRadio(\"top\", \"placement\")}\r\n />\r\n <label onClick={() => handleRadio(\"top\", \"placement\")}>\r\n Top of the cart{\" \"}\r\n </label>\r\n </div>\r\n <div className={styles.radioDiv}>\r\n <input\r\n type=\"radio\"\r\n id=\"timerplacementbottom\"\r\n value={\"bottom\"}\r\n checked={scary.placement === \"bottom\"}\r\n onChange={() => handleRadio(\"bottom\", \"placement\")}\r\n />\r\n <label onClick={() => handleRadio(\"bottom\", \"placement\")}>\r\n Above checkout button\r\n </label>\r\n </div>\r\n </FormControl>\r\n </FormGroup>\r\n );\r\n}\r\n\r\n\r\nexport {ScarcitySettings};","import React from 'react';\r\nimport {\r\n\tFormGroup,\r\n\tFormControl,\r\n\tDropdown,\r\n RichEditor,\r\n} from 'components';\r\nimport { BADGES_POSITIONS } from 'lib/globals'\r\nimport styles from 'styles/cart_screen.module.scss';\r\n\r\n\r\nconst BadgesSettings = ({shopContext, }) => {\r\n\r\n return (\r\n <FormGroup\r\n label=\"Trust Badges / images\"\r\n info={`Increase trust with a secure checkout message and payment badges.\r\n You can use the ones we provide or upload your own. \r\n (Suggested image size = 50kb or less)`}\r\n fullWidth\r\n >\r\n <FormControl\r\n label=\"Position in Cart Drawer\"\r\n withSwitch={[shopContext, \"settings.badges.isActive\"]}\r\n >\r\n <Dropdown\r\n options={BADGES_POSITIONS}\r\n first\r\n BindToContext={[shopContext, \"settings.badges.position\"]}\r\n />\r\n </FormControl>\r\n <FormControl>\r\n <RichEditor\r\n placeholder=\"payement badges\"\r\n BindToContext={[shopContext, \"settings.badges.value\"]}\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n );\r\n}\r\n\r\n\r\nexport {BadgesSettings};","import React from 'react';\r\nimport {\r\n\tColorPicker,\r\n\tFormGroup,\r\n\tFormControl,\r\n RichEditor\r\n} from 'components';\r\n\r\n\r\n\r\nconst TermsSettings = ({shopContext }) => {\r\n\r\n\tconst { state, setItem } = shopContext;\r\n\tconst { checkout_condition_text } = state.settings\r\n\r\n\r\n return (\r\n \r\n <FormGroup label=\"Terms And Conditions\" fullWidth>\r\n <FormControl\r\n label=\" Terms and conditions checkbox\" \r\n info={`Add a checkbox that must be clicked before proceeding to checkout.\r\n Tip: You can also add url hyperlinks for terms and condition pages.`}\r\n withSwitch={[shopContext, 'settings.is_checkout_condition_active']}\r\n >\r\n <RichEditor\r\n placeholder=\"I agree with terms & conditions\"\r\n BindToContext={[shopContext, 'settings.checkout_condition_text']}\r\n />\r\n </FormControl>\r\n <FormControl >\r\n <ColorPicker text=\"Checkbox color\" BindToContext={[shopContext, 'settings.checkout_condition_color']} />\r\n </FormControl>\r\n </FormGroup>\r\n\r\n )\r\n}\r\n\r\n\r\nexport {TermsSettings};","\r\nimport React from 'react';\r\nimport {\r\n\tColorPicker,\r\n\tFormGroup,\r\n\tInput,\r\n\tFormControl,\r\n\tDropdown,\r\n\tCustomText,\r\n RichEditor,\r\n Icon,\r\n ButtonSelect,\r\n} from 'components';\r\nimport { ANNOUNCEMENT_POSITIONS } from 'lib/globals'\r\nimport styles from 'styles/cart_screen.module.scss';\r\n\r\n\r\nconst AnnouncementSettings = ({shopContext }) => {\r\n return (\r\n <FormGroup \r\n label=\"Announcement Banner\" \r\n info=\"Get your message across with banner.\" fullWidth\r\n >\r\n <FormControl\r\n label=\"Position in Cart Drawer\"\r\n withSwitch={[shopContext, \"settings.announcement.isActive\"]}\r\n >\r\n <Dropdown\r\n options={ANNOUNCEMENT_POSITIONS}\r\n first\r\n BindToContext={[shopContext, \"settings.announcement.position\"]}\r\n />\r\n </FormControl>\r\n <FormControl >\r\n <CustomText\r\n context={shopContext}\r\n label=\"Customize\"\r\n path=\"settings.announcement.text\"\r\n hasColor={true}\r\n />\r\n </FormControl>\r\n <FormControl >\r\n <ColorPicker text=\"Background\" BindToContext={[shopContext, 'settings.announcement.background']} />\r\n <ColorPicker text=\"Border\" BindToContext={[shopContext, 'settings.announcement.border']} />\r\n </FormControl>\r\n \r\n <FormControl label=\"Style\" >\r\n <Dropdown\r\n options={[\r\n { value: 'left', label: 'Left' },\r\n { value: 'center', label: 'Center' },\r\n { value: 'right', label: 'Right' },\r\n ]}\r\n first\r\n BindToContext={[ shopContext, 'settings.announcement.textAlignement']}\r\n />\r\n </FormControl>\r\n\r\n <FormControl >\r\n <ButtonSelect\r\n options={[\r\n {\r\n value: 'rounded',\r\n label: \"Rounded\",\r\n },\r\n {\r\n value: 'full',\r\n label: \"Full width\",\r\n },\r\n ]}\r\n showSeparator={true}\r\n BindToContext={[shopContext, 'settings.announcement.style']}\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n )\r\n\r\n}\r\n\r\nexport default AnnouncementSettings","var _path, _path2, _g, _defs;\n\nvar _excluded = [\"svgRef\", \"title\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar SvgCheck = function SvgCheck(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 28,\n height: 28,\n viewBox: \"0 0 28 28\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, /*#__PURE__*/React.createElement(\"g\", {\n clipPath: \"url(#clip0_3554_531)\"\n }, /*#__PURE__*/React.createElement(\"mask\", {\n id: \"mask0_3554_531\",\n style: {\n maskType: \"luminance\"\n },\n maskUnits: \"userSpaceOnUse\",\n x: 0,\n y: 0,\n width: 28,\n height: 28\n }, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14.0026 25.6667C15.535 25.6687 17.0527 25.3678 18.4684 24.7814C19.8841 24.195 21.17 23.3345 22.2521 22.2495C23.3371 21.1674 24.1975 19.8815 24.784 18.4658C25.3704 17.0501 25.6713 15.5324 25.6693 14.0001C25.6712 12.4677 25.3703 10.95 24.7839 9.5343C24.1975 8.11858 23.3371 6.8327 22.2521 5.75055C21.17 4.66557 19.8841 3.80513 18.4684 3.2187C17.0527 2.63227 15.535 2.3314 14.0026 2.33338C12.4702 2.33143 10.9526 2.63231 9.53686 3.21874C8.12114 3.80518 6.83526 4.66559 5.75311 5.75055C4.66816 6.8327 3.80774 8.11858 3.22131 9.5343C2.63488 10.95 2.33399 12.4677 2.33595 14.0001C2.33396 15.5324 2.63483 17.0501 3.22126 18.4658C3.8077 19.8815 4.66813 21.1674 5.75311 22.2495C6.83526 23.3345 8.12114 24.1949 9.53686 24.7814C10.9526 25.3678 12.4702 25.6687 14.0026 25.6667Z\",\n fill: \"white\",\n stroke: \"white\",\n strokeWidth: 4,\n strokeLinejoin: \"round\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.33594 14L12.8359 17.5L19.8359 10.5\",\n stroke: \"black\",\n strokeWidth: 4,\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\"\n }))), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n mask: \"url(#mask0_3554_531)\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M0 0H28V28H0V0Z\",\n fill: \"#3FB36D\"\n })))), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"clipPath\", {\n id: \"clip0_3554_531\"\n }, /*#__PURE__*/React.createElement(\"rect\", {\n width: 28,\n height: 28,\n fill: \"white\"\n })))));\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgCheck, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/check.fd1534ee.svg\";\nexport { ForwardRef as ReactComponent };","var _path;\n\nvar _excluded = [\"svgRef\", \"title\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar SvgWarning = function SvgWarning(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: 28,\n height: 28,\n viewBox: \"0 0 28 28\",\n fill: \"none\",\n ref: svgRef\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M14 0C6.3 0 0 6.3 0 14C0 21.7 6.3 28 14 28C21.7 28 28 21.7 28 14C28 6.3 21.7 0 14 0ZM12.9 6H15.1V17H12.9V6ZM14 23C13.2 23 12.5 22.3 12.5 21.5C12.5 20.7 13.2 20 14 20C14.8 20 15.5 20.7 15.5 21.5C15.5 22.3 14.8 23 14 23Z\",\n fill: \"#F5A34B\"\n })));\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgWarning, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/warning.e11c7b1a.svg\";\nexport { ForwardRef as ReactComponent };","export const LOGOS = [\r\n {\r\n src: \"https://s3-us-west-2.amazonaws.com/apps.static.resources/afterpay_green.png\"\r\n },\r\n {\r\n src: \"https://s3-us-west-2.amazonaws.com/apps.static.resources/afterpay_black.png\"\r\n },\r\n {\r\n src: \"https://s3-us-west-2.amazonaws.com/apps.static.resources/afterpay_white.png\"\r\n },\r\n]","\r\nimport React, { useState } from 'react';\r\nimport {\r\n FormControl,\r\n Icon,\r\n ImagePicker\r\n} from 'components';\r\nimport {\r\n faCheckCircle\r\n} from '@fortawesome/fontawesome-pro-solid';\r\nimport { LOGOS } from 'lib/afterPayLogos'\r\nimport classNames from 'lib/classNames';\r\n\r\nconst AfterPaySelector = ({ shopContext }) => {\r\n const {\r\n state: { settings: { afterPay } },\r\n setItem\r\n } = shopContext\r\n const [uploadedImage, setUploadedImage] = useState(afterPay.isExternal ? afterPay.image : null)\r\n const handleImageSelect = (image, isExternal = true) => {\r\n setItem(\"settings.afterPay.image\", image)\r\n setItem(\"settings.afterPay.isExternal\", isExternal)\r\n if (isExternal) {\r\n setUploadedImage(image)\r\n }\r\n }\r\n\r\n const selectedImage = afterPay?.image\r\n return (\r\n <>\r\n <FormControl label='Select payment provider' isSingleCol={true}>\r\n <div className={classNames('flex flex-wrap ')} >\r\n {\r\n LOGOS.map(({ src, id, style }, key) => {\r\n return (\r\n <div key={key} className={classNames('relative')} >\r\n <div key={id} className={classNames('rounded-full flex justify-center items-center m-2 cursor-pointer overflow-hidden')} style={style} onClick={() => handleImageSelect(src, false)}>\r\n <img style={{ height: \"25px\" }} src={src} />\r\n </div>\r\n {selectedImage === src && <div className={classNames('absolute top-0 right-0')}> <Icon icon={faCheckCircle} color=\"#2f80ed\" /> </div>}\r\n </div>\r\n )\r\n })\r\n }\r\n {\r\n !!uploadedImage &&\r\n <div className={classNames('flex relative')}>\r\n <div className={classNames('rounded-full flex justify-center items-center m-2 cursor-pointer overflow-hidden\t')} onClick={() => handleImageSelect(uploadedImage, true)}>\r\n <img style={{ height: \"25px\" }} src={uploadedImage} />\r\n </div>\r\n {selectedImage === uploadedImage && <div className={classNames('absolute top-0 right-0')}> <Icon icon={faCheckCircle} color=\"#2f80ed\" /> </div>}\r\n </div>\r\n }\r\n </div>\r\n <div className={classNames('m-2')}>\r\n <ImagePicker onChange={handleImageSelect} simplified={true} />\r\n </div>\r\n </FormControl>\r\n </>\r\n )\r\n\r\n}\r\n\r\nexport default AfterPaySelector","\r\nimport React from 'react';\r\nimport {\r\n\tFormGroup,\r\n\tInput,\r\n\tFormControl,\r\n\tCustomText,\r\n} from 'components';\r\nimport AfterPaySelector from \"./afterPaySelector\"\r\n\r\nconst AfterPay = ({shopContext }) => {\r\n return (\r\n <FormGroup \r\n label=\"Split Payments\" \r\n info=\"Communicate split payments offers within the cart. (only activate this if you have a split payment provider active on shopify checkout)\" fullWidth\r\n >\r\n <FormControl label=\"Customize\" withSwitch={[shopContext, \"settings.afterPay.isActive\"]}>\r\n <CustomText\r\n context={shopContext}\r\n \r\n path=\"settings.afterPay.text\"\r\n hasColor={true}\r\n indicator=\"{{installments}} {{split payment}}\"\r\n hasWeight=\"700\"\r\n />\r\n </FormControl>\r\n <AfterPaySelector shopContext={shopContext}/>\r\n <FormControl label='Select split payment quantity'>\r\n <Input min={2} BindToContext={[shopContext, \"settings.afterPay.splits\"]}/>\r\n </FormControl>\r\n </FormGroup>\r\n )\r\n\r\n}\r\n\r\nexport default AfterPay","import React, {\r\n useContext,\r\n Fragment,\r\n useEffect,\r\n useRef,\r\n useState,\r\n} from \"react\";\r\nimport { useMutation, useQuery } from \"@apollo/react-hooks\";\r\nimport PageScrollContext from \"context/PageScrollContext\";\r\nimport md5 from \"crypto-js/md5\";\r\nimport {\r\n Page,\r\n Range,\r\n ColorPicker,\r\n FormGroup,\r\n Input,\r\n Textarea,\r\n FormControl,\r\n Dropdown,\r\n Switch,\r\n CustomText,\r\n Icon,\r\n Button,\r\n Alert,\r\n VideoModal,\r\n RichEditor,\r\n ButtonSelect,\r\n MultiCurrencyModeAlerts,\r\n CodeEditor,\r\n} from \"components\";\r\nimport PreviewContext from \"context/PreviewContext\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport UserContext from \"context/UserContext\";\r\nimport {\r\n GOOGLE_FONTS,\r\n CAMPAIGN_TYPES,\r\n SHOP_DEFAULT_SETTINGS,\r\n BREAK_POINTS,\r\n} from \"lib/globals\";\r\nimport { SAVE_SHOP_SETTINGS, UPDATE_SHOP_PROP } from \"lib/mutations\";\r\nimport CheckoutButton from \"screens/campaigns/settings/ExtraModules/CheckoutButton\";\r\nimport { Loading, Toast, Modal } from \"@shopify/app-bridge-react\";\r\n\r\nimport { ShopConstraints } from \"Constraints\";\r\nimport removeTypeName, { removeByType } from \"lib/removeTypeName\";\r\nimport { Run } from \"lib/validate\";\r\nimport { GET_SHOP_SETTINGS, LIST_SHOP_CAMPAIGNS } from \"Queries\";\r\nimport { API, graphqlOperation } from \"aws-amplify\";\r\nimport { APP_DEV } from \"aws-exports\";\r\nimport Axios from \"axios\";\r\nimport { useTransition } from \"react-spring\";\r\nimport _ from \"lodash\";\r\nimport classNames from \"lib/classNames\";\r\nimport useReactRouter from \"use-react-router\";\r\nimport { SET_ALL, SET_ITEM } from \"reducers/SetItemReducer\";\r\nimport useRefState from \"hooks/useRefState\";\r\nimport { ScarcitySettings } from \"./settings/scarcity\";\r\nimport { BadgesSettings } from \"./settings/badges\";\r\nimport { TermsSettings } from \"./settings/terms\";\r\nimport AnnouncementSettings from \"./settings/announcement\";\r\nimport { getSessionToken } from \"@shopify/app-bridge-utils\";\r\nimport EmbeddedContext from \"context/EmbeddedContext\";\r\nimport { trackMixPanelEvent } from \"lib/mixpanel\";\r\nimport { Redirect } from \"@shopify/app-bridge/actions\";\r\nimport { ReactComponent as Rotate } from \"svgs/rotate.svg\";\r\nimport { ReactComponent as Check } from \"svgs/check.svg\";\r\nimport { ReactComponent as Warning } from \"svgs/warning.svg\";\r\nimport \"styles/custom.css\";\r\nimport AfterPay from \"./settings/afterPay\";\r\nimport { getIn, setIn } from \"immutable\";\r\n\r\nconst CartScreen = (props) => {\r\n const {\r\n setCartIsEmpty,\r\n previewBundlesVariantsPicker,\r\n setAutoDiscount,\r\n setShowSubscription,\r\n setCheckoutButtonLoadingEdit,\r\n campaign_preview_types,\r\n } = useContext(PreviewContext);\r\n const stickyAlert = useRef(null);\r\n const { history, location } = useReactRouter();\r\n const [scrollTop, setScrollTop, scrollTopRef] = useRefState();\r\n const [cartActivateLoading, setCartActivateLoading] = useState(false);\r\n const [videoOne, setVideoOne] = useState(false);\r\n const [googleFonts, setGoogleFonts] = useState([]);\r\n const [hideTopBar, setHideTopBar] = useState(false);\r\n const [embedInstructionsCollapsed, setEmbedInstructionsCollapsed] =\r\n useState(false);\r\n const [showConfirmActivate, setShowConfirmActivate] = useState(false);\r\n const [showInstallationModel, setShowInstallationModel] = useState(false);\r\n\r\n const [campaignActive, setCampaignActive] = useState(false);\r\n const [dataLoading, setDataLoading] = useState(true);\r\n const [subscriptionTab, setSubscriptionTab] = useState(\"unsubscribed\");\r\n\r\n const [cartType, setCartType] = useState(\"loading\");\r\n const [cartTextPrimary, setCartTextPrimary] = useState(\r\n \"Checking if Monster Cart is activated.\"\r\n );\r\n const [cartTextSecondary, setCartTextSecondary] = useState(\r\n \"We are checking your theme to see if monster cart is activated\"\r\n );\r\n const [cartButtonText, setCartButtonText] = useState(\"\");\r\n const [cartButtonType, setCartButtonType] = useState(\"\");\r\n\r\n const [campaign_preview_visible, setCampaign_preview_visible] =\r\n useState(false);\r\n const campaign_preview_content_ref = useRef(null);\r\n const shopContext = useContext(ShopContext);\r\n const { app, AppBridgeRedirect } = useContext(EmbeddedContext);\r\n const user = useContext(UserContext);\r\n const {\r\n state,\r\n discard,\r\n validationErrors,\r\n setValidationErrors,\r\n dispatch,\r\n setItem,\r\n AppLocalStorage,\r\n setup: { cartActive, cartLoading, setCartLoading },\r\n } = shopContext;\r\n const {\r\n campaigns,\r\n draft_checkout_alerted,\r\n multi_currency_checkout_alerted,\r\n } = state;\r\n // const filterSettings = (settings) =>\r\n // \t_.merge(\r\n // \t\t{},\r\n // \t\tSHOP_DEFAULT_SETTINGS(),\r\n // \t\tremoveByType(\r\n // \t\t\tremoveTypeName(\r\n // \t\t\t\tObject.fromEntries(Object.entries(settings).filter(([key]) => !['settingsSaved'].includes(key)))\r\n // \t\t\t),\r\n // \t\t\t(v) => v !== '' && v !== null\r\n // \t\t)\r\n // \t);\r\n const filterSettings = (settings) => {\r\n return removeByType(\r\n removeTypeName(\r\n Object.fromEntries(\r\n Object.entries(settings).filter(\r\n ([key]) => ![\"settingsSaved\"].includes(key)\r\n )\r\n )\r\n ),\r\n (v) => v !== \"\" && v !== null\r\n );\r\n\r\n return (\r\n _.mergeWith(\r\n SHOP_DEFAULT_SETTINGS(),\r\n removeByType(\r\n removeTypeName(\r\n Object.fromEntries(\r\n Object.entries(settings).filter(\r\n ([key]) => ![\"settingsSaved\"].includes(key)\r\n )\r\n )\r\n ),\r\n (v) => v !== \"\" && v !== null\r\n ),\r\n (v) => v !== \"\" && v !== null\r\n ),\r\n (objValue, srcValue) =>\r\n srcValue && _.isArray(srcValue) ? srcValue : undefined\r\n );\r\n };\r\n\r\n let [saveShopSettings, { data, error, loading }] = useMutation(\r\n SAVE_SHOP_SETTINGS,\r\n {\r\n refetchQueries: [\r\n {\r\n query: GET_SHOP_SETTINGS,\r\n variables: {\r\n userId: user.attributes.website,\r\n },\r\n },\r\n ],\r\n }\r\n );\r\n const transitions = useTransition(\r\n !_.isEqual(state.original_settings, state.settings) && !hideTopBar,\r\n null,\r\n {\r\n from: { position: \"absolute\", opacity: 0 },\r\n enter: { opacity: 1 },\r\n leave: { opacity: 0 },\r\n config: {\r\n duration: 300,\r\n },\r\n }\r\n );\r\n const validate = (state, specific = []) =>\r\n Run(state, specific, {\r\n errors: validationErrors,\r\n setErrors: setValidationErrors,\r\n constraints: ShopConstraints,\r\n });\r\n const save = (assign = {}, checkRTL = true) => {\r\n if (validate(state)) {\r\n // console.log(\"validationErrors\",validationErrors,validate(state));\r\n return;\r\n }\r\n // if (\r\n // checkRTL &&\r\n // Object.keys(state.original_settings || {}).length &&\r\n // state.settings.rtl !== state.original_settings.rtl\r\n // ) {\r\n // return activateCart(state.settings.active, true, state.settings.rtl);\r\n // }\r\n\r\n if (!AppLocalStorage.getItem(\"first_cart_turn_on\"))\r\n AppLocalStorage.setItem(\"first_cart_turn_on\", true);\r\n\r\n saveShopSettings({\r\n variables: {\r\n id: user.attributes.website,\r\n input: filterSettings(Object.assign(state.settings, assign)),\r\n },\r\n });\r\n };\r\n\r\n let campaign_data = useQuery(LIST_SHOP_CAMPAIGNS, {\r\n variables: {\r\n userId: user.attributes.sub,\r\n },\r\n fetchPolicy: \"network-only\",\r\n });\r\n\r\n const activateCart = async (\r\n active,\r\n confirmed = false,\r\n rtl = null,\r\n disableLoading = true\r\n ) => {\r\n if (\r\n active &&\r\n !confirmed &&\r\n !state.settingsSaved &&\r\n _.isEqual(SHOP_DEFAULT_SETTINGS, state.settings)\r\n ) {\r\n return setShowConfirmActivate(true);\r\n }\r\n setCartActivateLoading(true);\r\n const { success } = await API.post(\"API_GATEWAY_NEW\", \"/cart/activate\", {\r\n body: { active, rtl: rtl === null ? state.settings.rtl : rtl },\r\n });\r\n if (disableLoading) setCartActivateLoading(false);\r\n\r\n if (!AppLocalStorage.getItem(\"first_cart_turn_on\")) {\r\n AppLocalStorage.setItem(\"first_cart_turn_on\", true);\r\n trackMixPanelEvent(\"First cart turn ON\", state?.id);\r\n }\r\n return save({ active }, false);\r\n };\r\n\r\n const handleOutSideClick = (event) => {\r\n if (!campaign_preview_content_ref.current) return;\r\n else if (campaign_preview_content_ref.current.contains(event.target))\r\n return;\r\n setCampaign_preview_visible(false);\r\n };\r\n\r\n const toggle_type = (type, value) => {\r\n if (value) {\r\n campaign_preview_types.set([\r\n ...new Set(campaign_preview_types.get.concat([type])),\r\n ]);\r\n } else {\r\n campaign_preview_types.set(\r\n campaign_preview_types.get.filter((c) => c !== type)\r\n );\r\n }\r\n };\r\n\r\n const type_is_active = (type) => {\r\n const typeIndex = campaign_preview_types.get.indexOf(type);\r\n return typeIndex !== -1 ? true : false;\r\n };\r\n\r\n useEffect(() => {\r\n if (campaign_preview_visible)\r\n document.addEventListener(\"mousedown\", handleOutSideClick, false);\r\n else document.removeEventListener(\"mousedown\", handleOutSideClick, false);\r\n return () => {\r\n document.removeEventListener(\"mousedown\", handleOutSideClick, false);\r\n };\r\n }, [campaign_preview_visible]);\r\n\r\n useEffect(() => {\r\n const { data } = campaign_data;\r\n if (data) {\r\n if (data.campaigns?.list?.length) {\r\n setCampaignActive(\r\n !!data.campaigns.list.find((campaign) => campaign.active)\r\n );\r\n }\r\n setDataLoading(false);\r\n }\r\n }, [campaign_data]);\r\n\r\n useEffect(() => {\r\n // if (typeof state.settings.multiCurrencyMode !== 'boolean') {\r\n // \tsetItem('settings.multiCurrencyMode', false);\r\n // }\r\n async function getGoogleFonts() {\r\n const { data } = await Axios.get(\r\n `https://www.googleapis.com/webfonts/v1/webfonts?sort=popularity&key=AIzaSyCYLq50twmAe1_7jITZuehrERZWOjNqBCY`\r\n );\r\n setGoogleFonts(\r\n data.items.map(({ family, variants }) => ({\r\n label: family,\r\n value: `${family}:${variants.join()}`,\r\n }))\r\n );\r\n }\r\n getGoogleFonts();\r\n }, []);\r\n\r\n const redirectToCheckoutSettings = (e) => {\r\n e.preventDefault();\r\n if (!scrollTopRef.current) return;\r\n const padding =\r\n 1.5 * parseFloat(getComputedStyle(document.documentElement).fontSize);\r\n scrollTopRef.current(\r\n document\r\n .getElementById(`id_${md5(\"checkout settings\")}`)\r\n .closest(\".mu-group-wrapper\").offsetTop - 0\r\n );\r\n };\r\n\r\n const sticky_path = \"settings.modules.checkout_button.fix_checkout_container\";\r\n const lower_path = \"settings.product.grow\";\r\n \r\n const getCheckoutPosition = () => {\r\n const lower_checkout_container = getIn(\r\n shopContext.state,\r\n lower_path.split(\".\")\r\n );\r\n const fix_checkout_container = getIn(\r\n shopContext.state,\r\n sticky_path.split(\".\")\r\n );\r\n if (fix_checkout_container) return \"sticky\";\r\n if (lower_checkout_container) return \"lower\";\r\n return \"higher\";\r\n };\r\n\r\n const [checkoutPosition, setCheckoutPosition] = useState(\r\n getCheckoutPosition()\r\n );\r\n\r\n const handleCheckoutPosition = (value) => {\r\n const isSticky = value === \"sticky\";\r\n const isLower = value === \"lower\";\r\n\r\n setIn(shopContext.state, sticky_path.split(\".\"), isSticky);\r\n shopContext.setItem(sticky_path, isSticky);\r\n\r\n setIn(shopContext.state, lower_path.split(\".\"), isLower);\r\n shopContext.setItem(lower_path, isLower);\r\n\r\n setCheckoutPosition(isSticky ? \"sticky\" : isLower ? \"lower\" : \"higher\");\r\n };\r\n\r\n const updateCheckoutText = (value) => {\r\n const path = \"settings.modules.checkout_button.button_text.text\";\r\n const checkout_text = getIn(shopContext.state, path.split(\".\"));\r\n const regex = /(\\{\\s*)?\\{\\s*subtotal\\s*\\}\\s*(\\})?/gi;\r\n let new_text = checkout_text;\r\n\r\n if (value) {\r\n if (!regex.test(checkout_text)) {\r\n new_text += \" / {{subtotal}}\";\r\n }\r\n } else {\r\n new_text = checkout_text.replace(\r\n /\\s*?\\/?\\s*-?\\s*?\\{\\{\\s*subtotal\\s*\\}\\}\\s*/,\r\n \"\"\r\n );\r\n }\r\n\r\n setIn(shopContext.state, path.split(\".\"), new_text);\r\n shopContext.setItem(path, new_text);\r\n };\r\n\r\n const updateShopProps = async (input) => {\r\n const authToken = `Bearer ${await getSessionToken(app)}`;\r\n await API.graphql(\r\n graphqlOperation(\r\n UPDATE_SHOP_PROP,\r\n {\r\n id: user.attributes.website,\r\n input,\r\n },\r\n authToken\r\n )\r\n );\r\n Object.entries(input).forEach(([key, value]) => {\r\n setItem(key, value);\r\n });\r\n };\r\n\r\n useEffect(() => {\r\n setHideTopBar(!!data);\r\n if (APP_DEV) {\r\n const timeout = setTimeout(() => setHideTopBar(false), 1500);\r\n return () => clearTimeout(timeout);\r\n }\r\n }, [data]);\r\n\r\n useEffect(() => {\r\n if (state.settings.cod_settings.checkout_mode == \"cod_and_checkout\") {\r\n setItem(\"settings.cod_settings.is_form_in_cart\", false);\r\n }\r\n }, [state.settings.cod_settings]);\r\n\r\n useEffect(() => {\r\n if (cartLoading) {\r\n setCartType(\"loading\");\r\n setCartTextPrimary(\"Checking if Monster Cart is activated.\");\r\n setCartTextSecondary(\r\n \"We are checking your theme to see if monster cart is activated\"\r\n );\r\n setCartButtonText(\"\");\r\n setCartButtonType(\"\");\r\n } else {\r\n if (cartActive) {\r\n setCartType(\"success\");\r\n setCartTextPrimary(\r\n \"Monster Cart is <span style='color: #3FB36D;'>active on theme</span>\"\r\n );\r\n setCartTextSecondary(\r\n \"Your cart is currently active on your live theme.\"\r\n );\r\n setCartButtonText(\"Disable\");\r\n setCartButtonType(\"default\");\r\n } else {\r\n setCartType(\"warning\");\r\n setCartTextPrimary(\"Monster Cart is not activated on your theme.\");\r\n setCartTextSecondary(\r\n \"Click “activate†and then click “save†in your theme editor.\"\r\n );\r\n setCartButtonText(\"Activate\");\r\n setCartButtonType(\"warning2\");\r\n }\r\n }\r\n }, [cartActive, cartLoading]);\r\n\r\n return (\r\n <Page\r\n background=\"none\"\r\n getScrollTop={({ scrollTop }) => {\r\n setScrollTop(scrollTop);\r\n }}\r\n padding={0}\r\n header={{\r\n title: \"Settings\",\r\n }}\r\n TopContent={{\r\n transitions,\r\n render: () => (\r\n <Alert\r\n type=\"save_settings\"\r\n title=\"unsaved changes\"\r\n borderPosition=\"none\"\r\n paddingX=\"px-6\"\r\n actions={[\r\n {\r\n text: \"Discard\",\r\n type: \"secondary\",\r\n loading: false,\r\n onClick: () => discard(),\r\n },\r\n {\r\n text: \"Save\",\r\n type: \"primary\",\r\n loading: loading || cartActivateLoading,\r\n onClick: () => save(),\r\n },\r\n ]}\r\n />\r\n ),\r\n }}\r\n >\r\n <Fragment>\r\n {data && (\r\n <Toast\r\n content=\"Cart settings has been saved\"\r\n duration={3000}\r\n onDismiss={() => {\r\n setHideTopBar(false);\r\n }}\r\n />\r\n )}\r\n {(loading || cartActivateLoading) && <Loading />}\r\n {/* <div className={classNames(\"bg-white rounded overflow-hidden shadow mb-10\")}>\r\n <div className={classNames(\"flex-center border-b px-3 py-1 text-gray-600\")}>\r\n <b className={classNames(\"flex-1 font-semibold text-base uppercase-first\")}>Activation instructions</b>\r\n <button className={classNames(\"w-10 h-10 flex-center hover:bg-gray-200 rounded-full focus:outline-none\")} onClick={() => setEmbedInstructionsCollapsed(!embedInstructionsCollapsed)}>\r\n <Icon icon=\"angle-up\" style={{\r\n transform: embedInstructionsCollapsed ? \"rotate(180deg)\" : undefined\r\n }}\r\n />\r\n </button>\r\n </div>\r\n <div className={classNames(\"text-gray-600 text-sm\")} style={{\r\n height: embedInstructionsCollapsed ? 0 : undefined\r\n }}>\r\n <div className={classNames(\"p-3\")}>\r\n <div className={classNames(\"leading-loose mb-3\")}>\r\n <p>When you click \"Preview in theme\" you will be redirected to your Shopify theme editor where you can turn your cart ON and OFF.</p>\r\n <p>All you need to do is enable/disable MonsterUpsells and click save.</p>\r\n </div>\r\n <img className={classNames(\"border rounded\")} src={`${window.location.origin}/static/images/embed-screenshot.jpg`} />\r\n <div className={classNames(\"flex flex-row-reverse mt-3\")}>\r\n <Button type=\"primary\" text=\"Preview in theme\" className={classNames(\"ml-3\")} />\r\n <Button type=\"secondary\" text=\"Watch video tutorial\" />\r\n </div>\r\n </div>\r\n </div>\r\n </div> */}\r\n <Alert\r\n type={cartType}\r\n title={cartTextPrimary}\r\n className=\"z-5\"\r\n icon={\r\n cartLoading ? (\r\n <Rotate className=\"rotating\" />\r\n ) : cartActive ? (\r\n <Check />\r\n ) : (\r\n <Warning />\r\n )\r\n }\r\n customSvg={true}\r\n actions={\r\n !cartLoading && [\r\n {\r\n text: cartButtonText,\r\n type: cartButtonType,\r\n loading: cartLoading,\r\n onClick: async () => {\r\n setCartLoading(true);\r\n if (!state.settingsSaved) {\r\n await save();\r\n }\r\n setShowInstallationModel(true);\r\n },\r\n },\r\n ]\r\n }\r\n >\r\n <p>{cartTextSecondary}</p>\r\n </Alert>\r\n {!AppLocalStorage?.getItem(\"first_cart_turn_on\") && (\r\n <Alert type={\"info\"} className=\"z-5 mt-4\">\r\n <p\r\n className={classNames(\r\n \"text-gray-600 text-md not-italic font-medium\"\r\n )}\r\n >\r\n Nearly there! ... Design Your Cart, Click “Save†{\">>\"} Then Click\r\n “Activateâ€\r\n </p>\r\n </Alert>\r\n )}\r\n {cartActive && !campaignActive && !dataLoading && (\r\n <Alert\r\n type={\"info\"}\r\n className=\"z-5 mt-4\"\r\n actions={[\r\n {\r\n text: \"Add Upsell\",\r\n type: \"info\",\r\n onClick: () => {\r\n history.push(\"/campaigns/create\" + location.search);\r\n },\r\n },\r\n ]}\r\n >\r\n <p\r\n className={classNames(\r\n \"text-gray-600 text-md not-italic font-medium\"\r\n )}\r\n >\r\n Cart is live! 👠Now add your first upsell campaign.\r\n </p>\r\n </Alert>\r\n )}\r\n <Modal\r\n size=\"Large\"\r\n title=\"Installation\"\r\n open={!!showInstallationModel}\r\n primaryAction={{\r\n content: \"Open Editor\",\r\n onAction: function () {\r\n const activateAppId = APP_DEV\r\n ? \"13fae760-4743-463c-aaeb-80cebaccc364\"\r\n : \"a1b8e58a-bf1d-4e0f-8768-a387c3f643c0\";\r\n const deepLink = `/themes/current/editor?context=apps&template=product&activateAppId=${activateAppId}/app-embed`;\r\n AppBridgeRedirect.dispatch(Redirect.Action.ADMIN_PATH, {\r\n path: deepLink,\r\n newContext: true,\r\n });\r\n },\r\n }}\r\n secondaryActions={[\r\n {\r\n content: \"Watch Tutorial\",\r\n onAction: () => {\r\n AppBridgeRedirect.dispatch(Redirect.Action.REMOTE, {\r\n url: \"https://monsterapps.crisp.help/en/article/activate-deactivate-monster-cart-19okfn1/\",\r\n newContext: true,\r\n });\r\n },\r\n },\r\n ]}\r\n src={`${window.location.origin}/AppThemeExtensionInstallation.html`}\r\n onClose={() => setShowInstallationModel(false)}\r\n />\r\n <Alert\r\n {...{\r\n forwardRef: stickyAlert,\r\n type: state.settings.active ? \"success\" : \"warning\",\r\n title: `custom cart is ${\r\n state.settings.active ? \"enabled\" : \"disabled\"\r\n }`,\r\n withSwitch: {\r\n context: [\r\n shopContext,\r\n \"settings.active\",\r\n (value) => activateCart(value),\r\n ],\r\n },\r\n icon: state.settings.active ? \"check-circle\" : \"exclamation-circle\",\r\n }}\r\n className=\"z-5 hidden\"\r\n >\r\n {state.settings.active && (\r\n <p>\r\n Cart button not working? Click to{\" \"}\r\n <span\r\n href=\"#\"\r\n className={classNames(\"font-bold underline cursor-pointer\")}\r\n onClick={() => {\r\n history.push(\"/settings/setup\" + location.search);\r\n }}\r\n >\r\n manually setup\r\n </span>\r\n </p>\r\n )}\r\n {!state.settings.active && (\r\n <p>Customize default cart settings / visuals and set it live.</p>\r\n )}\r\n </Alert>\r\n {/* {campaigns.length === 0 && (\r\n <Alert\r\n {...{\r\n type: \"warning\",\r\n borderPosition: \"border-l-4\",\r\n iconSize: \"2x\",\r\n title: \"Create your first campaign\",\r\n icon: \"exclamation-circle\",\r\n customStyle: {\r\n icon: \"text-orange-400 self-start mt-1\",\r\n },\r\n }}\r\n className=\"my-6 z-5\"\r\n >\r\n <p>Visit Campaign Page To Create Your 1st Upsell Campaign.</p>\r\n <div className={classNames(\"flex space-x-3 pt-3 justify-start\")}>\r\n <a\r\n className={classNames(\r\n \"text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded\"\r\n )}\r\n onClick={() =>\r\n history.push(\"campaigns/create\" + location.search)\r\n }\r\n >\r\n <Icon icon=\"info-circle\" className=\"mr-2\" size=\"1x\" />\r\n <span className={classNames(\"text-xs\")}>Create campaign</span>\r\n </a>\r\n </div>\r\n </Alert>\r\n )} */}\r\n\r\n <Modal\r\n title=\"Activating custom cart\"\r\n message=\"You're about to activate the cart with the default settings\"\r\n open={!!showConfirmActivate}\r\n primaryAction={{\r\n content: \"Activate\",\r\n destructive: true,\r\n onAction: () => {\r\n setShowConfirmActivate(false);\r\n activateCart(true, true);\r\n },\r\n }}\r\n secondaryActions={[\r\n {\r\n content: \"Cancel\",\r\n onAction: () => {\r\n setShowConfirmActivate(false);\r\n discard();\r\n },\r\n },\r\n ]}\r\n />\r\n <MultiCurrencyModeAlerts\r\n {...{\r\n ...state,\r\n redirectToCheckoutSettings,\r\n IUnderstand: updateShopProps,\r\n }}\r\n />\r\n\r\n <FormGroup\r\n label=\"Basic Cart Design\"\r\n info=\"Design theme of cart\"\r\n collapsable\r\n isOpen={false}\r\n >\r\n <FormControl label=\"Default language\">\r\n <Dropdown\r\n options={[\r\n { value: \"english\", label: \"English\" },\r\n { value: \"french\", label: \"Français\" },\r\n { value: \"german\", label: \"German\" },\r\n { value: \"arabic\", label: \"العربية\" },\r\n ]}\r\n first\r\n autoFocus={true}\r\n BindToContext={[\r\n shopContext,\r\n \"settings.default_language\",\r\n (language) => {\r\n dispatch({\r\n type: SET_ALL,\r\n value: {\r\n ...state,\r\n settings: SHOP_DEFAULT_SETTINGS(language),\r\n },\r\n });\r\n },\r\n \"settings\",\r\n ]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Colors\"\r\n error={validationErrors[\"settings.theme.background\"]}\r\n >\r\n <ColorPicker\r\n text=\"Primary\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.theme.primary\",\r\n (value) => {\r\n dispatch({\r\n type: SET_ALL,\r\n value: {\r\n ...state,\r\n settings: {\r\n ...state.settings,\r\n modules: {\r\n ...state.settings.modules,\r\n checkout_button: {\r\n ...state.settings.modules.checkout_button,\r\n background: value,\r\n savings: {\r\n ...state.settings.modules.checkout_button.savings,\r\n color: value,\r\n },\r\n },\r\n },\r\n theme: {\r\n ...state.settings.theme,\r\n primary: value,\r\n },\r\n },\r\n },\r\n });\r\n },\r\n ]}\r\n />\r\n <ColorPicker\r\n text=\"Secondary\"\r\n BindToContext={[shopContext, \"settings.theme.secondary\"]}\r\n />\r\n <ColorPicker\r\n text=\"Text On Cart\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.theme.textColor\",\r\n (value) => {\r\n dispatch({\r\n type: SET_ALL,\r\n value: {\r\n ...state,\r\n settings: {\r\n ...state.settings,\r\n modules: {\r\n ...state.settings.modules,\r\n checkout_button: {\r\n ...state.settings.modules.checkout_button,\r\n subtotal: {\r\n ...state.settings.modules.checkout_button\r\n .subtotal,\r\n color: value,\r\n },\r\n },\r\n },\r\n theme: {\r\n ...state.settings.theme,\r\n textColor: value,\r\n },\r\n product: {\r\n ...state.settings.product,\r\n // title: {\r\n // ...state.settings.product.title,\r\n // color: value,\r\n // },\r\n price: {\r\n ...state.settings.product.price,\r\n color: value,\r\n },\r\n },\r\n },\r\n },\r\n });\r\n },\r\n ]}\r\n />\r\n <ColorPicker\r\n text=\"Text On Buttons\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.theme.buttonColor\",\r\n (value) => {\r\n dispatch({\r\n type: SET_ALL,\r\n value: {\r\n ...state,\r\n settings: {\r\n ...state.settings,\r\n modules: {\r\n ...state.settings.modules,\r\n checkout_button: {\r\n ...state.settings.modules.checkout_button,\r\n button_text: {\r\n ...state.settings.modules.checkout_button\r\n .button_text,\r\n color: value,\r\n },\r\n },\r\n },\r\n theme: {\r\n ...state.settings.theme,\r\n buttonColor: value,\r\n },\r\n },\r\n },\r\n });\r\n },\r\n ]}\r\n />\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[shopContext, \"settings.theme.background\"]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"default font size\"\r\n info=\"This font effects all other cart font sizes\"\r\n error={validationErrors[\"settings.font.size\"]}\r\n >\r\n <Input\r\n type=\"number\"\r\n icon={{ char: \"PX\" }}\r\n max={18}\r\n min={12}\r\n BindToContext={[shopContext, \"settings.font.size\"]}\r\n hasError={!!validationErrors[\"settings.font.size\"]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"choose font\"\r\n withSwitch={[shopContext, \"settings.font.custom\"]}\r\n info=\"By default the cart will use your store theme font. Turn this section on to add a custom google font.\"\r\n >\r\n <Dropdown\r\n disabled={!state.settings.font.custom || !googleFonts.length}\r\n options={googleFonts}\r\n first\r\n BindToContext={[shopContext, \"settings.font.family\"]}\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n <FormGroup\r\n label=\"advanced design settings\"\r\n info=\"Finetune Cart Visuals\"\r\n collapsable\r\n >\r\n <FormGroup label=\"header\" fullWidth>\r\n <CustomText\r\n context={shopContext}\r\n label=\"cart title\"\r\n path=\"settings.header.title\"\r\n hasWeight=\"600\"\r\n // info=\"The em unit is relative to the font size (2em means 2 times the current font size)\"\r\n />\r\n <FormControl\r\n label=\"header colors\"\r\n error={validationErrors[\"settings.header.background\"]}\r\n >\r\n <ColorPicker\r\n text=\"text\"\r\n BindToContext={[shopContext, \"settings.header.title.color\"]}\r\n />\r\n <ColorPicker\r\n text=\"background\"\r\n BindToContext={[shopContext, \"settings.header.background\"]}\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n <FormGroup\r\n label=\"cart\"\r\n info=\"Design the basic cart visuals\"\r\n fullWidth\r\n >\r\n <CustomText\r\n context={shopContext}\r\n label=\"product title\"\r\n path=\"settings.product.title\"\r\n hasColor={true}\r\n hasWeight=\"600\"\r\n />\r\n <CustomText\r\n context={shopContext}\r\n label=\"product price\"\r\n path=\"settings.product.price\"\r\n hasColor={true}\r\n hasWeight=\"600\"\r\n />\r\n <FormControl\r\n label=\"product image size\"\r\n info=\"an integer between 50 and 120\"\r\n error={validationErrors[\"settings.product.image_size\"]}\r\n >\r\n <Input\r\n type=\"number\"\r\n BindToContext={[shopContext, \"settings.product.image_size\"]}\r\n min={50}\r\n max={120}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Checkout Button Position\"\r\n info={\r\n \"Sticky: Always Visible At Bottom of cart (Suggested)\\nLower: Sits at Bottom of Page until product push it down further.\\nHigher: Sits Under Product Section And Scrolls Down as more products are added.\"\r\n }\r\n >\r\n <Dropdown\r\n options={[\r\n {\r\n value: \"sticky\",\r\n label: \"Sticky\",\r\n },\r\n {\r\n value: \"higher\",\r\n label: \"Higher\",\r\n },\r\n {\r\n value: \"lower\",\r\n label: \"Lower\",\r\n },\r\n ]}\r\n value={checkoutPosition}\r\n onChange={handleCheckoutPosition}\r\n />\r\n </FormControl>\r\n {/* <FormControl\r\n label=\"lower checkout button\"\r\n info=\"Checkout button will sit at the bottom of screen unless products push it lower.\"\r\n error={validationErrors[\"settings.product.grow\"]}\r\n >\r\n <Switch BindToContext={[shopContext, \"settings.product.grow\"]} />\r\n </FormControl>\r\n <FormControl\r\n label=\"sticky checkout button\"\r\n info=\"Keeps the checkout button fixed at the bottom, always visible and not pushed down by products.\"\r\n error={\r\n validationErrors[\r\n \"settings.modules.checkout_button.fix_checkout_container\"\r\n ]\r\n }\r\n >\r\n <Switch\r\n BindToContext={[\r\n shopContext,\r\n \"settings.modules.checkout_button.fix_checkout_container\",\r\n ]}\r\n />\r\n </FormControl> */}\r\n <FormControl\r\n label=\"subtotal within checkout\"\r\n info=\"Choose to integrate the subtotal within the checkout button or display it separately.\"\r\n error={\r\n validationErrors[\r\n \"settings.modules.checkout_button.show_subtotal\"\r\n ]\r\n }\r\n >\r\n <Switch\r\n BindToContext={[\r\n shopContext,\r\n \"settings.modules.checkout_button.show_subtotal\",\r\n updateCheckoutText,\r\n ]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Add to cart opens Cart\"\r\n info=\"Every time a customer adds to cart the slide cart will appears. (We recommended leaving this on.)\"\r\n error={validationErrors[\"settings.open_cart\"]}\r\n >\r\n <Switch BindToContext={[shopContext, \"settings.open_cart\"]} />\r\n </FormControl>\r\n <FormControl\r\n label=\"sold out\"\r\n error={validationErrors[\"settings.product.sold_out\"]}\r\n >\r\n <Input\r\n type=\"text\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.product.sold_out\",\r\n null,\r\n \"settings\",\r\n ]}\r\n hasError={!!validationErrors[\"settings.product.sold_out\"]}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"empty cart\"\r\n info={`Displayed when no products are in the cart.\r\n\t\t\t\t\t\t\tTip: you can add images`}\r\n >\r\n <RichEditor\r\n placeholder=\"empty cart text\"\r\n BindToContext={[shopContext, \"settings.empty_cart\"]}\r\n onFocus={() => {\r\n setCartIsEmpty(true);\r\n }}\r\n onBlur={(editor, activeElement) => {\r\n if (!editor.contains(activeElement)) setCartIsEmpty(false);\r\n }}\r\n />\r\n </FormControl>\r\n <FormControl\r\n label=\"Empty cart - Continue shopping button\"\r\n info=\"Make it easy for customers to continue shopping\"\r\n withSwitch={[\r\n shopContext,\r\n \"settings.active_continue_shopping_button\",\r\n ]}\r\n >\r\n {state.settings.active_continue_shopping_button && (\r\n <CustomText\r\n context={shopContext}\r\n placeholder=\"Continue shopping\"\r\n hasColor={true}\r\n path=\"settings.continue_shopping_button\"\r\n onFocus={() => {\r\n setCartIsEmpty(true);\r\n }}\r\n onBlur={() => {\r\n setCartIsEmpty(false);\r\n }}\r\n hasWeight={true}\r\n />\r\n )}\r\n </FormControl>\r\n </FormGroup>\r\n\r\n <FormGroup\r\n label=\"Auto discount style\"\r\n onFocus={() => setAutoDiscount(true)}\r\n onBlur={() => setAutoDiscount(false)}\r\n fullWidth\r\n >\r\n <CustomText\r\n context={shopContext}\r\n label=\"text\"\r\n path=\"settings.auto_discount.text\"\r\n hasColor={true}\r\n hasWeight=\"700\"\r\n beta\r\n />\r\n <FormControl>\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.auto_discount.background\",\r\n ]}\r\n />\r\n <ColorPicker\r\n text=\"Border\"\r\n BindToContext={[shopContext, \"settings.auto_discount.border\"]}\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n <FormGroup\r\n label=\"Subscription upgrades\"\r\n fullWidth\r\n withSwitch={[shopContext, \"settings.subscription.isActive\"]}\r\n onFocus={() => setShowSubscription(true)}\r\n onBlur={() => setShowSubscription(false)}\r\n beta\r\n >\r\n {state.settings.subscription?.isActive && (\r\n <>\r\n <div className={classNames(\"flex-center pt-5 mb-3\")}>\r\n <button\r\n className={classNames(\r\n \"text-sm focus:outline-none py-2 px-3 font-semibold border-2 rounded-l border-r-none border-blue-500\",\r\n {\r\n \"bg-blue-500 text-white\":\r\n subscriptionTab === \"unsubscribed\",\r\n \"bg-white text-blue-500\":\r\n subscriptionTab !== \"unsubscribed\",\r\n }\r\n )}\r\n onClick={() => setSubscriptionTab(\"unsubscribed\")}\r\n >\r\n Unsubscribed\r\n </button>\r\n <button\r\n className={classNames(\r\n \"relative text-sm focus:outline-none py-2 px-3 font-semibold border-t-2 border-b-2 border-blue-500\",\r\n {\r\n \"bg-blue-500 text-white\": subscriptionTab === \"loading\",\r\n \"bg-white text-blue-500\": subscriptionTab !== \"loading\",\r\n }\r\n )}\r\n onClick={() => setSubscriptionTab(\"loading\")}\r\n >\r\n Loading\r\n </button>\r\n <button\r\n className={classNames(\r\n \"text-sm focus:outline-none py-2 px-3 font-semibold border-2 rounded-r border-l-none border-blue-500\",\r\n {\r\n \"bg-blue-500 text-white\":\r\n subscriptionTab === \"subscribed\",\r\n \"bg-white text-blue-500\":\r\n subscriptionTab !== \"subscribed\",\r\n }\r\n )}\r\n onClick={() => setSubscriptionTab(\"subscribed\")}\r\n >\r\n Subscribed\r\n </button>\r\n </div>\r\n {subscriptionTab === \"unsubscribed\" && (\r\n <>\r\n <CustomText\r\n context={shopContext}\r\n label=\"subscribe text\"\r\n path=\"settings.subscription.text\"\r\n hasColor={true}\r\n hasWeight=\"700\"\r\n info=\"use {{plans_group_name}} to display the subscriptions group name, ex: (Subscribe & Save 10%)\"\r\n />\r\n <FormControl>\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.subscription.background\",\r\n ]}\r\n />\r\n <ColorPicker\r\n text=\"Border\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.subscription.border\",\r\n ]}\r\n />\r\n </FormControl>\r\n </>\r\n )}\r\n {subscriptionTab === \"loading\" && (\r\n <>\r\n <CustomText\r\n context={shopContext}\r\n label=\"upgrading text\"\r\n path=\"settings.subscription.upgradingText\"\r\n hasColor={true}\r\n hasWeight=\"700\"\r\n />\r\n <CustomText\r\n context={shopContext}\r\n label=\"downgrading text\"\r\n path=\"settings.subscription.downgradingText\"\r\n hasColor={true}\r\n hasWeight=\"700\"\r\n />\r\n <FormControl>\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.subscription.loadingBackground\",\r\n ]}\r\n />\r\n <ColorPicker\r\n text=\"Border\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.subscription.loadingBorder\",\r\n ]}\r\n />\r\n </FormControl>\r\n </>\r\n )}\r\n {subscriptionTab === \"subscribed\" && (\r\n <>\r\n <CustomText\r\n context={shopContext}\r\n label=\"subscribed text\"\r\n path=\"settings.subscription.subscribedText\"\r\n hasColor={true}\r\n hasWeight=\"700\"\r\n info=\"use {{selling_plan_name}} to display the selected plan name, ex: (Monthly Subscription)\"\r\n />\r\n <FormControl>\r\n <ColorPicker\r\n text=\"Background\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.subscription.subscribedBackground\",\r\n ]}\r\n />\r\n <ColorPicker\r\n text=\"Border\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.subscription.subscribedBorder\",\r\n ]}\r\n />\r\n </FormControl>\r\n </>\r\n )}\r\n <a\r\n className={classNames(\r\n \"w-full cursor-pointer hover:underline flex-1 mt-6 text-gray-500 text-xs italic mb-1\"\r\n )}\r\n href=\"https://monsterapps.crisp.help/en/article/subscription-apps-subscribe-in-cart-giteo5/?bust=1726664071981&fbclid=IwY2xjawFjVcJleHRuA2FlbQIxMAABHVf2wiS31mKi6CfqqRw28L9z4OPn2grGtJl4PrQZyP7TQM4PNi1WNo_j6Q_aem_ttRHtjqNu4zJqEd-85JT_A\"\r\n target=\"_blank\"\r\n >\r\n Click here to see the list of compatible apps\r\n </a>\r\n </>\r\n )}\r\n </FormGroup>\r\n <CheckoutButton\r\n context={shopContext}\r\n setCheckoutButtonLoadingEdit={setCheckoutButtonLoadingEdit}\r\n />\r\n\r\n <FormControl\r\n label=\"display cart on RTL\"\r\n withSwitch={[shopContext, \"settings.rtl\"]}\r\n info=\"Enable this if your store language uses right to left scripts.\"\r\n />\r\n <FormControl\r\n label=\"Curve corners\"\r\n withSwitch={[shopContext, \"settings.curved\"]}\r\n info=\"Turn curved corners on and off.\"\r\n />\r\n <FormControl\r\n label=\"Display compare price\"\r\n info=\"Show Shopify product compare pricing in cart.\"\r\n withSwitch={[shopContext, \"settings.count_compare_at\"]}\r\n />\r\n </FormGroup>\r\n <FormGroup\r\n label=\"extra features\"\r\n info=\"Timer, Split Payments, Badges Banners ect.\"\r\n collapsable\r\n >\r\n <AfterPay shopContext={shopContext} />\r\n <ScarcitySettings {...{ shopContext }} />\r\n <BadgesSettings {...{ shopContext }} />\r\n <TermsSettings {...{ shopContext }} />\r\n <AnnouncementSettings {...{ shopContext }} />\r\n </FormGroup>\r\n <FormGroup label=\"advanced cart settings\" collapsable>\r\n <FormGroup label=\"Custom CSS\" fullWidth>\r\n <FormControl\r\n label=\"Manually Add Custom CSS Changes To The Cart.\"\r\n info={`This is helpful if you need to modify text sizes and introduce small branding elements.\r\n\t\t\t\t\t\t\tReach out to the team if you need help finding specific id's. Styles will only be applied to live cart on your store not in dashboard preview. \r\n\t\t\t\t\t\t\t(Advanced users only)`}\r\n >\r\n {/* <Textarea\r\n BindToContext={[shopContext, \"settings.custom_css\"]}\r\n placeholder=\".text{ color: blue; }\"\r\n /> */}\r\n <CodeEditor\r\n BindToContext={[shopContext, \"settings.custom_css\"]}\r\n language={\"css\"}\r\n placeholder=\"/* your css here */\"\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n </FormGroup>\r\n\r\n {!BREAK_POINTS[\"kill_draft\"](shopContext) && (\r\n <FormGroup\r\n label=\"checkout settings\"\r\n info={`\r\n\t\t\t\t\t\t<p class=\"${classNames(\r\n \"mb-1\"\r\n )}\">To navigate Shopify’s limited discount functionalities we use draft discounts.</p>\r\n\t\t\t\t\t\t<h4 class=\"${classNames(\"font-bold text-gray-600 mb-1\")}\">Draft checkout:</h4>\r\n\t\t\t\t\t\t<p>has more discount functionality and is preferred option for upsells.</p>\r\n\t\t\t\t\t\t<h4 class=\"${classNames(\r\n \"font-bold text-gray-600 mb-1\"\r\n )}\">Normal Shopify checkout:</h4>\r\n\t\t\t\t\t\t<p>works better for stores that sell in multi-currency and want customers to add discounts in checkout area.</p>\r\n\t\t\t\t\t\t`}\r\n >\r\n <ButtonSelect\r\n isVertical\r\n options={[\r\n {\r\n label: \"Draft Checkout\",\r\n value: false,\r\n infoHtml: true,\r\n info: `\r\n\t\t\t\t\t\t\t\t<ul class=\"${classNames(\"list-disc list-inside\")}\">\r\n\t\t\t\t\t\t\t\t\t<li>Allow multiple discounts</li>\r\n\t\t\t\t\t\t\t\t\t<li>More powerful campaign options</li>\r\n\t\t\t\t\t\t\t\t\t<li>Checkout is in default store currency</li>\r\n\t\t\t\t\t\t\t\t\t<li>Coupon must be added in upsell cart</li>\r\n\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t\t`,\r\n },\r\n {\r\n label: \"Normal Shopify Checkout\",\r\n value: true,\r\n infoHtml: true,\r\n info: `\r\n\t\t\t\t\t\t\t\t\t<ul class=\"${classNames(\"list-disc list-inside\")}\">\r\n\t\t\t\t\t\t\t\t\t<li>One discount at a time</li>\r\n\t\t\t\t\t\t\t\t\t<li>Uses unique discount codes injected at checkout</li>\r\n\t\t\t\t\t\t\t\t\t<li>Checkout is in Multi-currency</li>\r\n\t\t\t\t\t\t\t\t\t<li>Coupons added in checkout like normal</li>\r\n\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t\t`,\r\n },\r\n ]}\r\n BindToContext={[shopContext, \"settings.multiCurrencyMode\"]}\r\n />\r\n </FormGroup>\r\n )}\r\n\r\n {/* // COD */}\r\n {/* <FormGroup\r\n label=\"Cash On Delivery Checkout\"\r\n info={`<p>Replace standard Shopify checkout process with our fully customizable COD checkout.</p>`}\r\n collapsable\r\n >\r\n <ButtonSelect\r\n isVertical\r\n options={[\r\n {\r\n label:\r\n \"Cash On Delivery Checkout - COD ( Shopify will not take any payments)\",\r\n infoHtml: true,\r\n withSwitch: true,\r\n disabledClick: true,\r\n info: `\r\n\t\t\t\t\t\t\t\t<ul class=\"${classNames(\"list-disc list-inside\")}\">\r\n\t\t\t\t\t\t\t\t\t<li>Replace checkout with quick order form</li>\r\n\t\t\t\t\t\t\t\t\t<li>Creates Draft order for you to fullfill </li>\r\n\t\t\t\t\t\t\t\t\t<li>Skips all checkout payment options (example: Paypal, Shopify Payments, Afterpay)</li>\r\n\t\t\t\t\t\t\t\t\t<li>Creates customer orders/accounts for you to fullfill and collect payment for</li>\r\n\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t\t`,\r\n },\r\n ]}\r\n BindToContext={[shopContext, \"settings.cod_settings.is_active\"]}\r\n showCheckedIcon={false}\r\n />\r\n {state.settings.cod_settings.is_active && (\r\n <>\r\n <FormControl\r\n label=\"Cash on delivery options\"\r\n info=\"Would you like to give both checkout options or limit to just cash on delivery?\"\r\n error={validationErrors[\"settings.cod_settings.checkout_mode\"]}\r\n isSingleCol={true}\r\n >\r\n <ButtonSelect\r\n options={[\r\n { label: \"Cash on Delivery only\", value: \"cod_only\" },\r\n {\r\n label: \"Checkout and cash on delivery\",\r\n value: \"cod_and_checkout\",\r\n },\r\n ]}\r\n BindToContext={[\r\n shopContext,\r\n \"settings.cod_settings.checkout_mode\",\r\n ]}\r\n />\r\n </FormControl>\r\n <FormControl>\r\n <div>\r\n <Button\r\n text=\"Customize COD Checkout\"\r\n onClick={() => {\r\n history.push(\"/settings/checkout\" + location.search);\r\n }}\r\n style={{ width: \"100%\" }}\r\n />\r\n </div>\r\n </FormControl>\r\n </>\r\n )}\r\n {state.settings.cod_settings.checkout_mode == \"cod_only\" && (\r\n <FormControl\r\n label=\"one step checkout\"\r\n withSwitch={[\r\n shopContext,\r\n \"settings.cod_settings.is_form_in_cart\",\r\n ]}\r\n info=\"Display the checkout form in the main cart for a fast onr step checkout.\"\r\n />\r\n )}\r\n </FormGroup> */}\r\n </Fragment>\r\n </Page>\r\n );\r\n};\r\n\r\nexport default CartScreen;\r\n","import React, { useRef, useState, useEffect } from \"react\";\r\nimport styles from \"styles/page.module.scss\";\r\nimport { Button, Spinner, Notifications } from \"components\";\r\nimport { Scrollbars } from \"react-custom-scrollbars\";\r\nimport { useTransition, animated } from \"react-spring\";\r\nimport { WithPageScrollProvider } from \"context/PageScrollContext\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nexport const PageHeader = ({ style = {}, title, actions = [] }) => {\r\n return (\r\n <div\r\n className={classNames(\"flex items-center px-6 p-2 bg-white\")}\r\n style={{ ...style, height: 48 }}\r\n >\r\n <h3\r\n className={\r\n classNames(\"flex-1 capitalize text-gray-600 text-lg font-bold\") +\r\n ` ${styles.page_header}`\r\n }\r\n >\r\n {title}\r\n </h3>\r\n {!!actions.length &&\r\n actions.map((action, index) => {\r\n if (typeof action === \"function\") return action(index);\r\n if (!action.type) action.type = \"circle-icon__primary\";\r\n return <Button {...action} className={styles.action} key={index} />;\r\n })}\r\n </div>\r\n );\r\n};\r\n\r\nconst Page = ({\r\n header = false,\r\n TopContent = null,\r\n children,\r\n loading = false,\r\n background = \"none\",\r\n padding = \"\",\r\n onScroll = null,\r\n getScrollTop,\r\n additional_classes = \"\",\r\n}) => {\r\n const scrollbars_ref = useRef(null);\r\n const [error, setError] = useState(false);\r\n const [buttonLoading, setButtonLoading] = useState(false);\r\n\r\n useEffect(() => {\r\n if (getScrollTop && scrollbars_ref.current) {\r\n getScrollTop(scrollbars_ref.current);\r\n }\r\n }, [scrollbars_ref]);\r\n return (\r\n <div className={styles.app_container}>\r\n {header && TopContent && (\r\n <div className={styles.topBarWrapper}>\r\n {TopContent.transitions.map(({ item, key, props }) => {\r\n return item ? (\r\n <animated.div\r\n style={props}\r\n className={classNames(\"h-full\")}\r\n key={key}\r\n >\r\n <TopContent.render\r\n error={{\r\n get: error,\r\n set: setError,\r\n }}\r\n loading={{\r\n get: buttonLoading,\r\n set: setButtonLoading,\r\n }}\r\n />\r\n </animated.div>\r\n ) : (\r\n <animated.div\r\n style={props}\r\n className={classNames(\"h-full\")}\r\n key={key}\r\n >\r\n <PageHeader {...header} />\r\n </animated.div>\r\n );\r\n })}\r\n </div>\r\n )}\r\n {header && !TopContent && (\r\n <div className={styles.topBarWrapper}>\r\n <PageHeader {...header} />\r\n </div>\r\n )}\r\n <Scrollbars\r\n className={styles.customScrollbars}\r\n style={{\r\n height: header ? \"calc(100vh - 50px)\" : \"100vh\",\r\n }}\r\n ref={scrollbars_ref}\r\n onScroll={() => {\r\n if (onScroll) onScroll(scrollbars_ref.current.getScrollTop());\r\n // localStorage.setItem('pst', scrollTop);\r\n }}\r\n >\r\n <WithPageScrollProvider pageScroll={scrollbars_ref}>\r\n <div className={classNames(\"relative h-full\")}>\r\n <Notifications />\r\n <div\r\n className={classNames(\r\n `min-h-full relative${additional_classes}`,\r\n styles.page_content,\r\n padding || \"p-6\"\r\n )}\r\n id=\"page-content\"\r\n >\r\n {loading.status ? (\r\n <Spinner text={loading.text || \"page loading\"} />\r\n ) : (\r\n children\r\n )}\r\n </div>\r\n </div>\r\n </WithPageScrollProvider>\r\n </Scrollbars>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Page;\r\n","import React, {\r\n useContext,\r\n Fragment,\r\n useEffect,\r\n useRef,\r\n useState\r\n} from \"react\";\r\nimport { useMutation } from \"@apollo/react-hooks\";\r\nimport {\r\n SortableContainer,\r\n SortableElement,\r\n sortableHandle\r\n} from \"react-sortable-hoc\";\r\nimport extrastyles from \"styles/extra_modules.module.scss\";\r\nimport arrayMove from \"array-move\";\r\nimport PageScrollContext from \"context/PageScrollContext\";\r\nimport md5 from \"crypto-js/md5\";\r\nimport {\r\n Page,\r\n Range,\r\n ColorPicker,\r\n FormGroup,\r\n Input,\r\n FormControl,\r\n Dropdown,\r\n Switch,\r\n CustomText,\r\n Icon,\r\n Button,\r\n Alert,\r\n VideoModal,\r\n RichEditor,\r\n ButtonSelect,\r\n MultiCurrencyModeAlerts,\r\n Modal\r\n} from \"components\";\r\nimport PreviewContext from \"context/PreviewContext\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport UserContext from \"context/UserContext\";\r\nimport {\r\n GOOGLE_FONTS,\r\n CAMPAIGN_TYPES,\r\n SHOP_DEFAULT_SETTINGS\r\n} from \"lib/globals\";\r\nimport { SAVE_SHOP_SETTINGS, UPDATE_SHOP_PROP } from \"lib/mutations\";\r\nimport ExtraModules from \"screens/campaigns/settings/ExtraModules/index\";\r\nimport CheckoutButton from \"screens/campaigns/settings/ExtraModules/CheckoutButton\";\r\nimport { Loading, Toast } from \"@shopify/app-bridge-react\";\r\nimport { ShopConstraints } from \"Constraints\";\r\nimport removeTypeName, { removeByType } from \"lib/removeTypeName\";\r\nimport { Run } from \"lib/validate\";\r\nimport { GET_SHOP_SETTINGS } from \"Queries\";\r\nimport { PageHeader } from \"components/Page\";\r\nimport { API, graphqlOperation } from \"aws-amplify\";\r\nimport { APP_DEV } from \"aws-exports\";\r\nimport Axios from \"axios\";\r\nimport { Manager, Reference, Popper } from \"react-popper\";\r\nimport Checkbox from \"react-simple-checkbox\";\r\nimport styles from \"styles/cart_screen.module.scss\";\r\nimport { useTransition } from \"react-spring\";\r\nimport _ from \"lodash\";\r\nimport classNames from \"lib/classNames\";\r\nimport useReactRouter from \"use-react-router\";\r\nimport { SET_ALL } from \"reducers/SetItemReducer\";\r\nimport useRefState from \"hooks/useRefState\";\r\nimport { modules } from \"Constraints/CampaignConstraints\";\r\n\r\nconst CodCheckout = (props) => {\r\n const {\r\n collapsed,\r\n setCollapsed,\r\n setCartIsEmpty,\r\n setComfirmOrderButtonLoadingEdit,\r\n editingProductDetails,\r\n setEditingProductDetails,\r\n campaign_preview_types\r\n } = useContext(PreviewContext);\r\n const stickyAlert = useRef(null);\r\n const { history, location } = useReactRouter();\r\n const [scrollTop, setScrollTop, scrollTopRef] = useRefState();\r\n const [cartActivateLoading, setCartActivateLoading] = useState(false);\r\n const [videoOne, setVideoOne] = useState(false);\r\n const [googleFonts, setGoogleFonts] = useState([]);\r\n const [hideTopBar, setHideTopBar] = useState(false);\r\n const [showConfirmActivate, setShowConfirmActivate] = useState(false);\r\n const [campaign_preview_visible, setCampaign_preview_visible] =\r\n useState(false);\r\n const campaign_preview_content_ref = useRef(null);\r\n const shopContext = useContext(ShopContext);\r\n const user = useContext(UserContext);\r\n const [editModalVisibility, setEditModalVisibility] = useState(false);\r\n const [addModalVisibility, setAddModalVisibility] = useState(false);\r\n\r\n const [selectedModule, setSelectedModule] = useState(null);\r\n const {\r\n state,\r\n discard,\r\n validationErrors,\r\n setValidationErrors,\r\n dispatch,\r\n setItem\r\n } = shopContext;\r\n\r\n const {\r\n settings: {\r\n cod_settings: { form, checkout_mode }\r\n }\r\n } = state;\r\n // const filterSettings = (settings) =>\r\n // \t_.merge(\r\n // \t\t{},\r\n // \t\tSHOP_DEFAULT_SETTINGS(),\r\n // \t\tremoveByType(\r\n // \t\t\tremoveTypeName(\r\n // \t\t\t\tObject.fromEntries(Object.entries(settings).filter(([key]) => !['settingsSaved'].includes(key)))\r\n // \t\t\t),\r\n // \t\t\t(v) => v !== '' && v !== null\r\n // \t\t)\r\n // \t);\r\n\r\n const filterSettings = (settings) => {\r\n return removeByType(\r\n removeTypeName(\r\n Object.fromEntries(\r\n Object.entries(settings).filter(\r\n ([key]) => ![\"settingsSaved\"].includes(key)\r\n )\r\n )\r\n ),\r\n (v) => v !== \"\" && v !== null\r\n );\r\n // _.mergeWith(\r\n // \tSHOP_DEFAULT_SETTINGS(),\r\n // \tremoveByType(\r\n // \t\tremoveTypeName(\r\n // \t\t\tObject.fromEntries(Object.entries(settings).filter(([key]) => !['settingsSaved'].includes(key)))\r\n // \t\t),\r\n // \t\t(v) => v !== '' && v !== null\r\n // \t),\r\n // \t(objValue, srcValue) => srcValue && _.isArray(srcValue) ? srcValue : undefined\r\n // );\r\n };\r\n\r\n let [saveShopSettings, { data, error, loading }] = useMutation(\r\n SAVE_SHOP_SETTINGS,\r\n {\r\n refetchQueries: [\r\n {\r\n query: GET_SHOP_SETTINGS,\r\n variables: {\r\n userId: user.attributes.website\r\n }\r\n }\r\n ]\r\n }\r\n );\r\n const transitions = useTransition(\r\n !_.isEqual(state.original_settings, state.settings) && !hideTopBar,\r\n null,\r\n {\r\n from: { position: \"absolute\", opacity: 0 },\r\n enter: { opacity: 1 },\r\n leave: { opacity: 0 },\r\n config: {\r\n duration: 300\r\n }\r\n }\r\n );\r\n const validate = (state, specific = []) =>\r\n Run(state, specific, {\r\n errors: validationErrors,\r\n setErrors: setValidationErrors,\r\n constraints: ShopConstraints\r\n });\r\n const onSortEnd = ({ oldIndex, newIndex }) => {\r\n const newOrder = arrayMove(form, oldIndex, newIndex);\r\n setItem(\"settings.cod_settings.form\", newOrder);\r\n // console.log(newOrder)\r\n // modules = newOrder\r\n // this.props.edit('modules', 'order', newOrder);\r\n // setModules(newOrder);\r\n };\r\n\r\n const deleteModule = (index) => {\r\n const newOrder = form.slice();\r\n newOrder.splice(index, 1);\r\n setItem(\"settings.cod_settings.form\", newOrder);\r\n };\r\n const editModule = (index, module) => {\r\n const newForm = form.slice();\r\n newForm[index] = module;\r\n setItem(\"settings.cod_settings.form\", newForm);\r\n };\r\n const addModule = (module) => {\r\n const newForm = form.slice();\r\n newForm.push(module);\r\n setItem(\"settings.cod_settings.form\", newForm);\r\n };\r\n\r\n const save = (assign = {}, checkRTL = true) => {\r\n // console.log(\"state.settings\")\r\n // console.log(state.settings)\r\n // return\r\n if (validate(state)) return;\r\n if (\r\n checkRTL &&\r\n Object.keys(state.original_settings || {}).length &&\r\n state.settings.rtl !== state.original_settings.rtl\r\n ) {\r\n console.log(\r\n \"updating theme\",\r\n state.settings.rtl,\r\n state.original_settings.rtl,\r\n state.settings.active\r\n );\r\n // return activateCart(state.settings.active, true, state.settings.rtl);\r\n }\r\n\r\n saveShopSettings({\r\n variables: {\r\n id: user.attributes.website,\r\n input: filterSettings(Object.assign(state.settings, assign))\r\n }\r\n });\r\n };\r\n\r\n const activateCart = async (active, confirmed = false, rtl = null) => {\r\n if (\r\n active &&\r\n !confirmed &&\r\n !state.settingsSaved &&\r\n _.isEqual(SHOP_DEFAULT_SETTINGS, state.settings)\r\n ) {\r\n return setShowConfirmActivate(true);\r\n }\r\n // setCartActivateLoading(true);\r\n // const { success } = await API.post(\"API_GATEWAY_NEW\", \"/cart/activate\", {\r\n // body: { active, rtl: rtl === null ? state.settings.rtl : rtl }\r\n // });\r\n // setCartActivateLoading(false);\r\n return save({ active }, false);\r\n };\r\n\r\n const handleOutSideClick = (event) => {\r\n if (!campaign_preview_content_ref.current) return;\r\n else if (campaign_preview_content_ref.current.contains(event.target))\r\n return;\r\n setCampaign_preview_visible(false);\r\n };\r\n\r\n useEffect(() => {\r\n if (campaign_preview_visible)\r\n document.addEventListener(\"mousedown\", handleOutSideClick, false);\r\n else document.removeEventListener(\"mousedown\", handleOutSideClick, false);\r\n return () => {\r\n document.removeEventListener(\"mousedown\", handleOutSideClick, false);\r\n };\r\n }, [campaign_preview_visible]);\r\n\r\n useEffect(() => {\r\n // if (typeof state.settings.multiCurrencyMode !== 'boolean') {\r\n // \tsetItem('settings.multiCurrencyMode', false);\r\n // }\r\n async function getGoogleFonts () {\r\n const { data } = await Axios.get(\r\n `https://www.googleapis.com/webfonts/v1/webfonts?sort=popularity&key=AIzaSyCYLq50twmAe1_7jITZuehrERZWOjNqBCY`\r\n );\r\n setGoogleFonts(\r\n data.items.map(({ family, variants }) => ({\r\n label: family,\r\n value: `${family}:${variants.join()}`\r\n }))\r\n );\r\n }\r\n getGoogleFonts();\r\n }, []);\r\n\r\n useEffect(() => {\r\n setHideTopBar(!!data);\r\n if (APP_DEV) setTimeout(() => setHideTopBar(false), 1500);\r\n }, [data]);\r\n return (\r\n <Page\r\n background=\"none\"\r\n getScrollTop={({ scrollTop }) => {\r\n setScrollTop(scrollTop);\r\n }}\r\n padding={0}\r\n header={{\r\n title: \"Cash on Delivery Checkout - Customization and Settings\",\r\n actions: [\r\n {\r\n text: \"Back to settings\",\r\n type: \"secondary\",\r\n loading: false,\r\n onClick: () => history.push(\"/settings\" + location.search)\r\n }\r\n ]\r\n }}\r\n TopContent={{\r\n transitions,\r\n render: () => (\r\n <Alert\r\n type=\"save_settings\"\r\n title=\"unsaved changes\"\r\n borderPosition=\"none\"\r\n paddingX=\"px-6\"\r\n actions={[\r\n {\r\n text: \"Discard\",\r\n type: \"secondary\",\r\n loading: false,\r\n onClick: () => discard()\r\n },\r\n {\r\n text: \"Save\",\r\n type: \"primary\",\r\n loading: loading || cartActivateLoading,\r\n onClick: () => save()\r\n }\r\n ]}\r\n />\r\n )\r\n }}\r\n >\r\n <Fragment>\r\n {data && (\r\n <Toast\r\n content=\"Cart settings has been saved\"\r\n duration={3000}\r\n onDismiss={() => {\r\n setHideTopBar(false);\r\n }}\r\n />\r\n )}\r\n {(loading || cartActivateLoading) && <Loading />}\r\n <FormGroup\r\n label=\"Create Cash on Delivery Form\"\r\n info={`Add the feilds you want your order form to have. You can add, edit , drag'n'drop and remove fields.`}\r\n >\r\n <ModulesList\r\n useDragHandle\r\n {...{\r\n form,\r\n onSortEnd,\r\n deleteModule,\r\n setSelectedModule,\r\n setEditModalVisibility\r\n }}\r\n />\r\n <FormControl>\r\n <div>\r\n <Button\r\n text=\"+ Add New Field\"\r\n type={\r\n validationErrors[\"target.selected\"] &&\r\n !!validationErrors[\"target.selected\"][0]\r\n ? \"danger\"\r\n : \"primary\"\r\n }\r\n onClick={() => {\r\n setAddModalVisibility(true);\r\n }}\r\n style={{ width: \"100%\" }}\r\n />\r\n </div>\r\n </FormControl>\r\n </FormGroup>\r\n {/* <FormGroup label=\"Customize checkout button\" info=\"Keep these settings simple and to the point\">\r\n\t\t\t\t\t<FormControl\r\n\t\t\t\t\t\tlabel=\"display cart on RTL\"\r\n\t\t\t\t\t\twithSwitch={[shopContext, 'settings.rtl']}\r\n\t\t\t\t\t\tinfo=\"Enable this if your store language uses right to left scripts.\"\r\n\t\t\t\t\t/>\r\n\t\t\t\t</FormGroup> */}\r\n <FormGroup\r\n label=\"Customize checkout button\"\r\n info=\"Keep these settings simple and to the point\"\r\n >\r\n <CustomText\r\n context={shopContext}\r\n placeholder=\"Confirm Order\"\r\n hasColor={true}\r\n label=\"Confirm order text\"\r\n path=\"settings.cod_settings.confirm_button\"\r\n />\r\n\r\n <FormControl label=\"checkout button colors\">\r\n <ColorPicker\r\n text=\"background\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.cod_settings.confirm_button.background\"\r\n ]}\r\n />\r\n {/* <ColorPicker\r\n text=\"hover background\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.cod_settings.confirm_button.hoverBackground\"\r\n ]}\r\n /> */}\r\n </FormControl>\r\n <CustomText\r\n context={shopContext}\r\n placeholder=\"processing\"\r\n hasColor={true}\r\n hasNumber={false}\r\n onFocus={() => setComfirmOrderButtonLoadingEdit(true)}\r\n onBlur={() => setComfirmOrderButtonLoadingEdit(false)}\r\n label=\"checkout button loading text\"\r\n path=\"settings.cod_settings.loading_button\"\r\n />\r\n </FormGroup>\r\n <FormGroup>\r\n <FormControl\r\n label=\"Error message\"\r\n error={validationErrors[\"settings.cod_settings.error_message\"]}\r\n >\r\n <Input\r\n type=\"text\"\r\n BindToContext={[\r\n shopContext,\r\n \"settings.cod_settings.error_message\"\r\n ]}\r\n hasError={\r\n !!validationErrors[\"settings.cod_settings.error_message\"]\r\n }\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n\r\n <EditModal\r\n {...{\r\n editModalVisibility,\r\n setEditModalVisibility,\r\n selectedModule,\r\n editModule\r\n }}\r\n />\r\n {addModalVisibility && (\r\n <AddModal\r\n {...{\r\n addModalVisibility,\r\n setAddModalVisibility,\r\n addModule\r\n }}\r\n />\r\n )}\r\n </Fragment>\r\n </Page>\r\n );\r\n};\r\n\r\nconst ModulesList = SortableContainer(\r\n ({ form, deleteModule, setSelectedModule, setEditModalVisibility }) => {\r\n return (\r\n <FormControl isSingleCol={true}>\r\n <div>\r\n {!!form &&\r\n form.map((module, index) => {\r\n return (\r\n <Module\r\n {...{\r\n setEditModalVisibility,\r\n module,\r\n setSelectedModule,\r\n deleteModule,\r\n index\r\n }}\r\n itemIndex={index}\r\n key={index}\r\n />\r\n );\r\n })}\r\n </div>\r\n </FormControl>\r\n );\r\n }\r\n);\r\n\r\nconst Module = SortableElement(\r\n ({\r\n module,\r\n deleteModule,\r\n itemIndex,\r\n setSelectedModule,\r\n setEditModalVisibility\r\n }) => {\r\n const { label, isRequired, type } = module;\r\n return (\r\n <div className={extrastyles.module} data-active={true}>\r\n <div\r\n className={extrastyles.header}\r\n data-has-children={false}\r\n data-one-row={true}\r\n >\r\n <div className={extrastyles.header_wrapper}>\r\n <b className={extrastyles.name}>{`${label} ${isRequired ? \"*\" : \"\"\r\n }`}</b>\r\n </div>\r\n <div className={classNames(\"flex \")}>\r\n <Button\r\n className={classNames(\"mx-2 \")}\r\n icon=\"edit\"\r\n type=\"circle-warning\"\r\n onClick={() => {\r\n setSelectedModule([itemIndex, module]);\r\n setEditModalVisibility(true);\r\n }}\r\n />\r\n {type !== \"name\" && (\r\n <Button\r\n className={classNames(\"mx-2 \")}\r\n icon=\"trash\"\r\n type=\"circle-danger\"\r\n onClick={() => deleteModule(itemIndex)}\r\n />\r\n )}\r\n </div>\r\n </div>\r\n <Grip active={true} />\r\n </div>\r\n );\r\n }\r\n);\r\n\r\nconst Grip = sortableHandle(({ active }) => {\r\n return (\r\n <div className={extrastyles.grip} data-active={active}>\r\n <Icon icon=\"angle-up\" />\r\n <Icon icon=\"angle-down\" />\r\n </div>\r\n );\r\n});\r\n\r\nconst EditModal = ({\r\n editModalVisibility,\r\n setEditModalVisibility,\r\n selectedModule,\r\n editModule\r\n}) => {\r\n const [module, setModule] = useState(null);\r\n useEffect(() => {\r\n if (selectedModule) {\r\n setModule({ ...selectedModule[1] });\r\n }\r\n }, [selectedModule]);\r\n\r\n const handleChange = (value, attribute) => {\r\n setModule({\r\n ...module,\r\n [attribute]: value\r\n });\r\n };\r\n\r\n const save = () => {\r\n editModule(selectedModule[0], module);\r\n setEditModalVisibility(false);\r\n // setSelectedModule(null)\r\n };\r\n\r\n return (\r\n <Modal\r\n visible={editModalVisibility && module}\r\n title=\"Edit\"\r\n onClose={() => setEditModalVisibility(false)}\r\n >\r\n {(close, setTitle) =>\r\n module ? (\r\n <div className={classNames(\"px-2 h-full flex flex-col\")}>\r\n <div className={classNames(\"h-full \")}>\r\n <FormControl label=\"Title\">\r\n <Input\r\n value={module.label}\r\n onChange={(v) => handleChange(v, \"label\")}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Placeholder\">\r\n <Input\r\n value={module.placeholder}\r\n onChange={(v) => handleChange(v, \"placeholder\")}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Required\">\r\n <Switch\r\n value={module.isRequired}\r\n onChange={(v) => handleChange(v, \"isRequired\")}\r\n />\r\n </FormControl>\r\n </div>\r\n\r\n <div className={classNames(\"flex justify-end \")}>\r\n <Button text=\"Save\" onClick={save} />\r\n </div>\r\n </div>\r\n ) : (\r\n <div></div>\r\n )\r\n }\r\n </Modal>\r\n );\r\n};\r\n\r\nconst AddModal = ({ addModalVisibility, setAddModalVisibility, addModule }) => {\r\n const [label, setLabel] = useState(\"Titre\");\r\n const [isRequired, setIsRequired] = useState(false);\r\n const [type, setType] = useState(\"string\");\r\n const [options, setOptions] = useState([]);\r\n const [placeholder, setPlaceholder] = useState(\"\");\r\n\r\n const save = () => {\r\n addModule({\r\n label,\r\n isRequired,\r\n type,\r\n options,\r\n placeholder\r\n });\r\n setAddModalVisibility(false);\r\n };\r\n\r\n const showOptions = [\"dropdown\", \"checkbox\", \"radio\"];\r\n\r\n return (\r\n <Modal\r\n visible={addModalVisibility}\r\n title=\"Add Field\"\r\n onClose={() => setAddModalVisibility(false)}\r\n >\r\n {(close, setTitle) => (\r\n <div className={classNames(\"px-2 \")}>\r\n <FormControl label=\"Field type\">\r\n <Dropdown\r\n options={[\r\n { value: \"name\", label: \"Full name\" },\r\n { value: \"email\", label: \"Email\" },\r\n { value: \"string\", label: \"Text\" },\r\n { value: \"textarea\", label: \"Text area\" },\r\n { value: \"dropdown\", label: \"Dropdown list\" }\r\n // { value: 'checkbox', \tlabel: 'Checkbox' },\r\n // { value: 'radio', \t\tlabel: 'Radio' },\r\n ]}\r\n onChange={(value) => setType(value)}\r\n value={type}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Title\">\r\n <Input value={label || \"\"} onChange={setLabel} />\r\n </FormControl>\r\n {showOptions.indexOf(type) === -1 && (\r\n <FormControl label=\"Placeholder\">\r\n <Input value={placeholder || \"\"} onChange={setPlaceholder} />\r\n </FormControl>\r\n )}\r\n {showOptions.indexOf(type) !== -1 && (\r\n <FormControl label=\"Options\">\r\n <Dropdown\r\n isCreatable={true}\r\n isMulti={true}\r\n onChange={setOptions}\r\n value={options || []}\r\n />\r\n </FormControl>\r\n )}\r\n\r\n <FormControl label=\"Required\">\r\n <Switch value={isRequired} onChange={setIsRequired} />\r\n </FormControl>\r\n <div className={classNames(\"flex justify-end py-2\")}>\r\n <Button text=\"Save\" onClick={save} />\r\n </div>\r\n </div>\r\n )}\r\n </Modal>\r\n );\r\n};\r\n\r\nexport default CodCheckout;\r\n","var _defs, _title, _ellipse, _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _g, _polygon, _polygon2, _path11, _path12, _path13, _path14, _path15, _path16, _path17, _path18, _path19, _path20, _path21, _path22, _path23, _path24, _path25, _path26, _path27, _path28, _path29, _path30, _path31, _path32, _path33, _path34, _g2, _path35, _path36, _path37, _path38, _path39, _path40, _polygon3, _polygon4, _polygon5, _polygon6, _polygon7, _polygon8, _polygon9, _polygon10, _polygon11, _polygon12, _polygon13, _polygon14, _polygon15, _polygon16, _polygon17, _polygon18, _path41, _path42, _path43, _path44, _path45, _path46, _path47, _path48, _path49, _path50, _path51, _path52, _path53, _path54, _path55, _path56, _path57, _path58, _path59, _path60, _path61, _ellipse2, _ellipse3, _ellipse4, _ellipse5, _ellipse6, _path62, _path63, _path64;\n\nvar _excluded = [\"svgRef\", \"title\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar SvgEmpty = function SvgEmpty(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"9af98f83-10c5-4067-bc84-20554b2827d8\",\n \"data-name\": \"Layer 1\",\n width: 1009.54,\n height: 789.93,\n viewBox: \"0 0 1009.54 789.93\",\n ref: svgRef\n }, props), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"07c62293-c0d3-4921-8e06-4e39241449cd\",\n x1: 318.22,\n y1: 488.45,\n x2: 630.35,\n y2: 488.45,\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n offset: 0,\n stopColor: \"gray\",\n stopOpacity: 0.25\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 0.54,\n stopColor: \"gray\",\n stopOpacity: 0.12\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"gray\",\n stopOpacity: 0.1\n })))), title === undefined ? _title || (_title = /*#__PURE__*/React.createElement(\"title\", null, \"empty\")) : title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _ellipse || (_ellipse = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 354.13,\n cy: 741.27,\n rx: 176.1,\n ry: 33.36,\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M681.78,166.43c-64.72-2.24-126.36-23.14-185.22-46S379.4,72.25,316.23,60.14C275.6,52.35,229.13,51.24,196.4,73c-31.51,21-41.69,57.15-47.16,90.72-4.12,25.26-6.54,51.85,4.74,75.5,7.84,16.42,21.74,30.22,31.36,45.95,33.47,54.72,9.81,122.2-26.45,175.63-17,25.06-36.75,49-49.88,75.65S89.81,593.74,101.3,621c11.38,27,38.51,47.24,67.9,61.49,59.69,28.95,130,37.23,198.61,41.93,151.83,10.38,304.46,5.89,456.69,1.38,56.34-1.66,112.92-3.35,168.34-12.06,30.78-4.84,62.55-12.52,84.9-31.06,28.36-23.53,35.39-63.37,16.38-92.87-31.88-49.5-120-61.79-142.31-114.9-12.26-29.24.33-61.8,18.16-88.91,38.24-58.17,102.33-109.2,105.7-175.68,2.32-45.66-28.49-91.39-76.13-113-49.93-22.65-119.18-19.8-156,17.69C805.59,153.57,738.93,168.42,681.78,166.43Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M630.35,416.77l-30.63-20.65h0l15.45-23-80.9-6.45L505.2,389.15l-36.39-20.4-30.35,3.65-.36-8a225.78,225.78,0,0,0-2.51-24.9c.13-2.5.22-5.37.21-8.49,0-13.15-1.78-30.58-9.6-42.2L428,272.63,413.4,255.38a110.37,110.37,0,0,1,8-13.46c.5-.72,1-1.42,1.54-2.1,18.95-1.37,33.9-16.95,33.9-36,0-.88,0-1.76-.1-2.63,0-.35-.07-.71-.11-1.06,1.85,1,3.72,2,5.59,3,.35.5.75,1,1.19,1.59l0,0,.09.11.56.69.18.21c.2.24.41.47.62.71l.14.16c.53.59,1.09,1.19,1.69,1.78a1.8,1.8,0,0,1,.2.19l.75.7.21.19c.64.57,1.32,1.12,2,1.64l.22.16.86.59.28.18c.33.2.67.41,1,.6l.12.07c.39.21.79.41,1.19.6l.2.08q.51.22,1,.42l.31.11c.35.12.69.23,1.05.33l.22.06c.44.11.88.2,1.33.27h.05a10.88,10.88,0,0,0,1.28.13h.29a11,11,0,0,0,1.15,0h.25a11.85,11.85,0,0,0,1.43-.17,15.78,15.78,0,0,0,6.3-2.26,5.5,5.5,0,0,0,1.28-1.19c2-2.62-.2-5.49-.2-5.49h0c-.78-1.86-5.84-3.17-5.84-3.17s-16-6.68-16-12-4-32.92-45.29-39.23c0,0-26.86-1.51-34.41,12.87l-.16,1.68c-2.22,1.39-4.06,4.18-6.25,5a10.21,10.21,0,0,0-2.71,1l0-.19h0a2.58,2.58,0,0,0-.61.79,8,8,0,0,0-.83,3,11.3,11.3,0,0,1-1.31,3.63,8.07,8.07,0,0,1-.6.92h0l-.17.27a7.3,7.3,0,0,0,3.4-.55,16.93,16.93,0,0,1-1,4,3.32,3.32,0,0,0,3.08-1.84l0-.08.13-.18a8.44,8.44,0,0,0,.62-1.45l-.11.12c.2-.65.38-1.31.6-1.95a3.06,3.06,0,0,1,.49-1,2.42,2.42,0,0,1,2.07-.69l-.41,8.67h.18a11.83,11.83,0,0,1-.88,1.82c-1.42,2.3-4,3.87-4.95,6.39a9.4,9.4,0,0,0-.46,3.78c0,.75.09,1.51.15,2.26v-.06c.14,2,.18,3.9-.9,5.51-.74,1.1-1.93,1.93-2.34,3.18a3.1,3.1,0,0,0-.15,1.08,12.13,12.13,0,0,0,.68,3.21.14.14,0,0,0,0-.06,4.88,4.88,0,0,1,.17,2.36c-.45,2-2.88,3.67-2.76,5.58a2.15,2.15,0,0,0,.11.74,4.05,4.05,0,0,0,2.26,2,8.8,8.8,0,0,0,5.08,1.12,6.68,6.68,0,0,0,1.9-.65c-.7,1.61-1.42,3.2-2.15,4.71-.11.24-.23.48-.35.72,0,0-6.18-4.13-9.69,4.29a18.68,18.68,0,0,0-2.17,5.64,13.42,13.42,0,0,1-.74,2.32,14.93,14.93,0,0,1-6.68,6c-7.16,3.28-36.08,39.35-36.59,48.69a54.49,54.49,0,0,1-1.84,10.78,64.15,64.15,0,0,0-1.72,25.49,48.77,48.77,0,0,0,1.77,8.13c3.07,9.33,5.12,26.74,5.12,26.74l3.32,30.22a86,86,0,0,0,.54,12.49c-3.39,3.87-17,20-11.8,24.39,4,3.46,11,2.89,14.93,2.18-3.31,8.19-8.52,22.43-9.21,32.21-1,14.47,1.71,33.64,6,41s18.59,26.24,18.59,26.24-.67,25.9,4.44,35.31,7.17,28.93,7.17,28.93,4.77,16.48,2.38,22.54,4.43,11.1-2.73,15.13-16.32,94.86-16.32,94.86-3.69,59.53,0,62.56a3.75,3.75,0,0,0,.63.37v20s-2.56,4.2,7.85,5.05c7.13.57,27.34,1.86,39.33,2.61l9.29.58s22,4.38,31.72,0,26.95-4.28,24.39-15.85a32.92,32.92,0,0,0-1.36-4.63c-2.81-7.18-7.58-8-16.37-10-.51-.11-1-.21-1.45-.29-9.26-1.61-12.3,2.7-17.49-2.91-4.51-4.85-18.87-10.28-23.76-12,.12-.36.27-.71.39-1.08a7.32,7.32,0,0,1-3.71-1.81l13.25.84,7.89.49s18.7,3.73,27,0,22.9-3.63,20.72-13.46a28.21,28.21,0,0,0-1.15-3.94c-2.39-6.1-6.45-6.77-13.92-8.46-.43-.09-.83-.18-1.23-.25-7.87-1.37-10.45,2.29-14.86-2.47-3.78-4.06-15.71-8.61-20-10.16,0-2.22-3-5.38-4.89-8.55-2.22-3.7,1.88-16.65,1.88-16.65L411,658.74a10.38,10.38,0,0,1,2.8-.8s10.58-10.1,8.19-20.86a69.13,69.13,0,0,1-.76-9.83c3.48-3.23,8.27-8,9.63-10.94,2.22-4.79,0-28,0-28V499.56l17.7,1.79L464.62,503l4.89.5,16.06,1.62,36.91,3.73,33.26-6.3,14.39-2.72,29.59-5.6V421.83ZM386.74,176.86l-2.06-.22C385.36,176.67,386.08,176.8,386.74,176.86Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"url(#07c62293-c0d3-4921-8e06-4e39241449cd)\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M558.56,463.78c-10,14.31-45.95,6.73-45.95,6.73l-27.86-26.07L481,440.91l6.29-13.36s2,.55,5.43,1.53C510.73,434.31,567,451.75,558.56,463.78Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#efb7b9\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M492.7,429.08c-1.23,4.28-4.6,10.69-7.95,15.36L481,440.91l6.29-13.36S489.31,428.1,492.7,429.08Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M397.15,278.42s-25.68,11.39-24.42,39.36a461.14,461.14,0,0,0,5.88,53.76s-5.25,42.09,16.61,52.94,42.09,19.77,42.09,19.77,34.2,3.68,38.45,5.2,17.53-21.72,15.08-25.34S457,412.9,453,406.86s-13.25-9.77-13.25-9.77-9.55-5.78-10.2-11,1.87-9.11,2.51-11.4,2.26-24.4,2.26-24.4S445.1,271.59,397.15,278.42Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#dce6f2\"\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M414.1,370.39s-35.23,5.9-31.82,18.23C382.28,388.62,395.07,375.31,414.1,370.39Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M414.37,375.38S395,391.19,398.79,392,414.37,375.38,414.37,375.38Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path8 || (_path8 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M423.68,380.89s-5.19,10.63-2,9.91S423.68,380.89,423.68,380.89Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path9 || (_path9 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M494,430.21l-2.14-.61c.61-2,.78-3.62.28-4.37-2.45-3.62-33.82-11.2-37.81-17.25s-13.25-9.77-13.25-9.77-9.55-5.78-10.2-11,1.87-9.11,2.51-11.4,2.26-24.41,2.26-24.41,10.75-78.69-37.2-71.86c0,0-25.68,11.4-24.43,39.37a459.85,459.85,0,0,0,5.89,53.76s-5.25,42.09,16.61,52.94,42.09,19.77,42.09,19.77,34.19,3.67,38.45,5.2c1.61.58,4.52-2.41,7.37-6.52l1.62,1.51,27.86,26.06s35.95,7.59,45.95-6.72C568.31,452.87,512.05,435.43,494,430.21Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path10 || (_path10 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M382.37,173.44a8.5,8.5,0,0,0-2.77,1.07c-1,.83-1,2.25-1.25,3.49a11.48,11.48,0,0,1-2,4.78,7.19,7.19,0,0,0,3.33-.55,17.14,17.14,0,0,1-1,4,3.24,3.24,0,0,0,3-1.83,19.26,19.26,0,0,0,1.25-3.51,2.89,2.89,0,0,1,.48-1c.92-1.09,2.63-.6,4.05-.46a6.65,6.65,0,0,0,6.08-2.92c1.51-2.29,1.6-8.15-2-8.77C387.78,167.12,385.44,172.3,382.37,173.44Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#965d7b\"\n })), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.1\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M379.5,175.74c.09-.49.15-1,.26-1.49h0c-.95.83-1,2.24-1.25,3.49a11,11,0,0,1-.59,2.11A11.46,11.46,0,0,0,379.5,175.74Z\",\n transform: \"translate(-95.23 -55.03)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M379.82,184a16.63,16.63,0,0,0,1-4,7.16,7.16,0,0,1-3.17.55,11.57,11.57,0,0,1-1.15,2,7.12,7.12,0,0,0,3.32-.54,16.63,16.63,0,0,1-1,4,3.25,3.25,0,0,0,3-1.83,7.46,7.46,0,0,0,.6-1.43A3,3,0,0,1,379.82,184Z\",\n transform: \"translate(-95.23 -55.03)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M388.6,177.2c-1.42-.14-3.14-.63-4.06.46a3.09,3.09,0,0,0-.48,1c-.09.26-.17.53-.24.8.95-.75,2.49-.35,3.78-.22a6.68,6.68,0,0,0,6.08-2.92,5.54,5.54,0,0,0,.67-1.57A6.66,6.66,0,0,1,388.6,177.2Z\",\n transform: \"translate(-95.23 -55.03)\"\n }))), _polygon || (_polygon = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"317.24 201 332.49 219.34 330.5 237.85 312.07 209 317.24 201\",\n fill: \"#dce6f2\"\n })), _polygon2 || (_polygon2 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"332.48 219.34 330.61 236.75 330.49 237.85 313.86 211.81 312.07 209 312.59 208.19 317.23 201 318.26 202.24 332.48 219.34\",\n opacity: 0.1\n })), _path11 || (_path11 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M435.63,231.2c-5.16,1.48-10.09,6.56-14.38,12.73a108.65,108.65,0,0,0-7.76,13.34c-1.41,2.82-2.65,5.53-3.68,7.89l-.72,1.68c-1.74,4.11-2.71,6.86-2.71,6.86S366.88,244,373.13,242c2.1-.67,4.86-5.17,7.59-10.84l.34-.72c1.73-3.64,3.43-7.7,4.94-11.52,3.09-7.85,5.38-14.67,5.38-14.67S451.38,226.7,435.63,231.2Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#efb7b9\"\n })), _path12 || (_path12 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M459.26,202.58s9.12,16.5,21.37,14.25,7.21-8.86,7.21-8.86Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#444053\"\n })), _path13 || (_path13 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M441.59,773.73c-8.08,3.69-26.35,0-26.35,0l-7.7-.48c-10-.64-26.74-1.72-32.66-2.2-8.64-.71-6.52-4.25-6.52-4.25V745.41l41.92-10.62s16.57,5.67,21.11,10.62c4.31,4.72,6.83,1.09,14.52,2.45.38.07.78.15,1.2.25,7.3,1.67,11.26,2.33,13.6,8.38a28.1,28.1,0,0,1,1.13,3.9C464,770.13,449.66,770.06,441.59,773.73Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#a36468\"\n })), _path14 || (_path14 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M460.71,756.49a31.34,31.34,0,0,1-4.72,2.42c-5.5,2.51-10.73,5.57-16.29,7.94s-11.55,4.06-17.57,3.61c-3.15-.23-6.37-1-9.38-.1a21.66,21.66,0,0,0-5.21,2.89c-10-.64-26.74-1.72-32.66-2.2-8.64-.71-6.52-4.25-6.52-4.25v-2.5c.31,0,.66-.09,1.06-.12a18.88,18.88,0,0,1,6.1.91c4.34,1.18,8.66,2.34,13,3.5a10.27,10.27,0,0,1,5-6.38,15.94,15.94,0,0,1,8.06-1.85c6.73.09,13.1,3.28,19.82,3.6a10.92,10.92,0,0,0,5.49-.92c.92-.46,1.73-1.13,2.63-1.64a19.2,19.2,0,0,1,4.53-1.53A99.76,99.76,0,0,0,447,755.69c1.2-.47,2.6-1.32,2.44-2.6-.21-1.7-2.88-1.9-3.58-3.46a2,2,0,0,1,.08-1.77c.38.07.78.15,1.2.25C454.41,749.78,458.37,750.44,460.71,756.49Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path15 || (_path15 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M433.05,820.53c-9.5,4.34-31,0-31,0L393,820c-11.72-.75-31.46-2-38.43-2.59-10.17-.84-7.67-5-7.67-5V787.2l49.33-12.5s19.5,6.67,24.84,12.5c5.07,5.55,8,1.28,17.09,2.88.45.08.92.18,1.41.29,8.59,2,13.25,2.75,16,9.87a32.1,32.1,0,0,1,1.33,4.59C459.38,816.29,442.55,816.2,433.05,820.53Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#a36468\"\n })), _path16 || (_path16 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M455.55,800.24a37.23,37.23,0,0,1-5.55,2.85c-6.47,2.95-12.63,6.55-19.17,9.34s-13.59,4.77-20.68,4.25c-3.7-.27-7.49-1.2-11-.12A25.5,25.5,0,0,0,393,820c-11.72-.75-31.46-2-38.43-2.59-10.17-.84-7.67-5-7.67-5v-2.94a12.5,12.5,0,0,1,1.25-.14,21.94,21.94,0,0,1,7.18,1.07l15.29,4.12a12.1,12.1,0,0,1,5.93-7.51,18.66,18.66,0,0,1,9.49-2.18c7.92.11,15.41,3.86,23.32,4.24A12.91,12.91,0,0,0,415.8,808c1.09-.55,2-1.34,3.1-1.93a21.75,21.75,0,0,1,5.33-1.8,119.69,119.69,0,0,0,15.16-4.92c1.41-.56,3.06-1.56,2.87-3.06-.25-2-3.39-2.24-4.22-4.08a2.41,2.41,0,0,1,.1-2.08c.45.08.92.18,1.41.29C448.14,792.34,452.8,793.12,455.55,800.24Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path17 || (_path17 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M411.55,647.54l-2.67,62.83s-4,12.83-1.83,16.5,5.83,7.33,4.5,9.5S394.22,762,389.05,753s-10.27-48-10.27-48l4.77-48.17Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#444053\"\n })), _path18 || (_path18 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M423.13,491l7.42,9.92V587.2s2.17,23,0,27.75-13.17,14.25-13.17,14.25l-9.25-47.5,2-50.25Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#444053\"\n })), _path19 || (_path19 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M411.55,647.54l-2.67,62.83s-4,12.83-1.83,16.5,5.83,7.33,4.5,9.5S394.22,762,389.05,753s-10.27-48-10.27-48l4.77-48.17Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path20 || (_path20 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M423.13,491l7.42,9.92V587.2s2.17,23,0,27.75-13.17,14.25-13.17,14.25l-9.25-47.5,2-50.25Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path21 || (_path21 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M430.55,454.2v46.67l-8.33,36.33s-2.67,87.67-.34,98.33-8,20.67-8,20.67-6,.67-6,5.33-10,18-10,18l.33,26s4.34,48.67-2.33,58,2.33,10.67,2.33,10.67c-8.33,27.33-48.33,21-51.94,18s0-62,0-62,8.94-90,15.94-94,.34-9,2.67-15-2.33-22.33-2.33-22.33-2-19.34-7-28.67-4.34-35-4.34-35-14-18.67-18.16-26-6.84-26.33-5.84-40.67c.68-9.69,5.77-23.8,9-31.92,1.55-3.89,2.67-6.41,2.67-6.41l.95.25,54.62,14.3Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#444053\"\n })), _path22 || (_path22 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M435.63,231.2c-5.16,1.48-10.09,6.56-14.38,12.73l-1.12,0a35.72,35.72,0,0,1-31-17.93,35.18,35.18,0,0,1-3.14-7.15c3.09-7.85,5.38-14.67,5.38-14.67S451.38,226.7,435.63,231.2Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path23 || (_path23 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M455.88,206.2A35.75,35.75,0,1,1,389,188.68a34.93,34.93,0,0,1,3.78-5.46A36.18,36.18,0,0,1,401,176a35.75,35.75,0,0,1,54.83,27.58C455.85,204.46,455.88,205.33,455.88,206.2Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#efb7b9\"\n })), _path24 || (_path24 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M425.84,291.78l-.12,1.1-16.63-26c-1.74,4.11-2.71,6.86-2.71,6.86S366.88,244,373.13,242c2.1-.67,4.86-5.17,7.59-10.84l.34-.72c2.9,8.64,19.75,25.91,26.76,32.83.81.8,1.48,1.46,2,1.94l1.07,1,.56.56C414,269.4,424.76,281,425.84,291.78Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path25 || (_path25 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M438.27,380l-1.82,58.57L436.13,449s-21.56-2-41.68-4.2c-16.2-1.77-31.47-3.68-33.82-4.8-3-1.41-9.43-2.5-14.5-3.19-3.92-.53-7-.81-7-.81s-1.15.34-2.92.66c-3.86.7-10.64,1.27-14.59-2.16-5.05-4.39,8.22-20.34,11.53-24.17l.73-.83-1.25-11.55L329.38,368s-2-17.25-5-26.5a48.88,48.88,0,0,1-1.73-8.05,64.48,64.48,0,0,1,1.68-25.26,55.08,55.08,0,0,0,1.8-10.69c.5-9.25,28.75-45,35.75-48.25a14.84,14.84,0,0,0,7.16-7.14,13.64,13.64,0,0,0,1.09-3.11c3-13,10.59-7.84,10.59-7.84,1.83,10.17,30.16,37.09,30.16,37.09l.56.56c2.81,2.88,15.33,16.4,14.44,27.94a33.87,33.87,0,0,0,1.89,12.64,213.75,213.75,0,0,1,9.85,56Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#dce6f2\"\n })), _path26 || (_path26 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M398.13,310.45s-7,17-12.25,19.75S400.63,336,398.13,310.45Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path27 || (_path27 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M403.38,342.2s-16,2-16,5S403.38,342.2,403.38,342.2Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path28 || (_path28 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M420.13,361.7s-23.25,49.5-29.75,51S420.13,361.7,420.13,361.7Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path29 || (_path29 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M410.44,270.76l-19.23,8.36L368,244.06a13.64,13.64,0,0,0,1.09-3.11c3-13,10.59-7.84,10.59-7.84,1.83,10.17,30.16,37.09,30.16,37.09Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path30 || (_path30 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M411.44,268.76l-19.23,8.36L369,242.06a13.64,13.64,0,0,0,1.09-3.11c3-13,10.59-7.84,10.59-7.84,1.83,10.17,30.16,37.09,30.16,37.09Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#dce6f2\"\n })), _path31 || (_path31 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M436.13,449s-21.56-2-41.68-4.2l36.1,9.45v11c-1.58,1.43-2.95,2.17-3.84,1.79-4.16-1.75-38.11-7.25-38.11-7.25s-19.72-10-41-22a16.43,16.43,0,0,1-1.5-.94,23.64,23.64,0,0,1-6.3-6.31c-3.93-5.69-5.85-13-6.68-20.17a87.22,87.22,0,0,1-.52-12.38A101.51,101.51,0,0,1,333.88,384a460.08,460.08,0,0,1-3-54c.25-28,26.5-38,26.5-38,48.25-4.25,33.29,73.75,33.29,73.75s-2.79,22-3.55,24.25-3.49,6-3.12,11.25,9.59,11.53,9.59,11.53,9,4.22,12.71,10.47c2.7,4.61,20.24,10.86,30.15,15.32Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path32 || (_path32 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M452.29,184a11.32,11.32,0,0,1-1,4.78,29.55,29.55,0,0,1-1.78,3.56,16.4,16.4,0,0,1-4.38,5.44c-2.31,1.65-5.23,2.11-8,2.78s-5.65,1.74-7.23,4.1a14.34,14.34,0,0,0-1.69,4.9,10.54,10.54,0,0,1-2,4.74,3.93,3.93,0,0,1-4.68,1.12,4.73,4.73,0,0,1-1.81-2.33c-1.14-2.57-1.43-5.42-1.89-8.19s-1.11-5.62-2.81-7.85-4.71-3.7-7.38-2.83a7.11,7.11,0,0,0-4,3.88,22.24,22.24,0,0,0-1.51,5.52q-1.86,10.18-4.39,20.24a1.86,1.86,0,0,1-.33.76,1.44,1.44,0,0,1-1,.42c-2.24.3-4.39-1.27-6.65-1.1a3.82,3.82,0,0,0-.69.11,35.73,35.73,0,0,1,3.61-40.8l.18-.05a10.78,10.78,0,0,0,4-2.52,42.22,42.22,0,0,0,4-4.63l.8-1a45.61,45.61,0,0,1,7.8-7.41,8,8,0,0,1,2.66-1.44,7.88,7.88,0,0,1,2.52-.08,63.57,63.57,0,0,0,10.41.39,66.79,66.79,0,0,1,7.31-.74c6.33.18,11.73,4.65,15.73,9.55C450.24,177.83,452.16,180.72,452.29,184Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path33 || (_path33 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M384.33,189.63c-1.39,2.28-3.9,3.83-4.84,6.33-1.38,3.63.95,8.15-1.19,11.39-.71,1.09-1.88,1.9-2.28,3.15-.68,2.11,1.18,4.36.7,6.53s-3.34,4-2.58,6.12a4,4,0,0,0,2.2,2,8.6,8.6,0,0,0,5,1.11c2.73-.45,4.76-3.13,7.53-3.33,2.25-.16,4.4,1.4,6.64,1.11a1.5,1.5,0,0,0,1-.43,1.73,1.73,0,0,0,.33-.76q2.52-10.05,4.4-20.24a21.8,21.8,0,0,1,1.5-5.52,7.17,7.17,0,0,1,4-3.88c2.67-.86,5.67.6,7.38,2.83s2.36,5.08,2.82,7.85.75,5.62,1.88,8.19a4.78,4.78,0,0,0,1.82,2.34c1.5.87,3.52.18,4.67-1.12a10.43,10.43,0,0,0,2-4.75,14.28,14.28,0,0,1,1.69-4.89c1.58-2.36,4.47-3.43,7.23-4.1s5.67-1.14,8-2.79a16.46,16.46,0,0,0,4.38-5.43c1.48-2.58,2.86-5.38,2.74-8.35-.13-3.24-2.05-6.13-4.1-8.65-4-4.9-9.41-9.37-15.74-9.54a62.2,62.2,0,0,0-7.31.74,62.57,62.57,0,0,1-10.41-.4,8.18,8.18,0,0,0-2.52.09,7.54,7.54,0,0,0-2.65,1.44,45.63,45.63,0,0,0-7.81,7.4,57.31,57.31,0,0,1-4.82,5.6,10.85,10.85,0,0,1-4,2.53c-1,.28-2,.08-2.95.39C386.09,183.52,385.7,187.37,384.33,189.63Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#965d7b\"\n })), _path34 || (_path34 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M480.63,216.82c-8,1.47-14.63-5-18.3-9.72a39.22,39.22,0,0,1-3.07-4.52l27.46,5.18,1.11.21S492.88,214.58,480.63,216.82Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _g2 || (_g2 = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.1\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M376.72,214.17a8.33,8.33,0,0,0-.58-3.84c0,.1-.09.2-.12.3-.43,1.34.15,2.73.52,4.12A3,3,0,0,0,376.72,214.17Z\",\n transform: \"translate(-95.23 -55.03)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M379.1,197.8a22.22,22.22,0,0,0,.08,4.15A22.28,22.28,0,0,0,379.1,197.8Z\",\n transform: \"translate(-95.23 -55.03)\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M448.55,188.45a16.4,16.4,0,0,1-4.38,5.44c-2.31,1.65-5.22,2.11-8,2.78s-5.65,1.74-7.23,4.1a14.41,14.41,0,0,0-1.69,4.9,10.47,10.47,0,0,1-2,4.75c-1.15,1.3-3.17,2-4.67,1.12a4.78,4.78,0,0,1-1.82-2.34c-1.13-2.57-1.43-5.41-1.88-8.19s-1.12-5.62-2.82-7.85-4.71-3.7-7.38-2.83a7.14,7.14,0,0,0-4,3.88,21.8,21.8,0,0,0-1.5,5.52q-1.87,10.19-4.4,20.24a1.73,1.73,0,0,1-.33.76,1.5,1.5,0,0,1-1,.43c-2.24.29-4.39-1.27-6.64-1.11-2.77.2-4.8,2.88-7.53,3.32a8.45,8.45,0,0,1-5-1.11,5.35,5.35,0,0,1-1.83-1.3,2.7,2.7,0,0,0-.37,2.33,3.9,3.9,0,0,0,2.2,2,8.45,8.45,0,0,0,5,1.11c2.73-.44,4.76-3.12,7.53-3.32,2.25-.16,4.4,1.4,6.64,1.11a1.5,1.5,0,0,0,1-.43,1.73,1.73,0,0,0,.33-.76q2.52-10,4.4-20.24a21.8,21.8,0,0,1,1.5-5.52,7.14,7.14,0,0,1,4-3.88c2.67-.87,5.67.6,7.38,2.83s2.36,5.08,2.82,7.85.75,5.62,1.88,8.19a4.78,4.78,0,0,0,1.82,2.34c1.5.87,3.52.18,4.67-1.12a10.47,10.47,0,0,0,2-4.75,14.41,14.41,0,0,1,1.69-4.9c1.58-2.36,4.47-3.42,7.23-4.1s5.67-1.13,8-2.78a16.4,16.4,0,0,0,4.38-5.44c1.48-2.57,2.86-5.37,2.74-8.34a10.74,10.74,0,0,0-.12-1.14A19.65,19.65,0,0,1,448.55,188.45Z\",\n transform: \"translate(-95.23 -55.03)\"\n }))), _path35 || (_path35 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M451.33,188.75a35.33,35.33,0,0,1,4.45,14.85c-8.91-5-17.29-10.49-21.52-12.4-7.37-3.33-34.93-2.83-45.29-2.52a34.93,34.93,0,0,1,3.78-5.46A36.18,36.18,0,0,1,401,176a35.77,35.77,0,0,1,50.38,12.73Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path36 || (_path36 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M483.13,212.58c-4.81,1.48-12.66-1.38-20.8-5.48a39.22,39.22,0,0,1-3.07-4.52l27.46,5.18C488.54,209,489,210.77,483.13,212.58Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path37 || (_path37 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M422.26,154.08s-26.25-1.5-33.63,12.75l-1.19,12.63-2-.22-.4,8.59s40.12-1.75,49.25,2.37,37.5,24.88,48.87,21.38-1-6.75-1-6.75S466.51,198.2,466.51,193,462.63,160.33,422.26,154.08Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#444053\"\n })), _path38 || (_path38 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M371.63,622.28s16.75,16.25,24,15C395.63,637.28,375.13,635.53,371.63,622.28Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path39 || (_path39 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M368.13,629.81s1.5,8.36,5.5,7.54S368.13,629.81,368.13,629.81Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path40 || (_path40 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M394.38,769.53s-23.78,18.5-19.77,19S394.38,769.53,394.38,769.53Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _polygon3 || (_polygon3 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"330.96 347.33 407.96 334.8 407.96 407.7 334.8 403.87 330.96 347.33\",\n fill: \"#2f80ed\"\n })), _polygon4 || (_polygon4 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"330.96 347.33 407.96 334.8 407.96 407.7 334.8 403.87 330.96 347.33\",\n opacity: 0.05\n })), _polygon5 || (_polygon5 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"407.96 334.8 500.3 341.71 495.19 405.15 407.96 407.7 407.96 334.8\",\n fill: \"#2f80ed\"\n })), _polygon6 || (_polygon6 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"407.96 334.8 500.3 341.71 495.19 405.15 407.96 407.7 407.96 334.8\",\n opacity: 0.1\n })), _polygon7 || (_polygon7 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"436.35 312.55 407.96 334.8 500.3 341.71 515.39 318.94 436.35 312.55\",\n fill: \"#2f80ed\"\n })), _polygon8 || (_polygon8 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"303.08 323.03 372.4 314.59 407.96 334.8 330.96 347.33 303.08 323.03\",\n fill: \"#2f80ed\"\n })), _polygon9 || (_polygon9 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"424.84 353.73 424.84 453.4 388.77 449.7 373.08 448.1 368.3 447.6 352.62 445.99 330.96 443.77 330.96 347.33 407.95 352.57 424.84 353.73\",\n fill: \"#2f80ed\"\n })), _polygon10 || (_polygon10 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"500.3 341.71 500.3 438.91 471.39 444.46 457.33 447.16 424.84 453.4 424.84 353.73 500.3 341.71\",\n fill: \"#2f80ed\"\n })), _polygon11 || (_polygon11 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"500.3 341.71 500.3 438.91 471.39 444.46 457.33 447.16 424.84 453.4 424.84 353.73 500.3 341.71\",\n opacity: 0.05\n })), _polygon12 || (_polygon12 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"303.08 368.31 330.96 347.33 424.84 353.73 411.02 377.01 303.08 368.31\",\n fill: \"#2f80ed\"\n })), _polygon13 || (_polygon13 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"303.08 368.31 330.96 347.33 424.84 353.73 411.02 377.01 303.08 368.31\",\n fill: \"#fff\",\n opacity: 0.1\n })), _polygon14 || (_polygon14 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"500.3 341.71 424.84 353.73 449.4 375.73 530.23 362.17 500.3 341.71\",\n fill: \"#2f80ed\"\n })), _polygon15 || (_polygon15 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"500.3 341.71 424.84 353.73 449.4 375.73 530.23 362.17 500.3 341.71\",\n fill: \"#fff\",\n opacity: 0.1\n })), _polygon16 || (_polygon16 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"471.39 444.46 457.33 447.16 457.33 426.39 470.5 423.07 471.39 444.46\",\n fill: \"#fff\",\n opacity: 0.1\n })), _polygon17 || (_polygon17 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"388.77 435.96 388.77 449.7 373.08 448.1 373.08 435.96 388.77 435.96\",\n fill: \"#fff\",\n opacity: 0.1\n })), _polygon18 || (_polygon18 = /*#__PURE__*/React.createElement(\"polygon\", {\n points: \"368.3 440.29 368.3 447.6 352.62 445.99 352.62 440.29 368.3 440.29\",\n fill: \"#fff\",\n opacity: 0.1\n })), _path41 || (_path41 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M510.63,483.7c-10.75,13.75-46.25,4.25-46.25,4.25L438,460.43l-3.58-3.73,7-13s2,.66,5.34,1.82C464.44,451.7,519.68,472.13,510.63,483.7Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path42 || (_path42 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M509.63,481.7c-10.75,13.75-46.25,4.25-46.25,4.25L437,458.43l-3.58-3.73,7-13s2,.66,5.34,1.82C463.44,449.7,518.68,470.13,509.63,481.7Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#efb7b9\"\n })), _path43 || (_path43 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M445.72,443.52c-1.46,4.2-5.17,10.42-8.76,14.91l-3.58-3.73,7-13S442.39,442.36,445.72,443.52Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path44 || (_path44 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M358.38,288s-26.25,10-26.5,38a460.08,460.08,0,0,0,3,54s-7.5,41.75,13.75,53.75,41,22,41,22,33.95,5.5,38.12,7.25,18.66-20.75,16.41-24.5-33.16-13-36.83-19.25-12.71-10.46-12.71-10.46-9.22-6.29-9.59-11.54,2.35-9,3.12-11.25,3.56-24.25,3.56-24.25S406.63,283.7,358.38,288Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#dce6f2\"\n })), _path45 || (_path45 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M370.38,380.7s-35.5,4-32.75,16.5C337.63,397.2,351.12,384.59,370.38,380.7Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path46 || (_path46 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M370.38,385.7s-20.15,14.75-16.45,15.75S370.38,385.7,370.38,385.7Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path47 || (_path47 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M379.38,391.7s-5.75,10.34-2.5,9.8S379.38,391.7,379.38,391.7Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.1\n })), _path48 || (_path48 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M749,167.42s-38-2.29-33.56,24.37c0,0-.89,4.71,3.38,6.85,0,0,.07-2,3.9-1.31a17.51,17.51,0,0,0,4.13.2,8.57,8.57,0,0,0,5.06-2.09h0s10.69-4.41,14.85-21.89c0,0,3.08-3.82,3-4.8l-6.42,2.75s2.19,4.63.46,8.48c0,0-.2-8.31-1.44-8.12-.25,0-3.33,1.61-3.33,1.61s3.77,8.06.92,13.93c0,0,1.08-9.94-2.1-13.35l-4.52,2.64s4.41,8.33,1.42,15.13c0,0,.77-10.43-2.37-14.49l-4.1,3.19s4.15,8.22,1.62,13.86c0,0-.33-12.14-2.51-13.06,0,0-3.58,3.16-4.12,4.46,0,0,2.83,6,1.07,9.11,0,0-1.08-8.09-2-8.13,0,0-3.57,5.36-3.94,9a19.46,19.46,0,0,1,3.07-9.54,10.71,10.71,0,0,0-5.46,2.83s.55-3.79,6.34-4.12c0,0,3-4.07,3.74-4.32,0,0-5.76-.48-9.25,1.07,0,0,3.07-3.57,10.31-2l4-3.3s-7.58-1-10.8.11c0,0,3.7-3.16,11.89-.86l4.4-2.63s-6.46-1.4-10.31-.89c0,0,4.06-2.19,11.6.18l3.15-1.41s-4.74-.93-6.12-1.08-1.46-.53-1.46-.53a16.36,16.36,0,0,1,8.89,1S749.14,167.84,749,167.42Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\"\n })), _path49 || (_path49 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M864.46,300.76s-38-2.29-33.56,24.37c0,0-.89,4.71,3.38,6.85,0,0,.07-2,3.91-1.31a17.51,17.51,0,0,0,4.13.2,8.56,8.56,0,0,0,5-2.08h0s10.7-4.42,14.86-21.9c0,0,3.07-3.81,2.95-4.79l-6.42,2.74s2.19,4.63.47,8.48c0,0-.21-8.31-1.44-8.12-.25,0-3.34,1.61-3.34,1.61s3.78,8.07.93,13.93c0,0,1.08-9.94-2.11-13.35L848.75,310s4.41,8.33,1.42,15.13c0,0,.77-10.43-2.37-14.49l-4.09,3.2s4.14,8.21,1.62,13.85c0,0-.33-12.14-2.51-13.06,0,0-3.58,3.16-4.13,4.46,0,0,2.84,6,1.08,9.11,0,0-1.08-8.09-2-8.13,0,0-3.57,5.36-3.94,9a19.52,19.52,0,0,1,3.08-9.54,10.76,10.76,0,0,0-5.47,2.83s.56-3.79,6.35-4.12c0,0,2.95-4.07,3.74-4.32,0,0-5.76-.48-9.25,1.07,0,0,3.07-3.57,10.3-1.95l4-3.3s-7.59-1-10.8.11c0,0,3.7-3.16,11.89-.86l4.4-2.63s-6.47-1.39-10.32-.89c0,0,4.07-2.19,11.61.18l3.15-1.41s-4.74-.93-6.13-1.08-1.46-.53-1.46-.53a16.39,16.39,0,0,1,8.9,1S864.58,301.18,864.46,300.76Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path50 || (_path50 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M633.61,277.09s8.75-37.09-18.29-37.22c0,0-4.49-1.68-7.32,2.16,0,0,1.93.41.62,4.07a17.8,17.8,0,0,0-.9,4,8.59,8.59,0,0,0,1.19,5.33h0s2.53,11.3,19,18.38c0,0,3.24,3.68,4.22,3.72l-1.6-6.79s-4.94,1.37-8.44-1c0,0,8.23,1.21,8.24,0,0-.25-1-3.56-1-3.56s-8.59,2.34-13.89-1.47c0,0,9.61,2.76,13.52.21L627.16,260s-9,2.93-15.16-1.18c0,0,10.15,2.54,14.69.14l-2.45-4.58s-8.8,2.68-13.93-.77c0,0,12,1.74,13.3-.24,0,0-2.5-4.07-3.69-4.83,0,0-6.36,1.78-9.16-.49,0,0,8.15.31,8.34-.55,0,0-4.67-4.43-8.23-5.43a19.6,19.6,0,0,1,8.89,4.66,10.79,10.79,0,0,0-1.86-5.87s3.64,1.2,3,7c0,0,3.5,3.6,3.61,4.42,0,0,1.45-5.59.52-9.3,0,0,3,3.64.17,10.49l2.56,4.55s2.32-7.3,1.73-10.66c0,0,2.49,4.18-1.18,11.86l1.85,4.79s2.47-6.14,2.63-10c0,0,1.47,4.38-2.16,11.41l.86,3.34s1.72-4.51,2.1-5.85.77-1.35.77-1.35a16.38,16.38,0,0,1-2.49,8.6S633.18,277.14,633.61,277.09Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path51 || (_path51 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M550.39,289.73s-30.52-22.83-41.43,1.9c0,0-3.33,3.45-.94,7.58,0,0,1.14-1.61,4,1.06a17.51,17.51,0,0,0,3.34,2.44,8.58,8.58,0,0,0,5.37,1h0s11.36,2.19,24.44-10.12c0,0,4.67-1.5,5.11-2.38L543.39,290s-.72,5.07-4.27,7.34c0,0,4.39-7.06,3.25-7.57-.23-.11-3.67-.5-3.67-.5s-1.28,8.82-6.88,12.15c0,0,6.37-7.71,5.58-12.31l-5.23-.28s-.89,9.39-7.13,13.43c0,0,6.37-8.29,6-13.41l-5.18.42s-1.05,9.13-6.26,12.45c0,0,6.39-10.32,5.08-12.28,0,0-4.73.67-5.9,1.45,0,0-.91,6.54-4.11,8.2,0,0,3.55-7.35,2.83-7.86,0,0-5.93,2.51-8.26,5.37a19.53,19.53,0,0,1,7.82-6.28,10.77,10.77,0,0,0-6.12-.64s2.54-2.86,7.56.05c0,0,4.7-1.77,5.5-1.55,0,0-4.55-3.57-8.32-4.19,0,0,4.54-1.3,9.69,4l5.19-.53s-5.77-5-9.08-5.84c0,0,4.83-.61,10.4,5.81l5.12.23s-4.63-4.72-8.12-6.42c0,0,4.59.4,9.59,6.53l3.41.55s-3.45-3.38-4.53-4.26-.93-1.25-.93-1.25a16.43,16.43,0,0,1,6.89,5.72S550.26,290.14,550.39,289.73Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path52 || (_path52 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M652,77.62s-30.52-22.84-41.43,1.9c0,0-3.33,3.45-.94,7.58,0,0,1.14-1.61,4,1.06a17.79,17.79,0,0,0,3.35,2.43,8.57,8.57,0,0,0,5.37,1h0s11.36,2.19,24.44-10.13c0,0,4.67-1.49,5.1-2.38L645,77.89s-.71,5.07-4.27,7.34c0,0,4.4-7.06,3.26-7.57-.23-.11-3.67-.5-3.67-.5S639,86,633.4,89.31c0,0,6.36-7.71,5.58-12.31l-5.23-.28s-.9,9.39-7.13,13.42c0,0,6.37-8.29,6-13.41l-5.17.42s-1.06,9.14-6.27,12.46c0,0,6.4-10.32,5.09-12.28,0,0-4.73.67-5.9,1.45,0,0-.91,6.54-4.11,8.2,0,0,3.55-7.35,2.83-7.87,0,0-5.93,2.52-8.26,5.38a19.44,19.44,0,0,1,7.82-6.28,10.7,10.7,0,0,0-6.13-.64s2.55-2.86,7.57.05c0,0,4.7-1.78,5.5-1.55,0,0-4.55-3.57-8.32-4.2,0,0,4.53-1.29,9.68,4l5.19-.53s-5.76-5-9.08-5.85c0,0,4.83-.6,10.41,5.82l5.12.22s-4.63-4.72-8.13-6.41c0,0,4.6.4,9.6,6.53l3.4.55S640,72.86,638.92,72s-.93-1.24-.93-1.24a16.4,16.4,0,0,1,6.89,5.72S651.83,78,652,77.62Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path53 || (_path53 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M768.62,106.55s-12.2-36.11-35.21-21.92c0,0-4.7,1-5.07,5.71,0,0,1.85-.68,2.67,3.12a18,18,0,0,0,1.37,3.91,8.66,8.66,0,0,0,3.84,3.89h0s8.12,8.25,25.88,5.52c0,0,4.69,1.42,5.55.93l-5-4.91s-3.46,3.77-7.68,3.62c0,0,7.63-3.32,7-4.39-.13-.21-2.74-2.48-2.74-2.48s-6.06,6.53-12.56,6.1c0,0,9.61-2.74,11.57-7l-4.14-3.19s-6.06,7.22-13.49,7c0,0,10-3.21,12.53-7.65l-4.5-2.59s-6,6.93-12.22,6.71c0,0,11.12-4.87,11.15-7.23,0,0-4.27-2.13-5.68-2.15,0,0-4.46,4.87-8,4.43,0,0,7.08-4.05,6.78-4.88,0,0-6.3-1.29-9.85-.25a19.49,19.49,0,0,1,10-.75,10.79,10.79,0,0,0-4.69-4s3.72-.91,6.21,4.33c0,0,4.88,1.21,5.4,1.84,0,0-1.72-5.51-4.47-8.17,0,0,4.47,1.51,5.69,8.82l4.58,2.5s-1.89-7.41-4.17-10c0,0,4.33,2.24,5.27,10.69l4.1,3.09s-1.14-6.52-3.06-9.9c0,0,3.56,2.94,4.2,10.83l2.49,2.38s-.92-4.74-1.3-6.08S761,93,761,93a16.49,16.49,0,0,1,2.43,8.62S768.27,106.81,768.62,106.55Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path54 || (_path54 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M689,108.33S651.1,104.11,654.23,131c0,0-1.13,4.66,3,7,0,0,.17-2,4-1.1a18.4,18.4,0,0,0,4.12.41,8.6,8.6,0,0,0,5.15-1.83h0s10.91-3.87,16-21.12c0,0,3.26-3.65,3.19-4.64l-6.55,2.42s2,4.73,0,8.49c0,0,.21-8.31-1-8.18-.25,0-3.41,1.44-3.41,1.44s3.36,8.25.22,14c0,0,1.58-9.88-1.43-13.44l-4.65,2.4s4,8.55.65,15.19c0,0,1.3-10.38-1.63-14.59l-4.25,3s3.72,8.41.91,13.92c0,0,.29-12.14-1.84-13.17,0,0-3.74,3-4.35,4.24,0,0,2.53,6.1.62,9.15,0,0-.67-8.13-1.55-8.21,0,0-3.84,5.17-4.4,8.82a19.47,19.47,0,0,1,3.56-9.38,10.76,10.76,0,0,0-5.6,2.55s.74-3.75,6.54-3.79c0,0,3.15-3.91,4-4.12,0,0-5.73-.77-9.3.6,0,0,3.25-3.42,10.39-1.43l4.21-3.09S663.22,115,660,116c0,0,3.86-3,11.92-.25l4.53-2.41s-6.39-1.72-10.26-1.41c0,0,4.17-2,11.58.77l3.22-1.25s-4.69-1.17-6.07-1.39-1.43-.6-1.43-.6a16.45,16.45,0,0,1,8.84,1.44S689.07,108.75,689,108.33Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path55 || (_path55 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1020.6,402.5s-37.88-4.22-34.75,22.64c0,0-1.13,4.66,3,7,0,0,.17-2,4-1.11a17.3,17.3,0,0,0,4.12.41,8.53,8.53,0,0,0,5.15-1.83h0s10.91-3.87,15.95-21.11c0,0,3.26-3.66,3.19-4.64l-6.55,2.41s2,4.74,0,8.5c0,0,.21-8.32-1-8.18-.25,0-3.41,1.43-3.41,1.43s3.36,8.25.22,14c0,0,1.58-9.87-1.43-13.44l-4.65,2.41s4,8.55.66,15.19c0,0,1.29-10.38-1.64-14.6l-4.25,3s3.72,8.41.91,13.91c0,0,.29-12.14-1.84-13.16,0,0-3.73,3-4.35,4.24,0,0,2.54,6.1.62,9.15,0,0-.67-8.13-1.55-8.21,0,0-3.84,5.17-4.4,8.82a19.47,19.47,0,0,1,3.56-9.38,10.67,10.67,0,0,0-5.6,2.55s.74-3.76,6.54-3.8c0,0,3.16-3.91,4-4.11,0,0-5.73-.78-9.3.59,0,0,3.25-3.41,10.4-1.42l4.2-3.09s-7.52-1.42-10.79-.44c0,0,3.86-3,11.92-.26l4.53-2.4s-6.39-1.72-10.26-1.41c0,0,4.17-2,11.58.77l3.22-1.26s-4.69-1.17-6.07-1.38-1.43-.6-1.43-.6a16.39,16.39,0,0,1,8.84,1.43S1020.7,402.93,1020.6,402.5Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path56 || (_path56 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M1078.51,437.88s-37.88-4.21-34.75,22.64c0,0-1.12,4.66,3,7,0,0,.17-2,4-1.1a17.65,17.65,0,0,0,4.11.4A8.64,8.64,0,0,0,1060,465h0s10.9-3.87,15.94-21.12c0,0,3.27-3.65,3.19-4.64l-6.55,2.41s2,4.74,0,8.5c0,0,.21-8.31-1-8.18-.25,0-3.41,1.43-3.41,1.43s3.36,8.25.22,14c0,0,1.58-9.87-1.43-13.43l-4.65,2.4s4,8.55.66,15.19c0,0,1.29-10.38-1.64-14.59l-4.25,3s3.72,8.41.92,13.92c0,0,.28-12.15-1.85-13.17,0,0-3.73,3-4.35,4.24,0,0,2.54,6.1.62,9.15,0,0-.67-8.13-1.55-8.21,0,0-3.84,5.17-4.39,8.82a19.52,19.52,0,0,1,3.55-9.38,10.76,10.76,0,0,0-5.6,2.55s.75-3.76,6.55-3.79c0,0,3.15-3.91,4-4.12,0,0-5.73-.77-9.3.6,0,0,3.25-3.42,10.4-1.43l4.2-3.09s-7.52-1.42-10.79-.44c0,0,3.86-3,11.92-.25l4.53-2.41s-6.39-1.72-10.26-1.41c0,0,4.17-2,11.58.77l3.22-1.25s-4.69-1.17-6.06-1.39-1.44-.6-1.44-.6a16.45,16.45,0,0,1,8.84,1.44S1078.61,438.31,1078.51,437.88Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path57 || (_path57 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M949.94,139.87s-30.52-22.83-41.43,1.9c0,0-3.33,3.45-.94,7.58,0,0,1.14-1.61,4,1.06a17.51,17.51,0,0,0,3.34,2.44,8.59,8.59,0,0,0,5.37,1h0s11.36,2.19,24.45-10.12c0,0,4.66-1.5,5.1-2.38l-6.87-1.24s-.72,5.07-4.27,7.34c0,0,4.39-7.06,3.25-7.57-.23-.11-3.66-.5-3.66-.5s-1.29,8.82-6.89,12.15c0,0,6.37-7.71,5.58-12.31l-5.23-.28s-.89,9.39-7.13,13.43c0,0,6.38-8.29,6-13.41l-5.18.42s-1,9.13-6.26,12.45c0,0,6.4-10.32,5.08-12.28,0,0-4.73.67-5.9,1.45,0,0-.9,6.54-4.1,8.2,0,0,3.54-7.35,2.82-7.86,0,0-5.93,2.51-8.26,5.37a19.53,19.53,0,0,1,7.82-6.28,10.77,10.77,0,0,0-6.12-.64s2.55-2.86,7.57.05c0,0,4.69-1.77,5.49-1.55,0,0-4.55-3.57-8.32-4.19,0,0,4.54-1.3,9.69,4l5.19-.53s-5.76-5-9.08-5.84c0,0,4.83-.61,10.4,5.81l5.13.23s-4.64-4.72-8.13-6.42c0,0,4.6.4,9.59,6.53l3.41.55s-3.45-3.38-4.53-4.26S936,133,936,133a16.44,16.44,0,0,1,6.88,5.72S949.81,140.28,949.94,139.87Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path58 || (_path58 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M973.52,304.69S963,268.06,939.34,281.21c0,0-4.74.73-5.33,5.47,0,0,1.88-.59,2.53,3.24a17.73,17.73,0,0,0,1.2,4A8.59,8.59,0,0,0,941.4,298h0s7.74,8.6,25.6,6.68c0,0,4.62,1.62,5.5,1.18l-4.73-5.14s-3.63,3.62-7.83,3.28c0,0,7.76-3,7.16-4.07-.12-.22-2.62-2.61-2.62-2.61s-6.34,6.26-12.82,5.53c0,0,9.73-2.3,11.87-6.44l-4-3.38s-6.38,6.94-13.79,6.4c0,0,10.08-2.77,12.86-7.08l-4.38-2.79s-6.35,6.65-12.51,6.15c0,0,11.33-4.37,11.47-6.72,0,0-4.18-2.32-5.59-2.4,0,0-4.67,4.66-8.22,4.06,0,0,7.26-3.73,7-4.57,0,0-6.24-1.57-9.83-.7a19.51,19.51,0,0,1,10-.29,10.73,10.73,0,0,0-4.5-4.2s3.76-.75,6,4.6c0,0,4.81,1.42,5.31,2.08,0,0-1.47-5.59-4.1-8.36,0,0,4.4,1.7,5.29,9.06l4.46,2.71s-1.56-7.5-3.72-10.14c0,0,4.22,2.43,4.79,10.91l4,3.27s-.85-6.56-2.61-10c0,0,3.43,3.1,3.71,11l2.38,2.5s-.7-4.78-1-6.14,0-1.55,0-1.55a16.39,16.39,0,0,1,2.05,8.72S973.16,304.93,973.52,304.69Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path59 || (_path59 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M739.1,387.23s-20.43-32.18-39.4-12.92c0,0-4.34,2-3.58,6.75,0,0,1.65-1.1,3.35,2.4a17.12,17.12,0,0,0,2.26,3.46,8.54,8.54,0,0,0,4.65,2.88h0s9.85,6.08,26.45-.8c0,0,4.89.26,5.61-.41l-6-3.6s-2.47,4.5-6.6,5.35c0,0,6.62-5,5.73-5.92-.17-.18-3.25-1.76-3.25-1.76s-4.33,7.78-10.75,8.91c0,0,8.69-4.95,9.59-9.53l-4.79-2.11s-4.17,8.45-11.43,10c0,0,8.9-5.49,10.35-10.41l-5-1.44s-4.22,8.17-10.27,9.42c0,0,9.64-7.38,9.11-9.68,0,0-4.66-1.05-6-.73,0,0-3.17,5.79-6.75,6.21,0,0,5.92-5.62,5.43-6.36,0,0-6.43.25-9.63,2.1a19.46,19.46,0,0,1,9.54-3.1,10.73,10.73,0,0,0-5.49-2.77s3.39-1.77,7,2.73c0,0,5,0,5.69.5,0,0-3-5-6.29-6.87,0,0,4.7.4,7.62,7.21l5.05,1.34s-3.61-6.75-6.42-8.68c0,0,4.73,1.14,7.66,9.13l4.72,2s-2.66-6.05-5.33-8.88c0,0,4.16,2,6.65,9.51l3,1.73s-2-4.39-2.71-5.6-.43-1.49-.43-1.49a16.4,16.4,0,0,1,4.41,7.79S738.83,387.57,739.1,387.23Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _path60 || (_path60 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M873.37,222.81s-19.43-32.79-39-14.13c0,0-4.4,1.9-3.78,6.64,0,0,1.67-1.06,3.27,2.49a17.28,17.28,0,0,0,2.15,3.54,8.49,8.49,0,0,0,4.56,3h0s9.65,6.38,26.46,0c0,0,4.88.41,5.62-.24l-5.87-3.78s-2.6,4.41-6.76,5.14c0,0,6.77-4.83,5.92-5.74-.18-.19-3.2-1.87-3.2-1.87s-4.57,7.65-11,8.58c0,0,8.84-4.68,9.87-9.22L856.89,215s-4.43,8.33-11.74,9.66c0,0,9.07-5.21,10.67-10.08l-4.94-1.6s-4.48,8-10.56,9.1c0,0,9.86-7.08,9.4-9.39,0,0-4.62-1.2-6-.92,0,0-3.35,5.69-6.94,6,0,0,6.09-5.42,5.63-6.18,0,0-6.44.05-9.69,1.8a19.52,19.52,0,0,1,9.63-2.8,10.75,10.75,0,0,0-5.41-2.94s3.45-1.67,7,2.94c0,0,5,.17,5.67.68,0,0-2.83-5-6.07-7.06,0,0,4.68.54,7.39,7.44l5,1.5s-3.39-6.86-6.15-8.88c0,0,4.7,1.29,7.38,9.36l4.65,2.17s-2.47-6.13-5-9c0,0,4.09,2.13,6.36,9.71l2.93,1.82s-1.88-4.45-2.54-5.68-.38-1.5-.38-1.5a16.43,16.43,0,0,1,4.17,7.92S873.08,223.14,873.37,222.81Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\"\n })), _path61 || (_path61 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M750.44,291.76s1-38.1-25.47-32.73c0,0-4.74-.73-6.74,3.61,0,0,2,0,1.44,3.85a17.56,17.56,0,0,0-.06,4.14,8.55,8.55,0,0,0,2.25,5h0s4.77,10.54,22.38,14.12c0,0,3.91,2.95,4.89,2.79l-3-6.32s-4.55,2.34-8.46.75c0,0,8.3-.49,8.07-1.71,0-.25-1.72-3.29-1.72-3.29s-7.94,4.05-13.89,1.39c0,0,10,.75,13.27-2.54l-2.79-4.43s-8.18,4.68-15.08,1.92c0,0,10.45.42,14.41-2.85l-3.33-4s-8.07,4.42-13.79,2.08c0,0,12.12-.73,13-2.94,0,0-3.28-3.47-4.6-4,0,0-5.86,3-9.06,1.38,0,0,8-1.34,8.05-2.23,0,0-5.47-3.39-9.16-3.64a19.47,19.47,0,0,1,9.65,2.76,10.75,10.75,0,0,0-3-5.37s3.81.43,4.33,6.2c0,0,4.17,2.82,4.44,3.6,0,0,.29-5.77-1.38-9.21,0,0,3.68,2.95,2.3,10.23l3.43,3.94s.78-7.62-.47-10.79c0,0,3.28,3.59,1.26,11.85l2.77,4.31s1.18-6.51.55-10.34c0,0,2.32,4,.2,11.61l1.52,3.1s.77-4.77.87-6.16.48-1.48.48-1.48a16.42,16.42,0,0,1-.69,8.93S750,291.89,750.44,291.76Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\"\n })), _ellipse2 || (_ellipse2 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 698.97,\n cy: 716.3,\n rx: 26.93,\n ry: 4.55,\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _ellipse3 || (_ellipse3 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 600.8,\n cy: 785.38,\n rx: 26.93,\n ry: 4.55,\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _ellipse4 || (_ellipse4 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 93.14,\n cy: 749.99,\n rx: 26.93,\n ry: 4.55,\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _ellipse5 || (_ellipse5 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 805.06,\n cy: 780.83,\n rx: 26.93,\n ry: 4.55,\n fill: \"#2f80ed\",\n opacity: 0.1\n })), _ellipse6 || (_ellipse6 = /*#__PURE__*/React.createElement(\"ellipse\", {\n cx: 833.1,\n cy: 723.1,\n rx: 40.21,\n ry: 6.8,\n fill: \"#2f80ed\"\n })), _path62 || (_path62 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M945,767a11.61,11.61,0,0,0,3.83-5.78c.5-2.3-.48-5.05-2.67-5.89-2.46-.94-5.09.76-7.09,2.48s-4.27,3.69-6.88,3.33a10.5,10.5,0,0,0,3.24-9.81,4.11,4.11,0,0,0-.9-2c-1.37-1.46-3.84-.83-5.48.32-5.2,3.66-6.65,10.72-6.68,17.08-.52-2.29-.08-4.68-.09-7s-.66-5-2.65-6.22a7.91,7.91,0,0,0-4-1c-2.34-.08-4.95.15-6.54,1.86-2,2.12-1.47,5.69.25,8s4.35,3.8,6.77,5.42a15.13,15.13,0,0,1,4.84,4.61,4.7,4.7,0,0,1,.35.82h14.66A40.44,40.44,0,0,0,945,767Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#2f80ed\"\n })), _path63 || (_path63 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M170.29,783.87s15.35-.47,20-3.77,23.63-7.23,24.78-1.94,23.08,26.29,5.74,26.43-40.29-2.7-44.91-5.52S170.29,783.87,170.29,783.87Z\",\n transform: \"translate(-95.23 -55.03)\",\n fill: \"#a8a8a8\"\n })), _path64 || (_path64 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M221.1,802.75c-17.34.14-40.29-2.7-44.91-5.52-3.52-2.14-4.92-9.83-5.39-13.38l-.51,0s1,12.39,5.59,15.2,27.57,5.66,44.91,5.52c5,0,6.73-1.82,6.64-4.46C226.73,801.72,224.82,802.72,221.1,802.75Z\",\n transform: \"translate(-95.23 -55.03)\",\n opacity: 0.2\n })));\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgEmpty, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/empty.7214f99f.svg\";\nexport { ForwardRef as ReactComponent };","import React, { useState, useEffect, useContext } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport Chart from \"react-apexcharts\";\r\nimport _ from \"lodash\";\r\nimport { API } from \"aws-amplify\";\r\nimport {\r\n CircularProgressbarWithChildren,\r\n buildStyles,\r\n} from \"react-circular-progressbar\";\r\nimport \"react-circular-progressbar/dist/styles.css\";\r\nimport { throttle } from \"lodash\";\r\nimport ContentLoader from \"react-content-loader\";\r\nimport moment from \"moment\";\r\n\r\nimport { Page, Icon, SetupGuide } from \"components\";\r\nimport { EmptyState, SearchDropdown, DateRange, Button } from \"components\";\r\nimport { ReactComponent as Empty } from \"svgs/empty.svg\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport classNames from \"lib/classNames\";\r\nimport { chartOptions, stateCards } from \"lib/globals\";\r\nimport { getShopifyCartItems } from \"../components/cart/Utils\";\r\nimport styles from \"styles/dashboard.module.scss\";\r\nimport { formatMoney } from \"components/cart/Utils\";\r\n\r\nwindow.mo = moment;\r\nconst defaultStateCards = {\r\n CartsDisplayed: null,\r\n SalesGenerated: null,\r\n SalesAmount: null,\r\n AverageOrderSize: null,\r\n CartConversionRate: null,\r\n UpsellsGenerated: null,\r\n UpsellsTotalAmount: null,\r\n TotalROI: null,\r\n};\r\nconst DashboardScreen = (props) => {\r\n const [activeChart, setActiveChart] = useState(\"CartsDisplayed\");\r\n const [loading, setLoading] = useState(false);\r\n const [campaignsFilter, setCampaignsFilter] = useState([]);\r\n const [dateRangeFilter, setDateRangeFilter] = useState(null);\r\n const [chartSeries, setChartSeries] = useState([\r\n {\r\n name: \"test\",\r\n data: [1, 2, 3],\r\n },\r\n ]);\r\n const [count, setCount] = useState(defaultStateCards);\r\n const { state: shop } = useContext(ShopContext);\r\n const formatter = (val, opts) => {\r\n switch (activeChart) {\r\n // case \"views\":\r\n // return `${val} views`;\r\n case \"revenue\":\r\n return `${val} $`;\r\n case \"CartConversionRate\":\r\n return `${val} %`;\r\n default:\r\n return val;\r\n }\r\n };\r\n const getChart = async (newActiveChart = \"CartsDisplayed\") => {\r\n setActiveChart(newActiveChart);\r\n setLoading(true);\r\n const dateFilter = dateRangeFilter\r\n ? {\r\n start: new Date(dateRangeFilter[0]).getTime(),\r\n end: new Date(dateRangeFilter[1]).getTime(),\r\n }\r\n : {};\r\n const data = await API.get(\"API_GATEWAY_NEW\", \"/analytics/chart\", {\r\n queryStringParameters: Object.assign(\r\n {\r\n type: newActiveChart,\r\n campaigns: campaignsFilter,\r\n },\r\n dateFilter\r\n ),\r\n });\r\n setChartSeries([\r\n {\r\n name: newActiveChart,\r\n data: data[newActiveChart]\r\n ? data[newActiveChart]\r\n .map((point) => {\r\n const { x = 0, y = 0 } = point || {};\r\n return x ? { x, y: y || 0 } : undefined;\r\n })\r\n .filter((p) => !!p)\r\n : [],\r\n },\r\n ]);\r\n setLoading(false);\r\n };\r\n const getCount = async () => {\r\n setCount(defaultStateCards);\r\n const dateFilter = dateRangeFilter\r\n ? {\r\n start: new Date(dateRangeFilter[0]).getTime(),\r\n end: new Date(dateRangeFilter[1]).getTime(),\r\n }\r\n : {};\r\n const count = await API.get(\"API_GATEWAY_NEW\", \"/analytics/count\", {\r\n queryStringParameters: Object.assign(\r\n {\r\n campaigns: campaignsFilter,\r\n },\r\n dateFilter\r\n ),\r\n });\r\n setCount(count);\r\n };\r\n const searchCampaigns = (keyword) =>\r\n API.get(\"API_GATEWAY_NEW\", \"/campaigns/search\", {\r\n queryStringParameters: { keyword },\r\n });\r\n const searchCampaignsThrottle = throttle(searchCampaigns, 700);\r\n\r\n useEffect(() => {\r\n getCount();\r\n getChart();\r\n return () => {\r\n console.log(\"dashboard screen cleanup\");\r\n };\r\n }, [campaignsFilter, dateRangeFilter]);\r\n return (\r\n <Page\r\n header={{\r\n title: \"Dashboard\",\r\n actions: [],\r\n }}\r\n loading={{\r\n text: \"Loading\",\r\n status: false,\r\n }}\r\n background=\"none\"\r\n padding={0}\r\n >\r\n <div\r\n className={classNames(\r\n \"grid grid-flow-row gap-8 grid-cols-1 lg:grid-cols-3\"\r\n )}\r\n >\r\n <div\r\n className={classNames(\r\n \"col-span-1 lg:col-span-3 flex items-center flex-wrap space-y-3 sm:space-y-0 sm:space-x-3\"\r\n )}\r\n >\r\n <b className={classNames(\"flex-1 text-gray-600 text-lg\")}>Stats</b>\r\n {/* <SearchDropdown\r\n\t\t\t\t\t\tclassName={classNames('flex-auto w-full sm:flex-1')}\r\n\t\t\t\t\t\tplaceholder=\"Campaigns Filter\"\r\n\t\t\t\t\t\tpromise={(keyword) => searchCampaignsThrottle(keyword)}\r\n\t\t\t\t\t\tonChange={(selected) => {\r\n\t\t\t\t\t\t\tsetCampaignsFilter(selected ? selected.map(({ value }) => value) : []);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/> */}\r\n <DateRange\r\n onChange={(range) => {\r\n setDateRangeFilter(range);\r\n }}\r\n maxDate={new Date()}\r\n value={dateRangeFilter}\r\n className={classNames(\"flex-auto w-full sm:flex-1\")}\r\n button={{\r\n text: \"Date Filter\",\r\n icon: \"calendar-alt\",\r\n }}\r\n />\r\n </div>\r\n <div\r\n className={classNames(\r\n \"col-span-1 lg:col-span-3 grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4\"\r\n )}\r\n >\r\n {stateCards.map((stateCard, i) => (\r\n <StateCard\r\n {...stateCard}\r\n value={count[stateCard.title]}\r\n key={i}\r\n position={i + 1}\r\n onClick={() => {\r\n if (stateCard.clickable === false) return;\r\n getChart(stateCard.title);\r\n }}\r\n active={activeChart == stateCard.title.toString() ? 1 : 0}\r\n />\r\n ))}\r\n </div>\r\n <div\r\n className={classNames(\r\n \"col-span-2 lg:col-span-3 bg-white p-3 relative rounded p-6 shadow\"\r\n )}\r\n >\r\n <Chart\r\n options={chartOptions(formatter)}\r\n series={chartSeries}\r\n type=\"area\"\r\n />\r\n {loading && (\r\n <div className={styles.loading}>\r\n <Icon\r\n icon=\"spinner-third\"\r\n className=\"fa-spin\"\r\n style={{\r\n animation: \"fa-spin 0.5s infinite linear\",\r\n }}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n {/* <div\r\n className={classNames(\r\n \"col-span-1 lg:col-span-1 text-gray-600 flex flex-col space-y-6\"\r\n )}\r\n >\r\n <h3 className={classNames(\"font-bold text-lg leading-none\")}>\r\n Setup guide - Increase revenue\r\n </h3>\r\n <iframe\r\n style={{ width: \"100%\", height: \"250px\" }}\r\n frameBorder=\"0\"\r\n allowFullScreen=\"1\"\r\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\r\n title=\"Setup guide - Increase revenue\"\r\n src=\"https://www.youtube.com/embed/22qamcR2eOc?autoplay=0&cc_load_policy=1&controls=2&hl=en&rel=0&enablejsapi=1&\"\r\n ></iframe>\r\n </div> */}\r\n </div>\r\n </Page>\r\n );\r\n};\r\n\r\nDashboardScreen.propTypes = {};\r\n\r\nconst Step = ({ index, title, completed = false, children }) => (\r\n <div\r\n className={classNames(\"flex items-start p-3 rounded bg-white shadow\")}\r\n data-completed={completed}\r\n >\r\n <span\r\n className={classNames(\r\n \"bg-orange-400 text-white w-8 h-8 rounded-full inline-flex items-center justify-center mr-3\",\r\n {\r\n \"bg-green-500\": completed,\r\n }\r\n )}\r\n >\r\n {completed ? (\r\n <Icon icon=\"check\" size=\"xs\" />\r\n ) : (\r\n <span className={classNames(\"font-bold\")}>{index}</span>\r\n )}\r\n </span>\r\n <div className={classNames(\"flex-1\")}>\r\n <h4\r\n className={classNames(\"font-bold mb-2 leading-none text-orange-400\", {\r\n \"line-through text-green-500\": completed,\r\n })}\r\n >\r\n {title}\r\n </h4>\r\n <div className={classNames(\"text-xs text-opacity-50\")}>{children}</div>\r\n </div>\r\n </div>\r\n);\r\n\r\nconst StateCard = (props) => {\r\n const {\r\n title,\r\n label,\r\n value,\r\n suf,\r\n pre,\r\n onClick,\r\n active,\r\n currency,\r\n clickable,\r\n } = props;\r\n const {\r\n state: { money_format },\r\n } = useContext(ShopContext);\r\n return (\r\n // <div className={styles.stateCard} {...{ position, onClick, active }}>\r\n <div\r\n className={classNames(\r\n \"shadow flex-1 bg-white rounded p-5 text-gray-600\",\r\n {\r\n \"text-blue-500 ring\": active,\r\n },\r\n {\r\n \"cursor-pointer\": clickable !== false,\r\n }\r\n )}\r\n {...{ onClick, active }}\r\n >\r\n {value === null && (\r\n <ContentLoader>\r\n <rect x=\"0\" y=\"0\" rx=\"4\" ry=\"4\" width=\"60%\" height=\"30\" />\r\n <rect x=\"0\" y=\"60\" rx=\"4\" ry=\"4\" width=\"30%\" height=\"30\" />\r\n </ContentLoader>\r\n )}\r\n {typeof value === \"number\" && (\r\n <>\r\n <h3 className={classNames(\"font-bold mb-3\")}>\r\n {label || _.startCase(title)}\r\n </h3>\r\n <h1 className={classNames(\"font-bold text-4xl\")}>\r\n {pre && <i className={styles.pre}>{pre}</i>}{\" \"}\r\n {currency ? (\r\n <span\r\n dangerouslySetInnerHTML={{\r\n __html: formatMoney(value * 100, money_format),\r\n }}\r\n ></span>\r\n ) : (\r\n value\r\n )}{\" \"}\r\n {suf && <i className={styles.suf}>{suf}</i>}\r\n </h1>\r\n </>\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nconst SetupAlert = (props) => {\r\n const { title, content, value } = props;\r\n return (\r\n <div className={styles.SetupAlert}>\r\n <div className={styles.content}>\r\n <b>{title}</b>\r\n <p>{content}</p>\r\n </div>\r\n <div className={styles.progress}>\r\n <CircularProgressbarWithChildren\r\n value={value}\r\n // text=\r\n strokeWidth={10}\r\n styles={buildStyles({\r\n // Rotation of path and trail, in number of turns (0-1)\r\n strokeLinecap: \"round\",\r\n textSize: \"17px\",\r\n pathTransitionDuration: 0.5,\r\n pathColor: \"#fff\",\r\n textColor: \"#fff\",\r\n trailColor: \"#286CC8\",\r\n backgroundColor: \"#3e98c7\",\r\n })}\r\n >\r\n <b>{`${value}%`}</b>\r\n </CircularProgressbarWithChildren>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default DashboardScreen;\r\n","import React from 'react';\r\nimport { Page } from 'components';\r\nimport 'styles/static_pages.scss';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst FaqScreen = () => (\r\n\t<Page\r\n\t\tbackground=\"white\"\r\n\t\tpadding={0}\r\n\t\theader={{\r\n\t\t\ttitle: \"FAQ's\",\r\n\t\t}}\r\n\t>\r\n\t\t<div className={classNames('text-gray-700 static_page')}>\r\n\t\t\t<h4>Simple setup instructions</h4>\r\n\r\n\t\t\t<h6>Setup cart:</h6>\r\n\t\t\t<p>Visit Settings Page And Setup/Design Your Stores Default Cart.</p>\r\n\t\t\t<h6>Activate cart:</h6>\r\n\t\t\t<p>Click Activate at the top of the settings page.</p>\r\n\t\t\t<p>\r\n\t\t\t\t(Note: This will activate the your cart immediately on your storefront and display any upsell campaigns\r\n\t\t\t\tyou currently have active.)\r\n\t\t\t</p>\r\n\t\t\t<h6>Create Upsell Campaigns:</h6>\r\n\t\t\t<p>Visit Campaign Page To Create Your 1St Upsell Campaign.</p>\r\n\r\n\t\t\t<h4>How to turn monster upsell cart off/on?</h4>\r\n\t\t\t<p>At the top of the settings page.</p>\r\n\t\t\t<h4>What happens if Monster Upsells Cart doesn’t load?</h4>\r\n\t\t\t<p>\r\n\t\t\t\tAt the top of the settings Your normal cart will be activated and customers will still be able to\r\n\t\t\t\tcheckout seamlessly.\r\n\t\t\t</p>\r\n\t\t\t<h4>Can i run multiple campaigns on the same cart?</h4>\r\n\t\t\t<p>Multiple campaigns can run on the cart at the same time but only 1 campaign (type) at a time.</p>\r\n\t\t\t<p>For example: If 2 Add To Unlock campaigns are running only 1 will show.</p>\r\n\t\t\t<h4>If 2 or more campaign types target the same product which campaign shows?</h4>\r\n\t\t\t<p>\r\n\t\t\t\tAlready activated campaigns on storefront will override new types to give the customer best user\r\n\t\t\t\texperience.\r\n\t\t\t</p>\r\n\t\t\t<h6>\r\n\t\t\t\tIf no existing campaign type was previously activated the following hierarchy will take place based on\r\n\t\t\t\tcampaign product targeting:\r\n\t\t\t</h6>\r\n\t\t\t<p>Order of least favored to most favored product targeting options. </p>\r\n\t\t\t<ul className={classNames('list-decimal list-inside')} style={{ marginBottom: 13 }}>\r\n\t\t\t\t<li style={{ fontSize: 13 }}>All products</li>\r\n\t\t\t\t<li style={{ fontSize: 13 }}>Collection</li>\r\n\t\t\t\t<li style={{ fontSize: 13 }}>Single product (most favored targeting)</li>\r\n\t\t\t</ul>\r\n\t\t\t<h6>Campaign Types using the same product targeting options:</h6>\r\n\t\t\t<p>The newest made campaign wins.</p>\r\n\t\t\t<h4>How do I cancel my subscription?</h4>\r\n\t\t\t<p>Uninstall the app, it's better to disable the custom cart before uninstalling.</p>\r\n\t\t\t<h4>Do you make changes to my store code?</h4>\r\n\t\t\t<p>Yes. We automatically add 2 snippets and 2 files to your theme.</p>\r\n\t\t\t<p>It’s really easy to remove all Monster Upsell code from your theme</p>\r\n\t\t\t<ul>\r\n\t\t\t\t<li>\r\n\t\t\t\t\t<p>Delete these 2 files from your theme code</p>\r\n\t\t\t\t\t<img src=\"https://s3-us-west-2.amazonaws.com/apps.static.resources/snippetsNames.png\" />\r\n\t\t\t\t</li>\r\n\t\t\t\t<li>\r\n\t\t\t\t\t<p>and these 2 snippets from your theme.liquid</p>\r\n\t\t\t\t\t<img src=\"https://s3-us-west-2.amazonaws.com/apps.static.resources/snippetsCalls.png\" />\r\n\t\t\t\t</li>\r\n\t\t\t</ul>\r\n\t\t\t<h4>\r\n\t\t\t\tWhy are my heat-map/screen recording tools (example: hotjar, crazy egg) not showing the correct shopping\r\n\t\t\t\tcart?\r\n\t\t\t</h4>\r\n\t\t\t<p>\r\n\t\t\t\tWe are trying to find a workaround for this, however for now these tools may not import the correct css.\r\n\t\t\t\tRest assured your cart is displayed perfectly for your customers.\r\n\t\t\t</p>\r\n\t\t\t<h4>Does it work with dynamic checkout buttons?</h4>\r\n\t\t\t<p>\r\n\t\t\t\tNo, it doesn't. You will need to deactivate those buttons if you want checkout to go through monster\r\n\t\t\t\tcart.\r\n\t\t\t</p>\r\n\t\t\t<h4>When will there be more updates?</h4>\r\n\t\t\t<p>\r\n\t\t\t\tOur goal is to be the only upsell app you will ever need. We have already started working on new updates\r\n\t\t\t\tyou are going to love and are planning to send updates live monthly! (Feel free to email us feature\r\n\t\t\t\tsuggestions.)\r\n\t\t\t</p>\r\n\t\t\t<p>\r\n\t\t\t\tIf you have any further questions feel free to contact our team at{' '}\r\n\t\t\t\t<a\r\n\t\t\t\t\thref=\"mailto:support@monsterapps.shop\"\r\n\t\t\t\t\ttarget=\"_blank\"\r\n\t\t\t\t\tclassName={classNames('text-blue-500 font-bold')}\r\n\t\t\t\t>\r\n\t\t\t\t\tsupport@monsterapps.shop\r\n\t\t\t\t</a>\r\n\t\t\t</p>\r\n\t\t</div>\r\n\t</Page>\r\n);\r\n\r\nexport default FaqScreen;\r\n","import React from 'react';\r\nimport { Page } from 'components';\r\nimport 'styles/static_pages.scss';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst PrivacyPolicy = () => (\r\n\t<Page\r\n\t\tbackground=\"none\"\r\n\t\tpadding={0}\r\n\t\theader={{\r\n\t\t\ttitle: 'Privacy Policy',\r\n\t\t}}\r\n\t>\r\n\t\t<div className={classNames('text-gray-700 static_page')}>\r\n\t\t\t<h4>Privacy Policy</h4>\r\n\t\t\t<p>\r\n\t\t\t\t(Basically we are serious about your privacy!)\r\n\t\t\t\t<br /> <br /> MonsterApps provides applications (\"the Service\") to merchants who use Shopify to build\r\n\t\t\t\tand maintain their online store. This Privacy Policy provide detailed information on how data is\r\n\t\t\t\tcollected, used, and shared when you install or use our apps with your Shopify store.\r\n\t\t\t</p>\r\n\r\n\t\t\t<h4>Personal Data We Process</h4>\r\n\t\t\t<p>\r\n\t\t\t\tWhen you install our apps, we are automatically able to access certain types of information from your\r\n\t\t\t\tShopify account. See more detailed information in Shopify's help docs.\r\n\t\t\t</p>\r\n\t\t\t<p>\r\n\t\t\t\tIn addition, we store the following personal information: Emails, names and location of our customers\r\n\t\t\t\tthat are necessary for localized email notifications, reports, support, product updates and reminders.\r\n\t\t\t</p>\r\n\r\n\t\t\t<h4>How We Use Personal Data</h4>\r\n\t\t\t<p>\r\n\t\t\t\tWe use the personal information we collect from you in order to provide the Service and to operate our\r\n\t\t\t\tapps. Additionally, we use the personal information to: communicate with you, optimize or improve the\r\n\t\t\t\tService, provide you with information about our products, and handling software bugs or support\r\n\t\t\t\trequests.\r\n\t\t\t</p>\r\n\t\t\t<p>\r\n\t\t\t\tWe also use your Personal Information to provide you with targeted advertisements or marketing\r\n\t\t\t\tcommunications we believe may be of interest to you. For more information about how targeted advertising\r\n\t\t\t\tworks, you can visit the Network Advertising Initiative’s (“NAI”) educational page at\r\n\t\t\t\thttp://www.networkadvertising.org/understanding-online-advertising/how-does-it-work.\r\n\t\t\t</p>\r\n\t\t\t<p>\r\n\t\t\t\tYou can opt out of some of these services by visiting the Digital Advertising Alliance’s opt-out\r\n\t\t\t\tportal at: http://optout.aboutads.info/.\r\n\t\t\t</p>\r\n\r\n\t\t\t<h4>Sharing Your Information</h4>\r\n\t\t\t<p>\r\n\t\t\t\tWe do not share your Personal Information with any third parties. We may share your Personal Information\r\n\t\t\t\tto comply with applicable laws and regulations, to respond to a subpoena, search warrant or other lawful\r\n\t\t\t\trequest for information we receive, or to otherwise protect our rights.\r\n\t\t\t</p>\r\n\r\n\t\t\t<h4>Your Rights</h4>\r\n\t\t\t<p>\r\n\t\t\t\tIf you are in the EU, you have the right to access, update or delete your Information and obtain a copy\r\n\t\t\t\tof your information we store on our systems and have us update, correct or delete it. You are also\r\n\t\t\t\tentitled to obtain your Information (excluding data obtained from other sources) in a structured,\r\n\t\t\t\tcommonly used and machine-readable format, and have the right to transmit those data to another data\r\n\t\t\t\tcontroller. If you wish to exercise any of these rights, contact us directly at\r\n\t\t\t\tsupport@monsterapps.shop. You have a right to submit a complaint to the relevant supervisory data\r\n\t\t\t\tprotection authority.\r\n\t\t\t</p>\r\n\t\t\t<p>\r\n\t\t\t\tIf you are in the EU, you can lodge a complaint to the supervisory authority under the General data\r\n\t\t\t\tProtection Regulations (\"GDPR\"), in particular in the Member State of your residence, place of work or\r\n\t\t\t\twhere the alleged infringement of the GDPR occurred.\r\n\t\t\t</p>\r\n\r\n\t\t\t<h4>Age Of Consent</h4>\r\n\t\t\t<p>\r\n\t\t\t\tBy using our apps, you indicate that you are at least 13 years of age or at least the age of majority in\r\n\t\t\t\tyour state or province of residence to use the App.\r\n\t\t\t</p>\r\n\r\n\t\t\t<h4>Changes To The Privacy Policy</h4>\r\n\t\t\t<p>\r\n\t\t\t\tWe may update this privacy policy at any time in order to reflect, for example, changes to our practices\r\n\t\t\t\tor for other operational, legal or regulatory reasons. If we make changes to this policy, we will notify\r\n\t\t\t\tyou by email of updates, so that you are aware of information we collect, how we use it, and under what\r\n\t\t\t\tcircumstances, if any.\r\n\t\t\t</p>\r\n\r\n\t\t\t<h4>Contact Information</h4>\r\n\t\t\t<p>\r\n\t\t\t\tIf you would like to access, correct, amend or delete any personal information, or require any\r\n\t\t\t\tadditional information about our privacy policy please contact us at{' '}\r\n\t\t\t\t<a\r\n\t\t\t\t\thref=\"mailto:support@monsterapps.shop\"\r\n\t\t\t\t\ttarget=\"_blank\"\r\n\t\t\t\t\tclassName={classNames('text-blue-500 font-bold')}\r\n\t\t\t\t>\r\n\t\t\t\t\tsupport@monsterapps.shop\r\n\t\t\t\t</a>\r\n\t\t\t</p>\r\n\t\t</div>\r\n\t</Page>\r\n);\r\n\r\nexport default PrivacyPolicy;\r\n","import React, { useState, useContext, useEffect, useRef } from \"react\";\r\nimport {\r\n Page,\r\n Icon,\r\n Spinner,\r\n ButtonSelect,\r\n FormGroup,\r\n FormControl,\r\n Input,\r\n Dropdown,\r\n Button,\r\n Alert\r\n} from \"components\";\r\nimport classNames from \"lib/classNames\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport UserContext from \"context/UserContext\";\r\nimport { Scrollbars } from \"react-custom-scrollbars\";\r\nimport { API_GATEWAY_NEW } from \"aws-exports\";\r\nimport styles from \"styles/page.module.scss\";\r\nimport { API } from \"aws-amplify\";\r\nimport { useTransition } from \"react-spring\";\r\nimport removeTypeName from \"lib/removeTypeName\";\r\nimport useRefState from \"hooks/useRefState\";\r\nimport useReactRouter from 'use-react-router';\r\n\r\nconst defaultCartLinks = [{ selector: 'a[href=\"/cart\"]', action: \"TOGGLE\" }];\r\nconst actions = [\r\n { value: \"TOGGLE\", label: \"Toggle Cart\" },\r\n { value: \"OPEN\", label: \"Open Cart\" },\r\n { value: \"CLOSE\", label: \"Close Cart\" }\r\n];\r\n\r\nconst ManualSetup = () => {\r\n const [activePreviewDevice, setActivePreviewDevice] = useState(\"desktop\");\r\n const is = value => activePreviewDevice === value\r\n const [currentAction, setCurrentAction] = useState();\r\n const [unsaved, setUnsaved] = useState(false);\r\n const shopContext = useContext(ShopContext);\r\n const user = useContext(UserContext);\r\n const { state } = shopContext;\r\n const [iframeSrc, setIframeSrc] = useState(\r\n `${API_GATEWAY_NEW}/storeFront?shop=${user.attributes.website}&manual_setup=true&origin=${window.location.origin}`\r\n );\r\n const { history, location } = useReactRouter();\r\n const iframe = useRef(null);\r\n const selectorOverlay = useRef(null);\r\n const [shopCustomLinks, setShopCustomLinks] = useState(\r\n removeTypeName(state.custom_links || [])\r\n );\r\n const [shopCustomATCs, setShopCustomATCs] = useState(\r\n removeTypeName(state.custom_atcs || [])\r\n );\r\n const [customCartLinks, setCustomCartLinks, cclRef] =\r\n useRefState(shopCustomLinks);\r\n const [customATCs, setCustomATCs, catcRef] =\r\n useRefState(shopCustomATCs);\r\n const [loading, setLoading] = useState(true);\r\n const [saveLoading, setSaveLoading] = useState(false);\r\n\r\n const discard = () => {\r\n setCustomCartLinks(shopCustomLinks);\r\n sendMessage({\r\n action: \"RESET_LINKS\",\r\n selectors: shopCustomLinks.map(({ selector }) => selector)\r\n });\r\n };\r\n\r\n const save = async () => {\r\n setSaveLoading(true);\r\n await API.post(\"API_GATEWAY_NEW\", \"/cart/links\", {\r\n body: {\r\n custom_links: cclRef.current,\r\n custom_atcs: catcRef.current,\r\n }\r\n });\r\n setShopCustomLinks(cclRef.current);\r\n setShopCustomATCs(catcRef.current);\r\n setSaveLoading(false);\r\n };\r\n\r\n const sendMessage = (data) => {\r\n if (iframe.current)\r\n iframe.current.contentWindow.postMessage(data, API_GATEWAY_NEW);\r\n };\r\n\r\n const handleMessage = (event) => {\r\n const { action, value } = event.data;\r\n console.log(event.data);\r\n switch (action) {\r\n case \"SELECT_CART_LINK\":\r\n if (!cclRef.current.find(v => v.selector === value)) {\r\n setCustomCartLinks(\r\n [...cclRef.current].concat([{\r\n selector: value,\r\n action: \"TOGGLE\"\r\n }])\r\n )\r\n }\r\n else {\r\n setCustomCartLinks(\r\n [...cclRef.current].filter(v => v.selector !== value)\r\n )\r\n }\r\n break;\r\n case \"SELECT_ATC\":\r\n console.log(value);\r\n if (!catcRef.current.find(v => v.button === value.button)) {\r\n setCustomATCs(\r\n [...catcRef.current].concat([value])\r\n )\r\n }\r\n else {\r\n setCustomATCs(\r\n [...catcRef.current].filter(v => v.button !== value.button)\r\n )\r\n }\r\n break;\r\n }\r\n };\r\n\r\n const [elementPickerEnabled, setElementPickerEnabled] = useState(false);\r\n\r\n useEffect(() => {\r\n window.addEventListener(\"message\", handleMessage);\r\n return () => {\r\n window.removeEventListener(\"message\", handleMessage);\r\n };\r\n }, []);\r\n useEffect(() => {\r\n if (currentAction) {\r\n sendMessage({\r\n action: \"VALUE_CHANGED\",\r\n value: {\r\n currentAction,\r\n customCartLinks\r\n }\r\n })\r\n }\r\n }, [currentAction, customCartLinks])\r\n\r\n useEffect(() => {\r\n console.log(\"unsaved\", JSON.stringify({ l: shopCustomLinks, b: shopCustomATCs }) !== JSON.stringify({ l: customCartLinks, b: customATCs }));\r\n setUnsaved(JSON.stringify({ l: shopCustomLinks, b: shopCustomATCs }) !== JSON.stringify({ l: customCartLinks, b: customATCs }))\r\n }, [shopCustomATCs, shopCustomLinks, customATCs, customCartLinks])\r\n\r\n return (\r\n <Page\r\n background=\"white\"\r\n padding=\"p-0\"\r\n header={{ title: \"Manual Setup\" }}\r\n >\r\n <div className={classNames(\"fixed z-20 bg-white inset-0 flex flex-col\")}>\r\n <nav className={classNames(\"flex py-2 px-4 items-center justify-between bg-gray-800 text-white font-bold text-lg\")}>\r\n\r\n <div className={classNames(\"flex-1\")}>\r\n <div className={classNames(\"flex w-48 border border-gray-700 rounded overflow-hidden\")}>\r\n <div className={classNames(\"py-1 flex-1 text-sm text-center rounded-l\", {\r\n \"bg-gray-700 pointer-events-none\": is(\"desktop\"),\r\n \"cursor-pointer hover:bg-gray-900\": is(\"mobile\"),\r\n })} disabled={is(\"desktop\")} onClick={() => setActivePreviewDevice(\"desktop\")}>Desktop</div>\r\n <div className={classNames(\" py-1 flex-1 text-sm text-center rounded-r\", {\r\n \"bg-gray-700 pointer-events-none\": is(\"mobile\"),\r\n \"cursor-pointer hover:bg-gray-900\": is(\"desktop\")\r\n })} disabled={is(\"mobile\")} onClick={() => setActivePreviewDevice(\"mobile\")}>Mobile</div>\r\n </div>\r\n </div>\r\n <div className={classNames(\"flex-1 flex-center\")}>\r\n <button className={classNames(\"py-1 px-2 text-sm text-center rounded cursor-pointer border border-gray-700 hover:bg-gray-900\", {\r\n hidden: !currentAction\r\n })} onClick={() => {\r\n const newState = currentAction === \"done\" ? undefined : \"done\"\r\n setCurrentAction(newState)\r\n }}>{\r\n currentAction === \"done\" ? \"Select an action \" : !currentAction ? \"Change Action\" : \"Done editing\"}</button>\r\n </div>\r\n <div className={classNames(\"w-48 flex items-center flex-1 justify-end\")}>\r\n <p className={classNames(\"text-sm text-white mr-3\", {\r\n hidden: !unsaved\r\n })}>Unsaved changes</p>\r\n <button className={classNames(\"py-1 px-4 text-sm bg-red-500 hover:bg-red-600 rounded\")} onClick={() => history.push(\"/settings\")}>Close</button>\r\n <button\r\n disabled={!unsaved}\r\n className={classNames(\"py-1 px-4 text-sm disabled:bg-gray-500 bg-blue-500 hover:bg-blue-600 rounded ml-2\")} onClick={() => {\r\n setCurrentAction(\"done\")\r\n save()\r\n }}>Save</button>\r\n </div>\r\n </nav>\r\n <div className={classNames(\"flex-1 h-full relative\")} >\r\n <div className={classNames(\"absolute inset-0 z-20 bg-black bg-opacity-75 backdrop-blur-sm flex-center\", {\r\n \"hidden\": currentAction || loading\r\n })}>\r\n <div className={classNames(\"bg-white rounded px-5 py-10 min-w-md\")}>\r\n <FormControl label=\"Manually setup cart trigger buttons\" info=\"Not every theme is created equal.<br/>You may need to manually select your cart drawer triggers.<br/>If you have any trouble with this please reach out to the team.\">\r\n <ButtonSelect\r\n options={[\r\n { value: \"atc_button\", icon: \"cart-plus\", info: \"Specify your products add to cart buttons\", label: \"Add to cart button\" },\r\n {\r\n value: \"cart_link\", icon: \"shopping-cart\", info: \"Specify elements that will open the cart drawer\", label: \"Open cart links\"\r\n },\r\n ]}\r\n value={currentAction}\r\n onChange={(value) => setCurrentAction(value)}\r\n className={classNames(\"mt-4\")}\r\n />\r\n </FormControl>\r\n </div>\r\n </div>\r\n <div className={classNames(\"w-full h-full relative\")}>\r\n {loading && <Spinner text=\"loading storefront\" />}\r\n <iframe\r\n ref={iframe}\r\n onLoad={() => {\r\n sendMessage({\r\n action: \"VALUE_CHANGED\",\r\n value: {\r\n currentAction,\r\n customCartLinks\r\n }\r\n })\r\n setLoading(false);\r\n }}\r\n src={iframeSrc}\r\n className={classNames(\"h-full mx-auto\", loading && \"hidden\")}\r\n style={{\r\n width: activePreviewDevice === \"desktop\" ? \"100%\" : 350\r\n }}\r\n onMouseLeave={() => {\r\n if (elementPickerEnabled && selectorOverlay.current)\r\n selectorOverlay.current.style.display = \"flex\";\r\n }}\r\n />\r\n {elementPickerEnabled && (\r\n <div\r\n ref={selectorOverlay}\r\n className={classNames(\r\n \"absolute inset-0 z-20 top-0 w-full h-full text-white text-2xl flex-center\"\r\n )}\r\n style={{ background: \"rgba(0,0,0,0.6)\" }}\r\n onMouseEnter={({ target }) => (target.style.display = \"none\")}\r\n >\r\n Click on the element to select it.\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n </div>\r\n </Page>\r\n );\r\n};\r\n\r\nexport default ManualSetup;\r\n\r\n//'ritzystore2.myshopify.com' ||\r\n\r\nconst CartLink = ({ link, updateLink, removeLink }) => {\r\n const isDefault = defaultCartLinks.includes(link);\r\n return (\r\n <div className={classNames(\"p-3 rounded bg-white mb-2 shadow-sm\")}>\r\n <FormControl\r\n label={`${isDefault ? \"default\" : \"additional\"} trigger`}\r\n marginBottom=\"mb-3\"\r\n >\r\n <Input\r\n type=\"text\"\r\n value={link.selector}\r\n onChange={(v) => console.log(v)}\r\n disabled={isDefault}\r\n />\r\n </FormControl>\r\n {/* <FormControl label=\"action\" marginBottom=\"mb-3\">\r\n\t\t\t\t<Dropdown options={actions} value={link.action} disabled={true} onChange={(v) => console.log(v)} />\r\n\t\t\t</FormControl> */}\r\n {!isDefault && (\r\n <div className={classNames(\"flex flex-row-reverse\")}>\r\n <button\r\n className={classNames(\r\n \"cursor-pointer focus:outline-none text-center text-red-500 text-sm\"\r\n )}\r\n onClick={() => removeLink(link.selector)}\r\n >\r\n Remove\r\n </button>\r\n </div>\r\n )}\r\n </div>\r\n );\r\n};\r\n","const oldPlans = [\r\n\t{\r\n\t\tdescription: 'Mini Cart',\r\n\t\ttransactions: 50,\r\n\t\tprice: 0,\r\n\t\treal_price: 7.99,\r\n\t\tcolor: 'teal-500',\r\n\t\tinfo: 'up to <b>50</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Big Cart',\r\n\t\ttransactions: 200,\r\n\t\tprice: 7,\r\n\t\treal_price: 14.99,\r\n\t\tcolor: 'blue-500',\r\n\t\tinfo: 'up to <b>200</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Beast Cart',\r\n\t\ttransactions: 500,\r\n\t\tprice: 15,\r\n\t\treal_price: 29.99,\r\n\t\tcolor: 'indigo-500',\r\n\t\tinfo: 'up to <b>500</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Ultimate Cart',\r\n\t\ttransactions: Infinity,\r\n\t\tprice: 20,\r\n\t\treal_price: 49.99,\r\n\t\tcolor: 'purple-500',\r\n\t\tinfo: '<b>unlimited</b> transactions',\r\n\t},\r\n];\r\n\r\nconst newPlans = [\r\n\t{\r\n\t\tdescription: 'Mini Cart',\r\n\t\ttransactions: 50,\r\n\t\tprice: 0,\r\n\t\treal_price: 7.99,\r\n\t\tcolor: 'teal-500',\r\n\t\tinfo: 'up to <b>50</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Big Cart',\r\n\t\ttransactions: 200,\r\n\t\tprice: 7,\r\n\t\treal_price: 14.99,\r\n\t\tcolor: 'blue-500',\r\n\t\tinfo: 'up to <b>200</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Beast Cart',\r\n\t\ttransactions: 500,\r\n\t\tprice: 15,\r\n\t\treal_price: 29.99,\r\n\t\tcolor: 'indigo-500',\r\n\t\tinfo: 'up to <b>500</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Ultimate Cart',\r\n\t\ttransactions: 1000,\r\n\t\tprice: 20,\r\n\t\treal_price: 49.99,\r\n\t\tcolor: 'purple-500',\r\n\t\tinfo: '<b>1000</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Epic Cart',\r\n\t\ttransactions: 2000,\r\n\t\tprice: 35,\r\n\t\treal_price: 84.99,\r\n\t\tcolor: 'purple-500',\r\n\t\tinfo: '<b>2000</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Advanced Cart',\r\n\t\ttransactions: 3000,\r\n\t\tprice: 15,\r\n\t\treal_price: 99.99,\r\n\t\tcolor: 'purple-500',\r\n\t\tinfo: '<b>3000</b> transactions',\r\n\t},\r\n\t{\r\n\t\tdescription: 'Monster Cart',\r\n\t\ttransactions: Infinity,\r\n\t\tprice: 30,\r\n\t\treal_price: 129.99,\r\n\t\tcolor: 'purple-500',\r\n\t\tinfo: '<b>unlimited</b> transactions',\r\n\t},\r\n];\r\n\r\nconst newPlansStartsAt = new Date('Thu Mar 04 2021 13:27:29 GMT+0100 (Central European Standard Time)').getTime();\r\nconst thirdPlansStartsAt = new Date(\"Tue Mar 01 2022 13:49:50 GMT+0100 (Central European Standard Time)\").getTime();\r\n\r\n\r\nfunction getNewPlans (installationTime) {\r\n\tconst hasSecondPricing = installationTime <= thirdPlansStartsAt;\r\n\treturn newPlans.map((plan, index) => {\r\n\t\tconst currentPlan = { ...plan }\r\n\t\tconst isLast = index === (newPlans.length - 1)\r\n\t\tcurrentPlan.real_price += hasSecondPricing ? isLast ? 0 : 3 : 5\r\n\t\tcurrentPlan.real_price = Number(currentPlan.real_price.toFixed(2))\r\n\t\tif (!hasSecondPricing) return currentPlan\r\n\t\tif (index === 0) {\r\n\t\t\tcurrentPlan.price = 3 // increase the first plan\r\n\t\t}\r\n\t\tif (isLast) {\r\n\t\t\tcurrentPlan.price -= 3 // decrease the last one\r\n\t\t}\r\n\t\treturn currentPlan\r\n\t})\r\n}\r\n\r\nexport default function getPlans (installationTime) {\r\n\tconst hasFirstPricing = installationTime <= newPlansStartsAt;\r\n\treturn hasFirstPricing ? oldPlans : getNewPlans(installationTime);\r\n}\r\n\r\nexport function getBasePrice (installationTime) {\r\n\tconst hasFirstPricing = installationTime <= newPlansStartsAt;\r\n\tconst hasSecondPricing = installationTime <= thirdPlansStartsAt;\r\n\treturn hasFirstPricing ? 7.99 : hasSecondPricing ? 10.99 : 12.99\r\n}\r\nexport function getPlansModal (installationTime) {\r\n\treturn installationTime <= newPlansStartsAt ? 'chargeApprovalModal.html' : 'chargeApprovalModal2.html';\r\n}\r\n","import React, { useState, useContext, useEffect, useRef } from \"react\";\r\nimport { Page, Spinner, Icon } from \"components\";\r\nimport classNames from \"lib/classNames\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport UserContext from \"context/UserContext\";\r\nimport { API_GATEWAY_NEW, APP_DEV } from \"aws-exports\";\r\nimport { API } from \"aws-amplify\";\r\nimport moment from \"moment\";\r\nimport { SAVE_PLAN_SETTINGS } from \"lib/mutations\";\r\nimport { useMutation } from \"@apollo/react-hooks\";\r\nimport { GET_SHOP_SETTINGS } from \"Queries\";\r\nimport { Loading, Toast } from \"@shopify/app-bridge-react\";\r\nimport useRefState from \"hooks/useRefState\";\r\nimport getPlans, { getBasePrice } from \"lib/getPlans\";\r\n\r\n// ⛔⛔ do not remove\r\n// this classes for the css purge\r\n// border-teal-500\r\n// border-blue-500\r\n// border-indigo-500\r\n// border-purple-500\r\n// bg-teal-500\r\n// bg-blue-500\r\n// bg-indigo-500\r\n// bg-purple-500\r\n// text-teal-500\r\n// text-blue-500\r\n// text-indigo-500\r\n// text-purple-500\r\n\r\nconst PlanScreen = () => {\r\n const [loading, setLoading] = useState(true);\r\n const [plan, setPlan] = useState(null);\r\n const [currentPlan, setCurrentPlan] = useState(null);\r\n const user = useContext(UserContext);\r\n const { state: shop } = useContext(ShopContext);\r\n const plans = getPlans(new Date(shop.installedAt).getTime());\r\n const hasDiscount =\r\n shop?.invitation &&\r\n shop?.invitation?.type === \"discount_percentage\" &&\r\n shop?.invitation?.value;\r\n const discount = hasDiscount ? shop.invitation.value / 100 : 0;\r\n const applyDiscount = (value) =>\r\n Number((value - value * discount).toFixed(2));\r\n const getPlan = async () => {\r\n const planResponse = await API.get(\"API_GATEWAY_NEW\", \"/shop/get_plan\");\r\n const balance_used = Number(planResponse.balance_used);\r\n setCurrentPlan(\r\n balance_used === 0\r\n ? 0\r\n : plans.findIndex(\r\n ({ real_price }) =>\r\n applyDiscount(real_price).toString() ===\r\n (balance_used + applyDiscount(getBasePrice())).toFixed(2)\r\n )\r\n );\r\n setPlan({\r\n ...planResponse,\r\n balance_used: Number(planResponse.balance_used),\r\n });\r\n setLoading(false);\r\n };\r\n\r\n useEffect(() => {\r\n getPlan();\r\n }, []);\r\n\r\n return (\r\n <Page background=\"white\" header={{ title: \"Your Plan\" }}>\r\n {loading && (\r\n <>\r\n <Spinner />\r\n <Loading />\r\n </>\r\n )}\r\n {!loading && plan && (\r\n <>\r\n <div className={classNames(\"mb-4 rounded bg-white mx-auto w-1/2\")}>\r\n <div\r\n className={classNames(\r\n \"flex items-start border-b p-3 font-bold text-sm\"\r\n )}\r\n >\r\n <label className={classNames(\"flex-1 capitalize text-gray-600\")}>\r\n Current Plan\r\n </label>\r\n <div className={classNames(\"w-40 text-gray-700\")}>\r\n <p>{plans[currentPlan]?.description}</p>\r\n </div>\r\n </div>\r\n <div\r\n className={classNames(\r\n \"flex items-start border-b p-3 font-bold text-sm\"\r\n )}\r\n >\r\n <label className={classNames(\"flex-1 capitalize text-gray-600\")}>\r\n Amount To Be Charged\r\n </label>\r\n <div className={classNames(\"w-40 text-gray-700\")}>\r\n <p\r\n dangerouslySetInnerHTML={{\r\n __html: `$${(\r\n plan.balance_used + applyDiscount(getBasePrice())\r\n ).toFixed(2)}${\r\n // plan.balance_used > 0\r\n // \t? ` <span class='mu-text-xs mu-text-gray-500'>(${plans[currentPlan].description})</span>`\r\n // \t: ''\r\n \"\"\r\n }`,\r\n }}\r\n />\r\n </div>\r\n </div>\r\n <div\r\n className={classNames(\r\n \"flex items-center border-b p-3 font-bold text-sm\"\r\n )}\r\n >\r\n <label className={classNames(\"flex-1 capitalize text-gray-600\")}>\r\n Status\r\n </label>\r\n <div className={classNames(\"w-40 text-gray-700\")}>\r\n <p>{plan.status}</p>\r\n </div>\r\n </div>\r\n <div\r\n className={classNames(\r\n \"flex items-center border-b p-3 font-bold text-sm\"\r\n )}\r\n >\r\n <label className={classNames(\"flex-1 capitalize text-gray-600\")}>\r\n Billing Date\r\n </label>\r\n <div className={classNames(\"w-40 text-gray-700\")}>\r\n <p>\r\n {plan.billing_on\r\n ? moment(plan.billing_on).format(\"MMM Do YYYY\")\r\n : \"Not Set\"}\r\n </p>\r\n </div>\r\n </div>\r\n <div\r\n className={classNames(\r\n \"flex items-center p-3 font-bold text-sm\"\r\n )}\r\n >\r\n <label className={classNames(\"flex-1 capitalize text-gray-600\")}>\r\n Transactions This Month\r\n </label>\r\n <div className={classNames(\"w-40 text-gray-700\")}>\r\n <p>{shop.transactions}</p>\r\n </div>\r\n </div>\r\n </div>\r\n <div className={classNames(\"flex-center p-3 mx-auto w-1/2\")}>\r\n <a\r\n className={classNames(\r\n \"font-bold text-sm text-blue-500 hover:underline\"\r\n )}\r\n href=\"https://monsterapps.crisp.help/en/article/pricing-and-billing-charges-48yd1o/\"\r\n target=\"_blank\"\r\n >\r\n Visit our pricing page for more information\r\n </a>\r\n </div>\r\n </>\r\n )}\r\n </Page>\r\n );\r\n};\r\n\r\nexport default PlanScreen;\r\n","import React, { useContext, Fragment, useEffect, useRef, useState } from 'react';\r\nimport { STICKY_CART_OPTIONS } from 'lib/globals';\r\nimport { useMutation } from '@apollo/react-hooks';\r\nimport PageScrollContext from 'context/PageScrollContext';\r\nimport md5 from 'crypto-js/md5';\r\nimport {\r\n Page,\r\n Range,\r\n ColorPicker,\r\n FormGroup,\r\n Input,\r\n FormControl,\r\n Dropdown,\r\n Switch,\r\n CustomText,\r\n Icon,\r\n Button,\r\n Alert,\r\n VideoModal,\r\n RichEditor,\r\n ButtonSelect,\r\n MultiCurrencyModeAlerts\r\n} from 'components';\r\nimport PreviewContext from 'context/PreviewContext';\r\nimport ShopContext from 'context/ShopContext';\r\nimport UserContext from 'context/UserContext';\r\nimport { GOOGLE_FONTS, CAMPAIGN_TYPES, SHOP_DEFAULT_SETTINGS, BREAK_POINTS } from 'lib/globals';\r\nimport { SAVE_SHOP_SETTINGS, UPDATE_SHOP_PROP } from 'lib/mutations';\r\nimport ExtraModules from 'screens/campaigns/settings/ExtraModules/index';\r\nimport CheckoutButton from 'screens/campaigns/settings/ExtraModules/CheckoutButton';\r\nimport { Loading, Toast, Modal } from '@shopify/app-bridge-react';\r\nimport { ShopConstraints } from 'Constraints';\r\nimport removeTypeName, { removeByType } from 'lib/removeTypeName';\r\nimport { Run } from 'lib/validate';\r\nimport { GET_SHOP_SETTINGS } from 'Queries';\r\nimport { PageHeader } from 'components/Page';\r\nimport { API, graphqlOperation } from 'aws-amplify';\r\nimport { APP_DEV } from 'aws-exports';\r\nimport Axios from 'axios';\r\nimport { Manager, Reference, Popper } from 'react-popper';\r\nimport Checkbox from 'react-simple-checkbox';\r\nimport styles from 'styles/cart_screen.module.scss';\r\nimport { useTransition } from 'react-spring';\r\nimport _ from 'lodash';\r\nimport classNames from 'lib/classNames';\r\nimport useReactRouter from 'use-react-router';\r\nimport { SET_ALL } from 'reducers/SetItemReducer';\r\nimport useRefState from 'hooks/useRefState';\r\n\r\nconst StickyCartSettings = (props) => {\r\n const { setIsStickyActVariantFocused } = useContext(PreviewContext);\r\n const stickyAlert = useRef(null);\r\n const { history, location } = useReactRouter();\r\n const [scrollTop, setScrollTop, scrollTopRef] = useRefState();\r\n const [cartActivateLoading, setCartActivateLoading] = useState(false);\r\n const [videoOne, setVideoOne] = useState(false);\r\n const [googleFonts, setGoogleFonts] = useState([]);\r\n const [hideTopBar, setHideTopBar] = useState(false);\r\n const [showConfirmActivate, setShowConfirmActivate] = useState(false);\r\n const [campaign_preview_visible, setCampaign_preview_visible] = useState(false);\r\n const campaign_preview_content_ref = useRef(null);\r\n const shopContext = useContext(ShopContext);\r\n const user = useContext(UserContext);\r\n const { state, discard, validationErrors, setValidationErrors, dispatch, setItem } =\r\n shopContext;\r\n\r\n const { sticky_cart } = state;\r\n\r\n const filterSettings = (settings) => {\r\n return removeByType(\r\n removeTypeName(\r\n Object.fromEntries(\r\n Object.entries(settings).filter(([key]) => !['settingsSaved'].includes(key))\r\n )\r\n ),\r\n (v) => v !== '' && v !== null\r\n );\r\n };\r\n\r\n let [saveShopSettings, { data, error, loading }] = useMutation(SAVE_SHOP_SETTINGS, {\r\n refetchQueries: [\r\n {\r\n query: GET_SHOP_SETTINGS,\r\n variables: {\r\n userId: user.attributes.website\r\n }\r\n }\r\n ]\r\n });\r\n const transitions = useTransition(\r\n !_.isEqual(state.original_settings, state.settings) && !hideTopBar,\r\n null,\r\n {\r\n from: { position: 'absolute', opacity: 0 },\r\n enter: { opacity: 1 },\r\n leave: { opacity: 0 },\r\n config: {\r\n duration: 300\r\n }\r\n }\r\n );\r\n const validate = (state, specific = []) =>\r\n Run(state, specific, {\r\n errors: validationErrors,\r\n setErrors: setValidationErrors,\r\n constraints: ShopConstraints\r\n });\r\n const save = (assign = {}, checkRTL = true) => {\r\n // console.log(\"state\")\r\n // console.log(state.settings)\r\n // return\r\n if (validate(state)) return;\r\n if (\r\n checkRTL &&\r\n Object.keys(state.original_settings || {}).length &&\r\n state.settings.rtl !== state.original_settings.rtl\r\n ) {\r\n console.log(\r\n 'updating theme',\r\n state.settings.rtl,\r\n state.original_settings.rtl,\r\n state.settings.active\r\n );\r\n return activateCart(state.settings.active, true, state.settings.rtl);\r\n }\r\n saveShopSettings({\r\n variables: {\r\n id: user.attributes.website,\r\n input: filterSettings(Object.assign(state.settings, assign))\r\n }\r\n });\r\n };\r\n\r\n const activateCart = async (active, confirmed = false, rtl = null) => {\r\n if (\r\n active &&\r\n !confirmed &&\r\n !state.settingsSaved &&\r\n _.isEqual(SHOP_DEFAULT_SETTINGS, state.settings)\r\n ) {\r\n return setShowConfirmActivate(true);\r\n }\r\n // setCartActivateLoading(true);\r\n // const { success } = await API.post(\"API_GATEWAY_NEW\", \"/cart/activate\", {\r\n // body: { active, rtl: rtl === null ? state.settings.rtl : rtl }\r\n // });\r\n // setCartActivateLoading(false);\r\n return save({ active }, false);\r\n };\r\n\r\n const handleOutSideClick = (event) => {\r\n if (!campaign_preview_content_ref.current) return;\r\n else if (campaign_preview_content_ref.current.contains(event.target)) return;\r\n setCampaign_preview_visible(false);\r\n };\r\n\r\n useEffect(() => {\r\n if (campaign_preview_visible)\r\n document.addEventListener('mousedown', handleOutSideClick, false);\r\n else document.removeEventListener('mousedown', handleOutSideClick, false);\r\n return () => {\r\n document.removeEventListener('mousedown', handleOutSideClick, false);\r\n };\r\n }, [campaign_preview_visible]);\r\n\r\n useEffect(() => {\r\n async function getGoogleFonts() {\r\n const { data } = await Axios.get(\r\n `https://www.googleapis.com/webfonts/v1/webfonts?sort=popularity&key=AIzaSyCYLq50twmAe1_7jITZuehrERZWOjNqBCY`\r\n );\r\n setGoogleFonts(\r\n data.items.map(({ family, variants }) => ({\r\n label: family,\r\n value: `${family}:${variants.join()}`\r\n }))\r\n );\r\n }\r\n getGoogleFonts();\r\n }, []);\r\n\r\n useEffect(() => {\r\n setHideTopBar(!!data);\r\n if (APP_DEV) setTimeout(() => setHideTopBar(false), 1500);\r\n }, [data]);\r\n\r\n return (\r\n <Page\r\n background=\"none\"\r\n getScrollTop={({ scrollTop }) => {\r\n setScrollTop(scrollTop);\r\n }}\r\n padding={0}\r\n header={{\r\n title: 'Settings',\r\n actions: []\r\n }}\r\n TopContent={{\r\n transitions,\r\n render: () => (\r\n <Alert\r\n type=\"save_settings\"\r\n title=\"unsaved changes\"\r\n borderPosition=\"none\"\r\n paddingX=\"px-6\"\r\n actions={[\r\n {\r\n text: 'Discard',\r\n type: 'secondary',\r\n loading: false,\r\n onClick: () => discard()\r\n },\r\n {\r\n text: 'Save',\r\n type: 'primary',\r\n loading: loading || cartActivateLoading,\r\n onClick: () => save()\r\n }\r\n ]}\r\n />\r\n )\r\n }}\r\n >\r\n <Fragment>\r\n {data && (\r\n <Toast\r\n content=\"Cart settings has been saved\"\r\n duration={3000}\r\n onDismiss={() => {\r\n setHideTopBar(false);\r\n }}\r\n />\r\n )}\r\n {(loading || cartActivateLoading) && <Loading />}\r\n <Alert\r\n type={state.settings.sticky_cart.isActive ? 'success' : 'warning'}\r\n icon={\r\n state.settings.sticky_cart.isActive ? 'check-circle' : 'exclamation-circle'\r\n }\r\n title=\"Sticky Add To Cart\"\r\n withSwitch={{\r\n context: [shopContext, 'settings.sticky_cart.isActive']\r\n }}\r\n className=\"z-5\"\r\n >\r\n <p>\r\n {' '}\r\n Keep Your Add To Cart Button Always Visible To Increase The Chances Of It\r\n Being Pressed.\r\n </p>\r\n </Alert>\r\n\r\n <Modal\r\n title=\"Activating custom cart\"\r\n message=\"You're about to activate the cart with the default settings\"\r\n open={!!showConfirmActivate}\r\n primaryAction={{\r\n content: 'Activate',\r\n destructive: true,\r\n onAction: () => {\r\n setShowConfirmActivate(false);\r\n activateCart(true, true);\r\n }\r\n }}\r\n secondaryActions={[\r\n {\r\n content: 'Cancel',\r\n onAction: () => {\r\n setShowConfirmActivate(false);\r\n discard();\r\n }\r\n }\r\n ]}\r\n />\r\n <FormGroup\r\n label=\"Button Settings\"\r\n className=\"settings-row\"\r\n info=\"Setup the color and look of your sticky cart button\"\r\n >\r\n <FormControl label=\"Button Style\">\r\n <Dropdown\r\n options={STICKY_CART_OPTIONS.btnStyles}\r\n first\r\n BindToContext={[shopContext, 'settings.sticky_cart.btn_style']}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Button Text\">\r\n <Input BindToContext={[shopContext, 'settings.sticky_cart.btn_text']} />\r\n </FormControl>\r\n <FormControl label=\"Unavailable Text\">\r\n <Input\r\n // onFocus={() => setIsUnavailableFocused(true)}\r\n // onBlur={() => setIsUnavailableFocused(false)}\r\n BindToContext={[\r\n shopContext,\r\n 'settings.sticky_cart.btn_text_unavailable'\r\n ]}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Button Colors\">\r\n <div className=\"row three-columns\">\r\n <ColorPicker\r\n text=\"Button Color\"\r\n colorType=\"hex\"\r\n BindToContext={[shopContext, 'settings.sticky_cart.btn_color']}\r\n />\r\n <ColorPicker\r\n text=\"text Color\"\r\n colorType=\"hex\"\r\n BindToContext={[shopContext, 'settings.sticky_cart.txt_color']}\r\n />\r\n <ColorPicker\r\n text=\"background Color\"\r\n colorType=\"hex\"\r\n BindToContext={[\r\n shopContext,\r\n 'settings.sticky_cart.background_color'\r\n ]}\r\n />\r\n </div>\r\n </FormControl>\r\n </FormGroup>\r\n {/* //----------------------------------- */}\r\n\r\n <FormGroup label=\"Desktop Settings\" info=\"Set settings for desktop sticky cart\">\r\n <FormControl\r\n label=\"Activate Sticky Cart\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.desktop_active']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <FormControl\r\n label=\"Show Variants Selector\"\r\n info=\"When turned off variants are selected from product\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.desktop_show_variants']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <FormControl\r\n label=\"Show Quantity Selector\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.desktop_show_quantity']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <CustomText\r\n context={shopContext}\r\n label=\"Quantity text\"\r\n path=\"settings.sticky_cart.desktop_quantity\"\r\n hasNumber={false}\r\n // hasWeight=\"700\"\r\n />\r\n <FormControl\r\n label=\"Show Product name\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.desktop_show_product_name']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <FormControl\r\n label=\"Product Image Preview\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.desktop_product_preview']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <FormControl\r\n label=\"Show compared price\"\r\n withSwitch={[\r\n shopContext,\r\n 'settings.sticky_cart.desktop_show_compared_price'\r\n ]}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <FormControl label=\"Desktop Visibilty\">\r\n <Dropdown\r\n options={STICKY_CART_OPTIONS.visibilityOptions}\r\n first\r\n BindToContext={[shopContext, 'settings.sticky_cart.desktop_visibility']}\r\n />\r\n </FormControl>\r\n <FormControl label=\"Desktop Location\">\r\n <Dropdown\r\n options={STICKY_CART_OPTIONS.btnPosition}\r\n first\r\n BindToContext={[shopContext, 'settings.sticky_cart.desktop_location']}\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n\r\n {/* //----------------------------------- */}\r\n <FormGroup label=\"Mobile Settings\" info=\"Set settings for mobile sticky cart\">\r\n <FormControl\r\n label=\"Activate Sticky Cart\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.mobile_active']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <FormControl\r\n label=\"Show Variants Selector\"\r\n info=\"When turned off variants are selected from product\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.mobile_show_variants']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <FormControl\r\n label=\"Show Quantity Selector\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.mobile_show_quantity']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <CustomText\r\n context={shopContext}\r\n label=\"Quantity text\"\r\n path=\"settings.sticky_cart.mobile_quantity\"\r\n hasNumber={false}\r\n // hasWeight=\"700\"\r\n />\r\n <FormControl\r\n label=\"Show compared price\"\r\n withSwitch={[\r\n shopContext,\r\n 'settings.sticky_cart.mobile_show_compared_price'\r\n ]}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n\r\n {/*New feature added*/}\r\n <FormControl\r\n label=\"Show product title\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.mobile_show_title']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n <FormControl\r\n label=\"Show product price\"\r\n withSwitch={[shopContext, 'settings.sticky_cart.mobile_show_price']}\r\n >\r\n {' '}\r\n <span></span>\r\n </FormControl>\r\n {/*---------*/}\r\n <FormControl label=\"Mobile Visibilty\">\r\n <Dropdown\r\n options={STICKY_CART_OPTIONS.visibilityOptions}\r\n first\r\n BindToContext={[shopContext, 'settings.sticky_cart.mobile_visibility']}\r\n />\r\n </FormControl>\r\n {state.settings.sticky_cart.mobile_show_variants && (\r\n <>\r\n <FormControl\r\n label=\"Customize Button text when variant available\"\r\n withSwitch={[\r\n shopContext,\r\n 'settings.sticky_cart.show_btn_atc_txt_variant_active'\r\n ]}\r\n >\r\n <Input\r\n disabled={\r\n !state.settings.sticky_cart.show_btn_atc_txt_variant_active\r\n }\r\n onFocus={() => setIsStickyActVariantFocused(true)}\r\n onBlur={() => setIsStickyActVariantFocused(false)}\r\n BindToContext={[\r\n shopContext,\r\n 'settings.sticky_cart.btn_atc_txt_variant_active'\r\n ]}\r\n />\r\n </FormControl>\r\n <CustomText\r\n context={shopContext}\r\n label=\"Cart Name\"\r\n path=\"settings.sticky_cart.cart_name\"\r\n hasNumber={false}\r\n // hasWeight=\"700\"\r\n />\r\n <FormControl label=\"Button Text on variant picker active\">\r\n <Input\r\n BindToContext={[\r\n shopContext,\r\n 'settings.sticky_cart.btn_text_variant_active'\r\n ]}\r\n />\r\n </FormControl>\r\n </>\r\n )}\r\n\r\n <FormControl label=\"Mobile Location\">\r\n <Dropdown\r\n options={STICKY_CART_OPTIONS.btnPosition}\r\n first\r\n BindToContext={[shopContext, 'settings.sticky_cart.mobile_location']}\r\n />\r\n </FormControl>\r\n <FormControl>\r\n <CustomText\r\n context={shopContext}\r\n label=\"ATC height\"\r\n path={`settings.sticky_cart.mobile_atc_height`}\r\n hasColor={false}\r\n hasNumber={false}\r\n hasBU={false}\r\n type=\"number\"\r\n icon={{ char: 'PX' }}\r\n // colorType=\"hex\"\r\n step=\"1\"\r\n />\r\n </FormControl>\r\n </FormGroup>\r\n <br />\r\n <br />\r\n <br />\r\n <br />\r\n <br />\r\n </Fragment>\r\n </Page>\r\n );\r\n};\r\n\r\nexport default StickyCartSettings;\r\n","import { Spinner } from \"components\";\r\n\r\nimport React, { useContext, useEffect } from \"react\";\r\nimport { useHistory, useParams } from \"react-router\";\r\nimport Axios from \"axios\";\r\nimport { API_GATEWAY2 } from \"aws-exports\";\r\nimport ShopContext from \"context/ShopContext\";\r\n\r\nfunction addDays (date, days) {\r\n const copy = new Date(Number(date));\r\n copy.setDate(date.getDate() + days);\r\n return copy.getTime();\r\n}\r\n\r\nexport default function InvitationScreen (props) {\r\n const history = useHistory();\r\n const { id } = useParams();\r\n const { AppLocalStorage } = useContext(ShopContext)\r\n const fetchInvitation = async () => {\r\n try {\r\n //HIT API\r\n const { data } = await Axios({\r\n method: \"get\",\r\n url: `${API_GATEWAY2}/invitations`,\r\n params: {\r\n id\r\n }\r\n });\r\n if (data.redirect) {\r\n AppLocalStorage.setItem(\r\n \"invitation_id\",\r\n JSON.stringify({\r\n id,\r\n expiry: addDays(new Date(), 7)\r\n })\r\n );\r\n window.location.href = `${data.redirect.indexOf(\"https://\") === 0 ? \"\" : \"https://\"\r\n }${data.redirect}`;\r\n } else {\r\n throw new Error(\"invitation not found\");\r\n }\r\n } catch (error) {\r\n history.push(\"/login\");\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n // get the invitation\r\n fetchInvitation();\r\n }, []);\r\n\r\n return <Spinner text=\"Please Wait\" />;\r\n}\r\n","import React, { useState, useEffect } from \"react\";\r\nimport { API } from \"aws-amplify\";\r\nimport { AUTH_COOKIE_DOMAIN, APP_DEV } from \"aws-exports\";\r\nimport classNames from \"lib/classNames\";\r\nimport _ from \"lodash\";\r\nimport ContentLoader from \"react-content-loader\";\r\nimport copy from \"copy-to-clipboard\";\r\nimport { Toast } from \"@shopify/app-bridge-react\";\r\n\r\nimport { Input, Button, Page, Alert, Icon, Spinner } from \"components\";\r\nimport {\r\n faEdit,\r\n faCopy,\r\n faSave,\r\n faUndo,\r\n fabac\r\n} from \"@fortawesome/fontawesome-pro-solid\";\r\n\r\nconst Affiliation = () => {\r\n const [settings, setSettings] = useState({});\r\n const [aff_code, setCode] = useState(\"\");\r\n const [eventsList, setEventsList] = useState();\r\n const [stats, setStats] = useState({});\r\n const [isEditingCode, setIsEditingCode] = useState(false);\r\n const [isEditingPaypal, setIsEditingPaypal] = useState(false);\r\n const [error, setError] = useState(false);\r\n const [message, setMessage] = useState();\r\n // const [paypal, setPaypal] = useState(false)\r\n const getAffiliationSettings = async () => {\r\n const {\r\n data,\r\n settings: responseSettings,\r\n code: aff_code\r\n } = await API.get(\"API_GATEWAY_NEW\", \"/aff/settings\");\r\n console.log(data);\r\n console.log(responseSettings);\r\n setCode(aff_code);\r\n setSettings({...responseSettings, ...data});\r\n };\r\n const handleSubmitSettings = async (settingsTosave, codeTosave) => {\r\n return await API.post(\"API_GATEWAY_NEW\", \"/aff/settings\", {\r\n body: {\r\n settings: settingsTosave,\r\n aff_code: codeTosave\r\n }\r\n });\r\n };\r\n\r\n const getEvents = async () => {\r\n const { stats, data } = await API.get(\"API_GATEWAY_NEW\", \"/aff/events\");\r\n setEventsList(data);\r\n setStats(stats);\r\n };\r\n\r\n const handlePaypalEdit = async (paypal_email) => {\r\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(paypal_email)) {\r\n await handleSubmitSettings({ ...settings, paypal_email }, aff_code);\r\n setSettings({ ...settings, paypal_email });\r\n setIsEditingPaypal(false);\r\n setMessage(\"Settings has been saved\");\r\n } else {\r\n setError(\"Invalid email\");\r\n }\r\n };\r\n\r\n const handleCodeEdit = async (code) => {\r\n const { error: responseError } = await handleSubmitSettings(settings, code);\r\n if (responseError) {\r\n setError(responseError);\r\n } else {\r\n setCode(code);\r\n setIsEditingCode(false);\r\n setMessage(\"Settings has been saved\");\r\n }\r\n };\r\n\r\n const handleLinkCopy = (link) => {\r\n copy(link);\r\n setMessage(\"Copied !\");\r\n };\r\n\r\n useEffect(() => {\r\n getAffiliationSettings();\r\n getEvents();\r\n }, []);\r\n\r\n return (\r\n <Page background=\"none\" padding={0}>\r\n <>\r\n {error && (\r\n <Toast\r\n content={error}\r\n duration={3000}\r\n error\r\n onDismiss={() => setError()}\r\n />\r\n )}\r\n {message && (\r\n <Toast\r\n content={message}\r\n duration={3000}\r\n onDismiss={() => setMessage()}\r\n />\r\n )}\r\n <div className={classNames(\"flex justify-between\")}>\r\n <div\r\n className={classNames(\r\n \" capitalize text-gray-600 text-2xl font-bold mb-6 \"\r\n )}\r\n >\r\n Referral Program\r\n </div>\r\n </div>\r\n <div className={classNames(\"bg-white my-4 p-4\")}>\r\n <div className={classNames(\" text-lg font-bold text-gray-600\")}>\r\n Share Link\r\n </div>\r\n <p className={classNames(\"text-sm text-gray-500\")}>\r\n {`Earn ${settings?.commission || \"15\"}% + Friend saves ${settings?.discount || \"5\"}% = Everyone is HAPPY 🥳 `}\r\n </p>\r\n <div className={classNames(\"flex my-2 items-center justify-center\")}>\r\n {!aff_code ? (\r\n <Spinner />\r\n ) : !isEditingCode ? (\r\n <ShowCode {...{ aff_code, setIsEditingCode, handleLinkCopy }} />\r\n ) : (\r\n <EditCode {...{ aff_code, setIsEditingCode, handleCodeEdit }} />\r\n )}\r\n </div>\r\n <div className={classNames(\" text-lg font-bold text-gray-600\")}>\r\n Share Coupon Code\r\n </div>\r\n <p className={classNames(\"text-sm text-gray-500\")}> Enter coupon code during MonsterUpsells installation. </p>\r\n <div className={classNames(\"flex my-2 items-center justify-center\")}>\r\n <ShowCoupon {...{ aff_code, setIsEditingCode, handleLinkCopy }} />\r\n </div>\r\n <p className={classNames(\"text-sm text-gray-500\")}>\r\n Earn{\" \"}\r\n <span className={classNames(\"text-blue-500 font-bold\")}>\r\n {settings?.commission || \"15\"}% of all revenue for life\r\n </span>{\" \"}\r\n from stores registered through this link.{\" \"}\r\n </p>\r\n <p className={classNames(\"text-sm text-gray-500\")}>\r\n Reward any paying store{\" \"}\r\n <span className={classNames(\"text-blue-500 font-bold\")}>\r\n {\" \"}\r\n {settings?.discount || \"5\"}% off Monsterupsells for life\r\n </span>{\" \"}\r\n within 30 days of link click.{\" \"}\r\n </p>\r\n </div>\r\n <div className={classNames(\"bg-white my-4 p-4\")}>\r\n <div className={classNames(\" text-lg font-bold text-gray-600\")}>\r\n Payment method{\" \"}\r\n </div>\r\n <div className={classNames(\"flex my-2 items-center justify-center\")}>\r\n {!settings?.hasOwnProperty(\"paypal_email\") ? (\r\n <Spinner />\r\n ) : !isEditingPaypal ? (\r\n <ShowPaypal\r\n {...{ paypal: settings.paypal_email, setIsEditingPaypal }}\r\n />\r\n ) : (\r\n <EditPaypal\r\n {...{\r\n paypal: settings.paypal_email,\r\n setIsEditingPaypal,\r\n handlePaypalEdit\r\n }}\r\n />\r\n )}\r\n </div>\r\n\r\n <p className={classNames(\"text-sm text-gray-500\")}>\r\n {\" \"}\r\n Payouts will be sent monthly. Minimum payment $50{\" \"}\r\n </p>\r\n </div>\r\n\r\n <div\r\n className={classNames(\r\n \"flex-1 capitalize text-gray-600 text-2xl font-bold mt-6\"\r\n )}\r\n >\r\n Statics\r\n </div>\r\n\r\n <div\r\n className={classNames(\r\n \"col-span-1 lg:col-span-3 grid grid-cols-1 gap-8 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 py-4\"\r\n )}\r\n >\r\n <StateCard title=\"Clicks\" value={stats.views} />\r\n <StateCard\r\n title=\"Active subscribers\"\r\n value={stats.active_referrals}\r\n />\r\n <StateCard title=\"Accumilated Commissions\" value={\"$0\"} />\r\n <StateCard title=\"Paid Out Commissions\" value={\"$0\"} />\r\n </div>\r\n <div className={classNames(\" pb-4 \")}>\r\n <div\r\n className={classNames(\"bg-white my-4 p-4 border-b \", {\r\n \"h-60\": !eventsList || !eventsList.length\r\n })}\r\n >\r\n <div className={classNames(\" text-lg font-bold text-gray-600\")}>\r\n Referred Stores{\" \"}\r\n </div>\r\n <div\r\n className={classNames(\r\n \"flex text-gray-600 text-lg font-bold border-b mt-6 \"\r\n )}\r\n >\r\n <div className={classNames(\"flex-1\")}>Store name</div>\r\n {/* <div></div> */}\r\n <div className={classNames(\"flex-1\")}>Total earned</div>\r\n </div>\r\n {!eventsList ? (\r\n <Spinner />\r\n ) : (\r\n eventsList.map((e, index) => {\r\n return (\r\n <div\r\n className={classNames(\r\n \"flex text-gray-500 font-bold border-b py-2 \"\r\n )}\r\n key={index}\r\n >\r\n <div className={classNames(\"flex-1\")}>{e.referral} </div>\r\n <div className={classNames(\"flex-1\")}>${e.earnings} </div>\r\n </div>\r\n );\r\n })\r\n )}\r\n </div>\r\n </div>\r\n <Alert\r\n type=\"success\"\r\n // icon= {state.settings.sticky_cart.isActive ? 'check-circle' : 'exclamation-circle'}\r\n title=\"Want to supply your audience with unique benefits or join our agency partner ?\"\r\n className=\"z-5\"\r\n >\r\n <p>\r\n {\" \"}\r\n Please contact our team at{\" \"}\r\n <a\r\n href=\"mailto:support@monsterapps.shop\"\r\n target=\"_blank\"\r\n className={classNames(\"text-blue-500 font-bold\")}\r\n >\r\n support@monsterapps.shop\r\n </a>\r\n </p>\r\n </Alert>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n <div></div>\r\n </>\r\n </Page>\r\n );\r\n};\r\n\r\nconst ShowCode = ({ aff_code, setIsEditingCode, handleLinkCopy }) => {\r\n const link = APP_DEV\r\n ? `${AUTH_COOKIE_DOMAIN}/ref/${aff_code}`\r\n : `https://monsterupsells.com/ref/${aff_code}`;\r\n return (\r\n <>\r\n <Input disabled={true} disabledBgColor=\"bg-gray-100\" value={link} />\r\n <div\r\n className={classNames(\r\n \"h-full flex p-2 items-center justify-center text-blue-500 mx-1 cursor-pointer\"\r\n )}\r\n onClick={() => handleLinkCopy(link)}\r\n >\r\n <Icon icon={faCopy} size=\"lg\" />\r\n </div>\r\n <div\r\n className={classNames(\r\n \"h-full flex p-2 items-center justify-center text-blue-500 mx-1 cursor-pointer\"\r\n )}\r\n onClick={() => setIsEditingCode(true)}\r\n >\r\n <Icon icon={faEdit} size=\"lg\" />\r\n </div>\r\n </>\r\n );\r\n};\r\nconst ShowCoupon = ({ aff_code , handleLinkCopy }) => { \r\n return (\r\n <>\r\n <Input disabled={true} disabledBgColor=\"bg-gray-100\" value={aff_code} />\r\n <div\r\n className={classNames(\r\n \"h-full flex p-2 items-center justify-center text-blue-500 mx-1 cursor-pointer\"\r\n )}\r\n onClick={() => handleLinkCopy(aff_code)}\r\n >\r\n <Icon icon={faCopy} size=\"lg\" />\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nconst EditCode = ({ aff_code, setIsEditingCode, handleCodeEdit }) => {\r\n const [code, setCode] = useState(aff_code);\r\n\r\n const handleLinkEdit = () => {\r\n handleCodeEdit(code);\r\n };\r\n\r\n const link = APP_DEV\r\n ? `${AUTH_COOKIE_DOMAIN}/ref/`\r\n : `https://monsterupsells.com/ref/`;\r\n return (\r\n <div className={classNames(\"flex flex-1 items-center justify-center\")}>\r\n <div className={classNames(\"text-gray-600 ml-2 mr-1\")}>{link}</div>\r\n <Input value={code} onChange={setCode} />\r\n <div\r\n className={classNames(\r\n \"h-full flex p-2 items-center justify-center text-blue-500 mx-1 cursor-pointer\"\r\n )}\r\n onClick={() => setIsEditingCode(false)}\r\n >\r\n <Icon icon={faUndo} size=\"lg\" />\r\n </div>\r\n <div\r\n className={classNames(\r\n \"h-full flex p-2 items-center justify-center text-blue-500 mx-1 cursor-pointer\"\r\n )}\r\n onClick={handleLinkEdit}\r\n >\r\n <Icon icon={faSave} size=\"lg\" />\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nconst ShowPaypal = ({ paypal, setIsEditingPaypal }) => {\r\n return (\r\n <div className={classNames(\"flex flex-1 items-center justify-center\")}>\r\n <Input disabled disabledBgColor=\"bg-gray-100\" value={paypal} />\r\n <div\r\n className={classNames(\r\n \"h-full flex p-2 items-center justify-center text-blue-500 mx-1 cursor-pointer\"\r\n )}\r\n onClick={() => setIsEditingPaypal(true)}\r\n >\r\n <Icon icon={faEdit} size=\"lg\" />\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nconst EditPaypal = ({ paypal, setIsEditingPaypal, handlePaypalEdit }) => {\r\n const [localPaypal, setLocalPaypal] = useState(paypal);\r\n return (\r\n <div className={classNames(\"flex flex-1 items-center justify-center\")}>\r\n <Input\r\n disabledBgColor=\"bg-gray-100\"\r\n value={localPaypal}\r\n onChange={setLocalPaypal}\r\n />\r\n <div\r\n className={classNames(\r\n \"h-full flex p-2 items-center justify-center text-blue-500 mx-1 cursor-pointer\"\r\n )}\r\n onClick={() => setIsEditingPaypal(false)}\r\n >\r\n <Icon icon={faUndo} size=\"lg\" />\r\n </div>\r\n <div\r\n className={classNames(\r\n \"h-full flex p-2 items-center justify-center text-blue-500 mx-1 cursor-pointer\"\r\n )}\r\n onClick={() => handlePaypalEdit(localPaypal)}\r\n >\r\n <Icon icon={faSave} size=\"lg\" />\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nconst StateCard = (props) => {\r\n const { title, value, onClick, active } = props;\r\n return (\r\n <div\r\n className={classNames(\r\n \"shadow flex-1 bg-white rounded p-5 text-gray-600 cursor-pointer\",\r\n {\r\n \"text-blue-500 ring\": active\r\n }\r\n )}\r\n {...{ onClick, active }}\r\n >\r\n {value === null && (\r\n <ContentLoader>\r\n <rect x=\"0\" y=\"0\" rx=\"4\" ry=\"4\" width=\"60%\" height=\"30\" />\r\n <rect x=\"0\" y=\"60\" rx=\"4\" ry=\"4\" width=\"30%\" height=\"30\" />\r\n </ContentLoader>\r\n )}\r\n <h3 className={classNames(\"font-bold mb-3\")}>{_.startCase(title)}</h3>\r\n <h1 className={classNames(\"font-bold text-4xl\")}>{value}</h1>\r\n </div>\r\n );\r\n};\r\n\r\nexport default Affiliation;\r\n","import React, { useContext, useEffect } from \"react\";\r\nimport { useHistory, useParams } from \"react-router\";\r\nimport { API } from \"aws-amplify\";\r\nimport { Spinner } from \"components\";\r\nimport { AUTH_COOKIE_DOMAIN } from \"aws-exports\";\r\nimport Axios from \"axios\";\r\nimport { API_GATEWAY_NEW, APP_DEV } from \"aws-exports\";\r\nimport ShopContext from \"context/ShopContext\";\r\n\r\nexport default function ReferralScreen (props) {\r\n const history = useHistory();\r\n const { code } = useParams();\r\n const { AppLocalStorage } = useContext(ShopContext)\r\n const addDays = (date, days) => {\r\n const copy = new Date(Number(date));\r\n copy.setDate(date.getDate() + days);\r\n return copy.getTime();\r\n };\r\n const handleReferral = async () => {\r\n if (window.location.host.indexOf(\"monsterupsells.com\") != -1) {\r\n AppLocalStorage.setItem(\r\n \"aff_code\",\r\n JSON.stringify({\r\n code,\r\n expiry: addDays(new Date(), 30)\r\n })\r\n );\r\n window.location.href = `https://${AUTH_COOKIE_DOMAIN}/ref/${code}`;\r\n } else {\r\n if (code) {\r\n const { exists } = await Axios.post(`${API_GATEWAY_NEW}/aff/events`, {\r\n aff_code: code,\r\n event: \"view\"\r\n });\r\n // if(exists){\r\n AppLocalStorage.setItem(\r\n \"aff_code\",\r\n JSON.stringify({\r\n code,\r\n expiry: addDays(new Date(), 30)\r\n })\r\n );\r\n // }\r\n }\r\n window.location.href = APP_DEV\r\n ? \"https://localhost/login\"\r\n : \"https://apps.shopify.com/monster-upsells\";\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n handleReferral();\r\n }, []);\r\n\r\n // return <div onClick={handleReferral}> clivk me </div>\r\n return <Spinner text=\"Please Wait\" />;\r\n}\r\n","import React from \"react\"\r\nimport { API_GATEWAY } from \"aws-exports\";\r\nimport { parseQueryString } from \"lib/query-string\";\r\nimport { useEffect } from \"react\";\r\nimport { Spinner } from \"components\";\r\n\r\nexport default function NewLoginScreen (props) {\r\n const { search } = props.location\r\n useEffect(() => {\r\n window.location.href = `${API_GATEWAY}/auth/shopify/install${search}`;\r\n }, [])\r\n return <Spinner />\r\n}","import React from \"react\";\r\nimport { Page } from \"components\";\r\nimport classNames from \"lib/classNames\";\r\n// import WbIcon from \"svgs/wb-icon.png\";\r\n// import TranscyIcon from \"svgs/transcy-icon.png\";\r\n// import PageflyIcon from \"svgs/pagefly-icon.png\";\r\n// import MonsterIcon from \"svgs/monster-checkout-icon.png\";\r\n// import GorillaIcon from \"svgs/gorilla-icon.png\";\r\n// import RechargeIcon from \"svgs/recharge-icon.jpeg\";\r\n// import ZeptoIcon from \"svgs/zepto-icon.png\";\r\n\r\n// const partners = [\r\n// {\r\n// name: \"Monster Checkout Upsells\",\r\n// description:\r\n// \"Increase Checkout Revenue using One Click Upsell funnels after someone has purchased from your store.\",\r\n// link: \"https://apps.shopify.com/monster-checkout\",\r\n// icon: MonsterIcon,\r\n// },\r\n// {\r\n// name: \"Widebundle\",\r\n// description:\r\n// \"Increase your AOV by adding bundles and offers to your products. Provide discounts that boost sales.\",\r\n// link: \"https://apps.shopify.com/widebundle\",\r\n// icon: WbIcon,\r\n// },\r\n// {\r\n// name: \"Transcy - Translate\",\r\n// description:\r\n// \"Transcy allows you to translate the content of your online store into multiple languages and convert the currency into the local currency of the customers.\",\r\n// link: \"https://apps.shopify.com/transcy-multiple-languages\",\r\n// icon: TranscyIcon,\r\n// },\r\n// {\r\n// name: \"PageFly\",\r\n// description: \"Drag and drop to build Landing, Product, Home and Blog pages\",\r\n// link: \"https://apps.shopify.com/pagefly\",\r\n// icon: PageflyIcon,\r\n// },\r\n// {\r\n// name: \"Wholesale Gorilla\",\r\n// description:\r\n// \"Create a wholesale portal on your store. A simple and powerful B2B solution built by real merchants.\",\r\n// link: \"https://apps.shopify.com/wholesale-gorilla\",\r\n// icon: GorillaIcon,\r\n// },\r\n// {\r\n// name: \"Recharge Subscriptions\",\r\n// description:\r\n// \"Grow your subscription business with Recharge and enable your customers to fully manage their subscriptions directly from your store.\",\r\n// link: \"https://apps.shopify.com/subscription-payments\",\r\n// icon: RechargeIcon,\r\n// },\r\n// {\r\n// name: \"Zepto Product Personalizer\",\r\n// description:\r\n// \"Add Unlimited Custom Product Options with Live Preview. A Visual Personalizer to boost sales.\",\r\n// link: \"https://apps.shopify.com/product-personalizer\",\r\n// icon: ZeptoIcon,\r\n// },\r\n// ];\r\n\r\nconst Integrations = () => {\r\n return (\r\n <>\r\n <Page\r\n background=\"white\"\r\n header={{ title: \"Integrations & Partners\" }}\r\n padding=\"p-0\"\r\n additional_classes=\" h-full\"\r\n >\r\n {/* <div className={classNames(\"bg-white relative rounded shadow p-5 pb-6\")}>\r\n <b className={classNames(\"text-gray-600 text-md\")}>\r\n We integrate with and recommend these apps\r\n </b>\r\n <div\r\n className={classNames(\r\n \"col-span-1 lg:col-span-3 grid grid-cols-1 gap-4 sm:grid-cols-1 md:grid-cols-2 lg:grid-cols-3 mt-4\"\r\n )}\r\n >\r\n {partners.map((partner) => (\r\n <div\r\n className={classNames(\r\n \"flex flex-1 items-start justify-start border border-solid border-gray-500 rounded-md p-3\"\r\n )}\r\n key={partner.name}\r\n >\r\n <div className={classNames(\"mr-3\")}>\r\n <img\r\n src={partner.icon}\r\n className={classNames(\"rounded-md w-12 h-12 max-w-none\")}\r\n />\r\n </div>\r\n <div className={classNames(\"\")}>\r\n <h3\r\n className={classNames(\"font-bold text-sm mb-1 text-gray-600\")}\r\n >\r\n {partner.name}\r\n </h3>\r\n <p\r\n className={classNames(\r\n \"font-small text-xs leading-4 text-gray-700\"\r\n )}\r\n >\r\n {partner.description}\r\n </p>\r\n <a\r\n className={classNames(\r\n \"font-medium text-xs leading-4 underline text-black mt-2\"\r\n )}\r\n href={partner.link}\r\n target=\"_blank\"\r\n >\r\n Learn More\r\n </a>\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n </div> */}\r\n <iframe\r\n src=\"https://monsterupsells.partnerpage.io/integrations\"\r\n width=\"100%\"\r\n height=\"100%\"\r\n frameborder=\"0\"\r\n className={classNames(\"bg-white\")}\r\n ></iframe>\r\n </Page>\r\n </>\r\n );\r\n};\r\n\r\nexport default Integrations;\r\n","import CampaignsList from \"./campaigns/List\";\r\nimport CreateCampaign from \"./campaigns/Create\";\r\nimport UpdateCampaign from \"./campaigns/Update\";\r\nimport DuplicateCampaign from \"./campaigns/Duplicate\";\r\n\r\nexport const Campaigns = {\r\n list: CampaignsList,\r\n update: UpdateCampaign,\r\n duplicate: DuplicateCampaign,\r\n create: CreateCampaign,\r\n};\r\n\r\n// export { default as UnexpectedErrorScreen } from './UnexpectedErrorScreen_deprecated';\r\nexport { default as ErrorScreen } from \"./ErrorScreen\";\r\nexport { default as NotFoundScreen } from \"./NotFoundScreen\";\r\nexport { default as LoginScreen } from \"./LoginScreen\";\r\nexport { default as LogoutScreen } from \"./LogoutScreen\";\r\n// export { default as CallbackScreen } from './__CallbackScreenen';\r\nexport { default as CartScreen } from \"./CartScreen\";\r\nexport { default as CodCheckout } from \"./CodCheckout\";\r\nexport { default as DashboardScreen } from \"./DashboardScreen\";\r\nexport { default as FaqScreen } from \"./FaqScreen\";\r\nexport { default as PrivacyPolicy } from \"./PrivacyPolicy\";\r\nexport { default as ManualSetup } from \"./ManualSetup\";\r\nexport { default as PlanScreen } from \"./PlanScreen\";\r\nexport { default as StickyCartSettings } from \"./StickyCartSettings\";\r\nexport { default as InvitationScreen } from \"./InvitationScreen\";\r\nexport { default as Affiliation } from \"./Affiliation\";\r\nexport { default as ReferralScreen } from \"./ReferralScreen\";\r\nexport { default as NewLoginScreen } from \"./NewLoginScreen\";\r\nexport { default as Integrations } from \"./Integrations\";\r\n","import React, { useState, useRef, useEffect } from 'react';\r\nimport { Icon } from 'components';\r\nimport { CenterModal } from 'react-spring-modal';\r\nimport 'react-spring-modal/dist/index.css';\r\nimport styled from 'styled-components';\r\nimport styles from 'styles/modal.module.scss';\r\nimport { Scrollbars } from 'react-custom-scrollbars';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst Modal = ({ footer,visible, title, children, subTitle = '', onClose = () => null, style ={} , background= \"bg-gray-200\"}) => {\r\n\t// const modal = useRef(null);\r\n\t// const overlay = useRef(null);\r\n\tconst [stateTitle, setTitle] = useState(title);\r\n\tconst scrollbars_ref = useRef(null);\r\n\r\n\tconst close = () => {\r\n\t\t// modal.current.appendChild(overlay.current);\r\n\t\tonClose();\r\n\t};\r\n\r\n\t// useEffect(() => {\r\n\t// \tconst PARENT_IS_NOT_BODY = !!overlay.current ? overlay.current.parentElement !== document.body : false;\r\n\t// \tif (PARENT_IS_NOT_BODY) {\r\n\t// \t\tdocument.getElementById('monster-upsell-cart').appendChild(overlay.current);\r\n\t// \t\toverlay.current.style.opacity = 1;\r\n\t// \t}\r\n\t// }, [overlay.current]);\r\n\r\n\treturn (\r\n\t\t<CenterModal isOpen={visible} onRequestClose={() => onClose()} className={`BottomModal__backdrop ${styles.modal}`}>\r\n\t\t\t<div className={`${classNames('p-4 h-full w-full '+background)} ${styles.header}`}>\r\n\t\t\t\t<div className={styles.meta}>\r\n\t\t\t\t\t<div className={styles.head}>{stateTitle}</div>\r\n\t\t\t\t\t{subTitle && <p>{subTitle}</p>}\r\n\t\t\t\t</div>\r\n\t\t\t\t<Icon icon=\"times\" onClick={() => close()} />\r\n\t\t\t</div>\r\n\t\t\t<Scrollbars className={styles.content} style={style}>\r\n\t\t\t\t<div className={styles.wrapper}>{children(close, setTitle)}</div>\r\n\t\t\t</Scrollbars>\r\n\t\t\t{\r\n\t\t\t\t!!footer && <div className={styles.footer}>{footer}</div>\r\n\t\t\t}\r\n\t\t</CenterModal>\r\n\t);\r\n};\r\n\r\nexport default Modal;\r\n","import React, { useContext, useEffect, useState, useCallback } from \"react\";\r\nimport { API } from \"aws-amplify\";\r\nimport classNames from \"lib/classNames\";\r\nimport styles from \"styles/charge_approval.module.scss\";\r\nimport Modal from \"./Modal\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport {\r\n Icon,\r\n Range\r\n} from 'components';\r\nimport { Redirect } from \"@shopify/app-bridge/actions\";\r\nimport {\r\n faCheckSquare\r\n} from '@fortawesome/fontawesome-pro-solid';\r\n\r\nimport EmbeddedContext from \"context/EmbeddedContext\";\r\nimport getPlans, { getBasePrice } from \"lib/getPlans\";\r\nimport { trackMixPanelEvent } from \"lib/mixpanel\"\r\n\r\n\r\nconst ChargeApproval = ({ }) => {\r\n const { AppBridgeRedirect } = useContext(EmbeddedContext);\r\n const shopContext = useContext(ShopContext);\r\n const {\r\n state: { chargeConfirmationUrl, redirectToChargeApproval },\r\n state\r\n } = shopContext;\r\n const plans = getPlans(new Date(state.installedAt).getTime());\r\n const [isModalVisible, setIsModalVisible] = useState(\r\n redirectToChargeApproval\r\n );\r\n const [orderSize, setOrderSize] = useState(10)\r\n const [isExpanded, setIsExpanded] = useState(false);\r\n // type: \"trial\"\r\n // value: 10\r\n const [couponOpened, setCouponOpened] = useState(false);\r\n const [couponCode, setCouponCode] = useState();\r\n const [discountLoading, setDiscountLoading] = useState(false);\r\n const [discount, setDiscount] = useState();\r\n const [discountMessage, setDiscountMessage] = useState();\r\n const [discountedChargeUrl, setDiscountedChargeUrl] = useState();\r\n\r\n useEffect(() => {\r\n if (redirectToChargeApproval) {\r\n AppBridgeRedirect.dispatch(Redirect.Action.REMOTE, chargeConfirmationUrl);\r\n }\r\n if (state?.invitation?.type === \"discount_percentage\") {\r\n setDiscount(state?.invitation?.value)\r\n setDiscountMessage({ type: \"info\", text: \"Discount applied: \" + state?.invitation?.value + \"%\" })\r\n }\r\n }, [])\r\n\r\n const calculatePrice = (orderSize) => {\r\n return plans.find(({ transactions }) => orderSize <= transactions)?.real_price\r\n }\r\n const handleDiscountApply = async () => {\r\n if (!couponCode) return\r\n setDiscountLoading(true)\r\n // make the call to check the discount\r\n const result = await API.post(\"API_GATEWAY_NEW\", \"/aff/coupon\", {\r\n body: {\r\n coupon: couponCode\r\n }\r\n });\r\n setDiscountLoading(false)\r\n if (result.found) {\r\n setDiscount(result.discount + \"%\")\r\n setDiscountMessage({ type: \"info\", text: \"Discount applied: \" + result.discount + \"%\" })\r\n setDiscountedChargeUrl(result.chargeConfirmationUrl)\r\n setCouponOpened(false)\r\n } else {\r\n setDiscount()\r\n setDiscountMessage({ type: \"error\", text: \"Discount code not found\" })\r\n }\r\n }\r\n const redirect = () => {\r\n trackMixPanelEvent(\"Accept charges click\", state?.id)\r\n AppBridgeRedirect.dispatch(Redirect.Action.REMOTE, discountedChargeUrl || chargeConfirmationUrl);\r\n };\r\n const footer = (\r\n <div className={`${classNames(\"flex items-center justify-between\")} `}>\r\n <div className={classNames(\"flex items-center\tflex-row\")}>\r\n {!discount && <div >\r\n <div\r\n className={classNames(\"font-bold flex items-center cursor-pointer text-gray-500\", { [\"justify-center\"]: !couponOpened })}\r\n onClick={() => setCouponOpened(!couponOpened)}\r\n tabIndex=\"0\"\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n className={classNames(\r\n \"transition-transform duration-200 ease-out transform\",\r\n {\r\n \"rotate-45\": couponOpened\r\n }\r\n )}\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 512 512\"\r\n style={{ width: 13, height: 13 }}\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z\"\r\n ></path>\r\n </svg>\r\n\r\n <div className={classNames(\"leading-full pl-1 text-sm\")} >\r\n Coupon code\r\n </div>\r\n </div>\r\n {couponOpened && (\r\n <>\r\n <div className={classNames(\"mt-2 flex items-stretch\")}>\r\n <div\r\n className={`${classNames(\r\n \"flex rounded border p-1 flex items-center flex-1 border-gray-500\"\r\n )}`}// ${styles.border_blue_color}\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n className={`${classNames(\"pr-2 flex-shrink-0\")} ${styles.blue_color}`}\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 512 512\"\r\n style={{ width: 25, height: 25 }}\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M512 256c0-37.7-23.7-69.9-57.1-82.4 14.7-32.4 8.8-71.9-17.9-98.6-26.7-26.7-66.2-32.6-98.6-17.9C325.9 23.7 293.7 0 256 0s-69.9 23.7-82.4 57.1c-32.4-14.7-72-8.8-98.6 17.9-26.7 26.7-32.6 66.2-17.9 98.6C23.7 186.1 0 218.3 0 256s23.7 69.9 57.1 82.4c-14.7 32.4-8.8 72 17.9 98.6 26.6 26.6 66.1 32.7 98.6 17.9 12.5 33.3 44.7 57.1 82.4 57.1s69.9-23.7 82.4-57.1c32.6 14.8 72 8.7 98.6-17.9 26.7-26.7 32.6-66.2 17.9-98.6 33.4-12.5 57.1-44.7 57.1-82.4zm-320-96c17.67 0 32 14.33 32 32s-14.33 32-32 32-32-14.33-32-32 14.33-32 32-32zm12.28 181.65c-6.25 6.25-16.38 6.25-22.63 0l-11.31-11.31c-6.25-6.25-6.25-16.38 0-22.63l137.37-137.37c6.25-6.25 16.38-6.25 22.63 0l11.31 11.31c6.25 6.25 6.25 16.38 0 22.63L204.28 341.65zM320 352c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z\"\r\n ></path>\r\n </svg>\r\n {!!discount && (\r\n <div\r\n className={`${classNames(\"flex px-2 py-1 rounded relative text-white\")} ${styles.bg_blue_color}`}\r\n >\r\n <span className={classNames(\"flex-1\")}>{couponCode}</span>\r\n </div>\r\n )}\r\n {!discount && (\r\n <input\r\n value={couponCode}\r\n placeholder={\"enter coupon code\"}\r\n onChange={({ target }) => {\r\n if (!discount) setCouponCode(target.value);\r\n }}\r\n disabled={!!discount}\r\n className={classNames(\r\n \"border-0 shadow-none focus:outline-none bg-transparent w-full text-sm\"\r\n )}\r\n />\r\n )}\r\n </div>\r\n <button\r\n onClick={() => handleDiscountApply()}\r\n disabled={!!discount || discountLoading}\r\n style={{ flex: 0 }}\r\n className={`${classNames(\"ml-2 px-3 btn-small flex-0 text-white\")} ${styles.bg_blue_color}`}\r\n >\r\n Apply\r\n </button>\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n }\r\n {discountMessage && (\r\n <div\r\n className={classNames(\"pt-2 p-1 rounded font-bold\", {\r\n \"text-green-500\":\r\n discountMessage.type === \"info\",\r\n \"text-red-500\":\r\n discountMessage.type === \"error\"\r\n })}\r\n >\r\n {discountMessage.text}\r\n </div>\r\n )}\r\n </div>\r\n <div className={`${classNames(\"flex\")} `}>\r\n <a\r\n className={`${classNames(\r\n \"py-2 px-5 font-bold text-sm cursor-pointer flex items-center\"\r\n )} ${styles.blue_color}`}\r\n onClick={() => setIsExpanded(!isExpanded)}\r\n >\r\n Pricing table\r\n <svg\r\n className={`${classNames(\"duration-300\", {\r\n \"transform \": isExpanded,\r\n \"rotate-180\": isExpanded\r\n })}`}\r\n width=\"30\"\r\n height=\"30\"\r\n viewBox=\"0 0 30 30\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M9.2625 10.7375L15 16.4625L20.7375 10.7375L22.5 12.5L15 20L7.5 12.5L9.2625 10.7375Z\"\r\n fill=\"#0053DC\"\r\n />\r\n </svg>\r\n </a>\r\n <a\r\n className={`${classNames(\r\n \"py-2 px-5 font-bold rounded-sm text-white text-sm cursor-pointer flex items-center\"\r\n )} ${styles.bg_blue_color}`}\r\n onClick={() => redirect()}\r\n >\r\n Get Access\r\n </a>\r\n </div>\r\n </div>\r\n )\r\n\r\n\r\n return (\r\n <div className={classNames(\"absolute z-50\")}>\r\n <Modal\r\n visible={isModalVisible}\r\n onClose={() => setIsModalVisible(false)}\r\n style={{ minWidth: \"900px\", minHeight: isExpanded ? \"485px\" : \"205px\" }}\r\n background=\"bg-white\"\r\n title={<div className={classNames(\" font-bold flex-center text-2xl\")} > Welcome to MonsterUpsells <span>👋</span> </div>}\r\n footer={footer}\r\n >\r\n {(close, setTitle) => (\r\n <div\r\n id=\"monster-upsell-cart\"\r\n className={classNames(\"px-4 h-full w-full \")}\r\n >\r\n <div\r\n className={`${classNames(\"w-full text-center\")} ${styles.navy_color}`}\r\n >\r\n\r\n <div className={classNames(\"py-2\")}>\r\n <p> The next page is a Shopify charge page. </p>\r\n </div>\r\n <div className={classNames(\"py-2\")}>\r\n <p> Although it might seem scarry...</p>\r\n <p> Dont worry! </p>\r\n </div>\r\n <div className={classNames(\"py-2 font-bold\")}>\r\n <p> YOU WILL NOT BE CHARGED UNLESS YOU KEEP THE APP LONGER THAN <u>THE 10-DAYS FREE TRIAL</u>.</p>\r\n </div>\r\n <div className={classNames(\"py-2\")}>\r\n <p> The app starts at ${getBasePrice(new Date(state.installedAt).getTime())} and increases depending on order volume. </p>\r\n </div>\r\n </div>\r\n <div\r\n className={`${classNames(\"flex \", {\r\n \"pb-6\": isExpanded\r\n })} ${styles.table} ${isExpanded ? \"\" : styles.hidden_pricing}`}\r\n >\r\n <div className={`${classNames(\"flex-1 p-2 m-2 h-full rounded\")} ${styles.bg_lighter_blue_color}`}>\r\n <div className={classNames(\"py-3 font-bold flex justify-center\")}>\r\n <p> <u>Our pricing</u></p>\r\n </div>\r\n <div className={classNames(\"py-2 flex justify-center\")}>\r\n <p className={classNames(\"text-center w-2/3\")}> How many monthly orders does your store have?</p>\r\n </div>\r\n <div className={classNames(\"px-6 py-4\")}>\r\n <Range\r\n value={orderSize}\r\n onChange={setOrderSize}\r\n min={1}\r\n max={3001}\r\n />\r\n </div>\r\n <div className={classNames(\" py-6 px-6 flex items-center justify-between\t\")}>\r\n <div className={classNames(\" mb-2\")}> <div className={classNames(\"p-1 bg-white rounded text-center \")}>{orderSize === 3001 ? \"Over 3000+\" : `Up to ${orderSize}`} </div> <div className={classNames(\"\")}> Orders per Month</div></div>\r\n <div className={classNames(\" text-center \")}> <div>${calculatePrice(orderSize)}</div> <div className={classNames(\"\")}> Price </div></div>\r\n </div>\r\n </div>\r\n <div className={classNames(\"flex-1 p-2 m-2\")}>\r\n <div className={classNames(\"py-2 font-bold\")}>\r\n <p> <u>Why MonsterUpsells?</u></p>\r\n </div>\r\n <div className={classNames(\"flex py-2\")}>\r\n <Icon color={\"#48bb78\"} icon={faCheckSquare} size=\"lg\" />\r\n <p className={classNames(\"pl-2\")} > Average revenue increase 10-15%</p>\r\n </div>\r\n <div className={classNames(\"flex py-2\")}>\r\n <Icon color={\"#48bb78\"} icon={faCheckSquare} size=\"lg\" />\r\n <p className={classNames(\"pl-2\")} > 10 Day free trial</p>\r\n </div>\r\n <div className={classNames(\"flex py-2\")}>\r\n <Icon color={\"#48bb78\"} icon={faCheckSquare} size=\"lg\" />\r\n <p className={classNames(\"pl-2\")} > Beautiful user experience</p>\r\n </div>\r\n <div className={classNames(\"flex py-2\")}>\r\n <Icon color={\"#48bb78\"} icon={faCheckSquare} size=\"lg\" />\r\n <p className={classNames(\"pl-2\")} > Powerful upsells offers</p>\r\n </div>\r\n <div className={classNames(\"flex py-2\")}>\r\n <Icon color={\"#48bb78\"} icon={faCheckSquare} size=\"lg\" />\r\n <p className={classNames(\"pl-2\")} > Average ROI of 2000%+</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n </Modal>\r\n </div>\r\n );\r\n};\r\n\r\nexport default ChargeApproval;\r\n","import React, { useContext, useEffect, useState, useCallback } from \"react\";\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { SHOPIFY_API_KEY, SHOPIFY_EMBEDDED_FORCE_REDIRECT } from \"aws-exports\";\r\nimport { Provider } from \"@shopify/app-bridge-react\";\r\nimport createApp from \"@shopify/app-bridge\";\r\nimport { Redirect, History, Toast } from \"@shopify/app-bridge/actions\";\r\n// import { useRoutePropagation } from \"@shopify/react-shopify-app-route-propagator\";\r\nimport useReactRouter from \"use-react-router\";\r\nimport NotifyContext from \"context/NotifyContext\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport { ErrorScreen } from \"screens\";\r\nimport { EmbeddedProvider } from \"context/EmbeddedContext\";\r\nimport UserContext from \"context/UserContext\";\r\nimport { ENGINE_WARNING_ICON } from \"lib/globals\";\r\nimport ChargeApproval from \"./chargeApproval\";\r\nimport WelcomeModal from \"./welcomeModal\";\r\nimport { setupModalAutoSizing } from \"@shopify/app-bridge-utils\";\r\n\r\nconst Embedded = ({ children, location, newPlanRedirect }) => {\r\n const { history } = useReactRouter();\r\n const user = useContext(UserContext);\r\n const shopContext = useContext(ShopContext);\r\n const {\r\n state: {\r\n settings,\r\n settingsSaved,\r\n chargeConfirmationUrl,\r\n redirectToChargeApproval,\r\n id,\r\n installedAt\r\n // show_recharge_alert\r\n },\r\n setItem\r\n } = shopContext;\r\n const { createNotification, deleteNotification } = useContext(NotifyContext);\r\n const queryString = window.location.search;\r\n const params = new URLSearchParams(queryString);\r\n const config = {\r\n apiKey: SHOPIFY_API_KEY,\r\n shopOrigin: user.attributes.website,\r\n forceRedirect: SHOPIFY_EMBEDDED_FORCE_REDIRECT,\r\n host: params.get(\"host\") || btoa(user.attributes.website)\r\n };\r\n const app = createApp(config);\r\n setupModalAutoSizing(app);\r\n const AppBridgeHistory = History.create(app);\r\n const AppBridgeRedirect = Redirect.create(app);\r\n const AppBridgeToast = toastOptions => {\r\n const toast = Toast.create(app, toastOptions)\r\n return {\r\n open () {\r\n toast.dispatch(Toast.Action.SHOW)\r\n }\r\n }\r\n };\r\n // useRoutePropagation(app, location);\r\n useEffect(() => {\r\n if (window.$crisp) {\r\n window.$crisp.push([\"set\", \"session:data\", [\"store\", id]]);\r\n window.$crisp.push([\"set\", \"session:data\", [\"App\", \"Monster UPSELLS\"]]);\r\n }\r\n }, [settings]);\r\n useEffect(() => {\r\n if (params.get(\"source\") === 'charge-accepted') {\r\n if (typeof window.fbq === 'function') {\r\n window.fbq('track', 'TrialStarted')\r\n }\r\n AppBridgeRedirect.dispatch(Redirect.Action.APP, '')\r\n }\r\n }, [params])\r\n // src={ `${window.location.origin}/${getPlansModal(new Date(installedAt).getTime())}?chargeConfirmationUrl=${chargeConfirmationUrl}`}\r\n return (\r\n <>\r\n <EmbeddedProvider value={{ app, AppBridgeRedirect, AppBridgeHistory, AppBridgeToast }}>\r\n <Provider config={config}>\r\n {!!(redirectToChargeApproval && window.location.pathname !== \"/affiliation\") && <ChargeApproval />}\r\n {/* {!redirectToChargeApproval && <WelcomeModal />} */}\r\n <ErrorScreen>{children}</ErrorScreen>\r\n </Provider>\r\n </EmbeddedProvider>\r\n </>\r\n );\r\n};\r\n\r\nexport default withRouter(Embedded);\r\n","import { getSessionToken } from \"@shopify/app-bridge-utils\";\r\nimport { API, graphqlOperation } from \"aws-amplify\";\r\nimport { UPDATE_SHOP_PROP } from \"./mutations\";\r\n\r\nexport default function (shop, shopSetItem, app) {\r\n const db_keys = [\"review_clicked\", \"welcome_video_watched\", \"survey_closed\", \"first_cart_turn_on\", \"first_new_campaign_click\", \"first_new_campaign\", \"fb_pixel_trial_started\"]\r\n const data = {}\r\n return {\r\n getItem (key) {\r\n const source = db_keys.includes(key) ? shop : data\r\n return shop[key] || null\r\n },\r\n async setItem (key, value) {\r\n if (db_keys.includes(key)) {\r\n const input = { [key]: value }\r\n const authToken = `Bearer ${await getSessionToken(app)}`\r\n API.graphql(\r\n graphqlOperation(UPDATE_SHOP_PROP, {\r\n id: shop.id,\r\n input\r\n }, authToken)\r\n ).then(() => {\r\n shopSetItem(key, value);\r\n })\r\n } else {\r\n data[key] = value\r\n }\r\n }\r\n }\r\n}","var _defs, _title, _rect, _g, _rect2, _rect3, _path, _rect4, _path2, _rect5, _g2, _rect6, _rect7, _path3, _rect8, _path4, _g3, _g4, _path5, _path6, _path7, _circle, _circle2, _circle3, _circle4, _circle5;\n\nvar _excluded = [\"svgRef\", \"title\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from \"react\";\n\nvar SvgNoData = function SvgNoData(_ref) {\n var svgRef = _ref.svgRef,\n title = _ref.title,\n props = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"f20e0c25-d928-42cc-98d1-13cc230663ea\",\n \"data-name\": \"Layer 1\",\n width: 820.16,\n height: 780.81,\n viewBox: \"0 0 820.16 780.81\",\n ref: svgRef\n }, props), _defs || (_defs = /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"07332201-7176-49c2-9908-6dc4a39c4716\",\n x1: 539.63,\n y1: 734.6,\n x2: 539.63,\n y2: 151.19,\n gradientTransform: \"translate(-3.62 1.57)\",\n gradientUnits: \"userSpaceOnUse\"\n }, /*#__PURE__*/React.createElement(\"stop\", {\n offset: 0,\n stopColor: \"gray\",\n stopOpacity: 0.25\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 0.54,\n stopColor: \"gray\",\n stopOpacity: 0.12\n }), /*#__PURE__*/React.createElement(\"stop\", {\n offset: 1,\n stopColor: \"gray\",\n stopOpacity: 0.1\n })), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"0ee1ab3f-7ba2-4205-9d4a-9606ad702253\",\n x1: 540.17,\n y1: 180.2,\n x2: 540.17,\n y2: 130.75,\n gradientTransform: \"translate(-63.92 7.85)\",\n xlinkHref: \"#07332201-7176-49c2-9908-6dc4a39c4716\"\n }), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"abca9755-bed1-4a97-b027-7f02ee3ffa09\",\n x1: 540.17,\n y1: 140.86,\n x2: 540.17,\n y2: 82.43,\n gradientTransform: \"translate(-84.51 124.6) rotate(-12.11)\",\n xlinkHref: \"#07332201-7176-49c2-9908-6dc4a39c4716\"\n }), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"2632d424-e666-4ee4-9508-a494957e14ab\",\n x1: 476.4,\n y1: 710.53,\n x2: 476.4,\n y2: 127.12,\n gradientTransform: \"matrix(1, 0, 0, 1, 0, 0)\",\n xlinkHref: \"#07332201-7176-49c2-9908-6dc4a39c4716\"\n }), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"97571ef7-1c83-4e06-b701-c2e47e77dca3\",\n x1: 476.94,\n y1: 156.13,\n x2: 476.94,\n y2: 106.68,\n gradientTransform: \"matrix(1, 0, 0, 1, 0, 0)\",\n xlinkHref: \"#07332201-7176-49c2-9908-6dc4a39c4716\"\n }), /*#__PURE__*/React.createElement(\"linearGradient\", {\n id: \"7d32e13e-a0c7-49c4-af0e-066a2f8cb76e\",\n x1: 666.86,\n y1: 176.39,\n x2: 666.86,\n y2: 117.95,\n gradientTransform: \"matrix(1, 0, 0, 1, 0, 0)\",\n xlinkHref: \"#07332201-7176-49c2-9908-6dc4a39c4716\"\n }))), title === undefined ? _title || (_title = /*#__PURE__*/React.createElement(\"title\", null, \"no data\")) : title ? /*#__PURE__*/React.createElement(\"title\", null, title) : null, _rect || (_rect = /*#__PURE__*/React.createElement(\"rect\", {\n x: 317.5,\n y: 142.55,\n width: 437.02,\n height: 603.82,\n transform: \"translate(-271.22 62.72) rotate(-12.11)\",\n fill: \"#e0e0e0\"\n })), _g || (_g = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.5\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: 324.89,\n y: 152.76,\n width: 422.25,\n height: 583.41,\n transform: \"translate(-271.22 62.72) rotate(-12.11)\",\n fill: \"url(#07332201-7176-49c2-9908-6dc4a39c4716)\"\n }))), _rect2 || (_rect2 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 329.81,\n y: 157.1,\n width: 411.5,\n height: 570.52,\n transform: \"translate(-270.79 62.58) rotate(-12.11)\",\n fill: \"#fafafa\"\n })), _rect3 || (_rect3 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 374.18,\n y: 138.6,\n width: 204.14,\n height: 49.45,\n transform: \"translate(-213.58 43.93) rotate(-12.11)\",\n fill: \"url(#0ee1ab3f-7ba2-4205-9d4a-9606ad702253)\"\n })), _path || (_path = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M460.93,91.9c-15.41,3.31-25.16,18.78-21.77,34.55s18.62,25.89,34,22.58,25.16-18.78,21.77-34.55S476.34,88.59,460.93,91.9ZM470.6,137A16.86,16.86,0,1,1,483.16,117,16.66,16.66,0,0,1,470.6,137Z\",\n transform: \"translate(-189.92 -59.59)\",\n fill: \"url(#abca9755-bed1-4a97-b027-7f02ee3ffa09)\"\n })), _rect4 || (_rect4 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 375.66,\n y: 136.55,\n width: 199.84,\n height: 47.27,\n transform: \"translate(-212.94 43.72) rotate(-12.11)\",\n fill: \"#2f80ed\"\n })), _path2 || (_path2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M460.93,91.9a27.93,27.93,0,1,0,33.17,21.45A27.93,27.93,0,0,0,460.93,91.9ZM470.17,135a16.12,16.12,0,1,1,12.38-19.14A16.12,16.12,0,0,1,470.17,135Z\",\n transform: \"translate(-189.92 -59.59)\",\n fill: \"#2f80ed\"\n })), _rect5 || (_rect5 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 257.89,\n y: 116.91,\n width: 437.02,\n height: 603.82,\n fill: \"#e0e0e0\"\n })), _g2 || (_g2 = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.5\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: 265.28,\n y: 127.12,\n width: 422.25,\n height: 583.41,\n fill: \"url(#2632d424-e666-4ee4-9508-a494957e14ab)\"\n }))), _rect6 || (_rect6 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 270.65,\n y: 131.42,\n width: 411.5,\n height: 570.52,\n fill: \"#fff\"\n })), _rect7 || (_rect7 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 374.87,\n y: 106.68,\n width: 204.14,\n height: 49.45,\n fill: \"url(#97571ef7-1c83-4e06-b701-c2e47e77dca3)\"\n })), _path3 || (_path3 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M666.86,118c-15.76,0-28.54,13.08-28.54,29.22s12.78,29.22,28.54,29.22,28.54-13.08,28.54-29.22S682.62,118,666.86,118Zm0,46.08a16.86,16.86,0,1,1,16.46-16.86A16.66,16.66,0,0,1,666.86,164Z\",\n transform: \"translate(-189.92 -59.59)\",\n fill: \"url(#7d32e13e-a0c7-49c4-af0e-066a2f8cb76e)\"\n })), _rect8 || (_rect8 = /*#__PURE__*/React.createElement(\"rect\", {\n x: 377.02,\n y: 104.56,\n width: 199.84,\n height: 47.27,\n fill: \"#2f80ed\"\n })), _path4 || (_path4 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M666.86,118a27.93,27.93,0,1,0,27.93,27.93A27.93,27.93,0,0,0,666.86,118Zm0,44.05A16.12,16.12,0,1,1,683,145.89,16.12,16.12,0,0,1,666.86,162Z\",\n transform: \"translate(-189.92 -59.59)\",\n fill: \"#2f80ed\"\n })), _g3 || (_g3 = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.5\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: 15.27,\n y: 737.05,\n width: 3.76,\n height: 21.33,\n fill: \"#47e6b1\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 205.19,\n y: 796.65,\n width: 3.76,\n height: 21.33,\n transform: \"translate(824.47 540.65) rotate(90)\",\n fill: \"#47e6b1\"\n }))), _g4 || (_g4 = /*#__PURE__*/React.createElement(\"g\", {\n opacity: 0.5\n }, /*#__PURE__*/React.createElement(\"rect\", {\n x: 451.49,\n width: 3.76,\n height: 21.33,\n fill: \"#47e6b1\"\n }), /*#__PURE__*/React.createElement(\"rect\", {\n x: 641.4,\n y: 59.59,\n width: 3.76,\n height: 21.33,\n transform: \"translate(523.63 -632.62) rotate(90)\",\n fill: \"#47e6b1\"\n }))), _path5 || (_path5 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M961,832.15a4.61,4.61,0,0,1-2.57-5.57,2.22,2.22,0,0,0,.1-.51h0a2.31,2.31,0,0,0-4.15-1.53h0a2.22,2.22,0,0,0-.26.45,4.61,4.61,0,0,1-5.57,2.57,2.22,2.22,0,0,0-.51-.1h0a2.31,2.31,0,0,0-1.53,4.15h0a2.22,2.22,0,0,0,.45.26,4.61,4.61,0,0,1,2.57,5.57,2.22,2.22,0,0,0-.1.51h0a2.31,2.31,0,0,0,4.15,1.53h0a2.22,2.22,0,0,0,.26-.45,4.61,4.61,0,0,1,5.57-2.57,2.22,2.22,0,0,0,.51.1h0a2.31,2.31,0,0,0,1.53-4.15h0A2.22,2.22,0,0,0,961,832.15Z\",\n transform: \"translate(-189.92 -59.59)\",\n fill: \"#4d8af0\",\n opacity: 0.5\n })), _path6 || (_path6 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M326.59,627.09a4.61,4.61,0,0,1-2.57-5.57,2.22,2.22,0,0,0,.1-.51h0a2.31,2.31,0,0,0-4.15-1.53h0a2.22,2.22,0,0,0-.26.45,4.61,4.61,0,0,1-5.57,2.57,2.22,2.22,0,0,0-.51-.1h0a2.31,2.31,0,0,0-1.53,4.15h0a2.22,2.22,0,0,0,.45.26,4.61,4.61,0,0,1,2.57,5.57,2.22,2.22,0,0,0-.1.51h0a2.31,2.31,0,0,0,4.15,1.53h0a2.22,2.22,0,0,0,.26-.45A4.61,4.61,0,0,1,325,631.4a2.22,2.22,0,0,0,.51.1h0a2.31,2.31,0,0,0,1.53-4.15h0A2.22,2.22,0,0,0,326.59,627.09Z\",\n transform: \"translate(-189.92 -59.59)\",\n fill: \"#fdd835\",\n opacity: 0.5\n })), _path7 || (_path7 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M855,127.77a4.61,4.61,0,0,1-2.57-5.57,2.22,2.22,0,0,0,.1-.51h0a2.31,2.31,0,0,0-4.15-1.53h0a2.22,2.22,0,0,0-.26.45,4.61,4.61,0,0,1-5.57,2.57,2.22,2.22,0,0,0-.51-.1h0a2.31,2.31,0,0,0-1.53,4.15h0a2.22,2.22,0,0,0,.45.26,4.61,4.61,0,0,1,2.57,5.57,2.22,2.22,0,0,0-.1.51h0a2.31,2.31,0,0,0,4.15,1.53h0a2.22,2.22,0,0,0,.26-.45,4.61,4.61,0,0,1,5.57-2.57,2.22,2.22,0,0,0,.51.1h0a2.31,2.31,0,0,0,1.53-4.15h0A2.22,2.22,0,0,0,855,127.77Z\",\n transform: \"translate(-189.92 -59.59)\",\n fill: \"#fdd835\",\n opacity: 0.5\n })), _circle || (_circle = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 812.64,\n cy: 314.47,\n r: 7.53,\n fill: \"#f55f44\",\n opacity: 0.5\n })), _circle2 || (_circle2 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 230.73,\n cy: 746.65,\n r: 7.53,\n fill: \"#f55f44\",\n opacity: 0.5\n })), _circle3 || (_circle3 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 735.31,\n cy: 477.23,\n r: 7.53,\n fill: \"#f55f44\",\n opacity: 0.5\n })), _circle4 || (_circle4 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 87.14,\n cy: 96.35,\n r: 7.53,\n fill: \"#4d8af0\",\n opacity: 0.5\n })), _circle5 || (_circle5 = /*#__PURE__*/React.createElement(\"circle\", {\n cx: 7.53,\n cy: 301.76,\n r: 7.53,\n fill: \"#47e6b1\",\n opacity: 0.5\n })));\n};\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(SvgNoData, _extends({\n svgRef: ref\n }, props));\n});\nexport default __webpack_public_path__ + \"static/media/no_data.caf56327.svg\";\nexport { ForwardRef as ReactComponent };","import React, { useState, useEffect, useReducer } from \"react\";\r\nimport { Auth } from \"aws-amplify\";\r\nimport { Spinner } from \"components\";\r\nimport UserContext, { UserProvider } from \"context/UserContext\";\r\nimport { ShopProvider } from \"context/ShopContext\";\r\nimport { withRouter } from \"react-router-dom\";\r\nimport { parseQueryString } from \"lib/query-string\";\r\nimport useShop from \"hooks/useShop\";\r\nimport { SetItemReducer, SET_ITEM, SET_ALL } from \"reducers/SetItemReducer\";\r\nimport { GET_SHOP_SETTINGS } from \"Queries\";\r\nimport { SHOP_DEFAULT_SETTINGS } from \"lib/globals\";\r\nimport {\r\n SCOPE,\r\n SHOPIFY_API_KEY,\r\n SHOPIFY_EMBEDDED_FORCE_REDIRECT,\r\n} from \"aws-exports\";\r\nimport AppLocalStorage from \"lib/AppLocalStorage\";\r\nimport { createApp } from \"@shopify/app-bridge\";\r\nimport { getScriptStatus } from \"./cart/Utils\";\r\n\r\nconst Authenticator = ({ children, location }) => {\r\n return <WithShopProvider shopName={window.shop}>{children}</WithShopProvider>;\r\n};\r\n\r\nexport default withRouter(Authenticator);\r\n\r\nconst WithShopProvider = ({ children, shopName }) => {\r\n const [validationErrors, setValidationErrors] = useState({});\r\n const [state, dispatch] = useReducer(SetItemReducer, {});\r\n const params = new URLSearchParams(window.location.search);\r\n const { data, error, loading } = useShop(\r\n shopName,\r\n GET_SHOP_SETTINGS,\r\n {},\r\n \"cache-first\"\r\n );\r\n const setItem = (path, value) => dispatch({ type: SET_ITEM, path, value });\r\n const discard = () => {\r\n if (data && data?.shop) {\r\n const { shop } = data;\r\n dispatch({\r\n type: SET_ITEM,\r\n path: \"settings\",\r\n value: shop.settings || SHOP_DEFAULT_SETTINGS(),\r\n });\r\n }\r\n };\r\n\r\n const [cartActive, setCartActive] = useState(false);\r\n const [cartLoading, setCartLoading] = useState(true);\r\n\r\n // const hasRecharge = async (shop_url: string) => {\r\n // const { data } = await Axios.get(\r\n // `https://static.rechargecdn.com/store/${shop_url}/product/2020-12/products.json`\r\n // );\r\n // return !!data?.widget_settings;\r\n // };\r\n\r\n useEffect(() => {\r\n async function checkScope(shop) {\r\n // console.log(\"#################\")\r\n // console.log(shop.scope)\r\n // console.log(SCOPE)\r\n // console.log(shop.version)\r\n // console.log(\"#################\")\r\n if (shop.scope !== SCOPE || !shop.version || shop.version !== \"1.0.3\") {\r\n // await logOutUser(shop);\r\n }\r\n }\r\n if (data && data?.shop) {\r\n const { shop } = data;\r\n checkScope(shop);\r\n const default_settings = SHOP_DEFAULT_SETTINGS(\r\n state.settings ? state.settings.default_language : \"english\"\r\n );\r\n\r\n const shop_settings = shop.settings;\r\n\r\n if (\r\n shop_settings &&\r\n !shop_settings.modules.checkout_button.coupon_alert_text\r\n ) {\r\n shop_settings[\"modules\"][\"checkout_button\"][\"coupon_alert_text\"] =\r\n default_settings[\"modules\"][\"checkout_button\"][\"coupon_alert_text\"];\r\n }\r\n // if (shop_settings && !shop_settings.modules.order_note) {\r\n // shop_settings[\"modules\"][\"order_note\"] = {\r\n // active: false,\r\n // ...default_settings[\"modules\"][\"order_note\"]\r\n // };\r\n // }\r\n // if (\r\n // shop_settings &&\r\n // shop_settings[\"modules\"][\"order\"].indexOf(\"order_note\") === -1\r\n // ) {\r\n // shop_settings[\"modules\"][\"order\"].push(\"order_note\");\r\n // }\r\n if (shop_settings && !shop_settings[\"cod_settings\"]) {\r\n shop_settings[\"cod_settings\"] = default_settings.cod_settings;\r\n }\r\n if (shop_settings && !shop_settings[\"subscription\"]) {\r\n shop_settings[\"subscription\"] = default_settings.subscription;\r\n } else if (\r\n shop_settings &&\r\n shop_settings[\"subscription\"] &&\r\n !shop_settings[\"subscription\"].upgradingText\r\n ) {\r\n shop_settings[\"subscription\"] = {\r\n ...shop_settings[\"subscription\"],\r\n downgradingText: default_settings.subscription.downgradingText,\r\n upgradingText: default_settings.subscription.upgradingText,\r\n loadingBackground: default_settings.subscription.loadingBackground,\r\n loadingBorder: default_settings.subscription.loadingBorder,\r\n subscribedText: default_settings.subscription.subscribedText,\r\n subscribedBackground: default_settings.subscription.subscribedBackground,\r\n subscribedBorder: default_settings.subscription.subscribedBorder,\r\n };\r\n }\r\n if (shop_settings && !shop_settings.hasOwnProperty(\"open_cart\")) {\r\n shop_settings[\"open_cart\"] = true;\r\n }\r\n if (shop_settings && !shop_settings.hasOwnProperty(\"show_coupon\")) {\r\n shop_settings[\"show_coupon\"] = true;\r\n }\r\n if (\r\n shop_settings &&\r\n !shop_settings.hasOwnProperty(\"show_coupon_alert_text\")\r\n ) {\r\n shop_settings[\"show_coupon_alert_text\"] = true;\r\n }\r\n if (shop_settings && !shop_settings[\"sticky_cart\"]) {\r\n shop_settings[\"sticky_cart\"] = default_settings.sticky_cart;\r\n }\r\n if (shop_settings && !shop_settings[\"scary\"]) {\r\n shop_settings[\"scary\"] = default_settings.scary;\r\n }\r\n if (\r\n shop_settings &&\r\n !shop_settings[\"modules\"][\"checkout_button\"][\"continue_shopping_button\"]\r\n ) {\r\n shop_settings[\"modules\"][\"checkout_button\"][\r\n \"continue_shopping_button\"\r\n ] = default_settings.modules.checkout_button.continue_shopping_button;\r\n shop_settings[\"modules\"][\"checkout_button\"][\r\n \"active_continue_shopping_button\"\r\n ] =\r\n default_settings.modules.checkout_button.active_continue_shopping_button;\r\n shop_settings[\"modules\"][\"checkout_button\"][\r\n \"active_continue_shopping_underlined\"\r\n ] =\r\n default_settings.modules.checkout_button.active_continue_shopping_underlined;\r\n }\r\n if (shop_settings && !shop_settings[\"checkout_condition_text\"]) {\r\n shop_settings[\"checkout_condition_text\"] =\r\n default_settings.checkout_condition_text;\r\n shop_settings[\"checkout_condition_color\"] =\r\n default_settings.checkout_condition_color;\r\n shop_settings[\"is_checkout_condition_active\"] = false;\r\n }\r\n if (shop_settings && !shop_settings[\"continue_shopping_button\"]) {\r\n shop_settings[\"continue_shopping_button\"] =\r\n default_settings.continue_shopping_button;\r\n shop_settings[\"active_continue_shopping_button\"] =\r\n default_settings.active_continue_shopping_button;\r\n shop_settings[\"active_continue_shopping_underlined\"] =\r\n default_settings.active_continue_shopping_underlined;\r\n }\r\n\r\n if (shop_settings && !shop_settings.sticky_cart[\"desktop_quantity\"]) {\r\n shop_settings.sticky_cart.desktop_quantity =\r\n default_settings.sticky_cart.desktop_quantity;\r\n shop_settings.sticky_cart.mobile_quantity =\r\n default_settings.sticky_cart.mobile_quantity;\r\n shop_settings.sticky_cart.cart_name =\r\n default_settings.sticky_cart.cart_name;\r\n }\r\n if (shop_settings && !shop_settings.badges) {\r\n shop_settings.badges = default_settings.badges;\r\n shop_settings.badges.isActive = false;\r\n }\r\n if (shop_settings && !shop_settings.announcement) {\r\n shop_settings.announcement = default_settings.announcement;\r\n shop_settings.announcement.isActive = false;\r\n }\r\n if (shop_settings && !shop_settings.afterPay) {\r\n shop_settings.afterPay = default_settings.afterPay;\r\n }\r\n if (shop_settings && !shop_settings.auto_discount) {\r\n shop_settings.auto_discount = {\r\n text: {\r\n ...default_settings.scary.text,\r\n font_size: 0.9,\r\n font_weight: 400,\r\n text: \"{{title}}\",\r\n },\r\n background: default_settings.scary.background,\r\n border: default_settings.scary.border,\r\n };\r\n }\r\n dispatch({\r\n type: SET_ALL,\r\n value: {\r\n ...shop,\r\n settings: shop_settings || default_settings,\r\n // settings: default_settings,\r\n // show_recharge_alert,\r\n original_settings: shop.settings || {},\r\n settingsSaved: !!shop.settings ? true : false, //TODO: this will be deprecated\r\n redirectToChargeApproval: !shop.chargeAccepted,\r\n },\r\n });\r\n }\r\n }, [data]);\r\n\r\n useEffect(() => {\r\n if (!data?.shop?.id && !window.location.origin) return;\r\n async function checkStatus() {\r\n // setCartLoading(true);\r\n await getScriptStatus(\r\n data?.shop.id,\r\n window.location.origin,\r\n (status, error) => {\r\n if (!error) {\r\n setCartActive(status);\r\n }\r\n setCartLoading(false);\r\n }\r\n );\r\n }\r\n checkStatus();\r\n\r\n const intervalId = setInterval(checkStatus, 6000);\r\n\r\n return () => clearInterval(intervalId);\r\n }, [data]);\r\n\r\n if (error) {\r\n console.log(error);\r\n throw new Error(error);\r\n }\r\n if (loading || !Object.keys(state).length)\r\n return <Spinner text=\"Fetching shop data\" />;\r\n else if (data) {\r\n const config = {\r\n apiKey: SHOPIFY_API_KEY,\r\n shopOrigin: state.id,\r\n forceRedirect: SHOPIFY_EMBEDDED_FORCE_REDIRECT,\r\n host: params.get(\"host\") || btoa(state.id),\r\n };\r\n const app = createApp(config);\r\n return (\r\n <ShopProvider\r\n value={{\r\n state,\r\n setItem,\r\n dispatch,\r\n discard,\r\n validationErrors,\r\n setValidationErrors,\r\n AppLocalStorage: AppLocalStorage(state, setItem, app),\r\n setup: {\r\n cartActive,\r\n cartLoading,\r\n setCartLoading,\r\n },\r\n }}\r\n >\r\n <UserProvider\r\n value={{\r\n attributes: {\r\n website: data?.shop.id,\r\n sub: data?.shop.userId,\r\n },\r\n }}\r\n >\r\n {children}\r\n </UserProvider>\r\n </ShopProvider>\r\n );\r\n }\r\n};\r\n","import { useQuery } from \"@apollo/react-hooks\";\r\n\r\nexport default function useShop(\r\n user,\r\n query,\r\n variables = {},\r\n fetchPolicy = \"no-cache\"\r\n) {\r\n let userId =\r\n typeof user === \"string\" &&\r\n user.match(/[a-z0-9][a-z0-9\\-]*\\.myshopify\\.com/i)\r\n ? user\r\n : user.attributes.website;\r\n let { data, loading, error, fetchMore } = useQuery(query, {\r\n variables: { userId, ...variables },\r\n fetchPolicy\r\n });\r\n return { data, loading, error, fetchMore };\r\n}\r\n","import React, { useContext, useEffect, useState } from \"react\";\r\nimport { getApolloContext } from \"@apollo/react-hooks\";\r\nimport AWSAppSyncClient from \"aws-appsync\";\r\nimport { Spinner } from \"components\";\r\n\r\nconst Rehydrated = ({ children }) => {\r\n const { client } = useContext(getApolloContext());\r\n const [rehydrated, setState] = useState(false);\r\n\r\n useEffect(() => {\r\n if (client instanceof AWSAppSyncClient) {\r\n (async () => {\r\n await client.hydrated();\r\n setState(true);\r\n })();\r\n }\r\n }, [client]);\r\n return rehydrated ? <>{children}</> : <Spinner />;\r\n};\r\n\r\nexport default Rehydrated;\r\n","import React from 'react';\r\nimport styles from 'styles/empty_state.module.scss';\r\nimport Button from 'components/Button';\r\nimport useReactRouter from 'use-react-router';\r\n\r\nconst EmptyState = ({ heading, children, Illustration, action = false, secondaryAction = false, background }) => {\r\n\tconst { history, location } = useReactRouter();\r\n\treturn (\r\n\t\t<div className={styles.EmptyState} style={{ background }}>\r\n\t\t\t<Illustration className={styles.illustration} />\r\n\t\t\t<div className={styles.details}>\r\n\t\t\t\t<h2>{heading}</h2>\r\n\t\t\t\t{children}\r\n\t\t\t\t{action && <Button {...action} onClick={() => history.push(action.url + location.search)} />}\r\n\t\t\t\t{secondaryAction && (\r\n\t\t\t\t\t<Button {...secondaryAction} onClick={() => history.push(action.url + location.search)} />\r\n\t\t\t\t)}\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default EmptyState;\r\n","import React from 'react';\r\nimport { Switch, Button, ActionsButtons } from 'components';\r\nimport styles from 'styles/items_list.module.scss';\r\nimport get from 'lodash/get';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst Item = (props) => {\r\n\tconst { item, actions, header } = props;\r\n\treturn (\r\n\t\t<tr className={styles.item}>\r\n\t\t\t{header.map((cell) => {\r\n\t\t\t\tswitch (cell.title) {\r\n\t\t\t\t\tcase 'Active':\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<td key={`Status-${item.id}`}>\r\n\t\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t\t<Switch value={item.active} onChange={(status) => cell.onChange(item, status)} />\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\tcase 'Created At':\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<td key={`${cell.title}-${item.id}`}>\r\n\t\t\t\t\t\t\t\t<div className={classNames('flex-center')}>\r\n\t\t\t\t\t\t\t\t\t{new Date(parseInt(item[cell.value])).toDateString()}\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\tcase 'Updated At':\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<td key={`${cell.title}-${item.id}`}>\r\n\t\t\t\t\t\t\t\t<div className={classNames('flex-center')}>\r\n\t\t\t\t\t\t\t\t\t{new Date(parseInt(item[cell.value])).toDateString()}\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\tcase 'Actions':\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<td key={`${cell.title}-${item.id}`}>\r\n\t\t\t\t\t\t\t\t<div className={classNames('flex-center')}>\r\n\t\t\t\t\t\t\t\t\t<ActionsButtons {...{ item, actions }} />\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<td key={`${cell.title}-${item.id}`}>\r\n\t\t\t\t\t\t\t\t<div>{getValue(item, cell)}</div>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t})}\r\n\t\t</tr>\r\n\t);\r\n};\r\n\r\nconst getValue = (item, cell) => {\r\n\tif (cell.value instanceof Function) return cell.value(item);\r\n\treturn get(item, cell.value || cell.title.toLowerCase());\r\n};\r\n\r\nexport default Item;\r\n","import React from 'react';\r\nimport styles from 'styles/items_list.module.scss';\r\nimport Item from './ItemsList_item';\r\nimport { EmptyState } from 'components';\r\nimport { ReactComponent as NoData } from 'svgs/no_data.svg';\r\n\r\nconst ItemsList = ({ items, header, actions, emptyState }) => {\r\n\tif (!items.length)\r\n\t\treturn (\r\n\t\t\t<EmptyState heading=\"No Data\" Illustration={NoData} action={emptyState.action} noIcon>\r\n\t\t\t\t<p>{emptyState.text}</p>\r\n\t\t\t</EmptyState>\r\n\t\t);\r\n\treturn (\r\n\t\t<table cellSpacing=\"0\" cellPadding=\"0\">\r\n\t\t\t<thead className={styles.header}>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t{header.map(item => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<th\r\n\t\t\t\t\t\t\t\tkey={item.title}\r\n\t\t\t\t\t\t\t\tclassName={item.title}\r\n\t\t\t\t\t\t\t\t// style={{\r\n\t\t\t\t\t\t\t\t// \tdisplay: item.title === 'Actions' ? 'none' : null,\r\n\t\t\t\t\t\t\t\t// }}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{item.title}\r\n\t\t\t\t\t\t\t</th>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t</tr>\r\n\t\t\t</thead>\r\n\t\t\t<tbody>\r\n\t\t\t\t{items.map((item, index) => (\r\n\t\t\t\t\t<Item header={header} index={index} actions={actions} item={item} key={`item-${item.id}`} />\r\n\t\t\t\t))}\r\n\t\t\t</tbody>\r\n\t\t</table>\r\n\t);\r\n};\r\n\r\nexport default ItemsList;\r\n","import React, { Fragment, useState, useEffect, useContext } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport styles from 'styles/carousel.module.scss';\r\nimport { Button } from 'components';\r\nimport useReactRouter from 'use-react-router';\r\nimport EmbeddedContext from 'context/EmbeddedContext';\r\nimport { History } from '@shopify/app-bridge/actions';\r\n\r\nconst Carousel = ({\r\n\tactive = null,\r\n\tcontents,\r\n\tcontrols,\r\n\tcontrolsPosition = 'both',\r\n\tonChange = null,\r\n\ttype = 'carousel',\r\n}) => {\r\n\tconst { location } = useReactRouter();\r\n\tlet params = new URLSearchParams(location.search);\r\n\tconst { AppBridgeHistory } = useContext(EmbeddedContext);\r\n\tconst ACTIVE_IS_NOT_SET = active === null;\r\n\tconst [activeTab, setActiveTab] = useState(ACTIVE_IS_NOT_SET ? parseInt(params.get('activeTab')) || 0 : active);\r\n\tconst bindedSetActiveTab = (tab) => {\r\n\t\tif (onChange) onChange(tab);\r\n\t\tsetActiveTab(tab);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (ACTIVE_IS_NOT_SET)\r\n\t\t\tAppBridgeHistory.dispatch(History.Action.REPLACE, `${location.pathname}?activeTab=${activeTab}`);\r\n\t}, [activeTab]);\r\n\r\n\treturn (\r\n\t\t<div className={styles.carousel}>\r\n\t\t\t{['top', 'both'].includes(controlsPosition) && (\r\n\t\t\t\t<Fragment>\r\n\t\t\t\t\t{type === 'carousel' ? (\r\n\t\t\t\t\t\t<CarouselControls {...{ controls, activeTab, setActiveTab }} />\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<StepperControls {...{ controls, activeTab, setActiveTab }} />\r\n\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t<hr />\r\n\t\t\t\t</Fragment>\r\n\t\t\t)}\r\n\t\t\t<div className={styles.content}>\r\n\t\t\t\t{contents.map((content, index) => {\r\n\t\t\t\t\tlet isFunction = typeof content === 'function';\r\n\t\t\t\t\treturn index === activeTab ? (\r\n\t\t\t\t\t\t<Fragment key={`content-${index}`}>\r\n\t\t\t\t\t\t\t{isFunction ? content(bindedSetActiveTab) : content}\r\n\t\t\t\t\t\t</Fragment>\r\n\t\t\t\t\t) : null;\r\n\t\t\t\t})}\r\n\t\t\t</div>\r\n\t\t\t{['bottom', 'both'].includes(controlsPosition) && (\r\n\t\t\t\t<Fragment>\r\n\t\t\t\t\t<hr />\r\n\t\t\t\t\t<CarouselControls {...{ controls, activeTab, setActiveTab }} />\r\n\t\t\t\t</Fragment>\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nconst CarouselControls = ({ controls, activeTab, setActiveTab }) => {\r\n\treturn (\r\n\t\t<div className={styles.control}>\r\n\t\t\t{controls.map(\r\n\t\t\t\t(control, index) =>\r\n\t\t\t\t\tcontrol.current === activeTab && (\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t// loading={true}\r\n\t\t\t\t\t\t\tkey={`control-${index}`}\r\n\t\t\t\t\t\t\t{...control}\r\n\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\tif (typeof control.next === 'function') control.next(setActiveTab);\r\n\t\t\t\t\t\t\t\telse if (Number.isInteger(control.next)) setActiveTab(control.next);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t)\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nconst StepperControls = ({ controls, activeTab, setActiveTab }) => {\r\n\treturn (\r\n\t\t<div className={styles.stepperControls}>\r\n\t\t\t{controls.map((control, index) => (\r\n\t\t\t\t<div\r\n\t\t\t\t\tclassName={`${control.current === activeTab ? styles.active : ''}`}\r\n\t\t\t\t\tkey={`control-${index}`}\r\n\t\t\t\t\t{...control}\r\n\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\tif (typeof control.next === 'function') control.next(setActiveTab);\r\n\t\t\t\t\t\telse if (Number.isInteger(control.next)) setActiveTab(control.next);\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t{control.text}\r\n\t\t\t\t</div>\r\n\t\t\t))}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nCarousel.propTypes = {\r\n\tcontents: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.element, PropTypes.func])).isRequired,\r\n\tcontrols: PropTypes.arrayOf(\r\n\t\tPropTypes.shape({\r\n\t\t\ttext: PropTypes.string.isRequired,\r\n\t\t\tcurrent: PropTypes.number.isRequired,\r\n\t\t})\r\n\t).isRequired,\r\n};\r\nexport default Carousel;\r\n","import React, { useState, useRef, useEffect, useContext } from 'react';\r\nimport propTypes from 'prop-types';\r\nimport md5 from 'crypto-js/md5';\r\nimport cssStyles from 'styles/form_group.module.scss';\r\nimport { Button, Switch, Icon } from 'components';\r\nimport PageScrollContext from 'context/PageScrollContext';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst FormGroup = ({\r\n label,\r\n children,\r\n className = '',\r\n onFocus,\r\n onBlur,\r\n info,\r\n minWidth = 410,\r\n focusCondition = () => false,\r\n styles = { content: {}, title: {} },\r\n noBorderBottom,\r\n collapsable = false,\r\n isOpen = true,\r\n fullWidth = false,\r\n withSwitch = false,\r\n beta = false\r\n}) => {\r\n const group = useRef(null);\r\n const groupContent = useRef(null);\r\n const { scrollTop, getScrollTop } = useContext(PageScrollContext) || {};\r\n const [collapsed, setCollapsed] = useState(isOpen);\r\n const [maxHeight, setMaxHeight] = useState(0);\r\n\r\n const handleClick = container => event => {\r\n const focusWithIn =\r\n container === document.activeElement ||\r\n container.contains(document.activeElement) ||\r\n focusCondition({\r\n activeElement: document.activeElement,\r\n event,\r\n container\r\n }) ||\r\n !![...container.querySelectorAll('.sketch-picker')].find(picker =>\r\n picker.contains(event.target)\r\n );\r\n if (focusWithIn && onFocus) onFocus();\r\n else if (!focusWithIn && onBlur) onBlur();\r\n };\r\n\r\n useEffect(\r\n () => {\r\n if (onFocus || onBlur) {\r\n document.addEventListener('mouseup', handleClick(group.current));\r\n }\r\n return () => {\r\n if (onFocus || onBlur) {\r\n document.removeEventListener('mouseup', handleClick(group.current));\r\n }\r\n };\r\n },\r\n [group.current, onFocus, onBlur]\r\n );\r\n\r\n useEffect(\r\n () => {\r\n if (groupContent.current) {\r\n setMaxHeight(groupContent.current.offsetHeight);\r\n }\r\n },\r\n [collapsed]\r\n );\r\n\r\n return (\r\n <div\r\n className={classNames(\r\n `flex flex-wrap sm:flex-col md:flex-col lg:flex-row border-gray-300 border-b ${\r\n collapsable ? \"\" : \"pt-6 pb-6\"\r\n } group-wrapper`\r\n )}\r\n >\r\n <div\r\n className={classNames(\r\n `${\r\n collapsable\r\n ? \"w-full flex-grow pt-6 pb-6\"\r\n : `${\r\n fullWidth\r\n ? \"w-full\"\r\n : \"flex-grow sm:w-full md:w-full lg:w-1/3\"\r\n } pb-3`\r\n } group-left-side flex flex-row pr-2 justify-between items-start cursor-pointer`\r\n )}\r\n style={{ ...styles.title, transition: \"margin 0.4s ease\" }}\r\n onClick={() => {\r\n setCollapsed(!collapsed);\r\n }}\r\n >\r\n <div className={classNames(\"flex-col\")}>\r\n <label\r\n className={classNames(\r\n `${\r\n collapsable\r\n ? \"text-lg text-gray-700\"\r\n : \"text-base text-gray-800\"\r\n } mb-2 font-bold capitalize relative group-label cursor-pointer`\r\n )}\r\n onClick={(e) => {\r\n if (!scrollTop) return;\r\n const padding =\r\n 1.5 *\r\n parseFloat(\r\n getComputedStyle(document.documentElement).fontSize\r\n );\r\n scrollTop(e.target.closest(\".mu-group-wrapper\").offsetTop - 0);\r\n }}\r\n id={`id_${md5(label)}`}\r\n >\r\n <Icon\r\n icon=\"hashtag\"\r\n style={{\r\n maxHeight: 27,\r\n }}\r\n className=\"absolute top-0 left-0 transform -translate-x-full text-gray-500 h-full pr-1 group-label-icon hidden\"\r\n />\r\n {label}\r\n </label>\r\n {!!info && (\r\n <p\r\n className={classNames(\"text-gray-500 text-xs italic\")}\r\n dangerouslySetInnerHTML={{\r\n __html: info.replace(\"\\n\", \"<br/>\"),\r\n }}\r\n />\r\n )}\r\n </div>\r\n\r\n <div className={classNames(\"flex flex-wrap\")}>\r\n {beta && (\r\n <span\r\n className={classNames(\r\n \"flex-center bg-orange-500 tracking-wider py-1 px-2 rounded-lg text-white text-xxs font-bold\",\r\n {\r\n \"mr-2\": withSwitch,\r\n }\r\n )}\r\n style={{ top: -2, right: -2 }}\r\n >\r\n Beta\r\n </span>\r\n )}\r\n {!!withSwitch && !collapsable && (\r\n <Switch BindToContext={withSwitch} />\r\n )}\r\n </div>\r\n {collapsable && (\r\n <div className={classNames(\"pt-2\")}>\r\n <svg\r\n className={classNames(\"w-4 h-3\")}\r\n viewBox=\"0 0 14 8\"\r\n fill=\"none\"\r\n style={{\r\n transform: collapsed ? \"rotate(180deg)\" : \"rotate(0deg)\",\r\n transition: \"transform 0.4s ease\",\r\n }}\r\n >\r\n <path\r\n d=\"M1 1L7 7L13 1\"\r\n stroke=\"#718096\"\r\n strokeWidth=\"3\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n </svg>\r\n </div>\r\n )}\r\n </div>\r\n\r\n <div\r\n className={classNames(\r\n `relative sm:w-full md:w-full ${\r\n collapsable\r\n ? \"lg:w-2/3 ml-auto sm:flex-grow xl:flex-grow-0\"\r\n : `${\r\n fullWidth ? \"\" : \"lg:w-2/3 \"\r\n }flex-grow flex-shrink-0 min-w-2/3 overflow-visible`\r\n } pl-2 sm:pl-0 md:pl-0`\r\n )}\r\n ref={group}\r\n style={{\r\n ...styles.content,\r\n minWidth,\r\n ...(collapsable\r\n ? {\r\n maxHeight: collapsed ? \"0px\" : `${maxHeight}px`,\r\n opacity: collapsed ? 0 : 1,\r\n overflow: collapsed ? \"hidden\" : \"visible\",\r\n transition: \"all 0.6s ease\",\r\n }\r\n : {}),\r\n }}\r\n >\r\n <div\r\n ref={groupContent}\r\n className={classNames(\"w-full px-1 pt-1\", { \"pb-6\": collapsable })}\r\n >\r\n {children}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nFormGroup.propTypes = {\r\n // children: propTypes.Children.isRequired,\r\n label: propTypes.string\r\n};\r\nexport default FormGroup;\r\n","import React from 'react';\r\n\r\nconst ErrorsList = ({ error, showFirstOnly = false, style = {} }) => {\r\n\tconst isString = typeof error === 'string';\r\n\tconst isArray = Array.isArray(error) && error.length;\r\n\tif (isString) return <small className=\"error\">{error}</small>;\r\n\tif (isArray && showFirstOnly) return <small className=\"error\" style={style}>{error[0]}</small>;\r\n\telse if (isArray)\r\n\t\treturn error.length ? (\r\n\t\t\t<div style={{ marginTop: 5 }}>\r\n\t\t\t\t{error.map(e => (e ? <small className=\"error\" style={style}>{e}</small> : null))}\r\n\t\t\t</div>\r\n\t\t) : null;\r\n\treturn null;\r\n};\r\n\r\nexport default ErrorsList;\r\n","import React, { useState, Children } from 'react';\r\nimport propTypes from 'prop-types';\r\nimport ErrorsList from 'components/ErrorsList';\r\nimport Switch from 'components/Switch';\r\nimport classNames from 'lib/classNames';\r\nimport { SideBarBadge } from './Sidebar';\r\nimport Button from './Button';\r\n\r\nconst FormControl = ({\r\n label,\r\n labelColor = 'text-gray-600',\r\n children,\r\n className = '',\r\n marginBottom = 'mb-6',\r\n info = null,\r\n error = null,\r\n showError = true,\r\n styles = {\r\n container: {},\r\n label: {}\r\n },\r\n withSwitch,\r\n childrenWidth = 'w-1/2',\r\n singleChildWidth = 'w-full',\r\n isSingleCol,\r\n beta,\r\n action,\r\n Footer,\r\n disabled = false,\r\n}) => {\r\n const isErrorArray = Array.isArray(error);\r\n const isString = error => typeof error === 'string';\r\n const hasErrors = (isErrorArray ? error.filter(isString).length : error) && !!showError;\r\n const getErrors = isErrorArray ? error.filter(isString) : error;\r\n\r\n const containerClasses = classNames(\r\n className,\r\n 'relative',\r\n {\r\n [marginBottom]: Children.count(children) === 1 || isSingleCol,\r\n 'opacity-50': disabled\r\n }\r\n );\r\n\r\n const labelClasses = classNames(\r\n 'flex items-center block flex-1 flex-grow capitalize text-sm font-bold',\r\n labelColor,\r\n {\r\n 'error': !!hasErrors && !disabled,\r\n 'text-gray-400': disabled\r\n }\r\n );\r\n\r\n const infoClasses = classNames(\r\n 'text-gray-500 text-xs italic mb-1',\r\n {\r\n 'error': !!hasErrors && !disabled,\r\n 'text-gray-400': disabled\r\n }\r\n );\r\n\r\n return (\r\n <div className={containerClasses}>\r\n {disabled && (\r\n <div className=\"absolute bottom-0 left-0 right-0 h-0.5 bg-gray-200 rounded\"></div>\r\n )}\r\n {!!label && (\r\n <div\r\n className={classNames('flex items-center mb-1', {\r\n 'mb-3': Children.count(children) && withSwitch\r\n })}\r\n >\r\n <label className={labelClasses}>\r\n {label}\r\n {disabled && (\r\n <span\r\n className={classNames(\r\n \"ml-2 flex-center tracking-wider py-1 px-2 rounded-lg text-black text-xs font-bold\"\r\n )}\r\n style={{ backgroundColor: \"#ffbf6e\" }}\r\n >\r\n Deprecated\r\n </span>\r\n )}\r\n </label>\r\n {(beta && !disabled) && (\r\n <span\r\n className={classNames(\r\n 'flex-center bg-orange-500 tracking-wider py-1 px-2 rounded-lg text-white text-xxs font-bold',\r\n {\r\n 'mr-2': withSwitch\r\n }\r\n )}\r\n style={{ top: -2, right: -2 }}\r\n >\r\n Beta\r\n </span>\r\n )}\r\n {!!withSwitch && <Switch disabled={disabled} BindToContext={withSwitch} />}\r\n {!withSwitch && action && (\r\n <Button\r\n disabled={disabled}\r\n type=\"link-danger\"\r\n icon=\"trash\"\r\n size=\"medium\"\r\n onClick={action}\r\n style={{ top: -2, right: -2 }}\r\n />\r\n )}\r\n </div>\r\n )}\r\n {!!info && (\r\n <p\r\n className={infoClasses}\r\n dangerouslySetInnerHTML={{ __html: info.replace(/\\n/g, '<br/>') }}\r\n />\r\n )}\r\n {Children.count(children) > 1 && !isSingleCol && (\r\n <div\r\n className={classNames('flex flex-wrap -mx-2', {\r\n 'mb-2': !!hasErrors\r\n })}\r\n >\r\n {Children.map(children, (child, i) => (\r\n <div className={classNames('px-2', childrenWidth, marginBottom)}>\r\n {child}\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n {(Children.count(children) === 1 || isSingleCol) && (\r\n <div className={classNames(singleChildWidth)}>\r\n {children}\r\n </div>\r\n )}\r\n {!!Footer && <Footer />}\r\n {!!hasErrors && !disabled && (\r\n <ErrorsList\r\n {...{ error: getErrors, showFirstOnly: true }}\r\n style={{ marginTop: 10 }}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nFormControl.propTypes = {\r\n label: propTypes.string,\r\n labelColor: propTypes.string,\r\n className: propTypes.string,\r\n marginBottom: propTypes.string,\r\n info: propTypes.string,\r\n error: propTypes.oneOfType([\r\n propTypes.string,\r\n propTypes.arrayOf(propTypes.string)\r\n ]),\r\n showError: propTypes.bool,\r\n styles: propTypes.object,\r\n withSwitch: propTypes.object,\r\n childrenWidth: propTypes.string,\r\n singleChildWidth: propTypes.string,\r\n isSingleCol: propTypes.bool,\r\n beta: propTypes.bool,\r\n action: propTypes.func,\r\n Footer: propTypes.func,\r\n disabled: propTypes.bool\r\n};\r\n\r\nFormControl.defaultProps = {\r\n info: false,\r\n style: {},\r\n disabled: false\r\n};\r\n\r\nexport default FormControl;","import React from 'react';\r\nimport Icon from 'components/Icon';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst Tag = ({\r\n\timage,\r\n\ttitle,\r\n\tid,\r\n\tonClose,\r\n\tstyle = {\r\n\t\tbackground: null,\r\n\t\tcolor: null,\r\n\t},\r\n}) => {\r\n\treturn (\r\n\t\t<div\r\n\t\t\tclassName={classNames('w-full p-2 relative inline-flex items-center flex-row bg-white rounded shadow')}\r\n\t\t\tstyle={{\r\n\t\t\t\tbackground: style.background,\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{image && (\r\n\t\t\t\t<img\r\n\t\t\t\t\tstyle={{ width: 30, height: 30 }}\r\n\t\t\t\t\tsrc={typeof image === 'string' ? image : image.src}\r\n\t\t\t\t\talt={title}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{!image && (\r\n\t\t\t\t<div\r\n\t\t\t\t\tstyle={{ fill: '#c4cdd5', width: 30, height: 30, padding: 0 }}\r\n\t\t\t\t\tclassName={classNames('text-transparent')}\r\n\t\t\t\t>\r\n\t\t\t\t\t<svg viewBox=\"0 0 20 20\" className={classNames('w-full h-full')}>\r\n\t\t\t\t\t\t<path fill=\"currentColor\" d=\"M14 9l-5 5-3-2-5 3v4h18v-6z\"></path>\r\n\t\t\t\t\t\t<path d=\"M19 0H1a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1zM8 6c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.654 0 3-1.346 3-3S9.654 4 8 4 5 5.346 5 7s1.346 3 3 3zm-6 8v-2.434l3.972-2.383 2.473 1.65c.398.264.925.21 1.262-.126l4.367-4.367L18 13.48V18H2zM18 2v8.92l-3.375-2.7a.999.999 0 0 0-1.332.073l-4.42 4.42-2.318-1.545a1 1 0 0 0-1.07-.025L2 13.233V2h16z\"></path>\r\n\t\t\t\t\t</svg>\r\n\t\t\t\t</div>\r\n\t\t\t)}\r\n\t\t\t<div\r\n\t\t\t\tclassName={classNames('mx-2 flex-1 text-xs font-bold capitalize text-gray-700 truncate ...')}\r\n\t\t\t\tstyle={{ color: style.color }}\r\n\t\t\t>\r\n\t\t\t\t{title}\r\n\t\t\t</div>\r\n\t\t\t<i\r\n\t\t\t\tclassName={classNames('text-red-500')}\r\n\t\t\t\tonClick={() => onClose(id)}\r\n\t\t\t\tstyle={{\r\n\t\t\t\t\tbackground: style.color,\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t<Icon\r\n\t\t\t\t\ticon=\"times\"\r\n\t\t\t\t\tsize=\"xs\"\r\n\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\tcolor: style.background,\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tclassName=\"cursor-pointer\"\r\n\t\t\t\t/>\r\n\t\t\t</i>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default Tag;\r\n","import React, { useState, useEffect, useRef } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Manager, Reference, Popper } from 'react-popper';\r\nimport { SketchPicker } from 'react-color';\r\nimport useBindToContext from 'hooks/useBindToContext';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst formatColor = color => {\r\n if (!color)\r\n color = {\r\n r: 0,\r\n g: 0,\r\n b: 0,\r\n a: 1\r\n };\r\n return typeof color === 'string' ? color : `rgba(${color.r},${color.g},${color.b},${color.a})`;\r\n};\r\n\r\nconst ColorPicker = ({\r\n BindToContext = null,\r\n value = null,\r\n onChange = null,\r\n onVisibleChange,\r\n text = null,\r\n position = 'bottom left',\r\n color_type = 'rgb',\r\n data_input,\r\n onFocus,\r\n onBlur,\r\n className = '',\r\n disableAlpha = false\r\n}) => {\r\n const [BindedValue, BindedOnChange, _, onRender] = useBindToContext(\r\n BindToContext,\r\n value,\r\n onChange\r\n );\r\n const contentRef = useRef(null);\r\n const [visible, _setVisible] = useState(false);\r\n const setVisible = value => {\r\n if (onVisibleChange) onVisibleChange(value);\r\n _setVisible(value);\r\n };\r\n const contentStyle = {\r\n padding: 0,\r\n border: 'none',\r\n background: 'none',\r\n boxShadow: 'none',\r\n width: 'initial'\r\n };\r\n const arrowStyle = {\r\n zIndex: 1\r\n };\r\n\r\n const handleOutSideClick = event => {\r\n if (!contentRef.current) return;\r\n else if (contentRef.current.contains(event.target)) return;\r\n\r\n setVisible(false);\r\n };\r\n\r\n useEffect(\r\n () => {\r\n if (visible) document.addEventListener('mousedown', handleOutSideClick, false);\r\n else document.removeEventListener('mousedown', handleOutSideClick, false);\r\n return () => {\r\n document.removeEventListener('mousedown', handleOutSideClick, false);\r\n };\r\n },\r\n [visible]\r\n );\r\n\r\n //useEffect(() => {\r\n //if (onRender?.length) onRender.forEach(fn => fn());\r\n //}, [onRender]);\r\n\r\n return (\r\n <div className={classNames('flex items-center', className)}>\r\n <Manager>\r\n <Reference>\r\n {({ ref }) =>\r\n <button\r\n type=\"button\"\r\n ref={ref}\r\n className={classNames('focus:output-none', {\r\n 'rounded-l border-r': data_input,\r\n 'rounded border focus:ring': !data_input\r\n })}\r\n onClick={() => {\r\n if (!visible) setVisible(true);\r\n }}\r\n data-active={visible}\r\n onFocus={e => {\r\n if (onFocus) onFocus(e);\r\n }}\r\n onBlur={e => {\r\n if (onBlur) onBlur(e);\r\n }}\r\n style={{\r\n width: 37,\r\n height: 37,\r\n backgroundColor: formatColor(BindedValue)\r\n }}\r\n tabIndex=\"0\"\r\n />}\r\n </Reference>\r\n <Popper\r\n placement=\"right-start\"\r\n positionFixed={false}\r\n modifiers={{\r\n preventOverflow: { enabled: true },\r\n offset: { offset: '100%r,0px', enabled: true }\r\n }}\r\n >\r\n {({ ref, style, placement, arrowProps }) => {\r\n return visible\r\n ? <div ref={contentRef}>\r\n <div\r\n ref={ref}\r\n style={{ ...style, zIndex: 100 }}\r\n data-placement={placement}\r\n >\r\n <SketchPicker\r\n disableAlpha={disableAlpha}\r\n color={BindedValue}\r\n onChange={color => {\r\n BindedOnChange(color[color_type]);\r\n }}\r\n />\r\n <div ref={arrowProps.ref} style={arrowProps.style} />\r\n </div>\r\n </div>\r\n : null;\r\n }}\r\n </Popper>\r\n </Manager>\r\n {!!text &&\r\n <span\r\n className={classNames('flex-1 flex-grow ml-2 text-gray-500 text-sm font-bold')}\r\n >\r\n {text}\r\n </span>}\r\n </div>\r\n );\r\n};\r\n\r\nColorPicker.propTypes = {};\r\n\r\nexport default ColorPicker;\r\n","import React, { useEffect } from 'react';\r\nimport Select, { components } from 'react-select';\r\nimport CreatableSelect from 'react-select/creatable';\r\nimport Icon from 'components/Icon';\r\nimport useBindToContext from 'hooks/useBindToContext';\r\n\r\nconst DropdownIndicator = (props) => {\r\n\treturn (\r\n\t\t<components.DropdownIndicator {...props}>\r\n\t\t\t<Icon icon=\"caret-down\" />\r\n\t\t</components.DropdownIndicator>\r\n\t);\r\n};\r\n\r\nconst colourStyles = (hasError, inInput) => ({\r\n\toption: (styles, { data, isDisabled, isFocused, isSelected }) => {\r\n\t\treturn {\r\n\t\t\t...styles,\r\n\t\t\tbackgroundColor: isDisabled ? null : isSelected ? '#F5F9FC' : isFocused ? '#F5F9FC' : null,\r\n\t\t\tcolor: isDisabled ? '#ccc' : isSelected ? '#027FFF' : isFocused ? '#027FFF' : '#BEC3C5',\r\n\t\t\tcursor: isDisabled ? 'not-allowed' : 'default',\r\n\t\t\tfontSize: '0.875rem',\r\n\t\t\ttextTransform: 'capitalize',\r\n\t\t};\r\n\t},\r\n\tcontrol: (styles, { data, isDisabled, isFocused, isSelected, isHovered }) => {\r\n\t\treturn {\r\n\t\t\t...styles,\r\n\t\t\tborder: inInput ? 'none' : undefined,\r\n\t\t\tboxShadow: inInput ? 'none' : isFocused ? '0 0 0 3px rgba(66, 153, 225, 0.5)' : 'none',\r\n\t\t\tbackgroundColor: inInput || isDisabled ? '#e2e8f0' : styles.backgroundColor,\r\n\t\t\tborderColor: inInput ? 'none' : hasError ? '#eb5757' : '#e2e8f0',\r\n\t\t\tborderRadius: inInput ? '4px 0 0 4px' : '4px',\r\n\t\t\theight: inInput ? '100%' : 39,\r\n\t\t\tminHeight: inInput ? '100%' : 39,\r\n\t\t\tfontWeight: inInput ? 'bold' : undefined,\r\n\t\t\t'&:hover': {\r\n\t\t\t\tborderColor: inInput ? 'none' : hasError ? '#eb5757' : '#e2e8f0',\r\n\t\t\t},\r\n\t\t};\r\n\t},\r\n\tsingleValue: (styles, { data, isDisabled }) => ({\r\n\t\t...styles,\r\n\t\tfontSize: inInput ? 16 : 12,\r\n\t\ttextTransform: 'capitalize',\r\n\t\tcolor: inInput ? '#4299e1' : isDisabled ? '#4a5568' : styles.color,\r\n\t\tfontSize: '0.875rem',\r\n\t}),\r\n\tdropdownIndicator: (styles, { isDisabled }) => ({\r\n\t\t...styles,\r\n\t\tcolor: inInput ? '#4299e1' : isDisabled ? '#4a5568' : styles.color,\r\n\t\t'&:hover': {\r\n\t\t\tcolor: inInput ? '#3182ce' : undefined,\r\n\t\t},\r\n\t}),\r\n\tindicatorSeparator: (styles) => ({ ...styles, display: inInput ? 'none' : 'initial' }),\r\n\tvalueContainer: (styles) => ({ ...styles, padding: '0 8px 0 8px', height: '100%' }),\r\n\tmenu: (styles) => ({ ...styles, padding: 0 }),\r\n});\r\n\r\nconst Dropdown = (props) => {\r\n\tconst {\r\n\t\toptions = [],\r\n\t\tvalue,\r\n\t\tonChange,\r\n\t\tBindToContext = null,\r\n\t\tvalidation = true,\r\n\t\tgetError = null,\r\n\t\tspecificValidation = null,\r\n\t\tinInput = false,\r\n\t\tdisabled,\r\n\t\tclassName = '',\r\n\t\tautoFocus = false,\r\n\t\tisMulti = false,\r\n\t\tcloseMenuOnSelect=true,\r\n\t\tisCreatable = false\r\n\t} = props;\r\n\tconst [BindedValue, BindedOnChange, hasError, onRender] = useBindToContext(\r\n\t\tBindToContext,\r\n\t\tvalue,\r\n\t\tonChange,\r\n\t\tspecificValidation,\r\n\t\tgetError,\r\n\t\tvalidation\r\n\t);\r\n\tlet selectedOption = !isMulti ?\r\n\t\toptions.find((option) => option.value == BindedValue)\r\n\t\t\t:\r\n\t\toptions.filter((option) => BindedValue.indexOf(option.value) !== -1);\r\n\r\n\tconst handleChange = (option) => {\r\n\t\tif(!option){\r\n\t\t\tBindedOnChange(isMulti ? [] : null)\r\n\t\t}else if(Array.isArray(option)){\r\n\t\t\tBindedOnChange(option.map(op => op.value))\r\n\t\t}else {\r\n\t\t\tBindedOnChange(option.value)\r\n\t\t}\r\n\t}\r\n\t//useEffect(() => {\r\n\t\t//if (onRender?.length) onRender.forEach(fn => fn());\r\n\t//}, [onRender]);\r\n\r\n\tif(isCreatable){\r\n\t\tlet createdOptions = !BindedValue ?\r\n\t\t[]\r\n\t\t\t:\r\n\t\tBindedValue.map(v => ({ value: v, label: v }))\r\n\t\treturn (\r\n\t\t\t<CreatableSelect\r\n\t\t\t\tisClearable={false}\r\n\t\t\t\t{...props}\r\n\t\t\t\tclassName={`basic-single ${className}`}\r\n\t\t\t\tclassNamePrefix=\"select\"\r\n\t\t\t\tisClearable={false}\r\n\t\t\t\tisDisabled={disabled}\r\n\t\t\t\tvalue={createdOptions}\r\n\t\t\t\tonChange={handleChange}\r\n\t\t\t\tcomponents={{ DropdownIndicator, indicatorSeparator: null }}\r\n\t\t\t\tstyles={colourStyles(hasError, inInput)}\r\n\t\t\t\tautoFocus={autoFocus}\r\n\t\t\t\tisMulti={isMulti}\r\n\t\t\t\t// menuIsOpen={false}\r\n\t\t\t\tcloseMenuOnSelect={closeMenuOnSelect}\r\n\t\t\t/>\r\n\t\t)\r\n\t} else\r\n\t\treturn (\r\n\t\t\t<Select\r\n\t\t\t\t{...props}\r\n\t\t\t\tclassName={`basic-single ${className}`}\r\n\t\t\t\tclassNamePrefix=\"select\"\r\n\t\t\t\tisClearable={false}\r\n\t\t\t\tisDisabled={disabled}\r\n\t\t\t\tvalue={selectedOption}\r\n\t\t\t\tonChange={handleChange}\r\n\t\t\t\tcomponents={{ DropdownIndicator, indicatorSeparator: null }}\r\n\t\t\t\tstyles={colourStyles(hasError, inInput)}\r\n\t\t\t\tautoFocus={autoFocus}\r\n\t\t\t\tisMulti={isMulti}\r\n\t\t\t\tcloseMenuOnSelect={closeMenuOnSelect}\r\n\t\t\t/>\r\n\t\t)\r\n};\r\n\r\nexport default Dropdown;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport Switch from 'components/Switch';\r\nimport Tag from 'components/Tag';\r\nimport Icon from 'components/Icon';\r\nimport ColorPicker from 'components/ColorPicker';\r\nimport Dropdown from 'components/Dropdown';\r\nimport useBindToContext from 'hooks/useBindToContext';\r\nimport styled from 'styled-components';\r\nimport classNames from 'lib/classNames';\r\nimport _ from 'lodash'\r\n\r\nconst Input = ({\r\n\tdisabled,\r\n\tdisabledBgColor = \"bg-gray-300\",\r\n\twithSwitch,\r\n\twithDropdown,\r\n\twithNumber,\r\n\twithWeight,\r\n\twithColor,\r\n\ttags,\r\n\tonFocus,\r\n\tonBlur,\r\n\tinputRef,\r\n\ttype,\r\n\tvalue,\r\n\tautofocus,\r\n\ticon,\r\n\tplaceholder,\r\n\tclassName,\r\n\tstyle,\r\n\tonChange,\r\n\tBindToContext,\r\n\ticonFirst,\r\n\tplaceholder_color,\r\n\tborder_color,\r\n\tmax,\r\n\tmin,\r\n\tvalidation = true,\r\n\tgetError = null,\r\n\tspecificValidation = null,\r\n\tfullWidth,\r\n\tisFlex,\r\n\tstep = 1,\r\n\tindicator\r\n}) => {\r\n\tconst hasTags = !!(tags && tags.length);\r\n\tconst [BindedValue, BindedOnChange, hasError, onRender] = useBindToContext(\r\n\t\tBindToContext,\r\n\t\tvalue,\r\n\t\tonChange,\r\n\t\tspecificValidation,\r\n\t\tgetError,\r\n\t\tvalidation\r\n\t);\r\n\tconst hasLeftNeighbor = !!withColor || !!withDropdown || !!hasTags;\r\n\r\n\tconst [inputValue, setInputValue] = useState(BindedValue)\r\n\t//useEffect(() => {\r\n\t//if (onRender?.length) onRender.forEach(fn => fn());\r\n\t//}, [onRender]);\r\n\r\n\tconst handleChange = (value) => {\r\n\t\tlet newValue = type === 'number' && value.length ? JSON.parse(value) : value;\r\n\t\tif (type === 'number' && typeof newValue === 'number' && max && newValue > max) return;\r\n\t\tBindedOnChange(newValue);\r\n\t\t// setInputValue(newValue)\r\n\t\t// debounce(newValue);\r\n\t};\r\n\r\n\t// const debounce = useCallback(\r\n\t// \t_.debounce((newValue) => {\r\n\t// \t\tBindedOnChange(newValue);\r\n\t// \t // send the server request here\t\t\r\n\t// \t}, 200),\r\n\t// \t[]\r\n\t// );\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div\r\n\t\t\t\tclassName={classNames(className, 'flex rounded focus-within-ring border', {\r\n\t\t\t\t\t'w-full': !isFlex,\r\n\t\t\t\t\t[disabledBgColor]: disabled,\r\n\t\t\t\t\t'bg-white': !disabled,\r\n\t\t\t\t\t'border-red-400': hasError,\r\n\t\t\t\t})}\r\n\t\t\t\tdata-tags={hasTags}\r\n\t\t\t>\r\n\t\t\t\t{!!withColor && (\r\n\t\t\t\t\t<ColorPicker data_input={true} value={withColor.value} color_type=\"rgb\" onChange={withColor.onChange} />\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t{!!withDropdown && <Dropdown {...withDropdown} className={classNames('w-17')} inInput={true} first />}\r\n\t\t\t\t{icon && iconFirst && (\r\n\t\t\t\t\t<div className={classNames('flex ml-2 text-xs rounded-l items-center')}>\r\n\t\t\t\t\t\t{icon.icon && <Icon {...icon} />}\r\n\t\t\t\t\t\t{icon.char && <span>{icon.char}</span>}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t\t{!!hasTags && (\r\n\t\t\t\t\t<div className={classNames('flex ml-2 items-center')}>\r\n\t\t\t\t\t\t{tags.map(({ id, title, onClose, style = {} }, i) => (\r\n\t\t\t\t\t\t\t<Tag key={i} style={style} title={title} id={id} onClose={(id) => onClose(id)} />\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\r\n\t\t\t\t<input\r\n\t\t\t\t\tonChange={({ target: { value } }) => handleChange(value)}\r\n\t\t\t\t\tstep={step}\r\n\t\t\t\t\tonFocus={(e) => {\r\n\t\t\t\t\t\tif (onFocus) onFocus(e);\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\tonBlur={(e) => {\r\n\t\t\t\t\t\tif (onBlur) onBlur(e);\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tplaceholder_color={placeholder_color}\r\n\t\t\t\t\tref={inputRef}\r\n\t\t\t\t\ttype={type}\r\n\t\t\t\t\tvalue={BindedValue}\r\n\t\t\t\t\tmax={max}\r\n\t\t\t\t\tmin={min}\r\n\t\t\t\t\tplaceholder={!hasTags ? placeholder : null}\r\n\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t'border-0 shadow-none min-w-0 w-full appearance-none flex-1 flex-grow py-2 px-3 text-sm text-gray-700 focus:outline-none bg-inherit',\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t'rounded-r': hasLeftNeighbor,\r\n\t\t\t\t\t\t\trounded: !hasLeftNeighbor,\r\n\t\t\t\t\t\t\t'placeholder-red-400': hasError,\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t)}\r\n\t\t\t\t\tautoFocus={autofocus}\r\n\t\t\t\t/>\r\n\t\t\t\t{icon && !iconFirst && (\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t'h-full flex p-2 items-center justify-center bg-gray-300 text-blue-500 font-bold text-sm rounded-r'\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{icon.icon && <Icon {...icon} />}\r\n\t\t\t\t\t\t{icon.char && <span>{icon.char}</span>}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t\t{withSwitch && (\r\n\t\t\t\t\t<div className={classNames('flex items-center justify-center bg-white mr-3 rounded-r border-l pl-2')}>\r\n\t\t\t\t\t\t<Switch onFocus={onFocus} onBlur={onBlur} BindToContext={withSwitch} />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t\t{withWeight && (\r\n\t\t\t\t\t<div className={classNames('flex items-center')}>\r\n\t\t\t\t\t\t<span className={classNames('bg-gray-300 number-input-separator')}></span>\r\n\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\tvalue={withWeight.value}\r\n\t\t\t\t\t\t\tonChange={withWeight.onChange}\r\n\t\t\t\t\t\t\tmin={withWeight.min || 0}\r\n\t\t\t\t\t\t\tmax={withWeight.max || 900}\r\n\t\t\t\t\t\t\tonFocus={(e) => {\r\n\t\t\t\t\t\t\t\tif (onFocus) onFocus(e);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tstep={withWeight.step || step}\r\n\t\t\t\t\t\t\tonBlur={(e) => {\r\n\t\t\t\t\t\t\t\tif (onBlur) onBlur(e);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'w-12 focus:outline-none appearance-none text-sm py-2 pl-3 text-gray-700 items-center'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<div className={classNames('pr-2 flex flex-col relative ')}>\r\n\t\t\t\t\t\t\t<button type='button' onClick={() => withWeight.onClick(withWeight.value + withWeight.step)} className={classNames('focus:ring-0 focus:outline-none p-0 flex-1 flex-center')}><Icon icon=\"caret-up\" /></button>\r\n\t\t\t\t\t\t\t<button type='button' onClick={() => withWeight.onClick(withWeight.value - withWeight.step)} className={classNames('focus:ring-0 focus:outline-none p-0 flex-1 flex-center')}><Icon icon=\"caret-down\" /></button>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t\t{withNumber && (\r\n\t\t\t\t\t<div className={classNames('flex items-center')}>\r\n\t\t\t\t\t\t<span className={classNames('bg-gray-300 number-input-separator')}></span>\r\n\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\tvalue={withNumber.value}\r\n\t\t\t\t\t\t\tonChange={withNumber.onChange}\r\n\t\t\t\t\t\t\tmin={withNumber.min || 0}\r\n\t\t\t\t\t\t\tonFocus={(e) => {\r\n\t\t\t\t\t\t\t\tif (onFocus) onFocus(e);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tstep={withNumber.step || step}\r\n\t\t\t\t\t\t\tonBlur={(e) => {\r\n\t\t\t\t\t\t\t\tif (onBlur) onBlur(e);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'w-12 focus:outline-none appearance-none text-sm py-2 pl-3 text-gray-700 items-center'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<div className={classNames('pr-2 flex flex-col relative ')}>\r\n\t\t\t\t\t\t\t<button type='button' onClick={() => withNumber.onClick(withNumber.value + withNumber.step)} className={classNames('focus:ring-0 focus:outline-none p-0 flex-1 flex-center')}><Icon icon=\"caret-up\" /></button>\r\n\t\t\t\t\t\t\t<button type='button' onClick={() => withNumber.onClick(withNumber.value - withNumber.step)} className={classNames('focus:ring-0 focus:outline-none p-0 flex-1 flex-center')}><Icon icon=\"caret-down\" /></button>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t{withNumber.icon.icon ||\r\n\t\t\t\t\t\t\t(withNumber.icon.char && (\r\n\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t\t\t'h-full flex p-2 items-center justify-center bg-gray-300 text-blue-500 font-bold text-sm rounded-r'\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{withNumber.icon.icon && <Icon {...withNumber.icon} />}\r\n\t\t\t\t\t\t\t\t\t{withNumber.icon.char && <span>{withNumber.icon.char}</span>}\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t</div>\r\n\t\t\t{\r\n\t\t\t\tindicator && <p className={classNames(\"text-gray-500 text-xs italic\")}>{indicator}</p>\r\n\t\t\t}\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nInput.defaultProps = {\r\n\tswitch: false,\r\n\ttags: [],\r\n\tdisabled: false,\r\n\tstyle: {},\r\n\tonEnter: false,\r\n\tonFocus: false,\r\n\tonBlur: false,\r\n\tonKeyDown: false,\r\n\tinputRef: null,\r\n\tBindToContext: null,\r\n\tdispatch: null,\r\n\tplaceholder: '',\r\n\twithSwitch: false,\r\n\twithNumber: false,\r\n\twithDropdown: false,\r\n\tvalue: undefined,\r\n\tclassName: '',\r\n\ticonFirst: false,\r\n\tplaceholder_color: null,\r\n\tborder_color: null,\r\n\tmax: null,\r\n\tmin: null,\r\n};\r\n\r\nexport default Input;\r\n","import React, { useState, useEffect, useCallback } from 'react';\r\nimport Switch from 'components/Switch';\r\nimport Tag from 'components/Tag';\r\nimport Icon from 'components/Icon';\r\nimport ColorPicker from 'components/ColorPicker';\r\nimport Dropdown from 'components/Dropdown';\r\nimport useBindToContext from 'hooks/useBindToContext';\r\nimport styled from 'styled-components';\r\nimport classNames from 'lib/classNames';\r\nimport _ from 'lodash'\r\n\r\nconst Textarea = ({\r\n\tdisabled,\r\n\tonFocus,\r\n\tonBlur,\r\n\tinputRef,\r\n\tvalue,\r\n\tautofocus,\r\n\tplaceholder,\r\n\tclassName,\r\n\tonChange,\r\n\tBindToContext,\r\n\tplaceholder_color,\r\n\tborder_color,\r\n\tvalidation = true,\r\n\tgetError = null,\r\n\tspecificValidation = null,\r\n\tisFlex,\r\n\trow= 2\r\n}) => {\r\n\tconst [BindedValue, BindedOnChange, hasError, onRender] = useBindToContext(\r\n\t\tBindToContext,\r\n\t\tvalue,\r\n\t\tonChange,\r\n\t\tspecificValidation,\r\n\t\tgetError,\r\n\t\tvalidation\r\n\t);\r\n\r\n\tconst handleChange = (value) => {\r\n\t\tBindedOnChange(value);\r\n\t}\r\n\treturn (\r\n\t\t<div\r\n\t\t\tclassName={classNames(className, 'flex rounded focus-within-ring border', {\r\n\t\t\t\t'w-full': !isFlex,\r\n\t\t\t\t'bg-gray-300': disabled,\r\n\t\t\t\t'bg-white': !disabled,\r\n\t\t\t\t'border-red-400': hasError,\r\n\t\t\t})}\r\n\t\t>\r\n\t\t\t\r\n\t\t\t<textarea\r\n\t\t\t\tonChange={({ target: { value } }) => handleChange(value)}\r\n\t\t\t\tonFocus={(e) => {\r\n\t\t\t\t\tif (onFocus) onFocus(e);\r\n\t\t\t\t}}\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\tonBlur={(e) => {\r\n\t\t\t\t\tif (onBlur) onBlur(e);\r\n\t\t\t\t}}\r\n\t\t\t\tplaceholder_color={placeholder_color}\r\n\t\t\t\tref={inputRef}\r\n\t\t\t\tvalue={BindedValue}\r\n\t\t\t\trow={row}\r\n\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t'border-0 shadow-none min-w-0 w-full appearance-none flex-1 flex-grow py-2 px-3 text-sm text-gray-700 focus:outline-none bg-inherit rounded',\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t'placeholder-red-400': hasError,\r\n\t\t\t\t\t}\r\n\t\t\t\t)}\r\n\t\t\t\tautoFocus={autofocus}\r\n\t\t\t/>\r\n\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nTextarea.defaultProps = {\r\n\tdisabled: false,\r\n\tstyle: {},\r\n\tonEnter: false,\r\n\tonFocus: false,\r\n\tonBlur: false,\r\n\tonKeyDown: false,\r\n\tinputRef: null,\r\n\tBindToContext: null,\r\n\tdispatch: null,\r\n\tplaceholder: '',\r\n\twithSwitch: false,\r\n\twithNumber: false,\r\n\twithDropdown: false,\r\n\tvalue: undefined,\r\n\tclassName: '',\r\n\ticonFirst: false,\r\n\tplaceholder_color: null,\r\n\tborder_color: null,\r\n\tmax: null,\r\n\tmin: null,\r\n};\r\n\r\nexport default Textarea;\r\n","import React, { Component } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport styles from 'styles/tag_input.module.scss';\r\nimport classNames from 'lib/classNames';\r\nimport { Tag, Icon } from 'components';\r\n\r\nconst TagInput = ({ tags, close }) => {\r\n\treturn (\r\n\t\t<div className={classNames('px-3 p-1 bg-gray-200 mt-6 rounded ')}>\r\n\t\t\t<div className={classNames('flex -mx-2 flex-wrap')}>\r\n\t\t\t\t{tags.map((tag) => (\r\n\t\t\t\t\t<div className={classNames('px-1 w-1/2 py-1')} key={tag.id}>\r\n\t\t\t\t\t\t<Tag {...tag} onClose={close} />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t))}\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nTagInput.propTypes = {\r\n\ttags: PropTypes.arrayOf(\r\n\t\tPropTypes.shape({\r\n\t\t\tid: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\r\n\t\t\timage: PropTypes.string,\r\n\t\t\ttitle: PropTypes.string.isRequired,\r\n\t\t})\r\n\t),\r\n\tclose: PropTypes.func.isRequired,\r\n};\r\n\r\nexport default TagInput;\r\n","import React, { Fragment, useEffect } from 'react';\r\nimport styles from 'styles/button_select.module.scss';\r\nimport useBindToContext from 'hooks/useBindToContext';\r\nimport { Icon, Switch } from 'components';\r\nimport classNames from 'lib/classNames';\r\nimport { SideBarBadge } from './Sidebar';\r\n\r\nconst ButtonSelect = ({\r\n options,\r\n onChange,\r\n value,\r\n BindToContext,\r\n onSelect = null,\r\n loading = [],\r\n showSeparator = true,\r\n showCheckedIcon = true,\r\n inlineIcon = false,\r\n noIconBG,\r\n className,\r\n isVertical,\r\n disabledClick = false,\r\n shopContext,\r\n keyPrefix = ''\r\n}) => {\r\n const [BindedValue, BindedOnChange, _, onRender] = useBindToContext(\r\n BindToContext,\r\n value,\r\n onChange\r\n );\r\n //useEffect(() => {\r\n //if (onRender?.length) onRender.forEach(fn => fn());\r\n //}, [onRender]);\r\n\r\n return (\r\n <div\r\n className={`${classNames('flex items-stretch w-full', {\r\n 'flex-col': isVertical\r\n })} ${className || ''}`}\r\n >\r\n {options.map((option, i) => {\r\n const isLoading = loading[i] ? loading[i] : false;\r\n const isLastButton = i === options.length - 1;\r\n const selected = BindedValue === option.value;\r\n const isDisabled =\r\n typeof option.disabled === 'function'\r\n ? option.disabled(BindToContext[0], shopContext)\r\n : option.disabled;\r\n return (\r\n <Fragment key={keyPrefix + i}>\r\n <div\r\n className={classNames(\r\n 'relative flex flex-col flex-1 text-gray-500 rounded bg-white p-2 border-2 focus:outline-none',\r\n {\r\n 'border-blue-500': selected,\r\n 'border-gray-500': !selected,\r\n 'justify-start': !!option.info,\r\n 'justify-center': !option.info,\r\n 'cursor-pointer focus:ring': !isDisabled,\r\n 'opacity-50 cursor-not-allowed': !!isDisabled\r\n }\r\n )}\r\n onClick={() => {\r\n if (isDisabled || option.disabledClick) return;\r\n BindedOnChange(option.value);\r\n if (onSelect) onSelect(option.value);\r\n }}\r\n onKeyPress={event => {\r\n if (event.key === 'Enter' && !isDisabled) {\r\n BindedOnChange(option.value);\r\n if (onSelect) onSelect(option.value);\r\n }\r\n }}\r\n tabIndex=\"0\"\r\n >\r\n {selected &&\r\n showCheckedIcon &&\r\n <div className={classNames('clear-both')}>\r\n <div\r\n className={classNames('rounded-full flex-center', {\r\n 'w-8 h-8 float-right mb-1':\r\n !!option.icon && !inlineIcon,\r\n 'w-5 h-5 absolute top-1/2 transform -translate-y-1/2 right-0 mr-1':\r\n !option.icon || inlineIcon,\r\n 'bg-blue-500 text-white': !noIconBG,\r\n 'text-blue-500': noIconBG\r\n })}\r\n >\r\n <Icon\r\n spin={!!option.loading}\r\n size=\"sm\"\r\n icon={\r\n option.loading\r\n ? 'spinner-third'\r\n : noIconBG && !!option.icon\r\n ? option.icon\r\n : 'check'\r\n }\r\n />\r\n </div>\r\n </div>}\r\n {!selected &&\r\n !!option.icon &&\r\n <div className={classNames('clear-both')}>\r\n <div\r\n className={classNames('rounded-full flex-center', {\r\n 'w-8 h-8 float-right mb-1': !inlineIcon,\r\n 'w-6 h-6 absolute top-1/2 transform -translate-y-1/2 right-0 mr-2': inlineIcon,\r\n 'bg-gray-500 text-white': !noIconBG,\r\n 'text-gray-500': noIconBG\r\n })}\r\n >\r\n <Icon\r\n spin={!!option.loading}\r\n icon={\r\n option.loading && option.icon\r\n ? 'spinner-third'\r\n : option.icon\r\n }\r\n />\r\n </div>\r\n </div>}\r\n <h3\r\n className={classNames('capitalize font-bold text-sm relative', {\r\n 'text-left mb-1': !!option.info,\r\n 'text-center': !option.info,\r\n 'text-blue-500': selected,\r\n 'text-gray-600': !selected,\r\n 'flex items-center justify-between': option.withSwitch\r\n })}\r\n >\r\n {option.beta &&\r\n <SideBarBadge\r\n className={classNames(\r\n 'flex-center bg-orange-500 transform -translate-y-full'\r\n )}\r\n style={{ top: -2, right: -2 }}\r\n >\r\n Beta\r\n </SideBarBadge>}\r\n {option.label}\r\n {option.withSwitch &&\r\n <div className={classNames('clear-both')}>\r\n <Switch BindToContext={BindToContext} />\r\n </div>}\r\n </h3>\r\n {!!option.title &&\r\n <p className={classNames('text-gray-600 text-xs font-bold mb-2')}>\r\n {option.title}\r\n </p>}\r\n {!!option.info &&\r\n !option.infoHtml &&\r\n <p className={classNames('text-gray-500 text-xs italic h-full')}>\r\n {option.info}\r\n </p>}\r\n {!!option.info &&\r\n !!option.infoHtml &&\r\n <p\r\n className={classNames('text-gray-500 text-xs italic h-full')}\r\n dangerouslySetInnerHTML={{ __html: option.info }}\r\n />}\r\n {!!option.link &&\r\n <div\r\n className={classNames(\r\n 'text-gray-600 text-xs font-semibold underline mt-2 cursor-pointer'\r\n )}\r\n onClick={() => window.open(option.link.href, '_blank')}\r\n >\r\n {option.link.text}\r\n </div>}\r\n </div>\r\n {!isLastButton && showSeparator && <Or isVertical={isVertical} />}\r\n {!isLastButton && !showSeparator && <span className={classNames('mx-2')} />}\r\n </Fragment>\r\n );\r\n })}\r\n </div>\r\n );\r\n};\r\n\r\nconst Or = ({ isVertical }) =>\r\n <div\r\n className={classNames(\r\n 'flex justify-center items-center',\r\n isVertical ? 'flex-row w-3/4 my-2 mx-auto' : 'flex-col h-16 mx-2 my-auto'\r\n )}\r\n >\r\n <div\r\n style={{ width: !isVertical && 2, height: isVertical && 2 }}\r\n className={classNames('bg-gray-400 flex-1')}\r\n />\r\n <span className={classNames('text-gray-600 font-bold uppercase', { 'mx-2': isVertical })}>\r\n or\r\n </span>\r\n <div\r\n style={{ width: !isVertical && 2, height: isVertical && 2 }}\r\n className={classNames('bg-gray-400 flex-1')}\r\n />\r\n </div>;\r\nexport default ButtonSelect;\r\n","import React, { useEffect, useState, useRef, useContext } from 'react';\r\nimport Styles from 'styles/sticky_cart_feature_preview.module.scss'\r\nimport PreviewContext from 'context/PreviewContext';\r\nimport { CartContext } from \"components/cart\";\r\n\r\nconst StickyCart = ({ settings, money_format, isPreview, device, product }) => {\r\n\r\n const SC = settings.sticky_cart\r\n // const {\r\n // \tcart_currency\r\n // } = useContext(CartContext);\r\n const {\r\n isUnavailableFocused,\r\n isStickyActVariantFocused,\r\n setIsStickyActVariantFocused\r\n } = useContext(PreviewContext);\r\n\r\n const [variants, setVariants] = useState({})\r\n const [isOpen, setIsOpen] = useState(false)\r\n const [qte, setQte] = useState(1)\r\n\r\n let price = product.variants[0].price\r\n let oldPrice = product.variants[0].compare_at_price || 0\r\n\r\n\r\n const formatColor = (color) => {\r\n if (!color)\r\n color = {\r\n r: 0,\r\n g: 0,\r\n b: 0,\r\n a: 1,\r\n };\r\n return typeof color === 'string' ? color : `rgba(${color.r},${color.g},${color.b},${color.a})`;\r\n };\r\n const formatWithDelimiters = (number, precision = 2, thousands = ',', decimal = '.') => {\r\n if (isNaN(number) || number == null) {\r\n return 0;\r\n }\r\n\r\n number = (number / 100.0).toFixed(precision);\r\n\r\n var parts = number.split('.'),\r\n dollars = parts[0].replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '$1' + thousands),\r\n cents = parts[1] ? decimal + parts[1] : '';\r\n\r\n return dollars + cents;\r\n }\r\n const formatMoney = (n, money_format = '${{amount}}') =>\r\n money_format\r\n .replace(/{{\\s*?amount\\s*?}}/g, formatWithDelimiters(n, 2))\r\n .replace(/{{\\s*?amount_with_decimal_separator\\s*?}}/g, formatWithDelimiters(n, 2))\r\n .replace(/{{\\s*?amount_no_decimals\\s*?}}/g, formatWithDelimiters(n, 0))\r\n .replace(/{{\\s*?amount_with_comma_separator\\s*?}}/g, formatWithDelimiters(n, 2, \".\", \",\"))\r\n .replace(/{{\\s*?amount_no_decimals_with_comma_separator\\s*?}}/g, formatWithDelimiters(n, 0, \".\", \",\"))\r\n .replace(/{{\\s*?amount_with_apostrophe_separator\\s*? }}/g, formatWithDelimiters(n, 2, \"'\", \".\"))\r\n .replace(/{{\\s*?amount_no_decimals\\s*? }}/g, formatWithDelimiters(n, 2, \"'\", \".\"));\r\n\r\n\r\n useEffect(() => {\r\n\r\n const selectedVariants = {}\r\n\r\n product.options.forEach(option => {\r\n selectedVariants['option' + option.position] = option.name\r\n })\r\n setVariants(\r\n selectedVariants\r\n )\r\n\r\n\r\n // auto close the selects\r\n window.addEventListener('click', function (e) {\r\n const selects = document.querySelectorAll('[data-open=\"open\"]')\r\n // console.log(selects)\r\n selects.forEach(select => {\r\n if (select && !select.contains(e.target)) {\r\n select.dataset.open = \"close\"\r\n }\r\n })\r\n\r\n });\r\n\r\n }, [])\r\n\r\n const changeSelect = (value, position) => {\r\n let tmpVariants = variants\r\n tmpVariants['option' + position] = value\r\n setVariants(\r\n { ...tmpVariants }\r\n )\r\n }\r\n const handleMobileAtcClick = () => {\r\n if (SC.mobile_show_quantity || SC.mobile_show_variants) setIsOpen(!isOpen)\r\n }\r\n\r\n useEffect(() => {\r\n if (!SC.mobile_show_quantity && !SC.mobile_show_variants) setIsOpen(false)\r\n }, [SC.mobile_show_quantity, SC.mobile_show_variants])\r\n\r\n const toggleOpen = (element) => {\r\n // element.currentTarget.focus()\r\n const state = element.currentTarget.dataset.open\r\n element.currentTarget.dataset.open = state === \"open\" ? \"close\" : \"open\"\r\n }\r\n\r\n const mobile_cart_position = SC.mobile_location\r\n return (\r\n <>\r\n {device === \"desktop\" &&\r\n <div\r\n className={`${Styles.desktopStickyCartContainar} ${SC.btn_style === \"curvy\" && Styles.curvy}`}\r\n style={{\r\n background: formatColor(SC.background_color),\r\n bottom: '10px',\r\n opacity: 1,\r\n visibility: SC.desktop_active ? \"visible\" : \"hidden\",\r\n }}>\r\n <div className={Styles.detailsSection}>\r\n {SC.desktop_product_preview && product.images.length && (product.images[0].src || typeof (product.images[0]) === \"string\") &&\r\n <img\r\n src={product.images[0].src || product.images[0]}\r\n alt=\"product image\"\r\n className={Styles.image}\r\n />\r\n }\r\n\r\n <div className={Styles.details}>\r\n {SC.desktop_show_product_name &&\r\n <div className={Styles.title}>\r\n {product.title}\r\n </div>\r\n }\r\n <span className={Styles.price}>\r\n {SC.desktop_show_compared_price && oldPrice != 0 &&\r\n <span className={Styles.oldPrice} dangerouslySetInnerHTML={{ __html: formatMoney(oldPrice, money_format) }}></span>\r\n }\r\n <span style={{ color: formatColor(SC.btn_color) }} dangerouslySetInnerHTML={{ __html: formatMoney(price, money_format) }}></span>\r\n </span>\r\n </div>\r\n </div>\r\n <div className={Styles.actionsSection}>\r\n\r\n {SC.desktop_show_variants && product.variants.length > 1 &&\r\n product.options.map((option, id) => {\r\n return (\r\n <div className={` ${Styles.map_select_containar} `} key={id}>\r\n <div className={` ${Styles.label} `}>\r\n {option.name}\r\n </div>\r\n <div\r\n key={\"options-\" + id}\r\n className={` ${Styles.map_select} `}\r\n data-open=\"close\"\r\n onClick={(e) => toggleOpen(e)}\r\n >\r\n\r\n <span className={Styles.current}> {option.values[0]} </span>\r\n <ul className={Styles.list} style={{ bottom: \"68px\" }}>\r\n {\r\n option.values.map((value, id) => <li key={id} data-value={id}\r\n data-display={value}\r\n className={` ${Styles.option} ${id === 0 && Styles.selected} `}>{value}</li>)\r\n }\r\n </ul>\r\n </div>\r\n </div>\r\n )\r\n })\r\n }\r\n\r\n {SC.desktop_show_quantity &&\r\n\r\n <div>\r\n <div className={` ${Styles.label} `}>\r\n {SC.desktop_quantity.text}\r\n </div>\r\n <div className={Styles.qte}>\r\n <span onClick={() => setQte(qte < 2 ? 1 : parseInt(qte, 10) - 1)}\r\n className={Styles.minus}>-</span>\r\n <input\r\n type=\"number\"\r\n value={qte}\r\n min={1}\r\n />\r\n <span onClick={() => setQte(parseInt(qte, 10) + 1)} className={Styles.minus}>+</span>\r\n </div>\r\n </div>\r\n }\r\n\r\n <div\r\n className={Styles.atc}\r\n style={{\r\n background: formatColor(SC.btn_color),\r\n color: formatColor(SC.txt_color),\r\n }}\r\n >\r\n {isUnavailableFocused ? SC.btn_text_unavailable : SC.btn_text}\r\n {/* BUY NOW */}\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n {\r\n device === \"mobile\" &&\r\n <>\r\n <div\r\n className={`${Styles.background}`}\r\n data-open={isOpen}\r\n onClick={() => setIsOpen(false)}\r\n ></div>\r\n <div\r\n className={Styles.mobileStickyCartContainar}\r\n style={{\r\n background: formatColor(SC.background_color),\r\n [mobile_cart_position]: 0,\r\n opacity: 1,\r\n }}\r\n >\r\n <div className={`${Styles.actionsSection}`} data-open={isOpen}>\r\n {!isOpen ?\r\n SC.mobile_show_title || SC.mobile_show_price ?\r\n <div className={Styles.infos}>\r\n <span className={Styles.title}> {SC.mobile_show_title && product.title} </span>\r\n {\r\n SC.mobile_show_price &&\r\n <span className={Styles.price} style={{ color: formatColor(SC.btn_color) }}>\r\n {SC.mobile_show_compared_price && oldPrice != 0 &&\r\n <span className={Styles.oldPrice} dangerouslySetInnerHTML={{ __html: formatMoney(oldPrice, money_format) }}></span>\r\n }\r\n <span className={Styles.current} dangerouslySetInnerHTML={{ __html: formatMoney(price, money_format) }} ></span>\r\n </span>\r\n }\r\n </div>\r\n :\r\n null\r\n :\r\n <div className={Styles.cart}>\r\n <div className={Styles.header}>\r\n <div className={Styles.txt}>\r\n <svg width=\"19\" height=\"18\" viewBox=\"0 0 19 18\" fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\">\r\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\r\n d=\"M4.64135 0.422363H0.53125V2.13789H3.29187L5.66684 13.0122H5.67782V13.2888H16.8287V13.076L18.71 4.78919L18.9995 3.85341H5.38207L4.89284 1.61338L4.64135 0.422363ZM16.8175 5.56893H5.75674L7.06809 11.5733H15.4544L16.8175 5.56893Z\"\r\n fill=\"#393939\" />\r\n <path\r\n d=\"M8.25166 17.5776C9.19914 17.5776 9.96718 16.8096 9.96718 15.8621C9.96718 14.9146 9.19914 14.1465 8.25166 14.1465C7.3042 14.1465 6.53613 14.9146 6.53613 15.8621C6.53613 16.8096 7.3042 17.5776 8.25166 17.5776Z\"\r\n fill=\"#393939\" />\r\n <path\r\n d=\"M15.9711 15.8621C15.9711 16.8096 15.203 17.5776 14.2556 17.5776C13.3081 17.5776 12.54 16.8096 12.54 15.8621C12.54 14.9146 13.3081 14.1465 14.2556 14.1465C15.203 14.1465 15.9711 14.9146 15.9711 15.8621Z\"\r\n fill=\"#393939\" />\r\n </svg>\r\n {SC.cart_name.text}\r\n <div className={Styles.close} onClick={() => setIsOpen(false)}>\r\n <svg width=\"11\" height=\"11\" viewBox=\"0 0 12 12\" fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\">\r\n <path\r\n d=\"M12 1.20857L10.7914 0L6 4.79143L1.20857 0L0 1.20857L4.79143 6L0 10.7914L1.20857 12L6 7.20857L10.7914 12L12 10.7914L7.20857 6L12 1.20857Z\"\r\n fill=\"#959595\" />\r\n </svg>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <div className={Styles.body}>\r\n <div className={Styles.infos}>\r\n {product.images.length && (product.images[0].src || typeof (product.images[0]) === \"string\") &&\r\n <img\r\n src={product.images[0].src || product.images[0]}\r\n alt=\"product image\"\r\n className={Styles.image}\r\n />\r\n }\r\n <span className={Styles.title}> {product.title} </span>\r\n <span className={Styles.price} style={{ color: formatColor(SC.btn_color) }}>\r\n {\r\n SC.mobile_show_compared_price && oldPrice != 0 &&\r\n <span className={Styles.oldPrice} dangerouslySetInnerHTML={{ __html: formatMoney(oldPrice, money_format) }} ></span>\r\n }\r\n <span dangerouslySetInnerHTML={{ __html: formatMoney(price, money_format) }} ></span>\r\n </span>\r\n </div>\r\n {SC.mobile_show_quantity &&\r\n <div className={` ${Styles.row} `}>\r\n <div className={` ${Styles.label} `}>\r\n {SC.mobile_quantity.text}\r\n </div>\r\n <div className={Styles.qte}>\r\n <span onClick={() => setQte(qte < 2 ? 1 : parseInt(qte, 10) - 1)}\r\n className={Styles.minus}>-</span>\r\n <input\r\n type=\"number\"\r\n value={qte}\r\n min={1}\r\n />\r\n <span onClick={() => setQte(parseInt(qte, 10) + 1)}\r\n className={Styles.minus}>+</span>\r\n </div>\r\n </div>\r\n }\r\n {SC.mobile_show_variants && product.variants.length > 1 &&\r\n product.options.map((option, id) => {\r\n return (\r\n <div className={` ${Styles.row} `} key={id}>\r\n <div className={` ${Styles.label} `}>\r\n {option.name}\r\n </div>\r\n <div\r\n key={\"options-\" + id}\r\n className={` ${Styles.map_select} `}\r\n data-open=\"close\"\r\n onClick={(e) => toggleOpen(e)}\r\n >\r\n\r\n <span className={Styles.current}> {option.values[0]} </span>\r\n <ul className={Styles.list} style={{ bottom: \"68px\" }}>\r\n {\r\n option.values.map((value, id) => <li key={id}\r\n data-value={id}\r\n data-display={value}\r\n className={` ${Styles.option} ${id === 0 && Styles.selected} `}>{value}</li>)\r\n }\r\n </ul>\r\n </div>\r\n </div>\r\n )\r\n })\r\n }\r\n </div>\r\n </div>\r\n\r\n }\r\n <div\r\n className={Styles.atc}\r\n style={{\r\n background: formatColor(SC.btn_color),\r\n color: formatColor(SC.txt_color),\r\n height: SC.mobile_atc_height.text + \"px\"\r\n }}\r\n onClick={handleMobileAtcClick}\r\n >\r\n {isUnavailableFocused ? SC.btn_text_unavailable :\r\n isOpen ? SC.btn_text_variant_active :\r\n (isStickyActVariantFocused && SC.show_btn_atc_txt_variant_active) ? SC.btn_atc_txt_variant_active : SC.btn_text\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </>\r\n }\r\n\r\n </>\r\n\r\n )\r\n}\r\n\r\n\r\nexport default StickyCart\r\n\r\n","import React, { useState, useContext, useEffect } from 'react';\r\nimport styles from 'styles/preview.module.scss';\r\nimport { PreviewProvider } from 'context/PreviewContext';\r\nimport { Spinner, Cart, Icon } from 'components';\r\nimport UserContext from 'context/UserContext';\r\nimport ShopContext from 'context/ShopContext';\r\nimport Axios from 'axios';\r\nimport { NEW_CAMPAIGN_INITIAL_STATE } from 'lib/globals';\r\nimport { API } from 'aws-amplify';\r\nimport classNames from 'lib/classNames';\r\nimport { fakePreviewProducts } from './cart/Utils';\r\nimport { default as StickyCart } from './stickyCart';\r\nconst cache = {};\r\n\r\nconst Preview = ({ children, openByDefault, noCampaign }) => {\r\n const [collapsed, setCollapsed] = useState(!openByDefault);\r\n const [campaignsFilter, setCampaignsFilter] = useState([]);\r\n const [compareAtMap, setCompareAtMap] = useState({});\r\n const [preview_active_campaign, setCampaign] = useState(null);\r\n const [cartItems, setCartItems] = useState([]);\r\n const [campaigns, setCampaigns] = useState(null);\r\n const [loading, setLoading] = useState(false);\r\n const [previewError, setPreviewError] = useState('');\r\n const [lastCampaign, setLastCampaign] = useState(null);\r\n const [cartIsEmpty, setCartIsEmpty] = useState(false);\r\n const [bundlesVariantPickerPreview, setBundlesVariantPickerPreview] = useState(null);\r\n const [autoDiscount, setAutoDiscount] = useState(false);\r\n const [giftCurrentPreview, setGiftCurrentPreview] = useState('before');\r\n const [isStickyActVariantFocused, setIsStickyActVariantFocused] = useState(false);\r\n const [checkoutButtonLoadingEdit, setCheckoutButtonLoadingEdit] =\r\n useState(false);\r\n const [showSubscription, setShowSubscription] = useState(false);\r\n const [comfirmOrderButtonLoadingEdit, setComfirmOrderButtonLoadingEdit] = useState(false);\r\n const [showATUAfterText, setShowATUAfterText] = useState(false);\r\n const [editingProductDetails, setEditingProductDetails] = useState(false);\r\n const [product, setProduct] = useState(null);\r\n const [orderCodForm, setOrderCodForm] = useState({});\r\n const [isCodFormSubmitted, setIsCodFormSubmitted] = useState(false);\r\n\r\n const [campaign_preview_types, setCampaign_preview_types] = useState([\r\n // 'bundles',\r\n // 'add_to_unlock',\r\n // 'one_check_up_sell',\r\n //\r\n ]);\r\n function previewBundlesVariantsPicker(status,bundles){\r\n console.log(product);\r\n const preview =status && product ? {\r\n product,\r\n quantity: 1,\r\n countStartAt:1,\r\n bundles,\r\n onConfirm: () => {},\r\n onClose: async () => {}\r\n }: null;\r\n setBundlesVariantPickerPreview(preview)\r\n }\r\n const {\r\n attributes: { website }\r\n } = useContext(UserContext);\r\n const {\r\n state: { settings, money_format, currency },\r\n AppLocalStorage\r\n } = useContext(ShopContext);\r\n const previewCampaign = (campaign, openPreview = true) => {\r\n // if (!collapsed && campaign == preview_active_campaign) setCollapsed(true);\r\n // else {\r\n // \tsetCampaign(campaign);\r\n // }\r\n // console.log(campaign.settings.add_to_unlock.goals[0].gift.products[0]);\r\n // debugger;\r\n setCampaign(campaign);\r\n if (openPreview) setCollapsed(false);\r\n };\r\n const mergeCompareAt = (data) => {\r\n setCompareAtMap(Object.assign({}, compareAtMap, data));\r\n };\r\n\r\n const PREVIEW_CAN_RENDER_ONLY_WITH_CAMPAIGN = !noCampaign && !!campaigns && !!settings;\r\n const PREVIEW_CAN_RENDER_WITHOUT_CAMPAIGN = !!noCampaign && !!settings;\r\n const CAN_RENDER_CART =\r\n !loading &&\r\n (!!cartItems.length || !!cartIsEmpty) &&\r\n (!!PREVIEW_CAN_RENDER_ONLY_WITH_CAMPAIGN || !!PREVIEW_CAN_RENDER_WITHOUT_CAMPAIGN);\r\n\r\n const isStickyPreview = window.location.pathname === '/sticky';\r\n\r\n useEffect(() => {\r\n const generateFakeCartItems = async (campaign) => {\r\n setLoading(true);\r\n setLastCampaign(campaign);\r\n let queryStringParameters = null;\r\n let productGetter;\r\n const isSpecificWithNoSelected = campaign?.target?.type !== 'all_products' && !campaign?.target?.selected?.length\r\n if (!campaign || campaign.target.type === 'all_products' || isSpecificWithNoSelected) {\r\n queryStringParameters = {};\r\n } else if (\r\n campaign.target.type === 'specific_products' &&\r\n campaign.target.selected?.length\r\n ) {\r\n queryStringParameters = { handle: campaign.target.selected[0].handle };\r\n } else if (\r\n campaign.target.type === 'specific_collections' &&\r\n campaign.target.selected?.length\r\n ) {\r\n // console.log(campaign.target.selected)\r\n queryStringParameters = {\r\n collection_id: campaign.target.selected[0].id\r\n };\r\n }\r\n if (queryStringParameters || !campaign?.target?.selected?.length) {\r\n let product = queryStringParameters\r\n ? await (async () => {\r\n try {\r\n const key = JSON.stringify(queryStringParameters);\r\n if (cache[key]) return cache[key];\r\n const data = await API.get('API_GATEWAY_NEW', '/products', {\r\n queryStringParameters: { limit: 5, ...queryStringParameters }\r\n })\r\n cache[key] = data.products.find(\r\n (prd) =>\r\n prd.variants.every((v) => Number(v.price) > 0) &&\r\n (prd.variants[0].featured_image?.src || prd.images?.length)\r\n ) || data.products[0];\r\n return cache[key];\r\n } catch (_error) {\r\n return undefined;\r\n }\r\n })()\r\n : fakePreviewProducts('20.00', 5)[0];\r\n if (product === undefined) product = fakePreviewProducts('20.00', 5)[0];\r\n if (!product) return setPreviewError('Sorry, there are no products to preview');\r\n setProduct(product);\r\n const { variants, title, images, id } = product;\r\n const variant = variants[0];\r\n const image =\r\n variant.featured_image?.src || product.images?.length\r\n ? product.images[0].src\r\n : 'https://cdn.shopify.com/s/files/1/0459/2081/3221/t/4/assets/product-placeholder.png?v=1662386189';\r\n const price = parseFloat((parseFloat(variant.price) * 100).toFixed(0));\r\n const cartItemQuantity = campaign?.settings?.type === \"bundles\" && campaign?.settings?.bundles?.list?.length ?\r\n campaign?.settings?.bundles?.list[0].quantity || 1 : 1\r\n setCartItems([\r\n {\r\n ...variant,\r\n price,\r\n product_title: title,\r\n image,\r\n discounts: autoDiscount\r\n ? [\r\n {\r\n title: '10% OFF',\r\n amount: price / 10\r\n }\r\n ]\r\n : [],\r\n line_level_discount_allocations: [\r\n {\r\n discount_application: {\r\n type: 'automatic'\r\n }\r\n }\r\n ],\r\n discounted_price: autoDiscount ? price - price / 10 : price,\r\n quantity: cartItemQuantity,\r\n variant_id: variant.id\r\n }\r\n ]);\r\n setCompareAtMap(\r\n settings.count_compare_at\r\n ? {\r\n [variant.id]: variant.compare_at_price\r\n ? Number(variant.compare_at_price) * 100\r\n : undefined\r\n }\r\n : {}\r\n );\r\n if (campaign) {\r\n setCampaigns({\r\n [variant.product_id]: [\r\n {\r\n type: campaign.settings.type,\r\n [campaign.settings.type]: campaign.settings[campaign.settings.type],\r\n multi_one_check_upsell:\r\n campaign.settings.type === 'one_check_up_sell'\r\n ? campaign.settings.multi_one_check_upsell\r\n : undefined\r\n }\r\n ]\r\n });\r\n }\r\n setLoading(false);\r\n }\r\n };\r\n\r\n if (!lastCampaign || !cartItems || lastCampaign.target !== preview_active_campaign.target \r\n || lastCampaign.settings.type !== preview_active_campaign.settings.type\r\n || JSON.stringify(lastCampaign.settings.bundles.list) !== JSON.stringify(preview_active_campaign.settings.bundles.list)\r\n ) {\r\n generateFakeCartItems(preview_active_campaign);\r\n } else if (preview_active_campaign && cartItems.length) {\r\n setCampaigns({\r\n [cartItems[0].product_id]: [\r\n {\r\n type: preview_active_campaign.settings.type,\r\n [preview_active_campaign.settings.type]:\r\n preview_active_campaign.settings[preview_active_campaign.settings.type],\r\n multi_one_check_upsell:\r\n preview_active_campaign.settings.type === 'one_check_up_sell'\r\n ? preview_active_campaign.settings.multi_one_check_upsell\r\n : undefined\r\n }\r\n ]\r\n });\r\n }\r\n }, [preview_active_campaign, settings.count_compare_at, autoDiscount]);\r\n\r\n useEffect(() => {\r\n if (noCampaign && Object.keys(cartItems).length) {\r\n const {\r\n modules: { checkout_button },\r\n theme: { primary, secondary, background },\r\n font: { color: font_color }\r\n } = settings;\r\n const [{ product_id }] = cartItems;\r\n const fakeCampaigns = campaign_preview_types.map((type) =>\r\n NEW_CAMPAIGN_INITIAL_STATE(\r\n { checkout_button, primary, secondary, font_color, background, type },\r\n settings.default_language,\r\n currency\r\n )\r\n );\r\n setCampaigns({\r\n [product_id]: fakeCampaigns.map(({ settings }) => ({\r\n type: settings.type,\r\n [settings.type]: settings[settings.type]\r\n }))\r\n });\r\n }\r\n return () => {\r\n\r\n }\r\n }, [noCampaign,cartItems, settings, campaign_preview_types]);\r\n\r\n const getSettings = () => {\r\n if (!preview_active_campaign) {\r\n return {\r\n ...settings,\r\n money_format\r\n };\r\n }\r\n const campaignModules = preview_active_campaign.settings.modules;\r\n return {\r\n ...settings,\r\n money_format,\r\n modules: {\r\n ...campaignModules,\r\n checkout_button: settings.modules.checkout_button,\r\n order_note: campaignModules?.order_note || settings.modules.order_note,\r\n order:\r\n campaignModules.order.indexOf('order_note') === -1\r\n ? [...campaignModules.order, 'order_note']\r\n : campaignModules.order\r\n }\r\n };\r\n };\r\n\r\n return (\r\n <PreviewProvider\r\n value={{\r\n collapsed,\r\n setCollapsed,\r\n setCartIsEmpty,\r\n setAutoDiscount,\r\n setGiftCurrentPreview,\r\n isStickyActVariantFocused,\r\n setIsStickyActVariantFocused,\r\n setCheckoutButtonLoadingEdit,\r\n setComfirmOrderButtonLoadingEdit,\r\n setShowATUAfterText,\r\n editingProductDetails,\r\n setEditingProductDetails,\r\n previewCampaign,\r\n preview_active_campaign,\r\n campaign_preview_types: {\r\n get: campaign_preview_types,\r\n set: setCampaign_preview_types\r\n },\r\n previewBundlesVariantsPicker,\r\n showSubscription,\r\n setShowSubscription\r\n }}\r\n >\r\n <div className={styles.wrapper}>\r\n <div className={styles.content}>{children}</div>\r\n <div\r\n className={styles.preview}\r\n data-collapsed={collapsed}\r\n data-curved={settings?.curved}\r\n id=\"monster_preview\"\r\n style={{ background: isStickyPreview ? '#f6f7fb' : '' }}\r\n >\r\n {previewError && (\r\n <div className={classNames('h-full flex-center flex-col p-3')}>\r\n <Icon\r\n icon=\"exclamation-triangle\"\r\n className=\"text-red-500 mb-2\"\r\n size=\"2x\"\r\n />\r\n <p className={classNames('text-red-500 text-sm')}>{previewError}</p>\r\n </div>\r\n )}\r\n {!CAN_RENDER_CART && !previewError && <Spinner text=\"Fetching product\" />}\r\n {CAN_RENDER_CART && !previewError && !isStickyPreview && (\r\n <Cart\r\n campaigns={campaigns}\r\n shop_settings={getSettings()}\r\n shop_url={website}\r\n compareAtMap={compareAtMap}\r\n cart_items={cartIsEmpty ? [] : cartItems}\r\n bundlesVariantPickerPreview={bundlesVariantPickerPreview}\r\n giftCurrentPreview={giftCurrentPreview}\r\n isPreview={true}\r\n showSubscription={showSubscription}\r\n cart_currency={currency}\r\n setCompareAtMap={mergeCompareAt}\r\n showCheckoutLoading={checkoutButtonLoadingEdit}\r\n showComfirmOrderLoading={comfirmOrderButtonLoadingEdit}\r\n showATUAfterText={showATUAfterText}\r\n {...{\r\n orderCodForm,\r\n setOrderCodForm,\r\n isCodFormSubmitted,\r\n setIsCodFormSubmitted\r\n }}\r\n forcePreview={\r\n editingProductDetails && product\r\n ? { ...product, showAddCartButton: true }\r\n : null\r\n }\r\n AppLocalStorage={AppLocalStorage}\r\n />\r\n )}\r\n {product && !previewError && isStickyPreview && (\r\n <div className={styles.mobileContainar}>\r\n <StickyCart\r\n settings={settings}\r\n device=\"mobile\"\r\n product={product}\r\n isPreview={true}\r\n />\r\n </div>\r\n )}\r\n </div>\r\n\r\n {product && !previewError && isStickyPreview && (\r\n <StickyCart\r\n settings={settings}\r\n money_format={money_format}\r\n device=\"desktop\"\r\n product={product}\r\n isPreview={true}\r\n />\r\n )}\r\n </div>\r\n </PreviewProvider>\r\n );\r\n};\r\n\r\nexport default Preview;\r\n","import React, { useState, useEffect, useRef } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Button } from 'components';\r\nimport styles from 'styles/actions_buttons.module.scss';\r\nimport useHover from 'hooks/useHover';\r\nimport { useResponsive } from 'react-hooks-responsive'\r\n\r\n\r\nconst ActionsButtons = ({ item, actions }) => {\r\n\tconst [collapsed, setCollapsed] = useState(true);\r\n\tconst getProperValue = (value, item) => (typeof value === 'function' ? value(item) : value);\r\n\tconst button_ref = useRef(null);\r\n\tconst actions_ref = useRef(null);\r\n\tconst breakpoints = { xs: 0, sm: 1045, md: 1200 }\r\n\tconst { size, orientation, screenIsAtLeast, screenIsAtMost } = useResponsive(breakpoints)\r\n\r\n\t// useEffect(() => {\r\n\t// \tdocument.addEventListener('click', handleClick, false);\r\n\t// \treturn () => {\r\n\t// \t\tdocument.removeEventListener('click', handleClick, false);\r\n\t// \t};\r\n\t// }, [collapsed]);\r\n\r\n\t// const handleClick = event => {\r\n\t// \tconst node = button_ref.current;\r\n\t// \tif (!node) return;\r\n\t// \tif (node.contains(event.target)) {\r\n\t// \t\t//click inside the button\r\n\t// \t\treturn setCollapsed(!collapsed); //toggle\r\n\t// \t}\r\n\t// \t//click outside the button\r\n\t// \tsetCollapsed(true); //close\r\n\t// \treturn true;\r\n\t// };\r\n\r\n\treturn (\r\n\t\t<div\r\n\t\t\tclassName={styles.actions}\r\n\t\t\tref={actions_ref}\r\n\t\t>\r\n\t\t\t<div\r\n\t\t\t\tclassName={styles.actions_wrapper}\r\n\t\t\t\tdata-collapsed={collapsed}\r\n\t\t\t\tdata-popover={screenIsAtMost('sm')}\r\n\t\t\t\tonMouseEnter={() => setCollapsed(false)}\r\n\t\t\t\tonMouseLeave={() => setCollapsed(true)}\r\n\t\t\t>\r\n\t\t\t\t{screenIsAtMost('sm') && <Button\r\n\t\t\t\t\tclassName={styles.action_button_menu}\r\n\t\t\t\t\ticon=\"ellipsis-v\"\r\n\t\t\t\t\treact_ref={button_ref}\r\n\t\t\t\t\ttype=\"circle-secondary\"\r\n\t\t\t\t\tstyle={{ margin: '7px', flexShrink: 0 }}\r\n\t\t\t\t/>}\r\n\t\t\t\t{(screenIsAtMost('sm') ? !collapsed : true) && (\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t{actions.map((action, key) => {\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\tclassName={styles.action_button}\r\n\t\t\t\t\t\t\t\t\tkey={key}\r\n\t\t\t\t\t\t\t\t\ticon={getProperValue(action.icon, item)}\r\n\t\t\t\t\t\t\t\t\tid={item.id}\r\n\t\t\t\t\t\t\t\t\tonClick={() => action.method(item)}\r\n\t\t\t\t\t\t\t\t\ttype={`circle-${getProperValue(action.color, item)}`}\r\n\t\t\t\t\t\t\t\t\tstyle={{ margin: '7px' }}\r\n\t\t\t\t\t\t\t\t\tdisabled={getProperValue(action.disabled,item)}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nActionsButtons.propTypes = {};\r\n\r\nexport default ActionsButtons;\r\n","import React, { useContext } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport NotifyContext from \"context/NotifyContext\";\r\nimport { Button, Icon, Alert } from \"components\";\r\nimport styles from \"styles/notifications.module.scss\";\r\nimport useReactRouter from \"use-react-router\";\r\nimport _ from \"lodash\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nconst Notifications = () => {\r\n const { state: notifications } = useContext(NotifyContext);\r\n const { history } = useReactRouter();\r\n const uniqNotifications = _.uniqBy(Object.values(notifications), \"id\").filter(\r\n ({ exclude = [], only = [] }) => {\r\n if (exclude.length && exclude.includes(history.location.pathname))\r\n return false;\r\n if (only.length && !only.includes(history.location.pathname))\r\n return false;\r\n return true;\r\n }\r\n );\r\n return !!uniqNotifications.length ? (\r\n <div className={classNames(\"px-6 pt-6\")}>\r\n {uniqNotifications.map((notification, index) => (\r\n <Notification key={index} {...notification} />\r\n ))}\r\n </div>\r\n ) : null;\r\n};\r\n\r\nNotifications.propTypes = {};\r\n\r\nconst Notification = ({\r\n type,\r\n icon,\r\n title,\r\n content = null,\r\n action = null,\r\n closeable = true\r\n}) => {\r\n const icons = {\r\n info: \"info-square\",\r\n warning: \"exclamation-square\"\r\n };\r\n return (\r\n <Alert\r\n {...{ type, title, closeable, icon, className: \"mb-2\" }}\r\n actions={action ? [action] : []}\r\n >\r\n {!!content && <p>{content}</p>}\r\n </Alert>\r\n );\r\n};\r\n\r\nexport default Notifications;\r\n","import React, { useEffect } from 'react';\r\nimport InputRange from 'react-input-range';\r\nimport useBindToContext from 'hooks/useBindToContext';\r\nimport 'styles/range.css';\r\n\r\nconst Range = ({\r\n\tmax = 100,\r\n\tmin = 0,\r\n\tstep = 1,\r\n\tvalue = null,\r\n\tonChange = null,\r\n\tBindToContext = null,\r\n\tvalidation = true,\r\n\tgetError = null,\r\n\tspecificValidation = null,\r\n\tformatter = (value) => parseFloat(value.toFixed(2)),\r\n}) => {\r\n\tconst [BindedValue, BindedOnChange, onRender] = useBindToContext(\r\n\t\tBindToContext,\r\n\t\tvalue,\r\n\t\tonChange,\r\n\t\tspecificValidation,\r\n\t\tgetError,\r\n\t\tvalidation\r\n\t);\r\n\r\n\t//useEffect(() => {\r\n\t\t//if (onRender?.length) onRender.forEach(fn => fn());\r\n\t//}, [onRender]);\r\n\r\n\treturn (\r\n\t\t<InputRange\r\n\t\t\tmaxValue={max}\r\n\t\t\tminValue={min}\r\n\t\t\tstep={step}\r\n\t\t\tstyle={{\r\n\t\t\t\tzIndex: 1,\r\n\t\t\t\tmarginBottom: 20,\r\n\t\t\t}}\r\n\t\t\tvalue={parseFloat(BindedValue)}\r\n\t\t\tonChange={(value) => BindedOnChange(formatter(value))}\r\n\t\t/>\r\n\t);\r\n};\r\n\r\nexport default Range;\r\n","import React, { useContext, useEffect } from \"react\";\r\n\r\nimport { Icon } from \"components\";\r\nimport useBindToContext from \"hooks/useBindToContext\";\r\nimport styles from \"styles/product_selector.module.scss\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport { formatMoney } from \"components/cart/Utils\";\r\n\r\nconst ProductSelector = ({\r\n\tproducts,\r\n\tcontext,\r\n\tshowCreate,\r\n\treducer,\r\n\tBindToContext = null,\r\n\tvalue = null,\r\n\tonChange = null,\r\n\tpresets = false,\r\n\tselectedProduct\r\n}) => {\r\n\tconst [BindedValue, BindedOnChange, __, onRender] = useBindToContext(BindToContext, value, onChange);\r\n\tconst {\r\n\t\tstate: { money_format }\r\n\t} = useContext(ShopContext);\r\n\t//useEffect(() => {\r\n\t\t//if (onRender?.length) onRender.forEach(fn => fn());\r\n\t//}, [onRender]);\r\n\r\n\treturn (\r\n\t\t<div className={styles.container}>\r\n\t\t\t{products.length > 0 &&\r\n\t\t\t\tproducts.map((product, key) => {\r\n\t\t\t\t\t// console.log(product)\r\n\t\t\t\t\tconst selected = BindedValue ? product.id.toString() === BindedValue.id : false;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\tclassName={styles.tile}\r\n\t\t\t\t\t\t\tdata-selected={!!selected}\r\n\t\t\t\t\t\t\tkey={key}\r\n\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\tpresets\r\n\t\t\t\t\t\t\t\t\t? onChange(product.id)\r\n\t\t\t\t\t\t\t\t\t: BindedOnChange({ ...reducer(product), image: product.image.src })\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\tclassName={`${styles.product} ${selected ? styles.selected : \"\"}`}\r\n\t\t\t\t\t\t\t\tkey={`p-${product.id}`}\r\n\t\t\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\t\t\tbackgroundImage: `url(${product.image.src ? product.image.src : product.image})`\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t></div>\r\n\t\t\t\t\t\t\t<div className={styles.title}>{product.title}</div>\r\n\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\tclassName={styles.priceTag}\r\n\t\t\t\t\t\t\t\tdangerouslySetInnerHTML={{\r\n\t\t\t\t\t\t\t\t\t__html: formatMoney(\r\n\t\t\t\t\t\t\t\t\t\t(presets ? product.price : product.variants[0].price) * 100,\r\n\t\t\t\t\t\t\t\t\t\tmoney_format\r\n\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{}\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t{!presets && (\r\n\t\t\t\t<div className={styles.add} onClick={() => showCreate()}>\r\n\t\t\t\t\t<div className={styles.inside}>\r\n\t\t\t\t\t\t<div>Create New</div>\r\n\t\t\t\t\t\t<Icon icon=\"plus\" size=\"lg\" style={{ color: \"#a2a2a2\" }} />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default ProductSelector;\r\n","import React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport styles from 'styles/image_picker.module.scss';\r\nimport { DragAndDrop, Icon } from 'components';\r\nimport {\r\n\tfaUpload,\r\n} from '@fortawesome/fontawesome-pro-solid';\r\nimport classNames from 'lib/classNames';\r\nimport { API } from 'aws-amplify';\r\nimport useRefState from 'hooks/useRefState';\r\n\r\nconst ImagePicker = ({ onChange, value, simplified = false }) => {\r\n\tconst input = useRef(null);\r\n\tconst [preview, setPreview] = useState(value)\r\n\tconst readImage = ({ target }) => {\r\n\t\tif (target.files && target.files[0]) {\r\n\t\t\tconst file = target.files[0]\r\n\t\t\tconst reader = new FileReader();\r\n\t\t\treader.onload = async function (event) {\r\n\t\t\t\t//TODO: update ui to show a loading indicator\r\n\t\t\t\tconst value = event.target.result\r\n\t\t\t\tsetPreview(value)\r\n\t\t\t\tconst body = {\r\n\t\t\t\t\tfileName: file.name,\r\n\t\t\t\t\tattachment: value.replace(/data:.*\\/.*;base64,/, \"\")\r\n\t\t\t\t}\r\n\t\t\t\t// const response = await API.post(\"API_GATEWAY_NEW\", \"/uploadImage\", { body });\r\n\t\t\t\t// console.log(\"response\", response);\r\n\t\t\t\t// onChange(response.public_url);\r\n\t\t\t};\r\n\t\t\treader.readAsDataURL(file);\r\n\t\t}\r\n\t};\r\n\tconst handleDrop = files => {\r\n\t\tinput.current.files = files;\r\n\t\treadImage({ target: input.current });\r\n\t};\r\n\tconst id = `fp-${new Date().getTime()}`;\r\n\tconst hasPreview = value || preview\r\n\treturn (\r\n\t\t<div className={styles.ImagePicker}>\r\n\t\t\t<input type=\"file\" id={id} onChange={e => readImage(e)} ref={input} />\r\n\t\t\t<label htmlFor={id} className=\"label\">\r\n\t\t\t\t{\r\n\t\t\t\t\tsimplified ?\r\n\t\t\t\t\t\t<span className={classNames('flex-1 flex-grow ml-2 text-gray-500 text-sm font-bold cursor-pointer')}>Upload my own <Icon icon={faUpload} color=\"\" /></span>\r\n\t\t\t\t\t\t:\r\n\t\t\t\t\t\t<DragAndDrop handleDrop={f => handleDrop(f)}>\r\n\t\t\t\t\t\t\t{hasPreview && (\r\n\t\t\t\t\t\t\t\t<Fragment>\r\n\t\t\t\t\t\t\t\t\t<div className={styles.previewWrapper}>\r\n\t\t\t\t\t\t\t\t\t\t<div className={styles.previewImage} style={{ backgroundImage: `url(${preview})` }} />\r\n\t\t\t\t\t\t\t\t\t\t{value && <div className={styles.image} style={{ backgroundImage: `url(${value})` }} />}\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t<small>Change</small>\r\n\t\t\t\t\t\t\t\t</Fragment>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t{!hasPreview && (\r\n\t\t\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\t\t\t<b>Choose an image </b> or drag it here.\r\n\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</DragAndDrop>\r\n\t\t\t\t}\r\n\r\n\t\t\t</label>\r\n\t\t</div>\r\n\t);\r\n};\r\nconst ImagePicker2 = ({ onChange, value }) => {\r\n\tconst reader = useMemo(() => new FileReader(), []);\r\n\tconst input = useRef(null);\r\n\tconst [preview, setPreview, previewRef] = useRefState(value)\r\n\tconst [uploading, setUploading, uploadingRef] = useRefState(false)\r\n\tconst readImage = ({ target }) => {\r\n\t\tif (target.files && target.files[0]) {\r\n\t\t\tsetUploading(true)\r\n\t\t\treader.readAsDataURL(target.files[0]);\r\n\t\t}\r\n\t};\r\n\tconst handleDrop = files => {\r\n\t\tinput.current.files = files;\r\n\t\treadImage({ target: input.current });\r\n\t};\r\n\tconst id = `fp-${new Date().getTime()}`;\r\n\tconst hasPreview = value || previewRef.current\r\n\tuseEffect(() => {\r\n\t\tasync function OnLoad (event) {\r\n\t\t\tconst value = event.target.result\r\n\t\t\tsetPreview(value)\r\n\t\t\tconst body = {\r\n\t\t\t\tfileName: input.current.files[0]?.name || `image_${(new Date()).getTime()}`,\r\n\t\t\t\tattachment: value\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tconst response = await API.post(\"API_GATEWAY_NEW\", \"/uploadImage\", { body });\r\n\t\t\t\tonChange(response.public_url);\r\n\t\t\t\tsetPreview(response.public_url)\r\n\t\t\t} catch (error) {\r\n\t\t\t\tsetPreview(undefined)\r\n\t\t\t}\r\n\t\t\tsetUploading(false)\r\n\t\t};\r\n\t\treader.addEventListener('load', OnLoad);\r\n\t\treturn () => {\r\n\t\t\treader.removeEventListener('load', OnLoad);\r\n\t\t}\r\n\t}, [reader])\r\n\treturn (\r\n\t\t<Fragment>\r\n\t\t\t<input type=\"file\" className={classNames(\"hidden\")} id={id} onChange={e => readImage(e)} ref={input} />\r\n\t\t\t<label htmlFor={id} className={classNames(\"flex justify-center w-full h-32 px-4 transition bg-white border-2 border-gray-300 border-dashed rounded-md appearance-none cursor-pointer hover:border-gray-400 focus:outline-none\")}>\r\n\t\t\t\t<DragAndDrop handleDrop={f => handleDrop(f)} className={classNames(\"w-full h-full flex-center space-x-2\")}>\r\n\t\t\t\t\t{/* <div className={classNames(\"w-full h-full flex-center space-x-2\")}> */}\r\n\t\t\t\t\t{hasPreview && (\r\n\t\t\t\t\t\t<Fragment>\r\n\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t<div className={classNames(\"w-24 h-24 rounded bg-cover bg-center border-2 border-white shadow rounded\")} style={{ backgroundImage: `url(${previewRef.current})` }}>\r\n\t\t\t\t\t\t\t\t\t<div className={classNames(\"flex-center w-full h-full bg-cover bg-center\")} style={{\r\n\t\t\t\t\t\t\t\t\t\tbackground: uploadingRef.current ? \"rgba(255,255,255,0.72)\" : undefined,\r\n\t\t\t\t\t\t\t\t\t}}>\r\n\t\t\t\t\t\t\t\t\t\t<svg className={classNames(\"fa-spin h-5 w-5 text-blue-500\", { hidden: !uploadingRef.current })} xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\">\r\n\t\t\t\t\t\t\t\t\t\t\t<circle className={classNames(\"opacity-25\")} cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\"></circle>\r\n\t\t\t\t\t\t\t\t\t\t\t<path className={classNames(\"opacity-75\")} fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"></path>\r\n\t\t\t\t\t\t\t\t\t\t</svg>\r\n\t\t\t\t\t\t\t\t\t\t<span className={classNames(\"bg-black text-white font-bold p-2 rounded bg-opacity-60 text-xxs tracking-wider uppercase\", { hidden: uploading || !value })}>change</span>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</Fragment>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{!hasPreview && (\r\n\t\t\t\t\t\t<div className={classNames(\"flex flex-col\")}>\r\n\t\t\t\t\t\t\t<div className={classNames(\"opacity-0 mb-2 mx-auto\") + \" \" + styles.dots} />\r\n\t\t\t\t\t\t\t<div className={classNames(\"flex space-x-2\")}>\r\n\t\t\t\t\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" className={classNames(\"w-6 h-6 text-gray-600\")} fill=\"none\" viewBox=\"0 0 24 24\"\r\n\t\t\t\t\t\t\t\t\tstroke=\"currentColor\" strokeWidth=\"2\">\r\n\t\t\t\t\t\t\t\t\t<path strokeLinecap=\"round\" strokeLinejoin=\"round\"\r\n\t\t\t\t\t\t\t\t\t\td=\"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12\" />\r\n\t\t\t\t\t\t\t\t</svg>\r\n\t\t\t\t\t\t\t\t<span className={classNames(\"font-semibold text-gray-600\")}>\r\n\t\t\t\t\t\t\t\t\tDrop images here, or <span className={classNames(\"text-blue-500 underline\")}>browse</span>\r\n\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div className={classNames(uploadingRef.current && !previewRef.current ? \"visible\" : \"invisible\", \"mt-2 mx-auto\") + \" \" + styles.dots} />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t)}\r\n\t\t\t\t\t{/* </div> */}\r\n\t\t\t\t</DragAndDrop>\r\n\t\t\t</label>\r\n\t\t</Fragment>\r\n\t);\r\n};\r\n\r\nexport default ImagePicker2;\r\n","import React, { useState, useRef, useEffect } from 'react';\r\nimport styles from 'styles/drag_and_drop.module.scss';\r\n\r\nconst DragAndDrop = props => {\r\n\tconst { noClass, className, children } = props\r\n\tconst [state, setState] = useState({ drag: false });\r\n\tconst dropRef = useRef(null);\r\n\r\n\tconst handleDrag = e => {\r\n\t\te.preventDefault();\r\n\t\t// e.stopPropagation();\r\n\t};\r\n\r\n\tconst handleDragIn = e => {\r\n\t\te.preventDefault();\r\n\t\t// e.stopPropagation();\r\n\t\tif (e.dataTransfer.items && e.dataTransfer.items.length > 0) {\r\n\t\t\tsetState({ drag: true });\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleDragOut = e => {\r\n\t\te.preventDefault();\r\n\t\t// e.stopPropagation();\r\n\t\tsetState({ drag: false });\r\n\t};\r\n\r\n\tconst handleDrop = e => {\r\n\t\te.preventDefault();\r\n\t\t// e.stopPropagation();\r\n\t\tsetState({ drag: false });\r\n\t\tif (e.dataTransfer.files && e.dataTransfer.files.length > 0) {\r\n\t\t\tprops.handleDrop(e.dataTransfer.files);\r\n\t\t\te.dataTransfer.clearData();\r\n\t\t}\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tlet div = dropRef.current;\r\n\t\tdiv.addEventListener('dragenter', handleDragIn);\r\n\t\tdiv.addEventListener('dragleave', handleDragOut);\r\n\t\tdiv.addEventListener('dragover', handleDrag);\r\n\t\tdiv.addEventListener('drop', handleDrop);\r\n\t\treturn () => {\r\n\t\t\tlet div = dropRef.current;\r\n\t\t\tdiv.removeEventListener('dragenter', handleDragIn);\r\n\t\t\tdiv.removeEventListener('dragleave', handleDragOut);\r\n\t\t\tdiv.removeEventListener('dragover', handleDrag);\r\n\t\t\tdiv.removeEventListener('drop', handleDrop);\r\n\t\t};\r\n\t}, []);\r\n\r\n\treturn (\r\n\t\t<div ref={dropRef} className={noClass || className ? className : `${styles.dragAndDrop} ${state.drag ? styles.dragging : ''}`}>\r\n\t\t\t{children}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default DragAndDrop;\r\n","import React, { useMemo, useRef } from 'react';\r\nimport useBindToContext from 'hooks/useBindToContext';\r\nimport ReactQuill from 'react-quill';\r\nimport uuid from 'uuid/v1';\r\nimport { GOOGLE_FONTS } from 'lib/globals';\r\nimport 'react-quill/dist/quill.snow.css';\r\nimport classNames from 'lib/classNames';\r\nimport { API } from 'aws-amplify';\r\n\r\nconst getColors = (value) => {\r\n\tconst array = [];\r\n\tif (value === null || value === undefined) return [];\r\n\tif (typeof value === 'string' && new RegExp('^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$').test(value)) array.push(value);\r\n\telse if (typeof value === 'object') {\r\n\t\tObject.entries(value).forEach(([key, v]) => {\r\n\t\t\tarray.push(getColors(value[key]));\r\n\t\t});\r\n\t}\r\n\treturn array;\r\n};\r\n\r\nconst RichEditor = ({\r\n\tBindToContext,\r\n\tvalue,\r\n\tonChange,\r\n\tspecificValidation = null,\r\n\tgetError = null,\r\n\tvalidation = null,\r\n\tdisabled = false,\r\n\tonFocus = null,\r\n\tonBlur = null,\r\n\tplaceholder = undefined,\r\n\timageEmoji = false,\r\n\trtl = false,\r\n\tdebug = false,\r\n\tindicator\r\n}) => {\r\n\tconst id = uuid();\r\n\tconst editorRef = useRef(null);\r\n\tconst colors = BindToContext ? [...new Set(getColors(BindToContext[0].state).flat(Infinity))] : [];\r\n\tconst [BindedValue, BindedOnChange, _hasError, onRender] = useBindToContext(\r\n\t\tBindToContext,\r\n\t\tvalue,\r\n\t\tonChange,\r\n\t\tspecificValidation,\r\n\t\tgetError,\r\n\t\tvalidation,\r\n\t\tdebug\r\n\t);\r\n\tconst input = document.createElement(\"input\");\r\n\tinput.setAttribute(\"type\", \"file\");\r\n\tinput.setAttribute(\"accept\", \"image/*\");\r\n\tinput.onchange = async () => {\r\n\t\tconst file = input.files[0];\r\n\t\tif (/^image\\//.test(file?.type)) {\r\n\t\t\ttry {\r\n\t\t\t\tconst reader = new FileReader();\r\n\t\t\t\treader.readAsDataURL(file)\r\n\t\t\t\treader.onload = async (event) => {\r\n\t\t\t\t\tconst attachment = event.target.result\r\n\t\t\t\t\tconst fileName = file.name\r\n\t\t\t\t\tconst response = await API.post(\"API_GATEWAY_NEW\", \"/uploadImage\", {\r\n\t\t\t\t\t\tbody: { fileName, attachment }\r\n\t\t\t\t\t});\r\n\t\t\t\t\tconst editor = editorRef.current.getEditor();\r\n\t\t\t\t\teditor.insertEmbed(editor.getSelection(), \"image\", response.public_url);\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.log(error.message);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconsole.log('You could only upload images.');\r\n\t\t}\r\n\t};\r\n\r\n\tconst modules = useMemo(\r\n () => ({\r\n toolbar: {\r\n container: [\r\n [{ size: [\"small\", false, \"large\", \"huge\"] }],\r\n [\"bold\", \"italic\", \"underline\", \"strike\"],\r\n [{ align: [] }],\r\n // [{ color: colors }],\r\n\t\t [{ color: ['#000000', '#e60000', '#ff9900', '#ffff00', '#008a00', '#0066cc', '#9933ff', '#ffffff', '#facccc', '#ffebcc', '#ffffcc', '#cce8cc', '#cce0f5', '#ebd6ff', '#bbbbbb', '#f06666', '#ffc266', '#ffff66', '#66b966', '#66a3e0', '#c285ff', '#888888', '#a10000', '#b26b00', '#b2b200', '#006100', '#0047b2', '#6b24b2', '#444444', '#5c0000', '#663d00', '#666600', '#003700', '#002966', '#3d1466', 'custom-color'] }],\r\n [\"image\", \"direction\"],\r\n [\"link\"],\r\n ],\r\n handlers: {\r\n image: async () => {\r\n console.log(\"working\");\r\n input.click();\r\n return true;\r\n },\r\n color: function (value) {\r\n if (value == \"custom-color\")\r\n value = window.prompt(\"Enter Hex Color Code\");\r\n this.quill.format(\"color\", value);\r\n },\r\n },\r\n },\r\n }),\r\n []\r\n );\r\n\r\n\treturn (\r\n\t\t<div>\r\n\t\t\t<ReactQuill\r\n\t\t\t\tid={id}\r\n\t\t\t\tclassName={classNames('bg-white', {\r\n\t\t\t\t\t'emoji-image': imageEmoji,\r\n\t\t\t\t})}\r\n\t\t\t\tref={editorRef}\r\n\t\t\t\ttheme=\"snow\"\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\tvalue={BindedValue}\r\n\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\tonChange={(value) => BindedOnChange(value)}\r\n\t\t\t\tonFocus={() => {\r\n\t\t\t\t\tif (onFocus) onFocus();\r\n\t\t\t\t}}\r\n\t\t\t\tonBlur={() => {\r\n\t\t\t\t\tif (onBlur) {\r\n\t\t\t\t\t\tconst editor = document.getElementById(id);\r\n\t\t\t\t\t\tconst activeElement = document.activeElement;\r\n\t\t\t\t\t\tonBlur(editor, activeElement);\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\tmodules={modules}\r\n\t\t\t/>\r\n\t\t\t{\r\n\t\t\t\tindicator && <p className={classNames(\"text-gray-500 text-xs italic\")}>{indicator}</p>\r\n\t\t\t}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default RichEditor;\r\n","import classNames from \"lib/classNames\";\r\nimport React from \"react\"\r\n\r\nexport default function Bindings ({ only = [], custom = null }) {\r\n return (\r\n <div className={classNames(\"flex flex-wrap items-center text-xs py-1\")}>\r\n You can use\r\n {Object.entries({\r\n goal: \"goal\",\r\n amount_left: \"goal minus total\",\r\n reward: \"reward\"\r\n })\r\n .filter(([key]) => {\r\n if (!only.length && !custom) return true;\r\n return only.includes(key);\r\n })\r\n .concat(custom ? [custom] : [])\r\n .map(([binding, tooltip], key) => {\r\n return (\r\n <div className={classNames(\"relative parent mx-1\")} key={key}>\r\n <span\r\n className={classNames(\"font-bold text-gray-500 hover:text-blue-500 cursor-pointer\")}\r\n >{`{{${binding}}}`}</span>\r\n <div\r\n className={classNames(\r\n \"absolute mt-1 bg-black text-white rounded left-0 bottom-full hidden parent-hover:block\"\r\n )}\r\n style={{\r\n width: \"max-content\"\r\n }}\r\n >\r\n <div className={classNames(\"relative py-1 px-4\")}>\r\n <svg\r\n className={classNames(\r\n \"absolute text-black h-2 left-0 ml-3 top-0 transform -translate-y-1/2\"\r\n )}\r\n x=\"0px\"\r\n y=\"0px\"\r\n viewBox=\"0 0 255 255\"\r\n xmlSpace=\"preserve\"\r\n >\r\n <polygon\r\n className={classNames(\"fill-current\")}\r\n points=\"0,127.5 127.5,0 255,127.5\"\r\n />\r\n </svg>\r\n {tooltip}\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n })}\r\n </div>\r\n );\r\n}","import React, { useReducer, useEffect } from \"react\";\r\nimport { getIn } from \"immutable\";\r\nimport { FormControl, Input } from \"components\";\r\nimport Bindings from \"./Bindings\";\r\n\r\nconst CustomText = ({\r\n\tcontext,\r\n\tclassName = \"\",\r\n\tlabel,\r\n\tpath,\r\n\tmin = 0.5,\r\n\tmax = 2,\r\n\thasColor,\r\n\thasNumber = true,\r\n\thasWeight = false, // or the default weight value\r\n\tonFocus,\r\n\tonBlur,\r\n\twithSwitch,\r\n\tlabelColor,\r\n\tmarginBottom,\r\n\tinfo,\r\n\ttext,\r\n\tisSingleCol,\r\n\tbindings,\r\n\tindicator,\r\n\tbeta\r\n}) => {\r\n\tconst { state, setItem, validationErrors } = context;\r\n\tconst textPAth = path + \".text\";\r\n\tconst fontSizePath = path + \".font_size\";\r\n\tconst fontWeightPath = path + \".font_weight\";\r\n\tconst colorPath = path + \".color\";\r\n\tconst withWeight = hasWeight ? {\r\n\t\tvalue: getIn(state, fontWeightPath.split(\".\")) || hasWeight,\r\n\t\tonChange: (e) => {\r\n\t\t\t// setItem(fontWeightPath, JSON.parse(e.target.value)); editable with arrows only\r\n\t\t},\r\n\t\tonClick: (value) => {\r\n\t\t\tif (value >= 100 && value <= 900)\r\n\t\t\t\tsetItem(fontWeightPath, JSON.parse(value));\r\n\t\t},\r\n\t\tmin: 100,\r\n\t\tmax: 900,\r\n\t\tstep: 100\r\n\t} : undefined\r\n\tconst withNumber = hasNumber\r\n\t\t? {\r\n\t\t\tvalue: getIn(state, fontSizePath.split(\".\")),\r\n\t\t\tonChange: (e) => {\r\n\t\t\t\tif (e.target.value >= min && e.target.value <= max)\r\n\t\t\t\t\tsetItem(fontSizePath, JSON.parse(e.target.value));\r\n\t\t\t},\r\n\t\t\tonClick: (value) => {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tif (value >= min && value <= max)\r\n\t\t\t\t\t\tsetItem(fontSizePath, JSON.parse(value.toFixed(2)));\r\n\t\t\t\t} catch (e) {\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t},\r\n\t\t\ticon: { char: \"EM\" },\r\n\t\t\tmin,\r\n\t\t\tmax,\r\n\t\t\tstep: 0.1\r\n\t\t}\r\n\t\t: undefined;\r\n\tconst withColor = hasColor\r\n\t\t? {\r\n\t\t\tvalue: getIn(state, colorPath.split(\".\")),\r\n\t\t\tonChange: (value) => setItem(colorPath, value)\r\n\t\t}\r\n\t\t: false;\r\n\r\n\treturn (\r\n\t\t<FormControl\r\n\t\t\tlabel={label}\r\n\t\t\tinfo={info}\r\n\t\t\tclassName={className}\r\n\t\t\terror={validationErrors[textPAth] || validationErrors[fontSizePath]}\r\n\t\t\tlabelColor={labelColor}\r\n\t\t\twithSwitch={withSwitch}\r\n\t\t\tmarginBottom={marginBottom}\r\n\t\t\tbeta={beta}\r\n\t\t\tisSingleCol\r\n\t\t>\r\n\t\t\t<Input\r\n\t\t\t\ttype=\"text\"\r\n\t\t\t\tBindToContext={[context, textPAth]}\r\n\t\t\t\t{...{\r\n\t\t\t\t\tonFocus,\r\n\t\t\t\t\tonBlur,\r\n\t\t\t\t\twithColor,\r\n\t\t\t\t\twithNumber,\r\n\t\t\t\t\twithWeight,\r\n\t\t\t\t\tindicator\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t\t{\r\n\t\t\t\tbindings && <Bindings {...bindings} />\r\n\t\t\t}\r\n\t\t</FormControl>\r\n\t);\r\n};\r\n\r\nexport default CustomText;\r\n","import React, { useState, useEffect, useRef } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { Manager, Reference, Popper } from 'react-popper';\r\nimport Moment from 'moment';\r\nimport { extendMoment } from 'moment-range';\r\n\r\n// import classNames from 'lib/classNames';\r\nimport styles from 'styles/date_range.module.scss';\r\nimport { Icon, Calendar } from 'components';\r\n\r\nconst moment = extendMoment(Moment);\r\nconst defaultPeriods = [\r\n\t{ label: 'Today', range: moment.range([moment().startOf('day'), moment().endOf('day')]) },\r\n\t{\r\n\t\tlabel: 'Yesterday',\r\n\t\trange: moment.range([moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')]),\r\n\t},\r\n\t{ label: 'This Week', range: moment.range([moment().startOf('week'), moment().endOf('week')]) },\r\n\t{\r\n\t\tlabel: 'Last Week',\r\n\t\trange: moment.range([\r\n\t\t\tmoment().subtract(1, 'weeks').startOf('week'),\r\n\t\t\tmoment().subtract(1, 'weeks').endOf('week'),\r\n\t\t]),\r\n\t},\r\n\t{\r\n\t\tlabel: 'This Month',\r\n\t\trange: moment.range([moment().startOf('month'), moment().endOf('month')]),\r\n\t},\r\n\t{\r\n\t\tlabel: 'Last Month',\r\n\t\trange: moment.range([\r\n\t\t\tmoment().subtract(1, 'months').startOf('month'),\r\n\t\t\tmoment().subtract(1, 'months').endOf('month'),\r\n\t\t]),\r\n\t},\r\n\t{ label: 'All Time', range: null },\r\n];\r\n\r\nconst DateRange = ({ onChange, value, children, button, maxDate, className, minDate, style = {} }) => {\r\n\tconst contentRef = useRef(null);\r\n\tconst tagRef = useRef(null);\r\n\tconst [visible, setVisible] = useState(false);\r\n\tconst handleOutSideClick = (event) => {\r\n\t\tif (!contentRef.current) return;\r\n\t\telse if (contentRef.current.contains(event.target)) return;\r\n\t\tsetVisible(false);\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (visible) document.addEventListener('mousedown', handleOutSideClick, false);\r\n\t\telse document.removeEventListener('mousedown', handleOutSideClick, false);\r\n\t\treturn () => {\r\n\t\t\tdocument.removeEventListener('mousedown', handleOutSideClick, false);\r\n\t\t};\r\n\t}, [visible]);\r\n\r\n\tconst formateUnLabeledRange = () => {\r\n\t\tconst range = [...new Set(value.map((date) => moment(date).format('MMM DD YYYY')))];\r\n\r\n\t\treturn range.length === 2 ? `${range[0]} - ${range[1]}` : range[0];\r\n\t};\r\n\tconst formatTagText = () => {\r\n\t\tconst isLabeled = defaultPeriods.find(({ range }) =>\r\n\t\t\tvalue && range ? moment.range(value).isSame(range) : value === range\r\n\t\t);\r\n\t\treturn isLabeled ? isLabeled.label : formateUnLabeledRange();\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div style={style} className={className} ref={contentRef}>\r\n\t\t\t<Manager>\r\n\t\t\t\t<Reference>\r\n\t\t\t\t\t{({ ref }) => (\r\n\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\t\tstyle={{ width: '100%', ...(button.style || {}) }}\r\n\t\t\t\t\t\t\tclassName={styles.trigger}\r\n\t\t\t\t\t\t\tonClick={(event) => {\r\n\t\t\t\t\t\t\t\tif (tagRef.current && tagRef.current.contains(event.target)) return;\r\n\t\t\t\t\t\t\t\tsetVisible(!visible);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tdata-active={!!value}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{button.icon && <Icon icon={button.icon} className=\"mr-2\" />}\r\n\t\t\t\t\t\t\t{button.text}\r\n\r\n\t\t\t\t\t\t\t<Tag\r\n\t\t\t\t\t\t\t\tforwardRef={tagRef}\r\n\t\t\t\t\t\t\t\ttext={formatTagText()}\r\n\t\t\t\t\t\t\t\tclosable={!!value}\r\n\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\tonChange(null);\r\n\t\t\t\t\t\t\t\t\tsetVisible(false);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Reference>\r\n\t\t\t\t<Popper\r\n\t\t\t\t\tplacement=\"right-start\"\r\n\t\t\t\t\tpositionFixed={false}\r\n\t\t\t\t\tmodifiers={{\r\n\t\t\t\t\t\tpreventOverflow: { enabled: true },\r\n\t\t\t\t\t\toffset: { offset: '100%r,-100%r', enabled: true },\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t{({ ref, style, placement, arrowProps }) => {\r\n\t\t\t\t\t\treturn visible ? (\r\n\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\tref={ref}\r\n\t\t\t\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\t\t\t\t...style,\r\n\t\t\t\t\t\t\t\t\t\tzIndex: 100,\r\n\t\t\t\t\t\t\t\t\t\tmarginTop: 10,\r\n\t\t\t\t\t\t\t\t\t\tborderRadius: 4,\r\n\t\t\t\t\t\t\t\t\t\tboxShadow: '0 1px 5px rgba(0, 0, 0, 0.46)',\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tdata-placement={placement}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<DateRangePicker value={value} onChange={(value) => onChange(value)} />\r\n\t\t\t\t\t\t\t\t\t<div ref={arrowProps.ref} style={arrowProps.style} />\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t) : null;\r\n\t\t\t\t\t}}\r\n\t\t\t\t</Popper>\r\n\t\t\t</Manager>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nconst Tag = ({ text, onClick, forwardRef, closable }) => {\r\n\treturn (\r\n\t\t<div className={styles.tag}>\r\n\t\t\t<div className={styles.text}>{text}</div>\r\n\t\t\t{closable && (\r\n\t\t\t\t<div className={styles.close} ref={forwardRef} onClick={() => onClick()}>\r\n\t\t\t\t\t<svg\r\n\t\t\t\t\t\theight=\"14\"\r\n\t\t\t\t\t\twidth=\"14\"\r\n\t\t\t\t\t\tviewBox=\"0 0 20 20\"\r\n\t\t\t\t\t\taria-hidden=\"true\"\r\n\t\t\t\t\t\tfocusable=\"false\"\r\n\t\t\t\t\t\tclassName=\"css-tj5bde-Svg\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<path d=\"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z\"></path>\r\n\t\t\t\t\t</svg>\r\n\t\t\t\t</div>\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default DateRange;\r\n\r\nconst DateRangePicker = ({ periods, value, onChange }) => {\r\n\treturn (\r\n\t\t<div className={styles.DateRangePicker}>\r\n\t\t\t<div className={styles.menu}>\r\n\t\t\t\t{periods.map(({ label, range }, i) => {\r\n\t\t\t\t\tconst active = value && range ? moment.range(value).isSame(range) : value === range;\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<span key={i} data-active={active} onClick={() => onChange(range ? range.toDate() : null)}>\r\n\t\t\t\t\t\t\t{label}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t</div>\r\n\t\t\t<Calendar range={value} onChange={(value) => onChange(value)} />\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nDateRangePicker.propTypes = {};\r\n\r\nDateRangePicker.defaultProps = {\r\n\tperiods: defaultPeriods,\r\n};\r\n","import React, { useState, useEffect } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport styles from 'styles/calendar.module.scss';\r\nimport { Icon, Dropdown } from 'components';\r\nimport Moment from 'moment';\r\nimport { extendMoment } from 'moment-range';\r\nconst moment = extendMoment(Moment);\r\n\r\nconst Calendar = ({ range, onChange }) => {\r\n\tconst [activePicker, setActivePicker] = useState('days');\r\n\tconst [dateObject, setDateObject] = useState(moment());\r\n\tconst [month, setMonth] = useState(moment(dateObject).format('MMMM'));\r\n\tconst [year, setYear] = useState(parseInt(moment(dateObject).format('YYYY')));\r\n\tconst [lastMonth, setLastMonth] = useState(\r\n\t\tmoment(dateObject)\r\n\t\t\t.subtract(1, 'months')\r\n\t\t\t.format('MMMM')\r\n\t);\r\n\tconst [nextMonth, setNextMonth] = useState(\r\n\t\tmoment(dateObject)\r\n\t\t\t.add(1, 'months')\r\n\t\t\t.format('MMMM')\r\n\t);\r\n\tuseEffect(() => {\r\n\t\tsetDateObject(moment(`${month}/${year}`));\r\n\t\tconst last_month = moment(`${month}/${year}`)\r\n\t\t\t.subtract(1, 'months')\r\n\t\t\t.format('MMMM');\r\n\t\tconst next_month = moment(`${month}/${year}`)\r\n\t\t\t.add(1, 'months')\r\n\t\t\t.format('MMMM');\r\n\t\tsetLastMonth(last_month);\r\n\t\tsetNextMonth(next_month);\r\n\t}, [month, year]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!range) {\r\n\t\t\tsetMonth(moment().format('MMMM'));\r\n\t\t\tsetYear(moment().format('YYYY'));\r\n\t\t} else if (Array.isArray(range) && range.length === 2) {\r\n\t\t\tsetMonth(moment(range[0]).format('MMMM'));\r\n\t\t\tsetYear(moment(range[0]).format('YYYY'));\r\n\t\t}\r\n\t}, [range]);\r\n\r\n\treturn (\r\n\t\t<div className={styles.calendar}>\r\n\t\t\t<div className={styles.header}>\r\n\t\t\t\t<Icon\r\n\t\t\t\t\tsize=\"lg\"\r\n\t\t\t\t\ticon=\"caret-left\"\r\n\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\tif (lastMonth === 'December') setYear(year - 1);\r\n\t\t\t\t\t\tsetMonth(lastMonth);\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t\t<div className={styles.selects}>\r\n\t\t\t\t\t<b onClick={() => setActivePicker('months')}>{month}</b>\r\n\t\t\t\t\t<b onClick={() => setActivePicker('years')}>{year}</b>\r\n\t\t\t\t</div>\r\n\t\t\t\t<Icon\r\n\t\t\t\t\tsize=\"lg\"\r\n\t\t\t\t\ticon=\"caret-right\"\r\n\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\tif (nextMonth === 'January') setYear(year + 1);\r\n\t\t\t\t\t\tsetMonth(nextMonth);\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t\t{activePicker === 'days' && <DaysPicker {...{ dateObject, range, onChange }} />}\r\n\t\t\t{activePicker === 'months' && (\r\n\t\t\t\t<MonthPicker\r\n\t\t\t\t\tactive={month}\r\n\t\t\t\t\tonChange={month => {\r\n\t\t\t\t\t\tsetMonth(month);\r\n\t\t\t\t\t\tsetActivePicker('days');\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t\t{activePicker === 'years' && (\r\n\t\t\t\t<YearsPicker\r\n\t\t\t\t\tactive={year}\r\n\t\t\t\t\tonChange={year => {\r\n\t\t\t\t\t\tsetYear(year);\r\n\t\t\t\t\t\tsetActivePicker('days');\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nCalendar.propTypes = {};\r\n\r\nCalendar.defaultProps = {};\r\n\r\nexport default Calendar;\r\n\r\nconst DaysPicker = ({ dateObject, range, onChange }) => {\r\n\tconst [selectedRange, setSelectedRangeState] = useState(range);\r\n\tconst [isSliding, setIsSliding] = useState(false);\r\n\tconst isArray = length => array => Array.isArray(array) && array.length === length;\r\n\tconst setSelectedRange = (range, fireOnChange = true) => {\r\n\t\tsetSelectedRangeState(range);\r\n\t\tif (fireOnChange) {\r\n\t\t\tconst formatRange = isArray(2)(range)\r\n\t\t\t\t? moment.range([moment(range[0]).startOf('day'), moment(range[1]).endOf('day')]).toDate()\r\n\t\t\t\t: null;\r\n\t\t\tonChange(formatRange);\r\n\t\t}\r\n\t};\r\n\tconst [tempRange, setTempRange] = useState(null);\r\n\tconst [previewRange, setPreviewRange] = useState(null);\r\n\tconst [mouseIsDown, setMouseIsDown] = useState(false);\r\n\r\n\tconst weekDayShort = moment.weekdaysShort();\r\n\tconst monthDaysCount = moment(dateObject).daysInMonth();\r\n\tconst currentMonthIsActive = moment(dateObject).format('MM/YYYY') === moment().format('MM/YYYY');\r\n\tconst currentDay = currentMonthIsActive ? parseInt(moment().format('D')) : null;\r\n\tconst firstDayOfMonth = parseInt(\r\n\t\tmoment(dateObject)\r\n\t\t\t.startOf('month')\r\n\t\t\t.format('d')\r\n\t);\r\n\tconst lastMonthDaysCount = moment(dateObject)\r\n\t\t.subtract(1, 'months')\r\n\t\t.daysInMonth();\r\n\r\n\tconst handleMouseDown = date => {\r\n\t\tsetMouseIsDown(true);\r\n\t\tif (!tempRange) {\r\n\t\t\tsetTempRange([new Date(date)]);\r\n\t\t\tsetSelectedRange(null);\r\n\t\t} else if (isArray(1)(tempRange)) {\r\n\t\t\tconst newSelectedRange = tempRange.concat([new Date(date)]).sort((a, b) => a.getTime() - b.getTime());\r\n\t\t\tsetSelectedRange(newSelectedRange);\r\n\t\t\tsetTempRange(null);\r\n\t\t\tsetPreviewRange(null);\r\n\t\t}\r\n\t};\r\n\tconst handleMouseUp = () => {\r\n\t\tsetMouseIsDown(false);\r\n\t\tsetPreviewRange(null);\r\n\t\tif (isArray(2)(selectedRange)) setTempRange(null);\r\n\t\tif (isSliding) {\r\n\t\t\tsetIsSliding(false);\r\n\t\t\tsetSelectedRange(selectedRange);\r\n\t\t}\r\n\t};\r\n\r\n\tconst handleMouseOver = date => {\r\n\t\tif (isArray(1)(tempRange) && (!selectedRange || mouseIsDown)) {\r\n\t\t\tconst newSelectedRange = tempRange.concat([new Date(date)]).sort((a, b) => a.getTime() - b.getTime());\r\n\t\t\tif (mouseIsDown) {\r\n\t\t\t\tsetIsSliding(true);\r\n\t\t\t\tsetSelectedRange(newSelectedRange, false);\r\n\t\t\t\tsetPreviewRange(null);\r\n\t\t\t} else setPreviewRange(newSelectedRange);\r\n\t\t}\r\n\t};\r\n\r\n\tconst isOnRange = date => {\r\n\t\tconst output = { selected: false, isFirst: false, isLast: false };\r\n\t\tif (!selectedRange) return output;\r\n\t\tconst [startDate, endDate] = selectedRange;\r\n\t\tconst momentRange = moment().range(startDate, endDate);\r\n\t\tconst selected = momentRange.contains(new Date(date));\r\n\t\tif (!selected) return output;\r\n\t\tconst isFirst = moment(date).format('MM/DD/YYYY') === moment(startDate).format('MM/DD/YYYY');\r\n\t\tconst isLast = moment(date).format('MM/DD/YYYY') === moment(endDate).format('MM/DD/YYYY');\r\n\t\treturn { selected, isFirst, isLast };\r\n\t};\r\n\r\n\tconst isOnPreviewRange = date => {\r\n\t\tconst output = { preview: false, isFirst: false, isLast: false };\r\n\t\tif (!previewRange) return output;\r\n\t\tconst [startDate, endDate] = previewRange;\r\n\t\tconst momentRange = moment().range(startDate, endDate);\r\n\t\tconst preview = isArray(2)(previewRange) ? momentRange.contains(new Date(date)) : false;\r\n\t\tif (!preview) return output;\r\n\t\tconst isFirst = moment(date).format('MM/DD/YYYY') === moment(startDate).format('MM/DD/YYYY');\r\n\t\tconst isLast = moment(date).format('MM/DD/YYYY') === moment(endDate).format('MM/DD/YYYY');\r\n\t\treturn { preview, isFirst, isLast };\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!range) {\r\n\t\t\tsetSelectedRange(null);\r\n\t\t} else if (\r\n\t\t\tisArray(2)(range) &&\r\n\t\t\t(!selectedRange || (isArray(2)(selectedRange) && !moment.range(range).isSame(moment.range(selectedRange))))\r\n\t\t) {\r\n\t\t\tsetSelectedRange(range);\r\n\t\t}\r\n\t}, [range]);\r\n\r\n\tlet blankDays = new Array(firstDayOfMonth)\r\n\t\t.fill(0)\r\n\t\t.map((_, i) => (\r\n\t\t\t<Day\r\n\t\t\t\tvalue={lastMonthDaysCount - i}\r\n\t\t\t\tisOnRange={isOnRange}\r\n\t\t\t\tisOnPreviewRange={isOnPreviewRange}\r\n\t\t\t\tsetMouseIsDown={setMouseIsDown}\r\n\t\t\t\tdateObject={dateObject}\r\n\t\t\t\tonMouseDown={date => handleMouseDown(date)}\r\n\t\t\t\tonMouseUp={() => handleMouseUp()}\r\n\t\t\t\tonMouseOver={date => handleMouseOver(date)}\r\n\t\t\t\tmonth={moment(dateObject).subtract(1, 'months')}\r\n\t\t\t\tempty={true}\r\n\t\t\t\tkey={i}\r\n\t\t\t/>\r\n\t\t))\r\n\t\t.reverse();\r\n\r\n\tlet daysInMonth = new Array(monthDaysCount).fill(0).map((_, i) => {\r\n\t\tlet attrs = currentDay && currentDay === i + 1 ? { 'data-today': true } : {};\r\n\t\treturn (\r\n\t\t\t<Day\r\n\t\t\t\tisOnRange={isOnRange}\r\n\t\t\t\tisOnPreviewRange={isOnPreviewRange}\r\n\t\t\t\tsetMouseIsDown={setMouseIsDown}\r\n\t\t\t\tvalue={i + 1}\r\n\t\t\t\tdateObject={dateObject}\r\n\t\t\t\tonMouseDown={date => handleMouseDown(date)}\r\n\t\t\t\tonMouseUp={() => handleMouseUp()}\r\n\t\t\t\tonMouseOver={date => handleMouseOver(date)}\r\n\t\t\t\tmonth={moment(dateObject)}\r\n\t\t\t\tkey={firstDayOfMonth + i}\r\n\t\t\t/>\r\n\t\t);\r\n\t});\r\n\tlet totalSlots = [...blankDays, ...daysInMonth];\r\n\tif (totalSlots.length < 35) {\r\n\t\ttotalSlots = totalSlots.concat(\r\n\t\t\tnew Array(35 - totalSlots.length)\r\n\t\t\t\t.fill(0)\r\n\t\t\t\t.map((_, i) => (\r\n\t\t\t\t\t<Day\r\n\t\t\t\t\t\tvalue={i + 1}\r\n\t\t\t\t\t\tisOnRange={isOnRange}\r\n\t\t\t\t\t\tisOnPreviewRange={isOnPreviewRange}\r\n\t\t\t\t\t\tsetMouseIsDown={setMouseIsDown}\r\n\t\t\t\t\t\tdateObject={dateObject}\r\n\t\t\t\t\t\tonMouseDown={date => handleMouseDown(date)}\r\n\t\t\t\t\t\tonMouseUp={() => handleMouseUp()}\r\n\t\t\t\t\t\tmonth={moment(dateObject).add(1, 'months')}\r\n\t\t\t\t\t\tonMouseOver={date => handleMouseOver(date)}\r\n\t\t\t\t\t\tempty={true}\r\n\t\t\t\t\t\tkey={totalSlots.length + i}\r\n\t\t\t\t\t/>\r\n\t\t\t\t))\r\n\t\t);\r\n\t}\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div className={styles.weekDays}>\r\n\t\t\t\t{weekDayShort.map((day, i) => (\r\n\t\t\t\t\t<div key={i}>\r\n\t\t\t\t\t\t<span>{day}</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t))}\r\n\t\t\t</div>\r\n\t\t\t<div\r\n\t\t\t\tclassName={styles.days}\r\n\t\t\t\tonMouseLeave={() => {\r\n\t\t\t\t\tsetPreviewRange(null);\r\n\t\t\t\t\tsetTempRange(null);\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t{totalSlots}\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nconst Day = ({\r\n\tdateObject,\r\n\tvalue,\r\n\tmonth,\r\n\tonMouseDown,\r\n\tonMouseUp,\r\n\tonMouseOver,\r\n\tisOnRange,\r\n\tisOnPreviewRange,\r\n\tempty = false,\r\n}) => {\r\n\tconst date = month.set('date', value).format('MM/DD/YYYY');\r\n\tconst { selected, isFirst, isLast } = isOnRange(date);\r\n\tconst { isFirst: isFirst_p, isLast: isLast_p, preview } = isOnPreviewRange(date);\r\n\treturn (\r\n\t\t<div\r\n\t\t\tclassName={styles.day}\r\n\t\t\tdata-selected={selected}\r\n\t\t\tdata-preview={preview}\r\n\t\t\tdata-first={isFirst || isFirst_p}\r\n\t\t\tdata-last={isLast || isLast_p}\r\n\t\t\tonMouseOver={() => onMouseOver(date)}\r\n\t\t\tonMouseDown={() => onMouseDown(date)}\r\n\t\t\tonMouseUp={() => onMouseUp(false)}\r\n\t\t\tonTouchStart={() => onMouseDown(date)}\r\n\t\t\tonTouchEnd={() => onMouseUp(false)}\r\n\t\t>\r\n\t\t\t<span className={styles.selected} />\r\n\t\t\t<span className={styles.preview} />\r\n\t\t\t<span data-empty={empty} data-selected={selected} data-preview={preview}>\r\n\t\t\t\t{value}\r\n\t\t\t</span>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nconst MonthPicker = ({ active, onChange }) => {\r\n\tconst months = moment.months();\r\n\treturn (\r\n\t\t<div className={styles.months}>\r\n\t\t\t{months.map((month, i) => {\r\n\t\t\t\tlet attrs = active === month ? { 'data-active': true } : {};\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<div key={i}>\r\n\t\t\t\t\t\t<span {...attrs} onClick={() => onChange(month)}>\r\n\t\t\t\t\t\t\t{month}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nconst YearsPicker = ({ active, onChange }) => {\r\n\tconst years = new Array(12).fill(0).map((_, i) => 2019 + i);\r\n\treturn (\r\n\t\t<div className={styles.months}>\r\n\t\t\t{years.map((year, i) => {\r\n\t\t\t\tlet attrs = active === year ? { 'data-active': true } : {};\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<div key={i}>\r\n\t\t\t\t\t\t<span {...attrs} onClick={() => onChange(year)}>\r\n\t\t\t\t\t\t\t{year}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t);\r\n\t\t\t})}\r\n\t\t</div>\r\n\t);\r\n};\r\n","import React from \"react\";\r\nimport { Icon, Button, Switch } from \"components\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nconst Alert = ({\r\n type = \"info\",\r\n title,\r\n children,\r\n icon = null,\r\n desc = null,\r\n withSwitch = null,\r\n actions = [],\r\n style = {},\r\n forwardRef = null,\r\n borderPosition = \"border-l-4\",\r\n paddingX = \"px-2\",\r\n className = \"\",\r\n customStyle = {},\r\n inlineIcon,\r\n iconSize,\r\n closable,\r\n iconColor = \"#748094\",\r\n customSvg = false,\r\n}) => {\r\n const styles = {\r\n loading: {\r\n box: \"border-gray-600 bg-white text-gray-600 \" + borderPosition,\r\n title: \"text-gray-600\",\r\n icon: \"text-orange-500\",\r\n inlineIcon: false,\r\n iconSize: \"1x\",\r\n },\r\n info: {\r\n box: \"border-l-4 border-blue-500 bg-white text-gray-500 text-md\",\r\n title: \"text-gray-600\",\r\n icon: \"text-blue-500\",\r\n },\r\n error: {\r\n box: \"border-l-4 border-red-500 bg-white text-gray-500 text-md\",\r\n title: \"text-red-500\",\r\n icon: \"text-gray-600\",\r\n },\r\n warning: {\r\n box:\r\n \"border-orange-400 bg-white text-gray-800 bg-yellow-100 \" +\r\n borderPosition,\r\n title: \"text-gray-900\",\r\n icon: \"text-orange-400\",\r\n inlineIcon: !!inlineIcon,\r\n iconSize: iconSize,\r\n },\r\n warning_secondary: {\r\n box: \"bg-yellow-200 border-b-2 border-yellow-300 text-yellow-800 rounded text-justify\",\r\n title: \"font-semibold text-yellow-800 mb-2 uppercase text-left\",\r\n icon: \"bg-white text-yellow-500 rounded-full w-10 h-10 flex-center border-2 border-yellow-500\",\r\n iconSize: \"1x\",\r\n inlineIcon: true,\r\n },\r\n success: {\r\n box: \"border-l-4 border-green-400 bg-white text-gray-500\",\r\n title: \"text-gray-600 mb-2\",\r\n icon: \"text-green-400\",\r\n },\r\n save_settings: {\r\n box: \"bg-white h-full max-h-full\",\r\n title: \"text-blue-500 uppercase\",\r\n },\r\n };\r\n return (\r\n <div\r\n className={classNames(\r\n className,\r\n (customStyle.box ? customStyle : styles[type]).box,\r\n \"relative flex items-center text-sm py-2\",\r\n paddingX\r\n )}\r\n ref={forwardRef}\r\n style={style}\r\n >\r\n {icon && !styles[type].inlineIcon && (\r\n <div\r\n className={classNames(\r\n (customStyle.icon ? customStyle : styles[type]).icon,\r\n \"flex items-center justify-center ml-2 mr-4\"\r\n )}\r\n >\r\n {customSvg ? (\r\n <>{icon}</>\r\n ) : (\r\n <Icon\r\n size={styles[type].iconSize || \"2x\"}\r\n icon={icon}\r\n color={iconColor}\r\n />\r\n )}\r\n </div>\r\n )}\r\n <div className={classNames(\"flex-1 flex-grow\")}>\r\n {!!title && (\r\n <h4\r\n className={classNames(\r\n (customStyle.title ? customStyle : styles[type]).title,\r\n \"font-semibold text-base uppercase-first\",\r\n {\r\n \"flex items-center\": styles[type].inlineIcon,\r\n \"mb-2\": !!children,\r\n }\r\n )}\r\n >\r\n {!!styles[type].inlineIcon && (\r\n <div\r\n className={classNames(\r\n (customStyle || styles[type]).icon,\r\n \"flex items-center justify-center mr-2\"\r\n )}\r\n >\r\n <Icon size={styles[type].iconSize || \"2x\"} icon={icon} />\r\n </div>\r\n )}\r\n <div\r\n className={classNames(\"flex-1\")}\r\n dangerouslySetInnerHTML={{\r\n __html: title,\r\n }}\r\n />\r\n </h4>\r\n )}\r\n {!!children && children}\r\n </div>\r\n {!!actions.length && (\r\n <div className={classNames(\"pl-2\")}>\r\n {actions.map((action, i) => (\r\n <Button\r\n className={classNames({ \"mr-2\": i !== actions.length - 1 })}\r\n key={i}\r\n type={action.type || type}\r\n {...action}\r\n />\r\n ))}\r\n </div>\r\n )}\r\n {!!withSwitch && (\r\n <Switch\r\n className={classNames(\"pl-2\")}\r\n BindToContext={withSwitch.context}\r\n {...(withSwitch.props || {})}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Alert;\r\n","import React from 'react';\r\n\r\nimport { Alert, Icon } from 'components';\r\nimport classNames from 'lib/classNames';\r\n\r\nexport default function MultiCurrencyModeAlerts ({\r\n\tenabled_presentment_currencies,\r\n\tdraft_checkout_alerted,\r\n\tmulti_currency_checkout_alerted,\r\n\tsettings,\r\n\tredirectToCheckoutSettings,\r\n\tIUnderstand,\r\n}) {\r\n\tconst showAlerts = enabled_presentment_currencies.length > 1 && !settings.multiCurrencyMode;\r\n\tif (!showAlerts) return null;\r\n\treturn (\r\n\t\t<div>\r\n\t\t\t{!multi_currency_checkout_alerted && (\r\n\t\t\t\t<Alert\r\n\t\t\t\t\t{...{\r\n\t\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\t\tborderPosition: 'border-l-4',\r\n\t\t\t\t\t\ticonSize: '2x',\r\n\t\t\t\t\t\ttitle: 'You have multi-currency enabled in your store',\r\n\t\t\t\t\t\ticon: 'exclamation-circle',\r\n\t\t\t\t\t\tcustomStyle: {\r\n\t\t\t\t\t\t\ticon: 'text-orange-400 self-start mt-1',\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tclassName=\"mt-6 z-5\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<p>\r\n\t\t\t\t\t\tCurrently customers will only be able to checkout with your default store currency. Visit\r\n\t\t\t\t\t\t<span\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'underline cursor-pointer hover:text-orange-500 focus:outline-none font-semibold mx-1'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\tonClick={redirectToCheckoutSettings}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tCheckout Settings\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\tif you want to enable multi-currency on checkout.\r\n\t\t\t\t\t</p>\r\n\t\t\t\t\t<div className={classNames('flex space-x-3 pt-3 justify-start')}>\r\n\t\t\t\t\t\t<a\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\thref=\"https://monsterapps.crisp.help/en/article/checkout-settings-multi-currency-discount-codes-draft-checkout-1qsfus8/?1604963115355\"\r\n\t\t\t\t\t\t\ttarget=\"_blank\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Icon icon=\"info-circle\" className=\"mr-2\" size=\"1x\" />\r\n\t\t\t\t\t\t\t<span className={classNames('text-xs')}>Learn More</span>\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\tonClick={redirectToCheckoutSettings}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Icon icon=\"cog\" className=\"mr-2\" size=\"1x\" />\r\n\t\t\t\t\t\t\t<span className={classNames('text-xs')}>Checkout Settings</span>\r\n\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\tIUnderstand({\r\n\t\t\t\t\t\t\t\t\tmulti_currency_checkout_alerted: true,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Icon icon=\"trash-alt\" className=\"mr-2\" size=\"1x\" />\r\n\t\t\t\t\t\t\t<span className={classNames('text-xs')}>I Understand</span>\r\n\t\t\t\t\t\t</button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</Alert>\r\n\t\t\t)}\r\n\t\t\t{!draft_checkout_alerted && (\r\n\t\t\t\t<Alert\r\n\t\t\t\t\t{...{\r\n\t\t\t\t\t\ttype: 'warning',\r\n\t\t\t\t\t\tborderPosition: 'border-l-4',\r\n\t\t\t\t\t\ticonSize: '2x',\r\n\t\t\t\t\t\ttitle: 'Draft checkout is currently activated',\r\n\t\t\t\t\t\ticon: 'exclamation-circle',\r\n\t\t\t\t\t\tcustomStyle: {\r\n\t\t\t\t\t\t\ticon: 'text-orange-400 self-start mt-1',\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tclassName=\"mt-6 z-5\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<p>This means all store discount codes need to be entered through Upsell Cart. (Not at checkout)</p>\r\n\t\t\t\t\t<p>\r\n\t\t\t\t\t\tVisit\r\n\t\t\t\t\t\t<span\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'underline cursor-pointer hover:text-orange-500 focus:outline-none font-semibold mx-1'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\tonClick={redirectToCheckoutSettings}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tCheckout Settings\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\tif you want to revert to native Shopify checkout.\r\n\t\t\t\t\t</p>\r\n\t\t\t\t\t<div className={classNames('flex space-x-3 pt-3 justify-start')}>\r\n\t\t\t\t\t\t<a\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\thref=\"https://monsterapps.crisp.help/en/article/checkout-settings-multi-currency-discount-codes-draft-checkout-1qsfus8/?1604963115355\"\r\n\t\t\t\t\t\t\ttarget=\"_blank\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Icon icon=\"info-circle\" className=\"mr-2\" size=\"1x\" />\r\n\t\t\t\t\t\t\t<span className={classNames('text-xs')}>Learn More</span>\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\tonClick={redirectToCheckoutSettings}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Icon icon=\"cog\" className=\"mr-2\" size=\"1x\" />\r\n\t\t\t\t\t\t\t<span className={classNames('text-xs')}>Checkout Settings</span>\r\n\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\t'text-gray-800 text-sm flex items-center hover:text-orange-500 focus:outline-none focus:outline-shadow font-semibold py-1 px-2 uppercase border bg-orange-200 bg-opacity-50 border-orange-300 rounded'\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\tIUnderstand({\r\n\t\t\t\t\t\t\t\t\tdraft_checkout_alerted: true,\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<Icon icon=\"trash-alt\" className=\"mr-2\" size=\"1x\" />\r\n\t\t\t\t\t\t\t<span className={classNames('text-xs')}>I Understand</span>\r\n\t\t\t\t\t\t</button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</Alert>\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n}\r\n","import React from \"react\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nconst GuideContainer = ({\r\n title,\r\n children,\r\n className = \"\",\r\n link = \"\",\r\n linkLabel,\r\n styles = {},\r\n itemsClassName = \"\",\r\n itemsStyles = {},\r\n}) => {\r\n return (\r\n <div\r\n className={classNames(\r\n \"shadow-sm px-5 pt-5 bg-white rounded relative\",\r\n className\r\n )}\r\n style={{ ...styles, paddingBottom: \"50px\" }}\r\n >\r\n <h4\r\n className={classNames(\r\n \"flex-1 capitalize text-gray-600 text-md font-bold\"\r\n )}\r\n >\r\n {title}\r\n </h4>\r\n <div\r\n className={classNames(\"w-full my-4\", itemsClassName)}\r\n style={itemsStyles}\r\n >\r\n {children}\r\n </div>\r\n <div\r\n className={classNames(\r\n \"w-full absolute flex items-center justify-center\"\r\n )}\r\n style={{ bottom: \"31px\" }}\r\n >\r\n <a\r\n className={classNames(\"capitalize text-gray-600 text-md font-bold\")}\r\n style={{\r\n bottom: \"31px\",\r\n textDecoration: \"underline\",\r\n lineHeight: \"22px\",\r\n }}\r\n href={link}\r\n target=\"_blank\"\r\n >\r\n {linkLabel}\r\n </a>\r\n </div>\r\n </div>\r\n );\r\n};\r\n\r\nexport default GuideContainer;\r\n","import React from \"react\";\r\nimport classNames from \"lib/classNames\";\r\nimport Icon from \"./Icon\";\r\nimport styles from \"styles/tutorial.module.scss\";\r\n\r\nconst GuideLink = ({ label, link = \"\" }) => {\r\n return (\r\n <div\r\n className={\r\n classNames(\"flex items-center justify-start mb-3\") + \" \" + styles.link\r\n }\r\n >\r\n <Icon icon=\"link\" color=\"#718096\" />\r\n <a\r\n className={classNames(\"text-gray-600 text-sm ml-2\")}\r\n style={{ lineHeight: \"19px\" }}\r\n href={link}\r\n target=\"_blank\"\r\n >\r\n {label}\r\n </a>\r\n </div>\r\n );\r\n};\r\n\r\nexport default GuideLink;\r\n","import React from \"react\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nconst GuideVideo = ({ label, link = \"\", image }) => {\r\n return (\r\n <a\r\n className={classNames(\"mb-3\")}\r\n href={link}\r\n style={{ width: \"30%\" }}\r\n target=\"_blank\"\r\n >\r\n <div\r\n style={{\r\n backgroundImage: `url(${image})`,\r\n backgroundRepeat: \"no-repeat\",\r\n backgroundPosition: \"center\",\r\n backgroundSize: \"contain\",\r\n width: \"100%\",\r\n height: \"110px\",\r\n }}\r\n ></div>\r\n {/* <iframe\r\n width=\"100%\"\r\n height=\"110px\"\r\n src={link}\r\n title={label}\r\n frameBorder=\"0\"\r\n allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\r\n allowFullScreen\r\n ></iframe> */}\r\n <p\r\n className={classNames(\"text-gray-600 text-sm mt-2 text-center\")}\r\n style={{ lineHeight: \"19px\" }}\r\n >\r\n {label}\r\n </p>\r\n </a>\r\n );\r\n};\r\n\r\nexport default GuideVideo;\r\n","import React from \"react\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nconst SetupStep = ({\r\n title,\r\n description,\r\n required,\r\n recommended,\r\n actionText,\r\n action,\r\n done,\r\n}) => {\r\n return (\r\n <div\r\n className={classNames(\r\n \"flex items-center justify-between pt-4 pb-4 border-gray-400 border-solid border-b\"\r\n )}\r\n >\r\n <div style={{ width: \"75%\" }}>\r\n <div className={classNames(\"flex items-center justify-start mb-3\")}>\r\n <b\r\n className={classNames(\r\n `font-medium text-gray-600 ${done ? \"line-through\" : \"\"}`\r\n )}\r\n >\r\n {title}\r\n </b>\r\n {(required || recommended) && (\r\n <div\r\n className={classNames(\"ml-6\")}\r\n style={{\r\n borderRadius: \"13px\",\r\n padding: \"1px 16px\",\r\n background: done\r\n ? \"#48bb78\"\r\n : required\r\n ? \"rgba(255, 0, 0, 0.4)\"\r\n : \"#4399E0\",\r\n }}\r\n >\r\n <b className={classNames(\"font-bold text-white text-sm\")}>\r\n {done ? \"Completed\" : required ? \"Required\" : \"Recommended\"}\r\n </b>\r\n </div>\r\n )}\r\n </div>\r\n <p\r\n className={classNames(\r\n `whitespace-pre-wrap text-sm leading-5 text-gray-600 ${\r\n done ? \"line-through\" : \"\"\r\n }`\r\n )}\r\n >\r\n {description}\r\n </p>\r\n </div>\r\n <button\r\n className={classNames(\r\n \"border-gray-400 border-solid border rounded-md capitalize font-bold text-sm text-center text-gray-600 py-1 px-5 no-outline focus:outline-none\"\r\n )}\r\n onClick={action}\r\n >\r\n {actionText}\r\n </button>\r\n </div>\r\n );\r\n};\r\n\r\nexport default SetupStep;\r\n","import React, { useContext, useEffect, useState } from \"react\";\r\nimport classNames from \"lib/classNames\";\r\nimport SetupStep from \"./SetupStep\";\r\nimport { LIST_SHOP_CAMPAIGNS } from \"Queries\";\r\nimport UserContext from \"context/UserContext\";\r\nimport ShopContext from \"context/ShopContext\";\r\nimport { useQuery } from \"@apollo/react-hooks\";\r\nimport useReactRouter from \"use-react-router\";\r\nimport { API_GATEWAY_NEW, APP_DEV, SHOPIFY_API_KEY } from \"aws-exports\";\r\nimport EmbeddedContext from \"context/EmbeddedContext\";\r\nimport { Redirect } from \"@shopify/app-bridge/actions\";\r\nimport Axios from \"axios\";\r\nimport { Loading, Toast, Modal } from \"@shopify/app-bridge-react\";\r\nimport ContentLoader from \"react-content-loader\";\r\nimport { getScriptStatus } from \"./cart/Utils\";\r\n\r\nconst SetupGuide = () => {\r\n const { history, location } = useReactRouter();\r\n const shopContext = useContext(ShopContext);\r\n const [showInstallationModel, setShowInstallationModel] = useState(false);\r\n const {\r\n AppLocalStorage,\r\n setup: { cartActive, cartLoading },\r\n } = shopContext;\r\n const user = useContext(UserContext);\r\n let { data } = useQuery(LIST_SHOP_CAMPAIGNS, {\r\n variables: {\r\n userId: user.attributes.sub,\r\n },\r\n fetchPolicy: \"network-only\",\r\n });\r\n const { AppBridgeRedirect } = useContext(EmbeddedContext);\r\n\r\n const [collapsed, setCollapsed] = useState(true);\r\n\r\n const [campaignActive, setCampaignActive] = useState(false);\r\n const [dataLoading, setDataLoading] = useState(true);\r\n const [designActive, setDesignActive] = useState(false);\r\n const [completedTasks, setCompletedTasks] = useState(0);\r\n\r\n useEffect(() => {\r\n const app_first_turn_on = AppLocalStorage.getItem(\"first_cart_turn_on\");\r\n setDesignActive(app_first_turn_on);\r\n }, [AppLocalStorage]);\r\n\r\n useEffect(() => {\r\n if (data) {\r\n if (data.campaigns?.list?.length) {\r\n setCampaignActive(\r\n !!data.campaigns.list.find((campaign) => campaign.active)\r\n );\r\n }\r\n setDataLoading(false);\r\n }\r\n }, [data]);\r\n\r\n useEffect(() => {\r\n if (!dataLoading && !cartLoading) {\r\n let total = +cartActive + +designActive + +campaignActive;\r\n setCompletedTasks(total);\r\n setCollapsed(total === 3);\r\n }\r\n }, [cartActive, designActive, campaignActive, cartLoading, dataLoading]);\r\n\r\n return (\r\n <div className={classNames(\"col-span-1 lg:col-span-3\")}>\r\n <div className={classNames(\"flex-1 mb-3\")}>\r\n <b className={classNames(\"text-gray-600 text-lg\")}>\r\n Welcome To Monster Cart Upsells 🥰\r\n </b>\r\n <p\r\n className={classNames(\"text-gray-600 font-normal text-md mt-1 mb-4\")}\r\n >\r\n Here are a few steps to get started. Reach out to the team if you need\r\n help.\r\n </p>\r\n </div>\r\n <div className={classNames(\"bg-white relative rounded shadow\")}>\r\n <div className={classNames(\"py-6 px-8\")}>\r\n <div className={classNames(\"flex items-center justify-between\")}>\r\n {dataLoading || cartLoading ? (\r\n <ContentLoader\r\n className={classNames(\"mb-3 rounded h-4\")}\r\n viewBox=\"0 0 400 12\"\r\n style={{ width: 100 }}\r\n >\r\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"12\" />\r\n </ContentLoader>\r\n ) : (\r\n <>\r\n <h3 className={classNames(\"font-bold mb-3 text-gray-600\")}>\r\n Setup Guide\r\n </h3>\r\n <div\r\n className={classNames(\"mb-3 cursor-pointer\")}\r\n style={{\r\n transform: collapsed ? \"rotate(180deg)\" : \"rotate(0deg)\",\r\n transition: \"transform 0.4s ease\",\r\n }}\r\n onClick={() => {\r\n setCollapsed(!collapsed);\r\n }}\r\n >\r\n <svg\r\n className={classNames(\"w-4 h-3\")}\r\n viewBox=\"0 0 14 8\"\r\n fill=\"none\"\r\n >\r\n <path\r\n d=\"M1 1L7 7L13 1\"\r\n stroke=\"#718096\"\r\n strokeWidth=\"3\"\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n />\r\n </svg>\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n <div\r\n className={classNames(\r\n \"flex items-center flex-wrap space-y-3 sm:space-y-0\"\r\n )}\r\n >\r\n {dataLoading || cartLoading ? (\r\n <>\r\n <ContentLoader\r\n viewBox=\"0 0 400 12\"\r\n className={classNames(\"flex-1 w-1/5 h-4 mr-3 rounded\")}\r\n >\r\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"12\" />\r\n </ContentLoader>\r\n <ContentLoader\r\n viewBox=\"0 0 400 12\"\r\n className={classNames(\"w-3/4 h-4 rounded-lg\")}\r\n >\r\n <rect x=\"0\" y=\"0\" width=\"400\" height=\"12\" />\r\n </ContentLoader>\r\n </>\r\n ) : (\r\n <>\r\n <p className={classNames(\"flex-1 text-gray-600 text-sm\")}>\r\n {completedTasks} of 3 tasks completed\r\n </p>\r\n <div\r\n className={classNames(\r\n \"flex w-3/4 h-3 rounded-md relative overflow-hidden mix-blend-darken bg-white\"\r\n )}\r\n style={{\r\n background: \"rgba(93, 120, 240, 0.2)\",\r\n }}\r\n >\r\n <div\r\n className={classNames(\r\n \"block transition-width absolute inset-0 duration-500 ease-out z-10\"\r\n )}\r\n style={{\r\n background: completedTasks < 3 ? \"#5D78F0\" : \"#48bb78\",\r\n width: `${(completedTasks * 100) / 3}%`,\r\n }}\r\n ></div>\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n {/* <div className={classNames(\"w-full h-px bg-gray-400\")}></div> */}\r\n <div\r\n className={classNames(\"relative overflow-hidden\")}\r\n style={{\r\n maxHeight: collapsed ? \"0px\" : \"450px\",\r\n transition: \"max-height 0.4s ease\",\r\n }}\r\n >\r\n <div\r\n className={classNames(\r\n \"border-gray-400 border-solid border-t pt-0 px-8 pb-6\"\r\n )}\r\n >\r\n <SetupStep\r\n title={`1. Review Monster Cart Design`}\r\n description={`The Monster Cart comes with great preset options. However you can customize them further to match your brand`}\r\n actionText=\"Open Cart Setup\"\r\n action={() => history.push(\"/settings\" + location.search)}\r\n done={designActive}\r\n />\r\n <SetupStep\r\n title={`2. Activate Monster Cart`}\r\n description={`Activate Monster Cart App embed block in your theme editor. \\nFind it in Theme settings > App embeds. Make sure you click save.`}\r\n required\r\n actionText=\"Enable / Disable Cart\"\r\n action={() => {\r\n setShowInstallationModel(true);\r\n }}\r\n done={cartActive}\r\n />\r\n <SetupStep\r\n title={`3. Activate Upsell Campaigns`}\r\n description={`Increase your average order value by displaying high converting upsell campaigns in your cart. Be sure to check out our best practise guides or reach out to the team if needed`}\r\n recommended\r\n actionText=\"Add Upsells\"\r\n action={() => history.push(\"/campaigns/create\" + location.search)}\r\n done={campaignActive}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n <Modal\r\n size=\"Large\"\r\n title=\"Installation\"\r\n open={!!showInstallationModel}\r\n primaryAction={{\r\n content: \"Open Editor\",\r\n onAction: function () {\r\n const activateAppId = APP_DEV\r\n ? \"13fae760-4743-463c-aaeb-80cebaccc364\"\r\n : \"a1b8e58a-bf1d-4e0f-8768-a387c3f643c0\";\r\n const deepLink = `/themes/current/editor?context=apps&template=product&activateAppId=${activateAppId}/app-embed`;\r\n AppBridgeRedirect.dispatch(Redirect.Action.ADMIN_PATH, {\r\n path: deepLink,\r\n newContext: true,\r\n });\r\n },\r\n }}\r\n secondaryActions={[\r\n {\r\n content: \"Watch Tutorial\",\r\n onAction: () => {\r\n AppBridgeRedirect.dispatch(Redirect.Action.REMOTE, {\r\n url: \"https://monsterapps.crisp.help/en/article/activate-deactivate-monster-cart-19okfn1/\",\r\n newContext: true,\r\n });\r\n },\r\n },\r\n ]}\r\n src={`${window.location.origin}/AppThemeExtensionInstallation.html`}\r\n onClose={() => setShowInstallationModel(false)}\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nexport default SetupGuide;\r\n","import React, { useState, useEffect, useCallback } from \"react\";\r\nimport Switch from \"components/Switch\";\r\nimport Tag from \"components/Tag\";\r\nimport Icon from \"components/Icon\";\r\nimport ColorPicker from \"components/ColorPicker\";\r\nimport Dropdown from \"components/Dropdown\";\r\nimport useBindToContext from \"hooks/useBindToContext\";\r\nimport styled from \"styled-components\";\r\nimport classNames from \"lib/classNames\";\r\nimport _ from \"lodash\";\r\nimport Editor, { DiffEditor, useMonaco, loader } from \"@monaco-editor/react\";\r\n\r\nconst CodeEditor = ({\r\n disabled,\r\n onFocus,\r\n onBlur,\r\n inputRef,\r\n value,\r\n autofocus,\r\n placeholder,\r\n className,\r\n onChange,\r\n BindToContext,\r\n placeholder_color,\r\n border_color,\r\n validation = true,\r\n getError = null,\r\n specificValidation = null,\r\n isFlex,\r\n row = 2,\r\n language,\r\n}) => {\r\n const [BindedValue, BindedOnChange, hasError, onRender] = useBindToContext(\r\n BindToContext,\r\n value,\r\n onChange,\r\n specificValidation,\r\n getError,\r\n validation\r\n );\r\n\r\n const handleChange = (value) => {\r\n BindedOnChange(value);\r\n };\r\n return (\r\n <div\r\n className={classNames(\r\n \"w-full rounded-md relative overflow-hidden h-64 mt-2\"\r\n )}\r\n >\r\n <Editor\r\n height=\"100%\"\r\n theme=\"light\"\r\n language={language}\r\n value={BindedValue}\r\n onChange={handleChange}\r\n defaultValue={placeholder}\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nCodeEditor.defaultProps = {\r\n disabled: false,\r\n style: {},\r\n onEnter: false,\r\n onFocus: false,\r\n onBlur: false,\r\n onKeyDown: false,\r\n inputRef: null,\r\n BindToContext: null,\r\n dispatch: null,\r\n placeholder: \"\",\r\n withSwitch: false,\r\n withNumber: false,\r\n withDropdown: false,\r\n value: undefined,\r\n className: \"\",\r\n iconFirst: false,\r\n placeholder_color: null,\r\n border_color: null,\r\n max: null,\r\n min: null,\r\n};\r\n\r\nexport default CodeEditor;\r\n","import React, { useCallback, useReducer } from \"react\";\r\nimport { SetItemReducer, SET_ITEM, DELETE_ITEM } from \"reducers/SetItemReducer\";\r\nimport uuid from \"uuid/v1\";\r\nimport { Embedded, Preview } from \"components\";\r\nimport { NotifyProvider } from \"context/NotifyContext\";\r\n\r\nexport const isEmbedded =\r\n ({\r\n ChildComponent,\r\n previewOpenByDefault = true,\r\n noCampaign = false,\r\n newPlanRedirect,\r\n setIsOpen,\r\n }) =>\r\n () => {\r\n const [state, dispatch] = useReducer(SetItemReducer, {});\r\n\r\n const createNotification = (notification) => {\r\n const id = notification.id || uuid();\r\n if (!state[id])\r\n dispatch({ type: SET_ITEM, path: id, value: { id, ...notification } });\r\n };\r\n const deleteNotification = (id) =>\r\n dispatch({ type: DELETE_ITEM, path: id });\r\n\r\n return (\r\n <NotifyProvider value={{ state, createNotification, deleteNotification }}>\r\n <Embedded newPlanRedirect={newPlanRedirect}>\r\n <Preview openByDefault={previewOpenByDefault} noCampaign={noCampaign}>\r\n {ChildComponent && <ChildComponent setIsOpen={setIsOpen} />}\r\n </Preview>\r\n </Embedded>\r\n </NotifyProvider>\r\n );\r\n };\r\n\r\nexport const hasPreview = (\r\n ChildComponent,\r\n openByDefault = true,\r\n noCampaign = false\r\n) => {\r\n return () => (\r\n <Preview openByDefault={openByDefault} noCampaign={noCampaign}>\r\n <ChildComponent />\r\n </Preview>\r\n );\r\n};\r\n","import React, { useEffect, useState, useCallback, useContext } from \"react\";\r\nimport classNames from \"lib/classNames\";\r\nimport GuideContainer from \"./GuideContainer\";\r\nimport GuideLink from \"./GuideLink\";\r\nimport GuideVideo from \"./GuideVideo\";\r\nimport YtClothing from \"svgs/yt-clothing.jpeg\";\r\nimport YtDesigning from \"svgs/yt-designing.jpeg\";\r\nimport YtDropshipping from \"svgs/yt-dropshipping.jpeg\";\r\nimport YtFreeGift from \"svgs/yt-free-gift.jpeg\";\r\nimport YtFreeShipping from \"svgs/yt-free-shipping.jpeg\";\r\nimport YtShippingProtection from \"svgs/yt-shipping-protection.jpeg\";\r\nimport styles from \"styles/tutorial.module.scss\";\r\n\r\nconst TutorialModal = ({ isOpen, setIsOpen }) => {\r\n return (\r\n isOpen && (\r\n <div>\r\n <div className={styles.overlay} onClick={() => setIsOpen(false)}></div>\r\n <div className={styles.container}>\r\n <h4\r\n className={classNames(\r\n \"flex-1 text-gray-600 text-md font-bold mb-4\"\r\n )}\r\n >\r\n Here are some quick setup tools. If you need further help please\r\n contact the support team.\r\n </h4>\r\n <div className={styles.close} onClick={() => setIsOpen(false)}>\r\n X\r\n </div>\r\n <div className={classNames(\"flex items-stretch\")}>\r\n <GuideContainer\r\n title=\"Frequent Asked Questions\"\r\n className=\"flex-1\"\r\n link=\"https://monsterapps.crisp.help/en/\"\r\n linkLabel=\"Visit Helpdesk\"\r\n styles={{ marginRight: \"10px\", maxWidth: \"35%\" }}\r\n >\r\n <GuideLink\r\n label=\"Why isn’t my MonsterUpsell cart appearing?\"\r\n link=\"https://monsterapps.crisp.help/en/article/activate-deactivate-monster-cart-19okfn1/\"\r\n />\r\n <GuideLink\r\n label=\"Can you run multiple Campaigns at the same time?\"\r\n link=\"https://monsterapps.crisp.help/en/article/multiple-campaigns-at-the-same-time-rules-and-targeting-1tt85ak/\"\r\n />\r\n <GuideLink\r\n label=\"Why isn't the store mini cart in corner syncing to MonsterUpsells?\"\r\n link=\"https://monsterapps.crisp.help/en/article/cart-button-in-corner-trouble-shooting-1paigp8\"\r\n />\r\n <GuideLink\r\n label=\"Is it possible to create Buy X Get Y offers?\"\r\n link=\"https://monsterapps.crisp.help/en/article/shopify-auto-discounts-setup-buy-x-get-y-and-more-jlyqfr/\"\r\n />\r\n <GuideLink\r\n label=\"Does MonsterUpsells work with Shopify Marketplace?\"\r\n link=\"https://monsterapps.crisp.help/en/article/shopify-markets-multi-currency-setup-1ab07h1\"\r\n />\r\n <GuideLink\r\n label=\"How do i turn off my default theme cart?\"\r\n link=\"https://monsterapps.crisp.help/en/article/my-old-cart-drawerajax-cart-is-showing-jpwk52\"\r\n />\r\n </GuideContainer>\r\n <GuideContainer\r\n title=\"Setup Guides and Best Practices\"\r\n className=\"flex-1\"\r\n link=\"https://monsterapps.crisp.help/en/\"\r\n linkLabel=\"More Setup Guides\"\r\n itemsClassName=\"flex items-start flex-wrap\"\r\n itemsStyles={{ justifyContent: \"space-between\" }}\r\n >\r\n <GuideVideo\r\n label=\"🎠Add To Unlock Free Gifts\"\r\n link=\"https://www.youtube.com/watch?v=7x68Cw-C3C4\"\r\n image={YtFreeGift}\r\n />\r\n <GuideVideo\r\n label=\"🚚 Add To Unlock Free Shipping\"\r\n link=\"https://www.youtube.com/watch?v=Tn6CKnyprA4\"\r\n image={YtFreeShipping}\r\n />\r\n <GuideVideo\r\n label=\"🛡 One tick Upsells\"\r\n link=\"https://www.youtube.com/watch?v=dNva0Jrd3FQ\"\r\n image={YtShippingProtection}\r\n />\r\n <GuideVideo\r\n label={\"Dropshiping / Gadgets (Best Practices)\"}\r\n link=\"https://www.youtube.com/watch?v=psPl2PNYt40\"\r\n image={YtDropshipping}\r\n />\r\n <GuideVideo\r\n label=\"Clothing / Accessories / Brand (Best Practices)\"\r\n link=\"https://www.youtube.com/watch?v=utNw-leSD9o\"\r\n image={YtClothing}\r\n />\r\n <GuideVideo\r\n label=\"Setup & Design Cart\"\r\n link=\"https://www.youtube.com/watch?v=OOHWtIoAf-w\"\r\n image={YtDesigning}\r\n />\r\n </GuideContainer>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n );\r\n};\r\n\r\nexport default TutorialModal;\r\n","import React, { useEffect, useState, useCallback, useContext } from 'react';\r\nimport classNames from 'lib/classNames';\r\nimport styles from 'styles/charge_approval.module.scss'\r\nimport Modal from \"./Modal\"\r\nimport ShopContext from 'context/ShopContext';\r\nimport { trackMixPanelEvent } from \"lib/mixpanel\" \r\n\r\nconst TallyModal = ({ }) => {\r\n const { AppLocalStorage, state: { id : shop} } = useContext(ShopContext)\r\n const [isModalVisible, setIsModalVisible] = useState(!AppLocalStorage.getItem('welcome_video_watched'));\r\n\r\n const close = () => {\r\n AppLocalStorage.setItem(\"welcome_video_watched\", true);\r\n trackMixPanelEvent(\"First login\", shop);\r\n setIsModalVisible(false);\r\n }\r\n\r\n return (\r\n <div className={classNames(\"absolute z-50\")}>\r\n <Modal\r\n visible={isModalVisible}\r\n onClose={() => close()}\r\n style={{ minWidth: \"900px\", minHeight: \"530px\" }}\r\n background=\"bg-white\"\r\n >\r\n {(close, setTitle) => (\r\n <div\r\n id=\"monster-upsell-cart\"\r\n className={classNames(\"px-4 h-full w-full \")}\r\n >\r\n <div\r\n className={`${classNames(\"h-full w-full -mt-8\")} ${\r\n styles.navy_color\r\n }`}\r\n >\r\n <iframe\r\n src=\"https://tally.so/embed/31kGaO?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1\"\r\n loading=\"lazy\"\r\n width=\"100%\"\r\n height=\"837\"\r\n frameborder=\"0\"\r\n marginheight=\"0\"\r\n marginwidth=\"0\"\r\n title=\"Welcome To Monster Cart Upsells\"\r\n ></iframe>\r\n </div>\r\n </div>\r\n )}\r\n </Modal>\r\n </div>\r\n );\r\n\r\n}\r\n\r\nexport default TallyModal;","import React from \"react\";\r\nimport { Page, SetupGuide } from \"components\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nconst SetupScreen = ({ setIsOpen }) => {\r\n return (\r\n <>\r\n <Page background=\"white\" header={{ title: \"Getting Started\" }}>\r\n <SetupGuide />\r\n <div\r\n className={classNames(\r\n \"grid grid-flow-row gap-8 grid-cols-1 lg:grid-cols-3 mt-6\"\r\n )}\r\n >\r\n <div\r\n className={classNames(\r\n \"col-span-1 lg:col-span-2 text-gray-600 flex flex-col space-y-3\"\r\n )}\r\n >\r\n <h3 className={classNames(\"font-bold text-lg leading-none\")}>\r\n Setup guide - Increase revenue\r\n </h3>\r\n <iframe\r\n style={{\r\n width: \"100%\",\r\n height: 400,\r\n minWidth: 700,\r\n maxWidth: 800,\r\n }}\r\n frameBorder=\"0\"\r\n allowFullScreen=\"1\"\r\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\r\n title=\"Setup guide - Increase revenue\"\r\n src=\"https://www.youtube.com/embed/yDMXgJUQ3NY?si=Rb2ctvLvRY4oBRuL&autoplay=0&cc_load_policy=1&controls=2&hl=en&rel=0&enablejsapi=1&\"\r\n ></iframe>\r\n </div>\r\n </div>\r\n <p\r\n className={classNames(\r\n \"w-full cursor-pointer hover:underline flex-1 text-gray-600 text-md font-bold mt-6\"\r\n )}\r\n onClick={() => setIsOpen(true)}\r\n >\r\n Need help setting up campaigns or want best practices? Click here\r\n </p>\r\n </Page>\r\n </>\r\n );\r\n};\r\n\r\nexport default SetupScreen;\r\n","import React, { useState, useCallback } from \"react\";\r\nimport { Authenticator, Sidebar, Input, Button } from \"components\";\r\nimport { SidebarProvider } from \"context/SidebarContext\";\r\nimport { BrowserRouter, Route, Switch } from \"react-router-dom\";\r\nimport {\r\n Campaigns,\r\n ErrorScreen,\r\n NotFoundScreen,\r\n LoginScreen,\r\n NewLoginScreen,\r\n LogoutScreen,\r\n CartScreen,\r\n CodCheckout,\r\n DashboardScreen,\r\n FaqScreen,\r\n PrivacyPolicy,\r\n ManualSetup,\r\n PlanScreen,\r\n StickyCartSettings,\r\n InvitationScreen,\r\n Affiliation,\r\n ReferralScreen,\r\n Integrations,\r\n} from \"screens\";\r\nimport { withCampaignProvider } from \"context/CampaignContext\";\r\nimport { isEmbedded } from \"lib/wrappers\";\r\nimport styles from \"styles/page.module.scss\";\r\nimport useReactRouter from \"use-react-router\";\r\nimport classNames from \"lib/classNames\";\r\nimport { API } from \"aws-amplify\";\r\nimport TutorialModal from \"components/TutorialModal\";\r\nimport TallyModal from \"components/TallyModal\";\r\nimport SetupScreen from \"screens/SetupScreen\";\r\n\r\nfunction App() {\r\n return (\r\n <BrowserRouter>\r\n <ErrorScreen>\r\n <Routes />\r\n </ErrorScreen>\r\n </BrowserRouter>\r\n );\r\n}\r\n\r\nexport default App;\r\n\r\nconst Routes = () => {\r\n const [voucher, setVoucher] = useState(\"\");\r\n const [newPlanRedirect, setNewPlanRedirect] = useState(null);\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const { location } = useReactRouter();\r\n // const [collapsed, originalSetCollapsed] = useState(\r\n // // JSON.parse(localStorage.getItem(\"sidebar_collapsed\"))\r\n // );\r\n // const setCollapsed = (value) => {\r\n // // localStorage.setItem(\"sidebar_collapsed\", value);\r\n // originalSetCollapsed(value);\r\n // };\r\n const [collapsed, setCollapsed] = useState(false);\r\n\r\n if (\r\n [\"/login\", \"/auth/shopify/callback\"].includes(location.pathname) ||\r\n new RegExp(\"/invitation/.*\").test(location.pathname) ||\r\n new RegExp(\"/ref/.*\").test(location.pathname)\r\n )\r\n return (\r\n <Switch>\r\n {/* <Route path=\"/login\" component={LoginScreen} /> */}\r\n <Route path=\"/login\" component={NewLoginScreen} />\r\n <Route path=\"/invitation/:id\" component={InvitationScreen} />\r\n <Route path=\"/ref/:code\" component={ReferralScreen} />\r\n </Switch>\r\n );\r\n else\r\n return (\r\n <Authenticator>\r\n <>\r\n <div\r\n className={classNames(\r\n \"hidden px-20 pr-8 mx-auto py-2 flex-center bg-indigo-800 text-white font-bold\"\r\n )}\r\n >\r\n <span className={classNames(\"flex-1\")}>Have a voucher code?</span>\r\n <div className={classNames(\"w-2/3 flex items-center justify-end\")}>\r\n <Input\r\n value={voucher}\r\n onChange={(value) => setVoucher(value)}\r\n isFlex\r\n placeholder=\"Voucher code\"\r\n />\r\n <Button\r\n text=\"Use It Now\"\r\n type=\"secondary2\"\r\n className={classNames(\"ml-3\")}\r\n onClick={async () => {\r\n const planResponse = await API.post(\r\n \"API_GATEWAY_NEW\",\r\n \"/shop/get_plan\",\r\n {\r\n body: {\r\n voucher,\r\n },\r\n }\r\n );\r\n setVoucher(\"\");\r\n setNewPlanRedirect(planResponse.confirmation_url);\r\n }}\r\n />\r\n </div>\r\n </div>\r\n <div className={styles.app_wrapper} data-collapsed={collapsed}>\r\n <SidebarProvider value={{ collapsed, setCollapsed }}>\r\n <Sidebar />\r\n </SidebarProvider>\r\n <Switch>\r\n <Route path=\"/logout\" component={LogoutScreen} />\r\n <Route\r\n path=\"/\"\r\n component={isEmbedded({\r\n ChildComponent: SetupScreen,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n setIsOpen,\r\n })}\r\n exact={true}\r\n />\r\n <Route\r\n path=\"/campaigns\"\r\n component={isEmbedded({\r\n ChildComponent: Campaigns.list,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n setIsOpen,\r\n })}\r\n exact={true}\r\n />\r\n <Route\r\n path=\"/campaigns/create\"\r\n component={isEmbedded({\r\n ChildComponent: withCampaignProvider(\r\n Campaigns.create,\r\n null,\r\n null,\r\n setIsOpen\r\n ),\r\n newPlanRedirect,\r\n setIsOpen,\r\n })}\r\n exact={true}\r\n />\r\n <Route\r\n path=\"/campaigns/create/:id\"\r\n component={isEmbedded({\r\n ChildComponent: Campaigns.duplicate,\r\n newPlanRedirect,\r\n setIsOpen,\r\n })}\r\n />\r\n <Route\r\n path=\"/campaigns/:id\"\r\n component={isEmbedded({\r\n ChildComponent: Campaigns.update,\r\n newPlanRedirect,\r\n setIsOpen,\r\n })}\r\n />\r\n <Route\r\n path=\"/settings\"\r\n component={isEmbedded({\r\n ChildComponent: CartScreen,\r\n previewOpenByDefault: true,\r\n noCampaign: true,\r\n newPlanRedirect,\r\n })}\r\n exact={true}\r\n />\r\n\r\n <Route\r\n path=\"/sticky\"\r\n component={isEmbedded({\r\n ChildComponent: StickyCartSettings,\r\n previewOpenByDefault: true,\r\n noCampaign: true,\r\n newPlanRedirect,\r\n })}\r\n exact={true}\r\n />\r\n <Route\r\n path=\"/settings/checkout\"\r\n component={isEmbedded({\r\n ChildComponent: CodCheckout,\r\n previewOpenByDefault: true,\r\n noCampaign: true,\r\n newPlanRedirect,\r\n })}\r\n exact={true}\r\n />\r\n <Route\r\n path=\"/settings/setup\"\r\n component={isEmbedded({\r\n ChildComponent: ManualSetup,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n })}\r\n exact={true}\r\n />\r\n <Route\r\n path=\"/dashboard\"\r\n component={isEmbedded({\r\n ChildComponent: DashboardScreen,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n })}\r\n exact={true}\r\n />\r\n <Route\r\n path=\"/plan\"\r\n component={isEmbedded({\r\n ChildComponent: PlanScreen,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n })}\r\n />\r\n <Route\r\n path=\"/integrations\"\r\n component={isEmbedded({\r\n ChildComponent: Integrations,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n })}\r\n />\r\n <Route\r\n path=\"/faq\"\r\n component={isEmbedded({\r\n ChildComponent: FaqScreen,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n })}\r\n />\r\n <Route\r\n path=\"/privacy_policy\"\r\n component={isEmbedded({\r\n ChildComponent: PrivacyPolicy,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n })}\r\n />\r\n\r\n <Route\r\n path=\"/affiliation\"\r\n component={isEmbedded({\r\n ChildComponent: Affiliation,\r\n previewOpenByDefault: false,\r\n newPlanRedirect,\r\n })}\r\n exact={true}\r\n />\r\n <Route component={NotFoundScreen} />\r\n </Switch>\r\n <TutorialModal isOpen={isOpen} setIsOpen={setIsOpen} />\r\n <TallyModal />\r\n </div>\r\n </>\r\n </Authenticator>\r\n );\r\n};\r\n","import createApp from \"@shopify/app-bridge\";\r\nimport { getSessionToken } from \"@shopify/app-bridge-utils\";\r\nimport React, { useState } from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport App from \"./App\";\r\nimport * as config from \"./aws-exports\";\r\nimport Client from \"aws-appsync\";\r\nimport Amplify from \"aws-amplify\";\r\nimport { ApolloProvider } from \"@apollo/react-hooks\";\r\nimport { Rehydrated } from \"components\";\r\nimport { InMemoryCache } from \"apollo-cache-inmemory\";\r\n\r\nconst queryString = window.location.search;\r\nconst params = new URLSearchParams(queryString);\r\nlet client;\r\n\r\nif (params.get(\"shop\")) {\r\n window.Shopify = {\r\n currency: {\r\n rate: 1\r\n }\r\n };\r\n\r\n Amplify.configure({\r\n // Auth: {\r\n // cookieStorage: {\r\n // domain: config.AUTH_COOKIE_DOMAIN,\r\n // expires: config.AUTH_COOKIE_EXPIRES,\r\n // path: config.AUTH_COOKIE_PATH,\r\n // secure: true,\r\n // sameSite: \"none\"\r\n // },\r\n // identityPoolId: config.AWS_COGNITO_IDENTITY_POOL_ID,\r\n // region: config.AWS_COGNITO_REGION,\r\n // userPoolId: config.AWS_COGNITO_USER_POOL_ID,\r\n // userPoolWebClientId: config.AWS_COGNITO_USER_POOL_CLIENT_ID\r\n // },\r\n API: {\r\n endpoints: [\r\n {\r\n name: \"API_GATEWAY_NEW\",\r\n endpoint: config.API_GATEWAY_NEW,\r\n custom_header: async () => {\r\n return {\r\n Authorization: `Bearer ${await getSessionToken(shopifyApp)}`\r\n };\r\n }\r\n },\r\n {\r\n name: \"API_GATEWAY\",\r\n endpoint: config.API_GATEWAY,\r\n custom_header: async () => {\r\n return {\r\n Authorization: `Bearer ${await getSessionToken(shopifyApp)}`\r\n };\r\n }\r\n }\r\n ]\r\n },\r\n aws_appsync_graphqlEndpoint: config.APPSYNC_ENDPOINT,\r\n aws_appsync_region: config.APPSYNC_REGION,\r\n aws_appsync_authenticationType: \"AWS_LAMBDA\"\r\n });\r\n\r\n const cache = new InMemoryCache();\r\n const shopifyApp = createApp({\r\n apiKey: config.SHOPIFY_API_KEY,\r\n shopOrigin: params.get(\"shop\"), // to handle login page\r\n host: params.get(\"host\") || btoa(params.get(\"shop\"))\r\n });\r\n client = new Client({\r\n auth: {\r\n token: async () => {\r\n const token = await getSessionToken(shopifyApp);\r\n return token;\r\n },\r\n type: \"AWS_LAMBDA\"\r\n },\r\n region: config.APPSYNC_REGION,\r\n url: config.APPSYNC_ENDPOINT,\r\n disableOffline: true,\r\n cache\r\n });\r\n\r\n window.shop = params.get(\"shop\");\r\n}\r\n\r\n\r\nReactDOM.render(\r\n client ? <ApolloProvider client={client}>\r\n <Rehydrated>\r\n <App />\r\n </Rehydrated>\r\n </ApolloProvider> : <App />,\r\n document.getElementById(\"app\")\r\n);\r\n","// Import dependencies\r\nimport axios from \"axios\";\r\nimport wrapper from \"axios-cache-plugin\";\r\n\r\nconst logging = false;\r\naxios.interceptors.request.use((request) => {\r\n if (logging) console.log(\"Starting Request\", request);\r\n return request;\r\n});\r\n\r\naxios.interceptors.response.use((response) => {\r\n if (logging) console.log(\"Response:\", response);\r\n return response;\r\n});\r\n\r\nlet Api = wrapper(axios, {\r\n maxCacheSize: 20,\r\n ttl: 24 * 60000\r\n});\r\nApi.__addFilter(/products/);\r\n\r\nexport default Api;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"customScrollbars\":\"page_customScrollbars__kv58A\",\"topBarWrapper\":\"page_topBarWrapper__1YfHZ\",\"app_wrapper\":\"page_app_wrapper__qSf65\",\"app_container\":\"page_app_container__2KX6y\",\"page_header\":\"page_page_header__TM-uT\",\"action\":\"page_action__2KvAQ\",\"page\":\"page_page__3-Uh5\",\"page_content\":\"page_page_content__2tC9_\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"calendar\":\"calendar_calendar__3srR9\",\"header\":\"calendar_header__21JZa\",\"selects\":\"calendar_selects__3zjo7\",\"weekDays\":\"calendar_weekDays__3G0DI\",\"days\":\"calendar_days__119h-\",\"selected\":\"calendar_selected__14nrg\",\"preview\":\"calendar_preview__2HMFV\",\"months\":\"calendar_months__1Kqw9\"};","import React, {\r\n Fragment,\r\n useState,\r\n useContext,\r\n useEffect,\r\n useMemo,\r\n} from \"react\";\r\nimport PropTypes from \"prop-types\";\r\n\r\nimport axios from \"axios\";\r\nimport Cookies from \"js-cookie\";\r\nimport loadable from \"@loadable/component\";\r\nimport { CartContext } from \"components/cart\";\r\nimport { API_GATEWAY_NEW } from \"aws-exports\";\r\nimport API from \"../Api\";\r\nimport useCampaign from \"hooks/useCampaign\";\r\nimport classNames from \"lib/classNames\";\r\nimport { GetCartLevelAutoDiscount } from \"../Utils\";\r\nimport { DefaultAutoDiscountSettings } from \"./CartItemsList\";\r\nconst AddToUnlock = loadable(() => import(\"./AddToUnlock\"));\r\nconst OneCheckUpSell = loadable(() => import(\"./OneCheckUpSell\"));\r\nconst Scary = loadable(() => import(\"./scary\"));\r\nconst Badges = loadable(() => import(\"./badges\"));\r\nconst Announcement = loadable(() => import(\"./announcement\"));\r\nconst AfterPay = loadable(() => import(\"./afterPay\"));\r\nconst NewOneCheckUpSell = loadable(() => import(\"./NewOneCheckUpSell\"));\r\nconst ConditionCheck = loadable(() => import(\"./ConditionCheck\"));\r\nconst CouponCodeForm = loadable(() => import(\"./CouponCodeForm\"));\r\n\r\nconst CheckoutButton = (props) => {\r\n const {\r\n campaigns,\r\n cart_settings,\r\n get_total,\r\n Utils,\r\n isPreview,\r\n shop_url,\r\n cart_level_discount_applications,\r\n shopify_cart_items,\r\n shopify_cart_upsells,\r\n cart_currency,\r\n productAddedToCart,\r\n discountCode,\r\n token,\r\n showCheckoutLoading,\r\n cartNote,\r\n slider,\r\n setPreviewed_product,\r\n update_cart_item,\r\n hasAutoDiscount,\r\n rechargeSettings,\r\n } = useContext(CartContext);\r\n const cartLevelAutoDiscount = useMemo(() => {\r\n return GetCartLevelAutoDiscount({ cart_level_discount_applications });\r\n }, [shopify_cart_items, cart_level_discount_applications]);\r\n const [checkoutLoading, setCheckoutLoading] = useState(false);\r\n const [previewCheckoutToast, setPreviewCheckoutToast] = useState(false);\r\n const [isTermsAccepted, setIsTermsAccepted] = useState(false);\r\n const [shakeClass, setShakeClass] = useState(\"\");\r\n const {\r\n theme: { secondary, primary, background },\r\n money_format,\r\n modules: { checkout_button },\r\n auto_discount = DefaultAutoDiscountSettings,\r\n currency,\r\n show_coupon,\r\n show_coupon_alert_text,\r\n rtl,\r\n cod_settings = {},\r\n scary = {},\r\n badges = {},\r\n announcement = {},\r\n afterPay,\r\n checkout_condition_text,\r\n is_checkout_condition_active,\r\n checkout_condition_color,\r\n } = cart_settings;\r\n function formatAutoDiscount(discount) {\r\n const { title, total_allocated_amount } = discount;\r\n return auto_discount.text.text\r\n .replace(\"{{title}}\", title)\r\n .replace(\r\n \"{{amount}}\",\r\n Utils.formatMoney(total_allocated_amount, money_format)\r\n );\r\n }\r\n function formatCheckout(text) {\r\n const moneyHtml = Utils.formatMoney(get_total(\"subtotal\"), money_format);\r\n const parser = new DOMParser();\r\n const doc = parser.parseFromString(moneyHtml, \"text/html\");\r\n const subtotal = doc.body.textContent || \"\";\r\n return text\r\n .replace(/\\//g, \"•\")\r\n .replace(\r\n /(\\{)?\\{\\s*subtotal\\s*\\}(\\})?/gi,\r\n () => `<span class=\"money\">${subtotal}</span>`\r\n );\r\n }\r\n const generateCheckoutUrl = (discount = null, esid = null) => {\r\n const wheelioDiscount = Cookies.get(\"discount_code\");\r\n const queryString = [\r\n discount && `discount=${encodeURIComponent(discount)}`,\r\n !discount &&\r\n wheelioDiscount &&\r\n `discount=${encodeURIComponent(wheelioDiscount)}`,\r\n esid && `attributes[esid]=${esid}`,\r\n ].filter(Boolean);\r\n return Utils.getLangPath(\r\n `checkout${queryString.length ? `?${queryString.join(\"&\")}` : \"\"}`\r\n );\r\n // return `https://${shop_url}/cart/${shopify_cart_items\r\n // \t.map(({ variant_id, quantity }) => `${variant_id}:${quantity}`)\r\n // \t.join()}${discount ? '?discount=' + discount : ''}`;\r\n };\r\n const setNote = async () => {\r\n try {\r\n await API.post(Utils.getLangPath(\"cart/update.js\"), { note: cartNote });\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n };\r\n const [one_check_up_sell_product_id, ocu_campaign, ocu_isGlobal] =\r\n useCampaign(\"one_check_up_sell\", null, true)(campaigns, shopify_cart_items);\r\n const [add_to_unlock_product_id, add_to_unlock, isGlobal] = useCampaign(\r\n \"add_to_unlock\"\r\n )(campaigns, shopify_cart_items);\r\n const CAN_RENDER_ADD_TO_UNLOCK =\r\n add_to_unlock &&\r\n (add_to_unlock.products.length ||\r\n add_to_unlock.recommendation_type == \"shopify_recommendation\" ||\r\n isPreview) &&\r\n add_to_unlock.show_suggestions &&\r\n (productAddedToCart({ id: add_to_unlock_product_id }) ||\r\n (isGlobal && shopify_cart_items.length));\r\n const products = getAllOCUProducts(ocu_campaign);\r\n const CAN_RENDER_ONE_CHECK_UP_SELL =\r\n ocuHasProduct(ocu_campaign || {}, products, isPreview) &&\r\n (productAddedToCart({ id: one_check_up_sell_product_id }) ||\r\n (ocu_isGlobal && shopify_cart_items.length));\r\n\r\n const redirectToCheckout = async (discount = null, esid = null) => {\r\n if(window.addShipProtect){\r\n await window.addShipProtect();\r\n }\r\n const checkoutUrl = generateCheckoutUrl(discount, esid);\r\n if (window.mu_checkoutHook) {\r\n const response = await window.mu_checkoutHook(checkoutUrl, setCheckoutLoading);\r\n if(response) return;\r\n }\r\n setCheckoutLoading(false);\r\n window.location.href = checkoutUrl;\r\n };\r\n\r\n const generateReChargeCheckout = async () => {\r\n const {\r\n data: { token },\r\n } = await axios.get(`${window.location.origin}/cart.js`);\r\n const checkoutUrl = `https://checkout.rechargeapps.com/r/checkout?myshopify_domain=${\r\n shop_url || window.Shopify.shop\r\n }&cart_token=${token}`;\r\n setCheckoutLoading(false);\r\n window.location.href = checkoutUrl;\r\n };\r\n\r\n const checkout = async () => {\r\n const isRechargeCheckout =\r\n rechargeSettings &&\r\n !!shopify_cart_items.filter(\r\n ({ properties }) =>\r\n properties &&\r\n properties?.shipping_interval_frequency &&\r\n properties?.shipping_interval_unit_type\r\n ).length;\r\n if (is_checkout_condition_active && !isTermsAccepted) {\r\n setShakeClass('shake-it');\r\n if (!shakeClass) {\r\n setTimeout(() => {\r\n setShakeClass('');\r\n }, 900);\r\n }\r\n return;\r\n }\r\n if (isPreview) {\r\n setCheckoutLoading(true);\r\n setPreviewCheckoutToast(true);\r\n setTimeout(() => {\r\n setCheckoutLoading(false);\r\n setPreviewCheckoutToast(false);\r\n }, 4000);\r\n return;\r\n }\r\n await setNote();\r\n if (window.mu_custom_checkout) {\r\n const continueExecuting = await window.mu_custom_checkout();\r\n if(continueExecuting === false) return;\r\n }\r\n if (window.ttq && !window.mu_disable_tiktok_tracking) {\r\n window.ttq.track('StartCheckout', {\r\n value: get_total('subtotal') / 100,\r\n currency: cart_currency,\r\n contents: shopify_cart_items.map((item) => ({\r\n content_type: 'product',\r\n content_name: item.title,\r\n content_id: item.product_id,\r\n quantity: item.quantity,\r\n price: item.price / 100\r\n }))\r\n });\r\n }\r\n setCheckoutLoading(true);\r\n if (discountCode) {\r\n return await redirectToCheckout(discountCode.code);\r\n } else if (hasAutoDiscount) {\r\n return await redirectToCheckout();\r\n }\r\n if (isRechargeCheckout) {\r\n return generateReChargeCheckout();\r\n }\r\n // const token = cart_token || generateToken(campaigns)\r\n API.post(`${API_GATEWAY_NEW}/public/checkout`, {\r\n shop: shop_url || window.Shopify?.shop,\r\n items: shopify_cart_items.map(\r\n ({ variant_id, product_id, quantity, selling_plan_allocation }) => ({\r\n variant_id,\r\n product_id,\r\n quantity,\r\n sp: selling_plan_allocation?.selling_plan?.id\r\n })\r\n ),\r\n note: cartNote,\r\n fbt: shopify_cart_upsells,\r\n cart_currency,\r\n schema: Object.entries(campaigns).reduce((acc, cur) => {\r\n const [product_id, campaigns] = cur;\r\n acc[product_id] = campaigns.map(({ campaign_key }) => campaign_key);\r\n return acc;\r\n }, {}),\r\n discountCode: discountCode?.title || null\r\n })\r\n .then(async ({ data: { invoice_url, code, esid } }) => {\r\n Cookies.remove('monster_cart');\r\n Cookies.remove('monster_product_id');\r\n if(!window.mu_keep_checkout_loading) setCheckoutLoading(false);\r\n if (invoice_url) {\r\n window.location.href = invoice_url;\r\n } else {\r\n if (code) {\r\n await axios.get(`${window.location.origin}/discount/${code}`);\r\n }\r\n return await redirectToCheckout(code, esid);\r\n }\r\n })\r\n .catch((error) => {\r\n console.log('checkout error', error);\r\n setCheckoutLoading(false);\r\n });\r\n };\r\n\r\n useEffect(() => {\r\n async function getCheckoutInfo(\r\n items = window.mu_filter_discount_items\r\n ? window.mu_filter_discount_items(shopify_cart_items)\r\n : shopify_cart_items\r\n ) {\r\n const { data } = await API.post(`${API_GATEWAY_NEW}/public/checkout`, {\r\n shop: shop_url || window.Shopify?.shop,\r\n items: items.map(\r\n ({\r\n variant_id,\r\n product_id,\r\n quantity,\r\n selling_plan_allocation,\r\n price,\r\n }) => ({\r\n variant_id,\r\n product_id,\r\n quantity,\r\n sp: selling_plan_allocation?.selling_plan?.id,\r\n ...(selling_plan_allocation\r\n ? {\r\n selling_plan: {\r\n price_adjustments_value:\r\n ((price - selling_plan_allocation.price) / price) * 100,\r\n price_adjustments_value_type: \"percentage\",\r\n },\r\n }\r\n : {}),\r\n })\r\n ),\r\n note: cartNote,\r\n fbt: shopify_cart_upsells,\r\n cart_currency,\r\n schema: Object.entries(campaigns).reduce((acc, cur) => {\r\n const [product_id, campaigns] = cur;\r\n acc[product_id] = campaigns.map(({ campaign_key }) => campaign_key);\r\n return acc;\r\n }, {}),\r\n discountCode: discountCode?.title || null,\r\n });\r\n return data;\r\n }\r\n window.mu_get_discount = getCheckoutInfo;\r\n }, [\r\n discountCode,\r\n shopify_cart_items,\r\n cartNote,\r\n shopify_cart_upsells,\r\n campaigns,\r\n ]);\r\n \r\n useEffect(() => {\r\n window.mu_terms_accepted = isTermsAccepted;\r\n }, [isTermsAccepted]);\r\n\r\n return (\r\n <div\r\n id=\"mu-checkout-container\"\r\n className={classNames(\"px-5\", {\r\n \"relative overflow-hidden border-t border-gray-300 pt-2 pb-2\":\r\n checkout_button.fix_checkout_container,\r\n })}\r\n >\r\n {/* {isPreview && previewCheckoutToast && (\r\n const checkout = async () => {\r\n const isRechargeCheckout =\r\n rechargeSettings &&\r\n !!shopify_cart_items.filter(\r\n ({ properties }) =>\r\n properties &&\r\n properties?.shipping_interval_frequency &&\r\n properties?.shipping_interval_unit_type\r\n ).length;\r\n if (is_checkout_condition_active && !isTermsAccepted) {\r\n setShakeClass(\"shake-it\");\r\n if (!shakeClass) {\r\n setTimeout(() => {\r\n setShakeClass(\"\");\r\n }, 900);\r\n }\r\n return;\r\n }\r\n if (isPreview) {\r\n setCheckoutLoading(true);\r\n setPreviewCheckoutToast(true);\r\n setTimeout(() => {\r\n setCheckoutLoading(false);\r\n setPreviewCheckoutToast(false);\r\n }, 4000);\r\n return;\r\n }\r\n await setNote();\r\n if (window.ttq && !window.mu_disable_tiktok_tracking) {\r\n window.ttq.track(\"StartCheckout\", {\r\n value: get_total(\"subtotal\") / 100,\r\n currency: cart_currency,\r\n contents: shopify_cart_items.map((item) => ({\r\n content_type: \"product\",\r\n content_name: item.title,\r\n content_id: item.product_id,\r\n quantity: item.quantity,\r\n price: item.price / 100,\r\n })),\r\n });\r\n }\r\n setCheckoutLoading(true);\r\n if (discountCode) {\r\n return await redirectToCheckout(discountCode.code);\r\n } else if (hasAutoDiscount) {\r\n return await redirectToCheckout();\r\n }\r\n if (isRechargeCheckout) {\r\n return generateReChargeCheckout();\r\n }\r\n // const token = cart_token || generateToken(campaigns)\r\n API.post(`${API_GATEWAY_NEW}/public/checkout`, {\r\n shop: shop_url || window.Shopify?.shop,\r\n items: shopify_cart_items.map(\r\n ({ variant_id, product_id, quantity, selling_plan_allocation }) => ({\r\n variant_id,\r\n product_id,\r\n quantity,\r\n sp: selling_plan_allocation?.selling_plan?.id,\r\n })\r\n ),\r\n note: cartNote,\r\n fbt: shopify_cart_upsells,\r\n cart_currency,\r\n schema: Object.entries(campaigns).reduce((acc, cur) => {\r\n const [product_id, campaigns] = cur;\r\n acc[product_id] = campaigns.map(({ campaign_key }) => campaign_key);\r\n return acc;\r\n }, {}),\r\n discountCode: discountCode?.title || null,\r\n })\r\n .then(async ({ data: { invoice_url, code, esid } }) => {\r\n Cookies.remove(\"monster_cart\");\r\n Cookies.remove(\"monster_product_id\");\r\n if (!window.mu_keep_checkout_loading) setCheckoutLoading(false);\r\n if (invoice_url) {\r\n window.location.href = invoice_url;\r\n } else {\r\n if (code) {\r\n await axios.get(`${window.location.origin}/discount/${code}`);\r\n }\r\n return await redirectToCheckout(code, esid);\r\n }\r\n })\r\n .catch((error) => {\r\n console.log(\"checkout error\", error);\r\n setCheckoutLoading(false);\r\n });\r\n };\r\n return (\r\n <div\r\n id=\"mu-checkout-container\"\r\n className={classNames(\"px-5\", {\r\n \"relative overflow-hidden border-t border-gray-300 pt-2 pb-2\":\r\n checkout_button.fix_checkout_container,\r\n })}\r\n >\r\n {/* {isPreview && previewCheckoutToast && (\r\n\t\t\t\t<Toast content={`This is only a preview button. Visit store for action`} duration={3000} />\r\n\t\t\t)} */}\r\n\r\n {cartLevelAutoDiscount && (\r\n <div style={{ textAlign: \"end\" }}>\r\n <div\r\n className={classNames(\r\n \"text-sm p-1 rounded mb-1 inline-flex items-center space-x-1\"\r\n )}\r\n style={{\r\n fontSize: `${auto_discount.text.font_size}em`,\r\n fontWeight: auto_discount.text.font_weight,\r\n color: Utils.formatColor(auto_discount.text.color),\r\n background: Utils.formatColor(auto_discount.background),\r\n border: `${Utils.formatColor(auto_discount.border)} 1px solid`,\r\n }}\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n className={classNames(\"w-5 h-5\")}\r\n >\r\n <path\r\n fill-rule=\"evenodd\"\r\n d=\"M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n <span className={classNames(\"leading-none\")}>\r\n {formatAutoDiscount(cartLevelAutoDiscount)}\r\n </span>\r\n </div>\r\n </div>\r\n )}\r\n {show_coupon && <CouponCodeForm />}\r\n\r\n {scary.isActive && scary.placement === \"bottom\" && (\r\n <Scary scary={scary} />\r\n )}\r\n {announcement?.isActive && announcement.position === \"above_totals\" && (\r\n <Announcement announcement={announcement} />\r\n )}\r\n {badges?.isActive && badges.position === \"above_totals\" && (\r\n <Badges badges={badges} />\r\n )}\r\n <InfoItem\r\n name={{ ...checkout_button.savings, text: \"total\" }}\r\n value={get_total(\"total\")}\r\n infoClass=\"total hidden\"\r\n />\r\n {get_total(\"finalDiscount\") > 0 && (\r\n <InfoItem\r\n negative={true}\r\n name={checkout_button.savings}\r\n value={get_total(\"finalDiscount\")}\r\n infoClass=\"savings\"\r\n />\r\n )}\r\n\r\n <InfoItem\r\n name={checkout_button.subtotal}\r\n value={get_total(\"subtotal\")}\r\n infoClass={`subtotal${\r\n checkout_button.show_subtotal ? \" hidden\" : \"\"\r\n }`}\r\n />\r\n {afterPay?.isActive && (\r\n <AfterPay afterPay={afterPay} price={get_total(\"subtotal\")} />\r\n )}\r\n {!!CAN_RENDER_ONE_CHECK_UP_SELL && (\r\n <div\r\n id=\"mu-ocu-container\"\r\n className={classNames(\"flex flex-col mb-1 space-y-1\")}\r\n >\r\n {products.map((ocu, i) => {\r\n const isOld = !ocu_campaign?.multi_one_check_upsell;\r\n if (isOld) {\r\n return (\r\n <OneCheckUpSell\r\n key={`one_tick_${i}`}\r\n one_check_up_sell={ocu}\r\n />\r\n );\r\n } else {\r\n return (\r\n <NewOneCheckUpSell\r\n key={`one_tick_${i}`}\r\n index={i}\r\n one_check_up_sell={ocu}\r\n multi_one_check_upsell={ocu_campaign.multi_one_check_upsell}\r\n />\r\n );\r\n }\r\n })}\r\n </div>\r\n )}\r\n {!!is_checkout_condition_active && (\r\n <ConditionCheck\r\n {...{\r\n checkout_condition_text,\r\n checkout_condition_color,\r\n isTermsAccepted,\r\n setIsTermsAccepted,\r\n Utils,\r\n rtl,\r\n shakeClass,\r\n }}\r\n />\r\n )}\r\n {badges?.isActive && badges.position === \"above_checkout\" && (\r\n <Badges badges={badges} />\r\n )}\r\n <div className=\"fondue-cashback-module\"></div>\r\n {/* normal checkout */}\r\n <button\r\n id=\"mu-checkout-button\"\r\n className={classNames(\r\n `custom-btn w-full${checkout_button.checkout_as_link ? \" py-1\":\" py-3\"} mb-2 checkout-btn flex items-center justify-center`,\r\n {\r\n \"rounded\": !checkout_button.checkout_as_link,\r\n \"hover:bg-transparent\": checkout_button.checkout_as_link\r\n }\r\n )}\r\n style={{\r\n backgroundColor: checkout_button.checkout_as_link\r\n ? \"transparent\"\r\n : Utils.formatColor(checkout_button.background),\r\n border: checkout_button.checkout_as_link ? \"none\" : \"inherit\",\r\n textDecoration: checkout_button.checkout_as_link\r\n ? \"underline\"\r\n : \"none\",\r\n fontFamily: \"inherit\",\r\n fontSize: Utils.em(checkout_button.button_text.font_size),\r\n fontWeight: checkout_button.button_text.font_weight,\r\n color:\r\n checkoutLoading || showCheckoutLoading\r\n ? Utils.formatColor(checkout_button.button_text_loading.color)\r\n : Utils.formatColor(checkout_button.button_text.color),\r\n \"--hover-background\": Utils.formatColor(\r\n checkout_button.hoverBackground\r\n ),\r\n }}\r\n onClick={async () => await checkout()}\r\n disabled={checkoutLoading || showCheckoutLoading}\r\n data-loading={`${checkoutLoading || showCheckoutLoading}`}\r\n data-display={Utils.formatMoney(get_total(\"subtotal\"), money_format)}\r\n >\r\n {window.mu_checkout_img && (\r\n <span\r\n className={classNames(\"mr-2\")}\r\n dangerouslySetInnerHTML={{ __html: window.mu_checkout_img }}\r\n />\r\n )}\r\n <span\r\n dangerouslySetInnerHTML={{\r\n __html:\r\n (checkoutLoading || showCheckoutLoading) &&\r\n !window.mu_stop_checkout_loading\r\n ? checkout_button.button_text_loading.text\r\n : formatCheckout(checkout_button.button_text.text),\r\n }}\r\n />\r\n {/* {checkout_button.show_subtotal &&\r\n !checkoutLoading &&\r\n !showCheckoutLoading && (\r\n <span\r\n className={classNames(\"checkout-subtotal\", {\r\n \"ml-1\": !rtl,\r\n \"mr-1\": rtl,\r\n })}\r\n >\r\n • {Utils.formatMoney(get_total(\"subtotal\"), money_format)}\r\n </span>\r\n )} */}\r\n </button>\r\n {badges?.isActive && badges.position === \"bellow_checkout\" && (\r\n <Badges badges={badges} />\r\n )}\r\n {checkout_button.active_continue_shopping_button && (\r\n <div\r\n id=\"mu-continue-shopping\"\r\n onClick={() => {\r\n if (window.mu_continue_shopping_logic) {\r\n const continueExecuting = window.mu_continue_shopping_logic();\r\n if (continueExecuting === false) return;\r\n }\r\n if (window.closeCart) window.closeCart();\r\n }}\r\n className={classNames(\r\n \"custom-btn w-full w-full py-1 mb-1 text-center cursor-pointer\"\r\n )}\r\n style={{\r\n color: Utils.formatColor(\r\n checkout_button.continue_shopping_button.color\r\n ),\r\n fontSize: `${checkout_button.continue_shopping_button.font_size}em`,\r\n textDecoration:\r\n checkout_button.active_continue_shopping_underlined &&\r\n \"underline\",\r\n }}\r\n >\r\n {checkout_button.continue_shopping_button.text}\r\n </div>\r\n )}\r\n {!!CAN_RENDER_ADD_TO_UNLOCK &&\r\n add_to_unlock.fbt_position !== \"under_products\" &&\r\n add_to_unlock.fbt_position !== \"above_checkout\" &&\r\n (add_to_unlock.fbt_position || !add_to_unlock.fbt_below) && (\r\n <AddToUnlock {...{ add_to_unlock, add_to_unlock_product_id }} />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nconst InfoItem = ({\r\n name: { text, font_size, color, font_weight },\r\n value,\r\n negative = false,\r\n infoClass = \"\",\r\n}) => {\r\n const {\r\n Utils,\r\n cart_settings: { money_format },\r\n } = useContext(CartContext);\r\n // const original = get_total('discount') > 0 ? get_total('original') : null;\r\n return (\r\n <div\r\n className={classNames(\r\n `${infoClass} pb-2 flex items-center font-bold info-item`\r\n )}\r\n style={{\r\n fontSize: Utils.em(font_size),\r\n fontWeight: font_weight,\r\n color: Utils.formatColor(color),\r\n }}\r\n >\r\n <span\r\n className={classNames(\"flex-1 flex-grow\")}\r\n style={{ color: \"inherit\" }}\r\n >\r\n {text}\r\n </span>\r\n <AnimatedNumber\r\n component=\"span\"\r\n value={value}\r\n style={{ color: \"inherit\" }}\r\n formatValue={(n) =>\r\n `${\r\n negative && !window.mu_stop_negative ? \"-\" : \"\"\r\n }${Utils.formatMoney(n, money_format)}`\r\n }\r\n />\r\n </div>\r\n );\r\n};\r\n\r\nconst AnimatedNumber = ({ value, style = {}, formatValue = null }) => (\r\n <span\r\n {...{ style }}\r\n data-value={formatValue ? formatValue(value) : value}\r\n className=\"notranslate\"\r\n dangerouslySetInnerHTML={{\r\n __html: formatValue ? formatValue(value) : value,\r\n }}\r\n />\r\n);\r\n\r\nCheckoutButton.propTypes = {};\r\n\r\nexport default CheckoutButton;\r\n\r\nfunction ocuHasProduct(\r\n { one_check_up_sell, multi_one_check_upsell } = {},\r\n products,\r\n preview\r\n) {\r\n if (preview) return true;\r\n if (!one_check_up_sell && !multi_one_check_upsell) return false;\r\n return !!products.find(canRenderOCU);\r\n}\r\n\r\nexport function getAllOCUProducts(campaign) {\r\n if (!campaign) return [];\r\n const { one_check_up_sell, multi_one_check_upsell } = campaign;\r\n return multi_one_check_upsell\r\n ? multi_one_check_upsell.products\r\n : [one_check_up_sell];\r\n}\r\n\r\nexport function isOCUProduct(campaign, product_id, is_example) {\r\n if (!campaign) return false;\r\n if (is_example) return true;\r\n const products = getAllOCUProducts(campaign);\r\n return !!products.find(\r\n ({ product }) => product && parseInt(product.id) === product_id\r\n );\r\n}\r\n\r\nfunction canRenderOCU({ product, text }) {\r\n return !!product && !!text;\r\n}\r\n\r\n// function generateToken (campaigns) {\r\n// const token = Object.assign(\r\n// {},\r\n// ...Object.entries(campaigns).map(([product_id, product_campaigns]: any[]) => {\r\n// return {\r\n// [product_id]: product_campaigns.map(({ campaign_key }: any) => campaign_key)\r\n// }\r\n// })\r\n// );\r\n// const simpleCrypto = new SimpleCrypto('58j?18!rI/]63#i~aqZZ*p(7<GSyJH');\r\n// return simpleCrypto.encrypt(token)\r\n// }\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"container\":\"product_selector_container__2zpr4\",\"add\":\"product_selector_add__2HM2T\",\"inside\":\"product_selector_inside__2UXx0\",\"product\":\"product_selector_product__3n_bR\",\"selected\":\"product_selector_selected__2eAkw\",\"title\":\"product_selector_title__1Lo6w\",\"priceTag\":\"product_selector_priceTag__3eKmJ\",\"tile\":\"product_selector_tile__heHJN\"};","import React, { useEffect } from \"react\";\r\nimport ReactSwitch from \"react-switch\";\r\nimport useBindToContext from \"hooks/useBindToContext\";\r\nimport classNames from \"lib/classNames\";\r\n\r\nconst Switch = ({\r\n\tvalue,\r\n\tdisabled = false,\r\n\tclassName = \"\",\r\n\tonChange,\r\n\tBindToContext = null,\r\n\thandleDiameter,\r\n\twidth,\r\n\theight,\r\n\tonColor,\r\n\toffColor,\r\n\tonHandleColor,\r\n\toffHandleColor,\r\n\tonFocus,\r\n\tonBlur,\r\n\tnoText = false\r\n}) => {\r\n\tconst [BindedValue, BindedOnChange, _, onRender] = useBindToContext(\r\n\t\tBindToContext,\r\n\t\tvalue,\r\n\t\tonChange\r\n\t);\r\n\r\n\t//useEffect(() => {\r\n\t//if (onRender?.length) onRender.forEach(fn => fn());\r\n\t//}, [onRender]);\r\n\r\n\treturn (\r\n\t\t<ReactSwitch\r\n\t\t\tchecked={BindedValue || false}\r\n\t\t\tonColor={onColor || \"#68d391\"}\r\n\t\t\toffColor={offColor || \"#f6ad55\"}\r\n\t\t\tdisabled={disabled}\r\n\t\t\tonHandleColor={onHandleColor || \"#FFFFFF\"}\r\n\t\t\toffHandleColor={offHandleColor || \"#FFFFFF\"}\r\n\t\t\thandleDiameter={handleDiameter || 22}\r\n\t\t\tboxShadow=\"0px 1px 5px rgba(0, 0, 0, 0.6)\"\r\n\t\t\tuncheckedIcon={false}\r\n\t\t\theight={height || 20}\r\n\t\t\twidth={width || 47}\r\n\t\t\tonChange={BindedOnChange}\r\n\t\t\tclassName={`switch ${className}`}\r\n\t\t\tonFocus={(e) => {\r\n\t\t\t\tif (onFocus) onFocus(e);\r\n\t\t\t}}\r\n\t\t\tonBlur={(e) => {\r\n\t\t\t\tif (onBlur) onBlur(e);\r\n\t\t\t}}\r\n\t\t\tcheckedIcon={\r\n\t\t\t\tnoText ? false : (\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\"flex-center h-full font-bold text-white pl-1\"\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\tstyle={{ fontSize: \"0.6em\" }}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\tON\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t\tuncheckedIcon={\r\n\t\t\t\tnoText ? false : (\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\"flex-center h-full font-bold text-white pr-1\"\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\tstyle={{ fontSize: \"0.6em\" }}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\tOFF\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)\r\n\t\t\t}\r\n\t\t/>\r\n\t);\r\n};\r\n\r\nexport default Switch;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"form\":\"campaign_settings_second_step_form__1IwEJ\",\"addBundle\":\"campaign_settings_second_step_addBundle__1TAkA\",\"goal\":\"campaign_settings_second_step_goal__1blpn\",\"row\":\"campaign_settings_second_step_row__14sXN\",\"header\":\"campaign_settings_second_step_header__3ous6\",\"switch\":\"campaign_settings_second_step_switch__1cken\",\"presets\":\"campaign_settings_second_step_presets__2Utnf\",\"preset\":\"campaign_settings_second_step_preset__2IPiF\",\"cover\":\"campaign_settings_second_step_cover__1FPwP\",\"title\":\"campaign_settings_second_step_title__1KprV\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"overlay\":\"tutorial_overlay__20obe\",\"container\":\"tutorial_container__1J8-S\",\"close\":\"tutorial_close__1evcg\",\"link\":\"tutorial_link__2Ffsy\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"modal\":\"modal_modal__3apDG\",\"header\":\"modal_header__3_jDX\",\"meta\":\"modal_meta__3yj7b\",\"head\":\"modal_head__2Vy9R\",\"content\":\"modal_content__39mqc\",\"wrapper\":\"modal_wrapper__xkAcp\",\"footer\":\"modal_footer__JiRDX\"};","import React from 'react';\r\nimport styles from 'styles/button.module.scss';\r\nimport loadable from '@loadable/component'\r\nimport PropTypes from 'prop-types';\r\nimport styled from 'styled-components';\r\nimport classNames from 'lib/classNames';\r\nconst Icon = loadable(() => import('components/Icon'));\r\n\r\nconst StyledButton = styled.button`\r\n\t&:hover,\r\n\t&:active {\r\n\t\tbackground: ${(props) => props.hover_background || ''} !important;\r\n\t}\r\n`;\r\n\r\nconst iconSizes = {\r\n\tdefault: 'lg',\r\n\tsmall: 'sm',\r\n\tmedium: '1x',\r\n};\r\n\r\nconst Button = (props) => {\r\n\tconst {\r\n\t\ttype,\r\n\t\tonClick,\r\n\t\tonMouseEnter,\r\n\t\tstyle,\r\n\t\tsize,\r\n\t\tclassName,\r\n\t\tid,\r\n\t\tloading,\r\n\t\tvalue,\r\n\t\tdisabled,\r\n\t\treact_ref,\r\n\t\thover_background,\r\n\t\tbeta\r\n\t} = props;\r\n\treturn (\r\n\t\t<StyledButton\r\n\t\t\tclassName={`${styles.button} ${styles['type-' + type]} ${styles['size-' + size]\r\n\t\t\t\t} ${className} focus:mu-outline-none focus:mu-shadow-ring`}\r\n\t\t\t{...{\r\n\t\t\t\tonClick,\r\n\t\t\t\tonMouseEnter,\r\n\t\t\t\tstyle,\r\n\t\t\t\tid,\r\n\t\t\t\tref: react_ref,\r\n\t\t\t\tvalue,\r\n\t\t\t\tdisabled: disabled || loading,\r\n\t\t\t\thover_background,\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{beta && <div className={`${styles.badge} ${classNames('flex-center bg-orange-500 transform -translate-y-full')}`} style={{ top: 10, right: 5 }}>Beta</div>}\r\n\t\t\t{loading ? <ButtonLoading {...props} /> : <ButtonText {...props} />}\r\n\t\t</StyledButton>\r\n\t);\r\n};\r\n\r\nconst ButtonText = (props) => {\r\n\tconst { text, icon, size, iconFirst } = props;\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{icon && iconFirst && <Icon className={text && 'mr-2'} icon={icon} size={iconSizes[size]} />}\r\n\t\t\t{text && <b>{text}</b>}\r\n\t\t\t{icon && !iconFirst && <Icon className={text && 'ml-2'} icon={icon} size={iconSizes[size]} />}\r\n\t\t</>\r\n\t);\r\n};\r\n\r\nconst ButtonLoading = (props) => {\r\n\tconst { text } = props;\r\n\treturn (\r\n\t\t<div className={styles.loadingContainer}>\r\n\t\t\t<b>{text}</b>\r\n\t\t\t<Icon icon=\"spinner-third\" className=\"absolute\" spin />\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nButton.propTypes = {\r\n\ttext: PropTypes.string.isRequired,\r\n\tsize: PropTypes.string.isRequired,\r\n\ticonFirst: PropTypes.bool.isRequired,\r\n\ttype: PropTypes.string.isRequired,\r\n\tstyle: PropTypes.object,\r\n\tclassName: PropTypes.string,\r\n\tloading: PropTypes.bool.isRequired,\r\n};\r\n\r\nButton.defaultProps = {\r\n\ttype: 'primary',\r\n\tstyle: {},\r\n\tsize: 'default',\r\n\tclassName: '',\r\n\tloading: false,\r\n\ttext: '',\r\n\tid: '',\r\n\ticonFirst: true,\r\n\tonClick: undefined,\r\n\tonMouseEnter: undefined,\r\n\tvalue: null,\r\n\tdisabled: false,\r\n\treact_ref: null,\r\n};\r\n\r\nexport default Button;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"header\":\"dashboard_header__14yuA\",\"campaignsFilter\":\"dashboard_campaignsFilter__2h7z9\",\"states\":\"dashboard_states__1B9Au\",\"loading\":\"dashboard_loading__2vAf5\",\"flashStates\":\"dashboard_flashStates__3lVIY\",\"stateCard\":\"dashboard_stateCard__3T-mT\",\"chart\":\"dashboard_chart__UKsJP\",\"setup\":\"dashboard_setup__28PQV\",\"ChartMenu\":\"dashboard_ChartMenu__202y2\",\"ChartMenuItem\":\"dashboard_ChartMenuItem__3ilrU\",\"title\":\"dashboard_title__2i7dv\",\"value\":\"dashboard_value__M21cy\",\"step\":\"dashboard_step__3jaUr\",\"icon\":\"dashboard_icon__1J1Ij\",\"content\":\"dashboard_content__66QhG\",\"SetupAlert\":\"dashboard_SetupAlert__3dYsA\",\"progress\":\"dashboard_progress__1SQ3f\",\"pre\":\"dashboard_pre__cH_dR\",\"suf\":\"dashboard_suf__1liR0\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"dots\":\"image_picker_dots__1ZbAy\",\"dots-u8fzftmn\":\"image_picker_dots-u8fzftmn__2OkFO\",\"ImagePicker\":\"image_picker_ImagePicker__3C4AL\",\"label\":\"image_picker_label__2CcS5\",\"image\":\"image_picker_image__1Bbf0\",\"dots-u8fzftmd\":\"image_picker_dots-u8fzftmd__18yMz\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"trigger\":\"date_range_trigger__3XX7W\",\"leftIcon\":\"date_range_leftIcon__Zp3HF\",\"rightIcon\":\"date_range_rightIcon__1Abh6\",\"content\":\"date_range_content__3TOvS\",\"tag\":\"date_range_tag__6cBuf\",\"text\":\"date_range_text__WRmLX\",\"close\":\"date_range_close__17dCm\",\"DateRangePicker\":\"date_range_DateRangePicker__1kkkB\",\"menu\":\"date_range_menu__3SN3v\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"badge\":\"button_badge__LxuwU\",\"button\":\"button_button__1Tp7w\",\"loadingContainer\":\"button_loadingContainer__35W0p\",\"withTextRight\":\"button_withTextRight__34ghc\",\"withTextLeft\":\"button_withTextLeft__3eDna\",\"type-primary\":\"button_type-primary__e0GEw\",\"type-circle-icon__primary\":\"button_type-circle-icon__primary__4O12F\",\"type-circle-icon__default\":\"button_type-circle-icon__default__3qvka\",\"type-danger\":\"button_type-danger__2qiaJ\",\"type-danger2\":\"button_type-danger2__1AQrH\",\"type-warning\":\"button_type-warning__L17EG\",\"type-warning2\":\"button_type-warning2__2NAdU\",\"type-default\":\"button_type-default__1yYTs\",\"type-success\":\"button_type-success__c3zUS\",\"type-success-filled\":\"button_type-success-filled__1RlVN\",\"type-secondary\":\"button_type-secondary__3BhlA\",\"type-secondary2\":\"button_type-secondary2__2RpGt\",\"type-info\":\"button_type-info__3dgSy\",\"type-link\":\"button_type-link__1uiFH\",\"type-link-success\":\"button_type-link-success__2DdQx\",\"type-link-danger\":\"button_type-link-danger__2xKa3\",\"type-link-primary\":\"button_type-link-primary__2rOwo\",\"type-link-info\":\"button_type-link-info__2tTu4\",\"type-link-secondary\":\"button_type-link-secondary__1vmVN\",\"type-link-warning\":\"button_type-link-warning__3gAfm\",\"type-link-default\":\"button_type-link-default__2vtUP\",\"type-circle-primary\":\"button_type-circle-primary__43jux\",\"type-circle-secondary\":\"button_type-circle-secondary__1i58v\",\"type-circle-danger\":\"button_type-circle-danger__30NdJ\",\"type-circle-success\":\"button_type-circle-success__3oXH8\",\"type-circle-warning\":\"button_type-circle-warning__1JB5c\",\"size-default\":\"button_size-default__2X4Dr\",\"size-small\":\"button_size-small__2q0gD\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"carousel\":\"carousel_carousel__1kW5u\",\"content\":\"carousel_content__1risj\",\"control\":\"carousel_control__T8TqV\"};","import english from './translations/english';\r\nimport french from './translations/french';\r\nimport arabic from './translations/arabic';\r\nimport german from './translations/german';\r\n\r\nexport default { english, french, arabic, german };\r\n","export default {\r\n rtl: false,\r\n header: {\r\n title: 'Your Cart'\r\n },\r\n empty_cart: '',\r\n shipping_option: 'livraison standard',\r\n product: {\r\n sold_out: 'Sold Out'\r\n },\r\n product_details: {\r\n atcButton: { text: 'Add To Cart' },\r\n readMore: { text: 'Read More' }\r\n },\r\n modules: {\r\n checkout_button: {\r\n button_text: { text: 'Checkout / {{ subtotal }}' },\r\n button_text_loading: { text: 'Generating Offer...' },\r\n use_coupon_code: { text: 'Coupon code' },\r\n enter_coupon_code: { text: 'Enter Coupon Code' },\r\n apply_coupon_code: { text: 'Apply' },\r\n edit_coupon_code: { text: 'Edit' },\r\n close_coupon_code: { text: 'Close' },\r\n subtotal: { text: 'Subtotal' },\r\n savings: { text: 'Savings' },\r\n coupon_alert_text: { text: 'Code overrides offers' }\r\n },\r\n random_text: {\r\n text: '<p class=\"ql-align-center\">100% NO-RISK MONEY BACK GUARANTEE</p>'\r\n },\r\n order_note: {\r\n text: '<p> <strong>Add a note to your order</strong></p>'\r\n }\r\n },\r\n campaigns: {\r\n bundles: {\r\n text: 'Buy {{quantity}} save {{discount}}',\r\n prefix: '{{individual_price}} each'\r\n },\r\n add_to_unlock: {\r\n title: {\r\n text: 'Frequently Bought Together'\r\n },\r\n\r\n show_product_details: {\r\n text: 'Show Details'\r\n },\r\n upsell_add_button: {\r\n text: 'Add To Cart'\r\n },\r\n upsell_confirm_button: {\r\n text: 'Confirm'\r\n },\r\n discount: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> Add <b>{{amount_left}}</b> to unlock <b>{{reward}}</b> off<p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> You've unlocked <b>{{reward}}</b> off<p>\"\r\n },\r\n free_shipping: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> Add <b>{{amount_left}}</b> to get <b>free shipping</b><p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> You've unlocked <b>Free shipping!</b><p>\"\r\n },\r\n separator: {\r\n text: 'OR'\r\n },\r\n gift: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> Add <b>{{amount_left}}</b> to get a <b>Free Gift</b><p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> You've unlocked a <b>Free Gift</b><p>\",\r\n compare_at_price: {\r\n text: '{{compare_at_price}}'\r\n },\r\n widget: {\r\n before: {\r\n header: '<b>Add {{amount_left}} to unlock Free Gift ðŸŽ</b>',\r\n product_name: 'Today only offer',\r\n offer_highlight: {\r\n text: 'Free'\r\n }\r\n // variant_selector_text: {\r\n // \ttext: \"Add Gift\"\r\n // },\r\n },\r\n selecting: {\r\n header: '<b>Select 1 Free Gift</b>',\r\n product_name: '{{product_name}}',\r\n offer_highlight: {\r\n text: 'Free'\r\n },\r\n variant_selector_text: {\r\n text: 'Add Gift'\r\n }\r\n },\r\n after: {\r\n header: '<b>You unlocked a Free Gift! 🎉</b>',\r\n product_name: '<p>Only valid today! â°</p><p>{{product_name}}</p>',\r\n offer_highlight: {\r\n text: 'Free'\r\n },\r\n variant_change_text: {\r\n text: 'Change gift'\r\n }\r\n }\r\n },\r\n inventory_quantity: {\r\n text: 'Only {{inventory_quantity}} left'\r\n }\r\n }\r\n },\r\n one_check_up_sell: {\r\n text: '<p>🔥 Add {{title}} For {{price}}</p>'\r\n }\r\n }\r\n};\r\n","export default {\r\n rtl: false,\r\n header: {\r\n title: 'votre panier'\r\n },\r\n empty_cart: '',\r\n shipping_option: 'livraison standard',\r\n product: {\r\n sold_out: 'épuisé'\r\n },\r\n product_details: {\r\n atcButton: { text: 'ajouter au panier' },\r\n readMore: { text: 'voir plus' }\r\n },\r\n modules: {\r\n checkout_button: {\r\n button_text: { text: 'check-out / {{ subtotal }}' },\r\n button_text_loading: { text: 'générer une offre...' },\r\n use_coupon_code: { text: 'code de coupon' },\r\n enter_coupon_code: { text: 'entrez le coupon' },\r\n apply_coupon_code: { text: 'appliquer' },\r\n edit_coupon_code: { text: 'modifier' },\r\n close_coupon_code: { text: 'fermer' },\r\n subtotal: { text: 'total' },\r\n savings: { text: 'remise' },\r\n coupon_alert_text: { text: 'Le code remplace les autres offres' }\r\n },\r\n random_text: {\r\n text: '<p class=\"ql-align-center\">100% NO-RISK MONEY BACK GUARANTEE</p>'\r\n },\r\n order_note: {\r\n text: '<p> <strong>Ajoutez une note</strong></p>'\r\n }\r\n },\r\n campaigns: {\r\n bundles: {\r\n text: 'Achetez {{quantity}} économisez {{discount}}',\r\n prefix: '{{individual_price}} chacun'\r\n },\r\n add_to_unlock: {\r\n title: {\r\n text: 'fréquemment achetés ensemble'\r\n },\r\n\r\n show_product_details: {\r\n text: 'afficher les détails'\r\n },\r\n upsell_add_button: {\r\n text: 'ajouter au panier'\r\n },\r\n upsell_confirm_button: {\r\n text: 'confirmer'\r\n },\r\n discount: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> ajoutez <b>{{amount_left}}</b> pour débloquer <b>{{award}}</b> de réduction<p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> vous avez débloqué <b>{{reward}}</b><p>\"\r\n },\r\n free_shipping: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> ajoutez <b>{{amount_left}}</b> pour bénéficier de <b>la livraison gratuite</b><p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> La livraison est <b>GRATUITE</b><p>\"\r\n },\r\n separator: {\r\n text: 'OU'\r\n },\r\n gift: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> Add <b>{{amount_left}}</b> to get a <b>Free Gift</b><p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> You've unlocked a <b>Free Gift</b><p>\",\r\n compare_at_price: {\r\n text: '{{compare_at_price}}'\r\n },\r\n widget: {\r\n before: {\r\n header: 'Spend {{goal}} Get A Free Gift ðŸŽ',\r\n product_name: 'Free gift: {{product_name}}',\r\n offer_highlight: {\r\n text: 'Free'\r\n }\r\n },\r\n after: {\r\n header: 'Hurry! This offer is only valid today! â°',\r\n product_name:\r\n '<p><b>You unlocked this! 🎉</b></p><p>Free gift: {{product_name}}</p>',\r\n offer_highlight: {\r\n text: 'Free'\r\n }\r\n }\r\n }\r\n }\r\n },\r\n one_check_up_sell: {\r\n text: '<p>🔥 ajouter {{title}} pour {{price}}</p>'\r\n }\r\n }\r\n};\r\n","export default {\r\n rtl: true,\r\n header: {\r\n title: 'Øقيبة التسوق'\r\n },\r\n empty_cart: '',\r\n shipping_option: 'Ø´ØÙ† عادي',\r\n product: {\r\n sold_out: 'غير متوÙر'\r\n },\r\n product_details: {\r\n atcButton: { text: 'اض٠الى Øقيبة التسوق' },\r\n readMore: { text: 'اظهر المزيد' }\r\n },\r\n modules: {\r\n checkout_button: {\r\n button_text: { text: 'اتمام عملية الشراء / {{ subtotal }}' },\r\n button_text_loading: { text: 'اتمام عملية الشراء' },\r\n use_coupon_code: { text: 'كوبون خصم' },\r\n enter_coupon_code: { text: 'ادخل الكود ان كان لديك كوبون خصم' },\r\n apply_coupon_code: { text: 'استخدام' },\r\n edit_coupon_code: { text: 'تعديل' },\r\n close_coupon_code: { text: 'اغلاق' },\r\n subtotal: { text: 'المجموع' },\r\n savings: { text: 'التوÙير' },\r\n coupon_alert_text: { text: 'كود الخصم يلغي بقية العروض' }\r\n },\r\n random_text: {\r\n text: '<p class=\"ql-align-center\">100% NO-RISK MONEY BACK GUARANTEE</p>'\r\n },\r\n order_note: {\r\n text: '<p> <strong>Add a note to your order</strong></p>'\r\n }\r\n },\r\n campaigns: {\r\n bundles: {\r\n text: 'إشتري {{quantity}} Ùˆ ÙˆÙر {{discount}}',\r\n prefix: '{{individual_price}} للوØدة'\r\n },\r\n add_to_unlock: {\r\n title: {\r\n text: 'منتجات ممكن أن تعجبك'\r\n },\r\n\r\n show_product_details: {\r\n text: 'أظهر المزيد'\r\n },\r\n upsell_add_button: {\r\n text: 'أض٠إلى Øقيبة التسوق'\r\n },\r\n upsell_confirm_button: {\r\n text: 'تأكيد'\r\n },\r\n discount: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> أظ٠<b>{{amount_left}}</b> للØصول على تخÙيض <b>{{award}}</b><p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> لقد Øصلت على تخÙيض <b>{{reward}}</b><p>\"\r\n },\r\n free_shipping: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> أظ٠<b>{{amount_left}}</b> للØصول على <b>Ø´ØÙ† مجاني</b><p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> لقد Øصلت على <b>Ø´ØÙ† مجاني</b><p>\"\r\n },\r\n separator: {\r\n text: 'أو'\r\n },\r\n gift: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> Add <b>{{amount_left}}</b> to get a <b>Free Gift</b><p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> You've unlocked a <b>Free Gift</b><p>\",\r\n compare_at_price: {\r\n text: '{{compare_at_price}}'\r\n },\r\n widget: {\r\n before: {\r\n header: 'Spend {{goal}} Get A Free Gift ðŸŽ',\r\n product_name: 'Free gift: {{product_name}}',\r\n offer_highlight: {\r\n text: 'Free'\r\n }\r\n },\r\n after: {\r\n header: 'Hurry! This offer is only valid today! â°',\r\n product_name:\r\n '<p><b>You unlocked this! 🎉</b></p><p>Free gift: {{product_name}}</p>',\r\n offer_highlight: {\r\n text: 'Free'\r\n }\r\n }\r\n }\r\n }\r\n },\r\n one_check_up_sell: {\r\n text: '<p>🔥 أظ٠{{title}} مقابل {{price}}</p>'\r\n }\r\n }\r\n};\r\n","export default {\r\n rtl: true,\r\n header: {\r\n title: 'Dein Warenkorb'\r\n },\r\n empty_cart: '',\r\n shipping_option: 'Kostenloser Versand',\r\n product: {\r\n sold_out: 'Ausverkauft'\r\n },\r\n product_details: {\r\n atcButton: { text: 'In den Warenkorb' },\r\n readMore: { text: 'Mehr lesen' }\r\n },\r\n modules: {\r\n checkout_button: {\r\n button_text: { text: 'Zur Kasse / {{ subtotal }}' },\r\n button_text_loading: { text: 'Neu generieren' },\r\n use_coupon_code: { text: 'Rabattcode' },\r\n enter_coupon_code: { text: 'Rabattcode eingeben' },\r\n apply_coupon_code: { text: 'Anwenden' },\r\n edit_coupon_code: { text: 'Ändern' },\r\n close_coupon_code: { text: 'Schließen' },\r\n subtotal: { text: 'Zwischensumme' },\r\n savings: { text: 'Du sparst' },\r\n coupon_alert_text: { text: 'Rabattcode nicht anwendbar' }\r\n },\r\n random_text: {\r\n text: '<p class=\"ql-align-center\">100% NO-RISK MONEY BACK GUARANTEE</p>'\r\n },\r\n order_note: {\r\n text: '<p> <strong>Add a note to your order</strong></p>'\r\n }\r\n },\r\n campaigns: {\r\n bundles: {\r\n text: 'Kaufe {{quantity}} Artikel,spare {{discount}}',\r\n prefix: '{{individual_price}} pro Set'\r\n },\r\n add_to_unlock: {\r\n title: {\r\n text: 'Wird oft zusammen gekauft'\r\n },\r\n\r\n show_product_details: {\r\n text: 'Zur Produktseite'\r\n },\r\n upsell_add_button: {\r\n text: 'Hinzufügen'\r\n },\r\n upsell_confirm_button: {\r\n text: 'Bestätigen'\r\n },\r\n discount: {\r\n before:\r\n '<p class=\"ql-align-center\">Füge Produkte im Wert von <strong>{{amount_left}}</strong> hinzu, um zusätzlich <strong>{{reward}}</strong> zu sparen</p>',\r\n after:\r\n '<p class=\"ql-align-center\">Du sparst zusätzlich <strong>{{reward}}</strong> auf deine Bestellung</p>'\r\n },\r\n free_shipping: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> Bitte Fügen Sie <b>{{amount_left}}</b> hinzu, um <b>kostenlosen Versand</b> zu erhalten<p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> Sie haben den <b>Kostenlosen Versand</b> freigeschaltet <p>\"\r\n },\r\n separator: {\r\n text: 'Wie wäre es mit'\r\n },\r\n gift: {\r\n before:\r\n \"<p class='ql-align-center'><img src='https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif'> Add <b>{{amount_left}}</b> to get a <b>Free Gift</b><p>\",\r\n after:\r\n \"<p class='ql-align-center'><img src='https://media.giphy.com/media/1wX5TJZPqVw3HhyDYn/giphy.gif'> You've unlocked a <b>Free Gift</b><p>\",\r\n compare_at_price: {\r\n text: '{{compare_at_price}}'\r\n },\r\n widget: {\r\n before: {\r\n header: 'Spend {{goal}} Get A Free Gift ðŸŽ',\r\n product_name: 'Free gift: {{product_name}}',\r\n offer_highlight: {\r\n text: 'Free'\r\n }\r\n },\r\n after: {\r\n header: 'Hurry! This offer is only valid today! â°',\r\n product_name:\r\n '<p><b>You unlocked this! 🎉</b></p><p>Free gift: {{product_name}}</p>',\r\n offer_highlight: {\r\n text: 'Free'\r\n }\r\n }\r\n }\r\n }\r\n },\r\n one_check_up_sell: {\r\n text: '<p>🔥 Add {{title}} For {{price}}</p>'\r\n }\r\n }\r\n};\r\n\r\n// 6f74adbe-fd22-4934-b17b-39020f42349f\r\n","import uuid from \"uuid/v1\";\r\nimport PriorityProcessingImage from \"./PriorityProcessings.base6\";\r\nimport Languages from \"./translations\";\r\nimport { getIn } from \"immutable\";\r\n// import compareVersions from 'compare-versions';\r\n\r\nexport const BREAK_POINTS = {\r\n kill_draft: (shopContext) => {\r\n return shopContext.state.settings.multiCurrencyMode;\r\n // const installedAt = new Date(shopContext.state.installedAt).getTime();\r\n // const breakPoint = new Date('Sun Apr 18 2021 15:00:00 GMT+0100').getTime();\r\n // return installedAt > breakPoint;\r\n },\r\n};\r\n\r\nexport const CAMPAIGN_TARGETS = [\r\n {\r\n value: \"all_products\",\r\n label: \"All Products\",\r\n disabled: ({ state }, shopContext) => {\r\n return BREAK_POINTS[\"kill_draft\"](shopContext)\r\n ? state.settings.type === \"bundles\"\r\n : false;\r\n },\r\n },\r\n { value: \"specific_products\", label: \"Specific Products\" },\r\n { value: \"specific_collections\", label: \"Specific Collections\" },\r\n];\r\nexport const ADD_TO_UNLOCK_FREE_SHIPPING_HANDLER = [\r\n {\r\n value: false,\r\n label: \"MonsterUpsells\",\r\n info: \"Shopify will inject a unique Free Shipping coupon code at checkout\",\r\n },\r\n {\r\n value: true,\r\n label: \"Shopify Admin\",\r\n info: \"You need to setup Free Shipping threshold in Shopify Admin\",\r\n link: {\r\n href: \"https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/setting-up-shipping-rates?fbclid=IwAR3OtBxohPJS0X1kzl1sOLfIqyCHkJkiLGiJPwmeAlkK3MAfZN6VdtmQw2s#create-free-shipping-rates\",\r\n text: \"Learn More\",\r\n },\r\n },\r\n];\r\nexport const CAMPAIGN_TYPES = {\r\n bundles: \"buy more save more\",\r\n add_to_unlock: \"Add to unlock + Frequently bought Together\",\r\n one_check_up_sell: \"one tick upsell\",\r\n};\r\n\r\nexport const ONE_CHECK_UP_SELL_PRODUCT_TYPE_OPTIONS = [\r\n { value: \"hidden\", label: \"Virtual Product\" },\r\n { value: \"existing\", label: \"Existing Product\" },\r\n];\r\n\r\nexport const GOOGLE_FONTS = [\r\n { value: \"Raleway\", label: \"Raleway\" },\r\n { value: \"Dosis\", label: \"Dosis\" },\r\n];\r\n\r\nexport const RESOURCE_PICKER_DEFAULT_REDUCERS = {\r\n Product: ({ id, title, variants, images, handle }) => ({\r\n id,\r\n title,\r\n handle,\r\n image: images.length ? images[0].originalSrc : null,\r\n price: variants[0].price,\r\n }),\r\n Collection: ({ id, title, image, handle }) => ({\r\n id,\r\n title,\r\n handle,\r\n image: image && image.originalSrc ? image.originalSrc : null,\r\n }),\r\n};\r\n\r\nexport const ADD_TO_UNLOCK_PRODUCTS_PICKER_REDUCER = ({\r\n id,\r\n title,\r\n variants,\r\n options,\r\n images,\r\n handle,\r\n}) => ({\r\n id,\r\n title,\r\n handle,\r\n image: images.length ? images[0].originalSrc : null,\r\n variants: variants.map(ADD_TO_UNLOCK_PRODUCTS_VARIANTS_MAP),\r\n options,\r\n});\r\n\r\nexport const ONE_CHECK_UP_SELL_PRODUCT_REDUCER = ({\r\n id,\r\n title,\r\n variants,\r\n options,\r\n images,\r\n image,\r\n handle,\r\n body_html,\r\n}) => ({\r\n id: id.toString(),\r\n title: title.toString(),\r\n handle,\r\n image: image\r\n ? image.originalSrc\r\n : images.length\r\n ? images[0].src || images[0].originalSrc\r\n : \"\",\r\n variant_id: variants[0].id.toString(),\r\n options,\r\n variants: variants.map(ADD_TO_UNLOCK_PRODUCTS_VARIANTS_MAP),\r\n});\r\n\r\nexport const GIFT_WITH_PURCHASE_PRODUCT_REDUCER = (product) => {\r\n const { id, title, variants, options, images, image, handle, body_html } =\r\n product;\r\n const variant = variants[0];\r\n if (!variant) throw new Error(\"variant not found\");\r\n const price = Number(variant.price) * 100;\r\n const compareAtPrice = variant.compareAtPrice\r\n ? Number(variant.compareAtPrice) * 100\r\n : price;\r\n const productImage = image\r\n ? image.originalSrc\r\n : images.length\r\n ? images[0].src || images[0].originalSrc\r\n : \"\";\r\n return {\r\n id: id.toString(),\r\n title: title.toString(),\r\n handle,\r\n image: image\r\n ? image.originalSrc\r\n : images.length\r\n ? images[0].src || images[0].originalSrc\r\n : \"\",\r\n variant_id: variants[0].id.toString(),\r\n variants: variants.map(ADD_TO_UNLOCK_PRODUCTS_VARIANTS_MAP),\r\n options,\r\n variant_price: compareAtPrice,\r\n };\r\n};\r\n\r\nconst ADD_TO_UNLOCK_PRODUCTS_VARIANTS_MAP = ({\r\n id,\r\n title,\r\n price,\r\n image,\r\n productImage = null,\r\n compareAtPrice,\r\n}) => ({\r\n id: id.toString(),\r\n title,\r\n price,\r\n compare_at_price: compareAtPrice ? Number(compareAtPrice) * 100 : undefined,\r\n image: image ? image.originalSrc : productImage,\r\n});\r\n\r\nexport const DISCOUNT_TYPES = (currency = \"$ \") => [\r\n { label: \"% \", value: \"percentage\" },\r\n { label: `${currency} `, value: \"fixed_amount\" },\r\n];\r\n\r\nexport const GET_GOAL_TYPES = (currency = \"$ \") => {\r\n return [\r\n { label: \"% \", value: \"relative\" },\r\n { label: `${currency} `, value: \"fixed\" },\r\n ];\r\n};\r\n\r\nexport const ADD_TO_UNLOCK_REWARD_OPTIONS = (goals, index) => {\r\n const otherGoals = goals\r\n .filter((_, i) => i !== index)\r\n .map(({ reward_type }) => reward_type);\r\n return [\r\n {\r\n value: \"discount\",\r\n label: \"Discount\",\r\n info: \"Unlock discounts that will be auto aded to the checkout using discount codes\",\r\n },\r\n {\r\n value: \"free_shipping\",\r\n label: \"Free Shipping\",\r\n info: \"You need to setup free shipping options in Shopify Admin\",\r\n disabled: otherGoals.includes(\"free_shipping\"),\r\n },\r\n {\r\n value: \"gift\",\r\n label: \"Free Gift\",\r\n info: \"Select a product as a free gift when cart goals are met\",\r\n disabled: !goals[index].gift,\r\n // beta: true\r\n },\r\n {\r\n value: \"manual\",\r\n label: \"Manual / Store Credit (CashBack)\",\r\n infoHtml: true,\r\n info: \"Create a goal that you will reward yourself.<br/><b>Example:</b> Free products, Gift wrapping, Free express shipping\",\r\n },\r\n ];\r\n};\r\n\r\nexport const CART_SLIDER_SETTINGS = {\r\n dots: false,\r\n arrows: false,\r\n speed: 500,\r\n slidesToShow: 1,\r\n slidesToScroll: 1,\r\n adaptiveHeight: false,\r\n draggable: false,\r\n infinite: false,\r\n easing: \"easeOut\",\r\n};\r\n\r\nconst default_background = { r: 255, g: 255, b: 255, a: 1 };\r\nconst default_primary = { a: 1, b: 248, g: 117, r: 90 };\r\nconst default_secondary = { a: 1, b: 255, g: 222, r: 215 };\r\nconst default_font_color = { r: 22, g: 37, b: 67, a: 1 };\r\nconst default_danger = { r: 239, g: 68, b: 68, a: 1 };\r\n\r\nexport const NEW_CAMPAIGN_INITIAL_STATE = (\r\n {\r\n checkout_button = {\r\n background: default_primary,\r\n hoverBackground: default_secondary,\r\n },\r\n primary = default_primary,\r\n secondary = default_secondary,\r\n font_color = default_font_color,\r\n background = default_background,\r\n danger = default_danger,\r\n type = \"\",\r\n multiCurrencyMode,\r\n } = {},\r\n language,\r\n currency\r\n) => {\r\n language = Object.keys(Languages).includes(language) ? language : \"english\";\r\n const __ = translate(language);\r\n return {\r\n name: \"\",\r\n settings: {\r\n type,\r\n applied_discount_title: \"Special Discount\",\r\n bundles: {\r\n text: __(\"campaigns.bundles.text\"),\r\n prefix: __(\"campaigns.bundles.prefix\"),\r\n font_size: 0.8,\r\n background: secondary,\r\n color: font_color,\r\n activeBackground: primary,\r\n activeColor: background,\r\n list: [\r\n { id: uuid(), type: \"percentage\", quantity: 2, reward: 10 },\r\n { id: uuid(), type: \"percentage\", quantity: 3, reward: 15 },\r\n ],\r\n style: \"vertical\",\r\n labelColor: primary,\r\n badge: {\r\n text: { a: 1, r: 0, g: 45, b: 255 },\r\n background: { a: 1, r: 240, g: 242, b: 255 },\r\n border: { a: 1, r: 161, g: 178, b: 255 },\r\n },\r\n variantsPicker: {\r\n active: true,\r\n label: \"Select product #{{number}}\",\r\n confirm: \"Confirm\",\r\n textColor: default_font_color,\r\n dropdownTextColor: default_font_color,\r\n dropdownBackground: secondary,\r\n confirmTextColor: background,\r\n confirmBackground: primary,\r\n },\r\n },\r\n add_to_unlock: {\r\n isActive: true,\r\n show_all_locked_goals: false,\r\n title: {\r\n text: __(\"campaigns.add_to_unlock.title.text\"),\r\n font_size: 1,\r\n color: font_color,\r\n },\r\n background: secondary,\r\n borderColor: secondary,\r\n show_product_details: {\r\n text: __(\"campaigns.add_to_unlock.show_product_details.text\"),\r\n font_size: 0.7,\r\n color: primary,\r\n },\r\n product_title: {\r\n text: \"{{product_title}}\",\r\n font_size: 1,\r\n color: font_color,\r\n },\r\n product_price: {\r\n text: \"{{original_price}}{{product_price}}\",\r\n font_size: 0.9,\r\n color: font_color,\r\n },\r\n upsell_add_button: {\r\n text: __(\"campaigns.add_to_unlock.upsell_add_button.text\"),\r\n color: primary,\r\n font_size: 0.8,\r\n },\r\n upsell_confirm_button: {\r\n text: __(\"campaigns.add_to_unlock.upsell_confirm_button.text\"),\r\n font_size: 0.8,\r\n },\r\n show_suggestions: true,\r\n recommendation_type: \"shopify_recommendation\",\r\n products_length: 2,\r\n exclude_tags: [],\r\n products: [],\r\n separator: {\r\n active: false,\r\n text: __(\"campaigns.add_to_unlock.separator.text\"),\r\n },\r\n multi_goal_type: \"amount\",\r\n show_badges: false,\r\n goals: [\r\n {\r\n badge: {\r\n show_text: true,\r\n text: { text: \"{{goal}}\", font_size: 1, color: default_primary },\r\n type: 2,\r\n image: null,\r\n },\r\n specific_goals: [{ currency, goal: 40, main: true }],\r\n reward_type: \"free_shipping\",\r\n goal_type: \"fixed\",\r\n goal_text: {\r\n text: \"Free Shipping\",\r\n font_size: 0.7,\r\n color: { r: 44, g: 50, b: 59, a: 1 },\r\n },\r\n show_goal_text: false,\r\n confetti: false,\r\n confetti_length: 400,\r\n discount: {\r\n type: \"percentage\",\r\n before: __(\"campaigns.add_to_unlock.discount.before\"),\r\n after: __(\"campaigns.add_to_unlock.discount.after\"),\r\n reward: 10,\r\n },\r\n free_shipping: {\r\n before: __(\"campaigns.add_to_unlock.free_shipping.before\"),\r\n after: __(\"campaigns.add_to_unlock.free_shipping.after\"),\r\n manual: true,\r\n },\r\n manual: {\r\n before: __(\"campaigns.add_to_unlock.free_shipping.before\"),\r\n after: __(\"campaigns.add_to_unlock.free_shipping.after\"),\r\n },\r\n gift: {\r\n before: __(\"campaigns.add_to_unlock.gift.before\"),\r\n after: __(\"campaigns.add_to_unlock.gift.after\"),\r\n products: [],\r\n previous_gift: \"keep\",\r\n multi_gift_select: \"select\",\r\n widget: {\r\n active: true,\r\n compare_at_price_active: true,\r\n compare_at_price: {\r\n color: { r: 141, g: 141, b: 141, a: 1 },\r\n font_size: 1,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.compare_at_price.text\"\r\n ),\r\n },\r\n before: {\r\n header: __(\r\n \"campaigns.add_to_unlock.gift.widget.before.header\"\r\n ),\r\n product_name: __(\r\n \"campaigns.add_to_unlock.gift.widget.before.product_name\"\r\n ),\r\n offer_highlight: {\r\n color: { r: 95, g: 95, b: 95, a: 1 },\r\n font_size: 1.2,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.before.offer_highlight.text\"\r\n ),\r\n }, // color: background, // goal: 40, // or custom_recommendation shopify_recommendation // quantity // product: {}, // free_shipping,discount, manual, gift // variant_selector_text: {\r\n // font_size: 1,\r\n // text: __(\"campaigns.add_to_unlock.gift.widget.before.variant_selector_text.text\")\r\n // },\r\n background: { r: 242, g: 245, b: 255, a: 1 },\r\n outline: { r: 196, g: 196, b: 196, a: 1 },\r\n multi_gift_image:\r\n \"https://d1s1zm0vzu692k.cloudfront.net/static/images/default_gifts.png\",\r\n },\r\n selecting: {\r\n header: __(\r\n \"campaigns.add_to_unlock.gift.widget.selecting.header\"\r\n ),\r\n product_name: __(\r\n \"campaigns.add_to_unlock.gift.widget.selecting.product_name\"\r\n ),\r\n offer_highlight: {\r\n color: { r: 95, g: 95, b: 95, a: 1 },\r\n font_size: 1.2,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.selecting.offer_highlight.text\"\r\n ),\r\n },\r\n variant_selector_text: {\r\n color: background,\r\n font_size: 1,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.selecting.variant_selector_text.text\"\r\n ),\r\n },\r\n background: { r: 242, g: 245, b: 255, a: 1 },\r\n outline: { r: 196, g: 196, b: 196, a: 1 },\r\n variant_button_background: primary,\r\n },\r\n after: {\r\n header: __(\r\n \"campaigns.add_to_unlock.gift.widget.after.header\"\r\n ),\r\n product_name: __(\r\n \"campaigns.add_to_unlock.gift.widget.after.product_name\"\r\n ),\r\n offer_highlight: {\r\n color: { r: 79, g: 181, b: 110, a: 1 },\r\n font_size: 1.2,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.after.offer_highlight.text\"\r\n ),\r\n },\r\n background: { r: 248, g: 251, b: 246, a: 1 },\r\n outline: { r: 203, g: 235, b: 206, a: 1 },\r\n variant_change_text: {\r\n color: { r: 134, g: 134, b: 134, a: 1 },\r\n font_size: 1,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.after.variant_change_text.text\"\r\n ),\r\n },\r\n },\r\n },\r\n },\r\n },\r\n ],\r\n separator: {\r\n active: false,\r\n text: __(\"campaigns.add_to_unlock.separator.text\"),\r\n },\r\n progress_primary: primary,\r\n progress_secondary: secondary,\r\n progress_complete: { a: 1, r: 87, g: 239, b: 197 },\r\n progress_background: { a: 1, r: 255, g: 255, b: 255 },\r\n product_details: {\r\n atcButton: {\r\n color: { a: 1, b: 255, g: 255, r: 255 },\r\n font_size: 1,\r\n text: __(\"product_details.atcButton.text\"),\r\n },\r\n atcButton_background: { a: 1, b: 248, g: 117, r: 90 },\r\n atcButton_hoverBackground: { a: 1, b: 206, g: 206, r: 206 },\r\n external: false,\r\n readMore: {\r\n color: { a: 1, b: 248, g: 117, r: 90 },\r\n font_size: 1,\r\n text: __(\"product_details.readMore.text\"),\r\n },\r\n truncate: true,\r\n truncate_length: 200,\r\n },\r\n fbt_below: true,\r\n fbt_position: \"above_checkout\",\r\n }, // inventory_quantity: { // variant_button_background: primary, // one_check_up_sell: default_one_check_upsell(language),\r\n // active: true,\r\n // text: __(\"campaigns.add_to_unlock.gift.inventory_quantity.text\")\r\n // }\r\n multi_one_check_upsell: {\r\n variant: \"square\",\r\n align: \"natural\",\r\n border: false,\r\n border_color: { r: 226, g: 232, b: 240, a: 1 },\r\n switch_on: primary,\r\n switch_off: secondary,\r\n highlight: primary,\r\n products: [default_one_check_upsell(language)],\r\n },\r\n modules: {\r\n order: [\"checkout_button\", \"random_text\", \"order_note\"],\r\n random_text: { text: __(\"modules.random_text.text\"), active: false },\r\n order_note: { text: __(\"modules.order_note.text\"), active: false },\r\n checkout_button: {\r\n checkout_as_link: false,\r\n show_subtotal: true,\r\n fix_checkout_container: true,\r\n active_continue_shopping_button: false,\r\n active_continue_shopping_underlined: true,\r\n continue_shopping_button: {\r\n text: \"Continue shopping\",\r\n font_size: 1,\r\n color: primary,\r\n },\r\n button_text: {\r\n text: __(\"modules.checkout_button.button_text.text\"),\r\n font_size: 1.3,\r\n color: background,\r\n },\r\n button_text_loading: {\r\n text: __(\"modules.checkout_button.button_text_loading.text\"),\r\n color: background,\r\n },\r\n background: checkout_button.background,\r\n hoverBackground: checkout_button.hoverBackground,\r\n coupon: {\r\n background: checkout_button.background,\r\n hoverBackground: checkout_button.hoverBackground,\r\n active_background: checkout_button.background,\r\n active_color: secondary,\r\n },\r\n coupon_alert_text: {\r\n text: __(\"modules.checkout_button.coupon_alert_text.text\"),\r\n font_size: 1,\r\n color: danger,\r\n },\r\n use_coupon_code: {\r\n text: __(\"modules.checkout_button.use_coupon_code.text\"),\r\n font_size: 0.9,\r\n color: { r: 160, g: 160, b: 160, a: 1 },\r\n },\r\n enter_coupon_code: {\r\n text: __(\"modules.checkout_button.enter_coupon_code.text\"),\r\n font_size: 0.9,\r\n color: secondary,\r\n },\r\n apply_coupon_code: {\r\n text: __(\"modules.checkout_button.apply_coupon_code.text\"),\r\n font_size: 1,\r\n color: background,\r\n },\r\n edit_coupon_code: {\r\n text: __(\"modules.checkout_button.edit_coupon_code.text\"),\r\n font_size: 0.9,\r\n },\r\n close_coupon_code: {\r\n text: __(\"modules.checkout_button.close_coupon_code.text\"),\r\n font_size: 0.9,\r\n },\r\n subtotal: {\r\n text: __(\"modules.checkout_button.subtotal.text\"),\r\n font_size: 1.3,\r\n color: font_color,\r\n },\r\n savings: {\r\n text: __(\"modules.checkout_button.savings.text\"),\r\n font_size: 1.3,\r\n color: checkout_button.background,\r\n },\r\n },\r\n },\r\n },\r\n target: {\r\n type: \"all_products\",\r\n selected: [],\r\n countries: {\r\n include_active: false,\r\n include: [\"worldwide\"],\r\n exclude_active: false,\r\n exclude: [],\r\n },\r\n },\r\n };\r\n};\r\n\r\nfunction translate(language) {\r\n return (path) => {\r\n path = path.split(\".\");\r\n return getIn(Languages[language], path) || getIn(Languages.english, path);\r\n };\r\n}\r\n\r\nexport const default_one_check_upsell = (language) => {\r\n const __ = translate(language);\r\n return {\r\n text: __(\"campaigns.one_check_up_sell.text\"),\r\n is_ticked_by_default: false,\r\n include_in_atu: true,\r\n product: {},\r\n product_type: \"existing\",\r\n truncate: true,\r\n truncate_length: 25,\r\n };\r\n};\r\n\r\nexport const SHOP_DEFAULT_SETTINGS = (language) => {\r\n language = Object.keys(Languages).includes(language) ? language : \"english\";\r\n const __ = translate(language);\r\n return {\r\n modules: NEW_CAMPAIGN_INITIAL_STATE({}, language).settings.modules,\r\n active: false,\r\n open_cart: true,\r\n multiCurrencyMode: true,\r\n rtl: __(\"rtl\"),\r\n curved: true,\r\n show_coupon: false,\r\n show_coupon_alert_text: true,\r\n is_checkout_condition_active: false,\r\n checkout_condition_color: default_primary,\r\n checkout_condition_text: \"I agree to <b>Terms & conditions</b>\",\r\n active_continue_shopping_button: true,\r\n active_continue_shopping_underlined: true,\r\n count_compare_at: true,\r\n continue_shopping_button: {\r\n text: \"Continue shopping\",\r\n font_size: 1,\r\n font_weight: 700,\r\n color: default_primary,\r\n },\r\n empty_cart:\r\n '<p class=\"ql-align-center\"><img src=\"https://cdn.shopify.com/s/files/1/0597/9367/0293/t/38/assets/download.png?v=1667818689\"></p>',\r\n font: {\r\n color: {\r\n a: 1,\r\n b: 67,\r\n g: 37,\r\n r: 22,\r\n },\r\n custom: false,\r\n family:\r\n \"Poppins:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic\",\r\n size: 14,\r\n },\r\n header: {\r\n background: {\r\n a: 1,\r\n b: 255,\r\n g: 255,\r\n r: 255,\r\n },\r\n title: {\r\n color: {\r\n a: 1,\r\n b: 0,\r\n g: 0,\r\n r: 0,\r\n },\r\n font_size: 1.1,\r\n text: __(\"header.title\"),\r\n },\r\n },\r\n product: {\r\n sold_out: __(\"product.sold_out\"),\r\n grow: false,\r\n image_size: 80,\r\n price: {\r\n color: {\r\n a: 1,\r\n b: 67,\r\n g: 37,\r\n r: 22,\r\n },\r\n font_size: 1.1,\r\n text: \"{{original_price}}{{product_price}}\",\r\n },\r\n title: {\r\n color: {\r\n a: 1,\r\n b: 67,\r\n g: 37,\r\n r: 22,\r\n },\r\n font_size: 1.1,\r\n text: \"{{product_title}}\",\r\n },\r\n },\r\n product_details: {\r\n atcButton: {\r\n color: {\r\n a: 1,\r\n b: 255,\r\n g: 255,\r\n r: 255,\r\n },\r\n font_size: 1,\r\n text: __(\"product_details.atcButton.text\"),\r\n },\r\n atcButton_background: {\r\n a: 1,\r\n b: 178,\r\n g: 84,\r\n r: 64,\r\n },\r\n atcButton_hoverBackground: {\r\n a: 1,\r\n b: 206,\r\n g: 206,\r\n r: 206,\r\n },\r\n external: false,\r\n readMore: {\r\n color: {\r\n a: 1,\r\n b: 178,\r\n g: 84,\r\n r: 64,\r\n },\r\n font_size: 1,\r\n text: __(\"product_details.readMore.text\"),\r\n },\r\n truncate: true,\r\n truncate_length: 200,\r\n },\r\n theme: {\r\n background: {\r\n a: 1,\r\n b: 255,\r\n g: 255,\r\n r: 255,\r\n },\r\n primary: {\r\n a: 1,\r\n b: 248,\r\n g: 117,\r\n r: 90,\r\n },\r\n secondary: {\r\n a: 1,\r\n b: 255,\r\n g: 222,\r\n r: 215,\r\n },\r\n textColor: {\r\n a: 0.8,\r\n b: 67,\r\n g: 37,\r\n r: 22,\r\n },\r\n buttonColor: {\r\n a: 1,\r\n b: 255,\r\n g: 255,\r\n r: 255,\r\n },\r\n },\r\n default_language: language,\r\n\r\n cod_settings: {\r\n error_message: \"This field is required\",\r\n is_active: false,\r\n is_form_in_cart: false,\r\n checkout_mode: \"cod_and_checkout\", // cod_and_checkout cod_only\r\n checkout_button: {\r\n text: \"PAY ON DELIVERY\",\r\n font_size: 1.7,\r\n color: default_background,\r\n background: default_primary,\r\n hoverBackground: default_secondary,\r\n },\r\n confirm_button: {\r\n text: \"Confirm Order\",\r\n font_size: 1.7,\r\n color: default_background,\r\n background: default_primary,\r\n hoverBackground: default_secondary,\r\n },\r\n loading_button: {\r\n text: \"Loading ...\",\r\n font_size: 1.7,\r\n color: default_background,\r\n background: default_primary,\r\n hoverBackground: default_secondary,\r\n },\r\n form: [\r\n {\r\n label: \"First name\", // editable\r\n isRequired: true, // obligatry for customer\r\n type: \"name\",\r\n placeholder: \"Please enter your full name\",\r\n },\r\n {\r\n label: \"Email\",\r\n isRequired: false,\r\n type: \"email\",\r\n placeholder: \"Please enter your email\",\r\n },\r\n // {\r\n // \tlabel: \"Zip Code\",\r\n // \tisRequired: true\r\n // },\r\n {\r\n label: \"Phone number\",\r\n isRequired: true,\r\n type: \"phone\",\r\n placeholder: \"Please enter your phone number\",\r\n },\r\n {\r\n label: \"Address\",\r\n isRequired: true,\r\n type: \"string\",\r\n placeholder: \"Please enter your address\",\r\n },\r\n {\r\n label: \"Note to seller\",\r\n isRequired: false,\r\n type: \"textarea\",\r\n placeholder: \"Please enter your a custome note\",\r\n },\r\n ],\r\n },\r\n sticky_cart: {\r\n isActive: false,\r\n btn_style: \"square\",\r\n btn_text: \"Add To Cart\",\r\n btn_text_variant_active: \"CONFIRM\",\r\n btn_text_unavailable: \"UNAVAILABLE\",\r\n btn_color: default_primary,\r\n txt_color: {\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n a: 1,\r\n },\r\n background_color: {\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n a: 1,\r\n },\r\n\r\n atc_action: \"checkout\",\r\n\r\n desktop_active: true,\r\n desktop_show_variants: true,\r\n desktop_show_quantity: true,\r\n desktop_show_product_name: true,\r\n desktop_product_preview: true,\r\n desktop_show_compared_price: true,\r\n\r\n desktop_visibility: \"dynamic\",\r\n desktop_location: \"bottom\",\r\n\r\n desktop_quantity: {\r\n text: \"Quantity\",\r\n // font_size: 1.7,\r\n },\r\n mobile_quantity: {\r\n text: \"Quantity\",\r\n // font_size: 1.7,\r\n },\r\n cart_name: {\r\n text: \"Add To Cart\",\r\n // font_size: 1.7,\r\n },\r\n mobile_active: true,\r\n mobile_show_variants: true,\r\n mobile_show_quantity: true,\r\n mobile_show_compared_price: true,\r\n\r\n mobile_show_title: true,\r\n mobile_show_price: true,\r\n\r\n mobile_visibility: \"dynamic\",\r\n mobile_location: \"bottom\",\r\n mobile_atc_height: {\r\n text: 50,\r\n },\r\n\r\n show_btn_atc_txt_variant_active: false,\r\n btn_atc_txt_variant_active: \"Choose size\",\r\n },\r\n auto_discount: {\r\n text: {\r\n color: {\r\n a: 1,\r\n r: 0,\r\n g: 45,\r\n b: 255,\r\n },\r\n font_weight: 400,\r\n font_size: 0.9,\r\n text: \"{{title}}\",\r\n },\r\n background: {\r\n a: 1,\r\n r: 240,\r\n g: 242,\r\n b: 255,\r\n },\r\n border: {\r\n a: 1,\r\n r: 161,\r\n g: 178,\r\n b: 255,\r\n },\r\n },\r\n subscription: {\r\n isActive: false,\r\n text: {\r\n color: {\r\n a: 1,\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n },\r\n font_weight: 700,\r\n font_size: 0.9,\r\n text: \"Upgrade to {{plans_group_name}}\",\r\n },\r\n background: {\r\n a: 1,\r\n r: 26,\r\n g: 68,\r\n b: 156,\r\n },\r\n border: {\r\n a: 1,\r\n r: 26,\r\n g: 68,\r\n b: 156,\r\n },\r\n upgradingText: {\r\n color: {\r\n a: 1,\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n },\r\n font_weight: 700,\r\n font_size: 0.9,\r\n text: \"Upgrading...\",\r\n },\r\n downgradingText: {\r\n color: {\r\n a: 1,\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n },\r\n font_weight: 700,\r\n font_size: 0.9,\r\n text: \"Downgrading...\",\r\n },\r\n loadingBackground: {\r\n a: 1,\r\n r: 153,\r\n g: 153,\r\n b: 153,\r\n },\r\n loadingBorder: {\r\n a: 1,\r\n r: 153,\r\n g: 153,\r\n b: 153,\r\n },\r\n subscribedText: {\r\n color: {\r\n a: 1,\r\n r: 0,\r\n g: 0,\r\n b: 0,\r\n },\r\n font_weight: 500,\r\n font_size: 0.9,\r\n text: \"{{selling_plan_name}}\",\r\n },\r\n subscribedBackground: {\r\n a: 1,\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n },\r\n subscribedBorder: {\r\n a: 1,\r\n r: 153,\r\n g: 153,\r\n b: 153,\r\n },\r\n },\r\n scary: {\r\n isActive: false,\r\n text: {\r\n color: {\r\n a: 1,\r\n r: 0,\r\n g: 45,\r\n b: 255,\r\n },\r\n font_size: 0.7,\r\n text: \"🔥 Your cart is reserved for... {{timer}} minutes\",\r\n },\r\n style: \"rounded\",\r\n background: {\r\n a: 1,\r\n r: 240,\r\n g: 242,\r\n b: 255,\r\n },\r\n border: {\r\n a: 1,\r\n r: 161,\r\n g: 178,\r\n b: 255,\r\n },\r\n isDaysActive: false,\r\n isHoursActive: true,\r\n isMinutesActive: true,\r\n isSecondsActive: true,\r\n days: 0,\r\n hours: 0,\r\n minutes: 4,\r\n seconds: 49,\r\n endAction: \"hide\", // hide restart\r\n placement: \"bottom\", // bottom top\r\n textAlignement: \"left\", // left center right\r\n },\r\n badges: {\r\n isActive: false,\r\n position: \"bellow_checkout\", // BADGES_POSITIONS\r\n value:\r\n '<p class=\"ql-align-center\" style=\"color: #162543;font-size: 13px;\">Guaranteed Safe & Secure Checkout </p><p><img src=\"https://storage.crisp.chat/users/upload/operator/efc812c3c6152000/payment-methods-min_dp91kr.png\"></p>',\r\n },\r\n afterPay: {\r\n isActive: false,\r\n splits: 4,\r\n text: {\r\n color: {\r\n a: 1,\r\n r: 22,\r\n g: 37,\r\n b: 67,\r\n },\r\n font_size: 0.8,\r\n font_weight: 700,\r\n text: \"Or {{installments}} installments of {{split payment}} with\",\r\n },\r\n image:\r\n \"https://s3-us-west-2.amazonaws.com/apps.static.resources/afterpay_black.png\",\r\n isExternal: false,\r\n },\r\n announcement: {\r\n isActive: false,\r\n position: \"bellow_products\", //ANNOUNCEMENT_POSITIONS\r\n text: {\r\n color: {\r\n a: 1,\r\n r: 0,\r\n g: 102,\r\n b: 79,\r\n },\r\n font_size: 0.7,\r\n text: \"â° Order before your items are out of stock!\",\r\n },\r\n style: \"rounded\", // full\r\n background: {\r\n a: 0.22,\r\n r: 80,\r\n g: 277,\r\n b: 194,\r\n },\r\n border: {\r\n a: 1,\r\n r: 80,\r\n g: 277,\r\n b: 194,\r\n },\r\n textAlignement: \"center\", // left center right\r\n },\r\n };\r\n};\r\nexport const BADGE_PERCENT_ICON = {\r\n //this icon is missing on fontawesome package\r\n prefix: \"fas\",\r\n iconName: \"adjust\",\r\n icon: [\r\n 512,\r\n 512,\r\n [],\r\n \"f646\",\r\n \"M512 256c0-37.7-23.7-69.9-57.1-82.4 14.7-32.4 8.8-71.9-17.9-98.6-26.7-26.7-66.2-32.6-98.6-17.9C325.9 23.7 293.7 0 256 0s-69.9 23.7-82.4 57.1c-32.4-14.7-72-8.8-98.6 17.9-26.7 26.7-32.6 66.2-17.9 98.6C23.7 186.1 0 218.3 0 256s23.7 69.9 57.1 82.4c-14.7 32.4-8.8 72 17.9 98.6 26.6 26.6 66.1 32.7 98.6 17.9 12.5 33.3 44.7 57.1 82.4 57.1s69.9-23.7 82.4-57.1c32.6 14.8 72 8.7 98.6-17.9 26.7-26.7 32.6-66.2 17.9-98.6 33.4-12.5 57.1-44.7 57.1-82.4zm-320-96c17.67 0 32 14.33 32 32s-14.33 32-32 32-32-14.33-32-32 14.33-32 32-32zm12.28 181.65c-6.25 6.25-16.38 6.25-22.63 0l-11.31-11.31c-6.25-6.25-6.25-16.38 0-22.63l137.37-137.37c6.25-6.25 16.38-6.25 22.63 0l11.31 11.31c6.25 6.25 6.25 16.38 0 22.63L204.28 341.65zM320 352c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32z\",\r\n ],\r\n};\r\n\r\nconst parseProductId = (string) => {\r\n // example gid://shopify/ProductVariant/19566771404862\r\n const pattern = new RegExp(\"gid://shopify/Product/([0-9]+)$\");\r\n if (pattern.test(string)) return parseInt(string.match(pattern)[1]);\r\n return string;\r\n};\r\n\r\nexport const stateCards = [\r\n { title: \"CartsDisplayed\" },\r\n { title: \"SalesGenerated\", label: \"Cart Orders\" },\r\n { title: \"SalesAmount\", label: \"Cart Total Revenue\", currency: true },\r\n { title: \"AverageOrderSize\", currency: true },\r\n { title: \"CartConversionRate\", suf: \"%\" },\r\n { title: \"UpsellsGenerated\", label: \"Campaign Added Products\" },\r\n { title: \"UpsellsTotalAmount\", label: \"Campaign Revenue\", currency: true },\r\n { title: \"TotalROI\", suf: \"%\", clickable: false },\r\n];\r\n\r\nexport const chartOptions = (formatter) => ({\r\n fill: {\r\n type: \"solid\",\r\n color: \"#485aff\",\r\n opacity: 0.15,\r\n },\r\n width: \"50%\",\r\n stroke: {\r\n show: true,\r\n curve: \"smooth\",\r\n lineCap: \"butt\",\r\n colors: [\"#2F80ED\"],\r\n width: 4,\r\n dashArray: 0,\r\n },\r\n dropShadow: {\r\n enabled: true,\r\n top: 1,\r\n left: 1,\r\n blur: 2,\r\n color: \"#000\",\r\n opacity: 0.9,\r\n },\r\n xaxis: {\r\n type: \"datetime\",\r\n },\r\n yaxis: {\r\n type: \"numeric\",\r\n },\r\n dataLabels: {\r\n enabled: false,\r\n enabledOnSeries: undefined,\r\n formatter,\r\n },\r\n});\r\n\r\nexport const ENGINE_WARNING_ICON = {\r\n prefix: \"fas\",\r\n iconName: \"engine-warning\",\r\n icon: [\r\n 640,\r\n 448,\r\n [],\r\n \"f5f2\",\r\n \"M48 256c0-59.53 19.55-117.38 55.36-164.51 5.18-6.81 4.48-16.31-2.03-21.86l-12.2-10.41c-6.91-5.9-17.62-5.06-23.15 2.15C23.32 117.02 0 185.5 0 256c0 70.47 23.32 138.96 65.96 194.62 5.53 7.21 16.23 8.05 23.15 2.16l12.19-10.4c6.51-5.55 7.21-15.04 2.04-21.86C67.55 373.37 48 315.53 48 256zM320 32C196.3 32 96 132.3 96 256c0 123.76 100.3 224 224 224s224-100.24 224-224c0-123.7-100.3-224-224-224zm0 352c-17.67 0-32-14.33-32-32s14.33-32 32-32 32 14.33 32 32-14.33 32-32 32zm25.44-110.41c-.82 8.18-7.7 14.41-15.92 14.41h-19.04c-8.22 0-15.1-6.23-15.92-14.41l-12.8-128c-.94-9.42 6.45-17.59 15.92-17.59h44.64c9.47 0 16.86 8.17 15.92 17.59l-12.8 128zM572.73 59.71c-5.58-7.18-16.29-7.95-23.17-2l-12.15 10.51c-6.47 5.6-7.1 15.09-1.88 21.87C572.04 137.47 592 195.81 592 256c0 60.23-19.96 118.57-56.46 165.95-5.22 6.78-4.59 16.27 1.88 21.87l12.15 10.5c6.87 5.95 17.59 5.18 23.17-2C616.21 396.38 640 327.31 640 256c0-71.27-23.79-140.34-67.27-196.29z\",\r\n ],\r\n};\r\nexport const SACK_DOLLAR_ICON = {\r\n prefix: \"fas\",\r\n iconName: \"sack-dollar\",\r\n icon: [\r\n 512,\r\n 512,\r\n [],\r\n \"f81d\",\r\n \"M192 96h128l47.4-71.12A16 16 0 0 0 354.09 0H157.94a16 16 0 0 0-13.31 24.88zm128 32H192C-10.38 243.4.09 396.64.09 416c0 53 49.11 96 109.68 96h292.48c60.58 0 109.68-43 109.68-96 0-19 9.35-173.24-191.93-288zm-46.58 278v17.34a8.68 8.68 0 0 1-8.7 8.62h-17.41a8.69 8.69 0 0 1-8.71-8.62v-17.51a63.14 63.14 0 0 1-34.16-12.17 8.52 8.52 0 0 1-.67-13l12.84-12.06a8.93 8.93 0 0 1 11-.76 26.71 26.71 0 0 0 13.93 4h30.58c7.07 0 12.84-6.35 12.84-14.22 0-6.46-3.92-12.06-9.58-13.67l-49-14.54c-20.24-6-34.39-25.2-34.39-46.74 0-26.38 20.68-47.82 46.46-48.57v-17.48a8.69 8.69 0 0 1 8.75-8.62h17.41a8.68 8.68 0 0 1 8.7 8.62v17.55a63.15 63.15 0 0 1 34.17 12.17 8.54 8.54 0 0 1 1.58 12 8.72 8.72 0 0 1-.92 1l-12.73 12.2a8.91 8.91 0 0 1-11 .75 26.8 26.8 0 0 0-13.93-4h-30.57c-7.07 0-12.84 6.35-12.84 14.21 0 6.46 3.92 12.06 9.57 13.68l49 14.54c20.24 6 34.38 25.2 34.38 46.74-.14 26.4-20.92 47.94-46.6 48.54z\",\r\n ],\r\n};\r\n\r\nexport const COMMENT_DOLLAR = {\r\n prefix: \"fas\",\r\n iconName: \"comment-dollar\",\r\n icon: [\r\n 512,\r\n 512,\r\n [],\r\n \"f81d\",\r\n \"M256 32C114.62 32 0 125.12 0 240c0 49.56 21.41 95.01 57.02 130.74C44.46 421.05 2.7 465.97 2.2 466.5A7.995 7.995 0 0 0 8 480c66.26 0 115.99-31.75 140.6-51.38C181.29 440.93 217.59 448 256 448c141.38 0 256-93.12 256-208S397.38 32 256 32zm24 302.44V352c0 8.84-7.16 16-16 16h-16c-8.84 0-16-7.16-16-16v-17.73c-11.42-1.35-22.28-5.19-31.78-11.46-6.22-4.11-6.82-13.11-1.55-18.38l17.52-17.52c3.74-3.74 9.31-4.24 14.11-2.03 3.18 1.46 6.66 2.22 10.26 2.22h32.78c4.66 0 8.44-3.78 8.44-8.42 0-3.75-2.52-7.08-6.12-8.11l-50.07-14.3c-22.25-6.35-40.01-24.71-42.91-47.67-4.05-32.07 19.03-59.43 49.32-63.05V128c0-8.84 7.16-16 16-16h16c8.84 0 16 7.16 16 16v17.73c11.42 1.35 22.28 5.19 31.78 11.46 6.22 4.11 6.82 13.11 1.55 18.38l-17.52 17.52c-3.74 3.74-9.31 4.24-14.11 2.03a24.516 24.516 0 0 0-10.26-2.22h-32.78c-4.66 0-8.44 3.78-8.44 8.42 0 3.75 2.52 7.08 6.12 8.11l50.07 14.3c22.25 6.36 40.01 24.71 42.91 47.67 4.05 32.06-19.03 59.42-49.32 63.04z\",\r\n ],\r\n};\r\nexport const BOX_CHECK_ICON = {\r\n prefix: \"fas\",\r\n iconName: \"box-check\",\r\n icon: [\r\n 640,\r\n 512,\r\n [],\r\n \"f467\",\r\n \"M240 0H98.6c-20.7 0-39 13.2-45.5 32.8L2.5 184.6c-.8 2.4-.8 4.9-1.2 7.4H240V0zm235.2 81.7l-16.3-48.8C452.4 13.2 434.1 0 413.4 0H272v157.4C315.9 109.9 378.4 80 448 80c9.2 0 18.3.6 27.2 1.7zM208 320c0-34.1 7.3-66.6 20.2-96H0v240c0 26.5 21.5 48 48 48h256.6C246.1 468.2 208 398.6 208 320zm240-192c-106 0-192 86-192 192s86 192 192 192 192-86 192-192-86-192-192-192zm114.1 147.8l-131 130c-4.3 4.3-11.3 4.3-15.6-.1l-75.7-76.3c-4.3-4.3-4.2-11.3.1-15.6l26-25.8c4.3-4.3 11.3-4.2 15.6.1l42.1 42.5 97.2-96.4c4.3-4.3 11.3-4.2 15.6.1l25.8 26c4.2 4.3 4.2 11.3-.1 15.5z\",\r\n ],\r\n};\r\nexport const PERCENTAGE_ICON = {\r\n prefix: \"fas\",\r\n iconName: \"percentage\",\r\n icon: [\r\n 384,\r\n 512,\r\n [],\r\n \"f541\",\r\n \"M109.25 173.25c24.99-24.99 24.99-65.52 0-90.51-24.99-24.99-65.52-24.99-90.51 0-24.99 24.99-24.99 65.52 0 90.51 25 25 65.52 25 90.51 0zm256 165.49c-24.99-24.99-65.52-24.99-90.51 0-24.99 24.99-24.99 65.52 0 90.51 24.99 24.99 65.52 24.99 90.51 0 25-24.99 25-65.51 0-90.51zm-1.94-231.43l-22.62-22.62c-12.5-12.5-32.76-12.5-45.25 0L20.69 359.44c-12.5 12.5-12.5 32.76 0 45.25l22.62 22.62c12.5 12.5 32.76 12.5 45.25 0l274.75-274.75c12.5-12.49 12.5-32.75 0-45.25z\",\r\n ],\r\n};\r\n\r\nexport const COMMENT_ALT_SMILE_ICON = {\r\n prefix: \"fas\",\r\n iconName: \"comment-alt-smile\",\r\n icon: [\r\n 512,\r\n 512,\r\n [],\r\n \"f4aa\",\r\n \"M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 9.8 11.2 15.5 19.1 9.7L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zM320 133.2c14.8 0 26.8 12 26.8 26.8s-12 26.8-26.8 26.8-26.8-12-26.8-26.8 12-26.8 26.8-26.8zm-128 0c14.8 0 26.8 12 26.8 26.8s-12 26.8-26.8 26.8-26.8-12-26.8-26.8 12-26.8 26.8-26.8zm164.2 140.9C331.3 303.3 294.8 320 256 320c-38.8 0-75.3-16.7-100.2-45.9-5.8-6.7-5-16.8 1.8-22.5 6.7-5.7 16.8-5 22.5 1.8 18.8 22 46.5 34.6 75.8 34.6 29.4 0 57-12.6 75.8-34.7 5.8-6.7 15.9-7.5 22.6-1.8 6.8 5.8 7.6 15.9 1.9 22.6z\",\r\n ],\r\n};\r\n\r\nexport const USER_SHIELD_ICON = {\r\n prefix: \"fas\",\r\n iconName: \"user-shield\",\r\n icon: [\r\n 640,\r\n 512,\r\n [],\r\n \"f505\",\r\n \"M622.3 271.1l-115.2-45c-4.1-1.6-12.6-3.7-22.2 0l-115.2 45c-10.7 4.2-17.7 14-17.7 24.9 0 111.6 68.7 188.8 132.9 213.9 9.6 3.7 18 1.6 22.2 0C558.4 489.9 640 420.5 640 296c0-10.9-7-20.7-17.7-24.9zM496 462.4V273.3l95.5 37.3c-5.6 87.1-60.9 135.4-95.5 151.8zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm96 40c0-2.5.8-4.8 1.1-7.2-2.5-.1-4.9-.8-7.5-.8h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c6.8 0 13.3-1.5 19.2-4-54-42.9-99.2-116.7-99.2-212z\",\r\n ],\r\n};\r\n\r\nexport const PRESET_HIDDEN_PRODUCTS = [\r\n {\r\n id: 1,\r\n title: \"Gift Wrappping\",\r\n price: 2.55,\r\n body_html:\r\n \"<p>Buying a Gift? Let us wrap it for you!</p><p>One of our team, will carefully wrap all you items individually to make your (someone special)...feel special!</p>\",\r\n },\r\n {\r\n id: 4,\r\n title: \"Fast Processing\",\r\n price: 2.55,\r\n body_html:\r\n \"<p>Want to get your order FAST?</p><p>Get Priority Processing and we'll bump your order up to the front of the line. </p>\",\r\n },\r\n {\r\n id: 2,\r\n title: \"Extended waranty\",\r\n price: 4.19,\r\n body_html: \"<p>We will cover any manufacturing faults for 2 years!</p>\",\r\n },\r\n];\r\nexport const TEST_COOKIE_NAME = \"shopifyTestCookie\";\r\nexport const GRANTED_STORAGE_ACCESS_COOKIE_NAME =\r\n \"shopify.granted_storage_access\";\r\n\r\nexport const DEFAULT_GOAL = (\r\n { multi_goal_type, goals },\r\n language,\r\n currency\r\n) => {\r\n language = Object.keys(Languages).includes(language) ? language : \"english\";\r\n const index = goals.length;\r\n const goal = multi_goal_type === \"amount\" ? 40 + 20 * index : 2 + 2 * index;\r\n const reward = 10 + 5 * index;\r\n const __ = translate(language);\r\n return {\r\n // goal,\r\n badge: {\r\n show_text: true,\r\n text: {\r\n text: \"{{goal}}\",\r\n font_size: 1,\r\n color: default_primary,\r\n },\r\n type: 2,\r\n image: null,\r\n },\r\n specific_goals: [\r\n {\r\n currency,\r\n goal,\r\n main: true,\r\n },\r\n ],\r\n reward_type: \"discount\", // free_shipping,discount,gift\r\n goal_type: \"fixed\",\r\n goal_text: {\r\n text: reward + \"% OFF\",\r\n font_size: 0.7,\r\n color: {\r\n r: 44,\r\n g: 50,\r\n b: 59,\r\n a: 1,\r\n },\r\n },\r\n show_goal_text: true,\r\n confetti: false,\r\n confetti_length: 400,\r\n discount: {\r\n type: \"percentage\",\r\n before: __(\"campaigns.add_to_unlock.discount.before\"),\r\n after: __(\"campaigns.add_to_unlock.discount.after\"),\r\n reward,\r\n },\r\n free_shipping: {\r\n before: __(\"campaigns.add_to_unlock.free_shipping.before\"),\r\n after: __(\"campaigns.add_to_unlock.free_shipping.after\"),\r\n manual: true,\r\n },\r\n manual: {\r\n before: __(\"campaigns.add_to_unlock.free_shipping.before\"),\r\n after: __(\"campaigns.add_to_unlock.free_shipping.after\"),\r\n },\r\n gift: {\r\n before: __(\"campaigns.add_to_unlock.gift.before\"),\r\n after: __(\"campaigns.add_to_unlock.gift.after\"),\r\n // product: {},\r\n products: [],\r\n previous_gift: \"keep\",\r\n multi_gift_select: \"select\",\r\n widget: {\r\n active: true,\r\n compare_at_price_active: true,\r\n compare_at_price: {\r\n color: { r: 141, g: 141, b: 141, a: 1 },\r\n font_size: 1,\r\n text: __(\"campaigns.add_to_unlock.gift.compare_at_price.text\"),\r\n },\r\n before: {\r\n header: __(\"campaigns.add_to_unlock.gift.widget.before.header\"),\r\n product_name: __(\r\n \"campaigns.add_to_unlock.gift.widget.before.product_name\"\r\n ),\r\n offer_highlight: {\r\n color: { r: 95, g: 95, b: 95, a: 1 },\r\n font_size: 1.2,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.before.offer_highlight.text\"\r\n ),\r\n },\r\n // variant_selector_text: {\r\n // color: { r: 255, g: 255, b: 255, a: 1 },\r\n // font_size: 1,\r\n // text: __(\"campaigns.add_to_unlock.gift.widget.before.variant_selector_text.text\"),\r\n // },\r\n background: { r: 242, g: 245, b: 255, a: 1 },\r\n outline: { r: 196, g: 196, b: 196, a: 1 },\r\n // variant_button_background: { r: 10, g: 133, b: 255, a: 1 },\r\n multi_gift_image:\r\n \"https://d1s1zm0vzu692k.cloudfront.net/static/images/default_gifts.png\",\r\n },\r\n selecting: {\r\n header: __(\"campaigns.add_to_unlock.gift.widget.selecting.header\"),\r\n product_name: __(\r\n \"campaigns.add_to_unlock.gift.widget.selecting.product_name\"\r\n ),\r\n offer_highlight: {\r\n color: { r: 95, g: 95, b: 95, a: 1 },\r\n font_size: 1.2,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.selecting.offer_highlight.text\"\r\n ),\r\n },\r\n variant_selector_text: {\r\n color: { r: 255, g: 255, b: 255, a: 1 },\r\n font_size: 1,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.selecting.variant_selector_text.text\"\r\n ),\r\n },\r\n background: { r: 242, g: 245, b: 255, a: 1 },\r\n outline: { r: 196, g: 196, b: 196, a: 1 },\r\n variant_button_background: { r: 10, g: 133, b: 255, a: 1 },\r\n },\r\n after: {\r\n header: __(\"campaigns.add_to_unlock.gift.widget.after.header\"),\r\n product_name: __(\r\n \"campaigns.add_to_unlock.gift.widget.after.product_name\"\r\n ),\r\n offer_highlight: {\r\n color: { r: 79, g: 181, b: 110, a: 1 },\r\n font_size: 1.2,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.after.offer_highlight.text\"\r\n ),\r\n },\r\n background: { r: 248, g: 251, b: 246, a: 1 },\r\n outline: { r: 203, g: 235, b: 206, a: 1 },\r\n variant_change_text: {\r\n color: { r: 134, g: 134, b: 134, a: 1 },\r\n font_size: 1,\r\n text: __(\r\n \"campaigns.add_to_unlock.gift.widget.after.variant_change_text.text\"\r\n ),\r\n },\r\n },\r\n },\r\n // inventory_quantity: {\r\n // active: true,\r\n // text: __(\"campaigns.add_to_unlock.gift.inventory_quantity.text\")\r\n // }\r\n },\r\n };\r\n};\r\nexport const COD_FORM = [];\r\n\r\nexport const STICKY_CART_OPTIONS = {\r\n btnStyles: [\r\n { value: \"square\", label: \"Square\" },\r\n { value: \"curvy\", label: \"Curvy\" },\r\n // { value: 'organic', label: 'Organic' },\r\n ],\r\n btnPosition: [\r\n { value: \"bottom\", label: \"Bottom\" },\r\n { value: \"top\", label: \"Top\" },\r\n ],\r\n visibilityOptions: [\r\n { value: \"always\", label: \"Always\" },\r\n { value: \"dynamic\", label: 'when \"Add To Cart\" is hidden' },\r\n ],\r\n atcActions: [\r\n { value: \"checkout\", label: \"Redirect to checkout page\" },\r\n { value: \"cart\", label: \"Redirect to cart\" },\r\n { value: \"stay\", label: \"Stay in product page\" },\r\n ],\r\n};\r\n\r\nexport const BADGES_POSITIONS = [\r\n { value: \"bellow_checkout\", label: \"Bellow checkout button\" },\r\n { value: \"above_checkout\", label: \"Above checkout button\" },\r\n { value: \"above_totals\", label: \"Above totals\" },\r\n];\r\n\r\nexport const ANNOUNCEMENT_POSITIONS = [\r\n { value: \"bellow_header\", label: \"Bellow cart header\" },\r\n { value: \"bellow_products\", label: \"Bellow product\" },\r\n { value: \"above_products\", label: \"Above Products\" },\r\n { value: \"above_totals\", label: \"Above Totals\" },\r\n];\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"wrapper\":\"preview_wrapper__3Au4R\",\"content\":\"preview_content__Zinsu\",\"preview\":\"preview_preview__1gYLv\",\"mobileContainar\":\"preview_mobileContainar__1aYRM\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"actions\":\"actions_buttons_actions__3WX0-\",\"actions_wrapper\":\"actions_buttons_actions_wrapper__3Gw5d\",\"action_button_menu\":\"actions_buttons_action_button_menu__joiZz\"};","import React from 'react';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst Spinner = ({ text, color, size = 5 }) => {\r\n\treturn (\r\n\t\t<div className={classNames('h-full flex-center flex-col p-3')}>\r\n\t\t\t<div\r\n\t\t\t\tstyle={{\r\n\t\t\t\t\tcolor: color || '#2f80ed',\r\n\t\t\t\t}}\r\n\t\t\t\tclassName={classNames('flex-center')}\r\n\t\t\t>\r\n\t\t\t\t<svg\r\n\t\t\t\t\taria-hidden=\"true\"\r\n\t\t\t\t\tfocusable=\"false\"\r\n\t\t\t\t\tdata-icon=\"spinner-third\"\r\n\t\t\t\t\trole=\"img\"\r\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\r\n\t\t\t\t\tviewBox=\"0 0 512 512\"\r\n\t\t\t\t\tclassName={classNames(`w-${size} h-${size} fa-spin`, {\r\n\t\t\t\t\t\t\"mb-2\": !!text\r\n\t\t\t\t\t})}\r\n\t\t\t\t>\r\n\t\t\t\t\t<path\r\n\t\t\t\t\t\tfill=\"currentColor\"\r\n\t\t\t\t\t\td=\"M456.433 371.72l-27.79-16.045c-7.192-4.152-10.052-13.136-6.487-20.636 25.82-54.328 23.566-118.602-6.768-171.03-30.265-52.529-84.802-86.621-144.76-91.424C262.35 71.922 256 64.953 256 56.649V24.56c0-9.31 7.916-16.609 17.204-15.96 81.795 5.717 156.412 51.902 197.611 123.408 41.301 71.385 43.99 159.096 8.042 232.792-4.082 8.369-14.361 11.575-22.424 6.92z\"\r\n\t\t\t\t\t></path>\r\n\t\t\t\t</svg>\r\n\t\t\t</div>\r\n\t\t\t{text && <p className={classNames('text-gray-400 text-sm')}>{text}</p>}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default Spinner;\r\n","import classNames from 'lib/classNames';\r\nimport React from 'react';\r\nimport styles from 'styles/custom_scroll.module.scss'\r\n\r\nexport default function CustomScroll (props) {\r\n const { children, isMobile, style, trackBg = \"#ffffff\", thumbBg = \"#afafaf\", className, scrollRef } = props\r\n const finalClassName = [className, styles.custom_scrollbar, isMobile && 'isMobile'].filter(Boolean).join(' ')\r\n return <div className={finalClassName} ref={scrollRef} style={Object.assign({}, style, {\r\n \"--trackBg\": trackBg,\r\n \"--thumbBg\": thumbBg,\r\n })} >\r\n {children}\r\n </div>\r\n}","const addPrefix = require('./addPrefix');\r\n\r\nexport default function classNames(...cssClasses) {\r\n const isObject = variable => Object.prototype.toString.call(variable) === '[object Object]';\r\n let className = '';\r\n return cssClasses\r\n .map(cssClass => {\r\n if (!cssClass) return '';\r\n if (isObject(cssClass)) {\r\n return Object.entries(cssClass)\r\n .map(([value, condition]) => {\r\n return !!condition ? addPrefix(value) : '';\r\n })\r\n .filter(c => !!c)\r\n .join(' ');\r\n }\r\n return addPrefix(cssClass);\r\n })\r\n .join(' ');\r\n}\r\n","//AWS API Gateway endpoint for the AppSync service\r\nexport const API_GATEWAY = process.env.REACT_APP_API_GATEWAY;\r\nexport const API_GATEWAY_NEW = process.env.REACT_APP_API_GATEWAY_NEW;\r\nexport const API_GATEWAY2 = process.env.REACT_APP_API_GATEWAY2;\r\n//AWS AppSync authentication type\r\nexport const APPSYNC_AUTH_TYPE = process.env.REACT_APP_APPSYNC_AUTH_TYPE;\r\n//AWS AppSync endpoint\r\nexport const APPSYNC_ENDPOINT = process.env.REACT_APP_APPSYNC_ENDPOINT;\r\n//AWS AppSyncregion\r\nexport const APPSYNC_REGION = process.env.REACT_APP_APPSYNC_REGION;\r\n//Domain for Amplify cookie storage\r\nexport const AUTH_COOKIE_DOMAIN = process.env.REACT_APP_AUTH_COOKIE_DOMAIN;\r\n//Cookie expiry time for Amplify cookie storage\r\nexport const AUTH_COOKIE_EXPIRES = parseInt(process.env.REACT_APP_AUTH_COOKIE_EXPIRES);\r\n//Path for Amplify cookie storage\r\nexport const AUTH_COOKIE_PATH = process.env.REACT_APP_AUTH_COOKIE_PATH;\r\n//The key used to store our temporary OAuth token in localStorage\r\nexport const AUTH_TOKEN_KEY = process.env.REACT_APP_AUTH_TOKEN_KEY;\r\n//AWS Cognito Identity Pool ID\r\nexport const AWS_COGNITO_IDENTITY_POOL_ID = process.env.REACT_APP_AWS_COGNITO_IDENTITY_POOL_ID;\r\n//AWS Cognito Identity Pool ID\r\nexport const AWS_COGNITO_REGION = process.env.REACT_APP_AWS_COGNITO_REGION;\r\n//AWS Cognito User Pool ID\r\nexport const AWS_COGNITO_USER_POOL_ID = process.env.REACT_APP_AWS_COGNITO_USER_POOL_ID;\r\n//AWS Cognito User Pool Client ID\r\nexport const AWS_COGNITO_USER_POOL_CLIENT_ID =\r\n process.env.REACT_APP_AWS_COGNITO_USER_POOL_CLIENT_ID;\r\n//Set to true to enable an embedded app or false to disable it\r\nexport const ENABLED_EMBEDDED = process.env.REACT_APP_ENABLED_EMBEDDED;\r\n//Shopify API Key\r\nexport const SHOPIFY_API_KEY = process.env.REACT_APP_SHOPIFY_API_KEY;\r\n// The app permalink is used for redirection you can found it here: shop.myshopify/admin/apps/{app permalink}\r\nexport const SHOPIFY_APP_PERMALINK = process.env.REACT_APP_SHOPIFY_APP_PERMALINK;\r\n//Embedded app force redirect\r\nexport const SHOPIFY_EMBEDDED_FORCE_REDIRECT = JSON.parse(\r\n process.env.REACT_APP_SHOPIFY_EMBEDDED_FORCE_REDIRECT\r\n);\r\nexport const APP_NAME = process.env.REACT_APP_APP_NAME;\r\nexport const SCOPE = process.env.REACT_APP_SCOPE;\r\nexport const APP_DEV = JSON.parse(process.env.REACT_APP_DEV);\r\nconst pushing_time = \"1742983365765\";\r\n","import React, { useContext, useState, useEffect } from 'react';\r\nimport loadable from '@loadable/component';\r\nimport PropTypes from 'prop-types';\r\nimport { CartContext } from 'components/cart';\r\nimport useCampaign from 'hooks/useCampaign';\r\nimport classNames from 'lib/classNames';\r\n// import GiftWithPurchaseWidget from \"./GiftWithPurchaseWidget\";\r\n// import MultiGiftWithPurchaseWidget from \"./MultiGiftWithPurchaseWidget\";\r\nimport { isOCUProduct, getAllOCUProducts } from './CheckoutButton';\r\nimport Axios from 'axios';\r\nimport { getAddedGifts, getGoal, GetPresentableItemsList } from '../Utils';\r\nimport AddToUnlock from './AddToUnlock';\r\nconst Bundles = loadable(() => import('./Bundles'));\r\nconst Announcement = loadable(() => import('./announcement'));\r\nconst GiftWithPurchaseWidget = loadable(() => import('./GiftWithPurchaseWidget'));\r\nconst MultiGiftWithPurchaseWidget = loadable(() => import('./MultiGiftWithPurchaseWidget'));\r\nconst Badges = loadable(() => import('./badges'));\r\n\r\nexport const DefaultAutoDiscountSettings = {\r\n text: {\r\n color: {\r\n a: 1,\r\n r: 0,\r\n g: 45,\r\n b: 255\r\n },\r\n font_weight: 400,\r\n font_size: 0.9,\r\n text: '{{title}}'\r\n },\r\n background: {\r\n a: 1,\r\n r: 240,\r\n g: 242,\r\n b: 255\r\n },\r\n border: {\r\n a: 1,\r\n r: 161,\r\n g: 178,\r\n b: 255\r\n }\r\n};\r\n\r\nconst CartItemsList = (props) => {\r\n const {\r\n campaigns,\r\n shopify_cart_items,\r\n cart_settings,\r\n isPreview,\r\n cart_settings: {\r\n announcement = {},\r\n modules: { checkout_button },\r\n badges = {}\r\n },\r\n productAddedToCart,\r\n discountCode,\r\n setCartItems,\r\n Utils,\r\n get_total,\r\n products\r\n } = useContext(CartContext);\r\n const [one_check_up_sell_product_id, ocu_campaign] = useCampaign(\r\n 'one_check_up_sell',\r\n null,\r\n true\r\n )(campaigns, shopify_cart_items);\r\n const ocu_products = getAllOCUProducts(ocu_campaign);\r\n const filteredItems = shopify_cart_items.filter((item) => {\r\n const ocu_product = ocu_products.find(\r\n ({ product }) => item.product_id.toString() === product?.id\r\n );\r\n return ocu_product\r\n ? ocu_product.include_in_atu\r\n : !['free_gift', 'singleton_gift'].includes(item?.product_type?.toLowerCase());\r\n });\r\n const [add_to_unlock_product_id, add_to_unlock, isGlobal] = useCampaign('add_to_unlock')(\r\n campaigns,\r\n shopify_cart_items\r\n );\r\n const CAN_RENDER_ADD_TO_UNLOCK =\r\n add_to_unlock &&\r\n (add_to_unlock.products.length ||\r\n add_to_unlock.recommendation_type == 'shopify_recommendation' ||\r\n isPreview) &&\r\n add_to_unlock.show_suggestions &&\r\n (productAddedToCart({ id: add_to_unlock_product_id }) ||\r\n (isGlobal && shopify_cart_items.length));\r\n const { original, subtotal } = get_total(null, filteredItems);\r\n const byQuantity = add_to_unlock?.multi_goal_type === 'quantity';\r\n const bundlesDiscounts = Utils.getDiscount({\r\n campaigns,\r\n items: shopify_cart_items,\r\n getBundlesOnly: true\r\n });\r\n const rate = window.mu_stop_shopify_rate ? 1 : parseFloat(window.Shopify.currency.rate);\r\n const goalValue = (goal) => (byQuantity ? goal : parseInt(goal * 100 * rate));\r\n const totalItems = shopify_cart_items\r\n .filter(({ price }) => Number(price) > 0)\r\n .reduce((acc, cur) => acc + cur.quantity, 0);\r\n const getTotal = (reward_type) => {\r\n const total = byQuantity\r\n ? totalItems\r\n : reward_type === 'free_shipping'\r\n ? subtotal\r\n : original - bundlesDiscounts;\r\n return total;\r\n };\r\n const giftGoals = add_to_unlock?.goals?.filter(\r\n ({ reward_type, gift }) =>\r\n reward_type === 'gift' && (gift?.product?.title || gift?.products?.length)\r\n );\r\n const CAN_RENDER_GIFT_WIDGET =\r\n (add_to_unlock?.isActive &&\r\n giftGoals.length &&\r\n productAddedToCart({ id: add_to_unlock_product_id })) ||\r\n (add_to_unlock?.isActive && isGlobal && shopify_cart_items.length);\r\n \r\n useEffect(() => {\r\n async function handleGiftCampaignChange() {\r\n const gifts = shopify_cart_items.filter(({ product_type }) =>\r\n ['free_gift', 'singleton_gift'].includes(product_type?.toLowerCase())\r\n );\r\n const { origin } = window.location;\r\n gifts.forEach(async (gift) => {\r\n const belongsToCurrentATU = !!giftGoals?.find((goal) => {\r\n if (goal.gift.products) {\r\n return !!goal.gift.products?.find(\r\n (product) => product?.id === gift.product_id.toString()\r\n );\r\n }\r\n return goal.gift.product?.id === gift.product_id.toString();\r\n });\r\n if (!belongsToCurrentATU) {\r\n const { data } = await Axios.post(Utils.getLangPath('cart/update.js'), {\r\n updates: { [gift.id]: 0 }\r\n });\r\n if (data?.items) {\r\n setCartItems(data.items, data.cart_level_discount_applications);\r\n }\r\n }\r\n });\r\n }\r\n handleGiftCampaignChange();\r\n }, [shopify_cart_items]);\r\n\r\n function getCartItems() {\r\n const items = GetPresentableItemsList(shopify_cart_items);\r\n return window.mu_dont_reverse_items ? items.reverse() : items;\r\n }\r\n\r\n return (\r\n <>\r\n <div\r\n id=\"mu-items-container\"\r\n className={classNames('flex flex-col px-5 ', {\r\n 'flex-1':\r\n cart_settings.product.grow ||\r\n (!!CAN_RENDER_ADD_TO_UNLOCK &&\r\n (add_to_unlock.fbt_position === 'above_checkout' ||\r\n (!add_to_unlock.fbt_position && add_to_unlock.fbt_below)) &&\r\n checkout_button.fix_checkout_container)\r\n })}\r\n style={{\r\n paddingTop: 12\r\n }}\r\n >\r\n {!!shopify_cart_items.length &&\r\n announcement?.isActive &&\r\n announcement.position === 'above_products' && (\r\n <Announcement announcement={announcement} />\r\n )}\r\n {!!shopify_cart_items.length &&\r\n getCartItems().map((cartItem, key) => (\r\n <CartItem\r\n cartItem={cartItem}\r\n key={key}\r\n giftGoals={giftGoals}\r\n line={shopify_cart_items.length - key}\r\n />\r\n ))}\r\n {!!CAN_RENDER_GIFT_WIDGET &&\r\n giftGoals.map((goal, key) => {\r\n if (!goal.gift?.widget?.active) {\r\n return null;\r\n }\r\n const { products, previous_gift } = goal.gift;\r\n const hasManyGifts = products?.length;\r\n // find if there is a previous goal and inject it on MultiGiftWithPurchaseWidget if the current goal removes the previous one\r\n const previous_goal =\r\n previous_gift === 'remove' && key > 0 && giftGoals[key - 1];\r\n // find the next goal and check if it's unlocked and it's removed previous and a gift is added\r\n //TODO: find all next goals with previous_gift = remove\r\n //TODO: check if at least one goal is unlocked to hide this goal\r\n const next_goal =\r\n key < giftGoals.length - 1 ? giftGoals[key + 1] : undefined;\r\n const next_remove_previous_goals = giftGoals\r\n .slice(key + 1)\r\n .filter(({ gift }) => gift?.previous_gift === 'remove');\r\n const oneGoalIsUnlocked = (goalObject) => {\r\n const { goal: oldGoal, specific_goals, reward_type } = goalObject;\r\n const goal = getGoal({\r\n byQuantity,\r\n oldGoal,\r\n specific_goals,\r\n inCents: true\r\n });\r\n const total = getTotal(reward_type);\r\n return total >= goal;\r\n };\r\n if (next_remove_previous_goals.some(oneGoalIsUnlocked)) {\r\n return null;\r\n }\r\n if (hasManyGifts)\r\n return (\r\n <MultiGiftWithPurchaseWidget\r\n key={key}\r\n previous_goal={previous_goal}\r\n giftGoal={goal}\r\n filteredItems={filteredItems}\r\n add_to_unlock={add_to_unlock}\r\n />\r\n );\r\n return (\r\n <GiftWithPurchaseWidget\r\n key={key}\r\n byQuantity={byQuantity}\r\n giftGoal={goal}\r\n filteredItems={filteredItems}\r\n multi_goal_type={add_to_unlock.multi_goal_type}\r\n />\r\n );\r\n })}\r\n {!!shopify_cart_items.length &&\r\n announcement?.isActive &&\r\n announcement.position === 'bellow_products' && (\r\n <Announcement announcement={announcement} />\r\n )}\r\n {/* {badges?.isActive && checkout_button.fix_checkout_container && (\r\n <Badges badges={badges} />\r\n )} */}\r\n </div>\r\n {!!CAN_RENDER_ADD_TO_UNLOCK &&\r\n (add_to_unlock.fbt_position === 'under_products' ||\r\n add_to_unlock.fbt_position === 'above_checkout' ||\r\n (!add_to_unlock.fbt_position && add_to_unlock.fbt_below)) && (\r\n <div className={classNames('px-5')}>\r\n <AddToUnlock {...{ add_to_unlock, add_to_unlock_product_id }} />\r\n </div>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nCartItemsList.propTypes = {};\r\n\r\nconst CartItem = ({ cartItem, giftGoals }) => {\r\n const {\r\n id,\r\n image,\r\n product_title,\r\n product_type,\r\n quantity,\r\n line,\r\n line_quantity,\r\n price,\r\n product_id,\r\n variant_id,\r\n url,\r\n itemSoldOut,\r\n variant_title,\r\n selling_plan_allocation,\r\n properties,\r\n compare_at_price,\r\n variant_options,\r\n } = cartItem;\r\n const [error, setError] = useState(null);\r\n const [soldOut, setSoldOut] = useState(!!itemSoldOut);\r\n const [maxQuantity, setMaxQuantity] = useState(Infinity);\r\n const [selectedSellingPlanID, setSelectedSellingPlanID] = useState(\r\n selling_plan_allocation?.selling_plan?.id ?? null\r\n );\r\n const [plansData, setPlansData] = useState(null);\r\n const [loadingPlan, setLoadingPlan] = useState(false);\r\n const {\r\n campaigns,\r\n update_cart_item,\r\n Utils,\r\n isPreview,\r\n showSubscription,\r\n cart_settings: {\r\n count_compare_at,\r\n theme: { background },\r\n product,\r\n money_format,\r\n rtl,\r\n auto_discount = DefaultAutoDiscountSettings,\r\n subscription\r\n },\r\n shopify_cart_items,\r\n productAddedToCart,\r\n discountCode,\r\n removeFBTUpsell,\r\n compareAtMap,\r\n hasAutoDiscount,\r\n products\r\n } = useContext(CartContext);\r\n // const subscription = {\r\n // isActive: true,\r\n // text: {\r\n // color: {\r\n // a: 1,\r\n // r: 255,\r\n // g: 255,\r\n // b: 255,\r\n // },\r\n // font_weight: 400,\r\n // font_size: 0.8,\r\n // text: \"Upgrade to {{selling_plan_name}}\",\r\n // },\r\n // background: {\r\n // a: 1,\r\n // r: 26,\r\n // g: 68,\r\n // b: 156,\r\n // },\r\n // border: {\r\n // a: 1,\r\n // r: 26,\r\n // g: 68,\r\n // b: 156,\r\n // },\r\n // };\r\n const [one_check_up_sell_product_id, ocu_campaign] = useCampaign(\r\n 'one_check_up_sell',\r\n null,\r\n true\r\n )(campaigns, shopify_cart_items);\r\n const selectedProduct = products\r\n ?.find(({ id }) => id == product_id);\r\n const selectedVariant = selectedProduct?.variants?.find(\r\n ({ id }) => id == variant_id\r\n );\r\n const [_, bundles] = useCampaign('bundles', product_id)(campaigns, shopify_cart_items);\r\n const IS_EXAMPLE = isPreview && product_id < 10;\r\n const IS_ONE_CHECK_PRODUCT =\r\n shopify_cart_items.length > 1 &&\r\n productAddedToCart(one_check_up_sell_product_id) &&\r\n isOCUProduct(ocu_campaign, product_id, IS_EXAMPLE);\r\n const IS_GIFT_PRODUCT = !!giftGoals?.find(\r\n ({ gift }) => gift?.product?.variant_id === variant_id?.toString()\r\n );\r\n const updateItem = (step) => {\r\n const newQuantity = (line_quantity || quantity) + step;\r\n update_cart_item({ line, variant_id: id, quantity: newQuantity });\r\n if (newQuantity === 0) removeFBTUpsell(id);\r\n };\r\n const formatText = (text) => {\r\n const { price, original } = getPrice();\r\n return text\r\n .replace(\"{{product_title}}\", product_title)\r\n .replace(\"{{product_price}}\", Utils.formatMoney(price, money_format))\r\n .replace(\r\n \"{{original_price}}\",\r\n original && original.toFixed(2) !== price.toFixed(2)\r\n ? `<del class='mu-original-price mu-opacity-75 ${\r\n rtl ? \"mu-ml-1\" : \"mu-mr-1\"\r\n } notranslate' style='font-size:0.8em'>${Utils.formatMoney(\r\n original,\r\n money_format\r\n )}</del> `\r\n : \"\"\r\n );\r\n };\r\n const hasCompareAt = (variant_id, quantity, price = null) => {\r\n if (!count_compare_at) return false;\r\n const finalPrice =\r\n (selectedVariant && Number(selectedVariant?.compare_at_price) * 100) ??\r\n (compareAtMap && compareAtMap[variant_id] ? compareAtMap[variant_id] : price);\r\n // console.log(compareAtMap);\r\n // const finalPrice = compareAtMap && compareAtMap[variant_id] ? compareAtMap[variant_id] * parseFloat(window.Shopify.currency.rate) : price\r\n if (window.mu_handle_compareAt) return window.mu_handle_compareAt(variant_id, quantity, price, finalPrice);\r\n return finalPrice * quantity;\r\n };\r\n const autoDiscount = Utils.GetCartLineItemDiscount(cartItem);\r\n const getPrice = () => {\r\n let single_price = window.mu_show_single_price;\r\n if (autoDiscount || cartItem.discounts.length) {\r\n const { discounted_price, original_line_price, discounts } = cartItem;\r\n const price =\r\n original_line_price - discounts.reduce((acc, { amount }) => acc + amount, 0);\r\n // return { price: discounted_price * (single_price ? 1 : quantity), original: hasCompareAt(id, (single_price ? 1 : quantity)) };\r\n if (!hasCompareAt(id, single_price ? 1 : quantity))\r\n return {\r\n price: single_price ? discounted_price : price,\r\n original: single_price ? original_line_price / quantity : original_line_price\r\n };\r\n return {\r\n price: single_price ? discounted_price : price,\r\n original: hasCompareAt(id, single_price ? 1 : quantity)\r\n };\r\n }\r\n if (!bundles || discountCode?.value) {\r\n return {\r\n price:\r\n price * (single_price ? 1 : quantity) -\r\n (cartItem.discounts?.reduce(\r\n (acc, { amount }) => acc + amount,\r\n 0\r\n ) ?? 0) /\r\n (single_price ? quantity : 1),\r\n original: hasCompareAt(id, single_price ? 1 : quantity, price),\r\n };\r\n }\r\n const productQuantity = shopify_cart_items\r\n .filter(({ product_id }) => product_id == cartItem.product_id)\r\n .reduce((acc, { quantity }) => acc + quantity, 0);\r\n const selectedBundle =\r\n bundles.list.find((bundle) => bundle.quantity === productQuantity) ||\r\n Utils.sortByQuantity(bundles.list).find(\r\n (bundle) => bundle.quantity < productQuantity\r\n );\r\n if (!selectedBundle)\r\n return {\r\n price: price * (single_price ? 1 : quantity),\r\n original: hasCompareAt(id, single_price ? 1 : quantity, price),\r\n };\r\n const discountedPrice = Utils.getBundleDiscount(\r\n selectedBundle,\r\n single_price ? 1 : quantity,\r\n price,\r\n money_format\r\n ); \r\n return {\r\n price: discountedPrice.plain,\r\n original: hasCompareAt(id, single_price ? 1 : quantity, price)\r\n };\r\n };\r\n\r\n function formatAutoDiscount(discount) {\r\n const { title, amount } = discount;\r\n return auto_discount.text.text\r\n .replace('{{title}}', title)\r\n .replace('{{amount}}', Utils.formatMoney(amount, money_format));\r\n }\r\n function formatBundleLabel(text) {\r\n if(!text) return null;\r\n const quantity = shopify_cart_items\r\n .filter((i) => i.product_id === product_id)\r\n .reduce((acc, { quantity }) => acc + quantity, 0);\r\n const bundle = Utils.sortBundles(bundles.list).reduce((acc, cur) => {\r\n if (quantity >= cur.quantity) acc = cur;\r\n return acc;\r\n }, null);\r\n if (!bundle) return null;\r\n const { type, reward } = bundle;\r\n const formatted_reward =\r\n type === 'percentage'\r\n ? `${reward}%`\r\n : Utils.formatMoney(reward * 100 * Number(window.Shopify.currency.rate), money_format, (n, p) =>\r\n Utils.formatWithDelimiters(n, p, ',', '.', true)\r\n ); \r\n return text.replace('{{quantity}}', quantity).replace('{{discount}}', formatted_reward);\r\n }\r\n\r\n useEffect(() => {\r\n const fetchData = async () => {\r\n if (isPreview) {\r\n if (showSubscription) {\r\n const response = await Utils.getPlansData(\r\n 8353444036775,\r\n \"recharge\",\r\n null,\r\n true\r\n );\r\n setPlansData(response);\r\n }\r\n } else {\r\n const subscriptionApps = [\r\n { name: \"recharge\", scriptKeyword: \"rechargecdn.com\" },\r\n { name: \"seal\", scriptKeyword: \"sealsubscriptions.com\" },\r\n { name: \"casa\", scriptKeyword: \"casaapps.com\" },\r\n { name: \"subify\", scriptKeyword: \"subify\" },\r\n { name: \"appstle\", scriptKeyword: \"appstle-subscription\" },\r\n { name: \"recurpay\", scriptKeyword: \"recurpay-subscriptions\" },\r\n { name: \"yotpo\", scriptKeyword: \"yotpo.com\" },\r\n { name: \"paywhirl\", scriptKeyword: \"paywhirl.com\" },\r\n ];\r\n\r\n const checkForAppScript = (scriptKeyword) => {\r\n const scripts = document.getElementsByTagName(\"script\");\r\n for (let i = 0; i < scripts.length; i++) {\r\n if (scripts[i].src.includes(scriptKeyword)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n\r\n let plansData = null;\r\n for (const app of subscriptionApps) {\r\n if (checkForAppScript(app.scriptKeyword)) {\r\n plansData = await Utils.getPlansData(\r\n product_id,\r\n app.name,\r\n url,\r\n null,\r\n variant_id\r\n );\r\n if (plansData) {\r\n setPlansData(plansData);\r\n break;\r\n }\r\n } else {\r\n setPlansData(null);\r\n }\r\n }\r\n }\r\n };\r\n\r\n fetchData();\r\n }, [product_id, showSubscription, isPreview, shopify_cart_items.length]);\r\n\r\n if (['free_gift', 'singleton_gift', 'ship_protect'].includes(product_type?.toLowerCase())) {\r\n return null;\r\n }\r\n\r\n function formatSubsciptionUpgrade(text=\"\", plans_group_name, selling_plan_name) {\r\n return text.replace(\r\n /{{plans_group_name}}/g,\r\n plans_group_name ?? Object.keys(plansData.subscriptions)[0]\r\n ).replace(\r\n /{{selling_plan_name}}/g,\r\n selling_plan_name ??\r\n plansData.subscriptions[\r\n Object.keys(plansData.subscriptions)[0]\r\n ]?.[0]?.external_plan_name\r\n );\r\n }\r\n \r\n return IS_ONE_CHECK_PRODUCT || IS_GIFT_PRODUCT ? null : (\r\n <div\r\n data-product-id={product_id}\r\n data-variant-id={variant_id}\r\n className={classNames(\"cart-item mb-2\")}\r\n >\r\n <div className={classNames(\"flex\")}>\r\n <div\r\n className={classNames(\"item-image bg-cover bg-center block\", {\r\n \"ml-2\": rtl,\r\n \"mr-2\": !rtl,\r\n })}\r\n style={{\r\n backgroundImage: `url(${\r\n window.mu_display_product_image && selectedProduct\r\n ? selectedProduct.images[0].src\r\n : (properties && properties[\"_customily-preview\"]) || image\r\n })`,\r\n width: `${product.image_size}px`,\r\n height: `${product.image_size}px`,\r\n }}\r\n />\r\n <div className={classNames(\"flex-1 flex-col\")}>\r\n <div\r\n className={classNames(\r\n \"item-title mb-0 overflow-hidden font-bold line-clamp leading-none mb-1\"\r\n )}\r\n style={{\r\n fontSize: Utils.em(product.title.font_size),\r\n color: Utils.formatColor(product.title.color),\r\n fontWeight: product.title.font_weight,\r\n }}\r\n >\r\n {isPreview || window.mu_title_unclickable ? (\r\n <span\r\n dangerouslySetInnerHTML={{\r\n __html: formatText(product.title.text),\r\n }}\r\n />\r\n ) : (\r\n <a\r\n href={`${window.origin}${url}`}\r\n dangerouslySetInnerHTML={{\r\n __html: formatText(product.title.text),\r\n }}\r\n />\r\n )}\r\n </div>\r\n {variant_title && variant_options && !window.hide_variant_title && (\r\n <p className={classNames(\"item-variants leading-none mb-1\")}>\r\n {variant_options.join(window.mu_variants_join_char ?? \"•\")}\r\n </p>\r\n )}\r\n {(!!autoDiscount ||\r\n (cartItem.discounts.length > 0 &&\r\n (window.mu_show_discount_when_code_only\r\n ? Boolean(discountCode?.value)\r\n : true))) &&\r\n !bundles && (\r\n <div\r\n className={classNames(\r\n \"item-auto-discount text-sm p-1 rounded mb-1 flex items-center space-x-1 leading-none mb-1\"\r\n )}\r\n style={{\r\n fontSize: `${auto_discount.text.font_size}em`,\r\n fontWeight: auto_discount.text.font_weight,\r\n color: Utils.formatColor(auto_discount.text.color),\r\n background: Utils.formatColor(auto_discount.background),\r\n border: `${Utils.formatColor(\r\n auto_discount.border\r\n )} 1px solid`,\r\n }}\r\n >\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n className={classNames(\"w-5 h-5\")}\r\n >\r\n <path\r\n fillRule=\"evenodd\"\r\n d=\"M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z\"\r\n clip-rule=\"evenodd\"\r\n />\r\n </svg>\r\n <span\r\n className={classNames(\"leading-none\")}\r\n dangerouslySetInnerHTML={{\r\n __html: formatAutoDiscount(cartItem.discounts[0]),\r\n }}\r\n ></span>\r\n </div>\r\n )}\r\n {!!bundles &&\r\n !soldOut &&\r\n !discountCode &&\r\n !hasAutoDiscount &&\r\n formatBundleLabel(bundles.text) && (\r\n <div\r\n className={classNames(\r\n \"item-auto-discount text-sm p-1 rounded mb-1 flex items-center space-x-1 leading-none inline-block\"\r\n )}\r\n style={{\r\n fontSize: `${auto_discount.text.font_size}em`,\r\n fontWeight: auto_discount.text.font_weight,\r\n color: Utils.formatColor(\r\n bundles.badge?.text || auto_discount.text.color\r\n ),\r\n background: Utils.formatColor(\r\n bundles.badge?.background || auto_discount.background\r\n ),\r\n border: `${Utils.formatColor(\r\n bundles.badge?.border || auto_discount.border\r\n )} 1px solid`,\r\n }}\r\n >\r\n {\" \"}\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n className={classNames(\"w-5 h-5\")}\r\n >\r\n <path\r\n fillRule=\"evenodd\"\r\n d=\"M5.5 3A2.5 2.5 0 003 5.5v2.879a2.5 2.5 0 00.732 1.767l6.5 6.5a2.5 2.5 0 003.536 0l2.878-2.878a2.5 2.5 0 000-3.536l-6.5-6.5A2.5 2.5 0 008.38 3H5.5zM6 7a1 1 0 100-2 1 1 0 000 2z\"\r\n clipRule=\"evenodd\"\r\n />\r\n </svg>\r\n <span\r\n className={classNames(\"leading-none\")}\r\n dangerouslySetInnerHTML={{\r\n __html: formatBundleLabel(bundles.text),\r\n }}\r\n />\r\n </div>\r\n )}\r\n {properties &&\r\n !properties[\"File1\"] &&\r\n !properties[\"_pplr_preview\"] &&\r\n !properties[\"_is_preorder\"] &&\r\n window.show_item_properties && (\r\n <div className={classNames(\"item-properties space-y-1\")}>\r\n {Object.entries(properties)\r\n .filter(\r\n ([key, value]) =>\r\n typeof value === \"string\" &&\r\n (!key.startsWith(\"_\") || window.show_private_properties)\r\n )\r\n .map(([key, value]) => (\r\n <p\r\n className={classNames(\r\n \"item-property text-sm capitalize\"\r\n )}\r\n key={key}\r\n style={{ opacity: 0.8 }}\r\n data-key={key}\r\n data-value={value}\r\n dangerouslySetInnerHTML={{\r\n __html: `<b>${key}: </b> ${value}`,\r\n }}\r\n ></p>\r\n ))}\r\n </div>\r\n )}\r\n {selling_plan_allocation?.selling_plan && (\r\n <p className={classNames(\"item-selling-plan text-xs\")}>\r\n {selling_plan_allocation?.selling_plan?.name}\r\n </p>\r\n )}\r\n {properties && properties[\"File1\"] && (\r\n <div className={classNames(\"item-properties gf-file\")}>\r\n {Object.entries(properties)\r\n .filter(([key]) => key !== \"_pplr_ref_variant\")\r\n .map(([key, value]) => (\r\n <div\r\n key={key}\r\n className={classNames(\r\n \"item-property flex items-center justify-start my-1\"\r\n )}\r\n data-key={key}\r\n data-value={value}\r\n >\r\n <p className={classNames(\"text-sm\")}>{key}</p>\r\n {key.includes(\"File\") ? (\r\n <a href={value} target={\"_blank\"}>\r\n <img\r\n className={classNames(\r\n \"rounded-sm ml-12 h-12 w-12 object-cover\"\r\n )}\r\n src={value}\r\n />\r\n </a>\r\n ) : (\r\n <p className={classNames(\"text-sm ml-2\")}>{value}</p>\r\n )}\r\n </div>\r\n ))}\r\n </div>\r\n )}\r\n {properties && properties[\"_pplr_preview\"] && (\r\n <div className={classNames(\"item-properties pplr mt-1\")}>\r\n {Object.entries(properties)\r\n .filter(\r\n ([name, value]) =>\r\n name &&\r\n value &&\r\n !name.includes(\"_pplr_preview\") &&\r\n !name.includes(\"_pplr_ref_variant\") &&\r\n !name.includes(\"_svg\")\r\n )\r\n .map(([name, value]) => (\r\n <div\r\n key={name}\r\n className={classNames(\"item-property text-sm\")}\r\n data-key={name}\r\n data-value={value}\r\n dangerouslySetInnerHTML={{\r\n __html: `${name.replace(\r\n \"See photo guide\",\r\n \"\"\r\n )}: ${value}`,\r\n }}\r\n ></div>\r\n ))}\r\n </div>\r\n )}\r\n {properties && properties[\"_is_preorder\"] && (\r\n <div className={classNames(\"item-properties preorder mt-1\")}>\r\n {Object.entries(properties)\r\n .filter(\r\n ([name, value]) =>\r\n name &&\r\n value &&\r\n !name.includes(\"_is_preorder\") &&\r\n !name.includes(\"_preorder_locale\")\r\n )\r\n .map(([name, value]) => (\r\n <p\r\n className={classNames(\"item-property text-sm\")}\r\n key={name}\r\n data-key={name}\r\n data-value={value}\r\n >\r\n <b\r\n className={classNames(\"font-bold\")}\r\n >{`${name}: ${value}`}</b>\r\n </p>\r\n ))}\r\n </div>\r\n )}\r\n <div className={classNames(\"flex items-center\")}>\r\n <b\r\n className={`${classNames(\r\n \"item-price flex-1 leading-none\"\r\n )} notranslate`}\r\n style={{\r\n fontSize: Utils.em(product.price.font_size),\r\n fontWeight: product.price.font_weight,\r\n color: Utils.formatColor(product.price.color),\r\n }}\r\n dangerouslySetInnerHTML={{\r\n __html: formatText(product.price.text),\r\n }}\r\n />\r\n\r\n {!soldOut && (\r\n <div\r\n className={`${classNames(\r\n \"item-quantity flex items-stretch\",\r\n getPrice().price == 0 ? \" hidden\" : \"\"\r\n )} notranslate`}\r\n >\r\n <button\r\n style={{\r\n border: \"1px solid\",\r\n color: Utils.formatColor(product.title.color),\r\n borderColor: Utils.lighterColor(0.8, product.title.color),\r\n minWidth: \"unset\",\r\n }}\r\n className={classNames(\r\n \"border flex-center p-1 xs:p-2 bg-transparent\",\r\n {\r\n \"rounded-r rounded-l-none\": rtl,\r\n \"rounded-l rounded-r-none\": !rtl,\r\n }\r\n )}\r\n onClick={() => updateItem(-1)}\r\n aria-label={\r\n quantity === 1\r\n ? \"remove item from cart\"\r\n : \"decrease item quantity by one\"\r\n }\r\n >\r\n {quantity === 1 && (\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-icon=\"trash\"\r\n style={{ height: 12 }}\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 448 512\"\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M0 84V56c0-13.3 10.7-24 24-24h112l9.4-18.7c4-8.2 12.3-13.3 21.4-13.3h114.3c9.1 0 17.4 5.1 21.5 13.3L312 32h112c13.3 0 24 10.7 24 24v28c0 6.6-5.4 12-12 12H12C5.4 96 0 90.6 0 84zm415.2 56.7L394.8 467c-1.6 25.3-22.6 45-47.9 45H101.1c-25.3 0-46.3-19.7-47.9-45L32.8 140.7c-.4-6.9 5.1-12.7 12-12.7h358.5c6.8 0 12.3 5.8 11.9 12.7z\"\r\n ></path>\r\n </svg>\r\n )}\r\n {quantity > 1 && (\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-icon=\"minus\"\r\n style={{ height: 12 }}\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 448 512\"\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M424 318.2c13.3 0 24-10.7 24-24v-76.4c0-13.3-10.7-24-24-24H24c-13.3 0-24 10.7-24 24v76.4c0 13.3 10.7 24 24 24h400z\"\r\n ></path>\r\n </svg>\r\n )}\r\n </button>\r\n <div\r\n className={classNames(\r\n \"px-2 border-t border-b font-bold flex-center w-8\"\r\n )}\r\n style={{\r\n color: Utils.formatColor(product.title.color),\r\n borderColor: Utils.lighterColor(0.8, product.title.color),\r\n }}\r\n >\r\n {quantity}\r\n </div>\r\n <button\r\n style={{\r\n border: \"1px solid\",\r\n color: Utils.formatColor(product.title.color),\r\n borderColor: Utils.lighterColor(0.8, product.title.color),\r\n minWidth: \"unset\",\r\n }}\r\n className={classNames(\r\n \"border flex-center p-1 xs:p-2 bg-transparent\",\r\n {\r\n \"rounded-l rounded-r-none\": rtl,\r\n \"rounded-r rounded-l-none\": !rtl,\r\n \"opacity-50 cursor-not-allowed\":\r\n quantity + 1 > maxQuantity,\r\n }\r\n )}\r\n disabled={quantity + 1 > maxQuantity}\r\n aria-label=\"increase item quantity by one\"\r\n onClick={() => updateItem(+1)}\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-icon=\"plus\"\r\n style={{ height: 12 }}\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 448 512\"\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M448 294.2v-76.4c0-13.3-10.7-24-24-24H286.2V56c0-13.3-10.7-24-24-24h-76.4c-13.3 0-24 10.7-24 24v137.8H24c-13.3 0-24 10.7-24 24v76.4c0 13.3 10.7 24 24 24h137.8V456c0 13.3 10.7 24 24 24h76.4c13.3 0 24-10.7 24-24V318.2H424c13.3 0 24-10.7 24-24z\"\r\n ></path>\r\n </svg>\r\n </button>\r\n </div>\r\n )}\r\n {soldOut && (\r\n <div\r\n className={classNames(\r\n \"item-soldout flex text-red-500 items-center\"\r\n )}\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-icon=\"ban\"\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 512 512\"\r\n className={classNames(\"w-4 h-4\", rtl ? \"ml-1\" : \"mr-1\")}\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M256 8C119.034 8 8 119.033 8 256s111.034 248 248 248 248-111.034 248-248S392.967 8 256 8zm130.108 117.892c65.448 65.448 70 165.481 20.677 235.637L150.47 105.216c70.204-49.356 170.226-44.735 235.638 20.676zM125.892 386.108c-65.448-65.448-70-165.481-20.677-235.637L361.53 406.784c-70.203 49.356-170.226 44.736-235.638-20.676z\"\r\n ></path>\r\n </svg>\r\n <span>Sold out</span>\r\n </div>\r\n )}\r\n </div>\r\n <div\r\n className={classNames(\r\n \"remove-item-container flex items-center hidden\"\r\n )}\r\n >\r\n <button\r\n className={classNames(\r\n \"remove-item border flex-center p-1 xs:p-2 bg-transparent\"\r\n )}\r\n onClick={() => {\r\n update_cart_item({\r\n line,\r\n variant_id: id,\r\n quantity: 0,\r\n });\r\n }}\r\n >\r\n Remove\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n {subscription &&\r\n subscription?.isActive &&\r\n !!plansData &&\r\n !!plansData.subscriptions && (\r\n <div\r\n className={classNames(\"subscription-container mt-2 mb-2 w-full\")}\r\n >\r\n {!selectedSellingPlanID ? (\r\n loadingPlan ? (\r\n <div\r\n className={classNames(\r\n \"subscription-button text-white block m-0 pt-2 pb-2 pl-3 pr-3 w-full leading-5 cursor-pointer shadow-none text-center\"\r\n )}\r\n data-state=\"upgrading\"\r\n style={{\r\n fontSize: `${\r\n subscription.upgradingText?.font_size ?? 0.8\r\n }em`,\r\n fontWeight:\r\n subscription.upgradingText?.font_weight ?? 500,\r\n lineHeight: \"normal\",\r\n color: Utils.formatColor(\r\n subscription.upgradingText?.color ?? {\r\n a: 1,\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n }\r\n ),\r\n backgroundColor: Utils.formatColor(\r\n subscription.loadingBackground ?? {\r\n a: 1,\r\n r: 153,\r\n g: 153,\r\n b: 153,\r\n }\r\n ),\r\n border: `1px solid ${Utils.formatColor(\r\n subscription.loadingBorder ?? {\r\n a: 1,\r\n r: 153,\r\n g: 153,\r\n b: 153,\r\n }\r\n )}`,\r\n }}\r\n >\r\n <span>{subscription.upgradingText?.text}</span>\r\n </div>\r\n ) : (\r\n <button\r\n className={classNames(\r\n \"subscription-button text-white block m-0 pt-2 pb-2 pl-3 pr-3 w-full leading-5 cursor-pointer shadow-none text-center\"\r\n )}\r\n onClick={async () => {\r\n const labels = Object.keys(plansData.subscriptions);\r\n const plans = plansData.subscriptions[labels[0]];\r\n const selling_plan_id = plans[0].external_plan_id;\r\n\r\n // console.log(\"selling_plan_id:\", selling_plan_id);\r\n // console.log(\"upgrading...\");\r\n\r\n if (isPreview) {\r\n setLoadingPlan(true);\r\n return setTimeout(() => {\r\n setSelectedSellingPlanID(selling_plan_id);\r\n setLoadingPlan(false);\r\n }, 1000);\r\n }\r\n\r\n const updateCartItem = async (retry = false) => {\r\n try {\r\n const { item, items } = await new Promise(\r\n (resolve, reject) => {\r\n update_cart_item(\r\n {\r\n line,\r\n variant_id: id,\r\n quantity,\r\n selling_plan: selling_plan_id,\r\n },\r\n (item, items, error) => {\r\n if (error) {\r\n reject(error);\r\n } else {\r\n resolve({ item, items });\r\n }\r\n }\r\n );\r\n }\r\n );\r\n\r\n // Log the successful upgrade and update state\r\n // console.log(\"upgraded successfully\");\r\n setSelectedSellingPlanID(selling_plan_id);\r\n\r\n // Return the items for further use if needed\r\n return { item, items };\r\n } catch (error) {\r\n console.error(\"An error occurred:\", error);\r\n // Retry the update in case of an error if it hasn't retried already\r\n if (!retry) {\r\n console.log(\"Retrying due to error...\");\r\n return await updateCartItem(true);\r\n }\r\n } finally {\r\n setLoadingPlan(false);\r\n }\r\n };\r\n\r\n setLoadingPlan(true);\r\n\r\n // Execute the update logic with an initial attempt\r\n await updateCartItem();\r\n }}\r\n style={{\r\n backgroundColor: Utils.formatColor(\r\n subscription.background\r\n ),\r\n border: `1px solid ${Utils.formatColor(\r\n subscription.border\r\n )}`,\r\n color: Utils.formatColor(subscription.text.color),\r\n fontSize: `${subscription.text.font_size}em`,\r\n fontWeight: subscription.text.font_weight,\r\n lineHeight: \"normal\",\r\n }}\r\n >\r\n <span>\r\n {formatSubsciptionUpgrade(subscription.text.text)}\r\n </span>\r\n </button>\r\n )\r\n ) : loadingPlan ? (\r\n <div\r\n className={classNames(\r\n \"subscription-button text-white block m-0 pt-2 pb-2 pl-3 pr-3 w-full leading-5 cursor-pointer shadow-none text-center\"\r\n )}\r\n data-state=\"downgrading\"\r\n style={{\r\n fontSize: `${\r\n subscription.downgradingText?.font_size ?? 0.8\r\n }em`,\r\n fontWeight:\r\n subscription.downgradingText?.font_weight ?? 500,\r\n lineHeight: \"normal\",\r\n color: Utils.formatColor(\r\n subscription.downgradingText?.color ?? {\r\n a: 1,\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n }\r\n ),\r\n backgroundColor: Utils.formatColor(\r\n subscription.loadingBackground ?? {\r\n a: 1,\r\n r: 153,\r\n g: 153,\r\n b: 153,\r\n }\r\n ),\r\n border: `1px solid ${Utils.formatColor(\r\n subscription.loadingBorder ?? {\r\n a: 1,\r\n r: 153,\r\n g: 153,\r\n b: 153,\r\n }\r\n )}`,\r\n }}\r\n >\r\n <span>{subscription.downgradingText?.text}</span>\r\n </div>\r\n ) : (\r\n <select\r\n className={classNames(\r\n \"subscription-frequency border-gray-200 pt-2 pb-2 pl-3 pr-5 w-full leading-5 shadow-none\"\r\n )}\r\n style={{\r\n backgroundColor: Utils.formatColor(\r\n subscription.subscribedBackground ?? {\r\n a: 1,\r\n r: 255,\r\n g: 255,\r\n b: 255,\r\n }\r\n ),\r\n border: `1px solid ${Utils.formatColor(\r\n subscription.subscribedBorder ?? {\r\n a: 1,\r\n r: 90,\r\n g: 117,\r\n b: 248,\r\n }\r\n )}`,\r\n color: Utils.formatColor(\r\n subscription.subscribedText?.color ?? {\r\n a: 1,\r\n r: 90,\r\n g: 117,\r\n b: 248,\r\n }\r\n ),\r\n fontSize: `${\r\n subscription.subscribedText?.font_size ?? 0.8\r\n }em`,\r\n fontWeight: subscription.subscribedText?.font_weight ?? 500,\r\n backgroundImage:\r\n \"linear-gradient(45deg, transparent 50%, #ccc 50%), linear-gradient(135deg, #ccc 50%, transparent 50%), linear-gradient(to right, #ccc, #ccc)\",\r\n backgroundPosition:\r\n \"calc(100% - 15px) calc(13px), calc(100% - 10px) calc(13px), calc(100% - 2.5em) 0.5em\",\r\n backgroundSize: \"5px 5px, 5px 5px, 1px 1.5em\",\r\n backgroundRepeat: \"no-repeat\",\r\n appearance: \"none\",\r\n lineHeight: \"normal\",\r\n }}\r\n value={selectedSellingPlanID}\r\n onChange={async (event) => {\r\n const value = event.target.value;\r\n const selling_plan_id = value !== \"onetime\" ? value : null;\r\n\r\n // console.log(\"selling_plan_id:\", selling_plan_id);\r\n\r\n if (isPreview) {\r\n if (!value || value === \"onetime\") {\r\n setLoadingPlan(true);\r\n }\r\n return setTimeout(() => {\r\n setSelectedSellingPlanID(selling_plan_id);\r\n setLoadingPlan(false);\r\n }, 1000);\r\n }\r\n\r\n const updateCartItem = async (retry = false) => {\r\n try {\r\n const { item, items } = await new Promise(\r\n (resolve, reject) => {\r\n update_cart_item(\r\n {\r\n line,\r\n variant_id: id,\r\n quantity,\r\n selling_plan: selling_plan_id,\r\n },\r\n (item, items, error) => {\r\n if (error) {\r\n reject(error);\r\n } else {\r\n resolve({ item, items });\r\n }\r\n }\r\n );\r\n }\r\n );\r\n\r\n // If successfully updated, log the result and update state\r\n // const message =\r\n // value === \"onetime\" ? \"downgraded\" : \"updated\";\r\n // console.log(`${message} successfully`);\r\n setSelectedSellingPlanID(selling_plan_id);\r\n\r\n // Return the items for further use if needed\r\n return { item, items };\r\n } catch (error) {\r\n console.error(\"An error occurred:\", error);\r\n // Retry the update in case of an error if it hasn't retried already\r\n if (!retry) {\r\n console.log(\"Retrying due to error...\");\r\n return await updateCartItem(true);\r\n }\r\n } finally {\r\n setLoadingPlan(false);\r\n }\r\n };\r\n\r\n if (!value || value === \"onetime\") {\r\n setLoadingPlan(true);\r\n }\r\n\r\n // Execute the update logic with an initial attempt\r\n await updateCartItem();\r\n }}\r\n >\r\n {/* One-time purchase option */}\r\n {plansData.onetime.length > 0 && (\r\n <optgroup label=\"Pay Full Price\">\r\n {plansData.onetime.map((plan) => (\r\n <option key={plan.id} value=\"onetime\">\r\n One-time only\r\n </option>\r\n ))}\r\n </optgroup>\r\n )}\r\n\r\n {/* Subscription options grouped by discount */}\r\n {Object.keys(plansData.subscriptions).map((groupLabel) => (\r\n <optgroup key={groupLabel} label={groupLabel}>\r\n {plansData.subscriptions[groupLabel].map((plan) => (\r\n <option\r\n key={plan.external_plan_id}\r\n value={plan.external_plan_id}\r\n >\r\n {formatSubsciptionUpgrade(\r\n subscription.subscribedText?.text ??\r\n \"{{selling_plan_name}}\",\r\n groupLabel,\r\n plan.external_plan_name\r\n )}\r\n </option>\r\n ))}\r\n </optgroup>\r\n ))}\r\n </select>\r\n )}\r\n </div>\r\n )}\r\n {!!bundles && !soldOut && !discountCode && !hasAutoDiscount && (\r\n <Bundles\r\n id={id}\r\n line={line}\r\n key={id}\r\n bundles={bundles}\r\n soldOut={{\r\n get: soldOut,\r\n set: (v) => setSoldOut(v),\r\n }}\r\n maxQuantity={{\r\n get: maxQuantity,\r\n set: (v) => setMaxQuantity(v),\r\n }}\r\n itemQuantity={quantity}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default CartItemsList;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"header\":\"items_list_header__2hYjr\",\"item\":\"items_list_item__2KlM7\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"EmptyState\":\"empty_state_EmptyState__39alv\",\"illustration\":\"empty_state_illustration__2YW3A\",\"details\":\"empty_state_details__1aWkY\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"qte\":\"sticky_cart_feature_preview_qte__p8EnI\",\"label\":\"sticky_cart_feature_preview_label__viS5u\",\"minus\":\"sticky_cart_feature_preview_minus__CwXR6\",\"map_select_containar\":\"sticky_cart_feature_preview_map_select_containar__dxw_Z\",\"map_select\":\"sticky_cart_feature_preview_map_select__1AuCw\",\"list\":\"sticky_cart_feature_preview_list__2Rq3o\",\"option\":\"sticky_cart_feature_preview_option__3fSRX\",\"focus\":\"sticky_cart_feature_preview_focus__2VmCf\",\"selected\":\"sticky_cart_feature_preview_selected__38qJJ\",\"disabled\":\"sticky_cart_feature_preview_disabled__ptUFw\",\"current\":\"sticky_cart_feature_preview_current__3ziWG\",\"desktopStickyCartContainar\":\"sticky_cart_feature_preview_desktopStickyCartContainar__2P6VA\",\"curvy\":\"sticky_cart_feature_preview_curvy__AdioQ\",\"atc\":\"sticky_cart_feature_preview_atc__1FI3o\",\"image\":\"sticky_cart_feature_preview_image__1db5T\",\"detailsSection\":\"sticky_cart_feature_preview_detailsSection__NfdTv\",\"details\":\"sticky_cart_feature_preview_details__3EkjT\",\"price\":\"sticky_cart_feature_preview_price__2Yzl8\",\"oldPrice\":\"sticky_cart_feature_preview_oldPrice__lTwcV\",\"title\":\"sticky_cart_feature_preview_title__3JulC\",\"actionsSection\":\"sticky_cart_feature_preview_actionsSection__kyg7B\",\"input\":\"sticky_cart_feature_preview_input__PDySe\",\"dropdown\":\"sticky_cart_feature_preview_dropdown__61Xd-\",\"background\":\"sticky_cart_feature_preview_background__3mROG\",\"mobileStickyCartContainar\":\"sticky_cart_feature_preview_mobileStickyCartContainar__1qok8\",\"infos\":\"sticky_cart_feature_preview_infos__2kR1S\",\"cart\":\"sticky_cart_feature_preview_cart__3dHfD\",\"header\":\"sticky_cart_feature_preview_header__3EUXV\",\"txt\":\"sticky_cart_feature_preview_txt__zfsQu\",\"close\":\"sticky_cart_feature_preview_close__18EVx\",\"body\":\"sticky_cart_feature_preview_body__1_lQN\",\"row\":\"sticky_cart_feature_preview_row__3ZKn5\"};","import Api from './Api';\r\nimport pSBC from 'shade-blend-color';\r\nimport getCampaign from 'hooks/useCampaign';\r\nimport { rgbaToHex } from 'hex-and-rgba';\r\nimport Decimal from 'decimal.js';\r\nimport { log } from 'xstate/lib/actions';\r\nimport { API_GATEWAY_NEW } from 'aws-exports';\r\nimport Axios from 'axios';\r\n// import ISO6391 from \"iso-639-1\";\r\n\r\nexport const get_product_by_handle = (shop_url, product_handle) =>\r\n Api.get(`https://${shop_url}/products/${product_handle}.json?fields=variants`);\r\n\r\nexport const getGoal = ({ oldGoal, specific_goals, byQuantity, inCents = false }) => {\r\n const cents = inCents ? 100 : 1;\r\n const rate = window.Shopify?.currency?.rate ?? 1;\r\n const multiplier = (value) =>\r\n value *\r\n (byQuantity || Number(rate) * cents);\r\n if (!specific_goals) return oldGoal ? multiplier(oldGoal) : 0;\r\n const goal = specific_goals.find(\r\n ({ currency }) => currency === window.Shopify.currency.active\r\n )?.goal;\r\n if (goal) return inCents ? goal * 100 : goal;\r\n return multiplier(specific_goals.find(({ main }) => main === true).goal);\r\n};\r\n\r\nconst formHasFile = (formData, variant_id) => {\r\n let hasFile = false;\r\n\r\n if (!formData) {\r\n return false;\r\n }\r\n const entriesIsFunction = typeof formData.entries === 'function';\r\n\r\n const getEntries = () => (entriesIsFunction ? formData.entries() : formData.entries);\r\n for (const [name, type] of getEntries()) {\r\n if (type instanceof File) {\r\n hasFile = true;\r\n window.mu_form_files[variant_id] = [\r\n ...new Set(\r\n (window.mu_form_files[variant_id] || []).concat([\r\n name.replace('properties[', '').replace(']', '')\r\n ])\r\n )\r\n ];\r\n // localStorage.setItem(\r\n // \"mu_form_files\",\r\n // JSON.stringify(window.mu_form_files)\r\n // );\r\n }\r\n }\r\n return hasFile;\r\n};\r\n\r\nexport function getLangPath(path) {\r\n const { origin } = window.location;\r\n let langPath = '/';\r\n // const pathArray = window.location.pathname.replace(/^\\//, \"\").split(\"/\");\r\n if (window.Shopify?.routes?.root) {\r\n langPath = window.Shopify.routes.root;\r\n }\r\n // else if (pathArray.length && ISO6391.validate(pathArray[0])) {\r\n // langPath = `/${pathArray[0]}/`;\r\n // }\r\n return `${origin}${langPath}${path}`;\r\n}\r\n\r\nexport function GetCartLevelAutoDiscount({ cart_level_discount_applications = [] }, types = ['automatic', '']) {\r\n const discount = cart_level_discount_applications?.find((discount) =>{\r\n if(discount.discount_application){\r\n discount = discount.discount_application\r\n }\r\n const {type,total_allocated_amount} = discount\r\n return types.includes(type) && total_allocated_amount > 0\r\n });\r\n if(!discount) return undefined\r\n return discount.discount_application || discount\r\n}\r\n\r\nexport function GetDiscountFromCheckoutPage(serializedGraphqlString) {\r\n try {\r\n const ParsedGraphql = JSON.parse(serializedGraphqlString);\r\n for (let key in ParsedGraphql)\r\n if (ParsedGraphql[key]?.session?.negotiate?.result?.sellerProposal) {\r\n const result = ParsedGraphql[key].session.negotiate.result;\r\n const errorMessage =\r\n ParsedGraphql[key].session.negotiate.errors.find(\r\n (error) => 'DISCOUNTS_NOT_FOUND' === error.code\r\n )?.localizedMessage || null;\r\n const { subtotalBeforeReductions, runningTotal, merchandiseDiscount } = result.sellerProposal;\r\n const discountCode = merchandiseDiscount?.lines[0]?.discount?.code;\r\n const OriginalTotal = new Decimal(subtotalBeforeReductions.value.amount)\r\n .mul(100)\r\n .toNumber();\r\n const NewTotal = new Decimal(runningTotal.value.amount).mul(100).toNumber();\r\n const discountValue = new Decimal(OriginalTotal).minus(NewTotal).toNumber();\r\n return {\r\n errorMessage,\r\n discountValue,\r\n discountCode\r\n };\r\n }\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}\r\n\r\nexport function CartHasAutoDiscount(cart) {\r\n const hasItemLevelAutoDiscount = cart.items.some(\r\n ({ discounts, line_level_discount_allocations }) => {\r\n const hasDiscount = !!discounts?.length;\r\n if (!hasDiscount) return false;\r\n const hasAutoDiscount = line_level_discount_allocations?.find(\r\n ({ discount_application }) => ['automatic', ''].includes(discount_application?.type)\r\n );\r\n return !!hasAutoDiscount;\r\n }\r\n );\r\n const hasCartLevelAutoDiscount = cart.cart_level_discount_applications?.some((discount) =>\r\n ['automatic', ''].includes(discount?.type)\r\n );\r\n return hasItemLevelAutoDiscount || hasCartLevelAutoDiscount;\r\n}\r\n\r\nexport function getCartLink() {\r\n return getLangPath(window.mu_use_cart_json ? 'cart.json' : 'cart.js');\r\n}\r\n\r\nexport const addToCart = (\r\n {\r\n variant_id,\r\n quantity,\r\n properties,\r\n selling_plan,\r\n currency,\r\n // props below are required for preview\r\n isPreview = false,\r\n shop_url = null,\r\n product_handle = null,\r\n product = null\r\n },\r\n formData\r\n) => {\r\n if (Array.isArray(selling_plan)) {\r\n selling_plan = selling_plan[0];\r\n }\r\n else if (typeof selling_plan === 'string'){\r\n selling_plan = Number.isNaN(parseInt(selling_plan)) ? undefined : parseInt(selling_plan);\r\n }\r\n const hasFile = formHasFile(formData, variant_id);\r\n if (isPreview) {\r\n variant_id = parseVariantId(variant_id);\r\n if (product) {\r\n const { id, image, title: product_title, variants } = product;\r\n const variant = variants.find(({ id }) => id === variant_id);\r\n const price = parseFloat((parseFloat(variant.price) * 100).toFixed(0));\r\n return Promise.resolve({\r\n ...variant,\r\n price,\r\n product_title,\r\n product_id: parseInt(id),\r\n image,\r\n quantity\r\n });\r\n }\r\n return new Promise((resolve, reject) => {\r\n get_product_by_handle(shop_url, product_handle)\r\n .then(({ data }) => {\r\n const { variants, title, images } = data.product;\r\n const variant = variants.find(({ id }) => id === parseInt(variant_id));\r\n const image = variant.image_id\r\n ? images.find(({ id }) => variant.image_id).src\r\n : data.product.image.src;\r\n const price = parseFloat((parseFloat(variant.price) * 100).toFixed(0));\r\n resolve({ ...variant, price, product_title: title, image, quantity });\r\n })\r\n .catch(reject);\r\n });\r\n } else {\r\n if (Array.isArray(variant_id)) {\r\n variant_id = variant_id.map(parseVariantId).filter((singleId) => !isNaN(singleId));\r\n if (variant_id.length == 1) variant_id = variant_id[0];\r\n\r\n if (variant_id.length == 0) return;\r\n }\r\n variant_id = parseVariantId(variant_id);\r\n return new Promise((resolve, reject) => {\r\n Api.post(\r\n getLangPath(`cart/add.js?m=true&shop=${window.Shopify.shop}`),\r\n hasFile\r\n ? formData\r\n : Array.isArray(variant_id)\r\n ? {\r\n items: variant_id.map((singleId) => ({\r\n quantity,\r\n id: parseVariantId(singleId)\r\n }))\r\n }\r\n : {\r\n quantity,\r\n id: parseVariantId(variant_id),\r\n properties,\r\n selling_plan\r\n }\r\n )\r\n .then(({ data }) => {\r\n if (window.ttq && !window.mu_disable_tiktok_tracking) {\r\n window.ttq.track('AddToCart', {\r\n contents: [\r\n {\r\n content_type: 'product',\r\n content_name: data.title,\r\n content_id: data.product_id,\r\n quantity: data.quantity,\r\n price: data.price / 100\r\n }\r\n ],\r\n value: data.price / 100,\r\n currency\r\n });\r\n }\r\n\r\n Api.get(getCartLink()).then(({ data }) => {\r\n resolve(data);\r\n });\r\n })\r\n .catch(reject);\r\n });\r\n }\r\n};\r\n\r\nexport const findItem = ({ line, items, variant_id }) => {\r\n return items.find(({ variant_id: id }, index) =>\r\n line ? line === index + 1 : id ? id.toString() == variant_id.toString() : false\r\n );\r\n};\r\n\r\nexport const updateCartItem = ({\r\n variant_id,\r\n line,\r\n quantity,\r\n properties,\r\n selling_plan,\r\n isPreview = false,\r\n state = null\r\n}) => {\r\n if (Array.isArray(selling_plan)) {\r\n selling_plan = selling_plan[0];\r\n }\r\n if (isPreview) {\r\n if (quantity === 0 && state.items.length === 1) {\r\n return Promise.resolve(state.items);\r\n }\r\n const stateCopy = { ...state };\r\n const newItems = stateCopy.items.map((item) => {\r\n if (item.id === variant_id) {\r\n return { ...item, quantity };\r\n }\r\n return item;\r\n });\r\n return Promise.resolve(newItems.filter(({ quantity }) => quantity > 0));\r\n } else {\r\n return new Promise((resolve, reject) => {\r\n Api.post(getLangPath(`cart/change.js?m=true&shop=${window.Shopify.shop}`), {\r\n quantity,\r\n properties,\r\n selling_plan,\r\n id: line ? undefined : parseVariantId(variant_id).toString(),\r\n line\r\n })\r\n .then(({ data }) => {\r\n const { items, cart_level_discount_applications } = {\r\n ...data,\r\n items: data.items.map((item) => ({\r\n ...item,\r\n // price: item.line_price ? (item.line_price / item.quantity):item.price,\r\n // original_price: item.original_line_price ? (item.original_line_price / item.quantity) : item.original_price\r\n })),\r\n };\r\n resolve({ items, cart_level_discount_applications });\r\n })\r\n\r\n .catch(reject);\r\n });\r\n }\r\n};\r\n\r\nexport const getBundleDiscount = ({ reward, type }, quantity, price, money_format) => {\r\n quantity = parseInt(quantity);\r\n reward = parseFloat(reward);\r\n const discounted = calculateDiscount({\r\n type,\r\n reward,\r\n total: price * quantity\r\n });\r\n return {\r\n plain: price * quantity - discounted,\r\n formatted: formatMoney(price * quantity - discounted, money_format),\r\n discounted\r\n };\r\n};\r\n\r\nexport const sortByProp = (prop, order = 'desc') => {\r\n return (array) => {\r\n return [...array].sort(function (a, b) {\r\n var x = a[prop];\r\n var y = b[prop];\r\n if (order === 'desc') {\r\n return x > y ? -1 : x < y ? 1 : 0;\r\n } else {\r\n return y > x ? -1 : y < x ? 1 : 0;\r\n }\r\n });\r\n };\r\n};\r\n\r\nexport const sortByQuantity = sortByProp('quantity');\r\n\r\nexport const isMobile = () => {\r\n const a = navigator.userAgent || navigator.vendor || window.opera;\r\n return (\r\n /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(\r\n a\r\n ) ||\r\n /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(\r\n a.substr(0, 4)\r\n )\r\n );\r\n};\r\n\r\nexport const calculateDiscount = ({ reward, type, total }) => {\r\n switch (type) {\r\n case 'fixed_amount':\r\n return Math.abs(reward) * 100 * Number(window.Shopify.currency.rate);\r\n case 'percentage':\r\n return Math.floor((total * Math.abs(reward)) / 100);\r\n default:\r\n return 0;\r\n }\r\n};\r\n\r\nexport function formatWithDelimiters(number, precision = 2, thousands = ',', decimal = '.', noMarketsRounding = false) {\r\n if (isNaN(number) || number == null) {\r\n return 0;\r\n }\r\n\r\n number = number / 100.0;\r\n if (window.mu_market_rounding && !noMarketsRounding) number = Math.ceil(number);\r\n number = number.toFixed(precision);\r\n\r\n const parts = number.split('.');\r\n const dollars = parts[0].replace(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/g, '$1' + thousands);\r\n const cents = parts[1] ? decimal + parts[1] : '';\r\n return dollars + cents;\r\n}\r\n\r\nexport const formatMoney = (n, money_format = '${{amount}}', formatter = formatWithDelimiters) => {\r\n const formattedMoney = money_format\r\n .replace(/{{\\s*?amount\\s*?}}/g, formatter(n, 2))\r\n .replace(/{{\\s*?amount_with_decimal_separator\\s*?}}/g, formatter(n, 2))\r\n .replace(/{{\\s*?amount_no_decimals\\s*?}}/g, formatter(n, 0))\r\n .replace(/{{\\s*?amount_with_comma_separator\\s*?}}/g, formatter(n, 2, '.', ','))\r\n .replace(/{{\\s*?amount_no_decimals_with_comma_separator\\s*?}}/g, formatter(n, 0, '.', ','))\r\n .replace(/{{\\s*?amount_with_apostrophe_separator\\s*? }}/g, formatter(n, 2, \"'\", '.'));\r\n return window.mu_after_format_money\r\n ? window.mu_after_format_money(formattedMoney)\r\n : formattedMoney;\r\n}\r\n\r\nexport const logError = (error) => {\r\n //log errors to bugSnag\r\n console.log('Monster error:', error);\r\n};\r\n\r\nexport function getVariantPrice({ isPreview, cart_currency, variant, plansData }) {\r\n if(plansData) {\r\n const selected_variant = plansData.variants?.find((v) => v.id === variant.id);\r\n if(selected_variant) {\r\n const subscription_first =\r\n selected_variant.requires_selling_plan || window.mu_fbt_sub_first;\r\n const { selling_plan_allocations } = selected_variant;\r\n const price = selling_plan_allocations?.[0]?.price;\r\n if (subscription_first && price) {\r\n return window.mu_market_rounding\r\n ? Math.ceil(price / 100)\r\n : price / 100;\r\n }\r\n }\r\n }\r\n const activeCurrency = isPreview ? cart_currency : window.Shopify.currency.active;\r\n const rate = isPreview || window.mu_stop_shopify_rate ? 1 : Number(window.Shopify.currency.rate);\r\n \r\n let unformattedPrice;\r\n\r\n const presentmentPrices = variant?.presentmentPrices || variant?.presentment_prices;\r\n\r\n if (Array.isArray(presentmentPrices)) {\r\n const foundPrice = presentmentPrices.find(\r\n ({ price }) => price.currency_code == activeCurrency\r\n );\r\n unformattedPrice = foundPrice ? Number(foundPrice.price.amount) : Number(variant.price) * rate;\r\n } else {\r\n unformattedPrice = presentmentPrices && presentmentPrices[activeCurrency]\r\n ? Number(presentmentPrices[activeCurrency].price)\r\n : Number(variant.price) * rate;\r\n }\r\n if (window.mu_stop_presentment) {\r\n unformattedPrice = Number(variant.price) * rate;\r\n } else {\r\n unformattedPrice = Number(unformattedPrice.toFixed(2));\r\n }\r\n \r\n return window.mu_market_rounding ? Math.ceil(unformattedPrice) : unformattedPrice;\r\n}\r\n\r\n\r\nexport const getAddedGifts = ({ goal, productAddedToCart }) => {\r\n let { products, product } = goal.gift;\r\n if (!products) {\r\n products = product ? [{ variants: [{ id: product.variant_id }] }] : [];\r\n }\r\n return products\r\n .map(({ variants }) => variants)\r\n .flat()\r\n .filter((variant) => productAddedToCart(variant, true));\r\n};\r\n\r\nexport const productHasOneVariant = (product) => {\r\n const { variants } = product;\r\n return variants.length === 1;\r\n // return options.every(({ values }) => values.length === 1);\r\n};\r\n\r\nexport const variantIsOnStock = (variant) => {\r\n const { inventory_management, inventory_quantity, inventory_policy } = variant;\r\n return inventory_management && inventory_policy === 'deny' ? inventory_quantity >= 1 : true;\r\n};\r\n\r\nexport const getMaxQuantity = (variant) => {\r\n const { inventory_management, inventory_quantity, inventory_policy } = variant;\r\n return inventory_management && inventory_policy === 'deny' ? inventory_quantity : Infinity;\r\n}\r\n\r\nexport const parseProductId = (string) => {\r\n // example gid://shopify/ProductVariant/19566771404862\r\n const pattern = new RegExp('gid://shopify/Product/([0-9]+)$');\r\n if (pattern.test(string)) return parseInt(string.match(pattern)[1]); \r\n return string;\r\n};\r\n\r\nexport const parseVariantId = (string) => {\r\n // example gid://shopify/ProductVariant/19566771404862\r\n const pattern = new RegExp('gid://shopify/ProductVariant/([0-9]+)$');\r\n if (pattern.test(string)) return parseInt(string.match(pattern)[1]);\r\n return string;\r\n};\r\n\r\nconst add = (x, y) => x + y;\r\n\r\nexport const getTotal = (items, products=[]) => {\r\n const initialValue = window.mu_shipProtectSelected\r\n ? window.mu_shipProtectPrice\r\n : 0;\r\n // console.log(initialValue, window.mu_shipProtectSelected , window.mu_shipProtectPrice);\r\n return items.length\r\n ? items\r\n .filter(\r\n ({ product_type, price }) =>\r\n !(\r\n [\"free_gift\", \"singleton_gift\"].includes(\r\n product_type?.toLowerCase()\r\n ) && price === 0\r\n )\r\n )\r\n .map(\r\n ({\r\n product_id,\r\n variant_id,\r\n price,\r\n quantity,\r\n selling_plan_allocation,\r\n }) => {\r\n const selectedProduct = products.find(({ id }) => id == product_id);\r\n const selectedVariant = selectedProduct?.variants?.find(\r\n ({ id }) => id == variant_id\r\n );\r\n\r\n const itemPrice =\r\n selectedVariant && !selling_plan_allocation\r\n ? Number(selectedVariant.price) * 100\r\n : price;\r\n\r\n return itemPrice * quantity;\r\n }\r\n )\r\n .reduce(add, initialValue)\r\n : initialValue;\r\n};\r\n\r\nexport function sortBundles(bundles) {\r\n return [...bundles].sort((a, b) => a.quantity - b.quantity);\r\n}\r\nexport function BundlesIndexMap(bundles) {\r\n return [...bundles].reduce((acc, cur, index) => {\r\n const { quantity } = cur;\r\n const next = bundles[index + 1];\r\n const quantityDeference = next ? next.quantity - quantity : 1;\r\n acc[quantity] = index;\r\n if (quantityDeference > 1) {\r\n for (let i = 1; i < quantityDeference; i++) {\r\n acc[quantity + i] = index;\r\n }\r\n }\r\n return acc;\r\n }, {});\r\n}\r\n\r\nexport const extractContent = (s) => {\r\n var span = document.createElement('span');\r\n span.innerHTML = s;\r\n return span.textContent || span.innerText;\r\n};\r\nexport const getCompareAtDiscount = ({ filteredItems, compareAtMap, products }) => {\r\n const compareAtDiscount = [...filteredItems.filter((item) => !window.mu_exclude_free_gift_price || item.product_type != \"free_gift\")].reduce((acc, { product_id, variant_id, price, quantity }) => {\r\n const selectedVariant = products?.find(({ id }) => id == product_id)?.variants?.find(({ id }) => id == variant_id);\r\n let rate = window.mu_stop_shopify_rate ? 1 : parseFloat(window.Shopify.currency.rate);\r\n let compare_at = selectedVariant ? Number(selectedVariant.compare_at_price)*100 : (compareAtMap && compareAtMap[variant_id] !== price && compareAtMap[variant_id]);\r\n compare_at = window.mu_market_rounding ? Math.ceil(\r\n compare_at\r\n ): compare_at;\r\n if (!compare_at) return acc;\r\n if (window.mu_handle_compareAt) compare_at = window.mu_handle_compareAt(variant_id, quantity, price, compare_at);\r\n const discount = new Decimal(compare_at).minus(price).times(quantity).toNumber();\r\n return acc + discount;\r\n }, 0);\r\n return compareAtDiscount;\r\n};\r\n\r\nexport function GetCartLineItemDiscount(item, checkAgainst = ['automatic', '']) {\r\n return item.line_level_discount_allocations?.filter(({ discount_application }) =>\r\n checkAgainst.includes(discount_application?.type)\r\n ).reduce((acc, { amount }) => acc + amount, 0);\r\n}\r\n\r\nexport function FilterAtuGoals(goals, hasAutoDiscount) {\r\n return hasAutoDiscount ? goals.filter(({ reward_type }) => reward_type !== 'discount') : goals;\r\n}\r\n\r\nfunction itemHasAutoDiscount({ discounted_price, price }) {\r\n return discounted_price !== price;\r\n}\r\n\r\nexport function GetPresentableItemsList(items) {\r\n const reversedItems = [...items].reverse();\r\n \r\n return reversedItems.reduce((acc, item, index) => {\r\n const line = items.length - index;\r\n const existingItemIndex = acc.findIndex(\r\n ({ variant_id, selling_plan_allocation, properties }) =>\r\n variant_id === item.variant_id &&\r\n selling_plan_allocation === item.selling_plan_allocation &&\r\n properties === item.properties\r\n );\r\n if (existingItemIndex === -1) {\r\n return acc.concat([{ ...item, line }]);\r\n }\r\n const existingItem = acc[existingItemIndex];\r\n // const oneItemIsAGift = [existingItem, item].some(isAutoDiscountGift)\r\n const oneItemHasADiscount = [existingItem, item].some(itemHasAutoDiscount);\r\n if (oneItemHasADiscount) {\r\n return acc.concat([{ ...item, line }]);\r\n }\r\n acc[existingItemIndex] = Object.assign({}, existingItem, {\r\n // price: existingItem.price + item.price,\r\n discounted_price: existingItem.discounted_price + item.discounted_price,\r\n quantity: existingItem.quantity + item.quantity,\r\n line_quantity: item.quantity,\r\n line\r\n });\r\n return acc;\r\n }, []);\r\n}\r\n\r\nexport function getAutoDiscounts({items,cart_level_discount_applications = []}) {\r\n // look for automatic discounts\r\n const ItemLevelAutoDiscount = items.map(i => GetCartLineItemDiscount(i)).reduce((a, b) => a + b, 0);\r\n const CartLevelAutoDiscount = GetCartLevelAutoDiscount({cart_level_discount_applications}, ['automatic', ''])?.total_allocated_amount || 0;\r\n return {\r\n ItemLevelAutoDiscount,\r\n CartLevelAutoDiscount,\r\n totalAutoDiscount: ItemLevelAutoDiscount + CartLevelAutoDiscount\r\n }\r\n}\r\n\r\nexport const getDiscount = ({\r\n campaigns,\r\n items,\r\n cart_level_discount_applications = [],\r\n total,\r\n filteredItems,\r\n filteredItemsTotal,\r\n discountCode,\r\n getBundlesOnly = false\r\n}) => {\r\n // const ItemLevelTotalDiscount = discountCode?.value ? 0 : window.mu_use_new_discount_calculation ? items.map( i => GetCartLineItemDiscount(i, ['discount_code'])).reduce((a, b) => a + b, 0) : items.reduce((total, item) => {\r\n // return total + (item.total_discount || 0);\r\n // }, 0);\r\n const ItemLevelTotalDiscount = window.mu_use_new_discount_calculation ? items.map( i => GetCartLineItemDiscount(i, ['discount_code'])).reduce((a, b) => a + b, 0) : items.reduce((total, item) => {\r\n return total + (item.total_discount || 0);\r\n }, 0);\r\n // const CartLevelDiscountCode = GetCartLevelAutoDiscount({cart_level_discount_applications}, ['discount_code'])?.totalAutoDiscount || discountCode?.value || 0;\r\n const CartLevelDiscountCode = GetCartLevelAutoDiscount({cart_level_discount_applications}, ['discount_code'])?.totalAutoDiscount || 0;\r\n // look for automatic discounts\r\n const { ItemLevelAutoDiscount, CartLevelAutoDiscount, totalAutoDiscount } = getAutoDiscounts({items,cart_level_discount_applications})\r\n\r\n const totalAppliedDiscounts = items.reduce((total, { discounts = [] }) => {\r\n return total + discounts.reduce((acc, discount) => acc + discount.amount, 0);\r\n }, 0);\r\n\r\n if(window.mu_use_totalAppliedDiscounts && totalAppliedDiscounts) return totalAppliedDiscounts;\r\n \r\n if ((CartLevelDiscountCode || ItemLevelTotalDiscount) && !totalAutoDiscount) {\r\n return CartLevelDiscountCode + ItemLevelTotalDiscount\r\n }\r\n else if (totalAutoDiscount)\r\n return totalAutoDiscount + (CartLevelDiscountCode || 0) + (window.mu_use_new_discount_calculation ? ItemLevelTotalDiscount || 0 : 0);\r\n if (!campaigns || !Object.keys(campaigns).length) return ItemLevelTotalDiscount;\r\n const calculatedCampaignsTypes = [];\r\n const countedBundles = []\r\n const bundlesDiscounts = [...items].reverse().reduce((acc, item) => {\r\n const { product_id } = item;\r\n const product_bundles_campaign = (campaigns[product_id] || []).find(\r\n ({ type }) => type === 'bundles'\r\n );\r\n if (product_bundles_campaign && !countedBundles.includes(product_id)) {\r\n countedBundles.push(product_id)\r\n const { bundles } = product_bundles_campaign;\r\n const productItems = items.filter(i => i.product_id === product_id);\r\n const quantity = productItems.reduce((acc,{quantity}) => acc + quantity, 0)\r\n const productTotal = productItems.reduce((acc,{price, quantity}) => acc + (price * quantity), 0)\r\n // const item = items.find((item) => item.product_id === product_id);\r\n // if (!item) return 0;\r\n const bundlesIndexMap = BundlesIndexMap(sortBundles(bundles.list));\r\n const maxQuantity = Math.max(...Object.keys(bundlesIndexMap).map(Number));\r\n let selectedBundle = bundlesIndexMap[quantity];\r\n if (selectedBundle === undefined && quantity > maxQuantity) {\r\n selectedBundle = bundlesIndexMap[maxQuantity];\r\n }\r\n const bundle = bundles.list[selectedBundle];\r\n const bundles_discount = bundle ? calculateReward(bundle, productTotal) : 0;\r\n acc += bundles_discount;\r\n }\r\n return acc;\r\n }, 0);\r\n if (getBundlesOnly) return bundlesDiscounts;\r\n const [add_to_unlock_product_id, add_to_unlock] = getCampaign('add_to_unlock')(\r\n campaigns,\r\n items\r\n );\r\n let atuDiscount = 0;\r\n const totalWithBundlesDiscount = filteredItemsTotal - bundlesDiscounts;\r\n const quantityCount = filteredItems.reduce((acc, cur) => {\r\n return acc + Number(cur.quantity);\r\n }, 0);\r\n if (add_to_unlock && add_to_unlock?.isActive) {\r\n const discounts = add_to_unlock.goals.filter(\r\n ({ reward_type, goal: oldGoal, specific_goals }) => {\r\n const goal = getGoal({\r\n oldGoal,\r\n specific_goals,\r\n byQuantity: add_to_unlock.multi_goal_type === 'quantity'\r\n });\r\n let unlocked = false;\r\n if (add_to_unlock.multi_goal_type === 'amount') {\r\n unlocked = totalWithBundlesDiscount >= goal * 100;\r\n } else if (add_to_unlock.multi_goal_type === 'quantity') {\r\n unlocked = quantityCount >= goal;\r\n }\r\n return reward_type === 'discount' && unlocked;\r\n }\r\n );\r\n atuDiscount = discounts.reduce((acc, cur) => {\r\n const add_to_unlock_discount = calculateReward(cur.discount, totalWithBundlesDiscount);\r\n if (add_to_unlock_discount > acc) {\r\n acc = add_to_unlock_discount;\r\n }\r\n return acc;\r\n }, 0);\r\n }\r\n return bundlesDiscounts + (window.round_atuDiscount\r\n ? Math.round(atuDiscount/100)*100\r\n : atuDiscount);\r\n};\r\n\r\nexport const getModules = (campaign, cart_settings) => {\r\n return campaign ? campaign.settings.modules : cart_settings.modules;\r\n};\r\n\r\nconst calculateReward = ({ type, reward }, total) => {\r\n return Math.floor(calculateDiscount({ reward, type, total }));\r\n};\r\n\r\nconst percentage = (partialValue, totalValue) => {\r\n return Math.floor((totalValue / 100) * partialValue);\r\n};\r\n\r\nconst lightOrDark = (color) => {\r\n color = formatColor(color);\r\n var r, g, b, hsp;\r\n if (color.match(/^rgb/)) {\r\n color = color.match(/^rgba?\\((\\d+),\\s*(\\d+),\\s*(\\d+)(?:,\\s*(\\d+(?:\\.\\d+)?))?\\)$/);\r\n r = color[1];\r\n g = color[2];\r\n b = color[3];\r\n } else {\r\n color = +('0x' + color.slice(1).replace(color.length < 5 && /./g, '$&$&'));\r\n r = color >> 16;\r\n g = (color >> 8) & 255;\r\n b = color & 255;\r\n }\r\n hsp = Math.sqrt(0.299 * (r * r) + 0.587 * (g * g) + 0.114 * (b * b));\r\n return hsp > 127.5 ? 'light' : 'dark';\r\n};\r\n\r\nexport const formatColor = (color, alpha = null) =>\r\n !!color\r\n ? typeof color === 'string'\r\n ? color\r\n : `rgba(${color?.r},${color?.g},${color?.b},${alpha || color?.a})`\r\n : undefined;\r\n\r\nexport function formatColorHex(color) {\r\n const { r, g, b } = color;\r\n return rgbaToHex(r, g, b);\r\n}\r\n\r\nexport function RGBToHex(r, g, b) {\r\n r = r.toString(16);\r\n g = g.toString(16);\r\n b = b.toString(16);\r\n\r\n if (r.length == 1) r = '0' + r;\r\n if (g.length == 1) g = '0' + g;\r\n if (b.length == 1) b = '0' + b;\r\n\r\n return '#' + r + g + b;\r\n}\r\nexport const colorAutoBlend = (percentage, color) => {\r\n switch (lightOrDark(color)) {\r\n case 'light':\r\n return darkerColor(percentage, formatColor(color));\r\n case 'dark':\r\n return lighterColor(percentage, formatColor(color));\r\n }\r\n};\r\nexport const lighterColor = (percentage, color, blend = '#fff') => {\r\n color = formatColor(color);\r\n return pSBC(percentage, color, blend, true);\r\n};\r\nexport const darkerColor = (percentage, color, blend = '#000') => {\r\n color = formatColor(color);\r\n return pSBC(-percentage, color, blend, true);\r\n};\r\n\r\nexport const fakePreviewProducts = (price = '20.00', index = 0) => [\r\n {\r\n isExample: true,\r\n handle: 'example-product',\r\n id: index.toString(),\r\n options: [\r\n {\r\n id: 0,\r\n product_id: index.toString(),\r\n name: 'Title',\r\n position: 1,\r\n values: ['Default Title']\r\n }\r\n ],\r\n images: [\r\n {\r\n src: 'https://cdn.pixabay.com/photo/2017/01/25/17/35/picture-2008484_1280.png'\r\n }\r\n ],\r\n title: 'Example product',\r\n variants: [\r\n {\r\n id: 1,\r\n product_id: index.toString(),\r\n image: null,\r\n price: price,\r\n featured_image: {\r\n src: 'https://cdn.pixabay.com/photo/2017/01/25/17/35/picture-2008484_1280.png'\r\n },\r\n title: 'Default Title',\r\n quantity: 20,\r\n inventory_policy: 'continue',\r\n\r\n inventory_management: null,\r\n inventory_quantity: 1,\r\n old_inventory_quantity: 1\r\n }\r\n ],\r\n variant_id: 1\r\n }\r\n];\r\n\r\nexport const em = (font_size) => `${font_size}em`;\r\n\r\nexport function hasParentWithMatchingSelector(target, selector) {\r\n return [...document.querySelectorAll(selector)].some(\r\n (el) => el !== target && el.contains(target)\r\n );\r\n}\r\n\r\nexport async function getScriptStatus(shop, origin, callback) {\r\n try {\r\n const { data } = await Axios.get(\r\n `${API_GATEWAY_NEW}/storeFront?shop=${shop}&manual_setup=true&origin=${origin}`\r\n );\r\n let isScript =\r\n data.includes(\"/cart_renderer.gz.js\") ||\r\n data.includes(\"/cart_renderer.js\");\r\n return callback(isScript);\r\n } catch (error) {\r\n return callback(false, true);\r\n }\r\n};\r\n\r\nexport async function getShopProducts() {\r\n try {\r\n if (window.mu_stop_json_products) return [];\r\n const totalPages = window.mu_get_all_products ? Number(window.mu_get_all_products) : 1;\r\n const requests = [];\r\n\r\n // Create an array of requests for each page\r\n for (let page = 1; page <= totalPages; page++) {\r\n requests.push(\r\n Axios.get(getLangPath(`products.json?limit=250&page=${page}`))\r\n );\r\n }\r\n // Fetch all pages concurrently\r\n const responses = await Promise.all(requests);\r\n const products = responses.flatMap(\r\n (response) => response.data?.products ?? []\r\n );\r\n return products;\r\n } catch (error) {\r\n console.error(\"Error fetching multiple pages:\", error);\r\n return [];\r\n }\r\n};\r\n\r\nconst getRechargeSubscriptionsData = async (productId, isPreview) => {\r\n try {\r\n const response = await fetch(\r\n `https://static.rechargecdn.com/store/${\r\n isPreview ? \"monsterapps-beta.myshopify.com\" : window.Shopify.shop\r\n }/product/2022-06/${productId}.json`\r\n );\r\n if (!response.ok) {\r\n console.error(\"Failed to fetch Recharge subscription data\");\r\n return null;\r\n }\r\n const data = await response.json();\r\n if (\r\n data &&\r\n data.product &&\r\n data.product.plans &&\r\n data.product.plans.length\r\n ) {\r\n const plans = data.product.plans;\r\n const groupedPlans = {\r\n onetime: [],\r\n subscriptions: {},\r\n };\r\n\r\n plans.reverse().forEach((plan) => {\r\n if (plan.type === \"onetime\") {\r\n groupedPlans.onetime.push(plan);\r\n } else if (plan.type === \"subscription\") {\r\n const discountLabel = `Subscribe and Save ${plan.discount_amount}%`;\r\n if (!groupedPlans.subscriptions[discountLabel]) {\r\n groupedPlans.subscriptions[discountLabel] = [];\r\n }\r\n groupedPlans.subscriptions[discountLabel].push(plan);\r\n }\r\n });\r\n return groupedPlans;\r\n }\r\n return null;\r\n } catch (error) {\r\n console.error(\"Error fetching recharge subscriptions data:\", error);\r\n return null;\r\n }\r\n};\r\n\r\nexport const getDefaultSubscriptionsData = async (productUrl, appId, variantId) => {\r\n try {\r\n const url = `https://${window.location.hostname}${productUrl?.split(\"?\")[0]}.js`;\r\n\r\n const response = await fetch(url);\r\n\r\n if (!response.ok) {\r\n console.error(\"Failed to fetch subscriptions data\");\r\n return null;\r\n }\r\n\r\n const data = await response.json();\r\n\r\n if (!data?.selling_plan_groups?.length) {\r\n return null;\r\n }\r\n\r\n const filteredSubscriptions = data.selling_plan_groups.filter(\r\n (group) =>\r\n (group.app_id &&\r\n group.app_id?.toLowerCase().includes(appId?.toLowerCase())) ||\r\n !appId\r\n );\r\n\r\n if (!filteredSubscriptions.length) {\r\n return null;\r\n }\r\n\r\n const selectedVariant = variantId\r\n ? data.variants.find((variant) => variant.id == variantId)\r\n : null;\r\n\r\n if(selectedVariant && !selectedVariant.selling_plan_allocations?.length) return null;\r\n\r\n const groupedPlans = {\r\n onetime: (\r\n selectedVariant\r\n ? selectedVariant.requires_selling_plan\r\n : data.requires_selling_plan\r\n )\r\n ? []\r\n : [\r\n {\r\n id: \"onetime\",\r\n type: \"onetime\",\r\n title: \"One-time Purchase\",\r\n },\r\n ],\r\n subscriptions: {},\r\n variants: data.variants,\r\n selling_plan_groups: data.selling_plan_groups,\r\n };\r\n\r\n filteredSubscriptions.forEach((subscriptionGroup) => {\r\n subscriptionGroup.selling_plans.forEach((plan) => {\r\n const { name, id, price_adjustments } = plan;\r\n const priceAdjustment = price_adjustments?.[0];\r\n\r\n let discount = \"\";\r\n if (priceAdjustment?.value) {\r\n if (priceAdjustment?.value_type === \"percentage\") {\r\n discount = `${priceAdjustment?.value}%`;\r\n } else if (priceAdjustment?.value_type === \"price\") {\r\n const oneTimePrice = selectedVariant\r\n ? selectedVariant.price\r\n : data.variants[0].price;\r\n const formattedMoney = formatMoney(\r\n oneTimePrice - priceAdjustment?.value,\r\n window.mu_money_format\r\n );\r\n discount = new DOMParser().parseFromString(\r\n formattedMoney,\r\n \"text/html\"\r\n ).body.textContent;\r\n } else {\r\n // Reintroducing DOMParser to strip any HTML tags from the formatted money string\r\n const formattedMoney = formatMoney(\r\n priceAdjustment?.value,\r\n window.mu_money_format\r\n );\r\n discount = new DOMParser().parseFromString(\r\n formattedMoney,\r\n \"text/html\"\r\n ).body.textContent;\r\n }\r\n }\r\n\r\n const discountLabel = discount\r\n ? `Subscribe & Save ${discount}` //`${subscriptionGroup.name} ${discount}`\r\n : \"Subscribe without discount\";\r\n\r\n const availableForVariant = selectedVariant\r\n ? selectedVariant.selling_plan_allocations.some(\r\n (spa) => spa.selling_plan_id == id\r\n )\r\n : true;\r\n \r\n if (availableForVariant) {\r\n if (!groupedPlans.subscriptions[discountLabel]) {\r\n groupedPlans.subscriptions[discountLabel] = [];\r\n }\r\n\r\n groupedPlans.subscriptions[discountLabel].push({\r\n id,\r\n external_plan_id: id,\r\n external_plan_name: name,\r\n charge_interval_frequency: 30,\r\n discount_amount: (priceAdjustment?.value_type === \"percentage\"\r\n ? priceAdjustment.value\r\n : (priceAdjustment?.value / 100 || 0).toFixed(2)\r\n )?.toString(),\r\n discount_type: priceAdjustment?.value_type,\r\n external_plan_group_id: subscriptionGroup.id,\r\n title: `${name}${discount ? ` with ${discount}` : \"\"}`,\r\n type: \"subscription\",\r\n // apply_cutoff_date_to_checkout: false,\r\n // charge_interval_frequency: 30,\r\n // external_variant_ids: [],\r\n // has_variant_restrictions: false,\r\n // interval_unit: \"day\",\r\n // order_interval_frequency: 30,\r\n // pricing_progression: [],\r\n // sort_order: 2,\r\n });\r\n }\r\n });\r\n });\r\n\r\n return groupedPlans;\r\n } catch (error) {\r\n console.error(\"Error fetching subscriptions data:\", error);\r\n return null;\r\n }\r\n};\r\n\r\nexport const getPlansData = async (productId, appType, productUrl, isPreview, variantId) => {\r\n switch (appType) {\r\n case \"recharge\":\r\n return await getRechargeSubscriptionsData(productId, isPreview);\r\n case \"seal\":\r\n return await getDefaultSubscriptionsData(\r\n productUrl,\r\n \"Seal Subscriptions\",\r\n variantId\r\n );\r\n case \"subify\":\r\n return await getDefaultSubscriptionsData(productUrl, \"subi\", variantId);\r\n case \"casa\":\r\n return await getDefaultSubscriptionsData(\r\n productUrl,\r\n \"IW00819979621610\",\r\n variantId\r\n );\r\n case \"appstle\":\r\n return await getDefaultSubscriptionsData(\r\n productUrl,\r\n \"appstle\",\r\n variantId\r\n );\r\n case \"recurpay\":\r\n return await getDefaultSubscriptionsData(productUrl, null, variantId);\r\n case \"yotpo\":\r\n return await getDefaultSubscriptionsData(\r\n productUrl,\r\n \"Yotpo Echo\",\r\n variantId\r\n );\r\n case \"paywhirl\":\r\n return await getDefaultSubscriptionsData(\r\n productUrl,\r\n \"paywhirl\",\r\n variantId\r\n );\r\n default:\r\n return null;\r\n }\r\n};","import React, { useState, useContext, useEffect, useMemo, useCallback } from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport { CartContext } from 'components/cart';\r\nimport classNames from 'lib/classNames';\r\nimport Api from '../Api';\r\nimport axios from 'axios';\r\nimport { API_GATEWAY_NEW } from 'aws-exports';\r\nimport { getDefaultSubscriptionsData } from '../Utils';\r\n\r\nconst Product = React.memo(({ product_info, add_to_unlock }) => {\r\n const {\r\n preview_product,\r\n Utils,\r\n isPreview,\r\n cart_settings: {\r\n count_compare_at,\r\n money_format,\r\n rtl,\r\n theme: { primary, background, secondary },\r\n product: { sold_out }\r\n },\r\n shop_url,\r\n add_to_cart,\r\n update_cart_item,\r\n productNotAddedToCart,\r\n setVariantPickerOptions,\r\n setVariantsPickerShow,\r\n addFBTUpsell,\r\n cart_currency,\r\n rechargeSettings,\r\n hasWriteDiscountsScope,\r\n products\r\n } = useContext(CartContext);\r\n const [product, setProduct] = useState(product_info);\r\n const subscriptionObject = rechargeSettings?.products?.find((p) => {\r\n return Object.keys(p)[0] === product_info.id.toString();\r\n });\r\n const subscription = subscriptionObject && subscriptionObject[product_info.id];\r\n const HAS_SUBSCRIPTION =\r\n subscription &&\r\n !!subscription?.selling_plan_groups?.length &&\r\n rechargeSettings?.widget_settings?.published;\r\n const { variants } = product_info;\r\n const [loading, setLoading] = useState(true);\r\n const [sodOut, setSodOut] = useState(false);\r\n const [compareAtMap, setCompareAtMap] = useState({});\r\n const [dataFetched, setDataFetched] = useState(false);\r\n const [plansData, setPlansData] = useState(null);\r\n\r\n const unformattedPrice = useMemo(\r\n () =>\r\n Utils.getVariantPrice({\r\n variant: window.mu_fbt_set_default_variant\r\n ? variants.find(({ title, option1, option2, option3 }) => {\r\n const selectedOptions = window.mu_fbt_set_default_variant(product);\r\n const selectedValues = Object.values(selectedOptions);\r\n const variantOptions = [option1, option2, option3];\r\n\r\n return (\r\n title === Object.values(selectedOptions).join(' / ') ||\r\n selectedValues.every(\r\n (value, index) => value === variantOptions[index]\r\n )\r\n );\r\n })\r\n : product.variants[0],\r\n cart_currency,\r\n isPreview,\r\n plansData\r\n }),\r\n [variants, cart_currency, isPreview, plansData]\r\n );\r\n\r\n const price = Utils.formatMoney(unformattedPrice * 100, money_format);\r\n const [original, setOriginal] = useState(0);\r\n\r\n const addToCartInit = useCallback(async () => {\r\n if (product.isExample || !product.fetched || loading) return;\r\n try {\r\n setLoading(true);\r\n const { variants } = product;\r\n let skip_picker = false;\r\n if (window.mu_custom_fbt_logic) {\r\n skip_picker = await window.mu_custom_fbt_logic(product);\r\n }\r\n if ((Utils.productHasOneVariant({ variants }) && !HAS_SUBSCRIPTION) || skip_picker) {\r\n if (Utils.variantIsOnStock(variants[0])) {\r\n addToCart(variants[0]);\r\n } else {\r\n setSodOut(true);\r\n }\r\n setLoading(false);\r\n } else {\r\n if (!dataFetched && !isPreview) {\r\n const data = await getDefaultSubscriptionsData(\r\n `/products/${product_info.handle}`\r\n );\r\n setPlansData(\r\n window.mu_filter_fbt_subscription\r\n ? window.mu_filter_fbt_subscription(data)\r\n : data\r\n );\r\n }\r\n setVariantPickerOptions({\r\n product,\r\n buttonText: add_to_unlock.upsell_confirm_button.text,\r\n onConfirm: (variant, sellingPlanId) => {\r\n addToCart(variant, sellingPlanId);\r\n },\r\n onClose: async () => {\r\n setLoading(false);\r\n },\r\n plansData,\r\n priceText: add_to_unlock.product_price.text\r\n });\r\n setVariantsPickerShow(true);\r\n }\r\n } catch (error) {\r\n setLoading(false);\r\n }\r\n }, [product, preview_product]);\r\n\r\n useEffect(() => {\r\n if (product?.variants?.length && !!count_compare_at) {\r\n setCompareAtMap(\r\n product.variants?.reduce((acc, variant) => {\r\n if (variant.compareAtPrice) {\r\n acc[variant.id] = Number(variant.compareAtPrice) * 100;\r\n }\r\n return acc;\r\n }, {})\r\n );\r\n }\r\n }, [product]);\r\n\r\n const addToCart = async (variant, sellingPlanId) => {\r\n if (window.mu_fbt_custom_atc) {\r\n const response = await window.mu_fbt_custom_atc(product, variant, sellingPlanId);\r\n if (response) {\r\n setLoading(false);\r\n setVariantsPickerShow(false);\r\n return;\r\n }\r\n }\r\n const variant_id = Number.parseInt(\r\n variant.id.toString().replace('gid://shopify/ProductVariant/', '')\r\n );\r\n if (productNotAddedToCart(product)) {\r\n add_to_cart(\r\n {\r\n variant_id,\r\n quantity: 1,\r\n selling_plan: sellingPlanId,\r\n product_handle: product.handle //required for preview only\r\n },\r\n (item) => {\r\n addFBTUpsell(item.id);\r\n setVariantsPickerShow(false);\r\n setLoading(false);\r\n }\r\n );\r\n } else {\r\n update_cart_item(\r\n { variant_id, selling_plan: sellingPlanId, quantity: '+1' },\r\n (item) => {\r\n addFBTUpsell(item.id);\r\n setVariantsPickerShow(false);\r\n setLoading(false);\r\n }\r\n );\r\n }\r\n };\r\n\r\n const formatText = (text) =>\r\n text\r\n .replace(/{{product_title}}/g, product.title)\r\n .replace(/{{product_price}}/g, price)\r\n .replace(\r\n /{{original_price}}/g,\r\n original && original !== price\r\n ? `<del class='mu-fbt-original-price mu-opacity-75 mu-ml-1 mu-mr-1 notranslate'>${original}</del> `\r\n : ''\r\n );\r\n\r\n useEffect(() => {\r\n const fetchProductInfo = async () => {\r\n const product = products?.find(({ id }) => id == product_info.id);\r\n // const updatedVariants = updateVariants(product.variants);\r\n if (product) {\r\n const newOriginal = calculateOriginal(product.variants);\r\n updateProduct(\r\n product,\r\n product.variants.map((variant) => ({\r\n ...product_info.variants.find(({ id }) => id == variant.id),\r\n ...variant,\r\n presentmentPrices: null\r\n })),\r\n newOriginal\r\n );\r\n } else {\r\n setProduct(product_info);\r\n }\r\n setLoading(false);\r\n if (!isPreview) {\r\n const data = await getDefaultSubscriptionsData(`/products/${product_info.handle}`);\r\n setPlansData(\r\n window.mu_filter_fbt_subscription\r\n ? window.mu_filter_fbt_subscription(data)\r\n : data\r\n );\r\n setDataFetched(true);\r\n }\r\n };\r\n\r\n const updateVariants = (newVariants) => {\r\n return product_info.variants.map((variant) => {\r\n const newVariantInfo = newVariants.find(\r\n (newVariant) => newVariant.id === variant.id\r\n );\r\n if (newVariantInfo) {\r\n return {\r\n ...newVariantInfo,\r\n ...variant,\r\n ...(window.mu_stop_presentment ? { presentmentPrices: null } : {}),\r\n price: Number(newVariantInfo.price)\r\n };\r\n }\r\n return variant;\r\n });\r\n };\r\n\r\n const calculateOriginal = (updatedVariants) => {\r\n if (!updatedVariants) return 0;\r\n const selected_variant = window.mu_fbt_set_default_variant\r\n ? updatedVariants.find(({ title, option1, option2, option3 }) => {\r\n const selectedOptions = window.mu_fbt_set_default_variant(product);\r\n const selectedValues = Object.values(selectedOptions);\r\n const variantOptions = [option1, option2, option3];\r\n\r\n return (\r\n title === Object.values(selectedOptions).join(' / ') ||\r\n selectedValues.every((value, index) => value === variantOptions[index])\r\n );\r\n })\r\n : updatedVariants[0];\r\n return (\r\n (updatedVariants &&\r\n selected_variant?.compare_at_price &&\r\n !!Number(selected_variant?.compare_at_price) &&\r\n Utils.formatMoney(\r\n Number(selected_variant?.compare_at_price) * 100,\r\n money_format\r\n )) ||\r\n 0\r\n );\r\n };\r\n\r\n const updateProduct = (newProduct, updatedVariants, newOriginal) => {\r\n const updatedProduct = {\r\n ...newProduct,\r\n ...(window.mu_fbt_use_fetched_product\r\n ? {\r\n fetched: true,\r\n handle: newProduct.handle,\r\n image: newProduct.images?.[0]?.src\r\n }\r\n : product_info),\r\n options: newProduct.options,\r\n variants: updatedVariants\r\n };\r\n setOriginal(newOriginal);\r\n setProduct(updatedProduct);\r\n };\r\n\r\n if (product_info) {\r\n fetchProductInfo();\r\n }\r\n }, [product_info]);\r\n\r\n const formattedText = useMemo(\r\n () => formatText(add_to_unlock.product_title.text),\r\n [product.title]\r\n );\r\n const formattedPrice = useMemo(\r\n () => formatText(add_to_unlock.product_price.text),\r\n [price, original]\r\n );\r\n\r\n return (\r\n <div\r\n className={classNames('fbt-item border-b last:border-b-0 mx-2 py-2')}\r\n style={{\r\n borderColor: Utils.formatColor(add_to_unlock.borderColor)\r\n }}\r\n data-loading={`${loading}`}\r\n >\r\n <div className={classNames('flex')}>\r\n {product.image || product.variants[0].image ? (\r\n <div\r\n className={classNames('fbt-item-image rounded bg-cover bg-center block')}\r\n style={{\r\n backgroundImage: `url(${(\r\n product.image?.src || product.variants[0].image?.src\r\n )?.replace(/\\.jpg|\\.png|\\.webp/, '_small$&')})`,\r\n width: 70,\r\n height: 70\r\n }}\r\n />\r\n ) : (\r\n <div\r\n style={{\r\n width: 70,\r\n height: 70,\r\n fill: Utils.formatColor(secondary),\r\n borderColor: Utils.formatColor(secondary)\r\n }}\r\n className={classNames(\r\n 'fbt-item-image text-transparent flex-center rounded border'\r\n )}\r\n >\r\n {product_info.fetch ? (\r\n <svg viewBox=\"0 0 20 20\" className={classNames('w-1/2 h-1/2')}>\r\n <path fill=\"currentColor\" d=\"M14 9l-5 5-3-2-5 3v4h18v-6z\"></path>\r\n <path d=\"M19 0H1a1 1 0 0 0-1 1v18a1 1 0 0 0 1 1h18a1 1 0 0 0 1-1V1a1 1 0 0 0-1-1zM8 6c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.654 0 3-1.346 3-3S9.654 4 8 4 5 5.346 5 7s1.346 3 3 3zm-6 8v-2.434l3.972-2.383 2.473 1.65c.398.264.925.21 1.262-.126l4.367-4.367L18 13.48V18H2zM18 2v8.92l-3.375-2.7a.999.999 0 0 0-1.332.073l-4.42 4.42-2.318-1.545a1 1 0 0 0-1.07-.025L2 13.233V2h16z\"></path>\r\n </svg>\r\n ) : (\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-icon=\"spinner-third\"\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 512 512\"\r\n className={classNames('w-4 h-4 fa-spin')}\r\n style={{ color: Utils.formatColor(secondary) }}\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M456.433 371.72l-27.79-16.045c-7.192-4.152-10.052-13.136-6.487-20.636 25.82-54.328 23.566-118.602-6.768-171.03-30.265-52.529-84.802-86.621-144.76-91.424C262.35 71.922 256 64.953 256 56.649V24.56c0-9.31 7.916-16.609 17.204-15.96 81.795 5.717 156.412 51.902 197.611 123.408 41.301 71.385 43.99 159.096 8.042 232.792-4.082 8.369-14.361 11.575-22.424 6.92z\"\r\n ></path>\r\n </svg>\r\n )}\r\n </div>\r\n )}\r\n <div className={classNames('flex-1 flex flex-col', rtl ? 'pr-2' : 'pl-2')}>\r\n <b\r\n className={classNames(\r\n 'fbt-item-title mb-0 overflow-hidden w-full line-clamp'\r\n )}\r\n style={{\r\n fontSize: Utils.em(add_to_unlock.product_title.font_size),\r\n fontWeight: add_to_unlock.product_title.font_weight,\r\n color: Utils.formatColor(add_to_unlock.product_title.color)\r\n }}\r\n >\r\n {isPreview || window.mu_fbt_title_unclickable ? (\r\n <span\r\n dangerouslySetInnerHTML={{\r\n __html: formattedText\r\n }}\r\n />\r\n ) : (\r\n <a\r\n href={`${window.origin}/products/${product.handle}`}\r\n dangerouslySetInnerHTML={{\r\n __html: formattedText\r\n }}\r\n />\r\n )}\r\n </b>\r\n <div className={classNames('flex items-center flex-wrap')}>\r\n <div\r\n className={classNames(\r\n 'flex flex-col flex-1 items-start',\r\n rtl ? 'ml-2' : 'mr-2'\r\n )}\r\n >\r\n <b\r\n className={`${classNames('fbt-item-price mb-0')} notranslate`}\r\n style={{\r\n fontSize: Utils.em(add_to_unlock.product_price.font_size),\r\n fontWeight: add_to_unlock.product_price.font_weight,\r\n color: Utils.formatColor(add_to_unlock.product_price.color)\r\n }}\r\n dangerouslySetInnerHTML={{\r\n __html: formattedPrice\r\n }}\r\n data-display={formattedPrice}\r\n />\r\n\r\n {window.mu_fbt_replace_show_details?.find(\r\n (elm) => elm.id === product.id\r\n ) ? (\r\n <p>\r\n {\r\n window.mu_fbt_replace_show_details?.find(\r\n (elm) => elm.id === product.id\r\n )?.text\r\n }\r\n </p>\r\n ) : (\r\n <button\r\n className={classNames('fbt-item-link btn-link')}\r\n style={{\r\n color: Utils.formatColor(\r\n add_to_unlock.show_product_details.color\r\n ),\r\n fontWeight: add_to_unlock.show_product_details.font_weight,\r\n fontSize: Utils.em(\r\n add_to_unlock.show_product_details.font_size\r\n )\r\n }}\r\n onClick={() => {\r\n if (!product.isExample) preview_product(product);\r\n }}\r\n >\r\n {add_to_unlock.show_product_details.text}\r\n </button>\r\n )}\r\n </div>\r\n\r\n <button\r\n className={classNames(\r\n 'fbt-item-atc border-solid border-2 bg-transparent btn-small py-2 relative'\r\n )}\r\n style={{\r\n borderColor: Utils.formatColor(\r\n add_to_unlock.upsell_add_button.color || primary\r\n ),\r\n color: Utils.formatColor(\r\n add_to_unlock.upsell_add_button.color || primary\r\n ),\r\n fontWeight: add_to_unlock.upsell_add_button.font_weight,\r\n fontSize: Utils.em(add_to_unlock.upsell_add_button.font_size)\r\n }}\r\n onClick={() => addToCartInit()}\r\n disabled={sodOut || !product.fetched || loading}\r\n >\r\n <span\r\n className={classNames({\r\n 'opacity-0': loading\r\n })}\r\n >\r\n {sodOut ? sold_out : add_to_unlock.upsell_add_button.text}\r\n </span>\r\n <div\r\n className={classNames('absolute inset-0 flex-center', {\r\n hidden: !loading\r\n })}\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n focusable=\"false\"\r\n data-icon=\"spinner-third\"\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 512 512\"\r\n className={classNames('w-3 h-3 fa-spin')}\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M456.433 371.72l-27.79-16.045c-7.192-4.152-10.052-13.136-6.487-20.636 25.82-54.328 23.566-118.602-6.768-171.03-30.265-52.529-84.802-86.621-144.76-91.424C262.35 71.922 256 64.953 256 56.649V24.56c0-9.31 7.916-16.609 17.204-15.96 81.795 5.717 156.412 51.902 197.611 123.408 41.301 71.385 43.99 159.096 8.042 232.792-4.082 8.369-14.361 11.575-22.424 6.92z\"\r\n ></path>\r\n </svg>\r\n </div>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n});\r\n\r\nProduct.propTypes = {};\r\n\r\nexport default Product;\r\n","import React, { useContext, useEffect, useState } from \"react\";\r\nimport PropTypes from \"prop-types\";\r\nimport { CartContext } from \"components/cart\";\r\nimport Product from \"./Product\";\r\nimport Axios from \"axios\";\r\nimport classNames from \"lib/classNames\";\r\nimport API from \"../Api\";\r\nimport { API_GATEWAY_NEW } from \"aws-exports\";\r\nimport useCampaign from \"hooks/useCampaign\";\r\n\r\nconst productsInMemory = {};\r\n\r\nconst AddToUnlock = ({ add_to_unlock, add_to_unlock_product_id }) => {\r\n const cartContext = useContext(CartContext);\r\n const {\r\n cart_settings: { theme, font },\r\n shopify_cart_items,\r\n campaigns,\r\n Utils,\r\n get_total,\r\n shop_url,\r\n isPreview,\r\n productNotAddedToCart,\r\n productAddedToCart,\r\n rechargeSettings,\r\n hasWriteDiscountsScope,\r\n products,\r\n } = cartContext;\r\n const [one_check_up_sell_product_id, ocu_campaign] = useCampaign(\r\n \"one_check_up_sell\",\r\n null,\r\n true\r\n )(campaigns, shopify_cart_items);\r\n const {\r\n borderColor,\r\n background,\r\n show_suggestions,\r\n recommendation_type = \"custom_recommendation\",\r\n products_length = 1,\r\n exclude_tags,\r\n } = add_to_unlock;\r\n const static_variants = window.monster_static?.variants;\r\n const [upSells, setUpSells] = useState([]);\r\n const filterUpsells = (value) => {\r\n return value.filter((product) => {\r\n if (productAddedToCart(product) || product.product_type === 'ship_protect') {\r\n return false;\r\n }\r\n const subscriptionObject = rechargeSettings?.products?.find((p) => {\r\n return Object.keys(p)[0] === product.id.toString();\r\n });\r\n const subscription = subscriptionObject && subscriptionObject[product.id];\r\n const { storefront_purchase_options } =\r\n subscription?.subscription_options || {};\r\n if (\r\n storefront_purchase_options &&\r\n storefront_purchase_options !== \"subscription_and_onetime\" &&\r\n storefront_purchase_options !== \"onetime_only\"\r\n ) {\r\n return false;\r\n }\r\n return true;\r\n });\r\n };\r\n const [allProducts, setAllProducts] = useState([]);\r\n const add_to_unlock_reward = add_to_unlock[add_to_unlock.reward_type];\r\n const handleSetAllProducts = (tmpProducts) => {\r\n setAllProducts(tmpProducts);\r\n };\r\n\r\n const fetchProducts = async (source, upsells) => {\r\n if (!upsells.length || upsells.every(({ fetched }) => fetched)) {\r\n return source.cancel();\r\n }\r\n try {\r\n const toBeFetched = [];\r\n let products = [];\r\n upsells.forEach(({ id }) => {\r\n const product = productsInMemory[id];\r\n if (product) {\r\n products.push(product);\r\n } else {\r\n toBeFetched.push(id);\r\n }\r\n });\r\n if (toBeFetched.length) {\r\n // const { data } = await Axios.get('https://mu-api.com/public/products', {\r\n // params: {\r\n // shopName: shop_url,\r\n // productIds: toBeFetched \r\n // },\r\n // cancelToken: source?.token,\r\n // });\r\n const { data } = await Axios.get(`${API_GATEWAY_NEW}/public/products`, {\r\n params: {\r\n shop: shop_url,\r\n ids: toBeFetched,\r\n },\r\n cancelToken: source?.token,\r\n });\r\n const fetchedProducts = Object.entries(data.products).reduce(\r\n (acc, [key, product]) => {\r\n if (!product) return acc;\r\n const data = { ...product, fetched: true };\r\n productsInMemory[key] = data;\r\n return acc.concat([data]);\r\n },\r\n []\r\n );\r\n products = products.concat(fetchedProducts);\r\n }\r\n setUpSells(filterUpsells(products));\r\n // // temporary send double product request\r\n // await Axios.get('https://mu-api.com/public/products', {params: {shopName: shop_url,productIds: toBeFetched }});\r\n } catch (e) {\r\n source.cancel();\r\n }\r\n };\r\n\r\n // set all possible poducts without the recommandations\r\n useEffect(() => {\r\n const tmpProducts = add_to_unlock.products.length\r\n ? add_to_unlock.products\r\n : isPreview\r\n ? Utils.fakePreviewProducts()\r\n : [];\r\n if (recommendation_type !== \"shopify_recommendation\")\r\n handleSetAllProducts(tmpProducts);\r\n }, [add_to_unlock.products, show_suggestions, recommendation_type]);\r\n\r\n // handle items change\r\n useEffect(() => {\r\n let tmpProducts = allProducts.filter((pro) => {\r\n const notAdded = productNotAddedToCart(pro);\r\n if (window.mu_custom_fbt_filter) {\r\n return window.mu_custom_fbt_filter(pro, products) && notAdded;\r\n }\r\n return notAdded;\r\n }).slice(0);\r\n if (show_suggestions && recommendation_type === \"shopify_recommendation\") {\r\n tmpProducts = tmpProducts\r\n .filter((prod) => checkTags(prod, exclude_tags))\r\n .splice(0, products_length);\r\n }\r\n\r\n if (rechargeSettings && !hasWriteDiscountsScope) {\r\n tmpProducts = filterUpsells(tmpProducts);\r\n }\r\n setUpSells(filterUpsells(tmpProducts));\r\n }, [\r\n shopify_cart_items,\r\n allProducts,\r\n show_suggestions,\r\n recommendation_type,\r\n products_length,\r\n exclude_tags,\r\n rechargeSettings,\r\n hasWriteDiscountsScope,\r\n ]);\r\n\r\n useEffect(() => {\r\n let tmpUpsel = (\r\n add_to_unlock.products.length\r\n ? add_to_unlock.products\r\n : isPreview\r\n ? Utils.fakePreviewProducts()\r\n : []\r\n ).filter((pro) => {\r\n const notAdded = productNotAddedToCart(pro);\r\n if (window.mu_custom_fbt_filter) {\r\n return window.mu_custom_fbt_filter(pro, products) && notAdded;\r\n }\r\n return notAdded;\r\n });\r\n setUpSells(filterUpsells(tmpUpsel));\r\n\r\n if (show_suggestions && recommendation_type == \"shopify_recommendation\") {\r\n if (isPreview) {\r\n API.get(`${API_GATEWAY_NEW}/public/products`, {\r\n params: { shop: shop_url, isPreview: true },\r\n })\r\n // API.get(\"https://mu-api.com/public/products\", {\r\n // params: { shopName: shop_url, isPreview: true },\r\n // })\r\n .then(({ data }) => {\r\n const { products } = data;\r\n let tmpProducts = parseProducts(products);\r\n handleSetAllProducts(tmpProducts);\r\n })\r\n .catch((error) => {\r\n API.get(`https://${shop_url}/products.json?limit=20`)\r\n .then(({ data }) => {\r\n const { products } = data;\r\n let tmpProducts = parseProducts(products);\r\n handleSetAllProducts(tmpProducts);\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n });\r\n });\r\n return; // TODO: return clean up function\r\n }\r\n const recoEndpoint = `/recommendations/products.json?product_id=${add_to_unlock_product_id}`;\r\n // const endpoint = 'https://shopquoteworthy.com/recommendations/products.json?product_id=5803024318625'\r\n // const recoEndpoint = '/recommendations/products.json?product_id=3320752701504'\r\n const productsEndpoint = \"/products.json?limit=20\";\r\n Axios.get(recoEndpoint).then(({ data }) => {\r\n const { products } = data;\r\n if (products) {\r\n if (products.length) {\r\n // map product and set it setAllProducts\r\n const tmpProducts = parseProducts(products);\r\n handleSetAllProducts(tmpProducts);\r\n } else {\r\n Axios.get(productsEndpoint).then(({ data: productsData }) => {\r\n const { products } = productsData;\r\n const tmpProducts = parseProducts(products);\r\n handleSetAllProducts(tmpProducts);\r\n });\r\n }\r\n }\r\n });\r\n //TODO: return clean up function\r\n }\r\n }, [show_suggestions, recommendation_type]);\r\n\r\n useEffect(() => {\r\n const CancelToken = Axios.CancelToken;\r\n const source = CancelToken.source();\r\n fetchProducts(source, upSells);\r\n return () => {\r\n source.cancel();\r\n };\r\n }, [upSells]);\r\n\r\n const parseProducts = (products) => {\r\n const ocu_products = (ocu_campaign?.multi_one_check_upsell?.products || [])\r\n .map(({ product }) => product.id)\r\n .filter(Boolean)\r\n .map(String);\r\n return products\r\n .filter(({ id }) => !ocu_products.includes(id.toString()))\r\n .map((product) => {\r\n return {\r\n id: product.id,\r\n title: product.title,\r\n handle: product.handle,\r\n image: product.image,\r\n options: product.options,\r\n tags: product.tags,\r\n product_type:product.product_type,\r\n variants: product.variants.map((v) => {\r\n return {\r\n ...v,\r\n id: v.id,\r\n title: v.title,\r\n price: v.price / 100,\r\n image: v.featured_image ? v.featured_image.src : null,\r\n };\r\n }),\r\n };\r\n });\r\n };\r\n\r\n const checkTags = (product, tags = []) => {\r\n if (!tags) return true;\r\n return tags.every(\r\n (tag) =>\r\n !product.tags || (product.tags && product.tags.indexOf(tag) === -1)\r\n );\r\n };\r\n\r\n return upSells.length ? (\r\n <>\r\n {add_to_unlock.separator.active && (\r\n <div\r\n id=\"mu-fbt-separator\"\r\n className={classNames(\"text-center my-3\")}\r\n style={{\r\n lineHeight: \"2px\",\r\n background: Utils.formatColor(font.color, 0.28),\r\n }}\r\n >\r\n <span\r\n style={{\r\n background: Utils.formatColor(theme.background),\r\n }}\r\n className={classNames(\"px-2 font-bold\")}\r\n >\r\n {add_to_unlock.separator.text}\r\n </span>\r\n </div>\r\n )}\r\n <div\r\n id=\"mu-fbt\"\r\n className={classNames(\"frequently-container rounded border mb-2\", {\r\n \"mt-5\": add_to_unlock.separator.active,\r\n \"mt-1\": !add_to_unlock.separator.active,\r\n })}\r\n style={{ borderColor: Utils.formatColor(borderColor) }}\r\n >\r\n <div\r\n className={classNames(\r\n \"frequently-header text-center p-2 font-bold w-full\"\r\n )}\r\n style={{\r\n background: Utils.formatColor(background),\r\n color: Utils.formatColor(add_to_unlock.title.color),\r\n fontSize: Utils.em(add_to_unlock.title.font_size),\r\n fontWeight: add_to_unlock.title.font_weight,\r\n }}\r\n >\r\n {add_to_unlock.title.text}\r\n </div>\r\n <div>\r\n {upSells.map((product) => {\r\n return (\r\n <Product\r\n key={product.id}\r\n product_info={product}\r\n add_to_unlock={add_to_unlock}\r\n />\r\n );\r\n })}\r\n </div>\r\n </div>\r\n </>\r\n ) : null;\r\n};\r\n\r\n// quotebujosandmore.myshopify.com/recommendations/products.json?product_id=36765506109601\r\n// https://shopquoteworthy.com//recommendations/products.json?product_id=36765506109601\r\n\r\n//3wizzystore.myshopify.com/recommendations/products.json?product_id=3431364624448\r\n\r\n// 3431364624448\r\n// const formateText = (text, rewardType, { type, reward, goal }, formatMoney, get_total) => {\r\n// \tlet replacedReward =\r\n// \t\trewardType === 'discount' ? (type === 'percentage' ? `${reward}%` : formatMoney(reward * 100)) : '';\r\n// \tlet replacedAmount = formatMoney(goal * 100 - get_total('original'));\r\n// \treturn text.replace('{{amount}}', replacedAmount).replace('{{reward}}', replacedReward);\r\n// };\r\n\r\nhttps: AddToUnlock.propTypes = {};\r\n\r\nexport default AddToUnlock;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"dragAndDrop\":\"drag_and_drop_dragAndDrop__36uZF\",\"dragging\":\"drag_and_drop_dragging__2JXPf\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"group\":\"campaign_settings_first_step_group__shXfQ\",\"first_step\":\"campaign_settings_first_step_first_step__3UBAa\",\"tiles\":\"campaign_settings_first_step_tiles__3t-dL\",\"tile\":\"campaign_settings_first_step_tile__37qLL\"};","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAf4AAABRCAYAAAAzUsSqAAAWJklEQVR4nO2dQXLbSLKG/wIBvd4NXjzRr3ddPkFTJzA0z/T0ru0TmDqB5RNYOoHlE4g+gTU7h0WPOScQ+wSq2TlGdARm5zAp5FsQcMMgABJgFVAk85voCblAJpKFQmWiUJkpwDAMwzB7hC8D34XbA9Bz4DwCIP6tPjzdRGZX9nsECgTErwIi+Lf68FCDqkZwu7L/CUDQ1AkJ9HKqRhfptkP5OBAQn5rSIeboTl1PGj4nw+wU8QR6KyB8XTIJdD5VozP9soXqwDn+rN4rPfKYbcGXgfTgBYD4dWGc0UuO0eJ/44ry/AMcBAQ8AqhHoB4AX0B8l2kzbgedkznmNzpv3BVMsg1TNRofysdhgzoM2egzzOaEahweysdvALzSI1GoOWYXJmQTojef1QelQxZjN9mnbwLJxRGKTXM1/nQc8CiRlzbuopbU9nA/q/dK741bSjhVo3HBsTGApw3ogA46502ch2H2gakanXXlk+f4PrluAp2Hahwm/5pjfuHhQINsoabq+mIzGYytLFaNnd91PX0njoMD51GEKEg/lNr+NL8ODrC4uQgUmj6ZgPhnyeGyY9og0Dkv9TGMXgjRyeZShLpT18N0S6jGYYT7l5vLJnb2d5seQKcAAh0rxwTyBcRrAj1tcCW6MRxgcXMBMH5jEOiq6JgLt/CYPoRy4Q7Nn4fZNnwZ+IfycXAoH592Zf+yK/sXbeu0TcQreeNNZBQ5D1/Ux6tNZBPoKutQMLvFVI0uKOc18gbyxgDe6pJnG27yx1SNLrqy/9rkyQikio59Vu9VV/ZNnh6E6C2/42PSO3qX3wF+Z9i0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W++rpsY8Sq6tzr5x4ap73Pu65AmIwg2mbc0XnDaJYZi9pa7hn4l7md2JzzDbguk4foZhGIZhLIINP8MwDMPsEWz4GYZhGGaPYMPPMAzDMHsEG36GYRiG2SPY8DMMwzDMHsGGn2EYhmH2CDb8DMPsM7WqfR6Qu5QxkWG2BTb8DMPsJZtUXiPQ6zrpjBnGBtjwMwyzd2xeeQ2yqCIpw9gOG36GYfYOTZXXXuQV+2IY22HDzzDMXqGx8prvwbvUIIdhGuX/AbUam12WV1bvAAAAAElFTkSuQmCC\"","module.exports = __webpack_public_path__ + \"static/media/redeemly-logo.546a3149.jpeg\";","// extracted by mini-css-extract-plugin\nmodule.exports = {\"custom_scrollbar\":\"custom_scroll_custom_scrollbar__3qT24\",\"isMobile\":\"custom_scroll_isMobile__HoMyk\"};","module.exports = __webpack_public_path__ + \"static/media/monster_logo.8c8178cf.png\";","// extracted by mini-css-extract-plugin\nmodule.exports = {\"display_text\":\"display_text_display_text__m2GIB\"};","module.exports = __webpack_public_path__ + \"static/media/yt-clothing.67ce0882.jpeg\";","module.exports = __webpack_public_path__ + \"static/media/yt-designing.99df31f6.jpeg\";","module.exports = __webpack_public_path__ + \"static/media/yt-dropshipping.1ebd70d4.jpeg\";","module.exports = __webpack_public_path__ + \"static/media/yt-free-gift.2208a3ba.jpeg\";","module.exports = __webpack_public_path__ + \"static/media/yt-free-shipping.b3ddfca6.jpeg\";","module.exports = __webpack_public_path__ + \"static/media/yt-shipping-protection.791f1aa9.jpeg\";","import { createMachine, interpret, assign } from \"xstate\";\r\nimport { getGoal } from \"../Utils\";\r\n\r\nconst sortGoals = (dir = \"DESC\") => {\r\n\tconst isDesc = dir.toLocaleUpperCase() === \"DESC\";\r\n\tif (isDesc) {\r\n\t\treturn (a, b) => b.goal - a.goal;\r\n\t} else {\r\n\t\treturn (a, b) => a.goal - b.goal;\r\n\t}\r\n};\r\n\r\nconst isUnlocked = (goal, total, log = false) => {\r\n\tif (log) console.log(`total: ${total}, goal: ${goal}, unlocked: ${total >= goal}`);\r\n\treturn total >= goal\r\n};\r\n\r\nconst calculateGoals = ({\r\n\tcampaign_id,\r\n\tgoals,\r\n\tshow_badges,\r\n\tshopify_cart_items,\r\n\toriginal,\r\n\tsubtotal,\r\n\tautoDiscountGifts,\r\n\tbundlesDiscounts,\r\n\tdiscountCode,\r\n\tbyQuantity,\r\n\tcontextCache,\r\n\tsetShowConfetti\r\n}) => {\r\n\t// const descGoals = [...goals].sort(sortGoals(\"DESC\"));\r\n\tconst ascGoals = [...goals].sort(sortGoals(\"ASC\")).map(goalObject => {\r\n\t\tconst { goal: oldGoal, specific_goals } = goalObject;\r\n\t\tconst goal = getGoal({ oldGoal, specific_goals, byQuantity })\r\n\t\treturn { ...goalObject, goal }\r\n\t});\r\n\tconst goalValue = (goal) => byQuantity ? goal : parseInt(goal * 100);\r\n\tconst getTotal = (reward_type) => {\r\n\t\tconst discountedValue = bundlesDiscounts \r\n\t\tconst total = byQuantity\r\n\t\t\t? totalItems\r\n\t\t\t: reward_type === \"free_shipping\"\r\n\t\t\t\t? (window.mu_include_sub_full_price ? totalPrice : subtotal)\r\n\t\t\t\t: reward_type === \"manual\"\r\n\t\t\t\t\t? original + autoDiscountGifts - discountedValue\r\n\t\t\t\t\t: original - discountedValue;\r\n\t\treturn total\r\n\t}\r\n\tconst totalItems = shopify_cart_items.filter(({ product_type }) => product_type?.toLowerCase() !== \"free_gift\").reduce((acc, cur) => acc + cur.quantity, 0);\r\n\tconst totalPrice = shopify_cart_items.filter(({ product_type }) => product_type?.toLowerCase() !== \"free_gift\").reduce((acc, cur) => {\r\n\t\tlet price;\r\n\t\tif(cur.selling_plan_allocation && cur.selling_plan_allocation.compare_at_price) {\r\n\t\t\tprice = cur.selling_plan_allocation.compare_at_price;\r\n\t\t} else {\r\n\t\t\tprice = cur.price;\r\n\t\t}\r\n\t\treturn acc + price * cur.quantity - cur.discounts?.reduce((acc, { amount }) => acc + amount, 0);\r\n\t}, 0);\r\n\treturn ascGoals.map((goalObject, index) => {\r\n\t\tconst { goal, reward_type, confetti, confetti_length } = goalObject;\r\n\t\tconst total = getTotal(reward_type)\r\n\t\tconst unlocked = isUnlocked(goalValue(goal), total);\r\n\t\tconst wasLocked = contextCache ? contextCache?.goals[index]?.unlocked === false : true;\r\n\t\tconst value = show_badges ? badgeProgressLength(unlocked, ascGoals.length) : Math.min(100, Number(((total / goalValue(goal)) * 100).toFixed(2)));\r\n\t\tconst isDescending = contextCache ? contextCache?.goals[index]?.value > value : false;\r\n\t\tconst previousGoal = index > 0 ? ascGoals[index - 1] : {};\r\n\t\tif (confetti && !isDescending && unlocked && wasLocked) {\r\n\t\t\tsetShowConfetti(confetti_length);\r\n\t\t}\r\n\t\treturn {\r\n\t\t\tcampaign_id,\r\n\t\t\tkey: \"atu_goal_\" + index,\r\n\t\t\ttextKey: \"atu_goal_text_\" + index,\r\n\t\t\tlabelKey: \"atu_goal_label_\" + index,\r\n\t\t\tgoalObject,\r\n\t\t\tvalue,\r\n\t\t\tpreviousIsUnlocked: previousGoal?.goal || previousGoal?.goal === 0 ? isUnlocked(goalValue(previousGoal.goal), getTotal(previousGoal.reward_type)) : undefined,\r\n\t\t\tisFirst: index === 0,\r\n\t\t\tisLast: index === ascGoals.length - 1,\r\n\t\t\tunlocked\r\n\t\t\t// animating:false\r\n\t\t};\r\n\t});\r\n};\r\n\r\nfunction badgeProgressLength(unlocked, goalsLength){\r\n\tconst preset = {\r\n\t\t1: 68,\r\n\t\t2: 45,\r\n\t\t3:10,\r\n\t\t4:5,\r\n\t}\r\n\treturn unlocked ? 100 : preset[goalsLength]\r\n}\r\n\r\nconst HeaderMachine = ({\r\n\tcampaign_id,\r\n\tgoals,\r\n\tshow_badges,\r\n\tshopify_cart_items,\r\n\tbyQuantity,\r\n\toriginal,\r\n\tautoDiscountGifts,\r\n\tsubtotal,\r\n\tbundlesDiscounts,\r\n\tdiscountCode,\r\n\tcontextCache,\r\n\tsetShowConfetti\r\n}) => {\r\n\t// const highestGoal = descGoals[0];\r\n\treturn createMachine({\r\n\t\tid: \"header-machine\",\r\n\t\t// initial: \"idle\",\r\n\t\tcontext: {\r\n\t\t\tgoals: calculateGoals({\r\n\t\t\t\tcampaign_id,\r\n\t\t\t\tgoals,\r\n\t\t\t\tshow_badges,\r\n\t\t\t\tshopify_cart_items,\r\n\t\t\t\toriginal,\r\n\t\t\t\tautoDiscountGifts,\r\n\t\t\t\tsubtotal,\r\n\t\t\t\tbyQuantity,\r\n\t\t\t\tbundlesDiscounts,\r\n\t\t\t\tdiscountCode,\r\n\t\t\t\tcontextCache,\r\n\t\t\t\tsetShowConfetti\r\n\t\t\t})\r\n\t\t}\r\n\t\t// states: {\r\n\t\t// \tidle: {\r\n\t\t// \t\ton: {\r\n\t\t// \t\t\tSTART_ANIMATION: {\r\n\t\t// \t\t\t\tactions: (context, event) => {\r\n\t\t// \t\t\t\t\tconst goals = {...context}.goals\r\n\t\t// goals[event.index].animating = true\r\n\t\t// \t\t\t\t\treturn assign({ goals: goals });\r\n\t\t// \t\t\t\t}\r\n\t\t// \t\t\t},\r\n\t\t// \t\t\tSTOP_ANIMATION: {\r\n\t\t// \t\t\t\tactions: (context, event) => {\r\n\t\t// \t\t\t\t\tconst goals = {...context}.goals\r\n\t\t// goals[event.index].animating = false\r\n\t\t// \t\t\t\t\treturn assign({ goals: goals });\r\n\t\t// \t\t\t\t}\r\n\t\t// \t\t\t}\r\n\t\t// \t\t}\r\n\t\t// \t}\r\n\t\t// }\r\n\t});\r\n};\r\n\r\nexport default HeaderMachine;\r\n","import classNames from 'lib/classNames';\r\nimport React, { Fragment, useContext } from 'react';\r\nimport { CartContext } from '../index';\r\n\r\nexport default function GoalImageContent({ goal }) {\r\n const { cart_settings: { money_format }, Utils } = useContext(CartContext);\r\n\r\n const { badge, reward_type } = goal;\r\n if (reward_type === 'discount' && badge?.type === 2) {\r\n const { type, reward } = goal.discount;\r\n const discount =\r\n type === \"percentage\"\r\n ? `${reward}%`\r\n : Utils.formatMoney(\r\n reward * 100 * Number(window.Shopify.currency.rate),\r\n money_format.replace(`money`, `\"money mu-font-bold\"`)\r\n );\r\n return (\r\n <Fragment>\r\n <span dangerouslySetInnerHTML={{ __html: discount }} />\r\n <span>Off</span>\r\n </Fragment>\r\n );\r\n } else if (reward_type === 'manual') {\r\n switch (badge?.type) {\r\n case 2:\r\n return (\r\n <Fragment>\r\n <span className={classNames('text-9px')}>Express</span>\r\n <span className={classNames('text-9px')} style={{ marginBottom: '2px' }}>\r\n shipping\r\n </span>\r\n <svg\r\n width=\"22\"\r\n height=\"14.67\"\r\n viewBox=\"0 0 33 22\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M3.82105 13.0625L2.77895 11H10.0737L9.24 8.9375H2.43158L1.38947 6.875H12.2274L11.3937 4.8125H1.19495L0 2.75H5.21053C5.21053 2.02065 5.50331 1.32118 6.02446 0.805456C6.54561 0.289731 7.25245 0 7.98947 0H24.6632V5.5H28.8316L33 11V17.875H30.2211C30.2211 18.969 29.7819 20.0182 29.0002 20.7918C28.2184 21.5654 27.1582 22 26.0526 22C24.9471 22 23.8868 21.5654 23.1051 20.7918C22.3234 20.0182 21.8842 18.969 21.8842 17.875H16.3263C16.3263 18.969 15.8871 20.0182 15.1054 20.7918C14.3237 21.5654 13.2634 22 12.1579 22C11.0524 22 9.99211 21.5654 9.21038 20.7918C8.42865 20.0182 7.98947 18.969 7.98947 17.875H5.21053V13.0625H3.82105ZM26.0526 19.9375C26.6054 19.9375 27.1355 19.7202 27.5264 19.3334C27.9173 18.9466 28.1368 18.422 28.1368 17.875C28.1368 17.328 27.9173 16.8034 27.5264 16.4166C27.1355 16.0298 26.6054 15.8125 26.0526 15.8125C25.4999 15.8125 24.9697 16.0298 24.5789 16.4166C24.188 16.8034 23.9684 17.328 23.9684 17.875C23.9684 18.422 24.188 18.9466 24.5789 19.3334C24.9697 19.7202 25.4999 19.9375 26.0526 19.9375ZM28.1368 7.5625H24.6632V11H30.8602L28.1368 7.5625ZM12.1579 19.9375C12.7107 19.9375 13.2408 19.7202 13.6317 19.3334C14.0225 18.9466 14.2421 18.422 14.2421 17.875C14.2421 17.328 14.0225 16.8034 13.6317 16.4166C13.2408 16.0298 12.7107 15.8125 12.1579 15.8125C11.6051 15.8125 11.075 16.0298 10.6841 16.4166C10.2933 16.8034 10.0737 17.328 10.0737 17.875C10.0737 18.422 10.2933 18.9466 10.6841 19.3334C11.075 19.7202 11.6051 19.9375 12.1579 19.9375Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n </Fragment>\r\n );\r\n case 3:\r\n return (\r\n <svg\r\n width=\"33\"\r\n height=\"22\"\r\n viewBox=\"0 0 33 22\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M3.82105 13.0625L2.77895 11H10.0737L9.24 8.9375H2.43158L1.38947 6.875H12.2274L11.3937 4.8125H1.19495L0 2.75H5.21053C5.21053 2.02065 5.50331 1.32118 6.02446 0.805456C6.54561 0.289731 7.25245 0 7.98947 0H24.6632V5.5H28.8316L33 11V17.875H30.2211C30.2211 18.969 29.7819 20.0182 29.0002 20.7918C28.2184 21.5654 27.1582 22 26.0526 22C24.9471 22 23.8868 21.5654 23.1051 20.7918C22.3234 20.0182 21.8842 18.969 21.8842 17.875H16.3263C16.3263 18.969 15.8871 20.0182 15.1054 20.7918C14.3237 21.5654 13.2634 22 12.1579 22C11.0524 22 9.99211 21.5654 9.21038 20.7918C8.42865 20.0182 7.98947 18.969 7.98947 17.875H5.21053V13.0625H3.82105ZM26.0526 19.9375C26.6054 19.9375 27.1355 19.7202 27.5264 19.3334C27.9173 18.9466 28.1368 18.422 28.1368 17.875C28.1368 17.328 27.9173 16.8034 27.5264 16.4166C27.1355 16.0298 26.6054 15.8125 26.0526 15.8125C25.4999 15.8125 24.9697 16.0298 24.5789 16.4166C24.188 16.8034 23.9684 17.328 23.9684 17.875C23.9684 18.422 24.188 18.9466 24.5789 19.3334C24.9697 19.7202 25.4999 19.9375 26.0526 19.9375ZM28.1368 7.5625H24.6632V11H30.8602L28.1368 7.5625ZM12.1579 19.9375C12.7107 19.9375 13.2408 19.7202 13.6317 19.3334C14.0225 18.9466 14.2421 18.422 14.2421 17.875C14.2421 17.328 14.0225 16.8034 13.6317 16.4166C13.2408 16.0298 12.7107 15.8125 12.1579 15.8125C11.6051 15.8125 11.075 16.0298 10.6841 16.4166C10.2933 16.8034 10.0737 17.328 10.0737 17.875C10.0737 18.422 10.2933 18.9466 10.6841 19.3334C11.075 19.7202 11.6051 19.9375 12.1579 19.9375Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n );\r\n }\r\n } else if (reward_type === 'free_shipping') {\r\n switch (badge?.type) {\r\n case 2:\r\n return (\r\n <Fragment>\r\n <span className={classNames('text-9px')}>Free</span>\r\n <span className={classNames('text-9px')} style={{ marginBottom: '2px' }}>\r\n shipping\r\n </span>\r\n <svg\r\n width=\"22\"\r\n height=\"14.67\"\r\n viewBox=\"0 0 33 22\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M3.82105 13.0625L2.77895 11H10.0737L9.24 8.9375H2.43158L1.38947 6.875H12.2274L11.3937 4.8125H1.19495L0 2.75H5.21053C5.21053 2.02065 5.50331 1.32118 6.02446 0.805456C6.54561 0.289731 7.25245 0 7.98947 0H24.6632V5.5H28.8316L33 11V17.875H30.2211C30.2211 18.969 29.7819 20.0182 29.0002 20.7918C28.2184 21.5654 27.1582 22 26.0526 22C24.9471 22 23.8868 21.5654 23.1051 20.7918C22.3234 20.0182 21.8842 18.969 21.8842 17.875H16.3263C16.3263 18.969 15.8871 20.0182 15.1054 20.7918C14.3237 21.5654 13.2634 22 12.1579 22C11.0524 22 9.99211 21.5654 9.21038 20.7918C8.42865 20.0182 7.98947 18.969 7.98947 17.875H5.21053V13.0625H3.82105ZM26.0526 19.9375C26.6054 19.9375 27.1355 19.7202 27.5264 19.3334C27.9173 18.9466 28.1368 18.422 28.1368 17.875C28.1368 17.328 27.9173 16.8034 27.5264 16.4166C27.1355 16.0298 26.6054 15.8125 26.0526 15.8125C25.4999 15.8125 24.9697 16.0298 24.5789 16.4166C24.188 16.8034 23.9684 17.328 23.9684 17.875C23.9684 18.422 24.188 18.9466 24.5789 19.3334C24.9697 19.7202 25.4999 19.9375 26.0526 19.9375ZM28.1368 7.5625H24.6632V11H30.8602L28.1368 7.5625ZM12.1579 19.9375C12.7107 19.9375 13.2408 19.7202 13.6317 19.3334C14.0225 18.9466 14.2421 18.422 14.2421 17.875C14.2421 17.328 14.0225 16.8034 13.6317 16.4166C13.2408 16.0298 12.7107 15.8125 12.1579 15.8125C11.6051 15.8125 11.075 16.0298 10.6841 16.4166C10.2933 16.8034 10.0737 17.328 10.0737 17.875C10.0737 18.422 10.2933 18.9466 10.6841 19.3334C11.075 19.7202 11.6051 19.9375 12.1579 19.9375Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n </Fragment>\r\n );\r\n case 3:\r\n return (\r\n <svg\r\n width=\"33\"\r\n height=\"22\"\r\n viewBox=\"0 0 33 22\"\r\n fill=\"none\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n >\r\n <path\r\n d=\"M3.82105 13.0625L2.77895 11H10.0737L9.24 8.9375H2.43158L1.38947 6.875H12.2274L11.3937 4.8125H1.19495L0 2.75H5.21053C5.21053 2.02065 5.50331 1.32118 6.02446 0.805456C6.54561 0.289731 7.25245 0 7.98947 0H24.6632V5.5H28.8316L33 11V17.875H30.2211C30.2211 18.969 29.7819 20.0182 29.0002 20.7918C28.2184 21.5654 27.1582 22 26.0526 22C24.9471 22 23.8868 21.5654 23.1051 20.7918C22.3234 20.0182 21.8842 18.969 21.8842 17.875H16.3263C16.3263 18.969 15.8871 20.0182 15.1054 20.7918C14.3237 21.5654 13.2634 22 12.1579 22C11.0524 22 9.99211 21.5654 9.21038 20.7918C8.42865 20.0182 7.98947 18.969 7.98947 17.875H5.21053V13.0625H3.82105ZM26.0526 19.9375C26.6054 19.9375 27.1355 19.7202 27.5264 19.3334C27.9173 18.9466 28.1368 18.422 28.1368 17.875C28.1368 17.328 27.9173 16.8034 27.5264 16.4166C27.1355 16.0298 26.6054 15.8125 26.0526 15.8125C25.4999 15.8125 24.9697 16.0298 24.5789 16.4166C24.188 16.8034 23.9684 17.328 23.9684 17.875C23.9684 18.422 24.188 18.9466 24.5789 19.3334C24.9697 19.7202 25.4999 19.9375 26.0526 19.9375ZM28.1368 7.5625H24.6632V11H30.8602L28.1368 7.5625ZM12.1579 19.9375C12.7107 19.9375 13.2408 19.7202 13.6317 19.3334C14.0225 18.9466 14.2421 18.422 14.2421 17.875C14.2421 17.328 14.0225 16.8034 13.6317 16.4166C13.2408 16.0298 12.7107 15.8125 12.1579 15.8125C11.6051 15.8125 11.075 16.0298 10.6841 16.4166C10.2933 16.8034 10.0737 17.328 10.0737 17.875C10.0737 18.422 10.2933 18.9466 10.6841 19.3334C11.075 19.7202 11.6051 19.9375 12.1579 19.9375Z\"\r\n fill=\"currentColor\"\r\n />\r\n </svg>\r\n );\r\n }\r\n }\r\n \r\n \r\n else if (reward_type === 'gift') {\r\n switch (badge?.type) {\r\n case 2:\r\n return (\r\n <Fragment>\r\n <span className={classNames('text-11px')}>Free</span>\r\n <span className={classNames('text-11px')}>Gift</span>\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 20 20\"\r\n fill=\"currentColor\"\r\n className={classNames('w-4 h-4')}\r\n >\r\n <path\r\n fillRule=\"evenodd\"\r\n d=\"M14 6a2.5 2.5 0 00-4-3 2.5 2.5 0 00-4 3H3.25C2.56 6 2 6.56 2 7.25v.5C2 8.44 2.56 9 3.25 9h6V6h1.5v3h6C17.44 9 18 8.44 18 7.75v-.5C18 6.56 17.44 6 16.75 6H14zm-1-1.5a1 1 0 01-1 1h-1v-1a1 1 0 112 0zm-6 0a1 1 0 001 1h1v-1a1 1 0 00-2 0z\"\r\n clipRule=\"evenodd\"\r\n />\r\n <path d=\"M9.25 10.5H3v4.75A2.75 2.75 0 005.75 18h3.5v-7.5zM10.75 18v-7.5H17v4.75A2.75 2.75 0 0114.25 18h-3.5z\" />\r\n </svg>\r\n </Fragment>\r\n );\r\n case 3:\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"currentColor\"\r\n className={classNames('w-6 h-6')}\r\n >\r\n <path d=\"M9.375 3a1.875 1.875 0 000 3.75h1.875v4.5H3.375A1.875 1.875 0 011.5 9.375v-.75c0-1.036.84-1.875 1.875-1.875h3.193A3.375 3.375 0 0112 2.753a3.375 3.375 0 015.432 3.997h3.943c1.035 0 1.875.84 1.875 1.875v.75c0 1.036-.84 1.875-1.875 1.875H12.75v-4.5h1.875a1.875 1.875 0 10-1.875-1.875V6.75h-1.5V4.875C11.25 3.839 10.41 3 9.375 3zM11.25 12.75H3v6.75a2.25 2.25 0 002.25 2.25h6v-9zM12.75 12.75v9h6.75a2.25 2.25 0 002.25-2.25v-6.75h-9z\" />\r\n </svg>\r\n );\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n","import React, { Fragment, useMemo, useContext, useEffect, useState } from 'react';\r\nimport { CartContext } from 'components/cart';\r\nimport classNames from 'lib/classNames';\r\nimport HeaderMachine from '../machines/HeaderMachine';\r\nimport { useMachine } from '@xstate/react';\r\nimport useRefState from 'hooks/useRefState';\r\nimport useCampaign from 'hooks/useCampaign';\r\nimport promisify from 'lib/promisify';\r\nimport { getAllOCUProducts } from './CheckoutButton';\r\nimport Axios from 'axios';\r\nimport { FilterAtuGoals } from '../Utils';\r\nimport GoalImageContent from './GoalImages';\r\n\r\nexport default function HeaderATU({ campaign_id, add_to_unlock, bundlesDiscounts }) {\r\n const {\r\n cart_settings: {\r\n theme: { primary, background },\r\n font: { color },\r\n rtl,\r\n money_format\r\n },\r\n campaigns,\r\n setShowConfetti,\r\n shopify_cart_items,\r\n Utils,\r\n add_to_cart,\r\n update_cart_item,\r\n get_total,\r\n productNotAddedToCart,\r\n onlyOneItemAddedToCart,\r\n productAddedToCart,\r\n discountCode,\r\n setCartItems,\r\n AppLocalStorage,\r\n hasAutoDiscount,\r\n shipProtectState\r\n } = useContext(CartContext);\r\n const [__, setContextCache, contextCache] = useRefState(null);\r\n const [one_check_up_sell_product_id, ocu_campaign] = useCampaign(\r\n 'one_check_up_sell',\r\n null,\r\n true\r\n )(campaigns, shopify_cart_items);\r\n const ocu_products = getAllOCUProducts(ocu_campaign);\r\n const filteredItems = shopify_cart_items.filter((item) => {\r\n const ocu_product = ocu_products.find(\r\n ({ product }) => item.product_id.toString() === product?.id\r\n );\r\n return ocu_product\r\n ? ocu_product.include_in_atu\r\n : !(['free_gift', 'singleton_gift'].includes(item?.product_type?.toLowerCase()) && item?.price === 0)\r\n });\r\n const { original, subtotal, autoDiscountGifts } = get_total(null, filteredItems);\r\n const byQuantity = add_to_unlock.multi_goal_type === 'quantity';\r\n const headerMachine = useMemo(\r\n () =>\r\n HeaderMachine({\r\n campaign_id,\r\n goals: FilterAtuGoals(\r\n add_to_unlock.goals,\r\n !!discountCode?.value || hasAutoDiscount\r\n ),\r\n show_badges:add_to_unlock.show_badges,\r\n setShowConfetti,\r\n shopify_cart_items: filteredItems,\r\n original,\r\n autoDiscountGifts,\r\n subtotal,\r\n bundlesDiscounts,\r\n discountCode,\r\n byQuantity,\r\n contextCache: contextCache.current\r\n }),\r\n [\r\n shopify_cart_items,\r\n add_to_unlock,\r\n bundlesDiscounts,\r\n contextCache.current,\r\n hasAutoDiscount,\r\n discountCode,\r\n shipProtectState\r\n ]\r\n );\r\n // const [current, send, service] = useMachine(headerMachine);\r\n const { context } = headerMachine;\r\nconst hasImage = context.goals.filter(({ goalObject: { badge } }) => add_to_unlock.show_badges).length > 0;\r\n useEffect(() => {\r\n const giftGoals = context.goals.filter(\r\n ({ goalObject }) => goalObject.reward_type === 'gift'\r\n );\r\n if (giftGoals.length) {\r\n handleGifts({\r\n giftGoals,\r\n AppLocalStorage,\r\n Utils,\r\n discountCode,\r\n productNotAddedToCart,\r\n onlyOneItemAddedToCart,\r\n productAddedToCart,\r\n setCartItems\r\n });\r\n }\r\n }, [discountCode, shopify_cart_items]);\r\n\r\n useEffect(() => {\r\n if (JSON.stringify(context) !== JSON.stringify(contextCache.current)) {\r\n if (contextCache.current) {\r\n const showConfettiPreview = context?.goals?.filter(\r\n ({ goalObject: { confetti } }, i) =>\r\n confetti && !contextCache?.current?.goals[i]?.goalObject?.confetti\r\n );\r\n if (showConfettiPreview.length) {\r\n setShowConfetti(showConfettiPreview[0].goalObject.confetti_length);\r\n }\r\n }\r\n setContextCache(context);\r\n }\r\n }, [context]);\r\n\r\n const hasLongBadgePrice = context?.goals?.filter(({goalObject}) => {\r\n const {badge,goal} = goalObject\r\n if(!badge) return false;\r\n const formattedGoal = badge?.text?.text.replace('{{goal}}', add_to_unlock.multi_goal_type === 'quantity' ? goal : Utils.formatMoney(goal * 100,money_format));\r\n const matches = formattedGoal.match(/>(.*?)<|^[^<>]+$/);\r\n const extractedText =\r\n matches && matches.length > 1 && matches[1]\r\n ? matches[1]\r\n : matches && matches.length > 0\r\n ? matches[0]\r\n : \"\";\r\n\r\n return extractedText\r\n ? extractedText.length > 8 && extractedText.split(\" \").length > 1\r\n : false;\r\n }).length\r\n \r\n return (\r\n <div\r\n className={classNames('atu-banner px-5 pb-2 mb-px border-b border-gray-400')}\r\n data-offset={1}\r\n style={{\r\n background: add_to_unlock.progress_background\r\n ? Utils.formatColor(add_to_unlock.progress_background)\r\n : 'inherit',\r\n paddingBottom: hasImage ? hasLongBadgePrice ? '43px' : \"30px\" : undefined,\r\n }}\r\n data-quantity={`${filteredItems.map((item) => item.quantity).reduce((acc, item) => acc + item, 0)}`}\r\n // data-subtotal={`${subtotal}`}\r\n >\r\n <div className={classNames('goal-text w-full')} \r\n style={{\r\n marginBottom: hasImage ? '20px': undefined,\r\n }}\r\n >\r\n {context.goals.map(\r\n ({ textKey, goalObject, unlocked, previousIsUnlocked, isFirst, isLast }, index) => (\r\n <GoalText\r\n key={textKey}\r\n unlocked={unlocked}\r\n bundlesDiscounts={bundlesDiscounts}\r\n currentGoal={goalObject}\r\n add_to_unlock={add_to_unlock}\r\n filteredItems={filteredItems}\r\n otherUnlockedDiscounts={context.goals.filter(\r\n ({ unlocked, goalObject: { reward_type } }, i) =>\r\n i !== index && unlocked && reward_type === 'discount'\r\n )}\r\n previousIsUnlocked={previousIsUnlocked}\r\n show_all_locked_goals={add_to_unlock.show_all_locked_goals}\r\n {...{ isFirst, isLast }}\r\n />\r\n )\r\n )}\r\n </div>\r\n <div\r\n className={classNames(\r\n 'progress-bar-container flex w-full relative mix-blend-darken',\r\n add_to_unlock.progress_thick ? 'h-4 rounded-4' : 'h-2 rounded-2'\r\n )}\r\n style={{\r\n background: Utils.formatColor(add_to_unlock.progress_secondary),\r\n }}\r\n >\r\n <div\r\n className={classNames(\r\n 'progress-bar block transition-width absolute inset-0 duration-500 ease-out z-10',\r\n add_to_unlock.progress_thick ? 'h-4 rounded-4' : 'h-2 rounded-2'\r\n )}\r\n style={{\r\n background:\r\n context.goals.filter(({ unlocked }) => !unlocked).length > 0\r\n ? Utils.formatColor(add_to_unlock.progress_primary)\r\n : Utils.formatColor(add_to_unlock.progress_complete),\r\n width: `${\r\n context.goals.reduce((acc, cur) => {\r\n const { unlocked, isFirst, previousIsUnlocked, value } = cur;\r\n return isFirst || previousIsUnlocked ? acc + value : acc;\r\n }, 0) / context.goals.length\r\n }%`\r\n }}\r\n />\r\n {context.goals.map(({ key,goalObject, isFirst, isLast,unlocked }, index) => (\r\n <ProgressBar\r\n key={key}\r\n add_to_unlock={add_to_unlock}\r\n unlocked={unlocked}\r\n goal={goalObject}\r\n goals={context.goals}\r\n isFirst={isFirst}\r\n isLast={isLast}\r\n borderColor=\"#718096\"\r\n />\r\n ))}\r\n </div>\r\n {/* {context.goals.length > 1 && ( */}\r\n <div className={classNames('goals flex justify-between text-gray-600 relative h-3')}>\r\n {context.goals.map(\r\n ({ labelKey, goalObject, isLast }, index) => {\r\n const { goal_text,badge,reward_type, show_goal_text } = goalObject;\r\n if (!show_goal_text || !!add_to_unlock.show_badges) return null;\r\n return (\r\n <div\r\n key={labelKey}\r\n className={classNames('goal absolute transform w-max text-center')}\r\n data-goal={Utils.formatMoney(goalObject.goal * 100 * (parseFloat(window.Shopify.currency.rate) || 1), money_format)}\r\n style={{\r\n left: !rtl && `${((index + 1) / context.goals.length) * 100}%`,\r\n right: rtl && `${((index + 1) / context.goals.length) * 100}%`,\r\n width: hasImage ? `${100 / context.goals.length}%` : 'fit-content',\r\n whiteSpace: 'nowrap',\r\n fontSize: Utils.em(goal_text.font_size),\r\n color: Utils.formatColor(goal_text.color),\r\n '--transform-translate-x': hasImage ? `${100 * (rtl ? 1 : -1)}%` : `${\r\n (isLast ? 100 : 50) * (rtl ? 1 : -1)\r\n }%`\r\n }}\r\n >\r\n {goal_text.text}\r\n </div>\r\n );\r\n }\r\n )}\r\n </div>\r\n {/* )} */}\r\n </div>\r\n );\r\n}\r\n\r\nconst ProgressBar = ({ isFirst, isLast, borderColor, goal,goals, unlocked,add_to_unlock }) => {\r\n const {\r\n cart_settings: {\r\n theme: { background },\r\n rtl,\r\n money_format\r\n },\r\n Utils\r\n } = useContext(CartContext);\r\n const {reward_type, badge } = goal;\r\n const formattedGoal = badge?.text?.text.replace('{{goal}}', add_to_unlock.multi_goal_type === 'quantity' ? goal.goal : Utils.formatMoney(goal.goal * 100,money_format));\r\n const hasUploadedImage = badge?.type === 1 && badge?.image\r\n const roundedFirst = add_to_unlock.progress_thick ? rtl ? 'rounded-r-4' : 'rounded-l-4' : rtl ? 'rounded-r-2' : 'rounded-l-2';\r\n const roundedLast = add_to_unlock.progress_thick ? rtl ? 'rounded-l-4' : 'rounded-r-4' : rtl ? 'rounded-l-2' : 'rounded-r-2';\r\n const goalsLength = goals.length\r\n const direction = (size) => ({[rtl? 'right' : 'left']: size})\r\n // right-1/2\r\n // left-1/2\r\n // right-4\r\n // left-4\r\n const completed = goals.filter(({ unlocked }) => !unlocked).length === 0\r\n \r\n return (\r\n <div\r\n className={classNames('badge-goal relative flex-1 bg-transparent z-20 mix-blend-overlay', \r\n add_to_unlock.progress_thick ? 'h-4' : 'h-2',\r\n {\r\n [roundedFirst]: isFirst,\r\n [roundedLast]: isLast,\r\n 'border-r': !add_to_unlock.show_badges && !rtl && !isLast,\r\n 'border-l': !add_to_unlock.show_badges && rtl && !isLast\r\n })}\r\n style={{ borderColor, display: 'block' }}\r\n >\r\n {!!add_to_unlock.show_badges && badge && <div \r\n className={classNames('z-20 w-55px h-55px rounded-full border-3 absolute top-1/2 transform text-12px font-bold leading-tight')} \r\n style={{\r\n ...direction(goalsLength > 2 ? '50%' : goalsLength === 1 ? '80%' : isFirst ? '85%' : '70%'),\r\n background: Utils.formatColor(background),\r\n color: Utils.formatColor(add_to_unlock.progress_primary),\r\n '--transform-translate-y': '-50%',\r\n '--transform-translate-x': !(goalsLength === 2 && isFirst) ? '-50%' : 0,\r\n borderColor: Utils.formatColor(unlocked ? completed ? add_to_unlock.progress_complete : add_to_unlock.progress_primary : add_to_unlock.progress_secondary),\r\n }}>\r\n <div style={{\r\n backgroundImage: hasUploadedImage ? `url(${badge?.image})` : undefined\r\n }} className={classNames('relative bg-cover bg-center flex items-center justify-center flex-col w-full h-full rounded-full')}>\r\n {!hasUploadedImage && <GoalImageContent goal={goal} />}\r\n <span className={classNames('absolute w-full text-center', {\r\n hidden: badge.show_text !== true\r\n })} style={{top: '53px', \r\n fontSize: Utils.em(badge?.text?.font_size),\r\n color: Utils.formatColor(badge?.text?.color),\r\n }} dangerouslySetInnerHTML={{__html:formattedGoal}}/>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n );\r\n};\r\n\r\nconst textIsEmpty = (html) => {\r\n const element = document.createElement('span');\r\n element.innerHTML = html;\r\n return element.innerText.length === 0;\r\n};\r\n\r\nconst GoalText = ({\r\n currentGoal,\r\n add_to_unlock: { multi_goal_type },\r\n unlocked,\r\n otherUnlockedDiscounts,\r\n previousIsUnlocked,\r\n show_all_locked_goals,\r\n bundlesDiscounts,\r\n filteredItems,\r\n isLast,\r\n isFirst\r\n}) => {\r\n const {\r\n cart_settings: {\r\n font: { color },\r\n money_format\r\n },\r\n Utils,\r\n get_total,\r\n discountCode\r\n } = useContext(CartContext);\r\n const { goal, reward_type } = currentGoal;\r\n const reward = currentGoal[reward_type];\r\n const isDiscount = reward_type === 'discount';\r\n const notTheHighestDiscount = isDiscount\r\n ? !!otherUnlockedDiscounts.find(\r\n ({ goalObject: { discount } }) => discount.reward > reward.reward\r\n )\r\n : false;\r\n const text = unlocked ? reward.after : reward.before;\r\n // if (\r\n // textIsEmpty(text) ||\r\n // notTheHighestDiscount ||\r\n // previousIsUnlocked === false ||\r\n // (!isLast && !show_all_locked_goals)\r\n // )\r\n // return null;\r\n if (\r\n !textIsEmpty(text) &&\r\n !notTheHighestDiscount &&\r\n ((show_all_locked_goals && unlocked) ||\r\n (isFirst && !unlocked) ||\r\n (isLast && unlocked) ||\r\n (!unlocked && previousIsUnlocked))\r\n )\r\n // if(!textIsEmpty(text) && !notTheHighestDiscount &&\r\n // ((isFirst && ((unlocked && show_all_locked_goals) || !unlocked) ) ||\r\n // (isLast && (unlocked || (!unlocked && previousIsUnlocked)))) ||\r\n // (!isLast && !isFirst && ((unlocked && show_all_locked_goals) || (!unlocked && previousIsUnlocked)))\r\n // )\r\n return (\r\n <div\r\n className={classNames('emoji-image mb-0 text-center')}\r\n style={{ color }}\r\n dangerouslySetInnerHTML={{\r\n __html: formateText(\r\n text,\r\n reward_type,\r\n reward,\r\n (v) => Utils.formatMoney(v, money_format),\r\n get_total,\r\n goal,\r\n multi_goal_type,\r\n filteredItems,\r\n bundlesDiscounts,\r\n discountCode\r\n )\r\n }}\r\n ></div>\r\n );\r\n else return null;\r\n};\r\n\r\nconst formateText = (\r\n text,\r\n rewardType,\r\n { type, reward },\r\n formatMoney,\r\n get_total,\r\n goal,\r\n multi_goal_type,\r\n filteredItems,\r\n bundlesDiscounts,\r\n discountCode\r\n) => {\r\n const rate = Number(window.Shopify.currency.rate);\r\n let replacedReward =\r\n rewardType === \"discount\"\r\n ? type === \"percentage\"\r\n ? `${reward}%`\r\n : formatMoney(reward * rate * 100)\r\n : \"\";\r\n const formattedGoal = parseInt(goal * 100);\r\n const { subtotal, original } = get_total(null, filteredItems);\r\n\tconst totalPrice = filteredItems.reduce((acc, cur) => {\r\n\t\tlet price;\r\n\t\tif(cur.selling_plan_allocation && cur.selling_plan_allocation.compare_at_price) {\r\n\t\t\tprice = cur.selling_plan_allocation.compare_at_price;\r\n\t\t} else {\r\n\t\t\tprice = cur.price;\r\n\t\t}\r\n\t\treturn acc + price * cur.quantity - cur.discounts?.reduce((acc, { amount }) => acc + amount, 0);\r\n\t}, 0);\r\n const currentAmount = rewardType === 'free_shipping' ? (window.mu_include_sub_full_price ? totalPrice : subtotal) : original - bundlesDiscounts;\r\n let replacedAmount = formatMoney(formattedGoal - currentAmount);\r\n let replacedQuantity =\r\n goal - filteredItems.map((item) => item.quantity).reduce((acc, item) => acc + item, 0);\r\n\r\n return text\r\n .replace(\r\n '{{amount_left}}',\r\n multi_goal_type === 'quantity' ? replacedQuantity : replacedAmount\r\n )\r\n .replace('{{reward}}', replacedReward)\r\n .replace('{{goal}}', formatMoney(goal * 100))\r\n .replace('https://www.amabattery.co.za/wpimages/wp4cb45f10.gif', 'https://monster-upsells-images-prod.s3.us-east-2.amazonaws.com/wp4cb45f10.gif')\r\n};\r\n\r\nfunction pickRandomGift({ AppLocalStorage, variants, key }) {\r\n const cachedVariant = AppLocalStorage.getItem(key);\r\n const generateVariant = () => {\r\n const variant = [...variants].sort(() => 0.5 - Math.random())[0];\r\n AppLocalStorage.setItem(\r\n key,\r\n JSON.stringify({\r\n cached_at: Date.now(),\r\n variant\r\n })\r\n );\r\n return variant;\r\n };\r\n if (cachedVariant) {\r\n const { cached_at, variant } = JSON.parse(cachedVariant);\r\n const eleven_hours = 12 * 60 * 60 * 100;\r\n if (Date.now() - cached_at > eleven_hours) {\r\n return generateVariant();\r\n }\r\n return variant;\r\n }\r\n return generateVariant();\r\n}\r\n\r\nfunction getVariants(products) {\r\n return products.map(({ variants }) => variants).flat();\r\n}\r\n\r\nfunction addedVariants(variants, productAddedToCart, type = 'find') {\r\n if (!['find', 'filter'].includes(type)) throw new Error('type must be find or filter');\r\n return variants[type]((variant) => productAddedToCart(variant, true));\r\n}\r\n\r\nasync function handleGifts({\r\n giftGoals,\r\n AppLocalStorage,\r\n Utils,\r\n discountCode,\r\n productNotAddedToCart,\r\n onlyOneItemAddedToCart,\r\n productAddedToCart,\r\n setCartItems\r\n}) {\r\n const { add, remove } = giftGoals.reduce(\r\n (acc, goal, index) => {\r\n const { campaign_id, key, goalObject } = goal;\r\n const { product, multi_gift_select, previous_gift } = goalObject.gift;\r\n const products =\r\n goalObject.gift.products ||\r\n [\r\n goalObject.gift.product\r\n ? { variants: [{ id: goalObject.gift.product.variant_id }] }\r\n : null\r\n ].filter(Boolean);\r\n const previous_goal = previous_gift === 'remove' && index > 0 && giftGoals[index - 1];\r\n const next_goal = index < giftGoals.length - 1 && giftGoals[index + 1];\r\n const giftsCount = products?.length;\r\n const isRandom = multi_gift_select === 'random';\r\n const GiftMustBeAddedManually =\r\n !isRandom && (giftsCount === 1 ? !Utils.productHasOneVariant(products[0]) : true);\r\n const variants = getVariants(\r\n products ||\r\n [product ? { variants: [{ id: product.variant_id }] } : null].filter(Boolean)\r\n );\r\n const oneVariantIsAdded = addedVariants(variants, productAddedToCart);\r\n const randomVariant =\r\n !oneVariantIsAdded &&\r\n pickRandomGift({\r\n AppLocalStorage,\r\n variants,\r\n key: `multi_gifts_${campaign_id}_${key}`\r\n });\r\n const { origin } = window.location;\r\n variants.forEach((variant) => {\r\n const action = handleGiftProduct({\r\n goal,\r\n variant,\r\n discountCode,\r\n productNotAddedToCart,\r\n onlyOneItemAddedToCart,\r\n productAddedToCart\r\n });\r\n if (action) {\r\n if (action === 'add' && products) {\r\n if (previous_goal && !GiftMustBeAddedManually) {\r\n const gift = previous_goal.goalObject.gift;\r\n const previous_goal_products =\r\n gift.products ||\r\n [\r\n gift.product\r\n ? { variants: [{ id: gift.product.variant_id }] }\r\n : null\r\n ].filter(Boolean);\r\n const added_variants = addedVariants(\r\n getVariants(previous_goal_products),\r\n productAddedToCart,\r\n 'filter'\r\n );\r\n added_variants.forEach((variant) => {\r\n acc['remove'].push({ id: variant.id });\r\n });\r\n }\r\n if (\r\n next_goal &&\r\n next_goal.unlocked &&\r\n next_goal.goalObject.gift.previous_gift === 'remove' &&\r\n variants.find((v) => v.id === variant.id)\r\n ) {\r\n return;\r\n }\r\n if (\r\n GiftMustBeAddedManually ||\r\n (isRandom && variant.id !== randomVariant.id)\r\n ) {\r\n return;\r\n }\r\n }\r\n acc[action].push({ id: variant.id });\r\n }\r\n });\r\n return acc;\r\n },\r\n { add: [], remove: [] }\r\n );\r\n if (add.length) {\r\n const updates = add.reduce((acc, { id }) => ({ ...acc, [id]: 1 }), {});\r\n const { data } = await Axios.post(Utils.getLangPath('cart/update.js'), { updates });\r\n if (data?.items) {\r\n setCartItems(data.items, data.cart_level_discount_applications);\r\n }\r\n }\r\n if (remove.length) {\r\n const updates = remove.reduce((acc, { id }) => ({ ...acc, [id]: 0 }), {});\r\n const { data } = await Axios.post(Utils.getLangPath('cart/update.js'), { updates });\r\n if (data?.items) {\r\n setCartItems(data.items.filter(({quantity}) => quantity !== 0), data.cart_level_discount_applications);\r\n }\r\n }\r\n}\r\nfunction handleGiftProduct({\r\n goal,\r\n variant,\r\n discountCode,\r\n productNotAddedToCart,\r\n onlyOneItemAddedToCart,\r\n productAddedToCart\r\n}) {\r\n const { unlocked } = goal;\r\n if (!variant) return;\r\n // we're using !onlyOneItemAddedToCart(product) here, because add will force the item quantity to be 1\r\n if (\r\n unlocked &&\r\n (productNotAddedToCart(variant, true) || !onlyOneItemAddedToCart(variant, true))\r\n ) {\r\n return 'add';\r\n } else if (!unlocked && productAddedToCart(variant, true)) {\r\n return 'remove';\r\n }\r\n return null;\r\n}\r\n","function addPrefix(string, prefix = 'mu-') {\r\n\tconst splice = (string, index, prefix) => string.slice(0, index) + prefix + string.slice(index);\r\n\treturn string\r\n\t\t.split(' ')\r\n\t\t.map((c) => {\r\n\t\t\tif (c.indexOf(':') !== -1) {\r\n\t\t\t\treturn splice(c, c.indexOf(':') + 1, prefix);\r\n\t\t\t}\r\n\t\t\treturn prefix + c;\r\n\t\t})\r\n\t\t.join(' ');\r\n}\r\n\r\nmodule.exports = addPrefix;\r\n","import { useState, useRef } from 'react';\r\n\r\nconst useRefState = (initialState, log) => {\r\n const [state, setState] = useState(initialState);\r\n if (log) console.log(log, state);\r\n const stateRef = useRef(initialState);\r\n return [\r\n state,\r\n newState => {\r\n stateRef.current = newState;\r\n setState(newState);\r\n },\r\n stateRef\r\n ];\r\n};\r\n\r\nexport default useRefState;\r\n","import { getIn, setIn, hasIn } from 'immutable';\r\nimport { NEW_CAMPAIGN_INITIAL_STATE, SHOP_DEFAULT_SETTINGS } from 'lib/globals';\r\n\r\nconst useBindToContext = (\r\n BindToContext,\r\n value = null,\r\n onChange = null,\r\n specificValidation = null,\r\n getError = null,\r\n validation = true,\r\n debug = false\r\n) => {\r\n if (debug) console.log('value changed', value);\r\n if (!BindToContext) return [value, onChange];\r\n const [\r\n { state, setItem, validationErrors, validate },\r\n path,\r\n inlineOnChange = null,\r\n type = 'campaign'\r\n ] = BindToContext;\r\n const hasError = !!(typeof getError === 'boolean' ? getError : validationErrors[path]);\r\n\r\n //in case we add new settings we want out ui to work with old ones\r\n let returnValue = getIn(state, path.split('.'));\r\n\r\n // const onRender = [];\r\n if ([null, undefined].includes(returnValue)) {\r\n returnValue =\r\n type === 'campaign'\r\n ? getIn(NEW_CAMPAIGN_INITIAL_STATE(), path.split('.'))\r\n : getIn(SHOP_DEFAULT_SETTINGS('english'), path.replace('settings.', '').split('.'));\r\n // onRender.push(() => setItem(path, returnValue));\r\n }\r\n\r\n return [\r\n returnValue,\r\n value => {\r\n setItem(path, value);\r\n if (inlineOnChange) {\r\n inlineOnChange(value, setItem);\r\n }\r\n if (validate && validation && hasError)\r\n validate(setIn(state, path.split('.'), value), [specificValidation || path]);\r\n },\r\n hasError\r\n // onRender\r\n ]; //we're returning here [ value , onChange, hasError ]\r\n};\r\nexport default useBindToContext;\r\n","import React, { useContext, useState, useEffect, useRef } from 'react';\r\nimport loadable from '@loadable/component';\r\nimport { CartContext } from 'components/cart';\r\nimport useCampaign from 'hooks/useCampaign';\r\nimport classNames from 'lib/classNames';\r\nimport { FilterAtuGoals } from '../Utils';\r\nconst Scary = loadable(() => import('./scary'));\r\nconst Announcement = loadable(() => import('./announcement'));\r\nconst HeaderATU = loadable(() => import('./Header_ATU'));\r\n\r\nconst Header = (props) => {\r\n const {\r\n cart_settings: {\r\n header,\r\n theme: { background, primary },\r\n rtl,\r\n curved,\r\n scary = {},\r\n announcement = {},\r\n modules: { checkout_button },\r\n },\r\n slider: { slickGoTo, active_slide },\r\n scrollbars_ref,\r\n shopify_cart_items,\r\n campaigns,\r\n Utils,\r\n isPreview,\r\n close,\r\n productAddedToCart,\r\n discountCode\r\n } = useContext(CartContext);\r\n const loadingBarRef = useRef();\r\n const back = () => {\r\n slickGoTo(0);\r\n scrollbars_ref.scrollTop = 0;\r\n };\r\n const [add_to_unlock_product_id, add_to_unlock_campaign, isGlobal] = useCampaign(\r\n 'add_to_unlock',\r\n null,\r\n true\r\n )(campaigns, shopify_cart_items);\r\n const { add_to_unlock, campaign_key } = add_to_unlock_campaign || {};\r\n const goals = add_to_unlock?.goals || [];\r\n const filterGoalsBasedOnDiscount = FilterAtuGoals(goals, !!discountCode);\r\n const CAN_RENDER_ADD_TO_UNLOCK =\r\n filterGoalsBasedOnDiscount.length &&\r\n add_to_unlock?.isActive &&\r\n (productAddedToCart({ id: add_to_unlock_product_id }) ||\r\n (isGlobal && shopify_cart_items.length));\r\n const bundlesDiscounts = Utils.getDiscount({\r\n campaigns,\r\n items: shopify_cart_items,\r\n getBundlesOnly: true\r\n });\r\n return (\r\n <div\r\n id=\"mu-header\"\r\n className={classNames({\r\n shadow: !CAN_RENDER_ADD_TO_UNLOCK && !scary.placement === 'top'\r\n })}\r\n ref={props.headerRef}\r\n // style={{\r\n // \tbackground: Utils.formatColor(background),\r\n // \tborderRadius: curved ? \"16px 16px 0px 0px\" : \"\"\r\n // }}\r\n >\r\n <div\r\n className={classNames('flex items-center relative')}\r\n style={{\r\n background: Utils.formatColor(header.background),\r\n color: Utils.formatColor(header.title.color),\r\n borderRadius: curved ? '15px 15px 0px 0px' : ''\r\n }}\r\n >\r\n <div\r\n className={classNames('px-5 py-3',\r\n // rtl ? 'pl-2' : 'pr-2',\r\n active_slide !== 1 ? 'opacity-0' : 'cursor-pointer'\r\n )}\r\n onClick={active_slide !== 1 ? () => {}: () => back()}\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n style={{ width: 15, height: 15 }}\r\n focusable=\"false\"\r\n data-icon=\"chevron-left\"\r\n onClick={() => back()}\r\n className={classNames('cursor-pointer')}\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox={rtl ? '0 0 320 512' : '0 0 384 512'}\r\n >\r\n {!rtl && (\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z\"\r\n ></path>\r\n )}\r\n {rtl && (\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z\"\r\n ></path>\r\n )}\r\n </svg>\r\n </div>\r\n <span\r\n className={classNames('cart-header flex-1 flex-grow text-center font-bold py-3')}\r\n style={{\r\n fontSize: Utils.em(header.title.font_size),\r\n fontWeight: header.title.font_weight\r\n }}\r\n >\r\n {header.title.text}\r\n </span>\r\n <div className={classNames(\"px-5 py-3\",\r\n // rtl ? 'pr-2' : 'pl-2',\r\n 'cursor-pointer')}\r\n onClick={() => (close ? close() : null)}\r\n >\r\n <svg\r\n aria-hidden=\"true\"\r\n style={{ width: 15, height: 15 }}\r\n focusable=\"false\"\r\n data-icon=\"times\"\r\n className={classNames('cursor-pointer')}\r\n role=\"img\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 384 512\"\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M323.1 441l53.9-53.9c9.4-9.4 9.4-24.5 0-33.9L279.8 256l97.2-97.2c9.4-9.4 9.4-24.5 0-33.9L323.1 71c-9.4-9.4-24.5-9.4-33.9 0L192 168.2 94.8 71c-9.4-9.4-24.5-9.4-33.9 0L7 124.9c-9.4 9.4-9.4 24.5 0 33.9l97.2 97.2L7 353.2c-9.4 9.4-9.4 24.5 0 33.9L60.9 441c9.4 9.4 24.5 9.4 33.9 0l97.2-97.2 97.2 97.2c9.3 9.3 24.5 9.3 33.9 0z\"\r\n ></path>\r\n </svg>\r\n </div>\r\n </div>\r\n {!!shopify_cart_items.length &&\r\n announcement?.isActive &&\r\n announcement.position === 'bellow_header' && (\r\n <Announcement announcement={announcement} />\r\n )}\r\n {!!shopify_cart_items.length && scary.isActive && scary.placement === 'top' && (\r\n <Scary scary={scary} />\r\n )}\r\n {!checkout_button.fix_checkout_container && !!CAN_RENDER_ADD_TO_UNLOCK && (\r\n <HeaderATU\r\n campaign_id={campaign_key && campaign_key[1]}\r\n add_to_unlock={add_to_unlock}\r\n bundlesDiscounts={bundlesDiscounts}\r\n />\r\n )}\r\n </div>\r\n );\r\n};\r\n\r\nexport default Header;\r\n","import React from 'react';\r\nimport PropTypes from 'prop-types';\r\nimport loadable from '@loadable/component'\r\nimport CheckoutButton from './CheckoutButton';\r\n\r\nconst RandomText = loadable(() => import('./RandomText'))\r\nconst OrderNote = loadable(() => import('./OrderNote'))\r\n\r\nconst ExtraModule = ({ moduleKey, modules, cartNote }) => {\r\n\tconst { random_text, checkout_button, order_note } = modules;\r\n\r\n\tswitch (moduleKey) {\r\n\t\tcase 'random_text':\r\n\t\t\treturn random_text.active ? <RandomText /> : null;\r\n\t\tcase 'order_note':\r\n\t\t\treturn order_note.active ? <OrderNote cartNote={cartNote} /> : null;\r\n\t\tcase 'checkout_button':\r\n\t\t\treturn <CheckoutButton />;\r\n\r\n\t\tdefault:\r\n\t\t\treturn null;\r\n\t}\r\n};\r\n\r\nExtraModule.propTypes = {};\r\n\r\nexport default ExtraModule;\r\n","import React, { useContext } from 'react';\r\nimport { CartContext } from 'components/cart';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'lib/classNames';\r\n\r\nconst EmptyState = () => {\r\n\tconst { \r\n\t\tUtils,\r\n\t\tcart_settings :{\r\n\t\t\tempty_cart,\r\n\t\t\tactive_continue_shopping_button,\r\n\t\t\tactive_continue_shopping_underlined,\r\n\t\t\tcontinue_shopping_button\r\n\t\t}\r\n\t } = useContext(CartContext);\r\n\treturn (\r\n\t\t<div id=\"mu-empty-cart\" className={classNames('relative p-3 empty-cart w-full min-w-full max-w-full')}>\r\n\t\t\t<div dangerouslySetInnerHTML={{ __html: empty_cart }}></div>\r\n\t\t\t{\r\n\t\t\t\tactive_continue_shopping_button && (\r\n\t\t\t\t\t<div\r\n \t\tid=\"mu-continue-shopping\"\r\n\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\tif (window.mu_continue_shopping_logic) {\r\n\t\t\t\t\t\t\tconst continueExecuting =\r\n\t\t\t\t\t\t\t\twindow.mu_continue_shopping_logic();\r\n\t\t\t\t\t\t\tif (continueExecuting === false) return;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (window.closeCart) window.closeCart();\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tclassName={classNames(\r\n\t\t\t\t\t\t\t\"custom-btn w-full w-full py-2 mb-2 text-center cursor-pointer\"\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\tcolor: Utils.formatColor(\r\n\t\t\t\t\t\t\tcontinue_shopping_button.color\r\n\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\tfontSize: `${continue_shopping_button.font_size}em`,\r\n\t\t\t\t\t\t\tfontWeight: `${continue_shopping_button.font_weight}`,\r\n\t\t\t\t\t\t\ttextDecoration:\r\n\t\t\t\t\t\t\tactive_continue_shopping_underlined && \"underline\"\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{continue_shopping_button.text}\r\n\t\t\t\t\t</div>\r\n \t\t\t)\r\n\t\t\t}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nEmptyState.propTypes = {};\r\n\r\nexport default EmptyState;\r\n","export const ADD_ITEM = \"ADD_ITEM\";\r\nexport const MERGE_ITEM = \"MERGE_ITEM\";\r\nexport const REMOVE_ITEM = \"REMOVE_ITEM\";\r\nexport const ADD_ITEMS = \"ADD_ITEMS\";\r\nexport const SET_ITEMS = \"SET_ITEMS\";\r\nexport const SET_CART_NOTE = \"SET_CART_NOTE\";\r\nexport const SET_PRODUCT_ID = \"SET_PRODUCT_ID\";\r\nexport const SET_CAMPAIGN = \"SET_CAMPAIGN\";\r\nexport const ADD_UPSELL = \"ADD_UPSELL\";\r\nexport const REMOVE_UPSELL = \"REMOVE_UPSELL\";\r\n\r\nconst fixItemPrice = (item) => {\r\n const { price, line_price, quantity, discounts } = item;\r\n if (!discounts?.length && line_price > 0 && price * quantity !== line_price) {\r\n item.price = line_price / quantity;\r\n }\r\n return item;\r\n};\r\n\r\nfunction getBagSelectors() {\r\n const initialSelectors = [\r\n \".icon_cart .tcount\",\r\n \".sticky_nav .cart_count\",\r\n \"#header .cart_count\",\r\n \"[data-desktop-header] .cart_count\",\r\n \".cart-count-bubble span\",\r\n \".sticky_nav .header-right + div .cart-count\",\r\n \".sticky_nav .header-right .cart-count\",\r\n \"#header .cart-count\",\r\n \"[data-desktop-header] .cart-count\",\r\n \"[data-cart-count]\",\r\n \"#shopify-section-toolbar_mobile [data-cart-count]\",\r\n \".cart-icon--basket2 > div\",\r\n \"[aria-label='Cart'] > div\",\r\n \".header__icon-list .header__cart-count\",\r\n \".hidden-pocket .header__cart-count\",\r\n \"#nav-user #cart-count\",\r\n \"#nav #cart-count\",\r\n \".mobile-header-wrap .cart-item-count-header\",\r\n \"#site-header .cart-item-count-header\",\r\n \".count-bubble.count-bubble--md\",\r\n \".page__header--desktop [data-count]\",\r\n \".page__header--mobile [data-count]\",\r\n \"span.cartCount\",\r\n \"[data-js-cart-count]\",\r\n \".header__row-mobile [data-js-cart-count]\",\r\n \"#navbar-desktop .cart-count-badge\",\r\n \"#navbar-mobile .cart-count-badge\",\r\n ];\r\n return initialSelectors.concat(\r\n window.mu_bag_selecor || window.mu_bag_selector || []\r\n );\r\n}\r\n\r\nfunction updateBagCounter(item_count) {\r\n if (item_count) {\r\n const dawn_icon = document.querySelector(\"#cart-icon-bubble\");\r\n const dawn_counter = document.querySelector(\".cart-count-bubble span\");\r\n const envy_counters = document.querySelectorAll(\r\n \"span.cart-item-count-header:not(.show)\"\r\n );\r\n if (dawn_icon && !dawn_counter) {\r\n const cart_svg = dawn_icon.querySelector(\".icon.icon-cart-empty\");\r\n if (cart_svg) {\r\n cart_svg.outerHTML = `<svg class=\"icon icon-cart\" aria-hidden=\"true\" focusable=\"false\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 40\" fill=\"none\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M20.5 6.5a4.75 4.75 0 00-4.75 4.75v.56h-3.16l-.77 11.6a5 5 0 004.99 5.34h7.38a5 5 0 004.99-5.33l-.77-11.6h-3.16v-.57A4.75 4.75 0 0020.5 6.5zm3.75 5.31v-.56a3.75 3.75 0 10-7.5 0v.56h7.5zm-7.5 1h7.5v.56a3.75 3.75 0 11-7.5 0v-.56zm-1 0v.56a4.75 4.75 0 109.5 0v-.56h2.22l.71 10.67a4 4 0 01-3.99 4.27h-7.38a4 4 0 01-4-4.27l.72-10.67h2.22z\"></path></svg>`;\r\n let cart_bubble = document.createElement(\"div\");\r\n cart_bubble.setAttribute(\"class\", \"cart-count-bubble\");\r\n cart_bubble.innerHTML = `<span aria-hidden=\"true\">${item_count}</span><span class=\"visually-hidden\">${item_count} items</span>`;\r\n dawn_icon.appendChild(cart_bubble);\r\n }\r\n }\r\n if (envy_counters.length) {\r\n envy_counters.forEach((envy_counter) => {\r\n envy_counter.classList.add(\"show\");\r\n envy_counter.classList.remove(\"hide\");\r\n });\r\n }\r\n }\r\n let selectors = getBagSelectors();\r\n selectors.forEach((selector) => {\r\n const count = item_count || 0;\r\n const formatted_count = window.mu_cart_count_formatter ? window.mu_cart_count_formatter(count) : count;\r\n if (typeof selector === \"function\") {\r\n selector(formatted_count);\r\n } else if (document.querySelectorAll(selector).length) {\r\n let counter = document.querySelectorAll(selector)[0];\r\n\r\n let child_nodes = counter.querySelectorAll(\"*\");\r\n\r\n if (child_nodes.length) {\r\n counter = child_nodes[0];\r\n }\r\n \r\n counter.textContent = formatted_count;\r\n }\r\n });\r\n}\r\n\r\nexport const CartItemsReducer = (AppLocalStorage) => (state, action) => {\r\n switch (action.type) {\r\n case SET_ITEMS:\r\n const items = action.items.map(fixItemPrice);\r\n sendCartUpdatedEvent(items);\r\n return {\r\n ...state,\r\n items,\r\n cart_level_discount_applications:\r\n action.cart_level_discount_applications ||\r\n state.cart_level_discount_applications,\r\n };\r\n case SET_CART_NOTE:\r\n return { ...state, cartNote: action.cartNote };\r\n case ADD_ITEM:\r\n const new_items = [action.item].concat(state.items).map(fixItemPrice);\r\n sendCartUpdatedEvent(new_items);\r\n return { ...state, items: new_items };\r\n case MERGE_ITEM:\r\n const item_exists = state.items.find(({ id }) => id === action.item.id);\r\n if (!item_exists) {\r\n const items = [action.item].concat(state.items).map(fixItemPrice);\r\n sendCartUpdatedEvent(items);\r\n return { ...state, items };\r\n } else {\r\n const items = state.items.map((item) => {\r\n if (item.id === action.item.id) {\r\n return action.item;\r\n }\r\n return item;\r\n });\r\n sendCartUpdatedEvent(items);\r\n return { ...state, items };\r\n }\r\n case REMOVE_ITEM:\r\n const filtered_items = state.items.filter(({ id }) => id !== action.id);\r\n sendCartUpdatedEvent(filtered_items);\r\n return { ...state, items: filtered_items };\r\n case ADD_ITEMS:\r\n const added_items = action.item.concat(state.items).map(fixItemPrice);\r\n sendCartUpdatedEvent(added_items);\r\n return { ...state, items: added_items };\r\n case SET_PRODUCT_ID:\r\n return { ...state, product_id: action.product_id };\r\n case SET_CAMPAIGN:\r\n return { ...state, campaign: action.campaign };\r\n case ADD_UPSELL:\r\n const newUpsells = [...new Set([...state.fbtUpsells, action.id])];\r\n AppLocalStorage.setItem(\"monster_uc_upsells\", JSON.stringify(newUpsells));\r\n return { ...state, fbtUpsells: newUpsells };\r\n case REMOVE_UPSELL:\r\n const finalUpsells = state.fbtUpsells.filter(\r\n (variant_id) => variant_id !== action.id\r\n );\r\n AppLocalStorage.setItem(\r\n \"monster_uc_upsells\",\r\n JSON.stringify(finalUpsells)\r\n );\r\n return { ...state, fbtUpsells: finalUpsells };\r\n default:\r\n return state;\r\n }\r\n};\r\n\r\nfunction sendCartUpdatedEvent(items) {\r\n const counter = items.reduce((total, item) => total + item.quantity, 0);\r\n if (!window.mu_disable_cart_update) updateBagCounter(counter);\r\n if (window.mu_stop_cart_updated_event) return;\r\n const event = new CustomEvent(\"cart:updated\", { detail: { items } });\r\n document.dispatchEvent(event);\r\n}\r\n","import Axios from 'axios';\r\nimport loadable from '@loadable/component';\r\nimport uniqueSelector from 'unique-selector';\r\nimport { getCartLink, getLangPath } from 'components/cart/Utils';\r\n\r\nvar jQuery = require('jquery/src/core');\r\nrequire('jquery/src/core/init');\r\nrequire('jquery/src/selector');\r\nrequire('jquery/src/event');\r\nrequire('jquery/src/traversing');\r\nrequire('jquery/src/event/trigger');\r\nrequire('jquery/src/manipulation');\r\nrequire('jquery/src/attributes');\r\n// require('jquery/src/deprecated');\r\n\r\nwindow.onSubmit = undefined;\r\nwindow.upsellCartStopped = false;\r\nvar DelayedEvents = [];\r\nvar additionalCartLinks = [\r\n \"a[data-toggle='mini-cart-desktop-info']\",\r\n \"a[data-toggle='mini-cart-info']\",\r\n '.minicart-link',\r\n '.cart-link__bubble',\r\n '.js-drawer-open-cart',\r\n '.cd-cart-trigger',\r\n '.tt-desctop-parent-cart.tt-parent-box',\r\n '.basket.cart-toggle',\r\n '.tt-cart .tt-dropdown-toggle',\r\n \"a[data-node-type='commerce-cart-open-link']\"\r\n];\r\nvar elementPickerEnabled = false;\r\n\r\n// if (process.env.BETA === \"true\") {\r\n// console.log(\r\n// \"%c%s\",\r\n// \"background: #00ffc4; color: #021c16; font-size: 12px; font-weight:bold; padding: 5px 10px; border-radius: 3px\",\r\n// \"MONSTER BETA\"\r\n// );\r\n// }\r\n\r\nexport var manualSetupCartLinks = [\r\n \"a[data-href='/cart']\",\r\n `a[data-href='https://${window.mu_origin}/cart']`\r\n]\r\n .concat(additionalCartLinks)\r\n .join();\r\n\r\nexport var cartLinks = [\r\n \"a[href='/cart']\",\r\n \"a[href$='/cart']\",\r\n `a[href='https://${window.mu_origin}/cart']`,\r\n 'div.minicart__button.monster'\r\n]\r\n .concat(manualSetupCartLinks)\r\n .concat((window.mu_custom_links || []).map(({ selector }) => selector))\r\n .join();\r\n\r\nfunction immediatePropStopped(event, label) {\r\n var msg = '';\r\n if (event.isImmediatePropagationStopped()) {\r\n msg = label + ' stopImmediatePropagation called';\r\n } else {\r\n msg = label + ' stopImmediatePropagation not called';\r\n }\r\n}\r\n\r\nexport const getParams = (url) => {\r\n var params = {};\r\n var parser = document.createElement('a');\r\n parser.href = url;\r\n var query = parser.search.substring(1);\r\n var vars = query.split('&');\r\n for (var i = 0; i < vars.length; i++) {\r\n var pair = vars[i].split('=');\r\n params[pair[0]] = decodeURIComponent(pair[1]);\r\n }\r\n return params;\r\n};\r\n\r\nconst handleResize = () => {\r\n document.documentElement.style.setProperty('--screen-height', `${window.innerHeight}px`);\r\n // document.documentElement.style.setProperty('--screen-width', `${window.innerWidth}px`);\r\n};\r\n\r\nexport function stopUpsellCart() {\r\n window.upsellCartStopped = true;\r\n}\r\n\r\nexport const controlTheme = () => {\r\n console.log(\r\n '%c%s',\r\n 'background: #1c64f6; color: #fff; font-size: 12px; font-weight:bold; padding: 5px 10px; border-radius: 3px',\r\n 'âš¡ï¸ MONSTER UPSELLS cart is controlling the theme âš¡ï¸'\r\n );\r\n if (!window.mu_stop_resize) {\r\n jQuery(window).on('resize', handleResize);\r\n jQuery(window).on('scroll', handleResize);\r\n }\r\n jQuery('head meta[name=\"viewport\"]').attr(\r\n 'content',\r\n `width=device-width, initial-scale=1.0${\r\n window.mu_allow_zoom ? '' : ', maximum-scale=1.0,user-scalable=0'\r\n }`\r\n );\r\n\r\n window.handleAddToCart = (event) => {\r\n if (window.upsellCartStopped) return;\r\n event.stopImmediatePropagation();\r\n event.preventDefault();\r\n if (window.onSubmit) return window.onSubmit(event);\r\n else if (window.monster_submitAddToCartForm && window.monster_setCartItems)\r\n monster_submit(event);\r\n else {\r\n DelayedEvents.push({\r\n type: 'submit',\r\n target: event.target\r\n });\r\n }\r\n };\r\n\r\n // jQuery(\"form[data-zp-add-to-cart-form]\").each(function () {\r\n // jQuery(this)\r\n // .removeAttr(\"data-zp-add-to-cart-form\")\r\n // .attr(\"action\", \"/cart/add\");\r\n // });\r\n jQuery(document).on('submit', `form[action*='/cart/add']`, (e) => {\r\n return window.handleAddToCart(e);\r\n });\r\n window.removeSelectors_keepStyle = (element) => {\r\n const style = window.getComputedStyle(element);\r\n [...element.children].forEach((child) => window.removeSelectors_keepStyle(child));\r\n element.style = style;\r\n element.className = '';\r\n element.setAttribute('id', '');\r\n };\r\n\r\n let ATC_SELECTOR =\r\n \"form[action*='/cart/add'] button[name='add'], form[action*='/cart/add'] button[data-checkout='same'], form[action*='/cart/add'] button[type='submit'],form[action*='/cart/add'] input[type='submit'], form[action*='/cart/add'] button[data-add-to-cart],form[action*='/cart/add'] label[role='submit'],form[data-zp-product-url='/cart'] button[type='submit'], form[action*='/cart/add'] a[role='submit'], [data-zp-add-to-cart]\";\r\n jQuery(window.mu_atc_selector ?? ATC_SELECTOR).on('click', function (event) {\r\n if (window.upsellCartStopped) return;\r\n event.stopImmediatePropagation();\r\n event.preventDefault();\r\n const atcButton = jQuery(this);\r\n const form = atcButton.closest(\"form[action*='/cart/add'], [data-zp-add-to-cart-form]\");\r\n if (form.length) {\r\n atcButton.attr('type', 'submit');\r\n atcButton.removeAttr('data-product-id');\r\n return window.handleAddToCart({\r\n preventDefault: () => null,\r\n stopImmediatePropagation: () => null,\r\n target: form.get(0)\r\n });\r\n }\r\n });\r\n\r\n jQuery('[data-pf-type=\"ProductATC\"]:not(.disable-monster)').on('click', async function (event) {\r\n const atcButton = jQuery(this);\r\n if (window.upsellCartStopped) {\r\n return;\r\n }\r\n event.stopImmediatePropagation();\r\n event.preventDefault();\r\n const form = atcButton.closest(\"form[action*='/cart/add']\");\r\n if (form.length) {\r\n return window.handleAddToCart({\r\n preventDefault: () => null,\r\n stopImmediatePropagation: () => null,\r\n target: form.get(0)\r\n });\r\n }\r\n if (window.mu_custom_atc_logic) {\r\n const continueATC = await window.mu_custom_atc_logic(event);\r\n if (continueATC === false) return;\r\n }\r\n const variantDiv = atcButton.siblings(\r\n '[data-pf-type=\"ProductVariant\"], [data-pf-type=\"ProductVariantSwatches\"]'\r\n );\r\n const combined = variantDiv.attr('data-combined');\r\n let quantity =\r\n atcButton\r\n .prev('[data-pf-type=\"ProductQuantity\"]')\r\n .find(\"[data-pf-type='QuantityField']\")\r\n .val() || 1;\r\n quantity = Number(quantity);\r\n if (combined) {\r\n const variant_id = variantDiv.find('[name=\"id\"]').val();\r\n window.onSubmit(null, { id: variant_id, quantity });\r\n } else {\r\n const product_id = atcButton.attr('data-product-id');\r\n const selected_options = getPageFlyOptions(variantDiv);\r\n const product_data = window.__pageflyProducts && window.__pageflyProducts[product_id];\r\n if (product_data && selected_options.length) {\r\n const selected_variant = getPageFlyVariant(selected_options, product_data);\r\n if (selected_variant) {\r\n window.onSubmit(null, { id: selected_variant.id, quantity });\r\n }\r\n } else if (product_data) {\r\n window.onSubmit(null, { id: product_data.variants[0].id, quantity });\r\n }\r\n }\r\n });\r\n\r\n function getPageFlyOptions(variantDiv) {\r\n const selected_options = [];\r\n const isRadio = variantDiv.attr('data-display') === 'radio';\r\n if (isRadio) {\r\n variantDiv.find(\"input[type='radio']:checked\").each(function () {\r\n const value = jQuery(this).val();\r\n if (value) selected_options.push(value);\r\n });\r\n } else {\r\n variantDiv.find('select.pf-variant-select').each(function () {\r\n const value = jQuery(this).val();\r\n if (value) selected_options.push(value);\r\n });\r\n }\r\n return selected_options;\r\n }\r\n\r\n function getPageFlyVariant(selected_options, product_data) {\r\n const selected_title = selected_options.join(' / ');\r\n const selected_variant = product_data.variants.find(\r\n ({ title }) => title === selected_title\r\n );\r\n return selected_variant;\r\n }\r\n function toggleCart(event) {\r\n if (window.upsellCartStopped || window?.MANUAL_SETUP_ACTION === 'cart_link') return;\r\n event.preventDefault();\r\n event.stopImmediatePropagation();\r\n if (window.toggleCart) return window.toggleCart();\r\n else {\r\n DelayedEvents.push({\r\n type: 'click',\r\n target: event.target\r\n });\r\n }\r\n }\r\n jQuery(cartLinks).on('click', toggleCart);\r\n jQuery(document).on('click', cartLinks, toggleCart);\r\n\r\n function IDGetter(settings, element) {\r\n const { type, selector, name } = settings;\r\n if (type === 'self-attr') {\r\n return element.attr(name);\r\n }\r\n const idElement = jQuery(selector);\r\n const parsedId = type === 'attr' ? idElement.attr(name) : idElement.val();\r\n return parsedId;\r\n }\r\n function cloneCustomATC(settings) {\r\n const elements = jQuery(settings.button);\r\n if (!elements.length) return;\r\n elements.each(function () {\r\n const element = jQuery(this);\r\n const clone = element[0].cloneNode(true);\r\n jQuery(clone).unbind().attr('clone', true);\r\n clone.addEventListener('click', (event) => {\r\n if (!window.onSubmit) return;\r\n event.preventDefault();\r\n event.stopImmediatePropagation();\r\n if (settings.id.type === 'hasFormParent') {\r\n const form = jQuery(clone).closest(\"form[action='/cart/add']\");\r\n if (form.length) {\r\n return window.handleAddToCart({\r\n preventDefault: () => null,\r\n stopImmediatePropagation: () => null,\r\n target: form[0]\r\n });\r\n }\r\n }\r\n const id = IDGetter(settings.id, element);\r\n if (id) {\r\n window.onSubmit(null, { id, quantity: 1 });\r\n }\r\n });\r\n element.replaceWith(clone);\r\n });\r\n }\r\n if (window.mu_custom_atcs?.length) {\r\n window.mu_custom_atcs.forEach(cloneCustomATC);\r\n }\r\n};\r\n\r\n// function activateWideBundleIntegration() {\r\n// // WIDE BUNDLE APP SUPPORT\r\n// const atc_btn = jQuery(\"#new-form-atc\");\r\n// if (atc_btn.length) {\r\n// const old_onclick = atc_btn[0].onclick;\r\n// const wb_atc_clone = atc_btn.clone().addClass(\"clone\");\r\n// atc_btn.replaceWith(wb_atc_clone);\r\n// wb_atc_clone.on(\"click\", function (event) {\r\n// if (window.upsellCartStopped) {\r\n// return old_onclick();\r\n// }\r\n// addLoadingATC();\r\n// event.stopImmediatePropagation();\r\n// event.preventDefault();\r\n// const id = getSelectedID();\r\n// if (id) {\r\n// window.onSubmit(null, { id, quantity: 1 });\r\n// }\r\n// putBackATC();\r\n// putBackATC(); // for some reason we need to call this twice\r\n// });\r\n// }\r\n// // END OF WIDE BUNDLE APP SUPPORT\r\n// }\r\n\r\nexport function init({ handleSubmit }) {\r\n // activateWideBundleIntegration()\r\n window.onSubmit = handleSubmit;\r\n window.monster_atc = ({ id, quantity = 1 }) => handleSubmit(null, { id, quantity });\r\n DelayedEvents.forEach(({ type, target }) => {\r\n jQuery(target).trigger(type);\r\n });\r\n}\r\n\r\nconst fetchProductDetails = async (handle) => {\r\n try {\r\n const response = await Axios.get(getLangPath(`/products/${handle}.json`));\r\n const productData = response.data.product;\r\n return productData;\r\n } catch (error) {\r\n console.error(`Error fetching product details for product ID ${handle}:`, error);\r\n return null;\r\n }\r\n};\r\n\r\nexport const getCartItems = async () => {\r\n const origin = window.location.origin;\r\n return new Promise((resolve, reject) => {\r\n Axios.get(getCartLink())\r\n .then(async ({ data: { token, items, cart_level_discount_applications } }) => {\r\n const cartItemsWithComparedPrices = window.mu_cart_with_compares\r\n ? await Promise.all(\r\n items.map(async (cartItem) => {\r\n const productDetails = await fetchProductDetails(cartItem.handle);\r\n const variant_data = productDetails?.variants.find(\r\n (variant) => variant.id === cartItem.variant_id\r\n );\r\n\r\n if (variant_data) {\r\n cartItem.compare_at_price =\r\n Number(variant_data.compare_at_price) * 100;\r\n }\r\n\r\n return cartItem;\r\n })\r\n )\r\n : items;\r\n if (cartItemsWithComparedPrices.length === 0) {\r\n thankYouPageCleanup();\r\n }\r\n resolve({\r\n token,\r\n items: cartItemsWithComparedPrices,\r\n cart_level_discount_applications\r\n });\r\n })\r\n .catch(reject);\r\n });\r\n};\r\nwindow.monster_getCartItems = getCartItems;\r\nfunction thankYouPageCleanup() {\r\n localStorage.removeItem('monster_uc_upsells');\r\n localStorage.removeItem('mu_form_files');\r\n localStorage.removeItem('cart_items');\r\n // function removeByCondition(condition) {\r\n // Object.entries(localStorage)\r\n // .map((x) => x[0])\r\n // .filter(condition)\r\n // .map((x) => localStorage.removeItem(x));\r\n // }\r\n // removeByCondition((x) => x?.contains('one_tick_removed_'));\r\n // removeByCondition((x) => x?.contains('multi_gifts_'));\r\n}\r\nasync function refreshCart(open = true, callback = () => {}) {\r\n await fetch(window.location.origin + '/cart.js')\r\n .then((res) => res.json())\r\n .then(async (response) => {\r\n if (window.monster_setCartItems && window.mu_productionAddToCartCallBack) {\r\n await window.monster_setCartItems(\r\n response.items,\r\n response.cart_level_discount_applications\r\n );\r\n await window.mu_productionAddToCartCallBack(response.items);\r\n }\r\n if (open && window.openCart) await window.openCart();\r\n callback();\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n });\r\n}\r\n\r\nwindow.monster_refresh = refreshCart;\r\n\r\nasync function monster_addToCart({ id, quantity, ...rest }, open = true, callback = () => {}) {\r\n await fetch(window.location.origin + '/cart/add.js', {\r\n headers: {\r\n 'content-type': 'application/json;'\r\n },\r\n body: JSON.stringify({\r\n id: Number(id),\r\n quantity: Number(quantity),\r\n ...rest\r\n }),\r\n method: 'POST'\r\n })\r\n .then(async () => {\r\n await refreshCart(open);\r\n callback();\r\n })\r\n .catch((error) => {\r\n console.log(error);\r\n });\r\n}\r\n\r\nwindow.monster_addToCart = monster_addToCart;\r\n\r\nfunction serializeForm(form) {\r\n const formData = new FormData(form);\r\n let serialized = { properties: {} };\r\n\r\n for (const [name, value] of formData) {\r\n if (name.includes('properties')) {\r\n const start = name.indexOf('[') + 1;\r\n const end = name.indexOf(']');\r\n const key = name.substring(start, end);\r\n serialized['properties'][key] = value;\r\n } else if (!name.includes('utf') && !name.includes('form_type')) serialized[name] = value;\r\n }\r\n return serialized;\r\n}\r\n\r\nasync function monster_submit(event) {\r\n if (event.target && event.target.tagName === 'FORM') {\r\n const form = event.target;\r\n\r\n if (form.action.includes('/cart/add')) {\r\n event.preventDefault();\r\n\r\n if (window.mu_custom_atc_logic) {\r\n const continueATC = await window.mu_custom_atc_logic(event);\r\n if (continueATC === false) return;\r\n }\r\n\r\n const id =\r\n form.querySelector('[name=\"id\"]')?.value ?? window.mu_product?.variants[0].id;\r\n const quantity = form.querySelector('[name=\"quantity\"]')?.value ?? 1;\r\n console.log('monster_addToCart');\r\n await monster_addToCart({ id, quantity, ...serializeForm(form) });\r\n } else {\r\n console.log('Monster : Unsuposted add to cart form');\r\n }\r\n } else {\r\n DelayedEvents.push({\r\n type: 'submit',\r\n target: event.target\r\n });\r\n }\r\n}\r\n\r\nwindow.monster_submitAddToCartForm = monster_submit;\r\n\r\nexport const getCartNote = async () => {\r\n return new Promise((resolve, reject) => {\r\n Axios.get(getCartLink())\r\n .then(({ data: { note } }) => resolve(note))\r\n .catch(reject);\r\n });\r\n};\r\n\r\nexport const clearCart = async () => {\r\n return new Promise((resolve, reject) => {\r\n Axios.post(`${window.location.origin}/cart/clear.js`)\r\n .then(({ data }) => resolve(data))\r\n .catch(reject);\r\n });\r\n};\r\n\r\nwindow.monster_clearCart = clearCart;\r\n","import React, {\r\n createContext,\r\n useRef,\r\n useEffect,\r\n useState,\r\n useReducer,\r\n useMemo,\r\n useContext\r\n} from 'react';\r\n// import \"preact/debug\"\r\n// import { Scrollbars } from 'react-custom-scrollbars';\r\nimport loadable from '@loadable/component';\r\nimport Header from './partials/Header';\r\nimport CartItemsList from './partials/CartItemsList';\r\nimport ExtraModule from './partials/ExtraModule';\r\nimport EmptyState from './partials/EmptyState';\r\nimport * as Utils from './Utils';\r\nimport { API_GATEWAY2 } from 'aws-exports';\r\nimport {\r\n CartItemsReducer,\r\n ADD_ITEM,\r\n MERGE_ITEM,\r\n REMOVE_ITEM,\r\n SET_ITEMS,\r\n SET_CART_NOTE,\r\n ADD_UPSELL,\r\n REMOVE_UPSELL\r\n} from 'reducers/CartItemsReducer';\r\nimport Axios from 'axios';\r\nimport classNames from 'lib/classNames';\r\nimport useCampaign from 'hooks/useCampaign';\r\nimport { getAllOCUProducts } from './partials/CheckoutButton';\r\nimport Spinner from 'components/Spinner';\r\nimport CustomScroll from './partials/CustomScroll';\r\nimport useRefState from 'hooks/useRefState';\r\nimport { getCartItems } from 'shopify_script_tags/cart';\r\nimport HeaderATU from './partials/Header_ATU';\r\n\r\nconst ProductDetails = loadable(() => import('./partials/ProductDetails'));\r\nconst CodForm = loadable(() => import('./partials/CodForm'));\r\nconst VariantsPicker = loadable(() => import('./partials/VariantsPicker'));\r\nconst BundlesVariantsPicker = loadable(() => import('./partials/BundlesVariantsPicker'));\r\nconst Confetti = loadable(() => import('react-confetti'));\r\n\r\nexport const CartContext = createContext(null);\r\nexport const CartProvider = CartContext.Provider;\r\n\r\nconst Cart = ({\r\n campaigns = {},\r\n token,\r\n getCampaigns,\r\n setCampaigns,\r\n mergeCampaigns,\r\n mergeCompareAtMap,\r\n shop_url = null,\r\n isPreview = false,\r\n showSubscription = false,\r\n cart_items = [],\r\n cart_level_discount_applications = [],\r\n cart_currency,\r\n shop_settings,\r\n setShopSettings,\r\n close = null,\r\n isOpened = null,\r\n onInit = null,\r\n product_id = null,\r\n products,\r\n forcePreview = null,\r\n style = {},\r\n showCheckoutLoading,\r\n showComfirmOrderLoading,\r\n orderCodForm,\r\n setOrderCodForm,\r\n isCodFormSubmitted,\r\n setIsCodFormSubmitted,\r\n showATUAfterText,\r\n cartNote = '',\r\n hasWriteDiscountsScope = false,\r\n compareAtMap = {},\r\n setCompareAtMap,\r\n giftCurrentPreview,\r\n AppLocalStorage,\r\n bundlesVariantPickerPreview\r\n}) => {\r\n const cart_ref = useRef(null);\r\n const header_ref = useRef(null);\r\n const [hasAutoDiscount, setHasAutoDiscount] = useState(\r\n Utils.CartHasAutoDiscount({ items: cart_items, cart_level_discount_applications })\r\n );\r\n const scrollbars_ref = useRef(null);\r\n const [variantsPickerShow, setVariantsPickerShow, variantsPickerShow_ref] = useRefState(false);\r\n const [variantPickerOptions, setVariantPickerOptions, setVariantPickerOptions_ref] =\r\n useRefState({});\r\n const [addedFromFbt, setAddedFromFbt] = useState([]);\r\n const [viewCartTracked, setViewCartTracked] = useState(false);\r\n const [showConfetti, setShowConfetti] = useState(0);\r\n const [active_slide, slickGoTo] = useState(0);\r\n const [previewed_product, setPreviewed_product] = useState(null);\r\n const [discountCode, setDiscountCode] = useState(null);\r\n const [rechargeSettings, setRechargeSettings] = useState(null);\r\n const [userIsTabbing, setUserIsTabbing] = useState(false);\r\n const [shipProtectState, setShipProtectState] = useState({selected:false, price: 0});\r\n const variantsPickerOverlay_ref = useRef(null);\r\n const bundlesVariantsPickerOverlay_ref = useRef(null);\r\n const [cartLoading, setCartLoading] = useState(false);\r\n const [bundlesVariantsPickerShow, setBundlesVariantsPickerShow] = useState(false);\r\n const [bundlesVariantsPickerOptions, setBundlesVariantsPickerOptions] = useState({});\r\n const [shopify_cart_state, dispatch] = useReducer(CartItemsReducer(AppLocalStorage), {\r\n items: cart_items,\r\n cart_level_discount_applications,\r\n cartNote,\r\n token,\r\n fbtUpsells: JSON.parse(AppLocalStorage.getItem('monster_uc_upsells') || '[]')\r\n });\r\n const [one_check_up_sell_product_id, ocu_campaign] = useCampaign(\r\n 'one_check_up_sell',\r\n null,\r\n true\r\n )(campaigns, shopify_cart_state.items);\r\n const slider = {\r\n slickGoTo,\r\n active_slide\r\n };\r\n\r\n const add_to_cart = (\r\n {\r\n variant_id,\r\n quantity = 1,\r\n product_handle = null,\r\n product = null,\r\n properties,\r\n selling_plan\r\n },\r\n callback = null,\r\n formData\r\n ) => {\r\n if(window.monster_loading) setCartLoading(true);\r\n Utils.addToCart(\r\n {\r\n variant_id,\r\n quantity,\r\n properties,\r\n selling_plan,\r\n isPreview,\r\n shop_url,\r\n product_handle,\r\n product,\r\n currency: shop_settings.currency\r\n },\r\n formData\r\n ).then((data) => {\r\n const items = data?.items || [data];\r\n const item = data?.items ? Utils.findItem({ items: data.items, variant_id }) : data;\r\n if (data?.items) {\r\n dispatch({\r\n type: SET_ITEMS,\r\n items,\r\n cart_level_discount_applications: data.cart_level_discount_applications\r\n });\r\n } else {\r\n dispatch({ type: ADD_ITEM, item });\r\n }\r\n\r\n if (!isPreview) {\r\n productionAddToCartCallBack(items);\r\n }\r\n if (callback) callback(item);\r\n if (window.monster_loading) setCartLoading(false);\r\n }).catch((error) => {\r\n if (window.monster_loading) setCartLoading(false);\r\n });\r\n };\r\n const productionAddToCartCallBack = async (items) => {\r\n const NonUndefinedCampaigns = campaigns || {};\r\n const campaignsKeys = Object.keys(NonUndefinedCampaigns).map(parseInt);\r\n \r\n const shouldBeActive = {\r\n random_text: false,\r\n order_note: false,\r\n checkout_button: false,\r\n };\r\n\r\n // First check which modules should be active based on items in cart\r\n items.filter(Boolean).forEach(({ product_id }) => {\r\n if (NonUndefinedCampaigns[product_id]) {\r\n const productCampaigns = NonUndefinedCampaigns[product_id];\r\n for (const campaign of productCampaigns) {\r\n if (campaign?.modules) {\r\n const modules = campaign.modules;\r\n Object.keys(shouldBeActive).forEach((moduleKey) => {\r\n if (\r\n modules[moduleKey] &&\r\n modules[moduleKey].active === true\r\n ) {\r\n shouldBeActive[moduleKey] = true;\r\n }\r\n });\r\n }\r\n }\r\n }\r\n });\r\n\r\n items.filter(Boolean).forEach(async ({ product_id, variant_id, product_type }) => {\r\n const hasNoCampaigns =\r\n !campaigns ||\r\n !campaignsKeys.includes(product_id) ||\r\n (NonUndefinedCampaigns && NonUndefinedCampaigns[product_id] === []);\r\n if (hasNoCampaigns && product_type.toLowerCase() !== 'free_gift') {\r\n // const current_types = Object.entries(NonUndefinedCampaigns).filter(([id]) => productAddedToCart({ id })).map(([_, c]) => c).flat().map(({ type }) => type);\r\n const response = await getCampaigns(\r\n [product_id],\r\n [`${product_id}:${variant_id}`],\r\n shopify_cart_state.token\r\n );\r\n const { settings, compareAtMap } = response;\r\n mergeCampaigns(response.campaigns);\r\n mergeCompareAtMap(compareAtMap);\r\n if (\r\n settings.fromCampaign ||\r\n !shop_settings.modules.order ||\r\n (shop_settings.modules.order && settings.modules.order && shop_settings.modules != settings.modules)\r\n ) {\r\n const mergedModules = { ...shop_settings.modules };\r\n\r\n Object.keys(settings.modules).forEach((moduleKey) => {\r\n if (moduleKey === \"order\") {\r\n mergedModules[moduleKey] = settings.modules[moduleKey];\r\n } else {\r\n if (!shouldBeActive[moduleKey]) {\r\n mergedModules[moduleKey] = {\r\n ...settings.modules[moduleKey],\r\n };\r\n }\r\n }\r\n });\r\n\r\n setShopSettings({\r\n ...shop_settings,\r\n ...settings,\r\n money_format: shop_settings.money_format,\r\n modules: mergedModules,\r\n });\r\n }\r\n }\r\n });\r\n // if(items.filter(Boolean).length){\r\n const newItems = await getCartItems()\r\n dispatch({ \r\n type: SET_ITEMS,\r\n items: newItems.items,\r\n cart_level_discount_applications:newItems.cart_level_discount_applications\r\n });\r\n // }\r\n };\r\n window.mu_productionAddToCartCallBack = productionAddToCartCallBack;\r\n\r\n const update_cart_item = (\r\n { variant_id, line, quantity = 1, properties, selling_plan, sold_out = false },\r\n callback = null,\r\n formData\r\n ) => {\r\n if (window.monster_loading) setCartLoading(true);\r\n const item = Utils.findItem({\r\n line,\r\n items: shopify_cart_state.items,\r\n variant_id: variant_id\r\n });\r\n const currentQuantity = item ? item.quantity : 0;\r\n if (quantity === '+1') quantity = currentQuantity + 1;\r\n if (quantity === '-1') quantity = currentQuantity - 1;\r\n Utils.updateCartItem(\r\n {\r\n variant_id,\r\n line,\r\n quantity,\r\n properties,\r\n selling_plan,\r\n isPreview,\r\n state: shopify_cart_state\r\n },\r\n formData\r\n ).then(({ items, cart_level_discount_applications }) => {\r\n if (items.length === 1 && items[0].price === 0 && items[0].product_type === \"free_gift\") {\r\n let { variant_id } = items[0];\r\n return update_cart_item(\r\n {\r\n variant_id,\r\n line: 1,\r\n quantity: 0,\r\n },\r\n callback\r\n );\r\n }\r\n if (!sold_out) {\r\n if(!hasAutoDiscount){\r\n dispatch({ type: SET_ITEMS, items, cart_level_discount_applications });\r\n }\r\n const item = Utils.findItem({ line, items, variant_id });\r\n if (!isPreview) {\r\n productionAddToCartCallBack(items);\r\n }\r\n // if (!item) return;\r\n if (callback) callback(item, items);\r\n } else {\r\n dispatch({\r\n type: SET_ITEMS,\r\n cart_level_discount_applications,\r\n items: items.map((item) => {\r\n if (item.variant_id === variant_id) {\r\n return { ...item, quantity: 0, itemSoldOut: true };\r\n }\r\n return item;\r\n })\r\n });\r\n if (callback) callback(null, items);\r\n }\r\n if (window.monster_loading) setCartLoading(false);\r\n })\r\n .catch((error) => {\r\n if (window.monster_loading) setCartLoading(false);\r\n if (callback) callback(null, null, error?.response?.data);\r\n });\r\n };\r\n\r\n const trackEvent = (data) => {\r\n return isPreview\r\n ? Promise.resolve(null)\r\n : Axios({\r\n method: 'post',\r\n url: `${API_GATEWAY2}/public/track`,\r\n params: {\r\n shop: shop_url\r\n },\r\n data\r\n });\r\n };\r\n\r\n const preview_product = (product, showAddCartButton = true) => {\r\n setPreviewed_product({ ...product, showAddCartButton });\r\n slider.slickGoTo(1);\r\n };\r\n const productAddedToCart = (product, byVariant) => {\r\n if (byVariant) return productAddedToCartByVariant(product);\r\n\r\n const product_id = Number(typeof product === 'object' ? product?.id : product);\r\n return !!shopify_cart_state.items.find((item) => item.product_id === product_id);\r\n };\r\n const productAddedToCartByVariant = (variant, items = undefined) => {\r\n items = items || shopify_cart_state.items;\r\n const variant_id = Number(typeof variant === 'object' ? variant?.id : variant);\r\n return !!items.find((item) => item.variant_id === variant_id);\r\n };\r\n\r\n const onlyOneItemAddedToCart = (product, byVariant) => {\r\n if (byVariant) return onlyOneItemAddedToCartByVariant(product);\r\n const product_id = Number(typeof product === 'object' ? product?.id : product);\r\n return !!shopify_cart_state.items.find(\r\n (item) => item.product_id === product_id && item.quantity === 1\r\n );\r\n };\r\n const onlyOneItemAddedToCartByVariant = (variant) => {\r\n const variant_id = Number(typeof variant === 'object' ? variant?.id : variant);\r\n return !!shopify_cart_state.items.find(\r\n (item) => item.variant_id === variant_id && item.quantity === 1\r\n );\r\n };\r\n\r\n const productNotAddedToCart = (product, byVariant) => !productAddedToCart(product, byVariant);\r\n\r\n const get_total = (type = null, items = null) => {\r\n const ocu_products = getAllOCUProducts(ocu_campaign);\r\n const filteredItems = (items || shopify_cart_state.items).filter((item) => {\r\n const ocu_product = ocu_products.find(\r\n ({ product }) => item.product_id.toString() === product?.id\r\n );\r\n return ocu_product\r\n ? ocu_product.include_in_atu\r\n : !(['free_gift', 'singleton_gift'].includes(item?.product_type?.toLowerCase()) && item?.price === 0);\r\n });\r\n const original = Utils.getTotal(items || shopify_cart_state.items, products);\r\n const filteredItemsTotal = Utils.getTotal(filteredItems);\r\n const discount = Utils.getDiscount({\r\n items: items || shopify_cart_state.items,\r\n cart_level_discount_applications: shopify_cart_state.cart_level_discount_applications,\r\n filteredItems,\r\n filteredItemsTotal,\r\n campaigns: campaigns || {},\r\n total: original,\r\n discountCode\r\n });\r\n const autoDiscountGifts = filteredItems.reduce((acc, item) => {\r\n const { discounts, price, line_level_discount_allocations } = item;\r\n const hasGiftAutoDiscount =\r\n discounts?.length &&\r\n line_level_discount_allocations?.find(({ discount_application }) =>\r\n ['automatic', ''].includes(discount_application?.type)\r\n ) &&\r\n discounts[0]?.amount === price;\r\n return hasGiftAutoDiscount ? acc + price : acc;\r\n }, 0);\r\n const subtotal = original - discount;\r\n const compareAt = shop_settings.count_compare_at\r\n ? Utils.getCompareAtDiscount({\r\n filteredItems: items || shopify_cart_state.items,\r\n compareAtMap,\r\n products\r\n })\r\n : 0;\r\n\r\n const output = {\r\n original,\r\n discount,\r\n subtotal,\r\n autoDiscountGifts,\r\n finalDiscount: compareAt + discount,\r\n total: original + compareAt\r\n };\r\n window.mu_cartSummary = output;\r\n return type ? output[type] : output;\r\n };\r\n window.monster_getTotal = get_total;\r\n\r\n const productionAddToCart = (\r\n items,\r\n { variant_id, quantity, selling_plan, properties },\r\n callback,\r\n formData\r\n ) => {\r\n const item = items.find((item) => {\r\n const sameId = item.id === parseInt(variant_id);\r\n const sameProperties = properties\r\n ? JSON.stringify(properties) === JSON.stringify(item.properties)\r\n : true;\r\n const sellingPlanId = item?.selling_plan_allocation?.selling_plan?.id;\r\n const sameSellingPlane = selling_plan\r\n ? sellingPlanId === Number(selling_plan) // selling plan must be the same\r\n : !sellingPlanId; // selling plan must be undefined\r\n return sameId && sameProperties && sameSellingPlane;\r\n });\r\n const gfFileUpload = document.querySelector('.gf_file-upload');\r\n if (item && !gfFileUpload) {\r\n const line = items.indexOf(item) + 1;\r\n update_cart_item(\r\n {\r\n variant_id,\r\n line,\r\n quantity: item.quantity + quantity,\r\n properties,\r\n selling_plan\r\n },\r\n callback,\r\n formData\r\n );\r\n } else {\r\n if (gfFileUpload) {\r\n const form = document.querySelector('form[action=\"/cart/add\"]');\r\n const requiredFields = form.querySelectorAll('[required=\"required\"]');\r\n for (let i = 0; i < requiredFields.length; i++) {\r\n if (!requiredFields[i].value) {\r\n form.requestSubmit();\r\n return;\r\n }\r\n }\r\n }\r\n add_to_cart(\r\n { variant_id, quantity, properties, selling_plan },\r\n (item) => {\r\n if (callback) callback(item, items.concat([item]));\r\n },\r\n formData\r\n );\r\n }\r\n };\r\n\r\n const hasFont =\r\n shop_settings.font.custom && shop_settings.font.family ? shop_settings.font.family : false;\r\n\r\n const handleFirstTab = ({ keyCode }) => {\r\n if (keyCode === 9) {\r\n setUserIsTabbing(true);\r\n window.removeEventListener('keydown', handleFirstTab);\r\n }\r\n };\r\n // const handleResize = () => {\r\n // \t// setWindowHeight(window.innerHeight);\r\n // \tdocument.documentElement.style.setProperty('--screen-width', `${window.innerWidth}px`);\r\n // \tdocument.documentElement.style.setProperty('--screen-height', `${window.innerHeight + 60}px`);\r\n // };\r\n const [add_to_unlock_product_id, add_to_unlock, campaign_key, isGlobal] = useCampaign('add_to_unlock')(\r\n campaigns,\r\n shopify_cart_state.items\r\n );\r\n\r\n useEffect(() => {\r\n if (isPreview) return;\r\n const gifts = add_to_unlock?.goals\r\n .filter(({ reward_type }) => reward_type === 'gift')\r\n .map(({ gift: { product, products } }) => product || products)\r\n .flat()\r\n .filter(Boolean);\r\n const nonGiftsItems = shopify_cart_state.items.filter(\r\n ({ product_type }) =>\r\n !['free_gift', 'singleton_gift'].includes(product_type?.toLowerCase())\r\n );\r\n if (\r\n gifts?.length &&\r\n (productAddedToCart({ id: add_to_unlock_product_id }) ||\r\n (isGlobal && nonGiftsItems.length))\r\n ) {\r\n if (!!shop_settings.count_compare_at) {\r\n setCompareAtMap(\r\n gifts?.reduce((acc, { variant_price, variants }) => {\r\n if (!variants) return;\r\n return Object.assign(\r\n {},\r\n acc,\r\n ...variants.map(({ id, compare_at_price }) => ({\r\n [id]: compare_at_price || variant_price\r\n }))\r\n );\r\n }, {})\r\n );\r\n }\r\n } else {\r\n const deleteGifts = shopify_cart_state.items\r\n .filter(({ product_type }) =>\r\n ['free_gift', 'singleton_gift'].includes(product_type?.toLowerCase())\r\n )\r\n .map(({ variant_id }) => update_cart_item({ variant_id, quantity: 0 }));\r\n Promise.all(deleteGifts);\r\n }\r\n // AppLocalStorage.setItem(\"cart_items\", JSON.stringify(shopify_cart_state.items))\r\n }, [\r\n campaigns,\r\n shopify_cart_state.items,\r\n add_to_unlock_product_id,\r\n add_to_unlock,\r\n discountCode\r\n ]);\r\n\r\n useEffect(() => {\r\n if(bundlesVariantPickerPreview){\r\n setBundlesVariantsPickerOptions(bundlesVariantPickerPreview)\r\n setBundlesVariantsPickerShow(true)\r\n }else {\r\n setBundlesVariantsPickerOptions(null)\r\n setBundlesVariantsPickerShow(false)\r\n\r\n }\r\n }, [bundlesVariantPickerPreview])\r\n\r\n useEffect(() => {\r\n const updateCartState = () => {\r\n if (window.monster_refresh && !isPreview) window.monster_refresh(false);\r\n };\r\n\r\n updateCartState();\r\n }, [discountCode]);\r\n \r\n async function updateShippingProtectAppState({selected,price,variant}){\r\n window.mu_shipProtectSelected = selected;\r\n window.mu_shipProtectPrice = price;\r\n setShipProtectState({selected,price})\r\n if(!selected){\r\n const {items} = await getCartItems()\r\n if(productAddedToCartByVariant(variant, items)){\r\n update_cart_item({ variant_id: variant, quantity: 0 });\r\n }\r\n }\r\n }\r\n\r\n window.notifyMonsterUpsells = updateShippingProtectAppState\r\n\r\n useEffect(() => {\r\n if (onInit) onInit(productionAddToCart);\r\n window.addEventListener('keydown', handleFirstTab);\r\n return () => {\r\n window.removeEventListener('keydown', handleFirstTab);\r\n };\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (hasFont && window.WebFont) {\r\n window.WebFont.load({\r\n google: {\r\n families: [hasFont]\r\n }\r\n });\r\n }\r\n }, [hasFont]);\r\n\r\n const addFBTUpsell = (id) => {\r\n dispatch({ type: ADD_UPSELL, id });\r\n };\r\n\r\n const removeFBTUpsell = (id) => {\r\n dispatch({ type: REMOVE_UPSELL, id });\r\n };\r\n\r\n const setCartItems = (items, cart_level_discount_applications, fetchCampaigns) => {\r\n dispatch({ type: SET_ITEMS, items, cart_level_discount_applications });\r\n if (fetchCampaigns) productionAddToCartCallBack(items);\r\n };\r\n const addCartItem = (item) => {\r\n dispatch({ type: ADD_ITEM, item });\r\n // productionAddToCartCallBack([item])\r\n };\r\n const mergeCartItem = (item) => {\r\n dispatch({ type: MERGE_ITEM, item });\r\n // productionAddToCartCallBack([item])\r\n };\r\n const removeCartItem = (id) => dispatch({ type: REMOVE_ITEM, id });\r\n const setCartNote = (cartNote) => dispatch({ type: SET_CART_NOTE, cartNote });\r\n window.monster_setCartItems = setCartItems;\r\n window.monster_addCartItem = mergeCartItem;\r\n window.monster_mergeCartItem = mergeCartItem;\r\n window.monster_removeCartItem = removeCartItem;\r\n window.monster_setCartNote = setCartNote;\r\n const getRechargeSettings = async () => {\r\n try {\r\n const response = await Axios.get(window.location.href);\r\n const recharge_installed = response.data.includes('static.rechargecdn.com');\r\n const recharge_active = response.data.includes('data-recharge-theme');\r\n if (!recharge_installed || !recharge_active) return setRechargeSettings(undefined);\r\n const { data } = await Axios.get(\r\n `https://static.rechargecdn.com/store/${shop_url}/product/2020-12/products.json`\r\n );\r\n setRechargeSettings(data);\r\n } catch (error) {\r\n if(window.ReCharge && window.ReCharge.is_installed) setRechargeSettings(window.ReCharge);\r\n else setRechargeSettings(undefined);\r\n }\r\n };\r\n useEffect(() => {\r\n const atcs = document.querySelectorAll(\"button[data-pf-type='ProductATC']\");\r\n atcs.forEach((atc) => {\r\n const form = atc.closest('form');\r\n atc.setAttribute('type', 'submit');\r\n if (form) {\r\n atc.removeAttribute('data-checkout');\r\n if (shop_url !== 'primary-beans.myshopify.com') {\r\n atc.removeAttribute('data-pf-type');\r\n atc.removeAttribute('data-product-id');\r\n }\r\n }\r\n });\r\n setCartItems(cart_items);\r\n if (rechargeSettings === null && !isPreview) getRechargeSettings();\r\n }, [cart_items]);\r\n\r\n useEffect(() => {\r\n if (!isPreview) return;\r\n\r\n if (forcePreview) {\r\n preview_product(forcePreview);\r\n } else if (\r\n window.location.pathname === '/settings/checkout' &&\r\n !shop_settings?.cod_settings?.is_form_in_cart\r\n ) {\r\n slider.slickGoTo(1);\r\n } else {\r\n slider.slickGoTo(0);\r\n }\r\n }, [isPreview, forcePreview, shop_settings?.cod_settings?.is_form_in_cart]);\r\n\r\n useEffect(() => {\r\n if (window.location.pathname === '/settings/checkout')\r\n slider.slickGoTo(\r\n shop_settings.cod_settings && shop_settings?.cod_settings?.is_form_in_cart ? 0 : 1\r\n );\r\n }, [shop_settings.cod_settings, shop_settings?.cod_settings?.is_form_in_cart]);\r\n\r\n useEffect(() => {\r\n if (!isPreview) {\r\n const hasAutoDiscount = Utils.CartHasAutoDiscount(shopify_cart_state);\r\n setHasAutoDiscount(hasAutoDiscount);\r\n }\r\n }, [shopify_cart_state.items]);\r\n\r\n useEffect(() => {\r\n // if (isOpened) iNoBounce.enable();\r\n // else iNoBounce.disable();\r\n if (isOpened && !viewCartTracked) {\r\n const campaignsIds = Object.values(campaigns)\r\n .flat(Infinity)\r\n .map((c) => {\r\n const { campaign_key } = c;\r\n return campaign_key && campaign_key[1];\r\n })\r\n .filter(Boolean);\r\n trackEvent({\r\n type: 'view_cart',\r\n campaigns: campaignsIds\r\n }).then((_) => {\r\n setViewCartTracked(true);\r\n });\r\n }\r\n }, [isOpened, viewCartTracked]);\r\n\r\n const goals = add_to_unlock?.goals || [];\r\n const filterGoalsBasedOnDiscount = Utils.FilterAtuGoals(goals, !!discountCode);\r\n const CAN_RENDER_ADD_TO_UNLOCK =\r\n filterGoalsBasedOnDiscount.length &&\r\n add_to_unlock?.isActive &&\r\n (productAddedToCart({ id: add_to_unlock_product_id }) ||\r\n (isGlobal && shopify_cart_state.items.length));\r\n const bundlesDiscounts = Utils.getDiscount({\r\n campaigns,\r\n items: shopify_cart_state.items,\r\n getBundlesOnly: true,\r\n });\r\n let stickyElements;\r\n return (\r\n <CartProvider\r\n value={{\r\n campaigns,\r\n token,\r\n cart_level_discount_applications:\r\n shopify_cart_state.cart_level_discount_applications,\r\n shopify_cart_items: shopify_cart_state.items,\r\n shopify_cart_upsells: shopify_cart_state.fbtUpsells,\r\n cartNote: shopify_cart_state.cartNote,\r\n setCartItems,\r\n addCartItem,\r\n removeCartItem,\r\n cart_currency,\r\n cart_ref,\r\n slider,\r\n cart_settings: shop_settings,\r\n Utils,\r\n add_to_cart,\r\n update_cart_item,\r\n preview_product,\r\n get_total,\r\n isPreview,\r\n showSubscription,\r\n previewed_product,\r\n setPreviewed_product,\r\n shop_url,\r\n productNotAddedToCart,\r\n onlyOneItemAddedToCart,\r\n productAddedToCart,\r\n scrollbars_ref: scrollbars_ref.current,\r\n close,\r\n discountCode,\r\n setDiscountCode,\r\n productionAddToCart,\r\n isOpened,\r\n trackEvent,\r\n setShowConfetti,\r\n variantsPickerShow,\r\n setVariantsPickerShow,\r\n setVariantPickerOptions,\r\n setBundlesVariantsPickerShow,\r\n setBundlesVariantsPickerOptions,\r\n showCheckoutLoading,\r\n showComfirmOrderLoading,\r\n orderCodForm,\r\n setOrderCodForm,\r\n isCodFormSubmitted,\r\n setIsCodFormSubmitted,\r\n showATUAfterText,\r\n setCartNote,\r\n addFBTUpsell,\r\n removeFBTUpsell,\r\n rechargeSettings,\r\n hasWriteDiscountsScope,\r\n compareAtMap,\r\n setCompareAtMap,\r\n giftCurrentPreview,\r\n AppLocalStorage,\r\n hasAutoDiscount,\r\n products,\r\n shipProtectState,\r\n cartLoading,\r\n setCartLoading,\r\n }}\r\n >\r\n <div\r\n className={classNames(\r\n \"w-full h-full m-0 p-0 max-w-full flex flex-col relative\",\r\n {\r\n \"disable-outline\": !userIsTabbing,\r\n }\r\n )}\r\n ref={cart_ref}\r\n style={{\r\n color: Utils.formatColor(shop_settings.font.color),\r\n background: Utils.formatColor(shop_settings.theme.background),\r\n fontSize: shop_settings.font.size,\r\n fontFamily: hasFont ? hasFont.split(\":\")[0] : \"inherit\",\r\n direction: shop_settings.rtl ? \"rtl\" : \"ltr\",\r\n borderRadius: shop_settings.curved ? \"15px\" : \"\",\r\n }}\r\n >\r\n {cart_ref.current && showConfetti !== 0 && (\r\n <Confetti\r\n width={cart_ref.current.offsetwidth}\r\n height={cart_ref.current.offsetHeight}\r\n recycle={false}\r\n numberOfPieces={showConfetti}\r\n gravity={0.2}\r\n onConfettiComplete={() => setShowConfetti(0)}\r\n initialVelocityX={5}\r\n />\r\n )}\r\n <Header title=\"My Cart\" headerRef={header_ref} />\r\n <CustomScroll\r\n scrollRef={scrollbars_ref}\r\n thumbBg={Utils.formatColor(shop_settings.theme.secondary)}\r\n trackBg={Utils.formatColor(shop_settings.theme.background)}\r\n isMobile={Utils.isMobile()}\r\n className={classNames(\"flex-1\")}\r\n style={{\r\n marginBottom:\r\n shop_settings.curved &&\r\n !shop_settings.modules.checkout_button.fix_checkout_container\r\n ? \"15px\"\r\n : \"\",\r\n }}\r\n >\r\n <div\r\n style={{ minHeight: \"100%\" }}\r\n className={classNames(\r\n \"slider w-full min-w-full flex-1 overflow-hidden flex flex-col\"\r\n )}\r\n >\r\n <div\r\n className={classNames(\r\n \"flex-1 flex transform transition-transform duration-300 ease-out\",\r\n {\r\n \"translate-x-full\": active_slide && shop_settings.rtl,\r\n \"-translate-x-full\": active_slide && !shop_settings.rtl,\r\n \"translate-x-0\": !active_slide,\r\n }\r\n )}\r\n >\r\n {shopify_cart_state.items.length ? (\r\n <div\r\n className={classNames(\r\n \"w-full min-w-full flex flex-col h-auto\"\r\n )}\r\n >\r\n {shop_settings.modules.checkout_button\r\n .fix_checkout_container &&\r\n !!CAN_RENDER_ADD_TO_UNLOCK && (\r\n <HeaderATU\r\n campaign_id={campaign_key && campaign_key[1]}\r\n add_to_unlock={add_to_unlock}\r\n bundlesDiscounts={bundlesDiscounts}\r\n />\r\n )}\r\n <CartItemsList />\r\n {shop_settings.cod_settings &&\r\n shop_settings.cod_settings.is_active &&\r\n shop_settings?.cod_settings?.is_form_in_cart && (\r\n <CodForm />\r\n )}\r\n {shop_settings.modules.order &&\r\n shop_settings.modules.order\r\n .filter(\r\n (key) =>\r\n !shop_settings.modules.checkout_button\r\n .fix_checkout_container ||\r\n key !== \"checkout_button\"\r\n )\r\n .map((key, i) => (\r\n <ExtraModule\r\n key={key}\r\n moduleKey={key}\r\n modules={shop_settings.modules}\r\n cartNote={shopify_cart_state.cartNote}\r\n />\r\n ))}\r\n </div>\r\n ) : (\r\n <EmptyState />\r\n )}\r\n\r\n {active_slide != 0 && <ProductDetails\r\n style={{\r\n maxHeight:\r\n active_slide === 0 && header_ref.current\r\n ? `calc(100vh - ${header_ref.current.offsetHeight}px)`\r\n : undefined,\r\n }}\r\n add_to_unlock={add_to_unlock}\r\n />}\r\n {(isPreview ||\r\n (shop_settings.cod_settings &&\r\n shop_settings.cod_settings.is_active)) && <CodForm />}\r\n </div>\r\n </div>\r\n {/* </div> */}\r\n {/* </Slider> */}\r\n </CustomScroll>\r\n\r\n {shopify_cart_state.items.length > 0 &&\r\n shop_settings.modules.order &&\r\n shop_settings.modules.order\r\n .filter(\r\n (key) =>\r\n shop_settings.modules.checkout_button\r\n .fix_checkout_container && key === \"checkout_button\"\r\n )\r\n .map((key, i) => (\r\n <ExtraModule\r\n key={key}\r\n moduleKey={key}\r\n modules={shop_settings.modules}\r\n cartNote={shopify_cart_state.cartNote}\r\n />\r\n ))}\r\n\r\n {variantsPickerShow_ref.current && variantsPickerShow && (\r\n <div className={classNames(\"absolute inset-0 z-20\")}>\r\n <div\r\n className={classNames(\r\n \"flex flex-col justify-end w-full h-full overflow-hidden transition-colors duration-300 ease-in cursor-pointer\"\r\n )}\r\n ref={variantsPickerOverlay_ref}\r\n onClick={(event) => {\r\n event.preventDefault();\r\n if (event.target === variantsPickerOverlay_ref.current) {\r\n if (variantPickerOptions.onClose)\r\n variantPickerOptions.onClose();\r\n setVariantsPickerShow(false);\r\n }\r\n }}\r\n style={{\r\n background: variantsPickerShow\r\n ? \"rgba(0,0,0,0.2)\"\r\n : \"transparent\",\r\n borderRadius: shop_settings.curved ? \"15px\" : \"\",\r\n }}\r\n >\r\n <div\r\n style={{}}\r\n className={classNames(\r\n \"max-h-full\",\r\n variantsPickerShow\r\n ? \"animate-slide-up\"\r\n : \"animate-slide-down\"\r\n )}\r\n >\r\n <VariantsPicker\r\n {...variantPickerOptions}\r\n CustomScroll={CustomScroll}\r\n parentRef={variantsPickerOverlay_ref}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n {bundlesVariantsPickerShow && (\r\n <div className={classNames(\"absolute inset-0 z-20\")}>\r\n <div\r\n className={classNames(\r\n \"flex flex-col justify-end w-full h-full overflow-hidden transition-colors duration-300 ease-in\"\r\n )}\r\n ref={bundlesVariantsPickerOverlay_ref}\r\n onClick={(event) => {\r\n if (\r\n event.target === bundlesVariantsPickerOverlay_ref.current\r\n ) {\r\n setBundlesVariantsPickerShow(false);\r\n if (bundlesVariantsPickerOptions.onClose)\r\n bundlesVariantsPickerOptions.onClose();\r\n }\r\n }}\r\n style={{\r\n background: bundlesVariantsPickerShow\r\n ? \"rgba(0,0,0,0.2)\"\r\n : \"transparent\",\r\n borderRadius: shop_settings.curved ? \"15px\" : \"\",\r\n }}\r\n >\r\n <div\r\n style={{}}\r\n className={classNames(\r\n \"max-h-full\",\r\n bundlesVariantsPickerShow\r\n ? \"animate-slide-up\"\r\n : \"animate-slide-down\"\r\n )}\r\n >\r\n <BundlesVariantsPicker\r\n {...bundlesVariantsPickerOptions}\r\n CustomScroll={CustomScroll}\r\n parentRef={bundlesVariantsPickerOverlay_ref}\r\n />\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n {cartLoading && (\r\n <div\r\n className={classNames(\r\n \"absolute h-full w-full flex-center flex-col\"\r\n )}\r\n style={{ background: \"#30303030\" }}\r\n >\r\n <Spinner />\r\n </div>\r\n )}\r\n </div>\r\n </CartProvider>\r\n );\r\n};\r\n\r\nexport default Cart;\r\n","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACtWK6eAAAEUElEQVR42uzTMQ0AIBAAMfw7ZSF5BWCA8cYOldC1z1zgTxAQBASBnCAgCAgCOUFAEBAEcoKAICAI5AQBQUAQyAkCgoAgkBMEBAFBICcICAKCQE4QEAQEgZwgIAgIAjlBQBAQBHKCgCAgCOQEAUFAEMgJAoKAIJATBAQBQSAnCAgCgkBOEBAEBIGcICAICAI5QUAQEARygoAgIAjkBAFBQBDICQKCgCCQEwQEAUEgJwgIAoJAThAQBASBnCA89u61KW0gCsDw//9LreMFqIrYgZZCQUDuV7XtP0iz1akQzyh6zm4S8n54PzkysLMPJJuwEECIAEJkHkCIAEIEkCANZ8uo2elF39rd3NXq9qPpcqMegyIFECGp5f3vqPq1EX06Pst9Dsvq4Y96TIoQQISkrurf1RMzS7VuBuoxKUIA2aPJcqOekFnruPSFTxGA2PSzP3zx7jvfPOSuWqO58zomnI8AxKIYxM7EGs1X6sdMo/aBvI6QAQQgBJBwQKaru+jmdhx1B6NovFhn6jgfIADx0j5AZut7cRm4clnLzEQECEC89AaQfyfAp5UL9zexo9Oyu8Cofh5rgAQPIAZAantcIymdV1M/3AIIQLz0GpDF3a/o80kpAUJuMJmrnwtAwgYQJZDb6ULAIPej25ceX05eAHBX9B1KgAQKIDkBEuP4f55TqV47JAAJEEBycIi1heOxZyQA8RxAMn6SnsAhIQGIxwBiAMTXMm8ChxoJQADipTQuFCZwmCABCEC89KFbTeLiW03MD6veQAIQ4wBiDCROvZS7hcMUCUAA4qVQQBI4zJEABCBeUgJxh1lBcCSQAMQggHgG4la4yhdXUW80DYJja3HAIQEIQPwnANkXh7v+4f7HXUx0SILg2ELiPr0AAhC/CUDeg+OxZyRBcDzltisCCED8JgB5Dw4JSRAcANEHEGMgAg4RyUn5XD35AeI/gBgCecKhntSWAQQg3hOA5AIHQPQBxABIVnEARB9APgYkFzgAog8gSiD98Uw9iX0GEIB4DyDFDSAAIYAABCAA8RZAihtADHY1ib9vntm4WREg3msdyMQCCEC8BJDiBpA96gxGOxOr0eqoD33S6PK6vv063B3F6rE59AAiJHypSX2ynLXiW+1T320+DwFESKrebKsnZZaKtyVSj0kRAoiUvPHCQSA5Oqu4X+1Vj0dRAsjrSTsoundfN8lyV284ccvS6jEoUgAhAggRQIjMAwgRQIgAQmQeQIgAQgQQIvMAQgQQIoAQmQcQIoAQAYTIPIAQAYQIIETmAYQIIEQAITIPIEQAIQIIkXkAIQIIEUCIzAMIEUD+tk+HBAAAAACC/r/2hJHABEAQ2AkCgoAgsBMEBAFBYCcICAKCwE4QEAQEgZ0gIAgIAjtBQBAQBHaCgCAgCOwEAUFAENgJAoKAILATBAQBQWAnCAgCgsBOEBAEBIGdICAICAI7QUAQEAR2goAgIAjsAhByelclhK5iAAAAAElFTkSuQmCC\"","// extracted by mini-css-extract-plugin\nmodule.exports = {\"bundle\":\"bundle_bundle__2I8ca\",\"trash\":\"bundle_trash__2H968\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"floating\":\"review_widget_floating__323Y2\",\"checklist\":\"review_widget_checklist__1c5RI\",\"btn\":\"review_widget_btn__3exhv\",\"label\":\"review_widget_label__9pELa\",\"badge\":\"review_widget_badge__3GOuM\",\"checklist_main\":\"review_widget_checklist_main__Rfano\",\"expanded\":\"review_widget_expanded__2R-4K\",\"show\":\"review_widget_show__aDk8r\",\"checklist_container\":\"review_widget_checklist_container__2MzPa\",\"checklist_header\":\"review_widget_checklist_header__iENhD\",\"header_content\":\"review_widget_header_content__209XZ\",\"title\":\"review_widget_title__1LyQZ\",\"desc\":\"review_widget_desc__3kgzJ\",\"progress_container\":\"review_widget_progress_container__2xpch\",\"completed_caption\":\"review_widget_completed_caption__3Lnsj\",\"progress_bar\":\"review_widget_progress_bar__pDJTZ\",\"progress_bar_complete\":\"review_widget_progress_bar_complete__3c9--\",\"minimize\":\"review_widget_minimize__1Ed1b\",\"checklist_body\":\"review_widget_checklist_body__2dg2_\",\"items\":\"review_widget_items__1YStB\",\"item\":\"review_widget_item__2GeP2\",\"completed\":\"review_widget_completed__1JS5r\",\"checkmark\":\"review_widget_checkmark__3ucmH\",\"sequential_label\":\"review_widget_sequential_label__23sJh\",\"checklist_footer\":\"review_widget_checklist_footer__1aLu-\",\"stars\":\"review_widget_stars__dZz54\",\"star\":\"review_widget_star__2yufD\",\"review\":\"review_widget_review__2lo7m\"};","import React from 'react';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport PropTypes from 'prop-types';\r\nimport classNames from 'lib/classNames';\r\n// import styles from 'styles/icon.module.scss';\r\n\r\nconst Icon = props => {\r\n const {\r\n icon,\r\n size,\r\n style,\r\n className,\r\n type,\r\n onClick,\r\n spin,\r\n color,\r\n iconRef,\r\n onMouseEnter,\r\n onMouseLeave\r\n } = props;\r\n if (!icon) console.log(props);\r\n return (\r\n <FontAwesomeIcon\r\n icon={icon}\r\n size={size}\r\n color={color}\r\n className={classNames(className, { 'cursor-pointer': onClick })}\r\n spin={spin}\r\n onMouseEnter={e => {\r\n if (onMouseEnter) onMouseEnter(e);\r\n }}\r\n onMouseLeave={e => {\r\n if (onMouseLeave) onMouseLeave(e);\r\n }}\r\n ref={iconRef}\r\n onClick={onClick}\r\n style={style}\r\n />\r\n );\r\n};\r\n\r\nIcon.propTypes = {\r\n style: PropTypes.object.isRequired\r\n};\r\n\r\nIcon.defaultProps = {\r\n style: {},\r\n size: '1x',\r\n className: '',\r\n type: 'normal',\r\n onClick: null,\r\n spin: false,\r\n color: null,\r\n iconRef: null,\r\n onMouseEnter: null,\r\n onMouseLeave: null\r\n};\r\n\r\nexport default Icon;\r\n","const useCampaign = (campaign_type, bundles_product_id = null, getFullCampaign = false) => (campaigns, cart_items) => {\r\n\tconst noCampaign = new Array(2).fill(null);\r\n\tif (!campaigns) return noCampaign;\r\n\r\n\tlet product_campaign = noCampaign;\r\n\r\n\tconst global_campaigns = Object.values(campaigns)\r\n\t\t.flat(Infinity)\r\n\t\t.filter((campaign) => campaign.isGlobal);\r\n\tif (campaign_type === 'bundles') {\r\n\t\tconst product_campaigns = campaigns[bundles_product_id] || [];\r\n\t\tconst bundles_campaign =\r\n\t\t\tproduct_campaigns.find(({ type }) => type === 'bundles') ||\r\n\t\t\tglobal_campaigns.find(({ type }) => type === 'bundles');\r\n\t\tif (bundles_campaign) product_campaign = [bundles_product_id, bundles_campaign];\r\n\t} else {\r\n\t\t// add to unlock and one tick renders a single campaign at time\r\n\t\tconst itemsIds = [...cart_items].reverse().map(({ product_id }) => product_id.toString());\r\n\t\tconst type_campaign = Object.entries(campaigns)\r\n\t\t\t.sort(([a], [b]) => {\r\n\t\t\t\tconst AIndex = itemsIds.indexOf(a) === -1 ? itemsIds.length + 1 : itemsIds.indexOf(a);\r\n\t\t\t\tconst BIndex = itemsIds.indexOf(b) === -1 ? itemsIds.length + 1 : itemsIds.indexOf(b);\r\n\t\t\t\treturn AIndex - BIndex;\r\n\t\t\t})\r\n\t\t\t.find(([product_id, product_campaigns]) => {\r\n\t\t\t\tconst productGlobalCampaigns = product_campaigns.filter((campaign) => campaign.isGlobal)\r\n\t\t\t\tconst productIsAddedToCart = cart_items.map(({ product_id: id }) => id).includes(parseInt(product_id))\r\n\t\t\t\tif (!productGlobalCampaigns.length && !productIsAddedToCart) return false;\r\n\t\t\t\treturn productIsAddedToCart ? product_campaigns.find(({ type }) => type === campaign_type) : productGlobalCampaigns.find(({ type }) => type === campaign_type);\r\n\t\t\t});\r\n\t\tif (type_campaign) {\r\n\t\t\tconst [id, camps] = type_campaign;\r\n\t\t\tproduct_campaign = [id, camps.find(({ type }) => type === campaign_type)];\r\n\t\t}\r\n\t}\r\n\tconst [product_id, campaign] = product_campaign;\r\n\treturn product_id ? [product_id, getFullCampaign ? campaign : campaign[campaign_type], campaign.isGlobal] : noCampaign;\r\n};\r\n\r\nconst getCampaignsByType = (campaign_type) => (campaigns) =>\r\n\tObject.values(campaigns)\r\n\t\t.filter(({ type }) => type === campaign_type)\r\n\t\t.map((campaign) => campaign[campaign_type]);\r\nexport default useCampaign;\r\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"ml_4\":\"extra_modules_ml_4__3193O\",\"module\":\"extra_modules_module__2xRB1\",\"header\":\"extra_modules_header__rHkZ9\",\"header_wrapper\":\"extra_modules_header_wrapper__7XGTe\",\"name\":\"extra_modules_name__2n4sH\",\"info\":\"extra_modules_info__11j55\",\"grip\":\"extra_modules_grip__1KJqt\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"campaign_preview\":\"cart_screen_campaign_preview__3f1M1\",\"campaign\":\"cart_screen_campaign__1yY51\",\"checkbox\":\"cart_screen_checkbox__ygUxe\",\"saveSettingBar\":\"cart_screen_saveSettingBar__sQQLl\",\"checkboxControl\":\"cart_screen_checkboxControl__3jBZl\",\"radioDiv\":\"cart_screen_radioDiv__3bAKu\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"group\":\"form_group_group__3-IRL\",\"title\":\"form_group_title__1qZF7\",\"content\":\"form_group_content__QcaQG\"};"],"sourceRoot":""}