@anker-in/campaign-ui 0.5.0-beta.2 → 0.5.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/credits/context/hooks/useCountries.js +1 -1
- package/dist/cjs/components/credits/context/hooks/useCountries.js.map +3 -3
- package/dist/cjs/components/memberPopup/MemberPopup.d.ts +1 -1
- package/dist/cjs/components/memberPopup/MemberPopup.js +1 -1
- package/dist/cjs/components/memberPopup/MemberPopup.js.map +3 -3
- package/dist/cjs/components/memberPopup/context/provider.d.ts +3 -3
- package/dist/cjs/components/memberPopup/context/provider.js +1 -1
- package/dist/cjs/components/memberPopup/context/provider.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/ActivitiesSubscribePanel.d.ts +7 -0
- package/dist/cjs/components/memberPopup/panels/ActivitiesSubscribePanel.js +2 -0
- package/dist/cjs/components/memberPopup/panels/ActivitiesSubscribePanel.js.map +7 -0
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/RedeemCouponPanel.d.ts +9 -7
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/RedeemCouponPanel.js +1 -1
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/RedeemCouponPanel.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/index.d.ts +1 -2
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/index.js +1 -1
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/index.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/EarnCredits/ActivatePanel.d.ts +1 -2
- package/dist/cjs/components/memberPopup/panels/EarnCredits/ActivatePanel.js +1 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/ActivatePanel.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/EarnCredits/CompleteProfileModal.js +1 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/CompleteProfileModal.js.map +2 -2
- package/dist/cjs/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.d.ts +1 -3
- package/dist/cjs/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.js +1 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribeEmailPanel.d.ts +1 -2
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribeEmailPanel.js +1 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribeEmailPanel.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/EarnCredits/index.d.ts +1 -8
- package/dist/cjs/components/memberPopup/panels/EarnCredits/index.js +1 -1
- package/dist/cjs/components/memberPopup/panels/EarnCredits/index.js.map +3 -3
- package/dist/cjs/components/memberPopup/panels/Referral/index.js +1 -1
- package/dist/cjs/components/memberPopup/panels/Referral/index.js.map +3 -3
- package/dist/cjs/components/memberPopup/type.d.ts +29 -3
- package/dist/cjs/components/memberPopup/type.js +1 -1
- package/dist/cjs/components/memberPopup/type.js.map +2 -2
- package/dist/cjs/templates/Credits.js +1 -1
- package/dist/cjs/templates/Credits.js.map +3 -3
- package/dist/esm/components/credits/context/hooks/useCountries.js +1 -1
- package/dist/esm/components/credits/context/hooks/useCountries.js.map +3 -3
- package/dist/esm/components/memberPopup/MemberPopup.d.ts +1 -1
- package/dist/esm/components/memberPopup/MemberPopup.js +1 -1
- package/dist/esm/components/memberPopup/MemberPopup.js.map +3 -3
- package/dist/esm/components/memberPopup/context/provider.d.ts +3 -3
- package/dist/esm/components/memberPopup/context/provider.js +1 -1
- package/dist/esm/components/memberPopup/context/provider.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/ActivitiesSubscribePanel.d.ts +7 -0
- package/dist/esm/components/memberPopup/panels/ActivitiesSubscribePanel.js +2 -0
- package/dist/esm/components/memberPopup/panels/ActivitiesSubscribePanel.js.map +7 -0
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/RedeemCouponPanel.d.ts +9 -7
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/RedeemCouponPanel.js +1 -1
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/RedeemCouponPanel.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/index.d.ts +1 -2
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/index.js +1 -1
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/index.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/EarnCredits/ActivatePanel.d.ts +1 -2
- package/dist/esm/components/memberPopup/panels/EarnCredits/ActivatePanel.js +1 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/ActivatePanel.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/EarnCredits/CompleteProfileModal.js +1 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/CompleteProfileModal.js.map +2 -2
- package/dist/esm/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.d.ts +1 -3
- package/dist/esm/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.js +1 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribeEmailPanel.d.ts +1 -2
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribeEmailPanel.js +1 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribeEmailPanel.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/EarnCredits/index.d.ts +1 -8
- package/dist/esm/components/memberPopup/panels/EarnCredits/index.js +1 -1
- package/dist/esm/components/memberPopup/panels/EarnCredits/index.js.map +3 -3
- package/dist/esm/components/memberPopup/panels/Referral/index.js +1 -1
- package/dist/esm/components/memberPopup/panels/Referral/index.js.map +3 -3
- package/dist/esm/components/memberPopup/type.d.ts +29 -3
- package/dist/esm/components/memberPopup/type.js +1 -1
- package/dist/esm/components/memberPopup/type.js.map +2 -2
- package/dist/esm/templates/Credits.js +1 -1
- package/dist/esm/templates/Credits.js.map +3 -3
- package/package.json +1 -1
- package/src/components/credits/context/hooks/useCountries.ts +4 -15
- package/src/components/memberPopup/MemberPopup.tsx +170 -177
- package/src/components/memberPopup/context/provider.tsx +24 -4
- package/src/components/memberPopup/panels/ActivitiesSubscribePanel.tsx +194 -0
- package/src/components/memberPopup/panels/ConsumeCredits/RedeemCouponPanel.tsx +93 -60
- package/src/components/memberPopup/panels/ConsumeCredits/index.tsx +200 -87
- package/src/components/memberPopup/panels/EarnCredits/ActivatePanel.tsx +30 -15
- package/src/components/memberPopup/panels/EarnCredits/CompleteProfileModal.tsx +6 -1
- package/src/components/memberPopup/panels/EarnCredits/CompleteProfilePanel.tsx +65 -35
- package/src/components/memberPopup/panels/EarnCredits/SubscribeEmailPanel.tsx +15 -6
- package/src/components/memberPopup/panels/EarnCredits/index.tsx +131 -86
- package/src/components/memberPopup/panels/Referral/index.tsx +35 -16
- package/src/components/memberPopup/type.ts +26 -3
- package/src/templates/Credits.tsx +25 -0
- package/dist/cjs/components/memberPopup/panels/Activity/SubscribeModal.d.ts +0 -10
- package/dist/cjs/components/memberPopup/panels/Activity/SubscribeModal.js +0 -2
- package/dist/cjs/components/memberPopup/panels/Activity/SubscribeModal.js.map +0 -7
- package/dist/cjs/components/memberPopup/panels/Activity/hooks/useActivitySubscribe.d.ts +0 -7
- package/dist/cjs/components/memberPopup/panels/Activity/hooks/useActivitySubscribe.js +0 -2
- package/dist/cjs/components/memberPopup/panels/Activity/hooks/useActivitySubscribe.js.map +0 -7
- package/dist/cjs/components/memberPopup/panels/Activity/index.d.ts +0 -7
- package/dist/cjs/components/memberPopup/panels/Activity/index.js +0 -2
- package/dist/cjs/components/memberPopup/panels/Activity/index.js.map +0 -7
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/RedeemCouponModal.d.ts +0 -19
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/RedeemCouponModal.js +0 -2
- package/dist/cjs/components/memberPopup/panels/ConsumeCredits/RedeemCouponModal.js.map +0 -7
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribeModal.d.ts +0 -10
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribeModal.js +0 -2
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribeModal.js.map +0 -7
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribePanel.d.ts +0 -9
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribePanel.js +0 -2
- package/dist/cjs/components/memberPopup/panels/EarnCredits/SubscribePanel.js.map +0 -7
- package/dist/cjs/components/memberPopup/panels/Referral/hooks/useReferralDashboard.d.ts +0 -13
- package/dist/cjs/components/memberPopup/panels/Referral/hooks/useReferralDashboard.js +0 -2
- package/dist/cjs/components/memberPopup/panels/Referral/hooks/useReferralDashboard.js.map +0 -7
- package/dist/esm/components/memberPopup/panels/Activity/SubscribeModal.d.ts +0 -10
- package/dist/esm/components/memberPopup/panels/Activity/SubscribeModal.js +0 -2
- package/dist/esm/components/memberPopup/panels/Activity/SubscribeModal.js.map +0 -7
- package/dist/esm/components/memberPopup/panels/Activity/hooks/useActivitySubscribe.d.ts +0 -7
- package/dist/esm/components/memberPopup/panels/Activity/hooks/useActivitySubscribe.js +0 -2
- package/dist/esm/components/memberPopup/panels/Activity/hooks/useActivitySubscribe.js.map +0 -7
- package/dist/esm/components/memberPopup/panels/Activity/index.d.ts +0 -7
- package/dist/esm/components/memberPopup/panels/Activity/index.js +0 -2
- package/dist/esm/components/memberPopup/panels/Activity/index.js.map +0 -7
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/RedeemCouponModal.d.ts +0 -19
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/RedeemCouponModal.js +0 -2
- package/dist/esm/components/memberPopup/panels/ConsumeCredits/RedeemCouponModal.js.map +0 -7
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribeModal.d.ts +0 -10
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribeModal.js +0 -2
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribeModal.js.map +0 -7
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribePanel.d.ts +0 -9
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribePanel.js +0 -2
- package/dist/esm/components/memberPopup/panels/EarnCredits/SubscribePanel.js.map +0 -7
- package/dist/esm/components/memberPopup/panels/Referral/hooks/useReferralDashboard.d.ts +0 -13
- package/dist/esm/components/memberPopup/panels/Referral/hooks/useReferralDashboard.js +0 -2
- package/dist/esm/components/memberPopup/panels/Referral/hooks/useReferralDashboard.js.map +0 -7
- package/dist/index.d.mts +0 -1775
- package/dist/index.d.ts +0 -1775
- package/dist/index.js +0 -18542
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -18514
- package/dist/index.mjs.map +0 -1
- package/src/components/memberPopup/panels/ConsumeCredits/RedeemCouponModal.tsx +0 -150
- package/src/components/memberPopup/panels/EarnCredits/SubscribeModal.tsx +0 -144
- package/src/components/memberPopup/panels/EarnCredits/SubscribePanel.tsx +0 -147
package/dist/index.d.mts
DELETED
|
@@ -1,1775 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { PropsWithChildren, Dispatch, SetStateAction } from 'react';
|
|
4
|
-
export { useCopilotAction, useCopilotChat, useCopilotReadable } from '@copilotkit/react-core';
|
|
5
|
-
export { ActionExecutionMessage, Role, TextMessage } from '@copilotkit/runtime-client-gql';
|
|
6
|
-
import * as swr_dist_mutation from 'swr/dist/mutation';
|
|
7
|
-
import { HeadlessConfig } from '@anker-in/lib';
|
|
8
|
-
|
|
9
|
-
interface ChatProps {
|
|
10
|
-
title: string;
|
|
11
|
-
runtimeUrl: string;
|
|
12
|
-
shopifyDomain: string;
|
|
13
|
-
/** GA 的 client id
|
|
14
|
-
*/
|
|
15
|
-
userId: string;
|
|
16
|
-
/** 是否登陆用户 0 or 1
|
|
17
|
-
*/
|
|
18
|
-
account?: string;
|
|
19
|
-
/** 用户浏览器语言
|
|
20
|
-
*/
|
|
21
|
-
locale?: string;
|
|
22
|
-
/** 开场白
|
|
23
|
-
*/
|
|
24
|
-
prologue?: string;
|
|
25
|
-
/** ?a=1&b=2
|
|
26
|
-
*/
|
|
27
|
-
query?: string;
|
|
28
|
-
/** 'follow' or 'unfollow' | true or false
|
|
29
|
-
* follow: ResponseButton 会跟随在 messages 的后边
|
|
30
|
-
* unfollow: ResponseButton 在聊天框底部
|
|
31
|
-
*/
|
|
32
|
-
showResponseButton?: string | boolean;
|
|
33
|
-
/** messages 的回调事件
|
|
34
|
-
* 每次生成/接受新的messages,会将 整个 messages list 传递给外部
|
|
35
|
-
*/
|
|
36
|
-
messagesCallback?: (_messages: any) => void;
|
|
37
|
-
/** 通用 action 的触发事件
|
|
38
|
-
*/
|
|
39
|
-
commonRender?: string | ((_props: any) => React__default.ReactElement);
|
|
40
|
-
/** shulex的 action 的触发事件
|
|
41
|
-
*/
|
|
42
|
-
shulexRender?: string | ((_props: any) => React__default.ReactElement);
|
|
43
|
-
/** 通用 积分 换 Coupon 的触发事件
|
|
44
|
-
*/
|
|
45
|
-
pointsExchangeCouponRender?: string | ((_props: any) => React__default.ReactElement);
|
|
46
|
-
/** 跳转 checkout action 卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
47
|
-
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
48
|
-
*/
|
|
49
|
-
gotocheckoutRender?: string | ((_props: any) => React__default.ReactElement);
|
|
50
|
-
/** 打开购物车 action 卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
51
|
-
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
52
|
-
*/
|
|
53
|
-
gotocartRender?: string | ((_props: any) => React__default.ReactElement);
|
|
54
|
-
/** 打开购物车 action 的触发事件
|
|
55
|
-
*/
|
|
56
|
-
addtocartHandler?: (_args: any) => Promise<any>;
|
|
57
|
-
/** 加购卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
58
|
-
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
59
|
-
*/
|
|
60
|
-
addtocartRender?: string | ((_props: any) => React__default.ReactElement);
|
|
61
|
-
/** 订阅卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
62
|
-
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
63
|
-
*/
|
|
64
|
-
signupRender?: string | ((_props: any) => React__default.ReactElement);
|
|
65
|
-
/** 产品卡片,接受参数: {"status":"complete","args":[{"sku":["A3936031"],"handle":"space-a40-a3936031"}],"result":""}
|
|
66
|
-
* 后端接口文档:https://anker-in.feishu.cn/wiki/DOYJwE9oxipWmYk072ncnJNznBb
|
|
67
|
-
*/
|
|
68
|
-
productRender?: string | ((_props: any) => React__default.ReactElement);
|
|
69
|
-
/** CopilotPopup 自定义参数,参考:https://docs.copilotkit.ai/reference/components/CopilotPopup */
|
|
70
|
-
popup?: any;
|
|
71
|
-
/** 文案,{"productRenderTipMessage": "","popupTip": "Hi ! Welcome to soundcore Innovations live chat!", "popupTipTimeout": [3000, 6000]} */
|
|
72
|
-
lang?: any;
|
|
73
|
-
/** 参考此文档:https://docs.copilotkit.ai/concepts/customize-look-and-feel */
|
|
74
|
-
style?: any;
|
|
75
|
-
className?: string;
|
|
76
|
-
}
|
|
77
|
-
declare const Chat: (props: ChatProps) => react_jsx_runtime.JSX.Element;
|
|
78
|
-
|
|
79
|
-
declare enum ConsumeType {
|
|
80
|
-
Coupon = "coupon",
|
|
81
|
-
GiftCard = "giftCard",
|
|
82
|
-
GoGift = "goGift",
|
|
83
|
-
Product = "product",
|
|
84
|
-
ShippingCoupon = "shippingCoupon"
|
|
85
|
-
}
|
|
86
|
-
declare enum DTC_TASK_TYPE {
|
|
87
|
-
FirstPurchase = "firstPurchase",
|
|
88
|
-
UploadReceipt = "uploadReceipt",
|
|
89
|
-
Shopping = "shopping"
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
interface BaseResponse {
|
|
93
|
-
brand: string;
|
|
94
|
-
}
|
|
95
|
-
interface CreditInfoResponse extends BaseResponse {
|
|
96
|
-
total_credit: number;
|
|
97
|
-
available_credit: number;
|
|
98
|
-
pending_credit: number;
|
|
99
|
-
expired_credit: number;
|
|
100
|
-
cancel_credit: number;
|
|
101
|
-
consumed_credit: number;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
interface MyActivitiesMetafields {
|
|
105
|
-
title: string;
|
|
106
|
-
tips: string;
|
|
107
|
-
allTab: string;
|
|
108
|
-
earnedTab: string;
|
|
109
|
-
deductedTab: string;
|
|
110
|
-
expiredTab: string;
|
|
111
|
-
activationTask: string;
|
|
112
|
-
updateNameTask: string;
|
|
113
|
-
updatePhoneTask: string;
|
|
114
|
-
updateBirthdayTask: string;
|
|
115
|
-
updateAppNameTask: string;
|
|
116
|
-
subscriptionTask: string;
|
|
117
|
-
refundTask: string;
|
|
118
|
-
productUnApprovedTask: string;
|
|
119
|
-
pendingTips?: string;
|
|
120
|
-
pendingTips2?: string;
|
|
121
|
-
firstPurchaseTask: string;
|
|
122
|
-
uploadReceiptTask: string;
|
|
123
|
-
shoppingTask: string;
|
|
124
|
-
emptyListImage: {
|
|
125
|
-
url: string;
|
|
126
|
-
alt?: string;
|
|
127
|
-
};
|
|
128
|
-
emptyListLabel: string;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
interface RewardsCopy {
|
|
132
|
-
title: string;
|
|
133
|
-
orderNumberLabel: string;
|
|
134
|
-
valueLabel: string;
|
|
135
|
-
receivedLabel: string;
|
|
136
|
-
failedLabel: string;
|
|
137
|
-
approveSuccessLabel: string;
|
|
138
|
-
couponTab: string;
|
|
139
|
-
productTab: string;
|
|
140
|
-
externalProductTab?: string;
|
|
141
|
-
pendingLabel: string;
|
|
142
|
-
unfulfilledLabel: string;
|
|
143
|
-
fulfilledLabel: string;
|
|
144
|
-
confirmedTip: string;
|
|
145
|
-
pendingTip: string;
|
|
146
|
-
processingTip: string;
|
|
147
|
-
ShippedTip: string;
|
|
148
|
-
emptyListLabel: string;
|
|
149
|
-
pointUnit: string;
|
|
150
|
-
code: string;
|
|
151
|
-
copied: string;
|
|
152
|
-
copy: string;
|
|
153
|
-
redeemLinkLabel?: string;
|
|
154
|
-
goGiftStatus?: {
|
|
155
|
-
pending?: {
|
|
156
|
-
label: string;
|
|
157
|
-
tip: string;
|
|
158
|
-
};
|
|
159
|
-
approved?: {
|
|
160
|
-
label: string;
|
|
161
|
-
tip: string;
|
|
162
|
-
};
|
|
163
|
-
secondConfirm?: {
|
|
164
|
-
label: string;
|
|
165
|
-
tip: string;
|
|
166
|
-
};
|
|
167
|
-
rejected?: {
|
|
168
|
-
label: string;
|
|
169
|
-
tip: string;
|
|
170
|
-
};
|
|
171
|
-
callbackPending?: {
|
|
172
|
-
label: string;
|
|
173
|
-
tip: string;
|
|
174
|
-
};
|
|
175
|
-
callbackSuccess?: {
|
|
176
|
-
label: string;
|
|
177
|
-
tip: string;
|
|
178
|
-
};
|
|
179
|
-
callbackTimeout?: {
|
|
180
|
-
label: string;
|
|
181
|
-
tip: string;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
emptyListImage: {
|
|
185
|
-
url: string;
|
|
186
|
-
alt?: string;
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
type RedeemModalCommon = {
|
|
191
|
-
confirmTitle: string;
|
|
192
|
-
confirmButton: string;
|
|
193
|
-
commonError: string;
|
|
194
|
-
redeemLimitError: string;
|
|
195
|
-
inventoryNotEnough: string;
|
|
196
|
-
creditsNotEnough: string;
|
|
197
|
-
crossSiteError: string;
|
|
198
|
-
errorImageUrl: string;
|
|
199
|
-
coupon: {
|
|
200
|
-
successDesc: string;
|
|
201
|
-
successTitle: string;
|
|
202
|
-
successButton: string;
|
|
203
|
-
successButtonUrl: string;
|
|
204
|
-
};
|
|
205
|
-
virtualProduct: {
|
|
206
|
-
successDesc: string;
|
|
207
|
-
successTitle: string;
|
|
208
|
-
successButton: string;
|
|
209
|
-
successButtonUrl: string;
|
|
210
|
-
stepTitle?: string;
|
|
211
|
-
steps?: {
|
|
212
|
-
imageUrl: string;
|
|
213
|
-
title: string;
|
|
214
|
-
}[];
|
|
215
|
-
};
|
|
216
|
-
product: {
|
|
217
|
-
required: string;
|
|
218
|
-
invalidEmail: string;
|
|
219
|
-
shippingAddress: string;
|
|
220
|
-
shippingProduct: string;
|
|
221
|
-
addressForm: {
|
|
222
|
-
key: string;
|
|
223
|
-
type: string;
|
|
224
|
-
label: string;
|
|
225
|
-
isSelect: boolean;
|
|
226
|
-
required: boolean;
|
|
227
|
-
placeholder: string;
|
|
228
|
-
}[][];
|
|
229
|
-
form: {
|
|
230
|
-
key: string;
|
|
231
|
-
type: string;
|
|
232
|
-
isSelect: boolean;
|
|
233
|
-
required: boolean;
|
|
234
|
-
placeholder: string;
|
|
235
|
-
}[][];
|
|
236
|
-
successDesc: string[];
|
|
237
|
-
rules: string[];
|
|
238
|
-
steps: {
|
|
239
|
-
imageUrl: string;
|
|
240
|
-
title: string;
|
|
241
|
-
}[];
|
|
242
|
-
quantityLabel: string;
|
|
243
|
-
totalPriceLabel: string;
|
|
244
|
-
variantLabel: string;
|
|
245
|
-
shippingFeeLabel: string;
|
|
246
|
-
paymentButton: string;
|
|
247
|
-
stepTitle: string;
|
|
248
|
-
};
|
|
249
|
-
};
|
|
250
|
-
type CreditsPageCommon = {
|
|
251
|
-
pointUnit?: string;
|
|
252
|
-
infoIcon?: string;
|
|
253
|
-
ruleLabel?: string;
|
|
254
|
-
soldOut?: string;
|
|
255
|
-
redeemed?: string;
|
|
256
|
-
copied?: string;
|
|
257
|
-
off?: string;
|
|
258
|
-
copy?: string;
|
|
259
|
-
giftCardLabel?: string;
|
|
260
|
-
goGiftLabel?: string;
|
|
261
|
-
imageMapping?: {
|
|
262
|
-
[key in ConsumeType]: {
|
|
263
|
-
url: string;
|
|
264
|
-
};
|
|
265
|
-
};
|
|
266
|
-
activitiesModal?: MyActivitiesMetafields;
|
|
267
|
-
rewardsModal?: RewardsCopy;
|
|
268
|
-
redeemModal?: RedeemModalCommon;
|
|
269
|
-
insufficientCredits?: string;
|
|
270
|
-
validatorInfo?: {
|
|
271
|
-
addressInfo: {
|
|
272
|
-
name: string;
|
|
273
|
-
country: string;
|
|
274
|
-
province: string;
|
|
275
|
-
city: string;
|
|
276
|
-
address: string;
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
};
|
|
280
|
-
|
|
281
|
-
declare enum FunctionDiscountType {
|
|
282
|
-
Percentage = 1,
|
|
283
|
-
FixedAmount = 2,
|
|
284
|
-
FixedPrice = 3
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
type DiscountConfig = {
|
|
288
|
-
discount_type: FunctionDiscountType;
|
|
289
|
-
discount_value: number;
|
|
290
|
-
};
|
|
291
|
-
type FunctionMemberPriceConfig = {
|
|
292
|
-
rule_id: string;
|
|
293
|
-
result_detail: {
|
|
294
|
-
member_discounts?: {
|
|
295
|
-
user_identity: number;
|
|
296
|
-
main_products: {
|
|
297
|
-
all_store_variant: boolean;
|
|
298
|
-
variants: {
|
|
299
|
-
variant_id: string;
|
|
300
|
-
sku: string;
|
|
301
|
-
handle: string;
|
|
302
|
-
}[];
|
|
303
|
-
};
|
|
304
|
-
discount_conf: DiscountConfig;
|
|
305
|
-
}[];
|
|
306
|
-
};
|
|
307
|
-
discount_combinations: {
|
|
308
|
-
other_product_discounts: boolean;
|
|
309
|
-
};
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
type Context = {
|
|
313
|
-
profile: any;
|
|
314
|
-
isLoadingProfile: boolean;
|
|
315
|
-
removeProfile: () => void;
|
|
316
|
-
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
|
|
317
|
-
openSignInPopup: () => void;
|
|
318
|
-
openSignUpPopup: () => void;
|
|
319
|
-
creditInfo?: CreditInfoResponse;
|
|
320
|
-
customer?: any;
|
|
321
|
-
customerLoading: boolean;
|
|
322
|
-
fetchCreditInfo: (user_id: string) => void;
|
|
323
|
-
gtm: {
|
|
324
|
-
pageGroup: string;
|
|
325
|
-
pageHandle?: string;
|
|
326
|
-
};
|
|
327
|
-
pageCommon: CreditsPageCommon;
|
|
328
|
-
memberPriceDiscount?: FunctionMemberPriceConfig[];
|
|
329
|
-
alpcBrand?: string;
|
|
330
|
-
cartConfig?: {
|
|
331
|
-
addToCart: (params: {
|
|
332
|
-
variantList: Array<{
|
|
333
|
-
variant: any;
|
|
334
|
-
quantity: number;
|
|
335
|
-
attributes?: Array<{
|
|
336
|
-
key: string;
|
|
337
|
-
value: string;
|
|
338
|
-
}>;
|
|
339
|
-
}>;
|
|
340
|
-
cartAttributes?: Record<string, string>;
|
|
341
|
-
discountCodes?: string[];
|
|
342
|
-
}) => void | Promise<any>;
|
|
343
|
-
};
|
|
344
|
-
openMyRewardsModal: boolean;
|
|
345
|
-
setOpenMyRewardsModal: (open: boolean) => void;
|
|
346
|
-
openActivitiesModal: boolean;
|
|
347
|
-
setOpenActivitiesModal: (open: boolean) => void;
|
|
348
|
-
apiBaseUrl?: string;
|
|
349
|
-
};
|
|
350
|
-
declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, pageCommon, memberPriceDiscount, alpcBrand, cartConfig, apiBaseUrl, }: PropsWithChildren<Omit<Context, 'openMyRewardsModal' | 'setOpenMyRewardsModal' | 'openActivitiesModal' | 'setOpenActivitiesModal'>>): react_jsx_runtime.JSX.Element;
|
|
351
|
-
declare function useCreditsContext(): Context;
|
|
352
|
-
|
|
353
|
-
declare const useUploadReceipt: () => swr_dist_mutation.SWRMutationResponse<{
|
|
354
|
-
ok: boolean;
|
|
355
|
-
code: number;
|
|
356
|
-
}, any, "/api/multipass/mktsrv/v1/credit/upload_third_party_order", {
|
|
357
|
-
orderName: string;
|
|
358
|
-
}>;
|
|
359
|
-
|
|
360
|
-
type ReceiptCopy = {
|
|
361
|
-
title: string;
|
|
362
|
-
description: string;
|
|
363
|
-
placeholder: string;
|
|
364
|
-
note: string;
|
|
365
|
-
submit: string;
|
|
366
|
-
successTitle: string;
|
|
367
|
-
successDescription: string;
|
|
368
|
-
gotIt: string;
|
|
369
|
-
failedTitle: string;
|
|
370
|
-
successIcon: string;
|
|
371
|
-
failedIcon: string;
|
|
372
|
-
failedReasons: {
|
|
373
|
-
code: string;
|
|
374
|
-
id: string;
|
|
375
|
-
description: string;
|
|
376
|
-
}[];
|
|
377
|
-
};
|
|
378
|
-
declare function CreditsUploadReceiptModal({ isOpen, onClose, copy, onSuccess, }: {
|
|
379
|
-
isOpen: boolean;
|
|
380
|
-
onClose: () => void;
|
|
381
|
-
copy: ReceiptCopy;
|
|
382
|
-
onSuccess: () => void;
|
|
383
|
-
}): react_jsx_runtime.JSX.Element;
|
|
384
|
-
|
|
385
|
-
type Img = {
|
|
386
|
-
url: string;
|
|
387
|
-
alt: string;
|
|
388
|
-
width?: number;
|
|
389
|
-
height?: number;
|
|
390
|
-
};
|
|
391
|
-
type CreditsBannerCopy = {
|
|
392
|
-
pcImg: Img;
|
|
393
|
-
laptopImg: Img;
|
|
394
|
-
mobileImg: Img;
|
|
395
|
-
joinNow: string;
|
|
396
|
-
loginIn: string;
|
|
397
|
-
login: {
|
|
398
|
-
title: string;
|
|
399
|
-
description: string;
|
|
400
|
-
};
|
|
401
|
-
unLogin: {
|
|
402
|
-
title: string;
|
|
403
|
-
description: string;
|
|
404
|
-
};
|
|
405
|
-
};
|
|
406
|
-
declare function CreditsBanner({ copy, id }: {
|
|
407
|
-
copy: CreditsBannerCopy;
|
|
408
|
-
id?: string;
|
|
409
|
-
}): react_jsx_runtime.JSX.Element;
|
|
410
|
-
|
|
411
|
-
interface BenefitItemCopy {
|
|
412
|
-
icon: {
|
|
413
|
-
alt: string;
|
|
414
|
-
url: string;
|
|
415
|
-
};
|
|
416
|
-
text: string;
|
|
417
|
-
note?: string;
|
|
418
|
-
tag?: string;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
type CreditsBenefitsCopy = {
|
|
422
|
-
title: string;
|
|
423
|
-
benefits: BenefitItemCopy[];
|
|
424
|
-
bigIcon?: boolean;
|
|
425
|
-
cardBgColor?: string;
|
|
426
|
-
cardBorderColor?: string;
|
|
427
|
-
};
|
|
428
|
-
declare const CreditsBenefits: ({ copy, id }: {
|
|
429
|
-
copy: CreditsBenefitsCopy;
|
|
430
|
-
id?: string;
|
|
431
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
432
|
-
|
|
433
|
-
type ButtonConfig = {
|
|
434
|
-
text: string;
|
|
435
|
-
type: 'activities' | 'rewards';
|
|
436
|
-
};
|
|
437
|
-
type CreditsInfoCardCopy = {
|
|
438
|
-
balanceLabel: string;
|
|
439
|
-
comingSoonLabel: string;
|
|
440
|
-
comingSoonTips: string;
|
|
441
|
-
buttons: ButtonConfig[];
|
|
442
|
-
};
|
|
443
|
-
declare function CreditsInfoCard({ copy, id }: {
|
|
444
|
-
copy: CreditsInfoCardCopy;
|
|
445
|
-
id?: string;
|
|
446
|
-
}): react_jsx_runtime.JSX.Element;
|
|
447
|
-
|
|
448
|
-
type CreditsSubscribeModalCopy = {
|
|
449
|
-
title: string;
|
|
450
|
-
desc?: string;
|
|
451
|
-
placeholder: string;
|
|
452
|
-
policy?: string;
|
|
453
|
-
successTips?: string;
|
|
454
|
-
dealsType?: string;
|
|
455
|
-
};
|
|
456
|
-
|
|
457
|
-
type BenefitItem = {
|
|
458
|
-
title: string;
|
|
459
|
-
credits: string;
|
|
460
|
-
id: string;
|
|
461
|
-
};
|
|
462
|
-
type CreditsWaysToGetCreditsCopy = {
|
|
463
|
-
title: string;
|
|
464
|
-
subtitle: string;
|
|
465
|
-
equalCredits: string;
|
|
466
|
-
musicIcon: string;
|
|
467
|
-
list: BenefitItem[];
|
|
468
|
-
mainImage: {
|
|
469
|
-
url: string;
|
|
470
|
-
alt: string;
|
|
471
|
-
};
|
|
472
|
-
joinNow: string;
|
|
473
|
-
activate: string;
|
|
474
|
-
completed: string;
|
|
475
|
-
completeProfile: string;
|
|
476
|
-
makeFirstPurchase: string;
|
|
477
|
-
goShopLink: string;
|
|
478
|
-
uploadReceipt: string;
|
|
479
|
-
shopNow: string;
|
|
480
|
-
subscribeLabel: string;
|
|
481
|
-
sendEmailSuccess: string;
|
|
482
|
-
creditsIcon: {
|
|
483
|
-
url: string;
|
|
484
|
-
alt: string;
|
|
485
|
-
};
|
|
486
|
-
receipt: ReceiptCopy;
|
|
487
|
-
subscribe: CreditsSubscribeModalCopy;
|
|
488
|
-
};
|
|
489
|
-
type CreditsWaysToGetCreditsProps = {
|
|
490
|
-
copy: CreditsWaysToGetCreditsCopy;
|
|
491
|
-
classNames?: {
|
|
492
|
-
equalCreditsText?: string;
|
|
493
|
-
subtitle?: string;
|
|
494
|
-
};
|
|
495
|
-
};
|
|
496
|
-
|
|
497
|
-
declare const CreditsWaysToGetCredits: ({ copy, classNames, id }: CreditsWaysToGetCreditsProps & {
|
|
498
|
-
id?: string;
|
|
499
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
500
|
-
|
|
501
|
-
type CreditsFaqCopy = {
|
|
502
|
-
title: string;
|
|
503
|
-
subTitle: string;
|
|
504
|
-
learnMore: {
|
|
505
|
-
link: string;
|
|
506
|
-
label: string;
|
|
507
|
-
};
|
|
508
|
-
items: {
|
|
509
|
-
category_name: string;
|
|
510
|
-
question: string;
|
|
511
|
-
answer: string;
|
|
512
|
-
}[];
|
|
513
|
-
};
|
|
514
|
-
declare const CreditsFaq: ({ copy, id }: {
|
|
515
|
-
copy: CreditsFaqCopy;
|
|
516
|
-
id?: string;
|
|
517
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
518
|
-
|
|
519
|
-
type RedeemableItemConfig$1 = {
|
|
520
|
-
title: string;
|
|
521
|
-
desc: string;
|
|
522
|
-
price: number;
|
|
523
|
-
credit: string;
|
|
524
|
-
rules: string;
|
|
525
|
-
image: {
|
|
526
|
-
url: string;
|
|
527
|
-
};
|
|
528
|
-
mobileImage: {
|
|
529
|
-
url: string;
|
|
530
|
-
};
|
|
531
|
-
redeemId: number;
|
|
532
|
-
};
|
|
533
|
-
type CreditsCashCopy = {
|
|
534
|
-
title: string;
|
|
535
|
-
list: (RedeemableItemConfig$1 & {
|
|
536
|
-
products: {
|
|
537
|
-
handle: string;
|
|
538
|
-
sku: string;
|
|
539
|
-
}[];
|
|
540
|
-
})[];
|
|
541
|
-
soldOut: string;
|
|
542
|
-
unlockRewards: string;
|
|
543
|
-
btnRedeem: string;
|
|
544
|
-
off: string;
|
|
545
|
-
badgeLabel?: string;
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
declare const CreditsCash: ({ copy, id }: {
|
|
549
|
-
copy: CreditsCashCopy;
|
|
550
|
-
id?: string;
|
|
551
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
552
|
-
|
|
553
|
-
type CreditsRedeemListCopy = {
|
|
554
|
-
title: string;
|
|
555
|
-
availableCredits: string;
|
|
556
|
-
unlockRewards: string;
|
|
557
|
-
btnRedeem: string;
|
|
558
|
-
list: {
|
|
559
|
-
label: string;
|
|
560
|
-
list: {
|
|
561
|
-
id: string;
|
|
562
|
-
type: string;
|
|
563
|
-
value: string;
|
|
564
|
-
rules: string[];
|
|
565
|
-
}[];
|
|
566
|
-
}[];
|
|
567
|
-
redeemModal: {
|
|
568
|
-
confirmTitle: string;
|
|
569
|
-
confirmButton: string;
|
|
570
|
-
commonError: string;
|
|
571
|
-
redeemLimitError: string;
|
|
572
|
-
inventoryNotEnough: string;
|
|
573
|
-
creditsNotEnough: string;
|
|
574
|
-
crossSiteError: string;
|
|
575
|
-
errorImageUrl: string;
|
|
576
|
-
coupon: {
|
|
577
|
-
successDesc: string;
|
|
578
|
-
successTitle: string;
|
|
579
|
-
successButton: string;
|
|
580
|
-
successButtonUrl: string;
|
|
581
|
-
};
|
|
582
|
-
virtualProduct: {
|
|
583
|
-
successDesc: string;
|
|
584
|
-
successTitle: string;
|
|
585
|
-
successButton: string;
|
|
586
|
-
successButtonUrl: string;
|
|
587
|
-
stepTitle?: string;
|
|
588
|
-
steps?: {
|
|
589
|
-
imageUrl: string;
|
|
590
|
-
title: string;
|
|
591
|
-
}[];
|
|
592
|
-
};
|
|
593
|
-
product: {
|
|
594
|
-
required: string;
|
|
595
|
-
invalidEmail: string;
|
|
596
|
-
shippingAddress: string;
|
|
597
|
-
shippingProduct: string;
|
|
598
|
-
addressForm: {
|
|
599
|
-
key: string;
|
|
600
|
-
type: string;
|
|
601
|
-
label: string;
|
|
602
|
-
isSelect: boolean;
|
|
603
|
-
required: boolean;
|
|
604
|
-
placeholder: string;
|
|
605
|
-
}[][];
|
|
606
|
-
form: {
|
|
607
|
-
key: string;
|
|
608
|
-
type: string;
|
|
609
|
-
isSelect: boolean;
|
|
610
|
-
required: boolean;
|
|
611
|
-
placeholder: string;
|
|
612
|
-
}[][];
|
|
613
|
-
successDesc: string[];
|
|
614
|
-
rules: string[];
|
|
615
|
-
steps: {
|
|
616
|
-
imageUrl: string;
|
|
617
|
-
title: string;
|
|
618
|
-
}[];
|
|
619
|
-
quantityLabel: string;
|
|
620
|
-
totalPriceLabel: string;
|
|
621
|
-
variantLabel: string;
|
|
622
|
-
shippingFeeLabel: string;
|
|
623
|
-
paymentButton: string;
|
|
624
|
-
stepTitle: string;
|
|
625
|
-
};
|
|
626
|
-
};
|
|
627
|
-
};
|
|
628
|
-
|
|
629
|
-
declare const CreditsRedeemList: ({ copy, id }: {
|
|
630
|
-
copy: CreditsRedeemListCopy;
|
|
631
|
-
id?: string;
|
|
632
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
633
|
-
|
|
634
|
-
type CreditsGoGiftCopy = {
|
|
635
|
-
title: string;
|
|
636
|
-
cardImg: {
|
|
637
|
-
url: string;
|
|
638
|
-
};
|
|
639
|
-
mCardImg?: {
|
|
640
|
-
url: string;
|
|
641
|
-
};
|
|
642
|
-
count?: string;
|
|
643
|
-
cardTitle: string;
|
|
644
|
-
cardDesc: string;
|
|
645
|
-
cardTip: string;
|
|
646
|
-
redeemBtn: string;
|
|
647
|
-
unlockRewards: string;
|
|
648
|
-
viewRedeemHistory?: string;
|
|
649
|
-
rulesLink?: string;
|
|
650
|
-
redeemId: string | number;
|
|
651
|
-
type: ConsumeType;
|
|
652
|
-
value?: string;
|
|
653
|
-
rules: string[];
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
declare const CreditsGoGift: ({ copy, id }: {
|
|
657
|
-
copy: CreditsGoGiftCopy;
|
|
658
|
-
id?: string;
|
|
659
|
-
}) => react_jsx_runtime.JSX.Element | null;
|
|
660
|
-
|
|
661
|
-
type AuthCodeActivateCopy = {
|
|
662
|
-
authCodeTitle?: string;
|
|
663
|
-
authCodeDesc?: string;
|
|
664
|
-
enterActiveCodeText?: string;
|
|
665
|
-
authCodeContent?: string;
|
|
666
|
-
authCodeReceiveText?: string;
|
|
667
|
-
sendAgainText?: string;
|
|
668
|
-
buttonText?: string;
|
|
669
|
-
note?: string;
|
|
670
|
-
codeEmptyError?: string;
|
|
671
|
-
incorrectCodeError?: string;
|
|
672
|
-
retrieveText?: string;
|
|
673
|
-
authSuccessMessage?: string;
|
|
674
|
-
sendEmailSuccessMessage?: string;
|
|
675
|
-
sendEmailErrorMessage?: string;
|
|
676
|
-
beenActivatedMessage?: string;
|
|
677
|
-
invalidCodeMessage?: string;
|
|
678
|
-
expiredCodeMessage?: string;
|
|
679
|
-
};
|
|
680
|
-
type AuthCodeActivateProps = {
|
|
681
|
-
copy: AuthCodeActivateCopy;
|
|
682
|
-
};
|
|
683
|
-
|
|
684
|
-
declare const AuthCodeActivate: React__default.FC<AuthCodeActivateProps>;
|
|
685
|
-
|
|
686
|
-
interface RegistrationContextType {
|
|
687
|
-
email?: string;
|
|
688
|
-
copy?: any;
|
|
689
|
-
authCodeActivate: {
|
|
690
|
-
isOpen: boolean;
|
|
691
|
-
open: () => void;
|
|
692
|
-
close: () => void;
|
|
693
|
-
isActivateSuccess: boolean;
|
|
694
|
-
activeToken?: string;
|
|
695
|
-
onAuthSuccess: (() => void) | undefined;
|
|
696
|
-
isSendingActivateEmail: boolean;
|
|
697
|
-
setIsSendingActivateEmail: Dispatch<SetStateAction<boolean>>;
|
|
698
|
-
setActiveToken: Dispatch<SetStateAction<string | undefined>>;
|
|
699
|
-
setIsActivateSuccess: Dispatch<SetStateAction<boolean>>;
|
|
700
|
-
setOnAuthSuccess: Dispatch<SetStateAction<(() => void) | undefined>>;
|
|
701
|
-
autoSendEmail: boolean;
|
|
702
|
-
setAutoSendEmail: Dispatch<SetStateAction<boolean>>;
|
|
703
|
-
};
|
|
704
|
-
}
|
|
705
|
-
declare const RegistrationContext: React$1.Context<RegistrationContextType>;
|
|
706
|
-
declare const useRegistration: () => RegistrationContextType;
|
|
707
|
-
declare const RegistrationProvider: ({ children, email, copy }: PropsWithChildren<{
|
|
708
|
-
email?: string;
|
|
709
|
-
copy?: any;
|
|
710
|
-
}>) => react_jsx_runtime.JSX.Element;
|
|
711
|
-
|
|
712
|
-
declare enum MemberPopupPanelType {
|
|
713
|
-
EarnCredits = "EARN_CREDITS",
|
|
714
|
-
ConsumeCredits = "CONSUME_CREDITS",
|
|
715
|
-
Referral = "REFERRAL",
|
|
716
|
-
Activity = "ACTIVITY"
|
|
717
|
-
}
|
|
718
|
-
declare enum MemberPopupActionType {
|
|
719
|
-
ExternalLink = "EXTERNAL_LINK",
|
|
720
|
-
OpenEarnCredits = "OPEN_EARN_CREDITS",
|
|
721
|
-
OpenConsumeCredits = "OPEN_CONSUME_CREDITS",
|
|
722
|
-
OpenReferral = "OPEN_REFERRAL"
|
|
723
|
-
}
|
|
724
|
-
declare enum EarnCreditsTaskType {
|
|
725
|
-
Activate = "activate",
|
|
726
|
-
CompleteProfile = "completeProfile",
|
|
727
|
-
Subscribe = "subscribe",
|
|
728
|
-
Shop = "shop"
|
|
729
|
-
}
|
|
730
|
-
declare enum ConsumeCreditsItemType {
|
|
731
|
-
Coupon = "COUPON",
|
|
732
|
-
RedeemAndBuy = "REDEEM_AND_BUY"
|
|
733
|
-
}
|
|
734
|
-
type MemberPopupLink = {
|
|
735
|
-
type: MemberPopupActionType;
|
|
736
|
-
label: string;
|
|
737
|
-
url?: string;
|
|
738
|
-
icon?: 'credit' | 'bag' | 'referral';
|
|
739
|
-
};
|
|
740
|
-
type MemberPopupItem = {
|
|
741
|
-
title: string;
|
|
742
|
-
description?: string;
|
|
743
|
-
links: MemberPopupLink[];
|
|
744
|
-
};
|
|
745
|
-
type MemberPopupCopy = {
|
|
746
|
-
triggerImg: {
|
|
747
|
-
url: string;
|
|
748
|
-
alt?: string;
|
|
749
|
-
};
|
|
750
|
-
title?: string;
|
|
751
|
-
subtitle?: string;
|
|
752
|
-
list: MemberPopupItem[];
|
|
753
|
-
footer?: {
|
|
754
|
-
loginHint: string;
|
|
755
|
-
loginLabel: string;
|
|
756
|
-
joinLabel: string;
|
|
757
|
-
shopLabel: string;
|
|
758
|
-
shopUrl?: string;
|
|
759
|
-
};
|
|
760
|
-
earnCredits?: EarnCreditsCopy;
|
|
761
|
-
consumeCredits?: ConsumeCreditsopy;
|
|
762
|
-
referral?: ReferralCopy;
|
|
763
|
-
activity?: ActivityCopy;
|
|
764
|
-
};
|
|
765
|
-
type EarnCreditsCopy = {
|
|
766
|
-
title?: string;
|
|
767
|
-
joinNow: string;
|
|
768
|
-
completed: string;
|
|
769
|
-
activate: string;
|
|
770
|
-
completeProfileLabel: string;
|
|
771
|
-
subscribeLabel: string;
|
|
772
|
-
shopNow: string;
|
|
773
|
-
goShopLink?: string;
|
|
774
|
-
list: {
|
|
775
|
-
id: EarnCreditsTaskType;
|
|
776
|
-
title: string;
|
|
777
|
-
credits: string;
|
|
778
|
-
}[];
|
|
779
|
-
authCodeActivate: AuthCodeActivateCopy;
|
|
780
|
-
completeProfile: CompleteProfileCopy;
|
|
781
|
-
subscribe: SubscribeModalCopy;
|
|
782
|
-
};
|
|
783
|
-
type CompleteProfileCopy = {
|
|
784
|
-
title: string;
|
|
785
|
-
firstName: string;
|
|
786
|
-
lastName: string;
|
|
787
|
-
email: string;
|
|
788
|
-
phone: string;
|
|
789
|
-
birthday: string;
|
|
790
|
-
country: string;
|
|
791
|
-
save: string;
|
|
792
|
-
cancel: string;
|
|
793
|
-
edit: string;
|
|
794
|
-
required: string;
|
|
795
|
-
};
|
|
796
|
-
type SubscribeModalCopy = {
|
|
797
|
-
title: string;
|
|
798
|
-
desc?: string;
|
|
799
|
-
placeholder: string;
|
|
800
|
-
policy?: string;
|
|
801
|
-
successTips?: string;
|
|
802
|
-
dealsType?: string;
|
|
803
|
-
buttonLabel?: string;
|
|
804
|
-
};
|
|
805
|
-
type ConsumeCreditsopy = {
|
|
806
|
-
title?: string;
|
|
807
|
-
soldOut: string;
|
|
808
|
-
unlockRewards: string;
|
|
809
|
-
btnRedeem: string;
|
|
810
|
-
insufficientCredits?: string;
|
|
811
|
-
pointUnit?: string;
|
|
812
|
-
list: ConsumeCreditsItem[];
|
|
813
|
-
redeemModal: RedeemCouponModalCopy;
|
|
814
|
-
};
|
|
815
|
-
type ConsumeCreditsItem = {
|
|
816
|
-
redeemId: string | number;
|
|
817
|
-
title: string;
|
|
818
|
-
description?: string;
|
|
819
|
-
image: {
|
|
820
|
-
url: string;
|
|
821
|
-
alt?: string;
|
|
822
|
-
};
|
|
823
|
-
type: ConsumeCreditsItemType;
|
|
824
|
-
product?: {
|
|
825
|
-
handle: string;
|
|
826
|
-
sku: string;
|
|
827
|
-
};
|
|
828
|
-
price?: number;
|
|
829
|
-
rules?: string[];
|
|
830
|
-
};
|
|
831
|
-
type RedeemCouponModalCopy = {
|
|
832
|
-
confirmTitle: string;
|
|
833
|
-
confirmButton: string;
|
|
834
|
-
commonError: string;
|
|
835
|
-
redeemLimitError: string;
|
|
836
|
-
inventoryNotEnough: string;
|
|
837
|
-
creditsNotEnough: string;
|
|
838
|
-
crossSiteError: string;
|
|
839
|
-
successTitle: string;
|
|
840
|
-
successDesc: string;
|
|
841
|
-
successButton: string;
|
|
842
|
-
successButtonUrl?: string;
|
|
843
|
-
};
|
|
844
|
-
type ReferralCopy = {
|
|
845
|
-
title?: string;
|
|
846
|
-
description?: string;
|
|
847
|
-
cashAvailableLabel: string;
|
|
848
|
-
cashPendingLabel: string;
|
|
849
|
-
ctaButton: string;
|
|
850
|
-
ctaUrl?: string;
|
|
851
|
-
loginTitle?: string;
|
|
852
|
-
loginDescription?: string;
|
|
853
|
-
loginCtaLabel?: string;
|
|
854
|
-
};
|
|
855
|
-
type ActivityCopy = {
|
|
856
|
-
image?: {
|
|
857
|
-
url: string;
|
|
858
|
-
alt?: string;
|
|
859
|
-
};
|
|
860
|
-
title?: string;
|
|
861
|
-
description?: string;
|
|
862
|
-
ctaButton?: string;
|
|
863
|
-
ctaUrl?: string;
|
|
864
|
-
subscribe?: ActivitySubscribeCopy;
|
|
865
|
-
};
|
|
866
|
-
type ActivitySubscribeCopy = {
|
|
867
|
-
title: string;
|
|
868
|
-
desc?: string;
|
|
869
|
-
placeholder: string;
|
|
870
|
-
policy?: string;
|
|
871
|
-
successTips?: string;
|
|
872
|
-
dealsType?: string;
|
|
873
|
-
buttonLabel?: string;
|
|
874
|
-
};
|
|
875
|
-
type AlpcConfig = {
|
|
876
|
-
brand: string;
|
|
877
|
-
locale: string;
|
|
878
|
-
appName: string;
|
|
879
|
-
apiBaseUrl?: string;
|
|
880
|
-
};
|
|
881
|
-
type MemberPopupContextValue = {
|
|
882
|
-
profile: any;
|
|
883
|
-
isLoadingProfile: boolean;
|
|
884
|
-
creditInfo?: CreditInfoResponse;
|
|
885
|
-
fetchCreditInfo: (userId: string) => void;
|
|
886
|
-
openSignUpPopup: () => void;
|
|
887
|
-
openSignInPopup: () => void;
|
|
888
|
-
taskIdToTypeMapping?: Record<string, DTC_TASK_TYPE>;
|
|
889
|
-
alpcConfig: AlpcConfig;
|
|
890
|
-
};
|
|
891
|
-
|
|
892
|
-
type MemberPopupProps = MemberPopupContextValue & {
|
|
893
|
-
headlessConfig: HeadlessConfig;
|
|
894
|
-
copy: MemberPopupCopy;
|
|
895
|
-
bottomOffset?: string;
|
|
896
|
-
};
|
|
897
|
-
declare function MemberPopup({ copy, bottomOffset, ...providerProps }: MemberPopupProps): react_jsx_runtime.JSX.Element;
|
|
898
|
-
|
|
899
|
-
declare function useMemberPopupContext(): MemberPopupContextValue;
|
|
900
|
-
|
|
901
|
-
type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
|
|
902
|
-
interface MessageMetadata {
|
|
903
|
-
tokenUsage?: {
|
|
904
|
-
inputTokens: number;
|
|
905
|
-
outputTokens: number;
|
|
906
|
-
};
|
|
907
|
-
toolCalls?: Array<{
|
|
908
|
-
id: string;
|
|
909
|
-
type: string;
|
|
910
|
-
name: string;
|
|
911
|
-
}>;
|
|
912
|
-
}
|
|
913
|
-
interface Message {
|
|
914
|
-
id: string;
|
|
915
|
-
sessionId?: string;
|
|
916
|
-
role: MessageRole;
|
|
917
|
-
content: MessageContent[];
|
|
918
|
-
timestamp: number;
|
|
919
|
-
metadata?: MessageMetadata;
|
|
920
|
-
structured_content?: Array<{
|
|
921
|
-
type: string;
|
|
922
|
-
data: any;
|
|
923
|
-
}>;
|
|
924
|
-
}
|
|
925
|
-
type MessageContentType = 'text' | 'product_card' | 'product_list' | 'product_comparison' | 'policy' | 'quick_replies' | 'thinking' | 'error' | 'faq_list' | 'cart';
|
|
926
|
-
type MessageContent = TextContent | ProductCardContent | ProductListContent | ProductComparisonContent | PolicyContent | QuickRepliesContent | ThinkingContent | ErrorContent | FAQListContent | PromotionListContent | CartContent;
|
|
927
|
-
interface TextContent {
|
|
928
|
-
type: 'text';
|
|
929
|
-
text: string;
|
|
930
|
-
}
|
|
931
|
-
interface ProductCardContent {
|
|
932
|
-
type: 'product_card';
|
|
933
|
-
data: {
|
|
934
|
-
product?: Product;
|
|
935
|
-
rawProduct?: any;
|
|
936
|
-
productHandle: string;
|
|
937
|
-
onAddToCart?: (product: Product) => void;
|
|
938
|
-
productCardRender?: (product: any, productHandle: string) => React.ReactNode;
|
|
939
|
-
};
|
|
940
|
-
}
|
|
941
|
-
interface ProductListContent {
|
|
942
|
-
type: 'product_list';
|
|
943
|
-
data: {
|
|
944
|
-
products: Product[];
|
|
945
|
-
title?: string;
|
|
946
|
-
onAddToCart?: (product: Product) => void;
|
|
947
|
-
commonText?: CommonText;
|
|
948
|
-
};
|
|
949
|
-
}
|
|
950
|
-
interface ProductComparisonContent {
|
|
951
|
-
type: 'product_comparison';
|
|
952
|
-
data: {
|
|
953
|
-
products: Product[];
|
|
954
|
-
dimensions: {
|
|
955
|
-
price?: {
|
|
956
|
-
label: string;
|
|
957
|
-
values: Array<{
|
|
958
|
-
product_id: string;
|
|
959
|
-
min: number;
|
|
960
|
-
max: number;
|
|
961
|
-
currency: string;
|
|
962
|
-
has_discount: boolean;
|
|
963
|
-
}>;
|
|
964
|
-
};
|
|
965
|
-
variants?: {
|
|
966
|
-
label: string;
|
|
967
|
-
values: Array<{
|
|
968
|
-
product_id: string;
|
|
969
|
-
count: number;
|
|
970
|
-
}>;
|
|
971
|
-
};
|
|
972
|
-
member_price?: {
|
|
973
|
-
label: string;
|
|
974
|
-
values: Array<{
|
|
975
|
-
product_id: string;
|
|
976
|
-
available: boolean;
|
|
977
|
-
min: number;
|
|
978
|
-
max: number;
|
|
979
|
-
currency: string;
|
|
980
|
-
}>;
|
|
981
|
-
};
|
|
982
|
-
discount?: {
|
|
983
|
-
label: string;
|
|
984
|
-
values: Array<{
|
|
985
|
-
product_id: string;
|
|
986
|
-
has_discount: boolean;
|
|
987
|
-
}>;
|
|
988
|
-
};
|
|
989
|
-
[key: string]: any;
|
|
990
|
-
};
|
|
991
|
-
onAddToCart?: (product: Product) => void;
|
|
992
|
-
commonText?: CommonText;
|
|
993
|
-
productComparisonRender?: (data: {
|
|
994
|
-
products: Product[];
|
|
995
|
-
dimensions: ProductComparisonContent['data']['dimensions'];
|
|
996
|
-
}) => React.ReactNode;
|
|
997
|
-
};
|
|
998
|
-
}
|
|
999
|
-
interface PolicyContent {
|
|
1000
|
-
type: 'policy';
|
|
1001
|
-
data: {
|
|
1002
|
-
title: string;
|
|
1003
|
-
content: string;
|
|
1004
|
-
};
|
|
1005
|
-
}
|
|
1006
|
-
interface QuickRepliesContent {
|
|
1007
|
-
type: 'quick_replies';
|
|
1008
|
-
data: {
|
|
1009
|
-
replies: QuickReply[];
|
|
1010
|
-
};
|
|
1011
|
-
}
|
|
1012
|
-
interface ThinkingContent {
|
|
1013
|
-
type: 'thinking';
|
|
1014
|
-
data: {
|
|
1015
|
-
status: string;
|
|
1016
|
-
};
|
|
1017
|
-
}
|
|
1018
|
-
interface ErrorContent {
|
|
1019
|
-
type: 'error';
|
|
1020
|
-
data: {
|
|
1021
|
-
message: string;
|
|
1022
|
-
code?: string;
|
|
1023
|
-
};
|
|
1024
|
-
}
|
|
1025
|
-
interface FAQListContent {
|
|
1026
|
-
type: 'faq_list';
|
|
1027
|
-
data: {
|
|
1028
|
-
found: boolean;
|
|
1029
|
-
count: number;
|
|
1030
|
-
total?: number;
|
|
1031
|
-
results: FAQItem[];
|
|
1032
|
-
};
|
|
1033
|
-
}
|
|
1034
|
-
interface PromotionListContent {
|
|
1035
|
-
type: 'promotion_list';
|
|
1036
|
-
data: {
|
|
1037
|
-
found: boolean;
|
|
1038
|
-
count: number;
|
|
1039
|
-
total?: number;
|
|
1040
|
-
results: PromotionItem[];
|
|
1041
|
-
commonText?: CommonText;
|
|
1042
|
-
};
|
|
1043
|
-
}
|
|
1044
|
-
type FAQCategory = 'shipping' | 'return' | 'product' | 'payment' | 'general';
|
|
1045
|
-
interface FAQItem {
|
|
1046
|
-
id: string;
|
|
1047
|
-
question: string;
|
|
1048
|
-
answer: string;
|
|
1049
|
-
category: FAQCategory;
|
|
1050
|
-
keywords?: string[];
|
|
1051
|
-
relatedQuestions?: string[];
|
|
1052
|
-
metadata?: {
|
|
1053
|
-
language?: string;
|
|
1054
|
-
priority?: number;
|
|
1055
|
-
lastUpdated?: string;
|
|
1056
|
-
};
|
|
1057
|
-
}
|
|
1058
|
-
interface PromotionItem {
|
|
1059
|
-
id: string;
|
|
1060
|
-
title: string;
|
|
1061
|
-
subtitle?: string;
|
|
1062
|
-
description?: string;
|
|
1063
|
-
banner_url?: string;
|
|
1064
|
-
url?: string;
|
|
1065
|
-
time_range: {
|
|
1066
|
-
start: string;
|
|
1067
|
-
end?: string | null;
|
|
1068
|
-
is_active: boolean;
|
|
1069
|
-
};
|
|
1070
|
-
priority?: number;
|
|
1071
|
-
product_count?: number;
|
|
1072
|
-
metadata?: {
|
|
1073
|
-
display_order?: number;
|
|
1074
|
-
target_audience?: string;
|
|
1075
|
-
};
|
|
1076
|
-
}
|
|
1077
|
-
type StockStatus = 'in_stock' | 'low_stock' | 'out_of_stock';
|
|
1078
|
-
interface Price {
|
|
1079
|
-
amount: number;
|
|
1080
|
-
currency: string;
|
|
1081
|
-
}
|
|
1082
|
-
interface PriceRange {
|
|
1083
|
-
min: number;
|
|
1084
|
-
max: number;
|
|
1085
|
-
currency: string;
|
|
1086
|
-
}
|
|
1087
|
-
interface VariantDiscount {
|
|
1088
|
-
has_discount: boolean;
|
|
1089
|
-
discount_price?: number;
|
|
1090
|
-
discount_code?: string;
|
|
1091
|
-
discount_percentage?: number;
|
|
1092
|
-
/** 折扣类型:fixed_amount 固定金额折扣,percentage 百分比折扣 */
|
|
1093
|
-
discount_type?: 'fixed_amount' | 'percentage';
|
|
1094
|
-
/** 折扣数值(可能是字符串或数字) */
|
|
1095
|
-
discount_value?: string | number;
|
|
1096
|
-
}
|
|
1097
|
-
interface VariantMemberPrice {
|
|
1098
|
-
has_member_price: boolean;
|
|
1099
|
-
price?: number;
|
|
1100
|
-
}
|
|
1101
|
-
interface ProductFeatures {
|
|
1102
|
-
is_new?: boolean;
|
|
1103
|
-
has_rental?: boolean;
|
|
1104
|
-
has_presale?: boolean;
|
|
1105
|
-
has_member_price?: boolean;
|
|
1106
|
-
has_discount?: boolean;
|
|
1107
|
-
}
|
|
1108
|
-
interface Variant {
|
|
1109
|
-
id: string;
|
|
1110
|
-
title: string;
|
|
1111
|
-
sku?: string;
|
|
1112
|
-
price?: Price;
|
|
1113
|
-
availableForSale: boolean;
|
|
1114
|
-
color?: string;
|
|
1115
|
-
discount?: VariantDiscount;
|
|
1116
|
-
memberPrice?: VariantMemberPrice;
|
|
1117
|
-
inventoryQuantity?: number;
|
|
1118
|
-
option1?: string;
|
|
1119
|
-
option2?: string;
|
|
1120
|
-
option3?: string;
|
|
1121
|
-
}
|
|
1122
|
-
interface Product {
|
|
1123
|
-
shopifyId: string;
|
|
1124
|
-
sku?: string;
|
|
1125
|
-
handle: string;
|
|
1126
|
-
title: string;
|
|
1127
|
-
description?: string;
|
|
1128
|
-
vendor?: string;
|
|
1129
|
-
price: Price;
|
|
1130
|
-
priceRange?: PriceRange;
|
|
1131
|
-
memberPriceRange?: PriceRange;
|
|
1132
|
-
imageUrl: string;
|
|
1133
|
-
productUrl: string;
|
|
1134
|
-
stockStatus: StockStatus;
|
|
1135
|
-
hotScore?: number;
|
|
1136
|
-
averageRating?: number;
|
|
1137
|
-
reviewCount?: number;
|
|
1138
|
-
variants?: Variant[];
|
|
1139
|
-
variantCount?: number;
|
|
1140
|
-
availableCount?: number;
|
|
1141
|
-
features?: ProductFeatures;
|
|
1142
|
-
tags?: string[];
|
|
1143
|
-
}
|
|
1144
|
-
interface QuickReply {
|
|
1145
|
-
id: string;
|
|
1146
|
-
label: string;
|
|
1147
|
-
value: string;
|
|
1148
|
-
icon?: string;
|
|
1149
|
-
}
|
|
1150
|
-
/**
|
|
1151
|
-
* 购物车金额信息
|
|
1152
|
-
*/
|
|
1153
|
-
interface CartAmount {
|
|
1154
|
-
/** 金额字符串(如 "99.99") */
|
|
1155
|
-
amount: string;
|
|
1156
|
-
/** 货币代码(如 "USD") */
|
|
1157
|
-
currencyCode: string;
|
|
1158
|
-
}
|
|
1159
|
-
/**
|
|
1160
|
-
* 购物车价格汇总
|
|
1161
|
-
*/
|
|
1162
|
-
interface CartCost {
|
|
1163
|
-
/** 应付总价(已应用折扣) */
|
|
1164
|
-
totalAmount: CartAmount;
|
|
1165
|
-
/** 原价小计(未应用折扣) */
|
|
1166
|
-
subtotalAmount: CartAmount;
|
|
1167
|
-
}
|
|
1168
|
-
/**
|
|
1169
|
-
* 购物车商品变体信息
|
|
1170
|
-
*/
|
|
1171
|
-
interface CartMerchandise {
|
|
1172
|
-
/** 变体 ID (Shopify ProductVariant GID) */
|
|
1173
|
-
id: string;
|
|
1174
|
-
/** 变体标题(如 "Black", "Large" 等) */
|
|
1175
|
-
title: string;
|
|
1176
|
-
/** 单价 */
|
|
1177
|
-
price: CartAmount;
|
|
1178
|
-
/** 商品图片 URL */
|
|
1179
|
-
image?: {
|
|
1180
|
-
url: string;
|
|
1181
|
-
altText?: string;
|
|
1182
|
-
};
|
|
1183
|
-
/** 关联的商品信息 */
|
|
1184
|
-
product: {
|
|
1185
|
-
/** 商品 ID */
|
|
1186
|
-
id: string;
|
|
1187
|
-
/** 商品标题 */
|
|
1188
|
-
title: string;
|
|
1189
|
-
/** 商品 handle */
|
|
1190
|
-
handle: string;
|
|
1191
|
-
};
|
|
1192
|
-
}
|
|
1193
|
-
/**
|
|
1194
|
-
* 购物车商品行
|
|
1195
|
-
*/
|
|
1196
|
-
interface CartLine {
|
|
1197
|
-
/** 购物车行 ID (用于更新/删除操作) */
|
|
1198
|
-
id: string;
|
|
1199
|
-
/** 商品数量 */
|
|
1200
|
-
quantity: number;
|
|
1201
|
-
/** 价格信息 */
|
|
1202
|
-
cost: {
|
|
1203
|
-
/** 行总价(单价 × 数量,已应用折扣) */
|
|
1204
|
-
totalAmount: CartAmount;
|
|
1205
|
-
/** 单价 */
|
|
1206
|
-
amountPerQuantity: CartAmount;
|
|
1207
|
-
/** 行小计(单价 × 数量,未应用折扣) */
|
|
1208
|
-
subtotalAmount: CartAmount;
|
|
1209
|
-
};
|
|
1210
|
-
/** 商品变体信息 */
|
|
1211
|
-
merchandise: CartMerchandise;
|
|
1212
|
-
/** 自定义属性(可选) */
|
|
1213
|
-
attributes?: Array<{
|
|
1214
|
-
key: string;
|
|
1215
|
-
value: string;
|
|
1216
|
-
}>;
|
|
1217
|
-
}
|
|
1218
|
-
/**
|
|
1219
|
-
* 购物车折扣码
|
|
1220
|
-
*/
|
|
1221
|
-
interface CartDiscountCode {
|
|
1222
|
-
/** 折扣码 */
|
|
1223
|
-
code: string;
|
|
1224
|
-
/** 是否有效/适用 */
|
|
1225
|
-
applicable: boolean;
|
|
1226
|
-
}
|
|
1227
|
-
/**
|
|
1228
|
-
* 购物车数据
|
|
1229
|
-
*/
|
|
1230
|
-
interface CartData {
|
|
1231
|
-
/** 购物车是否为空 */
|
|
1232
|
-
isEmpty: boolean;
|
|
1233
|
-
/** 购物车 ID (Shopify Cart GID) */
|
|
1234
|
-
cartId: string;
|
|
1235
|
-
/** 商品总数量 */
|
|
1236
|
-
totalQuantity: number;
|
|
1237
|
-
/** 商品列表 */
|
|
1238
|
-
lines: CartLine[];
|
|
1239
|
-
/** 价格汇总 */
|
|
1240
|
-
cost: CartCost;
|
|
1241
|
-
/** 折扣码列表 */
|
|
1242
|
-
discountCodes?: CartDiscountCode[];
|
|
1243
|
-
/** 结账页面 URL */
|
|
1244
|
-
checkoutUrl?: string;
|
|
1245
|
-
/** 购物车按钮回调函数 */
|
|
1246
|
-
onCart?: (cartId: string, checkoutUrl?: string) => void;
|
|
1247
|
-
/** 通用文案配置 */
|
|
1248
|
-
commonText?: CommonText;
|
|
1249
|
-
}
|
|
1250
|
-
/**
|
|
1251
|
-
* 购物车内容块
|
|
1252
|
-
*/
|
|
1253
|
-
interface CartContent {
|
|
1254
|
-
type: 'cart';
|
|
1255
|
-
data: CartData;
|
|
1256
|
-
}
|
|
1257
|
-
type SSEEventType = 'message_start' | 'content_delta' | 'content_block' | 'message_end' | 'tool_start' | 'tool_end' | 'status' | 'error' | 'done';
|
|
1258
|
-
interface SSEEvent<T = any> {
|
|
1259
|
-
event: SSEEventType | null;
|
|
1260
|
-
data: T;
|
|
1261
|
-
}
|
|
1262
|
-
/**
|
|
1263
|
-
* 流式对话请求参数
|
|
1264
|
-
*/
|
|
1265
|
-
interface ChatStreamRequest {
|
|
1266
|
-
/** 用户的消息文本 */
|
|
1267
|
-
message: string;
|
|
1268
|
-
/** 用户标识符 */
|
|
1269
|
-
user_id: string;
|
|
1270
|
-
/** 来自 new-session 端点的会话 ID */
|
|
1271
|
-
session_id: string;
|
|
1272
|
-
/** 可选的上下文信息 */
|
|
1273
|
-
context?: {
|
|
1274
|
-
/** 用于购物车操作的 Shopify 购物车 ID */
|
|
1275
|
-
cartId?: string;
|
|
1276
|
-
/** Storefront API 访问令牌 */
|
|
1277
|
-
accessToken?: string;
|
|
1278
|
-
/** 已登录用户的 ID */
|
|
1279
|
-
real_user_id?: string;
|
|
1280
|
-
};
|
|
1281
|
-
}
|
|
1282
|
-
/**
|
|
1283
|
-
* 通用文案配置
|
|
1284
|
-
* 用于自定义组件中的按钮文案
|
|
1285
|
-
*/
|
|
1286
|
-
interface CommonText {
|
|
1287
|
-
/**
|
|
1288
|
-
* 产品列表展开按钮文案
|
|
1289
|
-
* @default "Learn More"
|
|
1290
|
-
*/
|
|
1291
|
-
learnMore?: string;
|
|
1292
|
-
/**
|
|
1293
|
-
* 产品列表收起按钮文案
|
|
1294
|
-
* @default "Show Less"
|
|
1295
|
-
*/
|
|
1296
|
-
showLess?: string;
|
|
1297
|
-
/**
|
|
1298
|
-
* 添加到购物车按钮文案
|
|
1299
|
-
* @default "Add to Cart"
|
|
1300
|
-
*/
|
|
1301
|
-
addToCart?: string;
|
|
1302
|
-
/**
|
|
1303
|
-
* 查看购物车/更多按钮文案
|
|
1304
|
-
* @default "View More"
|
|
1305
|
-
*/
|
|
1306
|
-
viewMore?: string;
|
|
1307
|
-
/**
|
|
1308
|
-
* 折扣标签后缀文案(如 "20% OFF" 中的 "OFF")
|
|
1309
|
-
* @default "OFF"
|
|
1310
|
-
*/
|
|
1311
|
-
off?: string;
|
|
1312
|
-
/**
|
|
1313
|
-
* 购物车总计文案
|
|
1314
|
-
* @default "Total"
|
|
1315
|
-
*/
|
|
1316
|
-
total?: string;
|
|
1317
|
-
}
|
|
1318
|
-
/**
|
|
1319
|
-
* 法规协议弹窗配置
|
|
1320
|
-
*/
|
|
1321
|
-
interface ComplianceDialogConfig {
|
|
1322
|
-
/**
|
|
1323
|
-
* 弹窗标题
|
|
1324
|
-
* @example "Hi! I'm your eufy AI assistant."
|
|
1325
|
-
*/
|
|
1326
|
-
title: string;
|
|
1327
|
-
/**
|
|
1328
|
-
* 弹窗内容文本(支持 HTML)
|
|
1329
|
-
* @example "AI-generated responses can be inaccurate. Please verify important info. Do not input sensitive personal data"
|
|
1330
|
-
*/
|
|
1331
|
-
content: string;
|
|
1332
|
-
/**
|
|
1333
|
-
* 勾选框文本(支持完整 HTML,包括链接)
|
|
1334
|
-
* 可以直接包含 <a> 标签等 HTML 元素
|
|
1335
|
-
* @example "By starting to use \"Live Chat\", you agree to Anker's <a href=\"https://www.anker.com/privacy\" target=\"_blank\">LIVE CHAT PRIVACY NOTICE</a>."
|
|
1336
|
-
*/
|
|
1337
|
-
checkboxText: string;
|
|
1338
|
-
/**
|
|
1339
|
-
* 同意按钮文本
|
|
1340
|
-
* @default "Agree"
|
|
1341
|
-
*/
|
|
1342
|
-
agreeButtonText?: string;
|
|
1343
|
-
/**
|
|
1344
|
-
* Cookie 名称,用于记录用户同意状态
|
|
1345
|
-
* Cookie 有效期为 365 天
|
|
1346
|
-
* @default "livechat_compliance_agreed"
|
|
1347
|
-
*/
|
|
1348
|
-
cookieName?: string;
|
|
1349
|
-
}
|
|
1350
|
-
interface LiveChatWidgetProps {
|
|
1351
|
-
/**
|
|
1352
|
-
* API 基础 URL
|
|
1353
|
-
* @example "https://beta-api-livechat.anker.com"
|
|
1354
|
-
*/
|
|
1355
|
-
apiBaseUrl: string;
|
|
1356
|
-
/**
|
|
1357
|
-
* 自定义请求头
|
|
1358
|
-
* 将在所有 API 请求中添加这些请求头
|
|
1359
|
-
* @example { "Authorization": "Bearer token", "X-Custom-Header": "value" }
|
|
1360
|
-
*/
|
|
1361
|
-
headers?: Record<string, string>;
|
|
1362
|
-
/**
|
|
1363
|
-
* reCAPTCHA site key
|
|
1364
|
-
* 提供此参数将自动启用 reCAPTCHA v3 验证
|
|
1365
|
-
* @example "6LfS4J4pAAAAACX1e_WrxutmxxzCK7FU4WzVqL14"
|
|
1366
|
-
*/
|
|
1367
|
-
recaptchaSitekey?: string;
|
|
1368
|
-
/**
|
|
1369
|
-
* reCAPTCHA action 前缀
|
|
1370
|
-
* 实际使用时会根据不同接口添加后缀(如 chat_stream, new_session)
|
|
1371
|
-
* @default "livechat"
|
|
1372
|
-
*/
|
|
1373
|
-
recaptchaAction?: string;
|
|
1374
|
-
/**
|
|
1375
|
-
* Shopify 店铺域名
|
|
1376
|
-
* @example "www.eufy.com"
|
|
1377
|
-
*/
|
|
1378
|
-
site?: string;
|
|
1379
|
-
/**
|
|
1380
|
-
* 渠道编码
|
|
1381
|
-
* 用于标识来源渠道
|
|
1382
|
-
* @example "web_homepage"
|
|
1383
|
-
*/
|
|
1384
|
-
channelCode?: string;
|
|
1385
|
-
/**
|
|
1386
|
-
* 已登录用户的 ID(可选)
|
|
1387
|
-
* 如果提供,将在 API 请求中传递
|
|
1388
|
-
*/
|
|
1389
|
-
loginUserId?: string;
|
|
1390
|
-
/**
|
|
1391
|
-
* Shopify 购物车 ID(可选)
|
|
1392
|
-
* 用于购物车操作,将在 stream 接口的 context 中传递
|
|
1393
|
-
* @example "gid://shopify/Cart/Z2NwLXVzLWVhc3QxOjAxSkZH..."
|
|
1394
|
-
*/
|
|
1395
|
-
cartId?: string;
|
|
1396
|
-
/**
|
|
1397
|
-
* Storefront API 访问令牌(可选)
|
|
1398
|
-
* 用于购物车操作,将在 stream 接口的 context 中传递
|
|
1399
|
-
*/
|
|
1400
|
-
accessToken?: string;
|
|
1401
|
-
/**
|
|
1402
|
-
* 气泡按钮位置
|
|
1403
|
-
* 自定义位置对象:{ top?: string, bottom?: string, left?: string, right?: string }
|
|
1404
|
-
* @default { bottom: "1.5rem", right: "1.5rem" }
|
|
1405
|
-
* @example
|
|
1406
|
-
* // 自定义位置
|
|
1407
|
-
* position={{ bottom: "20px", right: "30px" }}
|
|
1408
|
-
* position={{ top: "100px", left: "50px" }}
|
|
1409
|
-
*/
|
|
1410
|
-
position?: BubblePosition;
|
|
1411
|
-
/**
|
|
1412
|
-
* 欢迎消息
|
|
1413
|
-
*/
|
|
1414
|
-
welcomeMessage?: string;
|
|
1415
|
-
/**
|
|
1416
|
-
* 初始快捷回复按钮
|
|
1417
|
-
*/
|
|
1418
|
-
quickReplies?: QuickReply[];
|
|
1419
|
-
/**
|
|
1420
|
-
* 自定义消息渲染器
|
|
1421
|
-
*/
|
|
1422
|
-
customRenderers?: Record<string, MessageRenderer>;
|
|
1423
|
-
/**
|
|
1424
|
-
* Logo URL
|
|
1425
|
-
*/
|
|
1426
|
-
logoUrl?: string;
|
|
1427
|
-
/**
|
|
1428
|
-
* 聊天窗口标题
|
|
1429
|
-
* @default "AI 助手"
|
|
1430
|
-
*/
|
|
1431
|
-
title?: string;
|
|
1432
|
-
/**
|
|
1433
|
-
* 聊天气泡按钮图标(图片 URL)
|
|
1434
|
-
* 如果提供,将使用图片替代默认的 SVG 图标
|
|
1435
|
-
*/
|
|
1436
|
-
chatBubbleIcon?: string;
|
|
1437
|
-
/**
|
|
1438
|
-
* 受控模式:是否打开聊天窗口
|
|
1439
|
-
* 提供此参数时,组件将处于受控模式
|
|
1440
|
-
* @example
|
|
1441
|
-
* ```tsx
|
|
1442
|
-
* const [isOpen, setIsOpen] = useState(false)
|
|
1443
|
-
* <LiveChatWidget open={isOpen} onOpenChange={setIsOpen} />
|
|
1444
|
-
* ```
|
|
1445
|
-
*/
|
|
1446
|
-
open?: boolean;
|
|
1447
|
-
/**
|
|
1448
|
-
* 受控模式:打开/关闭状态变化回调
|
|
1449
|
-
* 【必需】配合 `open` 使用,用于同步状态到父组件
|
|
1450
|
-
* 当用户点击打开或关闭按钮时触发
|
|
1451
|
-
* @example
|
|
1452
|
-
* ```tsx
|
|
1453
|
-
* <LiveChatWidget
|
|
1454
|
-
* open={isOpen}
|
|
1455
|
-
* onOpenChange={setIsOpen} // 必需:同步状态
|
|
1456
|
-
* />
|
|
1457
|
-
* ```
|
|
1458
|
-
*/
|
|
1459
|
-
onOpenChange?: (open: boolean) => void;
|
|
1460
|
-
/**
|
|
1461
|
-
* 【可选】窗口打开事件监听
|
|
1462
|
-
* 用于埋点、日志等副作用,不影响状态控制
|
|
1463
|
-
* 在 onOpenChange 之后触发
|
|
1464
|
-
* @example
|
|
1465
|
-
* ```tsx
|
|
1466
|
-
* <LiveChatWidget
|
|
1467
|
-
* open={isOpen}
|
|
1468
|
-
* onOpenChange={setIsOpen}
|
|
1469
|
-
* onOpen={() => trackEvent('chat_opened')} // 可选:埋点
|
|
1470
|
-
* />
|
|
1471
|
-
* ```
|
|
1472
|
-
*/
|
|
1473
|
-
onOpen?: () => void;
|
|
1474
|
-
/**
|
|
1475
|
-
* 【可选】窗口关闭事件监听
|
|
1476
|
-
* 用于埋点、日志等副作用,不影响状态控制
|
|
1477
|
-
* 在 onOpenChange 之后触发
|
|
1478
|
-
* @example
|
|
1479
|
-
* ```tsx
|
|
1480
|
-
* <LiveChatWidget
|
|
1481
|
-
* open={isOpen}
|
|
1482
|
-
* onOpenChange={setIsOpen}
|
|
1483
|
-
* onClose={() => trackEvent('chat_closed')} // 可选:埋点
|
|
1484
|
-
* />
|
|
1485
|
-
* ```
|
|
1486
|
-
*/
|
|
1487
|
-
onClose?: () => void;
|
|
1488
|
-
onMessageSend?: (message: string) => void;
|
|
1489
|
-
onError?: (error: Error) => void;
|
|
1490
|
-
/**
|
|
1491
|
-
* AI 消息回调
|
|
1492
|
-
*/
|
|
1493
|
-
/**
|
|
1494
|
-
* AI 回复文本消息时触发
|
|
1495
|
-
*/
|
|
1496
|
-
onTextMessage?: () => void;
|
|
1497
|
-
/**
|
|
1498
|
-
* AI 回复商品列表卡片时触发
|
|
1499
|
-
*/
|
|
1500
|
-
onProductList?: () => void;
|
|
1501
|
-
/**
|
|
1502
|
-
* AI 回复促销卡片时触发
|
|
1503
|
-
* @param promotions 促销活动数组数据
|
|
1504
|
-
*/
|
|
1505
|
-
onPromotionList?: (promotions: PromotionItem[]) => void;
|
|
1506
|
-
/**
|
|
1507
|
-
* 商品操作回调
|
|
1508
|
-
*/
|
|
1509
|
-
onAddToCart?: (product: Product) => void;
|
|
1510
|
-
/**
|
|
1511
|
-
* 购物车按钮点击回调
|
|
1512
|
-
*/
|
|
1513
|
-
onCart?: (cartId: string, checkoutUrl?: string) => void;
|
|
1514
|
-
/**
|
|
1515
|
-
* 是否显示新会话按钮
|
|
1516
|
-
* @default true
|
|
1517
|
-
*/
|
|
1518
|
-
showNewSessionButton?: boolean;
|
|
1519
|
-
/**
|
|
1520
|
-
* 通用文案配置
|
|
1521
|
-
* 用于自定义按钮文案
|
|
1522
|
-
*/
|
|
1523
|
-
commonText?: CommonText;
|
|
1524
|
-
/**
|
|
1525
|
-
* 自定义产品卡片渲染函数
|
|
1526
|
-
* 用于自定义渲染 product_card 类型的产品卡片
|
|
1527
|
-
* 当提供此函数时,将替代默认的产品卡片渲染逻辑
|
|
1528
|
-
* @param product 原始后端产品数据(未经转换的数据),如果在 product_list 中找不到则为 undefined
|
|
1529
|
-
* @param productHandle 文本占位符中的产品 ID(如 {{product:ID}} 中的 ID),可用于应用层查询产品数据
|
|
1530
|
-
* @returns React 可渲染的内容
|
|
1531
|
-
* @example
|
|
1532
|
-
* ```tsx
|
|
1533
|
-
* <LiveChatWidget
|
|
1534
|
-
* productCardRender={(product, productHandle) => {
|
|
1535
|
-
* // product 可能为 undefined,此时可用 productHandle 查询产品
|
|
1536
|
-
* if (!product) {
|
|
1537
|
-
* return <ProductCardByHandle handle={productHandle} />
|
|
1538
|
-
* }
|
|
1539
|
-
* return (
|
|
1540
|
-
* <div>
|
|
1541
|
-
* <h3>{product.title}</h3>
|
|
1542
|
-
* <p>{product.price_range?.min}</p>
|
|
1543
|
-
* </div>
|
|
1544
|
-
* )
|
|
1545
|
-
* }}
|
|
1546
|
-
* />
|
|
1547
|
-
* ```
|
|
1548
|
-
*/
|
|
1549
|
-
productCardRender?: (product: any, productHandle: string) => React.ReactNode;
|
|
1550
|
-
/**
|
|
1551
|
-
* 自定义产品对比卡片渲染函数
|
|
1552
|
-
* 用于自定义渲染 product_comparison 类型的产品对比卡片
|
|
1553
|
-
* 当提供此函数时,将替代默认的产品对比卡片渲染逻辑
|
|
1554
|
-
* @param data 产品对比数据(包含 products 和 dimensions)
|
|
1555
|
-
* @returns React 可渲染的内容
|
|
1556
|
-
*/
|
|
1557
|
-
productComparisonRender?: (data: ProductComparisonContent['data']) => React.ReactNode;
|
|
1558
|
-
/**
|
|
1559
|
-
* 输入框底部提示文本
|
|
1560
|
-
* 不传入则不显示
|
|
1561
|
-
*/
|
|
1562
|
-
bottomTips?: string;
|
|
1563
|
-
/**
|
|
1564
|
-
* 法规协议弹窗配置
|
|
1565
|
-
* 提供此参数将在用户首次点击聊天气泡时显示法规协议弹窗
|
|
1566
|
-
* 用户同意后才会打开聊天窗口
|
|
1567
|
-
*/
|
|
1568
|
-
complianceConfig?: ComplianceDialogConfig;
|
|
1569
|
-
}
|
|
1570
|
-
interface MessageRenderer {
|
|
1571
|
-
render: (content: MessageContent, isUser: boolean, isSystem: boolean) => React.ReactNode;
|
|
1572
|
-
}
|
|
1573
|
-
interface PositionStyles {
|
|
1574
|
-
bottom?: string;
|
|
1575
|
-
top?: string;
|
|
1576
|
-
left?: string;
|
|
1577
|
-
right?: string;
|
|
1578
|
-
}
|
|
1579
|
-
type BubblePosition = PositionStyles;
|
|
1580
|
-
|
|
1581
|
-
/**
|
|
1582
|
-
* LiveChat 主组件
|
|
1583
|
-
* 集成所有子组件,提供完整的聊天功能
|
|
1584
|
-
* 基于 specs/livechat-widget/plan.md 的三层架构设计
|
|
1585
|
-
*/
|
|
1586
|
-
|
|
1587
|
-
/**
|
|
1588
|
-
* LiveChat 聊天组件
|
|
1589
|
-
*
|
|
1590
|
-
* 功能:
|
|
1591
|
-
* - 气泡弹窗聊天界面
|
|
1592
|
-
* - SSE 流式消息接收
|
|
1593
|
-
* - 会话管理(userId, sessionId)
|
|
1594
|
-
* - 历史消息加载
|
|
1595
|
-
* - 多种消息类型渲染
|
|
1596
|
-
* - 自定义扩展机制
|
|
1597
|
-
* - reCAPTCHA v3 安全防护
|
|
1598
|
-
*
|
|
1599
|
-
* 架构:
|
|
1600
|
-
* - UI Layer: ChatBubble, ChatWindow, MessageList, etc.
|
|
1601
|
-
* - Logic Layer: useChatState, useChatAPI, useSession
|
|
1602
|
-
* - Core Layer: MessageRendererRegistry, 自定义渲染器
|
|
1603
|
-
*
|
|
1604
|
-
* @example
|
|
1605
|
-
* ```tsx
|
|
1606
|
-
* // 基础使用(使用默认位置)
|
|
1607
|
-
* <LiveChatWidget
|
|
1608
|
-
* apiBaseUrl="https://beta-api-livechat.anker.com"
|
|
1609
|
-
* site="www.eufy.com"
|
|
1610
|
-
* welcomeMessage="你好!我是 AI 助手"
|
|
1611
|
-
* onMessageSend={(msg) => console.log('Sent:', msg)}
|
|
1612
|
-
* />
|
|
1613
|
-
*
|
|
1614
|
-
* // 使用自定义位置
|
|
1615
|
-
* <LiveChatWidget
|
|
1616
|
-
* apiBaseUrl="https://beta-api-livechat.anker.com"
|
|
1617
|
-
* site="www.eufy.com"
|
|
1618
|
-
* position={{ bottom: "20px", right: "30px" }}
|
|
1619
|
-
* onMessageSend={(msg) => console.log('Sent:', msg)}
|
|
1620
|
-
* />
|
|
1621
|
-
*
|
|
1622
|
-
* // 启用 reCAPTCHA v3 安全防护(提供 sitekey 即自动启用)
|
|
1623
|
-
* <LiveChatWidget
|
|
1624
|
-
* apiBaseUrl="https://beta-api-livechat.anker.com"
|
|
1625
|
-
* site="www.eufy.com"
|
|
1626
|
-
* recaptchaSitekey="6LfS4J4pAAAAACX1e_WrxutmxxzCK7FU4WzVqL14"
|
|
1627
|
-
* recaptchaAction="livechat"
|
|
1628
|
-
* />
|
|
1629
|
-
*
|
|
1630
|
-
* // 使用自定义 headers 和 reCAPTCHA
|
|
1631
|
-
* <LiveChatWidget
|
|
1632
|
-
* apiBaseUrl="https://beta-api-livechat.anker.com"
|
|
1633
|
-
* site="www.eufy.com"
|
|
1634
|
-
* headers={{
|
|
1635
|
-
* "Authorization": "Bearer your-token",
|
|
1636
|
-
* "X-Custom-Header": "value"
|
|
1637
|
-
* }}
|
|
1638
|
-
* recaptchaSitekey="your-site-key"
|
|
1639
|
-
* />
|
|
1640
|
-
* ```
|
|
1641
|
-
*/
|
|
1642
|
-
declare const LiveChatWidget: React__default.FC<LiveChatWidgetProps>;
|
|
1643
|
-
|
|
1644
|
-
type RedeemableItemConfig = {
|
|
1645
|
-
title: string;
|
|
1646
|
-
desc: string;
|
|
1647
|
-
price: number;
|
|
1648
|
-
credit: string;
|
|
1649
|
-
rules: string;
|
|
1650
|
-
image: {
|
|
1651
|
-
url: string;
|
|
1652
|
-
};
|
|
1653
|
-
mobileImage: {
|
|
1654
|
-
url: string;
|
|
1655
|
-
};
|
|
1656
|
-
redeemId: number;
|
|
1657
|
-
};
|
|
1658
|
-
type TabConfig = {
|
|
1659
|
-
label: string;
|
|
1660
|
-
type: 'memberPrice' | 'redeem';
|
|
1661
|
-
};
|
|
1662
|
-
type CreditsMemberPriceCopy = {
|
|
1663
|
-
title: string;
|
|
1664
|
-
tabs: TabConfig[];
|
|
1665
|
-
memberPriceTab: {
|
|
1666
|
-
memberPriceRuleId: string;
|
|
1667
|
-
addToCart: string;
|
|
1668
|
-
shopNowText: string;
|
|
1669
|
-
memberPriceLabel: string;
|
|
1670
|
-
badgeLabel?: string;
|
|
1671
|
-
};
|
|
1672
|
-
redeemTab: {
|
|
1673
|
-
list: (RedeemableItemConfig & {
|
|
1674
|
-
products: {
|
|
1675
|
-
handle: string;
|
|
1676
|
-
sku: string;
|
|
1677
|
-
}[];
|
|
1678
|
-
})[];
|
|
1679
|
-
soldOut: string;
|
|
1680
|
-
unlockRewards: string;
|
|
1681
|
-
btnRedeem: string;
|
|
1682
|
-
off: string;
|
|
1683
|
-
badgeLabel?: string;
|
|
1684
|
-
};
|
|
1685
|
-
};
|
|
1686
|
-
|
|
1687
|
-
type NavigationItem = {
|
|
1688
|
-
label: string;
|
|
1689
|
-
targetId: string;
|
|
1690
|
-
};
|
|
1691
|
-
type CreditsNavigationCopy = {
|
|
1692
|
-
items: NavigationItem[];
|
|
1693
|
-
};
|
|
1694
|
-
|
|
1695
|
-
declare enum ComponentKey {
|
|
1696
|
-
Navigation = "creditsNavigation",
|
|
1697
|
-
Banner = "creditsBanner",
|
|
1698
|
-
InfoCard = "creditsInfoCard",
|
|
1699
|
-
Benefits = "creditsBenefits",
|
|
1700
|
-
WaysToGetCredits = "creditsWaysToGetCredits",
|
|
1701
|
-
AnkersolixTask = "creditsAnkersolixTask",
|
|
1702
|
-
RedeemList = "creditsRedeemList",
|
|
1703
|
-
GoGift = "creditsGoGift",
|
|
1704
|
-
SpendCreditsLikeCash = "creditsCash",
|
|
1705
|
-
MemberPrice = "creditsMemberPrice",
|
|
1706
|
-
Faqs = "creditsFaq"
|
|
1707
|
-
}
|
|
1708
|
-
type CreditsTemplateProps = {
|
|
1709
|
-
headlessConfig: HeadlessConfig;
|
|
1710
|
-
siteConfig: {
|
|
1711
|
-
registrationsSettings: {
|
|
1712
|
-
authCodeActivate: AuthCodeActivateCopy;
|
|
1713
|
-
};
|
|
1714
|
-
taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
|
|
1715
|
-
memberPriceDiscount?: FunctionMemberPriceConfig[];
|
|
1716
|
-
};
|
|
1717
|
-
creditsConfig?: {
|
|
1718
|
-
alpcBrand?: string;
|
|
1719
|
-
};
|
|
1720
|
-
pageConfig: {
|
|
1721
|
-
order: ComponentKey[];
|
|
1722
|
-
common: CreditsPageCommon;
|
|
1723
|
-
components: {
|
|
1724
|
-
[ComponentKey.Navigation]?: CreditsNavigationCopy;
|
|
1725
|
-
[ComponentKey.Banner]?: CreditsBannerCopy;
|
|
1726
|
-
[ComponentKey.InfoCard]?: CreditsInfoCardCopy;
|
|
1727
|
-
[ComponentKey.Benefits]?: CreditsBenefitsCopy;
|
|
1728
|
-
[ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy;
|
|
1729
|
-
[ComponentKey.AnkersolixTask]?: CreditsWaysToGetCreditsCopy;
|
|
1730
|
-
[ComponentKey.RedeemList]?: CreditsRedeemListCopy;
|
|
1731
|
-
[ComponentKey.GoGift]?: CreditsGoGiftCopy;
|
|
1732
|
-
[ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy;
|
|
1733
|
-
[ComponentKey.MemberPrice]?: CreditsMemberPriceCopy;
|
|
1734
|
-
[ComponentKey.Faqs]?: CreditsFaqCopy;
|
|
1735
|
-
};
|
|
1736
|
-
};
|
|
1737
|
-
userContext: {
|
|
1738
|
-
profile: any;
|
|
1739
|
-
removeProfile: () => void;
|
|
1740
|
-
isLoadingProfile: boolean;
|
|
1741
|
-
creditInfo: any;
|
|
1742
|
-
customer: any;
|
|
1743
|
-
customerLoading: boolean;
|
|
1744
|
-
fetchCreditInfo: () => void;
|
|
1745
|
-
apiBaseUrl?: string;
|
|
1746
|
-
};
|
|
1747
|
-
registrationContext: {
|
|
1748
|
-
openSignUpPopup: () => void;
|
|
1749
|
-
openSignInPopup: () => void;
|
|
1750
|
-
};
|
|
1751
|
-
gtm: {
|
|
1752
|
-
pageGroup: string;
|
|
1753
|
-
pageHandle?: string;
|
|
1754
|
-
};
|
|
1755
|
-
cartConfig?: {
|
|
1756
|
-
addToCart: (params: {
|
|
1757
|
-
variantList: Array<{
|
|
1758
|
-
variant: any;
|
|
1759
|
-
quantity: number;
|
|
1760
|
-
attributes?: Array<{
|
|
1761
|
-
key: string;
|
|
1762
|
-
value: string;
|
|
1763
|
-
}>;
|
|
1764
|
-
}>;
|
|
1765
|
-
cartAttributes?: Record<string, string>;
|
|
1766
|
-
discountCodes?: string[];
|
|
1767
|
-
}) => void | Promise<any>;
|
|
1768
|
-
};
|
|
1769
|
-
};
|
|
1770
|
-
|
|
1771
|
-
declare const CreditsTemplate: ({ headlessConfig, siteConfig, creditsConfig, userContext, pageConfig, registrationContext, gtm, cartConfig, }: CreditsTemplateProps) => react_jsx_runtime.JSX.Element;
|
|
1772
|
-
|
|
1773
|
-
declare const ROUNDED_BRANDS: string[];
|
|
1774
|
-
|
|
1775
|
-
export { type ActivityCopy, type ActivitySubscribeCopy, type AlpcConfig, AuthCodeActivate, Chat, type ChatStreamRequest, type CompleteProfileCopy, type ConsumeCreditsItem, ConsumeCreditsItemType, type ConsumeCreditsopy, CreditsBanner, CreditsBenefits, CreditsCash, CreditsFaq, CreditsGoGift, CreditsInfoCard, CreditsProvider, CreditsRedeemList, CreditsTemplate, CreditsUploadReceiptModal, CreditsWaysToGetCredits, type EarnCreditsCopy, EarnCreditsTaskType, type ErrorContent, LiveChatWidget, type LiveChatWidgetProps, MemberPopup, MemberPopupActionType, type MemberPopupContextValue, type MemberPopupCopy, type MemberPopupItem, type MemberPopupLink, MemberPopupPanelType, type Message, type MessageContent, type MessageContentType, type MessageMetadata, type MessageRenderer, type MessageRole, type PolicyContent, type ProductCardContent, type ProductListContent, type QuickRepliesContent, type QuickReply, ROUNDED_BRANDS, type RedeemCouponModalCopy, type ReferralCopy, RegistrationContext, RegistrationProvider, type SSEEvent, type SubscribeModalCopy, type ThinkingContent, useCreditsContext, useUploadReceipt as useCreditsUploadReceipt, useMemberPopupContext, useRegistration };
|