@anker-in/headless-ui 1.3.7 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  2. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +2 -2
  3. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +5 -1
  4. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  5. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  6. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.d.ts +13 -0
  7. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js +2 -0
  8. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js.map +7 -0
  9. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.d.ts +6 -8
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  15. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
  16. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
  17. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  18. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  19. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  20. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.d.ts +11 -0
  21. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js +2 -0
  22. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js.map +7 -0
  23. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  24. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  25. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js +1 -1
  26. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js.map +2 -2
  27. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  28. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  29. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  30. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  31. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  32. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  33. package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.d.ts +9 -0
  34. package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.js +2 -0
  35. package/dist/cjs/biz-components/Listing/components/SlideUpModal/index.js.map +7 -0
  36. package/dist/cjs/biz-components/Listing/const.d.ts +11 -0
  37. package/dist/cjs/biz-components/Listing/const.js +1 -1
  38. package/dist/cjs/biz-components/Listing/const.js.map +3 -3
  39. package/dist/cjs/biz-components/Listing/hooks/useComponentData.d.ts +1 -0
  40. package/dist/cjs/biz-components/Listing/hooks/useComponentData.js +2 -0
  41. package/dist/cjs/biz-components/Listing/hooks/useComponentData.js.map +7 -0
  42. package/dist/cjs/biz-components/index.d.ts +5 -1
  43. package/dist/cjs/biz-components/index.js +1 -1
  44. package/dist/cjs/biz-components/index.js.map +3 -3
  45. package/dist/cjs/components/Countdown.js +1 -1
  46. package/dist/cjs/components/Countdown.js.map +3 -3
  47. package/dist/cjs/components/tabs.js +1 -1
  48. package/dist/cjs/components/tabs.js.map +3 -3
  49. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  50. package/dist/esm/biz-components/AnchorNavigation/index.js.map +2 -2
  51. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +5 -1
  52. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  53. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  54. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.d.ts +13 -0
  55. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js +2 -0
  56. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js.map +7 -0
  57. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  58. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  59. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.d.ts +6 -8
  60. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  61. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
  62. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  63. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
  64. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
  65. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  66. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  67. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  68. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.d.ts +11 -0
  69. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js +2 -0
  70. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js.map +7 -0
  71. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  72. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  73. package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js +1 -1
  74. package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.js.map +2 -2
  75. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  76. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  77. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  78. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  79. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  80. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  81. package/dist/esm/biz-components/Listing/components/SlideUpModal/index.d.ts +9 -0
  82. package/dist/esm/biz-components/Listing/components/SlideUpModal/index.js +2 -0
  83. package/dist/esm/biz-components/Listing/components/SlideUpModal/index.js.map +7 -0
  84. package/dist/esm/biz-components/Listing/const.d.ts +11 -0
  85. package/dist/esm/biz-components/Listing/const.js +1 -1
  86. package/dist/esm/biz-components/Listing/const.js.map +3 -3
  87. package/dist/esm/biz-components/Listing/hooks/useComponentData.d.ts +1 -0
  88. package/dist/esm/biz-components/Listing/hooks/useComponentData.js +2 -0
  89. package/dist/esm/biz-components/Listing/hooks/useComponentData.js.map +7 -0
  90. package/dist/esm/biz-components/index.d.ts +5 -1
  91. package/dist/esm/biz-components/index.js +1 -1
  92. package/dist/esm/biz-components/index.js.map +3 -3
  93. package/dist/esm/components/Countdown.js +1 -1
  94. package/dist/esm/components/Countdown.js.map +3 -3
  95. package/dist/esm/components/tabs.js +1 -1
  96. package/dist/esm/components/tabs.js.map +3 -3
  97. package/package.json +1 -1
  98. package/style.css +39 -3
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/biz-components/index.ts"],
4
- "sourcesContent": ["export { default as ActivitySchedule } from './ActivitySchedule/index.js'\nexport type { ActivityScheduleProps, ActivityScheduleData, ActivityScheduleItem } from './ActivitySchedule/types.js'\nexport { default as GiftShelf } from './GiftShelf/index.js'\nexport type {\n GiftShelfProps,\n GiftShelfData,\n GiftShelfItem,\n CountdownConfig,\n ResponsiveBackgroundImage as GiftShelfResponsiveBackgroundImage,\n} from './GiftShelf/types.js'\nexport { default as GiftTierShelf } from './GiftTierShelf/index.js'\nexport type { GiftTierShelfProps, GiftTierShelfData, GiftTierItem, GiftTierProduct } from './GiftTierShelf/types.js'\nexport { default as ActivityMechanism } from './ActivityMechanism/index.js'\nexport type {\n ActivityMechanismProps,\n ActivityMechanismItem,\n ActivityMechanismSemanticName,\n ResponsiveBackgroundImage,\n} from './ActivityMechanism/types.js'\nexport { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as MarqueeReview } from './MarqueeReview/index.js'\nexport type { MarqueeReviewProps, MarqueeReviewData, ReviewItem } from './MarqueeReview/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n\nexport { default as BizProductProvider } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductBenefits } from './Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductExchangePurchase } from './Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductCoupon } from './Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js'\nexport { default as ProductBanner } from './Listing/components/ProductCard/ProductDetail/ProductBanner/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\nexport { default as ProductPaidShipping } from './Listing/components/ProductCard/ProductPaidShipping/index.js'\n\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\nexport { default as BrandCardLink } from './BrandCardLink/index.js'\nexport type { BrandCardLinkProps, BrandCardLinkItemProps } from './BrandCardLink/types.js'\n\nexport * as IPRedirect from './IPRedirect/index.js'\n\nexport { default as WheelLottery } from './WheelLottery/index.js'\nexport type {\n WheelLotteryProps,\n WheelLotteryHandle,\n Prize,\n ChanceMethod,\n WinningInfo,\n UserData,\n} from './WheelLottery/types.js'\nexport { default as ProductLottery } from './ProductLottery/index.js'\nexport type { ProductLotteryProps, ProductLotteryHandle, MediaConfig, CtaButtonConfig } from './ProductLottery/types.js'\nexport { default as ProductCompare } from './ProductCompare/index.js'\nexport type { ProductCompareProps, ProductItemData } from './ProductCompare/index.js'\nexport { default as Ksp } from './Ksp/index.js'\nexport type { KspProps, KspData, KspCardItem } from './Ksp/index.js'\nexport { default as ImageTextFeature } from './ImageTextFeature/index.js'\nexport type { ImageTextFeatureProps, ImageTextFeatureItem } from './ImageTextFeature/index.js'\nexport { default as FeatureCards } from './FeatureCards/index.js'\nexport type { FeatureCardsProps, FeatureCardItem } from './FeatureCards/index.js'\nexport { default as FeaturedBlogPosts } from './FeaturedBlogPosts/index.js'\nexport type {\n FeaturedBlogPostsProps,\n FeaturedBlogPostsData,\n FeaturedBlogPostItem,\n FeaturedBlogPostSpan,\n} from './FeaturedBlogPosts/index.js'\nexport { default as ImageWithText } from './ImageWithText/index.js'\nexport type { ImageWithTextProps } from './ImageWithText/index.js'\nexport { default as VideoFeature } from './VideoFeature/index.js'\nexport type { VideoFeatureProps } from './VideoFeature/index.js'\nexport { default as TabsWithMedia } from './TabsWithMedia/index.js'\nexport type { TabsWithMediaProps, TabItem, TimeIndex } from './TabsWithMedia/index.js'\nexport { default as TabWithImage } from './TabWithImage/index.js'\nexport type { TabWithImageProps, TabWithImageDataItem } from './TabWithImage/index.js'\nexport { default as FeatureShowcase } from './FeatureShowcase/index.js'\nexport type { FeatureShowcaseProps, FeatureShowcaseItem } from './FeatureShowcase/index.js'\nexport { default as ProductHero } from './ProductHero/index.js'\nexport type { ProductHeroProps } from './ProductHero/index.js'\nexport { default as SpecsComparison } from './SpecsComparison/index.js'\nexport type {\n SpecsComparisonProps,\n SpecsComparisonMenuItem,\n SpecsComparisonLeftMenuItem,\n} from './SpecsComparison/index.js'\nexport { default as MediaSceneSwitcher } from './MediaSceneSwitcher/index.js'\nexport type { MediaSceneSwitcherProps } from './MediaSceneSwitcher/types.js'\nexport { default as MediaSceneSwitcherV2 } from './MediaSceneSwitcherV2/index.js'\nexport type {\n MediaSceneSwitcherV2Props,\n MediaSceneSwitcherV2Data,\n MediaSceneSwitcherV2Item,\n MediaSceneSwitcherV2Layout,\n} from './MediaSceneSwitcherV2/index.js'\nexport { default as ThreeDCarousel } from './ThreeDCarousel/index.js'\nexport type { ThreeDCarouselProps } from './ThreeDCarousel/index.js'\nexport { default as ProductNav } from './ProductNav/index.js'\nexport type { ProductNavProps, TabLink, AnchorItem, BuyButton } from './ProductNav/index.js'\nexport { default as AnchorNavigation } from './AnchorNavigation/index.js'\nexport { default as PromotionalBar } from './PromotionalBar/index.js'\nexport { default as EventSchedule } from './EventSchedule/index.js'\nexport { default as SecondaryBanner } from './SecondaryBanner/index.js'\nexport { default as BuyOneGetOneShelf } from './BuyOneGetOneShelf/index.js'\nexport { default as ActiveShelf } from './ActiveShelf/index.js'\nexport { default as MediaShelf } from './MediaShelf/index.js'\nexport { default as CreditsShelf, CreditsProductCard } from './CreditsShelf/index.js'\nexport type {\n CreditsShelfSemanticName,\n CreditsProductCardData,\n CopyConfig as CreditsShelfCopyConfig,\n ButtonFunctionType as CreditsShelfButtonFunctionType,\n} from './CreditsShelf/index.js'\nexport { default as SceneShelf, SceneProductCard } from './SceneShelf/index.js'\nexport type { SceneShelfSemanticName, SceneProductCardData, SceneProductCardSemanticName } from './SceneShelf/index.js'\nexport { default as SceneShelfV2, SceneShelfV2ProductCard } from './SceneShelfV2/index.js'\nexport type {\n SceneShelfV2SemanticName,\n SceneShelfV2Data,\n SceneShelfV2Product,\n SceneShelfV2Props,\n} from './SceneShelfV2/index.js'\nexport { default as SceneShelfV3 } from './SceneShelfV3/index.js'\nexport type { SceneShelfV3Data, SceneShelfV3Props, ProductTab as SceneShelfV3ProductTab } from './SceneShelfV3/index.js'\nexport type {\n SceneShelfV3SemanticName,\n ProductCardData as SceneShelfV3ProductCardData,\n} from './SceneShelfV3/ProductCard.js'\n\nexport { default as MediaEndorsement } from './MediaEndorsement/index.js'\nexport type {\n MediaEndorsementProps,\n MediaEndorsementData,\n MediaEndorsementItem,\n MediaEndorsementSemanticName,\n} from './MediaEndorsement/index.js'\n\nexport { default as MediaTextOverlay } from './MediaTextOverlay/index.js'\nexport type {\n MediaTextOverlayProps,\n MediaTextOverlayData,\n MediaTextOverlayItem,\n MediaTextOverlaySemanticName,\n ResponsiveMedia,\n} from './MediaTextOverlay/index.js'\n\n// Copy configuration types and defaults\nexport type {\n CopyConfig as MediaShelfCopyConfig,\n ButtonFunctionType as MediaShelfButtonFunctionType,\n} from './MediaShelf/types.js'\nexport type { CopyConfig as ActiveShelfCopyConfig, ButtonFunctionType } from './ActiveShelf/types.js'\n\nexport {\n default as ImageOverlayShelf,\n type ButtonFunctionType as ImageOverlayShelfButtonFunctionType,\n} from './ImageOverlayShelf/index.js'\n\nexport { default as ImageTextOverlay } from './ImageTextOverlay/index.js'\nexport type {\n ImageTextOverlayProps,\n ImageTextOverlayData,\n ImageTextOverlayItem,\n ImageTextOverlaySemanticName,\n ImageTextOverlayBackgroundImage,\n} from './ImageTextOverlay/types.js'\n\n// MiniCart \u7EC4\u4EF6\u53CA\u7C7B\u578B\u5BFC\u51FA\nexport { default as MiniCart } from './MiniCart/index.js'\nexport type { Cart, CartLineItem, MiniCartData, MiniCartProps, CircleProgressConfig } from './MiniCart/index.js'\nexport { default as MiniCartCircleProgress } from './MiniCart/CircleProgress.js'\nexport type { CircleProgressProps as MiniCartCircleProgressProps } from './MiniCart/CircleProgress.js'\nexport { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js'\nexport type {\n MiniCartDialogProps,\n MiniCartDialogCopy,\n MiniCartDialogSemanticName,\n CartData,\n} from './MiniCart/MiniCartDialog.js'\n\n// \u2500\u2500\u2500 Web Push \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nexport { default as WebPushPopup } from './WebPushPopup/index.js'\nexport type { WebPushPopupProps } from './WebPushPopup/index.js'\nexport { useEmarsysWebPush } from '../hooks/useEmarsysWebPush.js'\nexport type {\n UseEmarsysWebPushOptions,\n UseEmarsysWebPushReturn,\n EmarsysContactInfo,\n EmarsysInitConfig,\n} from '../hooks/useEmarsysWebPush.js'\n\n/**\n * \u7EC4\u4EF6\u6620\u5C04\u5BF9\u8C61\n */\n\nexport const PAYLOAD_COMPONENT_MAP = {\n 'ipc-accordioncards': 'AccordionCards',\n 'ipc-aplusdesc': 'AplusDesc',\n 'ipc-banner': 'HeroBanner',\n 'ipc-brand-equity': 'BrandEquity',\n 'ipc-category': 'Category',\n 'ipc-collection-banner': 'CollectionBanner',\n 'ipc-collection-shelves': 'CollectionShelves',\n 'ipc-creativemodule': 'CreativeModule',\n 'ipc-download': 'DownLoad',\n 'ipc-evaluate': 'Evaluate',\n 'ipc-faq': 'Faq',\n 'ipc-features': 'Features',\n 'ipc-footcharger': 'FootCharger',\n 'ipc-ga-block': 'GraphicAttractionBlock',\n 'ipc-giftbox': 'GiftBox',\n 'ipc-giftshelf': 'GiftShelf',\n 'ipc-graphic': 'Graphic',\n 'ipc-graphicmore': 'GraphicMore',\n 'ipc-graphicoverlay': 'GraphicOverlay',\n 'ipc-marquee': 'Marquee',\n 'ipc-mediaplayerbase': 'MediaPlayerBase',\n 'ipc-mediaplayermulti': 'MediaPlayerMulti',\n 'ipc-mediaplayersticky': 'MediaPlayerSticky',\n 'ipc-member-equity': 'MemberEquity',\n 'ipc-mlg-block': 'MultiLayoutGraphicBlock',\n 'ipc-search-page-tabs': 'SearchPageBlock',\n 'ipc-selectstore': 'SelectStore',\n 'ipc-shelfdisplay': 'ShelfDisplay',\n 'ipc-slogan': 'Slogan',\n 'ipc-spacer': 'Spacer',\n 'ipc-specs': 'Specs',\n 'ipc-tabs': 'TabsBlock',\n 'ipc-text-marquee': 'TextMarquee',\n 'ipc-title': 'Title',\n 'ipc-whychoose': 'WhyChoose',\n 'ipc-product-nav': 'ProductNav',\n 'ipc-brand-card-link': 'BrandCardLink',\n 'ipc-ipredirect': 'IPRedirect',\n ksp: 'Ksp',\n 'ipc-secondary-banner': 'SecondaryBanner',\n /**\n * \u6D3B\u52A8\u8D27\u67B6\n */\n 'ipc-active-shelf': 'ActiveShelf',\n 'ipc-media-shelf': 'MediaShelf',\n /**\n * \u6D3B\u52A8\u4E70\u8D60\u8D27\u67B6\n */\n 'ipc-bogo-shelf': 'BuyOneGetOneShelf',\n 'ipc-media-endorsement': 'MediaEndorsement',\n 'ipc-media-scene-switcher-v2': 'MediaSceneSwitcherV2',\n 'ipc-featured-blog-posts': 'FeaturedBlogPosts',\n}\n"],
5
- "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,khCAAAE,GAAA,2xBAAAC,GAAA,66CAAAC,GAAAJ,IAAA,IAAAK,EAA4C,0CAE5CC,EAAqC,mCAQrCC,EAAyC,uCAEzCC,EAA6C,2CAO7CC,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,gCAClCC,EAAwC,sCACxCC,EAAoC,kCACpCC,EAAoC,kCACpCC,EAAsC,oCACtCC,EAA0C,wCAC1CC,EAAmC,iCACnCC,EAA2C,yCAC3CC,EAA6C,2CAC7CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAyC,uCAEzCC,EAAqC,mCACrCC,EAA+B,6BAC/BH,EAAqE,8BACrEI,EAAmD,iDAEnDC,EAAkD,gDAElDC,EAA4C,0CAC5CC,EAA4C,0CAC5CC,EAAsC,oCAEtCC,EAAmD,iCAEnDC,EAA2B,+BAC3BC,EAAwC,sCACxCC,EAAgC,8BAChCC,EAA0C,wCAC1CC,EAA0C,wCAC1CC,EAAiC,+BACjCC,EAAoC,mCAEpCC,EAA8C,8CAC9CC,EAAuC,wDACvCC,EAA0C,uEAE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gB,WAChB,kBAAmB,cACnB,eAAgB,yBAChB,cAAe,UACf,gBAAiB,YACjB,cAAe,UACf,kBAAmB,cACnB,qBAAsB,iBACtB,cAAe,UACf,sBAAuB,kBACvB,uBAAwB,mBACxB,wBAAyB,oBACzB,oBAAqB,eACrB,gBAAiB,0BACjB,uBAAwB,kBACxB,kBAAmB,cACnB,mBAAoB,eACpB,aAAc,SACd,aAAc,SACd,YAAa,QACb,WAAY,YACZ,mBAAoB,cACpB,YAAa,QACb,gBAAiB,YACjB,kBAAmB,aACnB,sBAAuB,gBACvB,iBAAkB,aAClB,IAAK,MACL,uBAAwB,kBAIxB,mBAAoB,cACpB,kBAAmB,aAInB,iBAAkB,oBAClB,wBAAyB,mBACzB,8BAA+B,uBAC/B,0BAA2B,mBAC7B",
6
- "names": ["biz_components_exports", "__export", "IPRedirect", "PAYLOAD_COMPONENT_MAP", "__toCommonJS", "import_ActivitySchedule", "import_GiftShelf", "import_GiftTierShelf", "import_ActivityMechanism", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_MarqueeReview", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_HeaderNavigation", "import_FooterNavigation", "import_SearchPage", "import_types", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay", "import_Specs", "import_TabsGroup", "import_BizProductProvider", "import_PurchaseBar", "import_ProductActions", "import_ProductCard", "import_ProductBenefitsTabs", "import_ProductBenefits", "import_ProductHighlight", "import_ProductFreeGift", "import_ProductExchangePurchase", "import_ProductOptions", "import_ProductBundle", "import_ProductCoupon", "import_ProductBanner", "import_ProductGridBox", "import_ProductGallery", "import_ProductDetail", "import_ProductSummary", "import_BenefitsTab", "import_PaidShipping", "import_ProductPaidShipping", "import_GraphicMore", "import_Features", "import_AplusDesc", "import_GiftBox", "import_SelectStore", "import_DownLoad", "import_FootCharger", "import_BrandCardLink", "import_WheelLottery", "import_ProductLottery", "import_ProductCompare", "import_Ksp", "import_ImageTextFeature", "import_FeatureCards", "import_FeaturedBlogPosts", "import_ImageWithText", "import_VideoFeature", "import_TabsWithMedia", "import_TabWithImage", "import_FeatureShowcase", "import_ProductHero", "import_SpecsComparison", "import_MediaSceneSwitcher", "import_MediaSceneSwitcherV2", "import_ThreeDCarousel", "import_ProductNav", "import_AnchorNavigation", "import_PromotionalBar", "import_EventSchedule", "import_SecondaryBanner", "import_BuyOneGetOneShelf", "import_ActiveShelf", "import_MediaShelf", "import_CreditsShelf", "import_SceneShelf", "import_SceneShelfV2", "import_SceneShelfV3", "import_MediaEndorsement", "import_MediaTextOverlay", "import_ImageOverlayShelf", "import_ImageTextOverlay", "import_MiniCart", "import_CircleProgress", "import_MiniCartDialog", "import_WebPushPopup", "import_useEmarsysWebPush"]
4
+ "sourcesContent": ["export { default as ActivitySchedule } from './ActivitySchedule/index.js'\nexport type { ActivityScheduleProps, ActivityScheduleData, ActivityScheduleItem } from './ActivitySchedule/types.js'\nexport { default as GiftShelf } from './GiftShelf/index.js'\nexport type {\n GiftShelfProps,\n GiftShelfData,\n GiftShelfItem,\n CountdownConfig,\n ResponsiveBackgroundImage as GiftShelfResponsiveBackgroundImage,\n} from './GiftShelf/types.js'\nexport { default as GiftTierShelf } from './GiftTierShelf/index.js'\nexport type { GiftTierShelfProps, GiftTierShelfData, GiftTierItem, GiftTierProduct } from './GiftTierShelf/types.js'\nexport { default as ActivityMechanism } from './ActivityMechanism/index.js'\nexport type {\n ActivityMechanismProps,\n ActivityMechanismItem,\n ActivityMechanismSemanticName,\n ResponsiveBackgroundImage,\n} from './ActivityMechanism/types.js'\nexport { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as MarqueeReview } from './MarqueeReview/index.js'\nexport type { MarqueeReviewProps, MarqueeReviewData, ReviewItem } from './MarqueeReview/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n\nexport { default as BizProductProvider, useBizProductContext } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductBenefits } from './Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductExchangePurchase } from './Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductCoupon } from './Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js'\nexport { default as ProductBanner } from './Listing/components/ProductCard/ProductDetail/ProductBanner/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\nexport { default as CartActionButtons } from './Listing/components/CartActionButtons/index.js'\nexport type { CartActionButtonsProps } from './Listing/components/CartActionButtons/index.js'\nexport { default as ProductServiceBenefits } from './Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js'\nexport type {\n ProductServiceBenefitsProps,\n ServiceBenefitItem,\n} from './Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js'\nexport { default as ProductPaidShipping } from './Listing/components/ProductCard/ProductPaidShipping/index.js'\n\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\nexport { default as BrandCardLink } from './BrandCardLink/index.js'\nexport type { BrandCardLinkProps, BrandCardLinkItemProps } from './BrandCardLink/types.js'\n\nexport * as IPRedirect from './IPRedirect/index.js'\n\nexport { default as WheelLottery } from './WheelLottery/index.js'\nexport type {\n WheelLotteryProps,\n WheelLotteryHandle,\n Prize,\n ChanceMethod,\n WinningInfo,\n UserData,\n} from './WheelLottery/types.js'\nexport { default as ProductLottery } from './ProductLottery/index.js'\nexport type { ProductLotteryProps, ProductLotteryHandle, MediaConfig, CtaButtonConfig } from './ProductLottery/types.js'\nexport { default as ProductCompare } from './ProductCompare/index.js'\nexport type { ProductCompareProps, ProductItemData } from './ProductCompare/index.js'\nexport { default as Ksp } from './Ksp/index.js'\nexport type { KspProps, KspData, KspCardItem } from './Ksp/index.js'\nexport { default as ImageTextFeature } from './ImageTextFeature/index.js'\nexport type { ImageTextFeatureProps, ImageTextFeatureItem } from './ImageTextFeature/index.js'\nexport { default as FeatureCards } from './FeatureCards/index.js'\nexport type { FeatureCardsProps, FeatureCardItem } from './FeatureCards/index.js'\nexport { default as FeaturedBlogPosts } from './FeaturedBlogPosts/index.js'\nexport type {\n FeaturedBlogPostsProps,\n FeaturedBlogPostsData,\n FeaturedBlogPostItem,\n FeaturedBlogPostSpan,\n} from './FeaturedBlogPosts/index.js'\nexport { default as ImageWithText } from './ImageWithText/index.js'\nexport type { ImageWithTextProps } from './ImageWithText/index.js'\nexport { default as VideoFeature } from './VideoFeature/index.js'\nexport type { VideoFeatureProps } from './VideoFeature/index.js'\nexport { default as TabsWithMedia } from './TabsWithMedia/index.js'\nexport type { TabsWithMediaProps, TabItem, TimeIndex } from './TabsWithMedia/index.js'\nexport { default as TabWithImage } from './TabWithImage/index.js'\nexport type { TabWithImageProps, TabWithImageDataItem } from './TabWithImage/index.js'\nexport { default as FeatureShowcase } from './FeatureShowcase/index.js'\nexport type { FeatureShowcaseProps, FeatureShowcaseItem } from './FeatureShowcase/index.js'\nexport { default as ProductHero } from './ProductHero/index.js'\nexport type { ProductHeroProps } from './ProductHero/index.js'\nexport { default as SpecsComparison } from './SpecsComparison/index.js'\nexport type {\n SpecsComparisonProps,\n SpecsComparisonMenuItem,\n SpecsComparisonLeftMenuItem,\n} from './SpecsComparison/index.js'\nexport { default as MediaSceneSwitcher } from './MediaSceneSwitcher/index.js'\nexport type { MediaSceneSwitcherProps } from './MediaSceneSwitcher/types.js'\nexport { default as MediaSceneSwitcherV2 } from './MediaSceneSwitcherV2/index.js'\nexport type {\n MediaSceneSwitcherV2Props,\n MediaSceneSwitcherV2Data,\n MediaSceneSwitcherV2Item,\n MediaSceneSwitcherV2Layout,\n} from './MediaSceneSwitcherV2/index.js'\nexport { default as ThreeDCarousel } from './ThreeDCarousel/index.js'\nexport type { ThreeDCarouselProps } from './ThreeDCarousel/index.js'\nexport { default as ProductNav } from './ProductNav/index.js'\nexport type { ProductNavProps, TabLink, AnchorItem, BuyButton } from './ProductNav/index.js'\nexport { default as AnchorNavigation } from './AnchorNavigation/index.js'\nexport { default as PromotionalBar } from './PromotionalBar/index.js'\nexport { default as EventSchedule } from './EventSchedule/index.js'\nexport { default as SecondaryBanner } from './SecondaryBanner/index.js'\nexport { default as BuyOneGetOneShelf } from './BuyOneGetOneShelf/index.js'\nexport { default as ActiveShelf } from './ActiveShelf/index.js'\nexport { default as MediaShelf } from './MediaShelf/index.js'\nexport { default as CreditsShelf, CreditsProductCard } from './CreditsShelf/index.js'\nexport type {\n CreditsShelfSemanticName,\n CreditsProductCardData,\n CopyConfig as CreditsShelfCopyConfig,\n ButtonFunctionType as CreditsShelfButtonFunctionType,\n} from './CreditsShelf/index.js'\nexport { default as SceneShelf, SceneProductCard } from './SceneShelf/index.js'\nexport type { SceneShelfSemanticName, SceneProductCardData, SceneProductCardSemanticName } from './SceneShelf/index.js'\nexport { default as SceneShelfV2, SceneShelfV2ProductCard } from './SceneShelfV2/index.js'\nexport type {\n SceneShelfV2SemanticName,\n SceneShelfV2Data,\n SceneShelfV2Product,\n SceneShelfV2Props,\n} from './SceneShelfV2/index.js'\nexport { default as SceneShelfV3 } from './SceneShelfV3/index.js'\nexport type { SceneShelfV3Data, SceneShelfV3Props, ProductTab as SceneShelfV3ProductTab } from './SceneShelfV3/index.js'\nexport type {\n SceneShelfV3SemanticName,\n ProductCardData as SceneShelfV3ProductCardData,\n} from './SceneShelfV3/ProductCard.js'\n\nexport { default as MediaEndorsement } from './MediaEndorsement/index.js'\nexport type {\n MediaEndorsementProps,\n MediaEndorsementData,\n MediaEndorsementItem,\n MediaEndorsementSemanticName,\n} from './MediaEndorsement/index.js'\n\nexport { default as MediaTextOverlay } from './MediaTextOverlay/index.js'\nexport type {\n MediaTextOverlayProps,\n MediaTextOverlayData,\n MediaTextOverlayItem,\n MediaTextOverlaySemanticName,\n ResponsiveMedia,\n} from './MediaTextOverlay/index.js'\n\n// Copy configuration types and defaults\nexport type {\n CopyConfig as MediaShelfCopyConfig,\n ButtonFunctionType as MediaShelfButtonFunctionType,\n} from './MediaShelf/types.js'\nexport type { CopyConfig as ActiveShelfCopyConfig, ButtonFunctionType } from './ActiveShelf/types.js'\n\nexport {\n default as ImageOverlayShelf,\n type ButtonFunctionType as ImageOverlayShelfButtonFunctionType,\n} from './ImageOverlayShelf/index.js'\n\nexport { default as ImageTextOverlay } from './ImageTextOverlay/index.js'\nexport type {\n ImageTextOverlayProps,\n ImageTextOverlayData,\n ImageTextOverlayItem,\n ImageTextOverlaySemanticName,\n ImageTextOverlayBackgroundImage,\n} from './ImageTextOverlay/types.js'\n\n// MiniCart \u7EC4\u4EF6\u53CA\u7C7B\u578B\u5BFC\u51FA\nexport { default as MiniCart } from './MiniCart/index.js'\nexport type { Cart, CartLineItem, MiniCartData, MiniCartProps, CircleProgressConfig } from './MiniCart/index.js'\nexport { default as MiniCartCircleProgress } from './MiniCart/CircleProgress.js'\nexport type { CircleProgressProps as MiniCartCircleProgressProps } from './MiniCart/CircleProgress.js'\nexport { default as MiniCartDialog, MiniCartDialog as MiniCartDialogComponent } from './MiniCart/MiniCartDialog.js'\nexport type {\n MiniCartDialogProps,\n MiniCartDialogCopy,\n MiniCartDialogSemanticName,\n CartData,\n} from './MiniCart/MiniCartDialog.js'\n\n// \u2500\u2500\u2500 Web Push \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\nexport { default as WebPushPopup } from './WebPushPopup/index.js'\nexport type { WebPushPopupProps } from './WebPushPopup/index.js'\nexport { useEmarsysWebPush } from '../hooks/useEmarsysWebPush.js'\nexport type {\n UseEmarsysWebPushOptions,\n UseEmarsysWebPushReturn,\n EmarsysContactInfo,\n EmarsysInitConfig,\n} from '../hooks/useEmarsysWebPush.js'\n\n/**\n * \u7EC4\u4EF6\u6620\u5C04\u5BF9\u8C61\n */\n\nexport const PAYLOAD_COMPONENT_MAP = {\n 'ipc-accordioncards': 'AccordionCards',\n 'ipc-aplusdesc': 'AplusDesc',\n 'ipc-banner': 'HeroBanner',\n 'ipc-brand-equity': 'BrandEquity',\n 'ipc-category': 'Category',\n 'ipc-collection-banner': 'CollectionBanner',\n 'ipc-collection-shelves': 'CollectionShelves',\n 'ipc-creativemodule': 'CreativeModule',\n 'ipc-download': 'DownLoad',\n 'ipc-evaluate': 'Evaluate',\n 'ipc-faq': 'Faq',\n 'ipc-features': 'Features',\n 'ipc-footcharger': 'FootCharger',\n 'ipc-ga-block': 'GraphicAttractionBlock',\n 'ipc-giftbox': 'GiftBox',\n 'ipc-giftshelf': 'GiftShelf',\n 'ipc-graphic': 'Graphic',\n 'ipc-graphicmore': 'GraphicMore',\n 'ipc-graphicoverlay': 'GraphicOverlay',\n 'ipc-marquee': 'Marquee',\n 'ipc-mediaplayerbase': 'MediaPlayerBase',\n 'ipc-mediaplayermulti': 'MediaPlayerMulti',\n 'ipc-mediaplayersticky': 'MediaPlayerSticky',\n 'ipc-member-equity': 'MemberEquity',\n 'ipc-mlg-block': 'MultiLayoutGraphicBlock',\n 'ipc-search-page-tabs': 'SearchPageBlock',\n 'ipc-selectstore': 'SelectStore',\n 'ipc-shelfdisplay': 'ShelfDisplay',\n 'ipc-slogan': 'Slogan',\n 'ipc-spacer': 'Spacer',\n 'ipc-specs': 'Specs',\n 'ipc-tabs': 'Tabs',\n 'ipc-text-marquee': 'TextMarquee',\n 'ipc-title': 'Title',\n 'ipc-whychoose': 'WhyChoose',\n 'ipc-product-nav': 'ProductNav',\n 'ipc-brand-card-link': 'BrandCardLink',\n 'ipc-ipredirect': 'IPRedirect',\n ksp: 'Ksp',\n 'ipc-secondary-banner': 'SecondaryBanner',\n /**\n * \u6D3B\u52A8\u8D27\u67B6\n */\n 'ipc-active-shelf': 'ActiveShelf',\n 'ipc-media-shelf': 'MediaShelf',\n /**\n * \u6D3B\u52A8\u4E70\u8D60\u8D27\u67B6\n */\n 'ipc-bogo-shelf': 'BuyOneGetOneShelf',\n 'ipc-media-endorsement': 'MediaEndorsement',\n 'ipc-media-scene-switcher-v2': 'MediaSceneSwitcherV2',\n 'ipc-featured-blog-posts': 'FeaturedBlogPosts',\n}\n"],
5
+ "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mjCAAAE,GAA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irect", "PAYLOAD_COMPONENT_MAP", "__toCommonJS", "import_ActivitySchedule", "import_GiftShelf", "import_GiftTierShelf", "import_ActivityMechanism", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_MarqueeReview", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_HeaderNavigation", "import_FooterNavigation", "import_SearchPage", "import_types", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay", "import_Specs", "import_TabsGroup", "import_BizProductProvider", "import_PurchaseBar", "import_ProductActions", "import_ProductCard", "import_ProductBenefitsTabs", "import_ProductBenefits", "import_ProductHighlight", "import_ProductFreeGift", "import_ProductExchangePurchase", "import_ProductOptions", "import_ProductBundle", "import_ProductCoupon", "import_ProductBanner", "import_ProductGridBox", "import_ProductGallery", "import_ProductDetail", "import_ProductSummary", "import_BenefitsTab", "import_PaidShipping", "import_CartActionButtons", "import_ProductServiceBenefits", "import_ProductPaidShipping", "import_GraphicMore", "import_Features", "import_AplusDesc", "import_GiftBox", "import_SelectStore", "import_DownLoad", "import_FootCharger", "import_BrandCardLink", "import_WheelLottery", "import_ProductLottery", "import_ProductCompare", "import_Ksp", "import_ImageTextFeature", "import_FeatureCards", "import_FeaturedBlogPosts", "import_ImageWithText", "import_VideoFeature", "import_TabsWithMedia", "import_TabWithImage", "import_FeatureShowcase", "import_ProductHero", "import_SpecsComparison", "import_MediaSceneSwitcher", "import_MediaSceneSwitcherV2", "import_ThreeDCarousel", "import_ProductNav", "import_AnchorNavigation", "import_PromotionalBar", "import_EventSchedule", "import_SecondaryBanner", "import_BuyOneGetOneShelf", "import_ActiveShelf", "import_MediaShelf", "import_CreditsShelf", "import_SceneShelf", "import_SceneShelfV2", "import_SceneShelfV3", "import_MediaEndorsement", "import_MediaTextOverlay", "import_ImageOverlayShelf", "import_ImageTextOverlay", "import_MiniCart", "import_CircleProgress", "import_MiniCartDialog", "import_WebPushPopup", "import_useEmarsysWebPush"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var X=Object.create;var f=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var tt=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var nt=(t,e)=>{for(var a in e)f(t,a,{get:e[a],enumerable:!0})},j=(t,e,a,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Z(e))!et.call(t,o)&&o!==a&&f(t,o,{get:()=>e[o],enumerable:!(x=Y(e,o))||x.enumerable});return t};var st=(t,e,a)=>(a=t!=null?X(tt(t)):{},j(e||!t||!t.__esModule?f(a,"default",{value:t,enumerable:!0}):a,t)),rt=t=>j(f({},"__esModule",{value:!0}),t);var mt={};nt(mt,{default:()=>pt});module.exports=rt(mt);var r=require("react/jsx-runtime"),s=st(require("react")),d=require("class-variance-authority"),g=require("../helpers/index.js");const at=(0,d.cva)("countdown-container flex w-full items-center",{variants:{variant:{outline:"gap-1",spacious:"gap-1"},align:{left:"justify-start",center:"justify-center"}},defaultVariants:{variant:"outline",align:"left"}}),ot=(0,d.cva)("time-block border-box rounded-box-small flex flex-col items-center justify-center overflow-hidden text-center text-xs",{variants:{variant:{outline:"border-info-primary text-info-primary desktop:size-12 desktop:p-1 size-10 border bg-transparent p-[2px]",spacious:"bg-info-white text-info-primary desktop:size-12 desktop:p-1 size-10 p-[2px]"}},defaultVariants:{variant:"outline"}}),it=(0,d.cva)("time-number lg-desktop:text-[24px] translate-y-[2px] whitespace-nowrap text-center text-[20px] font-bold leading-none"),lt=(0,d.cva)("separator desktop:text-2xl text-xl font-bold",{variants:{variant:{outline:"text-info-primary",spacious:"text-info-primary"}},defaultVariants:{variant:"outline"}}),ut=t=>t?t==="light"?"bg-info-primary text-info-white border-transparent":"bg-container-secondary text-info-primary border-transparent":"",ct=t=>t?"text-info-primary":"",b=(t,e=2)=>String(Math.abs(t)).padStart(e,"0"),H=()=>({day:"Day",hour:"Hours",minute:"Mins",second:"Secs"}),B=t=>{const e=H();return{day:t.day??t.days??e.day,hour:t.hour??t.hours??e.hour,minute:t.minute??t.minutes??e.minute,second:t.second??t.seconds??e.second}},dt=t=>{try{let e=t?.trim?.();return!e?.startsWith?.("{")||!e?.endsWith?.("}")?{}:(e=e?.replace?.(/(\w+)\s*:/g,'"$1":'),JSON.parse(e))}catch{return{}}},O=s.default.forwardRef(({className:t,endDate:e,endDate_tz:a,locale:x,timeLabels:o,dateFormat:h,onExpire:w,separator:W=":",hideWhenExpired:A=!0,showDays:T=!0,showHours:N=!0,showMinutes:L=!0,showSeconds:M=!0,variant:v,align:_,theme:C,...F},J)=>{const p=(0,s.useMemo)(()=>o?B(o):h?B(dt(h)):H(),[o,h]),i=(0,s.useRef)(Date.parse(e)),[q,k]=(0,s.useState)(()=>{const n=i.current;return isNaN(n)?0:Math.max(0,n-Date.now())}),[m,D]=(0,s.useState)(()=>{const n=i.current;return!isNaN(n)&&n<=Date.now()});(0,s.useEffect)(()=>{i.current=Date.parse(e);const n=i.current,c=isNaN(n)?0:Math.max(0,n-Date.now()),y=!isNaN(n)&&n<=Date.now();k(c),D(y)},[e]),(0,s.useEffect)(()=>{if(m||isNaN(i.current))return;let n=!1;const c=()=>{const U=Date.now(),$=Math.max(0,i.current-U);k($),$<=0&&!n&&(n=!0,D(!0),w?.())};c();const y=window.setInterval(c,1e3);return()=>clearInterval(y)},[w,m,e]);const I=Math.floor(q/1e3),V=I%60,S=Math.floor(I/60),E=S%60,P=Math.floor(S/60),R=P%24,z=Math.floor(P/24),l=[];T&&l.push({value:z,label:p.day,cssClass:"time-days-box"}),N&&l.push({value:R,label:p.hour,cssClass:"time-hours-box"}),L&&l.push({value:E,label:p.minute,cssClass:"time-minutes-box"}),M&&l.push({value:V,label:p.second,cssClass:"time-seconds-box"});const u=[];T&&u.push(`${z} days`),N&&u.push(`${b(R)} hours`),L&&u.push(`${b(E)} minutes`),M&&u.push(`${b(V)} seconds`);const G=u.length>0?`${u.join(" ")} remaining`:"countdown timer";if(m&&A)return(0,r.jsx)("span",{role:"status","aria-live":"polite",className:"sr-only",children:"Countdown has ended"});const K=ut(C),Q=ct(C);return(0,r.jsxs)("div",{ref:J,className:(0,g.cn)(at({variant:v,align:_}),t),role:"timer","aria-label":G,...F,children:[l.map((n,c)=>(0,r.jsxs)(s.default.Fragment,{children:[(0,r.jsxs)("div",{className:(0,g.cn)(ot({variant:v}),K,n.cssClass),children:[(0,r.jsx)("div",{className:it(),children:b(n.value,2)}),(0,r.jsx)("div",{className:"truncate text-center text-[12px] font-bold",children:n.label})]}),c<l.length-1&&(0,r.jsx)("div",{className:(0,g.cn)(lt({variant:v}),Q),children:W})]},n.cssClass)),m&&(0,r.jsx)("span",{role:"status","aria-live":"polite",className:"sr-only",children:"Countdown has ended"})]})});O.displayName="Countdown";var pt=O;
1
+ "use strict";"use client";var Z=Object.create;var b=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ne=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var re=(e,t)=>{for(var a in t)b(e,a,{get:t[a],enumerable:!0})},H=(e,t,a,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of te(t))!se.call(e,o)&&o!==a&&b(e,o,{get:()=>t[o],enumerable:!(x=ee(t,o))||x.enumerable});return e};var ae=(e,t,a)=>(a=e!=null?Z(ne(e)):{},H(t||!e||!e.__esModule?b(a,"default",{value:e,enumerable:!0}):a,e)),oe=e=>H(b({},"__esModule",{value:!0}),e);var be={};re(be,{default:()=>fe});module.exports=oe(be);var r=require("react/jsx-runtime"),s=ae(require("react")),d=require("class-variance-authority"),h=require("../helpers/index.js");const ie=(0,d.cva)("countdown-container flex w-full items-center",{variants:{variant:{outline:"gap-1",spacious:"gap-1"},align:{left:"justify-start",center:"justify-center"}},defaultVariants:{variant:"outline",align:"left"}}),le=(0,d.cva)("time-block border-box rounded-box-small flex flex-col items-center justify-center overflow-hidden text-center text-xs",{variants:{variant:{outline:"border-info-primary text-info-primary desktop:size-12 desktop:p-1 size-10 border bg-transparent p-[2px]",spacious:"bg-info-white text-info-primary desktop:size-12 desktop:p-1 size-10 p-[2px]"}},defaultVariants:{variant:"outline"}}),ue=(0,d.cva)("time-number lg-desktop:text-[24px] translate-y-[2px] whitespace-nowrap text-center text-[20px] font-bold leading-none"),ce=(0,d.cva)("separator desktop:text-2xl text-xl font-bold",{variants:{variant:{outline:"text-info-primary",spacious:"text-info-primary"}},defaultVariants:{variant:"outline"}}),de=e=>e?e==="light"?"bg-info-primary text-info-white border-transparent":"bg-container-secondary text-info-primary border-transparent":"",me=e=>e?"text-info-primary":"",g=(e,t=2)=>String(Math.abs(e)).padStart(t,"0"),F=()=>({day:"Day",hour:"Hours",minute:"Mins",second:"Secs"}),B=e=>{const t=F();return{day:e.day??e.days??t.day,hour:e.hour??e.hours??t.hour,minute:e.minute??e.minutes??t.minute,second:e.second??e.seconds??t.second}},pe=e=>{try{let t=e?.trim?.();return!t?.startsWith?.("{")||!t?.endsWith?.("}")?{}:(t=t?.replace?.(/(\w+)\s*:/g,'"$1":'),JSON.parse(t))}catch{return{}}},O=s.default.forwardRef(({className:e,endDate:t,endDate_tz:a,locale:x,timeLabels:o,dateFormat:y,onExpire:T,separator:W=":",hideWhenExpired:q=!0,showDays:N=!0,showHours:L=!0,showMinutes:M=!0,showSeconds:C=!0,variant:v,align:_,theme:k,...J},G)=>{const m=(0,s.useMemo)(()=>o?B(o):y?B(pe(y)):F(),[o,y]),l=(0,s.useRef)(Date.parse(t)),[K,D]=(0,s.useState)(()=>{const n=l.current;return isNaN(n)?0:Math.max(0,n-Date.now())}),[p,S]=(0,s.useState)(()=>{const n=l.current;return!isNaN(n)&&n<=Date.now()});(0,s.useEffect)(()=>{l.current=Date.parse(t);const n=l.current,i=isNaN(n)?0:Math.max(0,n-Date.now()),f=!isNaN(n)&&n<=Date.now();D(i),S(f)},[t]),(0,s.useEffect)(()=>{if(p||isNaN(l.current))return;let n=!1,i=0,f=-1;const j=()=>{const Y=Date.now(),w=Math.max(0,l.current-Y),A=Math.floor(w/1e3);if(A!==f&&(f=A,D(w),w<=0&&!n)){n=!0,S(!0),T?.();return}i=requestAnimationFrame(j)};return i=requestAnimationFrame(j),()=>cancelAnimationFrame(i)},[T,p,t]);const V=Math.floor(K/1e3),E=V%60,I=Math.floor(V/60),P=I%60,R=Math.floor(I/60),z=R%24,$=Math.floor(R/24),u=[];N&&u.push({value:$,label:m.day,cssClass:"time-days-box"}),L&&u.push({value:z,label:m.hour,cssClass:"time-hours-box"}),M&&u.push({value:P,label:m.minute,cssClass:"time-minutes-box"}),C&&u.push({value:E,label:m.second,cssClass:"time-seconds-box"});const c=[];N&&c.push(`${$} days`),L&&c.push(`${g(z)} hours`),M&&c.push(`${g(P)} minutes`),C&&c.push(`${g(E)} seconds`);const Q=c.length>0?`${c.join(" ")} remaining`:"countdown timer";if(p&&q)return(0,r.jsx)("span",{role:"status","aria-live":"polite",className:"sr-only",children:"Countdown has ended"});const U=de(k),X=me(k);return(0,r.jsxs)("div",{ref:G,className:(0,h.cn)(ie({variant:v,align:_}),e),role:"timer","aria-label":Q,...J,children:[u.map((n,i)=>(0,r.jsxs)(s.default.Fragment,{children:[(0,r.jsxs)("div",{className:(0,h.cn)(le({variant:v}),U,n.cssClass),children:[(0,r.jsx)("div",{className:ue(),children:g(n.value,2)}),(0,r.jsx)("div",{className:"truncate text-center text-[12px] font-bold",children:n.label})]}),i<u.length-1&&(0,r.jsx)("div",{className:(0,h.cn)(ce({variant:v}),X),children:W})]},n.cssClass)),p&&(0,r.jsx)("span",{role:"status","aria-live":"polite",className:"sr-only",children:"Countdown has ended"})]})});O.displayName="Countdown";var fe=O;
2
2
  //# sourceMappingURL=Countdown.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Countdown.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport React, { useEffect, useRef, useState, useMemo } from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\n// \u5B9A\u4E49\u6837\u5F0F\u53D8\u4F53\nconst countdownVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u5012\u8BA1\u65F6\u5BB9\u5668\n 'countdown-container flex w-full items-center',\n {\n variants: {\n variant: {\n outline: 'gap-1',\n spacious: 'gap-1',\n },\n align: {\n left: 'justify-start',\n center: 'justify-center',\n },\n },\n defaultVariants: {\n variant: 'outline',\n align: 'left',\n },\n }\n)\n\nconst timeBlockVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u65F6\u95F4\u5757\n 'time-block border-box rounded-box-small flex flex-col items-center justify-center overflow-hidden text-center text-xs',\n {\n variants: {\n variant: {\n outline:\n 'border-info-primary text-info-primary desktop:size-12 desktop:p-1 size-10 border bg-transparent p-[2px]',\n spacious: 'bg-info-white text-info-primary desktop:size-12 desktop:p-1 size-10 p-[2px]',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n }\n)\n\nconst timeNumberVariants = cva(\n 'time-number lg-desktop:text-[24px] translate-y-[2px] whitespace-nowrap text-center text-[20px] font-bold leading-none'\n)\n\nconst separatorVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u5206\u9694\u7B26\n 'separator desktop:text-2xl text-xl font-bold',\n {\n variants: {\n variant: {\n outline: 'text-info-primary',\n spacious: 'text-info-primary',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n }\n)\n\n/**\n * \u4E3B\u9898\u8272\u8986\u76D6\u7C7B - \u4EC5\u5F53 theme \u4F20\u5165\u65F6\u8986\u76D6 variant \u7684\u989C\u8272\u90E8\u5206\uFF0C\u4FDD\u7559\u5E03\u5C40/\u5C3A\u5BF8\n */\nconst getTimeBlockThemeClasses = (theme?: 'light' | 'dark'): string => {\n if (!theme) return ''\n return theme === 'light'\n ? 'bg-info-primary text-info-white border-transparent'\n : 'bg-container-secondary text-info-primary border-transparent'\n}\n\nconst getSeparatorThemeClasses = (theme?: 'light' | 'dark'): string => {\n if (!theme) return ''\n return 'text-info-primary'\n}\n\n/**\n * \u65F6\u95F4\u6807\u7B7E\u914D\u7F6E\u63A5\u53E3 (singular keys)\n */\nexport interface TimeLabels {\n /** \u5929\u7684\u6807\u7B7E */\n day: string\n /** \u5C0F\u65F6\u7684\u6807\u7B7E */\n hour: string\n /** \u5206\u949F\u7684\u6807\u7B7E */\n minute: string\n /** \u79D2\u7684\u6807\u7B7E */\n second: string\n}\n\n/**\n * \u65F6\u95F4\u6807\u7B7E\u914D\u7F6E\u63A5\u53E3 (plural keys, e.g. from Title component)\n */\nexport interface PluralTimeLabels {\n days: string\n hours: string\n minutes: string\n seconds: string\n}\n\n/**\n * \u65F6\u95F4\u6807\u7B7E\u8F93\u5165\u7C7B\u578B - \u652F\u6301 singular \u548C plural \u952E\u540D\uFF0C\u6240\u6709\u5B57\u6BB5\u53EF\u9009\n */\nexport type TimeLabelsInput = Partial<TimeLabels & PluralTimeLabels>\n\n/**\n * \u5012\u8BA1\u65F6\u7EC4\u4EF6Props\u63A5\u53E3\n */\nexport interface CountdownProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onExpire'>, VariantProps<typeof countdownVariants> {\n /** \u7ED3\u675F\u65F6\u95F4 - ISO\u683C\u5F0F\u5B57\u7B26\u4E32 */\n endDate: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF0C\u5982: America/Los_Angeles */\n endDate_tz?: string\n /** \u683C\u5F0F\u5316\u7528\u7684locale\uFF0C\u9ED8\u8BA4\u4F7F\u7528navigator.language */\n locale?: string\n /** \u65F6\u95F4\u6807\u7B7E\u914D\u7F6E\uFF0C\u652F\u6301 singular (day/hour/minute/second) \u548C plural (days/hours/minutes/seconds) \u952E\u540D */\n timeLabels?: TimeLabelsInput\n /** JSON\u5B57\u7B26\u4E32\u683C\u5F0F\u7684\u65F6\u95F4\u6807\u7B7E\uFF08\u5411\u540E\u517C\u5BB9\uFF09 */\n dateFormat?: string\n /** \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03 */\n onExpire?: () => void\n /** \u5206\u9694\u7B26\u5B57\u7B26\uFF0C\u9ED8\u8BA4\u4E3A ':' */\n separator?: string\n /** \u9690\u85CF\u5DF2\u8FC7\u671F\u7684\u5012\u8BA1\u65F6\uFF0C\u9ED8\u8BA4\u4E3A true */\n hideWhenExpired?: boolean\n /** \u662F\u5426\u663E\u793A\u5929\u6570\uFF0C\u9ED8\u8BA4\u4E3A true */\n showDays?: boolean\n /** \u662F\u5426\u663E\u793A\u5C0F\u65F6\uFF0C\u9ED8\u8BA4\u4E3A true */\n showHours?: boolean\n /** \u662F\u5426\u663E\u793A\u5206\u949F\uFF0C\u9ED8\u8BA4\u4E3A true */\n showMinutes?: boolean\n /** \u662F\u5426\u663E\u793A\u79D2\u6570\uFF0C\u9ED8\u8BA4\u4E3A true */\n showSeconds?: boolean\n /** \u989C\u8272\u4E3B\u9898 - \u8986\u76D6 variant \u7684\u989C\u8272\u90E8\u5206\uFF0C\u4FDD\u7559\u5E03\u5C40/\u5C3A\u5BF8\u3002\u4E0D\u4F20\u5219\u4FDD\u6301 variant \u539F\u6709\u989C\u8272 */\n theme?: 'light' | 'dark'\n}\n\n/**\n * \u6570\u5B57\u8865\u96F6\u51FD\u6570\n */\nconst pad = (n: number, len = 2) => String(Math.abs(n)).padStart(len, '0')\n\n/**\n * \u9ED8\u8BA4\u65F6\u95F4\u6807\u7B7E\n */\nconst getDefaultTimeLabels = (): TimeLabels => ({\n day: 'Day',\n hour: 'Hours',\n minute: 'Mins',\n second: 'Secs',\n})\n\n/**\n * \u5C06 plural/singular \u6DF7\u5408\u6807\u7B7E\u89C4\u8303\u5316\u4E3A singular \u683C\u5F0F\n * singular \u952E\u4F18\u5148\u4E8E plural \u952E\uFF0C\u7F3A\u5931\u65F6\u4F7F\u7528\u9ED8\u8BA4\u503C\n */\nconst resolveTimeLabels = (labels: TimeLabelsInput): TimeLabels => {\n const defaults = getDefaultTimeLabels()\n return {\n day: labels.day ?? labels.days ?? defaults.day,\n hour: labels.hour ?? labels.hours ?? defaults.hour,\n minute: labels.minute ?? labels.minutes ?? defaults.minute,\n second: labels.second ?? labels.seconds ?? defaults.second,\n }\n}\n\n/**\n * \u89E3\u6790dateFormat JSON\u5B57\u7B26\u4E32\uFF08\u5411\u540E\u517C\u5BB9\uFF09\n */\nconst safeStringToObject = (str: string): TimeLabelsInput => {\n try {\n let jsonStr = str?.trim?.()\n if (!jsonStr?.startsWith?.('{') || !jsonStr?.endsWith?.('}')) {\n return {}\n }\n jsonStr = jsonStr?.replace?.(/(\\w+)\\s*:/g, '\"$1\":')\n return JSON.parse(jsonStr) as TimeLabelsInput\n } catch (err) {\n return {}\n }\n}\n\n/**\n * Countdown - \u5012\u8BA1\u65F6\u539F\u5B50\u7EC4\u4EF6\n *\n * @description \u7528\u4E8E\u663E\u793A\u5012\u8BA1\u65F6\u7684\u7EC4\u4EF6\uFF0C\u652F\u6301\u5929\u3001\u65F6\u3001\u5206\u3001\u79D2\u663E\u793A\uFF0C\u652F\u6301\u591A\u79CD\u6837\u5F0F\u53D8\u4F53\u3001\u4E3B\u9898\u548C\u5355\u4F4D\u53EF\u89C1\u6027\u63A7\u5236\n */\nconst Countdown = React.forwardRef<HTMLDivElement, CountdownProps>(\n (\n {\n className,\n endDate,\n endDate_tz,\n locale,\n timeLabels,\n dateFormat,\n onExpire,\n separator = ':',\n hideWhenExpired = true,\n showDays = true,\n showHours = true,\n showMinutes = true,\n showSeconds = true,\n variant,\n align,\n theme,\n ...props\n },\n ref\n ) => {\n // \u786E\u5B9A\u6700\u7EC8\u4F7F\u7528\u7684\u65F6\u95F4\u6807\u7B7E (\u652F\u6301 plural \u548C singular \u952E)\n const finalTimeLabels = useMemo(() => {\n if (timeLabels) return resolveTimeLabels(timeLabels)\n if (dateFormat) return resolveTimeLabels(safeStringToObject(dateFormat))\n return getDefaultTimeLabels()\n }, [timeLabels, dateFormat])\n\n // \u89E3\u6790\u76EE\u6807\u65F6\u95F4\n const targetMsRef = useRef<number>(Date.parse(endDate))\n const [remainingMs, setRemainingMs] = useState<number>(() => {\n const t = targetMsRef.current\n return isNaN(t) ? 0 : Math.max(0, t - Date.now())\n })\n\n // \u5224\u65AD\u662F\u5426\u5DF2\u8FC7\u671F\n const [isExpired, setIsExpired] = useState<boolean>(() => {\n const t = targetMsRef.current\n return !isNaN(t) && t <= Date.now()\n })\n\n // \u5F53endDate\u6539\u53D8\u65F6\u66F4\u65B0\u76EE\u6807\u65F6\u95F4\n useEffect(() => {\n targetMsRef.current = Date.parse(endDate)\n const t = targetMsRef.current\n const newRemaining = isNaN(t) ? 0 : Math.max(0, t - Date.now())\n const newIsExpired = !isNaN(t) && t <= Date.now()\n\n setRemainingMs(newRemaining)\n setIsExpired(newIsExpired)\n }, [endDate])\n\n // \u542F\u52A8\u5012\u8BA1\u65F6\u5B9A\u65F6\u5668\n useEffect(() => {\n if (isExpired) return // \u5DF2\u8FC7\u671F\u5219\u4E0D\u542F\u52A8\n if (isNaN(targetMsRef.current)) return // \u65E0\u6548\u65E5\u671F\u4E0D\u542F\u52A8\n\n let expiredCalled = false\n const tick = () => {\n const now = Date.now()\n const remaining = Math.max(0, targetMsRef.current - now)\n setRemainingMs(remaining)\n\n if (remaining <= 0 && !expiredCalled) {\n expiredCalled = true\n setIsExpired(true)\n onExpire?.()\n }\n }\n\n tick() // \u7ACB\u5373\u6267\u884C\u4E00\u6B21\n const intervalId = window.setInterval(tick, 1000)\n\n return () => clearInterval(intervalId)\n }, [onExpire, isExpired, endDate])\n\n // \u8BA1\u7B97\u65F6\u95F4\u5355\u4F4D\n const totalSeconds = Math.floor(remainingMs / 1000)\n const seconds = totalSeconds % 60\n const totalMinutes = Math.floor(totalSeconds / 60)\n const minutes = totalMinutes % 60\n const totalHours = Math.floor(totalMinutes / 60)\n const hours = totalHours % 24\n const days = Math.floor(totalHours / 24)\n\n // \u6784\u5EFA\u53EF\u89C1\u7684\u65F6\u95F4\u5355\u4F4D\u6570\u7EC4\n const units: Array<{ value: number; label: string; cssClass: string }> = []\n if (showDays) units.push({ value: days, label: finalTimeLabels.day, cssClass: 'time-days-box' })\n if (showHours) units.push({ value: hours, label: finalTimeLabels.hour, cssClass: 'time-hours-box' })\n if (showMinutes) units.push({ value: minutes, label: finalTimeLabels.minute, cssClass: 'time-minutes-box' })\n if (showSeconds) units.push({ value: seconds, label: finalTimeLabels.second, cssClass: 'time-seconds-box' })\n\n // \u6784\u5EFA\u52A8\u6001 aria-label\n const ariaLabelParts: string[] = []\n if (showDays) ariaLabelParts.push(`${days} days`)\n if (showHours) ariaLabelParts.push(`${pad(hours)} hours`)\n if (showMinutes) ariaLabelParts.push(`${pad(minutes)} minutes`)\n if (showSeconds) ariaLabelParts.push(`${pad(seconds)} seconds`)\n const ariaLabel = ariaLabelParts.length > 0 ? `${ariaLabelParts.join(' ')} remaining` : 'countdown timer'\n\n // \u5982\u679C\u5DF2\u8FC7\u671F\u4E14\u9700\u8981\u9690\u85CF\uFF0C\u4EC5\u4FDD\u7559 screen reader \u901A\u77E5\n if (isExpired && hideWhenExpired) {\n return (\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n Countdown has ended\n </span>\n )\n }\n\n const timeBlockTheme = getTimeBlockThemeClasses(theme)\n const separatorTheme = getSeparatorThemeClasses(theme)\n\n return (\n <div\n ref={ref}\n className={cn(countdownVariants({ variant, align }), className)}\n role=\"timer\"\n aria-label={ariaLabel}\n {...props}\n >\n {units.map((unit, index) => (\n <React.Fragment key={unit.cssClass}>\n <div className={cn(timeBlockVariants({ variant }), timeBlockTheme, unit.cssClass)}>\n <div className={timeNumberVariants()}>{pad(unit.value, 2)}</div>\n <div className=\"truncate text-center text-[12px] font-bold\">{unit.label}</div>\n </div>\n {index < units.length - 1 && (\n <div className={cn(separatorVariants({ variant }), separatorTheme)}>{separator}</div>\n )}\n </React.Fragment>\n ))}\n {/* Visually hidden status for screen readers - announces only on expiry */}\n {isExpired && (\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n Countdown has ended\n </span>\n )}\n </div>\n )\n }\n)\n\nCountdown.displayName = 'Countdown'\n\nexport default Countdown\n"],
5
- "mappings": "8kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAySQ,IAAAI,EAAA,6BAvSRC,EAA4D,qBAC5DC,EAAuC,oCACvCC,EAAmB,+BAGnB,MAAMC,MAAoB,OAExB,+CACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,QACT,SAAU,OACZ,EACA,MAAO,CACL,KAAM,gBACN,OAAQ,gBACV,CACF,EACA,gBAAiB,CACf,QAAS,UACT,MAAO,MACT,CACF,CACF,EAEMC,MAAoB,OAExB,wHACA,CACE,SAAU,CACR,QAAS,CACP,QACE,0GACF,SAAU,6EACZ,CACF,EACA,gBAAiB,CACf,QAAS,SACX,CACF,CACF,EAEMC,MAAqB,OACzB,uHACF,EAEMC,MAAoB,OAExB,+CACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,oBACT,SAAU,mBACZ,CACF,EACA,gBAAiB,CACf,QAAS,SACX,CACF,CACF,EAKMC,GAA4BC,GAC3BA,EACEA,IAAU,QACb,qDACA,8DAHe,GAMfC,GAA4BD,GAC3BA,EACE,oBADY,GAqEfE,EAAM,CAACC,EAAWC,EAAM,IAAM,OAAO,KAAK,IAAID,CAAC,CAAC,EAAE,SAASC,EAAK,GAAG,EAKnEC,EAAuB,KAAmB,CAC9C,IAAK,MACL,KAAM,QACN,OAAQ,OACR,OAAQ,MACV,GAMMC,EAAqBC,GAAwC,CACjE,MAAMC,EAAWH,EAAqB,EACtC,MAAO,CACL,IAAKE,EAAO,KAAOA,EAAO,MAAQC,EAAS,IAC3C,KAAMD,EAAO,MA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S,YAAU,SAAS,UAAU,UAAU,+BAE3D,GAEJ,CAEJ,CACF,EAEAxB,EAAU,YAAc,YAExB,IAAOvB,GAAQuB",
6
- "names": ["Countdown_exports", "__export", "Countdown_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_class_variance_authority", "import_helpers", "countdownVariants", "timeBlockVariants", "timeNumberVariants", "separatorVariants", "getTimeBlockThemeClasses", "theme", "getSeparatorThemeClasses", "pad", "n", "len", "getDefaultTimeLabels", "resolveTimeLabels", "labels", "defaults", "safeStringToObject", "str", "jsonStr", "Countdown", "React", "className", "endDate", "endDate_tz", "locale", "timeLabels", "dateFormat", "onExpire", "separator", "hideWhenExpired", "showDays", "showHours", "showMinutes", "showSeconds", "variant", "align", "props", "ref", "finalTimeLabels", "targetMsRef", "remainingMs", "setRemainingMs", "t", "isExpired", "setIsExpired", "newRemaining", "newIsExpired", "expiredCalled", "tick", "now", "remaining", "intervalId", "totalSeconds", "seconds", "totalMinutes", "minutes", "totalHours", "hours", "days", "units", "ariaLabelParts", "ariaLabel", "timeBlockTheme", "separatorTheme", "unit", "index"]
4
+ "sourcesContent": ["'use client'\n\nimport React, { useEffect, useRef, useState, useMemo } from 'react'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\n// \u5B9A\u4E49\u6837\u5F0F\u53D8\u4F53\nconst countdownVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u5012\u8BA1\u65F6\u5BB9\u5668\n 'countdown-container flex w-full items-center',\n {\n variants: {\n variant: {\n outline: 'gap-1',\n spacious: 'gap-1',\n },\n align: {\n left: 'justify-start',\n center: 'justify-center',\n },\n },\n defaultVariants: {\n variant: 'outline',\n align: 'left',\n },\n }\n)\n\nconst timeBlockVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u65F6\u95F4\u5757\n 'time-block border-box rounded-box-small flex flex-col items-center justify-center overflow-hidden text-center text-xs',\n {\n variants: {\n variant: {\n outline:\n 'border-info-primary text-info-primary desktop:size-12 desktop:p-1 size-10 border bg-transparent p-[2px]',\n spacious: 'bg-info-white text-info-primary desktop:size-12 desktop:p-1 size-10 p-[2px]',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n }\n)\n\nconst timeNumberVariants = cva(\n 'time-number lg-desktop:text-[24px] translate-y-[2px] whitespace-nowrap text-center text-[20px] font-bold leading-none'\n)\n\nconst separatorVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\uFF1A\u5206\u9694\u7B26\n 'separator desktop:text-2xl text-xl font-bold',\n {\n variants: {\n variant: {\n outline: 'text-info-primary',\n spacious: 'text-info-primary',\n },\n },\n defaultVariants: {\n variant: 'outline',\n },\n }\n)\n\n/**\n * \u4E3B\u9898\u8272\u8986\u76D6\u7C7B - \u4EC5\u5F53 theme \u4F20\u5165\u65F6\u8986\u76D6 variant \u7684\u989C\u8272\u90E8\u5206\uFF0C\u4FDD\u7559\u5E03\u5C40/\u5C3A\u5BF8\n */\nconst getTimeBlockThemeClasses = (theme?: 'light' | 'dark'): string => {\n if (!theme) return ''\n return theme === 'light'\n ? 'bg-info-primary text-info-white border-transparent'\n : 'bg-container-secondary text-info-primary border-transparent'\n}\n\nconst getSeparatorThemeClasses = (theme?: 'light' | 'dark'): string => {\n if (!theme) return ''\n return 'text-info-primary'\n}\n\n/**\n * \u65F6\u95F4\u6807\u7B7E\u914D\u7F6E\u63A5\u53E3 (singular keys)\n */\nexport interface TimeLabels {\n /** \u5929\u7684\u6807\u7B7E */\n day: string\n /** \u5C0F\u65F6\u7684\u6807\u7B7E */\n hour: string\n /** \u5206\u949F\u7684\u6807\u7B7E */\n minute: string\n /** \u79D2\u7684\u6807\u7B7E */\n second: string\n}\n\n/**\n * \u65F6\u95F4\u6807\u7B7E\u914D\u7F6E\u63A5\u53E3 (plural keys, e.g. from Title component)\n */\nexport interface PluralTimeLabels {\n days: string\n hours: string\n minutes: string\n seconds: string\n}\n\n/**\n * \u65F6\u95F4\u6807\u7B7E\u8F93\u5165\u7C7B\u578B - \u652F\u6301 singular \u548C plural \u952E\u540D\uFF0C\u6240\u6709\u5B57\u6BB5\u53EF\u9009\n */\nexport type TimeLabelsInput = Partial<TimeLabels & PluralTimeLabels>\n\n/**\n * \u5012\u8BA1\u65F6\u7EC4\u4EF6Props\u63A5\u53E3\n */\nexport interface CountdownProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onExpire'>, VariantProps<typeof countdownVariants> {\n /** \u7ED3\u675F\u65F6\u95F4 - ISO\u683C\u5F0F\u5B57\u7B26\u4E32 */\n endDate: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF0C\u5982: America/Los_Angeles */\n endDate_tz?: string\n /** \u683C\u5F0F\u5316\u7528\u7684locale\uFF0C\u9ED8\u8BA4\u4F7F\u7528navigator.language */\n locale?: string\n /** \u65F6\u95F4\u6807\u7B7E\u914D\u7F6E\uFF0C\u652F\u6301 singular (day/hour/minute/second) \u548C plural (days/hours/minutes/seconds) \u952E\u540D */\n timeLabels?: TimeLabelsInput\n /** JSON\u5B57\u7B26\u4E32\u683C\u5F0F\u7684\u65F6\u95F4\u6807\u7B7E\uFF08\u5411\u540E\u517C\u5BB9\uFF09 */\n dateFormat?: string\n /** \u5012\u8BA1\u65F6\u7ED3\u675F\u56DE\u8C03 */\n onExpire?: () => void\n /** \u5206\u9694\u7B26\u5B57\u7B26\uFF0C\u9ED8\u8BA4\u4E3A ':' */\n separator?: string\n /** \u9690\u85CF\u5DF2\u8FC7\u671F\u7684\u5012\u8BA1\u65F6\uFF0C\u9ED8\u8BA4\u4E3A true */\n hideWhenExpired?: boolean\n /** \u662F\u5426\u663E\u793A\u5929\u6570\uFF0C\u9ED8\u8BA4\u4E3A true */\n showDays?: boolean\n /** \u662F\u5426\u663E\u793A\u5C0F\u65F6\uFF0C\u9ED8\u8BA4\u4E3A true */\n showHours?: boolean\n /** \u662F\u5426\u663E\u793A\u5206\u949F\uFF0C\u9ED8\u8BA4\u4E3A true */\n showMinutes?: boolean\n /** \u662F\u5426\u663E\u793A\u79D2\u6570\uFF0C\u9ED8\u8BA4\u4E3A true */\n showSeconds?: boolean\n /** \u989C\u8272\u4E3B\u9898 - \u8986\u76D6 variant \u7684\u989C\u8272\u90E8\u5206\uFF0C\u4FDD\u7559\u5E03\u5C40/\u5C3A\u5BF8\u3002\u4E0D\u4F20\u5219\u4FDD\u6301 variant \u539F\u6709\u989C\u8272 */\n theme?: 'light' | 'dark'\n}\n\n/**\n * \u6570\u5B57\u8865\u96F6\u51FD\u6570\n */\nconst pad = (n: number, len = 2) => String(Math.abs(n)).padStart(len, '0')\n\n/**\n * \u9ED8\u8BA4\u65F6\u95F4\u6807\u7B7E\n */\nconst getDefaultTimeLabels = (): TimeLabels => ({\n day: 'Day',\n hour: 'Hours',\n minute: 'Mins',\n second: 'Secs',\n})\n\n/**\n * \u5C06 plural/singular \u6DF7\u5408\u6807\u7B7E\u89C4\u8303\u5316\u4E3A singular \u683C\u5F0F\n * singular \u952E\u4F18\u5148\u4E8E plural \u952E\uFF0C\u7F3A\u5931\u65F6\u4F7F\u7528\u9ED8\u8BA4\u503C\n */\nconst resolveTimeLabels = (labels: TimeLabelsInput): TimeLabels => {\n const defaults = getDefaultTimeLabels()\n return {\n day: labels.day ?? labels.days ?? defaults.day,\n hour: labels.hour ?? labels.hours ?? defaults.hour,\n minute: labels.minute ?? labels.minutes ?? defaults.minute,\n second: labels.second ?? labels.seconds ?? defaults.second,\n }\n}\n\n/**\n * \u89E3\u6790dateFormat JSON\u5B57\u7B26\u4E32\uFF08\u5411\u540E\u517C\u5BB9\uFF09\n */\nconst safeStringToObject = (str: string): TimeLabelsInput => {\n try {\n let jsonStr = str?.trim?.()\n if (!jsonStr?.startsWith?.('{') || !jsonStr?.endsWith?.('}')) {\n return {}\n }\n jsonStr = jsonStr?.replace?.(/(\\w+)\\s*:/g, '\"$1\":')\n return JSON.parse(jsonStr) as TimeLabelsInput\n } catch (err) {\n return {}\n }\n}\n\n/**\n * Countdown - \u5012\u8BA1\u65F6\u539F\u5B50\u7EC4\u4EF6\n *\n * @description \u7528\u4E8E\u663E\u793A\u5012\u8BA1\u65F6\u7684\u7EC4\u4EF6\uFF0C\u652F\u6301\u5929\u3001\u65F6\u3001\u5206\u3001\u79D2\u663E\u793A\uFF0C\u652F\u6301\u591A\u79CD\u6837\u5F0F\u53D8\u4F53\u3001\u4E3B\u9898\u548C\u5355\u4F4D\u53EF\u89C1\u6027\u63A7\u5236\n */\nconst Countdown = React.forwardRef<HTMLDivElement, CountdownProps>(\n (\n {\n className,\n endDate,\n endDate_tz,\n locale,\n timeLabels,\n dateFormat,\n onExpire,\n separator = ':',\n hideWhenExpired = true,\n showDays = true,\n showHours = true,\n showMinutes = true,\n showSeconds = true,\n variant,\n align,\n theme,\n ...props\n },\n ref\n ) => {\n // \u786E\u5B9A\u6700\u7EC8\u4F7F\u7528\u7684\u65F6\u95F4\u6807\u7B7E (\u652F\u6301 plural \u548C singular \u952E)\n const finalTimeLabels = useMemo(() => {\n if (timeLabels) return resolveTimeLabels(timeLabels)\n if (dateFormat) return resolveTimeLabels(safeStringToObject(dateFormat))\n return getDefaultTimeLabels()\n }, [timeLabels, dateFormat])\n\n // \u89E3\u6790\u76EE\u6807\u65F6\u95F4\n const targetMsRef = useRef<number>(Date.parse(endDate))\n const [remainingMs, setRemainingMs] = useState<number>(() => {\n const t = targetMsRef.current\n return isNaN(t) ? 0 : Math.max(0, t - Date.now())\n })\n\n // \u5224\u65AD\u662F\u5426\u5DF2\u8FC7\u671F\n const [isExpired, setIsExpired] = useState<boolean>(() => {\n const t = targetMsRef.current\n return !isNaN(t) && t <= Date.now()\n })\n\n // \u5F53endDate\u6539\u53D8\u65F6\u66F4\u65B0\u76EE\u6807\u65F6\u95F4\n useEffect(() => {\n targetMsRef.current = Date.parse(endDate)\n const t = targetMsRef.current\n const newRemaining = isNaN(t) ? 0 : Math.max(0, t - Date.now())\n const newIsExpired = !isNaN(t) && t <= Date.now()\n\n setRemainingMs(newRemaining)\n setIsExpired(newIsExpired)\n }, [endDate])\n\n useEffect(() => {\n if (isExpired) return\n if (isNaN(targetMsRef.current)) return\n\n let expiredCalled = false\n let rafId: number = 0\n let lastSecond = -1\n\n const tick = () => {\n const now = Date.now()\n const remaining = Math.max(0, targetMsRef.current - now)\n const currentSecond = Math.floor(remaining / 1000)\n\n if (currentSecond !== lastSecond) {\n lastSecond = currentSecond\n setRemainingMs(remaining)\n\n if (remaining <= 0 && !expiredCalled) {\n expiredCalled = true\n setIsExpired(true)\n onExpire?.()\n return\n }\n }\n\n rafId = requestAnimationFrame(tick)\n }\n\n rafId = requestAnimationFrame(tick)\n return () => cancelAnimationFrame(rafId)\n }, [onExpire, isExpired, endDate])\n\n // \u8BA1\u7B97\u65F6\u95F4\u5355\u4F4D\n const totalSeconds = Math.floor(remainingMs / 1000)\n const seconds = totalSeconds % 60\n const totalMinutes = Math.floor(totalSeconds / 60)\n const minutes = totalMinutes % 60\n const totalHours = Math.floor(totalMinutes / 60)\n const hours = totalHours % 24\n const days = Math.floor(totalHours / 24)\n\n // \u6784\u5EFA\u53EF\u89C1\u7684\u65F6\u95F4\u5355\u4F4D\u6570\u7EC4\n const units: Array<{ value: number; label: string; cssClass: string }> = []\n if (showDays) units.push({ value: days, label: finalTimeLabels.day, cssClass: 'time-days-box' })\n if (showHours) units.push({ value: hours, label: finalTimeLabels.hour, cssClass: 'time-hours-box' })\n if (showMinutes) units.push({ value: minutes, label: finalTimeLabels.minute, cssClass: 'time-minutes-box' })\n if (showSeconds) units.push({ value: seconds, label: finalTimeLabels.second, cssClass: 'time-seconds-box' })\n\n // \u6784\u5EFA\u52A8\u6001 aria-label\n const ariaLabelParts: string[] = []\n if (showDays) ariaLabelParts.push(`${days} days`)\n if (showHours) ariaLabelParts.push(`${pad(hours)} hours`)\n if (showMinutes) ariaLabelParts.push(`${pad(minutes)} minutes`)\n if (showSeconds) ariaLabelParts.push(`${pad(seconds)} seconds`)\n const ariaLabel = ariaLabelParts.length > 0 ? `${ariaLabelParts.join(' ')} remaining` : 'countdown timer'\n\n // \u5982\u679C\u5DF2\u8FC7\u671F\u4E14\u9700\u8981\u9690\u85CF\uFF0C\u4EC5\u4FDD\u7559 screen reader \u901A\u77E5\n if (isExpired && hideWhenExpired) {\n return (\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n Countdown has ended\n </span>\n )\n }\n\n const timeBlockTheme = getTimeBlockThemeClasses(theme)\n const separatorTheme = getSeparatorThemeClasses(theme)\n\n return (\n <div\n ref={ref}\n className={cn(countdownVariants({ variant, align }), className)}\n role=\"timer\"\n aria-label={ariaLabel}\n {...props}\n >\n {units.map((unit, index) => (\n <React.Fragment key={unit.cssClass}>\n <div className={cn(timeBlockVariants({ variant }), timeBlockTheme, unit.cssClass)}>\n <div className={timeNumberVariants()}>{pad(unit.value, 2)}</div>\n <div className=\"truncate text-center text-[12px] font-bold\">{unit.label}</div>\n </div>\n {index < units.length - 1 && (\n <div className={cn(separatorVariants({ variant }), separatorTheme)}>{separator}</div>\n )}\n </React.Fragment>\n ))}\n {/* Visually hidden status for screen readers - announces only on expiry */}\n {isExpired && (\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n Countdown has ended\n </span>\n )}\n </div>\n )\n }\n)\n\nCountdown.displayName = 'Countdown'\n\nexport default Countdown\n"],
5
+ "mappings": "klBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAiTQ,IAAAI,EAAA,6BA/SRC,EAA4D,qBAC5DC,EAAuC,oCACvCC,EAAmB,+BAGnB,MAAMC,MAAoB,OAExB,+CACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,QACT,SAAU,OACZ,EACA,MAAO,CACL,KAAM,gBACN,OAAQ,gBACV,CACF,EACA,gBAAiB,CACf,QAAS,UACT,MAAO,MACT,CACF,CACF,EAEMC,MAAoB,OAExB,wHACA,CACE,SAAU,CACR,QAAS,CACP,QACE,0GACF,SAAU,6EAC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C,EAAiB1D,GAAyBC,CAAK,EAC/C0D,EAAiBzD,GAAyBD,CAAK,EAErD,SACE,QAAC,OACC,IAAK8B,EACL,aAAW,MAAGnC,GAAkB,CAAE,QAAAgC,EAAS,MAAAC,CAAM,CAAC,EAAGd,CAAS,EAC9D,KAAK,QACL,aAAY0C,EACX,GAAG3B,EAEH,UAAAyB,EAAM,IAAI,CAACK,EAAMC,OAChB,QAAC,EAAA/C,QAAM,SAAN,CACC,qBAAC,OAAI,aAAW,MAAGjB,GAAkB,CAAE,QAAA+B,CAAQ,CAAC,EAAG8B,EAAgBE,EAAK,QAAQ,EAC9E,oBAAC,OAAI,UAAW9D,GAAmB,EAAI,SAAAK,EAAIyD,EAAK,MAAO,CAAC,EAAE,KAC1D,OAAC,OAAI,UAAU,6CAA8C,SAAAA,EAAK,MAAM,GAC1E,EACCC,EAAQN,EAAM,OAAS,MACtB,OAAC,OAAI,aAAW,MAAGxD,GAAkB,CAAE,QAAA6B,CAAQ,CAAC,EAAG+B,CAAc,EAAI,SAAArC,EAAU,IAN9DsC,EAAK,QAQ1B,CACD,EAEAvB,MACC,OAAC,QAAK,KAAK,SAAS,YAAU,SAAS,UAAU,UAAU,+BAE3D,GAEJ,CAEJ,CACF,EAEAxB,EAAU,YAAc,YAExB,IAAOvB,GAAQuB",
6
+ "names": ["Countdown_exports", "__export", "Countdown_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_class_variance_authority", "import_helpers", "countdownVariants", "timeBlockVariants", "timeNumberVariants", "separatorVariants", "getTimeBlockThemeClasses", "theme", "getSeparatorThemeClasses", "pad", "n", "len", "getDefaultTimeLabels", "resolveTimeLabels", "labels", "defaults", "safeStringToObject", "str", "jsonStr", "Countdown", "React", "className", "endDate", "endDate_tz", "locale", "timeLabels", "dateFormat", "onExpire", "separator", "hideWhenExpired", "showDays", "showHours", "showMinutes", "showSeconds", "variant", "align", "props", "ref", "finalTimeLabels", "targetMsRef", "remainingMs", "setRemainingMs", "t", "isExpired", "setIsExpired", "newRemaining", "newIsExpired", "expiredCalled", "rafId", "lastSecond", "tick", "now", "remaining", "currentSecond", "totalSeconds", "seconds", "totalMinutes", "minutes", "totalHours", "hours", "days", "units", "ariaLabelParts", "ariaLabel", "timeBlockTheme", "separatorTheme", "unit", "index"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var N=Object.create;var p=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var a in e)p(t,a,{get:e[a],enumerable:!0})},R=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of W(e))!k.call(t,o)&&o!==a&&p(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t};var y=(t,e,a)=>(a=t!=null?N(E(t)):{},R(e||!t||!t.__esModule?p(a,"default",{value:t,enumerable:!0}):a,t)),A=t=>R(p({},"__esModule",{value:!0}),t);var j={};S(j,{Tabs:()=>u,TabsContent:()=>T,TabsList:()=>g,TabsTrigger:()=>h});module.exports=A(j);var r=require("react/jsx-runtime"),i=y(require("react")),l=require("../helpers/index.js"),n=y(require("@radix-ui/react-tabs")),b=require("class-variance-authority");const c=i.createContext({align:"left",shape:"square"}),u=i.forwardRef(({children:t,align:e="left",shape:a="default",...s},o)=>(0,r.jsx)(n.Root,{ref:o,...s,children:(0,r.jsx)(c.Provider,{value:{align:e,shape:a},children:t})}));u.displayName="Tabs";const F=(0,b.cva)("rounded-tabs",{variants:{align:{left:"justify-left",center:"justify-center",right:"justify-end"},shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{align:"left",shape:"default"}}),V=(0,b.cva)("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),g=i.forwardRef(({className:t,...e},a)=>{const{align:s,shape:o}=i.useContext(c);return(0,r.jsx)(n.List,{ref:a,className:(0,l.cn)("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",F({align:s,shape:o}),t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...e})});g.displayName=n.List.displayName;const h=i.forwardRef(({className:t,onClick:e,...a},s)=>{const{shape:o}=i.useContext(c),v=f=>{e?.(f);const d=f?.currentTarget,m=f?.currentTarget?.parentElement;if(d&&m){const x=d.offsetLeft,P=d.offsetWidth,C=m.offsetWidth,L=x-C/2+P/2;m.scrollTo({left:L,behavior:"smooth"})}};return(0,r.jsx)(n.Trigger,{ref:s,className:(0,l.cn)("text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]",t,V({shape:o})),onClick:v,...a})});h.displayName=n.Trigger.displayName;const T=i.forwardRef(({className:t,...e},a)=>(0,r.jsx)(n.Content,{ref:a,className:(0,l.cn)(t),...e}));T.displayName=n.Content.displayName;
1
+ "use strict";"use client";var L=Object.create;var f=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var a in e)f(t,a,{get:e[a],enumerable:!0})},v=(t,e,a,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of W(e))!k.call(t,s)&&s!==a&&f(t,s,{get:()=>e[s],enumerable:!(o=N(e,s))||o.enumerable});return t};var y=(t,e,a)=>(a=t!=null?L(E(t)):{},v(e||!t||!t.__esModule?f(a,"default",{value:t,enumerable:!0}):a,t)),A=t=>v(f({},"__esModule",{value:!0}),t);var q={};S(q,{Tabs:()=>h,TabsContent:()=>R,TabsList:()=>g,TabsTrigger:()=>T});module.exports=A(q);var i=require("react/jsx-runtime"),r=y(require("react")),d=require("../helpers/index.js"),n=y(require("@radix-ui/react-tabs")),u=require("class-variance-authority");const b=r.createContext({align:"left",shape:"square"}),h=r.forwardRef(({children:t,align:e="left",shape:a="default",...o},s)=>(0,i.jsx)(n.Root,{ref:s,...o,children:(0,i.jsx)(b.Provider,{value:{align:e,shape:a},children:t})}));h.displayName="Tabs";const F=(0,u.cva)("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),V=(0,u.cva)("rounded-tabs",{variants:{shape:{default:"",rounded:"rounded-[28px]",square:"rounded-none"}},defaultVariants:{shape:"default"}}),g=r.forwardRef(({className:t,...e},a)=>{const{align:o,shape:s}=r.useContext(b),p=o==="center"?"flex w-full justify-center":o==="right"?"flex w-full justify-end":null,l=(0,i.jsx)(n.List,{ref:a,className:(0,d.cn)("bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1",F({shape:s}),t),style:{scrollbarWidth:"none",msOverflowStyle:"none"},...e});return p?(0,i.jsx)("div",{className:p,children:l}):l});g.displayName=n.List.displayName;const T=r.forwardRef(({className:t,onClick:e,...a},o)=>{const{shape:s}=r.useContext(b),p=l=>{e?.(l);const c=l?.currentTarget,m=l?.currentTarget?.parentElement;if(c&&m){const x=c.offsetLeft,P=c.offsetWidth,C=m.offsetWidth,w=x-C/2+P/2;m.scrollTo({left:w,behavior:"smooth"})}};return(0,i.jsx)(n.Trigger,{ref:o,className:(0,d.cn)("text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]",t,V({shape:s})),onClick:p,...a})});T.displayName=n.Trigger.displayName;const R=r.forwardRef(({className:t,...e},a)=>(0,i.jsx)(n.Content,{ref:a,className:(0,d.cn)(t),...e}));R.displayName=n.Content.displayName;
2
2
  //# sourceMappingURL=tabs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/tabs.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\ntype tabShape = Shape | 'default'\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: tabShape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: tabShape\n }\n>(({ children, align = 'left', shape = 'default', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('rounded-tabs', {\n variants: {\n align: {\n left: 'justify-left',\n center: 'justify-center',\n right: 'justify-end',\n },\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n align: 'left',\n shape: 'default',\n },\n})\n\nconst tabsTriggerVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n return (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({\n align: alignFromParent,\n shape: shapeFromParent,\n }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n const tabElement = e?.currentTarget\n const container = e?.currentTarget?.parentElement\n if (tabElement && container) {\n const tabLeft = tabElement.offsetLeft\n const tabWidth = tabElement.offsetWidth\n const containerWidth = container.offsetWidth\n const scrollTo = tabLeft - containerWidth / 2 + tabWidth / 2\n container.scrollTo({\n left: scrollTo,\n behavior: 'smooth',\n })\n }\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n {...props}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,EAAA,aAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAN,GA2BI,IAAAO,EAAA,6BAzBJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAA+B,mCAC/BC,EAAoB,oCAKpB,MAAMC,EAAiBJ,EAAM,cAG1B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,IAAUE,CAAC,EACX,MAAMC,EAAaD,GAAG,cAChBE,EAAYF,GAAG,eAAe,cACpC,GAAIC,GAAcC,EAAW,CAC3B,MAAMC,EAAUF,EAAW,WACrBG,EAAWH,EAAW,YACtBI,EAAiBH,EAAU,YAC3BI,EAAWH,EAAUE,EAAiB,EAAID,EAAW,EAC3DF,EAAU,SAAS,CACjB,KAAMI,EACN,SAAU,QACZ,CAAC,CACH,CACF,EACA,SACE,OAACrB,EAAc,QAAd,CACC,IAAKO,EACL,aAAW,MACT,8PACAG,EACAD,EAAoB,CAClB,MAAOG,CACT,CAAC,CACH,EACA,QAASE,EACR,GAAGR,EACN,CAEJ,CAAC,EACDX,EAAY,YAAcK,EAAc,QAAQ,YAEhD,MAAMP,EAAcK,EAAM,WAGxB,CAAC,CAAE,UAAAY,EAAW,GAAGJ,CAAM,EAAGC,OAAQ,OAACP,EAAc,QAAd,CAAsB,IAAKO,EAAK,aAAW,MAAGG,CAAS,EAAI,GAAGJ,EAAO,CAAE,EAC5Gb,EAAY,YAAcO,EAAc,QAAQ",
6
- "names": ["tabs_exports", "__export", "Tabs", "TabsContent", "TabsList", "TabsTrigger", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "TabsPrimitive", "import_class_variance_authority", "TabListContext", "children", "align", "shape", "props", "ref", "tabsListVariants", "tabsTriggerVariants", "className", "alignFromParent", "shapeFromParent", "onClick", "handleClick", "e", "tabElement", "container", "tabLeft", "tabWidth", "containerWidth", "scrollTo"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva } from 'class-variance-authority'\nimport type { Align, Shape } from '../types/props.js'\n\ntype tabShape = Shape | 'default'\n\nconst TabListContext = React.createContext<{\n align?: Align\n shape: tabShape\n}>({\n align: 'left',\n shape: 'square',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {\n align?: Align\n shape?: tabShape\n }\n>(({ children, align = 'left', shape = 'default', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ align, shape }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\n\nconst tabsTriggerVariants = cva('rounded-tabs', {\n variants: {\n shape: {\n default: '',\n rounded: 'rounded-[28px]',\n square: 'rounded-none',\n },\n },\n defaultVariants: {\n shape: 'default',\n },\n})\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { align: alignFromParent, shape: shapeFromParent } = React.useContext(TabListContext)\n\n const wrapperClass =\n alignFromParent === 'center'\n ? 'flex w-full justify-center'\n : alignFromParent === 'right'\n ? 'flex w-full justify-end'\n : null\n\n const list = (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'bg-tabs-list-bg flex w-fit max-w-full overflow-x-auto p-1',\n tabsListVariants({ shape: shapeFromParent }),\n className\n )}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n {...props}\n />\n )\n\n return wrapperClass ? <div className={wrapperClass}>{list}</div> : list\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, onClick, ...props }, ref) => {\n const { shape: shapeFromParent } = React.useContext(TabListContext)\n const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {\n onClick?.(e)\n const tabElement = e?.currentTarget\n const container = e?.currentTarget?.parentElement\n if (tabElement && container) {\n const tabLeft = tabElement.offsetLeft\n const tabWidth = tabElement.offsetWidth\n const containerWidth = container.offsetWidth\n const scrollTo = tabLeft - containerWidth / 2 + tabWidth / 2\n container.scrollTo({\n left: scrollTo,\n behavior: 'smooth',\n })\n }\n }\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'text-info-primary lg-desktop:text-base disabled:text-btn-secondary-disabled lg-desktop:px-[28px] lg-desktop:pt-[15px] lg-desktop:pb-[14px] shrink-0 px-5 pb-2.5 pt-[11px] text-sm font-bold data-[state=active]:bg-white data-[state=active]:text-[#080A0F]',\n className,\n tabsTriggerVariants({\n shape: shapeFromParent,\n })\n )}\n onClick={handleClick}\n {...props}\n />\n )\n})\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,EAAA,aAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAN,GA2BI,IAAAO,EAAA,6BAzBJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAA+B,mCAC/BC,EAAoB,oCAKpB,MAAMC,EAAiBJ,EAAM,cAG1B,CACD,MAAO,OACP,MAAO,QACT,CAAC,EAEKN,EAAOM,EAAM,WAMjB,CAAC,CAAE,SAAAK,EAAU,MAAAC,EAAQ,OAAQ,MAAAC,EAAQ,UAAW,GAAGC,CAAM,EAAGC,OAC5D,OAACP,EAAc,KAAd,CAAmB,IAAKO,EAAM,GAAGD,EAChC,mBAACJ,EAAe,SAAf,CAAwB,MAAO,CAAE,MAAAE,EAAO,MAAAC,CA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SAAS,CACjB,KAAMI,EACN,SAAU,QACZ,CAAC,CACH,CACF,EACA,SACE,OAACvB,EAAc,QAAd,CACC,IAAKO,EACL,aAAW,MACT,8PACAG,EACAD,EAAoB,CAClB,MAAOG,CACT,CAAC,CACH,EACA,QAASI,EACR,GAAGV,EACN,CAEJ,CAAC,EACDX,EAAY,YAAcK,EAAc,QAAQ,YAEhD,MAAMP,EAAcK,EAAM,WAGxB,CAAC,CAAE,UAAAY,EAAW,GAAGJ,CAAM,EAAGC,OAAQ,OAACP,EAAc,QAAd,CAAsB,IAAKO,EAAK,aAAW,MAAGG,CAAS,EAAI,GAAGJ,EAAO,CAAE,EAC5Gb,EAAY,YAAcO,EAAc,QAAQ",
6
+ "names": ["tabs_exports", "__export", "Tabs", "TabsContent", "TabsList", "TabsTrigger", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "TabsPrimitive", "import_class_variance_authority", "TabListContext", "children", "align", "shape", "props", "ref", "tabsListVariants", "tabsTriggerVariants", "className", "alignFromParent", "shapeFromParent", "wrapperClass", "list", "onClick", "handleClick", "e", "tabElement", "container", "tabLeft", "tabWidth", "containerWidth", "scrollTo"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as p}from"react/jsx-runtime";import*as r from"react";import{cn as g}from"../../helpers/utils.js";import{cva as h}from"class-variance-authority";import w from"./useAnchorPosition.js";import{Container as L}from"../../components/container.js";import{withLayout as S}from"../../shared/Styles.js";const D=h("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),E=h("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),H=h("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),k={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},B={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},y=r.forwardRef(({classNames:l={},data:a,onItemClick:I,buttonStyle:s,className:V,...N},R)=>{const{alignment:x="start",theme:C="light",size:A="small"}=a,i=w(a.sectionIds?.map(t=>t.targetId)||[]),c=r.useRef(null),f=r.useRef(null),b=r.useRef([]);r.useImperativeHandle(R,()=>c.current);const u=C==="dark"?B:k,d={defaultColor:s?.defaultColor??u.defaultColor,activeColor:s?.activeColor??u.activeColor,activeIndicatorColor:s?.activeIndicatorColor??u.activeIndicatorColor},m=r.useCallback(t=>{const e=b.current[t];if(e&&f.current){const n=f.current,o=e,v=o.offsetLeft-n.offsetWidth/2+o.offsetWidth/2;typeof n.scrollTo=="function"&&n.scrollTo({left:v,behavior:"smooth"})}},[]);return r.useEffect(()=>{if(!i)return;const t=a.sectionIds?.findIndex(e=>e.targetId===i);t!==void 0&&t!==-1&&m(t)},[i,a.sectionIds,m]),p(L,{ref:c,className:g(H({theme:C}),l?.root),...N,children:p("div",{ref:f,className:g(D({alignment:x,size:A}),"relative",l?.content),children:a.sectionIds?.map((t,e)=>{const n=i===t.targetId;return p("button",{ref:o=>{o&&(b.current[e]=o)},"aria-current":n?!0:void 0,onClick:()=>{if(m(e),I){I(t,e);return}const o=document.getElementById(t.targetId);if(o&&c.current){const v=c.current.offsetHeight,T=o.getBoundingClientRect().top+window.scrollY-v;window.scrollTo({top:T,behavior:"smooth"})}},className:g(E({size:A}),n?[d.activeColor,d.activeIndicatorColor,"after:w-full after:opacity-100"]:d.defaultColor,l?.item),children:t.label},t.targetId)})})})});y.displayName="AnchorNavigation";var j=S(y);export{j as default};
1
+ "use client";import{jsx as p}from"react/jsx-runtime";import*as r from"react";import{cn as g}from"../../helpers/utils.js";import{cva as h}from"class-variance-authority";import L from"./useAnchorPosition.js";import{Container as S}from"../../components/container.js";import{withLayout as D}from"../../shared/Styles.js";const E=h("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),H=h("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),k=h("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"!bg-white",dark:"!bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),B={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},V={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},y=r.forwardRef(({classNames:l={},data:a,onItemClick:I,buttonStyle:s,className:R,...N},x)=>{const{alignment:T="start",theme:C="light",size:A="small"}=a,i=L(a.sectionIds?.map(t=>t.targetId)||[]),c=r.useRef(null),f=r.useRef(null),b=r.useRef([]);r.useImperativeHandle(x,()=>c.current);const u=C==="dark"?V:B,d={defaultColor:s?.defaultColor??u.defaultColor,activeColor:s?.activeColor??u.activeColor,activeIndicatorColor:s?.activeIndicatorColor??u.activeIndicatorColor},m=r.useCallback(t=>{const e=b.current[t];if(e&&f.current){const n=f.current,o=e,v=o.offsetLeft-n.offsetWidth/2+o.offsetWidth/2;typeof n.scrollTo=="function"&&n.scrollTo({left:v,behavior:"smooth"})}},[]);return r.useEffect(()=>{if(!i)return;const t=a.sectionIds?.findIndex(e=>e.targetId===i);t!==void 0&&t!==-1&&m(t)},[i,a.sectionIds,m]),p(S,{ref:c,className:g(k({theme:C}),R,l?.root),...N,children:p("div",{ref:f,className:g(E({alignment:T,size:A}),"relative",l?.content),children:a.sectionIds?.map((t,e)=>{const n=i===t.targetId;return p("button",{ref:o=>{o&&(b.current[e]=o)},"aria-current":n?!0:void 0,onClick:()=>{if(m(e),I){I(t,e);return}const o=document.getElementById(t.targetId);if(o&&c.current){const v=c.current.offsetHeight,w=o.getBoundingClientRect().top+window.scrollY-v;window.scrollTo({top:w,behavior:"smooth"})}},className:g(H({size:A}),n?[d.activeColor,d.activeIndicatorColor,"after:w-full after:opacity-100"]:d.defaultColor,l?.item),children:t.label},t.targetId)})})})});y.displayName="AnchorNavigation";var j=D(y);export{j as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AnchorNavigation/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default withLayout(AnchorNavigation)\n"],
5
- "mappings": "aAyMc,cAAAA,MAAA,oBAvMd,UAAYC,MAAW,QACvB,OAAS,MAA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AK,QAAQ,EAC3D,GAAIgB,GAAiBf,EAAQ,QAAS,CACpC,MAAMgB,EAAYhB,EAAQ,QAAQ,aAC5BiB,EAAiBF,EAAc,sBAAsB,EAAE,IAAM,OAAO,QAAUC,EAEpF,OAAO,SAAS,CACd,IAAKC,EACL,SAAU,QACZ,CAAC,CACH,CACF,EACA,UAAWxC,EACTM,EAAmB,CAAE,KAAAc,CAAK,CAAC,EAC3BgB,EACI,CACET,EAAoB,YACpBA,EAAoB,qBACpB,gCACF,EACAA,EAAoB,aACxBhB,GAAY,IACd,EAEC,SAAAW,EAAK,OAzCDA,EAAK,QA0CZ,CAEJ,CAAC,EACH,EACF,CAEJ,CACF,EAEAZ,EAAiB,YAAc,mBAC/B,IAAO+B,EAAQrC,EAAWM,CAAgB",
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: '!bg-white',\n dark: '!bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), className, classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default withLayout(AnchorNavigation)\n"],
5
+ "mappings": "aAyMc,cAAAA,MAAA,oBAvMd,UAAYC,MAAW,QACvB,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B,SAAS,eAAehB,EAAK,QAAQ,EAC3D,GAAIgB,GAAiBf,EAAQ,QAAS,CACpC,MAAMgB,EAAYhB,EAAQ,QAAQ,aAC5BiB,EAAiBF,EAAc,sBAAsB,EAAE,IAAM,OAAO,QAAUC,EAEpF,OAAO,SAAS,CACd,IAAKC,EACL,SAAU,QACZ,CAAC,CACH,CACF,EACA,UAAWxC,EACTM,EAAmB,CAAE,KAAAc,CAAK,CAAC,EAC3BgB,EACI,CACET,EAAoB,YACpBA,EAAoB,qBACpB,gCACF,EACAA,EAAoB,aACxBhB,GAAY,IACd,EAEC,SAAAW,EAAK,OAzCDA,EAAK,QA0CZ,CAEJ,CAAC,EACH,EACF,CAEJ,CACF,EAEAZ,EAAiB,YAAc,mBAC/B,IAAO+B,EAAQrC,EAAWM,CAAgB",
6
6
  "names": ["jsx", "React", "cn", "cva", "useAnchorPosition", "Container", "withLayout", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition", "AnchorNavigation_default"]
7
7
  }
@@ -88,6 +88,10 @@ export interface ProductContextType {
88
88
  product: Product;
89
89
  profile?: UserProfile;
90
90
  variant: ProductVariant;
91
+ resolvedPayload?: {
92
+ components: any[];
93
+ [key: string]: any;
94
+ };
91
95
  selectedVariants: Array<variantWithFinalPrice>;
92
96
  renderRating?: React.ReactNode;
93
97
  coupon?: VariantCoupon;
@@ -131,5 +135,5 @@ export interface ProductContextType {
131
135
  }
132
136
  export declare const BizProductContext: React.Context<ProductContextType>;
133
137
  export declare const useBizProductContext: () => ProductContextType;
134
- declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemption, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderInstallments, onUseCouponChange, onUseMemberDiscountChange, discount, buyNowLoading, addToCartLoading, }: PropsWithChildren<Omit<ProductContextType, "joinedRecommendBuyProducts" | "setJoinedRecommendBuyProducts" | "addOrder" | "setAddOrder">>) => import("react/jsx-runtime").JSX.Element;
138
+ declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemption, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderInstallments, onUseCouponChange, onUseMemberDiscountChange, discount, buyNowLoading, addToCartLoading, }: PropsWithChildren<Omit<ProductContextType, "joinedRecommendBuyProducts" | "setJoinedRecommendBuyProducts" | "addOrder" | "setAddOrder" | "resolvedPayload">>) => import("react/jsx-runtime").JSX.Element;
135
139
  export default ProductProvider;
@@ -1,2 +1,2 @@
1
- import{jsx as Y}from"react/jsx-runtime";import{createContext as K,useContext as a,useState as i,useEffect as Q}from"react";const t=K({}),te=()=>{if(!a(t))throw new Error("useProductContext must be used in <ProductProvider>");return a(t)},X=({product:n,isLogin:d,profile:c,isMobile:u,isDesktop:s,children:p,renderRating:l,freeGift:m,exchangePurchase:b,bundle:P,checkedBundle:g,checkedGift:h,setCheckedBundle:y,setCheckedGift:C,checkedExchangePurchase:f,setCheckedExchangePurchase:v,variant:e,selectedOptions:x,setSelectedOptions:S,compareData:D,coupon:B,finalPrice:R,comparePrice:A,totalSavings:O,savingDetail:k,setSavingDetail:_,selectedVariants:V,onAddToCart:M,onBuyNow:w,creditsRedemption:F,memberFunctionResult:T,openModal:G,openSignInPopup:J,openAuthCodePopup:L,openSignUpPopup:I,renderInstallments:N,onUseCouponChange:U,onUseMemberDiscountChange:E,discount:W,buyNowLoading:j,addToCartLoading:z})=>{const[q,o]=i({}),[H,r]=i([]);return Q(()=>{e?.id&&(o({bundle:{value:void 0,canOperate:!0},gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0}}),r([]))},[e?.id]),Y(t.Provider,{value:{product:n,variant:e,isMobile:u,isDesktop:s,isLogin:d,profile:c,coupon:B,renderRating:l,finalPrice:R,comparePrice:A,savingDetail:k,setSavingDetail:_,totalSavings:O,selectedOptions:x,setSelectedOptions:S,freeGift:m,exchangePurchase:b,checkedGift:h,setCheckedGift:C,checkedBundle:g,setCheckedBundle:y,bundle:P,compareData:D,selectedVariants:V,onAddToCart:M,onBuyNow:w,joinedRecommendBuyProducts:q,setJoinedRecommendBuyProducts:o,checkedExchangePurchase:f,setCheckedExchangePurchase:v,creditsRedemption:F,memberFunctionResult:T,openModal:G,openSignInPopup:J,openAuthCodePopup:L,openSignUpPopup:I,renderInstallments:N,onUseCouponChange:U,onUseMemberDiscountChange:E,discount:W,buyNowLoading:j,addToCartLoading:z,addOrder:H,setAddOrder:r},children:p})};var ne=X;export{t as BizProductContext,ne as default,te as useBizProductContext};
1
+ import{jsx as re}from"react/jsx-runtime";import{createContext as $,useContext as d,useState as c,useEffect as ee,useMemo as te}from"react";import{VARIANT_PAYLOAD_EXCLUDED_KEYS as ne}from"./const.js";const o=$({}),se=()=>{if(!d(o))throw new Error("useProductContext must be used in <ProductProvider>");return d(o)},oe=({product:t,isLogin:u,profile:s,isMobile:l,isDesktop:p,children:m,renderRating:P,freeGift:b,exchangePurchase:g,bundle:y,checkedBundle:h,checkedGift:f,setCheckedBundle:C,setCheckedGift:v,checkedExchangePurchase:x,setCheckedExchangePurchase:S,variant:e,selectedOptions:D,setSelectedOptions:R,compareData:B,coupon:A,finalPrice:k,comparePrice:O,totalSavings:_,savingDetail:V,setSavingDetail:M,selectedVariants:T,onAddToCart:E,onBuyNow:L,creditsRedemption:w,memberFunctionResult:F,openModal:N,openSignInPopup:G,openAuthCodePopup:I,openSignUpPopup:J,renderInstallments:U,onUseCouponChange:W,onUseMemberDiscountChange:j,discount:z,buyNowLoading:K,addToCartLoading:Y})=>{const[X,r]=c({}),[q,a]=c([]),H=te(()=>{const Q=e?.payload?.components??[],Z=ne;return Q.filter(n=>{const i=n.componentKey??n.blockType??n.blockName;return i&&!Z.includes(i)}).length>0?e?.payload:t?.payload},[e?.payload,t?.payload]);return ee(()=>{e?.id&&(r({bundle:{value:void 0,canOperate:!0},gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0}}),a([]))},[e?.id]),re(o.Provider,{value:{product:t,variant:e,isMobile:l,isDesktop:p,isLogin:u,profile:s,coupon:A,renderRating:P,finalPrice:k,comparePrice:O,savingDetail:V,setSavingDetail:M,totalSavings:_,selectedOptions:D,setSelectedOptions:R,freeGift:b,exchangePurchase:g,checkedGift:f,setCheckedGift:v,checkedBundle:h,setCheckedBundle:C,bundle:y,compareData:B,selectedVariants:T,onAddToCart:E,onBuyNow:L,joinedRecommendBuyProducts:X,setJoinedRecommendBuyProducts:r,checkedExchangePurchase:x,setCheckedExchangePurchase:S,creditsRedemption:w,memberFunctionResult:F,openModal:N,openSignInPopup:G,openAuthCodePopup:I,openSignUpPopup:J,renderInstallments:U,onUseCouponChange:W,onUseMemberDiscountChange:j,discount:z,buyNowLoading:K,addToCartLoading:Y,addOrder:q,setAddOrder:a,resolvedPayload:H},children:m})};var le=oe;export{o as BizProductContext,le as default,se as useBizProductContext};
2
2
  //# sourceMappingURL=BizProductProvider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Listing/BizProductProvider.tsx"],
4
- "sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n useEffect,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = {\n coupon: number\n bundle: number\n member: number\n freeGift: number\n compare: number\n exchangePurchase: number\n}\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\nexport type JoinedRecommendBuyProducts = {\n bundle?: {\n value?: BundleListItem\n canOperate?: boolean\n }\n gift?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n exchange?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n}\n\nexport type CreditsRedemption = {\n amount: number\n availablePoints: number\n usedPoints: number\n skuDetails?: {\n sku: string\n is_eligible: boolean\n }[]\n}\n\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: JoinedRecommendBuyProducts\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<JoinedRecommendBuyProducts>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemption?: CreditsRedemption\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderInstallments?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n buyNowLoading?: boolean\n addToCartLoading?: boolean\n addOrder?: Array<'bundle' | 'gift' | 'exchange'>\n setAddOrder?: Dispatch<SetStateAction<Array<'bundle' | 'gift' | 'exchange'>>>\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemption,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n}: PropsWithChildren<\n Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts' | 'addOrder' | 'setAddOrder'>\n>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<JoinedRecommendBuyProducts>({})\n const [addOrder, setAddOrder] = useState<Array<'bundle' | 'gift' | 'exchange'>>([])\n\n useEffect(() => {\n if (variant?.id) {\n setJoinedRecommendBuyProducts({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setAddOrder([])\n }\n }, [variant?.id])\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemption,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n addOrder,\n setAddOrder,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
5
- "mappings": "AAgQI,cAAAA,MAAA,oBAhQJ,OACE,iBAAAC,EAEA,cAAAC,EAIA,YAAAC,EACA,aAAAC,MACK,QAwKA,MAAMC,EAAoBJ,EAAkC,CAAC,CAAuB,EAE9EK,GAAuB,IAAM,CAExC,GAAI,CADYJ,EAAWG,CAAiB,EAE1C,MAAM,IAAI,MAAM,qDAAqD,EAEvE,OAAOH,EAAWG,CAAiB,CACrC,EAEME,EAAkB,CAAC,CACvB,QAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,wBAAAC,EACA,2BAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,kBAAAC,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,CACF,IAEM,CACJ,KAAM,CAACC,EAA4BC,CAA6B,EAAI/C,EAAqC,CAAC,CAAC,EACrG,CAACgD,EAAUC,CAAW,EAAIjD,EAAgD,CAAC,CAAC,EAElF,OAAAC,EAAU,IAAM,CACVoB,GAAS,KACX0B,EAA8B,CAC5B,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,CACF,CAAC,EACDE,EAAY,CAAC,CAAC,EAElB,EAAG,CAAC5B,GAAS,EAAE,CAAC,EAGdxB,EAACK,EAAkB,SAAlB,CACC,MAAO,CACL,QAAAG,EACA,QAAAgB,EACA,SAAAb,EACA,UAAAC,EACA,QAAAH,EACA,QAAAC,EACA,OAAAkB,EACA,aAAAd,EACA,WAAAe,EACA,aAAAC,EACA,aAAAE,EACA,gBAAAC,EACA,aAAAF,EACA,gBAAAN,EACA,mBAAAC,EACA,SAAAX,EACA,iBAAAC,EACA,YAAAG,EACA,eAAAE,EACA,cAAAH,EACA,iBAAAE,EACA,OAAAH,EACA,YAAAU,EACA,iBAAAO,EACA,YAAAC,EACA,SAAAC,EACA,2BAAAa,EACA,8BAAAC,EACA,wBAAA5B,EACA,2BAAAC,EACA,kBAAAc,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,SAAAG,EACA,YAAAC,CACF,EAEC,SAAAvC,EACH,CAEJ,EAEA,IAAOwC,GAAQ9C",
6
- "names": ["jsx", "createContext", "useContext", "useState", "useEffect", "BizProductContext", "useBizProductContext", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemption", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "buyNowLoading", "addToCartLoading", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "addOrder", "setAddOrder", "BizProductProvider_default"]
4
+ "sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n useEffect,\n useMemo,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\nimport { VARIANT_PAYLOAD_EXCLUDED_KEYS } from './const.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = {\n coupon: number\n bundle: number\n member: number\n freeGift: number\n compare: number\n exchangePurchase: number\n}\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\nexport type JoinedRecommendBuyProducts = {\n bundle?: {\n value?: BundleListItem\n canOperate?: boolean\n }\n gift?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n exchange?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n}\n\nexport type CreditsRedemption = {\n amount: number\n availablePoints: number\n usedPoints: number\n skuDetails?: {\n sku: string\n is_eligible: boolean\n }[]\n}\n\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n resolvedPayload?: {\n components: any[]\n [key: string]: any\n }\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: JoinedRecommendBuyProducts\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<JoinedRecommendBuyProducts>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemption?: CreditsRedemption\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderInstallments?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n buyNowLoading?: boolean\n addToCartLoading?: boolean\n addOrder?: Array<'bundle' | 'gift' | 'exchange'>\n setAddOrder?: Dispatch<SetStateAction<Array<'bundle' | 'gift' | 'exchange'>>>\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemption,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n}: PropsWithChildren<\n Omit<\n ProductContextType,\n 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts' | 'addOrder' | 'setAddOrder' | 'resolvedPayload'\n >\n>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<JoinedRecommendBuyProducts>({})\n const [addOrder, setAddOrder] = useState<Array<'bundle' | 'gift' | 'exchange'>>([])\n\n const resolvedPayload = useMemo(() => {\n const variantComponents: any[] = variant?.payload?.components ?? []\n const excluded = VARIANT_PAYLOAD_EXCLUDED_KEYS as readonly string[]\n const nonExcluded = variantComponents.filter(item => {\n const identifier = item.componentKey ?? item.blockType ?? item.blockName\n return identifier && !excluded.includes(identifier)\n })\n return nonExcluded.length > 0 ? variant?.payload : product?.payload\n }, [variant?.payload, product?.payload])\n\n useEffect(() => {\n if (variant?.id) {\n setJoinedRecommendBuyProducts({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setAddOrder([])\n }\n }, [variant?.id])\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemption,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n addOrder,\n setAddOrder,\n resolvedPayload,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
5
+ "mappings": "AAmRI,cAAAA,OAAA,oBAnRJ,OACE,iBAAAC,EAEA,cAAAC,EAIA,YAAAC,EACA,aAAAC,GACA,WAAAC,OACK,QAYP,OAAS,iCAAAC,OAAqC,aAiKvC,M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AAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,CACF,CAAC,EACDE,EAAY,CAAC,CAAC,EAElB,EAAG,CAAC5B,GAAS,EAAE,CAAC,EAGd1B,GAACO,EAAkB,SAAlB,CACC,MAAO,CACL,QAAAG,EACA,QAAAgB,EACA,SAAAb,EACA,UAAAC,EACA,QAAAH,EACA,QAAAC,EACA,OAAAkB,EACA,aAAAd,EACA,WAAAe,EACA,aAAAC,EACA,aAAAE,EACA,gBAAAC,EACA,aAAAF,EACA,gBAAAN,EACA,mBAAAC,EACA,SAAAX,EACA,iBAAAC,EACA,YAAAG,EACA,eAAAE,EACA,cAAAH,EACA,iBAAAE,EACA,OAAAH,EACA,YAAAU,EACA,iBAAAO,EACA,YAAAC,EACA,SAAAC,EACA,2BAAAa,EACA,8BAAAC,EACA,wBAAA5B,EACA,2BAAAC,EACA,kBAAAc,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,SAAAG,EACA,YAAAC,EACA,gBAAAC,CACF,EAEC,SAAAxC,EACH,CAEJ,EAEA,IAAO6C,GAAQnD",
6
+ "names": ["jsx", "createContext", "useContext", "useState", "useEffect", "useMemo", "VARIANT_PAYLOAD_EXCLUDED_KEYS", "BizProductContext", "useBizProductContext", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemption", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "buyNowLoading", "addToCartLoading", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "addOrder", "setAddOrder", "resolvedPayload", "variantComponents", "excluded", "item", "identifier", "BizProductProvider_default"]
7
7
  }
@@ -0,0 +1,13 @@
1
+ export interface CartActionButtonsProps {
2
+ availableForSale?: boolean;
3
+ addToCartText?: string;
4
+ buyNowText?: string;
5
+ addToCartLoading?: boolean;
6
+ buyNowLoading?: boolean;
7
+ addToCartClassName?: string;
8
+ buyNowClassName?: string;
9
+ onAddToCart?: () => void;
10
+ onBuyNow?: () => void;
11
+ }
12
+ declare const CartActionButtons: ({ availableForSale, addToCartText, buyNowText, addToCartLoading, buyNowLoading, addToCartClassName, buyNowClassName, onAddToCart, onBuyNow, }: CartActionButtonsProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default CartActionButtons;
@@ -0,0 +1,2 @@
1
+ import{Fragment as c,jsx as t,jsxs as g}from"react/jsx-runtime";import{Button as a}from"../../../../components/index.js";const C=({availableForSale:n=!0,addToCartText:e="Add to Cart",buyNowText:r="Buy Now",addToCartLoading:s=!1,buyNowLoading:i=!1,addToCartClassName:d="tablet:w-auto w-1/2",buyNowClassName:l="tablet:w-auto w-1/2",onAddToCart:u,onBuyNow:b})=>{const o=!n;return g(c,{children:[t(a,{variant:"secondary",disabled:o,size:"lg",className:d,onClick:u,loading:s,children:e}),t(a,{variant:"primary",disabled:o,size:"lg",loading:i,className:l,onClick:b,children:r})]})};var N=C;export{N as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/biz-components/Listing/components/CartActionButtons/index.tsx"],
4
+ "sourcesContent": ["import { Button } from '../../../../components/index.js'\n\nexport interface CartActionButtonsProps {\n availableForSale?: boolean\n addToCartText?: string\n buyNowText?: string\n addToCartLoading?: boolean\n buyNowLoading?: boolean\n addToCartClassName?: string\n buyNowClassName?: string\n onAddToCart?: () => void\n onBuyNow?: () => void\n}\n\nconst CartActionButtons = ({\n availableForSale = true,\n addToCartText = 'Add to Cart',\n buyNowText = 'Buy Now',\n addToCartLoading = false,\n buyNowLoading = false,\n addToCartClassName = 'tablet:w-auto w-1/2',\n buyNowClassName = 'tablet:w-auto w-1/2',\n onAddToCart,\n onBuyNow,\n}: CartActionButtonsProps) => {\n const disabled = !availableForSale\n\n return (\n <>\n <Button\n variant=\"secondary\"\n disabled={disabled}\n size=\"lg\"\n className={addToCartClassName}\n onClick={onAddToCart}\n loading={addToCartLoading}\n >\n {addToCartText}\n </Button>\n <Button\n variant=\"primary\"\n disabled={disabled}\n size=\"lg\"\n loading={buyNowLoading}\n className={buyNowClassName}\n onClick={onBuyNow}\n >\n {buyNowText}\n </Button>\n </>\n )\n}\n\nexport default CartActionButtons\n"],
5
+ "mappings": "AA4BI,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBA5BJ,OAAS,UAAAC,MAAc,kCAcvB,MAAMC,EAAoB,CAAC,CACzB,iBAAAC,EAAmB,GACnB,cAAAC,EAAgB,cAChB,WAAAC,EAAa,UACb,iBAAAC,EAAmB,GACnB,cAAAC,EAAgB,GAChB,mBAAAC,EAAqB,sBACrB,gBAAAC,EAAkB,sBAClB,YAAAC,EACA,SAAAC,CACF,IAA8B,CAC5B,MAAMC,EAAW,CAACT,EAElB,OACEH,EAAAF,EAAA,CACE,UAAAC,EAACE,EAAA,CACC,QAAQ,YACR,SAAUW,EACV,KAAK,KACL,UAAWJ,EACX,QAASE,EACT,QAASJ,EAER,SAAAF,EACH,EACAL,EAACE,EAAA,CACC,QAAQ,UACR,SAAUW,EACV,KAAK,KACL,QAASL,EACT,UAAWE,EACX,QAASE,EAER,SAAAN,EACH,GACF,CAEJ,EAEA,IAAOQ,EAAQX",
6
+ "names": ["Fragment", "jsx", "jsxs", "Button", "CartActionButtons", "availableForSale", "addToCartText", "buyNowText", "addToCartLoading", "buyNowLoading", "addToCartClassName", "buyNowClassName", "onAddToCart", "onBuyNow", "disabled", "CartActionButtons_default"]
7
+ }