@anker-in/headless-ui 1.3.37 → 1.3.39-alpha.1784616869310

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 (405) hide show
  1. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
  2. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
  3. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
  4. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
  5. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
  6. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
  7. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
  8. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
  9. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
  10. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
  11. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +2 -0
  12. package/dist/cjs/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
  13. package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
  14. package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
  15. package/dist/cjs/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
  16. package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
  17. package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
  18. package/dist/cjs/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
  19. package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
  20. package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
  21. package/dist/cjs/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
  22. package/dist/cjs/biz-components/AccessoriesShelf/index.d.ts +7 -0
  23. package/dist/cjs/biz-components/AccessoriesShelf/index.js +2 -0
  24. package/dist/cjs/biz-components/AccessoriesShelf/index.js.map +7 -0
  25. package/dist/cjs/biz-components/AccessoriesShelf/types.d.ts +16 -0
  26. package/dist/cjs/biz-components/AccessoriesShelf/types.js +2 -0
  27. package/dist/cjs/biz-components/AccessoriesShelf/types.js.map +7 -0
  28. package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +14 -0
  29. package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
  30. package/dist/cjs/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
  31. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
  32. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
  33. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
  34. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
  35. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
  36. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
  37. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +13 -0
  38. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
  39. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
  40. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
  41. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
  42. package/dist/cjs/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
  43. package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
  44. package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js +2 -0
  45. package/dist/cjs/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
  46. package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +54 -0
  47. package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
  48. package/dist/cjs/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
  49. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
  50. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
  51. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
  52. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
  53. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
  54. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
  55. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +9 -0
  56. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +2 -0
  57. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
  58. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
  59. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
  60. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
  61. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
  62. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
  63. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
  64. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +12 -0
  65. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
  66. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
  67. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
  68. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
  69. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
  70. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
  71. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
  72. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
  73. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
  74. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
  75. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
  76. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
  77. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +2 -0
  78. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
  79. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
  80. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
  81. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
  82. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
  83. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
  84. package/dist/cjs/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
  85. package/dist/cjs/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
  86. package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js +2 -0
  87. package/dist/cjs/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
  88. package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +36 -0
  89. package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
  90. package/dist/cjs/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
  91. package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
  92. package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js +2 -0
  93. package/dist/cjs/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
  94. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +47 -0
  95. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
  96. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
  97. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
  98. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
  99. package/dist/cjs/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
  100. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
  101. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
  102. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
  103. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
  104. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
  105. package/dist/cjs/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
  106. package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
  107. package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
  108. package/dist/cjs/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
  109. package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
  110. package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js +2 -0
  111. package/dist/cjs/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
  112. package/dist/cjs/biz-components/CartDetail/index.d.ts +16 -0
  113. package/dist/cjs/biz-components/CartDetail/index.js +2 -0
  114. package/dist/cjs/biz-components/CartDetail/index.js.map +7 -0
  115. package/dist/cjs/biz-components/CartDetail/types.d.ts +132 -0
  116. package/dist/cjs/biz-components/CartDetail/types.js +2 -0
  117. package/dist/cjs/biz-components/CartDetail/types.js.map +7 -0
  118. package/dist/cjs/biz-components/FeaturedBlogPosts/index.js +1 -1
  119. package/dist/cjs/biz-components/FeaturedBlogPosts/index.js.map +2 -2
  120. package/dist/cjs/biz-components/Ksp/index.d.ts +2 -0
  121. package/dist/cjs/biz-components/Ksp/index.js +1 -1
  122. package/dist/cjs/biz-components/Ksp/index.js.map +3 -3
  123. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +13 -9
  124. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  125. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  126. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.d.ts +9 -1
  127. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js +1 -1
  128. package/dist/cjs/biz-components/Listing/components/CartActionButtons/index.js.map +3 -3
  129. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  130. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  131. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  132. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
  133. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -0
  134. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  135. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  136. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.d.ts +48 -0
  137. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.js +2 -0
  138. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.js.map +7 -0
  139. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.d.ts +1 -1
  140. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  141. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
  142. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +0 -2
  143. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  144. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +4 -4
  145. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.d.ts +3 -0
  146. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js +2 -0
  147. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js.map +7 -0
  148. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.d.ts +115 -0
  149. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.js +2 -0
  150. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.js.map +7 -0
  151. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  152. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  153. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  154. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  155. package/dist/cjs/biz-components/Listing/components/index.d.ts +0 -1
  156. package/dist/cjs/biz-components/Listing/components/index.js +1 -1
  157. package/dist/cjs/biz-components/Listing/components/index.js.map +3 -3
  158. package/dist/cjs/biz-components/Listing/hooks/useBenefits.d.ts +8 -2
  159. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
  160. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  161. package/dist/cjs/biz-components/Listing/types/product.d.ts +0 -21
  162. package/dist/cjs/biz-components/Listing/types/product.js +1 -1
  163. package/dist/cjs/biz-components/Listing/types/product.js.map +1 -1
  164. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.d.ts +7 -0
  165. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.js +2 -0
  166. package/dist/cjs/biz-components/NotifyMeDialog/NotifyMeDialog.js.map +7 -0
  167. package/dist/cjs/biz-components/NotifyMeDialog/index.d.ts +2 -0
  168. package/dist/cjs/biz-components/NotifyMeDialog/index.js +2 -0
  169. package/dist/cjs/biz-components/NotifyMeDialog/index.js.map +7 -0
  170. package/dist/cjs/biz-components/NotifyMeDialog/types.d.ts +111 -0
  171. package/dist/cjs/biz-components/NotifyMeDialog/types.js +2 -0
  172. package/dist/cjs/biz-components/NotifyMeDialog/types.js.map +7 -0
  173. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  174. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  175. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  176. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  177. package/dist/cjs/biz-components/index.d.ts +11 -3
  178. package/dist/cjs/biz-components/index.js +1 -1
  179. package/dist/cjs/biz-components/index.js.map +3 -3
  180. package/dist/cjs/components/breadcrumb.d.ts +12 -0
  181. package/dist/cjs/components/breadcrumb.js +2 -0
  182. package/dist/cjs/components/breadcrumb.js.map +7 -0
  183. package/dist/cjs/components/index.d.ts +2 -0
  184. package/dist/cjs/components/index.js +1 -1
  185. package/dist/cjs/components/index.js.map +3 -3
  186. package/dist/cjs/components/input-number.d.ts +22 -0
  187. package/dist/cjs/components/input-number.js +1 -1
  188. package/dist/cjs/components/input-number.js.map +3 -3
  189. package/dist/cjs/components/input.d.ts +5 -0
  190. package/dist/cjs/components/input.js +1 -1
  191. package/dist/cjs/components/input.js.map +3 -3
  192. package/dist/cjs/components/tabs.js +1 -1
  193. package/dist/cjs/components/tabs.js.map +3 -3
  194. package/dist/cjs/components/toast.d.ts +25 -0
  195. package/dist/cjs/components/toast.js +2 -0
  196. package/dist/cjs/components/toast.js.map +7 -0
  197. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.d.ts +11 -0
  198. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js +2 -0
  199. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoriesProductGrid/index.js.map +7 -0
  200. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.d.ts +23 -0
  201. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js +2 -0
  202. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/ProductCard.js.map +7 -0
  203. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.d.ts +40 -0
  204. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js +2 -0
  205. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/index.js.map +7 -0
  206. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.d.ts +107 -0
  207. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js +1 -0
  208. package/dist/esm/biz-components/AccessoriesShelf/components/AccessoryShelf/types.js.map +7 -0
  209. package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.d.ts +22 -0
  210. package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js +2 -0
  211. package/dist/esm/biz-components/AccessoriesShelf/components/MainProductArea/index.js.map +7 -0
  212. package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.d.ts +10 -0
  213. package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js +2 -0
  214. package/dist/esm/biz-components/AccessoriesShelf/components/PromoBanner/index.js.map +7 -0
  215. package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.d.ts +9 -0
  216. package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js +2 -0
  217. package/dist/esm/biz-components/AccessoriesShelf/components/SectionHeader/index.js.map +7 -0
  218. package/dist/esm/biz-components/AccessoriesShelf/index.d.ts +7 -0
  219. package/dist/esm/biz-components/AccessoriesShelf/index.js +2 -0
  220. package/dist/esm/biz-components/AccessoriesShelf/index.js.map +7 -0
  221. package/dist/esm/biz-components/AccessoriesShelf/types.d.ts +16 -0
  222. package/dist/esm/biz-components/AccessoriesShelf/types.js +1 -0
  223. package/dist/esm/biz-components/AccessoriesShelf/types.js.map +7 -0
  224. package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.d.ts +14 -0
  225. package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js +2 -0
  226. package/dist/esm/biz-components/CartDetail/CartGiftSection/CartGiftSection.js.map +7 -0
  227. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.d.ts +11 -0
  228. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js +2 -0
  229. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/GiftConfirmDialog.js.map +7 -0
  230. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.d.ts +2 -0
  231. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js +2 -0
  232. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftConfirmDialog/index.js.map +7 -0
  233. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.d.ts +13 -0
  234. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js +2 -0
  235. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/GiftOptionRow.js.map +7 -0
  236. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.d.ts +2 -0
  237. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js +2 -0
  238. package/dist/esm/biz-components/CartDetail/CartGiftSection/components/GiftOptionRow/index.js.map +7 -0
  239. package/dist/esm/biz-components/CartDetail/CartGiftSection/index.d.ts +2 -0
  240. package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js +2 -0
  241. package/dist/esm/biz-components/CartDetail/CartGiftSection/index.js.map +7 -0
  242. package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.d.ts +54 -0
  243. package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js +2 -0
  244. package/dist/esm/biz-components/CartDetail/CartItemRow/CartItemRow.js.map +7 -0
  245. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.d.ts +4 -0
  246. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js +2 -0
  247. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/CartItemGiftShipping.js.map +7 -0
  248. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.d.ts +2 -0
  249. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js +2 -0
  250. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/index.js.map +7 -0
  251. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.d.ts +9 -0
  252. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js +1 -0
  253. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemGiftShipping/types.js.map +7 -0
  254. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.d.ts +11 -0
  255. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js +2 -0
  256. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/CartItemInfo.js.map +7 -0
  257. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.d.ts +2 -0
  258. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js +2 -0
  259. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemInfo/index.js.map +7 -0
  260. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.d.ts +12 -0
  261. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js +2 -0
  262. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/CartItemKsp.js.map +7 -0
  263. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.d.ts +2 -0
  264. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js +2 -0
  265. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemKsp/index.js.map +7 -0
  266. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.d.ts +4 -0
  267. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js +2 -0
  268. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/CartItemRemoveConfirm.js.map +7 -0
  269. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.d.ts +2 -0
  270. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js +2 -0
  271. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/index.js.map +7 -0
  272. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.d.ts +11 -0
  273. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js +1 -0
  274. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemRemoveConfirm/types.js.map +7 -0
  275. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.d.ts +8 -0
  276. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js +2 -0
  277. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/CartItemShipping.js.map +7 -0
  278. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.d.ts +2 -0
  279. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js +2 -0
  280. package/dist/esm/biz-components/CartDetail/CartItemRow/components/CartItemShipping/index.js.map +7 -0
  281. package/dist/esm/biz-components/CartDetail/CartItemRow/index.d.ts +2 -0
  282. package/dist/esm/biz-components/CartDetail/CartItemRow/index.js +2 -0
  283. package/dist/esm/biz-components/CartDetail/CartItemRow/index.js.map +7 -0
  284. package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.d.ts +36 -0
  285. package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js +2 -0
  286. package/dist/esm/biz-components/CartDetail/CartPerksSection/CartPerksSection.js.map +7 -0
  287. package/dist/esm/biz-components/CartDetail/CartPerksSection/index.d.ts +2 -0
  288. package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js +2 -0
  289. package/dist/esm/biz-components/CartDetail/CartPerksSection/index.js.map +7 -0
  290. package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.d.ts +47 -0
  291. package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js +2 -0
  292. package/dist/esm/biz-components/CartDetail/CartPriceSummary/CartPriceSummary.js.map +7 -0
  293. package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.d.ts +2 -0
  294. package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js +2 -0
  295. package/dist/esm/biz-components/CartDetail/CartPriceSummary/index.js.map +7 -0
  296. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.d.ts +26 -0
  297. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js +2 -0
  298. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/CartSummaryHeader.js.map +7 -0
  299. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.d.ts +2 -0
  300. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js +2 -0
  301. package/dist/esm/biz-components/CartDetail/CartSummaryHeader/index.js.map +7 -0
  302. package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.d.ts +10 -0
  303. package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js +2 -0
  304. package/dist/esm/biz-components/CartDetail/CartThirdParty/CartThirdParty.js.map +7 -0
  305. package/dist/esm/biz-components/CartDetail/CartThirdParty/index.d.ts +2 -0
  306. package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js +2 -0
  307. package/dist/esm/biz-components/CartDetail/CartThirdParty/index.js.map +7 -0
  308. package/dist/esm/biz-components/CartDetail/index.d.ts +16 -0
  309. package/dist/esm/biz-components/CartDetail/index.js +2 -0
  310. package/dist/esm/biz-components/CartDetail/index.js.map +7 -0
  311. package/dist/esm/biz-components/CartDetail/types.d.ts +132 -0
  312. package/dist/esm/biz-components/CartDetail/types.js +1 -0
  313. package/dist/esm/biz-components/CartDetail/types.js.map +7 -0
  314. package/dist/esm/biz-components/FeaturedBlogPosts/index.js +1 -1
  315. package/dist/esm/biz-components/FeaturedBlogPosts/index.js.map +2 -2
  316. package/dist/esm/biz-components/Ksp/index.d.ts +2 -0
  317. package/dist/esm/biz-components/Ksp/index.js +1 -1
  318. package/dist/esm/biz-components/Ksp/index.js.map +3 -3
  319. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +13 -9
  320. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  321. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  322. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.d.ts +9 -1
  323. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js +1 -1
  324. package/dist/esm/biz-components/Listing/components/CartActionButtons/index.js.map +3 -3
  325. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  326. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  327. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  328. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js.map +3 -3
  329. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -0
  330. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  331. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  332. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.d.ts +48 -0
  333. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.js +1 -0
  334. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/types.js.map +7 -0
  335. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.d.ts +1 -1
  336. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  337. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +3 -3
  338. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +0 -2
  339. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  340. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +3 -3
  341. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.d.ts +3 -0
  342. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js +2 -0
  343. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js.map +7 -0
  344. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.d.ts +115 -0
  345. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.js +1 -0
  346. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/types.js.map +7 -0
  347. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  348. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  349. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  350. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  351. package/dist/esm/biz-components/Listing/components/index.d.ts +0 -1
  352. package/dist/esm/biz-components/Listing/components/index.js +1 -1
  353. package/dist/esm/biz-components/Listing/components/index.js.map +2 -2
  354. package/dist/esm/biz-components/Listing/hooks/useBenefits.d.ts +8 -2
  355. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
  356. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  357. package/dist/esm/biz-components/Listing/types/product.d.ts +0 -21
  358. package/dist/esm/biz-components/Listing/types/product.js.map +1 -1
  359. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.d.ts +7 -0
  360. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.js +2 -0
  361. package/dist/esm/biz-components/NotifyMeDialog/NotifyMeDialog.js.map +7 -0
  362. package/dist/esm/biz-components/NotifyMeDialog/index.d.ts +2 -0
  363. package/dist/esm/biz-components/NotifyMeDialog/index.js +2 -0
  364. package/dist/esm/biz-components/NotifyMeDialog/index.js.map +7 -0
  365. package/dist/esm/biz-components/NotifyMeDialog/types.d.ts +111 -0
  366. package/dist/esm/biz-components/NotifyMeDialog/types.js +1 -0
  367. package/dist/esm/biz-components/NotifyMeDialog/types.js.map +7 -0
  368. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  369. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  370. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  371. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +2 -2
  372. package/dist/esm/biz-components/index.d.ts +11 -3
  373. package/dist/esm/biz-components/index.js +1 -1
  374. package/dist/esm/biz-components/index.js.map +3 -3
  375. package/dist/esm/components/breadcrumb.d.ts +12 -0
  376. package/dist/esm/components/breadcrumb.js +2 -0
  377. package/dist/esm/components/breadcrumb.js.map +7 -0
  378. package/dist/esm/components/index.d.ts +2 -0
  379. package/dist/esm/components/index.js +1 -1
  380. package/dist/esm/components/index.js.map +3 -3
  381. package/dist/esm/components/input-number.d.ts +22 -0
  382. package/dist/esm/components/input-number.js +1 -1
  383. package/dist/esm/components/input-number.js.map +3 -3
  384. package/dist/esm/components/input.d.ts +5 -0
  385. package/dist/esm/components/input.js +1 -1
  386. package/dist/esm/components/input.js.map +3 -3
  387. package/dist/esm/components/tabs.js +1 -1
  388. package/dist/esm/components/tabs.js.map +3 -3
  389. package/dist/esm/components/toast.d.ts +25 -0
  390. package/dist/esm/components/toast.js +2 -0
  391. package/dist/esm/components/toast.js.map +7 -0
  392. package/package.json +1 -1
  393. package/style.css +338 -0
  394. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +0 -2
  395. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +0 -2
  396. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +0 -7
  397. package/dist/cjs/biz-components/Listing/components/ProductCard/index.d.ts +0 -2
  398. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +0 -2
  399. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +0 -7
  400. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +0 -2
  401. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +0 -2
  402. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +0 -7
  403. package/dist/esm/biz-components/Listing/components/ProductCard/index.d.ts +0 -2
  404. package/dist/esm/biz-components/Listing/components/ProductCard/index.js +0 -2
  405. package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +0 -7
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as a,Picture as N,Checkbox as E}from"../../../../../../components/index.js";import{cn as x}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as D}from"../../../../BizProductProvider.js";import{formatPrice as h}from"../../../../utils/index.js";import{useAiuiContext as F}from"../../../../../AiuiProvider/index.js";import{withLayout as B}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const L=()=>{const{locale:c="us"}=F(),{tooltip:f,getTooltipProps:b}=T(),{checkedExchangePurchase:r,exchangePurchase:g,setCheckedBundle:O,setJoinedRecommendBuyProducts:d,setSavingDetail:P,setCheckedExchangePurchase:i,joinedRecommendBuyProducts:s,savingDetail:k,setAddOrder:n}=D(),{title:C,giftList:p=[],freeLabel:S}=g||{},m=w(()=>p?.filter(e=>e.availableForSale),[p]),v=e=>{r?.id===e.id?(i?.(void 0),d?.({...s,exchange:{value:void 0,canOperate:!0}}),P?.({...k,exchangePurchase:0}),n?.(l=>l.filter(u=>u!=="exchange"))):(i?.(e),d?.({...s,exchange:{value:e,canOperate:!1}}),n?.(l=>[...l.filter(y=>y!=="exchange"),"exchange"]))};return m?.length?o("div",{className:"ipc-product-detail-exchange-purchase",children:[t(a,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:C}),t("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:m.map(e=>o("div",{className:x("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":r?.id===e.id}),children:[t(E,{onCheckedChange:()=>v(e),size:"lg",className:x("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":r?.id===e.id}),id:e.id,checked:r?.id===e.id,value:e.id}),o("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[o("div",{className:"flex items-center gap-2",children:[t(N,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),t(a,{...b(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),t(z,{...f})]}),o("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[t(a,{className:"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold",html:h({amount:e?.finalPrice?.amount||0,locale:c,currencyCode:e?.finalPrice?.currencyCode||"USD"})}),t(a,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:h({amount:e.price.amount,locale:c,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var q=B(L);export{q as default};
1
+ var c=(b,a)=>()=>(a||b((a={exports:{}}).exports,a),a.exports);var d=c(()=>{});export default d();
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n } else {\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'exchange')\n return [...filtered, 'exchange']\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedExchangePurchase?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedExchangePurchase?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold\"\n html={formatPrice({\n amount: gift?.finalPrice?.amount || 0,\n locale,\n currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n })}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductExchangePurchase)\n"],
5
- "mappings": "AA8DM,cAAAA,EA0BQ,QAAAC,MA1BR,oBA9DN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAS,WAAAC,MAAe,QACxB,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,uCAE/B,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,EAAkB,iBAAAC,MAAqB,wCAEhD,MAAMC,EAA0B,IAAM,CACpC,KAAM,CAAE,OAAAC,EAAS,IAAK,EAAIL,EAAe,EACnC,CAAE,QAAAM,E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AAK,GACT,QAASlB,GAAyB,KAAOkB,EAAK,GAC9C,MAAOA,EAAK,GACb,EACDlC,EAAC,SACC,QAASkC,EAAK,GACd,UAAU,qFAEV,UAAAlC,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACG,EAAA,CAAQ,OAAQgC,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,EACrFnC,EAACE,EAAA,CACE,GAAGc,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,EACAnC,EAACY,EAAA,CAAe,GAAGG,EAAS,GAC9B,EACAd,EAAC,OAAI,UAAU,4DACb,UAAAD,EAACE,EAAA,CACC,UAAU,4EACV,KAAMM,EAAY,CAChB,OAAQ2B,GAAM,YAAY,QAAU,EACpC,OAAArB,EACA,aAAcqB,GAAM,YAAY,cAAgB,KAClD,CAAC,EACH,EACAnC,EAACE,EAAA,CACC,UAAU,yGACV,KAAMM,EAAY,CAChB,OAAQ2B,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IAjDKA,EAAK,EAkDZ,CACD,EACH,GACF,EA7DkC,IA+DtC,EAEA,IAAOC,EAAQ1B,EAAWG,CAAuB",
6
- "names": ["jsx", "jsxs", "Text", "Picture", "Checkbox", "cn", "useMemo", "useBizProductContext", "formatPrice", "useAiuiContext", "withLayout", "useFollowTooltip", "FollowTooltip", "ProductExchangePurchase", "locale", "tooltip", "getTooltipProps", "checkedExchangePurchase", "exchangePurchase", "setCheckedBundle", "setJoinedRecommendBuyProducts", "setSavingDetail", "setCheckedExchangePurchase", "joinedRecommendBuyProducts", "savingDetail", "setAddOrder", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "prev", "t", "gift", "ProductExchangePurchase_default"]
4
+ "sourcesContent": ["// import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\n// import { cn } from '../../../../../../helpers/index.js'\n// import { useMemo } from 'react'\n// import { useBizProductContext } from '../../../../BizProductProvider.js'\n// import { formatPrice } from '../../../../utils/index.js'\n// import { useAiuiContext } from '../../../../../AiuiProvider/index.js'\n// import type { ProductVariant, ProductPrice } from '../../../../types/product'\n// import { withLayout } from '../../../../../../shared/Styles.js'\n// import { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\n// const ProductExchangePurchase = () => {\n// const { locale = 'us' } = useAiuiContext()\n// const { tooltip, getTooltipProps } = useFollowTooltip()\n// const {\n// // checkedExchangePurchase,\n// // exchangePurchase,\n// setCheckedBundle,\n// setJoinedRecommendBuyProducts,\n// setSavingDetail,\n// // setCheckedExchangePurchase,\n// joinedRecommendBuyProducts,\n// savingDetail,\n// setAddOrder,\n// } = useBizProductContext()\n// const { title, giftList = [], freeLabel } = exchangePurchase || {}\n// const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n// const handleCheckboxClick = (value: ProductVariant) => {\n// if (checkedExchangePurchase?.id === value.id) {\n// setCheckedExchangePurchase?.(undefined)\n// setJoinedRecommendBuyProducts?.({\n// ...joinedRecommendBuyProducts,\n// exchange: {\n// value: undefined,\n// canOperate: true,\n// },\n// })\n// setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n// // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n// setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n// } else {\n// setCheckedExchangePurchase?.(value)\n// setJoinedRecommendBuyProducts?.({\n// ...joinedRecommendBuyProducts,\n// exchange: {\n// value,\n// canOperate: false,\n// },\n// })\n// // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n// setAddOrder?.(prev => {\n// // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n// const filtered = prev.filter(t => t !== 'exchange')\n// return [...filtered, 'exchange']\n// })\n// }\n// }\n\n// if (!availableGifts?.length) return null\n\n// return (\n// <div className=\"ipc-product-detail-exchange-purchase\">\n// <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n// <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n// {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n// <div\n// key={gift.id}\n// className={cn(\n// 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n// {\n// ['border-brand']: checkedExchangePurchase?.id === gift.id,\n// }\n// )}\n// >\n// <Checkbox\n// onCheckedChange={() => handleCheckboxClick(gift)}\n// size=\"lg\"\n// className={cn('rounded-full border-2 border-[#E4E5E6]', {\n// 'border-brand-0 data-[state=checked]:bg-brand-0': checkedExchangePurchase?.id === gift.id,\n// })}\n// id={gift.id}\n// checked={checkedExchangePurchase?.id === gift.id}\n// value={gift.id}\n// ></Checkbox>\n// <label\n// htmlFor={gift.id}\n// className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n// >\n// <div className=\"flex items-center gap-2\">\n// <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n// <Text\n// {...getTooltipProps(gift.product.title)}\n// className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n// html={gift.product.title}\n// />\n// <FollowTooltip {...tooltip} />\n// </div>\n// <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n// <Text\n// className=\"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold\"\n// html={formatPrice({\n// amount: gift?.finalPrice?.amount || 0,\n// locale,\n// currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n// })}\n// />\n// <Text\n// className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n// html={formatPrice({\n// amount: gift.price.amount,\n// locale,\n// currencyCode: gift.price.currencyCode,\n// })}\n// />\n// </div>\n// </label>\n// </div>\n// ))}\n// </div>\n// </div>\n// )\n// }\n\n// export default withLayout(ProductExchangePurchase)\n"],
5
+ "mappings": "8DAAA,IAAAA,EAAAC,EAAA",
6
+ "names": ["require_ProductExchangePurchase", "__commonJSMin"]
7
7
  }
@@ -0,0 +1,3 @@
1
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<unknown, "container" | keyof import("../../../../../../shared/Styles.js").StylesProps> & import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../index.js").ContainerProps & import("react").RefAttributes<unknown>> & {};
2
+ export default _default;
3
+ export type { ProductFunctionFreeGiftProps, FunctionFreeGiftItem } from './types.js';
@@ -0,0 +1,2 @@
1
+ import{jsx as o,jsxs as i}from"react/jsx-runtime";import{Text as n,Picture as v,Checkbox as y}from"../../../../../../components/index.js";import{cn as a}from"../../../../../../helpers/index.js";import{withLayout as G}from"../../../../../../shared/Styles.js";import{useFollowTooltip as P,FollowTooltip as w}from"../../../../hooks/useFollowTooltip.js";import{useBizProductContext as I}from"../../../../BizProductProvider.js";const u=()=>{const{functionFreeGift:r,checkedFunctionGifts:c,setCheckedFunctionGifts:p}=I();if(!r||!c||!p)return null;const{title:f,freeLabel:m,giftItems:s=[]}=r,{tooltip:x,getTooltipProps:h}=P(),g=r.mode==="multiple";if(!s.length)return null;const b=e=>c?.has(String(e.id))??!1,F=e=>{const t=String(e.id);p?.(k=>{const l=new Set(k),d=l.has(t);if(g){d?l.delete(t):l.add(t);const N=s.filter(C=>l.has(String(C.id)));r.onCheckedChange?.(N)}else l.clear(),d||l.add(t),r.onCheckedChange?.(d?void 0:e);return l})};return i("div",{className:a("ipc-product-detail-free-gift"),children:[o(n,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:f}),o("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:s.map(e=>{const t=b(e);return i("div",{className:a("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":t}),children:[o(y,{onCheckedChange:()=>F(e),size:"lg",className:a("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":t}),id:String(e.id),checked:t,value:String(e.id)}),i("label",{htmlFor:String(e.id),className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[i("div",{className:"flex items-center gap-2",children:[o(v,{source:e.imageUrl,className:"size-12 shrink-0",imgClassName:"h-full"}),o(n,{...h(e.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.title}),o(w,{...x})]}),i("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[m&&o(n,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]",html:m}),e.comparePrice&&o(n,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]",html:e.comparePrice})]})]})]},e.id)})})]})};u.displayName="ProductFunctionFreeGift";var D=G(u);export{D as default};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.tsx"],
4
+ "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\nimport type { FunctionFreeGiftItem } from './types.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nconst ProductFunctionFreeGift = () => {\n const { functionFreeGift: freeGift, checkedFunctionGifts, setCheckedFunctionGifts } = useBizProductContext()\n\n if (!freeGift) return null\n if (!checkedFunctionGifts || !setCheckedFunctionGifts) return null\n\n const { title, freeLabel, giftItems = [] } = freeGift\n const { tooltip, getTooltipProps } = useFollowTooltip()\n\n const isMultiple = freeGift.mode === 'multiple'\n\n if (!giftItems.length) return null\n\n const isChecked = (gift: FunctionFreeGiftItem): boolean => {\n return checkedFunctionGifts?.has(String(gift.id)) ?? false\n }\n\n const handleToggle = (gift: FunctionFreeGiftItem) => {\n const giftId = String(gift.id)\n setCheckedFunctionGifts?.(prev => {\n const next = new Set(prev)\n const alreadyChecked = next.has(giftId)\n\n if (isMultiple) {\n alreadyChecked ? next.delete(giftId) : next.add(giftId)\n const nextItems = giftItems.filter(g => next.has(String(g.id)))\n freeGift.onCheckedChange?.(nextItems)\n } else {\n next.clear()\n if (!alreadyChecked) {\n next.add(giftId)\n }\n freeGift.onCheckedChange?.(alreadyChecked ? undefined : gift)\n }\n return next\n })\n }\n\n return (\n <div className={cn('ipc-product-detail-free-gift')}>\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {giftItems.map(gift => {\n const checked = isChecked(gift)\n return (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n { 'border-brand': checked }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleToggle(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checked,\n })}\n id={String(gift.id)}\n checked={checked}\n value={String(gift.id)}\n />\n <label\n htmlFor={String(gift.id)}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.imageUrl} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n {freeLabel && (\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]\"\n html={freeLabel}\n />\n )}\n {gift.comparePrice && (\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]\"\n html={gift.comparePrice}\n />\n )}\n </div>\n </label>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nProductFunctionFreeGift.displayName = 'ProductFunctionFreeGift'\n\nexport default withLayout(ProductFunctionFreeGift)\nexport type { ProductFunctionFreeGiftProps, FunctionFreeGiftItem } from './types.js'\n"],
5
+ "mappings": "AA+CM,cAAAA,EA0BU,QAAAC,MA1BV,oBA/CN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,EAAkB,iBAAAC,MAAqB,wCAEhD,OAAS,wBAAAC,MAA4B,oCAErC,MAAMC,EAA0B,IAAM,CACpC,KAAM,CAAE,iBAAkBC,EAAU,qBAAAC,EAAsB,wBAAAC,CAAwB,EAAIJ,EAAqB,EAG3G,GADI,CAACE,GACD,CAACC,GAAwB,CAACC,EAAyB,OAAO,KAE9D,KAAM,CAAE,MAAAC,EAAO,UAAAC,EAAW,UAAAC,EAAY,CAAC,CAAE,EAAIL,EACvC,CAAE,QAAAM,EAAS,gBAAAC,CAAgB,EAAIX,EAAiB,EAEhDY,EAAaR,EAAS,OAAS,WAErC,GAAI,CAACK,EAAU,OAAQ,OAAO,KAE9B,MAAMI,EAAaC,GACVT,GAAsB,IAAI,OAAOS,EAAK,EAAE,CAAC,GAAK,GAGjDC,E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AACQ,EAAA,CAAe,GAAGS,EAAS,GAC9B,EACAhB,EAAC,OAAI,UAAU,4DACZ,UAAAc,GACCf,EAACE,EAAA,CACC,UAAU,4EACV,KAAMa,EACR,EAEDM,EAAK,cACJrB,EAACE,EAAA,CACC,UAAU,wGACV,KAAMmB,EAAK,aACb,GAEJ,GACF,IA3CKA,EAAK,EA4CZ,CAEJ,CAAC,EACH,GACF,CAEJ,EAEAX,EAAwB,YAAc,0BAEtC,IAAOoB,EAAQxB,EAAWI,CAAuB",
6
+ "names": ["jsx", "jsxs", "Text", "Picture", "Checkbox", "cn", "withLayout", "useFollowTooltip", "FollowTooltip", "useBizProductContext", "ProductFunctionFreeGift", "freeGift", "checkedFunctionGifts", "setCheckedFunctionGifts", "title", "freeLabel", "giftItems", "tooltip", "getTooltipProps", "isMultiple", "isChecked", "gift", "handleToggle", "giftId", "prev", "next", "alreadyChecked", "nextItems", "g", "checked", "ProductFunctionFreeGift_default"]
7
+ }
@@ -0,0 +1,115 @@
1
+ /**
2
+ * 单个买赠礼品项
3
+ *
4
+ * 由业务端将 API reward_list 映射而来,所有展示字段已处理为字符串,
5
+ * 组件内部不再做任何格式化计算。
6
+ */
7
+ export interface FunctionFreeGiftItem {
8
+ /**
9
+ * 礼品唯一标识符,用于 checkbox 选中判断
10
+ * 通常对应 API 中的 variant_id
11
+ */
12
+ id: string | number;
13
+ /** 商品标题,业务端从商品数据中获取后传入 */
14
+ title: string;
15
+ /** 商品主图 URL(可选,业务端提供) */
16
+ imageUrl?: string;
17
+ /**
18
+ * 格式化后的划线原价字符串(可选)
19
+ * 仅在有原价需要展示时传入,组件会显示划线样式
20
+ * 示例:'$89.99'、'€79,99'
21
+ */
22
+ comparePrice?: string;
23
+ }
24
+ interface ProductFunctionFreeGiftBaseProps {
25
+ /** 区块标题文案,支持 HTML */
26
+ title?: string;
27
+ /**
28
+ * "FREE" 标签文案,所有礼品共享同一个标签
29
+ * 示例:'FREE'、'Gift'、'Free Gift'
30
+ * 来源:API discount_label.cart_checkout_label
31
+ */
32
+ freeLabel?: string;
33
+ /**
34
+ * 礼品列表
35
+ * 业务端负责:过滤可用项(availableForSale)、映射数据结构
36
+ * 组件直接渲染,不做额外过滤
37
+ */
38
+ giftItems?: FunctionFreeGiftItem[];
39
+ className?: string;
40
+ }
41
+ /**
42
+ * 单选模式(默认)
43
+ * 同一时刻最多选中一个礼品;再次点击已选中项则取消选中。
44
+ *
45
+ * @example
46
+ * ```tsx
47
+ * <ProductFreeGift
48
+ * title="Choose a free gift"
49
+ * freeLabel="FREE"
50
+ * giftItems={items}
51
+ * checkedId={selectedId}
52
+ * onCheckedChange={(gift) => setSelectedId(gift?.id)}
53
+ * />
54
+ * ```
55
+ */
56
+ interface ProductFunctionFreeGiftSingleProps extends ProductFunctionFreeGiftBaseProps {
57
+ mode?: 'single';
58
+ /** 当前选中的礼品 id;undefined 表示无选中 */
59
+ checkedId?: string | number;
60
+ /** 选中时返回 FreeGiftItem,取消选中时返回 undefined */
61
+ onCheckedChange?: (gift?: FunctionFreeGiftItem) => void;
62
+ checkedIds?: never;
63
+ }
64
+ /**
65
+ * 多选模式
66
+ * 可同时选中多个礼品,回调始终返回当前全部已选项数组。
67
+ *
68
+ * @example
69
+ * ```tsx
70
+ * <ProductFreeGift
71
+ * mode="multiple"
72
+ * title="Choose your free gifts"
73
+ * freeLabel="FREE"
74
+ * giftItems={items}
75
+ * checkedIds={selectedIds}
76
+ * onCheckedChange={(gifts) => setSelectedIds(gifts.map(g => g.id))}
77
+ * />
78
+ * ```
79
+ */
80
+ interface ProductFunctionFreeGiftMultipleProps extends ProductFunctionFreeGiftBaseProps {
81
+ mode: 'multiple';
82
+ /** 当前选中的礼品 id 数组;空数组表示无选中 */
83
+ checkedIds?: (string | number)[];
84
+ /** 每次勾选/取消后返回当前全部已选的 FreeGiftItem 数组 */
85
+ onCheckedChange?: (gifts: FunctionFreeGiftItem[]) => void;
86
+ checkedId?: never;
87
+ }
88
+ export type ProductFunctionFreeGiftProps = ProductFunctionFreeGiftSingleProps | ProductFunctionFreeGiftMultipleProps;
89
+ export {};
90
+ /**
91
+ * 业务端 free gift rule API 数据结构
92
+ *
93
+ * @example
94
+ * ```json
95
+ * {
96
+ * "rule_id": 1598,
97
+ * "rule_type": 1,
98
+ * "discount_label": {
99
+ * "cart_checkout_label": "Gift",
100
+ * "product_label": "",
101
+ * "sold_out_label": ""
102
+ * },
103
+ * "frontend_labels": null,
104
+ * "apply_unit": 1,
105
+ * "discount_combinations": { ... },
106
+ * "gift_type": 1,
107
+ * "reward_list": [
108
+ * {
109
+ * "get_unit": 1,
110
+ * "variant_list": [{ "variant_id": "44302515404975", "sku": "A3062Z11-97", "handle": "a3062z11-97-travel-case" }]
111
+ * }
112
+ * ]
113
+ * }
114
+ * ```
115
+ */
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Text as s,Button as _,Grid as ee,GridItem as J,Picture as A,Heading as te}from"../../../../../components/index.js";import{useBizProductContext as S}from"../../../BizProductProvider.js";import{useComponentData as ae}from"../../../hooks/useComponentData.js";import{useEffect as oe,useMemo as T,useState as ne}from"react";import{formatPrice as N}from"../../../utils/index.js";import{useAiuiContext as j}from"../../../../AiuiProvider/index.js";import Q from"decimal.js";import{replaceTemplate as le}from"../../../utils/textFormat.js";import{withLayout as re}from"../../../../../shared/Styles.js";import{ExposureDetector as ie}from"../../../../../components/index.js";import{gaTrack as ce}from"../../../../../shared/track.js";import se from"../../CartActionButtons/index.js";const de=()=>{const{locale:m="us",copyWriting:a,trackingData:g}=j(),{product:p,variant:n,finalPrice:x,comparePrice:v,coupon:k,selectedOptions:d,selectedVariants:r,totalSavings:B,onAddToCart:w,onBuyNow:E,savingDetail:f,checkedBundle:y,joinedRecommendBuyProducts:t,setJoinedRecommendBuyProducts:P,setSavingDetail:C,addToCartLoading:L,buyNowLoading:U,profile:G,addOrder:$,setAddOrder:D}=S(),I=g?.showComparePrice??!0,F=ae("ProductSummary")??{},[z]=r,V=T(()=>{const i=y?.variants.find(h=>h.variant.sku===z?.sku),l=new Q(z?.price?.amount||0).minus(i?.price||z?.price?.amount).toNumber();let u=new Q(z?.price?.amount||0);G?.email&&(u=u.minus(f?.member||0));const b=u.minus(f?.coupon).minus(l).toNumber();return parseFloat(b.toFixed(2))},[z,y,G,f?.member,f?.coupon]),{bundleVariant:R,giftVariant:W,exchangeVariant:q}=pe()||{},[c,O]=ne();oe(()=>{O({bundle:t.bundle?.value?void 0:R,gift:t.gift?.value?void 0:W,exchange:t.exchange?.value?void 0:q})},[R,W,q,t]);const X=T(()=>{const i=[];return $&&$.forEach((l,u)=>{t[l]?.value&&i.push({type:l,key:`${l}-${u}`})}),i},[$,t]),Y=T(()=>{const i=d?.quantity||"",l=d?.color||d?.colour||d?.couleur||"";return`${i&&l?`${i} | ${l}`:i||l}`},[d?.quantity,d?.color,d?.colour,d?.couleur]),Z=T(()=>{const{image_1920:i,image_1440:l,image_1024:u,image_768:b,image_390:h}=F?.thumbnail||{};return(F?.thumbnail?`${i} 1920, ${l} 1440, ${u} 1024, ${b} 768, ${h} 390`:n.image?.url)||n.image?.url},[F?.thumbnail,n.image?.url]);return n.availableForSale?e("div",{className:"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16",children:e("div",{className:"laptop:rounded-2xl bg-[#F5F5F7]",children:o(ee,{className:"tablet:p-8 tablet:!pb-0 px-4 pt-6",children:[o(J,{className:"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4",children:[e(te,{className:"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]",html:F?.readyWant?.replace?.("{title}",p?.title)}),e("div",{className:"",children:e(A,{source:Z,className:"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]",imgClassName:"object-cover h-full"})})]}),o(J,{className:"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6",children:[o("div",{children:[o("div",{className:"flex flex-col gap-4",children:[e(ie,{exposureKey:"listing_selector",onExposure:()=>{ce({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${n.sku}`,component_type:"image",component_name:"listing_selector",position:1}})},children:o("div",{className:"flex items-center justify-between gap-6",children:[o("div",{className:"flex items-center gap-4",children:[e(A,{source:n.image?.url||p?.images?.[0]?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),o("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[e(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:p.title}),e(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:Y})]})]}),o("div",{className:"flex items-center gap-1",children:[e(s,{className:"laptop-md:text-2xl text-base font-bold",html:N({amount:V,currencyCode:n.price.currencyCode,locale:m})}),I&&V<n?.price?.amount&&e(s,{className:"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through",html:N({amount:n?.price?.amount,currencyCode:n.price.currencyCode,locale:m})})]})]})}),X.map(({type:i,key:l})=>i==="gift"&&t?.gift?.value?e(K,{giftOperation:u=>{P?.({...t,gift:{value:void 0,canOperate:!0}}),O?.({...c,gift:u}),D?.(b=>b.filter(h=>h!=="gift"))},status:!!t?.gift,gift:t?.gift?.value,canOperate:t?.gift?.canOperate},l):i==="bundle"&&t?.bundle?.value?e(H,{bundleOperation:u=>{P?.({...t,bundle:{value:void 0,canOperate:!0}}),O?.({...c,bundle:u}),D?.(b=>b.filter(h=>h!=="bundle"))},status:!!t?.bundle,bundleListItem:t?.bundle?.value,canOperate:t?.bundle?.canOperate},l):i==="exchange"&&t?.exchange?.value?e(M,{exchangeOperation:u=>{P?.({...t,exchange:{value:void 0,canOperate:!0}}),O?.({...c,exchange:u}),D?.(b=>b.filter(h=>h!=="exchange"))},status:!!t?.exchange,canOperate:t?.exchange?.canOperate,exchange:t?.exchange?.value},l):null)]}),(c?.bundle||c?.gift||c?.exchange)&&o("div",{className:"laptop-md:mt-8 mt-6",children:[e(s,{className:"laptop-md:text-[18px] text-sm font-bold",html:F?.recommendBuy}),o("div",{className:"laptop-md:gap-4 mt-4 flex flex-col gap-6",children:[c?.exchange&&e(M,{exchangeOperation:i=>{P?.({...t,exchange:{value:i,canOperate:!0}}),O?.({...c,exchange:void 0}),D?.(l=>[...l,"exchange"])},canOperate:t?.exchange?.canOperate,status:!c?.exchange,exchange:c?.exchange}),c?.bundle&&e(H,{bundleOperation:i=>{C?.({...f,exchangePurchase:0}),P?.({...t,bundle:{value:i,canOperate:!0}}),O?.({...c,bundle:void 0}),D?.(l=>[...l,"bundle"])},canOperate:t?.bundle?.canOperate,status:!c?.bundle,bundleListItem:c?.bundle}),c?.gift&&e(K,{giftOperation:i=>{P?.({...t,gift:{value:i,canOperate:!0}}),O?.({...c,gift:void 0}),D?.(l=>[...l,"gift"])},canOperate:t?.gift?.canOperate,status:!c?.gift,gift:c?.gift})]})]})]}),o("div",{className:"text-right",children:[e(s,{className:"laptop:text-xl laptop-md:text-2xl text-right font-bold",html:`${le(a?.totalPrice||"",{amount:N({amount:parseFloat(x.toFixed(2)),currencyCode:n.price.currencyCode,locale:m})})}`}),I&&B>0&&e(s,{className:"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through",html:N({amount:v,currencyCode:n.price.currencyCode,locale:m})}),e("div",{className:"mt-4 flex justify-end gap-3",children:e(se,{availableForSale:n.availableForSale,addToCartText:a?.addToCart,buyNowText:a?.shopNow,addToCartLoading:L,buyNowLoading:U,addToCartClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",buyNowClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",onAddToCart:w,onBuyNow:E})})]})]})]})})}):null},pe=()=>{const{bundle:m,variant:a,checkedBundle:g,freeGift:p,checkedGift:n,exchangePurchase:x,checkedExchangePurchase:v}=S();let k,d,r;const{bundleList:B}=m||{},{giftList:w=[]}=p||{},{giftList:E=[]}=x||{},f=B?.filter(C=>C.variants.slice(1,C.variants.length).every(L=>L.variant.availableForSale))||[],[y]=f;k=g||y;const[t]=w?.filter(C=>C.availableForSale)??[];d=n||t;const[P]=E?.filter(C=>C.availableForSale)??[];return r=v||P,{bundleVariant:k,giftVariant:d,exchangeVariant:r}},H=({bundleOperation:m,bundleListItem:a,canOperate:g,status:p})=>{const{locale:n="us",copyWriting:x}=j(),{variant:v,setCheckedBundle:k}=S(),d=a?.variants.filter(r=>r.variant.sku!==v.sku);return e("div",{className:"",children:d?.map(r=>o("div",{className:"flex items-center justify-between gap-4",children:[o("div",{className:"flex items-center gap-4",children:[e(A,{source:r?.variant?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),e("div",{className:"tablet:max-w-none line-clamp-2 flex max-w-[178px] flex-col gap-[6px]",children:e(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold",html:r.variant.product.title})})]}),o("div",{className:"flex flex-col items-end justify-center gap-1",children:[!!a&&o("div",{className:"flex items-center gap-1",children:[e(s,{className:"laptop-md:text-2xl text-base font-bold",html:N({amount:r?.price||0,locale:n,currencyCode:r.variant?.price?.currencyCode||""})}),r.price<r.variant.price.amount&&e(s,{className:"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:N({amount:r.variant.price.amount||0,locale:n,currencyCode:r.variant?.price?.currencyCode||""})})]}),g&&e(_,{size:"icon",variant:"link",onClick:()=>{k?.(p?void 0:a),m?.(a)},className:"size-auto shrink-0 underline",children:p?x?.remove:x?.add})]})]},r.variant.id))})},K=({giftOperation:m,gift:a,status:g,canOperate:p})=>{const{locale:n="us",copyWriting:x}=j(),{freeGift:v,setCheckedGift:k}=S(),{freeLabel:d}=v||{},{options:r}=a||{},B=T(()=>{const w=r?.find(t=>t.name==="color"||t.name==="colour"||t.name==="couleur")||{},E=r?.find(t=>t.name==="quantity")||{},f=w?w.values?.[0]?.label:"",y=E?E.values?.[0]?.label:"";return`${f&&y?y+" | "+f:y||f} | ${d}`},[d,r]);return o("div",{className:"flex items-center justify-between gap-6",children:[o("div",{className:"flex items-center gap-4",children:[e(A,{source:a?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),o("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[e(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:a?.product?.title}),e(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:B})]})]}),o("div",{className:"flex flex-col items-end justify-center gap-2",children:[!!a&&o("div",{className:"flex items-center gap-1",children:[e(s,{className:"laptop-md:text-2xl text-base font-bold",html:d}),e(s,{className:"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:N({amount:a.price.amount,locale:n,currencyCode:a.price.currencyCode})})]}),p&&e(_,{size:"icon",variant:"link",onClick:()=>{k?.(g?void 0:a),m(a)},className:"size-auto shrink-0 underline",children:g?x?.remove:x?.add})]})]})},M=({exchangeOperation:m,exchange:a,canOperate:g,status:p})=>{const{locale:n="us",copyWriting:x}=j(),{setCheckedExchangePurchase:v}=S();return o("div",{className:"flex items-center justify-between gap-6",children:[o("div",{className:"flex items-center gap-4",children:[e(A,{source:a?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),o("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[e(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:a?.product?.title}),e(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]"})]})]}),o("div",{className:"flex flex-col items-end justify-center gap-2",children:[!!a&&o("div",{className:"flex items-center gap-1",children:[e(s,{className:"laptop-md:text-2xl text-base font-bold",html:N({amount:a.finalPrice?.amount||0,locale:n,currencyCode:a.price.currencyCode})}),e(s,{className:"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:N({amount:a.price?.amount||0,locale:n,currencyCode:a.price.currencyCode})})]}),g&&e(_,{size:"icon",variant:"link",onClick:()=>{v?.(p?void 0:a),m(a)},className:"size-auto shrink-0 underline",children:p?x?.remove:x?.add})]})]})};var we=re(de);export{we as default};
1
+ import{jsx as t,jsxs as l}from"react/jsx-runtime";import{Text as s,Button as K,Grid as U,GridItem as M,Picture as T,Heading as X}from"../../../../../components/index.js";import{useBizProductContext as B}from"../../../BizProductProvider.js";import{useComponentData as Y}from"../../../hooks/useComponentData.js";import{useEffect as Z,useMemo as N,useState as tt}from"react";import{formatPrice as h}from"../../../utils/index.js";import{useAiuiContext as V}from"../../../../AiuiProvider/index.js";import et from"decimal.js";import{replaceTemplate as at}from"../../../utils/textFormat.js";import{withLayout as ot}from"../../../../../shared/Styles.js";import{ExposureDetector as lt}from"../../../../../components/index.js";import{gaTrack as it}from"../../../../../shared/track.js";import rt from"../../CartActionButtons/index.js";const nt=()=>{const{locale:p="us",copyWriting:r,trackingData:f}=V(),{product:m,variant:e,finalPrice:d,comparePrice:x,coupon:C,selectedOptions:n,selectedVariants:g,totalSavings:k,onAddToCart:P,onBuyNow:w,savingDetail:c,checkedBundle:v,joinedRecommendBuyProducts:a,setJoinedRecommendBuyProducts:$,setSavingDetail:ct,addToCartLoading:I,buyNowLoading:R,notifyMeMode:q,onNotifyMeClick:W,profile:A,addOrder:D,setAddOrder:S}=B(),_=f?.showComparePrice??!0,b=Y("ProductSummary")??{},[G]=g,j=N(()=>{let o=new et(G?.price?.amount||0);A?.email&&(o=o.minus(c?.member||0));const i=o.minus(c?.coupon).toNumber();return parseFloat(i.toFixed(2))},[G,v,A,c?.member,c?.coupon]),{giftVariant:z}=st()||{},[u,O]=tt();Z(()=>{O({gift:a.gift?.value?void 0:z})},[z,a]);const J=N(()=>{const o=[];return D&&D.forEach((i,y)=>{a[i]?.value&&o.push({type:i,key:`${i}-${y}`})}),o},[D,a]),Q=N(()=>{const o=n?.quantity||"",i=n?.color||n?.colour||n?.couleur||"";return`${o&&i?`${o} | ${i}`:o||i}`},[n?.quantity,n?.color,n?.colour,n?.couleur]),H=N(()=>{const{image_1920:o,image_1440:i,image_1024:y,image_768:E,image_390:F}=b?.thumbnail||{};return(b?.thumbnail?`${o} 1920, ${i} 1440, ${y} 1024, ${E} 768, ${F} 390`:e.image?.url)||e.image?.url},[b?.thumbnail,e.image?.url]);return e.availableForSale?t("div",{className:"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16",children:t("div",{className:"laptop:rounded-2xl bg-[#F5F5F7]",children:l(U,{className:"tablet:p-8 tablet:!pb-0 px-4 pt-6",children:[l(M,{className:"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4",children:[t(X,{className:"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]",html:b?.readyWant?.replace?.("{title}",m?.title)}),t("div",{className:"",children:t(T,{source:H,className:"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]",imgClassName:"object-cover h-full"})})]}),l(M,{className:"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6",children:[l("div",{children:[l("div",{className:"flex flex-col gap-4",children:[t(lt,{exposureKey:"listing_selector",onExposure:()=>{it({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${e.sku}`,component_type:"image",component_name:"listing_selector",position:1}})},children:l("div",{className:"flex items-center justify-between gap-6",children:[l("div",{className:"flex items-center gap-4",children:[t(T,{source:e.image?.url||m?.images?.[0]?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),l("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[t(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:m.title}),t(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:Q})]})]}),l("div",{className:"flex items-center gap-1",children:[t(s,{className:"laptop-md:text-2xl text-base font-bold",html:h({amount:j,currencyCode:e.price.currencyCode,locale:p})}),_&&j<e?.price?.amount&&t(s,{className:"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through",html:h({amount:e?.price?.amount,currencyCode:e.price.currencyCode,locale:p})})]})]})}),J.map(({type:o,key:i})=>o==="gift"&&a?.gift?.value?t(L,{giftOperation:y=>{$?.({...a,gift:{value:void 0,canOperate:!0}}),O?.({...u,gift:y}),S?.(E=>E.filter(F=>F!=="gift"))},status:!!a?.gift,gift:a?.gift?.value,canOperate:a?.gift?.canOperate},i):null)]}),u?.gift&&l("div",{className:"laptop-md:mt-8 mt-6",children:[t(s,{className:"laptop-md:text-[18px] text-sm font-bold",html:b?.recommendBuy}),t("div",{className:"laptop-md:gap-4 mt-4 flex flex-col gap-6",children:u?.gift&&t(L,{giftOperation:o=>{$?.({...a,gift:{value:o,canOperate:!0}}),O?.({...u,gift:void 0}),S?.(i=>[...i,"gift"])},canOperate:a?.gift?.canOperate,status:!u?.gift,gift:u?.gift})})]})]}),l("div",{className:"text-right",children:[t(s,{className:"laptop:text-xl laptop-md:text-2xl text-right font-bold",html:`${at(r?.totalPrice||"",{amount:h({amount:parseFloat(d.toFixed(2)),currencyCode:e.price.currencyCode,locale:p})})}`}),_&&k>0&&t(s,{className:"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through",html:h({amount:x,currencyCode:e.price.currencyCode,locale:p})}),t("div",{className:"mt-4 flex justify-end gap-3",children:t(rt,{mode:q,availableForSale:e.availableForSale,addToCartText:r?.addToCart,buyNowText:r?.shopNow,addToCartLoading:I,buyNowLoading:R,addToCartClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",buyNowClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",onAddToCart:P,onBuyNow:w,onNotifyMeClick:W,notifyMeText:r?.notifyMe,notifyMeClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2"})})]})]})]})})}):null},st=()=>{const{bundle:p,variant:r,checkedBundle:f,freeGift:m,checkedGift:e}=B();let d;const{giftList:x=[]}=m||{},[C]=x?.filter(n=>n.availableForSale)??[];return d=e||C,{giftVariant:d}},L=({giftOperation:p,gift:r,status:f,canOperate:m})=>{const{locale:e="us",copyWriting:d}=V(),{freeGift:x,setCheckedGift:C}=B(),{freeLabel:n}=x||{},{options:g}=r||{},k=N(()=>{const P=g?.find(a=>a.name==="color"||a.name==="colour"||a.name==="couleur")||{},w=g?.find(a=>a.name==="quantity")||{},c=P?P.values?.[0]?.label:"",v=w?w.values?.[0]?.label:"";return`${c&&v?v+" | "+c:v||c} | ${n}`},[n,g]);return l("div",{className:"flex items-center justify-between gap-6",children:[l("div",{className:"flex items-center gap-4",children:[t(T,{source:r?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),l("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[t(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:r?.product?.title}),t(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:k})]})]}),l("div",{className:"flex flex-col items-end justify-center gap-2",children:[!!r&&l("div",{className:"flex items-center gap-1",children:[t(s,{className:"laptop-md:text-2xl text-base font-bold",html:n}),t(s,{className:"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:h({amount:r.price.amount,locale:e,currencyCode:r.price.currencyCode})})]}),m&&t(K,{size:"icon",variant:"link",onClick:()=>{C?.(f?void 0:r),p(r)},className:"size-auto shrink-0 underline",children:f?d?.remove:d?.add})]})]})};var wt=ot(nt);export{wt as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductSummary/index.tsx"],
4
- "sourcesContent": ["import { Text, Button, Grid, GridItem, Picture, Heading } from '../../../../../components/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useComponentData } from '../../../hooks/useComponentData.js'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport type { BundleListItem, ProductVariant, ProductPrice, ProductOption } from '../../../types/product'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\nimport { ExposureDetector } from '../../../../../components/index.js'\nimport { gaTrack } from '../../../../../shared/track.js'\nimport CartActionButtons from '../../CartActionButtons/index.js'\n\nconst ProductSummary = () => {\n const { locale = 'us', copyWriting, trackingData } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n addToCartLoading,\n buyNowLoading,\n profile,\n addOrder,\n setAddOrder,\n } = useBizProductContext()\n\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7\uFF08\u5212\u7EBF\u4EF7\uFF09\uFF0C\u9ED8\u8BA4\u663E\u793A */\n const showComparePrice = trackingData?.showComparePrice ?? true\n\n const productSummaryData = useComponentData('ProductSummary') ?? {}\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const currentBundleVariant = checkedBundle?.variants.find(v => v.variant.sku === currentProductVariant?.sku)\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n let currentProductPrice = new Decimal(currentProductVariant?.price?.amount || 0)\n if (profile?.email) {\n currentProductPrice = currentProductPrice.minus(savingDetail?.member || 0)\n }\n const finalPrice = currentProductPrice.minus(savingDetail?.coupon).minus(currentBundlePrice).toNumber()\n return parseFloat(finalPrice.toFixed(2))\n }, [currentProductVariant, checkedBundle, profile, savingDetail?.member, savingDetail?.coupon])\n\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle?.value ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift?.value ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange?.value ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, exchangeVariant, joinedRecommendBuyProducts])\n\n // \u6839\u636E\u6DFB\u52A0\u987A\u5E8F\u751F\u6210\u5DF2\u6DFB\u52A0\u4EA7\u54C1\u7684\u5217\u8868\n const orderedJoinedProducts = useMemo(() => {\n const result: Array<{ type: 'bundle' | 'gift' | 'exchange'; key: string }> = []\n\n // \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6DFB\u52A0\n if (addOrder) {\n addOrder.forEach((type, index) => {\n if (joinedRecommendBuyProducts[type]?.value) {\n result.push({ type, key: `${type}-${index}` })\n }\n })\n }\n\n return result\n }, [addOrder, joinedRecommendBuyProducts])\n\n const productOptionsText = useMemo(() => {\n const quantity = selectedOptions?.quantity || ''\n const color = selectedOptions?.color || selectedOptions?.colour || selectedOptions?.couleur || ''\n return `${quantity && color ? `${quantity} | ${color}` : quantity || color}`\n }, [selectedOptions?.quantity, selectedOptions?.color, selectedOptions?.colour, selectedOptions?.couleur])\n\n const variantImage = useMemo(() => {\n const { image_1920, image_1440, image_1024, image_768, image_390 } = productSummaryData?.thumbnail || {}\n const responsiveSource = productSummaryData?.thumbnail\n ? `${image_1920} 1920, ${image_1440} 1440, ${image_1024} 1024, ${image_768} 768, ${image_390} 390`\n : variant.image?.url\n return responsiveSource || variant.image?.url\n }, [productSummaryData?.thumbnail, variant.image?.url])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16\">\n <div className=\"laptop:rounded-2xl bg-[#F5F5F7]\">\n <Grid className=\"tablet:p-8 tablet:!pb-0 px-4 pt-6\">\n <GridItem className=\"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4\">\n <Heading\n className=\"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]\"\n html={productSummaryData?.readyWant?.replace?.('{title}', product?.title)}\n />\n <div className=\"\">\n <Picture\n source={variantImage}\n className=\"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]\"\n imgClassName=\"object-cover h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <ExposureDetector\n exposureKey=\"listing_selector\"\n onExposure={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_impression',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n component_type: 'image',\n component_name: 'listing_selector',\n position: 1,\n },\n })\n }}\n >\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={product.title}\n />\n <Text\n className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={productOptionsText}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {showComparePrice && summaryFinalPrice < variant?.price?.amount && (\n <Text\n className=\"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n </ExposureDetector>\n {/* \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6E32\u67D3\u5DF2\u6DFB\u52A0\u7684\u4EA7\u54C1 */}\n {orderedJoinedProducts.map(({ type, key }) => {\n if (type === 'gift' && joinedRecommendBuyProducts?.gift?.value) {\n return (\n <ProductGiftSummary\n key={key}\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift?.value}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n />\n )\n }\n if (type === 'bundle' && joinedRecommendBuyProducts?.bundle?.value) {\n return (\n <ProductBundleSummary\n key={key}\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle?.value}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n />\n )\n }\n if (type === 'exchange' && joinedRecommendBuyProducts?.exchange?.value) {\n return (\n <ProductExchangeSummary\n key={key}\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n exchange={joinedRecommendBuyProducts?.exchange?.value}\n />\n )\n }\n return null\n })}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"laptop-md:mt-8 mt-6\">\n <Text className=\"laptop-md:text-[18px] text-sm font-bold\" html={productSummaryData?.recommendBuy} />\n <div className=\"laptop-md:gap-4 mt-4 flex flex-col gap-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: exchange,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'exchange'])\n }}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundle,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'bundle'])\n }}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: gift,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'gift'])\n }}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl laptop-md:text-2xl text-right font-bold\"\n html={`${replaceTemplate(copyWriting?.totalPrice || '', { amount: formatPrice({ amount: parseFloat(finalPrice.toFixed(2)), currencyCode: variant.price.currencyCode, locale }) })}`}\n />\n\n {showComparePrice && totalSavings > 0 && (\n <Text\n className=\"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"mt-4 flex justify-end gap-3\">\n <CartActionButtons\n availableForSale={variant.availableForSale}\n addToCartText={copyWriting?.addToCart}\n buyNowText={copyWriting?.shopNow}\n addToCartLoading={addToCartLoading}\n buyNowLoading={buyNowLoading}\n addToCartClassName=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n buyNowClassName=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n />\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale) ?? []\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale) ?? []\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n canOperate,\n status,\n}: {\n bundleOperation: (bundle?: BundleListItem) => void\n bundleListItem?: BundleListItem\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center justify-between gap-4\" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-4\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none line-clamp-2 flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-1\">\n {!!bundleListItem && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: bundleVariant?.price || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n )}\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation?.(bundleListItem)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n status,\n canOperate,\n}: {\n giftOperation: (gift?: ProductVariant) => void\n gift?: ProductVariant\n status?: boolean\n canOperate?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel } = freeGift || {}\n const { options } = gift || {}\n\n const giftOptionsText = useMemo(() => {\n const giftColorOption = (options?.find(\n option => option.name === 'color' || option.name === 'colour' || option.name === 'couleur'\n ) || {}) as ProductOption\n const giftQuantityOption = options?.find(option => option.name === 'quantity') || ({} as ProductOption)\n const giftColorOptionText = giftColorOption ? giftColorOption.values?.[0]?.label : ''\n const giftQuantityOptionText = giftQuantityOption ? giftQuantityOption.values?.[0]?.label : ''\n return `${giftColorOptionText && giftQuantityOptionText ? giftQuantityOptionText + ' | ' + giftColorOptionText : giftQuantityOptionText || giftColorOptionText} | ${freeLabel}`\n }, [freeLabel, options])\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={gift?.product?.title}\n />\n <Text\n className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={giftOptionsText}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"laptop-md:text-2xl text-base font-bold\" html={freeLabel} />\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n canOperate,\n status,\n}: {\n exchangeOperation: (exchange?: ProductVariant) => void\n exchange?: ProductVariant & { finalPrice?: ProductPrice }\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={exchange?.product?.title}\n />\n <Text className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductSummary)\n"],
5
- "mappings": "AAgHU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAhHV,OAAS,QAAAC,EAAM,UAAAC,EAAQ,QAAAC,GAAM,YAAAC,EAAU,WAAAC,EAAS,WAAAC,OAAe,qCAC/D,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,oBAAAC,OAAwB,qCACjC,OAAS,aAAAC,GAAW,WAAAC,EAAS,YAAAC,OAAgB,QAC7C,OAAS,eAAAC,MAAmB,0BAC5B,OAAS,kBAAAC,MAAsB,oCAE/B,OAAOC,MAAa,aACpB,OAAS,mBAAAC,OAAuB,+BAChC,OAAS,cAAAC,OAAkB,kCAC3B,OAAS,oBAAAC,OAAwB,qCACjC,OAAS,WAAAC,OAAe,iCACxB,OAAOC,OAAuB,mCAE9B,MAAMC,GAAiB,IAAM,CAC3B,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,EAAa,aAAAC,CAAa,EAAIV,EAAe,EAC9D,CACJ,QAAAW,EACA,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,OAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,aAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,cAAAC,EACA,2BAAAC,EACA,8BAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,cAAAC,EAC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ASxE,GAAa,OAASA,GAAa,IAC/C,GAEJ,GACF,CAEJ,EAEA,IAAOuF,GAAQ7F,GAAWI,EAAc",
6
- "names": ["jsx", "jsxs", "Text", "Button", "Grid", "GridItem", "Picture", "Heading", "useBizProductContext", "useComponentData", "useEffect", "useMemo", "useState", "formatPrice", "useAiuiContext", "Decimal", "replaceTemplate", "withLayout", "ExposureDetector", "gaTrack", "CartActionButtons", "ProductSummary", "locale", "copyWriting", "trackingData", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "setSavingDetail", "addToCartLoading", "buyNowLoading", "profile", "addOrder", "setAddOrder", "showComparePrice", "productSummaryData", "currentProductVariant", "summaryFinalPrice", "currentBundleVariant", "v", "currentBundlePrice", "currentProductPrice", "bundleVariant", "giftVariant", "exchangeVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "orderedJoinedProducts", "result", "type", "index", "productOptionsText", "quantity", "color", "variantImage", "image_1920", "image_1440", "image_1024", "image_768", "image_390", "key", "ProductGiftSummary", "gift", "prev", "t", "ProductBundleSummary", "bundle", "ProductExchangeSummary", "exchange", "freeGift", "checkedGift", "exchangePurchase", "checkedExchangePurchase", "bundleList", "giftList", "exchangeList", "availableBundleList", "firstAvailableBundle", "firstAvailableGift", "firstAvailableExchange", "bundleOperation", "bundleListItem", "canOperate", "status", "setCheckedBundle", "bundleVariants", "giftOperation", "setCheckedGift", "freeLabel", "options", "giftOptionsText", "giftColorOption", "option", "giftQuantityOption", "giftColorOptionText", "giftQuantityOptionText", "exchangeOperation", "setCheckedExchangePurchase", "ProductSummary_default"]
4
+ "sourcesContent": ["import { Text, Button, Grid, GridItem, Picture, Heading } from '../../../../../components/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useComponentData } from '../../../hooks/useComponentData.js'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport type { ProductVariant, ProductPrice, ProductOption } from '../../../types/product'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\nimport { ExposureDetector } from '../../../../../components/index.js'\nimport { gaTrack } from '../../../../../shared/track.js'\nimport CartActionButtons from '../../CartActionButtons/index.js'\n\nconst ProductSummary = () => {\n const { locale = 'us', copyWriting, trackingData } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n addToCartLoading,\n buyNowLoading,\n notifyMeMode,\n onNotifyMeClick,\n profile,\n addOrder,\n setAddOrder,\n } = useBizProductContext()\n\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7\uFF08\u5212\u7EBF\u4EF7\uFF09\uFF0C\u9ED8\u8BA4\u663E\u793A */\n const showComparePrice = trackingData?.showComparePrice ?? true\n\n const productSummaryData = useComponentData('ProductSummary') ?? {}\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n // const currentBundleVariant = checkedBundle?.variants.find(v => v.variant.sku === currentProductVariant?.sku)\n // const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n // .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n // .toNumber()\n let currentProductPrice = new Decimal(currentProductVariant?.price?.amount || 0)\n if (profile?.email) {\n currentProductPrice = currentProductPrice.minus(savingDetail?.member || 0)\n }\n const finalPrice = currentProductPrice.minus(savingDetail?.coupon).toNumber()\n return parseFloat(finalPrice.toFixed(2))\n }, [currentProductVariant, checkedBundle, profile, savingDetail?.member, savingDetail?.coupon])\n\n const { giftVariant } = useRecommendBuyProducts() || {}\n\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n // bundle?: BundleListItem\n gift?: ProductVariant\n // exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n // bundle: joinedRecommendBuyProducts.bundle?.value ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift?.value ? undefined : giftVariant,\n // exchange: joinedRecommendBuyProducts.exchange?.value ? undefined : exchangeVariant,\n })\n }, [giftVariant, joinedRecommendBuyProducts])\n\n // \u6839\u636E\u6DFB\u52A0\u987A\u5E8F\u751F\u6210\u5DF2\u6DFB\u52A0\u4EA7\u54C1\u7684\u5217\u8868\n const orderedJoinedProducts = useMemo(() => {\n const result: Array<{ type: 'bundle' | 'gift' | 'exchange'; key: string }> = []\n\n // \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6DFB\u52A0\n if (addOrder) {\n addOrder.forEach((type, index) => {\n if (joinedRecommendBuyProducts[type]?.value) {\n result.push({ type, key: `${type}-${index}` })\n }\n })\n }\n\n return result\n }, [addOrder, joinedRecommendBuyProducts])\n\n const productOptionsText = useMemo(() => {\n const quantity = selectedOptions?.quantity || ''\n const color = selectedOptions?.color || selectedOptions?.colour || selectedOptions?.couleur || ''\n return `${quantity && color ? `${quantity} | ${color}` : quantity || color}`\n }, [selectedOptions?.quantity, selectedOptions?.color, selectedOptions?.colour, selectedOptions?.couleur])\n\n const variantImage = useMemo(() => {\n const { image_1920, image_1440, image_1024, image_768, image_390 } = productSummaryData?.thumbnail || {}\n const responsiveSource = productSummaryData?.thumbnail\n ? `${image_1920} 1920, ${image_1440} 1440, ${image_1024} 1024, ${image_768} 768, ${image_390} 390`\n : variant.image?.url\n return responsiveSource || variant.image?.url\n }, [productSummaryData?.thumbnail, variant.image?.url])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16\">\n <div className=\"laptop:rounded-2xl bg-[#F5F5F7]\">\n <Grid className=\"tablet:p-8 tablet:!pb-0 px-4 pt-6\">\n <GridItem className=\"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4\">\n <Heading\n className=\"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]\"\n html={productSummaryData?.readyWant?.replace?.('{title}', product?.title)}\n />\n <div className=\"\">\n <Picture\n source={variantImage}\n className=\"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]\"\n imgClassName=\"object-cover h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <ExposureDetector\n exposureKey=\"listing_selector\"\n onExposure={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_impression',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n component_type: 'image',\n component_name: 'listing_selector',\n position: 1,\n },\n })\n }}\n >\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={product.title}\n />\n <Text\n className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={productOptionsText}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"laptop-md:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {showComparePrice && summaryFinalPrice < variant?.price?.amount && (\n <Text\n className=\"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n </ExposureDetector>\n {/* \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6E32\u67D3\u5DF2\u6DFB\u52A0\u7684\u4EA7\u54C1 */}\n {orderedJoinedProducts.map(({ type, key }) => {\n if (type === 'gift' && joinedRecommendBuyProducts?.gift?.value) {\n return (\n <ProductGiftSummary\n key={key}\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift?.value}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n />\n )\n }\n // if (type === 'bundle' && joinedRecommendBuyProducts?.bundle?.value) {\n // return (\n // <ProductBundleSummary\n // key={key}\n // bundleOperation={bundle => {\n // setJoinedRecommendBuyProducts?.({\n // ...joinedRecommendBuyProducts,\n // bundle: {\n // value: undefined,\n // canOperate: true,\n // },\n // })\n // setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n // // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n // setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n // }}\n // status={!!joinedRecommendBuyProducts?.bundle}\n // bundleListItem={joinedRecommendBuyProducts?.bundle?.value}\n // canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n // />\n // )\n // }\n // if (type === 'exchange' && joinedRecommendBuyProducts?.exchange?.value) {\n // return (\n // <ProductExchangeSummary\n // key={key}\n // exchangeOperation={exchange => {\n // setJoinedRecommendBuyProducts?.({\n // ...joinedRecommendBuyProducts,\n // exchange: {\n // value: undefined,\n // canOperate: true,\n // },\n // })\n // setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n // // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n // setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n // }}\n // status={!!joinedRecommendBuyProducts?.exchange}\n // canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n // exchange={joinedRecommendBuyProducts?.exchange?.value}\n // />\n // )\n // }\n return null\n })}\n </div>\n {\n initialRecommendBuyProducts?.gift && (\n <div className=\"laptop-md:mt-8 mt-6\">\n <Text className=\"laptop-md:text-[18px] text-sm font-bold\" html={productSummaryData?.recommendBuy} />\n <div className=\"laptop-md:gap-4 mt-4 flex flex-col gap-6\">\n {/* {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: exchange,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'exchange'])\n }}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )} */}\n {/* {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundle,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'bundle'])\n }}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )} */}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: gift,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'gift'])\n }}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl laptop-md:text-2xl text-right font-bold\"\n html={`${replaceTemplate(copyWriting?.totalPrice || '', { amount: formatPrice({ amount: parseFloat(finalPrice.toFixed(2)), currencyCode: variant.price.currencyCode, locale }) })}`}\n />\n\n {showComparePrice && totalSavings > 0 && (\n <Text\n className=\"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"mt-4 flex justify-end gap-3\">\n <CartActionButtons\n mode={notifyMeMode}\n availableForSale={variant.availableForSale}\n addToCartText={copyWriting?.addToCart}\n buyNowText={copyWriting?.shopNow}\n addToCartLoading={addToCartLoading}\n buyNowLoading={buyNowLoading}\n addToCartClassName=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n buyNowClassName=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n onNotifyMeClick={onNotifyMeClick}\n notifyMeText={copyWriting?.notifyMe}\n notifyMeClassName=\"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2\"\n />\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift } =\n useBizProductContext()\n// let bundleVariant = undefined\n let giftVariant = undefined\n// let exchangeVariant = undefined\n// const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n// const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n// const availableBundleList =\n// bundleList?.filter(bundle =>\n// bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n// ) || []\n\n// const [firstAvailableBundle] = availableBundleList\n// bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale) ?? []\n giftVariant = checkedGift || firstAvailableGift\n\n// const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale) ?? []\n// exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { giftVariant }\n}\n\n// const ProductBundleSummary = ({\n// bundleOperation,\n// bundleListItem,\n// canOperate,\n// status,\n// }: {\n// bundleOperation: (bundle?: BundleListItem) => void\n// bundleListItem?: BundleListItem\n// canOperate?: boolean\n// status?: boolean\n// }) => {\n// const { locale = 'us', copyWriting } = useAiuiContext()\n// const { variant, setCheckedBundle } = useBizProductContext()\n// const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n// return (\n// <div className=\"\">\n// {bundleVariants?.map(bundleVariant => {\n// return (\n// <div className=\"flex items-center justify-between gap-4\" key={bundleVariant.variant.id}>\n// <div className=\"flex items-center gap-4\">\n// <Picture\n// source={bundleVariant?.variant?.image?.url}\n// className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n// />\n// <div className=\"tablet:max-w-none line-clamp-2 flex max-w-[178px] flex-col gap-[6px]\">\n// <Text\n// className=\"laptop-md:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold\"\n// html={bundleVariant.variant.product.title}\n// />\n// </div>\n// </div>\n// <div className=\"flex flex-col items-end justify-center gap-1\">\n// {!!bundleListItem && (\n// <div className=\"flex items-center gap-1\">\n// <Text\n// className=\"laptop-md:text-2xl text-base font-bold\"\n// html={formatPrice({\n// amount: bundleVariant?.price || 0,\n// locale,\n// currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n// })}\n// />\n// {bundleVariant.price < bundleVariant.variant.price.amount && (\n// <Text\n// className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n// html={formatPrice({\n// amount: bundleVariant.variant.price.amount || 0,\n// locale,\n// currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n// })}\n// />\n// )}\n// </div>\n// )}\n// {canOperate && (\n// <Button\n// size=\"icon\"\n// variant=\"link\"\n// onClick={() => {\n// setCheckedBundle?.(status ? undefined : bundleListItem)\n// bundleOperation?.(bundleListItem)\n// }}\n// className=\"size-auto shrink-0 underline\"\n// >\n// {status ? copyWriting?.remove : copyWriting?.add}\n// </Button>\n// )}\n// </div>\n// </div>\n// )\n// })}\n// </div>\n// )\n// }\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n status,\n canOperate,\n}: {\n giftOperation: (gift?: ProductVariant) => void\n gift?: ProductVariant\n status?: boolean\n canOperate?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel } = freeGift || {}\n const { options } = gift || {}\n\n const giftOptionsText = useMemo(() => {\n const giftColorOption = (options?.find(\n option => option.name === 'color' || option.name === 'colour' || option.name === 'couleur'\n ) || {}) as ProductOption\n const giftQuantityOption = options?.find(option => option.name === 'quantity') || ({} as ProductOption)\n const giftColorOptionText = giftColorOption ? giftColorOption.values?.[0]?.label : ''\n const giftQuantityOptionText = giftQuantityOption ? giftQuantityOption.values?.[0]?.label : ''\n return `${giftColorOptionText && giftQuantityOptionText ? giftQuantityOptionText + ' | ' + giftColorOptionText : giftQuantityOptionText || giftColorOptionText} | ${freeLabel}`\n }, [freeLabel, options])\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={gift?.product?.title}\n />\n <Text\n className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={giftOptionsText}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"laptop-md:text-2xl text-base font-bold\" html={freeLabel} />\n <Text\n className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\n// const ProductExchangeSummary = ({\n// exchangeOperation,\n// exchange,\n// canOperate,\n// status,\n// }: {\n// exchangeOperation: (exchange?: ProductVariant) => void\n// exchange?: ProductVariant & { finalPrice?: ProductPrice }\n// canOperate?: boolean\n// status?: boolean\n// }) => {\n// const { locale = 'us', copyWriting } = useAiuiContext()\n// const { setCheckedExchangePurchase } = useBizProductContext()\n\n// return (\n// <div className=\"flex items-center justify-between gap-6\">\n// <div className=\"flex items-center gap-4\">\n// <Picture\n// source={exchange?.image?.url}\n// className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n// />\n// <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n// <Text\n// className=\"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n// html={exchange?.product?.title}\n// />\n// <Text className=\"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]\" />\n// </div>\n// </div>\n// <div className=\"flex flex-col items-end justify-center gap-2\">\n// {!!exchange && (\n// <div className=\"flex items-center gap-1\">\n// <Text\n// className=\"laptop-md:text-2xl text-base font-bold\"\n// html={formatPrice({\n// amount: exchange.finalPrice?.amount || 0,\n// locale,\n// currencyCode: exchange.price.currencyCode,\n// })}\n// />\n// <Text\n// className=\"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n// html={formatPrice({\n// amount: exchange.price?.amount || 0,\n// locale,\n// currencyCode: exchange.price.currencyCode,\n// })}\n// />\n// </div>\n// )}\n// {canOperate && (\n// <Button\n// size=\"icon\"\n// variant=\"link\"\n// onClick={() => {\n// setCheckedExchangePurchase?.(status ? undefined : exchange)\n// exchangeOperation(exchange)\n// }}\n// className=\"size-auto shrink-0 underline\"\n// >\n// {status ? copyWriting?.remove : copyWriting?.add}\n// </Button>\n// )}\n// </div>\n// </div>\n// )\n// }\n\nexport default withLayout(ProductSummary)\n"],
5
+ "mappings": "AAkHU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAlHV,OAAS,QAAAC,EAAM,UAAAC,EAAQ,QAAAC,EAAM,YAAAC,EA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O,OAAS,UAAU,GAAM,CAAC,EAC9EE,EAAsBH,EAAkBA,EAAgB,SAAS,CAAC,GAAG,MAAQ,GAC7EI,EAAyBF,EAAqBA,EAAmB,SAAS,CAAC,GAAG,MAAQ,GAC5F,MAAO,GAAGC,GAAuBC,EAAyBA,EAAyB,MAAQD,EAAsBC,GAA0BD,CAAmB,MAAMN,CAAS,EAC/K,EAAG,CAACA,EAAWC,CAAO,CAAC,EAEvB,OACEnF,EAAC,OAAI,UAAU,0CACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACM,EAAA,CACC,OAAQiE,GAAM,OAAO,IACrB,UAAU,wHACZ,EACAtE,EAAC,OAAI,UAAU,0DACb,UAAAD,EAACE,EAAA,CACC,UAAU,kFACV,KAAMqE,GAAM,SAAS,MACvB,EACAvE,EAACE,EAAA,CACC,UAAU,gFACV,KAAMmF,EACR,GACF,GACF,EACApF,EAAC,OAAI,UAAU,+CACZ,WAAC,CAACsE,GACDtE,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACE,EAAA,CAAK,UAAU,yCAAyC,KAAMiF,EAAW,EAC1EnF,EAACE,EAAA,CACC,UAAU,qEACV,KAAMW,EAAY,CAChB,OAAQ0D,EAAK,MAAM,OACnB,OAAAjD,EACA,aAAciD,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,EAEDU,GACCjF,EAACG,EAAA,CACC,KAAK,OACL,QAAQ,OACR,QAAS,IAAM,CACb+E,IAAiBF,EAAS,OAAYT,CAAI,EAC1CQ,EAAcR,CAAI,CACpB,EACA,UAAU,+BAET,SAAAS,EAASzD,GAAa,OAASA,GAAa,IAC/C,GAEJ,GACF,CAEJ,EAsEA,IAAOoE,GAAQ1E,GAAWI,EAAc",
6
+ "names": ["jsx", "jsxs", "Text", "Button", "Grid", "GridItem", "Picture", "Heading", "useBizProductContext", "useComponentData", "useEffect", "useMemo", "useState", "formatPrice", "useAiuiContext", "Decimal", "replaceTemplate", "withLayout", "ExposureDetector", "gaTrack", "CartActionButtons", "ProductSummary", "locale", "copyWriting", "trackingData", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "setSavingDetail", "addToCartLoading", "buyNowLoading", "notifyMeMode", "onNotifyMeClick", "profile", "addOrder", "setAddOrder", "showComparePrice", "productSummaryData", "currentProductVariant", "summaryFinalPrice", "currentProductPrice", "giftVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "orderedJoinedProducts", "result", "type", "index", "productOptionsText", "quantity", "color", "variantImage", "image_1920", "image_1440", "image_1024", "image_768", "image_390", "key", "ProductGiftSummary", "gift", "prev", "t", "bundle", "freeGift", "checkedGift", "giftList", "firstAvailableGift", "giftOperation", "status", "canOperate", "setCheckedGift", "freeLabel", "options", "giftOptionsText", "giftColorOption", "option", "giftQuantityOption", "giftColorOptionText", "giftQuantityOptionText", "ProductSummary_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as o,jsxs as u}from"react/jsx-runtime";import{Text as n,Container as F}from"../../../../../components/index.js";import{useAiuiContext as M}from"../../../../AiuiProvider/index.js";import{useBizProductContext as L}from"../../../BizProductProvider.js";import{useMemo as C}from"react";import{formatPrice as d}from"../../../utils/index.js";import{replaceTemplate as y}from"../../../utils/textFormat.js";import{useBenefits as E}from"../../../hooks/useBenefits.js";import R from"../../CartActionButtons/index.js";const O=({totalSavingsSlot:v}={})=>{const{copyWriting:e,locale:a="us",trackingData:N,currencyCode:r}=M(),{variant:t,finalPrice:h,totalSavings:l,isLogin:m,comparePrice:w,onAddToCart:S,onBuyNow:A,savingDetail:s,addToCartLoading:P,buyNowLoading:T,discount:_,memberFunctionResult:p}=L(),k=E({variant:t}),{commonCoupon:i,memberDiscount:c}=k,D=N?.showComparePrice??!0,B=C(()=>y(e?.totalSavings||"",{amount:d({amount:l,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),[e?.totalSavings,l,t.price.currencyCode,a]),x=C(()=>{if(!e?.unlockedSaving)return;const b=i?.enable?Number(i?.config?.fixed_value||0):0,f=c?.enable?c.config?.amount??0:0,g=Math.round((p?.withoutCouponMaxMemberTotalSave?Math.max(f,b):f+b)*100)/100;if(!(g<=0))return y(e.unlockedSaving,{amount:d({amount:g,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})})},[e?.unlockedSaving,i?.enable,i?.config?.fixed_value,c?.enable,c?.config?.amount,p,t.price.currencyCode,a]);return u(F,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[t.availableForSale?u("div",{className:"laptop-md:items-end flex flex-col justify-between",children:[u("div",{className:"flex items-center gap-1",children:[o(n,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:d({amount:parseFloat(h.toFixed(2)),currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),D&&(l>0||s?.member>0&&m)&&o(n,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:d({amount:w,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),s?.member>0&&m&&o(n,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),v||(l>0||s?.member>0&&m?o(n,{className:"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${B}`}):x?o(n,{className:"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:x}):null)]}):o(n,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),o("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:o(R,{availableForSale:t.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:P,buyNowLoading:T,onAddToCart:S,onBuyNow:A})})]})};var I=O;export{I as default};
1
+ import{jsx as o,jsxs as u}from"react/jsx-runtime";import{Text as n,Container as L}from"../../../../../components/index.js";import{useAiuiContext as E}from"../../../../AiuiProvider/index.js";import{useBizProductContext as R}from"../../../BizProductProvider.js";import{useMemo as C}from"react";import{formatPrice as d}from"../../../utils/index.js";import{replaceTemplate as y}from"../../../utils/textFormat.js";import{useBenefits as O}from"../../../hooks/useBenefits.js";import _ from"../../CartActionButtons/index.js";const j=({totalSavingsSlot:v}={})=>{const{copyWriting:e,locale:a="us",trackingData:N,currencyCode:l}=E(),{variant:t,finalPrice:h,totalSavings:r,isLogin:m,comparePrice:w,onAddToCart:S,onBuyNow:T,savingDetail:s,addToCartLoading:k,buyNowLoading:A,notifyMeMode:M,onNotifyMeClick:P,discount:q,memberFunctionResult:p}=R(),D=O({variant:t}),{commonCoupon:i,memberDiscount:c}=D,B=N?.showComparePrice??!0,F=C(()=>y(e?.totalSavings||"",{amount:d({amount:r,currencyCode:t.price.currencyCode,locale:l==="CAD"?"us":a||"us"})}),[e?.totalSavings,r,t.price.currencyCode,a]),x=C(()=>{if(!e?.unlockedSaving)return;const b=i?.enable?Number(i?.config?.fixed_value||0):0,f=c?.enable?c.config?.amount??0:0,g=Math.round((p?.withoutCouponMaxMemberTotalSave?Math.max(f,b):f+b)*100)/100;if(!(g<=0))return y(e.unlockedSaving,{amount:d({amount:g,currencyCode:t.price.currencyCode,locale:l==="CAD"?"us":a||"us"})})},[e?.unlockedSaving,i?.enable,i?.config?.fixed_value,c?.enable,c?.config?.amount,p,t.price.currencyCode,a]);return u(L,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[t.availableForSale?u("div",{className:"laptop-md:items-end flex flex-col justify-between",children:[u("div",{className:"flex items-center gap-1",children:[o(n,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:d({amount:parseFloat(h.toFixed(2)),currencyCode:t.price.currencyCode,locale:l==="CAD"?"us":a||"us"})}),B&&(r>0||s?.member>0&&m)&&o(n,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:d({amount:w,currencyCode:t.price.currencyCode,locale:l==="CAD"?"us":a||"us"})}),s?.member>0&&m&&o(n,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),v||(r>0||s?.member>0&&m?o(n,{className:"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${F}`}):x?o(n,{className:"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:x}):null)]}):o(n,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),o("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:o(_,{mode:M,availableForSale:t.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:k,buyNowLoading:A,onAddToCart:S,onBuyNow:T,onNotifyMeClick:P,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var K=j;export{K as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ProductActions/index.tsx"],
4
- "sourcesContent": ["import { Text, Container } from '../../../../../components/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo, type ReactNode } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { useBenefits } from '../../../hooks/useBenefits.js'\nimport CartActionButtons from '../../CartActionButtons/index.js'\n\nexport interface ProductActionsProps {\n /** \u81EA\u5B9A\u4E49\u603B\u8282\u7701\u7EC4\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684 totalSavings \u663E\u793A */\n totalSavingsSlot?: ReactNode\n}\n\nconst ProductActions = ({ totalSavingsSlot }: ProductActionsProps = {}) => {\n const { copyWriting, locale = 'us', trackingData, currencyCode } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n addToCartLoading,\n buyNowLoading,\n discount,\n memberFunctionResult,\n } = useBizProductContext()\n const benefits = useBenefits({ variant })\n const { commonCoupon, memberDiscount } = benefits\n\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7\uFF08\u5212\u7EBF\u4EF7\uFF09\uFF0C\u9ED8\u8BA4\u663E\u793A */\n const showComparePrice = trackingData?.showComparePrice ?? true\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({\n amount: totalSavings,\n currencyCode: variant.price.currencyCode,\n locale: currencyCode === 'CAD' ? 'us' : locale || 'us',\n }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n const unlockedSavingText = useMemo(() => {\n if (!copyWriting?.unlockedSaving) return undefined\n\n const couponSaving = commonCoupon?.enable ? Number(commonCoupon?.config?.fixed_value || 0) : 0\n const memberSaving = memberDiscount?.enable ? (memberDiscount.config?.amount ?? 0) : 0\n\n // \u4E0D\u53EF\u53E0\u52A0\u65F6\u53D6\u4F1A\u5458\u4EF7\u4E0E code \u6298\u6263\u7684\u6700\u5927\u503C\uFF0C\u53EF\u53E0\u52A0\u65F6\u53D6\u4E8C\u8005\u4E4B\u548C\n const totalUnlocked = Math.round((\n memberFunctionResult?.withoutCouponMaxMemberTotalSave\n ? Math.max(memberSaving, couponSaving)\n : memberSaving + couponSaving\n ) * 100) / 100\n\n if (totalUnlocked <= 0) return undefined\n\n return replaceTemplate(copyWriting.unlockedSaving, {\n amount: formatPrice({\n amount: totalUnlocked,\n currencyCode: variant.price.currencyCode,\n locale: currencyCode === 'CAD' ? 'us' : locale || 'us',\n }),\n })\n }, [\n copyWriting?.unlockedSaving,\n commonCoupon?.enable,\n commonCoupon?.config?.fixed_value,\n memberDiscount?.enable,\n memberDiscount?.config?.amount,\n memberFunctionResult,\n variant.price.currencyCode,\n locale,\n ])\n\n return (\n <Container\n childClassName=\"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4\"\n className=\"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3\"\n >\n {variant.availableForSale ? (\n <div className=\"laptop-md:items-end flex flex-col justify-between\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]\"\n html={formatPrice({\n amount: parseFloat(finalPrice.toFixed(2)),\n currencyCode: variant.price.currencyCode,\n locale: currencyCode === 'CAD' ? 'us' : locale || 'us',\n })}\n />\n {showComparePrice && (totalSavings > 0 || (savingDetail?.member > 0 && isLogin)) && (\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale: currencyCode === 'CAD' ? 'us' : locale || 'us',\n })}\n />\n )}\n {savingDetail?.member > 0 && isLogin && (\n <Text\n className=\"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white\"\n html={copyWriting?.memberPrice || 'Member Price'}\n />\n )}\n </div>\n {totalSavingsSlot ||\n (totalSavings > 0 || (savingDetail?.member > 0 && isLogin) ? (\n <Text\n className=\"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={`${totalSavingsText}`}\n />\n ) : unlockedSavingText ? (\n <Text\n className=\"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={unlockedSavingText}\n />\n ) : null)}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"tablet:mt-0 mt-2 flex items-center gap-2\">\n <CartActionButtons\n availableForSale={variant.availableForSale}\n addToCartText={copyWriting?.addToCart ?? 'Add to Cart'}\n buyNowText={copyWriting?.buyNow ?? 'Buy Now'}\n addToCartLoading={addToCartLoading}\n buyNowLoading={buyNowLoading}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n />\n </div>\n </Container>\n )\n}\n\nexport default ProductActions\n"],
5
- "mappings": "AAsFU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAtFV,OAAS,QAAAC,EAAM,aAAAC,MAAiB,qCAChC,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,WAAAC,MAA+B,QACxC,OAAS,eAAAC,MAAmB,0BAC5B,OAAS,mBAAAC,MAAuB,+BAChC,OAAS,eAAAC,MAAmB,gCAC5B,OAAOC,MAAuB,mCAO9B,MAAMC,EAAiB,CAAC,CAAE,iBAAAC,CAAiB,EAAyB,CAAC,IAAM,CACzE,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,KAAM,aAAAC,EAAc,aAAAC,CAAa,EAAIZ,EAAe,EAC5E,CACJ,QAAAa,EACA,WAAAC,EACA,aAAAC,EACA,QAAAC,EACA,aAAAC,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AAD,EAACE,EAAA,CACC,UAAU,yFACV,KAAMK,EAAY,CAChB,OAAQ,WAAWW,EAAW,QAAQ,CAAC,CAAC,EACxC,aAAcD,EAAQ,MAAM,aAC5B,OAAQD,IAAiB,MAAQ,KAAOF,GAAU,IACpD,CAAC,EACH,EACCkB,IAAqBb,EAAe,GAAMK,GAAc,OAAS,GAAKJ,IACrEpB,EAACE,EAAA,CACC,UAAU,qHACV,KAAMK,EAAY,CAChB,OAAQc,EACR,aAAcJ,EAAQ,MAAM,aAC5B,OAAQD,IAAiB,MAAQ,KAAOF,GAAU,IACpD,CAAC,EACH,EAEDU,GAAc,OAAS,GAAKJ,GAC3BpB,EAACE,EAAA,CACC,UAAU,gEACV,KAAMW,GAAa,aAAe,eACpC,GAEJ,EACCD,IACEO,EAAe,GAAMK,GAAc,OAAS,GAAKJ,EAChDpB,EAACE,EAAA,CACC,UAAU,4HACV,KAAM,GAAG+B,CAAgB,GAC3B,EACEC,EACFlC,EAACE,EAAA,CACC,UAAU,oIACV,KAAMgC,EACR,EACE,OACR,EAEAlC,EAACE,EAAA,CAAK,UAAU,uCAAuC,KAAMW,GAAa,SAAW,WAAY,EAEnGb,EAAC,OAAI,UAAU,2CACb,SAAAA,EAACU,EAAA,CACC,iBAAkBO,EAAQ,iBAC1B,cAAeJ,GAAa,WAAa,cACzC,WAAYA,GAAa,QAAU,UACnC,iBAAkBY,EAClB,cAAeC,EACf,YAAaJ,EACb,SAAUC,EACZ,EACF,GACF,CAEJ,EAEA,IAAOe,EAAQ3B",
6
- "names": ["jsx", "jsxs", "Text", "Container", "useAiuiContext", "useBizProductContext", "useMemo", "formatPrice", "replaceTemplate", "useBenefits", "CartActionButtons", "ProductActions", "totalSavingsSlot", "copyWriting", "locale", "trackingData", "currencyCode", "variant", "finalPrice", "totalSavings", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "addToCartLoading", "buyNowLoading", "discount", "memberFunctionResult", "benefits", "commonCoupon", "memberDiscount", "showComparePrice", "totalSavingsText", "unlockedSavingText", "couponSaving", "memberSaving", "totalUnlocked", "ProductActions_default"]
4
+ "sourcesContent": ["import { Text, Container } from '../../../../../components/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo, type ReactNode } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { useBenefits } from '../../../hooks/useBenefits.js'\nimport CartActionButtons from '../../CartActionButtons/index.js'\n\nexport interface ProductActionsProps {\n /** \u81EA\u5B9A\u4E49\u603B\u8282\u7701\u7EC4\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684 totalSavings \u663E\u793A */\n totalSavingsSlot?: ReactNode\n}\n\nconst ProductActions = ({ totalSavingsSlot }: ProductActionsProps = {}) => {\n const { copyWriting, locale = 'us', trackingData, currencyCode } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n addToCartLoading,\n buyNowLoading,\n notifyMeMode,\n onNotifyMeClick,\n discount,\n memberFunctionResult,\n } = useBizProductContext()\n const benefits = useBenefits({ variant })\n const { commonCoupon, memberDiscount } = benefits\n\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7\uFF08\u5212\u7EBF\u4EF7\uFF09\uFF0C\u9ED8\u8BA4\u663E\u793A */\n const showComparePrice = trackingData?.showComparePrice ?? true\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({\n amount: totalSavings,\n currencyCode: variant.price.currencyCode,\n locale: currencyCode === 'CAD' ? 'us' : locale || 'us',\n }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n const unlockedSavingText = useMemo(() => {\n if (!copyWriting?.unlockedSaving) return undefined\n\n const couponSaving = commonCoupon?.enable ? Number(commonCoupon?.config?.fixed_value || 0) : 0\n const memberSaving = memberDiscount?.enable ? (memberDiscount.config?.amount ?? 0) : 0\n\n // \u4E0D\u53EF\u53E0\u52A0\u65F6\u53D6\u4F1A\u5458\u4EF7\u4E0E code \u6298\u6263\u7684\u6700\u5927\u503C\uFF0C\u53EF\u53E0\u52A0\u65F6\u53D6\u4E8C\u8005\u4E4B\u548C\n const totalUnlocked = Math.round((\n memberFunctionResult?.withoutCouponMaxMemberTotalSave\n ? Math.max(memberSaving, couponSaving)\n : memberSaving + couponSaving\n ) * 100) / 100\n\n if (totalUnlocked <= 0) return undefined\n\n return replaceTemplate(copyWriting.unlockedSaving, {\n amount: formatPrice({\n amount: totalUnlocked,\n currencyCode: variant.price.currencyCode,\n locale: currencyCode === 'CAD' ? 'us' : locale || 'us',\n }),\n })\n }, [\n copyWriting?.unlockedSaving,\n commonCoupon?.enable,\n commonCoupon?.config?.fixed_value,\n memberDiscount?.enable,\n memberDiscount?.config?.amount,\n memberFunctionResult,\n variant.price.currencyCode,\n locale,\n ])\n\n return (\n <Container\n childClassName=\"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4\"\n className=\"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3\"\n >\n {variant.availableForSale ? (\n <div className=\"laptop-md:items-end flex flex-col justify-between\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]\"\n html={formatPrice({\n amount: parseFloat(finalPrice.toFixed(2)),\n currencyCode: variant.price.currencyCode,\n locale: currencyCode === 'CAD' ? 'us' : locale || 'us',\n })}\n />\n {showComparePrice && (totalSavings > 0 || (savingDetail?.member > 0 && isLogin)) && (\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale: currencyCode === 'CAD' ? 'us' : locale || 'us',\n })}\n />\n )}\n {savingDetail?.member > 0 && isLogin && (\n <Text\n className=\"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white\"\n html={copyWriting?.memberPrice || 'Member Price'}\n />\n )}\n </div>\n {totalSavingsSlot ||\n (totalSavings > 0 || (savingDetail?.member > 0 && isLogin) ? (\n <Text\n className=\"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={`${totalSavingsText}`}\n />\n ) : unlockedSavingText ? (\n <Text\n className=\"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={unlockedSavingText}\n />\n ) : null)}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"tablet:mt-0 mt-2 flex items-center gap-2\">\n <CartActionButtons\n mode={notifyMeMode}\n availableForSale={variant.availableForSale}\n addToCartText={copyWriting?.addToCart ?? 'Add to Cart'}\n buyNowText={copyWriting?.buyNow ?? 'Buy Now'}\n addToCartLoading={addToCartLoading}\n buyNowLoading={buyNowLoading}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n onNotifyMeClick={onNotifyMeClick}\n notifyMeText={copyWriting?.notifyMe}\n notifyMeClassName=\"w-full\"\n />\n </div>\n </Container>\n )\n}\n\nexport default ProductActions\n"],
5
+ "mappings": "AAwFU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAxFV,OAAS,QAAAC,EAAM,aAAAC,MAAiB,qCAChC,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,WAAAC,MAA+B,QACxC,OAAS,eAAAC,MAAmB,0BAC5B,OAAS,mBAAAC,MAAuB,+BAChC,OAAS,eAAAC,MAAmB,gCAC5B,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,EACF,GACF,CAEJ,EAEA,IAAO2B,EAAQ7B",
6
+ "names": ["jsx", "jsxs", "Text", "Container", "useAiuiContext", "useBizProductContext", "useMemo", "formatPrice", "replaceTemplate", "useBenefits", "CartActionButtons", "ProductActions", "totalSavingsSlot", "copyWriting", "locale", "trackingData", "currencyCode", "variant", "finalPrice", "totalSavings", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "addToCartLoading", "buyNowLoading", "notifyMeMode", "onNotifyMeClick", "discount", "memberFunctionResult", "benefits", "commonCoupon", "memberDiscount", "showComparePrice", "totalSavingsText", "unlockedSavingText", "couponSaving", "memberSaving", "totalUnlocked", "ProductActions_default"]
7
7
  }
@@ -1,3 +1,2 @@
1
1
  export { default as PurchaseBar } from './PurchaseBar/index.js';
2
2
  export { default as ProductActions } from './PurchaseBar/ProductActions/index.js';
3
- export { default as ProductCard } from './ProductCard/index.js';
@@ -1,2 +1,2 @@
1
- import{default as o}from"./PurchaseBar/index.js";import{default as e}from"./PurchaseBar/ProductActions/index.js";import{default as f}from"./ProductCard/index.js";export{e as ProductActions,f as ProductCard,o as PurchaseBar};
1
+ import{default as o}from"./PurchaseBar/index.js";import{default as e}from"./PurchaseBar/ProductActions/index.js";export{e as ProductActions,o as PurchaseBar};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/biz-components/Listing/components/index.ts"],
4
- "sourcesContent": ["export { default as PurchaseBar } from './PurchaseBar/index.js'\nexport { default as ProductActions } from './PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './ProductCard/index.js'\n"],
5
- "mappings": "AAAA,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAAiC,wCAC1C,OAAoB,WAAXA,MAA8B",
4
+ "sourcesContent": ["export { default as PurchaseBar } from './PurchaseBar/index.js'\nexport { default as ProductActions } from './PurchaseBar/ProductActions/index.js'\n\n"],
5
+ "mappings": "AAAA,OAAoB,WAAXA,MAA8B,yBACvC,OAAoB,WAAXA,MAAiC",
6
6
  "names": ["default"]
7
7
  }