@anker-in/headless-ui 1.0.19-temp-101705 → 1.0.20-alpha.102201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/cjs/biz-components/AplusDesc/index.js +2 -0
- package/dist/cjs/biz-components/AplusDesc/index.js.map +7 -0
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.d.ts +0 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js.map +3 -3
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +3 -3
- package/dist/cjs/biz-components/CollectionsFilters/component/TabFilter.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/component/TabFilter.js.map +2 -2
- package/dist/cjs/biz-components/CollectionsFilters/index.d.ts +0 -1
- package/dist/cjs/biz-components/CollectionsFilters/index.js +1 -1
- package/dist/cjs/biz-components/CollectionsFilters/index.js.map +3 -3
- package/dist/cjs/biz-components/DownLoad/index.d.ts +9 -6
- package/dist/cjs/biz-components/DownLoad/index.js +2 -0
- package/dist/cjs/biz-components/DownLoad/index.js.map +7 -0
- package/dist/cjs/biz-components/Faq/Faq.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
- package/dist/cjs/biz-components/Features/index.js +2 -0
- package/dist/cjs/biz-components/Features/index.js.map +7 -0
- package/dist/cjs/biz-components/FootCharger/index.js +2 -0
- package/dist/cjs/biz-components/FootCharger/index.js.map +7 -0
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/FooterNavigation/types.d.ts +2 -1
- package/dist/cjs/biz-components/FooterNavigation/types.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/GiftBox/index.js +2 -0
- package/dist/cjs/biz-components/GiftBox/index.js.map +7 -0
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
- package/dist/cjs/biz-components/GraphicMore/index.js +2 -0
- package/dist/cjs/biz-components/GraphicMore/index.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +6 -5
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.d.ts +2 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/icons/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +20 -2
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/cjs/biz-components/Listing/ProductProvider.d.ts +7 -7
- package/dist/cjs/biz-components/Listing/ProductProvider.js +2 -0
- package/dist/cjs/biz-components/Listing/ProductProvider.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/const.js +2 -0
- package/dist/cjs/biz-components/Listing/const.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/cjs/biz-components/Listing/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/index.js +2 -0
- package/dist/cjs/biz-components/Listing/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js +2 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/product.js +2 -0
- package/dist/cjs/biz-components/Listing/types/product.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js +2 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types.js +2 -0
- package/dist/cjs/biz-components/Listing/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/index.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -0
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +7 -0
- package/dist/cjs/biz-components/NavigationSearch/types.js +2 -0
- package/dist/cjs/biz-components/NavigationSearch/types.js.map +7 -0
- package/dist/cjs/biz-components/SearchPage/index.js +2 -0
- package/dist/cjs/biz-components/SearchPage/index.js.map +7 -0
- package/dist/cjs/biz-components/SearchPage/types.js +2 -0
- package/dist/cjs/biz-components/SearchPage/types.js.map +7 -0
- package/dist/cjs/biz-components/SelectStore/index.d.ts +4 -10
- package/dist/cjs/biz-components/SelectStore/index.js +2 -0
- package/dist/cjs/biz-components/SelectStore/index.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/biz-components/Specs/dropdown.js +3 -0
- package/dist/cjs/biz-components/Specs/dropdown.js.map +7 -0
- package/dist/cjs/biz-components/Specs/index.js +2 -0
- package/dist/cjs/biz-components/Specs/index.js.map +7 -0
- package/dist/cjs/biz-components/Subscribe/index.d.ts +7 -1
- package/dist/cjs/biz-components/Subscribe/index.js +10 -1
- package/dist/cjs/biz-components/Subscribe/index.js.map +3 -3
- package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +7 -0
- package/dist/cjs/biz-components/TabsGroup/index.js +2 -0
- package/dist/cjs/biz-components/TabsGroup/index.js.map +7 -0
- package/dist/cjs/biz-components/TabsGroup/types.d.ts +16 -0
- package/dist/cjs/biz-components/TabsGroup/types.js +2 -0
- package/dist/cjs/biz-components/TabsGroup/types.js.map +7 -0
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +2 -2
- package/dist/cjs/biz-components/Title/types.d.ts +3 -1
- package/dist/cjs/biz-components/Title/types.js +1 -1
- package/dist/cjs/biz-components/Title/types.js.map +1 -1
- package/dist/cjs/biz-components/index.d.ts +26 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +3 -3
- package/dist/cjs/components/container.js +1 -1
- package/dist/cjs/components/container.js.map +2 -2
- package/dist/cjs/components/dialog.d.ts +3 -1
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/loadingDots.js +42 -0
- package/dist/cjs/components/loadingDots.js.map +7 -0
- package/dist/cjs/helpers/utils.d.ts +1 -0
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/cjs/stories/aplusdesc.stories.js +2 -0
- package/dist/cjs/stories/aplusdesc.stories.js.map +7 -0
- package/dist/cjs/stories/download.stories.d.ts +1 -6
- package/dist/cjs/stories/download.stories.js +2 -0
- package/dist/cjs/stories/download.stories.js.map +7 -0
- package/dist/cjs/stories/features.stories.js +2 -0
- package/dist/cjs/stories/features.stories.js.map +7 -0
- package/dist/cjs/stories/footcharger.stories.js +2 -0
- package/dist/cjs/stories/footcharger.stories.js.map +7 -0
- package/dist/cjs/stories/giftbox.stories.js +2 -0
- package/dist/cjs/stories/giftbox.stories.js.map +7 -0
- package/dist/cjs/stories/graphicMore.stories.js +2 -0
- package/dist/cjs/stories/graphicMore.stories.js.map +7 -0
- package/dist/cjs/stories/selectstore.stories.js +2 -0
- package/dist/cjs/stories/selectstore.stories.js.map +7 -0
- package/dist/cjs/stories/shelfDisplay.stories.js +644 -1
- package/dist/cjs/stories/shelfDisplay.stories.js.map +2 -2
- package/dist/cjs/stories/tabs.stories.js +1 -1
- package/dist/cjs/stories/tabs.stories.js.map +3 -3
- package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/esm/biz-components/AplusDesc/index.js +2 -0
- package/dist/esm/biz-components/AplusDesc/index.js.map +7 -0
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.d.ts +0 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js.map +3 -3
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +3 -3
- package/dist/esm/biz-components/CollectionsFilters/component/TabFilter.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/component/TabFilter.js.map +2 -2
- package/dist/esm/biz-components/CollectionsFilters/index.d.ts +0 -1
- package/dist/esm/biz-components/CollectionsFilters/index.js +1 -1
- package/dist/esm/biz-components/CollectionsFilters/index.js.map +3 -3
- package/dist/esm/biz-components/DownLoad/index.d.ts +9 -6
- package/dist/esm/biz-components/DownLoad/index.js +2 -0
- package/dist/esm/biz-components/DownLoad/index.js.map +7 -0
- package/dist/esm/biz-components/Faq/Faq.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.js.map +3 -3
- package/dist/esm/biz-components/Features/index.js +2 -0
- package/dist/esm/biz-components/Features/index.js.map +7 -0
- package/dist/esm/biz-components/FootCharger/index.js +2 -0
- package/dist/esm/biz-components/FootCharger/index.js.map +7 -0
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/FooterNavigation/types.d.ts +2 -1
- package/dist/esm/biz-components/FooterNavigation/types.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/GiftBox/index.js +2 -0
- package/dist/esm/biz-components/GiftBox/index.js.map +7 -0
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicMore/index.js +2 -0
- package/dist/esm/biz-components/GraphicMore/index.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +6 -5
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js +2 -0
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/icons/index.d.ts +2 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/icons/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +20 -2
- package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/esm/biz-components/Listing/ProductProvider.d.ts +7 -7
- package/dist/esm/biz-components/Listing/ProductProvider.js +2 -0
- package/dist/esm/biz-components/Listing/ProductProvider.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/const.js +2 -0
- package/dist/esm/biz-components/Listing/const.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-options.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/esm/biz-components/Listing/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/index.js +2 -0
- package/dist/esm/biz-components/Listing/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/graphql.js +2 -0
- package/dist/esm/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/product.js +2 -0
- package/dist/esm/biz-components/Listing/types/product.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js +1 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/types.js +1 -0
- package/dist/esm/biz-components/Listing/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/helper.js +2 -0
- package/dist/esm/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/index.js +2 -0
- package/dist/esm/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +2 -2
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -0
- package/dist/esm/biz-components/NavigationSearch/index.js.map +7 -0
- package/dist/esm/biz-components/NavigationSearch/types.js +2 -0
- package/dist/esm/biz-components/NavigationSearch/types.js.map +7 -0
- package/dist/esm/biz-components/SearchPage/index.js +2 -0
- package/dist/esm/biz-components/SearchPage/index.js.map +7 -0
- package/dist/esm/biz-components/SearchPage/types.js +2 -0
- package/dist/esm/biz-components/SearchPage/types.js.map +7 -0
- package/dist/esm/biz-components/SelectStore/index.d.ts +4 -10
- package/dist/esm/biz-components/SelectStore/index.js +2 -0
- package/dist/esm/biz-components/SelectStore/index.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +9 -9
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/biz-components/Specs/dropdown.js +3 -0
- package/dist/esm/biz-components/Specs/dropdown.js.map +7 -0
- package/dist/esm/biz-components/Specs/index.js +2 -0
- package/dist/esm/biz-components/Specs/index.js.map +7 -0
- package/dist/esm/biz-components/Subscribe/index.d.ts +7 -1
- package/dist/esm/biz-components/Subscribe/index.js +10 -1
- package/dist/esm/biz-components/Subscribe/index.js.map +3 -3
- package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/esm/biz-components/TabsGroup/index.d.ts +7 -0
- package/dist/esm/biz-components/TabsGroup/index.js +2 -0
- package/dist/esm/biz-components/TabsGroup/index.js.map +7 -0
- package/dist/esm/biz-components/TabsGroup/types.d.ts +16 -0
- package/dist/esm/biz-components/TabsGroup/types.js +1 -0
- package/dist/esm/biz-components/TabsGroup/types.js.map +7 -0
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +2 -2
- package/dist/esm/biz-components/Title/types.d.ts +3 -1
- package/dist/esm/biz-components/index.d.ts +26 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +3 -3
- package/dist/esm/components/container.js +1 -1
- package/dist/esm/components/container.js.map +2 -2
- package/dist/esm/components/dialog.d.ts +3 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +3 -3
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/loadingDots.js +42 -0
- package/dist/esm/components/loadingDots.js.map +7 -0
- package/dist/esm/helpers/utils.d.ts +1 -0
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/dist/esm/stories/aplusdesc.stories.js +2 -0
- package/dist/esm/stories/aplusdesc.stories.js.map +7 -0
- package/dist/esm/stories/download.stories.d.ts +1 -6
- package/dist/esm/stories/download.stories.js +2 -0
- package/dist/esm/stories/download.stories.js.map +7 -0
- package/dist/esm/stories/features.stories.js +2 -0
- package/dist/esm/stories/features.stories.js.map +7 -0
- package/dist/esm/stories/footcharger.stories.js +2 -0
- package/dist/esm/stories/footcharger.stories.js.map +7 -0
- package/dist/esm/stories/giftbox.stories.js +2 -0
- package/dist/esm/stories/giftbox.stories.js.map +7 -0
- package/dist/esm/stories/graphicMore.stories.js +2 -0
- package/dist/esm/stories/graphicMore.stories.js.map +7 -0
- package/dist/esm/stories/selectstore.stories.js +2 -0
- package/dist/esm/stories/selectstore.stories.js.map +7 -0
- package/dist/esm/stories/shelfDisplay.stories.js +644 -1
- package/dist/esm/stories/shelfDisplay.stories.js.map +2 -2
- package/dist/esm/stories/tabs.stories.js +1 -1
- package/dist/esm/stories/tabs.stories.js.map +3 -3
- package/dist/tokens/base.css +1 -1
- package/package.json +1 -1
- package/style.css +9 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useMediaQuery as
|
|
1
|
+
"use client";import{jsx as t,jsxs as a}from"react/jsx-runtime";import{useMediaQuery as S}from"react-responsive";import B,{useEffect as D,useImperativeHandle as E,useRef as w,useState as r}from"react";import{cn as m}from"../../helpers/utils.js";import{withLayout as H}from"../../shared/Styles.js";import L from"../SwiperBox/index.js";import{Button as U,Heading as z,Picture as f,Text as j}from"../../components/index.js";import R from"../Title/index.js";import{VideoModal as q}from"../VideoModal/index.js";import{TextModal as Y}from"../TextModal/index.js";import{useExposure as y}from"../../hooks/useExposure.js";import{trackUrlRef as k}from"../../shared/trackUrlRef.js";const n="image",p="graphic",_=({data:e,configuration:o})=>{const d=w(null),u=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}};return y(d,{componentType:n,componentName:p,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1}),t("div",{ref:d,className:m(u(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:t("div",{className:m("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":o?.itemShape==="round"}),children:a("div",{className:"relative block size-full cursor-pointer overflow-hidden",children:[e?.href?t("a",{"aria-label":e?.title??e?.description,href:k(e?.href||"",`${n}_${p}`),className:"block size-full cursor-pointer overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${n}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:t(f,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}):t("div",{className:"block size-full cursor-pointer overflow-hidden",children:t(f,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.imgUrl?.url,alt:e?.imgUrl?.alt||""})}),a("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[a("div",{className:m("flex items-end overflow-hidden","graphic-bottom"),children:[a("div",{className:"flex-1 overflow-hidden",children:[t(j,{html:e?.title,style:{color:e?.textColor},className:"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base text-sm font-bold leading-[1.2]"}),e?.description&&t(z,{html:e?.description,style:{color:e?.textColor},as:"h3",className:"graphic-description lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]"})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:i=>{i.preventDefault(),i.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75 overflow-hidden",children:t(f,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(U,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"mt-[8px] self-start",href:k(e?.href,`${n}_${p}`),"data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${n}#${p}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},T=B.forwardRef(({data:e,className:o},d)=>{const u=S({query:"(max-width: 768px)"}),i=w(null),[N,b]=r(!1),[g,M]=r(""),[I,V]=r(""),[C,P]=r(""),[$,x]=r(null),[G,v]=r(!1),h=l=>{const s=e?.items?.length>3,c=e?.items?.length>2;switch(l){case 1440:return s?4:e?.items?.length;case 1024:return s?3:e?.items?.length;case 768:return e?.items?.length===1?1:s||c?2.3:2;default:return 1.2}};return E(d,()=>i.current),y(i,{componentType:n,componentName:p,componentTitle:e?.title}),D(()=>{const l=i.current?.querySelectorAll(".graphic-description");if(l&&l.length>0){let s=0;l.forEach(c=>{s=Math.max(s,c.offsetHeight)}),l.forEach(c=>{c.style.height=`${s}px`})}},[]),a("div",{className:m("graphicBlock",o),ref:i,children:[a("div",{className:"graphic-box",children:[e?.title&&t(R,{data:{title:e?.title}}),t(L,{id:"Graphic",className:m("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,onVideoPlayBtnClick:(l,s)=>{b(!0),s?.isYouTube?V?.(s?.youtubeId||""):(M?.(s?.video?.url||""),P?.(s?.mobileVideo?.url||""))},onIconClick:l=>{v(!0),x(l)},title:e?.title}},Slide:_,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:h()},768:{spaceBetween:16,freeMode:!1,slidesPerView:h(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:h(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:h(1440)}}})]}),t(q,{visible:N,youTubeId:I,onCloseModal:()=>b(!1),videoUrl:u&&C||g}),t(Y,{textVisible:G,extension:$?.extension,onCloseModal:()=>{v(!1),x(null)}})]})});T.displayName="Graphic";var se=H(T);export{se as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/Graphic/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport { useMediaQuery } from 'react-responsive'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { TextModal } from '../TextModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Media } from '../../types/props.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n isYouTube?: boolean\n isShowIcon?: boolean\n buttonText?: string\n icon?: Img\n theme?: Theme\n extension?: {\n text: string\n textDesc: string\n textTitle: string\n textPcImg: Img\n textMobileImg: Img\n }\n // textPcImg?: Img\n // textMobileImg?: Img\n // text?: string\n // textDesc?: string\n // textTitle?: string\n}\nexport interface GraphicProps extends ComponentCommonProps {\n className?: string\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n handleAspect(),\n 'graphicItem',\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <div className=\"relative block size-full cursor-pointer overflow-hidden\">\n {data?.href ? (\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(data?.href || '', `${componentType}_${componentName}`)}\n className=\"block size-full cursor-pointer overflow-hidden\"\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </a>\n ) : (\n <div className=\"block size-full cursor-pointer overflow-hidden\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </div>\n )}\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n // eslint-disable-next-line tailwindcss/classnames-order\n className=\"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base text-sm font-bold leading-[1.2]\"\n />\n {data?.description && (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n className=\"graphic-description lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]\"\n />\n )}\n </div>\n {!data?.isShowIcon && (data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n {data?.isShowIcon && data?.icon?.url && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onIconClick?.(data, configuration)\n }}\n className=\"laptop:size-9 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75 overflow-hidden\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.icon?.url}\n alt={data?.icon?.alt || ''}\n />\n </button>\n )}\n </div>\n {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"mt-[8px] self-start\"\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}#${data?.buttonText}`}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className }, ref) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const [mobileVideoUrl, setMobileVideoUrl] = useState<string>('')\n const [currentItem, setCurrentItem] = useState<GraphicType | null>(null)\n const [textVisible, setTextVisible] = useState<boolean>(false)\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const descriptions = innerRef.current?.querySelectorAll<HTMLDivElement>('.graphic-description')\n if (descriptions && descriptions.length > 0) {\n let maxHeight = 0\n descriptions.forEach((el: HTMLDivElement) => {\n maxHeight = Math.max(maxHeight, el.offsetHeight)\n })\n descriptions.forEach((el: HTMLDivElement) => {\n el.style.height = `${maxHeight}px`\n })\n }\n }, [])\n\n return (\n <div className={cn('graphicBlock', className)} ref={innerRef}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n setMobileVideoUrl?.(data?.mobileVideo?.url || '')\n }\n },\n onIconClick: (data: GraphicType) => {\n setTextVisible(true)\n setCurrentItem(data)\n },\n title: data?.title,\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n onCloseModal={() => setVisible(false)}\n videoUrl={isMobile ? mobileVideoUrl || videoUrl : videoUrl}\n />\n <TextModal\n textVisible={textVisible}\n extension={currentItem?.extension}\n onCloseModal={() => {\n setTextVisible(false)\n setCurrentItem(null)\n }}\n />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
|
|
5
|
-
"mappings": "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
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { useMediaQuery } from 'react-responsive'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { TextModal } from '../TextModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Media } from '../../types/props.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n isYouTube?: boolean\n isShowIcon?: boolean\n buttonText?: string\n icon?: Img\n theme?: Theme\n extension?: {\n text: string\n textDesc: string\n textTitle: string\n textPcImg: Img\n textMobileImg: Img\n }\n // textPcImg?: Img\n // textMobileImg?: Img\n // text?: string\n // textDesc?: string\n // textTitle?: string\n}\nexport interface GraphicProps extends ComponentCommonProps {\n className?: string\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n handleAspect(),\n 'graphicItem',\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <div className=\"relative block size-full cursor-pointer overflow-hidden\">\n {data?.href ? (\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(data?.href || '', `${componentType}_${componentName}`)}\n className=\"block size-full cursor-pointer overflow-hidden\"\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </a>\n ) : (\n <div className=\"block size-full cursor-pointer overflow-hidden\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.imgUrl?.url}\n alt={data?.imgUrl?.alt || ''}\n />\n </div>\n )}\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n // eslint-disable-next-line tailwindcss/classnames-order\n className=\"graphic-title line-clamp-3 lg-desktop:text-lg desktop:text-base text-sm font-bold leading-[1.2]\"\n />\n {data?.description && (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n className=\"graphic-description lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]\"\n />\n )}\n </div>\n {!data?.isShowIcon && (data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n {data?.isShowIcon && data?.icon?.url && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onIconClick?.(data, configuration)\n }}\n className=\"laptop:size-9 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75 overflow-hidden\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.icon?.url}\n alt={data?.icon?.alt || ''}\n />\n </button>\n )}\n </div>\n {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"mt-[8px] self-start\"\n href={trackUrlRef(data?.href, `${componentType}_${componentName}`)}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}#${data?.buttonText}`}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className }, ref) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const [mobileVideoUrl, setMobileVideoUrl] = useState<string>('')\n const [currentItem, setCurrentItem] = useState<GraphicType | null>(null)\n const [textVisible, setTextVisible] = useState<boolean>(false)\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n const descriptions = innerRef.current?.querySelectorAll<HTMLDivElement>('.graphic-description')\n if (descriptions && descriptions.length > 0) {\n let maxHeight = 0\n descriptions.forEach((el: HTMLDivElement) => {\n maxHeight = Math.max(maxHeight, el.offsetHeight)\n })\n descriptions.forEach((el: HTMLDivElement) => {\n el.style.height = `${maxHeight}px`\n })\n }\n }, [])\n\n return (\n <div className={cn('graphicBlock', className)} ref={innerRef}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n setMobileVideoUrl?.(data?.mobileVideo?.url || '')\n }\n },\n onIconClick: (data: GraphicType) => {\n setTextVisible(true)\n setCurrentItem(data)\n },\n title: data?.title,\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n onCloseModal={() => setVisible(false)}\n videoUrl={isMobile ? mobileVideoUrl || videoUrl : videoUrl}\n />\n <TextModal\n textVisible={textVisible}\n extension={currentItem?.extension}\n onCloseModal={() => {\n setTextVisible(false)\n setCurrentItem(null)\n }}\n />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["jsx", "jsxs", "useMediaQuery", "React", "useEffect", "useImperativeHandle", "useRef", "useState", "cn", "withLayout", "SwiperBox", "Button", "Heading", "Picture", "Text", "Title", "VideoModal", "TextModal", "useExposure", "trackUrlRef", "componentType", "componentName", "Item", "data", "configuration", "ref", "handleAspect", "e", "Graphic", "className", "isMobile", "innerRef", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "mobileVideoUrl", "setMobileVideoUrl", "currentItem", "setCurrentItem", "textVisible", "setTextVisible", "handleSwiperShow", "width", "isShow", "descriptions", "maxHeight", "el", "_", "Graphic_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{Fragment as h,jsx as t,jsxs as o}from"react/jsx-runtime";import{cn as l}from"../../helpers/utils.js";import"../SwiperBox/index.js";import{withLayout as c}from"../../shared/Styles.js";import{Grid as f,GridItem as x}from"../../components/gird.js";import{Picture as i,Text as a}from"../../components/index.js";const u=p=>{const{data:m,className:n}=p,{productsTab:d,shape:s}=m;return o(h,{children:[t("div",{className:l("creativeModuleBlock","tablet:block box-border hidden w-full overflow-hidden text-[#1D1D1F]"),children:t(f,{className:l("tablet:gap-4 grid grid-cols-12 gap-3 ",n),children:d?.map((e,r)=>o(x,{span:e.span,className:l("text-info-primary relative w-full overflow-hidden",s==="rounded"?"rounded-2xl":"rounded-none","",{"aiui-dark":e.theme==="dark"}),children:[t(i,{source:e.img.url,className:"size-full",imgClassName:""}),o("div",{className:"footBottom lg-desktop:top-8 lg-desktop:px-8 desktop:top-6 desktop:px-6 absolute top-4 px-4 flex flex-col gap-[6px] left-0 right-0 overflow-hidden",children:[e.title&&t(a,{html:e.title,as:"p",className:"line-clamp-2 desktop:text-[32px] laptop:text-2xl text-xl font-bold"}),e.description&&t(a,{html:e.description,className:"line-clamp-2 desktop:text-lg text-sm font-bold"})]})]},r))})}),t("div",{className:"tablet:hidden block text-[#1D1D1F]",children:t("div",{className:" flex gap-[12px] flex-wrap",children:d?.map((e,r)=>o("div",{className:l("text-info-primary relative overflow-hidden",s==="rounded"?"rounded-xl":"rounded-none",{"aiui-dark":e.theme==="dark"},e?.fullWidth==="true"?"w-full flex-none":" w-[173px]"),children:[t(i,{source:e.mobileImg.url,className:"size-full",imgClassName:"h-full object-cover"}),o("div",{className:"footBottomMob absolute top-4 px-4 flex flex-col gap-[6px] left-0 right-0 overflow-hidden",children:[e.title&&t(a,{html:e.title,as:"p",className:"text-xl font-bold leading-[1.2]"}),e.description&&t(a,{html:e.description,className:"text-xl font-bold"})]})]},r))})})]})};var w=c(u);export{w as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/GraphicMore/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Picture, Text } from '../../components/index.js'\n\nexport type GraphicMoreDataType = {\n img: Img\n mobileImg: Img\n title: string\n description: string\n theme: 'light' | 'dark'\n fullWidth: 'true' | 'false'\n span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n}\n\ntype GraphicMoreType = {\n data: {\n shape?: 'rounded' | 'square'\n productsTab: GraphicMoreDataType[]\n }\n className?: string\n}\n\nconst GraphicMore = (props: GraphicMoreType) => {\n const { data, className } = props\n const { productsTab, shape } = data\n\n return (\n <>\n <div className={cn('creativeModuleBlock', 'tablet:block box-border hidden w-full overflow-hidden text-[#1D1D1F]')}>\n <Grid className={cn('tablet:gap-4 grid grid-cols-12 gap-3 ', className)}>\n {productsTab?.map((item, index) => {\n return (\n <GridItem\n key={index}\n span={item.span}\n className={cn(\n 'text-info-primary relative w-full overflow-hidden',\n shape === 'rounded' ? 'rounded-2xl' : 'rounded-none',\n '',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Picture source={item.img.url} className=\"size-full\" imgClassName=\"\" />\n <div className=\"footBottom lg-desktop:top-8 lg-desktop:px-8 desktop:top-6 desktop:px-6 absolute top-4 px-4 flex flex-col gap-[6px] left-0 right-0 overflow-hidden\">\n {item.title && (\n <Text\n html={item.title}\n as=\"p\"\n className=\"line-clamp-2 desktop:text-[32px] laptop:text-2xl text-xl font-bold\"\n />\n )}\n {item.description && (\n <Text html={item.description} className=\"line-clamp-2 desktop:text-lg text-sm font-bold\" />\n )}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n </div>\n <div className='tablet:hidden block text-[#1D1D1F]'>\n <div className=\" flex gap-[12px] flex-wrap\">\n {productsTab?.map((it, ind) => {\n return (\n <div\n key={ind}\n className={cn(\n 'text-info-primary relative overflow-hidden',\n shape === 'rounded' ? 'rounded-xl' : 'rounded-none',\n { 'aiui-dark': it.theme === 'dark' },\n it?.fullWidth === 'true' \n ? 'w-full flex-none' // \u5360\u6EE1\u6574\u884C\n : ' w-[173px]' // \u666E\u901A\u5143\u7D20\n )}\n >\n <Picture source={it.mobileImg.url} className=\"size-full\" imgClassName=\"h-full object-cover\" />\n <div className=\"footBottomMob absolute top-4 px-4 flex flex-col gap-[6px] left-0 right-0 overflow-hidden\">\n {it.title && <Text html={it.title} as=\"p\" className=\"text-xl font-bold leading-[1.2]\" />}\n {it.description && <Text html={it.description} className=\"text-xl font-bold\" />}\n </div>\n </div>\n )\n })}\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(GraphicMore)\n"],
|
|
5
|
+
"mappings": "aA+BI,mBAAAA,EAiBY,OAAAC,EACA,QAAAC,MAlBZ,oBA9BJ,OAAS,MAAAC,MAAU,yBACnB,MAAsB,wBAEtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,QAAAC,EAAM,YAAAC,MAAgB,2BAC/B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAoB9B,MAAMC,EAAeC,GAA2B,CAC9C,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,YAAAG,EAAa,MAAAC,CAAM,EAAIH,EAE/B,OACET,EAAAF,EAAA,CACE,UAAAC,EAAC,OAAI,UAAWE,EAAG,sBAAuB,sEAAsE,EAC9G,SAAAF,EAACI,EAAA,CAAK,UAAWF,EAAG,wCAAyCS,CAAS,EACnE,SAAAC,GAAa,IAAI,CAACE,EAAMC,IAErBd,EAACI,EAAA,CAEC,KAAMS,EAAK,KACX,UAAWZ,EACT,oDACAW,IAAU,UAAY,cAAgB,eACtC,GACA,CACE,YAAaC,EAAK,QAAU,MAC9B,CACF,EAEA,UAAAd,EAACM,EAAA,CAAQ,OAAQQ,EAAK,IAAI,IAAK,UAAU,YAAY,aAAa,GAAG,EACrEb,EAAC,OAAI,UAAU,oJACZ,UAAAa,EAAK,OACJd,EAACO,EAAA,CACC,KAAMO,EAAK,MACX,GAAG,IACH,UAAU,qEACZ,EAEDA,EAAK,aACJd,EAACO,EAAA,CAAK,KAAMO,EAAK,YAAa,UAAU,iDAAiD,GAE7F,IAvBKC,CAwBP,CAEH,EACH,EACF,EACAf,EAAC,OAAI,UAAU,qCACb,SAAAA,EAAC,OAAI,UAAU,6BACd,SAAAY,GAAa,IAAI,CAACI,EAAIC,IAEnBhB,EAAC,OAEC,UAAWC,EACT,6CACAW,IAAU,UAAY,aAAe,eACrC,CAAE,YAAaG,EAAG,QAAU,MAAO,EACnCA,GAAI,YAAc,OACd,mBACA,YACN,EAEA,UAAAhB,EAACM,EAAA,CAAQ,OAAQU,EAAG,UAAU,IAAK,UAAU,YAAY,aAAa,sBAAsB,EAC5Ff,EAAC,OAAI,UAAU,2FACZ,UAAAe,EAAG,OAAShB,EAACO,EAAA,CAAK,KAAMS,EAAG,MAAO,GAAG,IAAI,UAAU,kCAAkC,EACrFA,EAAG,aAAehB,EAACO,EAAA,CAAK,KAAMS,EAAG,YAAa,UAAU,oBAAoB,GAC/E,IAdKC,CAeP,CAEH,EACD,EACF,GACF,CAEJ,EAEA,IAAOC,EAAQf,EAAWK,CAAW",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "cn", "withLayout", "Grid", "GridItem", "Picture", "Text", "GraphicMore", "props", "data", "className", "productsTab", "shape", "item", "index", "it", "ind", "GraphicMore_default"]
|
|
7
|
+
}
|
|
@@ -4,7 +4,8 @@ import { HeaderNavigationMenu } from './types.js';
|
|
|
4
4
|
import type { UserProfile } from './types.js';
|
|
5
5
|
interface NavContextType {
|
|
6
6
|
buildProps: {
|
|
7
|
-
products
|
|
7
|
+
products?: Product[];
|
|
8
|
+
categories?: Record<string, any>;
|
|
8
9
|
};
|
|
9
10
|
event?: {
|
|
10
11
|
search?: () => void;
|
|
@@ -19,10 +20,10 @@ interface NavContextType {
|
|
|
19
20
|
payloadData: any;
|
|
20
21
|
currentMenu?: HeaderNavigationMenu;
|
|
21
22
|
setCurrentMenu?: (menu: HeaderNavigationMenu) => void;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
currentSeriesMetadata?: any;
|
|
24
|
+
setCurrentSeriesMetadata?: (metadata: any) => void;
|
|
25
|
+
subSubCategory?: any;
|
|
26
|
+
setSubSubCategory?: (category: any) => void;
|
|
26
27
|
}
|
|
27
28
|
export declare const NavContext: React.Context<NavContextType>;
|
|
28
29
|
export declare const useNavContext: () => NavContextType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as l}from"react/jsx-runtime";import{createContext as C,useCallback as n,useContext as d,useMemo as S,useReducer as E}from"react";import{HeaderNavigationMenu as v}from"./types.js";const p={isMobile:!1,payloadData:{},buildProps:{products:[],categories:{}},currentMenu:v.Primary,setCurrentMenu:()=>{},currentSeriesMetadata:{},setCurrentSeriesMetadata:()=>{}},o=C(p),U=()=>{if(!d(o))throw new Error("useNavContext must be used in <NavProvider>");return d(o)},T=(e,t)=>{switch(t.type){case"SET_CURRENT_MENU":return{...e,currentMenu:t.value};case"SET_CURRENT_SERIES_METADATA":return{...e,currentSeriesMetadata:t.value};case"SET_SUB_SUB_CATEGORY":return{...e,subSubCategory:t.value}}},M=({children:e,...t})=>{const[u,r]=E(T,{...p,currentMenu:v.Primary,setCurrentMenu:()=>{}}),i=n(a=>r({type:"SET_CURRENT_MENU",value:a}),[r]),s=n(a=>r({type:"SET_CURRENT_SERIES_METADATA",value:a}),[r]),c=n(a=>r({type:"SET_SUB_SUB_CATEGORY",value:a}),[r]),y=S(()=>({...u,setCurrentMenu:i,setCurrentSeriesMetadata:s,setSubSubCategory:c}),[i,s,c,u]);return l(o.Provider,{value:{...y,...t},children:e})};var b=M;export{o as NavContext,b as default,U as useNavContext};
|
|
2
2
|
//# sourceMappingURL=NavProvider.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/HeaderNavigation/NavProvider.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport type { UserProfile } from './types.js'\n\ninterface NavContextType {\n buildProps: {\n products
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "createContext", "useCallback", "useContext", "useMemo", "useReducer", "HeaderNavigationMenu", "initialState", "NavContext", "useNavContext", "reducer", "state", "action", "NavProvider", "children", "rest", "dispatch", "setCurrentMenu", "value", "
|
|
4
|
+
"sourcesContent": ["import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport type { UserProfile } from './types.js'\n\ninterface NavContextType {\n buildProps: {\n products?: Product[] // \u4EA7\u54C1\u6570\u636E\n categories?: Record<string, any> // \u5206\u7C7B\u6570\u636E\n }\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n isMobile?: boolean\n payloadData: any\n currentMenu?: HeaderNavigationMenu // \u5F53\u524D\u83DC\u5355\n setCurrentMenu?: (menu: HeaderNavigationMenu) => void // \u8BBE\u7F6E\u5F53\u524D\u83DC\u5355\n currentSeriesMetadata?: any // \u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n setCurrentSeriesMetadata?: (metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n subSubCategory?: any // \u5B50\u5B50\u5206\u7C7B\n setSubSubCategory?: (category: any) => void // \u8BBE\u7F6E\u5B50\u5B50\u5206\u7C7B\n}\n\nconst initialState: NavContextType = {\n isMobile: false,\n payloadData: {},\n buildProps: {\n products: [],\n categories: {},\n },\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n currentSeriesMetadata: {},\n setCurrentSeriesMetadata: () => {},\n}\n\ntype Action =\n | {\n type: 'SET_CURRENT_MENU'\n value: HeaderNavigationMenu\n }\n | {\n type: 'SET_CURRENT_SERIES_METADATA'\n value: any\n }\n | {\n type: 'SET_SUB_SUB_CATEGORY'\n value: any\n }\n\nexport const NavContext = createContext<NavContextType>(initialState)\n\nexport const useNavContext = () => {\n const context = useContext(NavContext)\n if (!context) {\n throw new Error('useNavContext must be used in <NavProvider>')\n }\n return useContext(NavContext)\n}\n\nconst reducer = (state: NavContextType, action: Action) => {\n switch (action.type) {\n case 'SET_CURRENT_MENU': {\n return {\n ...state,\n currentMenu: action.value,\n }\n }\n case 'SET_CURRENT_SERIES_METADATA': {\n return {\n ...state,\n currentSeriesMetadata: action.value,\n }\n }\n case 'SET_SUB_SUB_CATEGORY': {\n return {\n ...state,\n subSubCategory: action.value,\n }\n }\n }\n}\n\nconst NavProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & NavContextType) => {\n const [state, dispatch] = useReducer(reducer, {\n ...initialState,\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n })\n\n const setCurrentMenu = useCallback(\n (value: HeaderNavigationMenu) => {\n return dispatch({ type: 'SET_CURRENT_MENU', value })\n },\n [dispatch]\n )\n\n const setCurrentSeriesMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_SERIES_METADATA', value })\n },\n [dispatch]\n )\n\n const setSubSubCategory = useCallback((value: any) => {\n return dispatch({ type: 'SET_SUB_SUB_CATEGORY', value })\n }, [dispatch])\n\n const value = useMemo(\n () => ({\n ...state,\n setCurrentMenu,\n setCurrentSeriesMetadata,\n setSubSubCategory,\n }),\n [setCurrentMenu, setCurrentSeriesMetadata, setSubSubCategory, state]\n )\n\n return <NavContext.Provider value={{ ...value, ...rest }}>{children}</NavContext.Provider>\n}\n\nexport default NavProvider\n"],
|
|
5
|
+
"mappings": "AAiIS,cAAAA,MAAA,oBAjIT,OAAgB,iBAAAC,EAAe,eAAAC,EAAa,cAAAC,EAAY,WAAAC,EAAS,cAAAC,MAAkB,QAEnF,OAAS,wBAAAC,MAA4B,aA2BrC,MAAMC,EAA+B,CACnC,SAAU,GACV,YAAa,CAAC,EACd,WAAY,CACV,SAAU,CAAC,EACX,WAAY,CAAC,CACf,EACA,YAAaD,EAAqB,QAClC,eAAgB,IAAM,CAAC,EACvB,sBAAuB,CAAC,EACxB,yBAA0B,IAAM,CAAC,CACnC,EAgBaE,EAAaP,EAA8BM,CAAY,EAEvDE,EAAgB,IAAM,CAEjC,GAAI,CADYN,EAAWK,CAAU,EAEnC,MAAM,IAAI,MAAM,6CAA6C,EAE/D,OAAOL,EAAWK,CAAU,CAC9B,EAEME,EAAU,CAACC,EAAuBC,IAAmB,CACzD,OAAQA,EAAO,KAAM,CACnB,IAAK,mBACH,MAAO,CACL,GAAGD,EACH,YAAaC,EAAO,KACtB,EAEF,IAAK,8BACH,MAAO,CACL,GAAGD,EACH,sBAAuBC,EAAO,KAChC,EAEF,IAAK,uBACH,MAAO,CACL,GAAGD,EACH,eAAgBC,EAAO,KACzB,CAEJ,CACF,EAEMC,EAAc,CAAC,CACnB,SAAAC,EACA,GAAGC,CACL,IAEuB,CACrB,KAAM,CAACJ,EAAOK,CAAQ,EAAIX,EAAWK,EAAS,CAC5C,GAAGH,EACH,YAAaD,EAAqB,QAClC,eAAgB,IAAM,CAAC,CACzB,CAAC,EAEKW,EAAiBf,EACpBgB,GACQF,EAAS,CAAE,KAAM,mBAAoB,MAAAE,CAAM,CAAC,EAErD,CAACF,CAAQ,CACX,EAEMG,EAA2BjB,EAC9BgB,GACQF,EAAS,CAAE,KAAM,8BAA+B,MAAAE,CAAM,CAAC,EAEhE,CAACF,CAAQ,CACX,EAEMI,EAAoBlB,EAAagB,GAC9BF,EAAS,CAAE,KAAM,uBAAwB,MAAAE,CAAM,CAAC,EACtD,CAACF,CAAQ,CAAC,EAEPE,EAAQd,EACZ,KAAO,CACL,GAAGO,EACH,eAAAM,EACA,yBAAAE,EACA,kBAAAC,CACF,GACA,CAACH,EAAgBE,EAA0BC,EAAmBT,CAAK,CACrE,EAEA,OAAOX,EAACQ,EAAW,SAAX,CAAoB,MAAO,CAAE,GAAGU,EAAO,GAAGH,CAAK,EAAI,SAAAD,EAAS,CACtE,EAEA,IAAOO,EAAQR",
|
|
6
|
+
"names": ["jsx", "createContext", "useCallback", "useContext", "useMemo", "useReducer", "HeaderNavigationMenu", "initialState", "NavContext", "useNavContext", "reducer", "state", "action", "NavProvider", "children", "rest", "dispatch", "setCurrentMenu", "value", "setCurrentSeriesMetadata", "setSubSubCategory", "NavProvider_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import"react";const e=t=>o("svg",{width:"16",height:"8",viewBox:"0 0 16 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:o("path",{d:"M8 0L16 8H0L8 0Z",fill:"currentColor"})});var n=e;export{n as default};
|
|
2
|
+
//# sourceMappingURL=Polygon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/biz-components/HeaderNavigation/icons/Polygon.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\n\nconst Polygon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"16\" height=\"8\" viewBox=\"0 0 16 8\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <path d=\"M8 0L16 8H0L8 0Z\" fill=\"currentColor\" />\n </svg>\n )\n}\n\nexport default Polygon"],
|
|
5
|
+
"mappings": "AAKM,cAAAA,MAAA,oBALN,MAAkB,QAElB,MAAMC,EAAWC,GAEbF,EAAC,OAAI,MAAM,KAAK,OAAO,IAAI,QAAQ,WAAW,KAAK,OAAO,MAAM,6BAA8B,GAAGE,EAC/F,SAAAF,EAAC,QAAK,EAAE,mBAAmB,KAAK,eAAe,EACjD,EAIJ,IAAOG,EAAQF",
|
|
6
|
+
"names": ["jsx", "Polygon", "props", "Polygon_default"]
|
|
7
|
+
}
|
|
@@ -8,4 +8,5 @@ import User from './User.js';
|
|
|
8
8
|
import RightArrow from './RightArrow.js';
|
|
9
9
|
import LeftArrow from './LeftArrow.js';
|
|
10
10
|
import DownArrow from './DownArrow.js';
|
|
11
|
-
|
|
11
|
+
import Polygon from './Polygon.js';
|
|
12
|
+
export { AnkerLogo, Menu, Search, Cart, Close, User, RightArrow, LeftArrow, DownArrow, LogoLine, Polygon };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from"./AnkerLogo.js";import r from"./LogoLine.js";import m from"./Menu.js";import t from"./Search.js";import i from"./Cart.js";import f from"./Close.js";import p from"./User.js";import e from"./RightArrow.js";import n from"./LeftArrow.js";import g from"./DownArrow.js";import w from"./Polygon.js";export{o as AnkerLogo,i as Cart,f as Close,g as DownArrow,n as LeftArrow,r as LogoLine,m as Menu,w as Polygon,e as RightArrow,t as Search,p as User};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/biz-components/HeaderNavigation/icons/index.ts"],
|
|
4
|
-
"sourcesContent": ["import AnkerLogo from './AnkerLogo.js'\nimport LogoLine from './LogoLine.js'\nimport Menu from './Menu.js'\nimport Search from './Search.js'\nimport Cart from './Cart.js'\nimport Close from './Close.js'\nimport User from './User.js'\nimport RightArrow from './RightArrow.js'\nimport LeftArrow from './LeftArrow.js'\nimport DownArrow from './DownArrow.js'\n\nexport { AnkerLogo, Menu, Search, Cart, Close, User, RightArrow, LeftArrow, DownArrow, LogoLine }\n"],
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAe,iBACtB,OAAOC,MAAc,gBACrB,OAAOC,MAAU,YACjB,OAAOC,MAAY,cACnB,OAAOC,MAAU,YACjB,OAAOC,MAAW,aAClB,OAAOC,MAAU,YACjB,OAAOC,MAAgB,kBACvB,OAAOC,MAAe,iBACtB,OAAOC,MAAe",
|
|
6
|
-
"names": ["AnkerLogo", "LogoLine", "Menu", "Search", "Cart", "Close", "User", "RightArrow", "LeftArrow", "DownArrow"]
|
|
4
|
+
"sourcesContent": ["import AnkerLogo from './AnkerLogo.js'\nimport LogoLine from './LogoLine.js'\nimport Menu from './Menu.js'\nimport Search from './Search.js'\nimport Cart from './Cart.js'\nimport Close from './Close.js'\nimport User from './User.js'\nimport RightArrow from './RightArrow.js'\nimport LeftArrow from './LeftArrow.js'\nimport DownArrow from './DownArrow.js'\nimport Polygon from './Polygon.js'\n\nexport { AnkerLogo, Menu, Search, Cart, Close, User, RightArrow, LeftArrow, DownArrow, LogoLine, Polygon }\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAe,iBACtB,OAAOC,MAAc,gBACrB,OAAOC,MAAU,YACjB,OAAOC,MAAY,cACnB,OAAOC,MAAU,YACjB,OAAOC,MAAW,aAClB,OAAOC,MAAU,YACjB,OAAOC,MAAgB,kBACvB,OAAOC,MAAe,iBACtB,OAAOC,MAAe,iBACtB,OAAOC,MAAa",
|
|
6
|
+
"names": ["AnkerLogo", "LogoLine", "Menu", "Search", "Cart", "Close", "User", "RightArrow", "LeftArrow", "DownArrow", "Polygon"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as de,jsx as e,jsxs as l}from"react/jsx-runtime";import{forwardRef as W,useCallback as G,useEffect as C,useImperativeHandle as me,useMemo as h,useRef as $,useState as w}from"react";import{Picture as J,Text as p,Button as S,Container as K,Link as T}from"../../components/index.js";import{withLayout as ue}from"../../shared/Styles.js";import{cn as E,atobID as pe}from"../../helpers/utils.js";import fe,{useNavContext as A}from"./NavProvider.js";import{HeaderNavigationMenu as D,HeaderNavigationBlockType as j,HeaderNavigationActionBlockType as R}from"./types.js";import{useMediaQuery as be}from"react-responsive";import{debounce as ve,throttle as ge}from"es-toolkit";import{useGSAP as Q}from"@gsap/react";import{gsap as V}from"gsap";import{WithSidebar as X,WithSupports as Z,WithMulticol as ee,WithGroupCategory as te}from"./withCategory.js";import{Menu as xe,Close as ae,User as ye,RightArrow as le,LeftArrow as he,DownArrow as ne,LogoLine as Ne}from"./icons/index.js";const ke=W((t,n)=>{const{data:{headerNavigation:a}={},buildProps:i,event:s,profile:o,theme:u="light"}=t,[f,N]=w(!1),[g,r]=w(!1),[c,d]=w(!1),b=$(null),v=be({query:"(max-width: 1440px)"});return C(()=>{N(v)},[v]),me(n,()=>b.current),C(()=>{let H=0,B=0;const I=ge(k=>{const z=B-k;z>0?(H+=z,H>=300&&(r(!1),H=0)):r(k>300),d(k>24),B=k},200),P=()=>{let k=0;document?.documentElement&&document?.documentElement?.scrollTop?k=document?.documentElement.scrollTop:document?.body&&(k=document?.body.scrollTop),I(k)};return window.addEventListener("scroll",P),()=>window.removeEventListener("scroll",P)},[]),e(fe,{buildProps:i,profile:o,isMobile:f,event:s,payloadData:a,children:e("header",{"data-ui-component-id":"HeaderNavigation",className:"sticky top-0 z-50",ref:b,children:l("div",{className:E("border-b border-b-gray-200",u==="light"?"text-black":"text-white",{"translate-y-[-100%] transition-transform duration-500 ease-in-out":g,"!bg-white transition-all duration-500 ease-in-out":c},{"hover:!text-black":u==="dark","!text-black":c}),children:[!f&&e(we,{data:a}),f&&e(Se,{data:a})]})})})}),we=W((t,n)=>{const{data:a}=t,{event:i}=A(),s=h(()=>te(a?.categories),[a]),[o,u]=w(null),[f,N]=w([]),g=$(null),[r,c]=w(!1),d=$(null),b=$(s.map(m=>Array(m?.length||0).fill(null)));C(()=>{s?.length&&N(s?.map((m,y)=>m?.map((M,L)=>({groupIndex:y,index:L,open:!1}))))},[s]);const v=h(()=>{let m=null;for(const y of f){for(const M of y)if(M.open){m=M;break}if(m)break}return m},[f]);C(()=>{},[v]);const H=(m,y,M)=>{m.stopPropagation(),u(s[y][M]),N(L=>L.map(_=>_.map(U=>U.groupIndex===y&&U.index===M?{...U,open:!U.open}:{...U,open:!1})))},B=()=>{N(m=>m.map(y=>y.map(M=>({...M,open:!1}))))},I=h(()=>{if(o)return o?.components?.[0]?.blockType},[o]),P=X(Me,o),k=Z(De,{categoriesItem:o,currentNavItemRef:b.current?.[v?.groupIndex||0]?.[v?.index||0]}),z=ee(Ce,o),Y=h(()=>{switch(I){case j.Sidebar:return e(P,{});case j.Supports:return e(k,{});case j.Multicol:return e(z,{});default:return null}},[I,z,P,k]),F=h(()=>a?.headerBar?.actions?.filter(m=>m?.pcShow),[a]),x=h(()=>F?.find(m=>m?.blockType===R.Profile),[F]),O=G(()=>{c(m=>!m)},[]);return C(()=>{if(g?.current){const m=g.current;return m.addEventListener("click",O),()=>{m.removeEventListener("click",O)}}},[O]),l(K,{childClassName:"bg-white",className:"relative h-[96px]",children:[l("div",{ref:d,onClick:B,className:"flex h-full flex-col justify-end gap-4",children:[l("div",{className:"flex items-center justify-between",children:[e(ie,{}),e(re,{ref:g,actions:F})]}),e("div",{className:"flex justify-between",children:s?.map((m,y)=>e("div",{className:"flex gap-6",children:m?.map((M,L)=>e("div",{ref:_=>{b.current[y][L]=_},className:"hover:text-brand-0 cursor-pointer",children:l("div",{className:"relative",children:[l("div",{className:"flex items-center gap-1 pb-4",onClick:_=>H(_,y,L),children:[e(p,{html:M.text,className:E(" text-sm font-bold leading-[1.4]",{"text-brand-0":v?.groupIndex===y&&v?.index===L})}),e(ne,{className:E({"text-brand-0":v?.groupIndex===y&&v?.index===L})})]}),e("div",{className:E("absolute bottom-0 left-0 h-[2px] w-0 bg-[#1D1D1F] transition-all duration-500",{"w-full":v?.groupIndex===y&&v?.index===L})})]})},M.id))},`groupCategory-${y}`))})]}),v?.open&&o&&l("div",{className:"absolute left-0 top-full z-[999] flex w-full flex-col bg-black/70",style:{height:`calc(100vh - ${d?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{className:"relative z-50",children:Y}),e("div",{className:"flex-1 bg-transparent",onClick:B})]}),r&&l("div",{className:"absolute left-0 z-[999] flex w-full bg-black/70",style:{height:`calc(100vh - ${g?.current?.getBoundingClientRect()?.bottom}px)`,top:`calc(12px + ${g?.current?.getBoundingClientRect()?.top}px)`},children:[l("div",{className:"absolute max-w-[272px] bg-white p-4",style:{right:`calc(100% - ${g?.current?.getBoundingClientRect()?.right}px)`},children:[e(p,{html:x?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-3 flex flex-col gap-1",children:x?.benefits?.map(m=>l("div",{className:"flex items-center gap-[6px]",children:[e(J,{source:m.benefitIcon?.url,className:"size-4",alt:m.benefit,width:16,height:16}),e(p,{html:m.benefit,className:"text-sm font-bold leading-[1.4]"})]},m.id))}),l("div",{className:"mt-4 flex items-center gap-2",children:[e(S,{variant:"secondary",size:"sm",onClick:()=>i?.join?.(),children:e(p,{html:x?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(S,{variant:"primary",size:"sm",onClick:()=>i?.login?.(),children:e(p,{html:x?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]}),e("div",{className:"flex-1 bg-transparent",onClick:()=>c(!1)})]})]})}),Me=({sidebarCategoriesMetadata:t,seriesMetadata:n})=>{const[a,i]=w([]),[s,o]=w(0),u=$(null);Q(()=>{V.fromTo(u?.current,{height:0},{height:548})},[]),C(()=>{t?.subcategories?.length&&i(t?.subcategories?.map((r,c)=>({index:c,open:!1})))},[t]);const f=h(()=>n?.find(r=>t?.subcategories?.[a?.find(c=>c.open)?.index||0]?.subSubCategories?.[s]?.label===r.label)||{},[t,a,s,n]),N=r=>{i(c=>c.map(d=>d.index===r?{...d,open:!d.open}:{...d,open:!1}))},g=r=>{o(r)};return l(K,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[l("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},children:[e("div",{className:"desktop:max-h-[416px] flex flex-col overflow-y-auto",children:t?.subcategories?.map((r,c)=>l("div",{children:[l("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>N(c),children:[e(p,{html:r.label,className:"p-4 text-sm font-bold leading-[1.4]"}),e(ne,{className:E({"rotate-180":a.find(d=>d.index===c)?.open})})]}),a.find(d=>d.index===c)?.open&&e("div",{className:"flex flex-col",children:r.subSubCategories?.map((d,b)=>e(p,{html:d.label,onMouseEnter:()=>g(b),className:E("cursor-pointer px-6 py-4 text-sm font-bold leading-[1.4] text-[#6D6D6F] hover:bg-[#F5F5F7]")},`subSubItem-${c}-${b}`))})]},`subcategoryItem-${c}`))}),e("div",{className:"flex",children:l("div",{className:"flex flex-col gap-4",children:[e(S,{variant:"primary",size:"lg",className:"text-base",children:e("a",{href:t?.primary?.url,children:t?.primary?.label})}),e(S,{variant:"link",size:"lg",className:"justify-start py-0 text-base",children:e("a",{href:t?.secondary?.url,children:t?.secondary?.label})})]})})]}),l("div",{className:"flex-1",children:[Reflect.ownKeys(f).length>0&&l("div",{className:"mb-4 flex items-center justify-between",children:[l("div",{className:"flex items-center gap-2",children:[e(p,{html:f?.label,className:"text-2xl font-bold leading-[1.4]"}),e(S,{variant:"link",size:"lg",className:"justify-start p-0 text-base",children:e(T,{href:f?.primary?.url,className:"text-base font-bold leading-[1.2] no-underline",children:f?.primary?.label})})]}),e(T,{href:f?.guide?.url,className:"text-base leading-[1.2] text-[#6D6D6F]",children:f?.guide?.label})]}),e("div",{className:"flex flex-col gap-4 overflow-y-auto",ref:u,children:f?.series?.map((r,c)=>l("div",{children:[e(p,{html:r.label,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 grid grid-cols-3 gap-4",children:r.products?.map((d,b)=>e(oe,{product:d},`seriesProductItem-${b}`))})]},`seriesItem-${c}`))})]})]})},Ce=({multicolMetadata:t})=>{const n=$(null);return Q(()=>{V.fromTo(n?.current,{height:0},{height:"auto"})},[]),e("div",{ref:n,children:e(K,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:t?.map((a,i)=>e("div",{className:"w-1/4",children:e(se,{item:a})},`multicolItem-${a?.label}-${i}`))})})})},De=({supportsMetadata:t,currentNavItemRef:n})=>{const a=$(null),[i,s]=w(null);Q(()=>{V.fromTo(a?.current,{height:0},{height:"auto"})},[]);const o=ve(()=>{if(n){const u=n.getBoundingClientRect();s(u)}},500);return C(()=>(o(),window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}),[o]),C(()=>{if(n){const u=n.getBoundingClientRect();s(u)}},[n]),e("div",{className:"absolute top-0 h-full bg-white p-4",ref:a,style:{right:`calc(100% - ${i?.right}px)`},children:e("div",{children:t?.map(u=>e("div",{className:"py-2",children:e(T,{href:u.url,className:"text-sm font-bold leading-[1.4] no-underline",children:u.label})},u.id))})})},oe=({product:t})=>{const{buildProps:n}=A(),a=n?.products?.find(o=>o.handle===t.handle),i=a?.variants?.find(o=>o.sku===t.sku),s=h(()=>`/products/${a?.handle}?variant=${pe(i?.id)}`,[a?.handle,i?.id]);return l("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-105",children:[e("div",{className:"shrink-0 basis-[96px]",children:e(J,{source:`${i?.image?.url||t?.images?.[0]?.url}}`,width:96,height:96})}),l("div",{className:"relative",children:[t?.badge&&e(p,{as:"p",html:t?.badge,className:"text-brand-0 mb-1 inline-block h-[24px] rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]"}),e(T,{href:s,className:"no-underline",children:e(p,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:a?.title||t?.name})}),t?.desc&&e(p,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})},se=({item:t})=>l(de,{children:[t?.columns&&l(de,{children:[e(p,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:t.columns?.map(n=>e("div",{className:"py-2",children:e(T,{href:n.url,className:"text-sm font-bold leading-[1.4] no-underline",children:n.label})},n.label))})]}),t?.imageUrl&&l("div",{className:"laptop:h-[280px] laptop:w-[404px] desktop:w-full desktop:h-auto relative h-[240px] w-[358px]",children:[e(J,{source:t.imageUrl,width:404,height:280}),l(T,{href:t.url,className:"absolute inset-0 z-10 flex flex-col justify-end p-4 no-underline",children:[e(p,{html:t.title,className:"desktop:text-2xl text-xl font-bold leading-[1.2] text-white"}),e(p,{html:t.subtitle,className:"text-sm font-bold leading-[1.4] text-white"})]})]})]}),Se=W(({data:t},n)=>{const a=h(()=>te(t?.categories),[t]),{currentMenu:i,setCurrentMenu:s,thirdNavTitle:o}=A(),[u,f]=w(!1),[N,g]=w(0),[r,c]=w(null),d=$(null);C(()=>{if(d?.current&&u){const x=d?.current?.getBoundingClientRect();g(window?.innerHeight-(x?.bottom||0))}},[u]),Q(()=>{V.fromTo(d.current,{height:0},{height:N,duration:.5})},[N]),C(()=>{document.documentElement.style.overflow=u?"hidden":"auto"},[u]);const b=h(()=>r?.components?.[0]?.blockType,[r]),v=X(Le,r),H=Z(Te,{categoriesItem:r}),B=ee(Ee,r),I=h(()=>{switch(b){case j.Sidebar:return e(v,{});case j.Supports:return e(H,{});case j.Multicol:return e(B,{});default:return null}},[b,v,H,B]),P=G(()=>{f(!1),g(0),s&&s(D.Primary)},[f,g,s]),k=h(()=>t?.headerBar?.actions?.filter(x=>x?.mobileShow&&x?.blockType!==R.Profile),[t]),z=h(()=>t?.headerBar?.actions?.find(x=>x?.mobileShow&&x?.blockType===R.Profile)||{},[t]),Y=h(()=>{switch(i){case D.Primary:return e(Be,{actions:k,menuOpen:u,onMenuOpenClose:()=>{f(!1),g(0)},onMenuOpenClick:()=>f(!0)});case D.Secondary:return e(ce,{title:r?.text,onMenuOpenClose:P,onMenuBackClick:()=>s?.(D.Primary)});case D.Third:return e(ce,{title:o,onMenuOpenClose:P,onMenuBackClick:()=>s?.(D.Secondary)});default:return null}},[u,i,s,r,k,o,P]),F=G((x,O)=>{const m=Array.isArray(a)?Array.isArray(a[x])?a[x][O]:{}:{};c(m),s?.(D.Secondary)},[a,s]);return l(K,{childClassName:"bg-white",className:"relative h-[52px]",children:[Y,u&&e("div",{ref:d,className:"absolute left-0 top-[calc(100%+1px)] z-[999] w-full overflow-y-auto bg-white",style:{height:N},children:i===D.Primary?e(Pe,{categories:a,onPrimaryMenuClick:F,profileAction:z}):I})]})}),Pe=({categories:t,onPrimaryMenuClick:n,profileAction:a})=>l("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((i,s)=>l("div",{className:"",children:[i?.map((o,u)=>e(q,{label:o.text,onClick:()=>n(s,u)},o.id)),e("div",{className:E("my-2 h-px w-full bg-[#E5E5E7]",{hidden:s===t.length-1})})]},`groupCategory-${s}`))}),e(He,{profileAction:a})]}),Le=({sidebarCategoriesMetadata:t,seriesMetadata:n})=>{const{currentMenu:a,setCurrentMenu:i,setThirdNavTitle:s,matchSeriesMetadata:o,setMatchSeriesMetadata:u}=A(),[f,N]=w([]);return C(()=>{t?.subcategories?.length&&N(t?.subcategories?.map((r,c)=>({index:c,open:!1})))},[t]),h(()=>{switch(a){case D.Secondary:return l("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col justify-between p-4",children:[l("div",{children:[t?.subcategories?.map((r,c)=>l("div",{children:[e(q,{label:r?.label,active:f.find(d=>d.index===c)?.open,onClick:()=>{N(d=>d.map(b=>b.index===c?{...b,open:!b.open}:{...b,open:!1}))}}),f.find(d=>d.index===c)?.open&&r.subSubCategories?.map((d,b)=>e("div",{className:"px-2 py-4",onClick:()=>{i&&i(D.Third),u?.(n?.find(v=>t?.subcategories?.[c]?.subSubCategories?.[b]?.label===v.label)||{}),s&&s(d.label)},children:e(p,{html:d.label,className:"text-sm font-bold leading-[1.4]"})},`${c}-${b}`))]},`${r.label}-${c}`)),e(T,{href:o?.guide?.url,children:e("div",{className:"mt-4",children:e(p,{html:o?.guide?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]}),l("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[e(S,{variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:e("a",{href:t?.primary?.url,children:t?.primary?.label})}),e(S,{variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:e("a",{href:t?.secondary?.url,children:t?.secondary?.label})})]})]});case D.Third:return l("div",{className:"tablet:px-8 laptop:px-16 desktop:px-0 p-4",children:[Reflect.ownKeys(o).length>0&&l("div",{className:"tablet:pt-0 flex items-center gap-3 py-4",children:[e(p,{html:o?.label,className:"text-xl font-bold leading-[1.4]"}),e(S,{variant:"link",size:"lg",className:"p-0",children:e(T,{href:o?.primary?.url,className:"text-base leading-[1.2]",children:o?.primary?.label})})]}),e("div",{className:"flex flex-col gap-6",children:o?.series?.map((r,c)=>l("div",{children:[e(p,{html:r.label,className:"text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),e("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 mt-2 flex flex-col gap-2",children:r.products?.map((d,b)=>e(oe,{product:d},`seriesProductItem-${c}-${b}`))})]},`seriesItem-${c}`))})]});default:return null}},[a,o,t,s,i,u,n,f])},Te=({supportsMetadata:t})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(n=>e(q,{href:n.url,label:n.label,onClick:()=>{}},n.id))}),Ee=({multicolMetadata:t})=>e("div",{className:"tablet:px-8 tablet:p-4 laptop:px-16 flex flex-col gap-4 px-4",children:t?.map((n,a)=>e("div",{children:e(se,{item:n})},`multicolItem-${n?.label}-${a}`))}),He=({profileAction:t})=>{const[n,a]=w(!1),{profile:i,event:s}=A();return l("div",{className:"tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",children:[l("div",{className:"flex items-center justify-between",onClick:()=>a(!n),children:[l("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] items-center justify-center rounded-full bg-white",children:e(ye,{})}),e(p,{html:i?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),e(le,{className:E({"rotate-90":n})})]}),i?.email&&e("div",{className:"mt-4",children:t?.profiles?.map(o=>e(q,{label:o?.title,href:o?.url},o.id))}),n&&!i?.email&&l("div",{className:"mt-4",children:[e(p,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-3 flex flex-col gap-1",children:t?.benefits?.map(o=>l("div",{className:"flex items-center gap-[6px]",children:[e(J,{source:o.benefitIcon?.url,className:"size-4",alt:o.benefit,width:16,height:16}),e(p,{html:o.benefit,className:"text-sm font-bold leading-[1.4]"})]},o.id))})]}),l("div",{className:"tablet:mt-4 mt-6 flex items-center gap-3",children:[e(S,{className:"tablet:flex-none flex-1",variant:"secondary",size:"sm",onClick:()=>s?.join?.(),children:e(p,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(S,{className:"tablet:flex-none flex-1",variant:"primary",size:"sm",onClick:()=>s?.login?.(),children:e(p,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Be=({menuOpen:t,onMenuOpenClose:n,onMenuOpenClick:a,actions:i})=>l("div",{className:"flex h-full items-center justify-between gap-4",children:[e(ie,{}),l("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(re,{actions:i}),t?e(ae,{onClick:()=>n()}):e(xe,{onClick:()=>a()})]})]}),ie=()=>{const{payloadData:t}=A();return l("div",{className:"desktop:gap-2 flex items-center gap-[6px]",children:[e("div",{dangerouslySetInnerHTML:{__html:t?.headerBar?.logo}}),e(Ne,{}),e(p,{html:t?.headerBar?.slogan,className:"tablet:text-sm text-xs font-bold leading-[1.4]"})]})},re=W(({actions:t},n)=>{const{event:a}=A(),i=G(s=>{switch(s?.blockType){case R.Search:a?.search?.();break;case R.Cart:a?.cart?.();break;case R.Profile:a?.profile?.();break;case R.Livestream:a?.livestream?.();break;default:return()=>{}}},[a]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map(s=>e("div",{ref:s.blockType===R.Profile?n:null,onClick:()=>i(s),children:e(p,{html:s.icon,className:"hover:text-brand-0 cursor-pointer"})},s.id))})}),ce=({title:t,onMenuOpenClose:n,onMenuBackClick:a})=>l("div",{className:"flex h-full items-center gap-3",children:[e(he,{onClick:()=>a()}),e(p,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e(ae,{onClick:()=>n()})]}),q=({label:t,href:n,onClick:a,active:i})=>e("div",{className:"flex cursor-pointer items-center justify-between py-4",onClick:a,children:l(T,{href:n,asChild:!n,className:"flex w-full items-center justify-between no-underline",children:[e(p,{html:t,className:"text-sm font-bold leading-[1.4]"}),e(le,{className:E({"rotate-90":i})})]})});var Ke=ue(ke);export{Ke as default};
|
|
1
|
+
"use client";import{Fragment as J,jsx as e,jsxs as n}from"react/jsx-runtime";import xe,{forwardRef as X,useCallback as _,useEffect as E,useImperativeHandle as Ne,useMemo as M,useRef as R,useState as D}from"react";import{Picture as K,Text as f,Button as H,Container as Y,Link as j,Heading as oe}from"../../components/index.js";import{withLayout as ke}from"../../shared/Styles.js";import{cn as N,atobID as we}from"../../helpers/utils.js";import Ce,{useNavContext as O}from"./NavProvider.js";import{HeaderNavigationMenu as T,HeaderNavigationBlockType as F,HeaderNavigationActionBlockType as I}from"./types.js";import"react-responsive";import{debounce as Se}from"es-toolkit";import Me from"jump.js";import{useGSAP as ne}from"@gsap/react";import{gsap as le}from"gsap";import{WithSidebar as se,WithSupports as re,WithMulticol as ie,WithGroupCategory as ce}from"./withCategory.js";import{Menu as De,Close as de,User as Le,RightArrow as Pe,LeftArrow as ze,DownArrow as Z,Polygon as Ee}from"./icons/index.js";import He from"../NavigationSearch/index.js";const Be=X((t,a)=>{const{data:{headerNavigation:l}={},buildProps:o,event:s,profile:c,theme:x="light",isTop:r=!1,searchResult:v,onSearch:h,isSearching:L,keywords:y}=t,u=R(null),[d,m]=D(!1),[p,i]=D(!1),[g,S]=D(!1),[C,P]=D(!1),k=R(null),A=()=>{const w=document?.querySelector("body")?.offsetWidth||0;P(w<=1440)};E(()=>(A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}),[]),Ne(a,()=>k.current),E(()=>{k.current&&r&&Me(k.current,{duration:0,offset:k.current?.getBoundingClientRect()?.bottom||0})},[r]),E(()=>{s&&(s.search=()=>m(!0))},[s]),ne(()=>{u?.current&&d&&le.fromTo(u.current,{height:0},{height:"auto",duration:.3})},[d]),E(()=>{document.documentElement.style.overflow=d?"hidden":"auto"},[d]);const W=M(()=>l?.headerBar?.actions?.find(w=>w?.blockType===I.Search)?.searchBar?.[0]||{},[l]);return e(Ce,{buildProps:o,profile:c,isMobile:C,event:s,payloadData:l,children:e("header",{"data-ui-component-id":"HeaderNavigation",className:"relative z-[100]",ref:k,children:n("div",{className:N(x==="light"?"text-black":"text-white",{}),onClick:()=>S(!0),children:[e(Te,{data:l,className:"hidden desktop:block",theme:x,onNavItemClick:()=>S(!0)}),e(je,{data:l,className:"block desktop:hidden"}),d&&n("div",{className:"absolute z-[60] top-0 left-0 w-full bg-black/70 flex flex-col",style:{height:`calc(100dvh - ${k?.current?.getBoundingClientRect()?.top}px)`},children:[e("div",{ref:u,className:N("overflow-y-auto",{}),children:e(He,{data:W,keywords:y,isSearching:L,searchResult:v,onSearch:w=>{h?.(w)},onClose:()=>{h?.(),m(!1)}})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>m(!1)})]})]})})})}),Te=X((t,a)=>{const{data:l,onNavItemClick:o,className:s,theme:c}=t,{event:x,profile:r}=O(),[v,h]=D(!1),L=M(()=>ce(l?.categories?.filter(b=>b?.pcShow)),[l]),[y,u]=D(null),[d,m]=D([]),p=R(null),[i,g]=D(!1),S=R(null),C=R(null),P=R(L.map(b=>Array(b?.length||0).fill(null)));E(()=>{L?.length&&m(L?.map((b,z)=>b?.map((B,$)=>({groupIndex:z,index:$,open:!1}))))},[L]);const k=M(()=>{let b=null;for(const z of d){for(const B of z)if(B.open){b=B;break}if(b)break}return b},[d]);E(()=>{document.documentElement.style.overflow=k?.open||i?"hidden":"auto"},[k?.open,i]);const A=(b,z,B)=>{g(!1),y?.components?.[0]?.blockType===F.Links?y?.components?.[0]?.url&&window.open(y?.components?.[0]?.url):(b.stopPropagation(),o?.(),u(L[z][B]),m($=>$.map(V=>V.map(q=>q.groupIndex===z&&q.index===B?{...q,open:!q.open}:{...q,open:!1}))))},W=()=>{m(b=>b.map(z=>z.map(B=>({...B,open:!1}))))},w=M(()=>{if(y)return y?.components?.[0]?.blockType},[y]),ee=se(Re,y),U=ie(Ae,y),he=re($e,{categoriesItem:y,currentNavItemRef:P.current?.[k?.groupIndex||0]?.[k?.index||0]}),ye=M(()=>{switch(w){case F.Sidebar:return e(ee,{});case F.Supports:return e(he,{});case F.Multicol:return e(U,{});default:return null}},[w,y]),te=M(()=>l?.headerBar?.actions?.filter(b=>b?.pcShow),[l]),G=M(()=>te?.find(b=>b?.blockType===I.Profile),[te]),ae=_(()=>{g(b=>!b)},[]);return E(()=>{if(p?.current){const b=p.current;return b.addEventListener("click",ae),()=>{b.removeEventListener("click",ae)}}},[ae]),ne(()=>{k?.open&&le.fromTo(C?.current,{height:0},{height:"auto"})},[k?.open]),n(Y,{className:N("relative h-[96px]",s),children:[n("div",{ref:S,onClick:W,className:"flex h-full flex-col justify-end gap-4",children:[n("div",{className:"flex items-center justify-between",children:[e(fe,{}),e(ve,{ref:p,actions:te,activeStatus:i})]}),e("div",{className:"flex justify-between",children:L?.map((b,z)=>e("div",{className:"flex gap-3",children:b?.map((B,$)=>e("div",{ref:V=>{P.current[z][$]=V},className:"group cursor-pointer",children:n("div",{className:"relative",children:[n("div",{className:"flex items-center gap-1 pb-4",onClick:V=>A(V,z,$),children:[e(f,{html:B.text,className:"text-sm font-bold leading-[1.4]"}),e(Z,{className:N("opacity-0 size-4 group-hover:opacity-100 transition-opacity duration-500",{"rotate-180":k?.groupIndex===z&&k?.index===$,"opacity-100":v&&k?.groupIndex===z&&k?.index===$})})]}),e("div",{className:N("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":k?.groupIndex===z&&k?.index===$},c==="dark"?"bg-white":"bg-[#1D1D1F]")})]})},B.id))},`groupCategory-${z}`))})]}),n("div",{className:N("border-t border-b-[#E4E5E6] text-black absolute left-0 top-full z-[999] flex w-full flex-col bg-black/70 overflow-hidden",{hidden:!(k?.open&&y)}),onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),style:{height:`calc(100dvh - ${S?.current?.getBoundingClientRect()?.bottom}px)`},children:[e("div",{ref:C,className:N("relative z-50",{"overflow-hidden":w!==F.Supports}),children:ye}),e("div",{className:"flex-1 bg-transparent",onClick:W})]}),i&&n("div",{className:"absolute left-0 z-[999] flex w-full bg-black/70 h-[100dvh] top-full",children:[e("div",{className:"absolute w-[272px] bg-white p-4",style:{right:`calc(100% - ${p?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:r?.email?n(J,{children:[e(f,{html:r?.nick_name||G?.welcome,className:"text-sm font-bold"}),e("div",{className:"h-[1px] mt-2 bg-[#D9D9D9]"}),e("div",{className:"mt-2",children:G?.profiles?.map(b=>e(Q,{className:"py-2",label:b?.title,href:b?.url},b.id))})]}):n(J,{children:[e(Ee,{className:"absolute -top-2 text-white right-[46px] z-30"}),e(f,{html:G?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:G?.benefits?.map(b=>n("div",{className:"flex items-center gap-[6px]",children:[e(K,{source:b.benefitIcon?.url,className:"size-4",alt:b.benefit,width:16,height:16}),e(f,{html:b.benefit,className:"text-sm font-bold leading-[1.4]"})]},b.id))}),n("div",{className:"mt-4 flex items-center gap-2",children:[e(H,{variant:"secondary",size:"lg",onClick:()=>x?.join?.(),children:e(f,{html:G?.primaryButton||"Join Now",className:"font-bold"})}),e(H,{variant:"primary",size:"lg",onClick:()=>x?.login?.(),children:e(f,{html:G?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),e("div",{className:"flex-1 bg-transparent",onClick:()=>g(!1)})]})]})}),Re=xe.memo(({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{buildProps:l}=O(),[o,s]=D([]),[c,x]=D(-1),r=R(null),v=_(()=>{const u=t?.subcategories;if(!u?.length)return;const d=u.findIndex(i=>!!i?.subSubCategories),m=u.findIndex(i=>!i?.subSubCategories),p=u.map((i,g)=>({index:g,open:d===g||m===g}));s(p)},[t]);E(()=>{v()},[v]);const h=M(()=>{const u=t?.subcategories?.[o?.find(m=>m.open)?.index||0],d=a?.find(m=>m?.label?.toLowerCase()===u?.label?.toLowerCase())||{};if(u?.collections){const m=l?.categories?.[u?.collections]||{};return{label:d?.label,isCollection:!0,banner:d?.banner,primary:d?.primary,series:[{products:m?.products}]}}else if(u?.subSubCategories){const m=u?.subSubCategories?.[c],p=a?.find(i=>i?.label?.toLowerCase()===m?.label?.toLowerCase())||{};if(m?.collections){const i=l?.categories?.[m?.collections]||{};return{label:p?.label,isCollection:!0,banner:p?.banner,primary:p?.primary,series:[{products:i?.products}]}}else return p}else return d},[t,o,c,a]),L=_((u,d)=>{if(d?.subSubCategories?.length>0?x(0):x(-1),d?.subSubCategories?.length>0)s(m=>m.map(p=>p.index===u?{...p,open:!0}:{...p,open:!1}));else{const p=t?.subcategories?.findIndex(i=>!!i?.subSubCategories);s(i=>i.map(g=>({...g,open:g.index===u||g.index===p})))}},[t,v]),y=(u,d)=>{s(m=>m.map(p=>p.index===u?{...p,open:!0}:{...p,open:!1})),x(d)};return n(Y,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[n("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:r,children:[e("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((u,d)=>{const m=Array.isArray(u?.subSubCategories)&&u?.subSubCategories?.length>0;return n("div",{children:[n("div",{className:N("flex cursor-pointer items-center justify-between",{"bg-[#F5F5F7]":!m&&o?.find(p=>p.index===d)?.open}),onClick:()=>{L(d,u)},children:[e(f,{html:u.label,className:"p-4 text-sm font-bold leading-[1.4]"}),m&&e(Z,{className:N("size-4",{"rotate-180":o?.find(p=>p.index===d)?.open})})]}),o?.find(p=>p.index===d)?.open&&e("div",{className:"flex flex-col",children:u.subSubCategories?.map((p,i)=>e(f,{html:p.label,onClick:()=>y(d,i),className:N("cursor-pointer hover:bg-[#F5F5F7] px-6 py-4 text-sm font-bold leading-[1.4] text-[#6D6D6F]",{"bg-[#F5F5F7]":c===i})},`subSubItem-${d}-${i}`))})]},`subcategoryItem-${d}`)})}),t&&e("div",{className:"flex",children:n("div",{className:"flex flex-col gap-4",children:[t?.primary&&e(H,{as:"a",href:t?.primary?.url,variant:"primary",size:"lg",className:"text-sm lg-desktop:text-base",children:t?.primary?.label}),t?.secondary&&e(H,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"justify-start !p-0 text-sm lg-desktop:text-base",children:t?.secondary?.label})]})})]}),n("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(h).length>0&&n("div",{className:"mb-4 flex items-center justify-between",children:[n("div",{className:"flex items-center gap-2",children:[e(f,{html:h?.label,className:"text-xl lg-desktop:text-2xl font-bold leading-[1.4]"}),h?.primary&&e(H,{as:"a",href:h?.primary?.url,variant:"link",size:"lg",className:"justify-start !p-0 text-sm lg-desktop:text-base font-bold leading-[1.2] no-underline",children:h?.primary?.label})]}),e(j,{href:h?.guide?.url,className:"text-sm lg-desktop:text-base leading-[1.2] text-[#6D6D6F]",children:h?.guide?.label})]}),e("div",{className:"flex flex-col gap-4 overflow-y-auto h-[426px]",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:h?.series?.map((u,d)=>n("div",{children:[u.label&&e(f,{html:u.label,className:"text-sm mb-2 font-bold leading-[1.4] text-[#6D6D6F]"}),n("div",{className:"grid grid-cols-3 gap-4",children:[!!h?.banner&&e(j,{asChild:!h?.banner?.href,href:h?.banner?.href,children:n("div",{className:"relative [&_img]:hover:scale-105 [&_img]:hover:transition-all [&_img]:hover:duration-300",children:[e(K,{source:h?.banner?.imageUrl,className:"h-[114px] laptop:h-[120px]",imgClassName:"object-cover h-full"}),n("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:[e(oe,{size:2,html:h?.banner?.title||"Buy in Guide",className:"font-bold text-white"}),e(f,{html:h?.banner?.desc||"20.000mAh",className:"text-sm text-white font-bold"})]})]})}),u.products?.map((m,p)=>e(ue,{product:m,isCollection:h?.isCollection},`seriesProductItem-${p}`))]})]},`seriesItem-${d}`))})]})]})}),Ae=({multicolMetadata:t})=>{const a=R(null);return e("div",{ref:a,children:e(Y,{childClassName:"bg-white",className:"h-full",children:e("div",{className:"flex gap-4 py-4",children:t?.map((l,o)=>e("div",{className:"w-1/4",children:e(me,{item:l})},`multicolItem-${l?.label}-${o}`))})})})},$e=({supportsMetadata:t,currentNavItemRef:a})=>{const l=R(null),[o,s]=D(null),[c,x]=D(0);E(()=>{if(l?.current){const v=l?.current?.getBoundingClientRect();x(v.height)}},[l]);const r=Se(()=>{if(a){const v=a.getBoundingClientRect();s(v)}},500);return E(()=>(r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[r]),E(()=>{if(a){const v=a.getBoundingClientRect();s(v)}},[a]),e("div",{className:"absolute top-0 h-full bg-white transition-all duration-500 overflow-hidden",style:{right:`calc(100% - ${o?.right}px)`,height:c},children:e("div",{ref:l,className:"p-4",children:t?.map(v=>e("div",{className:"py-2",children:e(j,{href:v.url,className:"text-sm font-bold leading-[1.4] no-underline",children:v.label})},v.id))})})},ue=({product:t,isCollection:a})=>{const{buildProps:l}=O();let o=a?t:l?.products?.find(r=>r.handle===t.handle);const s=o?.variants?.find(r=>r.sku===t.sku)||o?.variants?.[0],c=M(()=>`/products/${o?.handle}?variant=${we(s?.id)}`,[o?.handle,s?.id]),x=M(()=>o?.tags?.filter?.(r=>r?.startsWith?.("CLtag"))?.map?.(r=>r?.replace?.("CLtag:",""))?.slice?.(0,2),[o?.tags]);return s?.availableForSale?n("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-105",children:[e("div",{className:"shrink-0",children:e(K,{source:`${s?.image?.url||t?.images?.[0]?.url}}`,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),n("div",{className:"relative",children:[e("div",{className:"flex gap-1",children:Array.isArray(x)&&x?.map(r=>e(f,{as:"p",html:r,className:"text-brand-0 whitespace-nowrap mb-1 inline-block h-[24px] rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"}))}),e(j,{href:c,className:"no-underline hover:text-current",children:e(f,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:o?.title||t?.name})}),t?.desc&&e(f,{as:"p",html:t?.desc,className:"lg-desktop:text-sm line-clamp-1 mt-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]}):null},me=({item:t,allPicture:a})=>n(J,{children:[t?.columns&&n(J,{children:[e(f,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),e("div",{className:"mt-2 flex flex-col",children:t.columns?.map(l=>n("div",{className:"py-2 flex items-center gap-1",children:[e(j,{href:l.url,className:"text-sm font-bold leading-[1.4] no-underline",children:l.label}),l?.badge&&e(f,{as:"p",html:l?.badge||"badge",className:"text-sm font-bold !leading-[24px] text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px]"})]},l.label))})]}),t?.imageUrl&&n("div",{className:N("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] h-[240px] max-w-[358px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative overflow-hidden",{"tablet:max-w-none laptop:max-w-none":a}),children:[e(K,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),n(j,{href:t.url,className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[e(f,{html:t.title,className:N("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":t?.theme==="dark"})}),t.subtitle&&e(f,{html:t.subtitle,className:N("text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"})}),t?.primary?.label&&e(H,{as:"a",href:t?.primary?.url,variant:"link",size:"lg",className:N("text-sm font-bold mr-auto !p-0 leading-[1.4] text-white",{"text-black":t?.theme==="dark"}),children:t?.primary?.label||"more"})]})]})]}),je=X(({data:t,className:a},l)=>{const o=M(()=>ce(t?.categories?.filter(w=>w?.mobileShow)),[t]),{currentMenu:s,setCurrentMenu:c,subSubCategory:x}=O(),[r,v]=D(!1),[h,L]=D(0),[y,u]=D(null),d=R(null);E(()=>{if(d?.current&&r){const w=d?.current?.getBoundingClientRect();L(window?.innerHeight-(w?.bottom||0))}},[r]),ne(()=>{le.fromTo(d.current,{height:0},{height:h,duration:.3})},[h]),E(()=>{document.documentElement.style.overflow=r?"hidden":"auto"},[r]);const m=M(()=>y?.components?.[0]?.blockType,[y]),p=re(Oe,{categoriesItem:y}),i=se(Ie,y),g=ie(_e,y),S=M(()=>{switch(m){case F.Sidebar:return e(i,{});case F.Supports:return e(p,{});case F.Multicol:return e(g,{});default:return null}},[m,y,p]),C=_(()=>{v(!1),L(0),c&&c(T.Primary)},[v,L,c]),P=M(()=>t?.headerBar?.actions?.filter(w=>w?.mobileShow&&w?.blockType!==I.Profile),[t]),k=M(()=>t?.headerBar?.actions?.find(w=>w?.mobileShow&&w?.blockType===I.Profile)||{},[t]),A=M(()=>{switch(s){case T.Primary:return e(Ue,{actions:P,menuOpen:r,onMenuOpenClose:()=>{v(!1),L(0)},onMenuOpenClick:()=>v(!0)});case T.Secondary:return e(ge,{title:y?.text,onMenuOpenClose:C,onMenuBackClick:()=>c?.(T.Primary)});case T.Third:return e(ge,{title:x?.label,onMenuOpenClose:C,onMenuBackClick:()=>c?.(T.Secondary)});default:return null}},[r,s,c,y,P,x,C]),W=_((w,ee)=>{const U=Array.isArray(o)?Array.isArray(o[w])?o[w][ee]:{}:{};u(U),U?.components?.[0]?.blockType===F.Links?U?.components?.[0]?.url&&window.open(U?.components?.[0]?.url):c?.(T.Secondary)},[o,c]);return n(Y,{className:N("relative h-[52px]",a),children:[A,r&&e("div",{ref:d,className:"absolute left-0 top-full text-black border-t border-[#E5E5E7] z-[999] w-full overflow-y-auto bg-white",style:{height:h},children:s===T.Primary?e(Fe,{categories:o,onPrimaryMenuClick:W,profileAction:k}):S})]})}),Fe=({categories:t,onPrimaryMenuClick:a,profileAction:l})=>n("div",{className:"flex h-full flex-col justify-between",children:[e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((o,s)=>n("div",{className:"",children:[o?.map((c,x)=>e(Q,{label:c.text,onClick:()=>a(s,x),icon:c.components?.[0]?.icon},c.id)),e("div",{className:N("my-2 h-px w-full bg-[#E5E5E7]",{hidden:s===t.length-1})})]},`groupCategory-${s}`))}),e(We,{profileAction:l})]}),Ie=({sidebarCategoriesMetadata:t,seriesMetadata:a})=>{const{currentMenu:l,setCurrentMenu:o,subSubCategory:s,setSubSubCategory:c,setCurrentSeriesMetadata:x,currentSeriesMetadata:r,buildProps:v}=O(),[h,L]=D([]),[y,u]=D([]);E(()=>{t?.subcategories?.length&&L(t?.subcategories?.map((i,g)=>({index:g,open:!1})))},[t]),E(()=>{s?.subSubCategories?.length&&u(s?.subSubCategories?.map((i,g)=>({index:g,open:g===0})))},[s]);const d=_((i,g)=>{o&&o(T.Third),c?.(i);const S=a?.find(C=>g!==void 0?i?.subSubCategories?.[g]?.label?.toLowerCase()===C.label?.toLowerCase():i?.label?.toLowerCase()===C.label?.toLowerCase())||{};if(i?.collections){const C=v?.categories?.[i?.collections]||{};x?.({label:S?.label,isCollection:!0,banner:S?.banner,primary:S?.primary,series:[{products:C?.products}]})}else x?.(S)},[a,t,o,c,x]),m=M(()=>a?.find(i=>!!i?.guide)?.guide,[a,t]);return M(()=>{switch(l){case T.Secondary:return n("div",{className:"tablet:px-8 laptop:px-16 flex h-full flex-col justify-between tablet:justify-start tablet:gap-16 p-4",children:[e("div",{children:t?.subcategories?.map((i,g)=>e("div",{children:e(Q,{label:i?.label,active:h.find(S=>S.index===g)?.open,onClick:()=>{d(i)}})},`${i.label}-${g}`))}),n("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&e(H,{as:"a",href:t?.primary?.url,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&e(H,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case T.Third:return n("div",{className:"tablet:px-8 laptop:px-16 p-4",children:[s?.subSubCategories?s?.subSubCategories?.map((i,g)=>{const S=a?.find(P=>P.label.toLowerCase()===i?.label?.toLowerCase())||{};let C={};if(i?.collections){const P=v?.categories?.[i?.collections]||{};C={label:S?.label,isCollection:!0,banner:S?.banner,primary:S?.primary,series:[{products:P?.products}]}}else C=S;return n("div",{children:[Reflect.ownKeys(i).length>0&&e(pe,{matchSeriesMetadata:C,onSubSubCategoryItemClick:()=>u(P=>P.map((k,A)=>({...k,open:A===g}))),expanded:!!y?.find(P=>P.index===g)?.open}),y?.find(P=>P.index===g)?.open&&n(J,{children:[e(be,{matchSeriesMetadata:C}),C?.primary&&e("div",{className:"text-center my-4",children:e(H,{as:"a",href:C?.primary?.url,className:"text-base no-underline leading-[1.2]",variant:"secondary",size:"base",children:C?.primary?.label})})]})]},`${i.label}-${g}`)}):n(J,{children:[Reflect.ownKeys(r).length>0&&e(pe,{matchSeriesMetadata:r}),e(be,{matchSeriesMetadata:r}),r?.primary&&e("div",{className:"text-center my-4 ",children:e(H,{as:"a",href:r?.primary?.url,variant:"secondary",size:"base",className:"text-base no-underline leading-[1.2]",children:r?.primary?.label})})]}),m&&e(j,{href:m?.url,children:e("div",{className:"mt-4",children:e(f,{html:m?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]});default:return null}},[l,t,o,a,h,y,c,s,x,r])},pe=({matchSeriesMetadata:t,onSubSubCategoryItemClick:a,expanded:l})=>n("div",{className:"tablet:pt-0 py-4 flex items-center justify-between",onClick:a,children:[t?.label&&e(f,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),a&&e(Z,{className:N("size-5",{"rotate-180":l})})]}),be=({matchSeriesMetadata:t})=>e("div",{className:"flex flex-col gap-2 laptop:gap-3",children:!!t?.series?.length&&t?.series?.map((a,l)=>n("div",{children:[a.label&&e(f,{html:a.label,className:"text-sm mb-2 font-bold leading-[1.4] text-[#3D3D3F]"}),n("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&e(j,{asChild:!t?.banner?.href,href:t?.banner?.href,children:n("div",{className:"relative [&_img]:hover:scale-105 [&_img]:hover:transition-all [&_img]:hover:duration-300",children:[e(K,{source:t?.banner?.imageUrl,className:"h-[114px] laptop:h-[120px]",imgClassName:"object-cover h-full"}),n("div",{className:"absolute bottom-0 left-0 right-0 p-4",children:[e(oe,{size:2,html:t?.banner?.title||"Buy in Guide",className:N("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),e(f,{html:t?.banner?.desc||"20.000mAh",className:N("text-sm text-white font-bold",{"text-black":t?.banner?.theme==="dark"})})]})]})}),a.products?.map((o,s)=>e(ue,{product:o,isCollection:t?.isCollection},`seriesProductItem-${l}-${s}`))]})]},`seriesItem-${l}`))}),Oe=({supportsMetadata:t})=>e("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(a=>e(Q,{href:a.url,label:a.label,onClick:()=>{}},a.id))}),_e=({multicolMetadata:t})=>{const a=M(()=>!t?.some(l=>!!l.columns),[t]);return e("div",{className:N("tablet:py-4 tablet:px-8 laptop:px-16 flex flex-col gap-4 tablet:gap-6 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":a}),children:t?.map((l,o)=>e("div",{children:e(me,{item:l,allPicture:a})},`multicolItem-${l?.label}-${o}`))})},We=({profileAction:t})=>{const[a,l]=D(!1),{profile:o,event:s}=O();return n("div",{className:N("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":a}),children:[n("div",{className:"flex items-center justify-between",onClick:()=>l(!a),children:[n("div",{className:"flex items-center gap-[14px]",children:[e("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:e(Le,{})}),e(f,{html:o?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!o?.email&&e(Z,{className:N("size-5 laptop:size-4",{"rotate-180":a})})]}),o?.email&&e("div",{className:"mt-4",children:t?.profiles?.map(c=>e(Q,{label:c?.title,href:c?.url},c.id))}),a&&!o?.email&&n("div",{className:"mt-4",children:[e(f,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),e("div",{className:"mt-2 flex flex-col gap-1",children:t?.benefits?.map(c=>n("div",{className:"flex items-center gap-[6px]",children:[e(K,{source:c.benefitIcon?.url,className:"size-4",alt:c.benefit,width:16,height:16}),e(f,{html:c.benefit,className:"text-sm font-bold leading-[1.4]"})]},c.id))})]}),!o?.email&&n("div",{className:"mt-4 flex items-center gap-3",children:[e(H,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>s?.join?.(),children:e(f,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),e(H,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>s?.login?.(),children:e(f,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Ue=({menuOpen:t,onMenuOpenClose:a,onMenuOpenClick:l,actions:o})=>n("div",{className:"flex h-full items-center justify-between gap-4",children:[e(fe,{}),n("div",{className:"desktop:gap-6 flex items-center gap-4",children:[e(ve,{actions:o}),t?e(de,{className:"size-5",onClick:()=>a()}):e(De,{className:"size-5",onClick:()=>l()})]})]}),fe=()=>{const{payloadData:t,isMobile:a}=O();return e("div",{className:"[&>svg]:w-full hover:text-brand-0 cursor-pointer",onClick:()=>{window.location.href="/"},dangerouslySetInnerHTML:{__html:a?t?.headerBar?.mobileLogo:t?.headerBar?.desktopLogo}})},ve=X(({actions:t,activeStatus:a=!1},l)=>{const{event:o}=O(),[s,c]=D(null),x=_((r,v)=>{switch(c(v),r?.blockType){case I.Search:o?.search?.();break;case I.Cart:o?.cart?.();break;case I.Profile:o?.profile?.();break;case I.Livestream:o?.livestream?.();break;default:return()=>{}}},[o]);return e("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map((r,v)=>e("div",{ref:r.blockType===I.Profile?l:null,onClick:()=>x(r,v),children:e(f,{html:r.icon,className:N("cursor-pointer size-5",{"text-brand-0":a&&s===v})})},r.id))})}),ge=({title:t,onMenuOpenClose:a,onMenuBackClick:l})=>n("div",{className:"flex h-full items-center gap-3",children:[e(ze,{className:"size-5",onClick:()=>l()}),e(f,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),e(de,{className:"size-5",onClick:()=>a()})]}),Q=({label:t,href:a,onClick:l,active:o,icon:s,className:c})=>e("div",{className:N("flex cursor-pointer items-center justify-between py-4",c),onClick:l,children:n(j,{href:a,asChild:!a,className:"flex w-full items-center justify-between no-underline",children:[n("div",{className:"flex items-center gap-4",children:[e(f,{html:t,className:N("text-sm font-bold leading-[1.4]",{underline:s})}),s&&e(f,{html:s})]}),e(Pe,{className:N("size-5 laptop:size-4",{"rotate-90":o})})]})});var it=ke(Be);export{it as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|