@tbox.cn/app-module-promotion 0.10.8 → 1.0.0-alpha.6

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.
@@ -0,0 +1,1368 @@
1
+ // src/client/cards/promotion-offer-list/index.tsx
2
+ import { CalendarBlank, CalendarDots, CaretDown, Lightbulb, MapPin, Sparkle, Ticket } from "@phosphor-icons/react";
3
+ import { useEffect as useEffect2, useLayoutEffect, useRef as useRef2, useState as useState3 } from "react";
4
+ import { ItemActionsRow, markSelfRendering, navigateToAlipayPage, sendCardAction } from "@tbox.cn/app-agent-sdk-client";
5
+
6
+ // src/client/components/CouponSheet.tsx
7
+ import { X } from "@phosphor-icons/react";
8
+ import { useCallback, useEffect, useRef, useState as useState2 } from "react";
9
+ import { createPortal } from "react-dom";
10
+
11
+ // src/client/components/ImageWithFallback.tsx
12
+ import { useState } from "react";
13
+ import { ImageSquare } from "@phosphor-icons/react";
14
+ import { jsx } from "react/jsx-runtime";
15
+ function ImageWithFallback(props) {
16
+ const { src, alt, className, size = 40 } = props;
17
+ const [failed, setFailed] = useState(false);
18
+ if (!src || failed) {
19
+ return /* @__PURE__ */ jsx(
20
+ "div",
21
+ {
22
+ className: `img-fallback promotion-image--fallback grid place-items-center bg-[#f1f2f4] text-[rgba(11,15,23,0.26)] ${className ?? ""}`.trim(),
23
+ "aria-label": alt,
24
+ role: "img",
25
+ children: /* @__PURE__ */ jsx(ImageSquare, { weight: "duotone", size: Math.round(size * 0.45) })
26
+ }
27
+ );
28
+ }
29
+ return /* @__PURE__ */ jsx(
30
+ "img",
31
+ {
32
+ className,
33
+ src,
34
+ alt,
35
+ loading: "eager",
36
+ decoding: "async",
37
+ referrerPolicy: "no-referrer",
38
+ onError: () => setFailed(true)
39
+ }
40
+ );
41
+ }
42
+
43
+ // src/client/utils/sanitize-activity-html.ts
44
+ var DROP_TAGS = /* @__PURE__ */ new Set([
45
+ "script",
46
+ "iframe",
47
+ "object",
48
+ "embed",
49
+ "style",
50
+ "link",
51
+ "meta",
52
+ "base",
53
+ "form",
54
+ "input",
55
+ "svg",
56
+ "math"
57
+ ]);
58
+ var URL_ATTRS = /* @__PURE__ */ new Set(["href", "src", "xlink:href", "formaction", "action", "poster", "background"]);
59
+ function sanitizeActivityHtml(html) {
60
+ if (typeof DOMParser === "undefined") return "";
61
+ const doc = new DOMParser().parseFromString(html, "text/html");
62
+ const walk = (node) => {
63
+ for (const child of [...node.children]) {
64
+ if (DROP_TAGS.has(child.tagName.toLowerCase())) {
65
+ child.remove();
66
+ continue;
67
+ }
68
+ for (const attr of [...child.attributes]) {
69
+ const name = attr.name.toLowerCase();
70
+ if (name.startsWith("on")) {
71
+ child.removeAttribute(attr.name);
72
+ continue;
73
+ }
74
+ if (URL_ATTRS.has(name)) {
75
+ const value = attr.value.trim().toLowerCase();
76
+ const isJs = value.startsWith("javascript:");
77
+ const isData = value.startsWith("data:") && !value.startsWith("data:image/");
78
+ if (isJs || isData) child.removeAttribute(attr.name);
79
+ }
80
+ }
81
+ walk(child);
82
+ }
83
+ };
84
+ walk(doc.body);
85
+ return doc.body.innerHTML;
86
+ }
87
+
88
+ // src/client/components/CouponSheet.tsx
89
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
90
+ function CouponSheet(props) {
91
+ const { title, imageUrl, imageFit = "contain", subtitle, noticeText, guaranteeText, priceMain, priceOriginal, aside, facts = [], beforeFacts, extra, foot, onClose } = props;
92
+ const [closing, setClosing] = useState2(false);
93
+ const closingRef = useRef(false);
94
+ const closeTimerRef = useRef();
95
+ const onCloseRef = useRef(onClose);
96
+ onCloseRef.current = onClose;
97
+ const finishClose = useCallback(() => {
98
+ if (!closingRef.current) return;
99
+ window.clearTimeout(closeTimerRef.current);
100
+ closingRef.current = false;
101
+ setClosing(false);
102
+ onCloseRef.current();
103
+ }, []);
104
+ const requestClose = useCallback(() => {
105
+ if (closingRef.current) return;
106
+ closingRef.current = true;
107
+ setClosing(true);
108
+ const reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches ?? false;
109
+ closeTimerRef.current = window.setTimeout(finishClose, reducedMotion ? 1 : 200);
110
+ }, [finishClose]);
111
+ useEffect(() => {
112
+ const onKey = (e) => {
113
+ if (e.key === "Escape") requestClose();
114
+ };
115
+ document.addEventListener("keydown", onKey);
116
+ return () => document.removeEventListener("keydown", onKey);
117
+ }, [requestClose]);
118
+ useEffect(() => () => window.clearTimeout(closeTimerRef.current), []);
119
+ return createPortal(
120
+ /* @__PURE__ */ jsx2(
121
+ "div",
122
+ {
123
+ className: `promotion-sheet fixed inset-0 z-[60] flex items-end justify-center bg-[rgba(11,15,23,0.42)] motion-reduce:animate-none ${closing ? "promotion-sheet--closing pointer-events-none animate-[promotion-sheet-out_180ms_ease-in_both]" : "animate-[promotion-sheet-in_180ms_ease-out]"}`,
124
+ role: "dialog",
125
+ "aria-modal": "true",
126
+ "aria-label": `${title} \u8BE6\u60C5`,
127
+ onAnimationEnd: (event) => {
128
+ if (closing && event.target === event.currentTarget) finishClose();
129
+ },
130
+ onMouseDown: (e) => {
131
+ if (e.target === e.currentTarget) requestClose();
132
+ },
133
+ children: /* @__PURE__ */ jsxs("div", { className: `promotion-sheet__panel relative flex max-h-[82vh] w-full max-w-[375px] flex-col rounded-t-[18px] bg-card motion-reduce:animate-none ${closing ? "animate-[promotion-sheet-down_180ms_ease-in_both]" : "animate-[promotion-sheet-up_220ms_cubic-bezier(0.22,1,0.36,1)]"}`, children: [
134
+ /* @__PURE__ */ jsx2("button", { type: "button", className: "promotion-sheet__close absolute top-3 right-3 z-[2] grid size-[30px] cursor-pointer place-items-center rounded-full border-0 bg-[rgba(11,15,23,0.42)] text-white [font-family:inherit]", "aria-label": "\u5173\u95ED\u8BE6\u60C5", onClick: requestClose, children: /* @__PURE__ */ jsx2(X, { size: 18, weight: "bold", "aria-hidden": "true" }) }),
135
+ /* @__PURE__ */ jsxs("div", { className: "promotion-sheet__scroll overflow-y-auto pb-1.5 [-webkit-overflow-scrolling:touch]", children: [
136
+ /* @__PURE__ */ jsx2(ImageWithFallback, { src: imageUrl, alt: title, className: imageFit === "cover" ? "promotion-sheet__image promotion-sheet__image--cover block h-[210px] w-full rounded-t-[18px] bg-[#f5f6f8] object-cover" : "promotion-sheet__image h-[210px] w-full rounded-t-[18px] bg-[#f5f6f8] object-contain" }),
137
+ (priceMain || aside) && /* @__PURE__ */ jsxs("div", { className: "promotion-sheet__price flex items-baseline gap-2 bg-[linear-gradient(180deg,#fdf1e8_0%,#fbe7d9_100%)] px-4 py-3", children: [
138
+ priceMain && /* @__PURE__ */ jsx2("b", { className: "text-2xl font-extrabold leading-[27px] text-[#e8471c]", children: priceMain }),
139
+ priceMain && priceOriginal && /* @__PURE__ */ jsx2("s", { className: "text-xs leading-[normal] text-[rgba(11,15,23,0.4)]", children: priceOriginal }),
140
+ aside && /* @__PURE__ */ jsx2("span", { className: "promotion-sheet__stock ml-auto text-xs leading-[normal] text-[rgba(11,15,23,0.55)]", children: aside })
141
+ ] }),
142
+ /* @__PURE__ */ jsx2("h4", { className: "promotion-sheet__title mx-4 mt-3.5 text-lg font-bold leading-[23px] text-[rgba(11,15,23,0.9)]", children: title }),
143
+ (noticeText || guaranteeText) && /* @__PURE__ */ jsxs("div", { className: "promotion-sheet__notice-strip mx-4 mt-3 grid gap-[3px] rounded-[5px] bg-[#fff8ef] px-[7px] py-1.5 text-sm leading-[19px]", children: [
144
+ noticeText && /* @__PURE__ */ jsxs("span", { className: "grid grid-cols-[72px_minmax(0,1fr)] gap-1.5", children: [
145
+ /* @__PURE__ */ jsx2("b", { className: "w-auto text-left text-[#b38a3e]", children: "\u987B\u77E5" }),
146
+ noticeText
147
+ ] }),
148
+ guaranteeText && /* @__PURE__ */ jsxs("span", { className: "grid grid-cols-[72px_minmax(0,1fr)] gap-1.5", children: [
149
+ /* @__PURE__ */ jsx2("b", { className: "w-auto text-left text-[#ef7654]", children: "\u4FDD\u969C" }),
150
+ guaranteeText
151
+ ] })
152
+ ] }),
153
+ subtitle && /* @__PURE__ */ jsx2("p", { className: "promotion-sheet__sub mx-4 mt-3 text-sm leading-[19px] text-[rgba(11,15,23,0.55)]", dangerouslySetInnerHTML: { __html: subtitle } }),
154
+ beforeFacts,
155
+ facts.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
156
+ /* @__PURE__ */ jsx2("div", { className: "promotion-sheet__section mx-4 mt-[17px] text-sm font-bold leading-5 text-[rgba(11,15,23,0.9)]", children: "\u4F7F\u7528\u987B\u77E5" }),
157
+ /* @__PURE__ */ jsx2("dl", { className: "promotion-sheet__facts mx-4 mt-2 rounded-[10px] bg-[#f7f8fa] px-3 py-[3px]", children: facts.map((f) => /* @__PURE__ */ jsxs("div", { className: "flex gap-1.5 border-b border-[#ecedf1] py-[11px] last:border-b-0", children: [
158
+ /* @__PURE__ */ jsxs("dt", { className: "flex w-[70px] shrink-0 items-center gap-[3.5px] text-xs leading-[17px] text-[rgba(11,15,23,0.55)]", children: [
159
+ f.icon,
160
+ f.label
161
+ ] }),
162
+ /* @__PURE__ */ jsx2("dd", { className: "text-sm leading-[19px] text-[rgba(11,15,23,0.85)] [overflow-wrap:anywhere]", dangerouslySetInnerHTML: { __html: sanitizeActivityHtml(f.value) } })
163
+ ] }, f.label)) })
164
+ ] }),
165
+ extra
166
+ ] }),
167
+ foot && /* @__PURE__ */ jsx2("div", { className: "promotion-sheet__foot flex items-center justify-between gap-3 border-t border-[#eef0f3] bg-card px-4 pt-[11px] pb-[calc(11px+env(safe-area-inset-bottom,0px))]", children: foot })
168
+ ] })
169
+ }
170
+ ),
171
+ document.body
172
+ );
173
+ }
174
+
175
+ // src/client/cards/view.ts
176
+ function offerTypeLabel(offerType) {
177
+ switch (offerType) {
178
+ case "COUPON":
179
+ return "\u4F18\u60E0\u5238";
180
+ case "BUNDLE":
181
+ return "\u7EC4\u5408\u5238";
182
+ case "PROMOTION":
183
+ return "\u4FC3\u9500";
184
+ case "ACTIVITY":
185
+ return "\u6D3B\u52A8";
186
+ case "GROUPON":
187
+ return "\u56E2\u8D2D";
188
+ default:
189
+ return "\u4F18\u60E0";
190
+ }
191
+ }
192
+ function entitlementStatusLabel(status) {
193
+ switch (status) {
194
+ case "EFFECTIVE":
195
+ return "\u53EF\u7528";
196
+ case "USED":
197
+ return "\u5DF2\u4F7F\u7528";
198
+ case "EXPIRED":
199
+ return "\u5DF2\u8FC7\u671F";
200
+ case "INVALID":
201
+ return "\u5DF2\u5931\u6548";
202
+ default:
203
+ return "\u672A\u77E5";
204
+ }
205
+ }
206
+
207
+ // src/client/utils/scroll-card-bottom.ts
208
+ var MIN_BOTTOM_GAP = 96;
209
+ function scrollCardBottom(anchor) {
210
+ const rootStyle = typeof document !== "undefined" ? getComputedStyle(document.documentElement) : void 0;
211
+ const reservedHeight = Number.parseFloat(rootStyle?.getPropertyValue("--tbox-chat-bottom-height") ?? "") || 0;
212
+ const bottomGap = Math.max(MIN_BOTTOM_GAP, reservedHeight + 24);
213
+ let scroller = anchor.parentElement;
214
+ while (scroller && scroller !== document.body) {
215
+ const style = getComputedStyle(scroller);
216
+ if (/(auto|scroll|overlay)/.test(style.overflowY) && scroller.scrollHeight > scroller.clientHeight) break;
217
+ scroller = scroller.parentElement;
218
+ }
219
+ if (!scroller || scroller === document.body) {
220
+ anchor.scrollIntoView?.({ behavior: "smooth", block: "end" });
221
+ return;
222
+ }
223
+ const anchorRect = anchor.getBoundingClientRect();
224
+ const scrollerRect = scroller.getBoundingClientRect();
225
+ scroller.scrollTo?.({
226
+ top: scroller.scrollTop + anchorRect.bottom - scrollerRect.bottom + bottomGap,
227
+ behavior: "smooth"
228
+ });
229
+ }
230
+
231
+ // src/client/components/class-names.ts
232
+ var PROMOTION_STATUS_CLASS = "inline-flex flex-none items-center gap-[3px] whitespace-nowrap rounded-full px-[7px] py-1 text-xs font-bold not-italic leading-[normal]";
233
+ var PROMOTION_STATUS_TONE_CLASS = {
234
+ available: "bg-[#eaf8f1] text-[#128356]",
235
+ requires_action: "bg-[var(--tbox-domain-promotion-surface,#fff1f3)] text-[#a43d25]",
236
+ unavailable: "bg-[#f0f3f2] text-secondary-foreground",
237
+ unknown: "bg-[#f0f3f2] text-secondary-foreground"
238
+ };
239
+ var PROMOTION_CHIP_CLASS = "inline-flex h-5 w-auto min-w-[52px] cursor-pointer items-center justify-center rounded-full border border-[#d9e0ea] bg-[#f4f8ff] px-[7px] text-xs font-bold leading-none text-[#2368ec] [font-family:inherit] transition-[border-color,color,background-color] duration-[160ms] ease-[ease] after:ml-1 after:content-['\u2192'] after:text-xs after:leading-none hover:not-disabled:border-[#2368ec] hover:not-disabled:bg-[#2368ec] hover:not-disabled:text-white hover:not-disabled:shadow-[0_3px_8px_rgba(35,104,236,0.18)] focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-[rgba(255,111,31,0.22)] disabled:cursor-not-allowed disabled:opacity-45";
240
+ var PROMOTION_CHIP_ACTIVITY_CLASS = "inline-flex h-5 w-auto min-w-[52px] cursor-pointer items-center justify-center rounded-full border border-[#d9e0ea] bg-[#f4f8ff] px-[7px] text-xs font-bold leading-none text-[#2368ec] [font-family:inherit] transition-[border-color,color,background-color] duration-[160ms] ease-[ease] after:ml-1 after:content-['\u2192'] after:text-xs after:leading-none hover:not-disabled:border-[#2368ec] hover:not-disabled:bg-[#2368ec] hover:not-disabled:text-white hover:not-disabled:shadow-[0_3px_8px_rgba(35,104,236,0.18)] focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-[#0b8b70] disabled:cursor-not-allowed disabled:opacity-45";
241
+ var PROMOTION_CHIP_COUPON_CLASS = "inline-flex h-8 w-auto min-w-[48px] cursor-pointer items-center justify-center rounded-full border-0 bg-[linear-gradient(160deg,#c3ad78_0%,#a89058_100%)] px-[7.5px] text-xs font-bold leading-none tracking-[1px] text-white shadow-none [font-family:inherit] after:hidden hover:not-disabled:border-0 hover:not-disabled:bg-[linear-gradient(160deg,#b39d68_0%,#967f4a_100%)] hover:not-disabled:text-white hover:not-disabled:shadow-none focus-visible:outline-none focus-visible:shadow-[inset_0_0_0_3px_#fff,inset_0_0_0_6px_#5f101d] disabled:cursor-not-allowed disabled:opacity-45";
242
+ var PROMOTION_CHIP_COUPON_LG_CLASS = "inline-flex h-[42px] w-auto min-w-[120px] cursor-pointer items-center justify-center rounded-full border-0 bg-[linear-gradient(160deg,#c3ad78_0%,#a89058_100%)] px-[7.5px] text-sm font-bold leading-none tracking-[1px] text-white shadow-none [font-family:inherit] after:hidden hover:not-disabled:border-0 hover:not-disabled:bg-[linear-gradient(160deg,#b39d68_0%,#967f4a_100%)] hover:not-disabled:text-white hover:not-disabled:shadow-none focus-visible:outline-none focus-visible:shadow-[inset_0_0_0_3px_#fff,inset_0_0_0_6px_#5f101d] disabled:cursor-not-allowed disabled:opacity-45";
243
+ var PROMOTION_CHIP_COUPON_OFF_CLASS = "inline-flex h-8 w-auto min-w-[48px] items-center justify-center rounded-full border-0 bg-[#f5f5f7] px-[7.5px] text-xs font-bold leading-none tracking-[1px] text-[rgba(11,15,23,0.45)] shadow-[inset_0_0_0_1px_#e3e4e8] [font-family:inherit] after:hidden hover:not-disabled:bg-[#f5f5f7] hover:not-disabled:text-[rgba(11,15,23,0.45)] hover:not-disabled:shadow-[inset_0_0_0_1px_#e3e4e8] focus-visible:outline-none focus-visible:shadow-[inset_0_0_0_3px_#fff,inset_0_0_0_6px_#5f101d]";
244
+ var PROMOTION_ACTIVITY_STATUS_CLASS = "inline-flex items-center whitespace-nowrap rounded-full border border-[rgba(10,133,103,0.16)] bg-[rgba(235,250,244,0.92)] px-[6px] py-[3.5px] text-xs font-bold leading-3 text-[#08745f] backdrop-blur-[6px]";
245
+ var PROMOTION_ACTIVITY_STATUS_TONE_CLASS = {
246
+ full: "border-[rgba(80,91,87,0.12)] bg-[rgba(245,247,246,0.94)] text-[#687570]",
247
+ ended: "border-[rgba(80,91,87,0.12)] bg-[rgba(245,247,246,0.94)] text-[#687570]",
248
+ upcoming: "border-[rgba(184,134,46,0.18)] bg-[rgba(255,246,223,0.94)] text-[#92600e]"
249
+ };
250
+ var PROMOTION_CATEGORY_ICON_TONE_CLASS = {
251
+ 0: "text-[#08775f] bg-[#dff6ed]",
252
+ 1: "text-[#9b6814] bg-[#fff0cb]",
253
+ 2: "text-[#b44333] bg-[#ffebe7]",
254
+ 3: "text-[#0d7384] bg-[#e1f5f7]"
255
+ };
256
+
257
+ // src/client/cards/promotion-offer-list/index.tsx
258
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
259
+ var statusText = (status, claimable) => {
260
+ if (status === "REQUIRES_ACTION") return "\u9700\u64CD\u4F5C";
261
+ if (status === "UNKNOWN") return "\u5F85\u786E\u8BA4";
262
+ return claimable ? "\u53EF\u9886\u53D6" : "\u4E0D\u53EF\u9886";
263
+ };
264
+ var statusTone = (status, claimable) => status?.toLowerCase() ?? (claimable ? "available" : "unavailable");
265
+ var statusBadgeClass = (status, claimable) => {
266
+ const tone = statusTone(status, claimable);
267
+ return `promotion-status promotion-status--${tone} ${PROMOTION_STATUS_CLASS} ${PROMOTION_STATUS_TONE_CLASS[tone] ?? ""}`;
268
+ };
269
+ var PROMOTION_BUTTON_PRIMARY_CLASS = "flex h-[38px] w-full cursor-pointer items-center justify-center gap-1.5 rounded-[7px] border-0 bg-[#ee3347] mt-[11px] text-xs font-black leading-[normal] tracking-[1px] text-white [clip-path:polygon(12px_0,100%_0,calc(100%_-_12px)_100%,0_100%)] [font-family:'Kaiti_SC',STKaiti,KaiTi,serif] disabled:cursor-not-allowed disabled:opacity-50";
270
+ var couponSubtitleIsTime = (subtitle) => {
271
+ const plainText = subtitle.replace(/<[^>]+>/g, " ").replace(/&nbsp;/gi, " ");
272
+ return /\d{4}\s*[-/.年]\s*\d{1,2}\s*[-/.月]\s*\d{1,2}|\d{1,2}:\d{2}/.test(plainText);
273
+ };
274
+ var sheetImageFit = (offer) => offer.offerRef === "demo:coupon:1001" || offer.offerRef === "demo:groupon:2001" ? "cover" : "contain";
275
+ function PromotionOfferListCard(props) {
276
+ const { data, cardId = "", isHistory = false, actionTokens } = props;
277
+ const [openRef, setOpenRef] = useState3(null);
278
+ const [claimingRef, setClaimingRef] = useState3(null);
279
+ const [claimedRefs, setClaimedRefs] = useState3(() => /* @__PURE__ */ new Set());
280
+ const [expanded, setExpanded] = useState3(false);
281
+ const [listHeights, setListHeights] = useState3({ collapsed: 0, expanded: 0 });
282
+ const listRef = useRef2(null);
283
+ const bottomRef = useRef2(null);
284
+ const initialRenderRef = useRef2(true);
285
+ useEffect2(() => {
286
+ if (initialRenderRef.current) {
287
+ initialRenderRef.current = false;
288
+ return;
289
+ }
290
+ if (bottomRef.current) scrollCardBottom(bottomRef.current);
291
+ }, [expanded]);
292
+ useLayoutEffect(() => {
293
+ const list = listRef.current;
294
+ if (!list) return;
295
+ const rows = [...list.children];
296
+ const boundary = rows[Math.min(maxItems, rows.length) - 1];
297
+ const listTop = list.getBoundingClientRect().top;
298
+ const collapsed = boundary ? boundary.getBoundingClientRect().bottom - listTop : list.scrollHeight;
299
+ setListHeights({ collapsed, expanded: list.scrollHeight });
300
+ }, [data.items.length, data.maxItems]);
301
+ const toggleExpanded = () => {
302
+ setExpanded((value) => !value);
303
+ };
304
+ useEffect2(() => {
305
+ if (!cardId || typeof window === "undefined") return void 0;
306
+ const onNotice = (event) => {
307
+ const detail = event.detail;
308
+ if (!detail?.text || detail.surfaceId && detail.surfaceId !== cardId) return;
309
+ const ref = claimingRef;
310
+ if (!ref) return;
311
+ setClaimingRef(null);
312
+ if (detail.level === "success" || /领取成功|已存入卡包|已领取/.test(detail.text)) {
313
+ setClaimedRefs((current) => new Set(current).add(ref));
314
+ }
315
+ };
316
+ window.addEventListener("tbox:notice", onNotice);
317
+ return () => window.removeEventListener("tbox:notice", onNotice);
318
+ }, [cardId, claimingRef]);
319
+ if (data.presentation === "recommendation") {
320
+ const [offer, ...alternatives] = data.items;
321
+ if (!offer) return /* @__PURE__ */ jsx3(Empty, { text: data.noResultsReason ?? "\u6682\u672A\u627E\u5230\u5339\u914D\u5F53\u524D\u573A\u666F\u7684\u4F18\u60E0" });
322
+ return /* @__PURE__ */ jsxs2("section", { className: "promotion-card promotion-recommendation relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground pb-[15px]", "aria-label": "\u66F4\u9002\u5408\u4F60\u7684\u4F18\u60E0", children: [
323
+ /* @__PURE__ */ jsxs2("header", { className: "promotion-card__header flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-3 max-[380px]:px-[13px] min-[760px]:pt-[15px]", children: [
324
+ /* @__PURE__ */ jsx3("span", { className: "promotion-card__mark promotion-card__mark--violet grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(155,104,20,0.22)] bg-[#fff0cb] text-[#9b6814] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5", children: /* @__PURE__ */ jsx3(Sparkle, { weight: "fill" }) }),
325
+ /* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1", children: [
326
+ /* @__PURE__ */ jsx3("span", { className: "promotion-card__eyebrow mb-0.5 block text-xs font-bold leading-[14px] text-[#2368ec]", children: "\u667A\u80FD\u5339\u914D" }),
327
+ /* @__PURE__ */ jsx3("h3", { className: "text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base", children: "\u66F4\u9002\u5408\u4F60\u7684\u4F18\u60E0" }),
328
+ /* @__PURE__ */ jsx3("p", { className: "mt-0.5 truncate text-xs leading-4 text-secondary-foreground", children: "\u6839\u636E\u5F53\u524D\u53EF\u7528\u6027\u4E0E\u9884\u8BA1\u8282\u7701\u6392\u5E8F" })
329
+ ] })
330
+ ] }),
331
+ /* @__PURE__ */ jsxs2("div", { className: "promotion-recommendation__main mx-4 grid grid-cols-[70px_minmax(0,1fr)_auto] items-center gap-2.5 rounded-[8px] border border-[rgba(35,104,236,0.16)] bg-[#f5fbf8] p-[9px]", children: [
332
+ /* @__PURE__ */ jsx3(ImageWithFallback, { src: offer.imageUrl, alt: offer.title, className: "promotion-recommendation__image h-[62px] w-[70px] rounded-[7px] object-cover" }),
333
+ /* @__PURE__ */ jsxs2("div", { className: "grid min-w-0 gap-[3px]", children: [
334
+ /* @__PURE__ */ jsx3("span", { className: statusBadgeClass(offer.availabilityStatus, offer.claimable), children: statusText(offer.availabilityStatus, offer.claimable) }),
335
+ /* @__PURE__ */ jsx3("strong", { className: "truncate text-sm leading-[normal]", children: offer.title }),
336
+ /* @__PURE__ */ jsx3("small", { className: "truncate text-xs leading-[normal] text-secondary-foreground", children: offer.subtitle ?? offer.validityText ?? "\u5F53\u524D\u5546\u573A\u53EF\u7528" })
337
+ ] }),
338
+ /* @__PURE__ */ jsx3("em", { className: "text-lg font-extrabold not-italic leading-[normal] tabular-nums text-[var(--tbox-domain-promotion-accent,#e42f46)]", children: offer.benefitText ?? offerTypeLabel(offer.offerType) })
339
+ ] }),
340
+ /* @__PURE__ */ jsxs2("div", { className: "promotion-recommendation__reason mx-4 mt-2.5 flex items-start gap-[7px] rounded-[7px] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[normal] text-[#744333] [&_svg]:shrink-0 [&_svg]:text-[var(--tbox-domain-promotion-accent,#e42f46)]", children: [
341
+ /* @__PURE__ */ jsx3(Lightbulb, { weight: "duotone" }),
342
+ /* @__PURE__ */ jsxs2("span", { className: "grid gap-[1px]", children: [
343
+ /* @__PURE__ */ jsx3("b", { children: "\u63A8\u8350\u4F9D\u636E" }),
344
+ data.summary ?? "\u7EFC\u5408\u8D44\u683C\u3001\u53EF\u7528\u6027\u548C\u4F18\u60E0\u529B\u5EA6"
345
+ ] })
346
+ ] }),
347
+ alternatives.length > 0 && /* @__PURE__ */ jsxs2("div", { className: "promotion-recommendation__alternatives mx-4 mt-2 text-xs leading-[normal] text-secondary-foreground", children: [
348
+ "\u53E6\u6709 ",
349
+ alternatives.length,
350
+ " \u4E2A\u5019\u9009\u4F18\u60E0"
351
+ ] }),
352
+ /* @__PURE__ */ jsx3(ItemActionsRow, { actions: offer.itemActions ?? [], cardId, isHistory, className: "promotion-recommendation__actions", chipClassName: `promotion-button promotion-button--primary ${PROMOTION_BUTTON_PRIMARY_CLASS}` })
353
+ ] });
354
+ }
355
+ const promotion = data.presentation === "promotion";
356
+ const hero = data.items[0];
357
+ const coupon = data.presentation === "coupon" || data.mode === "claimable";
358
+ const title = promotion ? "\u672C\u5468\u8425\u9500\u6D3B\u52A8" : coupon ? "\u5546\u573A\u795E\u5238" : "\u6D3B\u52A8\u4E0E\u4F18\u60E0";
359
+ const eyebrow = promotion ? "\u6D3B\u52A8\u53D1\u73B0" : coupon ? "\u5F53\u524D\u5546\u573A \xB7 \u4F18\u60E0\u7CBE\u9009" : "\u4F18\u60E0\u7CBE\u9009";
360
+ const summary = data.summary && data.summary !== eyebrow ? data.summary : void 0;
361
+ const items = data.mode === "claimable" ? data.items.filter((item) => item.claimable) : data.items;
362
+ const maxItems = data.maxItems ?? 4;
363
+ return /* @__PURE__ */ jsxs2("section", { className: `promotion-card promotion-list relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground ${promotion ? " promotion-list--promotion" : ""}${coupon ? " promotion-list--coupon promotion-list--offers pb-3" : ""}`, "aria-label": title, children: [
364
+ promotion && hero && /* @__PURE__ */ jsxs2("div", { className: "promotion-list__hero relative h-[92px] overflow-hidden bg-[#eef2f8]", children: [
365
+ /* @__PURE__ */ jsx3(ImageWithFallback, { src: hero.imageUrl, alt: title, className: "promotion-list__hero-image h-full w-full object-cover" }),
366
+ /* @__PURE__ */ jsxs2("div", { className: "promotion-list__glass absolute right-3 bottom-2.5 left-3 grid gap-[1px] rounded-[7px] border border-[rgba(255,255,255,0.68)] bg-[rgba(255,255,255,0.78)] px-2.5 py-2 shadow-[0_8px_20px_rgba(21,45,88,0.15)] backdrop-blur-[6px]", children: [
367
+ /* @__PURE__ */ jsx3("span", { className: "text-xs font-bold leading-[normal] text-[#128356]", children: "\u521A\u521A\u66F4\u65B0" }),
368
+ /* @__PURE__ */ jsxs2("strong", { className: "text-sm leading-[18px]", children: [
369
+ data.items.length,
370
+ " \u4E2A\u6D3B\u52A8\u6B63\u5728\u8FDB\u884C"
371
+ ] })
372
+ ] })
373
+ ] }),
374
+ coupon ? /* @__PURE__ */ jsx3("header", { className: "promotion-activity__header promotion-activity__header--pea promotion-coupon__header relative flex min-h-[87px] items-center overflow-hidden bg-[#f9f1e2] bg-cover bg-center bg-[image:var(--tbox-asset-promotion-coupon-header,linear-gradient(135deg,#fff1f3,#ffe4e8))] px-3.5 pt-3 pb-2.5", children: /* @__PURE__ */ jsxs2("div", { className: "promotion-activity__header-copy relative z-[1] w-[52%] min-w-0", children: [
375
+ /* @__PURE__ */ jsxs2("div", { className: "promotion-activity__header-title-row flex items-center gap-2.5 text-[#2f3a22] [&_svg]:size-[15px] [&_svg]:shrink-0 [&_svg]:text-[#4f7b37]", children: [
376
+ /* @__PURE__ */ jsx3(Ticket, { weight: "fill" }),
377
+ /* @__PURE__ */ jsx3("h3", { className: "text-base font-bold leading-[21px] text-[#2f3a22] [overflow-wrap:anywhere]", children: title })
378
+ ] }),
379
+ /* @__PURE__ */ jsx3("p", { className: "mt-1 text-xs leading-4 text-[#626b5c]", children: eyebrow })
380
+ ] }) }) : /* @__PURE__ */ jsxs2("header", { className: "promotion-card__header flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-3 max-[380px]:px-[13px] min-[760px]:pt-[15px]", children: [
381
+ /* @__PURE__ */ jsx3("span", { className: "promotion-card__mark grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(8,119,95,0.18)] bg-[#dff6ed] text-[#08775f] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5", children: promotion ? /* @__PURE__ */ jsx3(CalendarDots, { weight: "duotone" }) : /* @__PURE__ */ jsx3(Sparkle, { weight: "fill" }) }),
382
+ /* @__PURE__ */ jsxs2("div", { className: "min-w-0 flex-1", children: [
383
+ /* @__PURE__ */ jsx3("span", { className: "promotion-card__eyebrow mb-0.5 block text-xs font-bold leading-[14px] text-[#2368ec]", children: eyebrow }),
384
+ /* @__PURE__ */ jsx3("h3", { className: "text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base", children: title }),
385
+ /* @__PURE__ */ jsx3("p", { className: "mt-0.5 truncate text-xs leading-4 text-secondary-foreground", children: summary ?? "\u6839\u636E\u5F53\u524D\u573A\u666F\u5B9E\u65F6\u7B5B\u9009" })
386
+ ] }),
387
+ /* @__PURE__ */ jsxs2("b", { className: "promotion-card__count flex-none rounded-full border border-[rgba(83,91,108,0.13)] bg-[#f0f3f8] px-2 py-1.25 text-xs leading-[normal] text-secondary-foreground max-[380px]:hidden", children: [
388
+ data.items.length,
389
+ " \u4E2A"
390
+ ] })
391
+ ] }),
392
+ !items.length ? /* @__PURE__ */ jsx3(Empty, { text: data.noResultsReason ?? "\u6682\u672A\u627E\u5230\u7B26\u5408\u6761\u4EF6\u7684\u4F18\u60E0" }) : /* @__PURE__ */ jsx3("div", { ref: listRef, className: coupon ? `promotion-list__items overflow-hidden px-3.5 pb-1 ${expanded ? " promotion-list__items--expanded transition-none" : " transition-[max-height] duration-[320ms] ease-[ease]"}` : `promotion-list__items px-4 pb-1 max-[380px]:px-[13px]${expanded ? " promotion-list__items--expanded" : ""}`, style: { maxHeight: expanded ? listHeights.expanded || void 0 : listHeights.collapsed || void 0 }, onTransitionEnd: () => {
393
+ if (bottomRef.current) scrollCardBottom(bottomRef.current);
394
+ }, children: items.map((item) => coupon ? /* @__PURE__ */ jsxs2(
395
+ "article",
396
+ {
397
+ className: "promotion-coupon-row relative grid min-h-[77px] w-full cursor-pointer grid-cols-[68px_minmax(0,1fr)_auto] items-center gap-x-[9px] gap-y-0 overflow-hidden border-0 py-2.5 text-left text-inherit focus-visible:rounded-[6px] focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[#2368ec]",
398
+ role: "button",
399
+ tabIndex: 0,
400
+ "aria-label": `${item.claimActionLabel ?? "\u9886\u53D6"}\u300C${item.title}\u300D`,
401
+ onClick: () => setOpenRef(item.offerRef),
402
+ onKeyDown: (e) => {
403
+ if (e.key === "Enter" || e.key === " ") {
404
+ e.preventDefault();
405
+ setOpenRef(item.offerRef);
406
+ }
407
+ },
408
+ children: [
409
+ /* @__PURE__ */ jsx3(ImageWithFallback, { src: item.imageUrl, alt: item.title, className: "promotion-coupon-row__thumb h-[68px] w-[68px] shrink-0 rounded-[9px] object-cover shadow-[inset_0_0_0_1px_rgba(11,15,23,0.04)] [&:not(.promotion-image--fallback)]:block" }),
410
+ /* @__PURE__ */ jsxs2("div", { className: "promotion-coupon-row__main relative flex min-w-0 flex-col justify-center gap-1 self-stretch pr-0.5", children: [
411
+ /* @__PURE__ */ jsx3("strong", { className: "promotion-coupon-row__title line-clamp-2 text-sm font-semibold leading-[19px] text-foreground", children: item.title }),
412
+ item.tags.some((tag) => !/^TOP[1-5]$/i.test(tag)) && /* @__PURE__ */ jsx3("span", { className: "promotion-coupon-row__tags mt-0 flex gap-1 overflow-hidden", children: item.tags.filter((tag) => !/^TOP[1-5]$/i.test(tag)).slice(0, 3).map((tag) => /* @__PURE__ */ jsx3("em", { className: `${/^(精选|餐饮|购物|生活)$/.test(tag) ? "promotion-coupon-row__tag--category" : "promotion-coupon-row__tag--meta"} shrink-0 max-w-[80px] truncate rounded-[3.5px] bg-[#fff4df] px-[5px] py-[1px] text-xs font-normal not-italic leading-[14px] text-[#986415]`, children: tag }, tag)) }),
413
+ item.subtitle && !couponSubtitleIsTime(item.subtitle) && /* @__PURE__ */ jsx3("span", { className: "promotion-coupon-row__sub line-clamp-2 text-xs leading-[11.5px] text-[rgba(11,15,23,0.55)]", dangerouslySetInnerHTML: { __html: item.subtitle } }),
414
+ /* @__PURE__ */ jsxs2("span", { className: "promotion-coupon-row__price mt-[1px] flex min-w-0 items-baseline gap-1", children: [
415
+ /* @__PURE__ */ jsx3("b", { className: "shrink-0 text-sm font-extrabold leading-[17px] text-[#e8471c]", children: item.priceText ?? item.benefitText ?? offerTypeLabel(item.offerType) }),
416
+ item.discountLabel && /* @__PURE__ */ jsx3("em", { className: "promotion-coupon-row__discount shrink-0 rounded-[2px] bg-[#fff1eb] px-[3.5px] py-[1px] text-xs font-bold not-italic leading-[10.5px] text-[#e8471c]", children: item.discountLabel }),
417
+ item.priceText && item.originalPriceText && /* @__PURE__ */ jsx3("s", { className: "truncate text-xs leading-3 text-[rgba(11,15,23,0.38)]", children: item.originalPriceText })
418
+ ] })
419
+ ] }),
420
+ /* @__PURE__ */ jsx3("span", { className: "promotion-item-actions promotion-item-actions--coupon contents shrink-0", "aria-hidden": "true", children: /* @__PURE__ */ jsx3("span", { className: `promotion-chip promotion-chip--coupon ${PROMOTION_CHIP_COUPON_CLASS}`, children: item.claimActionLabel ?? "\u9886\u53D6" }) })
421
+ ]
422
+ },
423
+ item.offerRef
424
+ ) : /* @__PURE__ */ jsxs2("article", { className: "grid min-h-[66px] w-full grid-cols-[52px_minmax(0,1fr)_auto_12px] items-center gap-[9px] border-t border-border py-2 text-left text-inherit first:border-t-0 max-[380px]:grid-cols-[46px_minmax(0,1fr)_auto_10px] max-[380px]:gap-[7px]", children: [
425
+ /* @__PURE__ */ jsxs2("span", { className: "promotion-list__visual relative h-[48px] w-[52px] max-[380px]:w-[46px]", children: [
426
+ /* @__PURE__ */ jsx3(ImageWithFallback, { src: item.imageUrl, alt: item.title, className: "promotion-list__thumb h-[48px] w-[52px] rounded-[7px] object-cover max-[380px]:w-[46px]" }),
427
+ /* @__PURE__ */ jsx3("em", { className: "absolute right-[3px] bottom-[3px] max-w-[47px] truncate rounded-[4px] border border-[rgba(255,255,255,0.7)] bg-[rgba(255,255,255,0.82)] px-1 py-0.5 text-xs font-extrabold not-italic leading-[normal] text-[var(--tbox-domain-promotion-accent,#e42f46)] backdrop-blur-[3.5px]", children: item.benefitText ?? offerTypeLabel(item.offerType) })
428
+ ] }),
429
+ /* @__PURE__ */ jsxs2("span", { className: "promotion-list__copy grid min-w-0 gap-0.5", children: [
430
+ /* @__PURE__ */ jsx3("small", { className: "text-xs font-bold leading-[normal] text-[#128356]", children: promotion ? "\u672C\u5468\u6D3B\u52A8" : offerTypeLabel(item.offerType) }),
431
+ /* @__PURE__ */ jsx3("strong", { className: "truncate text-sm leading-[18px]", children: item.title }),
432
+ /* @__PURE__ */ jsx3("span", { className: "truncate text-xs leading-[normal] text-secondary-foreground", children: item.subtitle ?? item.validityText ?? "\u5F53\u524D\u5546\u573A\u53EF\u7528" })
433
+ ] }),
434
+ /* @__PURE__ */ jsx3("span", { className: statusBadgeClass(item.availabilityStatus, item.claimable), children: statusText(item.availabilityStatus, item.claimable) }),
435
+ /* @__PURE__ */ jsx3(ItemActionsRow, { actions: item.itemActions ?? [], cardId, isHistory, className: "promotion-item-actions contents", chipClassName: PROMOTION_CHIP_CLASS })
436
+ ] }, item.offerRef)) }),
437
+ items.length > maxItems && /* @__PURE__ */ jsxs2(
438
+ "button",
439
+ {
440
+ type: "button",
441
+ className: coupon ? `promotion-list__toggle flex min-h-8 w-full cursor-pointer items-center justify-center gap-0.5 mt-0.5 border-0 bg-transparent px-0 py-0 text-xs font-normal leading-[normal] text-[#686d69] [font-family:inherit] hover:brightness-100 focus-visible:rounded-[5px] focus-visible:outline-3 focus-visible:outline-offset-2 focus-visible:outline-[rgba(9,107,250,0.28)] [&_svg]:transition-transform [&_svg]:duration-[160ms] [&_svg]:ease-[ease] [&_svg[data-rotated=true]]:rotate-180` : `promotion-list__toggle inline-flex w-full cursor-pointer items-center justify-center gap-[3px] mt-0.5 border-0 border-t border-[rgba(188,205,191,0.42)] bg-[linear-gradient(105deg,#fffaf0_0%,#f9f5e9_46%,#eaf6f3_100%)] px-3 pt-[7px] pb-2 text-xs font-semibold leading-[normal] text-foreground [font-family:inherit] hover:brightness-[0.94] focus-visible:outline-3 focus-visible:outline-foreground focus-visible:outline-offset-[-3px] [&_svg]:transition-transform [&_svg]:duration-[160ms] [&_svg]:ease-[ease] [&_svg[data-rotated=true]]:rotate-180`,
442
+ "aria-expanded": expanded,
443
+ onClick: toggleExpanded,
444
+ children: [
445
+ !coupon && /* @__PURE__ */ jsx3(CaretDown, { size: 16, "data-rotated": expanded || void 0 }),
446
+ expanded ? "\u6536\u8D77" : `\u67E5\u770B\u66F4\u591A\uFF08${items.length - maxItems} \u6761\uFF09`,
447
+ coupon && /* @__PURE__ */ jsx3(CaretDown, { size: 17, "aria-hidden": "true", "data-rotated": expanded || void 0 })
448
+ ]
449
+ }
450
+ ),
451
+ items.length > maxItems && /* @__PURE__ */ jsx3("div", { ref: bottomRef, className: "promotion-list__bottom-anchor h-0 flex-none scroll-mb-[max(96px,calc(var(--tbox-chat-bottom-height,0px)_+_24px))]", "aria-hidden": "true" }),
452
+ data.nextCursor && /* @__PURE__ */ jsx3("p", { className: "promotion-list__more px-4 pt-1 pb-[9px] text-center text-xs leading-[normal] text-secondary-foreground", children: "\u8FD8\u6709\u66F4\u591A\u5185\u5BB9\uFF0C\u53EF\u7EE7\u7EED\u67E5\u8BE2" }),
453
+ openRef && (() => {
454
+ const target = items.find((i) => i.offerRef === openRef);
455
+ if (!target) return null;
456
+ const token = actionTokens?.["promotion.acquire-from-list"];
457
+ const label = target.claimActionLabel ?? "\u9886\u53D6";
458
+ const purchaseOnly = label === "\u62A2\u8D2D";
459
+ const redirectOnly = purchaseOnly || target.freeCouponClaimMode === "REDIRECT";
460
+ const redirectLabel = purchaseOnly ? "\u53BB\u5C0F\u7A0B\u5E8F\u62A2\u8D2D" : "\u53BB\u5C0F\u7A0B\u5E8F\u9886\u53D6";
461
+ const facts = [
462
+ target.usageSceneText ? { icon: /* @__PURE__ */ jsx3(MapPin, { weight: "duotone" }), label: "\u4F7F\u7528\u573A\u666F", value: target.usageSceneText } : null,
463
+ target.usageTimeText ? { icon: /* @__PURE__ */ jsx3(CalendarBlank, { weight: "duotone" }), label: "\u4F7F\u7528\u65F6\u95F4", value: target.usageTimeText } : null,
464
+ target.thresholdText ? { icon: /* @__PURE__ */ jsx3(Ticket, { weight: "duotone" }), label: "\u4F7F\u7528\u9650\u5236", value: target.thresholdText } : null,
465
+ target.claimTimeText ? { icon: /* @__PURE__ */ jsx3(CalendarBlank, { weight: "duotone" }), label: "\u53EF\u9886\u53D6\u65F6\u95F4", value: target.claimTimeText } : null,
466
+ target.validityText ? { icon: /* @__PURE__ */ jsx3(CalendarBlank, { weight: "duotone" }), label: "\u6709\u6548\u671F", value: target.validityText } : null,
467
+ target.usageRuleText ? { icon: /* @__PURE__ */ jsx3(Ticket, { weight: "duotone" }), label: "\u4F7F\u7528\u89C4\u5219", value: target.usageRuleText } : null
468
+ ].filter(Boolean);
469
+ const priceMain = target.priceText ?? target.benefitText ?? offerTypeLabel(target.offerType);
470
+ return /* @__PURE__ */ jsx3(
471
+ CouponSheet,
472
+ {
473
+ title: target.title,
474
+ imageUrl: target.imageUrl,
475
+ imageFit: sheetImageFit(target),
476
+ noticeText: target.usageNoticeText,
477
+ guaranteeText: target.guaranteeText,
478
+ subtitle: redirectOnly ? [target.subtitle, target.purchaseUrl ? `\u8BE5\u4F18\u60E0\u9700\u524D\u5F80\u5C0F\u7A0B\u5E8F\u5B8C\u6210${purchaseOnly ? "\u8D2D\u4E70" : "\u9886\u53D6"}` : `\u8BE5\u4F18\u60E0\u7684${purchaseOnly ? "\u62A2\u8D2D" : "\u9886\u53D6"}\u94FE\u63A5\u6682\u4E0D\u53EF\u7528`].filter(Boolean).join(" \xB7 ") : target.subtitle,
479
+ priceMain,
480
+ priceOriginal: target.priceText ? target.originalPriceText : void 0,
481
+ aside: target.stockText,
482
+ facts,
483
+ onClose: () => {
484
+ setOpenRef(null);
485
+ setClaimingRef((current) => current === target.offerRef ? null : current);
486
+ setClaimedRefs((current) => {
487
+ if (!current.has(target.offerRef)) return current;
488
+ const next = new Set(current);
489
+ next.delete(target.offerRef);
490
+ return next;
491
+ });
492
+ },
493
+ foot: /* @__PURE__ */ jsxs2(Fragment2, { children: [
494
+ /* @__PURE__ */ jsxs2("span", { className: "promotion-sheet__foot-price flex min-w-0 items-baseline gap-1", children: [
495
+ /* @__PURE__ */ jsx3("b", { className: "text-xl font-extrabold leading-[normal] text-[#e8471c]", children: target.priceText ?? target.benefitText ?? "" }),
496
+ target.priceText && target.originalPriceText && /* @__PURE__ */ jsx3("s", { className: "text-xs leading-[normal] text-[rgba(11,15,23,0.4)]", children: target.originalPriceText })
497
+ ] }),
498
+ redirectOnly ? /* @__PURE__ */ jsx3(
499
+ "button",
500
+ {
501
+ type: "button",
502
+ disabled: !target.purchaseUrl,
503
+ className: `promotion-chip promotion-chip--coupon promotion-chip--coupon-lg ${PROMOTION_CHIP_COUPON_LG_CLASS}`,
504
+ onClick: () => {
505
+ if (!target.purchaseUrl) return;
506
+ void navigateToAlipayPage(target.purchaseUrl).catch((err) => {
507
+ console.warn("[PromotionOfferListCard] navigateTo failed", err);
508
+ });
509
+ },
510
+ children: target.purchaseUrl ? redirectLabel : `${purchaseOnly ? "\u62A2\u8D2D" : "\u9886\u53D6"}\u94FE\u63A5\u6682\u4E0D\u53EF\u7528`
511
+ }
512
+ ) : token && !isHistory ? (
513
+ // 直接走写动作,不再绕发消息:结果以新卡片回到对话流,当前浮层保持已领取态
514
+ /* @__PURE__ */ jsx3(
515
+ "button",
516
+ {
517
+ type: "button",
518
+ className: `promotion-chip promotion-chip--coupon promotion-chip--coupon-lg ${PROMOTION_CHIP_COUPON_LG_CLASS}`,
519
+ onClick: () => {
520
+ setClaimingRef(target.offerRef);
521
+ sendCardAction(cardId, { type: "moduleAction", actionId: "promotion.acquire-from-list", contextToken: token }, { offerRef: target.offerRef });
522
+ },
523
+ disabled: claimingRef === target.offerRef || claimedRefs.has(target.offerRef),
524
+ children: claimedRefs.has(target.offerRef) ? "\u5DF2\u9886\u53D6" : claimingRef === target.offerRef ? "\u9886\u53D6\u4E2D\uFF0C\u8BF7\u7A0D\u5019\u2026" : label
525
+ }
526
+ )
527
+ ) : (
528
+ // 无令牌(历史卡、旧服务端)时退回发消息,保住可用性
529
+ /* @__PURE__ */ jsx3(
530
+ ItemActionsRow,
531
+ {
532
+ actions: target.itemActions ?? [],
533
+ cardId,
534
+ isHistory,
535
+ className: "promotion-item-actions",
536
+ chipClassName: `promotion-chip promotion-chip--coupon promotion-chip--coupon-lg ${PROMOTION_CHIP_COUPON_LG_CLASS}`
537
+ }
538
+ )
539
+ )
540
+ ] })
541
+ }
542
+ );
543
+ })()
544
+ ] });
545
+ }
546
+ markSelfRendering(PromotionOfferListCard);
547
+ function Empty({ text }) {
548
+ return /* @__PURE__ */ jsxs2("div", { className: "promotion-card__empty flex min-h-[94px] items-center justify-center gap-2 p-5 text-xs leading-[normal] text-secondary-foreground", children: [
549
+ /* @__PURE__ */ jsx3(Ticket, { size: 28, weight: "duotone" }),
550
+ /* @__PURE__ */ jsx3("span", { children: text })
551
+ ] });
552
+ }
553
+ var promotion_offer_list_default = PromotionOfferListCard;
554
+
555
+ // src/client/cards/promotion-offer-detail/index.tsx
556
+ import { CalendarBlank as CalendarBlank2, CheckCircle, Clock, Gift, Info, ListChecks, MapPin as MapPin2, SealCheck, Ticket as Ticket2 } from "@phosphor-icons/react";
557
+ import { useEffect as useEffect3, useRef as useRef3, useState as useState4 } from "react";
558
+ import { markSelfRendering as markSelfRendering2, navigateToAlipayPage as navigateToAlipayPage2, sendCardAction as sendCardAction2 } from "@tbox.cn/app-agent-sdk-client";
559
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
560
+ var COUPON_MAIN_ACTION_CLASS = "flex min-h-[38px] w-full items-center justify-center rounded-[6px] border-0 bg-[#d9273d] mt-[9px] text-xs font-extrabold leading-[normal] text-white [font-family:inherit] hover:not-disabled:bg-[#c82036] focus-visible:shadow-[inset_0_0_0_3px_#fff,inset_0_0_0_6px_#5f101d] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50";
561
+ var COUPON_MAIN_ACTION_PENDING_CLASS = "relative overflow-hidden cursor-wait after:absolute after:inset-0 after:w-[38%] after:animate-[promotion-claim-progress_1.1s_ease-in-out_infinite] after:bg-[rgba(255,255,255,0.18)] after:content-[''] after:[transform:translateX(-140%)_skewX(-18deg)] motion-reduce:after:animate-none";
562
+ var modeText = {
563
+ AUTOMATIC_DISCOUNT: "\u7ED3\u7B97\u65F6\u81EA\u52A8\u4F18\u60E0",
564
+ CLAIM_THEN_PURCHASE: "\u5148\u9886\u5238\uFF0C\u518D\u8D2D\u4E70",
565
+ REGISTER_THEN_ATTEND: "\u5148\u62A5\u540D\uFF0C\u518D\u5230\u573A",
566
+ GROUP_PURCHASE: "\u53D1\u8D77\u6216\u53C2\u4E0E\u62FC\u56E2",
567
+ UNKNOWN: "\u4EE5\u6D3B\u52A8\u9875\u8BF4\u660E\u4E3A\u51C6"
568
+ };
569
+ function isClaimSuccess(text, level) {
570
+ return level === "success" || /领取成功|已存入卡包|已领取/.test(text);
571
+ }
572
+ function PromotionOfferDetailCard({ data, cardId = "", isHistory = false, actionTokens }) {
573
+ const [acquiring, setAcquiring] = useState4(false);
574
+ const [claimed, setClaimed] = useState4(false);
575
+ const [claimMessage, setClaimMessage] = useState4(null);
576
+ const pendingClaimRef = useRef3(false);
577
+ useEffect3(() => {
578
+ if (!cardId || typeof window === "undefined") return void 0;
579
+ const onNotice = (event) => {
580
+ const detail = event.detail;
581
+ if (!detail?.text || detail.surfaceId && detail.surfaceId !== cardId) return;
582
+ setAcquiring(false);
583
+ pendingClaimRef.current = false;
584
+ if (isClaimSuccess(detail.text, detail.level)) {
585
+ setClaimed(true);
586
+ }
587
+ setClaimMessage(detail.text);
588
+ };
589
+ const onCard = (event) => {
590
+ const card = event.detail;
591
+ if (card?.cardType !== "promotion-entitlement-list" || !pendingClaimRef.current) return;
592
+ pendingClaimRef.current = false;
593
+ setAcquiring(false);
594
+ setClaimed(true);
595
+ setClaimMessage("\u9886\u53D6\u6210\u529F\uFF01\u5DF2\u5B58\u5165\u5361\u5305");
596
+ };
597
+ window.addEventListener("tbox:notice", onNotice);
598
+ window.addEventListener("tbox:card", onCard);
599
+ return () => {
600
+ window.removeEventListener("tbox:notice", onNotice);
601
+ window.removeEventListener("tbox:card", onCard);
602
+ };
603
+ }, [cardId]);
604
+ if (data.presentation === "promotion-guide") return /* @__PURE__ */ jsx4(PromotionGuide, { data });
605
+ const coupon = data.offerType === "COUPON" || data.presentation === "coupon";
606
+ const purchaseOnly = coupon && data.claimActionLabel === "\u62A2\u8D2D";
607
+ const label = data.presentation === "promotion" ? "\u672C\u5468\u6D3B\u52A8" : data.presentation === "package" ? "\u7EC4\u5408\u793C\u5305" : "\u4F1A\u5458\u4E13\u4EAB";
608
+ return /* @__PURE__ */ jsxs3("section", { className: `promotion-card promotion-detail relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground ${coupon ? " promotion-detail--coupon" : ""}`, "aria-label": data.title, children: [
609
+ /* @__PURE__ */ jsxs3("div", { className: coupon ? "promotion-detail__hero relative mx-2.5 mt-[9px] h-[107px] overflow-hidden rounded-[8px] bg-[#f5f6f8]" : "promotion-detail__hero relative h-[126px] overflow-hidden bg-[#eef2f8] min-[760px]:h-[138px]", children: [
610
+ /* @__PURE__ */ jsx4(ImageWithFallback, { src: data.imageUrl, alt: data.title, className: "promotion-detail__image h-full w-full object-cover" }),
611
+ /* @__PURE__ */ jsx4("span", { className: coupon ? "promotion-detail__hero-label absolute top-[7px] left-[7px] rounded-[3.5px] border-0 bg-[rgba(200,32,54,0.94)] px-[7px] py-1 text-xs font-bold leading-[normal] text-white backdrop-blur-[4px]" : "promotion-detail__hero-label absolute top-2.5 left-3 rounded-full border border-[rgba(255,255,255,0.55)] bg-[rgba(6,42,101,0.66)] px-[7px] py-1 text-xs font-bold leading-[normal] text-white backdrop-blur-[4px]", children: label }),
612
+ /* @__PURE__ */ jsxs3("div", { className: coupon ? "promotion-detail__glass absolute right-[7px] bottom-[7px] left-[7px] grid grid-cols-[minmax(0,1fr)_auto] items-end gap-x-2.5 gap-y-[1px] rounded-[5px] border-0 bg-[rgba(255,241,243,0.94)] px-2 py-[6.5px] shadow-none backdrop-blur-[4px]" : "promotion-detail__glass absolute right-3 bottom-2.5 left-3 grid grid-cols-[minmax(0,1fr)_auto] items-end gap-x-2.5 gap-y-[1px] rounded-[7px] border border-[rgba(255,255,255,0.62)] bg-[rgba(255,255,255,0.82)] px-2.5 py-2 shadow-[0_8px_22px_rgba(21,45,88,0.16)] backdrop-blur-[6px]", children: [
613
+ /* @__PURE__ */ jsx4("small", { className: coupon ? "truncate text-xs font-bold leading-[normal] text-[#9f3d24]" : "truncate text-xs font-bold leading-[normal] text-[#128356]", children: data.claimable ? "\u53EF\u9886\u53D6" : "\u8BE6\u60C5" }),
614
+ /* @__PURE__ */ jsx4("strong", { className: coupon ? "col-start-2 row-span-2 text-lg leading-[21px] tabular-nums text-[var(--tbox-domain-promotion-accent,#e42f46)]" : "col-start-2 row-span-2 text-2xl leading-6 tabular-nums text-[var(--tbox-domain-promotion-accent,#e42f46)]", children: data.benefitText ?? offerTypeLabel(data.offerType) }),
615
+ /* @__PURE__ */ jsx4("em", { className: coupon ? "truncate text-xs not-italic leading-[normal] text-[rgba(11,15,23,0.62)]" : "truncate text-xs not-italic leading-[normal] text-secondary-foreground", children: data.subtitle ?? "\u5F53\u524D\u5546\u573A\u53EF\u7528" })
616
+ ] })
617
+ ] }),
618
+ /* @__PURE__ */ jsxs3("div", { className: coupon ? "promotion-detail__body px-3.5 pt-[11px] pb-3.5" : "promotion-detail__body px-4 pt-[13px] pb-[15px] max-[380px]:px-[13px]", children: [
619
+ /* @__PURE__ */ jsxs3("div", { className: "promotion-detail__status flex items-center justify-between gap-2", children: [
620
+ /* @__PURE__ */ jsxs3("span", { className: `promotion-status promotion-status--${data.claimable ? "available" : "unavailable"} ${PROMOTION_STATUS_CLASS} ${PROMOTION_STATUS_TONE_CLASS[data.claimable ? "available" : "unavailable"] ?? ""}`, children: [
621
+ /* @__PURE__ */ jsx4(SealCheck, { weight: "fill" }),
622
+ data.claimable ? "\u53EF\u9886\u53D6" : "\u6682\u4E0D\u53EF\u9886"
623
+ ] }),
624
+ data.validityText && /* @__PURE__ */ jsxs3("small", { className: "flex items-center gap-1 text-xs leading-[normal] text-secondary-foreground [&_svg]:size-3", children: [
625
+ /* @__PURE__ */ jsx4(Clock, {}),
626
+ data.validityText
627
+ ] })
628
+ ] }),
629
+ /* @__PURE__ */ jsx4("h3", { className: coupon ? "mt-[6.5px] text-base font-bold leading-[19.5px] [overflow-wrap:anywhere]" : "mt-2 text-lg font-bold leading-[22px] [overflow-wrap:anywhere]", children: data.title }),
630
+ (data.usageNoticeText || data.guaranteeText) && /* @__PURE__ */ jsxs3("div", { className: "promotion-detail__notice-strip mt-2 grid gap-[5px] rounded-[7px] bg-[#fff8ef] px-[9px] py-2", children: [
631
+ data.usageNoticeText && /* @__PURE__ */ jsxs3("span", { className: "grid grid-cols-[46px_minmax(0,1fr)] items-baseline gap-2 text-xs leading-[15px] text-[#171717]", children: [
632
+ /* @__PURE__ */ jsx4("b", { className: "w-auto text-left text-xs leading-[normal] text-[#b38a3e]", children: "\u987B\u77E5" }),
633
+ data.usageNoticeText
634
+ ] }),
635
+ data.guaranteeText && /* @__PURE__ */ jsxs3("span", { className: "grid grid-cols-[46px_minmax(0,1fr)] items-baseline gap-2 text-xs leading-[15px] text-[#171717]", children: [
636
+ /* @__PURE__ */ jsx4("b", { className: "w-auto text-left text-xs leading-[normal] text-[#ef7654]", children: "\u4FDD\u969C" }),
637
+ data.guaranteeText
638
+ ] })
639
+ ] }),
640
+ (data.usageSceneText || data.validityText || data.usageTimeText || data.thresholdText || data.claimTimeText) && /* @__PURE__ */ jsxs3("div", { className: coupon ? "promotion-detail__facts mt-2.5 grid grid-cols-[56px_minmax(0,1fr)] overflow-hidden rounded-[7px] border border-[#eceef2] bg-[#fafafb]" : "promotion-detail__facts mt-2.5 grid grid-cols-[56px_minmax(0,1fr)] overflow-hidden rounded-[7px] border border-border bg-[#f8faf9]", children: [
641
+ data.usageSceneText && /* @__PURE__ */ jsxs3("div", { className: "contents", children: [
642
+ /* @__PURE__ */ jsxs3("dt", { className: "m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground", children: [
643
+ /* @__PURE__ */ jsx4(MapPin2, { weight: "duotone" }),
644
+ "\u4F7F\u7528\u573A\u666F"
645
+ ] }),
646
+ /* @__PURE__ */ jsx4("dd", { className: "m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]", children: data.usageSceneText })
647
+ ] }),
648
+ data.validityText && /* @__PURE__ */ jsxs3("div", { className: "contents", children: [
649
+ /* @__PURE__ */ jsxs3("dt", { className: "m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground", children: [
650
+ /* @__PURE__ */ jsx4(CalendarBlank2, { weight: "duotone" }),
651
+ "\u6709\u6548\u671F"
652
+ ] }),
653
+ /* @__PURE__ */ jsx4("dd", { className: "m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]", children: data.validityText })
654
+ ] }),
655
+ data.usageTimeText && /* @__PURE__ */ jsxs3("div", { className: "contents", children: [
656
+ /* @__PURE__ */ jsxs3("dt", { className: "m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground", children: [
657
+ /* @__PURE__ */ jsx4(Clock, { weight: "duotone" }),
658
+ "\u4F7F\u7528\u65F6\u95F4"
659
+ ] }),
660
+ /* @__PURE__ */ jsx4("dd", { className: "m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]", children: data.usageTimeText })
661
+ ] }),
662
+ data.thresholdText && /* @__PURE__ */ jsxs3("div", { className: "contents", children: [
663
+ /* @__PURE__ */ jsxs3("dt", { className: "m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground", children: [
664
+ /* @__PURE__ */ jsx4(Ticket2, { weight: "duotone" }),
665
+ "\u4F7F\u7528\u9650\u5236"
666
+ ] }),
667
+ /* @__PURE__ */ jsx4("dd", { className: "m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]", children: data.thresholdText })
668
+ ] }),
669
+ data.claimTimeText && /* @__PURE__ */ jsxs3("div", { className: "contents", children: [
670
+ /* @__PURE__ */ jsxs3("dt", { className: "m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground", children: [
671
+ /* @__PURE__ */ jsx4(CalendarBlank2, { weight: "duotone" }),
672
+ "\u53EF\u9886\u53D6\u65F6\u95F4"
673
+ ] }),
674
+ /* @__PURE__ */ jsx4("dd", { className: "m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]", children: data.claimTimeText })
675
+ ] })
676
+ ] }),
677
+ (data.steps?.length ?? 0) > 0 && /* @__PURE__ */ jsx4("div", { className: "promotion-detail__rules mt-[11px] grid gap-1.5", children: data.steps?.slice(0, 3).map((step, index) => /* @__PURE__ */ jsxs3("span", { className: "grid grid-cols-[14px_minmax(0,1fr)] items-start gap-x-1.5 gap-y-0 [&_svg]:row-span-2 [&_svg]:mt-0.5 [&_svg]:text-success", children: [
678
+ /* @__PURE__ */ jsx4(CheckCircle, { weight: "fill" }),
679
+ /* @__PURE__ */ jsx4("b", { className: "text-xs", children: step.title }),
680
+ /* @__PURE__ */ jsx4("small", { className: "text-xs leading-[15px] text-secondary-foreground", children: step.description ?? "" })
681
+ ] }, index)) }),
682
+ (data.usageRuleText || data.description) && /* @__PURE__ */ jsxs3("div", { className: "promotion-detail__usage-rule mt-3 text-xs leading-4 text-secondary-foreground", children: [
683
+ /* @__PURE__ */ jsx4("strong", { className: "mb-1 block text-xs leading-[normal] text-[#171717]", children: "\u4F7F\u7528\u89C4\u5219" }),
684
+ /* @__PURE__ */ jsx4("div", { dangerouslySetInnerHTML: { __html: sanitizeActivityHtml(data.usageRuleText ?? data.description ?? "") } })
685
+ ] }),
686
+ purchaseOnly ? /* @__PURE__ */ jsx4("button", { className: `promotion-coupon-main-action cursor-pointer ${COUPON_MAIN_ACTION_CLASS}`, type: "button", disabled: !data.purchaseUrl || isHistory, onClick: () => {
687
+ if (!data.purchaseUrl) return;
688
+ void navigateToAlipayPage2(data.purchaseUrl).catch((err) => console.warn("[PromotionOfferDetailCard] navigateTo failed", err));
689
+ }, children: data.purchaseUrl ? "\u53BB\u5C0F\u7A0B\u5E8F\u62A2\u8D2D" : "\u62A2\u8D2D\u94FE\u63A5\u6682\u4E0D\u53EF\u7528" }) : data.claimable && actionTokens?.["promotion.acquire"] && /* @__PURE__ */ jsx4("button", { className: `promotion-coupon-main-action cursor-pointer ${COUPON_MAIN_ACTION_CLASS}${acquiring ? ` promotion-coupon-main-action--pending ${COUPON_MAIN_ACTION_PENDING_CLASS}` : ""}`, type: "button", disabled: acquiring || claimed, onClick: () => {
690
+ pendingClaimRef.current = true;
691
+ setAcquiring(true);
692
+ setClaimMessage("\u9886\u53D6\u4E2D\uFF0C\u8BF7\u7A0D\u5019\uFF1B\u9886\u53D6\u6210\u529F\u540E\u5C06\u81EA\u52A8\u5C55\u793A\u6211\u7684\u5238\u5305");
693
+ sendCardAction2(cardId, { type: "moduleAction", actionId: "promotion.acquire", contextToken: actionTokens["promotion.acquire"] }, { offerRef: data.offerRef });
694
+ }, children: claimed ? "\u5DF2\u9886\u53D6" : acquiring ? "\u9886\u53D6\u4E2D\u2026" : "\u7ACB\u5373\u9886\u53D6" }),
695
+ claimMessage && /* @__PURE__ */ jsx4("p", { className: "promotion-detail__claim-status mt-1.25 text-xs leading-[10px] text-[#9a4b12]", role: "status", children: claimMessage }),
696
+ (data.bundleItems?.length ?? 0) > 0 && /* @__PURE__ */ jsx4("div", { className: "promotion-detail__bundle mt-[11px] grid gap-[5px]", children: data.bundleItems?.map((item, index) => /* @__PURE__ */ jsxs3("span", { className: "grid grid-cols-[18px_minmax(0,1fr)_auto] items-center gap-1.5 rounded-[6px] border border-border bg-[#f8faf9] px-2 py-1.75 [&_svg]:text-[var(--tbox-domain-promotion-accent,#e42f46)]", children: [
697
+ /* @__PURE__ */ jsx4(Gift, { weight: "duotone" }),
698
+ /* @__PURE__ */ jsx4("b", { className: "text-xs leading-[normal]", children: item.name }),
699
+ /* @__PURE__ */ jsxs3("small", { className: "text-secondary-foreground", children: [
700
+ "x",
701
+ item.quantity
702
+ ] })
703
+ ] }, index)) }),
704
+ data.notice && /* @__PURE__ */ jsxs3("div", { className: coupon ? "promotion-detail__notice mt-2.5 flex items-start gap-1.5 rounded-[6px] border-0 bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#8a4a3d] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0" : "promotion-detail__notice mt-2.5 flex items-start gap-1.5 rounded-[6px] border border-[rgba(228,47,70,0.12)] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#744333] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0", children: [
705
+ /* @__PURE__ */ jsx4(Info, {}),
706
+ data.notice
707
+ ] }),
708
+ (data.stores?.length ?? 0) > 0 && /* @__PURE__ */ jsxs3("div", { className: "promotion-detail__stores mt-1.5 grid gap-[3px] rounded-[4px] border border-[var(--promotion-line,#e5e7eb)] bg-[var(--promotion-surface-muted,#f8fafc)] px-1.5 py-1.25", children: [
709
+ /* @__PURE__ */ jsx4("strong", { className: "text-xs leading-[normal] text-[var(--promotion-ink,#17202a)]", children: "\u9002\u7528\u95E8\u5E97" }),
710
+ data.stores?.slice(0, 8).map((store) => /* @__PURE__ */ jsxs3("span", { className: "flex gap-[2.5px] text-xs leading-[normal] text-[var(--promotion-muted,#667085)]", children: [
711
+ /* @__PURE__ */ jsx4(MapPin2, { weight: "fill" }),
712
+ store.storeName,
713
+ store.floor ? ` \xB7 ${store.floor}` : "",
714
+ store.address ? ` \xB7 ${store.address}` : ""
715
+ ] }, store.storeId))
716
+ ] }),
717
+ !data.claimable && data.unavailableReason && /* @__PURE__ */ jsxs3("div", { className: coupon ? "promotion-detail__notice mt-2.5 flex items-start gap-1.5 rounded-[6px] border-0 bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#8a4a3d] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0" : "promotion-detail__notice mt-2.5 flex items-start gap-1.5 rounded-[6px] border border-[rgba(228,47,70,0.12)] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#744333] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0", children: [
718
+ /* @__PURE__ */ jsx4(Info, {}),
719
+ data.unavailableReason
720
+ ] }),
721
+ data.caveats.length > 0 && /* @__PURE__ */ jsx4("footer", { className: "promotion-card__footer flex items-center gap-[5px] border-t border-border px-4 pt-[9px] pb-[11px] text-xs leading-[15px] text-secondary-foreground", children: data.caveats.join("\uFF1B") })
722
+ ] })
723
+ ] });
724
+ }
725
+ function PromotionGuide({ data }) {
726
+ const steps = data.steps ?? data.rules.map((rule) => ({ title: rule }));
727
+ return /* @__PURE__ */ jsxs3("section", { className: "promotion-card promotion-guide relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground", "aria-label": "\u6D3B\u52A8\u53C2\u4E0E\u65B9\u5F0F", children: [
728
+ /* @__PURE__ */ jsxs3("header", { className: "promotion-card__header promotion-card__header--compact flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-2.5 max-[380px]:px-[13px] min-[760px]:pt-[15px]", children: [
729
+ /* @__PURE__ */ jsx4("span", { className: "promotion-card__mark promotion-card__mark--cyan grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(13,115,132,0.18)] bg-[#e1f5f7] text-[#0d7384] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5", children: /* @__PURE__ */ jsx4(ListChecks, { weight: "duotone" }) }),
730
+ /* @__PURE__ */ jsxs3("div", { className: "min-w-0 flex-1", children: [
731
+ /* @__PURE__ */ jsx4("span", { className: "promotion-card__eyebrow mb-0.5 block text-xs font-bold leading-[14px] text-[#2368ec]", children: "\u6D3B\u52A8\u53C2\u4E0E\u65B9\u5F0F" }),
732
+ /* @__PURE__ */ jsx4("h3", { className: "text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base", children: data.title }),
733
+ /* @__PURE__ */ jsx4("p", { className: "mt-0.5 truncate text-xs leading-4 text-secondary-foreground", children: data.validityText ?? "\u5F53\u524D\u6D3B\u52A8\u6709\u6548\u671F\u4EE5\u73B0\u573A\u4E3A\u51C6" })
734
+ ] }),
735
+ /* @__PURE__ */ jsx4("b", { className: `promotion-status promotion-status--${data.claimable ? "available" : "unavailable"} ${PROMOTION_STATUS_CLASS} ${PROMOTION_STATUS_TONE_CLASS[data.claimable ? "available" : "unavailable"] ?? ""}`, children: data.claimable ? "\u53EF\u53C2\u4E0E" : "\u67E5\u770B\u89C4\u5219" })
736
+ ] }),
737
+ /* @__PURE__ */ jsxs3("div", { className: "promotion-guide__summary mx-4 flex items-center justify-between gap-2 rounded-[7px] border border-[rgba(35,104,236,0.13)] bg-[#eaf3ff] px-2.5 py-2 text-xs leading-[normal] text-[#2368ec] [&_svg]:w-[13px]", children: [
738
+ /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-1", children: [
739
+ /* @__PURE__ */ jsx4(MapPin2, { weight: "fill" }),
740
+ "\u5F53\u524D\u5546\u573A"
741
+ ] }),
742
+ /* @__PURE__ */ jsx4("strong", { children: modeText[data.participationMode ?? "UNKNOWN"] })
743
+ ] }),
744
+ /* @__PURE__ */ jsx4("ol", { className: "my-3 mx-4 grid list-none gap-2", children: steps.map((step, index) => /* @__PURE__ */ jsxs3("li", { className: "grid grid-cols-[24px_minmax(0,1fr)] gap-2", children: [
745
+ /* @__PURE__ */ jsx4("b", { className: "grid size-6 place-items-center rounded-full bg-success text-xs leading-[normal] text-white", children: index + 1 }),
746
+ /* @__PURE__ */ jsxs3("span", { className: "grid gap-0.5 pt-0.5", children: [
747
+ /* @__PURE__ */ jsx4("strong", { className: "text-xs leading-[normal]", children: step.title }),
748
+ /* @__PURE__ */ jsx4("small", { className: "text-xs leading-[15px] text-secondary-foreground", children: step.description ?? "" })
749
+ ] })
750
+ ] }, index)) }),
751
+ (data.requirements?.length ?? 0) > 0 && /* @__PURE__ */ jsx4("div", { className: "promotion-guide__requirements mx-4 mb-[11px] flex flex-wrap gap-[5px]", children: data.requirements?.map((item) => /* @__PURE__ */ jsxs3("span", { className: "flex items-center gap-[3px] rounded-[5px] bg-[#eaf8f1] px-1.75 py-1 text-xs leading-[normal] text-[#128356] [&_svg]:w-[11px]", children: [
752
+ /* @__PURE__ */ jsx4(CheckCircle, { weight: "fill" }),
753
+ item
754
+ ] }, item)) }),
755
+ data.notice && /* @__PURE__ */ jsxs3("div", { className: "promotion-detail__notice mx-4 mt-2.5 flex items-start gap-1.5 rounded-[6px] border border-[rgba(228,47,70,0.12)] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#744333] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0", children: [
756
+ /* @__PURE__ */ jsx4(Info, { weight: "duotone" }),
757
+ data.notice
758
+ ] }),
759
+ /* @__PURE__ */ jsx4("footer", { className: "promotion-card__footer flex items-center gap-[5px] border-t border-border px-4 pt-[9px] pb-[11px] text-xs leading-[15px] text-secondary-foreground", children: "\u53C2\u4E0E\u8D44\u683C\u548C\u573A\u6B21\u4EE5\u6D3B\u52A8\u73B0\u573A\u5B9E\u65F6\u4FE1\u606F\u4E3A\u51C6" })
760
+ ] });
761
+ }
762
+ var promotion_offer_detail_default = PromotionOfferDetailCard;
763
+ markSelfRendering2(PromotionOfferDetailCard);
764
+
765
+ // src/client/cards/promotion-entitlement-list/index.tsx
766
+ import { CalendarBlank as CalendarBlank3, CaretDown as CaretDown2, Copy, MapPinLine, NavigationArrow, ShieldCheck, Ticket as Ticket3 } from "@phosphor-icons/react";
767
+ import { useEffect as useEffect5, useLayoutEffect as useLayoutEffect2, useRef as useRef5, useState as useState6 } from "react";
768
+ import { callJsapi, httpGet } from "@tbox.cn/app-agent-sdk-client";
769
+
770
+ // src/client/components/CouponQrCode.tsx
771
+ import QRCode from "qrcode";
772
+ import JsBarcode from "jsbarcode";
773
+ import { useEffect as useEffect4, useState as useState5 } from "react";
774
+ import { useRef as useRef4 } from "react";
775
+ import { jsx as jsx5 } from "react/jsx-runtime";
776
+ function CouponQrCode(props) {
777
+ const { value, disabled = false } = props;
778
+ const [src, setSrc] = useState5();
779
+ useEffect4(() => {
780
+ let active = true;
781
+ setSrc(void 0);
782
+ void QRCode.toDataURL(value, {
783
+ width: 200,
784
+ margin: 1,
785
+ errorCorrectionLevel: "M",
786
+ color: { dark: disabled ? "#999999" : "#000000", light: "#ffffff" }
787
+ }).then((dataUrl) => {
788
+ if (active) setSrc(dataUrl);
789
+ }).catch(() => {
790
+ if (active) setSrc(void 0);
791
+ });
792
+ return () => {
793
+ active = false;
794
+ };
795
+ }, [disabled, value]);
796
+ return src ? /* @__PURE__ */ jsx5("img", { className: `promotion-sheet__qrcode block h-auto w-[min(70%,120px)] aspect-square mx-auto mt-2.5 mb-3 [image-rendering:pixelated] ${disabled ? " promotion-sheet__qrcode--disabled opacity-85" : ""}`, src, alt: "\u5238\u7801\u4E8C\u7EF4\u7801" }) : null;
797
+ }
798
+ function CouponBarcode(props) {
799
+ const { value, disabled = false } = props;
800
+ const ref = useRef4(null);
801
+ useEffect4(() => {
802
+ if (!ref.current) return;
803
+ try {
804
+ JsBarcode(ref.current, value, {
805
+ format: "CODE128",
806
+ width: 2,
807
+ height: 52,
808
+ margin: 0,
809
+ displayValue: false,
810
+ lineColor: disabled ? "#999999" : "#000000"
811
+ });
812
+ } catch {
813
+ ref.current.replaceChildren();
814
+ }
815
+ }, [disabled, value]);
816
+ return /* @__PURE__ */ jsx5("svg", { ref, className: `promotion-sheet__barcode block h-auto min-h-[26px] w-[min(70%,160px)] mx-auto mt-3.5 mb-2.5 ${disabled ? " promotion-sheet__barcode--disabled opacity-85" : ""}`, "aria-label": "\u5238\u7801\u6761\u5F62\u7801", role: "img" });
817
+ }
818
+
819
+ // src/client/cards/promotion-entitlement-list/index.tsx
820
+ import { Fragment as Fragment3, jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
821
+ function PromotionEntitlementListCard(props) {
822
+ const { data } = props;
823
+ const [openRef, setOpenRef] = useState6(null);
824
+ const [expanded, setExpanded] = useState6(false);
825
+ const [listHeights, setListHeights] = useState6({ collapsed: 0, expanded: 0 });
826
+ const listRef = useRef5(null);
827
+ const bottomRef = useRef5(null);
828
+ const initialRenderRef = useRef5(true);
829
+ useEffect5(() => {
830
+ if (initialRenderRef.current) {
831
+ initialRenderRef.current = false;
832
+ return;
833
+ }
834
+ if (bottomRef.current) scrollCardBottom(bottomRef.current);
835
+ }, [expanded]);
836
+ useLayoutEffect2(() => {
837
+ const list = listRef.current;
838
+ if (!list) return;
839
+ const rows = [...list.children];
840
+ const boundary = rows[Math.min(maxItems, rows.length) - 1];
841
+ const listTop = list.getBoundingClientRect().top;
842
+ const collapsed = boundary ? boundary.getBoundingClientRect().bottom - listTop : list.scrollHeight;
843
+ setListHeights({ collapsed, expanded: list.scrollHeight });
844
+ }, [data.items.length, data.maxItems]);
845
+ const toggleExpanded = () => {
846
+ setExpanded((value) => !value);
847
+ };
848
+ const target = openRef ? data.items.find((item) => item.entitlementRef === openRef) : void 0;
849
+ const [detailTarget, setDetailTarget] = useState6();
850
+ const [detailLoading, setDetailLoading] = useState6(false);
851
+ const detailController = useRef5(null);
852
+ const [copied, setCopied] = useState6(false);
853
+ useEffect5(() => {
854
+ detailController.current?.abort();
855
+ if (!openRef || !target) {
856
+ setDetailTarget(void 0);
857
+ setDetailLoading(false);
858
+ return void 0;
859
+ }
860
+ const controller = new AbortController();
861
+ detailController.current = controller;
862
+ setDetailTarget(void 0);
863
+ setDetailLoading(true);
864
+ const params = new URLSearchParams({ entitlementRef: openRef });
865
+ if (data.mallId) params.set("mallId", data.mallId);
866
+ if (data.miniAppId) params.set("miniAppId", data.miniAppId);
867
+ httpGet(`/api/m/promotion/entitlement-detail?${params.toString()}`, { signal: controller.signal }).then(({ data: payload }) => {
868
+ if (!controller.signal.aborted) setDetailTarget(payload.data);
869
+ }).catch(() => void 0).finally(() => {
870
+ if (!controller.signal.aborted) setDetailLoading(false);
871
+ });
872
+ return () => controller.abort();
873
+ }, [openRef, target]);
874
+ const sheetTarget = detailTarget ?? target;
875
+ const maxItems = data.maxItems ?? 4;
876
+ const copyCode = async (code) => {
877
+ try {
878
+ await navigator.clipboard?.writeText(code);
879
+ setCopied(true);
880
+ window.setTimeout(() => setCopied(false), 1600);
881
+ } catch {
882
+ setCopied(false);
883
+ }
884
+ };
885
+ return /* @__PURE__ */ jsxs4("section", { className: "promotion-card promotion-list--coupon promotion-entitlements relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground", "aria-label": "\u6211\u7684\u4F18\u60E0\u6743\u76CA", children: [
886
+ /* @__PURE__ */ jsx6("header", { className: "promotion-activity__header promotion-activity__header--pea promotion-coupon__header relative flex min-h-[87px] items-center overflow-hidden bg-[#f9f1e2] bg-cover bg-center bg-[image:var(--tbox-asset-promotion-coupon-header,linear-gradient(135deg,#fff1f3,#ffe4e8))] px-3.5 pt-3 pb-2.5", children: /* @__PURE__ */ jsxs4("div", { className: "promotion-activity__header-copy relative z-[1] w-[52%] min-w-0", children: [
887
+ /* @__PURE__ */ jsxs4("div", { className: "promotion-activity__header-title-row flex items-center gap-2.5 text-[#2f3a22] [&_svg]:size-[15px] [&_svg]:shrink-0 [&_svg]:text-[#4f7b37]", children: [
888
+ /* @__PURE__ */ jsx6(Ticket3, { weight: "fill" }),
889
+ /* @__PURE__ */ jsx6("h3", { className: "text-base font-bold leading-[21px] text-[#2f3a22] [overflow-wrap:anywhere]", children: "\u6211\u7684\u4F18\u60E0\u5238" })
890
+ ] }),
891
+ /* @__PURE__ */ jsx6("p", { className: "mt-1 text-xs leading-4 text-[#626b5c]", children: "\u5F53\u524D\u8D26\u6237 \xB7 \u5238\u5305\u6743\u76CA" })
892
+ ] }) }),
893
+ !data.items.length ? /* @__PURE__ */ jsxs4("div", { className: "promotion-card__empty flex min-h-[94px] items-center justify-center gap-2 p-5 text-xs leading-[normal] text-secondary-foreground", children: [
894
+ /* @__PURE__ */ jsx6(Ticket3, { size: 28, weight: "duotone" }),
895
+ /* @__PURE__ */ jsx6("span", { children: data.noResultsReason ?? "\u5F53\u524D\u8D26\u6237\u6682\u65E0\u53EF\u7528\u6743\u76CA" })
896
+ ] }) : /* @__PURE__ */ jsx6("div", { ref: listRef, className: `promotion-list__items overflow-hidden px-3.5 pb-1 ${expanded ? " promotion-list__items--expanded transition-none" : " transition-[max-height] duration-[320ms] ease-[ease]"}`, style: { maxHeight: expanded ? listHeights.expanded || void 0 : listHeights.collapsed || void 0 }, onTransitionEnd: () => {
897
+ if (bottomRef.current) scrollCardBottom(bottomRef.current);
898
+ }, children: data.items.map((item) => /* @__PURE__ */ jsxs4(
899
+ "article",
900
+ {
901
+ className: `promotion-coupon-row relative grid min-h-[77px] w-full cursor-pointer grid-cols-[56px_minmax(0,1fr)_auto] items-center gap-x-2 gap-y-0 overflow-hidden border-t border-[#f0f1f4] py-[9px] text-left text-inherit first:border-t-0 focus-visible:rounded-[6px] focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[#2368ec] ${item.status === "EFFECTIVE" ? "" : " promotion-coupon-row--disabled opacity-72"}`,
902
+ role: "button",
903
+ tabIndex: 0,
904
+ "aria-label": `\u67E5\u770B\u300C${item.title}\u300D`,
905
+ onClick: () => setOpenRef(item.entitlementRef),
906
+ onKeyDown: (e) => {
907
+ if (e.key === "Enter" || e.key === " ") {
908
+ e.preventDefault();
909
+ setOpenRef(item.entitlementRef);
910
+ }
911
+ },
912
+ children: [
913
+ /* @__PURE__ */ jsx6(ImageWithFallback, { src: item.imageUrl, alt: item.title, className: "promotion-coupon-row__thumb h-14 w-14 shrink-0 rounded-[6px] object-cover shadow-[inset_0_0_0_1px_rgba(11,15,23,0.04)] [&:not(.promotion-image--fallback)]:block" }),
914
+ /* @__PURE__ */ jsxs4("div", { className: "promotion-coupon-row__main relative flex min-w-0 flex-col justify-center gap-[3.5px] self-stretch pr-0.5", children: [
915
+ /* @__PURE__ */ jsx6("strong", { className: "promotion-coupon-row__title line-clamp-2 text-xs font-bold leading-4 text-[rgba(11,15,23,0.9)]", children: item.title }),
916
+ item.usageNotice && /* @__PURE__ */ jsx6("span", { className: "promotion-coupon-row__sub line-clamp-2 text-xs leading-[11.5px] text-[rgba(11,15,23,0.55)]", dangerouslySetInnerHTML: { __html: sanitizeActivityHtml(item.usageNotice) } }),
917
+ /* @__PURE__ */ jsxs4("span", { className: "promotion-coupon-row__price mt-[1px] flex min-w-0 items-baseline gap-1", children: [
918
+ /* @__PURE__ */ jsx6("b", { className: "shrink-0 text-sm font-extrabold leading-[17px] text-[#e8471c]", children: item.benefitText ?? entitlementStatusLabel(item.status) }),
919
+ item.thresholdText && /* @__PURE__ */ jsx6("em", { className: "promotion-coupon-row__discount shrink-0 rounded-[2px] bg-[#fff1eb] px-[3.5px] py-[1px] text-xs font-bold not-italic leading-[10.5px] text-[#e8471c]", children: item.thresholdText })
920
+ ] })
921
+ ] }),
922
+ /* @__PURE__ */ jsx6(
923
+ "span",
924
+ {
925
+ className: `promotion-owned-action promotion-chip promotion-chip--coupon promotion-coupon-row__state--${item.status.toLowerCase()} justify-self-end pointer-events-none ${item.status === "EFFECTIVE" ? PROMOTION_CHIP_COUPON_CLASS : `promotion-chip--coupon-off ${PROMOTION_CHIP_COUPON_OFF_CLASS}`}`,
926
+ "aria-hidden": "true",
927
+ children: item.status === "EFFECTIVE" ? "\u53BB\u4F7F\u7528" : entitlementStatusLabel(item.status)
928
+ }
929
+ )
930
+ ]
931
+ },
932
+ item.entitlementRef
933
+ )) }),
934
+ data.items.length > maxItems && /* @__PURE__ */ jsxs4(
935
+ "button",
936
+ {
937
+ type: "button",
938
+ className: "promotion-list__toggle inline-flex w-full cursor-pointer items-center justify-center gap-[3px] mt-0.5 border-0 border-t border-[rgba(188,205,191,0.42)] bg-[linear-gradient(105deg,#fffaf0_0%,#f9f5e9_46%,#eaf6f3_100%)] px-3 pt-[7px] pb-2 text-xs font-semibold leading-[normal] text-foreground [font-family:inherit] hover:brightness-[0.94] focus-visible:outline-3 focus-visible:outline-foreground focus-visible:outline-offset-[-3px] [&_svg]:transition-transform [&_svg]:duration-[160ms] [&_svg]:ease-[ease] [&_svg[data-rotated=true]]:rotate-180",
939
+ "aria-expanded": expanded,
940
+ onClick: toggleExpanded,
941
+ children: [
942
+ /* @__PURE__ */ jsx6(CaretDown2, { size: 16, "data-rotated": expanded || void 0 }),
943
+ expanded ? "\u6536\u8D77" : `\u67E5\u770B\u66F4\u591A\uFF08${data.items.length - maxItems} \u6761\uFF09`
944
+ ]
945
+ }
946
+ ),
947
+ data.items.length > maxItems && /* @__PURE__ */ jsx6("div", { ref: bottomRef, className: "promotion-list__bottom-anchor h-0 flex-none scroll-mb-[max(96px,calc(var(--tbox-chat-bottom-height,0px)_+_24px))]", "aria-hidden": "true" }),
948
+ sheetTarget && (() => {
949
+ const facts = [
950
+ sheetFact(/* @__PURE__ */ jsx6(MapPinLine, { weight: "duotone" }), "\u4F7F\u7528\u573A\u666F", sheetTarget.usageSceneText),
951
+ sheetFact(/* @__PURE__ */ jsx6(CalendarBlank3, { weight: "duotone" }), "\u6709\u6548\u671F", sheetTarget.validityText ?? sheetTarget.validUntilText),
952
+ sheetFact(/* @__PURE__ */ jsx6(CalendarBlank3, { weight: "duotone" }), "\u4F7F\u7528\u65F6\u95F4", sheetTarget.usageTimeText),
953
+ sheetFact(/* @__PURE__ */ jsx6(ShieldCheck, { weight: "duotone" }), "\u4F7F\u7528\u9650\u5236", sheetTarget.thresholdText),
954
+ sheetFact(/* @__PURE__ */ jsx6(CalendarBlank3, { weight: "duotone" }), "\u53EF\u9886\u53D6\u65F6\u95F4", sheetTarget.claimTimeText),
955
+ sheetFact(/* @__PURE__ */ jsx6(Ticket3, { weight: "duotone" }), "\u4F7F\u7528\u89C4\u5219", sheetTarget.usageRuleText)
956
+ ].filter(Boolean);
957
+ return /* @__PURE__ */ jsx6(
958
+ CouponSheet,
959
+ {
960
+ title: sheetTarget.title,
961
+ imageUrl: sheetTarget.imageUrl,
962
+ priceMain: sheetTarget.benefitText,
963
+ aside: detailLoading ? "\u52A0\u8F7D\u8BE6\u60C5\u4E2D" : entitlementStatusLabel(sheetTarget.status),
964
+ noticeText: sheetTarget.usageNotice,
965
+ guaranteeText: sheetTarget.guaranteeText,
966
+ facts,
967
+ onClose: () => setOpenRef(null),
968
+ beforeFacts: /* @__PURE__ */ jsxs4(Fragment3, { children: [
969
+ sheetTarget.qrCodeEnabled && sheetTarget.code && /* @__PURE__ */ jsxs4(Fragment3, { children: [
970
+ /* @__PURE__ */ jsx6(CouponBarcode, { value: sheetTarget.code, disabled: sheetTarget.status !== "EFFECTIVE" }),
971
+ /* @__PURE__ */ jsx6(CouponQrCode, { value: sheetTarget.code, disabled: sheetTarget.status !== "EFFECTIVE" })
972
+ ] }),
973
+ (sheetTarget.code || sheetTarget.codeMasked) && /* @__PURE__ */ jsxs4("div", { className: `promotion-sheet__code mx-4 mt-[11px] flex items-center gap-1.5 rounded-[10px] bg-card px-3 py-[11px] ${sheetTarget.status === "EFFECTIVE" ? "" : " promotion-sheet__code--disabled"}`, children: [
974
+ /* @__PURE__ */ jsx6("span", { className: "flex-none text-xs font-bold leading-[normal] text-[rgba(11,15,23,0.86)]", children: "\u5238\u7801" }),
975
+ /* @__PURE__ */ jsx6("strong", { className: `min-w-0 text-sm font-semibold leading-[normal] tracking-[1px] [overflow-wrap:anywhere] ${sheetTarget.status === "EFFECTIVE" ? "text-[rgba(11,15,23,0.9)]" : "text-[#999] line-through"}`, children: sheetTarget.code || sheetTarget.codeMasked }),
976
+ /* @__PURE__ */ jsxs4("button", { type: "button", className: "promotion-sheet__copy my-0 ml-auto inline-flex min-h-6 flex-none cursor-pointer items-center gap-[2.5px] rounded-full border-0 bg-[#c8a45e] px-2.5 py-[3.5px] text-xs leading-[normal] text-white [font-family:inherit]", onClick: () => copyCode(sheetTarget.code || sheetTarget.codeMasked), children: [
977
+ /* @__PURE__ */ jsx6(Copy, { size: 16 }),
978
+ copied ? "\u5DF2\u590D\u5236" : "\u590D\u5236"
979
+ ] })
980
+ ] }),
981
+ sheetTarget.stores?.length ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
982
+ /* @__PURE__ */ jsx6("div", { className: "promotion-sheet__section mx-4 mt-[17px] text-sm font-bold leading-5 text-[rgba(11,15,23,0.9)]", children: "\u9002\u7528\u5546\u5BB6" }),
983
+ /* @__PURE__ */ jsx6("div", { className: "promotion-sheet__stores mx-4 mt-2 rounded-[10px] bg-card px-3 py-1", children: sheetTarget.stores.map((store, storeIndex) => /* @__PURE__ */ jsxs4("div", { className: `promotion-sheet__store flex items-center gap-2 py-[9px] text-xs leading-[normal] text-[#493d36] ${storeIndex > 0 ? " border-t border-[#ecedf1]" : ""}`, children: [
984
+ store.imageUrl && /* @__PURE__ */ jsx6(ImageWithFallback, { src: store.imageUrl, alt: store.storeName, className: "promotion-sheet__store-image h-8 w-8 rounded-[6px] object-cover" }),
985
+ /* @__PURE__ */ jsxs4("span", { className: "flex min-w-0 flex-col gap-0.5", children: [
986
+ /* @__PURE__ */ jsx6("strong", { className: "text-sm font-semibold leading-[normal] text-[rgba(11,15,23,0.9)]", children: store.storeName }),
987
+ store.businessName && store.businessName !== store.storeName && /* @__PURE__ */ jsx6("small", { className: "truncate text-xs leading-4 text-[rgba(11,15,23,0.55)]", children: store.businessName }),
988
+ store.floor && /* @__PURE__ */ jsx6("small", { className: "truncate text-xs leading-4 text-[rgba(11,15,23,0.55)]", children: store.floor }),
989
+ store.address && /* @__PURE__ */ jsx6("small", { className: "truncate text-xs leading-4 text-[rgba(11,15,23,0.55)]", children: store.address })
990
+ ] }),
991
+ store.latitude !== void 0 && store.longitude !== void 0 && /* @__PURE__ */ jsxs4("button", { type: "button", className: "promotion-sheet__navigate ml-auto inline-flex flex-none cursor-pointer items-center gap-0.5 rounded-[4px] border-0 bg-[#fff1eb] px-[5px] py-1 text-xs leading-[normal] text-[#d4512d] [font-family:inherit]", "aria-label": `\u5BFC\u822A\u5230${store.storeName}`, onClick: (event) => {
992
+ event.stopPropagation();
993
+ void callJsapi("openLocation", { latitude: store.latitude, longitude: store.longitude, name: store.storeName, address: store.address ?? "" }).catch(() => void 0);
994
+ }, children: [
995
+ /* @__PURE__ */ jsx6(NavigationArrow, { size: 18 }),
996
+ "\u5BFC\u822A"
997
+ ] })
998
+ ] }, store.storeId)) })
999
+ ] }) : null
1000
+ ] })
1001
+ }
1002
+ );
1003
+ })()
1004
+ ] });
1005
+ }
1006
+ function sheetFact(icon, label, value) {
1007
+ return value ? { icon, label, value } : null;
1008
+ }
1009
+ var promotion_entitlement_list_default = PromotionEntitlementListCard;
1010
+
1011
+ // src/client/cards/promotion-activity-list/index.tsx
1012
+ import { CalendarDots as CalendarDots2, Sparkle as Sparkle2, Ticket as Ticket4 } from "@phosphor-icons/react";
1013
+ import { sendCardAction as sendCardAction3 } from "@tbox.cn/app-agent-sdk-client";
1014
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
1015
+ var statusText2 = { AVAILABLE: "\u53EF\u62A5\u540D", FULL: "\u5DF2\u6EE1", ENDED: "\u5DF2\u7ED3\u675F", UPCOMING: "\u5373\u5C06\u5F00\u59CB", UNKNOWN: "\u5F85\u786E\u8BA4" };
1016
+ function PromotionActivityListCard(props) {
1017
+ const { data, cardId = "", isHistory = false } = props;
1018
+ return /* @__PURE__ */ jsxs5("section", { className: "promotion-card promotion-activity promotion-activity--list relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground", children: [
1019
+ /* @__PURE__ */ jsx7("header", { className: "promotion-activity__header promotion-activity__header--pea relative flex min-h-[87px] items-center overflow-hidden bg-[#f9f1e2] bg-cover bg-center bg-[image:var(--tbox-asset-promotion-activity-header,linear-gradient(135deg,#fff1f3,#ffe4e8))] px-3.5 pt-3 pb-2.5", children: /* @__PURE__ */ jsxs5("div", { className: "promotion-activity__header-copy relative z-[1] w-[52%] min-w-0", children: [
1020
+ /* @__PURE__ */ jsxs5("div", { className: "promotion-activity__header-title-row flex items-center gap-2.5 text-[#2f3a22] [&_svg]:size-[15px] [&_svg]:shrink-0 [&_svg]:text-[#4f7b37]", children: [
1021
+ /* @__PURE__ */ jsx7(Sparkle2, { weight: "fill" }),
1022
+ /* @__PURE__ */ jsx7("h3", { className: "text-base font-bold leading-[21px] text-[#2f3a22] [overflow-wrap:anywhere]", children: "\u6D3B\u52A8\u4E2D\u5FC3" })
1023
+ ] }),
1024
+ /* @__PURE__ */ jsx7("p", { className: "mt-1 text-xs leading-4 text-[#626b5c]", children: "\u53D1\u73B0\u5546\u573A\u8FD1\u671F\u7CBE\u5F69\u6D3B\u52A8" })
1025
+ ] }) }),
1026
+ /* @__PURE__ */ jsx7("div", { className: "promotion-activity__list grid px-3.5 pt-0.5 pb-1.25", children: data.items.map((item) => {
1027
+ const status = item.availabilityStatus ?? (item.remainingQuota === 0 ? "FULL" : "UNKNOWN");
1028
+ const action = item.itemActions?.find((candidate) => candidate.kind === "send" || candidate.kind === "link");
1029
+ const jumpOnly = item.jumpOnly === true;
1030
+ return /* @__PURE__ */ jsxs5(
1031
+ "button",
1032
+ {
1033
+ type: "button",
1034
+ disabled: isHistory || !action,
1035
+ "aria-label": action?.label ?? (jumpOnly ? `\u6253\u5F00${item.title}` : `\u67E5\u770B${item.title}\u8BE6\u60C5`),
1036
+ className: `grid min-h-[71px] w-full cursor-pointer touch-manipulation grid-cols-[71px_minmax(0,1fr)] items-center gap-[9px] border-0 border-t border-[#e6ecea] bg-transparent py-[9px] text-left text-inherit transition-[background-color] duration-[180ms] ease-[ease] first:border-t-0 hover:not-disabled:bg-[#f5f8ff] focus-visible:outline-3 focus-visible:outline-offset-[-3px] focus-visible:outline-[#0b8b70] disabled:cursor-default ${status === "FULL" || status === "ENDED" ? "is-muted opacity-[0.68]" : ""}`,
1037
+ onClick: () => {
1038
+ if (!action || isHistory) return;
1039
+ if (action.kind === "link") {
1040
+ sendCardAction3(cardId, { type: "openLink", url: action.url });
1041
+ } else {
1042
+ sendCardAction3(cardId, { type: "sendMessage", value: action.value ?? action.label, visible: true });
1043
+ }
1044
+ },
1045
+ children: [
1046
+ /* @__PURE__ */ jsxs5("span", { className: "promotion-activity__visual relative h-[53px] w-[71px]", children: [
1047
+ /* @__PURE__ */ jsx7(ImageWithFallback, { src: item.coverUrl, alt: item.title, className: "promotion-activity__thumb h-[53px] w-[71px] rounded-[7px] object-cover shadow-[0_5px_12px_rgba(22,62,51,0.14)]" }),
1048
+ /* @__PURE__ */ jsx7("span", { className: `promotion-activity__status promotion-activity__status--${status.toLowerCase()} absolute right-1 bottom-1 ${PROMOTION_ACTIVITY_STATUS_CLASS} ${PROMOTION_ACTIVITY_STATUS_TONE_CLASS[status.toLowerCase()] ?? ""}`, children: statusText2[status] })
1049
+ ] }),
1050
+ /* @__PURE__ */ jsxs5("span", { className: "promotion-activity__copy grid min-w-0 gap-[2.5px]", children: [
1051
+ /* @__PURE__ */ jsxs5("small", { className: "flex items-center gap-[2.5px] text-xs font-bold leading-3 text-[#b8862e]", children: [
1052
+ /* @__PURE__ */ jsx7(Sparkle2, { weight: "fill" }),
1053
+ item.categoryName ?? (jumpOnly ? "\u9996\u9875\u7CBE\u9009" : "\u4F1A\u5458\u6D3B\u52A8")
1054
+ ] }),
1055
+ /* @__PURE__ */ jsx7("strong", { className: "line-clamp-2 text-xs leading-[15.5px]", children: item.title }),
1056
+ /* @__PURE__ */ jsxs5("span", { className: "flex items-center gap-[3px] text-xs leading-[12.5px] text-[#60726c]", children: [
1057
+ /* @__PURE__ */ jsx7(CalendarDots2, { weight: "duotone" }),
1058
+ item.periodText ?? (jumpOnly ? "\u70B9\u51FB\u6253\u5F00\u67E5\u770B\u5185\u5BB9" : "\u65F6\u95F4\u4EE5\u6D3B\u52A8\u9875\u4E3A\u51C6")
1059
+ ] }),
1060
+ /* @__PURE__ */ jsx7("em", { className: "text-xs font-bold not-italic leading-3 text-[#e75c47]", children: item.remainingQuota !== void 0 ? item.remainingQuota > 0 ? `\u4EC5\u4F59 ${item.remainingQuota} \u5E2D` : "\u540D\u989D\u5DF2\u6EE1" : jumpOnly ? item.jumpLabel ?? "\u6253\u5F00\u67E5\u770B" : item.registrationRequired ? "\u9700\u63D0\u524D\u62A5\u540D" : "\u65E0\u9700\u62A5\u540D" })
1061
+ ] })
1062
+ ]
1063
+ },
1064
+ item.activityRef
1065
+ );
1066
+ }) }),
1067
+ !data.items.length && /* @__PURE__ */ jsxs5("div", { className: "promotion-card__empty flex min-h-[94px] items-center justify-center gap-2 p-5 text-xs leading-[normal] text-secondary-foreground", children: [
1068
+ /* @__PURE__ */ jsx7(CalendarDots2, { size: 28 }),
1069
+ /* @__PURE__ */ jsx7("span", { children: data.noResultsReason ?? "\u8FD1\u671F\u6682\u65E0\u6D3B\u52A8" })
1070
+ ] }),
1071
+ /* @__PURE__ */ jsxs5("footer", { className: "promotion-activity__footer flex items-center justify-center gap-1 border-t border-[#e7eeeb] px-3.5 pt-2 pb-2.5 text-xs leading-3 text-[#6c7c77]", children: [
1072
+ /* @__PURE__ */ jsx7(Ticket4, { weight: "duotone" }),
1073
+ "\u4F1A\u5458\u6D3B\u52A8\u540D\u989D\u5B9E\u65F6\u53D8\u5316\uFF0C\u4EE5\u6D3B\u52A8\u8BE6\u60C5\u4E3A\u51C6"
1074
+ ] })
1075
+ ] });
1076
+ }
1077
+ var promotion_activity_list_default = PromotionActivityListCard;
1078
+
1079
+ // src/client/cards/promotion-activity-detail/index.tsx
1080
+ import { ArrowSquareOut, CalendarDots as CalendarDots3, CheckCircle as CheckCircle2, Clock as Clock2, Crown, ListChecks as ListChecks2, MapPin as MapPin3, Sparkle as Sparkle3, Users } from "@phosphor-icons/react";
1081
+ import { sendCardAction as sendCardAction4 } from "@tbox.cn/app-agent-sdk-client";
1082
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
1083
+ var ACTIVITY_HEADER_COMPACT = "flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-2.5 max-[380px]:px-[13px] min-[760px]:pt-[15px]";
1084
+ var ACTIVITY_MARK = "grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(8,119,95,0.18)] bg-[#dff6ed] text-[#08775f] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5";
1085
+ var ACTIVITY_EYEBROW = "mb-1 block text-xs font-bold leading-[14px] text-[#2368ec]";
1086
+ var ACTIVITY_H3 = "text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base";
1087
+ var ACTIVITY_HP = "mt-0.5 truncate text-xs leading-4 text-secondary-foreground";
1088
+ var ACTIVITY_READONLY = "mx-3.5 mb-3 flex items-center gap-1 rounded-[6px] bg-[#f2f7f5] px-[7.5px] py-[6.5px] text-xs leading-[12.5px] text-[#596d66] [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-[#0b8a6f]";
1089
+ var sessionText = { OPEN: "\u53EF\u9009", FULL: "\u5DF2\u6EE1", CLOSED: "\u5DF2\u7ED3\u675F", UNKNOWN: "\u5F85\u786E\u8BA4" };
1090
+ function PromotionActivityDetailCard({ data, cardId = "", isHistory = false }) {
1091
+ if (data.presentation === "schedule") return /* @__PURE__ */ jsx8(ActivitySchedule, { data });
1092
+ if (data.presentation === "guide") return /* @__PURE__ */ jsx8(ActivityGuide, { data });
1093
+ return /* @__PURE__ */ jsx8(ActivityDetail, { data, cardId, isHistory });
1094
+ }
1095
+ function ActivityDetail({ data, cardId, isHistory }) {
1096
+ const status = data.remainingQuota === 0 ? "FULL" : "AVAILABLE";
1097
+ return /* @__PURE__ */ jsxs6("section", { className: "promotion-card promotion-activity promotion-activity--detail relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground", children: [
1098
+ /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__cover relative h-[124px] bg-[#dfeee9]", children: [
1099
+ /* @__PURE__ */ jsx8(ImageWithFallback, { src: data.coverUrl, alt: data.title, className: "promotion-activity__cover-image h-full w-full object-cover" }),
1100
+ /* @__PURE__ */ jsx8("span", { className: "promotion-activity__cover-shade absolute inset-0 bg-[linear-gradient(90deg,rgba(12,39,32,0.82),rgba(12,39,32,0.3)_68%,transparent)]" }),
1101
+ /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__cover-meta absolute top-2.5 right-[11px] left-[11px] flex items-center justify-between", children: [
1102
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-[3.5px] rounded-full border border-[rgba(255,255,255,0.58)] bg-[rgba(18,48,40,0.56)] px-[6.5px] py-2 text-xs font-bold leading-[normal] text-[#fff5d6] backdrop-blur-[7px]", children: [
1103
+ /* @__PURE__ */ jsx8(Crown, { weight: "fill" }),
1104
+ "\u4F1A\u5458\u4E13\u4EAB\u4F53\u9A8C"
1105
+ ] }),
1106
+ /* @__PURE__ */ jsx8("span", { className: `promotion-activity__status promotion-activity__status--${status.toLowerCase()} ${PROMOTION_ACTIVITY_STATUS_CLASS} ${PROMOTION_ACTIVITY_STATUS_TONE_CLASS[status.toLowerCase()] ?? ""}`, children: status === "FULL" ? "\u5DF2\u6EE1" : "\u53EF\u62A5\u540D" })
1107
+ ] })
1108
+ ] }),
1109
+ /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__detail-body px-3.5 pt-[11px] pb-3.5", children: [
1110
+ /* @__PURE__ */ jsx8("small", { className: "text-xs font-bold leading-3 text-[#b8862e]", children: data.jumpOnly ? "\u9996\u9875\u7CBE\u9009 \xB7 \u53EF\u8DF3\u8F6C\u5185\u5BB9" : `\u6D3B\u52A8\u8BE6\u60C5 \xB7 ${data.categoryName ?? "\u4F1A\u5458\u6D3B\u52A8"}` }),
1111
+ /* @__PURE__ */ jsx8("h3", { className: "mt-[3px] mb-0.5 text-base font-bold leading-[20.5px] [overflow-wrap:anywhere]", children: data.title }),
1112
+ (data.subtitle ?? data.description) && /* @__PURE__ */ jsx8("p", { className: "text-xs leading-[14.5px] text-[#62736d]", children: data.subtitle ?? data.description }),
1113
+ /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__spotlight mt-2.5 grid grid-cols-2 gap-1.5", children: [
1114
+ /* @__PURE__ */ jsxs6("span", { className: "grid grid-cols-[18px_minmax(0,1fr)] gap-x-1 rounded-[7px] border border-[#e1ebe7] bg-[#f8fbfa] px-2 py-[7.5px] [&_svg]:row-span-2 [&_svg]:size-4 [&_svg]:self-center [&_svg]:text-[#0b8b70]", children: [
1115
+ /* @__PURE__ */ jsx8(CalendarDots3, { weight: "duotone" }),
1116
+ /* @__PURE__ */ jsx8("small", { className: "text-xs leading-[11px] text-[#71817c]", children: data.jumpOnly ? "\u5185\u5BB9\u8BF4\u660E" : "\u6D3B\u52A8\u65F6\u95F4" }),
1117
+ /* @__PURE__ */ jsx8("strong", { className: "truncate text-xs leading-[13px] text-[#213b34]", children: data.periodText ?? (data.jumpOnly ? "\u8BE6\u60C5\u4EE5\u8DF3\u8F6C\u9875\u9762\u4E3A\u51C6" : "\u4EE5\u6D3B\u52A8\u9875\u4E3A\u51C6") })
1118
+ ] }),
1119
+ /* @__PURE__ */ jsxs6("span", { className: "grid grid-cols-[18px_minmax(0,1fr)] gap-x-1 rounded-[7px] border border-[#e1ebe7] bg-[#f8fbfa] px-2 py-[7.5px] [&_svg]:row-span-2 [&_svg]:size-4 [&_svg]:self-center [&_svg]:text-[#0b8b70]", children: [
1120
+ /* @__PURE__ */ jsx8(Users, { weight: "duotone" }),
1121
+ /* @__PURE__ */ jsx8("small", { className: "text-xs leading-[11px] text-[#71817c]", children: "\u6D3B\u52A8\u540D\u989D" }),
1122
+ /* @__PURE__ */ jsx8("strong", { className: "truncate text-xs leading-[13px] text-[#213b34]", children: data.remainingQuota !== void 0 ? `\u5269\u4F59 ${data.remainingQuota} \u5E2D` : data.registrationRequired ? "\u9700\u63D0\u524D\u62A5\u540D" : "\u65E0\u9700\u62A5\u540D" })
1123
+ ] })
1124
+ ] }),
1125
+ /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__venue mt-1.5 flex items-center gap-[5.5px] rounded-[7px] border border-[#e7ecea] px-2 py-1.75 [&>svg]:size-4 [&>svg]:text-[#e75c47]", children: [
1126
+ /* @__PURE__ */ jsx8(MapPin3, { weight: "fill" }),
1127
+ /* @__PURE__ */ jsxs6("span", { className: "grid", children: [
1128
+ /* @__PURE__ */ jsx8("small", { className: "text-xs leading-[11px] text-[#71817c]", children: "\u6D3B\u52A8\u5730\u70B9" }),
1129
+ /* @__PURE__ */ jsx8("strong", { className: "text-xs leading-[13.5px]", children: data.location ?? "\u5F53\u524D\u5546\u573A" })
1130
+ ] })
1131
+ ] }),
1132
+ data.registrationRequired && /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__benefit mt-1.5 flex items-center gap-1.5 rounded-[7px] border border-[rgba(184,134,46,0.2)] bg-[#fff6df] px-2 py-1.75 text-[#805616] [&>svg]:size-[17px] [&>svg]:shrink-0", children: [
1133
+ /* @__PURE__ */ jsx8(Crown, { weight: "fill" }),
1134
+ /* @__PURE__ */ jsxs6("span", { className: "grid text-xs leading-3", children: [
1135
+ /* @__PURE__ */ jsx8("b", { className: "text-xs leading-[13.5px]", children: "\u4F1A\u5458\u4E13\u4EAB\u793C\u9047" }),
1136
+ "\u5B8C\u6210\u4F1A\u5458\u8EAB\u4EFD\u6821\u9A8C\u540E\u53EF\u53C2\u4E0E"
1137
+ ] })
1138
+ ] }),
1139
+ data.notice && /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__detail-notice mt-1.5 flex items-center gap-[5px] rounded-[6px] border border-[#e4e9e7] bg-[#f4f7f6] px-[7.5px] py-[6.5px] text-xs leading-[12.5px] text-[#596d66] [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:text-[#7b8e87]", children: [
1140
+ /* @__PURE__ */ jsx8(Clock2, { weight: "duotone" }),
1141
+ /* @__PURE__ */ jsx8("span", { children: data.notice })
1142
+ ] }),
1143
+ (data.sessions.length > 0 || data.guideSteps.length > 0) && /* @__PURE__ */ jsxs6("div", { className: `promotion-activity__readonly ${ACTIVITY_READONLY}`, children: [
1144
+ /* @__PURE__ */ jsx8(ListChecks2, { weight: "fill" }),
1145
+ "\u53EF\u7EE7\u7EED\u8BE2\u95EE\u53C2\u4E0E\u6307\u5357\u548C\u53EF\u9009\u573A\u6B21"
1146
+ ] }),
1147
+ (data.registrationRequired || data.jumpOnly) && data.registrationUrl && /* @__PURE__ */ jsxs6(
1148
+ "button",
1149
+ {
1150
+ type: "button",
1151
+ className: "promotion-activity__register flex min-h-[42px] w-full cursor-pointer touch-manipulation items-center justify-center gap-[5px] rounded-full border-0 bg-[linear-gradient(135deg,#ff8c33_0%,#ff6f1f_100%)] mt-[9px] text-xs font-bold leading-[14px] text-white shadow-[0_3px_7px_rgba(255,111,31,0.2)] [font-family:inherit] hover:not-disabled:opacity-80 focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-[#0b8b70] disabled:cursor-default disabled:bg-[#e3e7ee] disabled:bg-none disabled:opacity-50 disabled:shadow-none [&_svg]:size-[13.5px] [&_svg]:shrink-0",
1152
+ disabled: isHistory,
1153
+ onClick: () => sendCardAction4(cardId, { type: "openLink", url: data.registrationUrl }),
1154
+ children: [
1155
+ /* @__PURE__ */ jsx8(ArrowSquareOut, { weight: "bold" }),
1156
+ data.jumpOnly ? data.jumpLabel ?? "\u6253\u5F00\u5C0F\u7A0B\u5E8F" : "\u53BB\u652F\u4ED8\u5B9D\u62A5\u540D"
1157
+ ]
1158
+ }
1159
+ ),
1160
+ data.jumpOnly && !data.registrationUrl && /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__detail-notice mt-1.5 flex items-center gap-[5px] rounded-[6px] border border-[#e4e9e7] bg-[#f4f7f6] px-[7.5px] py-[6.5px] text-xs leading-[12.5px] text-[#596d66] [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:text-[#7b8e87]", children: [
1161
+ /* @__PURE__ */ jsx8(Clock2, { weight: "duotone" }),
1162
+ /* @__PURE__ */ jsx8("span", { children: "\u8BE5\u9996\u9875\u8D44\u6E90\u6682\u65E0\u53EF\u7528\u8DF3\u8F6C\u94FE\u63A5" })
1163
+ ] })
1164
+ ] })
1165
+ ] });
1166
+ }
1167
+ function ActivitySchedule({ data }) {
1168
+ return /* @__PURE__ */ jsxs6("section", { className: "promotion-card promotion-activity promotion-activity--schedule relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground", children: [
1169
+ /* @__PURE__ */ jsx8(ActivityHeader, { title: "\u9009\u62E9\u5FC3\u4EEA\u573A\u6B21", subtitle: data.title, icon: "calendar" }),
1170
+ /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__session-summary mx-3.5 mb-[9px] grid grid-cols-[27px_minmax(0,1fr)_auto] items-center gap-1.5 rounded-[7px] border border-[rgba(184,134,46,0.2)] bg-[linear-gradient(105deg,#fff9eb,#fff4d8)] px-[8.5px] py-[7.5px] [&>svg]:size-[19px] [&>svg]:text-[#b8862e]", children: [
1171
+ /* @__PURE__ */ jsx8(CalendarDots3, { weight: "duotone" }),
1172
+ /* @__PURE__ */ jsxs6("span", { className: "grid", children: [
1173
+ /* @__PURE__ */ jsx8("small", { className: "text-xs leading-[11px] text-[#806b43]", children: "\u53EF\u9009\u573A\u6B21" }),
1174
+ /* @__PURE__ */ jsxs6("strong", { className: "text-xs leading-[14.5px] text-[#5c451c]", children: [
1175
+ data.sessions.length,
1176
+ " \u573A"
1177
+ ] })
1178
+ ] }),
1179
+ /* @__PURE__ */ jsx8("em", { className: "text-xs font-bold not-italic leading-[normal] text-[#9a6813]", children: "\u5B9E\u65F6\u540D\u989D" })
1180
+ ] }),
1181
+ /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__sessions grid gap-1.5 px-3.5 pb-[9px]", children: [
1182
+ data.sessions.map((session, index) => /* @__PURE__ */ jsxs6("article", { className: `grid min-h-[46px] grid-cols-[25px_minmax(0,1fr)_auto_auto] items-center gap-[7px] rounded-[7px] border border-[#e0eae6] px-2 py-1.75 shadow-[0_4px_11px_rgba(31,77,65,0.06)] ${session.status === "OPEN" ? "is-available" : "is-full opacity-[0.68]"}`, children: [
1183
+ /* @__PURE__ */ jsx8("b", { className: "grid size-[25px] place-items-center rounded-[7px] bg-[#e5f7f1] text-xs leading-[normal] text-[#08735d]", children: String(index + 1).padStart(2, "0") }),
1184
+ /* @__PURE__ */ jsxs6("span", { className: "grid gap-[0.5px]", children: [
1185
+ /* @__PURE__ */ jsx8("strong", { className: "text-xs leading-[14px]", children: session.title }),
1186
+ /* @__PURE__ */ jsxs6("small", { className: "text-xs leading-3 text-[#71817c]", children: [
1187
+ session.startText,
1188
+ session.endText ? ` - ${session.endText}` : ""
1189
+ ] })
1190
+ ] }),
1191
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-[2.5px] whitespace-nowrap text-xs text-[#61736d]", children: [
1192
+ /* @__PURE__ */ jsx8(Users, { weight: "duotone" }),
1193
+ session.remainingQuota !== void 0 ? `\u4F59 ${session.remainingQuota} \u5E2D` : session.location ?? "\u540D\u989D\u5B9E\u65F6"
1194
+ ] }),
1195
+ /* @__PURE__ */ jsx8("em", { className: "rounded-full bg-[#e7f8f2] px-[5px] py-[3px] text-xs font-bold not-italic leading-[normal] text-[#08735d]", children: sessionText[session.status] })
1196
+ ] }, session.sessionRef)),
1197
+ !data.sessions.length && /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__empty-state flex min-h-[53px] items-center justify-center gap-[7px] rounded-[7px] border border-dashed border-[#cadbd5] bg-[#f8fbfa] text-xs text-[#667973] [&_svg]:size-[19px]", children: [
1198
+ /* @__PURE__ */ jsx8(Clock2, { weight: "duotone" }),
1199
+ /* @__PURE__ */ jsxs6("span", { className: "grid", children: [
1200
+ /* @__PURE__ */ jsx8("strong", { className: "text-xs leading-[normal]", children: "\u573A\u6B21\u6B63\u5728\u786E\u8BA4" }),
1201
+ /* @__PURE__ */ jsx8("small", { className: "text-xs leading-[normal]", children: "\u7A0D\u540E\u518D\u6765\u67E5\u770B\u6700\u65B0\u5B89\u6392" })
1202
+ ] })
1203
+ ] })
1204
+ ] }),
1205
+ /* @__PURE__ */ jsxs6("p", { className: `promotion-activity__readonly ${ACTIVITY_READONLY}`, children: [
1206
+ /* @__PURE__ */ jsx8(CheckCircle2, { weight: "fill" }),
1207
+ "\u5F53\u524D\u4EC5\u5C55\u793A\u573A\u6B21\u4E0E\u540D\u989D\uFF0C\u4E0D\u4F1A\u76F4\u63A5\u63D0\u4EA4\u62A5\u540D"
1208
+ ] })
1209
+ ] });
1210
+ }
1211
+ function ActivityGuide({ data }) {
1212
+ const steps = data.guideItems ?? data.guideSteps.map((title) => ({ title }));
1213
+ return /* @__PURE__ */ jsxs6("section", { className: "promotion-card promotion-activity promotion-activity--guide relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground", children: [
1214
+ /* @__PURE__ */ jsx8(ActivityHeader, { title: "\u53C2\u4E0E\u6307\u5357", subtitle: data.title, icon: "guide" }),
1215
+ /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__guide-banner mx-3.5 mb-2.5 flex items-center gap-[7px] rounded-[7px] border border-[rgba(184,134,46,0.18)] bg-[linear-gradient(105deg,#fff9ed,#fff3d6)] px-[9px] py-2 text-[#78531a] [&>svg]:size-[19px]", children: [
1216
+ /* @__PURE__ */ jsx8(Sparkle3, { weight: "fill" }),
1217
+ /* @__PURE__ */ jsxs6("span", { className: "grid", children: [
1218
+ /* @__PURE__ */ jsx8("small", { className: "text-xs font-extrabold leading-[11px]", children: "HOW TO JOIN" }),
1219
+ /* @__PURE__ */ jsx8("strong", { className: "text-xs leading-[14px]", children: "\u63D0\u524D\u51C6\u5907\uFF0C\u5230\u573A\u66F4\u4ECE\u5BB9" })
1220
+ ] })
1221
+ ] }),
1222
+ /* @__PURE__ */ jsx8("ol", { className: "promotion-activity__steps grid list-none px-3.5 pb-[9px]", children: steps.map((step, index) => /* @__PURE__ */ jsxs6("li", { className: "relative grid min-h-[41px] grid-cols-[24px_minmax(0,1fr)] items-start gap-[7px] [&:not(:last-child)]:after:absolute [&:not(:last-child)]:after:top-6 [&:not(:last-child)]:after:bottom-0.5 [&:not(:last-child)]:after:left-[11.5px] [&:not(:last-child)]:after:w-px [&:not(:last-child)]:after:bg-[#cbe6de] [&:not(:last-child)]:after:content-['']", children: [
1223
+ /* @__PURE__ */ jsx8("b", { className: "z-[1] grid size-6 place-items-center rounded-full bg-[linear-gradient(145deg,#0e9a79,#08745f)] text-xs leading-[normal] text-white shadow-[0_3.5px_9px_rgba(8,116,95,0.18)]", children: index + 1 }),
1224
+ /* @__PURE__ */ jsxs6("span", { className: "grid gap-[1.5px] pt-[1.5px]", children: [
1225
+ /* @__PURE__ */ jsx8("strong", { className: "text-xs leading-[14.5px]", children: step.title }),
1226
+ /* @__PURE__ */ jsx8("small", { className: "text-xs leading-[13px] text-[#687a74]", children: step.description ?? "" })
1227
+ ] })
1228
+ ] }, index)) }),
1229
+ data.conditions.length > 0 && /* @__PURE__ */ jsxs6("div", { className: "promotion-activity__requirements mx-3.5 mb-[9px] rounded-[7px] border border-[#dfebe7] bg-[#f8fbfa] px-[8.5px] py-[7.5px]", children: [
1230
+ /* @__PURE__ */ jsx8("b", { className: "mb-[4.5px] block text-xs leading-[normal] text-[#29473e]", children: "\u53C2\u4E0E\u6761\u4EF6" }),
1231
+ /* @__PURE__ */ jsx8("div", { className: "flex flex-wrap gap-1", children: data.conditions.map((item) => /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-[2.5px] rounded-full bg-[#e6f7f1] px-[5px] py-[3px] text-xs leading-[normal] text-[#08745f] [&_svg]:size-2.5", children: [
1232
+ /* @__PURE__ */ jsx8(CheckCircle2, { weight: "fill" }),
1233
+ item
1234
+ ] }, item)) })
1235
+ ] }),
1236
+ /* @__PURE__ */ jsxs6("p", { className: `promotion-activity__readonly ${ACTIVITY_READONLY}`, children: [
1237
+ /* @__PURE__ */ jsx8(CheckCircle2, { weight: "fill" }),
1238
+ data.notice ?? "\u5F53\u524D\u4EC5\u63D0\u4F9B\u53C2\u4E0E\u8BF4\u660E\uFF0C\u4E0D\u4F1A\u76F4\u63A5\u63D0\u4EA4\u62A5\u540D"
1239
+ ] })
1240
+ ] });
1241
+ }
1242
+ function ActivityHeader({ title, subtitle, icon }) {
1243
+ return /* @__PURE__ */ jsxs6("header", { className: `promotion-card__header promotion-card__header--compact ${ACTIVITY_HEADER_COMPACT}`, children: [
1244
+ /* @__PURE__ */ jsx8("span", { className: `promotion-card__mark ${ACTIVITY_MARK}`, children: icon === "calendar" ? /* @__PURE__ */ jsx8(CalendarDots3, { weight: "duotone" }) : /* @__PURE__ */ jsx8(ListChecks2, { weight: "duotone" }) }),
1245
+ /* @__PURE__ */ jsxs6("div", { className: "min-w-0 flex-1", children: [
1246
+ /* @__PURE__ */ jsx8("span", { className: `promotion-card__eyebrow ${ACTIVITY_EYEBROW}`, children: "\u4F1A\u5458\u6D3B\u52A8" }),
1247
+ /* @__PURE__ */ jsx8("h3", { className: ACTIVITY_H3, children: title }),
1248
+ /* @__PURE__ */ jsx8("p", { className: ACTIVITY_HP, children: subtitle })
1249
+ ] })
1250
+ ] });
1251
+ }
1252
+ var promotion_activity_detail_default = PromotionActivityDetailCard;
1253
+
1254
+ // src/client/cards/promotion-activity-category-list/index.tsx
1255
+ import { GameController, Palette, Sparkle as Sparkle4, Storefront } from "@phosphor-icons/react";
1256
+ import { ItemActionsRow as ItemActionsRow2 } from "@tbox.cn/app-agent-sdk-client";
1257
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
1258
+ var icons = [GameController, Storefront, Palette, Sparkle4];
1259
+ function PromotionActivityCategoryListCard(props) {
1260
+ const { data, cardId = "", isHistory = false } = props;
1261
+ return /* @__PURE__ */ jsxs7("section", { className: "promotion-card promotion-activity promotion-activity--categories relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground", children: [
1262
+ /* @__PURE__ */ jsxs7("header", { className: "promotion-card__header promotion-card__header--compact flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-2.5 max-[380px]:px-[13px] min-[760px]:pt-[15px]", children: [
1263
+ /* @__PURE__ */ jsx9("span", { className: "promotion-card__mark grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(8,119,95,0.18)] bg-[#dff6ed] text-[#08775f] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5", children: /* @__PURE__ */ jsx9(Sparkle4, { weight: "fill" }) }),
1264
+ /* @__PURE__ */ jsxs7("div", { className: "min-w-0 flex-1", children: [
1265
+ /* @__PURE__ */ jsx9("span", { className: "promotion-card__eyebrow mb-0.5 block text-xs font-bold leading-[14px] text-[#2368ec]", children: "\u4F1A\u5458\u6D3B\u52A8" }),
1266
+ /* @__PURE__ */ jsx9("h3", { className: "text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base", children: "\u63A2\u7D22\u4F1A\u5458\u6D3B\u52A8" }),
1267
+ /* @__PURE__ */ jsx9("p", { className: "mt-0.5 truncate text-xs leading-4 text-secondary-foreground", children: "\u6309\u5174\u8DA3\u627E\u5230\u4F60\u7684\u4E13\u5C5E\u5468\u672B" })
1268
+ ] })
1269
+ ] }),
1270
+ /* @__PURE__ */ jsx9("div", { className: "promotion-activity__categories grid grid-cols-2 gap-[7px] px-3.5 pb-3.5", children: data.items.map((item, index) => {
1271
+ const Icon = icons[index % icons.length];
1272
+ return /* @__PURE__ */ jsxs7("article", { className: "grid min-h-[46px] cursor-pointer grid-cols-[27px_minmax(0,1fr)_9px] items-center gap-1.5 rounded-[7px] border border-[#e5ece9] bg-[rgba(255,255,255,0.92)] px-2 py-1.75 text-left text-[#15372f] shadow-[0_5px_13px_rgba(23,74,61,0.08)] transition-[border-color,box-shadow,background] duration-[180ms] ease-[ease] motion-reduce:transition-none", children: [
1273
+ /* @__PURE__ */ jsx9("span", { className: `promotion-activity__category-icon promotion-activity__category-icon--${index % 4} grid size-[27px] place-items-center rounded-[8px] [&_svg]:size-[15px] ${PROMOTION_CATEGORY_ICON_TONE_CLASS[index % 4] ?? ""}`, children: /* @__PURE__ */ jsx9(Icon, { weight: "duotone" }) }),
1274
+ /* @__PURE__ */ jsxs7("span", { className: "grid min-w-0 gap-[1px]", children: [
1275
+ /* @__PURE__ */ jsx9("strong", { className: "truncate text-xs leading-[15px]", children: item.name }),
1276
+ /* @__PURE__ */ jsx9("small", { className: "text-xs leading-3 text-[#687a74]", children: "\u53D1\u73B0\u7CBE\u5F69\u6D3B\u52A8" })
1277
+ ] }),
1278
+ /* @__PURE__ */ jsx9(ItemActionsRow2, { actions: item.itemActions ?? [], cardId, isHistory, className: "promotion-item-actions contents", chipClassName: PROMOTION_CHIP_ACTIVITY_CLASS })
1279
+ ] }, item.categoryId);
1280
+ }) }),
1281
+ !data.items.length && /* @__PURE__ */ jsxs7("div", { className: "promotion-card__empty flex min-h-[94px] items-center justify-center gap-2 p-5 text-xs leading-[normal] text-secondary-foreground", children: [
1282
+ /* @__PURE__ */ jsx9(Sparkle4, { size: 28 }),
1283
+ /* @__PURE__ */ jsx9("span", { children: data.noResultsReason ?? "\u6682\u65E0\u6D3B\u52A8\u5206\u7C7B" })
1284
+ ] })
1285
+ ] });
1286
+ }
1287
+ var promotion_activity_category_list_default = PromotionActivityCategoryListCard;
1288
+
1289
+ // src/client/cards/promotion-best-deal/index.tsx
1290
+ import { Calculator, TrendUp } from "@phosphor-icons/react";
1291
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
1292
+ var money = (cents) => (cents / 100).toFixed(2);
1293
+ function PromotionBestDealCard({ data }) {
1294
+ const savings = data.savingsCents ?? 0;
1295
+ const payable = data.expectedPayCents ?? Math.max(0, data.originalAmountCents - savings);
1296
+ return /* @__PURE__ */ jsxs8("section", { className: "promotion-card promotion-deal relative w-full overflow-hidden bg-card pb-[15px] text-sm leading-[normal] tracking-[0] text-foreground", "aria-label": "\u4F18\u60E0\u6D4B\u7B97", children: [
1297
+ /* @__PURE__ */ jsxs8("header", { className: "promotion-card__header flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-3 max-[380px]:px-[13px] min-[760px]:pt-[15px]", children: [
1298
+ /* @__PURE__ */ jsx10("span", { className: "promotion-card__mark promotion-card__mark--cyan grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(13,115,132,0.18)] bg-[#e1f5f7] text-[#0d7384] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5", children: /* @__PURE__ */ jsx10(Calculator, { weight: "duotone" }) }),
1299
+ /* @__PURE__ */ jsxs8("div", { className: "min-w-0 flex-1", children: [
1300
+ /* @__PURE__ */ jsx10("span", { className: "promotion-card__eyebrow mb-0.5 block text-xs font-bold leading-[14px] text-[#2368ec]", children: "\u4F18\u60E0\u65B9\u6848" }),
1301
+ /* @__PURE__ */ jsx10("h3", { className: "text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base", children: "\u4F18\u60E0\u6D4B\u7B97" }),
1302
+ /* @__PURE__ */ jsx10("p", { className: "mt-0.5 truncate text-xs leading-4 text-secondary-foreground", children: data.authoritative ? "\u5B9E\u65F6\u4F18\u60E0\u6D4B\u7B97" : "\u7ED3\u7B97\u524D\u4F18\u60E0\u5EFA\u8BAE" })
1303
+ ] })
1304
+ ] }),
1305
+ data.authoritative ? /* @__PURE__ */ jsxs8("div", { className: "promotion-deal__hero mx-4 flex items-center justify-between gap-2.5 rounded-[8px] bg-[linear-gradient(135deg,#eaf8f1,var(--tbox-domain-promotion-surface,#fff1f3))] px-3 py-[11px]", children: [
1306
+ /* @__PURE__ */ jsxs8("span", { className: "grid", children: [
1307
+ /* @__PURE__ */ jsx10("small", { className: "text-xs leading-[normal] text-secondary-foreground", children: "\u9884\u8BA1\u5B9E\u4ED8" }),
1308
+ /* @__PURE__ */ jsxs8("strong", { className: "text-2xl tabular-nums leading-[normal] text-[var(--tbox-domain-promotion-accent,#e42f46)]", children: [
1309
+ "\xA5",
1310
+ money(payable)
1311
+ ] })
1312
+ ] }),
1313
+ /* @__PURE__ */ jsxs8("em", { className: "rounded-full bg-card px-2 py-1.25 text-xs font-bold not-italic leading-[normal] text-[var(--tbox-domain-promotion-accent,#e42f46)] shadow-[0_4px_12px_rgba(69,69,69,0.08)]", children: [
1314
+ "\u9884\u8BA1\u8282\u7701 \xA5",
1315
+ money(savings)
1316
+ ] })
1317
+ ] }) : /* @__PURE__ */ jsxs8("div", { className: "promotion-deal__notice mx-4 mt-2.5 flex items-start gap-[7px] rounded-[7px] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[normal] text-[#744333] [&_svg]:shrink-0 [&_svg]:text-[var(--tbox-domain-promotion-accent,#e42f46)]", children: [
1318
+ /* @__PURE__ */ jsx10(TrendUp, { weight: "duotone" }),
1319
+ /* @__PURE__ */ jsxs8("span", { className: "grid gap-[1px]", children: [
1320
+ /* @__PURE__ */ jsx10("b", { children: "\u5F53\u524D\u4E3A\u5EFA\u8BAE\u7ED3\u679C" }),
1321
+ data.message ?? "\u6700\u7EC8\u91D1\u989D\u8BF7\u5728\u7ED3\u7B97\u9875\u786E\u8BA4"
1322
+ ] })
1323
+ ] }),
1324
+ /* @__PURE__ */ jsxs8("div", { className: "promotion-deal__metrics mx-4 mt-[9px] grid grid-cols-3 gap-1.5", children: [
1325
+ /* @__PURE__ */ jsxs8("span", { className: "grid min-w-0 gap-[0.5px] rounded-[6px] border border-border bg-[#f9fbfa] px-1.5 py-2 text-center", children: [
1326
+ /* @__PURE__ */ jsx10("small", { className: "text-xs leading-[normal] text-secondary-foreground", children: "\u6D88\u8D39\u91D1\u989D" }),
1327
+ /* @__PURE__ */ jsxs8("strong", { className: "overflow-hidden text-ellipsis text-sm leading-[normal] text-[#128356]", children: [
1328
+ "\xA5",
1329
+ money(data.originalAmountCents)
1330
+ ] })
1331
+ ] }),
1332
+ /* @__PURE__ */ jsxs8("span", { className: "grid min-w-0 gap-[0.5px] rounded-[6px] border border-border bg-[#f9fbfa] px-1.5 py-2 text-center", children: [
1333
+ /* @__PURE__ */ jsx10("small", { className: "text-xs leading-[normal] text-secondary-foreground", children: "\u9884\u8BA1\u8282\u7701" }),
1334
+ /* @__PURE__ */ jsxs8("strong", { className: "overflow-hidden text-ellipsis text-sm leading-[normal] text-[#128356]", children: [
1335
+ "\xA5",
1336
+ money(savings)
1337
+ ] })
1338
+ ] }),
1339
+ /* @__PURE__ */ jsxs8("span", { className: "grid min-w-0 gap-[0.5px] rounded-[6px] border border-border bg-[#f9fbfa] px-1.5 py-2 text-center", children: [
1340
+ /* @__PURE__ */ jsx10("small", { className: "text-xs leading-[normal] text-secondary-foreground", children: "\u5019\u9009\u4F18\u60E0" }),
1341
+ /* @__PURE__ */ jsx10("strong", { className: "overflow-hidden text-ellipsis text-sm leading-[normal] text-[#128356]", children: data.candidates?.length ?? data.appliedOfferRefs.length })
1342
+ ] })
1343
+ ] })
1344
+ ] });
1345
+ }
1346
+ var promotion_best_deal_default = PromotionBestDealCard;
1347
+
1348
+ // src/client/index.ts
1349
+ var cards = {
1350
+ "promotion-offer-list": promotion_offer_list_default,
1351
+ "promotion-offer-detail": promotion_offer_detail_default,
1352
+ "promotion-entitlement-list": promotion_entitlement_list_default,
1353
+ "promotion-activity-list": promotion_activity_list_default,
1354
+ "promotion-activity-detail": promotion_activity_detail_default,
1355
+ "promotion-activity-category-list": promotion_activity_category_list_default,
1356
+ "promotion-best-deal": promotion_best_deal_default
1357
+ };
1358
+ var clientModule = {
1359
+ cards,
1360
+ register(ctx) {
1361
+ ctx.cards.registerMap(cards);
1362
+ }
1363
+ };
1364
+
1365
+ export {
1366
+ cards,
1367
+ clientModule
1368
+ };