@anker-in/headless-ui 1.3.81 → 1.3.82-alpha.1793170647538
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +57 -0
- package/README.md +6 -0
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +2 -0
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/types.d.ts +2 -0
- package/dist/cjs/biz-components/BrandEquity/types.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/types.d.ts +8 -2
- package/dist/cjs/biz-components/ImageWithText/types.js +1 -1
- package/dist/cjs/biz-components/Ksp/index.d.ts +2 -0
- package/dist/cjs/biz-components/Ksp/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/hooks/useStickyFlip.d.ts +20 -0
- package/dist/cjs/biz-components/Listing/hooks/useStickyFlip.js +1 -0
- package/dist/cjs/biz-components/MarqueeReview/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/cjs/biz-components/MiniCart/CircleProgress.d.ts +22 -1
- package/dist/cjs/biz-components/MiniCart/CircleProgress.js +2 -1
- package/dist/cjs/biz-components/MiniCart/MiniCartDialog.d.ts +4 -2
- package/dist/cjs/biz-components/MiniCart/MiniCartDialog.js +1 -1
- package/dist/cjs/biz-components/MiniCart/index.d.ts +45 -0
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductCompare/index.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductHero/types.d.ts +2 -0
- package/dist/cjs/biz-components/ProductHero/types.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +10 -0
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/Specs/dropdown.js +1 -2
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/index.d.ts +2 -2
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/helpers/ScrollLoadVideo.d.ts +9 -1
- package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/hooks/useDraggableScroll.js +1 -1
- package/dist/cjs/hooks/useExposure.d.ts +1 -1
- package/dist/cjs/hooks/useExposure.js +1 -1
- package/dist/cjs/hooks/useViewItemList.d.ts +1 -1
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/shared/ContainerGridContext.d.ts +20 -0
- package/dist/cjs/shared/ContainerGridContext.js +1 -0
- package/dist/cjs/shared/Styles.d.ts +2 -0
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/mediaGridSpec.d.ts +87 -0
- package/dist/cjs/shared/mediaGridSpec.js +1 -0
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +2 -0
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/types.d.ts +2 -0
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/types.d.ts +8 -2
- package/dist/esm/biz-components/Ksp/index.d.ts +2 -0
- package/dist/esm/biz-components/Ksp/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/Listing/hooks/useStickyFlip.d.ts +20 -0
- package/dist/esm/biz-components/Listing/hooks/useStickyFlip.js +1 -0
- package/dist/esm/biz-components/MarqueeReview/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
- package/dist/esm/biz-components/MiniCart/CircleProgress.d.ts +22 -1
- package/dist/esm/biz-components/MiniCart/CircleProgress.js +2 -1
- package/dist/esm/biz-components/MiniCart/MiniCartDialog.d.ts +4 -2
- package/dist/esm/biz-components/MiniCart/MiniCartDialog.js +1 -1
- package/dist/esm/biz-components/MiniCart/index.d.ts +45 -0
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductCompare/index.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductHero/types.d.ts +2 -0
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +10 -0
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/Specs/dropdown.js +1 -2
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/index.d.ts +2 -2
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/helpers/ScrollLoadVideo.d.ts +9 -1
- package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/hooks/useDraggableScroll.js +1 -1
- package/dist/esm/hooks/useExposure.d.ts +1 -1
- package/dist/esm/hooks/useExposure.js +1 -1
- package/dist/esm/hooks/useViewItemList.d.ts +1 -1
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/shared/ContainerGridContext.d.ts +20 -0
- package/dist/esm/shared/ContainerGridContext.js +1 -0
- package/dist/esm/shared/Styles.d.ts +2 -0
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/mediaGridSpec.d.ts +87 -0
- package/dist/esm/shared/mediaGridSpec.js +1 -0
- package/dist/tokens/base.css +48 -0
- package/package.json +5 -2
- package/style.css +281 -144
- package/tailwind.config.js +8 -0
package/CONTRIBUTING.md
CHANGED
|
@@ -221,6 +221,63 @@ alert('Example of disabled line for no-alert')
|
|
|
221
221
|
|
|
222
222
|
❗ 在ui/目录下的代码导入的时候,要带上.js后缀,比如 import { cn } from '../helpers/index.js' 否则在使用的时候会出现 ERR_UNSUPPORTED_DIR_IMPORT 问题
|
|
223
223
|
|
|
224
|
+
# 媒体字段断点命名(ADR 0010,增量强制)
|
|
225
|
+
|
|
226
|
+
业务组件中「断点族媒体字段」(承载图片/视频/海报引用、按断点区分尺寸的字段)必须遵守与 Tailwind 断点对齐的 canonical 5 端命名:
|
|
227
|
+
|
|
228
|
+
| 断点 | canonical 字段名(image 族) | video / poster 族同理 |
|
|
229
|
+
| ---- | ---- | ---- |
|
|
230
|
+
| mobile 基线(<768px) | `image`(无前缀 = 移动优先基线) | `video` / `poster` |
|
|
231
|
+
| tablet(≥768px) | `tabletImage` | `tabletVideo` / `tabletPoster` |
|
|
232
|
+
| laptop(≥1025px) | `laptopImage` | `laptopVideo` / `laptopPoster` |
|
|
233
|
+
| desktop(≥1440px) | `desktopImage` | `desktopVideo` / `desktopPoster` |
|
|
234
|
+
| lg-desktop(≥1920px) | `lgDesktopImage` | `lgDesktopVideo` / `lgDesktopPoster` |
|
|
235
|
+
|
|
236
|
+
```tsx
|
|
237
|
+
// ✅ 合规
|
|
238
|
+
export interface MyCompItem {
|
|
239
|
+
image: Media
|
|
240
|
+
tabletImage?: Media
|
|
241
|
+
laptopImage?: Media
|
|
242
|
+
desktopImage?: Media
|
|
243
|
+
lgDesktopImage?: Media
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// ❌ 违规(pad/mob/pc 前缀、后缀式、嵌套裸断点键均不合规)
|
|
247
|
+
export interface MyCompItem {
|
|
248
|
+
pcImage: Media
|
|
249
|
+
padImage?: Media
|
|
250
|
+
mobImage?: Media
|
|
251
|
+
imgPad?: Media
|
|
252
|
+
backgroundImage?: { mobile?: Media; tablet?: Media }
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**豁免**:语义媒体(`icon` / `avatar` / `logo` 等单尺寸小图)无断点概念,不需要断点前缀,保持原样即合规。
|
|
257
|
+
|
|
258
|
+
## lint 闸门与 ratchet 快照(grandfather)
|
|
259
|
+
|
|
260
|
+
命名检查由 `scripts/check-material-naming.mjs` 实现,已接入 `pnpm lint`(`pnpm --filter @anker-in/headless-ui run lint`),CI / pre-commit 均经此入口拦截:
|
|
261
|
+
|
|
262
|
+
- **新组件 / 新增媒体字段**不合规 → lint 红,报错信息含 canonical 写法与 `material-meta.json` 的 `fieldMap` 逃生舱指引(字段名已写进生产 PageConfig、无法改名时,用 fieldMap 显式声明字段→断点映射,这是合法终态而非临时豁免)。
|
|
263
|
+
- **存量不合规字段**(`imgPad` / `imageMob` / `padImage` / 嵌套 `backgroundImage.{mobile...}` 等)记录在 `scripts/material-naming-snapshot.json`,被 grandfather 不报错——不做 big-bang 迁移,存量字段名已固化在 CMS 数据里,改名 = 数据迁移。
|
|
264
|
+
- 快照**只减不增**:字段从源码消失后重新生成快照即自动收紧;快照中不存在的字段永远报错。
|
|
265
|
+
|
|
266
|
+
单独运行:
|
|
267
|
+
|
|
268
|
+
```shell
|
|
269
|
+
pnpm --filter @anker-in/headless-ui run lint:material-naming # 检查
|
|
270
|
+
pnpm --filter @anker-in/headless-ui run lint:material-naming:update # 重新生成快照
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## 随 touch 迁移(touch-to-migrate)
|
|
274
|
+
|
|
275
|
+
eslint 无法感知「本次 PR 是否改动了某字段」,因此存量字段的合规化提示由 PR review 承担:
|
|
276
|
+
|
|
277
|
+
- 你的 PR 若**触及**某组件的媒体字段(新增、修改、挪动),请顺手将该字段合规化(改名 + 组件内 fallback 兼容旧名),或在该组件的 `material-meta.json` 中显式声明 `fieldMap`。
|
|
278
|
+
- 字段合规化后运行 `lint:material-naming:update` 收紧快照,被迁移的字段从快照中移除,之后任何人再引入该旧名都会 lint 红。
|
|
279
|
+
- 判定逻辑(哪个字段是媒体、哪个名字合规)全仓单点在 `src/material/breakpoints.ts`(`isMediaField` / `isCanonicalMediaFieldName`),本检查脚本直接复用,勿在别处复制第二份词表。
|
|
280
|
+
|
|
224
281
|
# Tesing
|
|
225
282
|
|
|
226
283
|
unit test 使用 [jest](https://jestjs.io/) 和 [@test-library/react](https://testing-library.com/)。
|
package/README.md
CHANGED
|
@@ -46,6 +46,12 @@ import '@anker-in/headless-ui/tokens/{barnd}.css' // brand 可以是 anker, eufy
|
|
|
46
46
|
查看所有Token https://headless-ui-doc.netlify.app?path=/docs/design-token--docs
|
|
47
47
|
Tokens 支持覆盖
|
|
48
48
|
|
|
49
|
+
栅格左右边距 Token `--grid-margin`(`px-grid` 工具类使用它)定义在 `tokens/base.css`,必须引入 `base.css`,否则 `px-grid` 退回 16px。
|
|
50
|
+
|
|
51
|
+
默认是阶梯式,与升级前一致:16px、32px(≥768px)、64px(≥1025px),1440px 至 1919px 固定 64px,1920px 起为 `calc(50% - 832px)`。升级后不做任何改动,页面表现不变。
|
|
52
|
+
|
|
53
|
+
需要流式间距时主动开启:在页面最外层或 `<html>` 上声明 `data-grid="fluid"`(或 `class="grid-fluid"`),其内库组件的左右边距在 1440px 至 1920px 之间从 64px 线性过渡到 128px,消除 1920px 处的跳变。注意写死阶梯式边距的定制组件和已安装的旧副本不会跟着变,开启范围内它们与库组件的左边缘会在 1441–1919px 错开,需要先迁移到 `px-grid`。流式范围内的局部区域可以用 `data-grid="legacy"`(或 `class="grid-legacy"`)切回阶梯式。开关只覆盖变量,不改组件代码。
|
|
54
|
+
|
|
49
55
|
|
|
50
56
|
```jsx
|
|
51
57
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var C=Object.create;var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},g=(e,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of V(t))!I.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(c=P(t,s))||c.enumerable});return e};var L=(e,t,a)=>(a=e!=null?C(z(e)):{},g(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),E=e=>g(p({},"__esModule",{value:!0}),e);var R={};B(R,{default:()=>M});module.exports=E(R);var i=require("react/jsx-runtime"),v=L(require("react")),d=require("../../helpers/index.js"),l=require("../../components/index.js"),f=require("class-variance-authority"),h=require("swiper/react"),y=require("../../shared/Styles.js");const j=(0,f.cva)("rounded-card laptop:px-6 laptop:py-4 relative flex min-w-0 flex-col justify-between gap-2 overflow-hidden px-4 py-3",{variants:{state:{"active-light":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","active-dark":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","inactive-light":"bg-[#EAEAEC]","inactive-dark":"bg-[#1E2024]"},size:{small:"laptop:h-[160px] h-[120px]",large:"laptop:h-[240px] h-[200px]"}},defaultVariants:{state:"inactive-light",size:"small"}}),m=(0,f.cva)("font-bold leading-[1.2]",{variants:{state:{"active-light":"text-white","active-dark":"text-white","inactive-light":"text-[#080A0F]","inactive-dark":"text-white"}},defaultVariants:{state:"inactive-light"}}),w=v.memo(({item:e,theme:t="light",className:a,size:c})=>{const s=e.isActive||!1,o=`${s?"active":"inactive"}-${t}`;return(0,i.jsx)("div",{className:(0,d.cn)(j({state:o,size:c}),a),"data-ui-component-id":"ActivityScheduleCard",children:(0,i.jsxs)(l.Link,{asChild:!e?.link,href:e?.link,className:"size-full no-underline hover:text-current",children:[(s?e.activeIcon:e.inactiveIcon)&&(0,i.jsx)("div",{className:"laptop:w-[160px] aspect-1 absolute right-0 top-0 z-10 w-[120px]",children:(0,i.jsx)(l.Picture,{source:s?e.activeIcon.url:e.inactiveIcon.url,alt:s?e.activeIcon.alt:e.inactiveIcon.alt,className:"aspect-square"})}),(0,i.jsxs)("div",{className:"relative z-20 flex h-full flex-col justify-between",children:[(0,i.jsx)(l.Heading,{as:"h3",size:3,html:e.title,className:(0,d.cn)(m({state:o}))}),(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsx)("div",{className:"flex flex-col justify-end overflow-hidden",children:(0,i.jsx)(l.Heading,{as:"h4",size:2,html:e.subtitle,className:(0,d.cn)(" line-clamp-2",m({state:o}))})}),c==="large"&&e.description&&(0,i.jsx)(l.Text,{html:e.description,className:(0,d.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-3 text-[14px] leading-[1.4]",m({state:o}))})]})]})]})})});w.displayName="ActivityScheduleCard";const x=v.forwardRef(({classNames:e={},data:t,...a},c)=>{const s=t.theme||"light",o=t.size||"
|
|
1
|
+
"use strict";"use client";var C=Object.create;var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},g=(e,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of V(t))!I.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(c=P(t,s))||c.enumerable});return e};var L=(e,t,a)=>(a=e!=null?C(z(e)):{},g(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),E=e=>g(p({},"__esModule",{value:!0}),e);var R={};B(R,{default:()=>M});module.exports=E(R);var i=require("react/jsx-runtime"),v=L(require("react")),d=require("../../helpers/index.js"),l=require("../../components/index.js"),f=require("class-variance-authority"),h=require("swiper/react"),y=require("../../shared/Styles.js");const j=(0,f.cva)("rounded-card laptop:px-6 laptop:py-4 relative flex min-w-0 flex-col justify-between gap-2 overflow-hidden px-4 py-3",{variants:{state:{"active-light":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","active-dark":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","inactive-light":"bg-[#EAEAEC]","inactive-dark":"bg-[#1E2024]"},size:{small:"laptop:h-[160px] h-[120px]",large:"laptop:h-[240px] h-[200px]"}},defaultVariants:{state:"inactive-light",size:"small"}}),m=(0,f.cva)("font-bold leading-[1.2]",{variants:{state:{"active-light":"text-white","active-dark":"text-white","inactive-light":"text-[#080A0F]","inactive-dark":"text-white"}},defaultVariants:{state:"inactive-light"}}),w=v.memo(({item:e,theme:t="light",className:a,size:c})=>{const s=e.isActive||!1,o=`${s?"active":"inactive"}-${t}`;return(0,i.jsx)("div",{className:(0,d.cn)(j({state:o,size:c}),a),"data-ui-component-id":"ActivityScheduleCard",children:(0,i.jsxs)(l.Link,{asChild:!e?.link,href:e?.link,className:"size-full no-underline hover:text-current",children:[(s?e.activeIcon:e.inactiveIcon)&&(0,i.jsx)("div",{className:"laptop:w-[160px] aspect-1 absolute right-0 top-0 z-10 w-[120px]",children:(0,i.jsx)(l.Picture,{source:s?e.activeIcon.url:e.inactiveIcon.url,alt:s?e.activeIcon.alt:e.inactiveIcon.alt,className:"aspect-square"})}),(0,i.jsxs)("div",{className:"relative z-20 flex h-full flex-col justify-between",children:[(0,i.jsx)(l.Heading,{as:"h3",size:3,html:e.title,className:(0,d.cn)(m({state:o}))}),(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsx)("div",{className:"flex flex-col justify-end overflow-hidden",children:(0,i.jsx)(l.Heading,{as:"h4",size:2,html:e.subtitle,className:(0,d.cn)(" line-clamp-2",m({state:o}))})}),c==="large"&&e.description&&(0,i.jsx)(l.Text,{html:e.description,className:(0,d.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-3 text-[14px] leading-[1.4]",m({state:o}))})]})]})]})})});w.displayName="ActivityScheduleCard";const x=v.forwardRef(({classNames:e={},data:t,...a},c)=>{const s=t.theme||"light",o=t.size||"small",r=v.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),k=v.useMemo(()=>{const n=N=>{switch(N){case"mobile":return{slidesPerView:1.17,spaceBetween:12};case"tablet":return r===2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.4,spaceBetween:12};case"laptop":return r===2?{}:r===4?{slidesPerView:3.2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16};case"desktop":return r===2?{slidesPerView:2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16}}},u=n("mobile"),S=n("tablet"),b=n("laptop"),A=n("desktop");return{0:u,768:S,1024:b,1440:A}},[r]);return(0,i.jsx)("div",{ref:c,className:(0,d.cn)(e?.root),"data-ui-component-id":"ActivitySchedule",...a,children:(0,i.jsx)(h.Swiper,{breakpoints:k,className:"w-full !overflow-visible",children:t?.scheduleList?.map((n,u)=>(0,i.jsx)(h.SwiperSlide,{children:(0,i.jsx)(w,{item:n,theme:s,size:o,className:e?.card})},"activityScheduleCardItem"+u))??null})})});x.displayName="ActivitySchedule";var M=(0,y.withLayout)(x);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { BrandEquityProps } from './types.js';
|
|
2
|
+
import 'swiper/css';
|
|
3
|
+
import 'swiper/css/pagination';
|
|
2
4
|
declare const _default: import("react").ForwardRefExoticComponent<Omit<BrandEquityProps & import("react").RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & import("react").RefAttributes<unknown>> & {
|
|
3
5
|
readonly $$typeof: symbol;
|
|
4
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var j=Object.create;var
|
|
1
|
+
"use strict";"use client";var j=Object.create;var u=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var D=(e,r)=>{for(var i in r)u(e,i,{get:r[i],enumerable:!0})},h=(e,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of z(r))!H.call(e,o)&&o!==i&&u(e,o,{get:()=>r[o],enumerable:!(a=L(r,o))||a.enumerable});return e};var k=(e,r,i)=>(i=e!=null?j(A(e)):{},h(r||!e||!e.__esModule?u(i,"default",{value:e,enumerable:!0}):i,e)),R=e=>h(u({},"__esModule",{value:!0}),e);var _={};D(_,{default:()=>F});module.exports=R(_);var t=require("react/jsx-runtime"),s=require("react"),l=require("../../helpers/utils.js"),x=k(require("../../components/picture.js")),E=require("../../shared/Styles.js"),q=require("react-responsive"),S=require("../../hooks/useExposure.js"),f=require("swiper/react"),n=require("swiper/modules"),J=require("swiper/css"),K=require("swiper/css/pagination"),I=k(require("../Title/index.js"));const Q="copy",$="store_benefits",C=(e,r)=>{const i=[];for(let a=0;a<e.length;a+=r)i.push(e.slice(a,a+r));return i},N=(0,s.forwardRef)(({data:{items:e=[],itemShape:r,title:i,theme:a},className:o},m)=>{const[c,M]=(0,s.useState)(!1),g=(0,q.useMediaQuery)({query:"(max-width: 767px)"}),[B,T]=(0,s.useState)(null),y=(0,s.useRef)(null);(0,s.useImperativeHandle)(m,()=>y.current),(0,S.useExposure)(y,{componentType:Q,componentName:$}),(0,s.useEffect)(()=>{M(g)},[g]);const P=c?C(e,3):e;return(0,t.jsxs)("div",{ref:y,className:(0,l.cn)("brand-equity-wrapper w-full",{"aiui-dark":a==="dark"},o),children:[i&&(0,t.jsx)(I.default,{data:{title:i}}),c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(f.Swiper,{className:(0,l.cn)(o),modules:[n.FreeMode,n.Mousewheel,n.Pagination],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:B},breakpoints:{0:{spaceBetween:12}},children:P?.map((p,d)=>(0,t.jsx)(f.SwiperSlide,{className:"!flex flex-col gap-3",children:Array.isArray(p)&&p?.map((v,b)=>(0,t.jsx)(w,{data:v,itemShape:r,index:b,theme:v.theme??a},b))},"SwiperSlide"+d))}),(0,t.jsx)("div",{ref:T,className:"brand-equity-pagination !static mt-[20px] flex justify-center"})]}):(0,t.jsx)("div",{className:(0,l.cn)("grid grid-cols-1 gap-3","tablet:grid-cols-2","laptop:gap-4 laptop:grid-cols-10"),children:e.map((p,d)=>(0,t.jsx)(w,{data:p,itemShape:r,index:d,theme:p.theme??a},d))})]})}),w=({data:e,itemShape:r,index:i,theme:a})=>{const o=a==="dark"&&e.iconImage?e.iconImage:e.icon;return(0,t.jsxs)("div",{className:(0,l.cn)("brand-equity-item",`brand-equity-item-${i+1}`,e.containerName?`brand-equity-item--${e.containerName}`:void 0,"bg-container-secondary-1 box-border flex w-full flex-col p-4","desktop:p-6 justify-between","laptop:col-span-3 lg-desktop:p-8","laptop:h-[192px] lg-desktop:h-[240px] h-[160px]",{"laptop:col-span-4":[0,5,6,11].includes(i),"bg-container-primary":a==="dark"},"rounded-box",e.className),children:[(0,t.jsxs)("div",{className:"lg-desktop:h-[36px] flex h-[32px] items-center justify-between gap-3",children:[(0,t.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.type==="avatar"?(0,t.jsx)("div",{className:"flex shrink-0 -space-x-2",children:e?.avatarList?.map((m,c)=>(0,t.jsx)("div",{className:(0,l.cn)("border-container-primary size-[32px] overflow-hidden rounded-full border-2","relative inline-block shrink-0","lg-desktop:size-[36px]"),children:(0,t.jsx)(x.default,{source:m.avatar?.url,alt:m.avatar?.alt,className:"size-full object-cover"})},c))}):(0,t.jsx)("div",{className:"lg-desktop:size-[36px] size-[32px] shrink-0",children:(0,t.jsx)(x.default,{className:"size-full object-cover",source:o?.url,alt:o?.alt,imgClassName:"w-full h-full object-cover"})})]}),(0,t.jsx)("p",{className:"lg-desktop:text-[24px] text-info-primary line-clamp-3 text-[20px] font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})};N.displayName="BrandEquity";var F=(0,E.withLayout)(N);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { ComponentCommonProps, Img } from '../../types/props.js';
|
|
2
2
|
export interface BrandEquityItemProps {
|
|
3
3
|
icon?: Img;
|
|
4
|
+
/** 暗色主题专用图标:item 或全局 theme 为 dark 时优先于 icon 渲染(semantic-media 命名遵循 ADR 0010) */
|
|
5
|
+
iconImage?: Img;
|
|
4
6
|
type?: 'icon' | 'avatar';
|
|
5
7
|
title: string;
|
|
6
8
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of s(t))!m.call(e,r)&&r!==n&&i(e,r,{get:()=>t[r],enumerable:!(a=o(t,r))||a.enumerable});return e};var g=e=>p(i({},"__esModule",{value:!0}),e);var
|
|
1
|
+
"use strict";var i=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of s(t))!m.call(e,r)&&r!==n&&i(e,r,{get:()=>t[r],enumerable:!(a=o(t,r))||a.enumerable});return e};var g=e=>p(i({},"__esModule",{value:!0}),e);var c={};module.exports=g(c);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var L=Object.create;var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var E=(t,l)=>{for(var s in l)y(t,s,{get:l[s],enumerable:!0})},w=(t,l,s,p)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of S(l))!A.call(t,i)&&i!==s&&y(t,i,{get:()=>l[i],enumerable:!(p=D(l,i))||p.enumerable});return t};var T=(t,l,s)=>(s=t!=null?L(z(t)):{},w(l||!t||!t.__esModule?y(s,"default",{value:t,enumerable:!0}):s,t)),P=t=>w(y({},"__esModule",{value:!0}),t);var R={};E(R,{default:()=>q});module.exports=P(R);var e=require("react/jsx-runtime"),m=require("react"),o=require("../../components/index.js"),M=T(require("../Subscribe/index.js")),k=require("./types.js"),x=require("./icons/index.js"),N=require("react-responsive"),d=require("../../helpers/utils.js"),b=require("../AiuiProvider/index.js"),F=require("../../shared/Styles.js");const $=({data:{footer:t}={},currentCountry:l,event:s,subscribeLoading:p,classNames:i,className:n,moduleIds:r,...u})=>{const[f,c]=(0,m.useState)(!1),g=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{c(g)},[g]);const h=(0,m.useMemo)(()=>t?.blocks?.find(a=>a?.blockType===k.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsx)("footer",{...u,className:(0,d.cn)(i?.root,n),children:(0,e.jsxs)(o.Container,{className:(0,d.cn)(i?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(o.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(a=>{if(a?.blockType===k.FooterNavigationBlockType.Signup)return(0,e.jsx)(O,{subscribeLoading:p,data:a,onSubmit:s?.signup,id:r?.marketingConversion},a.id);if(a?.blockType===k.FooterNavigationBlockType.Brand)return(0,e.jsx)(Q,{data:a,isMobile:f,event:s,currentCountry:l,id:r?.footerBrand},a?.id);if(a?.blockType===k.FooterNavigationBlockType.Main)return(0,e.jsx)(j,{data:{...a,country:h},event:s,isMobile:f,currentCountry:l,id:r?.mainServices},a.id)})]})})},O=({data:t,onSubmit:l,subscribeLoading:s,id:p="footer-marketing-conversion"})=>{const{locale:i="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(M.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:l,loading:s}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(n?.link,i,"ref=footer"),asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},j=({data:t,event:l,isMobile:s,currentCountry:p,id:i="footer-main-services"})=>{const{locale:n="us"}=(0,b.useAiuiContext)(),[r,u]=(0,m.useState)(!1),{services:f,mainNav:c,country:g}=t,h="contact-section";return(0,e.jsxs)("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":f?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":f?.download?.title}),children:[(0,e.jsx)(o.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":f?.download?.title}),children:f?.storeBenefits?.reasons?.map(a=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},a?.id))})]}),(0,e.jsx)(B,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":f?.download?.title}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(v,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(v,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(v,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(o.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),s&&(0,e.jsx)("button",{onClick:()=>u(!r),"aria-expanded":r,"aria-controls":h,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&s||!s)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:c?.contact?.contacts?.map(a=>(0,e.jsxs)(o.Link,{href:a?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},a?.id))}),(0,e.jsx)(C,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:s,onChangeCountry:l?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(B,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),className:"group",role:"listitem","aria-label":a?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},a?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,role:"listitem","aria-label":a?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},a?.id))})]})]})]})},Q=({data:t,isMobile:l,event:s,currentCountry:p,id:i="footer-brand"})=>{const{locale:n="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:i,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsx)("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(t?.brand?.link,n,"ref=footer"),asChild:!t?.brand?.link,children:(0,e.jsx)(o.Text,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((r,u)=>(0,e.jsxs)(m.Fragment,{children:[u<=0&&(0,e.jsx)("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"text-base leading-normal no-underline",children:(0,e.jsx)(o.Text,{html:r?.icon,"aria-hidden":"true"})},r?.id)]},u))]})}),(0,e.jsx)(C,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:l,onChangeCountry:s?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(o.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:s?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},v=({title:t,lists:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)(),[i,n]=(0,m.useState)(!1),[r,u]=(0,m.useState)(!1),f=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{u(f)},[f]);const c=`nav-section-${t?.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(o.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!i),"aria-expanded":i,"aria-controls":c,"aria-label":i?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(i&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:l?.map(g=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(g?.link,p,"ref=footer"),className:"no-underline",children:(0,e.jsx)(o.Text,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},B=({title:t,apps:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)();return l?.length?(0,e.jsxs)("div",{className:s,children:[(0,e.jsx)(o.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:l?.map(i=>(0,e.jsxs)(o.Link,{href:(0,d.getLocalizedPath)(i?.link,p,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[(0,e.jsx)("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&(0,e.jsx)(o.Text,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},C=({country:t,isMobile:l,className:s,onChangeCountry:p})=>(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(o.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),l&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})});var q=(0,F.withLayout)($);
|
|
1
|
+
"use strict";var z=Object.create;var N=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var O=(t,s)=>{for(var i in s)N(t,i,{get:s[i],enumerable:!0})},C=(t,s,i,p)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of T(s))!$.call(t,o)&&o!==i&&N(t,o,{get:()=>s[o],enumerable:!(p=A(s,o))||p.enumerable});return t};var j=(t,s,i)=>(i=t!=null?z(P(t)):{},C(s||!t||!t.__esModule?N(i,"default",{value:t,enumerable:!0}):i,t)),Q=t=>C(N({},"__esModule",{value:!0}),t);var J={};O(J,{default:()=>H});module.exports=Q(J);var e=require("react/jsx-runtime"),u=require("react"),a=require("../../components/index.js"),L=j(require("../Subscribe/index.js")),v=require("./types.js"),x=require("./icons/index.js"),B=require("react-responsive"),d=require("../../helpers/utils.js"),k=require("../AiuiProvider/index.js"),S=require("../../shared/Styles.js");const M=t=>!!(t?.countryName||t?.country),q=({data:{footer:t}={},currentCountry:s,event:i,subscribeLoading:p,classNames:o,className:n,moduleIds:r,...h})=>{const[f,c]=(0,u.useState)(!1),g=(0,B.useMediaQuery)({query:"(max-width: 1439px)"});(0,u.useEffect)(()=>{c(g)},[g]);const y=(0,u.useMemo)(()=>t?.blocks?.find(m=>m?.blockType===v.FooterNavigationBlockType.Brand)?.country,[t]);return(0,e.jsx)("footer",{...h,className:(0,d.cn)(o?.root,n),children:(0,e.jsxs)(a.Container,{className:(0,d.cn)(o?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(a.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(m=>{if(m?.blockType===v.FooterNavigationBlockType.Signup)return(0,e.jsx)(R,{subscribeLoading:p,data:m,onSubmit:i?.signup,id:r?.marketingConversion},m.id);if(m?.blockType===v.FooterNavigationBlockType.Brand)return(0,e.jsx)(G,{data:m,isMobile:f,event:i,currentCountry:s,id:r?.footerBrand},m?.id);if(m?.blockType===v.FooterNavigationBlockType.Main)return(0,e.jsx)(_,{data:{...m,country:y},event:i,isMobile:f,currentCountry:s,id:r?.mainServices},m.id)})]})})},R=({data:t,onSubmit:s,subscribeLoading:i,id:p="footer-marketing-conversion"})=>{const{locale:o="us"}=(0,k.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(L.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:s,loading:i}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(a.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(a.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(a.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(n?.link,o,"ref=footer"),asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(a.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},_=({data:t,event:s,isMobile:i,currentCountry:p,id:o="footer-main-services"})=>{const{locale:n="us"}=(0,k.useAiuiContext)(),[r,h]=(0,u.useState)(!1),{services:f,mainNav:c,country:g}=t,y="contact-section",m=!!f?.storeBenefits?.title&&!!f?.storeBenefits?.reasons?.length,b=!!f?.download?.title&&!!f?.download?.apps?.length,E=M(p||g);return(0,e.jsxs)("nav",{id:o,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(m||b)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":b}),children:[m&&(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":b}),children:[(0,e.jsx)(a.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":b}),children:f?.storeBenefits?.reasons?.map(l=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),asChild:!l?.link,className:"no-underline",children:(0,e.jsx)(a.Text,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},l?.id))})]}),(0,e.jsx)(F,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":b}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"})]}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(w,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(w,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(w,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(a.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:y}),i&&(0,e.jsx)("button",{onClick:()=>h(!r),"aria-expanded":r,"aria-controls":y,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&i||!i)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":y,children:c?.contact?.contacts?.map(l=>(0,e.jsxs)(a.Link,{href:l?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(a.Text,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},l?.id))}),E?(0,e.jsx)(D,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:i,onChangeCountry:s?.country}):(0,e.jsx)("div",{className:"desktop:hidden border-b border-[#3D3E3F]","aria-hidden":"true"}),b&&(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(F,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(l=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),className:"group",role:"listitem","aria-label":l?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},l?.id))}),!!c?.payment?.length&&(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(l=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),asChild:!l?.link,role:"listitem","aria-label":l?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},l?.id))})]})]})]})},G=({data:t,isMobile:s,event:i,currentCountry:p,id:o="footer-brand"})=>{const{locale:n="us"}=(0,k.useAiuiContext)();return(0,e.jsxs)("div",{id:o,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsx)("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsx)(a.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(t?.brand?.link,n,"ref=footer"),asChild:!t?.brand?.link,children:(0,e.jsx)(a.Text,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((r,h)=>(0,e.jsxs)(u.Fragment,{children:[h<=0&&(0,e.jsx)("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),(0,e.jsx)(a.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"text-base leading-normal no-underline",children:(0,e.jsx)(a.Text,{html:r?.icon,"aria-hidden":"true"})},r?.id)]},h))]})}),(0,e.jsx)(D,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:s,onChangeCountry:i?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(a.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:i?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},w=({title:t,lists:s,className:i})=>{const{locale:p="us"}=(0,k.useAiuiContext)(),[o,n]=(0,u.useState)(!1),[r,h]=(0,u.useState)(!1),f=(0,B.useMediaQuery)({query:"(max-width: 1439px)"});if((0,u.useEffect)(()=>{h(f)},[f]),!t)return null;const c=`nav-section-${t.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(a.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!o),"aria-expanded":o,"aria-controls":c,"aria-label":o?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:o?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(o&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:s?.map(g=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(g?.link,p,"ref=footer"),className:"no-underline",children:(0,e.jsx)(a.Text,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},F=({title:t,apps:s,className:i})=>{const{locale:p="us"}=(0,k.useAiuiContext)();return!t||!s?.length?null:(0,e.jsxs)("div",{className:i,children:[(0,e.jsx)(a.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:s?.map(o=>(0,e.jsxs)(a.Link,{href:(0,d.getLocalizedPath)(o?.link,p,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":o?.icon?.alt||o?.label||"Download app",children:[(0,e.jsx)("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),o?.label&&(0,e.jsx)(a.Text,{html:o?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},o?.id))})]})},D=({country:t,isMobile:s,className:i,onChangeCountry:p})=>M(t)?(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(a.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),s&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})}):null;var H=(0,S.withLayout)(q);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var Q=Object.create;var M=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(a,t)=>{for(var s in t)M(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Z(t))!F.call(a,i)&&i!==s&&M(a,i,{get:()=>t[i],enumerable:!(h=q(t,i))||h.enumerable});return a};var P=(a,t,s)=>(s=a!=null?Q(j(a)):{},G(t||!a||!a.__esModule?M(s,"default",{value:a,enumerable:!0}):s,a)),K=a=>G(M({},"__esModule",{value:!0}),a);var ee={};J(ee,{default:()=>X});module.exports=K(ee);var e=require("react/jsx-runtime"),r=P(require("react")),R=require("react-responsive"),A=require("../../shared/Styles.js"),C=P(require("../../components/picture.js")),O=P(require("../../components/button.js")),I=require("../../components/heading.js"),
|
|
1
|
+
"use strict";var Q=Object.create;var M=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(a,t)=>{for(var s in t)M(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Z(t))!F.call(a,i)&&i!==s&&M(a,i,{get:()=>t[i],enumerable:!(h=q(t,i))||h.enumerable});return a};var P=(a,t,s)=>(s=a!=null?Q(j(a)):{},G(t||!a||!a.__esModule?M(s,"default",{value:a,enumerable:!0}):s,a)),K=a=>G(M({},"__esModule",{value:!0}),a);var ee={};J(ee,{default:()=>X});module.exports=K(ee);var e=require("react/jsx-runtime"),r=P(require("react")),R=require("react-responsive"),A=require("../../shared/Styles.js"),C=P(require("../../components/picture.js")),O=P(require("../../components/button.js")),I=require("../../components/heading.js"),b=require("../../components/tabs.js"),E=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),_=P(require("../SwiperBox/index.js")),L=require("../../shared/mimeType.js"),D=require("../../hooks/useExposure.js"),V=require("../../shared/trackUrlRef.js"),H=require("../AiuiProvider/index.js");const w="image",y="p1_banner",W=({data:a,configuration:t,jIndex:s})=>{const[h,i]=(0,r.useState)(!1),m=(0,R.useMediaQuery)({query:"(max-width: 768px)"}),u=(0,r.useRef)(null),v=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,D.useExposure)(u,{componentType:w,componentName:y,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,r.useEffect)(()=>{i(m)},[m]);const{theme:n="light",title:c,description:o,imageUrl:d,primaryButton:f,secondaryButton:g,imageMobileUrl:k,blockLink:x,video:$,youtubeId:N,isYouTube:B}=a,T="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",v(),{"rounded-box":!0,"aiui-dark":n==="dark","h-[400px]":h},"text-info-primary"),ref:u,children:[x&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(x||"",t?.locale||"us"),`${w}_${y}`),"data-headless-type-name":`${w}#${y}`,"data-headless-title-desc-button":`${c}#${o}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,L.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:(0,p.cn)("h-full object-cover",x&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,L.isVideo)(k?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:k?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:k?.url||d?.url,alt:k?.alt||d?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(I.Heading,{size:3,as:"h3",className:"item-title",html:c}),(0,e.jsx)(I.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:o})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[g&&g.text&&(0,e.jsxs)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(g.link||"",t?.locale||"us"),`${w}_${y}`),"data-headless-type-name":`${w}#${y}`,"data-headless-title-desc-button":`${c}#${o}#${g?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[g.text,(0,e.jsx)("span",{className:"sr-only",children:c??o})]}),f&&f.text&&(0,e.jsx)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-right pointer-events-auto"),variant:"primary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(f.link||"",t?.locale||"us"),`${w}_${y}`),"data-headless-type-name":`${w}#${y}`,"data-headless-title-desc-button":`${c}#${o}#${f.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:f.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||N)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||N,B)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:n==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},z=({items:a=[],shape:t,locale:s,activeTab:h,onVideoPlayBtnClick:i})=>{const m=u=>{const v=a?.length,n=v>3,c=v>2,o=v>1;switch(!0){case u>=1440:case u>=1024:return n?3:v;case u>=768:return n||c?2.3:o?2:1;default:return o?1.2:1}};return(0,e.jsx)(_.default,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:a||[],configuration:{shape:t,num:a.length,locale:s,activeTab:h,onVideoPlayBtnClick:i}},Slide:W,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:m(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:m(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:m(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:m(1440)}}})},U=r.default.forwardRef((a,t)=>{const{data:s,className:h,...i}=a,{shape:m,items:u=[],isShowTab:v=!1,tabs:n,tabAlign:c="left"}=s,[o,d]=(0,r.useState)(!1),[f,g]=(0,r.useState)(""),[k,x]=(0,r.useState)(""),[$,N]=(0,r.useState)(n?.[0]?.id??""),{locale:B="us"}=(0,H.useAiuiContext)(),T=(l,Y)=>{d(!0),Y?x?.(l||""):g?.(l||"")},S=()=>(0,e.jsx)(E.VideoModal,{visible:o,youTubeId:k,videoUrl:f,onCloseModal:()=>d(!1)});return!v||!n||n.length===0?(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary max-w-[100dvw]",h),children:[u&&u.length>0?(0,e.jsx)(z,{items:u,shape:m,locale:B,onVideoPlayBtnClick:T}):null,o&&S()]}):(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary max-w-[100dvw]",h),children:[(0,e.jsxs)(b.Tabs,{value:$,onValueChange:N,align:c,children:[(0,e.jsx)("div",{className:"mb-6",children:(0,e.jsx)(b.TabsList,{children:n.map(l=>(0,e.jsx)(b.TabsTrigger,{value:l.id,children:l.label},l.id))})}),n.map(l=>(0,e.jsx)(b.TabsContent,{value:l.id,children:l.items&&l.items.length>0?(0,e.jsx)(z,{items:l.items,shape:m,locale:B,activeTab:l.id,onVideoPlayBtnClick:T}):null},l.id))]}),o&&S()]})});U.displayName="GraphicOverlayBlock";var X=(0,A.withLayout)(U);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var Oe=Object.create;var M=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,_e=Object.prototype.hasOwnProperty;var qe=(t,p)=>{for(var o in p)M(t,o,{get:p[o],enumerable:!0})},se=(t,p,o,T)=>{if(p&&typeof p=="object"||typeof p=="function")for(let g of Ge(p))!_e.call(t,g)&&g!==o&&M(t,g,{get:()=>p[g],enumerable:!(T=Ue(p,g))||T.enumerable});return t};var H=(t,p,o)=>(o=t!=null?Oe(Je(t)):{},se(p||!t||!t.__esModule?M(o,"default",{value:t,enumerable:!0}):o,t)),Fe=t=>se(M({},"__esModule",{value:!0}),t);var $e={};qe($e,{default:()=>Xe});module.exports=Fe($e);var e=require("react/jsx-runtime"),u=H(require("react")),V=H(require("gsap")),z=require("gsap/dist/ScrollTrigger"),R=H(require("jump.js")),f=require("./mediaResolver.js"),pe=require("react-intersection-observer"),ce=H(require("../../helpers/ScrollLoadVideo.js")),l=require("../../components/index.js"),m=require("../../helpers/index.js"),I=require("class-variance-authority"),ue=require("../../shared/Styles.js"),me=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),v=require("../../shared/track.js"),de=require("../../helpers/utils.js"),fe=require("../AiuiProvider/index.js"),ge=require("../../components/button.js"),be=require("../VideoModal/index.js"),ve=H(require("./HeroBannerCarousel.js"));const y="hero_banner",We=(0,I.cva)("hero-banner-content lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"tablet:px-[32px] laptop:top-1/2 laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] laptop:-translate-y-1/2 left-0 px-[16px]",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),Ye=(0,I.cva)("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Ze=(0,I.cva)("hero-banner-button-group lg-desktop:gap-x-3 pointer-events-auto flex flex-wrap items-center gap-x-2 gap-y-3",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Ke=(0,I.cva)("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Qe=({size:t="base"})=>{const{width:p,height:o}=ge.sizeMap[t];return(0,e.jsx)("svg",{width:p,height:o,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},le=u.default.forwardRef(({data:t,className:p,classNames:o={},onSecondaryClick:T,onPrimaryClick:g,onTertiaryClick:_,jumpOptions:xe={},a11yLabels:ye,...q},F)=>{const{locale:W,pageHandle:ke}=(0,fe.useAiuiContext)(),Y=t.mode!=="single"&&!!t.items&&t.items.length>0,E={...{duration:500,offset:0},...xe},L=r=>!r||!W?r:(0,de.getLocalizedPath)(r,W),{label:Z,title:c,subtitle:a,endDate:K,endDate_tz:he,dateFormat:Te,pcImage:D,isShowVideo:Q,isVideoLoop:we=!0,primaryButton:i,secondaryButton:n,tertiaryButton:s,theme:Be="light",size:j="default",titleSize:A,caption:X=[],blockLink:S,iconArray:$,align:w="left",enableParallax:ee=!0}=t,O=Array.isArray(X)?X:[],Ne=Array.isArray($)?$:void 0,te=(0,f.useMediaTier)(),re=(0,f.buildPictureSource)(t),Ce=(0,f.resolveTierMedia)(t,te,"video")?.url||"",[ne,oe]=(0,u.useState)(!1),{ref:He,inView:ae}=(0,pe.useInView)(),U=(0,u.useRef)(null),G=(0,u.useRef)(null),J=(0,u.useRef)(null),B=(0,u.useRef)(null),x=(0,u.useRef)(null),b=(0,v.resolveComponentMediaType)(Q),P=(0,k.buildTrackingRef)(ke??"",b,y),h=(0,f.resolveTierMedia)(t,te,b==="video"?"video":"image")?.id||D?.id||"",Ve=c?.trim()||a?.trim()||D?.alt?.trim()||void 0,ze=c!==void 0?c?.trim()||a?.trim()||D?.alt?.trim()||void 0:a&&a.trim()||"",Ie=a&&a.trim()||"";(0,me.useExposure)(x,{componentType:b,componentName:y,componentTitle:ze,componentDescription:Ie,creativeId:h,position:1});const Le=S?(0,k.trackUrlRef)(L(S),P):void 0,Se=n?.link?(0,k.trackUrlRef)(L(n.link),P):void 0,Pe=i?.link?(0,k.trackUrlRef)(L(i.link),P):void 0,Me=s?.link?(0,k.trackUrlRef)(L(s.link),P):void 0,Re=(0,v.buildClickTrackingProps)({interactive:!!S,componentType:b,componentName:y,title:c,description:a,position:1,creativeId:h}),Ee=(0,v.buildClickTrackingProps)({interactive:!0,componentType:b,componentName:y,title:c,description:a,buttonName:"video play",position:1,creativeId:h}),De=(0,v.buildClickTrackingProps)({interactive:!!(n?.link||n?.isCustomSecondaryButton),componentType:b,componentName:y,title:c,description:a,buttonName:n?.text,position:1,creativeId:h}),je=(0,v.buildClickTrackingProps)({interactive:!!(i?.link||i?.isCustomPrimaryButton),componentType:b,componentName:y,title:c,description:a,buttonName:i?.text,position:1,creativeId:h}),Ae=(0,v.buildClickTrackingProps)({interactive:!!(s?.link||s?.isCustomTertiaryButton),componentType:b,componentName:y,title:c,description:a,buttonName:s?.text,position:1,creativeId:h});return(0,u.useImperativeHandle)(F,()=>x.current),(0,u.useEffect)(()=>{if(Y||!ee)return;V.default.registerPlugin(z.ScrollTrigger);function r(){if(!B.current)return;const d=x.current?.clientHeight||100;window.innerHeight<=d?U.current=z.ScrollTrigger.create({trigger:x.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:N=>{const C=N.progress*40-20;V.default.set(B.current,{yPercent:C})}}):(J.current=z.ScrollTrigger.create({trigger:x.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:N=>{const C=N.progress*20-20;V.default.set(B.current,{yPercent:C})}}),G.current=z.ScrollTrigger.create({trigger:x.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:N=>{const C=N.progress*20;V.default.set(B.current,{yPercent:C})}}))}return ae&&r(),()=>{U.current&&U.current.kill(),J.current&&J.current.kill(),G.current&&G.current.kill()}},[ae,t.items,ee]),Y?(0,e.jsx)(ve.default,{data:t,className:p,classNames:o,onPrimaryClick:g,onSecondaryClick:T,onTertiaryClick:_,a11yLabels:ye,ref:F,...q}):(0,e.jsx)("div",{...q,ref:He,"data-ui-component-id":"HeroBanner",className:(0,m.cn)(o.root),children:(0,e.jsxs)("div",{ref:x,className:(0,m.cn)(Be==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":j==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":j==="sm"},p),children:[S&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:Le,tabIndex:-1,"aria-hidden":"true","aria-label":Ve,...Re}),(0,e.jsx)("div",{ref:B,className:(0,m.cn)("absolute left-0 top-0 size-full"),children:Q?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ce.default,{poster:void 0,src:Ce,className:"laptop:w-full absolute inset-0 h-full",videoClassName:"h-full object-cover",muted:!0,loop:we,playsInline:!0,onPlaying:r=>{r.currentTarget.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")}}),(0,e.jsx)("div",{"data-video-poster":"true",className:"laptop:w-full pointer-events-none absolute inset-0 h-full transition-opacity duration-500",children:(0,e.jsx)(l.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})})]}):(0,e.jsx)(l.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})}),(0,e.jsxs)("div",{className:We({align:w}),children:[(0,e.jsxs)("div",{className:Ye({align:w}),children:[Z&&(0,e.jsx)(l.Text,{size:2,as:"p",className:(0,m.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:Z}),c&&(0,e.jsx)(l.Heading,{as:A==="4"?"h1":"h2",html:c,className:(0,m.cn)("hero-banner-title",o.title),size:A?Number(A||"5"):j==="sm"?4:5}),a&&(0,e.jsx)(l.Text,{as:"p",size:2,className:(0,m.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",o.subtitle),html:a}),K&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(l.Countdown,{endDate:K,endDate_tz:he,dateFormat:Te,variant:"spacious",align:w})})]}),(0,e.jsxs)("div",{className:(0,m.cn)(Ze({align:w}),o.buttonGroup),children:[(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[n?.isShowPlayVideoButton&&n?.playVideoButtonText?(0,e.jsxs)(l.Button,{onClick:()=>oe(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",...Ee,children:[n?.playVideoButtonText," ",(0,e.jsx)(Qe,{size:"lg"})]}):n?.text?(0,e.jsxs)(l.Button,{"aria-label":c??a,size:"lg",variant:"secondary",className:(0,m.cn)("hero-banner-secondary-button",o.secondaryButton),as:n?.isCustomSecondaryButton?"button":"a",href:Se,target:n?.target,rel:n?.target==="_blank"?n?.rel??"noopener noreferrer":n?.rel,onClick:r=>{if(n.link?.startsWith("#")){r.preventDefault();const d=document.querySelector(n.link);d&&(0,R.default)(d,E)}n?.isCustomSecondaryButton&&T?.(t,r,n?.customSecondaryEventId)},...De,children:[n?.text,(0,e.jsx)("span",{className:"sr-only",children:c??a})]}):null,i&&i.text&&(0,e.jsx)(l.Button,{"aria-label":c??a,size:"lg",variant:"primary",className:(0,m.cn)("hero-banner-primary-button",o.primaryButton),as:i?.isCustomPrimaryButton?"button":"a",href:Pe,target:i?.target,rel:i?.target==="_blank"?i?.rel??"noopener noreferrer":i?.rel,onClick:r=>{if(i.link?.startsWith("#")){r.preventDefault();const d=document.querySelector(i.link);d&&(0,R.default)(d,E)}i?.isCustomPrimaryButton&&g?.(t,r,i?.customPrimaryEventId)},...je,children:i.text})]}),s&&s.text&&(0,e.jsxs)(l.Button,{"aria-label":c??a,size:"lg",variant:"link",className:(0,m.cn)("hero-banner-tertiary-button w-auto p-0",o.tertiaryButton),as:s?.isCustomTertiaryButton?"button":"a",href:Me,target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:r=>{if(s.link?.startsWith("#")){r.preventDefault();const d=document.querySelector(s.link);d&&(0,R.default)(d,E)}s?.isCustomTertiaryButton&&_?.(t,r,s?.customTertiaryEventId)},...Ae,children:[s.text,(0,e.jsx)("span",{className:"sr-only",children:c??a})]})]}),(0,e.jsx)("div",{className:Ke({align:w}),children:Ne?.map(r=>(0,e.jsx)("div",{className:"h-12",children:(0,e.jsx)(l.Picture,{className:"!inline-block h-full !w-auto",imgClassName:"!w-auto h-full object-contain",loading:"eager",alt:r?.pcImage?.alt||"",source:r?.pcImage?.url})},r?.pcImage?.url||r?.pcImage?.alt))})]}),O.length>0&&(0,e.jsx)("div",{className:(0,m.cn)("hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",o.captionGroup),children:O.map((r,d)=>(0,e.jsxs)(u.default.Fragment,{children:[(0,e.jsx)(l.Text,{size:2,className:(0,m.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:r.title}),d<O.length-1&&(0,e.jsx)("div",{className:(0,m.cn)("bg-info-primary w-px")})]},r.title))}),ne&&(0,e.jsx)(be.VideoModal,{visible:ne,videoUrl:n?.isYoutubeVideo?void 0:n?.videoUrl?.url,youTubeId:n?.isYoutubeVideo?n?.youtubeId:void 0,onCloseModal:()=>oe(!1)})]})})});le.displayName="HeroBanner";var Xe=(0,ue.withLayout)(le);
|
|
1
|
+
"use strict";"use client";var Ue=Object.create;var M=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var Fe=(t,p)=>{for(var o in p)M(t,o,{get:p[o],enumerable:!0})},le=(t,p,o,T)=>{if(p&&typeof p=="object"||typeof p=="function")for(let g of Je(p))!qe.call(t,g)&&g!==o&&M(t,g,{get:()=>p[g],enumerable:!(T=Ge(p,g))||T.enumerable});return t};var C=(t,p,o)=>(o=t!=null?Ue(_e(t)):{},le(p||!t||!t.__esModule?M(o,"default",{value:t,enumerable:!0}):o,t)),We=t=>le(M({},"__esModule",{value:!0}),t);var et={};Fe(et,{default:()=>$e});module.exports=We(et);var e=require("react/jsx-runtime"),m=C(require("react")),L=C(require("gsap")),V=require("gsap/dist/ScrollTrigger"),P=C(require("jump.js")),f=require("./mediaResolver.js"),pe=require("react-intersection-observer"),ue=C(require("../../helpers/ScrollLoadVideo.js")),c=require("../../components/index.js"),d=require("../../helpers/index.js"),S=require("class-variance-authority"),me=require("../../shared/Styles.js"),de=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),v=require("../../shared/track.js"),fe=require("../../helpers/utils.js"),ge=require("../AiuiProvider/index.js"),be=require("../../components/button.js"),ve=require("../VideoModal/index.js"),ye=C(require("./HeroBannerCarousel.js"));const x="hero_banner",Ye=(0,S.cva)("hero-banner-content lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"laptop:top-1/2 px-grid laptop:-translate-y-1/2 left-0",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),Ze=(0,S.cva)("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Ke=(0,S.cva)("hero-banner-button-group lg-desktop:gap-x-3 pointer-events-auto flex flex-wrap items-center gap-x-2 gap-y-3",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Qe=(0,S.cva)("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Xe=({size:t="base"})=>{const{width:p,height:o}=be.sizeMap[t];return(0,e.jsx)("svg",{width:p,height:o,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ce=m.default.forwardRef(({data:t,className:p,classNames:o={},onSecondaryClick:T,onPrimaryClick:g,onTertiaryClick:_,jumpOptions:xe={},a11yLabels:ke,...q},F)=>{const{locale:W,pageHandle:he}=(0,ge.useAiuiContext)(),Y=t.mode!=="single"&&!!t.items&&t.items.length>0,R={...{duration:500,offset:0},...xe},z=r=>!r||!W?r:(0,fe.getLocalizedPath)(r,W),{label:Z,title:u,subtitle:i,endDate:K,endDate_tz:Te,dateFormat:we,pcImage:D,isShowVideo:Q,isVideoLoop:Be=!0,primaryButton:s,secondaryButton:n,tertiaryButton:l,theme:He="light",size:j="default",titleSize:A,caption:X=[],blockLink:I,iconArray:$,align:w="left",enableParallax:ee=!0}=t,O=Array.isArray(X)?X:[],Ne=Array.isArray($)?$:void 0,te=(0,f.useMediaTier)(),re=(0,f.buildPictureSource)(t),Ce=(0,f.resolveTierMedia)(t,te,"video")?.url||"",[ne,oe]=(0,m.useState)(!1),{ref:Le,inView:ae}=(0,pe.useInView)(),U=(0,m.useRef)(null),G=(0,m.useRef)(null),J=(0,m.useRef)(null),B=(0,m.useRef)(null),y=(0,m.useRef)(null),b=(0,v.resolveComponentMediaType)(Q),E=(0,k.buildTrackingRef)(he??"",b,x),h=(0,f.resolveTierMedia)(t,te,b==="video"?"video":"image")?.id||D?.id||"",Ve=u?.trim()||i?.trim()||D?.alt?.trim()||void 0,Se=u!==void 0?u?.trim()||i?.trim()||D?.alt?.trim()||void 0:i&&i.trim()||"",ze=i&&i.trim()||"";(0,de.useExposure)(y,{componentType:b,componentName:x,componentTitle:Se,componentDescription:ze,creativeId:h,position:1});const Ie=I?(0,k.trackUrlRef)(z(I),E):void 0,Ee=n?.link?(0,k.trackUrlRef)(z(n.link),E):void 0,Me=s?.link?(0,k.trackUrlRef)(z(s.link),E):void 0,Pe=l?.link?(0,k.trackUrlRef)(z(l.link),E):void 0,Re=(0,v.buildClickTrackingProps)({interactive:!!I,componentType:b,componentName:x,title:u,description:i,position:1,creativeId:h}),De=(0,v.buildClickTrackingProps)({interactive:!0,componentType:b,componentName:x,title:u,description:i,buttonName:"video play",position:1,creativeId:h}),je=(0,v.buildClickTrackingProps)({interactive:!!(n?.link||n?.isCustomSecondaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:n?.text,position:1,creativeId:h}),Ae=(0,v.buildClickTrackingProps)({interactive:!!(s?.link||s?.isCustomPrimaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:s?.text,position:1,creativeId:h}),Oe=(0,v.buildClickTrackingProps)({interactive:!!(l?.link||l?.isCustomTertiaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:l?.text,position:1,creativeId:h});return(0,m.useImperativeHandle)(F,()=>y.current),(0,m.useEffect)(()=>{if(Y||!ee)return;L.default.registerPlugin(V.ScrollTrigger);function r(){if(!B.current)return;const a=y.current?.clientHeight||100;window.innerHeight<=a?U.current=V.ScrollTrigger.create({trigger:y.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:H=>{const N=H.progress*40-20;L.default.set(B.current,{yPercent:N})}}):(J.current=V.ScrollTrigger.create({trigger:y.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:H=>{const N=H.progress*20-20;L.default.set(B.current,{yPercent:N})}}),G.current=V.ScrollTrigger.create({trigger:y.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:H=>{const N=H.progress*20;L.default.set(B.current,{yPercent:N})}}))}return ae&&r(),()=>{U.current&&U.current.kill(),J.current&&J.current.kill(),G.current&&G.current.kill()}},[ae,t.items,ee]),Y?(0,e.jsx)(ye.default,{data:t,className:p,classNames:o,onPrimaryClick:g,onSecondaryClick:T,onTertiaryClick:_,a11yLabels:ke,ref:F,...q}):(0,e.jsx)("div",{...q,ref:Le,"data-ui-component-id":"HeroBanner",className:(0,d.cn)(o.root),children:(0,e.jsxs)("div",{ref:y,className:(0,d.cn)(He==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":j==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":j==="sm"},p),children:[I&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:Ie,tabIndex:-1,"aria-hidden":"true","aria-label":Ve,...Re}),(0,e.jsx)("div",{ref:B,className:(0,d.cn)("absolute left-0 top-0 size-full"),children:Q?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ue.default,{poster:void 0,src:Ce,className:"laptop:w-full absolute inset-0 h-full transition-opacity duration-500",videoLayerClassName:"opacity-0",videoClassName:"h-full object-cover",muted:!0,loop:Be,playsInline:!0,onPlaying:r=>{const a=r.currentTarget;a.parentElement?.classList.remove("opacity-0"),a.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:r=>{const a=r.currentTarget;if(a.currentTime>=.5)return;a.parentElement?.classList.add("opacity-0"),a.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),(0,e.jsx)("div",{"data-video-poster":"true",className:"laptop:w-full bg-container-primary pointer-events-none absolute inset-0 h-full transition-opacity duration-500",children:(0,e.jsx)(c.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})})]}):(0,e.jsx)(c.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})}),(0,e.jsxs)("div",{className:Ye({align:w}),children:[(0,e.jsxs)("div",{className:Ze({align:w}),children:[Z&&(0,e.jsx)(c.Text,{size:2,as:"p",className:(0,d.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:Z}),u&&(0,e.jsx)(c.Heading,{as:A==="4"?"h1":"h2",html:u,className:(0,d.cn)("hero-banner-title",o.title),size:A?Number(A||"5"):j==="sm"?4:5}),i&&(0,e.jsx)(c.Text,{as:"p",size:2,className:(0,d.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",o.subtitle),html:i}),K&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(c.Countdown,{endDate:K,endDate_tz:Te,dateFormat:we,variant:"spacious",align:w})})]}),(0,e.jsxs)("div",{className:(0,d.cn)(Ke({align:w}),o.buttonGroup),children:[(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[n?.isShowPlayVideoButton&&n?.playVideoButtonText?(0,e.jsxs)(c.Button,{onClick:()=>oe(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",...De,children:[n?.playVideoButtonText," ",(0,e.jsx)(Xe,{size:"lg"})]}):n?.text?(0,e.jsxs)(c.Button,{"aria-label":u??i,size:"lg",variant:"secondary",className:(0,d.cn)("hero-banner-secondary-button",o.secondaryButton),as:n?.isCustomSecondaryButton?"button":"a",href:Ee,target:n?.target,rel:n?.target==="_blank"?n?.rel??"noopener noreferrer":n?.rel,onClick:r=>{if(n.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(n.link);a&&(0,P.default)(a,R)}n?.isCustomSecondaryButton&&T?.(t,r,n?.customSecondaryEventId)},...je,children:[n?.text,(0,e.jsx)("span",{className:"sr-only",children:u??i})]}):null,s&&s.text&&(0,e.jsx)(c.Button,{"aria-label":u??i,size:"lg",variant:"primary",className:(0,d.cn)("hero-banner-primary-button",o.primaryButton),as:s?.isCustomPrimaryButton?"button":"a",href:Me,target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:r=>{if(s.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(s.link);a&&(0,P.default)(a,R)}s?.isCustomPrimaryButton&&g?.(t,r,s?.customPrimaryEventId)},...Ae,children:s.text})]}),l&&l.text&&(0,e.jsxs)(c.Button,{"aria-label":u??i,size:"lg",variant:"link",className:(0,d.cn)("hero-banner-tertiary-button w-auto p-0",o.tertiaryButton),as:l?.isCustomTertiaryButton?"button":"a",href:Pe,target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:r=>{if(l.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(l.link);a&&(0,P.default)(a,R)}l?.isCustomTertiaryButton&&_?.(t,r,l?.customTertiaryEventId)},...Oe,children:[l.text,(0,e.jsx)("span",{className:"sr-only",children:u??i})]})]}),(0,e.jsx)("div",{className:Qe({align:w}),children:Ne?.map(r=>(0,e.jsx)("div",{className:"h-12",children:(0,e.jsx)(c.Picture,{className:"!inline-block h-full !w-auto",imgClassName:"!w-auto h-full object-contain",loading:"eager",alt:r?.pcImage?.alt||"",source:r?.pcImage?.url})},r?.pcImage?.url||r?.pcImage?.alt))})]}),O.length>0&&(0,e.jsx)("div",{className:(0,d.cn)("hero-banner-caption-group laptop:gap-3 px-grid desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 pb-[16px]",o.captionGroup),children:O.map((r,a)=>(0,e.jsxs)(m.default.Fragment,{children:[(0,e.jsx)(c.Text,{size:2,className:(0,d.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:r.title}),a<O.length-1&&(0,e.jsx)("div",{className:(0,d.cn)("bg-info-primary w-px")})]},r.title))}),ne&&(0,e.jsx)(ve.VideoModal,{visible:ne,videoUrl:n?.isYoutubeVideo?void 0:n?.videoUrl?.url,youTubeId:n?.isYoutubeVideo?n?.youtubeId:void 0,onCloseModal:()=>oe(!1)})]})})});ce.displayName="HeroBanner";var $e=(0,me.withLayout)(ce);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var et=Object.create;var re=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var rt=(o,c)=>{for(var f in c)re(o,f,{get:c[f],enumerable:!0})},Le=(o,c,f,H)=>{if(c&&typeof c=="object"||typeof c=="function")for(let T of nt(c))!at.call(o,T)&&T!==f&&re(o,T,{get:()=>c[T],enumerable:!(H=tt(c,T))||H.enumerable});return o};var Ve=(o,c,f)=>(f=o!=null?et(ot(o)):{},Le(c||!o||!o.__esModule?re(f,"default",{value:o,enumerable:!0}):f,o)),it=o=>Le(re({},"__esModule",{value:!0}),o);var ut={};rt(ut,{default:()=>ct});module.exports=it(ut);var n=require("react/jsx-runtime"),i=Ve(require("react")),se=require("swiper/react"),Be=Ve(require("../../helpers/ScrollLoadVideo.js")),C=require("../../helpers/index.js"),S=require("./mediaResolver.js"),p=require("../../components/index.js"),Pe=require("../../hooks/useCarouselPlayback.js"),j=require("../../shared/CarouselControls.js"),E=require("../../shared/track.js"),q=require("../../shared/trackUrlRef.js"),Ne=require("../../hooks/useExposure.js"),_e=require("../AiuiProvider/index.js"),He=require("../VideoModal/index.js"),mt=require("swiper/css");const st=({size:o="base"})=>{const c=o==="lg"?"20":o==="sm"?"16":"18";return(0,n.jsx)("svg",{width:c,height:c,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ie="hero_banner",lt=({data:o,isActive:c,videoRef:f,slideIndex:H,containerSize:T="default",theme:le="light",slideLabel:de,position:J,locale:B,pageHandle:d,onPlayVideo:$,onPrimaryClick:K,onSecondaryClick:y,onTertiaryClick:ce})=>{const{pcImage:O,isVideoLoop:ue=!0,isShowVideo:A,title:w,subtitle:P,label:z,endDate:G,endDate_tz:Q,dateFormat:X,iconArray:k,caption:I,blockLink:L,primaryButton:u,secondaryButton:s,tertiaryButton:m,align:R="left",titleSize:F}=o,U=(0,S.useMediaTier)(),N=(0,S.buildPictureSource)(o),b=(0,S.resolveTierMedia)(o,"lgDesktop","image")?.alt||O?.alt||"",pe=(0,S.resolveTierMedia)(o,U,"video")?.url||"",x=!!N&&!/\.(mp4|mov|webm|m4v)(\?|$)/i.test(N),V=(0,E.resolveComponentMediaType)(A),me=(0,S.resolveTierMedia)(o,U,A?"video":"image")?.id||O?.id||"",ge=`${(0,q.buildTrackingRef)(d??"",V,ie)}_${J}`,ee=a=>a&&B?(0,C.getLocalizedPath)(a,B):a,D=a=>a?(0,q.trackUrlRef)(ee(a),ge):void 0,M=(a,l)=>(0,E.buildClickTrackingProps)({interactive:a,componentType:V,componentName:ie,title:w,description:P,buttonName:l,position:J,creativeId:me});return(0,n.jsxs)("div",{"data-ui-component-id":"HeroBannerSlide",role:"group","aria-roledescription":"slide","aria-label":de,className:(0,C.cn)("text-info-primary relative w-full overflow-hidden transition-colors duration-500",le==="dark"&&"aiui-dark",T==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]"),children:[L&&(0,n.jsx)("a",{className:"absolute inset-0 z-10",href:D(L),tabIndex:-1,"aria-hidden":"true","aria-label":w?.trim()||P?.trim()||b||void 0,...M(!0)}),A?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(Be.default,{videoRef:f,src:pe,poster:void 0,className:"absolute inset-0 size-full",videoClassName:"size-full object-cover",muted:!0,loop:ue,playsInline:!0,onPlaying:a=>{a.currentTarget.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:a=>{const l=a.currentTarget;if(l.currentTime>=.5)return;l.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),x&&(0,n.jsx)("div",{"data-video-poster":"true",className:"pointer-events-none absolute inset-0 size-full transition-opacity duration-500",children:(0,n.jsx)(p.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:H===0?"eager":"lazy",fetchPriority:H===0?"high":"auto",alt:b,source:N})})]}):(0,n.jsx)(p.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:b,source:N}),(0,n.jsxs)("div",{className:(0,C.cn)("laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px] transition-colors duration-500",R==="center"?"left-1/2 -translate-x-1/2 items-center text-center":"tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] left-0 px-[16px]"),children:[(0,n.jsxs)("div",{className:(0,C.cn)("tablet:max-w-[704px] laptop:max-w-[440px] desktop:max-w-[648px] lg-desktop:max-w-[824px] max-w-[358px] transition-colors duration-500",R==="center"?"text-center":"laptop:text-left"),children:[z&&(0,n.jsx)(p.Text,{size:2,as:"p",className:(0,C.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:z}),w&&(0,n.jsx)(p.Heading,{as:F==="4"?"h1":"h2",html:w,size:F?Number(F||"5"):T==="sm"?4:5}),P&&(0,n.jsx)(p.Text,{as:"p",size:2,className:"font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",html:P}),G&&(0,n.jsx)("div",{className:"mt-3",children:(0,n.jsx)(p.Countdown,{endDate:G,endDate_tz:Q,dateFormat:X,variant:"spacious",align:R})})]}),(u?.text||s?.text||m?.text)&&(0,n.jsxs)("div",{className:(0,C.cn)("lg-desktop:gap-3 pointer-events-auto flex flex-wrap items-center gap-2",R==="center"?"justify-center":"laptop:justify-start"),children:[s?.isShowPlayVideoButton&&s?.playVideoButtonText?(0,n.jsxs)(p.Button,{size:"lg",variant:"secondary",className:"hero-banner-play-video-button",onClick:()=>$?.(),...M(!0,"video play"),children:[s.playVideoButtonText," ",(0,n.jsx)(st,{size:"lg"})]}):s?.text?(0,n.jsxs)(p.Button,{size:"lg",variant:"secondary",as:s?.isCustomSecondaryButton?"button":"a",href:D(s.link),target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:a=>s?.isCustomSecondaryButton&&y?.(o,a,s?.customSecondaryEventId),...M(!!(s.link||s.isCustomSecondaryButton),s.text),children:[s.text,(0,n.jsx)("span",{className:"sr-only",children:w??P})]}):null,u?.text&&(0,n.jsx)(p.Button,{size:"lg",variant:"primary",as:u?.isCustomPrimaryButton?"button":"a",href:D(u.link),target:u?.target,rel:u?.target==="_blank"?u?.rel??"noopener noreferrer":u?.rel,onClick:a=>u?.isCustomPrimaryButton&&K?.(o,a,u?.customPrimaryEventId),...M(!!(u.link||u.isCustomPrimaryButton),u.text),children:u.text}),m?.text&&(0,n.jsxs)(p.Button,{size:"lg",variant:"link",className:"tablet:basis-auto basis-full",as:m?.isCustomTertiaryButton?"button":"a",href:D(m.link),target:m?.target,rel:m?.target==="_blank"?m?.rel??"noopener noreferrer":m?.rel,onClick:a=>m?.isCustomTertiaryButton&&ce?.(o,a,m?.customTertiaryEventId),...M(!!(m.link||m.isCustomTertiaryButton),m.text),children:[m.text,(0,n.jsx)("span",{className:"sr-only",children:w??P})]})]}),k&&k.length>0&&(0,n.jsx)("div",{className:(0,C.cn)("flex items-center gap-2",R==="center"?"justify-center":"justify-start"),children:k.map(a=>(0,n.jsx)("div",{className:"h-12",children:(0,n.jsx)(p.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:a?.pcImage?.alt||"",source:a?.pcImage?.url})},a?.pcImage?.url||a?.pcImage?.alt))})]}),I&&I.length>0&&(0,n.jsx)("div",{className:"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:I.map((a,l)=>(0,n.jsxs)(i.default.Fragment,{children:[(0,n.jsx)(p.Text,{size:2,className:"hero-banner-product-text tablet:w-[108px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]",html:a.title}),l<I.length-1&&(0,n.jsx)("div",{className:"bg-info-primary w-px"})]},a.title))})]})},dt={prevSlide:"Previous slide",nextSlide:"Next slide",pauseAutoplay:"Pause autoplay",playAutoplay:"Play autoplay",pauseVideo:"Pause video",playVideo:"Play video",slideStatus:"Slide",carouselLabel:"Banner carousel"},Ee=i.default.forwardRef(({data:o,className:c,classNames:f={},a11yLabels:H,onPrimaryClick:T,onSecondaryClick:le,onTertiaryClick:de,...J},B)=>{const d=o.items||[],$=o.carousel,K=$?.size??o.size??"default",y={...dt,...H},{locale:ce,pageHandle:O,trackingData:ue}=(0,_e.useAiuiContext)(),A=(0,S.useMediaTier)(),w=(0,q.buildPageGroup)({pageHandle:O,pageGroup:ue?.pageGroup}),P=(0,i.useRef)(null),[z,G]=(0,i.useState)(null),[Q,X]=(0,i.useState)(null),[k,I]=(0,i.useState)(null),[L,u]=(0,i.useState)(null),s=(0,i.useRef)(d);(0,i.useEffect)(()=>{s.current=d});const m=e=>e!==void 0&&e!==999&&e>=5,R=e=>e!==void 0&&e!==999&&e>=1&&e<=30,F=$?.autoplaySeconds,U=e=>{const t=e?.autoplaySeconds;return R(t)?t:m(F)?F:void 0},N=d.length>1&&d.some(e=>U(e)!==void 0),b=(0,i.useRef)(d.map(()=>i.default.createRef())),pe=($?.showArrows??!0)&&d.length>1,x=(0,i.useCallback)((e,t)=>{(0,E.gaTrack)({event:"ga4Event",event_name:e,event_parameters:t})},[]),V=(0,i.useCallback)(e=>s.current[e]?.isShowVideo?"video":"image",[]),me=(0,i.useCallback)((e,t)=>{t==="swipe"&&x("hero_banner_swipe",{to_index:e}),x("hero_banner_slide_view",{index:e,total:s.current.length,media_type:V(e),trigger:t})},[x,V]),ge=(0,i.useCallback)((e,t,r,v="arrow")=>{x("hero_banner_arrow_click",{direction:e,from_index:t,to_index:r,source:v})},[x]),ee=(0,i.useCallback)((e,t)=>{x(e?"hero_banner_pause":"hero_banner_resume",{index:t,media_type:V(t)})},[x,V]),D=(0,i.useCallback)((e,t)=>{const r=s.current[t];r&&(0,E.trackComponentClick)({pageGroup:w,componentType:"video",componentName:ie,position:t+1,buttonName:e?"video pause":"video play",componentTitle:r.title,componentDescription:r.subtitle,creativeId:(0,S.resolveTierMedia)(r,A,"video")?.id||r.pcImage?.id||""})},[w,A]),M=(0,i.useCallback)(e=>{b.current.forEach((r,v)=>{v!==e&&r.current&&(r.current.pause(),r.current.currentTime=0)});const t=b.current[e];t?.current&&(t.current.currentTime=0,t.current.play()?.catch(()=>{}))},[]),{rootRef:a,activeIndex:l,playbackState:be,resetNonce:Ae,announcement:Ie,activeFrameIntervalSec:he,isTimerRunning:Re,handleSwiperInit:Me,handleSlideChange:ze,handleTransitionEnd:Fe,handleSliderFirstMove:De,goToSlide:xe,goToSlideIndex:je,handlePausePlayClick:qe,notifyVideoPlaying:Se,handleFocus:$e,handleBlur:Oe}=(0,Pe.useCarouselPlayback)({frameCount:d.length,resolveFrameIntervalSec:e=>U(d[e]),isAutoplayEnabled:N,swiperRef:P,slideStatusLabel:y.slideStatus,onSlideMediaSync:M,onSlideChange:me,onArrowNavigate:ge,delaysCountdownForVideo:e=>!!s.current[e]?.isShowVideo,onPauseToggle:(e,t)=>{ee(e,t);const r=b.current[t]?.current;r&&(e?r.pause():r.ended||r.play()?.catch(()=>{}))}}),Ge=(0,i.useCallback)(e=>{a.current=e,typeof B=="function"?B(e):B&&(B.current=e)},[B,a]),h=d[l]??d[0],Ue=(0,E.resolveComponentMediaType)(h?.isShowVideo),Ye=h?.title!==void 0?h?.title?.trim()||h?.subtitle?.trim()||h?.pcImage?.alt?.trim()||void 0:h?.subtitle&&h.subtitle.trim()||"",We=h&&((0,S.resolveTierMedia)(h,A,h.isShowVideo?"video":"image")?.id||h.pcImage?.id)||"";(0,Ne.useExposure)(a,{componentType:Ue,componentName:ie,componentTitle:Ye,componentDescription:h?.subtitle?.trim()||"",creativeId:We,position:1}),(0,i.useEffect)(()=>{G(null),X(null);const e=s.current[l],t=b.current[l]?.current;if(!e?.isShowVideo||!t)return;const r=()=>G(t.ended?"ended":t.paused?"paused":"playing"),v=()=>X(Number.isFinite(t.duration)?t.duration:null),te=()=>{r(),Se(l)};return r(),v(),t.addEventListener("playing",te),t.addEventListener("pause",r),t.addEventListener("ended",r),t.addEventListener("loadedmetadata",v),()=>{t.removeEventListener("playing",te),t.removeEventListener("pause",r),t.removeEventListener("ended",r),t.removeEventListener("loadedmetadata",v)}},[l,Se]),(0,i.useEffect)(()=>{const e=s.current[l];if(!e?.isShowVideo||!e?.isMultiThemeEnabled)return;const t=b.current[l]?.current;if(!t)return;const r=(g,_,ae,ye)=>{if(!(!g||typeof _!="number"||typeof ae!="number"||typeof ye!="number"))return ye>=_&&ye<ae?g:void 0};let v=null;const te=g=>{v=g,I(_=>_&&_.index===l&&_.theme===g?_:{index:l,theme:g})},Ce=g=>{te(r(e.theme_1,e.star_time_1,e.end_time_1,g)??r(e.theme_2,e.star_time_2,e.end_time_2,g)??e.theme??"light")},ne=t;let W=0,Z=0;const ve=typeof ne.requestVideoFrameCallback=="function",Xe=()=>ve?Z!==0:W!==0,fe=()=>{if(!Xe())if(ve){const g=(_,ae)=>{Ce(ae.mediaTime),Z=ne.requestVideoFrameCallback(g)};Z=ne.requestVideoFrameCallback(g)}else{const g=()=>{Ce(t.currentTime),W=requestAnimationFrame(g)};W=requestAnimationFrame(g)}},oe=()=>{ve?(ne.cancelVideoFrameCallback?.(Z),Z=0):(cancelAnimationFrame(W),W=0)},we=()=>{oe(),v&&I({index:l,theme:v})};return t.addEventListener("play",fe),t.addEventListener("pause",oe),t.addEventListener("ended",we),!t.paused&&!t.ended&&fe(),()=>{oe(),t.removeEventListener("play",fe),t.removeEventListener("pause",oe),t.removeEventListener("ended",we)}},[l]),(0,i.useEffect)(()=>{b.current.forEach((e,t)=>{t!==0&&e.current&&(e.current.pause(),e.current.currentTime=0)})},[]),(0,i.useEffect)(()=>{s.current.length!==0&&x("hero_banner_slide_view",{index:0,total:s.current.length,media_type:V(0),trigger:"initial"})},[x,V]);const Ze=!!d[l]?.isShowVideo,Te=he!==void 0,Y=!Te&&Ze&&Q!==null&&Q>5&&z!=="ended"&&z!==null,Je=Te||Y,Ke=Y?z==="paused":be==="STOPPED",Qe=()=>{if(!Y){qe();return}const e=b.current[l]?.current;if(!e)return;const t=!e.paused;t?e.pause():e.play()?.catch(()=>{}),ee(t,l),D(t,l)},ke=k&&k.index===l?k.theme:d[l]?.theme;return(0,n.jsxs)("div",{ref:Ge,role:"region","aria-roledescription":"carousel","aria-label":y.carouselLabel,"data-ui-component-id":"HeroBanner",onFocus:$e,onBlur:Oe,className:(0,C.cn)("hero-banner-carousel group relative w-full overflow-hidden",K==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]",f.root,c),...J,children:[(0,n.jsx)(se.Swiper,{onSwiper:Me,onSlideChange:ze,onSlideChangeTransitionEnd:Fe,onSliderFirstMove:De,slidesPerView:1,loop:!0,initialSlide:0,allowTouchMove:!0,children:d.map((e,t)=>{const r=k&&k.index===t?k.theme:e.theme??"light";return(0,n.jsx)(se.SwiperSlide,{children:({isActive:v})=>(0,n.jsx)(lt,{data:e,isActive:v,slideIndex:t,slideLabel:`${y.slideStatus} ${t+1} / ${d.length}`,videoRef:b.current[t],containerSize:K,theme:r,position:t+1,locale:ce,pageHandle:O,onPlayVideo:()=>u(t),onPrimaryClick:T,onSecondaryClick:le,onTertiaryClick:de})},t)})}),pe&&(0,n.jsx)(j.CarouselArrows,{onPrev:()=>xe("prev"),onNext:()=>xe("next"),prevLabel:y.prevSlide,nextLabel:y.nextSlide}),N&&(0,n.jsx)(j.CarouselProgressControls,{frameCount:d.length,activeIndex:l,resetNonce:Ae,activeFrameIntervalSec:he,isAutoplayEnabled:N,isTimerRunning:Re,onSegmentClick:je,segmentLabel:e=>`${y.slideStatus} ${e+1} / ${d.length}`,classPrefix:"hero-banner",theme:ke}),Je&&(0,n.jsx)(j.CarouselCornerToggle,{isPaused:Ke,onToggle:Qe,pausedLabel:Y?y.playVideo:y.playAutoplay,playingLabel:Y?y.pauseVideo:y.pauseAutoplay,classPrefix:"hero-banner",theme:ke}),(0,n.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Ie}),L!==null&&d[L]?.secondaryButton&&(0,n.jsx)(He.VideoModal,{visible:!0,videoUrl:d[L].secondaryButton?.isYoutubeVideo?void 0:d[L].secondaryButton?.videoUrl?.url,youTubeId:d[L].secondaryButton?.isYoutubeVideo?d[L].secondaryButton?.youtubeId:void 0,onCloseModal:()=>u(null)})]})});Ee.displayName="HeroBannerCarousel";var ct=Ee;
|
|
1
|
+
"use strict";"use client";var et=Object.create;var de=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var rt=(a,c)=>{for(var f in c)de(a,f,{get:c[f],enumerable:!0})},Ee=(a,c,f,A)=>{if(c&&typeof c=="object"||typeof c=="function")for(let k of nt(c))!at.call(a,k)&&k!==f&&de(a,k,{get:()=>c[k],enumerable:!(A=tt(c,k))||A.enumerable});return a};var Ve=(a,c,f)=>(f=a!=null?et(ot(a)):{},Ee(c||!a||!a.__esModule?de(f,"default",{value:a,enumerable:!0}):f,a)),it=a=>Ee(de({},"__esModule",{value:!0}),a);var ut={};rt(ut,{default:()=>ct});module.exports=it(ut);var o=require("react/jsx-runtime"),i=Ve(require("react")),ue=require("swiper/react"),Pe=Ve(require("../../helpers/ScrollLoadVideo.js")),w=require("../../helpers/index.js"),x=require("./mediaResolver.js"),u=require("../../components/index.js"),Ne=require("../../hooks/useCarouselPlayback.js"),j=require("../../shared/CarouselControls.js"),E=require("../../shared/track.js"),q=require("../../shared/trackUrlRef.js"),_e=require("../../hooks/useExposure.js"),He=require("../AiuiProvider/index.js"),Ae=require("../VideoModal/index.js"),mt=require("swiper/css");const st=({size:a="base"})=>{const c=a==="lg"?"20":a==="sm"?"16":"18";return(0,o.jsx)("svg",{width:c,height:c,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ce="hero_banner",lt=({data:a,isActive:c,isAdjacent:f=!1,videoRef:A,slideIndex:k,containerSize:Q="default",theme:pe="light",slideLabel:me,position:V,locale:s,pageHandle:$,onPlayVideo:X,onPrimaryClick:y,onSecondaryClick:ge,onTertiaryClick:ee})=>{const{pcImage:te,isVideoLoop:O=!0,isShowVideo:I,title:B,subtitle:C,label:G,endDate:U,endDate_tz:ne,dateFormat:P,iconArray:R,caption:S,blockLink:Y,primaryButton:l,secondaryButton:d,tertiaryButton:p,align:N="left",titleSize:M}=a,z=(0,x.useMediaTier)(),v=(0,x.buildPictureSource)(a),W=(0,x.resolveTierMedia)(a,"lgDesktop","image")?.alt||te?.alt||"",T=(0,x.resolveTierMedia)(a,z,"video")?.url||"",_=!!v&&!/\.(mp4|mov|webm|m4v)(\?|$)/i.test(v),oe=(0,E.resolveComponentMediaType)(I),ve=(0,x.resolveTierMedia)(a,z,I?"video":"image")?.id||te?.id||"",ae=`${(0,q.buildTrackingRef)($??"",oe,ce)}_${V}`,fe=n=>n&&s?(0,w.getLocalizedPath)(n,s):n,F=n=>n?(0,q.trackUrlRef)(fe(n),ae):void 0,L=(n,b)=>(0,E.buildClickTrackingProps)({interactive:n,componentType:oe,componentName:ce,title:B,description:C,buttonName:b,position:V,creativeId:ve});return(0,o.jsxs)("div",{"data-ui-component-id":"HeroBannerSlide",role:"group","aria-roledescription":"slide","aria-label":me,className:(0,w.cn)("text-info-primary relative w-full overflow-hidden transition-colors duration-500",pe==="dark"&&"aiui-dark",Q==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]"),children:[Y&&(0,o.jsx)("a",{className:"absolute inset-0 z-10",href:F(Y),tabIndex:-1,"aria-hidden":"true","aria-label":B?.trim()||C?.trim()||W||void 0,...L(!0)}),I?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Pe.default,{videoRef:A,src:T,poster:void 0,className:"absolute inset-0 size-full transition-opacity duration-500",videoClassName:"size-full object-cover",videoLayerClassName:"opacity-0",muted:!0,loop:O,playsInline:!0,onPlaying:n=>{const b=n.currentTarget;b.parentElement?.classList.remove("opacity-0"),b.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:n=>{const b=n.currentTarget;if(b.currentTime>=.5)return;b.parentElement?.classList.add("opacity-0"),b.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),_&&(0,o.jsx)("div",{"data-video-poster":"true",className:"bg-container-primary pointer-events-none absolute inset-0 size-full transition-opacity duration-500",children:(0,o.jsx)(u.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:k===0||f?"eager":"lazy",fetchPriority:k===0?"high":"auto",alt:W,source:v})})]}):(0,o.jsx)(u.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:W,source:v}),(0,o.jsxs)("div",{className:(0,w.cn)("laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px] transition-colors duration-500",N==="center"?"left-1/2 -translate-x-1/2 items-center text-center":"px-grid left-0"),children:[(0,o.jsxs)("div",{className:(0,w.cn)("tablet:max-w-[704px] laptop:max-w-[440px] desktop:max-w-[648px] lg-desktop:max-w-[824px] max-w-[358px] transition-colors duration-500",N==="center"?"text-center":"laptop:text-left"),children:[G&&(0,o.jsx)(u.Text,{size:2,as:"p",className:(0,w.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:G}),B&&(0,o.jsx)(u.Heading,{as:M==="4"?"h1":"h2",html:B,size:M?Number(M||"5"):Q==="sm"?4:5}),C&&(0,o.jsx)(u.Text,{as:"p",size:2,className:"font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",html:C}),U&&(0,o.jsx)("div",{className:"mt-3",children:(0,o.jsx)(u.Countdown,{endDate:U,endDate_tz:ne,dateFormat:P,variant:"spacious",align:N})})]}),(l?.text||d?.text||p?.text)&&(0,o.jsxs)("div",{className:(0,w.cn)("lg-desktop:gap-3 pointer-events-auto flex flex-wrap items-center gap-2",N==="center"?"justify-center":"laptop:justify-start"),children:[d?.isShowPlayVideoButton&&d?.playVideoButtonText?(0,o.jsxs)(u.Button,{size:"lg",variant:"secondary",className:"hero-banner-play-video-button",onClick:()=>X?.(),...L(!0,"video play"),children:[d.playVideoButtonText," ",(0,o.jsx)(st,{size:"lg"})]}):d?.text?(0,o.jsxs)(u.Button,{size:"lg",variant:"secondary",as:d?.isCustomSecondaryButton?"button":"a",href:F(d.link),target:d?.target,rel:d?.target==="_blank"?d?.rel??"noopener noreferrer":d?.rel,onClick:n=>d?.isCustomSecondaryButton&&ge?.(a,n,d?.customSecondaryEventId),...L(!!(d.link||d.isCustomSecondaryButton),d.text),children:[d.text,(0,o.jsx)("span",{className:"sr-only",children:B??C})]}):null,l?.text&&(0,o.jsx)(u.Button,{size:"lg",variant:"primary",as:l?.isCustomPrimaryButton?"button":"a",href:F(l.link),target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:n=>l?.isCustomPrimaryButton&&y?.(a,n,l?.customPrimaryEventId),...L(!!(l.link||l.isCustomPrimaryButton),l.text),children:l.text}),p?.text&&(0,o.jsxs)(u.Button,{size:"lg",variant:"link",className:"tablet:basis-auto basis-full",as:p?.isCustomTertiaryButton?"button":"a",href:F(p.link),target:p?.target,rel:p?.target==="_blank"?p?.rel??"noopener noreferrer":p?.rel,onClick:n=>p?.isCustomTertiaryButton&&ee?.(a,n,p?.customTertiaryEventId),...L(!!(p.link||p.isCustomTertiaryButton),p.text),children:[p.text,(0,o.jsx)("span",{className:"sr-only",children:B??C})]})]}),R&&R.length>0&&(0,o.jsx)("div",{className:(0,w.cn)("flex items-center gap-2",N==="center"?"justify-center":"justify-start"),children:R.map(n=>(0,o.jsx)("div",{className:"h-12",children:(0,o.jsx)(u.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:n?.pcImage?.alt||"",source:n?.pcImage?.url})},n?.pcImage?.url||n?.pcImage?.alt))})]}),S&&S.length>0&&(0,o.jsx)("div",{className:"hero-banner-caption-group laptop:gap-3 px-grid desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 pb-[16px]",children:S.map((n,b)=>(0,o.jsxs)(i.default.Fragment,{children:[(0,o.jsx)(u.Text,{size:2,className:"hero-banner-product-text tablet:w-[108px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]",html:n.title}),b<S.length-1&&(0,o.jsx)("div",{className:"bg-info-primary w-px"})]},n.title))})]})},dt={prevSlide:"Previous slide",nextSlide:"Next slide",pauseAutoplay:"Pause autoplay",playAutoplay:"Play autoplay",pauseVideo:"Pause video",playVideo:"Play video",slideStatus:"Slide",carouselLabel:"Banner carousel"},Be=i.default.forwardRef(({data:a,className:c,classNames:f={},a11yLabels:A,onPrimaryClick:k,onSecondaryClick:Q,onTertiaryClick:pe,...me},V)=>{const s=a.items||[],$=a.carousel,X=$?.size??a.size??"default",y={...dt,...A},{locale:ge,pageHandle:ee,trackingData:te}=(0,He.useAiuiContext)(),O=(0,x.useMediaTier)(),I=(0,q.buildPageGroup)({pageHandle:ee,pageGroup:te?.pageGroup}),B=(0,i.useRef)(null),[C,G]=(0,i.useState)(null),[U,ne]=(0,i.useState)(null),[P,R]=(0,i.useState)(null),[S,Y]=(0,i.useState)(null),l=(0,i.useRef)(s);(0,i.useEffect)(()=>{l.current=s});const d=e=>e!==void 0&&e!==999&&e>=5,p=e=>e!==void 0&&e!==999&&e>=1&&e<=30,N=$?.autoplaySeconds,M=e=>{const t=e?.autoplaySeconds;return p(t)?t:d(N)?N:void 0},z=s.length>1&&s.some(e=>M(e)!==void 0),v=(0,i.useRef)(s.map(()=>i.default.createRef())),W=($?.showArrows??!0)&&s.length>1,T=(0,i.useCallback)((e,t)=>{(0,E.gaTrack)({event:"ga4Event",event_name:e,event_parameters:t})},[]),_=(0,i.useCallback)(e=>l.current[e]?.isShowVideo?"video":"image",[]),oe=(0,i.useCallback)((e,t)=>{t==="swipe"&&T("hero_banner_swipe",{to_index:e}),T("hero_banner_slide_view",{index:e,total:l.current.length,media_type:_(e),trigger:t})},[T,_]),ve=(0,i.useCallback)((e,t,r,g="arrow")=>{T("hero_banner_arrow_click",{direction:e,from_index:t,to_index:r,source:g})},[T]),ae=(0,i.useCallback)((e,t)=>{T(e?"hero_banner_pause":"hero_banner_resume",{index:t,media_type:_(t)})},[T,_]),fe=(0,i.useCallback)((e,t)=>{const r=l.current[t];r&&(0,E.trackComponentClick)({pageGroup:I,componentType:"video",componentName:ce,position:t+1,buttonName:e?"video pause":"video play",componentTitle:r.title,componentDescription:r.subtitle,creativeId:(0,x.resolveTierMedia)(r,O,"video")?.id||r.pcImage?.id||""})},[I,O]),F=(0,i.useCallback)(e=>{v.current.forEach((r,g)=>{g!==e&&r.current&&(r.current.pause(),r.current.currentTime=0)});const t=v.current[e];t?.current&&(t.current.currentTime=0,t.current.play()?.catch(()=>{}))},[]),{rootRef:L,activeIndex:n,playbackState:b,resetNonce:ye,announcement:Ie,activeFrameIntervalSec:Te,isTimerRunning:Re,handleSwiperInit:Me,handleSlideChange:ze,handleTransitionEnd:Fe,handleSliderFirstMove:De,goToSlide:xe,goToSlideIndex:je,handlePausePlayClick:qe,notifyVideoPlaying:ke,handleFocus:$e,handleBlur:Oe}=(0,Ne.useCarouselPlayback)({frameCount:s.length,resolveFrameIntervalSec:e=>M(s[e]),isAutoplayEnabled:z,swiperRef:B,slideStatusLabel:y.slideStatus,onSlideMediaSync:F,onSlideChange:oe,onArrowNavigate:ve,delaysCountdownForVideo:e=>!!l.current[e]?.isShowVideo,onPauseToggle:(e,t)=>{ae(e,t);const r=v.current[t]?.current;r&&(e?r.pause():r.ended||r.play()?.catch(()=>{}))}}),Ge=(0,i.useCallback)(e=>{L.current=e,typeof V=="function"?V(e):V&&(V.current=e)},[V,L]),h=s[n]??s[0],Ue=(0,E.resolveComponentMediaType)(h?.isShowVideo),Ye=h?.title!==void 0?h?.title?.trim()||h?.subtitle?.trim()||h?.pcImage?.alt?.trim()||void 0:h?.subtitle&&h.subtitle.trim()||"",We=h&&((0,x.resolveTierMedia)(h,O,h.isShowVideo?"video":"image")?.id||h.pcImage?.id)||"";(0,_e.useExposure)(L,{componentType:Ue,componentName:ce,componentTitle:Ye,componentDescription:h?.subtitle?.trim()||"",creativeId:We,position:1}),(0,i.useEffect)(()=>{G(null),ne(null);const e=l.current[n],t=v.current[n]?.current;if(!e?.isShowVideo||!t)return;const r=()=>G(t.ended?"ended":t.paused?"paused":"playing"),g=()=>ne(Number.isFinite(t.duration)?t.duration:null),D=()=>{r(),ke(n)};return r(),g(),t.addEventListener("playing",D),t.addEventListener("pause",r),t.addEventListener("ended",r),t.addEventListener("loadedmetadata",g),()=>{t.removeEventListener("playing",D),t.removeEventListener("pause",r),t.removeEventListener("ended",r),t.removeEventListener("loadedmetadata",g)}},[n,ke]),(0,i.useEffect)(()=>{const e=l.current[n];if(!e?.isShowVideo||!e?.isMultiThemeEnabled)return;const t=v.current[n]?.current;if(!t)return;const r=(m,H,le,Se)=>{if(!(!m||typeof H!="number"||typeof le!="number"||typeof Se!="number"))return Se>=H&&Se<le?m:void 0};let g=null;const D=m=>{g=m,R(H=>H&&H.index===n&&H.theme===m?H:{index:n,theme:m})},re=m=>{D(r(e.theme_1,e.star_time_1,e.end_time_1,m)??r(e.theme_2,e.star_time_2,e.end_time_2,m)??e.theme??"light")},ie=t;let J=0,K=0;const be=typeof ie.requestVideoFrameCallback=="function",Xe=()=>be?K!==0:J!==0,he=()=>{if(!Xe())if(be){const m=(H,le)=>{re(le.mediaTime),K=ie.requestVideoFrameCallback(m)};K=ie.requestVideoFrameCallback(m)}else{const m=()=>{re(t.currentTime),J=requestAnimationFrame(m)};J=requestAnimationFrame(m)}},se=()=>{be?(ie.cancelVideoFrameCallback?.(K),K=0):(cancelAnimationFrame(J),J=0)},Le=()=>{se(),g&&R({index:n,theme:g})};return t.addEventListener("play",he),t.addEventListener("pause",se),t.addEventListener("ended",Le),!t.paused&&!t.ended&&he(),()=>{se(),t.removeEventListener("play",he),t.removeEventListener("pause",se),t.removeEventListener("ended",Le)}},[n]),(0,i.useEffect)(()=>{v.current.forEach((e,t)=>{t!==0&&e.current&&(e.current.pause(),e.current.currentTime=0)})},[]),(0,i.useEffect)(()=>{l.current.length!==0&&T("hero_banner_slide_view",{index:0,total:l.current.length,media_type:_(0),trigger:"initial"})},[T,_]);const Ze=!!s[n]?.isShowVideo,Ce=Te!==void 0,Z=!Ce&&Ze&&U!==null&&U>5&&C!=="ended"&&C!==null,Je=Ce||Z,Ke=Z?C==="paused":b==="STOPPED",Qe=()=>{if(!Z){qe();return}const e=v.current[n]?.current;if(!e)return;const t=!e.paused;t?e.pause():e.play()?.catch(()=>{}),ae(t,n),fe(t,n)},we=P&&P.index===n?P.theme:s[n]?.theme;return(0,o.jsxs)("div",{ref:Ge,role:"region","aria-roledescription":"carousel","aria-label":y.carouselLabel,"data-ui-component-id":"HeroBanner",onFocus:$e,onBlur:Oe,className:(0,w.cn)("hero-banner-carousel group relative w-full overflow-hidden",X==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]",f.root,c),...me,children:[(0,o.jsx)(ue.Swiper,{onSwiper:Me,onSlideChange:ze,onSlideChangeTransitionEnd:Fe,onSliderFirstMove:De,slidesPerView:1,loop:!0,initialSlide:0,allowTouchMove:!0,children:s.map((e,t)=>{const r=P&&P.index===t?P.theme:e.theme??"light";return(0,o.jsx)(ue.SwiperSlide,{children:({isActive:g,isPrev:D,isNext:re})=>(0,o.jsx)(lt,{data:e,isActive:g,isAdjacent:D||re,slideIndex:t,slideLabel:`${y.slideStatus} ${t+1} / ${s.length}`,videoRef:v.current[t],containerSize:X,theme:r,position:t+1,locale:ge,pageHandle:ee,onPlayVideo:()=>Y(t),onPrimaryClick:k,onSecondaryClick:Q,onTertiaryClick:pe})},t)})}),W&&(0,o.jsx)(j.CarouselArrows,{onPrev:()=>xe("prev"),onNext:()=>xe("next"),prevLabel:y.prevSlide,nextLabel:y.nextSlide}),z&&(0,o.jsx)(j.CarouselProgressControls,{frameCount:s.length,activeIndex:n,resetNonce:ye,activeFrameIntervalSec:Te,isAutoplayEnabled:z,isTimerRunning:Re,onSegmentClick:je,segmentLabel:e=>`${y.slideStatus} ${e+1} / ${s.length}`,classPrefix:"hero-banner",theme:we}),Je&&(0,o.jsx)(j.CarouselCornerToggle,{isPaused:Ke,onToggle:Qe,pausedLabel:Z?y.playVideo:y.playAutoplay,playingLabel:Z?y.pauseVideo:y.pauseAutoplay,classPrefix:"hero-banner",theme:we}),(0,o.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Ie}),S!==null&&s[S]?.secondaryButton&&(0,o.jsx)(Ae.VideoModal,{visible:!0,videoUrl:s[S].secondaryButton?.isYoutubeVideo?void 0:s[S].secondaryButton?.videoUrl?.url,youTubeId:s[S].secondaryButton?.isYoutubeVideo?s[S].secondaryButton?.youtubeId:void 0,onCloseModal:()=>Y(null)})]})});Be.displayName="HeroBannerCarousel";var ct=Be;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var fe=Object.create;var S=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var we=(n,p)=>{for(var g in p)S(n,g,{get:p[g],enumerable:!0})},U=(n,p,g,b)=>{if(p&&typeof p=="object"||typeof p=="function")for(let v of ge(p))!be.call(n,v)&&v!==g&&S(n,v,{get:()=>p[v],enumerable:!(b=he(p,v))||b.enumerable});return n};var _e=(n,p,g)=>(g=n!=null?fe(ve(n)):{},U(p||!n||!n.__esModule?S(g,"default",{value:n,enumerable:!0}):g,n)),ye=n=>U(S({},"__esModule",{value:!0}),n);var Ie={};we(Ie,{default:()=>Te});module.exports=ye(Ie);var e=require("react/jsx-runtime"),a=_e(require("react")),r=require("../../components/index.js"),l=require("../../helpers/utils.js"),ee=require("../../shared/Styles.js"),te=require("../../hooks/useExposure.js"),ie=require("../../hooks/useIntersectionObserver.js"),ae=require("../AiuiProvider/index.js"),k=require("framer-motion");const ke="image",Ne="image_with_text",X=(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,e.jsx)("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),Y=a.default.forwardRef(({data:n,className:p},g)=>{const{title:b,subtitle:v,desc:_,descIcon:M,image:N,padImage:z,mobileImage:E,theme:oe="dark",items:H=[],layout:le="left",mediaType:se="image",datalist:d=[],video:j,padVideo:R,mobVideo:W,button:w,textAlign:m="left",titleTag:re}=n,i=le,{locale:C="us"}=(0,ae.useAiuiContext)(),D=(0,a.useRef)(null),I=(0,a.useRef)(null),L=(0,a.useRef)(null),P=(0,a.useRef)(null),A=(0,a.useRef)(null),[u,ne]=(0,a.useState)(0),q=(0,a.useRef)([]),[$,me]=(0,a.useState)({left:0,width:0}),[y,B]=(0,a.useState)(""),[F,O]=(0,a.useState)(""),[Z,G]=(0,a.useState)(""),c=d.length>0,T=se==="video";(0,te.useExposure)(D,{componentType:ke,componentName:Ne,componentTitle:b,componentDescription:v}),(0,a.useImperativeHandle)(g,()=>D.current),(0,a.useEffect)(()=>{if(d.length>0){const t=q.current[u];if(t){const{offsetLeft:s,offsetWidth:o}=t;me({left:s,width:o})}}},[u,d.length]);const[J,de]=(0,a.useState)(!1);(0,ie.useIntersectionObserverDelay)(A,{once:!0,threshold:.01,callback:()=>{de(!0)}}),(0,a.useEffect)(()=>{if(!J||!T)return;let t="",s="",o="";if(c&&d[u]){const f=d[u];t=f.video?.url||"",s=f.padVideo?.url||t,o=f.mobVideo?.url||t}else t=j?.url||"",s=R?.url||t,o=W?.url||t;t&&B(t),s&&O(s),o&&G(o),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},200)},[J,T,c,u,d,j?.url,R?.url,W?.url]);const pe=(t,s)=>{if(ne(t),s.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),T&&c&&d[t]){const o=d[t];o.video?.url&&B(o.video.url),o.padVideo?.url&&O(o.padVideo.url),o.mobVideo?.url&&G(o.mobVideo.url),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},300)}},ce=()=>!V||!w?.text||i==="top"||i==="bottom"?null:(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":m==="center","flex justify-start":m==="left"}),children:(0,e.jsx)(r.Link,{href:(0,l.getLocalizedPath)(w.link||"",C),className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:X,children:w.text})}),x=H.length>0,V=!!w,K=()=>{if(c&&d[u]){const t=d[u];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return N?`${N?.url},${z?.url||N?.url} 1024, ${E?.url||N?.url} 768`:""},Q=()=>{if(c){const f=d[u],h=f.image?.url,xe=f.imgPad?.url||h,ue=f.imageMob?.url||h;return(0,e.jsx)(k.AnimatePresence,{mode:"wait",children:(0,e.jsx)(k.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:h,src:y,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:xe,src:F||y,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ue,src:Z||y,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},f.video?.url||f.image?.url)})}const t=N?.url,s=z?.url||t,o=E?.url||t;return(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:y,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:s,src:F||y,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:o,src:Z||y,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return(0,e.jsxs)("section",{ref:D,"data-ui-component-id":"ImageWithText",className:(0,l.cn)("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!c,"flex-col":!c&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!c&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":c,"aiui-dark":oe==="dark"},p),children:[c&&(b||_||d.length>0)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":m==="left","text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:"image-with-text__header",children:[(0,e.jsx)(r.Heading,{as:"h3",size:4,html:b,className:"image-with-text__title"}),(0,e.jsx)(r.Text,{as:"p",size:1,html:_,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":m==="center"}),children:(0,e.jsxs)("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[(0,e.jsx)("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:$.left,width:$.width}}),d.map((t,s)=>(0,e.jsx)("div",{ref:o=>{q.current[s]=o},onClick:o=>pe(s,o),className:(0,l.cn)("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",u===s?"image-with-text__tab--active text-black":"text-white"),children:(0,e.jsx)(r.Heading,{as:re??"h3",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},s))]})})]}),!c&&(b||v||_)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__content flex w-full flex-col",{"justify-center":!V,"justify-between":V,"items-start":m==="left"&&x,"items-center":m==="center"&&x,"text-left":m==="left","text-center":m==="center","laptop:order-1":i==="left"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__main-content",{"flex flex-col":V}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&w?.text}),children:[(0,e.jsxs)("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[(0,e.jsx)(r.Heading,{as:"h2",size:4,html:b,className:(0,l.cn)("image-with-text__title",{"text-left":x&&m==="left","text-center":x&&m==="center"})}),v&&(0,e.jsx)(r.Text,{as:"p",size:x?4:3,html:v,className:(0,l.cn)("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!x,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":x,"text-left":x&&m==="left","text-center":x&&m==="center"})})]}),(i==="top"||i==="bottom")&&w?.text&&(0,e.jsx)(r.Link,{href:(0,l.getLocalizedPath)(w.link||"",C),className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:X,children:w.text})]}),!x&&(_||M)&&(0,e.jsxs)("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[M&&(0,e.jsx)("img",{src:M,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),_&&(0,e.jsx)(r.Heading,{as:"h4",size:5,html:_,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),x&&(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:H.map((t,s)=>(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item",{"text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":m==="center","justify-start":m==="left"}),children:[t.icon?.url&&(0,e.jsx)(r.Picture,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),(0,e.jsx)(r.Heading,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),(0,e.jsx)(r.Text,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},s))})]}),ce()]}),(0,e.jsx)("div",{ref:A,className:(0,l.cn)("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":x,"laptop:basis-[63%] desktop:basis-[57%]":x&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":c,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:c?T?Q():(0,e.jsx)(k.AnimatePresence,{mode:"wait",children:(0,e.jsx)(k.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:(0,e.jsx)(r.Picture,{source:K(),alt:d[u].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},d[u].image?.url)}):T?Q():(0,e.jsx)(r.Picture,{source:K(),className:(0,l.cn)("image-with-text__image rounded-box laptop:rounded-box")})})]})});Y.displayName="ImageWithText";var Te=(0,ee.withLayout)(Y);
|
|
1
|
+
"use strict";"use client";var Te=Object.create;var E=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var Se=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Pe=(d,p)=>{for(var f in p)E(d,f,{get:p[f],enumerable:!0})},ie=(d,p,f,w)=>{if(p&&typeof p=="object"||typeof p=="function")for(let v of Se(p))!Me.call(d,v)&&v!==f&&E(d,v,{get:()=>p[v],enumerable:!(w=Ie(p,v))||w.enumerable});return d};var Ve=(d,p,f)=>(f=d!=null?Te(Le(d)):{},ie(p||!d||!d.__esModule?E(f,"default",{value:d,enumerable:!0}):f,d)),Ce=d=>ie(E({},"__esModule",{value:!0}),d);var Ae={};Pe(Ae,{default:()=>He});module.exports=Ce(Ae);var e=require("react/jsx-runtime"),o=Ve(require("react")),s=require("../../components/index.js"),a=require("../../helpers/utils.js"),le=require("../../shared/Styles.js"),D=require("../../shared/mediaGridSpec.js"),se=require("../../shared/ContainerGridContext.js"),re=require("../../hooks/useExposure.js"),ne=require("../../hooks/useIntersectionObserver.js"),me=require("../AiuiProvider/index.js"),N=require("framer-motion");const Ee="image",De="image_with_text",ze={1:"grid-cols-1",2:"grid-cols-2"},Re={1:"tablet:grid-cols-1",2:"tablet:grid-cols-2",3:"tablet:grid-cols-3",4:"tablet:grid-cols-4"},je={1:"laptop:grid-cols-1",2:"laptop:grid-cols-2"},ae=(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,e.jsx)("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),oe=o.default.forwardRef(({data:d,className:p},f)=>{const{title:w,subtitle:v,desc:_,descIcon:z,image:T,padImage:j,mobileImage:H,theme:de="dark",items:I=[],layout:ce="left",mediaType:pe="image",datalist:c=[],video:A,padVideo:W,mobVideo:$,button:b,textAlign:r="left",titleTag:xe,caption:L}=d,i=ce,{locale:q="us"}=(0,me.useAiuiContext)(),R=(0,o.useRef)(null),M=(0,o.useRef)(null),P=(0,o.useRef)(null),V=(0,o.useRef)(null),B=(0,o.useRef)(null),[x,ue]=(0,o.useState)(0),O=(0,o.useRef)([]),[F,he]=(0,o.useState)({left:0,width:0}),[k,G]=(0,o.useState)(""),[Z,J]=(0,o.useState)(""),[K,Q]=(0,o.useState)(""),n=c.length>0,S=pe==="video",U=(0,se.useContainerGrid)(),X=i==="bottom"?"bottom":"left-right",y=!n&&U?(0,D.resolveMediaGridSpec)(U.gridColumns,X):void 0,ge=y?{...(0,D.mediaGridSpecToCssVars)(y),"--mw-l":`${y.laptop.w}px`,"--mw-d":`${y.desktop.w}px`,"--mw-x":`${y.lgDesktop.w}px`}:void 0,fe=ze[Math.min(I.length,2)],ve=Re[Math.min(I.length,4)],we=je[Math.min(I.length,2)];(0,re.useExposure)(R,{componentType:Ee,componentName:De,componentTitle:w,componentDescription:v}),(0,o.useImperativeHandle)(f,()=>R.current),(0,o.useEffect)(()=>{if(c.length>0){const t=O.current[x];if(t){const{offsetLeft:m,offsetWidth:l}=t;he({left:m,width:l})}}},[x,c.length]);const[Y,be]=(0,o.useState)(!1);(0,ne.useIntersectionObserverDelay)(B,{once:!0,threshold:.01,callback:()=>{be(!0)}}),(0,o.useEffect)(()=>{if(!Y||!S)return;let t="",m="",l="";if(n&&c[x]){const h=c[x];t=h.video?.url||"",m=h.padVideo?.url||t,l=h.mobVideo?.url||t}else t=A?.url||"",m=W?.url||t,l=$?.url||t;t&&G(t),m&&J(m),l&&Q(l),setTimeout(()=>{[M.current?.querySelector("video"),P.current?.querySelector("video"),V.current?.querySelector("video")].forEach(g=>{g&&(g.load(),g.play().catch(()=>{}))})},200)},[Y,S,n,x,c,A?.url,W?.url,$?.url]);const _e=(t,m)=>{if(ue(t),m.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),S&&n&&c[t]){const l=c[t];l.video?.url&&G(l.video.url),l.padVideo?.url&&J(l.padVideo.url),l.mobVideo?.url&&Q(l.mobVideo.url),setTimeout(()=>{[M.current?.querySelector("video"),P.current?.querySelector("video"),V.current?.querySelector("video")].forEach(g=>{g&&(g.load(),g.play().catch(()=>{}))})},300)}},ke=()=>!C||!b?.text||i==="bottom"?null:(0,e.jsx)("div",{className:(0,a.cn)("image-with-text__button-wrapper mt-[24px]",{"flex justify-center":r==="center","flex justify-start":r==="left"}),children:(0,e.jsx)(s.Link,{href:(0,a.getLocalizedPath)(b.link||"",q),className:"image-with-text__button lg-desktop:text-[16px] whitespace-nowrap text-[14px] no-underline",suffixIcon:ae,children:b.text})}),u=I.length>0,C=!!b,ee=()=>{if(n&&c[x]){const t=c[x];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return T?`${T?.url},${j?.url||T?.url} 1024, ${H?.url||T?.url} 768`:""},te=()=>{if(n){const h=c[x],g=h.image?.url,ye=h.imgPad?.url||g,Ne=h.imageMob?.url||g;return(0,e.jsx)(N.AnimatePresence,{mode:"wait",children:(0,e.jsx)(N.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:M,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:g,src:k,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ye,src:Z||k,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:V,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:Ne,src:K||k,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},h.video?.url||h.image?.url)})}const t=T?.url,m=j?.url||t,l=H?.url||t;return(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:M,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:k,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:m,src:Z||k,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:V,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:l,src:K||k,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return(0,e.jsxs)("section",{ref:R,"data-ui-component-id":"ImageWithText",className:(0,a.cn)("image-with-text text-info-primary",{flex:!n,"gap-[24px]":!n&&i==="bottom","gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!n&&i!=="bottom","flex-col":!n&&i==="bottom","items-center":i==="left"||i==="right","flex-col laptop:flex-row":!n&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":n,"aiui-dark":de==="dark"},p),children:[n&&(w||_||c.length>0)&&(0,e.jsxs)("div",{className:(0,a.cn)("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":r==="left","text-center":r==="center"}),children:[(0,e.jsxs)("div",{className:"image-with-text__header",children:[(0,e.jsx)(s.Heading,{as:"h3",size:4,html:w,className:"image-with-text__title"}),(0,e.jsx)(s.Text,{as:"p",size:1,html:_,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),(0,e.jsx)("div",{className:(0,a.cn)("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":r==="center"}),children:(0,e.jsxs)("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[(0,e.jsx)("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:F.left,width:F.width}}),c.map((t,m)=>(0,e.jsx)("div",{ref:l=>{O.current[m]=l},onClick:l=>_e(m,l),className:(0,a.cn)("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",x===m?"image-with-text__tab--active text-black":"text-white"),children:(0,e.jsx)(s.Heading,{as:xe??"h3",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},m))]})})]}),!n&&(w||v||_)&&(0,e.jsxs)("div",{className:(0,a.cn)("image-with-text__content flex w-full flex-col",{"justify-center":!C,"justify-between":C,"items-start":r==="left"&&u,"items-center":r==="center"&&u,"text-left":r==="left","text-center":r==="center","laptop:order-1":i==="left"}),children:[(0,e.jsxs)("div",{className:(0,a.cn)("image-with-text__main-content",{"flex flex-col":C}),children:[(0,e.jsxs)("div",{className:(0,a.cn)("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":i==="bottom"&&b?.text}),children:[(0,e.jsxs)("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[(0,e.jsx)(s.Heading,{as:"h2",size:4,html:w,className:(0,a.cn)("image-with-text__title",{"text-left":u&&r==="left","text-center":u&&r==="center"})}),v&&(0,e.jsx)(s.Text,{as:"p",size:u?4:3,html:v,className:(0,a.cn)("image-with-text__subtitle tablet:mt-[8px] lg-desktop:text-[16px] mt-[4px] text-[14px]",{"text-left":u&&r==="left","text-center":u&&r==="center"})})]}),i==="bottom"&&b?.text&&(0,e.jsx)(s.Link,{href:(0,a.getLocalizedPath)(b.link||"",q),className:"laptop:flex lg-desktop:text-[16px] hidden whitespace-nowrap text-[14px] no-underline",suffixIcon:ae,children:b.text})]}),!u&&(_||z)&&(0,e.jsxs)("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[z&&(0,e.jsx)("img",{src:z,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),_&&(0,e.jsx)(s.Heading,{as:"h4",size:5,html:_,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),u&&(0,e.jsx)("div",{className:(0,a.cn)("image-with-text__items laptop:mt-[32px] desktop:mt-[24px] mt-[16px] grid w-full gap-6",fe,ve,{"!mt-6":i==="bottom",[we]:i==="left"||i==="right"}),children:I.map((t,m)=>(0,e.jsxs)("div",{className:(0,a.cn)("image-with-text__item",{"text-center":r==="center"}),children:[(0,e.jsxs)("div",{className:(0,a.cn)("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":r==="center","justify-start":r==="left"}),children:[t.icon?.url&&(0,e.jsx)(s.Picture,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon desktop:h-[32px] lg-desktop:h-[40px] h-[24px]",imgClassName:"h-full !w-full"}),(0,e.jsx)(s.Heading,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),(0,e.jsx)(s.Text,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc laptop:mt-[16px] lg-desktop:text-[16px] mt-[16px] line-clamp-2 text-[14px]"})]},m))}),L&&(i==="left"||i==="right")&&(0,e.jsx)(s.Text,{as:"p",size:1,weight:"medium",html:L,className:(0,a.cn)("image-with-text__caption tablet:block text-info-secondary mt-[24px] hidden",{"text-center":r==="center"})})]}),ke()]}),(0,e.jsx)("div",{ref:B,style:ge,className:(0,a.cn)("image-with-text__media-wrapper",y?X==="bottom"?"tablet:h-[360px] laptop:h-auto laptop:aspect-[var(--ar-l)] desktop:aspect-[var(--ar-d)] lg-desktop:aspect-[var(--ar-x)] h-[var(--mh-m)] w-full shrink-0":"tablet:h-[360px] laptop:h-auto laptop:w-[var(--mw-l)] laptop:aspect-[var(--ar-l)] desktop:w-[var(--mw-d)] desktop:aspect-[var(--ar-d)] lg-desktop:w-[var(--mw-x)] lg-desktop:aspect-[var(--ar-x)] h-[var(--mh-m)] w-full shrink-0":{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":u&&i!=="bottom","laptop:basis-[63%] desktop:basis-[57%]":u&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":n,"!max-w-none !max-h-none aspect-auto":i==="bottom"}),children:n?S?te():(0,e.jsx)(N.AnimatePresence,{mode:"wait",children:(0,e.jsx)(N.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:(0,e.jsx)(s.Picture,{source:ee(),alt:c[x].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},c[x].image?.url)}):S?te():(0,e.jsx)(s.Picture,{source:ee(),className:(0,a.cn)("image-with-text__image rounded-box laptop:rounded-box size-full"),imgClassName:"h-full object-cover"})}),L&&!n&&(0,e.jsx)(s.Text,{as:"p",size:1,weight:"medium",html:L,className:(0,a.cn)("image-with-text__caption text-info-secondary mt-[-16px] w-full",{"tablet:hidden":i==="left"||i==="right","text-center":r==="center"})})]})});oe.displayName="ImageWithText";var He=(0,le.withLayout)(oe);
|
|
@@ -45,7 +45,7 @@ export interface ImageWithTextTabItem {
|
|
|
45
45
|
title: string;
|
|
46
46
|
}
|
|
47
47
|
export type MediaType = 'image' | 'video';
|
|
48
|
-
export type LayoutPosition = 'left' | 'right' | '
|
|
48
|
+
export type LayoutPosition = 'left' | 'right' | 'bottom';
|
|
49
49
|
export type TextAlign = 'left' | 'center';
|
|
50
50
|
/** 列数枚举类型 */
|
|
51
51
|
export declare enum Cols {
|
|
@@ -68,7 +68,7 @@ export interface ImageWithTextProps {
|
|
|
68
68
|
descIcon?: string;
|
|
69
69
|
/** 主题,默认 dark */
|
|
70
70
|
theme?: Theme;
|
|
71
|
-
/** 布局位置,默认 left
|
|
71
|
+
/** 布局位置,默认 left。支持左右布局(left/right)和上下布局(bottom,图下文上) */
|
|
72
72
|
layout?: LayoutPosition;
|
|
73
73
|
/** 媒体类型,默认 image。所有模式都支持 image 和 video */
|
|
74
74
|
mediaType?: MediaType;
|
|
@@ -104,6 +104,12 @@ export interface ImageWithTextProps {
|
|
|
104
104
|
datalist?: ImageWithTextTabItem[];
|
|
105
105
|
/** 按钮配置 */
|
|
106
106
|
button?: ButtonConfig;
|
|
107
|
+
/**
|
|
108
|
+
* 媒体说明文字(12px,可选,缺省不渲染)
|
|
109
|
+
* - bottom 布局:全断点位于图片下方,上方间距 8px
|
|
110
|
+
* - left/right 布局:≥768px 位于功能列表(图标组)下方(上方间距 24px),<768px 位于图片下方(上方间距 8px)
|
|
111
|
+
*/
|
|
112
|
+
caption?: string;
|
|
107
113
|
};
|
|
108
114
|
/** 自定义类名 */
|
|
109
115
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var o=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var p=(i,t)=>{for(var a in t)o(i,a,{get:t[a],enumerable:!0})},s=(i,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of g(t))!m.call(i,e)&&e!==a&&o(i,e,{get:()=>t[e],enumerable:!(r=n(t,e))||r.enumerable});return i};var x=i=>s(o({},"__esModule",{value:!0}),i);var M={};p(M,{Cols:()=>d});module.exports=x(M);var d=(e=>(e.One="1",e.Two="2",e.Three="3",e.Four="4",e))(d||{});
|