ordering-ui-external 1.9.2 → 1.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/0.ordering-ui.9ce64e14904d222c0020.js +1 -0
- package/_bundles/{1.ordering-ui.8e20ae6af39ad738a29e.js → 1.ordering-ui.9ce64e14904d222c0020.js} +1 -1
- package/_bundles/{2.ordering-ui.8e20ae6af39ad738a29e.js → 2.ordering-ui.9ce64e14904d222c0020.js} +1 -1
- package/_bundles/{4.ordering-ui.8e20ae6af39ad738a29e.js → 4.ordering-ui.9ce64e14904d222c0020.js} +1 -1
- package/_bundles/{5.ordering-ui.8e20ae6af39ad738a29e.js → 5.ordering-ui.9ce64e14904d222c0020.js} +1 -1
- package/_bundles/{6.ordering-ui.8e20ae6af39ad738a29e.js → 6.ordering-ui.9ce64e14904d222c0020.js} +1 -1
- package/_bundles/{7.ordering-ui.8e20ae6af39ad738a29e.js → 7.ordering-ui.9ce64e14904d222c0020.js} +2 -2
- package/_bundles/{7.ordering-ui.8e20ae6af39ad738a29e.js.LICENSE.txt → 7.ordering-ui.9ce64e14904d222c0020.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.8e20ae6af39ad738a29e.js → 8.ordering-ui.9ce64e14904d222c0020.js} +1 -1
- package/_bundles/{9.ordering-ui.8e20ae6af39ad738a29e.js → 9.ordering-ui.9ce64e14904d222c0020.js} +1 -1
- package/_bundles/ordering-ui.9ce64e14904d222c0020.js +2 -0
- package/_bundles/{ordering-ui.8e20ae6af39ad738a29e.js.LICENSE.txt → ordering-ui.9ce64e14904d222c0020.js.LICENSE.txt} +0 -0
- package/_modules/components/BusinessesListing/index.js +1 -3
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +26 -12
- package/_modules/components/VerticalOrdersLayout/styles.js +1 -1
- package/_modules/themes/five/index.js +7 -0
- package/_modules/themes/five/src/components/AddressList/index.js +3 -2
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +3 -2
- package/_modules/themes/five/src/components/BusinessListingSearch/index.js +14 -6
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +50 -14
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +9 -2
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +10 -6
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +55 -186
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +29 -40
- package/_modules/themes/five/src/components/Cart/index.js +56 -97
- package/_modules/themes/five/src/components/CartContent/index.js +50 -2
- package/_modules/themes/five/src/components/CartContent/styles.js +6 -4
- package/_modules/themes/five/src/components/Checkout/index.js +8 -2
- package/_modules/themes/five/src/components/Checkout/styles.js +10 -4
- package/_modules/themes/five/src/components/Header/index.js +26 -34
- package/_modules/themes/five/src/components/Header/styles.js +46 -35
- package/_modules/themes/five/src/components/HeaderOption/index.js +3 -2
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +3 -2
- package/_modules/themes/five/src/components/MultiCheckout/index.js +22 -13
- package/_modules/themes/five/src/components/MultiCheckout/styles.js +11 -8
- package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +9 -1
- package/_modules/themes/five/src/components/OrderContextUI/index.js +192 -0
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +41 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +3 -0
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +8 -2
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +8 -2
- package/_modules/themes/five/src/components/OrdersOption/index.js +2 -1
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +17 -8
- package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +27 -27
- package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +7 -2
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +17 -14
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +16 -16
- package/_modules/themes/five/src/components/SingleOrderCard/styles.js +49 -41
- package/package.json +3 -2
- package/src/components/BusinessesListing/index.js +1 -3
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +25 -14
- package/src/components/VerticalOrdersLayout/styles.js +8 -0
- package/src/themes/five/index.js +2 -0
- package/src/themes/five/src/components/AddressList/index.js +3 -2
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -1
- package/src/themes/five/src/components/BusinessListingSearch/index.js +4 -0
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
- package/src/themes/five/src/components/BusinessProductsList/index.js +54 -18
- package/src/themes/five/src/components/BusinessProductsListing/index.js +14 -2
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +18 -6
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +219 -345
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +2 -77
- package/src/themes/five/src/components/Cart/index.js +50 -57
- package/src/themes/five/src/components/CartContent/index.js +43 -3
- package/src/themes/five/src/components/CartContent/styles.js +6 -0
- package/src/themes/five/src/components/Checkout/index.js +16 -2
- package/src/themes/five/src/components/Checkout/styles.js +19 -6
- package/src/themes/five/src/components/Header/index.js +281 -277
- package/src/themes/five/src/components/Header/styles.js +20 -51
- package/src/themes/five/src/components/HeaderOption/index.js +3 -2
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +2 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +27 -13
- package/src/themes/five/src/components/MultiCheckout/styles.js +8 -13
- package/src/themes/five/src/components/MultiOrdersDetails/index.js +21 -13
- package/src/themes/five/src/components/OrderContextUI/index.js +133 -0
- package/src/themes/five/src/components/OrderContextUI/styles.js +86 -0
- package/src/themes/five/src/components/OrderDetails/index.js +4 -0
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +5 -2
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +4 -0
- package/src/themes/five/src/components/OrdersOption/index.js +2 -1
- package/src/themes/five/src/components/ProductItemAccordion/index.js +58 -40
- package/src/themes/five/src/components/ProductItemAccordion/styles.js +4 -3
- package/src/themes/five/src/components/ProductOptionSubOption/index.js +8 -1
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +6 -0
- package/src/themes/five/src/components/SingleOrderCard/index.js +12 -13
- package/src/themes/five/src/components/SingleOrderCard/styles.js +26 -7
- package/template/app.js +179 -66
- package/template/components/ListenPageChanges/index.js +3 -2
- package/template/components/OrderingThemeUpdated/index.js +41 -0
- package/template/helmetdata.json +7 -0
- package/template/pages/MessagesList/index.js +2 -0
- package/template/pages/MultiCart/index.js +30 -0
- package/template/pages/MultiCheckout/index.js +86 -10
- package/template/pages/MultiOrdersDetails/index.js +9 -4
- package/_bundles/0.ordering-ui.8e20ae6af39ad738a29e.js +0 -1
- package/_bundles/ordering-ui.8e20ae6af39ad738a29e.js +0 -2
package/template/app.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import PWAPrompt from 'react-ios-pwa-prompt'
|
|
3
|
+
import { useTheme, ThemeProvider } from 'styled-components'
|
|
4
|
+
import loadable from '@loadable/component'
|
|
2
5
|
import {
|
|
3
6
|
Switch,
|
|
4
7
|
Route,
|
|
@@ -6,65 +9,82 @@ import {
|
|
|
6
9
|
Link,
|
|
7
10
|
useLocation
|
|
8
11
|
} from 'react-router-dom'
|
|
9
|
-
import { useTheme, ThemeProvider } from 'styled-components'
|
|
10
|
-
import PWAPrompt from 'react-ios-pwa-prompt'
|
|
11
12
|
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import {
|
|
14
|
+
useSession,
|
|
15
|
+
useApi,
|
|
16
|
+
useLanguage,
|
|
17
|
+
useOrder,
|
|
18
|
+
Analytics,
|
|
19
|
+
FacebookPixel,
|
|
20
|
+
useConfig,
|
|
21
|
+
AnalyticsSegment,
|
|
22
|
+
useEvent,
|
|
23
|
+
useOrderingTheme,
|
|
24
|
+
useSite
|
|
25
|
+
} from 'ordering-components-external'
|
|
17
26
|
|
|
18
|
-
import { SpinnerLoader } from '../src/components/SpinnerLoader'
|
|
19
|
-
import { Header as HeaderOld } from '../src/components/Header'
|
|
20
|
-
import { Header as HeaderRed } from '../src/themes/seven/src/components/Header'
|
|
21
|
-
import { Header as HeaderStarbucks } from '../src/themes/six/src/components/Header'
|
|
22
27
|
import { useOnlineStatus } from '../src/hooks/useOnlineStatus'
|
|
23
28
|
import { useWindowSize } from '../src/hooks/useWindowSize'
|
|
24
|
-
|
|
25
|
-
import { SmartAppBanner } from '../src/components/SmartAppBanner'
|
|
26
|
-
|
|
27
|
-
import { NavigationBar } from '../src/themes/five/src/components/NavigationBar'
|
|
28
|
-
import { Modal } from '../src/themes/five/src/components/Modal'
|
|
29
|
-
|
|
30
|
-
import { ReviewTrigger } from '../src/themes/five/src/components/ReviewTrigger'
|
|
31
|
-
import { ReviewOrder } from '../src/themes/five/src/components/ReviewOrder'
|
|
32
|
-
import { ReviewProduct } from '../src/themes/five/src/components/ReviewProduct'
|
|
33
|
-
import { ReviewDriver } from '../src/themes/five/src/components/ReviewDriver'
|
|
34
|
-
import { SignUpApproval } from '../src/themes/five/src/components/SignUpApproval'
|
|
35
|
-
|
|
36
|
-
import { AddressList } from './pages/AddressList'
|
|
37
|
-
import { BusinessesList } from './pages/BusinessesList'
|
|
38
|
-
import { BusinessProductsList } from './pages/BusinessProductsList'
|
|
39
|
-
import { CheckoutPage } from './pages/Checkout'
|
|
40
|
-
import { Cms } from './pages/Cms'
|
|
41
|
-
import { HomePage } from './pages/Home'
|
|
42
|
-
import { MyOrders } from './pages/MyOrders'
|
|
43
|
-
import { OrderDetailsPage } from './pages/OrderDetails'
|
|
44
|
-
import { PageNotFound } from './pages/PageNotFound'
|
|
45
|
-
import { PagesList } from './pages/PagesList'
|
|
46
|
-
import { Profile } from './pages/Profile'
|
|
47
|
-
import { Wallets } from './pages/Wallets'
|
|
48
|
-
import { MessagesList } from './pages/MessagesList'
|
|
49
|
-
import { Help } from './pages/Help'
|
|
50
|
-
import { Favorite } from './pages/Favorite'
|
|
51
|
-
import { SessionsList } from './pages/SessionsList'
|
|
52
|
-
import { SignUpBusiness } from './pages/SignUpBusiness'
|
|
53
|
-
import { SignUpDriver } from './pages/SignUpDriver'
|
|
54
|
-
import { UserVerification } from './pages/UserVerification'
|
|
55
|
-
import { BusinessListingSearch } from './pages/BusinessListingSearch'
|
|
56
|
-
import { ResetPassword } from './pages/ResetPassword'
|
|
57
|
-
import { ScrollToTop } from './components/ScrollToTop'
|
|
58
|
-
import { ListenPageChanges } from './components/ListenPageChanges'
|
|
59
|
-
import { HelmetTags } from './components/HelmetTags'
|
|
29
|
+
|
|
60
30
|
import settings from './config'
|
|
61
|
-
import {
|
|
62
|
-
|
|
63
|
-
import {
|
|
64
|
-
import { CancellationComponent } from '../src/components/CancellationComponent'
|
|
65
|
-
import { Button } from '../src/themes/five/src/styles/Buttons'
|
|
31
|
+
import { orderingThemeUpdated } from './components/OrderingThemeUpdated'
|
|
32
|
+
|
|
33
|
+
import { SpinnerLoader } from '../src/components/SpinnerLoader'
|
|
66
34
|
import { Input } from '../src/themes/five/src/styles/Inputs'
|
|
67
35
|
|
|
36
|
+
const Header = loadable(() => import('../src/themes/five/src/components/Header'))
|
|
37
|
+
const HeaderKiosk = loadable(() => import('../src/themes/five/src/components/Header/layouts/Kiosk'))
|
|
38
|
+
const NotNetworkConnectivity = loadable(() => import('../src/themes/five/src/components/NotNetworkConnectivity'))
|
|
39
|
+
const Footer = loadable(() => import('../src/themes/five/src/components/Footer'))
|
|
40
|
+
const NavigationBar = loadable(() => import('../src/themes/five/src/components/NavigationBar'))
|
|
41
|
+
const Modal = loadable(() => import('../src/themes/five/src/components/Modal'))
|
|
42
|
+
const ReviewTrigger = loadable(() => import('../src/themes/five/src/components/ReviewTrigger'))
|
|
43
|
+
const ReviewOrder = loadable(() => import('../src/themes/five/src/components/ReviewOrder'))
|
|
44
|
+
const ReviewProduct = loadable(() => import('../src/themes/five/src/components/ReviewProduct'))
|
|
45
|
+
const ReviewDriver = loadable(() => import('../src/themes/five/src/components/ReviewDriver'))
|
|
46
|
+
const SignUpApproval = loadable(() => import('../src/themes/five/src/components/SignUpApproval'))
|
|
47
|
+
const Button = loadable(() => import('../src/themes/five/src/styles/Buttons'))
|
|
48
|
+
|
|
49
|
+
const Alert = loadable(() => import('../src/components/Confirm'))
|
|
50
|
+
const HeaderOld = loadable(() => import('../src/components/Header'))
|
|
51
|
+
|
|
52
|
+
const SmartAppBanner = loadable(() => import('../src/components/SmartAppBanner'))
|
|
53
|
+
const CancellationComponent = loadable(() => import('../src/components/CancellationComponent'))
|
|
54
|
+
|
|
55
|
+
const HeaderRed = loadable(() => import('../src/themes/seven/src/components/Header'))
|
|
56
|
+
const HeaderStarbucks = loadable(() => import('../src/themes/six/src/components/Header'))
|
|
57
|
+
|
|
58
|
+
const AddressList = loadable(() => import('./pages/AddressList'))
|
|
59
|
+
const BusinessesList = loadable(() => import('./pages/BusinessesList'))
|
|
60
|
+
const CheckoutPage = loadable(() => import('./pages/Checkout'))
|
|
61
|
+
const Cms = loadable(() => import('./pages/Cms'))
|
|
62
|
+
const HomePage = loadable(() => import('./pages/Home'))
|
|
63
|
+
const MyOrders = loadable(() => import('./pages/MyOrders'))
|
|
64
|
+
const OrderDetailsPage = loadable(() => import('./pages/OrderDetails'))
|
|
65
|
+
const PageNotFound = loadable(() => import('./pages/PageNotFound'))
|
|
66
|
+
const PagesList = loadable(() => import('./pages/PagesList'))
|
|
67
|
+
const Profile = loadable(() => import('./pages/Profile'))
|
|
68
|
+
const Wallets = loadable(() => import('./pages/Wallets'))
|
|
69
|
+
const MessagesList = loadable(() => import('./pages/MessagesList'))
|
|
70
|
+
const Help = loadable(() => import('./pages/Help'))
|
|
71
|
+
const Favorite = loadable(() => import('./pages/Favorite'))
|
|
72
|
+
const SessionsList = loadable(() => import('./pages/SessionsList'))
|
|
73
|
+
const SignUpBusiness = loadable(() => import('./pages/SignUpBusiness'))
|
|
74
|
+
const SignUpDriver = loadable(() => import('./pages/SignUpDriver'))
|
|
75
|
+
const UserVerification = loadable(() => import('./pages/UserVerification'))
|
|
76
|
+
const BusinessListingSearch = loadable(() => import('./pages/BusinessListingSearch'))
|
|
77
|
+
const ResetPassword = loadable(() => import('./pages/ResetPassword'))
|
|
78
|
+
const Promotions = loadable(() => import('./pages/Promotions'))
|
|
79
|
+
const MultiCheckout = loadable(() => import('./pages/MultiCheckout'))
|
|
80
|
+
const MultiCart = loadable(() => import('./pages/MultiCart'))
|
|
81
|
+
const MultiOrdersDetails = loadable(() => import('./pages/MultiOrdersDetails'))
|
|
82
|
+
const BusinessProductsList = loadable(() => import('./pages/BusinessProductsList'))
|
|
83
|
+
|
|
84
|
+
const ScrollToTop = loadable(() => import('./components/ScrollToTop'))
|
|
85
|
+
const ListenPageChanges = loadable(() => import('./components/ListenPageChanges'))
|
|
86
|
+
const HelmetTags = loadable(() => import('./components/HelmetTags'))
|
|
87
|
+
|
|
68
88
|
export const App = () => {
|
|
69
89
|
const [{ auth, user }, { login }] = useSession()
|
|
70
90
|
const [events] = useEvent()
|
|
@@ -81,6 +101,7 @@ export const App = () => {
|
|
|
81
101
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
82
102
|
const windowSize = useWindowSize()
|
|
83
103
|
const [businessSignUpSuccessed, setBusinessSignUpSuccessed] = useState({ open: false, content: {} })
|
|
104
|
+
const [searchValue, setSearchValue] = useState('')
|
|
84
105
|
const [lastOrderReview, setLastOrderReview] = useState({
|
|
85
106
|
isReviewOpen: false,
|
|
86
107
|
order: null,
|
|
@@ -100,6 +121,38 @@ export const App = () => {
|
|
|
100
121
|
...theme.colors,
|
|
101
122
|
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_btn_color && { primary: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_btn_color }),
|
|
102
123
|
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color && { links: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color })
|
|
124
|
+
},
|
|
125
|
+
images: {
|
|
126
|
+
...theme.images,
|
|
127
|
+
general: {
|
|
128
|
+
...theme.images.general,
|
|
129
|
+
homeHero: orderingTheme?.theme?.homepage_view?.components?.homepage_header?.components?.image || theme.images?.general?.homeHero,
|
|
130
|
+
businessHero: orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image || theme.images?.general?.businessHero,
|
|
131
|
+
notFound: orderingTheme?.theme?.business_listing_view?.components?.not_found_source?.components?.image || theme.images?.general?.notFound,
|
|
132
|
+
emptyActiveOrders: orderingTheme?.theme?.orders?.components?.active_orders?.components?.not_found_source?.components?.image || theme.images?.general?.emptyActiveOrders,
|
|
133
|
+
emptyPastOrders: orderingTheme?.theme?.orders?.components?.past_orders?.components?.not_found_source?.components?.image,
|
|
134
|
+
notNetwork: orderingTheme?.theme?.no_internet?.components?.image || theme.images?.general?.notNetwork,
|
|
135
|
+
businessSignUpHero: orderingTheme?.theme?.business_signup?.components?.icon?.components?.image || theme.images?.general?.businessSignUpHero,
|
|
136
|
+
driverSignUpHero: orderingTheme?.theme?.driver_signup?.components?.icon?.components?.image || theme.images?.general?.driverSignUpHero
|
|
137
|
+
},
|
|
138
|
+
categories: {
|
|
139
|
+
...theme.images.categories,
|
|
140
|
+
food: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.food?.image || theme.images.categories.categoryFood,
|
|
141
|
+
groceries: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.groceries?.image || theme.images.categories.categoryGroceries,
|
|
142
|
+
alcohol: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.alcohol?.image || theme.images.categories.categoryAlcohol,
|
|
143
|
+
laundry: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.laundry?.image || theme.images.categories.categoryLaundry,
|
|
144
|
+
all: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.all?.image || theme.images.categories.categoryAll
|
|
145
|
+
},
|
|
146
|
+
dummies: {
|
|
147
|
+
...theme.images.dummies,
|
|
148
|
+
businessHeader: orderingTheme?.theme?.business_view?.components?.header?.components?.dummy_image || theme.images.dummies.businessHeader,
|
|
149
|
+
businessLogo: orderingTheme?.theme?.business_view?.components?.header?.components?.logo?.dummy_image || theme.images.dummies.businessLogo,
|
|
150
|
+
product: orderingTheme?.theme?.business_view?.components?.products?.components?.photo?.components?.dummy_image || theme.images.dummies.product
|
|
151
|
+
},
|
|
152
|
+
logos: {
|
|
153
|
+
...theme.images.logos,
|
|
154
|
+
logotype: orderingTheme?.theme?.header?.components?.logo?.components?.image || theme.images.logos.logotype
|
|
155
|
+
}
|
|
103
156
|
}
|
|
104
157
|
}
|
|
105
158
|
|
|
@@ -140,6 +193,9 @@ export const App = () => {
|
|
|
140
193
|
const isUserVerifyRequired = (isEmailVerifyRequired || isPhoneVerifyRequired) && !isKioskApp
|
|
141
194
|
const isHideFooter = orderingTheme?.theme?.footer?.hidden
|
|
142
195
|
|
|
196
|
+
const isHome = location.pathname === '/' || location.pathname === '/home'
|
|
197
|
+
const isFooterPage = location.pathname === '/pages/footer' || isKioskApp || isHideFooter
|
|
198
|
+
|
|
143
199
|
const closeAlert = () => {
|
|
144
200
|
setAlertState({
|
|
145
201
|
open: false,
|
|
@@ -152,9 +208,6 @@ export const App = () => {
|
|
|
152
208
|
window.location.reload()
|
|
153
209
|
}
|
|
154
210
|
|
|
155
|
-
const isHome = location.pathname === '/' || location.pathname === '/home'
|
|
156
|
-
const isFooterPage = location.pathname === '/pages/footer' || isKioskApp || isHideFooter
|
|
157
|
-
|
|
158
211
|
const handleSuccessSignup = (user) => {
|
|
159
212
|
if (!user?.enabled && (configs?.business_signup_enabled_default?.value === '0' || configs?.driver_signup_enabled_default?.value === '0')) {
|
|
160
213
|
signUpBusinesslayout === 'new'
|
|
@@ -277,6 +330,40 @@ export const App = () => {
|
|
|
277
330
|
}
|
|
278
331
|
}
|
|
279
332
|
|
|
333
|
+
useEffect(() => {
|
|
334
|
+
const link = document.createElement('link')
|
|
335
|
+
const oldLink = document.getElementById('favicon')
|
|
336
|
+
link.id = 'favicon'
|
|
337
|
+
link.rel = 'icon'
|
|
338
|
+
link.href = themeUpdated?.general?.components?.favicon
|
|
339
|
+
if (oldLink) {
|
|
340
|
+
document.head.removeChild(oldLink)
|
|
341
|
+
}
|
|
342
|
+
document.head.appendChild(link)
|
|
343
|
+
const fonts = Object.entries(themeUpdated?.general?.components?.fonts || {})
|
|
344
|
+
fonts.forEach(([name, fontFamily]) => {
|
|
345
|
+
const fontElement = window.document.getElementById(`${name}-font-styles`)
|
|
346
|
+
if (
|
|
347
|
+
(fontElement?.name !== fontFamily.name && fontFamily.name) ||
|
|
348
|
+
(fontElement?.href !== fontFamily?.href && fontFamily?.href)
|
|
349
|
+
) {
|
|
350
|
+
window.document.body.removeChild(window.document.getElementById(`${name}-font-styles`))
|
|
351
|
+
const font = window.document.createElement('link')
|
|
352
|
+
font.id = `${name}-font-styles`
|
|
353
|
+
font.rel = 'stylesheet'
|
|
354
|
+
font.async = true
|
|
355
|
+
font.defer = true
|
|
356
|
+
font.name = fontFamily.name
|
|
357
|
+
font.href = fontFamily.href || `https://fonts.googleapis.com/css2?family=${fontFamily.name}:wght@${fontFamily.weights.join(';')}&display=swap`
|
|
358
|
+
|
|
359
|
+
window.document.body.appendChild(font)
|
|
360
|
+
if (name === 'primary') {
|
|
361
|
+
window.document.body.style.fontFamily = fontFamily.name
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
})
|
|
365
|
+
}, [themeUpdated])
|
|
366
|
+
|
|
280
367
|
useEffect(() => {
|
|
281
368
|
if (!isShowReviewsPopupEnabled) return
|
|
282
369
|
const _user = window.localStorage.getItem('user')
|
|
@@ -367,13 +454,17 @@ export const App = () => {
|
|
|
367
454
|
/>
|
|
368
455
|
{
|
|
369
456
|
loaded && (
|
|
370
|
-
<ThemeProvider
|
|
457
|
+
<ThemeProvider
|
|
458
|
+
theme={orderingThemeUpdated(theme, orderingTheme)}
|
|
459
|
+
>
|
|
371
460
|
<ListenPageChanges />
|
|
372
|
-
{!(isKioskApp && isHome) &&
|
|
461
|
+
{!(isKioskApp && isHome) && (
|
|
373
462
|
<HeaderComponent
|
|
374
463
|
isHome={isHome}
|
|
375
464
|
location={location}
|
|
376
465
|
isCustomLayout={singleBusinessConfig.isActive}
|
|
466
|
+
searchValue={searchValue}
|
|
467
|
+
setSearchValue={setSearchValue}
|
|
377
468
|
/>
|
|
378
469
|
)}
|
|
379
470
|
<NotNetworkConnectivity />
|
|
@@ -507,7 +598,7 @@ export const App = () => {
|
|
|
507
598
|
<Redirect to='/verify' />
|
|
508
599
|
) : (
|
|
509
600
|
orderStatus.options?.address?.location
|
|
510
|
-
? <BusinessesList />
|
|
601
|
+
? <BusinessesList searchValueCustom={searchValue} />
|
|
511
602
|
: <Redirect to={singleBusinessConfig.isActive ? `/${singleBusinessConfig.businessSlug}` : '/'} />
|
|
512
603
|
)
|
|
513
604
|
)
|
|
@@ -553,7 +644,7 @@ export const App = () => {
|
|
|
553
644
|
/>
|
|
554
645
|
)}
|
|
555
646
|
</Route>
|
|
556
|
-
<Route path='/multi-checkout'>
|
|
647
|
+
<Route exact path='/multi-checkout/:cartUuid?'>
|
|
557
648
|
{auth
|
|
558
649
|
? isUserVerifyRequired
|
|
559
650
|
? <Redirect to='/verify' />
|
|
@@ -568,7 +659,22 @@ export const App = () => {
|
|
|
568
659
|
/>
|
|
569
660
|
)}
|
|
570
661
|
</Route>
|
|
571
|
-
<Route path='/multi-
|
|
662
|
+
<Route exact path='/multi-cart'>
|
|
663
|
+
{auth
|
|
664
|
+
? isUserVerifyRequired
|
|
665
|
+
? <Redirect to='/verify' />
|
|
666
|
+
: <MultiCart />
|
|
667
|
+
: (
|
|
668
|
+
<Redirect to={{
|
|
669
|
+
pathname: singleBusinessConfig.isActive
|
|
670
|
+
? `/${singleBusinessConfig.businessSlug}`
|
|
671
|
+
: '/',
|
|
672
|
+
state: { from: location.pathname || null }
|
|
673
|
+
}}
|
|
674
|
+
/>
|
|
675
|
+
)}
|
|
676
|
+
</Route>
|
|
677
|
+
<Route exact path='/multi-orders/:orderId'>
|
|
572
678
|
{auth
|
|
573
679
|
? isUserVerifyRequired
|
|
574
680
|
? <Redirect to='/verify' />
|
|
@@ -648,35 +754,42 @@ export const App = () => {
|
|
|
648
754
|
<BusinessProductsList />
|
|
649
755
|
)}
|
|
650
756
|
</Route>
|
|
651
|
-
<Route exact path='/:business_slug'>
|
|
757
|
+
<Route exact path='/store/:business_slug'>
|
|
652
758
|
{isUserVerifyRequired ? (
|
|
653
759
|
<Redirect to='/verify' />
|
|
654
760
|
) : (
|
|
655
761
|
<BusinessProductsList />
|
|
656
762
|
)}
|
|
657
763
|
</Route>
|
|
658
|
-
<Route exact path='/:business_slug/:category_slug/:product_slug'>
|
|
764
|
+
<Route exact path='/store/:business_slug/:category_slug/:product_slug'>
|
|
659
765
|
{isUserVerifyRequired ? (
|
|
660
766
|
<Redirect to='/verify' />
|
|
661
767
|
) : (
|
|
662
768
|
<BusinessProductsList />
|
|
663
769
|
)}
|
|
664
770
|
</Route>
|
|
665
|
-
<Route exact path='/store/:
|
|
771
|
+
<Route exact path='/store/:category_slug/:product_slug'>
|
|
666
772
|
{isUserVerifyRequired ? (
|
|
667
773
|
<Redirect to='/verify' />
|
|
668
774
|
) : (
|
|
669
775
|
<BusinessProductsList />
|
|
670
776
|
)}
|
|
671
777
|
</Route>
|
|
672
|
-
<Route exact path='
|
|
778
|
+
<Route exact path='/:business_slug'>
|
|
673
779
|
{isUserVerifyRequired ? (
|
|
674
780
|
<Redirect to='/verify' />
|
|
675
781
|
) : (
|
|
676
782
|
<BusinessProductsList />
|
|
677
783
|
)}
|
|
678
784
|
</Route>
|
|
679
|
-
<Route exact path='
|
|
785
|
+
<Route exact path='/:business_slug/:category_slug/:product_slug'>
|
|
786
|
+
{isUserVerifyRequired ? (
|
|
787
|
+
<Redirect to='/verify' />
|
|
788
|
+
) : (
|
|
789
|
+
<BusinessProductsList />
|
|
790
|
+
)}
|
|
791
|
+
</Route>
|
|
792
|
+
<Route exact path='/:business_slug/:category_slug'>
|
|
680
793
|
{isUserVerifyRequired ? (
|
|
681
794
|
<Redirect to='/verify' />
|
|
682
795
|
) : (
|
|
@@ -695,7 +808,7 @@ export const App = () => {
|
|
|
695
808
|
{(!isFooterPage || enabledPoweredByOrdering) && (
|
|
696
809
|
<Footer isFooterPage={isFooterPage} />
|
|
697
810
|
)}
|
|
698
|
-
{windowSize.width < 576 && onlineStatus && (
|
|
811
|
+
{(windowSize.width < 576 && onlineStatus) && (
|
|
699
812
|
<NavigationBar />
|
|
700
813
|
)}
|
|
701
814
|
<Alert
|
|
@@ -31,8 +31,9 @@ export const ListenPageChanges = ({ children }) => {
|
|
|
31
31
|
order_detail: '/orders/:orderId',
|
|
32
32
|
checkout: '/checkout/:cartUuid',
|
|
33
33
|
checkout_list: '/checkout',
|
|
34
|
-
multi_checkout: '/multi-checkout',
|
|
35
|
-
multi_orders: '/multi-orders',
|
|
34
|
+
multi_checkout: '/multi-checkout/:cartUuid',
|
|
35
|
+
multi_orders: '/multi-orders/:orderId',
|
|
36
|
+
multi_cart: '/multi-cart',
|
|
36
37
|
business: businessUrl,
|
|
37
38
|
business_slug: '/:store',
|
|
38
39
|
product: productUrl,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export const orderingThemeUpdated = (theme, orderingTheme) => ({
|
|
2
|
+
...theme,
|
|
3
|
+
...orderingTheme?.theme,
|
|
4
|
+
colors: {
|
|
5
|
+
...theme.colors,
|
|
6
|
+
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_btn_color && { primary: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_btn_color }),
|
|
7
|
+
...(orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color && { links: orderingTheme?.theme?.my_products?.components?.theme_settings?.components?.style?.primary_link_color })
|
|
8
|
+
},
|
|
9
|
+
images: {
|
|
10
|
+
...theme.images,
|
|
11
|
+
general: {
|
|
12
|
+
...theme.images.general,
|
|
13
|
+
homeHero: orderingTheme?.theme?.homepage_view?.components?.homepage_header?.components?.image || theme.images?.general?.homeHero,
|
|
14
|
+
businessHero: orderingTheme?.theme?.business_listing_view?.components?.business_hero?.components?.image || theme.images?.general?.businessHero,
|
|
15
|
+
notFound: orderingTheme?.theme?.business_listing_view?.components?.not_found_source?.components?.image || theme.images?.general?.notFound,
|
|
16
|
+
emptyActiveOrders: orderingTheme?.theme?.orders?.components?.active_orders?.components?.not_found_source?.components?.image || theme.images?.general?.emptyActiveOrders,
|
|
17
|
+
emptyPastOrders: orderingTheme?.theme?.orders?.components?.past_orders?.components?.not_found_source?.components?.image,
|
|
18
|
+
notNetwork: orderingTheme?.theme?.no_internet?.components?.image || theme.images?.general?.notNetwork,
|
|
19
|
+
businessSignUpHero: orderingTheme?.theme?.business_signup?.components?.icon?.components?.image || theme.images?.general?.businessSignUpHero,
|
|
20
|
+
driverSignUpHero: orderingTheme?.theme?.driver_signup?.components?.icon?.components?.image || theme.images?.general?.driverSignUpHero
|
|
21
|
+
},
|
|
22
|
+
categories: {
|
|
23
|
+
...theme.images.categories,
|
|
24
|
+
food: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.food?.image || theme.images.categories.categoryFood,
|
|
25
|
+
groceries: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.groceries?.image || theme.images.categories.categoryGroceries,
|
|
26
|
+
alcohol: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.alcohol?.image || theme.images.categories.categoryAlcohol,
|
|
27
|
+
laundry: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.laundry?.image || theme.images.categories.categoryLaundry,
|
|
28
|
+
all: orderingTheme?.theme?.business_listing_view?.components?.categories?.components?.all?.image || theme.images.categories.categoryAll
|
|
29
|
+
},
|
|
30
|
+
dummies: {
|
|
31
|
+
...theme.images.dummies,
|
|
32
|
+
businessHeader: orderingTheme?.theme?.business_view?.components?.header?.components?.dummy_image || theme.images.dummies.businessHeader,
|
|
33
|
+
businessLogo: orderingTheme?.theme?.business_view?.components?.header?.components?.logo?.dummy_image || theme.images.dummies.businessLogo,
|
|
34
|
+
product: orderingTheme?.theme?.business_view?.components?.products?.components?.photo?.components?.dummy_image || theme.images.dummies.product
|
|
35
|
+
},
|
|
36
|
+
logos: {
|
|
37
|
+
...theme.images.logos,
|
|
38
|
+
logotype: orderingTheme?.theme?.header?.components?.logo?.components?.image || theme.images.logos.logotype
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
})
|
package/template/helmetdata.json
CHANGED
|
@@ -180,5 +180,12 @@
|
|
|
180
180
|
"keywords": "test, dummy, data",
|
|
181
181
|
"robots": "index, follow",
|
|
182
182
|
"canonicalUrl": ""
|
|
183
|
+
},
|
|
184
|
+
"multi_cart": {
|
|
185
|
+
"title": "Multi Cart",
|
|
186
|
+
"description": "a dummy description about this page",
|
|
187
|
+
"keywords": "test, dummy, data",
|
|
188
|
+
"robots": "index, follow",
|
|
189
|
+
"canonicalUrl": ""
|
|
183
190
|
}
|
|
184
191
|
}
|
|
@@ -3,11 +3,13 @@ import { MessagesListing } from '../../../src/themes/five/src/components/Message
|
|
|
3
3
|
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
5
|
import { useEvent } from 'ordering-components-external'
|
|
6
|
+
import settings from '../../config'
|
|
6
7
|
|
|
7
8
|
export const MessagesList = (props) => {
|
|
8
9
|
const [events] = useEvent()
|
|
9
10
|
const messageprops = {
|
|
10
11
|
...props,
|
|
12
|
+
franchiseId: settings?.franchiseSlug,
|
|
11
13
|
onRedirectPage: (data) => events.emit('go_to_page', data)
|
|
12
14
|
}
|
|
13
15
|
return (
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { MultiCart as MultiCartController } from '../../../src/themes/five/src/components/MultiCart'
|
|
3
|
+
import { HelmetTags } from '../../components/HelmetTags'
|
|
4
|
+
import { useEvent } from 'ordering-components-external'
|
|
5
|
+
import { useParams } from 'react-router-dom'
|
|
6
|
+
|
|
7
|
+
export const MultiCart = (props) => {
|
|
8
|
+
const [events] = useEvent()
|
|
9
|
+
const { cartUuid, cartGroup } = useParams()
|
|
10
|
+
const multiCheckoutProps = {
|
|
11
|
+
...props,
|
|
12
|
+
onRedirectPage: (data) => events.emit('go_to_page', data),
|
|
13
|
+
handleOnRedirectMultiCheckout: (cartUuid) => {
|
|
14
|
+
events.emit('go_to_page', { page: 'multi_checkout', params: { cartUuid }, replace: true })
|
|
15
|
+
},
|
|
16
|
+
handleOnRedirectCheckout: (cartUuid) => {
|
|
17
|
+
events.emit('go_to_page', { page: 'checkout', params: { cartUuid }, replace: true })
|
|
18
|
+
},
|
|
19
|
+
cartUuid,
|
|
20
|
+
cartGroup
|
|
21
|
+
}
|
|
22
|
+
return (
|
|
23
|
+
<>
|
|
24
|
+
<HelmetTags page='multi_cart' />
|
|
25
|
+
<MultiCartController {...multiCheckoutProps} />
|
|
26
|
+
</>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default MultiCart
|
|
@@ -1,22 +1,98 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useParams } from 'react-router-dom'
|
|
3
3
|
import { MultiCheckout as MultiCheckoutController } from '../../../src/themes/five/src/components/MultiCheckout'
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
|
-
import { useEvent } from 'ordering-components-external'
|
|
5
|
+
import { useEvent, useLanguage, useOrder } from 'ordering-components-external'
|
|
6
|
+
import { loadStripe } from '@stripe/stripe-js'
|
|
6
7
|
|
|
7
8
|
export const MultiCheckout = (props) => {
|
|
8
9
|
const [events] = useEvent()
|
|
9
|
-
const
|
|
10
|
+
const { cartUuid } = useParams()
|
|
11
|
+
const [, { confirmMultiCarts }] = useOrder()
|
|
12
|
+
const [, t] = useLanguage()
|
|
13
|
+
const stripePayments = ['stripe', 'stripe_connect', 'stripe_direct', 'google_pay', 'apple_pay']
|
|
14
|
+
const [errors, setErrors] = useState([])
|
|
15
|
+
|
|
16
|
+
const actionsBeforePlace = async (paymethod, cart) => {
|
|
17
|
+
if (stripePayments.includes(paymethod.gateway)) {
|
|
18
|
+
try {
|
|
19
|
+
const stripe = await loadStripe(paymethod.paymethod?.credentials?.publishable || paymethod?.paymethod?.credentials?.publishable_key)
|
|
20
|
+
const result = await stripe.confirmCardPayment(cart.paymethod_data.result.client_secret)
|
|
21
|
+
if (result?.paymentIntent?.status === 'succeeded') {
|
|
22
|
+
try {
|
|
23
|
+
const confirmCartRes = await confirmMultiCarts(cartUuid)
|
|
24
|
+
if (confirmCartRes.error) {
|
|
25
|
+
setErrors([confirmCartRes.error.message])
|
|
26
|
+
}
|
|
27
|
+
if (confirmCartRes.result.order?.uuid) {
|
|
28
|
+
events.emit('go_to_page', { page: 'multi_orders', params: { orderId: confirmCartRes.result.order.uuid }, replace: true })
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
setErrors([error.message])
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (result?.error?.code === 'payment_intent_authentication_failure') {
|
|
35
|
+
setErrors([t('CART_STATUS_CANCEL_MESSAGE', 'The payment has not been successful, please try again')])
|
|
36
|
+
}
|
|
37
|
+
return true
|
|
38
|
+
} catch (error) {
|
|
39
|
+
setErrors([error.message])
|
|
40
|
+
}
|
|
41
|
+
} else if (paymethod.gateway === 'stripe_redirect') {
|
|
42
|
+
const stripe = await loadStripe(paymethod.paymethod?.credentials?.publishable)
|
|
43
|
+
const confirmOption = {
|
|
44
|
+
bancontact: {
|
|
45
|
+
name: 'confirmBancontactPayment',
|
|
46
|
+
type: 1
|
|
47
|
+
},
|
|
48
|
+
alipay: {
|
|
49
|
+
name: 'confirmAlipayPayment',
|
|
50
|
+
type: 2
|
|
51
|
+
},
|
|
52
|
+
giropay: {
|
|
53
|
+
name: 'confirmGiropayPayment',
|
|
54
|
+
type: 1
|
|
55
|
+
},
|
|
56
|
+
ideal: {
|
|
57
|
+
name: 'confirmIdealPayment',
|
|
58
|
+
type: 2
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const params = {
|
|
62
|
+
1: {
|
|
63
|
+
payment_method: {
|
|
64
|
+
billing_details: cart.paymethod_data.data.owner
|
|
65
|
+
},
|
|
66
|
+
return_url: `${window.location.origin}/checkout/${cartUuid}`
|
|
67
|
+
},
|
|
68
|
+
2: {
|
|
69
|
+
return_url: `${window.location.origin}/checkout/${cartUuid}`
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
stripe[confirmOption[paymethod.data.type]?.name](
|
|
73
|
+
cart.paymethod_data.result.client_secret,
|
|
74
|
+
params[confirmOption[paymethod.data.type]?.type]
|
|
75
|
+
).then((result) => {
|
|
76
|
+
if (result?.error) {
|
|
77
|
+
setErrors([...errors, result?.error?.message])
|
|
78
|
+
}
|
|
79
|
+
}).catch((e) => {
|
|
80
|
+
setErrors([...errors, e?.message || e?.toString()])
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
}
|
|
10
84
|
const multiCheckoutProps = {
|
|
11
85
|
...props,
|
|
86
|
+
cartUuid,
|
|
87
|
+
errors,
|
|
88
|
+
clearErrors: () => setErrors([]),
|
|
12
89
|
onRedirectPage: (data) => events.emit('go_to_page', data),
|
|
13
|
-
onPlaceOrderClick: (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
}
|
|
90
|
+
onPlaceOrderClick: (order) => {
|
|
91
|
+
events.emit('go_to_page', { page: 'multi_orders', params: { orderId: order?.id } })
|
|
92
|
+
},
|
|
93
|
+
actionsBeforePlace
|
|
19
94
|
}
|
|
95
|
+
|
|
20
96
|
return (
|
|
21
97
|
<>
|
|
22
98
|
<HelmetTags page='multi_checkout' />
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useHistory, useParams } from 'react-router-dom'
|
|
3
3
|
import { MultiOrdersDetails as MultiOrdersDetailsController } from '../../../src/themes/five/src/components/MultiOrdersDetails'
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
5
|
import { useEvent } from 'ordering-components-external'
|
|
6
6
|
|
|
7
7
|
export const MultiOrdersDetails = (props) => {
|
|
8
8
|
const [events] = useEvent()
|
|
9
|
-
const {
|
|
9
|
+
const { orderId } = useParams()
|
|
10
|
+
const history = useHistory()
|
|
11
|
+
|
|
10
12
|
const multiOrdersDetailsProps = {
|
|
11
13
|
...props,
|
|
12
|
-
|
|
13
|
-
onRedirectPage: () => events.emit('go_to_page', { page: 'search' })
|
|
14
|
+
orderId: orderId,
|
|
15
|
+
onRedirectPage: () => events.emit('go_to_page', { page: 'search' }),
|
|
16
|
+
handleOrderRedirect: () => {
|
|
17
|
+
history.push('/profile/orders')
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
return (
|
|
16
21
|
<>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonpOrderingUI=window.webpackJsonpOrderingUI||[]).push([[0],{625:function(t,n,e){"use strict";function i(t,n){var e,i;return"boolean"==typeof(null==n?void 0:n.enabled)?n.enabled:null===(i=null===(e=null==t?void 0:t.__default)||void 0===e?void 0:e.enabled)||void 0===i||i}e.d(n,"a",(function(){return i}))},728:function(t,n,e){"use strict";e.r(n),e.d(n,"LegacyDestination",(function(){return w})),e.d(n,"ajsDestinations",(function(){return _}));var i=e(4),r=e(58),o=e(47),a=e(21),s=e(103),c=e(66),u=e(625),d=e(193),l=e(198),h=e(48),v=e(72),f=e(194),b=e(87),p=e(108);function g(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function y(t,n){return void 0===n&&(n=!1),n?btoa(t).replace(/=/g,""):void 0}function j(t,n,e,r){return Object(i.b)(this,void 0,void 0,(function(){var o,a,s,c,u,d;return Object(i.d)(this,(function(l){switch(l.label){case 0:o=g(n),a=y(o,r),s=Object(b.b)(),c="".concat(s,"/integrations/").concat(null!=a?a:o,"/").concat(e,"/").concat(null!=a?a:o,".dynamic.js.gz"),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Object(p.a)(c)];case 2:return l.sent(),function(t,n,e){var r,o;try{var a=(null!==(o=null===(r=null===window||void 0===window?void 0:window.performance)||void 0===r?void 0:r.getEntriesByName(t,"resource"))&&void 0!==o?o:[])[0];a&&n.stats.gauge("legacy_destination_time",Math.round(a.duration),Object(i.f)([e],a.duration<100?["cached"]:[],!0))}catch(t){}}(c,t,n),[3,4];case 3:throw u=l.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(n),"failed"]),u;case 4:return d=window["".concat(o,"Deps")],[4,Promise.all(d.map((function(t){return Object(p.a)(s+t+".gz")})))];case 5:return l.sent(),window["".concat(o,"Loader")](),[2,window["".concat(o,"Integration")]]}}))}))}function O(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function m(t,n){return Object(i.b)(this,void 0,void 0,(function(){var e,r=this;return Object(i.d)(this,(function(s){switch(s.label){case 0:return e=[],Object(o.a)()?[2,n]:[4,Object(l.a)((function(){return n.length>0&&Object(o.b)()}),(function(){return Object(i.b)(r,void 0,void 0,(function(){var r,o;return Object(i.d)(this,(function(i){switch(i.label){case 0:return(r=n.pop())?[4,Object(c.a)(r,t)]:[2];case 1:return o=i.sent(),o instanceof a.a||e.push(r),[2]}}))}))}))];case 1:return s.sent(),e.map((function(t){return n.pushWithBackoff(t)})),[2,n]}}))}))}var w=function(){function t(t,n,e,r,o){void 0===e&&(e={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=n,this.settings=Object(i.a)({},e),this.disableAutoISOConversion=r.disableAutoISOConversion||!1,this.integrationSource=o,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=r,this.buffer=r.disableClientPersistence?new h.b(4,[]):new v.a(4,"dest-".concat(t)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return this._ready},t.prototype.ready=function(){var t;return null!==(t=this.onReady)&&void 0!==t?t:Promise.resolve()},t.prototype.load=function(t,n){var e;return Object(i.b)(this,void 0,void 0,(function(){var r,o,a=this;return Object(i.d)(this,(function(i){switch(i.label){case 0:return this._ready||void 0!==this.onReady?[2]:null===(e=this.integrationSource)||void 0===e?[3,1]:(o=e,[3,3]);case 1:return[4,j(t,this.name,this.version,this.options.obfuscate)];case 2:o=i.sent(),i.label=3;case 3:r=o,this.integration=function(t,n,e){var i;"Integration"in t?(t({user:function(){return e.user()},addIntegration:function(){}}),i=t.Integration):i=t;var r=new i(n);return r.analytics=e,r}(r,this.settings,n),this.onReady=new Promise((function(t){a.integration.once("ready",(function(){a._ready=!0,t(!0)}))})),this.onInitialize=new Promise((function(t){a.integration.on("initialize",(function(){a._initialized=!0,t(!0)}))}));try{t.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(n){throw t.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),n}return[2]}}))}))},t.prototype.unload=function(t,n){return function(t,n,e){return Object(i.b)(this,void 0,void 0,(function(){var r,o,a,s;return Object(i.d)(this,(function(i){return r=Object(b.b)(),o=g(t),a=y(t,e),s="".concat(r,"/integrations/").concat(null!=a?a:o,"/").concat(n,"/").concat(null!=a?a:o,".dynamic.js.gz"),[2,Object(p.b)(s)]}))}))}(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var t,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.middleware=(t=this.middleware).concat.apply(t,n)},t.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&(Object(o.a)()||!1===this._ready||!1===this._initialized)},t.prototype.send=function(t,n,e){var r,o;return Object(i.b)(this,void 0,void 0,(function(){var s,c,d,l,h,v;return Object(i.d)(this,(function(b){switch(b.label){case 0:if(this.shouldBuffer(t))return this.buffer.push(t),this.scheduleFlush(),[2,t];if(s=null===(o=null===(r=this.options)||void 0===r?void 0:r.plan)||void 0===o?void 0:o.track,c=t.event.event,s&&c&&"Segment.io"!==this.name){if(d=s[c],!Object(u.a)(s,d))return t.updateEvent("integrations",Object(i.a)(Object(i.a)({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new a.b({retry:!1,reason:"Event ".concat(c," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t];if(t.updateEvent("integrations",Object(i.a)(Object(i.a)({},t.event.integrations),null==d?void 0:d.integrations)),(null==d?void 0:d.enabled)&&!1===(null==d?void 0:d.integrations[this.name]))return t.cancel(new a.b({retry:!1,reason:"Event ".concat(c," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t]}return[4,Object(f.applyDestinationMiddleware)(this.name,t.event,this.middleware)];case 1:if(null===(l=b.sent()))return[2,t];h=new n(l,{traverse:!this.disableAutoISOConversion}),t.stats.increment("analytics_js.integration.invoke",1,["method:".concat(e),"integration_name:".concat(this.name)]),b.label=2;case 2:return b.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,e,h)]:[3,4];case 3:b.sent(),b.label=4;case 4:return[3,6];case 5:throw v=b.sent(),t.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(e),"integration_name:".concat(this.name)]),v;case 6:return[2,t]}}))}))},t.prototype.track=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(n){return[2,this.send(t,r.Track,"track")]}))}))},t.prototype.page=function(t){var n;return Object(i.b)(this,void 0,void 0,(function(){var e=this;return Object(i.d)(this,(function(i){return(null===(n=this.integration)||void 0===n?void 0:n._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return e.send(t,r.Page,"page")}))]}))}))},t.prototype.identify=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(n){return[2,this.send(t,r.Identify,"identify")]}))}))},t.prototype.alias=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(n){return[2,this.send(t,r.Alias,"alias")]}))}))},t.prototype.group=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(n){return[2,this.send(t,r.Group,"group")]}))}))},t.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout((function(){return Object(i.b)(t,void 0,void 0,(function(){var t;return Object(i.d)(this,(function(n){switch(n.label){case 0:return this.flushing=!0,t=this,[4,m(this,this.buffer)];case 1:return t.buffer=n.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},t}();function _(t,n,e,r,o){var a,c;if(void 0===n&&(n={}),void 0===e&&(e={}),Object(s.b)())return[];t.plan&&((e=null!=e?e:{}).plan=t.plan);var u=null!==(c=null===(a=t.middlewareSettings)||void 0===a?void 0:a.routingRules)&&void 0!==c?c:[],l=t.integrations,h=e.integrations,v=Object(d.a)(t,null!=e?e:{}),f=null==o?void 0:o.reduce((function(t,n){var e;return Object(i.a)(Object(i.a)({},t),((e={})[function(t){return("Integration"in t?t.Integration:t).prototype.name}(n)]=n,e))}),{}),b=new Set(Object(i.f)(Object(i.f)([],Object.keys(l).filter((function(t){return function(t,n){var e,i=n.type,r=n.bundlingStatus,o=n.versionSettings,a="unbundled"!==r&&("browser"===i||(null===(e=null==o?void 0:o.componentTypes)||void 0===e?void 0:e.includes("browser")));return!t.startsWith("Segment")&&"Iterable"!==t&&a}(t,l[t])})),!0),Object.keys(f||{}).filter((function(t){return O(l[t])||O(null==h?void 0:h[t])})),!0));return Array.from(b).filter((function(t){return!function(t,n){var e=!1===n.All&&void 0===n[t];return!1===n[t]||e}(t,n)})).map((function(t){var n=function(t){var n,e,i,r;return null!==(r=null!==(e=null===(n=null==t?void 0:t.versionSettings)||void 0===n?void 0:n.override)&&void 0!==e?e:null===(i=null==t?void 0:t.versionSettings)||void 0===i?void 0:i.version)&&void 0!==r?r:"latest"}(l[t]),i=new w(t,n,v[t],e,null==f?void 0:f[t]);return u.filter((function(n){return n.destinationName===t})).length>0&&r&&i.addMiddleware(r),i}))}}}]);
|