@anker-in/headless-ui 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  3. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  4. package/dist/cjs/biz-components/EventSchedule/index.js.map +2 -2
  5. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  6. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +2 -2
  7. package/dist/cjs/biz-components/Listing/utils/index.js +1 -1
  8. package/dist/cjs/biz-components/Listing/utils/index.js.map +2 -2
  9. package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
  10. package/dist/cjs/biz-components/SceneShelf/ProductCard.js.map +3 -3
  11. package/dist/cjs/biz-components/WebPushPopup/index.d.ts +44 -0
  12. package/dist/cjs/biz-components/WebPushPopup/index.js +2 -0
  13. package/dist/cjs/biz-components/WebPushPopup/index.js.map +7 -0
  14. package/dist/cjs/biz-components/index.d.ts +4 -0
  15. package/dist/cjs/biz-components/index.js +1 -1
  16. package/dist/cjs/biz-components/index.js.map +3 -3
  17. package/dist/cjs/hooks/useEmarsysWebPush.d.ts +111 -0
  18. package/dist/cjs/hooks/useEmarsysWebPush.js +2 -0
  19. package/dist/cjs/hooks/useEmarsysWebPush.js.map +7 -0
  20. package/dist/cjs/shared/LocalizedLink.d.ts +6 -0
  21. package/dist/cjs/shared/LocalizedLink.js +2 -0
  22. package/dist/cjs/shared/LocalizedLink.js.map +7 -0
  23. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  24. package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
  25. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  26. package/dist/esm/biz-components/EventSchedule/index.js.map +2 -2
  27. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  28. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +2 -2
  29. package/dist/esm/biz-components/Listing/utils/index.js +1 -1
  30. package/dist/esm/biz-components/Listing/utils/index.js.map +2 -2
  31. package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
  32. package/dist/esm/biz-components/SceneShelf/ProductCard.js.map +3 -3
  33. package/dist/esm/biz-components/WebPushPopup/index.d.ts +44 -0
  34. package/dist/esm/biz-components/WebPushPopup/index.js +2 -0
  35. package/dist/esm/biz-components/WebPushPopup/index.js.map +7 -0
  36. package/dist/esm/biz-components/index.d.ts +4 -0
  37. package/dist/esm/biz-components/index.js +1 -1
  38. package/dist/esm/biz-components/index.js.map +3 -3
  39. package/dist/esm/hooks/useEmarsysWebPush.d.ts +111 -0
  40. package/dist/esm/hooks/useEmarsysWebPush.js +2 -0
  41. package/dist/esm/hooks/useEmarsysWebPush.js.map +7 -0
  42. package/dist/esm/shared/LocalizedLink.d.ts +6 -0
  43. package/dist/esm/shared/LocalizedLink.js +2 -0
  44. package/dist/esm/shared/LocalizedLink.js.map +7 -0
  45. package/package.json +4 -2
  46. package/static/emarsys-service-worker.js +31 -0
  47. package/style.css +52 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/biz-components/index.ts"],
4
- "sourcesContent": ["export { default as ActivitySchedule } from './ActivitySchedule/index.js'\nexport type { ActivityScheduleProps, ActivityScheduleData, ActivityScheduleItem } from './ActivitySchedule/types.js'\nexport { default as GiftShelf } from './GiftShelf/index.js'\nexport type {\n GiftShelfProps,\n GiftShelfData,\n GiftShelfItem,\n CountdownConfig,\n ResponsiveBackgroundImage as GiftShelfResponsiveBackgroundImage,\n} from './GiftShelf/types.js'\nexport { default as GiftTierShelf } from './GiftTierShelf/index.js'\nexport type { GiftTierShelfProps, GiftTierShelfData, GiftTierItem, GiftTierProduct } from './GiftTierShelf/types.js'\nexport { default as ActivityMechanism } from './ActivityMechanism/index.js'\nexport type {\n ActivityMechanismProps,\n ActivityMechanismItem,\n ActivityMechanismSemanticName,\n ResponsiveBackgroundImage,\n} from './ActivityMechanism/types.js'\nexport { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as MarqueeReview } from './MarqueeReview/index.js'\nexport type { MarqueeReviewProps, MarqueeReviewData, ReviewItem } from './MarqueeReview/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n\nexport { default as BizProductProvider } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductBenefits } from './Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductExchangePurchase } from './Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductCoupon } from './Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js'\nexport { default as ProductBanner } from './Listing/components/ProductCard/ProductDetail/ProductBanner/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\nexport { default as ProductPaidShipping } from './Listing/components/ProductCard/ProductPaidShipping/index.js'\n\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\nexport { default as BrandCardLink } from './BrandCardLink/index.js'\nexport type { BrandCardLinkProps, BrandCardLinkItemProps } from './BrandCardLink/types.js'\n\nexport * as IPRedirect from './IPRedirect/index.js'\n\nexport { default as WheelLottery } from './WheelLottery/index.js'\nexport type {\n WheelLotteryProps,\n WheelLotteryHandle,\n Prize,\n ChanceMethod,\n WinningInfo,\n UserData,\n} from './WheelLottery/types.js'\nexport { default as ProductLottery } from './ProductLottery/index.js'\nexport type { ProductLotteryProps, ProductLotteryHandle, MediaConfig, CtaButtonConfig } from './ProductLottery/types.js'\nexport { default as ProductCompare } from './ProductCompare/index.js'\nexport type { ProductCompareProps, ProductItemData } from './ProductCompare/index.js'\nexport { default as Ksp } from './Ksp/index.js'\nexport type { KspProps, KspData, KspCardItem } from './Ksp/index.js'\nexport { default as ImageTextFeature } from './ImageTextFeature/index.js'\nexport type { ImageTextFeatureProps, ImageTextFeatureItem } from './ImageTextFeature/index.js'\nexport { default as FeatureCards } from './FeatureCards/index.js'\nexport type { FeatureCardsProps, FeatureCardItem } from './FeatureCards/index.js'\nexport { default as FeaturedBlogPosts } from './FeaturedBlogPosts/index.js'\nexport type {\n FeaturedBlogPostsProps,\n FeaturedBlogPostsData,\n FeaturedBlogPostItem,\n FeaturedBlogPostSpan,\n} from './FeaturedBlogPosts/index.js'\nexport { default as ImageWithText } from './ImageWithText/index.js'\nexport type { ImageWithTextProps } from './ImageWithText/index.js'\nexport { default as VideoFeature } from './VideoFeature/index.js'\nexport type { VideoFeatureProps } from './VideoFeature/index.js'\nexport { default as TabsWithMedia } from './TabsWithMedia/index.js'\nexport type { TabsWithMediaProps, TabItem, TimeIndex } from './TabsWithMedia/index.js'\nexport { default as TabWithImage } from './TabWithImage/index.js'\nexport type { TabWithImageProps, TabWithImageDataItem } from './TabWithImage/index.js'\nexport { default as FeatureShowcase } from './FeatureShowcase/index.js'\nexport type { FeatureShowcaseProps, FeatureShowcaseItem } from './FeatureShowcase/index.js'\nexport { default as ProductHero } from './ProductHero/index.js'\nexport type { ProductHeroProps } from './ProductHero/index.js'\nexport { default as SpecsComparison } from './SpecsComparison/index.js'\nexport type {\n SpecsComparisonProps,\n SpecsComparisonMenuItem,\n SpecsComparisonLeftMenuItem,\n} from './SpecsComparison/index.js'\nexport { default as MediaSceneSwitcher } from './MediaSceneSwitcher/index.js'\nexport type { MediaSceneSwitcherProps } from './MediaSceneSwitcher/types.js'\nexport { default as MediaSceneSwitcherV2 } from './MediaSceneSwitcherV2/index.js'\nexport type {\n MediaSceneSwitcherV2Props,\n MediaSceneSwitcherV2Data,\n MediaSceneSwitcherV2Item,\n MediaSceneSwitcherV2Layout,\n} from './MediaSceneSwitcherV2/index.js'\nexport { default as ThreeDCarousel } from './ThreeDCarousel/index.js'\nexport type { ThreeDCarouselProps } from './ThreeDCarousel/index.js'\nexport { default as ProductNav } from './ProductNav/index.js'\nexport type { ProductNavProps, TabLink, AnchorItem, BuyButton } from './ProductNav/index.js'\nexport { default as AnchorNavigation } from './AnchorNavigation/index.js'\nexport { default as PromotionalBar } from './PromotionalBar/index.js'\nexport { default as EventSchedule } from './EventSchedule/index.js'\nexport { default as SecondaryBanner } from './SecondaryBanner/index.js'\nexport { default as BuyOneGetOneShelf } from './BuyOneGetOneShelf/index.js'\nexport { default as ActiveShelf } from './ActiveShelf/index.js'\nexport { default as MediaShelf } from './MediaShelf/index.js'\nexport { default as CreditsShelf, CreditsProductCard } from './CreditsShelf/index.js'\nexport type {\n CreditsShelfSemanticName,\n CreditsProductCardData,\n CopyConfig as CreditsShelfCopyConfig,\n ButtonFunctionType as CreditsShelfButtonFunctionType,\n} from './CreditsShelf/index.js'\nexport { default as SceneShelf, SceneProductCard } from './SceneShelf/index.js'\nexport type { SceneShelfSemanticName, SceneProductCardData, SceneProductCardSemanticName } from './SceneShelf/index.js'\nexport { default as SceneShelfV2, SceneShelfV2ProductCard } from './SceneShelfV2/index.js'\nexport type {\n SceneShelfV2SemanticName,\n SceneShelfV2Data,\n SceneShelfV2Product,\n SceneShelfV2Props,\n} from './SceneShelfV2/index.js'\nexport { default as SceneShelfV3 } from './SceneShelfV3/index.js'\nexport type { SceneShelfV3Data, SceneShelfV3Props, ProductTab as SceneShelfV3ProductTab } from './SceneShelfV3/index.js'\nexport type {\n SceneShelfV3SemanticName,\n ProductCardData as SceneShelfV3ProductCardData,\n} from './SceneShelfV3/ProductCard.js'\n\nexport { default as MediaEndorsement } from './MediaEndorsement/index.js'\nexport type {\n MediaEndorsementProps,\n MediaEndorsementData,\n MediaEndorsementItem,\n MediaEndorsementSemanticName,\n} from './MediaEndorsement/index.js'\n\nexport { default as MediaTextOverlay } from './MediaTextOverlay/index.js'\nexport type {\n MediaTextOverlayProps,\n MediaTextOverlayData,\n MediaTextOverlayItem,\n MediaTextOverlaySemanticName,\n ResponsiveMedia,\n} from './MediaTextOverlay/index.js'\n\n// Copy configuration types and defaults\nexport type {\n CopyConfig as MediaShelfCopyConfig,\n ButtonFunctionType as MediaShelfButtonFunctionType,\n} from './MediaShelf/types.js'\nexport type { CopyConfig as ActiveShelfCopyConfig, ButtonFunctionType } from './ActiveShelf/types.js'\n\nexport {\n default as ImageOverlayShelf,\n type ButtonFunctionType as ImageOverlayShelfButtonFunctionType,\n} from './ImageOverlayShelf/index.js'\n\nexport { default as ImageTextOverlay } from './ImageTextOverlay/index.js'\nexport type {\n ImageTextOverlayProps,\n ImageTextOverlayData,\n ImageTextOverlayItem,\n ImageTextOverlaySemanticName,\n ImageTextOverlayBackgroundImage,\n} from './ImageTextOverlay/types.js'\n\n// MiniCart \u7EC4\u4EF6\u53CA\u7C7B\u578B\u5BFC\u51FA\nexport { default as MiniCart } from './MiniCart/index.js'\nexport type { Cart, CartLineItem, MiniCartData, MiniCartProps, CircleProgressConfig } from './MiniCart/index.js'\nexport { default as MiniCartCircleProgress } from './MiniCart/CircleProgress.js'\nexport type { CircleProgressProps as MiniCartCircleProgressProps } from './MiniCart/CircleProgress.js'\nexport { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js'\nexport type {\n MiniCartDialogProps,\n MiniCartDialogCopy,\n MiniCartDialogSemanticName,\n CartData,\n} from './MiniCart/MiniCartDialog.js'\n\n/**\n * \u7EC4\u4EF6\u6620\u5C04\u5BF9\u8C61\n */\n\nexport const PAYLOAD_COMPONENT_MAP = {\n 'ipc-accordioncards': 'AccordionCards',\n 'ipc-aplusdesc': 'AplusDesc',\n 'ipc-banner': 'HeroBanner',\n 'ipc-brand-equity': 'BrandEquity',\n 'ipc-category': 'Category',\n 'ipc-collection-banner': 'CollectionBanner',\n 'ipc-collection-shelves': 'CollectionShelves',\n 'ipc-creativemodule': 'CreativeModule',\n 'ipc-download': 'DownLoad',\n 'ipc-evaluate': 'Evaluate',\n 'ipc-faq': 'Faq',\n 'ipc-features': 'Features',\n 'ipc-footcharger': 'FootCharger',\n 'ipc-ga-block': 'GraphicAttractionBlock',\n 'ipc-giftbox': 'GiftBox',\n 'ipc-giftshelf': 'GiftShelf',\n 'ipc-graphic': 'Graphic',\n 'ipc-graphicmore': 'GraphicMore',\n 'ipc-graphicoverlay': 'GraphicOverlay',\n 'ipc-marquee': 'Marquee',\n 'ipc-mediaplayerbase': 'MediaPlayerBase',\n 'ipc-mediaplayermulti': 'MediaPlayerMulti',\n 'ipc-mediaplayersticky': 'MediaPlayerSticky',\n 'ipc-member-equity': 'MemberEquity',\n 'ipc-mlg-block': 'MultiLayoutGraphicBlock',\n 'ipc-search-page-tabs': 'SearchPageBlock',\n 'ipc-selectstore': 'SelectStore',\n 'ipc-shelfdisplay': 'ShelfDisplay',\n 'ipc-slogan': 'Slogan',\n 'ipc-spacer': 'Spacer',\n 'ipc-specs': 'Specs',\n 'ipc-tabs': 'TabsBlock',\n 'ipc-text-marquee': 'TextMarquee',\n 'ipc-title': 'Title',\n 'ipc-whychoose': 'WhyChoose',\n 'ipc-product-nav': 'ProductNav',\n 'ipc-brand-card-link': 'BrandCardLink',\n 'ipc-ipredirect': 'IPRedirect',\n ksp: 'Ksp',\n 'ipc-secondary-banner': 'SecondaryBanner',\n /**\n * \u6D3B\u52A8\u8D27\u67B6\n */\n 'ipc-active-shelf': 'ActiveShelf',\n 'ipc-media-shelf': 'MediaShelf',\n /**\n * \u6D3B\u52A8\u4E70\u8D60\u8D27\u67B6\n */\n 'ipc-bogo-shelf': 'BuyOneGetOneShelf',\n 'ipc-media-endorsement': 'MediaEndorsement',\n 'ipc-media-scene-switcher-v2': 'MediaSceneSwitcherV2',\n 'ipc-featured-blog-posts': 'FeaturedBlogPosts',\n}\n"],
5
- "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,khCAAAE,GAAA,2xBAAAC,GAAA,s2CAAAC,GAAAJ,IAAA,IAAAK,EAA4C,0CAE5CC,EAAqC,mCAQrCC,EAAyC,uCAEzCC,EAA6C,2CAO7CC,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,gCAClCC,EAAwC,sCACxCC,EAAoC,kCACpCC,EAAoC,kCACpCC,EAAsC,oCACtCC,EAA0C,wCAC1CC,EAAmC,iCACnCC,EAA2C,yCAC3CC,EAA6C,2CAC7CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAyC,uCAEzCC,EAAqC,mCACrCC,EAA+B,6BAC/BH,EAAqE,8BACrEI,EAAmD,iDAEnDC,EAAkD,gDAElDC,EAA4C,0CAC5CC,EAA4C,0CAC5CC,EAAsC,oCAEtCC,EAAmD,iCAEnDC,EAA2B,+BAC3BC,EAAwC,sCACxCC,EA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ChB,wBAAyB,mBACzB,yBAA0B,oBAC1B,qBAAsB,iBACtB,eAAgB,WAChB,eAAgB,WAChB,UAAW,MACX,eAAgB,WAChB,kBAAmB,cACnB,eAAgB,yBAChB,cAAe,UACf,gBAAiB,YACjB,cAAe,UACf,kBAAmB,cACnB,qBAAsB,iBACtB,cAAe,UACf,sBAAuB,kBACvB,uBAAwB,mBACxB,wBAAyB,oBACzB,oBAAqB,eACrB,gBAAiB,0BACjB,uBAAwB,kBACxB,kBAAmB,cACnB,mBAAoB,eACpB,aAAc,SACd,aAAc,SACd,YAAa,QACb,WAAY,YACZ,mBAAoB,cACpB,YAAa,QACb,gBAAiB,YACjB,kBAAmB,aACnB,sBAAuB,gBACvB,iBAAkB,aAClB,IAAK,MACL,uBAAwB,kBAIxB,mBAAoB,cACpB,kBAAmB,aAInB,iBAAkB,oBAClB,wBAAyB,mBACzB,8BAA+B,uBAC/B,0BAA2B,mBAC7B",
6
- "names": ["biz_components_exports", "__export", "IPRedirect", "PAYLOAD_COMPONENT_MAP", "__toCommonJS", "import_ActivitySchedule", "import_GiftShelf", "import_GiftTierShelf", "import_ActivityMechanism", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_MarqueeReview", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_HeaderNavigation", "import_FooterNavigation", "import_SearchPage", "import_types", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay", "import_Specs", "import_TabsGroup", "import_BizProductProvider", "import_PurchaseBar", "import_ProductActions", "import_ProductCard", "import_ProductBenefitsTabs", "import_ProductBenefits", "import_ProductHighlight", "import_ProductFreeGift", "import_ProductExchangePurchase", "import_ProductOptions", "import_ProductBundle", "import_ProductCoupon", "import_ProductBanner", "import_ProductGridBox", "import_ProductGallery", "import_ProductDetail", "import_ProductSummary", "import_BenefitsTab", "import_PaidShipping", "import_ProductPaidShipping", "import_GraphicMore", "import_Features", "import_AplusDesc", "import_GiftBox", "import_SelectStore", "import_DownLoad", "import_FootCharger", "import_BrandCardLink", "import_WheelLottery", "import_ProductLottery", "import_ProductCompare", "import_Ksp", "import_ImageTextFeature", "import_FeatureCards", "import_FeaturedBlogPosts", "import_ImageWithText", "import_VideoFeature", "import_TabsWithMedia", "import_TabWithImage", "import_FeatureShowcase", "import_ProductHero", "import_SpecsComparison", "import_MediaSceneSwitcher", "import_MediaSceneSwitcherV2", "import_ThreeDCarousel", "import_ProductNav", "import_AnchorNavigation", "import_PromotionalBar", "import_EventSchedule", "import_SecondaryBanner", "import_BuyOneGetOneShelf", "import_ActiveShelf", "import_MediaShelf", "import_CreditsShelf", "import_SceneShelf", "import_SceneShelfV2", "import_SceneShelfV3", "import_MediaEndorsement", "import_MediaTextOverlay", "import_ImageOverlayShelf", "import_ImageTextOverlay", "import_MiniCart", "import_CircleProgress", "import_MiniCartDialog"]
4
+ "sourcesContent": ["export { default as ActivitySchedule } from './ActivitySchedule/index.js'\nexport type { ActivityScheduleProps, ActivityScheduleData, ActivityScheduleItem } from './ActivitySchedule/types.js'\nexport { default as GiftShelf } from './GiftShelf/index.js'\nexport type {\n GiftShelfProps,\n GiftShelfData,\n GiftShelfItem,\n CountdownConfig,\n ResponsiveBackgroundImage as GiftShelfResponsiveBackgroundImage,\n} from './GiftShelf/types.js'\nexport { default as GiftTierShelf } from './GiftTierShelf/index.js'\nexport type { GiftTierShelfProps, GiftTierShelfData, GiftTierItem, GiftTierProduct } from './GiftTierShelf/types.js'\nexport { default as ActivityMechanism } from './ActivityMechanism/index.js'\nexport type {\n ActivityMechanismProps,\n ActivityMechanismItem,\n ActivityMechanismSemanticName,\n ResponsiveBackgroundImage,\n} from './ActivityMechanism/types.js'\nexport { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as MarqueeReview } from './MarqueeReview/index.js'\nexport type { MarqueeReviewProps, MarqueeReviewData, ReviewItem } from './MarqueeReview/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n\nexport { default as BizProductProvider } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductBenefits } from './Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductExchangePurchase } from './Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductCoupon } from './Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js'\nexport { default as ProductBanner } from './Listing/components/ProductCard/ProductDetail/ProductBanner/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\nexport { default as ProductPaidShipping } from './Listing/components/ProductCard/ProductPaidShipping/index.js'\n\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\nexport { default as BrandCardLink } from './BrandCardLink/index.js'\nexport type { BrandCardLinkProps, BrandCardLinkItemProps } from './BrandCardLink/types.js'\n\nexport * as IPRedirect from './IPRedirect/index.js'\n\nexport { default as WheelLottery } from './WheelLottery/index.js'\nexport type {\n WheelLotteryProps,\n WheelLotteryHandle,\n Prize,\n ChanceMethod,\n WinningInfo,\n UserData,\n} from './WheelLottery/types.js'\nexport { default as ProductLottery } from './ProductLottery/index.js'\nexport type { ProductLotteryProps, ProductLotteryHandle, MediaConfig, CtaButtonConfig } from './ProductLottery/types.js'\nexport { default as ProductCompare } from './ProductCompare/index.js'\nexport type { ProductCompareProps, ProductItemData } from './ProductCompare/index.js'\nexport { default as Ksp } from './Ksp/index.js'\nexport type { KspProps, KspData, KspCardItem } from './Ksp/index.js'\nexport { default as ImageTextFeature } from './ImageTextFeature/index.js'\nexport type { ImageTextFeatureProps, ImageTextFeatureItem } from './ImageTextFeature/index.js'\nexport { default as FeatureCards } from './FeatureCards/index.js'\nexport type { FeatureCardsProps, FeatureCardItem } from './FeatureCards/index.js'\nexport { default as FeaturedBlogPosts } from './FeaturedBlogPosts/index.js'\nexport type {\n FeaturedBlogPostsProps,\n FeaturedBlogPostsData,\n FeaturedBlogPostItem,\n FeaturedBlogPostSpan,\n} from './FeaturedBlogPosts/index.js'\nexport { default as ImageWithText } from './ImageWithText/index.js'\nexport type { ImageWithTextProps } from './ImageWithText/index.js'\nexport { default as VideoFeature } from './VideoFeature/index.js'\nexport type { VideoFeatureProps } from './VideoFeature/index.js'\nexport { default as TabsWithMedia } from './TabsWithMedia/index.js'\nexport type { TabsWithMediaProps, TabItem, TimeIndex } from './TabsWithMedia/index.js'\nexport { default as TabWithImage } from './TabWithImage/index.js'\nexport type { TabWithImageProps, TabWithImageDataItem } from './TabWithImage/index.js'\nexport { default as FeatureShowcase } from './FeatureShowcase/index.js'\nexport type { FeatureShowcaseProps, FeatureShowcaseItem } from './FeatureShowcase/index.js'\nexport { default as ProductHero } from './ProductHero/index.js'\nexport type { ProductHeroProps } from './ProductHero/index.js'\nexport { default as SpecsComparison } from './SpecsComparison/index.js'\nexport type {\n SpecsComparisonProps,\n SpecsComparisonMenuItem,\n SpecsComparisonLeftMenuItem,\n} from './SpecsComparison/index.js'\nexport { default as MediaSceneSwitcher } from './MediaSceneSwitcher/index.js'\nexport type { MediaSceneSwitcherProps } from './MediaSceneSwitcher/types.js'\nexport { default as MediaSceneSwitcherV2 } from './MediaSceneSwitcherV2/index.js'\nexport type {\n MediaSceneSwitcherV2Props,\n MediaSceneSwitcherV2Data,\n MediaSceneSwitcherV2Item,\n MediaSceneSwitcherV2Layout,\n} from './MediaSceneSwitcherV2/index.js'\nexport { default as ThreeDCarousel } from './ThreeDCarousel/index.js'\nexport type { ThreeDCarouselProps } from './ThreeDCarousel/index.js'\nexport { default as ProductNav } from './ProductNav/index.js'\nexport type { ProductNavProps, TabLink, AnchorItem, BuyButton } from './ProductNav/index.js'\nexport { default as AnchorNavigation } from './AnchorNavigation/index.js'\nexport { default as PromotionalBar } from './PromotionalBar/index.js'\nexport { default as EventSchedule } from './EventSchedule/index.js'\nexport { default as SecondaryBanner } from './SecondaryBanner/index.js'\nexport { default as BuyOneGetOneShelf } from './BuyOneGetOneShelf/index.js'\nexport { default as ActiveShelf } from './ActiveShelf/index.js'\nexport { default as MediaShelf } from './MediaShelf/index.js'\nexport { default as CreditsShelf, CreditsProductCard } from './CreditsShelf/index.js'\nexport type {\n CreditsShelfSemanticName,\n CreditsProductCardData,\n CopyConfig as CreditsShelfCopyConfig,\n ButtonFunctionType as CreditsShelfButtonFunctionType,\n} from './CreditsShelf/index.js'\nexport { default as SceneShelf, SceneProductCard } from './SceneShelf/index.js'\nexport type { SceneShelfSemanticName, SceneProductCardData, SceneProductCardSemanticName } from './SceneShelf/index.js'\nexport { default as SceneShelfV2, SceneShelfV2ProductCard } from './SceneShelfV2/index.js'\nexport type {\n SceneShelfV2SemanticName,\n SceneShelfV2Data,\n SceneShelfV2Product,\n SceneShelfV2Props,\n} from './SceneShelfV2/index.js'\nexport { default as SceneShelfV3 } from './SceneShelfV3/index.js'\nexport type { SceneShelfV3Data, SceneShelfV3Props, ProductTab as SceneShelfV3ProductTab } from './SceneShelfV3/index.js'\nexport type {\n SceneShelfV3SemanticName,\n ProductCardData as SceneShelfV3ProductCardData,\n} from './SceneShelfV3/ProductCard.js'\n\nexport { default as MediaEndorsement } from './MediaEndorsement/index.js'\nexport type {\n MediaEndorsementProps,\n MediaEndorsementData,\n MediaEndorsementItem,\n MediaEndorsementSemanticName,\n} from './MediaEndorsement/index.js'\n\nexport { default as MediaTextOverlay } from './MediaTextOverlay/index.js'\nexport type {\n MediaTextOverlayProps,\n MediaTextOverlayData,\n MediaTextOverlayItem,\n MediaTextOverlaySemanticName,\n ResponsiveMedia,\n} from './MediaTextOverlay/index.js'\n\n// Copy configuration types and defaults\nexport type {\n CopyConfig as MediaShelfCopyConfig,\n ButtonFunctionType as MediaShelfButtonFunctionType,\n} from './MediaShelf/types.js'\nexport type { CopyConfig as ActiveShelfCopyConfig, ButtonFunctionType } from './ActiveShelf/types.js'\n\nexport {\n default as ImageOverlayShelf,\n type ButtonFunctionType as ImageOverlayShelfButtonFunctionType,\n} from './ImageOverlayShelf/index.js'\n\nexport { default as ImageTextOverlay } from './ImageTextOverlay/index.js'\nexport type {\n ImageTextOverlayProps,\n ImageTextOverlayData,\n ImageTextOverlayItem,\n ImageTextOverlaySemanticName,\n ImageTextOverlayBackgroundImage,\n} from './ImageTextOverlay/types.js'\n\n// MiniCart \u7EC4\u4EF6\u53CA\u7C7B\u578B\u5BFC\u51FA\nexport { default as MiniCart } from './MiniCart/index.js'\nexport type { Cart, CartLineItem, MiniCartData, MiniCartProps, CircleProgressConfig } from './MiniCart/index.js'\nexport { default as MiniCartCircleProgress } from './MiniCart/CircleProgress.js'\nexport type { CircleProgressProps as MiniCartCircleProgressProps } from './MiniCart/CircleProgress.js'\nexport { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js'\nexport type {\n MiniCartDialogProps,\n MiniCartDialogCopy,\n MiniCartDialogSemanticName,\n CartData,\n} from './MiniCart/MiniCartDialog.js'\n\n// \u2500\u2500\u2500 Web Push \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nexport { default as WebPushPopup } from './WebPushPopup/index.js'\nexport type { WebPushPopupProps } from './WebPushPopup/index.js'\nexport { useEmarsysWebPush } from '../hooks/useEmarsysWebPush.js'\nexport type {\n UseEmarsysWebPushOptions,\n UseEmarsysWebPushReturn,\n EmarsysContactInfo,\n EmarsysInitConfig,\n} from '../hooks/useEmarsysWebPush.js'\n\n/**\n * \u7EC4\u4EF6\u6620\u5C04\u5BF9\u8C61\n */\n\nexport const PAYLOAD_COMPONENT_MAP = {\n 'ipc-accordioncards': 'AccordionCards',\n 'ipc-aplusdesc': 'AplusDesc',\n 'ipc-banner': 'HeroBanner',\n 'ipc-brand-equity': 'BrandEquity',\n 'ipc-category': 'Category',\n 'ipc-collection-banner': 'CollectionBanner',\n 'ipc-collection-shelves': 'CollectionShelves',\n 'ipc-creativemodule': 'CreativeModule',\n 'ipc-download': 'DownLoad',\n 'ipc-evaluate': 'Evaluate',\n 'ipc-faq': 'Faq',\n 'ipc-features': 'Features',\n 'ipc-footcharger': 'FootCharger',\n 'ipc-ga-block': 'GraphicAttractionBlock',\n 'ipc-giftbox': 'GiftBox',\n 'ipc-giftshelf': 'GiftShelf',\n 'ipc-graphic': 'Graphic',\n 'ipc-graphicmore': 'GraphicMore',\n 'ipc-graphicoverlay': 'GraphicOverlay',\n 'ipc-marquee': 'Marquee',\n 'ipc-mediaplayerbase': 'MediaPlayerBase',\n 'ipc-mediaplayermulti': 'MediaPlayerMulti',\n 'ipc-mediaplayersticky': 'MediaPlayerSticky',\n 'ipc-member-equity': 'MemberEquity',\n 'ipc-mlg-block': 'MultiLayoutGraphicBlock',\n 'ipc-search-page-tabs': 'SearchPageBlock',\n 'ipc-selectstore': 'SelectStore',\n 'ipc-shelfdisplay': 'ShelfDisplay',\n 'ipc-slogan': 'Slogan',\n 'ipc-spacer': 'Spacer',\n 'ipc-specs': 'Specs',\n 'ipc-tabs': 'TabsBlock',\n 'ipc-text-marquee': 'TextMarquee',\n 'ipc-title': 'Title',\n 'ipc-whychoose': 'WhyChoose',\n 'ipc-product-nav': 'ProductNav',\n 'ipc-brand-card-link': 'BrandCardLink',\n 'ipc-ipredirect': 'IPRedirect',\n ksp: 'Ksp',\n 'ipc-secondary-banner': 'SecondaryBanner',\n /**\n * \u6D3B\u52A8\u8D27\u67B6\n */\n 'ipc-active-shelf': 'ActiveShelf',\n 'ipc-media-shelf': 'MediaShelf',\n /**\n * \u6D3B\u52A8\u4E70\u8D60\u8D27\u67B6\n */\n 'ipc-bogo-shelf': 'BuyOneGetOneShelf',\n 'ipc-media-endorsement': 'MediaEndorsement',\n 'ipc-media-scene-switcher-v2': 'MediaSceneSwitcherV2',\n 'ipc-featured-blog-posts': 'FeaturedBlogPosts',\n}\n"],
5
+ "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,khCAAAE,GAAA,2xBAAAC,GAAA,66CAAAC,GAAAJ,IAAA,IAAAK,EAA4C,0CAE5CC,EAAqC,mCAQrCC,EAAyC,uCAEzCC,EAA6C,2CAO7CC,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,g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C,GAA0C,wCAC1CC,GAAyC,uCACzCC,GAA2C,yCAC3CC,GAA6C,2CAC7CC,GAAuC,qCACvCC,GAAsC,oCACtCC,EAA4D,sCAO5DC,EAAwD,oCAExDC,EAAiE,sCAOjEC,GAAwC,sCAOxCC,GAA4C,0CAQ5CC,GAA4C,0CAgB5CC,GAGO,2CAEPC,GAA4C,0CAU5CC,GAAoC,kCAEpCC,GAAkD,2CAElDC,EAAqF,2CASrFC,GAAwC,sCAExCC,GAAkC,yCAY3B,MAAMtG,GAAwB,CACnC,qBAAsB,iBACtB,gBAAiB,YACjB,aAAc,aACd,mBAAoB,cACpB,eAAgB,WAChB,wBAAyB,mBACzB,yBAA0B,oBAC1B,qBAAsB,iBACtB,eAAgB,WAChB,eAAgB,WAChB,UAAW,MACX,eAAgB,WAChB,kBAAmB,cACnB,eAAgB,yBAChB,cAAe,UACf,gBAAiB,YACjB,cAAe,UACf,kBAAmB,cACnB,qBAAsB,iBACtB,cAAe,UACf,sBAAuB,kBACvB,uBAAwB,mBACxB,wBAAyB,oBACzB,oBAAqB,eACrB,gBAAiB,0BACjB,uBAAwB,kBACxB,kBAAmB,cACnB,mBAAoB,eACpB,aAAc,SACd,aAAc,SACd,YAAa,QACb,WAAY,YACZ,mBAAoB,cACpB,YAAa,QACb,gBAAiB,YACjB,kBAAmB,aACnB,sBAAuB,gBACvB,iBAAkB,aAClB,IAAK,MACL,uBAAwB,kBAIxB,mBAAoB,cACpB,kBAAmB,aAInB,iBAAkB,oBAClB,wBAAyB,mBACzB,8BAA+B,uBAC/B,0BAA2B,mBAC7B",
6
+ "names": ["biz_components_exports", "__export", "IPRedirect", "PAYLOAD_COMPONENT_MAP", "__toCommonJS", "import_ActivitySchedule", "import_GiftShelf", "import_GiftTierShelf", "import_ActivityMechanism", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_MarqueeReview", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_HeaderNavigation", "import_FooterNavigation", "import_SearchPage", "import_types", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay", "import_Specs", "import_TabsGroup", "import_BizProductProvider", "import_PurchaseBar", "import_ProductActions", "import_ProductCard", "import_ProductBenefitsTabs", "import_ProductBenefits", "import_ProductHighlight", "import_ProductFreeGift", "import_ProductExchangePurchase", "import_ProductOptions", "import_ProductBundle", "import_ProductCoupon", "import_ProductBanner", "import_ProductGridBox", "import_ProductGallery", "import_ProductDetail", "import_ProductSummary", "import_BenefitsTab", "import_PaidShipping", "import_ProductPaidShipping", "import_GraphicMore", "import_Features", "import_AplusDesc", "import_GiftBox", "import_SelectStore", "import_DownLoad", "import_FootCharger", "import_BrandCardLink", "import_WheelLottery", "import_ProductLottery", "import_ProductCompare", "import_Ksp", "import_ImageTextFeature", "import_FeatureCards", "import_FeaturedBlogPosts", "import_ImageWithText", "import_VideoFeature", "import_TabsWithMedia", "import_TabWithImage", "import_FeatureShowcase", "import_ProductHero", "import_SpecsComparison", "import_MediaSceneSwitcher", "import_MediaSceneSwitcherV2", "import_ThreeDCarousel", "import_ProductNav", "import_AnchorNavigation", "import_PromotionalBar", "import_EventSchedule", "import_SecondaryBanner", "import_BuyOneGetOneShelf", "import_ActiveShelf", "import_MediaShelf", "import_CreditsShelf", "import_SceneShelf", "import_SceneShelfV2", "import_SceneShelfV3", "import_MediaEndorsement", "import_MediaTextOverlay", "import_ImageOverlayShelf", "import_ImageTextOverlay", "import_MiniCart", "import_CircleProgress", "import_MiniCartDialog", "import_WebPushPopup", "import_useEmarsysWebPush"]
7
7
  }
@@ -0,0 +1,111 @@
1
+ export interface EmarsysContactInfo {
2
+ /** Emarsys 联系人字段 ID(如 10372) */
3
+ fieldId: number;
4
+ /** 字段值(如用户唯一标识) */
5
+ fieldValue: string;
6
+ }
7
+ export interface EmarsysInitConfig {
8
+ /** Emarsys Domain Code,从后台获取 */
9
+ applicationCode: string;
10
+ /** macOS Safari 16+ 使用 VAPID 替代 APNS */
11
+ enableMacSafariVapid?: boolean;
12
+ /** 默认推送通知标题 */
13
+ defaultNotificationTitle?: string;
14
+ /** 默认推送通知图标 URL */
15
+ defaultNotificationIcon?: string;
16
+ /** 是否自动触发浏览器订阅弹窗,强烈建议设为 false */
17
+ autoSubscribe?: boolean;
18
+ /** 开发阶段开启 SDK 日志 */
19
+ enableLogging?: boolean;
20
+ serviceWorker: {
21
+ /** Service Worker 文件路径(需放在网站根目录) */
22
+ url: string;
23
+ /** VAPID 公钥(Base64 URL-safe 编码) */
24
+ applicationServerPublicKey: string;
25
+ };
26
+ }
27
+ type EmarsysSdkEventName = 'onReady' | 'onSubscribe' | 'onUnsubscribe' | 'onPermissionPrompt' | 'onPermissionGranted' | 'onPermissionDenied' | 'onSWInitError';
28
+ type EmarsysSdkCommand = ['init', EmarsysInitConfig] | [EmarsysSdkEventName, () => void];
29
+ interface EmarsysSdkApi {
30
+ subscribe: () => void;
31
+ unsubscribe: () => void;
32
+ login: (contactInfo: EmarsysContactInfo) => Promise<boolean>;
33
+ logout: () => Promise<boolean>;
34
+ isSubscribed: () => Promise<boolean>;
35
+ isRegistered: () => boolean;
36
+ customEvent: (eventName: string, payload?: Record<string, unknown>) => Promise<boolean>;
37
+ push: (command: EmarsysSdkCommand | ((sdk: EmarsysSdkApi) => void)) => void;
38
+ }
39
+ declare global {
40
+ interface Window {
41
+ WebEmarsysSdk: EmarsysSdkApi | (EmarsysSdkCommand | ((sdk: EmarsysSdkApi) => void))[];
42
+ }
43
+ }
44
+ export interface UseEmarsysWebPushOptions {
45
+ /** Emarsys Domain Code */
46
+ applicationCode: string;
47
+ /** VAPID 公钥 */
48
+ applicationServerPublicKey: string;
49
+ /** Service Worker 路径,默认 'service-worker.js'(不含前导斜杠) */
50
+ serviceWorkerUrl?: string;
51
+ /** 默认通知标题 */
52
+ defaultNotificationTitle?: string;
53
+ /** 默认通知图标 URL */
54
+ defaultNotificationIcon?: string;
55
+ /** 联系人主键字段 ID(由 Emarsys 后台配置) */
56
+ fieldId: number;
57
+ /**
58
+ * 当前用户的联系人标识(如 hashed email / customer ID)。
59
+ * null 表示未登录的匿名访客。
60
+ */
61
+ contactValue: string | null;
62
+ /** 是否开启调试日志,默认 false */
63
+ enableLogging?: boolean;
64
+ /**
65
+ * 点击"稍后"后的弹窗冷却天数,默认 7 天。
66
+ * 冷却期间不再展示自定义弹窗。
67
+ */
68
+ dismissCooldownDays?: number;
69
+ /**
70
+ * SDK 是否已通过外部 <Script> 标签加载完毕。
71
+ * 传入此 flag 以便 hook 在正确时机初始化。
72
+ * 默认 true(假设 SDK 已经加载)。
73
+ */
74
+ sdkLoaded?: boolean;
75
+ }
76
+ export interface UseEmarsysWebPushReturn {
77
+ /** 手动触发浏览器原生订阅弹窗(供"订阅"按钮调用) */
78
+ subscribe: () => void;
79
+ /** 取消推送订阅 */
80
+ unsubscribe: () => void;
81
+ /** 是否应向用户展示自定义引导弹窗 */
82
+ shouldShowPopup: boolean;
83
+ /** 关闭自定义弹窗并写入冷却标记 */
84
+ dismissPopup: () => void;
85
+ /** 当前是否已订阅(异步检测完成后更新) */
86
+ isSubscribed: boolean;
87
+ /** SDK 是否就绪 */
88
+ isReady: boolean;
89
+ }
90
+ /**
91
+ * useEmarsysWebPush
92
+ *
93
+ * 封装 Emarsys Web Push SDK 的订阅生命周期,包括:
94
+ * - SDK 初始化
95
+ * - 自定义弹窗展示逻辑(两步策略,避免直接触发浏览器原生弹窗)
96
+ * - 已登录联系人的 login / logout 自动管理
97
+ * - 已有订阅用户的迁移(从旧推送系统迁移)
98
+ *
99
+ * @example
100
+ * ```tsx
101
+ * const { shouldShowPopup, subscribe, dismissPopup } = useEmarsysWebPush({
102
+ * applicationCode: process.env.NEXT_PUBLIC_EMARSYS_APP_CODE!,
103
+ * applicationServerPublicKey: process.env.NEXT_PUBLIC_EMARSYS_VAPID_PUBLIC_KEY!,
104
+ * fieldId: 10372,
105
+ * contactValue: user?.customerId ?? null,
106
+ * sdkLoaded: scriptLoaded,
107
+ * })
108
+ * ```
109
+ */
110
+ export declare function useEmarsysWebPush({ applicationCode, applicationServerPublicKey, serviceWorkerUrl, defaultNotificationTitle, defaultNotificationIcon, fieldId, contactValue, enableLogging, dismissCooldownDays, sdkLoaded, }: UseEmarsysWebPushOptions): UseEmarsysWebPushReturn;
111
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";var E=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var x=(e,i)=>{for(var o in i)E(e,o,{get:i[o],enumerable:!0})},T=(e,i,o,l)=>{if(i&&typeof i=="object"||typeof i=="function")for(let u of U(i))!D.call(e,u)&&u!==o&&E(e,u,{get:()=>i[u],enumerable:!(l=O(i,u))||l.enumerable});return e};var K=e=>T(E({},"__esModule",{value:!0}),e);var j={};x(j,{useEmarsysWebPush:()=>B});module.exports=K(j);var n=require("react");const w="emarsysSubscribe",m="emarsysLogin",W="anker_push_dismissed";function M(){return typeof navigator>"u"?!1:/iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase())}function Y(){return typeof window>"u"?!1:window.matchMedia("(display-mode: standalone)").matches||"standalone"in window.navigator&&window.navigator.standalone===!0}function a(e,i,o){try{if(e==="get")return localStorage.getItem(i);e==="set"&&o!==void 0&&localStorage.setItem(i,o),e==="remove"&&localStorage.removeItem(i)}catch{}return null}function c(){if(typeof window>"u")return null;const e=window.WebEmarsysSdk;return!e||Array.isArray(e)?null:e}function B({applicationCode:e,applicationServerPublicKey:i,serviceWorkerUrl:o="service-worker.js",defaultNotificationTitle:l,defaultNotificationIcon:u,fieldId:k,contactValue:d,enableLogging:h=!1,dismissCooldownDays:v=7,sdkLoaded:b=!0}){const[p,R]=(0,n.useState)(!1),[C,S]=(0,n.useState)(!1),[L,g]=(0,n.useState)(!1),y=(0,n.useRef)(!1),P=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!b||typeof window>"u")return;const s=o.replace(/^\/+/,"").replace(/^https?:\/\/[^/]+\//,"");window.WebEmarsysSdk=window.WebEmarsysSdk||[],window.WebEmarsysSdk.push(["init",{applicationCode:e,enableMacSafariVapid:!0,defaultNotificationTitle:l,defaultNotificationIcon:u,autoSubscribe:!1,enableLogging:h,serviceWorker:{url:s,applicationServerPublicKey:i}}])},[b,e,i,o,l,u,h]);const f=(0,n.useCallback)(s=>{if(y.current)return;const r=c();r&&r.isSubscribed().then(t=>{t&&r.login({fieldId:k,fieldValue:s}).then(I=>{I&&(a("set",m,"login"),y.current=!0)})})},[k]),A=(0,n.useCallback)(()=>{const s=c();s&&s.isSubscribed().then(r=>{r&&s.logout().then(t=>{t&&(a("remove",m),y.current=!1)})})},[]);(0,n.useEffect)(()=>{if(!b||typeof window>"u"||M()&&!Y())return;window.WebEmarsysSdk=window.WebEmarsysSdk||[];const s=window.WebEmarsysSdk;s.push(["onReady",()=>{R(!0),c()?.isSubscribed().then(t=>{S(t)}),s.push(["onPermissionGranted",()=>{!a("get",w)&&!P.current&&(c()?.subscribe(),a("set",w,"subscribe"))}]);let r=!1;s.push(["onPermissionGranted",()=>{r=!0}]),s.push(["onPermissionDenied",()=>{r=!0}]),setTimeout(()=>{if(r)return;const t=a("get",W);t&&Date.now()-parseInt(t,10)<v*24*60*60*1e3||g(!0)},2e3)}]),s.push(["onSubscribe",()=>{S(!0),a("set",w,"subscribe"),d&&f(d)}]),s.push(["onUnsubscribe",()=>{S(!1)}])},[b,d,v,f]),(0,n.useEffect)(()=>{p&&(d?a("get",m)||f(d):a("get",m)&&A())},[p,d,f,A]);const G=(0,n.useCallback)(()=>{g(!1),P.current=!0;const s=c();if(!s){window.WebEmarsysSdk.push(t=>{t.subscribe()});return}s.subscribe()},[]),_=(0,n.useCallback)(()=>{c()?.unsubscribe()},[]),N=(0,n.useCallback)(()=>{g(!1),a("set",W,String(Date.now()))},[]);return{subscribe:G,unsubscribe:_,shouldShowPopup:L,dismissPopup:N,isSubscribed:C,isReady:p}}
2
+ //# sourceMappingURL=useEmarsysWebPush.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useEmarsysWebPush.ts"],
4
+ "sourcesContent": ["import { useCallback, useEffect, useRef, useState } from 'react'\n\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Emarsys Web Push SDK \u5168\u5C40\u7C7B\u578B\u58F0\u660E\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface EmarsysContactInfo {\n /** Emarsys \u8054\u7CFB\u4EBA\u5B57\u6BB5 ID\uFF08\u5982 10372\uFF09 */\n fieldId: number\n /** \u5B57\u6BB5\u503C\uFF08\u5982\u7528\u6237\u552F\u4E00\u6807\u8BC6\uFF09 */\n fieldValue: string\n}\n\nexport interface EmarsysInitConfig {\n /** Emarsys Domain Code\uFF0C\u4ECE\u540E\u53F0\u83B7\u53D6 */\n applicationCode: string\n /** macOS Safari 16+ \u4F7F\u7528 VAPID \u66FF\u4EE3 APNS */\n enableMacSafariVapid?: boolean\n /** \u9ED8\u8BA4\u63A8\u9001\u901A\u77E5\u6807\u9898 */\n defaultNotificationTitle?: string\n /** \u9ED8\u8BA4\u63A8\u9001\u901A\u77E5\u56FE\u6807 URL */\n defaultNotificationIcon?: string\n /** \u662F\u5426\u81EA\u52A8\u89E6\u53D1\u6D4F\u89C8\u5668\u8BA2\u9605\u5F39\u7A97\uFF0C\u5F3A\u70C8\u5EFA\u8BAE\u8BBE\u4E3A false */\n autoSubscribe?: boolean\n /** \u5F00\u53D1\u9636\u6BB5\u5F00\u542F SDK \u65E5\u5FD7 */\n enableLogging?: boolean\n serviceWorker: {\n /** Service Worker \u6587\u4EF6\u8DEF\u5F84\uFF08\u9700\u653E\u5728\u7F51\u7AD9\u6839\u76EE\u5F55\uFF09 */\n url: string\n /** VAPID \u516C\u94A5\uFF08Base64 URL-safe \u7F16\u7801\uFF09 */\n applicationServerPublicKey: string\n }\n}\n\ntype EmarsysSdkEventName =\n | 'onReady'\n | 'onSubscribe'\n | 'onUnsubscribe'\n | 'onPermissionPrompt'\n | 'onPermissionGranted'\n | 'onPermissionDenied'\n | 'onSWInitError'\n\ntype EmarsysSdkCommand = ['init', EmarsysInitConfig] | [EmarsysSdkEventName, () => void]\n\ninterface EmarsysSdkApi {\n subscribe: () => void\n unsubscribe: () => void\n login: (contactInfo: EmarsysContactInfo) => Promise<boolean>\n logout: () => Promise<boolean>\n isSubscribed: () => Promise<boolean>\n isRegistered: () => boolean\n customEvent: (eventName: string, payload?: Record<string, unknown>) => Promise<boolean>\n push: (command: EmarsysSdkCommand | ((sdk: EmarsysSdkApi) => void)) => void\n}\n\ndeclare global {\n interface Window {\n WebEmarsysSdk: EmarsysSdkApi | (EmarsysSdkCommand | ((sdk: EmarsysSdkApi) => void))[]\n }\n}\n\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Hook \u5165\u53C2\u7C7B\u578B\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface UseEmarsysWebPushOptions {\n /** Emarsys Domain Code */\n applicationCode: string\n /** VAPID \u516C\u94A5 */\n applicationServerPublicKey: string\n /** Service Worker \u8DEF\u5F84\uFF0C\u9ED8\u8BA4 'service-worker.js'\uFF08\u4E0D\u542B\u524D\u5BFC\u659C\u6760\uFF09 */\n serviceWorkerUrl?: string\n /** \u9ED8\u8BA4\u901A\u77E5\u6807\u9898 */\n defaultNotificationTitle?: string\n /** \u9ED8\u8BA4\u901A\u77E5\u56FE\u6807 URL */\n defaultNotificationIcon?: string\n /** \u8054\u7CFB\u4EBA\u4E3B\u952E\u5B57\u6BB5 ID\uFF08\u7531 Emarsys \u540E\u53F0\u914D\u7F6E\uFF09 */\n fieldId: number\n /**\n * \u5F53\u524D\u7528\u6237\u7684\u8054\u7CFB\u4EBA\u6807\u8BC6\uFF08\u5982 hashed email / customer ID\uFF09\u3002\n * null \u8868\u793A\u672A\u767B\u5F55\u7684\u533F\u540D\u8BBF\u5BA2\u3002\n */\n contactValue: string | null\n /** \u662F\u5426\u5F00\u542F\u8C03\u8BD5\u65E5\u5FD7\uFF0C\u9ED8\u8BA4 false */\n enableLogging?: boolean\n /**\n * \u70B9\u51FB\"\u7A0D\u540E\"\u540E\u7684\u5F39\u7A97\u51B7\u5374\u5929\u6570\uFF0C\u9ED8\u8BA4 7 \u5929\u3002\n * \u51B7\u5374\u671F\u95F4\u4E0D\u518D\u5C55\u793A\u81EA\u5B9A\u4E49\u5F39\u7A97\u3002\n */\n dismissCooldownDays?: number\n /**\n * SDK \u662F\u5426\u5DF2\u901A\u8FC7\u5916\u90E8 <Script> \u6807\u7B7E\u52A0\u8F7D\u5B8C\u6BD5\u3002\n * \u4F20\u5165\u6B64 flag \u4EE5\u4FBF hook \u5728\u6B63\u786E\u65F6\u673A\u521D\u59CB\u5316\u3002\n * \u9ED8\u8BA4 true\uFF08\u5047\u8BBE SDK \u5DF2\u7ECF\u52A0\u8F7D\uFF09\u3002\n */\n sdkLoaded?: boolean\n}\n\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// Hook \u8FD4\u56DE\u503C\u7C7B\u578B\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport interface UseEmarsysWebPushReturn {\n /** \u624B\u52A8\u89E6\u53D1\u6D4F\u89C8\u5668\u539F\u751F\u8BA2\u9605\u5F39\u7A97\uFF08\u4F9B\"\u8BA2\u9605\"\u6309\u94AE\u8C03\u7528\uFF09 */\n subscribe: () => void\n /** \u53D6\u6D88\u63A8\u9001\u8BA2\u9605 */\n unsubscribe: () => void\n /** \u662F\u5426\u5E94\u5411\u7528\u6237\u5C55\u793A\u81EA\u5B9A\u4E49\u5F15\u5BFC\u5F39\u7A97 */\n shouldShowPopup: boolean\n /** \u5173\u95ED\u81EA\u5B9A\u4E49\u5F39\u7A97\u5E76\u5199\u5165\u51B7\u5374\u6807\u8BB0 */\n dismissPopup: () => void\n /** \u5F53\u524D\u662F\u5426\u5DF2\u8BA2\u9605\uFF08\u5F02\u6B65\u68C0\u6D4B\u5B8C\u6210\u540E\u66F4\u65B0\uFF09 */\n isSubscribed: boolean\n /** SDK \u662F\u5426\u5C31\u7EEA */\n isReady: boolean\n}\n\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// \u5DE5\u5177\u51FD\u6570\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst STORAGE_KEY_SUBSCRIBE = 'emarsysSubscribe'\nconst STORAGE_KEY_LOGIN = 'emarsysLogin'\nconst STORAGE_KEY_DISMISSED = 'anker_push_dismissed'\n\nfunction isIOS(): boolean {\n if (typeof navigator === 'undefined') return false\n return /iphone|ipad|ipod/.test(navigator.userAgent.toLowerCase())\n}\n\nfunction isStandaloneWebApp(): boolean {\n if (typeof window === 'undefined') return false\n return (\n window.matchMedia('(display-mode: standalone)').matches ||\n // Safari standalone \u5C5E\u6027\uFF08\u975E\u6807\u51C6\uFF09\n ('standalone' in window.navigator && (window.navigator as Navigator & { standalone?: boolean }).standalone === true)\n )\n}\n\nfunction safeLocalStorage(action: 'get', key: string): string | null\nfunction safeLocalStorage(action: 'set', key: string, value: string): void\nfunction safeLocalStorage(action: 'remove', key: string): void\nfunction safeLocalStorage(action: 'get' | 'set' | 'remove', key: string, value?: string): string | null | void {\n try {\n if (action === 'get') return localStorage.getItem(key)\n if (action === 'set' && value !== undefined) localStorage.setItem(key, value)\n if (action === 'remove') localStorage.removeItem(key)\n } catch {\n // SSR \u6216\u9690\u79C1\u6A21\u5F0F\u4E0B localStorage \u4E0D\u53EF\u7528\n }\n return null\n}\n\nfunction getSdkApi(): EmarsysSdkApi | null {\n if (typeof window === 'undefined') return null\n const sdk = window.WebEmarsysSdk\n if (!sdk || Array.isArray(sdk)) return null\n return sdk as EmarsysSdkApi\n}\n\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// \u6838\u5FC3 Hook\n// \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * useEmarsysWebPush\n *\n * \u5C01\u88C5 Emarsys Web Push SDK \u7684\u8BA2\u9605\u751F\u547D\u5468\u671F\uFF0C\u5305\u62EC\uFF1A\n * - SDK \u521D\u59CB\u5316\n * - \u81EA\u5B9A\u4E49\u5F39\u7A97\u5C55\u793A\u903B\u8F91\uFF08\u4E24\u6B65\u7B56\u7565\uFF0C\u907F\u514D\u76F4\u63A5\u89E6\u53D1\u6D4F\u89C8\u5668\u539F\u751F\u5F39\u7A97\uFF09\n * - \u5DF2\u767B\u5F55\u8054\u7CFB\u4EBA\u7684 login / logout \u81EA\u52A8\u7BA1\u7406\n * - \u5DF2\u6709\u8BA2\u9605\u7528\u6237\u7684\u8FC1\u79FB\uFF08\u4ECE\u65E7\u63A8\u9001\u7CFB\u7EDF\u8FC1\u79FB\uFF09\n *\n * @example\n * ```tsx\n * const { shouldShowPopup, subscribe, dismissPopup } = useEmarsysWebPush({\n * applicationCode: process.env.NEXT_PUBLIC_EMARSYS_APP_CODE!,\n * applicationServerPublicKey: process.env.NEXT_PUBLIC_EMARSYS_VAPID_PUBLIC_KEY!,\n * fieldId: 10372,\n * contactValue: user?.customerId ?? null,\n * sdkLoaded: scriptLoaded,\n * })\n * ```\n */\nexport function useEmarsysWebPush({\n applicationCode,\n applicationServerPublicKey,\n serviceWorkerUrl = 'service-worker.js',\n defaultNotificationTitle,\n defaultNotificationIcon,\n fieldId,\n contactValue,\n enableLogging = false,\n dismissCooldownDays = 7,\n sdkLoaded = true,\n}: UseEmarsysWebPushOptions): UseEmarsysWebPushReturn {\n const [isReady, setIsReady] = useState(false)\n const [isSubscribed, setIsSubscribed] = useState(false)\n const [shouldShowPopup, setShouldShowPopup] = useState(false)\n\n // \u907F\u514D\u91CD\u590D login/logout\n const hasPerformedLogin = useRef(false)\n // \u8FFD\u8E2A\u5F53\u524D session \u5185\u662F\u5426\u5DF2\u4E3B\u52A8\u89E6\u53D1\u8FC7 subscribe\n const isGeneralSubscribeRef = useRef(false)\n\n // \u2500\u2500 \u521D\u59CB\u5316 SDK \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n useEffect(() => {\n if (!sdkLoaded || typeof window === 'undefined') return\n\n // SDK v4.7.0 \u5185\u90E8 registerServiceWorker() \u6267\u884C `/${url}` \u62FC\u63A5\uFF0C\n // \u56E0\u6B64\u6B64\u5904\u5FC5\u987B\u4F20\u4E0D\u542B\u524D\u5BFC\u659C\u6760\u7684\u7EAF\u8DEF\u5F84\uFF08\u5982 'service-worker.js'\uFF09\uFF0C\n // \u4F20\u5165\u5E26\u659C\u6760\u7684\u8DEF\u5F84\u6216\u7EDD\u5BF9 URL \u5747\u4F1A\u5BFC\u81F4\u53CC\u659C\u6760/\u8DE8\u57DF SecurityError\u3002\n const swPath = serviceWorkerUrl.replace(/^\\/+/, '').replace(/^https?:\\/\\/[^/]+\\//, '')\n\n window.WebEmarsysSdk = window.WebEmarsysSdk || []\n const sdk = window.WebEmarsysSdk as (EmarsysSdkCommand | ((api: EmarsysSdkApi) => void))[]\n\n sdk.push([\n 'init',\n {\n applicationCode,\n enableMacSafariVapid: true,\n defaultNotificationTitle,\n defaultNotificationIcon,\n autoSubscribe: false,\n enableLogging,\n serviceWorker: {\n url: swPath,\n applicationServerPublicKey,\n },\n },\n ])\n }, [\n sdkLoaded,\n applicationCode,\n applicationServerPublicKey,\n serviceWorkerUrl,\n defaultNotificationTitle,\n defaultNotificationIcon,\n enableLogging,\n ])\n\n // \u2500\u2500 \u6267\u884C Emarsys login\uFF08\u5173\u8054\u5DF2\u77E5\u8054\u7CFB\u4EBA\uFF09\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const performLogin = useCallback(\n (value: string) => {\n if (hasPerformedLogin.current) return\n const api = getSdkApi()\n if (!api) return\n\n api.isSubscribed().then(subscribed => {\n if (!subscribed) return\n api.login({ fieldId, fieldValue: value }).then(result => {\n if (result) {\n safeLocalStorage('set', STORAGE_KEY_LOGIN, 'login')\n hasPerformedLogin.current = true\n }\n })\n })\n },\n [fieldId]\n )\n\n // \u2500\u2500 \u6267\u884C Emarsys logout\uFF08\u89E3\u9664\u8054\u7CFB\u4EBA\u5173\u8054\uFF09\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const performLogout = useCallback(() => {\n const api = getSdkApi()\n if (!api) return\n\n api.isSubscribed().then(subscribed => {\n if (!subscribed) return\n api.logout().then(result => {\n if (result) {\n safeLocalStorage('remove', STORAGE_KEY_LOGIN)\n hasPerformedLogin.current = false\n }\n })\n })\n }, [])\n\n // \u2500\u2500 \u6CE8\u518C SDK \u56DE\u8C03 & \u4E1A\u52A1\u903B\u8F91 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n useEffect(() => {\n if (!sdkLoaded || typeof window === 'undefined') return\n\n // iOS \u6D4F\u89C8\u5668\uFF08\u975E PWA \u6A21\u5F0F\uFF09\u4E0D\u505A\u4EFB\u4F55\u64CD\u4F5C\n if (isIOS() && !isStandaloneWebApp()) return\n\n window.WebEmarsysSdk = window.WebEmarsysSdk || []\n const sdk = window.WebEmarsysSdk as (EmarsysSdkCommand | ((api: EmarsysSdkApi) => void))[]\n\n sdk.push([\n 'onReady',\n () => {\n setIsReady(true)\n\n // \u68C0\u67E5\u5F53\u524D\u8BA2\u9605\u72B6\u6001\n getSdkApi()\n ?.isSubscribed()\n .then(subscribed => {\n setIsSubscribed(subscribed)\n })\n\n // \u5DF2\u6709\u8BA2\u9605\u7528\u6237\u8FC1\u79FB\uFF08\u65E7\u63A8\u9001\u7CFB\u7EDF \u2192 Emarsys\uFF09\n sdk.push([\n 'onPermissionGranted',\n () => {\n if (!safeLocalStorage('get', STORAGE_KEY_SUBSCRIBE) && !isGeneralSubscribeRef.current) {\n getSdkApi()?.subscribe()\n safeLocalStorage('set', STORAGE_KEY_SUBSCRIBE, 'subscribe')\n }\n },\n ])\n\n // \u5224\u65AD\u662F\u5426\u9700\u8981\u5C55\u793A\u81EA\u5B9A\u4E49\u5F15\u5BFC\u5F39\u7A97\n // \u5EF6\u8FDF 2 \u79D2\uFF0C\u7B49\u5F85 onPermissionGranted / onPermissionDenied \u5F02\u6B65\u56DE\u8C03\n let permissionAlreadyHandled = false\n sdk.push([\n 'onPermissionGranted',\n () => {\n permissionAlreadyHandled = true\n },\n ])\n sdk.push([\n 'onPermissionDenied',\n () => {\n permissionAlreadyHandled = true\n },\n ])\n\n setTimeout(() => {\n if (permissionAlreadyHandled) return\n\n // \u68C0\u67E5\u51B7\u5374\u671F\n const dismissedAt = safeLocalStorage('get', STORAGE_KEY_DISMISSED)\n if (dismissedAt) {\n const elapsed = Date.now() - parseInt(dismissedAt, 10)\n if (elapsed < dismissCooldownDays * 24 * 60 * 60 * 1000) return\n }\n\n setShouldShowPopup(true)\n }, 2000)\n },\n ])\n\n // \u8BA2\u9605\u6210\u529F\u540E\u66F4\u65B0\u72B6\u6001\u5E76\u6267\u884C login\n sdk.push([\n 'onSubscribe',\n () => {\n setIsSubscribed(true)\n safeLocalStorage('set', STORAGE_KEY_SUBSCRIBE, 'subscribe')\n if (contactValue) {\n performLogin(contactValue)\n }\n },\n ])\n\n sdk.push([\n 'onUnsubscribe',\n () => {\n setIsSubscribed(false)\n },\n ])\n }, [sdkLoaded, contactValue, dismissCooldownDays, performLogin])\n\n // \u2500\u2500 \u76D1\u542C contactValue \u53D8\u5316\uFF0C\u81EA\u52A8 login / logout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n useEffect(() => {\n if (!isReady) return\n\n if (contactValue) {\n if (!safeLocalStorage('get', STORAGE_KEY_LOGIN)) {\n performLogin(contactValue)\n }\n } else {\n if (safeLocalStorage('get', STORAGE_KEY_LOGIN)) {\n performLogout()\n }\n }\n }, [isReady, contactValue, performLogin, performLogout])\n\n // \u2500\u2500 \u5BF9\u5916\u66B4\u9732\u7684 API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n const subscribe = useCallback(() => {\n setShouldShowPopup(false)\n isGeneralSubscribeRef.current = true\n const api = getSdkApi()\n if (!api) {\n const sdk = window.WebEmarsysSdk as ((api: EmarsysSdkApi) => void)[]\n sdk.push(sdkApi => {\n sdkApi.subscribe()\n })\n return\n }\n api.subscribe()\n }, [])\n\n const unsubscribe = useCallback(() => {\n getSdkApi()?.unsubscribe()\n }, [])\n\n const dismissPopup = useCallback(() => {\n setShouldShowPopup(false)\n safeLocalStorage('set', STORAGE_KEY_DISMISSED, String(Date.now()))\n }, [])\n\n return {\n subscribe,\n unsubscribe,\n shouldShowPopup,\n dismissPopup,\n isSubscribed,\n isReady,\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uB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AG,CAAC,CAAC,EAEC+B,KAAe,eAAY,IAAM,CACrCd,EAAmB,EAAK,EACxBrB,EAAiB,MAAOH,EAAuB,OAAO,KAAK,IAAI,CAAC,CAAC,CACnE,EAAG,CAAC,CAAC,EAEL,MAAO,CACL,UAAAmC,EACA,YAAAE,EACA,gBAAAd,EACA,aAAAe,EACA,aAAAjB,EACA,QAAAF,CACF,CACF",
6
+ "names": ["useEmarsysWebPush_exports", "__export", "useEmarsysWebPush", "__toCommonJS", "import_react", "STORAGE_KEY_SUBSCRIBE", "STORAGE_KEY_LOGIN", "STORAGE_KEY_DISMISSED", "isIOS", "isStandaloneWebApp", "safeLocalStorage", "action", "key", "value", "getSdkApi", "sdk", "applicationCode", "applicationServerPublicKey", "serviceWorkerUrl", "defaultNotificationTitle", "defaultNotificationIcon", "fieldId", "contactValue", "enableLogging", "dismissCooldownDays", "sdkLoaded", "isReady", "setIsReady", "isSubscribed", "setIsSubscribed", "shouldShowPopup", "setShouldShowPopup", "hasPerformedLogin", "isGeneralSubscribeRef", "swPath", "performLogin", "api", "subscribed", "result", "performLogout", "permissionAlreadyHandled", "dismissedAt", "subscribe", "sdkApi", "unsubscribe", "dismissPopup"]
7
+ }
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface LocalizedLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
3
+ href?: string;
4
+ }
5
+ declare const LocalizedLink: React.ForwardRefExoticComponent<LocalizedLinkProps & React.RefAttributes<HTMLAnchorElement>>;
6
+ export { LocalizedLink };
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var u=Object.create;var a=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var M=(e,o)=>{for(var r in o)a(e,r,{get:o[r],enumerable:!0})},l=(e,o,r,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of A(o))!H.call(e,t)&&t!==r&&a(e,t,{get:()=>o[t],enumerable:!(n=z(o,t))||n.enumerable});return e};var x=(e,o,r)=>(r=e!=null?u(k(e)):{},l(o||!e||!e.__esModule?a(r,"default",{value:e,enumerable:!0}):r,e)),P=e=>l(a({},"__esModule",{value:!0}),e);var R={};M(R,{LocalizedLink:()=>c});module.exports=P(R);var i=require("react/jsx-runtime"),L=x(require("react")),d=require("../helpers/index.js"),f=require("../biz-components/AiuiProvider/index.js");const c=L.forwardRef(({href:e,className:o,children:r,rel:n="noreferrer",...t},m)=>{const{locale:s="us"}=(0,f.useAiuiContext)(),p=L.useMemo(()=>e?(0,d.getLocalizedPath)(e,s):void 0,[e,s]);return e?(0,i.jsx)("a",{ref:m,href:p,rel:n,className:o,...t,children:r}):(0,i.jsx)(i.Fragment,{children:r})});c.displayName="LocalizedLink";
2
+ //# sourceMappingURL=LocalizedLink.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/shared/LocalizedLink.tsx"],
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { getLocalizedPath } from '../helpers/index.js'\nimport { useAiuiContext } from '../biz-components/AiuiProvider/index.js'\n\nexport interface LocalizedLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {\n href?: string\n}\n\nconst LocalizedLink = React.forwardRef<HTMLAnchorElement, LocalizedLinkProps>(\n ({ href, className, children, rel = 'noreferrer', ...props }, ref) => {\n const { locale = 'us' } = useAiuiContext()\n const localizedHref = React.useMemo(() => (href ? getLocalizedPath(href, locale) : undefined), [href, locale])\n\n if (!href) {\n return <>{children}</>\n }\n\n return (\n <a ref={ref} href={localizedHref} rel={rel} className={className} {...props}>\n {children}\n </a>\n )\n }\n)\n\nLocalizedLink.displayName = 'LocalizedLink'\n\nexport { LocalizedLink }\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAgBa,IAAAI,EAAA,6BAdbC,EAAuB,oBACvBC,EAAiC,+BACjCC,EAA+B,mDAM/B,MAAML,EAAgBG,EAAM,WAC1B,CAAC,CAAE,KAAAG,EAAM,UAAAC,EAAW,SAAAC,EAAU,IAAAC,EAAM,aAAc,GAAGC,CAAM,EAAGC,IAAQ,CACpE,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnCC,EAAgBV,EAAM,QAAQ,IAAOG,KAAO,oBAAiBA,EAAMM,CAAM,EAAI,OAAY,CAACN,EAAMM,CAAM,CAAC,EAE7G,OAAKN,KAKH,OAAC,KAAE,IAAKK,EAAK,KAAME,EAAe,IAAKJ,EAAK,UAAWF,EAAY,GAAGG,EACnE,SAAAF,EACH,KANO,mBAAG,SAAAA,EAAS,CAQvB,CACF,EAEAR,EAAc,YAAc",
6
+ "names": ["LocalizedLink_exports", "__export", "LocalizedLink", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_AiuiProvider", "href", "className", "children", "rel", "props", "ref", "locale", "localizedHref"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as r,jsxs as a}from"react/jsx-runtime";import B from"../Title/index.js";import{cn as o}from"../../helpers/utils.js";import _ from"../../components/picture.js";import N from"../../components/button.js";import S from"../SwiperBox/index.js";import{withLayout as C}from"../../shared/Styles.js";import D,{useState as L,useRef as g,useCallback as A,useImperativeHandle as j,useEffect as M}from"react";import{useExposure as H}from"../../hooks/useExposure.js";import{trackUrlRef as T}from"../../shared/trackUrlRef.js";import z from"../../shared/throttle.js";import{Heading as R}from"../../components/heading.js";const l="image",s="scene_banner",P=({item:e,idx:t,itemShape:m,hoverIndex:v,getRef:w,handleSwiperItemClick:b,contentWidth:d,primaryButton:c,event:p,data:u,accordionRef:k})=>{const h=v===t,y=h?8:1;return H({current:k.current[t]},{componentType:l,componentName:s,componentTitle:e?.title,position:t+1,componentDescription:e?.subTitle}),a("div",{style:{flex:`${y} 1 0%`,transition:"all 0.6s"},ref:x=>{x&&w(t,x)},className:o("relative cursor-pointer overflow-hidden",m==="round"?"rounded-2xl":""),onMouseEnter:()=>b(t),onClick:()=>{b(t)},children:[r("a",{href:T(e?.imgLink,`${l}_${s}`),"data-headless-type-name":`${l}#${s}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}`,children:r(_,{source:e?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",alt:e?.img?.alt||""})}),a("div",{style:{width:d},className:o("absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in",h&&d?"opacity-100":"opacity-0"),children:[a("div",{className:"mr-16 flex-1 overflow-hidden",children:[r(R,{as:"h3",className:"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold",children:e?.title}),r(R,{as:"h4",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]",children:e?.subTitle})]}),c&&a(N,{className:o("mb-1.5 font-bold"),as:"a",href:T(e?.link,`${l}_${s}`),"data-headless-type-name":`${l}#${s}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${c}`,onClick:()=>p?.primaryButton?.(u,t),children:[c,r("span",{className:"sr-only",children:e?.title??e?.subTitle})]})]})]},t)},O=({data:e,configuration:t})=>{const m=g(null);return H(m,{componentType:l,componentName:s,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.subTitle}),a("div",{ref:m,className:o("bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid",t?.itemShape==="round"?"rounded-2xl":""),children:[r("a",{href:T(e?.imgLink,`${l}_${s}`),"data-headless-type-name":`${l}#${s}`,"data-headless-title-desc-button":`${e?.title}@${e?.subTitle}`,"data-headless-nav-position":`''#${t?.index+1}`,children:r(_,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:e?.mobileImg?.url||"",alt:e?.mobileImg?.alt||""})}),a("div",{className:o("absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4"),children:[a("div",{className:"tablet:mb-6 mb-4 flex-1 overflow-hidden",children:[r("h3",{className:"text-info-primary line-clamp-3 text-2xl font-bold leading-[1.2]",dangerouslySetInnerHTML:{__html:e?.title}}),r("h4",{className:"text-info-primary line-clamp-2 text-sm font-bold",dangerouslySetInnerHTML:{__html:e?.subTitle}})]}),t?.primaryButton&&r(N,{as:"a",variant:"secondary","aria-label":e?.title??e?.subTitle,className:o("text-info-primary text-sm font-bold"),href:T(e.link,`${l}_${s}`),"data-headless-type-name":`${l}#${s}`,"data-headless-nav-position":`''#${t?.index+1}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${t?.primaryButton}`,children:t?.primaryButton})]})]})},E=D.forwardRef(({data:e,autoplay:t={enabled:!1,loop:!1,interval:1500},className:m="",event:v,...w},b)=>{const[d,c]=L(0),p=g(0),u=g([]),[k,h]=L(0),y=g(null);j(b,()=>y.current);const x=(n,i)=>{i&&(u.current[n]=i)};M(()=>{const n=()=>{u.current[p.current]&&h(u.current[p.current].offsetWidth)};n();const i=z(n,300);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const I=A(n=>{d!==n&&(c(n),p.current=n)},[e?.products,d]);return M(()=>{let n;return t?.enabled&&(n=setInterval(()=>{c(i=>{const $=i??0;let f;if(t.loop!==!1)f=($+1)%e?.products?.length;else if(f=$+1,f>=e?.products?.length)return f=e?.products?.length-1,n&&clearInterval(n),$;return p.current=f,f})},t?.interval)),()=>{n&&clearInterval(n)}},[t?.enabled,t?.interval,t?.loop,e?.products?.length,I]),a("div",{...w,ref:y,children:[e?.title&&r(B,{data:{title:e?.title}}),r("div",{className:o("laptop:block hidden",{"aiui-dark":e?.theme==="dark"}),children:r("div",{className:o("lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden",m),children:e?.products?.map((n,i)=>r(P,{item:n,idx:i,itemShape:e?.itemShape,hoverIndex:d,getRef:x,handleSwiperItemClick:I,contentWidth:k,primaryButton:e?.primaryButton,event:v,data:e,accordionRef:u},i))})}),r("div",{className:o("laptop:hidden block",{"aiui-dark":e?.theme==="dark"}),children:r(S,{className:o("h-[400px] !overflow-visible",m),id:"AccordionCards"+e?.key,data:{list:e?.products,configuration:{shape:e?.shape,itemShape:e?.itemShape,primaryButton:e?.primaryButton,event:v,title:e?.title}},Slide:O,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3}}})})]})});E.displayName="AccordionCards";var Z=C(E);export{Z as default};
1
+ "use client";import{jsx as n,jsxs as a}from"react/jsx-runtime";import B from"../Title/index.js";import{cn as o}from"../../helpers/utils.js";import x from"../../components/picture.js";import N from"../../components/button.js";import S from"../SwiperBox/index.js";import{withLayout as C}from"../../shared/Styles.js";import D,{useState as L,useRef as T,useCallback as j,useImperativeHandle as A,useEffect as M}from"react";import{useExposure as H}from"../../hooks/useExposure.js";import{trackUrlRef as k}from"../../shared/trackUrlRef.js";import z from"../../shared/throttle.js";import{Heading as R}from"../../components/heading.js";const l="image",s="scene_banner",P=({item:e,idx:t,itemShape:m,hoverIndex:b,getRef:w,handleSwiperItemClick:v,contentWidth:c,primaryButton:d,event:p,data:u,accordionRef:I})=>{const h=b===t,g=h?8:1;return H({current:I.current[t]},{componentType:l,componentName:s,componentTitle:e?.title,position:t+1,componentDescription:e?.subTitle}),a("div",{style:{flex:`${g} 1 0%`,transition:"all 0.6s"},ref:y=>{y&&w(t,y)},className:o("relative cursor-pointer overflow-hidden",m==="round"?"rounded-2xl":""),onMouseEnter:()=>v(t),onClick:()=>{v(t)},children:[e?.imgLink?n("a",{href:k(e.imgLink,`${l}_${s}`),"data-headless-type-name":`${l}#${s}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}`,children:n(x,{source:e?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",alt:e?.img?.alt||""})}):n(x,{source:e?.img?.url,className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",alt:e?.img?.alt||""}),a("div",{style:{width:c},className:o("absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in",h&&c?"opacity-100":"opacity-0"),children:[a("div",{className:"mr-16 flex-1 overflow-hidden",children:[n(R,{as:"h3",className:"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold",children:e?.title}),n(R,{as:"h4",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]",children:e?.subTitle})]}),d&&a(N,{className:o("mb-1.5 font-bold"),as:"a",href:k(e?.link,`${l}_${s}`),"data-headless-type-name":`${l}#${s}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${d}`,onClick:()=>p?.primaryButton?.(u,t),children:[d,n("span",{className:"sr-only",children:e?.title??e?.subTitle})]})]})]},t)},O=({data:e,configuration:t})=>{const m=T(null);return H(m,{componentType:l,componentName:s,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.subTitle}),a("div",{ref:m,className:o("bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid",t?.itemShape==="round"?"rounded-2xl":""),children:[e?.imgLink?n("a",{href:k(e.imgLink,`${l}_${s}`),"data-headless-type-name":`${l}#${s}`,"data-headless-title-desc-button":`${e?.title}@${e?.subTitle}`,"data-headless-nav-position":`''#${t?.index+1}`,children:n(x,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:e?.mobileImg?.url||"",alt:e?.mobileImg?.alt||""})}):n(x,{className:"size-full object-cover [&_img]:h-full [&_img]:object-cover",source:e?.mobileImg?.url||"",alt:e?.mobileImg?.alt||""}),a("div",{className:o("absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4"),children:[a("div",{className:"tablet:mb-6 mb-4 flex-1 overflow-hidden",children:[n("h3",{className:"text-info-primary line-clamp-3 text-2xl font-bold leading-[1.2]",dangerouslySetInnerHTML:{__html:e?.title}}),n("h4",{className:"text-info-primary line-clamp-2 text-sm font-bold",dangerouslySetInnerHTML:{__html:e?.subTitle}})]}),t?.primaryButton&&n(N,{as:"a",variant:"secondary","aria-label":e?.title??e?.subTitle,className:o("text-info-primary text-sm font-bold"),href:k(e.link,`${l}_${s}`),"data-headless-type-name":`${l}#${s}`,"data-headless-nav-position":`''#${t?.index+1}`,"data-headless-title-desc-button":`${e?.title}#${e?.subTitle}#${t?.primaryButton}`,children:t?.primaryButton})]})]})},E=D.forwardRef(({data:e,autoplay:t={enabled:!1,loop:!1,interval:1500},className:m="",event:b,...w},v)=>{const[c,d]=L(0),p=T(0),u=T([]),[I,h]=L(0),g=T(null);A(v,()=>g.current);const y=(r,i)=>{i&&(u.current[r]=i)};M(()=>{const r=()=>{u.current[p.current]&&h(u.current[p.current].offsetWidth)};r();const i=z(r,300);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const _=j(r=>{c!==r&&(d(r),p.current=r)},[e?.products,c]);return M(()=>{let r;return t?.enabled&&(r=setInterval(()=>{d(i=>{const $=i??0;let f;if(t.loop!==!1)f=($+1)%e?.products?.length;else if(f=$+1,f>=e?.products?.length)return f=e?.products?.length-1,r&&clearInterval(r),$;return p.current=f,f})},t?.interval)),()=>{r&&clearInterval(r)}},[t?.enabled,t?.interval,t?.loop,e?.products?.length,_]),a("div",{...w,ref:g,children:[e?.title&&n(B,{data:{title:e?.title}}),n("div",{className:o("laptop:block hidden",{"aiui-dark":e?.theme==="dark"}),children:n("div",{className:o("lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden",m),children:e?.products?.map((r,i)=>n(P,{item:r,idx:i,itemShape:e?.itemShape,hoverIndex:c,getRef:y,handleSwiperItemClick:_,contentWidth:I,primaryButton:e?.primaryButton,event:b,data:e,accordionRef:u},i))})}),n("div",{className:o("laptop:hidden block",{"aiui-dark":e?.theme==="dark"}),children:n(S,{className:o("h-[400px] !overflow-visible",m),id:"AccordionCards"+e?.key,data:{list:e?.products,configuration:{shape:e?.shape,itemShape:e?.itemShape,primaryButton:e?.primaryButton,event:b,title:e?.title}},Slide:O,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3}}})})]})});E.displayName="AccordionCards";var Z=C(E);export{Z as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AccordionCards/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport React, { useState, useRef, useCallback, useImperativeHandle, useEffect, type RefObject } from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\nimport throttle from '../../shared/throttle.js'\nimport { Heading } from '../../components/heading.js'\n\nconst componentType = 'image'\nconst componentName = 'scene_banner'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: Img\n mobileImg?: Img\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n imgLink?: string\n}\n\nexport type AccordionCardsType = Omit<React.HTMLAttributes<HTMLDivElement>, 'className'> & {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n theme?: 'light' | 'dark'\n }\n /**\n * \u81EA\u52A8\u64AD\u653E\u914D\u7F6E\n */\n autoplay?: {\n /**\n * \u662F\u5426\u5F00\u542F\u81EA\u52A8\u64AD\u653E\n */\n enabled: boolean\n /**\n * \u662F\u5426\u5FAA\u73AF\u64AD\u653E\n */\n loop?: boolean\n /**\n * \u81EA\u52A8\u64AD\u653E\u95F4\u9694\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\n */\n interval?: number\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n}\n\nconst AccordionCardsPcItem = ({\n item,\n idx,\n itemShape,\n hoverIndex,\n getRef,\n handleSwiperItemClick,\n contentWidth,\n primaryButton,\n event,\n data,\n accordionRef,\n}: {\n item: ItemType\n idx: number\n itemShape: 'round' | 'square' | undefined\n hoverIndex: number | null\n getRef: (_idx: number, _el: HTMLDivElement) => void\n handleSwiperItemClick: (_idx: number) => void\n contentWidth: number\n primaryButton: string | undefined\n event: any\n data: AccordionCardsType['data']\n accordionRef: React.MutableRefObject<HTMLDivElement[]>\n}) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 8 : 1\n\n useExposure({ current: accordionRef.current[idx] } as RefObject<HTMLDivElement>, {\n componentType,\n componentName,\n componentTitle: item?.title,\n position: idx + 1,\n componentDescription: item?.subTitle,\n })\n\n return (\n <div\n key={idx}\n style={{\n flex: `${flexValue} 1 0%`,\n transition: 'all 0.6s',\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn('relative cursor-pointer overflow-hidden', itemShape === 'round' ? 'rounded-2xl' : '')}\n onMouseEnter={() => handleSwiperItemClick(idx)}\n onClick={() => {\n handleSwiperItemClick(idx)\n }}\n >\n <a\n href={trackUrlRef(item?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}`}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n alt={item?.img?.alt || ''}\n />\n </a>\n <div\n style={{\n width: contentWidth,\n }}\n className={cn(\n 'absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in',\n isExpanded && contentWidth ? 'opacity-100' : 'opacity-0'\n )}\n >\n <div className=\"mr-16 flex-1 overflow-hidden\">\n <Heading as=\"h3\" className=\"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold\">\n {item?.title}\n </Heading>\n <Heading\n as=\"h4\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]\"\n >\n {item?.subTitle}\n </Heading>\n </div>\n {primaryButton && (\n <Button\n className={cn('mb-1.5 font-bold')}\n as=\"a\"\n href={trackUrlRef(item?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}#${primaryButton}`}\n onClick={() => event?.primaryButton?.(data, idx)}\n >\n {primaryButton}\n <span className=\"sr-only\">{item?.title ?? item?.subTitle}</span>\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.subTitle,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n <a\n href={trackUrlRef(data?.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}@${data?.subTitle}`}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n >\n <Picture\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n source={data?.mobileImg?.url || ''}\n alt={data?.mobileImg?.alt || ''}\n />\n </a>\n <div className={cn('absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4')}>\n <div className=\"tablet:mb-6 mb-4 flex-1 overflow-hidden\">\n <h3\n className=\"text-info-primary line-clamp-3 text-2xl font-bold leading-[1.2]\"\n dangerouslySetInnerHTML={{ __html: data?.title }}\n ></h3>\n <h4\n className=\"text-info-primary line-clamp-2 text-sm font-bold\"\n dangerouslySetInnerHTML={{ __html: data?.subTitle }}\n ></h4>\n </div>\n\n {configuration?.primaryButton && (\n <Button\n as=\"a\"\n variant=\"secondary\"\n aria-label={data?.title ?? data?.subTitle}\n className={cn('text-info-primary text-sm font-bold')}\n href={trackUrlRef(data.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n data-headless-title-desc-button={`${data?.title}#${data?.subTitle}#${configuration?.primaryButton}`}\n >\n {configuration?.primaryButton}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst AccordionCards = React.forwardRef<HTMLDivElement, AccordionCardsType>(\n ({ data, autoplay = { enabled: false, loop: false, interval: 1500 }, className = '', event, ...rest }, ref) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n\n const hoverIndexRef = useRef<number>(0)\n const accordionRef = useRef<HTMLDivElement[]>([])\n const [contentWidth, setContentWidth] = useState<number>(0)\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n useEffect(() => {\n const handleResize = () => {\n if (accordionRef.current[hoverIndexRef.current]) {\n setContentWidth(accordionRef.current[hoverIndexRef.current].offsetWidth)\n }\n }\n handleResize()\n const throttleResize = throttle(handleResize, 300)\n window.addEventListener('resize', throttleResize)\n return () => window.removeEventListener('resize', throttleResize)\n }, [])\n\n const handleSwiperItemClick = useCallback(\n (idx: number) => {\n if (hoverIndex === idx) return\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n hoverIndexRef.current = idx\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [data?.products, hoverIndex]\n )\n\n useEffect(() => {\n let autoPlayTimer: NodeJS.Timeout\n if (autoplay?.enabled) {\n autoPlayTimer = setInterval(() => {\n setHoverIndex(prev => {\n const currentIndex = prev ?? 0\n let nextIndex: number\n\n if (autoplay.loop !== false) {\n // \u9ED8\u8BA4\u5FAA\u73AF\u64AD\u653E\n nextIndex = (currentIndex + 1) % data?.products?.length\n } else {\n // \u4E0D\u5FAA\u73AF\uFF1A\u64AD\u653E\u5230\u6700\u540E\u4E00\u4E2A\u540E\u505C\u6B62\n nextIndex = currentIndex + 1\n if (nextIndex >= data?.products?.length) {\n nextIndex = data?.products?.length - 1\n // \u505C\u6B62\u81EA\u52A8\u64AD\u653E\n if (autoPlayTimer) {\n clearInterval(autoPlayTimer)\n }\n return currentIndex // \u4FDD\u6301\u5728\u6700\u540E\u4E00\u4E2A\n }\n }\n\n hoverIndexRef.current = nextIndex\n return nextIndex\n })\n }, autoplay?.interval)\n }\n return () => {\n if (autoPlayTimer) {\n clearInterval(autoPlayTimer)\n }\n }\n }, [autoplay?.enabled, autoplay?.interval, autoplay?.loop, data?.products?.length, handleSwiperItemClick])\n\n return (\n <div {...rest} ref={innerRef}>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div className={cn('laptop:block hidden', { 'aiui-dark': data?.theme === 'dark' })}>\n <div\n className={cn(\n 'lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden',\n className\n )}\n >\n {data?.products?.map((item, idx) => (\n <AccordionCardsPcItem\n key={idx}\n item={item}\n idx={idx}\n itemShape={data?.itemShape}\n hoverIndex={hoverIndex}\n getRef={getRef}\n handleSwiperItemClick={handleSwiperItemClick}\n contentWidth={contentWidth}\n primaryButton={data?.primaryButton}\n event={event}\n data={data}\n accordionRef={accordionRef}\n />\n ))}\n </div>\n </div>\n <div className={cn('laptop:hidden block', { 'aiui-dark': data?.theme === 'dark' })}>\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n itemShape: data?.itemShape,\n primaryButton: data?.primaryButton,\n event: event,\n title: data?.title,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n }}\n />\n </div>\n </div>\n )\n }\n)\n\nAccordionCards.displayName = 'AccordionCards'\nexport default withLayout(AccordionCards)\n"],
5
- "mappings": "aA4HQ,cAAAA,EAeA,QAAAC,MAfA,oBA3HR,OAAOC,MAAW,oBAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAOC,MAAY,6BACnB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,GAAS,YAAAC,EAAU,UAAAC,EAAQ,eAAAC,EAAa,uBAAAC,EAAqB,aAAAC,MAAiC,QACrG,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,eAAAC,MAAmB,8BAE5B,OAAOC,MAAc,2BACrB,OAAS,WAAAC,MAAe,8BAExB,MAAMC,EAAgB,QAChBC,EAAgB,eAoDhBC,EAAuB,CAAC,CAC5B,KAAAC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O,CAAC,EAC/E,SAAA9B,EAACM,EAAA,CACC,UAAWH,EAAG,8BAA+BqC,CAAS,EACtD,GAAI,iBAAmBV,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,UAAWA,GAAM,UACjB,cAAeA,GAAM,cACrB,MAAOD,EACP,MAAOC,GAAM,KACf,CACF,EACA,MAAOK,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,CACF,EACF,EACF,GACF,CAEJ,CACF,EAEAG,EAAe,YAAc,iBAC7B,IAAOe,EAAQ9C,EAAW+B,CAAc",
4
+ "sourcesContent": ["'use client'\nimport Title from '../Title/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport React, { useState, useRef, useCallback, useImperativeHandle, useEffect, type RefObject } from 'react'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\nimport throttle from '../../shared/throttle.js'\nimport { Heading } from '../../components/heading.js'\n\nconst componentType = 'image'\nconst componentName = 'scene_banner'\n\n/** Hook\uFF1A\u76D1\u542C\u7A97\u53E3\u5BBD\u5EA6 */\ntype ItemType = {\n /** \u6807\u9898\u6587\u672C */\n title: string\n /** \u56FE\u7247*/\n img: Img\n mobileImg?: Img\n /** \u5185\u5BB9\u8282\u70B9 */\n subTitle: string\n link?: string\n imgLink?: string\n}\n\nexport type AccordionCardsType = Omit<React.HTMLAttributes<HTMLDivElement>, 'className'> & {\n className?: string\n data: {\n key?: string\n title?: string\n products: Array<ItemType>\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n theme?: 'light' | 'dark'\n }\n /**\n * \u81EA\u52A8\u64AD\u653E\u914D\u7F6E\n */\n autoplay?: {\n /**\n * \u662F\u5426\u5F00\u542F\u81EA\u52A8\u64AD\u653E\n */\n enabled: boolean\n /**\n * \u662F\u5426\u5FAA\u73AF\u64AD\u653E\n */\n loop?: boolean\n /**\n * \u81EA\u52A8\u64AD\u653E\u95F4\u9694\u65F6\u95F4\uFF0C\u5355\u4F4D\u6BEB\u79D2\n */\n interval?: number\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n}\n\nconst AccordionCardsPcItem = ({\n item,\n idx,\n itemShape,\n hoverIndex,\n getRef,\n handleSwiperItemClick,\n contentWidth,\n primaryButton,\n event,\n data,\n accordionRef,\n}: {\n item: ItemType\n idx: number\n itemShape: 'round' | 'square' | undefined\n hoverIndex: number | null\n getRef: (_idx: number, _el: HTMLDivElement) => void\n handleSwiperItemClick: (_idx: number) => void\n contentWidth: number\n primaryButton: string | undefined\n event: any\n data: AccordionCardsType['data']\n accordionRef: React.MutableRefObject<HTMLDivElement[]>\n}) => {\n const isExpanded = hoverIndex === idx\n const flexValue = isExpanded ? 8 : 1\n\n useExposure({ current: accordionRef.current[idx] } as RefObject<HTMLDivElement>, {\n componentType,\n componentName,\n componentTitle: item?.title,\n position: idx + 1,\n componentDescription: item?.subTitle,\n })\n\n return (\n <div\n key={idx}\n style={{\n flex: `${flexValue} 1 0%`,\n transition: 'all 0.6s',\n }}\n ref={(el: HTMLDivElement | null) => {\n if (el) getRef(idx, el)\n }}\n className={cn('relative cursor-pointer overflow-hidden', itemShape === 'round' ? 'rounded-2xl' : '')}\n onMouseEnter={() => handleSwiperItemClick(idx)}\n onClick={() => {\n handleSwiperItemClick(idx)\n }}\n >\n {item?.imgLink ? (\n <a\n href={trackUrlRef(item.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}`}\n >\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n alt={item?.img?.alt || ''}\n />\n </a>\n ) : (\n <Picture\n source={item?.img?.url}\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n alt={item?.img?.alt || ''}\n />\n )}\n <div\n style={{\n width: contentWidth,\n }}\n className={cn(\n 'absolute inset-x-0 bottom-0 flex w-full items-end justify-between overflow-hidden px-8 pb-8 opacity-0 transition-opacity duration-[600ms] ease-in',\n isExpanded && contentWidth ? 'opacity-100' : 'opacity-0'\n )}\n >\n <div className=\"mr-16 flex-1 overflow-hidden\">\n <Heading as=\"h3\" className=\"laptop:text-2xl desktop:text-[32px] text-info-primary mb-1 text-xl font-bold\">\n {item?.title}\n </Heading>\n <Heading\n as=\"h4\"\n className=\"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary line-clamp-2 text-[14px] font-[700]\"\n >\n {item?.subTitle}\n </Heading>\n </div>\n {primaryButton && (\n <Button\n className={cn('mb-1.5 font-bold')}\n as=\"a\"\n href={trackUrlRef(item?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${item?.title}#${item?.subTitle}#${primaryButton}`}\n onClick={() => event?.primaryButton?.(data, idx)}\n >\n {primaryButton}\n <span className=\"sr-only\">{item?.title ?? item?.subTitle}</span>\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst MobileItem = ({ data, configuration }: { data: ItemType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n position: configuration?.index + 1,\n componentDescription: data?.subTitle,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-secondary-1 relative w-full shrink-0 grow-0 overflow-hidden border border-solid',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : ''\n )}\n >\n {data?.imgLink ? (\n <a\n href={trackUrlRef(data.imgLink, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}@${data?.subTitle}`}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n >\n <Picture\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n source={data?.mobileImg?.url || ''}\n alt={data?.mobileImg?.alt || ''}\n />\n </a>\n ) : (\n <Picture\n className=\"size-full object-cover [&_img]:h-full [&_img]:object-cover\"\n source={data?.mobileImg?.url || ''}\n alt={data?.mobileImg?.alt || ''}\n />\n )}\n <div className={cn('absolute inset-x-0 bottom-0 overflow-hidden px-4 pb-4')}>\n <div className=\"tablet:mb-6 mb-4 flex-1 overflow-hidden\">\n <h3\n className=\"text-info-primary line-clamp-3 text-2xl font-bold leading-[1.2]\"\n dangerouslySetInnerHTML={{ __html: data?.title }}\n ></h3>\n <h4\n className=\"text-info-primary line-clamp-2 text-sm font-bold\"\n dangerouslySetInnerHTML={{ __html: data?.subTitle }}\n ></h4>\n </div>\n\n {configuration?.primaryButton && (\n <Button\n as=\"a\"\n variant=\"secondary\"\n aria-label={data?.title ?? data?.subTitle}\n className={cn('text-info-primary text-sm font-bold')}\n href={trackUrlRef(data.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n data-headless-title-desc-button={`${data?.title}#${data?.subTitle}#${configuration?.primaryButton}`}\n >\n {configuration?.primaryButton}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst AccordionCards = React.forwardRef<HTMLDivElement, AccordionCardsType>(\n ({ data, autoplay = { enabled: false, loop: false, interval: 1500 }, className = '', event, ...rest }, ref) => {\n const [hoverIndex, setHoverIndex] = useState<number | null>(0)\n\n const hoverIndexRef = useRef<number>(0)\n const accordionRef = useRef<HTMLDivElement[]>([])\n const [contentWidth, setContentWidth] = useState<number>(0)\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const getRef = (index: number, el: HTMLDivElement) => {\n if (el) {\n accordionRef.current[index] = el\n }\n }\n\n useEffect(() => {\n const handleResize = () => {\n if (accordionRef.current[hoverIndexRef.current]) {\n setContentWidth(accordionRef.current[hoverIndexRef.current].offsetWidth)\n }\n }\n handleResize()\n const throttleResize = throttle(handleResize, 300)\n window.addEventListener('resize', throttleResize)\n return () => window.removeEventListener('resize', throttleResize)\n }, [])\n\n const handleSwiperItemClick = useCallback(\n (idx: number) => {\n if (hoverIndex === idx) return\n // \u66F4\u65B0\u5BBD\u5EA6\u76F8\u5173\u72B6\u6001\n setHoverIndex(idx)\n hoverIndexRef.current = idx\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [data?.products, hoverIndex]\n )\n\n useEffect(() => {\n let autoPlayTimer: NodeJS.Timeout\n if (autoplay?.enabled) {\n autoPlayTimer = setInterval(() => {\n setHoverIndex(prev => {\n const currentIndex = prev ?? 0\n let nextIndex: number\n\n if (autoplay.loop !== false) {\n // \u9ED8\u8BA4\u5FAA\u73AF\u64AD\u653E\n nextIndex = (currentIndex + 1) % data?.products?.length\n } else {\n // \u4E0D\u5FAA\u73AF\uFF1A\u64AD\u653E\u5230\u6700\u540E\u4E00\u4E2A\u540E\u505C\u6B62\n nextIndex = currentIndex + 1\n if (nextIndex >= data?.products?.length) {\n nextIndex = data?.products?.length - 1\n // \u505C\u6B62\u81EA\u52A8\u64AD\u653E\n if (autoPlayTimer) {\n clearInterval(autoPlayTimer)\n }\n return currentIndex // \u4FDD\u6301\u5728\u6700\u540E\u4E00\u4E2A\n }\n }\n\n hoverIndexRef.current = nextIndex\n return nextIndex\n })\n }, autoplay?.interval)\n }\n return () => {\n if (autoPlayTimer) {\n clearInterval(autoPlayTimer)\n }\n }\n }, [autoplay?.enabled, autoplay?.interval, autoplay?.loop, data?.products?.length, handleSwiperItemClick])\n\n return (\n <div {...rest} ref={innerRef}>\n {data?.title && <Title data={{ title: data?.title }} />}\n <div className={cn('laptop:block hidden', { 'aiui-dark': data?.theme === 'dark' })}>\n <div\n className={cn(\n 'lg-desktop:h-[calc(560_/_1920*100vw)] desktop:h-[calc(448_/_1440*100vw)] laptop:h-[calc(336_/_1025*100vw)] flex max-h-[560px] min-h-[336px] w-full gap-4 overflow-hidden',\n className\n )}\n >\n {data?.products?.map((item, idx) => (\n <AccordionCardsPcItem\n key={idx}\n item={item}\n idx={idx}\n itemShape={data?.itemShape}\n hoverIndex={hoverIndex}\n getRef={getRef}\n handleSwiperItemClick={handleSwiperItemClick}\n contentWidth={contentWidth}\n primaryButton={data?.primaryButton}\n event={event}\n data={data}\n accordionRef={accordionRef}\n />\n ))}\n </div>\n </div>\n <div className={cn('laptop:hidden block', { 'aiui-dark': data?.theme === 'dark' })}>\n <SwiperBox\n className={cn('h-[400px] !overflow-visible', className)}\n id={'AccordionCards' + data?.key}\n data={{\n list: data?.products,\n configuration: {\n shape: data?.shape,\n itemShape: data?.itemShape,\n primaryButton: data?.primaryButton,\n event: event,\n title: data?.title,\n },\n }}\n Slide={MobileItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n }}\n />\n </div>\n </div>\n )\n }\n)\n\nAccordionCards.displayName = 'AccordionCards'\nexport default withLayout(AccordionCards)\n"],
5
+ "mappings": "aA6HU,cAAAA,EAsBF,QAAAC,MAtBE,oBA5HV,OAAOC,MAAW,oBAClB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAa,8BACpB,OAAOC,MAAY,6BACnB,OAAOC,MAAe,wBACtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,GAAS,YAA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AAM,KAAM,EAAG,EACrD9B,EAAC,OAAI,UAAWG,EAAG,sBAAuB,CAAE,YAAa2B,GAAM,QAAU,MAAO,CAAC,EAC/E,SAAA9B,EAAC,OACC,UAAWG,EACT,2KACAqC,CACF,EAEC,SAAAV,GAAM,UAAU,IAAI,CAACT,EAAMC,IAC1BtB,EAACoB,EAAA,CAEC,KAAMC,EACN,IAAKC,EACL,UAAWQ,GAAM,UACjB,WAAYN,EACZ,OAAQC,EACR,sBAAuBC,EACvB,aAAcC,EACd,cAAeG,GAAM,cACrB,MAAOD,EACP,KAAMC,EACN,aAAcC,GAXTT,CAYP,CACD,EACH,EACF,EACAtB,EAAC,OAAI,UAAWG,EAAG,sBAAuB,CAAE,YAAa2B,GAAM,QAAU,MAAO,CAAC,EAC/E,SAAA9B,EAACM,EAAA,CACC,UAAWH,EAAG,8BAA+BqC,CAAS,EACtD,GAAI,iBAAmBV,GAAM,IAC7B,KAAM,CACJ,KAAMA,GAAM,SACZ,cAAe,CACb,MAAOA,GAAM,MACb,UAAWA,GAAM,UACjB,cAAeA,GAAM,cACrB,MAAOD,EACP,MAAOC,GAAM,KACf,CACF,EACA,MAAOK,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,CACF,EACF,EACF,GACF,CAEJ,CACF,EAEAG,EAAe,YAAc,iBAC7B,IAAOe,EAAQ9C,EAAW+B,CAAc",
6
6
  "names": ["jsx", "jsxs", "Title", "cn", "Picture", "Button", "SwiperBox", "withLayout", "React", "useState", "useRef", "useCallback", "useImperativeHandle", "useEffect", "useExposure", "trackUrlRef", "throttle", "Heading", "componentType", "componentName", "AccordionCardsPcItem", "item", "idx", "itemShape", "hoverIndex", "getRef", "handleSwiperItemClick", "contentWidth", "primaryButton", "event", "data", "accordionRef", "isExpanded", "flexValue", "el", "MobileItem", "configuration", "ref", "AccordionCards", "autoplay", "className", "rest", "setHoverIndex", "hoverIndexRef", "setContentWidth", "innerRef", "index", "handleResize", "throttleResize", "autoPlayTimer", "prev", "currentIndex", "nextIndex", "AccordionCards_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as s,jsxs as h}from"react/jsx-runtime";import*as i from"react";import{cn as g}from"../../helpers/index.js";import{withLayout as R}from"../../shared/Styles.js";import{Text as D,Picture as z,Heading as j,Container as H}from"../../components/index.js";import{Swiper as L,SwiperSlide as F}from"swiper/react";import w from"dayjs";import{cva as b}from"class-variance-authority";const x=(r,t)=>{const d=w(),c=w(r).startOf("day"),u=w(t).endOf("day");return d.isAfter(u)?"completed":d.isBefore(c)?"not-started":"in-progress"},$=b("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),O=b("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),k=b("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),q=b("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),G=({timeStatus:r,theme:t="light",className:d,index:c,nodeLength:u})=>{const o=`${r}-${t}`,n=c===0,a=c===u-1;return h("div",{className:"relative my-2 flex h-1 w-full items-center justify-center",children:[s("div",{className:g($({state:o}),n&&"rounded-l-full",a&&"rounded-r-full",d)}),s("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:s("div",{className:O({state:o})})})]})},J=(r,t)=>{if(r)return t==="in-progress"?r.active:t==="completed"&&r.completed||r.inactive},K=({timeStatus:r,item:t,theme:d="light",className:c,scheduleCount:u})=>{const o=i.useMemo(()=>J(t.icon,r),[t.icon,r]),n=`${r}-${d}`;return h("div",{className:g(q({state:n}),c),children:[o&&s("div",{className:"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]",children:s(z,{source:o.url,alt:o.alt,className:"aspect-square"})}),h("div",{className:"tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8",children:[s(j,{html:t.title,className:g(u>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",k({state:n}))}),s("div",{className:"flex flex-col gap-0.5",children:t.items.map((a,l)=>h("div",{className:"flex items-center gap-2",children:[a.icon&&s(D,{className:g("desktop:size-6 size-5 shrink-0",k({state:n})),html:a.icon}),s(D,{html:a.label,className:g("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]",k({state:n}))})]},l))})]})]})},V=i.forwardRef(({classNames:r={},data:t,className:d,...c},u)=>{const o=t.theme||"light",n=i.useRef(null),a=i.useRef(null),l=i.useRef(!1),f=i.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),S=i.useMemo(()=>t.scheduleList.findIndex(e=>x(e.startDate,e.endDate)==="in-progress"),[t.scheduleList]),v=i.useCallback((e,m=!1)=>{const p=P=>{switch(P){case"mobile":return{slidesPerView:1.17};case"tablet":return e===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return e===2?{}:e===4?{slidesPerView:3.2}:{slidesPerView:e};case"desktop":return e===2?{slidesPerView:2}:{slidesPerView:e}}},T=p("mobile"),C=p("tablet"),N=p("laptop"),y=p("desktop");return m?{0:{...T,spaceBetween:12},768:{...C,spaceBetween:12},1024:{...N,spaceBetween:16},1440:{...y,spaceBetween:16}}:{0:T,768:C,1024:N,1440:y}},[]),A=i.useMemo(()=>v(f,!0),[f,v]),I=i.useMemo(()=>v(f,!1),[f,v]),E=t.showTimeline!==!1,M=i.useCallback(e=>{l.current||!a.current||(l.current=!0,a.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{l.current=!1},50))},[]),B=i.useCallback(e=>{l.current||!n.current||(l.current=!0,n.current.slideTo(e.activeIndex,e.params.speed),setTimeout(()=>{l.current=!1},50))},[]);return i.useEffect(()=>{n.current&&a.current&&S>=0&&setTimeout(()=>{l.current=!0,n.current?.slideTo(S,500),a.current?.slideTo(S,500),setTimeout(()=>{l.current=!1},600)},100)},[S]),h(H,{...c,ref:u,className:g("overflow-hidden",r?.root,d),children:[E&&s(L,{breakpoints:I,className:"h-4 w-full !overflow-visible",onSwiper:e=>{a.current=e},onSlideChange:B,children:t.scheduleList.map((e,m)=>{const p=x(e.startDate,e.endDate);return s(F,{className:"",children:s(G,{className:r?.timeline,timeStatus:p,theme:o,index:m,nodeLength:t.scheduleList.length})},"timelineNode"+m)})}),s(L,{breakpoints:A,className:"w-full !overflow-visible",onSwiper:e=>{n.current=e},onSlideChange:M,children:t.scheduleList.map((e,m)=>{const p=x(e.startDate,e.endDate);return s(F,{children:s(K,{timeStatus:p,className:g(E?"laptop:mt-4 mt-2":"",r?.eventScheduleCard),item:e,theme:o,scheduleCount:t.scheduleList.length})},"SwiperSlideItem"+m)})})]})});V.displayName="EventSchedule";var _=R(V);export{_ as default};
1
+ "use client";import{jsx as s,jsxs as g}from"react/jsx-runtime";import*as n from"react";import{cn as d}from"../../helpers/index.js";import{withLayout as B}from"../../shared/Styles.js";import{Text as y,Picture as P,Heading as R,Container as z}from"../../components/index.js";import{Swiper as D,SwiperSlide as L}from"swiper/react";import w from"dayjs";import{cva as x}from"class-variance-authority";const S=(e,r)=>{const c=w(),u=w(e).startOf("day"),m=w(r).endOf("day");return c.isAfter(m)?"completed":c.isBefore(u)?"not-started":"in-progress"},j=x("h-1 w-full overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),H=x("size-4 rounded-full transition-colors",{variants:{state:{"in-progress-light":"bg-[#F6CD4E]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F6CD4E]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),k=x("font-bold leading-[1.2]",{variants:{state:{"in-progress-light":"text-[#080A0F]","in-progress-dark":"text-white","not-started-light":"text-[#080A0F]","not-started-dark":"text-[#F5F6F7]","completed-light":"text-[#4A4C56]/60","completed-dark":"text-[#F5F6F7]/60"}},defaultVariants:{state:"not-started-light"}}),O=x("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"in-progress-light":"bg-[#F4E8BC]","in-progress-dark":"bg-[#D79941]","not-started-light":"bg-[#EAEAEC]","not-started-dark":"bg-[#1E2024]","completed-light":"bg-[#F4E8BC]","completed-dark":"bg-[#D79941]"}},defaultVariants:{state:"not-started-light"}}),q=({timeStatus:e,theme:r="light",className:c,index:u,nodeLength:m})=>{const o=`${e}-${r}`,i=u===0,l=u===m-1;return g("div",{className:d(`event-schedule-timeline-node event-schedule-timeline-node--${e} relative my-2 flex h-1 w-full items-center justify-center`,c),children:[s("div",{className:d(`event-schedule-timeline-progress event-schedule-timeline-progress--${e}`,j({state:o}),i&&"rounded-l-full",l&&"rounded-r-full")}),s("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:s("div",{className:d(`event-schedule-timeline-dot event-schedule-timeline-dot--${e}`,H({state:o}))})})]})},G=(e,r)=>{if(e)return r==="in-progress"?e.active:r==="completed"&&e.completed||e.inactive},J=({timeStatus:e,item:r,theme:c="light",className:u,scheduleCount:m})=>{const o=n.useMemo(()=>G(r.icon,e),[r.icon,e]),i=`${e}-${c}`;return g("div",{className:d(`event-schedule-card event-schedule-card--${e}`,O({state:i}),u),children:[o&&s("div",{className:`event-schedule-card__background-icon event-schedule-card__background-icon--${e} laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]`,children:s(P,{source:o.url,alt:o.alt,className:"aspect-square"})}),g("div",{className:`event-schedule-card__content event-schedule-card__content--${e} tablet:px-4 tablet:py-3 desktop:pl-6 desktop:pr-16 relative z-20 flex h-full flex-col justify-between p-4 pr-8`,children:[s(R,{html:r.title,className:d(`event-schedule-card__title event-schedule-card__title--${e}`,m>=4?"desktop:text-[24px]":"desktop:text-[32px]","laptop:text-[24px] line-clamp-1 text-[20px]",k({state:i}))}),s("div",{className:`event-schedule-card__details event-schedule-card__details--${e} flex flex-col gap-0.5`,children:r.items.map((l,a)=>g("div",{className:`event-schedule-card__detail-item event-schedule-card__detail-item--${e} flex items-center gap-2`,children:[l.icon&&s(y,{className:d(`event-schedule-card__detail-icon event-schedule-card__detail-icon--${e} desktop:size-6 size-5 shrink-0`,k({state:i})),html:l.icon}),s(y,{html:l.label,className:d(`event-schedule-card__detail-text event-schedule-card__detail-text--${e} lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 flex-1 text-[14px] leading-[1.4]`,k({state:i}))})]},a))})]})]})},F=n.forwardRef(({classNames:e={},data:r,className:c,...u},m)=>{const o=r.theme||"light",i=n.useRef(null),l=n.useRef(null),a=n.useRef(!1),f=n.useMemo(()=>r?.scheduleList?.length||2,[r?.scheduleList]),v=n.useMemo(()=>r.scheduleList.findIndex(t=>S(t.startDate,t.endDate)==="in-progress"),[r.scheduleList]),b=n.useCallback((t,h=!1)=>{const p=M=>{switch(M){case"mobile":return{slidesPerView:1.17};case"tablet":return t===2?{slidesPerView:2}:{slidesPerView:2.4};case"laptop":return t===2?{}:t===4?{slidesPerView:3.2}:{slidesPerView:t};case"desktop":return t===2?{slidesPerView:2}:{slidesPerView:t}}},T=p("mobile"),C=p("tablet"),N=p("laptop"),_=p("desktop");return h?{0:{...T,spaceBetween:12},768:{...C,spaceBetween:12},1024:{...N,spaceBetween:16},1440:{..._,spaceBetween:16}}:{0:T,768:C,1024:N,1440:_}},[]),V=n.useMemo(()=>b(f,!0),[f,b]),$=n.useMemo(()=>b(f,!1),[f,b]),E=r.showTimeline!==!1,A=n.useCallback(t=>{a.current||!l.current||(a.current=!0,l.current.slideTo(t.activeIndex,t.params.speed),setTimeout(()=>{a.current=!1},50))},[]),I=n.useCallback(t=>{a.current||!i.current||(a.current=!0,i.current.slideTo(t.activeIndex,t.params.speed),setTimeout(()=>{a.current=!1},50))},[]);return n.useEffect(()=>{i.current&&l.current&&v>=0&&setTimeout(()=>{a.current=!0,i.current?.slideTo(v,500),l.current?.slideTo(v,500),setTimeout(()=>{a.current=!1},600)},100)},[v]),g(z,{...u,ref:m,className:d("event-schedule-root overflow-hidden",e?.root,c),children:[E&&s(D,{breakpoints:$,className:"event-schedule-timeline h-4 w-full !overflow-visible",onSwiper:t=>{l.current=t},onSlideChange:I,children:r.scheduleList.map((t,h)=>{const p=S(t.startDate,t.endDate);return s(L,{className:"",children:s(q,{className:e?.timeline,timeStatus:p,theme:o,index:h,nodeLength:r.scheduleList.length})},"timelineNode"+h)})}),s(D,{breakpoints:V,className:"event-schedule-cards w-full !overflow-visible",onSwiper:t=>{i.current=t},onSlideChange:A,children:r.scheduleList.map((t,h)=>{const p=S(t.startDate,t.endDate);return s(L,{children:s(J,{timeStatus:p,className:d(E?"laptop:mt-4 mt-2":"",e?.eventScheduleCard),item:t,theme:o,scheduleCount:r.scheduleList.length})},"SwiperSlideItem"+h)})})]})});F.displayName="EventSchedule";var Z=B(F);export{Z as default};
2
2
  //# sourceMappingURL=index.js.map