@anker-in/campaign-ui 0.3.6 → 0.3.7

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.
Files changed (36) hide show
  1. package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js +1 -1
  2. package/dist/cjs/components/LiveChatWidget/LiveChatWidget.js.map +3 -3
  3. package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductComparison.d.ts +1 -0
  4. package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductComparison.js +1 -1
  5. package/dist/cjs/components/LiveChatWidget/components/MessageContent/ProductComparison.js.map +3 -3
  6. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.d.ts +5 -0
  7. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js +1 -1
  8. package/dist/cjs/components/LiveChatWidget/hooks/useChatState.js.map +3 -3
  9. package/dist/cjs/components/LiveChatWidget/types.d.ts +12 -0
  10. package/dist/cjs/components/LiveChatWidget/types.js.map +1 -1
  11. package/dist/esm/components/LiveChatWidget/LiveChatWidget.js +1 -1
  12. package/dist/esm/components/LiveChatWidget/LiveChatWidget.js.map +3 -3
  13. package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductComparison.d.ts +1 -0
  14. package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductComparison.js +1 -1
  15. package/dist/esm/components/LiveChatWidget/components/MessageContent/ProductComparison.js.map +3 -3
  16. package/dist/esm/components/LiveChatWidget/hooks/useChatState.d.ts +5 -0
  17. package/dist/esm/components/LiveChatWidget/hooks/useChatState.js +1 -1
  18. package/dist/esm/components/LiveChatWidget/hooks/useChatState.js.map +3 -3
  19. package/dist/esm/components/LiveChatWidget/types.d.ts +12 -0
  20. package/dist/index.js +59 -67
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +70 -78
  23. package/dist/index.mjs.map +1 -1
  24. package/package.json +1 -1
  25. package/src/components/LiveChatWidget/LiveChatWidget.tsx +4 -1
  26. package/src/components/LiveChatWidget/components/MessageContent/ProductComparison.tsx +6 -13
  27. package/src/components/LiveChatWidget/hooks/useChatState.ts +8 -0
  28. package/src/components/LiveChatWidget/types.ts +13 -0
  29. package/dist/cjs/stories/CartCard.stories.d.ts +0 -33
  30. package/dist/cjs/stories/CartCard.stories.js +0 -21
  31. package/dist/cjs/stories/CartCard.stories.js.map +0 -7
  32. package/dist/esm/stories/CartCard.stories.d.ts +0 -33
  33. package/dist/esm/stories/CartCard.stories.js +0 -21
  34. package/dist/esm/stories/CartCard.stories.js.map +0 -7
  35. package/dist/index.d.mts +0 -1432
  36. package/dist/index.d.ts +0 -1432
package/dist/index.d.mts DELETED
@@ -1,1432 +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 MyRewardsMetafields {
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
- pendingLabel: string;
141
- unfulfilledLabel: string;
142
- fulfilledLabel: string;
143
- confirmedTip: string;
144
- pendingTip: string;
145
- processingTip: string;
146
- ShippedTip: string;
147
- emptyListLabel: string;
148
- pointUnit: string;
149
- code: string;
150
- copied: string;
151
- copy: string;
152
- emptyListImage: {
153
- url: string;
154
- alt?: string;
155
- };
156
- }
157
-
158
- type CreditsPageCommon = {
159
- pointUnit?: string;
160
- infoIcon?: string;
161
- ruleLabel?: string;
162
- soldOut?: string;
163
- copied?: string;
164
- off?: string;
165
- copy?: string;
166
- giftCardLabel?: string;
167
- imageMapping?: {
168
- [key in ConsumeType]: {
169
- url: string;
170
- };
171
- };
172
- activitiesModal?: MyActivitiesMetafields;
173
- rewardsModal?: MyRewardsMetafields;
174
- insufficientCredits?: string;
175
- validatorInfo?: {
176
- addressInfo: {
177
- name: string;
178
- country: string;
179
- province: string;
180
- city: string;
181
- address: string;
182
- };
183
- };
184
- };
185
-
186
- declare enum FunctionDiscountType {
187
- Percentage = 1,
188
- FixedAmount = 2,
189
- FixedPrice = 3
190
- }
191
-
192
- type DiscountConfig = {
193
- discount_type: FunctionDiscountType;
194
- discount_value: number;
195
- };
196
- type FunctionMemberPriceConfig = {
197
- rule_id: string;
198
- result_detail: {
199
- member_discounts?: {
200
- user_identity: number;
201
- main_products: {
202
- all_store_variant: boolean;
203
- variants: {
204
- variant_id: string;
205
- sku: string;
206
- handle: string;
207
- }[];
208
- };
209
- discount_conf: DiscountConfig;
210
- }[];
211
- };
212
- discount_combinations: {
213
- other_product_discounts: boolean;
214
- };
215
- };
216
-
217
- type Context = {
218
- profile: any;
219
- isLoadingProfile: boolean;
220
- removeProfile: () => void;
221
- taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
222
- openSignInPopup: () => void;
223
- openSignUpPopup: () => void;
224
- creditInfo?: CreditInfoResponse;
225
- customer?: any;
226
- customerLoading: boolean;
227
- fetchCreditInfo: (user_id: string) => void;
228
- gtm: {
229
- pageGroup: string;
230
- pageHandle?: string;
231
- };
232
- pageCommon: CreditsPageCommon;
233
- memberPriceDiscount?: FunctionMemberPriceConfig[];
234
- alpcBrand?: string;
235
- cartConfig?: {
236
- addToCart: (params: {
237
- variantList: Array<{
238
- variant: any;
239
- quantity: number;
240
- attributes?: Array<{
241
- key: string;
242
- value: string;
243
- }>;
244
- }>;
245
- cartAttributes?: Record<string, string>;
246
- discountCodes?: string[];
247
- }) => void | Promise<any>;
248
- };
249
- };
250
- declare function CreditsProvider({ children, profile, removeProfile, isLoadingProfile, openSignInPopup, openSignUpPopup, taskIdToTypeMapping, creditInfo, customer, customerLoading, fetchCreditInfo, gtm, pageCommon, memberPriceDiscount, alpcBrand, cartConfig, }: PropsWithChildren<Context>): react_jsx_runtime.JSX.Element;
251
- declare function useCreditsContext(): Context;
252
-
253
- declare const useUploadReceipt: () => swr_dist_mutation.SWRMutationResponse<{
254
- ok: boolean;
255
- code: number;
256
- }, any, "/api/multipass/mktsrv/v1/credit/upload_third_party_order", {
257
- orderName: string;
258
- }>;
259
-
260
- type ReceiptCopy = {
261
- title: string;
262
- description: string;
263
- placeholder: string;
264
- note: string;
265
- submit: string;
266
- successTitle: string;
267
- successDescription: string;
268
- gotIt: string;
269
- failedTitle: string;
270
- successIcon: string;
271
- failedIcon: string;
272
- failedReasons: {
273
- code: string;
274
- id: string;
275
- description: string;
276
- }[];
277
- };
278
- declare function CreditsUploadReceiptModal({ isOpen, onClose, copy, onSuccess, }: {
279
- isOpen: boolean;
280
- onClose: () => void;
281
- copy: ReceiptCopy;
282
- onSuccess: () => void;
283
- }): react_jsx_runtime.JSX.Element;
284
-
285
- type Img = {
286
- url: string;
287
- alt: string;
288
- width?: number;
289
- height?: number;
290
- };
291
- type CreditsBannerCopy = {
292
- pcImg: Img;
293
- laptopImg: Img;
294
- mobileImg: Img;
295
- joinNow: string;
296
- loginIn: string;
297
- login: {
298
- title: string;
299
- description: string;
300
- };
301
- unLogin: {
302
- title: string;
303
- description: string;
304
- };
305
- };
306
- declare function CreditsBanner({ copy, id }: {
307
- copy: CreditsBannerCopy;
308
- id?: string;
309
- }): react_jsx_runtime.JSX.Element;
310
-
311
- interface BenefitItemCopy {
312
- icon: {
313
- alt: string;
314
- url: string;
315
- };
316
- text: string;
317
- note?: string;
318
- tag?: string;
319
- }
320
-
321
- type CreditsBenefitsCopy = {
322
- title: string;
323
- benefits: BenefitItemCopy[];
324
- bigIcon?: boolean;
325
- cardBgColor?: string;
326
- cardBorderColor?: string;
327
- };
328
- declare const CreditsBenefits: ({ copy, id }: {
329
- copy: CreditsBenefitsCopy;
330
- id?: string;
331
- }) => react_jsx_runtime.JSX.Element;
332
-
333
- type ButtonConfig = {
334
- text: string;
335
- type: 'activities' | 'rewards';
336
- };
337
- type CreditsInfoCardCopy = {
338
- balanceLabel: string;
339
- comingSoonLabel: string;
340
- comingSoonTips: string;
341
- buttons: ButtonConfig[];
342
- };
343
- declare function CreditsInfoCard({ copy, id }: {
344
- copy: CreditsInfoCardCopy;
345
- id?: string;
346
- }): react_jsx_runtime.JSX.Element;
347
-
348
- type CreditsSubscribeModalCopy = {
349
- title: string;
350
- desc?: string;
351
- placeholder: string;
352
- policy?: string;
353
- successTips?: string;
354
- dealsType?: string;
355
- };
356
-
357
- type BenefitItem = {
358
- title: string;
359
- credits: string;
360
- id: string;
361
- };
362
- type CreditsWaysToGetCreditsCopy = {
363
- title: string;
364
- subtitle: string;
365
- equalCredits: string;
366
- musicIcon: string;
367
- list: BenefitItem[];
368
- mainImage: {
369
- url: string;
370
- alt: string;
371
- };
372
- joinNow: string;
373
- activate: string;
374
- completed: string;
375
- completeProfile: string;
376
- makeFirstPurchase: string;
377
- goShopLink: string;
378
- uploadReceipt: string;
379
- shopNow: string;
380
- subscribeLabel: string;
381
- sendEmailSuccess: string;
382
- creditsIcon: {
383
- url: string;
384
- alt: string;
385
- };
386
- receipt: ReceiptCopy;
387
- subscribe: CreditsSubscribeModalCopy;
388
- };
389
- type CreditsWaysToGetCreditsProps = {
390
- copy: CreditsWaysToGetCreditsCopy;
391
- classNames?: {
392
- equalCreditsText?: string;
393
- subtitle?: string;
394
- };
395
- };
396
-
397
- declare const CreditsWaysToGetCredits: ({ copy, classNames, id }: CreditsWaysToGetCreditsProps & {
398
- id?: string;
399
- }) => react_jsx_runtime.JSX.Element;
400
-
401
- type CreditsFaqCopy = {
402
- title: string;
403
- subTitle: string;
404
- learnMore: {
405
- link: string;
406
- label: string;
407
- };
408
- items: {
409
- category_name: string;
410
- question: string;
411
- answer: string;
412
- }[];
413
- };
414
- declare const CreditsFaq: ({ copy, id }: {
415
- copy: CreditsFaqCopy;
416
- id?: string;
417
- }) => react_jsx_runtime.JSX.Element;
418
-
419
- type RedeemableItemConfig$1 = {
420
- title: string;
421
- desc: string;
422
- price: number;
423
- credit: string;
424
- rules: string;
425
- image: {
426
- url: string;
427
- };
428
- mobileImage: {
429
- url: string;
430
- };
431
- redeemId: number;
432
- };
433
- type CreditsCashCopy = {
434
- title: string;
435
- list: (RedeemableItemConfig$1 & {
436
- products: {
437
- handle: string;
438
- sku: string;
439
- }[];
440
- })[];
441
- soldOut: string;
442
- unlockRewards: string;
443
- btnRedeem: string;
444
- off: string;
445
- badgeLabel?: string;
446
- };
447
-
448
- declare const CreditsCash: ({ copy, id }: {
449
- copy: CreditsCashCopy;
450
- id?: string;
451
- }) => react_jsx_runtime.JSX.Element;
452
-
453
- type CreditsRedeemListCopy = {
454
- title: string;
455
- availableCredits: string;
456
- unlockRewards: string;
457
- btnRedeem: string;
458
- list: {
459
- label: string;
460
- list: {
461
- id: string;
462
- type: string;
463
- value: string;
464
- rules: string[];
465
- }[];
466
- }[];
467
- redeemModal: {
468
- confirmTitle: string;
469
- confirmButton: string;
470
- commonError: string;
471
- redeemLimitError: string;
472
- inventoryNotEnough: string;
473
- creditsNotEnough: string;
474
- crossSiteError: string;
475
- errorImageUrl: string;
476
- coupon: {
477
- successDesc: string;
478
- successTitle: string;
479
- successButton: string;
480
- successButtonUrl: string;
481
- };
482
- product: {
483
- required: string;
484
- invalidEmail: string;
485
- shippingAddress: string;
486
- shippingProduct: string;
487
- addressForm: {
488
- key: string;
489
- type: string;
490
- label: string;
491
- isSelect: boolean;
492
- required: boolean;
493
- placeholder: string;
494
- }[][];
495
- form: {
496
- key: string;
497
- type: string;
498
- isSelect: boolean;
499
- required: boolean;
500
- placeholder: string;
501
- }[][];
502
- successDesc: string[];
503
- rules: string[];
504
- steps: {
505
- imageUrl: string;
506
- title: string;
507
- }[];
508
- quantityLabel: string;
509
- totalPriceLabel: string;
510
- variantLabel: string;
511
- shippingFeeLabel: string;
512
- paymentButton: string;
513
- stepTitle: string;
514
- };
515
- };
516
- };
517
-
518
- declare const CreditsRedeemList: ({ copy, id }: {
519
- copy: CreditsRedeemListCopy;
520
- id?: string;
521
- }) => react_jsx_runtime.JSX.Element;
522
-
523
- type AuthCodeActivateCopy = {
524
- authCodeTitle?: string;
525
- authCodeDesc?: string;
526
- enterActiveCodeText?: string;
527
- authCodeContent?: string;
528
- authCodeReceiveText?: string;
529
- sendAgainText?: string;
530
- buttonText?: string;
531
- note?: string;
532
- codeEmptyError?: string;
533
- incorrectCodeError?: string;
534
- retrieveText?: string;
535
- authSuccessMessage?: string;
536
- sendEmailSuccessMessage?: string;
537
- sendEmailErrorMessage?: string;
538
- beenActivatedMessage?: string;
539
- invalidCodeMessage?: string;
540
- expiredCodeMessage?: string;
541
- };
542
- type AuthCodeActivateProps = {
543
- copy: AuthCodeActivateCopy;
544
- };
545
-
546
- declare const AuthCodeActivate: React__default.FC<AuthCodeActivateProps>;
547
-
548
- interface RegistrationContextType {
549
- email?: string;
550
- copy?: any;
551
- authCodeActivate: {
552
- isOpen: boolean;
553
- open: () => void;
554
- close: () => void;
555
- isActivateSuccess: boolean;
556
- activeToken?: string;
557
- onAuthSuccess: (() => void) | undefined;
558
- isSendingActivateEmail: boolean;
559
- setIsSendingActivateEmail: Dispatch<SetStateAction<boolean>>;
560
- setActiveToken: Dispatch<SetStateAction<string | undefined>>;
561
- setIsActivateSuccess: Dispatch<SetStateAction<boolean>>;
562
- setOnAuthSuccess: Dispatch<SetStateAction<(() => void) | undefined>>;
563
- autoSendEmail: boolean;
564
- setAutoSendEmail: Dispatch<SetStateAction<boolean>>;
565
- };
566
- }
567
- declare const RegistrationContext: React$1.Context<RegistrationContextType>;
568
- declare const useRegistration: () => RegistrationContextType;
569
- declare const RegistrationProvider: ({ children, email, copy }: PropsWithChildren<{
570
- email?: string;
571
- copy?: any;
572
- }>) => react_jsx_runtime.JSX.Element;
573
-
574
- type MessageRole = 'user' | 'assistant' | 'system' | 'tool';
575
- interface MessageMetadata {
576
- tokenUsage?: {
577
- inputTokens: number;
578
- outputTokens: number;
579
- };
580
- toolCalls?: Array<{
581
- id: string;
582
- type: string;
583
- name: string;
584
- }>;
585
- }
586
- interface Message {
587
- id: string;
588
- sessionId?: string;
589
- role: MessageRole;
590
- content: MessageContent[];
591
- timestamp: number;
592
- metadata?: MessageMetadata;
593
- structured_content?: Array<{
594
- type: string;
595
- data: any;
596
- }>;
597
- }
598
- type MessageContentType = 'text' | 'product_card' | 'product_list' | 'product_comparison' | 'policy' | 'quick_replies' | 'thinking' | 'error' | 'faq_list' | 'cart';
599
- type MessageContent = TextContent | ProductCardContent | ProductListContent | ProductComparisonContent | PolicyContent | QuickRepliesContent | ThinkingContent | ErrorContent | FAQListContent | PromotionListContent | CartContent;
600
- interface TextContent {
601
- type: 'text';
602
- text: string;
603
- }
604
- interface ProductCardContent {
605
- type: 'product_card';
606
- data: {
607
- product?: Product;
608
- rawProduct?: any;
609
- productHandle: string;
610
- onAddToCart?: (product: Product) => void;
611
- productCardRender?: (product: any, productHandle: string) => React.ReactNode;
612
- };
613
- }
614
- interface ProductListContent {
615
- type: 'product_list';
616
- data: {
617
- products: Product[];
618
- title?: string;
619
- onAddToCart?: (product: Product) => void;
620
- commonText?: CommonText;
621
- };
622
- }
623
- interface ProductComparisonContent {
624
- type: 'product_comparison';
625
- data: {
626
- products: Product[];
627
- dimensions: {
628
- price?: {
629
- label: string;
630
- values: Array<{
631
- product_id: string;
632
- min: number;
633
- max: number;
634
- currency: string;
635
- has_discount: boolean;
636
- }>;
637
- };
638
- variants?: {
639
- label: string;
640
- values: Array<{
641
- product_id: string;
642
- count: number;
643
- }>;
644
- };
645
- member_price?: {
646
- label: string;
647
- values: Array<{
648
- product_id: string;
649
- available: boolean;
650
- min: number;
651
- max: number;
652
- currency: string;
653
- }>;
654
- };
655
- discount?: {
656
- label: string;
657
- values: Array<{
658
- product_id: string;
659
- has_discount: boolean;
660
- }>;
661
- };
662
- [key: string]: any;
663
- };
664
- onAddToCart?: (product: Product) => void;
665
- commonText?: CommonText;
666
- };
667
- }
668
- interface PolicyContent {
669
- type: 'policy';
670
- data: {
671
- title: string;
672
- content: string;
673
- };
674
- }
675
- interface QuickRepliesContent {
676
- type: 'quick_replies';
677
- data: {
678
- replies: QuickReply[];
679
- };
680
- }
681
- interface ThinkingContent {
682
- type: 'thinking';
683
- data: {
684
- status: string;
685
- };
686
- }
687
- interface ErrorContent {
688
- type: 'error';
689
- data: {
690
- message: string;
691
- code?: string;
692
- };
693
- }
694
- interface FAQListContent {
695
- type: 'faq_list';
696
- data: {
697
- found: boolean;
698
- count: number;
699
- total?: number;
700
- results: FAQItem[];
701
- };
702
- }
703
- interface PromotionListContent {
704
- type: 'promotion_list';
705
- data: {
706
- found: boolean;
707
- count: number;
708
- total?: number;
709
- results: PromotionItem[];
710
- commonText?: CommonText;
711
- };
712
- }
713
- type FAQCategory = 'shipping' | 'return' | 'product' | 'payment' | 'general';
714
- interface FAQItem {
715
- id: string;
716
- question: string;
717
- answer: string;
718
- category: FAQCategory;
719
- keywords?: string[];
720
- relatedQuestions?: string[];
721
- metadata?: {
722
- language?: string;
723
- priority?: number;
724
- lastUpdated?: string;
725
- };
726
- }
727
- interface PromotionItem {
728
- id: string;
729
- title: string;
730
- subtitle?: string;
731
- description?: string;
732
- banner_url?: string;
733
- url?: string;
734
- time_range: {
735
- start: string;
736
- end?: string | null;
737
- is_active: boolean;
738
- };
739
- priority?: number;
740
- product_count?: number;
741
- metadata?: {
742
- display_order?: number;
743
- target_audience?: string;
744
- };
745
- }
746
- type StockStatus = 'in_stock' | 'low_stock' | 'out_of_stock';
747
- interface Price {
748
- amount: number;
749
- currency: string;
750
- }
751
- interface PriceRange {
752
- min: number;
753
- max: number;
754
- currency: string;
755
- }
756
- interface VariantDiscount {
757
- has_discount: boolean;
758
- discount_price?: number;
759
- discount_code?: string;
760
- discount_percentage?: number;
761
- /** 折扣类型:fixed_amount 固定金额折扣,percentage 百分比折扣 */
762
- discount_type?: 'fixed_amount' | 'percentage';
763
- /** 折扣数值(可能是字符串或数字) */
764
- discount_value?: string | number;
765
- }
766
- interface VariantMemberPrice {
767
- has_member_price: boolean;
768
- price?: number;
769
- }
770
- interface ProductFeatures {
771
- is_new?: boolean;
772
- has_rental?: boolean;
773
- has_presale?: boolean;
774
- has_member_price?: boolean;
775
- has_discount?: boolean;
776
- }
777
- interface Variant {
778
- id: string;
779
- title: string;
780
- sku?: string;
781
- price?: Price;
782
- availableForSale: boolean;
783
- color?: string;
784
- discount?: VariantDiscount;
785
- memberPrice?: VariantMemberPrice;
786
- inventoryQuantity?: number;
787
- option1?: string;
788
- option2?: string;
789
- option3?: string;
790
- }
791
- interface Product {
792
- shopifyId: string;
793
- sku?: string;
794
- handle: string;
795
- title: string;
796
- description?: string;
797
- vendor?: string;
798
- price: Price;
799
- priceRange?: PriceRange;
800
- memberPriceRange?: PriceRange;
801
- imageUrl: string;
802
- productUrl: string;
803
- stockStatus: StockStatus;
804
- hotScore?: number;
805
- averageRating?: number;
806
- reviewCount?: number;
807
- variants?: Variant[];
808
- variantCount?: number;
809
- availableCount?: number;
810
- features?: ProductFeatures;
811
- tags?: string[];
812
- }
813
- interface QuickReply {
814
- id: string;
815
- label: string;
816
- value: string;
817
- icon?: string;
818
- }
819
- /**
820
- * 购物车金额信息
821
- */
822
- interface CartAmount {
823
- /** 金额字符串(如 "99.99") */
824
- amount: string;
825
- /** 货币代码(如 "USD") */
826
- currencyCode: string;
827
- }
828
- /**
829
- * 购物车价格汇总
830
- */
831
- interface CartCost {
832
- /** 应付总价(已应用折扣) */
833
- totalAmount: CartAmount;
834
- /** 原价小计(未应用折扣) */
835
- subtotalAmount: CartAmount;
836
- }
837
- /**
838
- * 购物车商品变体信息
839
- */
840
- interface CartMerchandise {
841
- /** 变体 ID (Shopify ProductVariant GID) */
842
- id: string;
843
- /** 变体标题(如 "Black", "Large" 等) */
844
- title: string;
845
- /** 单价 */
846
- price: CartAmount;
847
- /** 商品图片 URL */
848
- image?: {
849
- url: string;
850
- altText?: string;
851
- };
852
- /** 关联的商品信息 */
853
- product: {
854
- /** 商品 ID */
855
- id: string;
856
- /** 商品标题 */
857
- title: string;
858
- /** 商品 handle */
859
- handle: string;
860
- };
861
- }
862
- /**
863
- * 购物车商品行
864
- */
865
- interface CartLine {
866
- /** 购物车行 ID (用于更新/删除操作) */
867
- id: string;
868
- /** 商品数量 */
869
- quantity: number;
870
- /** 价格信息 */
871
- cost: {
872
- /** 行总价(单价 × 数量,已应用折扣) */
873
- totalAmount: CartAmount;
874
- /** 单价 */
875
- amountPerQuantity: CartAmount;
876
- /** 行小计(单价 × 数量,未应用折扣) */
877
- subtotalAmount: CartAmount;
878
- };
879
- /** 商品变体信息 */
880
- merchandise: CartMerchandise;
881
- /** 自定义属性(可选) */
882
- attributes?: Array<{
883
- key: string;
884
- value: string;
885
- }>;
886
- }
887
- /**
888
- * 购物车折扣码
889
- */
890
- interface CartDiscountCode {
891
- /** 折扣码 */
892
- code: string;
893
- /** 是否有效/适用 */
894
- applicable: boolean;
895
- }
896
- /**
897
- * 购物车数据
898
- */
899
- interface CartData {
900
- /** 购物车是否为空 */
901
- isEmpty: boolean;
902
- /** 购物车 ID (Shopify Cart GID) */
903
- cartId: string;
904
- /** 商品总数量 */
905
- totalQuantity: number;
906
- /** 商品列表 */
907
- lines: CartLine[];
908
- /** 价格汇总 */
909
- cost: CartCost;
910
- /** 折扣码列表 */
911
- discountCodes?: CartDiscountCode[];
912
- /** 结账页面 URL */
913
- checkoutUrl?: string;
914
- /** 购物车按钮回调函数 */
915
- onCart?: (cartId: string, checkoutUrl?: string) => void;
916
- /** 通用文案配置 */
917
- commonText?: CommonText;
918
- }
919
- /**
920
- * 购物车内容块
921
- */
922
- interface CartContent {
923
- type: 'cart';
924
- data: CartData;
925
- }
926
- type SSEEventType = 'message_start' | 'content_delta' | 'content_block' | 'message_end' | 'tool_start' | 'tool_end' | 'status' | 'error' | 'done';
927
- interface SSEEvent<T = any> {
928
- event: SSEEventType | null;
929
- data: T;
930
- }
931
- /**
932
- * 流式对话请求参数
933
- */
934
- interface ChatStreamRequest {
935
- /** 用户的消息文本 */
936
- message: string;
937
- /** 用户标识符 */
938
- user_id: string;
939
- /** 来自 new-session 端点的会话 ID */
940
- session_id: string;
941
- /** 可选的上下文信息 */
942
- context?: {
943
- /** 用于购物车操作的 Shopify 购物车 ID */
944
- cartId?: string;
945
- /** Storefront API 访问令牌 */
946
- accessToken?: string;
947
- /** 已登录用户的 ID */
948
- real_user_id?: string;
949
- };
950
- }
951
- /**
952
- * 通用文案配置
953
- * 用于自定义组件中的按钮文案
954
- */
955
- interface CommonText {
956
- /**
957
- * 产品列表展开按钮文案
958
- * @default "Learn More"
959
- */
960
- learnMore?: string;
961
- /**
962
- * 产品列表收起按钮文案
963
- * @default "Show Less"
964
- */
965
- showLess?: string;
966
- /**
967
- * 添加到购物车按钮文案
968
- * @default "Add to Cart"
969
- */
970
- addToCart?: string;
971
- /**
972
- * 查看购物车/更多按钮文案
973
- * @default "View More"
974
- */
975
- viewMore?: string;
976
- /**
977
- * 折扣标签后缀文案(如 "20% OFF" 中的 "OFF")
978
- * @default "OFF"
979
- */
980
- off?: string;
981
- /**
982
- * 购物车总计文案
983
- * @default "Total"
984
- */
985
- total?: string;
986
- }
987
- /**
988
- * 法规协议弹窗配置
989
- */
990
- interface ComplianceDialogConfig {
991
- /**
992
- * 弹窗标题
993
- * @example "Hi! I'm your eufy AI assistant."
994
- */
995
- title: string;
996
- /**
997
- * 弹窗内容文本(支持 HTML)
998
- * @example "AI-generated responses can be inaccurate. Please verify important info. Do not input sensitive personal data"
999
- */
1000
- content: string;
1001
- /**
1002
- * 勾选框文本(支持完整 HTML,包括链接)
1003
- * 可以直接包含 <a> 标签等 HTML 元素
1004
- * @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>."
1005
- */
1006
- checkboxText: string;
1007
- /**
1008
- * 同意按钮文本
1009
- * @default "Agree"
1010
- */
1011
- agreeButtonText?: string;
1012
- /**
1013
- * Cookie 名称,用于记录用户同意状态
1014
- * Cookie 有效期为 365 天
1015
- * @default "livechat_compliance_agreed"
1016
- */
1017
- cookieName?: string;
1018
- }
1019
- interface LiveChatWidgetProps {
1020
- /**
1021
- * API 基础 URL
1022
- * @example "https://beta-api-livechat.anker.com"
1023
- */
1024
- apiBaseUrl: string;
1025
- /**
1026
- * 自定义请求头
1027
- * 将在所有 API 请求中添加这些请求头
1028
- * @example { "Authorization": "Bearer token", "X-Custom-Header": "value" }
1029
- */
1030
- headers?: Record<string, string>;
1031
- /**
1032
- * reCAPTCHA site key
1033
- * 提供此参数将自动启用 reCAPTCHA v3 验证
1034
- * @example "6LfS4J4pAAAAACX1e_WrxutmxxzCK7FU4WzVqL14"
1035
- */
1036
- recaptchaSitekey?: string;
1037
- /**
1038
- * reCAPTCHA action 前缀
1039
- * 实际使用时会根据不同接口添加后缀(如 chat_stream, new_session)
1040
- * @default "livechat"
1041
- */
1042
- recaptchaAction?: string;
1043
- /**
1044
- * Shopify 店铺域名
1045
- * @example "www.eufy.com"
1046
- */
1047
- site?: string;
1048
- /**
1049
- * 渠道编码
1050
- * 用于标识来源渠道
1051
- * @example "web_homepage"
1052
- */
1053
- channelCode?: string;
1054
- /**
1055
- * 已登录用户的 ID(可选)
1056
- * 如果提供,将在 API 请求中传递
1057
- */
1058
- loginUserId?: string;
1059
- /**
1060
- * Shopify 购物车 ID(可选)
1061
- * 用于购物车操作,将在 stream 接口的 context 中传递
1062
- * @example "gid://shopify/Cart/Z2NwLXVzLWVhc3QxOjAxSkZH..."
1063
- */
1064
- cartId?: string;
1065
- /**
1066
- * Storefront API 访问令牌(可选)
1067
- * 用于购物车操作,将在 stream 接口的 context 中传递
1068
- */
1069
- accessToken?: string;
1070
- /**
1071
- * 气泡按钮位置
1072
- * 自定义位置对象:{ top?: string, bottom?: string, left?: string, right?: string }
1073
- * @default { bottom: "1.5rem", right: "1.5rem" }
1074
- * @example
1075
- * // 自定义位置
1076
- * position={{ bottom: "20px", right: "30px" }}
1077
- * position={{ top: "100px", left: "50px" }}
1078
- */
1079
- position?: BubblePosition;
1080
- /**
1081
- * 欢迎消息
1082
- */
1083
- welcomeMessage?: string;
1084
- /**
1085
- * 初始快捷回复按钮
1086
- */
1087
- quickReplies?: QuickReply[];
1088
- /**
1089
- * 自定义消息渲染器
1090
- */
1091
- customRenderers?: Record<string, MessageRenderer>;
1092
- /**
1093
- * Logo URL
1094
- */
1095
- logoUrl?: string;
1096
- /**
1097
- * 聊天窗口标题
1098
- * @default "AI 助手"
1099
- */
1100
- title?: string;
1101
- /**
1102
- * 聊天气泡按钮图标(图片 URL)
1103
- * 如果提供,将使用图片替代默认的 SVG 图标
1104
- */
1105
- chatBubbleIcon?: string;
1106
- /**
1107
- * 受控模式:是否打开聊天窗口
1108
- * 提供此参数时,组件将处于受控模式
1109
- * @example
1110
- * ```tsx
1111
- * const [isOpen, setIsOpen] = useState(false)
1112
- * <LiveChatWidget open={isOpen} onOpenChange={setIsOpen} />
1113
- * ```
1114
- */
1115
- open?: boolean;
1116
- /**
1117
- * 受控模式:打开/关闭状态变化回调
1118
- * 【必需】配合 `open` 使用,用于同步状态到父组件
1119
- * 当用户点击打开或关闭按钮时触发
1120
- * @example
1121
- * ```tsx
1122
- * <LiveChatWidget
1123
- * open={isOpen}
1124
- * onOpenChange={setIsOpen} // 必需:同步状态
1125
- * />
1126
- * ```
1127
- */
1128
- onOpenChange?: (open: boolean) => void;
1129
- /**
1130
- * 【可选】窗口打开事件监听
1131
- * 用于埋点、日志等副作用,不影响状态控制
1132
- * 在 onOpenChange 之后触发
1133
- * @example
1134
- * ```tsx
1135
- * <LiveChatWidget
1136
- * open={isOpen}
1137
- * onOpenChange={setIsOpen}
1138
- * onOpen={() => trackEvent('chat_opened')} // 可选:埋点
1139
- * />
1140
- * ```
1141
- */
1142
- onOpen?: () => void;
1143
- /**
1144
- * 【可选】窗口关闭事件监听
1145
- * 用于埋点、日志等副作用,不影响状态控制
1146
- * 在 onOpenChange 之后触发
1147
- * @example
1148
- * ```tsx
1149
- * <LiveChatWidget
1150
- * open={isOpen}
1151
- * onOpenChange={setIsOpen}
1152
- * onClose={() => trackEvent('chat_closed')} // 可选:埋点
1153
- * />
1154
- * ```
1155
- */
1156
- onClose?: () => void;
1157
- onMessageSend?: (message: string) => void;
1158
- onError?: (error: Error) => void;
1159
- /**
1160
- * AI 消息回调
1161
- */
1162
- /**
1163
- * AI 回复文本消息时触发
1164
- */
1165
- onTextMessage?: () => void;
1166
- /**
1167
- * AI 回复商品列表卡片时触发
1168
- */
1169
- onProductList?: () => void;
1170
- /**
1171
- * AI 回复促销卡片时触发
1172
- * @param promotions 促销活动数组数据
1173
- */
1174
- onPromotionList?: (promotions: PromotionItem[]) => void;
1175
- /**
1176
- * 商品操作回调
1177
- */
1178
- onAddToCart?: (product: Product) => void;
1179
- /**
1180
- * 购物车按钮点击回调
1181
- */
1182
- onCart?: (cartId: string, checkoutUrl?: string) => void;
1183
- /**
1184
- * 是否显示新会话按钮
1185
- * @default true
1186
- */
1187
- showNewSessionButton?: boolean;
1188
- /**
1189
- * 通用文案配置
1190
- * 用于自定义按钮文案
1191
- */
1192
- commonText?: CommonText;
1193
- /**
1194
- * 自定义产品卡片渲染函数
1195
- * 用于自定义渲染 product_card 类型的产品卡片
1196
- * 当提供此函数时,将替代默认的产品卡片渲染逻辑
1197
- * @param product 原始后端产品数据(未经转换的数据),如果在 product_list 中找不到则为 undefined
1198
- * @param productHandle 文本占位符中的产品 ID(如 {{product:ID}} 中的 ID),可用于应用层查询产品数据
1199
- * @returns React 可渲染的内容
1200
- * @example
1201
- * ```tsx
1202
- * <LiveChatWidget
1203
- * productCardRender={(product, productHandle) => {
1204
- * // product 可能为 undefined,此时可用 productHandle 查询产品
1205
- * if (!product) {
1206
- * return <ProductCardByHandle handle={productHandle} />
1207
- * }
1208
- * return (
1209
- * <div>
1210
- * <h3>{product.title}</h3>
1211
- * <p>{product.price_range?.min}</p>
1212
- * </div>
1213
- * )
1214
- * }}
1215
- * />
1216
- * ```
1217
- */
1218
- productCardRender?: (product: any, productHandle: string) => React.ReactNode;
1219
- /**
1220
- * 输入框底部提示文本
1221
- * 不传入则不显示
1222
- */
1223
- bottomTips?: string;
1224
- /**
1225
- * 法规协议弹窗配置
1226
- * 提供此参数将在用户首次点击聊天气泡时显示法规协议弹窗
1227
- * 用户同意后才会打开聊天窗口
1228
- */
1229
- complianceConfig?: ComplianceDialogConfig;
1230
- }
1231
- interface MessageRenderer {
1232
- render: (content: MessageContent, isUser: boolean, isSystem: boolean) => React.ReactNode;
1233
- }
1234
- interface PositionStyles {
1235
- bottom?: string;
1236
- top?: string;
1237
- left?: string;
1238
- right?: string;
1239
- }
1240
- type BubblePosition = PositionStyles;
1241
-
1242
- /**
1243
- * LiveChat 主组件
1244
- * 集成所有子组件,提供完整的聊天功能
1245
- * 基于 specs/livechat-widget/plan.md 的三层架构设计
1246
- */
1247
-
1248
- /**
1249
- * LiveChat 聊天组件
1250
- *
1251
- * 功能:
1252
- * - 气泡弹窗聊天界面
1253
- * - SSE 流式消息接收
1254
- * - 会话管理(userId, sessionId)
1255
- * - 历史消息加载
1256
- * - 多种消息类型渲染
1257
- * - 自定义扩展机制
1258
- * - reCAPTCHA v3 安全防护
1259
- *
1260
- * 架构:
1261
- * - UI Layer: ChatBubble, ChatWindow, MessageList, etc.
1262
- * - Logic Layer: useChatState, useChatAPI, useSession
1263
- * - Core Layer: MessageRendererRegistry, 自定义渲染器
1264
- *
1265
- * @example
1266
- * ```tsx
1267
- * // 基础使用(使用默认位置)
1268
- * <LiveChatWidget
1269
- * apiBaseUrl="https://beta-api-livechat.anker.com"
1270
- * site="www.eufy.com"
1271
- * welcomeMessage="你好!我是 AI 助手"
1272
- * onMessageSend={(msg) => console.log('Sent:', msg)}
1273
- * />
1274
- *
1275
- * // 使用自定义位置
1276
- * <LiveChatWidget
1277
- * apiBaseUrl="https://beta-api-livechat.anker.com"
1278
- * site="www.eufy.com"
1279
- * position={{ bottom: "20px", right: "30px" }}
1280
- * onMessageSend={(msg) => console.log('Sent:', msg)}
1281
- * />
1282
- *
1283
- * // 启用 reCAPTCHA v3 安全防护(提供 sitekey 即自动启用)
1284
- * <LiveChatWidget
1285
- * apiBaseUrl="https://beta-api-livechat.anker.com"
1286
- * site="www.eufy.com"
1287
- * recaptchaSitekey="6LfS4J4pAAAAACX1e_WrxutmxxzCK7FU4WzVqL14"
1288
- * recaptchaAction="livechat"
1289
- * />
1290
- *
1291
- * // 使用自定义 headers 和 reCAPTCHA
1292
- * <LiveChatWidget
1293
- * apiBaseUrl="https://beta-api-livechat.anker.com"
1294
- * site="www.eufy.com"
1295
- * headers={{
1296
- * "Authorization": "Bearer your-token",
1297
- * "X-Custom-Header": "value"
1298
- * }}
1299
- * recaptchaSitekey="your-site-key"
1300
- * />
1301
- * ```
1302
- */
1303
- declare const LiveChatWidget: React__default.FC<LiveChatWidgetProps>;
1304
-
1305
- type RedeemableItemConfig = {
1306
- title: string;
1307
- desc: string;
1308
- price: number;
1309
- credit: string;
1310
- rules: string;
1311
- image: {
1312
- url: string;
1313
- };
1314
- mobileImage: {
1315
- url: string;
1316
- };
1317
- redeemId: number;
1318
- };
1319
- type TabConfig = {
1320
- label: string;
1321
- type: 'memberPrice' | 'redeem';
1322
- };
1323
- type CreditsMemberPriceCopy = {
1324
- title: string;
1325
- tabs: TabConfig[];
1326
- memberPriceTab: {
1327
- memberPriceRuleId: string;
1328
- addToCart: string;
1329
- shopNowText: string;
1330
- memberPriceLabel: string;
1331
- badgeLabel?: string;
1332
- };
1333
- redeemTab: {
1334
- list: (RedeemableItemConfig & {
1335
- products: {
1336
- handle: string;
1337
- sku: string;
1338
- }[];
1339
- })[];
1340
- soldOut: string;
1341
- unlockRewards: string;
1342
- btnRedeem: string;
1343
- off: string;
1344
- badgeLabel?: string;
1345
- };
1346
- };
1347
-
1348
- type NavigationItem = {
1349
- label: string;
1350
- targetId: string;
1351
- };
1352
- type CreditsNavigationCopy = {
1353
- items: NavigationItem[];
1354
- };
1355
-
1356
- declare enum ComponentKey {
1357
- Navigation = "creditsNavigation",
1358
- Banner = "creditsBanner",
1359
- InfoCard = "creditsInfoCard",
1360
- Benefits = "creditsBenefits",
1361
- WaysToGetCredits = "creditsWaysToGetCredits",
1362
- AnkersolixTask = "creditsAnkersolixTask",
1363
- RedeemList = "creditsRedeemList",
1364
- SpendCreditsLikeCash = "creditsCash",
1365
- MemberPrice = "creditsMemberPrice",
1366
- Faqs = "creditsFaq"
1367
- }
1368
- type CreditsTemplateProps = {
1369
- headlessConfig: HeadlessConfig;
1370
- siteConfig: {
1371
- registrationsSettings: {
1372
- authCodeActivate: AuthCodeActivateCopy;
1373
- };
1374
- taskIdToTypeMapping: Record<string, DTC_TASK_TYPE>;
1375
- memberPriceDiscount?: FunctionMemberPriceConfig[];
1376
- };
1377
- creditsConfig?: {
1378
- alpcBrand?: string;
1379
- };
1380
- pageConfig: {
1381
- order: ComponentKey[];
1382
- common: CreditsPageCommon;
1383
- components: {
1384
- [ComponentKey.Navigation]?: CreditsNavigationCopy;
1385
- [ComponentKey.Banner]?: CreditsBannerCopy;
1386
- [ComponentKey.InfoCard]?: CreditsInfoCardCopy;
1387
- [ComponentKey.Benefits]?: CreditsBenefitsCopy;
1388
- [ComponentKey.WaysToGetCredits]?: CreditsWaysToGetCreditsCopy;
1389
- [ComponentKey.AnkersolixTask]?: CreditsWaysToGetCreditsCopy;
1390
- [ComponentKey.RedeemList]?: CreditsRedeemListCopy;
1391
- [ComponentKey.SpendCreditsLikeCash]?: CreditsCashCopy;
1392
- [ComponentKey.MemberPrice]?: CreditsMemberPriceCopy;
1393
- [ComponentKey.Faqs]?: CreditsFaqCopy;
1394
- };
1395
- };
1396
- userContext: {
1397
- profile: any;
1398
- removeProfile: () => void;
1399
- isLoadingProfile: boolean;
1400
- creditInfo: any;
1401
- customer: any;
1402
- customerLoading: boolean;
1403
- fetchCreditInfo: () => void;
1404
- };
1405
- registrationContext: {
1406
- openSignUpPopup: () => void;
1407
- openSignInPopup: () => void;
1408
- };
1409
- gtm: {
1410
- pageGroup: string;
1411
- pageHandle?: string;
1412
- };
1413
- cartConfig?: {
1414
- addToCart: (params: {
1415
- variantList: Array<{
1416
- variant: any;
1417
- quantity: number;
1418
- attributes?: Array<{
1419
- key: string;
1420
- value: string;
1421
- }>;
1422
- }>;
1423
- cartAttributes?: Record<string, string>;
1424
- discountCodes?: string[];
1425
- }) => void | Promise<any>;
1426
- };
1427
- };
1428
- declare const CreditsTemplate: ({ headlessConfig, siteConfig, creditsConfig, userContext, pageConfig, registrationContext, gtm, cartConfig, }: CreditsTemplateProps) => react_jsx_runtime.JSX.Element;
1429
-
1430
- declare const ROUNDED_BRANDS: string[];
1431
-
1432
- export { AuthCodeActivate, Chat, type ChatStreamRequest, ComponentKey, CreditsBanner, CreditsBenefits, CreditsCash, CreditsFaq, CreditsInfoCard, CreditsProvider, CreditsRedeemList, CreditsTemplate, type CreditsTemplateProps, CreditsUploadReceiptModal, CreditsWaysToGetCredits, type ErrorContent, LiveChatWidget, type LiveChatWidgetProps, type Message, type MessageContent, type MessageContentType, type MessageMetadata, type MessageRenderer, type MessageRole, type PolicyContent, type ProductCardContent, type ProductListContent, type QuickRepliesContent, type QuickReply, ROUNDED_BRANDS, RegistrationContext, RegistrationProvider, type SSEEvent, type ThinkingContent, useCreditsContext, useUploadReceipt as useCreditsUploadReceipt, useRegistration };