@anker-in/headless-ui 1.0.26-alpha.1762331489014 → 1.0.26-alpha.1762411688784

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 (390) hide show
  1. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  2. package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
  3. package/dist/cjs/biz-components/AplusDesc/index.js +2 -0
  4. package/dist/cjs/biz-components/AplusDesc/index.js.map +7 -0
  5. package/dist/cjs/biz-components/DownLoad/index.js +2 -0
  6. package/dist/cjs/biz-components/DownLoad/index.js.map +7 -0
  7. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  8. package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
  9. package/dist/cjs/biz-components/Features/index.js +2 -0
  10. package/dist/cjs/biz-components/Features/index.js.map +7 -0
  11. package/dist/cjs/biz-components/FootCharger/index.js +2 -0
  12. package/dist/cjs/biz-components/FootCharger/index.js.map +7 -0
  13. package/dist/cjs/biz-components/GiftBox/index.js +2 -0
  14. package/dist/cjs/biz-components/GiftBox/index.js.map +7 -0
  15. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  16. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  17. package/dist/cjs/biz-components/GraphicMore/index.js +2 -0
  18. package/dist/cjs/biz-components/GraphicMore/index.js.map +7 -0
  19. package/dist/cjs/biz-components/HeroBanner/Countdown.js +2 -0
  20. package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +7 -0
  21. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  22. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  23. package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
  24. package/dist/cjs/biz-components/Listing/BizProductProvider.js +2 -0
  25. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +7 -0
  26. package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
  27. package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
  28. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
  29. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
  30. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
  31. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
  32. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +2 -0
  33. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
  34. package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js +2 -0
  35. package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
  36. package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js +2 -0
  37. package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
  38. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +40 -0
  39. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
  40. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
  41. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
  42. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
  43. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
  44. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
  45. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
  46. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
  47. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
  48. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
  49. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
  50. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
  51. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
  52. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
  53. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
  54. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
  55. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
  56. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
  57. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
  58. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
  59. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
  60. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
  61. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
  62. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
  63. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
  64. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
  65. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
  66. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
  67. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
  68. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
  69. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
  70. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
  71. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
  72. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +2 -0
  73. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
  74. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +2 -0
  75. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +7 -0
  76. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
  77. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
  78. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
  79. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
  80. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +2 -0
  81. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
  82. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +2 -0
  83. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
  84. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +2 -0
  85. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
  86. package/dist/cjs/biz-components/Listing/components/index.js +2 -0
  87. package/dist/cjs/biz-components/Listing/components/index.js.map +7 -0
  88. package/dist/cjs/biz-components/Listing/const.js +2 -0
  89. package/dist/cjs/biz-components/Listing/const.js.map +7 -0
  90. package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +2 -0
  91. package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
  92. package/dist/cjs/biz-components/Listing/hooks/use-variant.js +2 -0
  93. package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +7 -0
  94. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +2 -0
  95. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +7 -0
  96. package/dist/cjs/biz-components/Listing/hooks/useCopy.js +2 -0
  97. package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +7 -0
  98. package/dist/cjs/biz-components/Listing/index.js +2 -0
  99. package/dist/cjs/biz-components/Listing/index.js.map +7 -0
  100. package/dist/cjs/biz-components/Listing/types/graphql.js +2 -0
  101. package/dist/cjs/biz-components/Listing/types/graphql.js.map +7 -0
  102. package/dist/cjs/biz-components/Listing/types/product.js +2 -0
  103. package/dist/cjs/biz-components/Listing/types/product.js.map +7 -0
  104. package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +2 -0
  105. package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +7 -0
  106. package/dist/cjs/biz-components/Listing/types/type-helper.js +2 -0
  107. package/dist/cjs/biz-components/Listing/types/type-helper.js.map +7 -0
  108. package/dist/cjs/biz-components/Listing/types.js +2 -0
  109. package/dist/cjs/biz-components/Listing/types.js.map +7 -0
  110. package/dist/cjs/biz-components/Listing/utils/helper.js +2 -0
  111. package/dist/cjs/biz-components/Listing/utils/helper.js.map +7 -0
  112. package/dist/cjs/biz-components/Listing/utils/index.js +2 -0
  113. package/dist/cjs/biz-components/Listing/utils/index.js.map +7 -0
  114. package/dist/cjs/biz-components/Listing/utils/textFormat.js +2 -0
  115. package/dist/cjs/biz-components/Listing/utils/textFormat.js.map +7 -0
  116. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  117. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  118. package/dist/cjs/biz-components/SelectStore/index.js +2 -0
  119. package/dist/cjs/biz-components/SelectStore/index.js.map +7 -0
  120. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  121. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  122. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  123. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +3 -3
  124. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
  125. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  126. package/dist/cjs/biz-components/index.js +1 -1
  127. package/dist/cjs/biz-components/index.js.map +3 -3
  128. package/dist/cjs/components/checkbox.js +1 -1
  129. package/dist/cjs/components/checkbox.js.map +3 -3
  130. package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
  131. package/dist/cjs/helpers/ScrollLoadVideo.js.map +3 -3
  132. package/dist/cjs/hooks/useRollout.js +2 -0
  133. package/dist/cjs/hooks/useRollout.js.map +7 -0
  134. package/dist/cjs/src/biz-components/AiuiProvider/index.d.ts +4 -0
  135. package/dist/cjs/src/biz-components/AplusDesc/index.d.ts +23 -0
  136. package/dist/cjs/src/biz-components/DownLoad/index.d.ts +21 -0
  137. package/dist/cjs/src/biz-components/Features/index.d.ts +27 -0
  138. package/dist/cjs/src/biz-components/FootCharger/index.d.ts +13 -0
  139. package/dist/cjs/src/biz-components/GiftBox/index.d.ts +18 -0
  140. package/dist/cjs/src/biz-components/GraphicMore/index.d.ts +23 -0
  141. package/dist/cjs/src/biz-components/HeroBanner/Countdown.d.ts +9 -0
  142. package/dist/cjs/src/biz-components/HeroBanner/types.d.ts +6 -0
  143. package/dist/cjs/src/biz-components/Listing/BizProductProvider.d.ts +126 -0
  144. package/dist/cjs/src/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
  145. package/dist/cjs/src/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
  146. package/dist/cjs/src/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
  147. package/dist/cjs/src/biz-components/Listing/components/PaidShipping/index.d.ts +12 -0
  148. package/dist/cjs/src/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
  149. package/dist/cjs/src/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
  150. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +38 -0
  151. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
  152. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +2 -0
  153. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +2 -0
  154. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +2 -0
  155. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +2 -0
  156. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +2 -0
  157. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
  158. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
  159. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
  160. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
  161. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
  162. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
  163. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +2 -0
  164. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +42 -0
  165. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
  166. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -0
  167. package/dist/cjs/src/biz-components/Listing/components/ProductCard/ProductSummary/types.d.ts +2 -0
  168. package/dist/cjs/src/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
  169. package/dist/cjs/src/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
  170. package/dist/cjs/src/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +4 -0
  171. package/dist/cjs/src/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +10 -0
  172. package/dist/cjs/src/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -0
  173. package/dist/cjs/src/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
  174. package/dist/cjs/src/biz-components/Listing/components/index.d.ts +3 -0
  175. package/dist/cjs/src/biz-components/Listing/const.d.ts +29 -0
  176. package/dist/cjs/src/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
  177. package/dist/cjs/src/biz-components/Listing/hooks/use-variant.d.ts +5 -0
  178. package/dist/cjs/src/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
  179. package/dist/cjs/src/biz-components/Listing/hooks/useCopy.d.ts +5 -0
  180. package/dist/cjs/src/biz-components/Listing/index.d.ts +4 -0
  181. package/dist/cjs/src/biz-components/Listing/types/graphql.d.ts +7473 -0
  182. package/dist/cjs/src/biz-components/Listing/types/product.d.ts +141 -0
  183. package/dist/cjs/src/biz-components/Listing/types/type-helper.d.ts +5 -0
  184. package/dist/cjs/src/biz-components/Listing/types.d.ts +28 -0
  185. package/dist/cjs/src/biz-components/Listing/utils/helper.d.ts +36 -0
  186. package/dist/cjs/src/biz-components/Listing/utils/index.d.ts +37 -0
  187. package/dist/cjs/src/biz-components/Listing/utils/textFormat.d.ts +73 -0
  188. package/dist/cjs/src/biz-components/SelectStore/index.d.ts +21 -0
  189. package/dist/cjs/src/biz-components/ShelfDisplay/shelfDisplay.d.ts +11 -2
  190. package/dist/cjs/src/biz-components/index.d.ts +24 -0
  191. package/dist/cjs/src/components/checkbox.d.ts +1 -0
  192. package/dist/cjs/src/hooks/useRollout.d.ts +14 -0
  193. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  194. package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
  195. package/dist/esm/biz-components/AplusDesc/index.js +2 -0
  196. package/dist/esm/biz-components/AplusDesc/index.js.map +7 -0
  197. package/dist/esm/biz-components/DownLoad/index.js +2 -0
  198. package/dist/esm/biz-components/DownLoad/index.js.map +7 -0
  199. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  200. package/dist/esm/biz-components/Faq/Faq.js.map +3 -3
  201. package/dist/esm/biz-components/Features/index.js +2 -0
  202. package/dist/esm/biz-components/Features/index.js.map +7 -0
  203. package/dist/esm/biz-components/FootCharger/index.js +2 -0
  204. package/dist/esm/biz-components/FootCharger/index.js.map +7 -0
  205. package/dist/esm/biz-components/GiftBox/index.js +2 -0
  206. package/dist/esm/biz-components/GiftBox/index.js.map +7 -0
  207. package/dist/esm/biz-components/Graphic/index.js +1 -1
  208. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  209. package/dist/esm/biz-components/GraphicMore/index.js +2 -0
  210. package/dist/esm/biz-components/GraphicMore/index.js.map +7 -0
  211. package/dist/esm/biz-components/HeroBanner/Countdown.js +2 -0
  212. package/dist/esm/biz-components/HeroBanner/Countdown.js.map +7 -0
  213. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  214. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  215. package/dist/esm/biz-components/Listing/BizProductProvider.js +2 -0
  216. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +7 -0
  217. package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
  218. package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
  219. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
  220. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
  221. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
  222. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
  223. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +2 -0
  224. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
  225. package/dist/esm/biz-components/Listing/components/PaidShipping/type.js +2 -0
  226. package/dist/esm/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
  227. package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js +2 -0
  228. package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
  229. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +40 -0
  230. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
  231. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
  232. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
  233. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
  234. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
  235. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
  236. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
  237. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
  238. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
  239. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
  240. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
  241. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
  242. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
  243. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
  244. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
  245. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
  246. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
  247. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
  248. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
  249. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
  250. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
  251. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
  252. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
  253. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
  254. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
  255. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
  256. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
  257. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
  258. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
  259. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
  260. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
  261. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
  262. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
  263. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +1 -0
  264. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +7 -0
  265. package/dist/esm/biz-components/Listing/components/ProductCard/index.js +2 -0
  266. package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +7 -0
  267. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
  268. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
  269. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
  270. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
  271. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +1 -0
  272. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
  273. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +2 -0
  274. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
  275. package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +1 -0
  276. package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
  277. package/dist/esm/biz-components/Listing/components/index.js +2 -0
  278. package/dist/esm/biz-components/Listing/components/index.js.map +7 -0
  279. package/dist/esm/biz-components/Listing/const.js +2 -0
  280. package/dist/esm/biz-components/Listing/const.js.map +7 -0
  281. package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +2 -0
  282. package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
  283. package/dist/esm/biz-components/Listing/hooks/use-variant.js +2 -0
  284. package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +7 -0
  285. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +2 -0
  286. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +7 -0
  287. package/dist/esm/biz-components/Listing/hooks/useCopy.js +2 -0
  288. package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +7 -0
  289. package/dist/esm/biz-components/Listing/index.js +2 -0
  290. package/dist/esm/biz-components/Listing/index.js.map +7 -0
  291. package/dist/esm/biz-components/Listing/types/graphql.js +2 -0
  292. package/dist/esm/biz-components/Listing/types/graphql.js.map +7 -0
  293. package/dist/esm/biz-components/Listing/types/product.js +2 -0
  294. package/dist/esm/biz-components/Listing/types/product.js.map +7 -0
  295. package/dist/esm/biz-components/Listing/types/productMetafields.d.js +2 -0
  296. package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +7 -0
  297. package/dist/esm/biz-components/Listing/types/type-helper.js +1 -0
  298. package/dist/esm/biz-components/Listing/types/type-helper.js.map +7 -0
  299. package/dist/esm/biz-components/Listing/types.js +1 -0
  300. package/dist/esm/biz-components/Listing/types.js.map +7 -0
  301. package/dist/esm/biz-components/Listing/utils/helper.js +2 -0
  302. package/dist/esm/biz-components/Listing/utils/helper.js.map +7 -0
  303. package/dist/esm/biz-components/Listing/utils/index.js +2 -0
  304. package/dist/esm/biz-components/Listing/utils/index.js.map +7 -0
  305. package/dist/esm/biz-components/Listing/utils/textFormat.js +2 -0
  306. package/dist/esm/biz-components/Listing/utils/textFormat.js.map +7 -0
  307. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  308. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  309. package/dist/esm/biz-components/SelectStore/index.js +2 -0
  310. package/dist/esm/biz-components/SelectStore/index.js.map +7 -0
  311. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  312. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  313. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  314. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +3 -3
  315. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +9 -9
  316. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  317. package/dist/esm/biz-components/index.js +1 -1
  318. package/dist/esm/biz-components/index.js.map +2 -2
  319. package/dist/esm/components/checkbox.js +1 -1
  320. package/dist/esm/components/checkbox.js.map +3 -3
  321. package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
  322. package/dist/esm/helpers/ScrollLoadVideo.js.map +3 -3
  323. package/dist/esm/hooks/useRollout.js +2 -0
  324. package/dist/esm/hooks/useRollout.js.map +7 -0
  325. package/dist/esm/src/biz-components/AiuiProvider/index.d.ts +4 -0
  326. package/dist/esm/src/biz-components/AplusDesc/index.d.ts +23 -0
  327. package/dist/esm/src/biz-components/DownLoad/index.d.ts +21 -0
  328. package/dist/esm/src/biz-components/Features/index.d.ts +27 -0
  329. package/dist/esm/src/biz-components/FootCharger/index.d.ts +13 -0
  330. package/dist/esm/src/biz-components/GiftBox/index.d.ts +18 -0
  331. package/dist/esm/src/biz-components/GraphicMore/index.d.ts +23 -0
  332. package/dist/esm/src/biz-components/HeroBanner/Countdown.d.ts +9 -0
  333. package/dist/esm/src/biz-components/HeroBanner/types.d.ts +6 -0
  334. package/dist/esm/src/biz-components/Listing/BizProductProvider.d.ts +126 -0
  335. package/dist/esm/src/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
  336. package/dist/esm/src/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
  337. package/dist/esm/src/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
  338. package/dist/esm/src/biz-components/Listing/components/PaidShipping/index.d.ts +12 -0
  339. package/dist/esm/src/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
  340. package/dist/esm/src/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
  341. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +38 -0
  342. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
  343. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +2 -0
  344. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +2 -0
  345. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +2 -0
  346. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +2 -0
  347. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +2 -0
  348. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
  349. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
  350. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
  351. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
  352. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
  353. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
  354. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +2 -0
  355. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +42 -0
  356. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
  357. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -0
  358. package/dist/esm/src/biz-components/Listing/components/ProductCard/ProductSummary/types.d.ts +2 -0
  359. package/dist/esm/src/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
  360. package/dist/esm/src/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
  361. package/dist/esm/src/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +4 -0
  362. package/dist/esm/src/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +10 -0
  363. package/dist/esm/src/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -0
  364. package/dist/esm/src/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
  365. package/dist/esm/src/biz-components/Listing/components/index.d.ts +3 -0
  366. package/dist/esm/src/biz-components/Listing/const.d.ts +29 -0
  367. package/dist/esm/src/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
  368. package/dist/esm/src/biz-components/Listing/hooks/use-variant.d.ts +5 -0
  369. package/dist/esm/src/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
  370. package/dist/esm/src/biz-components/Listing/hooks/useCopy.d.ts +5 -0
  371. package/dist/esm/src/biz-components/Listing/index.d.ts +4 -0
  372. package/dist/esm/src/biz-components/Listing/types/graphql.d.ts +7473 -0
  373. package/dist/esm/src/biz-components/Listing/types/product.d.ts +141 -0
  374. package/dist/esm/src/biz-components/Listing/types/type-helper.d.ts +5 -0
  375. package/dist/esm/src/biz-components/Listing/types.d.ts +28 -0
  376. package/dist/esm/src/biz-components/Listing/utils/helper.d.ts +36 -0
  377. package/dist/esm/src/biz-components/Listing/utils/index.d.ts +37 -0
  378. package/dist/esm/src/biz-components/Listing/utils/textFormat.d.ts +73 -0
  379. package/dist/esm/src/biz-components/SelectStore/index.d.ts +21 -0
  380. package/dist/esm/src/biz-components/ShelfDisplay/shelfDisplay.d.ts +11 -2
  381. package/dist/esm/src/biz-components/index.d.ts +24 -0
  382. package/dist/esm/src/components/checkbox.d.ts +1 -0
  383. package/dist/esm/src/hooks/useRollout.d.ts +14 -0
  384. package/dist/tokens/anker.css +1 -0
  385. package/dist/tokens/base.css +1 -1
  386. package/dist/tokens/eufy.css +1 -0
  387. package/dist/tokens/eufyMake.css +1 -0
  388. package/dist/tokens/solix.css +1 -0
  389. package/dist/tokens/soundcore.css +1 -0
  390. package/package.json +3 -1
@@ -0,0 +1,2 @@
1
+ "use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var p=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of a(t))!u.call(e,r)&&r!==n&&o(e,r,{get:()=>t[r],enumerable:!(i=s(t,r))||i.enumerable});return e};var d=e=>p(o({},"__esModule",{value:!0}),e);var c={};module.exports=d(c);var y=require("../const");
2
+ //# sourceMappingURL=product.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/types/product.ts"],
4
+ "sourcesContent": ["import type {\n CurrencyCode,\n Image,\n Media,\n Product as ShopifyProduct,\n ProductVariant as ShopifyProductVariant,\n} from './graphql'\nimport { DiscountType } from '../const'\n\nexport type ProductPrice = {\n amount: number\n currencyCode: CurrencyCode\n}\n\nexport type ProductOption = {\n __typename?: 'MultipleChoiceOption'\n id: string\n name: string\n values: ProductOptionValues[]\n}\n\nexport type ProductOptionValues = {\n label: string\n hexColors?: string[]\n}\n\nexport type ProductVariant = {\n id: string | number\n options: ProductOption[]\n sku: string\n metafields?: Record<string, any>\n price: ProductPrice\n product: Product\n coupons: VariantCoupon[]\n weight?: number\n payload?: any\n} & Omit<ShopifyProductVariant, 'options' | 'metafields' | 'price'>\n\nexport type Product = {\n path?: string\n images: Image[]\n media: ProductMedia[]\n variants: ProductVariant[]\n price: ProductPrice\n options: ProductOption[]\n metafields?: { [key: string]: any }\n slug: string\n payload?: any\n} & Omit<ShopifyProduct, 'metafields' | 'images' | 'variants' | 'price' | 'options' | 'media'>\n\nexport type GetProductBody = {\n handles: string\n locale?: string\n}\n\nexport type ProductTypes = {\n product: Product\n getBody: GetProductBody\n}\n\nexport type GetAllProductPathsOperation<T extends ProductTypes = ProductTypes> = {\n data: { products: Pick<T['product'], 'path'>[] }\n variables: { first?: number }\n}\n\nexport type GetAllProductsOperation<T extends ProductTypes = ProductTypes> = {\n data: { products: T['product'][] }\n variables: {\n relevance?: 'featured' | 'best_selling' | 'newest'\n ids?: string[]\n first?: number\n }\n}\n\nexport type GetProductOperation<T extends ProductTypes = ProductTypes> = {\n data: { product?: T['product'] }\n variables: { path: string; slug?: never } | { path?: never; slug: string }\n}\n\nexport type Options = Record<string, string>\n\nexport type ProductMedia = Media & {\n sources?: {\n url: string\n altText: string\n }[]\n image?: {\n url: string\n altText: string\n }\n}\n\nexport type VariantCoupon = {\n title: string\n starts_at: string // ISO 8601 \u65E5\u671F\u5B57\u7B26\u4E32\n ends_at: string | null // ISO 8601 \u65E5\u671F\u5B57\u7B26\u4E32\u6216 null\n variant_shopify_id: number\n value_type: DiscountType\n value: string // \u8D1F\u6570\u7684\u767E\u5206\u6BD4\u503C\n currency: string\n fixed_value: string // \u56FA\u5B9A\u503C\n value_style: string // \u5E26\u6709\u8D27\u5E01\u7B26\u53F7\u7684\u503C\n variant_price4wscode: number\n discount_type: string // \u5047\u8BBE discount_type \u662F\u4E00\u4E2A\u5B57\u7B26\u4E32\n amazon_deal: boolean\n cdi_id: number\n cdi_updated_at: string // ISO 8601 \u65E5\u671F\u5B57\u7B26\u4E32\n}\n\nexport type ScriptDiscount = {\n type: DiscountType\n excludeSkus: string[]\n discount: number\n}\n\nexport type FreeGift = {\n title: string\n note: string\n soldOutLabel: string\n freeLabel: string\n giftList: ProductVariant[]\n count: number\n showCoupon: boolean\n [key: string]: any\n}\n\nexport type BundleListItem = {\n id: string\n price: number\n comparePrice: number\n savings: number\n variants: {\n price: number\n quantity: number\n label: string\n variant: ProductVariant\n }[]\n}\n\nexport type Bundle = {\n title: string\n soldOutLabel: string\n youSaveText: string\n showCoupon: boolean\n bundleList: BundleListItem[]\n showAtListing: boolean\n [key: string]: any\n}"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAOA,IAAAE,EAA6B",
6
+ "names": ["product_exports", "__toCommonJS", "import_const"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var u=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of l(e))!a.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(n=o(e,s))||n.enumerable});return t};var p=t=>u(i({},"__esModule",{value:!0}),t);var b={};module.exports=p(b);var g=require("@projectTypes/product");
2
+ //# sourceMappingURL=productMetafields.d.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/types/productMetafields.d.ts"],
4
+ "sourcesContent": ["import { DiscountType } from '@projectTypes/product'\n\n// \u6EE1\u8D60\nexport type VariantFreeGiftMetafields = {\n count: number // \u6700\u591A\u9009\u62E9\u793C\u54C1\u6570\u91CF\uFF0C\u4E70\u4E00\u8D60X\n showDiscounts: boolean\n list: {\n handle: string\n sku: string\n }[]\n labels: string[]\n}\n\n// bundle\nexport type VariantBundleMetafields = {\n list: {\n handle: string\n sku: string\n price: number\n qty: number\n label: string\n }[][]\n title: string\n discount_type: DiscountType\n showDiscounts: boolean\n labels: string[]\n}\n\n// \u6EE1\u51CF\\\u5C0Fb\u6298\u6263 metafields\nexport type VariantPriceDropMetafields = {\n showDiscounts: boolean\n discountType: DiscountType\n rules: {\n value: number\n }[]\n labels: string[]\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAA,IAAAE,EAA6B",
6
+ "names": ["productMetafields_d_exports", "__toCommonJS", "import_product"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var K=Object.prototype.hasOwnProperty;var n=(t,e,T,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of p(e))!K.call(t,r)&&r!==T&&o(t,r,{get:()=>e[r],enumerable:!(i=a(e,r))||i.enumerable});return t};var l=t=>n(o({},"__esModule",{value:!0}),t);var x={};module.exports=l(x);
2
+ //# sourceMappingURL=type-helper.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/types/type-helper.ts"],
4
+ "sourcesContent": ["export type PartialRecord<K extends string | number | symbol, T> = Partial<Record<K, T>>\n\nexport type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>\n\nexport type Replace<T, K extends keyof T, V> = Omit<T, K> & { [P in K]: V }\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["type_helper_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var c=(e,t,p,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of i(t))!n.call(e,r)&&r!==p&&a(e,r,{get:()=>t[r],enumerable:!(o=m(t,r))||o.enumerable});return e};var s=e=>c(a({},"__esModule",{value:!0}),e);var u={};module.exports=s(u);
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/Listing/types.ts"],
4
+ "sourcesContent": ["import type { Product } from './types/product'\n\nexport type CompareProductItem = {\n handle: string\n shortName: string\n compareProductCollection?: string\n}\n\nexport type CompareItem = { product: Product } & CompareProductItem\n\nexport type CompareData = {\n data: {\n availableCompareList: Array<CompareItem>\n currentProductCompareData?: CompareItem\n options: { value: string; text: string }[]\n specificationKeys?: string[]\n }\n show: boolean\n}\n\nexport type DiscountData = {\n codeSavings: number\n scriptSavings: number\n totalSavings: number\n comparePrice: number\n finalPrice: number\n}"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["types_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var u=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(e,t)=>{for(var r in t)u(e,r,{get:t[r],enumerable:!0})},p=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of l(t))!f.call(e,a)&&a!==r&&u(e,a,{get:()=>t[a],enumerable:!(n=d(t,a))||n.enumerable});return e};var m=e=>p(u({},"__esModule",{value:!0}),e);var I={};g(I,{atobID:()=>P,btoaID:()=>x,checkItemAvailableForProduct:()=>v,getNormalCoupon:()=>V,getThemeLocale:()=>y,getVariantImageIndex:()=>o,getVariantMediaList:()=>k,handle:()=>b,isObjEmpty:()=>h,replaceUmlaut:()=>c});module.exports=m(I);var s=require("../const");function h(e){return e?Object.keys(e).length===0:!0}function P(e){return e&&typeof e=="string"&&e.includes("/")?e.split("/").pop()?.split("?")?.shift():e}function x(e,t="ProductVariant"){return`gid://shopify/${t}/${e}`}const y=e=>e==="eu-de"?"de":e==="eu-en"?"eu":e==="au"?"au":e,V=({variant:e})=>e?.coupons?.find(t=>t.discount_type!==s.CouponChannel.WSCH),i={\u00DC:"U",\u00C4:"A",\u00D6:"O",\u00FC:"u",\u00E4:"a",\u00F6:"o",\u00DF:"ss",\u00E8:"e"};function c(e){return e.replace(/[\u00dc|\u00c4|\u00d6][a-z]/g,t=>{const r=i[t.slice(0,1)];return r.charAt(0)+r.charAt(1).toLowerCase()+t.slice(1)}).replace(new RegExp("["+Object.keys(i).join("|")+"]","g"),t=>i[t])}function b(e){return c(e).replace(/ /g,"-").replace(/[^a-zA-Z0-9-]/g,"").toLowerCase()}function o({mediaList:e,variant:t}){const r=t?.image?.url;return r?e.map(n=>n.image?.url).findIndex(n=>n==r):null}function k({product:e,variant:t}){const r=o({mediaList:e.media,variant:t});if(r!==null){const n=e.variants.filter(a=>t.id!==a.id).map(a=>o({mediaList:e.media,variant:a})).find(a=>a!==null&&a>r)||-1;return e.media.slice(r,n===-1?e.media.length:n)}else return e.media}const v=({product:e,item:t,variant:r})=>t?Number(t?.includeTags?.length)>0?e.tags?.find(n=>t?.includeTags?.includes(n)):Number(t?.includeProducts?.length)>0?t.includeProducts?.find(n=>n?.variant?.handle===e.handle&&n?.variant?.sku===r.sku):Number(t?.excludeProducts?.length)>0?!t.excludeProducts?.find(n=>n?.variant?.handle===e.handle&&n?.variant?.sku===r.sku):!0:!1;
2
+ //# sourceMappingURL=helper.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/utils/helper.ts"],
4
+ "sourcesContent": ["// \u6539\u7EC4\u4EF6\u5BA2\u6237\u7AEF\u6267\u884C\n// import { SchemaVariant } from '@projectTypes/template'\nimport type { Product, ProductMedia, ProductVariant } from '../types/product'\nimport { CouponChannel } from '../const'\n// import Cookies from 'js-cookie'\n// import { Attribute, HasMetafieldsIdentifier } from 'lib/shopify/gql'\n// import { HasMetafieldQueryRoot } from 'lib/shopify/types/fetcher'\n// import { useEffect, useState } from 'react'\n\n// import { PartialRecord } from './type-helper'\n\nexport type SchemaVariant = {\n variant: {\n handle: string\n sku: string\n }\n}\n\n// \u5224\u65AD\u5BF9\u8C61\u662F\u5426\u4E3A\u7A7A\nexport function isObjEmpty(obj?: Record<string, any>) {\n if (!obj) return true\n else {\n return Object.keys(obj).length === 0\n }\n}\n\nexport function atobID(id: string) {\n if (id && typeof id === 'string' && id.includes('/')) {\n return id.split('/').pop()?.split('?')?.shift()\n } else {\n return id\n }\n}\n\nexport function btoaID(id: string, type: 'ProductVariant' | 'Product' = 'ProductVariant') {\n return `gid://shopify/${type}/${id}`\n}\n\n// \u76AE\u80A4\u7AD9\u4E09\u7EA7\u57DF\u540D\nexport const getThemeLocale = (locale: string) => {\n if (locale === 'eu-de') return 'de'\n if (locale === 'eu-en') return 'eu'\n if (locale === 'au') return 'au'\n return locale\n}\n\n/**\n * \u751F\u6210 metafieldIdentifiers \u67E5\u8BE2\u53C2\u6570\n */\n// export function constructMetafieldIdentifiersQueryParams<T extends HasMetafieldQueryRoot>(\n// metafieldIdentifiers: PartialRecord<T, HasMetafieldsIdentifier[]> = {},\n// ): PartialRecord<`${T}MetafieldIdentifiers`, HasMetafieldsIdentifier[]> {\n// const identifiers = Object.entries(metafieldIdentifiers).reduce(\n// (queryInput, [key, value]) => {\n// const metafieldIdentifiers = value as HasMetafieldsIdentifier[]\n// queryInput[`${key}MetafieldIdentifiers`] = metafieldIdentifiers\n// .filter((item) => !item.namespace.startsWith(metafieldNamespacePrefix))\n// .map((item) => ({\n// namespace: `${metafieldNamespacePrefix}combo`,\n// key: item.namespace,\n// }))\n// .concat(metafieldIdentifiers)\n// return queryInput\n// },\n// {} as PartialRecord<`${T}MetafieldIdentifiers`, HasMetafieldsIdentifier[]>,\n// )\n// return identifiers\n// }\n\n// export function cleanShopKey(shop: Shop) {\n// const { privacyPolicy, refundPolicy, shippingPolicy, termsOfService, subscriptionPolicy, ...otherShop } = shop\n// return otherShop\n// }\n\n// export const delHtmlTag = (str?: string) => {\n// return str ? String(str).replace(/<[^>]+>/g, '') : ''\n// }\n\nexport const getNormalCoupon = ({ variant }: { variant?: ProductVariant }) => {\n return variant?.coupons?.find(coupon => coupon.discount_type !== CouponChannel.WSCH)\n}\n\n// export const setCartSecretCookie = ({ cart }) => {\n// const key = cart.id.split('?key=')[1]\n// const id = cart.id.split('?key=')[0].split('gid://shopify/Cart/')[1]\n// Cookies.set(id, key, {\n// Domain: window.location.hostname.split('.').reverse().slice(0, 2).reverse().join('.'),\n// })\n// }\n\n// export const languageCode = (locale: string) =>\n// ({\n// us: 'US',\n// uk: 'GB',\n// ca: 'CA',\n// fr: 'FR',\n// au: 'AU',\n// my: 'MY',\n// vn: 'VN',\n// it: 'IT',\n// de: 'DE',\n// cl: 'CL',\n// })[locale] || 'US'\n\n// shopify \u7684\u7279\u6B8A\u6587\u4EF6\u8F6C\u6362\u89C4\u5219\nconst umlautMap = {\n '\\u00dc': 'U',\n '\\u00c4': 'A',\n '\\u00d6': 'O',\n '\\u00fc': 'u',\n '\\u00e4': 'a',\n '\\u00f6': 'o',\n '\\u00df': 'ss',\n '\\u00E8': 'e',\n}\n\n// \u66FF\u6362\u5B57\u7B26\u4E32\u4E2D\u7684\u7279\u6B8A\u5B57\u7B26\nexport function replaceUmlaut(str: string) {\n return str\n .replace(/[\\u00dc|\\u00c4|\\u00d6][a-z]/g, a => {\n const big = umlautMap[a.slice(0, 1) as keyof typeof umlautMap]\n return big.charAt(0) + big.charAt(1).toLowerCase() + a.slice(1)\n })\n .replace(new RegExp('[' + Object.keys(umlautMap).join('|') + ']', 'g'), a => umlautMap[a as keyof typeof umlautMap])\n}\n\n// \u5C06\u5B57\u7B26\u4E32\u8F6C\u6362\u4E3A slug\nexport function handle(str: string) {\n return replaceUmlaut(str)\n .replace(/ /g, '-')\n .replace(/[^a-zA-Z0-9-]/g, '')\n .toLowerCase()\n}\n\n// get variant image index\nexport function getVariantImageIndex({\n mediaList,\n variant,\n}: {\n variant: ProductVariant\n mediaList: ProductMedia[]\n}): null | number {\n const src = variant?.image?.url\n return src ? mediaList.map(media => media.image?.url).findIndex(imageSrc => imageSrc == src) : null\n}\n\n// get images belong to variant\nexport function getVariantMediaList({ product, variant }: { variant: ProductVariant; product: Product }) {\n const currentVariantImageIndex = getVariantImageIndex({ mediaList: product.media, variant })\n\n if (currentVariantImageIndex !== null) {\n const nextVariantImageIndex =\n product.variants\n .filter(v => variant.id !== v.id)\n .map(v => getVariantImageIndex({ mediaList: product.media, variant: v }))\n .find(index => index !== null && index > currentVariantImageIndex) || -1\n\n // current variant images, if no next variant found, return images from current index to the end\n return product.media.slice(\n currentVariantImageIndex,\n nextVariantImageIndex === -1 ? product.media.length : nextVariantImageIndex\n )\n } else {\n // if no variant image found, return all images\n return product.media\n }\n}\n\n// // \u901A\u8FC7\u9009\u62E9 option \u83B7\u53D6 variant\n// export function getVariantFromSelectedOptions({\n// product,\n// selectedOptions,\n// }: {\n// product: Product\n// selectedOptions: Record<string, string>\n// }) {\n// return product.variants.find((variant) => {\n// return Object.entries(selectedOptions).every(([key, value]) =>\n// variant.options.find((option) => {\n// if (option.__typename === 'MultipleChoiceOption' && option.name === key) {\n// return option.values.find((v) => v.label === value)\n// }\n// }),\n// )\n// })\n// }\n\n// export const getURLParameter = (name, url = window.location.href) => {\n// name = name.replace(/[\\[\\]]/g, '\\\\$&') // \u5C06\u65B9\u62EC\u53F7\u8F6C\u4E49\uFF0C\u4EE5\u4FBF\u5728\u6B63\u5219\u8868\u8FBE\u5F0F\u4E2D\u4F7F\u7528\n// var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)') // \u521B\u5EFA\u5339\u914D\u53C2\u6570\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\n// var results = regex.exec(url) // \u5728URL\u4E2D\u67E5\u627E\u5339\u914D\u7684\u53C2\u6570\n// if (!results) return null // \u5982\u679C\u6CA1\u6709\u627E\u5230\u5339\u914D\u7684\u53C2\u6570\uFF0C\u5219\u8FD4\u56DEnull\n// if (!results[2]) return '' // \u5982\u679C\u53C2\u6570\u7684\u503C\u4E3A\u7A7A\uFF0C\u5219\u8FD4\u56DE\u7A7A\u5B57\u7B26\u4E32\n// return decodeURIComponent(results[2]) // \u8FD4\u56DE\u89E3\u7801\u540E\u7684\u53C2\u6570\u503C\n// }\n\nexport const checkItemAvailableForProduct = ({\n product,\n item,\n variant,\n}: {\n product: Product\n variant: ProductVariant\n item?: {\n includeTags?: string[]\n includeProducts?: SchemaVariant[]\n excludeProducts?: SchemaVariant[]\n }\n}) => {\n if (item) {\n if (Number(item?.includeTags?.length) > 0) {\n return product.tags?.find((tag) => item?.includeTags?.includes(tag))\n } else if (Number(item?.includeProducts?.length) > 0) {\n return item.includeProducts?.find((p) => p?.variant?.handle === product.handle && p?.variant?.sku === variant.sku)\n } else if (Number(item?.excludeProducts?.length) > 0) {\n return !item.excludeProducts?.find(\n (p) => p?.variant?.handle === product.handle && p?.variant?.sku === variant.sku,\n )\n } else {\n return true\n }\n } else {\n return false\n }\n}\n// export const getReferralAttributes = () => {\n// const inviteCode = Cookies.get('invite_code')\n// const playModeId = Cookies.get('playModeId')\n// const popup = Cookies.get('_popup')\n// if (inviteCode && playModeId) {\n// return popup\n// ? [\n// { key: '_invite_code', value: inviteCode ? inviteCode : '' },\n// { key: '_play_mode_id', value: playModeId ? playModeId : '' },\n// { key: '_popup', value: popup },\n// ]\n// : [\n// { key: '_invite_code', value: inviteCode ? inviteCode : '' },\n// { key: '_play_mode_id', value: playModeId ? playModeId : '' },\n// ]\n// }\n// return []\n// }\n\n// export function useH2Toc(htmlContent: string) {\n// const [toc, setToc] = useState<{ updatedHtmlContent: string; dataList: { url: string; text: string }[] }>({\n// updatedHtmlContent: htmlContent,\n// dataList: [],\n// })\n\n// useEffect(() => {\n// if (typeof window === 'undefined' || typeof document === 'undefined') return\n// const div = document.createElement('div')\n// div.innerHTML = htmlContent\n// const h2s = div.querySelectorAll('h2')\n// const dataList: { url: string; text: string }[] = []\n// h2s.forEach((h2, idx) => {\n// const text = (h2.textContent || '').trim()\n// if (!text) return\n// const id = encodeURIComponent(text).replace(/'/g, '&#39;')\n// h2.setAttribute('id', id)\n// dataList.push({ url: id, text })\n// })\n// setToc({ updatedHtmlContent: div.innerHTML, dataList })\n// }, [htmlContent])\n\n// return toc\n// }\n\n// export const isAttributesEqual = (oldAttributes: Attribute[], newAttributes: Attribute[]) => {\n// // \u6BD4\u5BF9\u4E24\u4E2A\u6570\u636E\u662F\u5426\u5B8C\u5168\u76F8\u540C\n// // \u68C0\u67E5\u6570\u7EC4\u957F\u5EA6\u662F\u5426\u76F8\u540C\n// if (oldAttributes?.length !== newAttributes?.length) {\n// return false\n// }\n\n// // \u5C06\u6570\u7EC4\u8F6C\u6362\u4E3A Map \u4EE5\u4FBF\u5FEB\u901F\u67E5\u627E\n// const oldMap = new Map(oldAttributes.map((attr) => [attr.key, attr.value]))\n// const newMap = new Map(newAttributes.map((attr) => [attr.key, attr.value]))\n\n// // \u68C0\u67E5\u6240\u6709 key \u662F\u5426\u90FD\u5B58\u5728\u4E14\u503C\u76F8\u540C\n// for (const [key, value] of newMap) {\n// if (!oldMap.has(key) || oldMap.get(key) !== value) {\n// return false\n// }\n// }\n\n// return true\n// }\n\n// // \u68C0\u67E5\u8F93\u5165\u6846\u4E2D\u7684\u7279\u6B8A\u7B26\u53F7\n// export function validateSpecialCharacters(input: string): { isValid: boolean; invalidChars: string[] } {\n// // \u5B9A\u4E49\u4E0D\u5141\u8BB8\u7684\u7279\u6B8A\u7B26\u53F7\n// const invalidSpecialChars = /[!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?`~]/g\n\n// const matches = input.match(invalidSpecialChars)\n// const invalidChars = matches ? [...new Set(matches)] : []\n\n// return {\n// isValid: invalidChars.length === 0,\n// invalidChars,\n// }\n// }\n\n// // \u83B7\u53D6\u7279\u6B8A\u7B26\u53F7\u7684\u9519\u8BEF\u63D0\u793A\u4FE1\u606F\n// export function getSpecialCharErrorMessage(invalidChars: string[]): string {\n// if (invalidChars.length === 0) return ''\n\n// const uniqueChars = [...new Set(invalidChars)]\n// if (uniqueChars.length === 1) {\n// return `\u4E0D\u5141\u8BB8\u4F7F\u7528\u7279\u6B8A\u7B26\u53F7: ${uniqueChars[0]}`\n// } else {\n// return `\u4E0D\u5141\u8BB8\u4F7F\u7528\u4EE5\u4E0B\u7279\u6B8A\u7B26\u53F7: ${uniqueChars.join(', ')}`\n// }\n// }"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,WAAAC,EAAA,iCAAAC,EAAA,oBAAAC,EAAA,mBAAAC,EAAA,yBAAAC,EAAA,wBAAAC,EAAA,WAAAC,EAAA,eAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAZ,GAGA,IAAAa,EAA8B,oBAgBvB,SAASH,EAAWI,EAA2B,CACpD,OAAKA,EAEI,OAAO,KAAKA,CAAG,EAAE,SAAW,EAFpB,EAInB,CAEO,SAASZ,EAAOa,EAAY,CACjC,OAAIA,GAAM,OAAOA,GAAO,UAA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,EAAkD,CACvG,MAAMW,EAA2BtB,EAAqB,CAAE,UAAWqB,EAAQ,MAAO,QAAAV,CAAQ,CAAC,EAE3F,GAAIW,IAA6B,KAAM,CACrC,MAAMC,EACJF,EAAQ,SACL,OAAOG,GAAKb,EAAQ,KAAOa,EAAE,EAAE,EAC/B,IAAIA,GAAKxB,EAAqB,CAAE,UAAWqB,EAAQ,MAAO,QAASG,CAAE,CAAC,CAAC,EACvE,KAAKC,GAASA,IAAU,MAAQA,EAAQH,CAAwB,GAAK,GAG1E,OAAOD,EAAQ,MAAM,MACnBC,EACAC,IAA0B,GAAKF,EAAQ,MAAM,OAASE,CACxD,CACF,KAEE,QAAOF,EAAQ,KAEnB,CA8BO,MAAMxB,EAA+B,CAAC,CAC3C,QAAAwB,EACA,KAAAK,EACA,QAAAf,CACF,IASMe,EACE,OAAOA,GAAM,aAAa,MAAM,EAAI,EAC/BL,EAAQ,MAAM,KAAMM,GAAQD,GAAM,aAAa,SAASC,CAAG,CAAC,EAC1D,OAAOD,GAAM,iBAAiB,MAAM,EAAI,EAC1CA,EAAK,iBAAiB,KAAME,GAAMA,GAAG,SAAS,SAAWP,EAAQ,QAAUO,GAAG,SAAS,MAAQjB,EAAQ,GAAG,EACxG,OAAOe,GAAM,iBAAiB,MAAM,EAAI,EAC1C,CAACA,EAAK,iBAAiB,KAC3BE,GAAMA,GAAG,SAAS,SAAWP,EAAQ,QAAUO,GAAG,SAAS,MAAQjB,EAAQ,GAC9E,EAEO,GAGF",
6
+ "names": ["helper_exports", "__export", "atobID", "btoaID", "checkItemAvailableForProduct", "getNormalCoupon", "getThemeLocale", "getVariantImageIndex", "getVariantMediaList", "handle", "isObjEmpty", "replaceUmlaut", "__toCommonJS", "import_const", "obj", "id", "type", "locale", "variant", "coupon", "umlautMap", "str", "a", "big", "mediaList", "src", "media", "imageSrc", "product", "currentVariantImageIndex", "nextVariantImageIndex", "v", "index", "item", "tag", "p"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var v=(r,e)=>{for(var n in e)c(r,n,{get:e[n],enumerable:!0})},O=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of b(e))!P.call(r,i)&&i!==n&&c(r,i,{get:()=>e[i],enumerable:!(t=y(e,i))||t.enumerable});return r};var C=r=>O(c({},"__esModule",{value:!0}),r);var $={};v($,{formatPrice:()=>d,formatVariantPrice:()=>x,getFirstAvailableVariant:()=>S,getVariantBySku:()=>k,getVariantFromSelectedOptions:()=>V,languageTerritory:()=>f,optionsConstructor:()=>F});module.exports=C($);var u=require("../const");function F(r){return r.reduce((e,n)=>(e[n.name]=n.values[0].label,e),{})}const S=r=>r.variants.find(e=>e.availableForSale)||r.variants[0],k=(r,e)=>r.variants.find(n=>n.sku===e),f=r=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",eu:"en-eu",pl:"pl-pl",fr:"fr-fr",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"en-ae",plus:"en-us",cl:"es-cl",es:"es-es",se:"en-se",dk:"en-dk",is:"en-is",no:"en-no",fi:"en-fi"})[r]||"";function d({amount:r,currencyCode:e,locale:n,maximumFractionDigits:t,minimumFractionDigits:i,removeTrailingZeros:a=!1}){let o=new Intl.NumberFormat(f(n),{style:"currency",currency:e||"USD",minimumFractionDigits:t===0?0:i,maximumFractionDigits:t}).format(r);return["eu-de","eu-en","de","eu"].includes(n)&&(o=o?.toString()?.replace(/[\s]/g,"")),a&&(o=o.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),o}function x({amount:r,baseAmount:e,currencyCode:n,locale:t,maximumFractionDigits:i,minimumFractionDigits:a,removeTrailingZeros:s}){if(typeof Intl>"u")return{price:`${u.PRICE_SYMBOL[t]}${r}`,basePrice:`${u.PRICE_SYMBOL[t]}${e}`,discount:`${u.PRICE_SYMBOL[t]}${e-r||0}`};const o=e>r,p=new Intl.NumberFormat(f(t),{style:"percent"}),m=o?p.format((e-r)/e):null,l=d({amount:r,currencyCode:n,locale:t,removeTrailingZeros:s}),g=o?d({amount:e,currencyCode:n,locale:t,maximumFractionDigits:i,minimumFractionDigits:a,removeTrailingZeros:s}):void 0;return{price:l,basePrice:g,discount:m}}function V({product:r,selectedOptions:e}){return r.variants.find(n=>Object.entries(e).every(([t,i])=>n.options.find(a=>{if(a.__typename==="MultipleChoiceOption"&&a.name===t)return a.values.find(s=>s.label===i)})))}
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/utils/index.ts"],
4
+ "sourcesContent": ["import { PRICE_SYMBOL } from '../const'\nimport type { Options, Product, ProductOption, ProductVariant } from '../types/product'\n\nexport function optionsConstructor(options: ProductOption[]): Options {\n return options.reduce((pre: any, cur: any) => {\n pre[cur.name] = cur.values[0].label\n return pre\n }, {})\n}\n\n/**\n * Returns the first available variant of a product.\n * If no variant is available, it returns the first variant in the list.\n *\n * @param product - The product object.\n * @returns The first available variant of the product.\n */\nexport const getFirstAvailableVariant = (product: Product) =>\n product.variants.find((variant: ProductVariant) => variant.availableForSale) || product.variants[0]\n\nexport const getVariantBySku = (product: Product, sku: string) =>\n product.variants.find((variant: ProductVariant) => variant.sku === sku)\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n eu: 'en-eu',\n pl: 'pl-pl',\n fr: 'fr-fr',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'en-ae',\n plus: 'en-us',\n cl: 'es-cl',\n es: 'es-es',\n // Nordic countries\n se: 'en-se',\n dk: 'en-dk',\n is: 'en-is',\n no: 'en-no',\n fi: 'en-fi',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale as keyof typeof PRICE_SYMBOL]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n\nexport function getVariantFromSelectedOptions({\n product,\n selectedOptions,\n}: {\n product: Product\n selectedOptions: Record<string, string>\n}) {\n return product.variants.find(variant => {\n return Object.entries(selectedOptions).every(([key, value]) =>\n variant.options.find(option => {\n if (option.__typename === 'MultipleChoiceOption' && option.name === key) {\n return option.values.find(v => v.label === value)\n }\n })\n )\n })\n}"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,EAAA,uBAAAC,EAAA,6BAAAC,EAAA,oBAAAC,EAAA,kCAAAC,EAAA,sBAAAC,EAAA,uBAAAC,IAAA,eAAAC,EAAAT,GAAA,IAAAU,EAA6B,oBAGtB,SAASF,EAAmBG,EAAmC,CACpE,OAAOA,EAAQ,OAAO,CAACC,EAAUC,KAC/BD,EAAIC,EAAI,IAAI,EAAIA,EAAI,OAAO,CAAC,EAAE,MACvBD,GACN,CAAC,CAAC,CACP,CASO,MAAMR,EAA4BU,GACvCA,EAAQ,SAAS,KAAMC,GAA4BA,EAAQ,gBAAgB,GAAKD,EAAQ,SAAS,CAAC,EAEvFT,EAAkB,CAACS,EAAkBE,IAChDF,EAAQ,SAAS,KAAMC,GAA4BA,EAAQ,MAAQC,CAAG,EAE3DT,EAAqBU,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,QACJ,GAAI,QAEJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,GAAGA,CAAM,GAAK,GAET,SAASf,EAAY,CAC1B,OAAAgB,EACA,aAAAC,EACA,OA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AM,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC,CAEO,SAASrB,EAA8B,CAC5C,QAAAQ,EACA,gBAAAgB,CACF,EAGG,CACD,OAAOhB,EAAQ,SAAS,KAAKC,GACpB,OAAO,QAAQe,CAAe,EAAE,MAAM,CAAC,CAACC,EAAKC,CAAK,IACvDjB,EAAQ,QAAQ,KAAKkB,GAAU,CAC7B,GAAIA,EAAO,aAAe,wBAA0BA,EAAO,OAASF,EAClE,OAAOE,EAAO,OAAO,KAAKC,GAAKA,EAAE,QAAUF,CAAK,CAEpD,CAAC,CACH,CACD,CACH",
6
+ "names": ["utils_exports", "__export", "formatPrice", "formatVariantPrice", "getFirstAvailableVariant", "getVariantBySku", "getVariantFromSelectedOptions", "languageTerritory", "optionsConstructor", "__toCommonJS", "import_const", "options", "pre", "cur", "product", "variant", "sku", "locale", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "baseAmount", "hasDiscount", "formatDiscount", "discount", "price", "basePrice", "selectedOptions", "key", "value", "option", "v"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var R=(e,n)=>{for(var r in n)i(e,r,{get:n[r],enumerable:!0})},d=(e,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of f(n))!l.call(e,t)&&t!==r&&i(e,t,{get:()=>n[t],enumerable:!(s=x(n,t))||s.enumerable});return e};var h=e=>d(i({},"__esModule",{value:!0}),e);var y={};R(y,{extractPlaceholders:()=>$,replaceTemplate:()=>u,replaceTemplates:()=>E});module.exports=h(y);const c=new Map;function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function p(e,n){const r=`${e}|${n}`;if(c.has(r))return c.get(r);const s=o(e),t=o(n),g=new RegExp(`${s}([a-zA-Z0-9_-]+)${t}`,"g");return c.set(r,g),g}function u(e,n,r="{",s="}"){if(!e||!n||Object.keys(n).length===0)return e;const t=p(r,s);return e.replace(t,(g,a)=>n[a]!==void 0?n[a]:g)}function E(e,n,r="{",s="}"){return e.map(t=>u(t,n,r,s))}function $(e,n="{",r="}"){if(!e)return[];const s=p(n,r),t=new Set;let g;for(;(g=s.exec(e))!==null;)t.add(g[1]);return Array.from(t)}
2
+ //# sourceMappingURL=textFormat.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/biz-components/Listing/utils/textFormat.ts"],
4
+ "sourcesContent": ["/**\n * \u5B57\u7B26\u4E32\u6A21\u677F\u66FF\u6362\u5DE5\u5177\u51FD\u6570\n * \u4F7F\u7528\u5355\u6B21\u904D\u5386\u548C\u6B63\u5219\u8868\u8FBE\u5F0F\u7F13\u5B58\u6765\u63D0\u9AD8\u6027\u80FD\n */\n\ntype ReplacementMap = Record<string, string>\n\n// \u7F13\u5B58\u6B63\u5219\u8868\u8FBE\u5F0F\u4EE5\u63D0\u9AD8\u6027\u80FD\nconst regexCache = new Map<string, RegExp>()\n\n/**\n * \u8F6C\u4E49\u6B63\u5219\u8868\u8FBE\u5F0F\u7279\u6B8A\u5B57\u7B26\n * @param str \u9700\u8981\u8F6C\u4E49\u7684\u5B57\u7B26\u4E32\n * @returns \u8F6C\u4E49\u540E\u7684\u5B57\u7B26\u4E32\n */\nfunction escapeRegExp(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n/**\n * \u83B7\u53D6\u6216\u521B\u5EFA\u6B63\u5219\u8868\u8FBE\u5F0F\uFF08\u5E26\u7F13\u5B58\uFF09\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u5982 \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u5982 \"}\"\n * @returns \u7F16\u8BD1\u540E\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\n */\nfunction getRegex(beginSeg: string, endSeg: string): RegExp {\n const cacheKey = `${beginSeg}|${endSeg}`\n\n if (regexCache.has(cacheKey)) {\n return regexCache.get(cacheKey)!\n }\n\n // \u8F6C\u4E49\u7279\u6B8A\u5B57\u7B26\uFF0C\u6784\u5EFA\u6B63\u5219\u8868\u8FBE\u5F0F\n // \u5339\u914D beginSeg + key + endSeg\uFF0Ckey \u53EF\u4EE5\u662F\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u3001\u8FDE\u5B57\u7B26\n const escapedBegin = escapeRegExp(beginSeg)\n const escapedEnd = escapeRegExp(endSeg)\n const regex = new RegExp(`${escapedBegin}([a-zA-Z0-9_-]+)${escapedEnd}`, 'g')\n\n regexCache.set(cacheKey, regex)\n return regex\n}\n\n/**\n * \u5B57\u7B26\u4E32\u6A21\u677F\u66FF\u6362\u51FD\u6570\n * @param template \u6A21\u677F\u5B57\u7B26\u4E32\uFF0C\u5982 \"Hello {name}, you have {count} messages\"\n * @param replacements \u66FF\u6362\u5BF9\u8C61\uFF0C\u5982 { name: \"John\", count: \"5\" }\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"}\"\n * @returns \u66FF\u6362\u540E\u7684\u5B57\u7B26\u4E32\n *\n * @example\n * ```ts\n * replaceTemplate(\"Hello {name}!\", { name: \"World\" })\n * // => \"Hello World!\"\n *\n * replaceTemplate(\"Price: {{amount}}\", { amount: \"$100\" }, \"{{\", \"}}\")\n * // => \"Price: $100\"\n *\n * replaceTemplate(\"You have {count} items\", { count: \"5\", unused: \"test\" })\n * // => \"You have 5 items\" (unused \u952E\u4F1A\u88AB\u5FFD\u7565)\n *\n * replaceTemplate(\"Hello ${name}!\", { name: \"World\" }, \"${\", \"}\")\n * // => \"Hello World!\"\n * ```\n */\nexport function replaceTemplate(\n template: string,\n replacements: ReplacementMap,\n beginSeg: string = '{',\n endSeg: string = '}',\n): string {\n if (!template) return template\n if (!replacements || Object.keys(replacements).length === 0) return template\n\n const regex = getRegex(beginSeg, endSeg)\n\n // \u4F7F\u7528 replace \u65B9\u6CD5\u8FDB\u884C\u66FF\u6362\uFF0C\u6027\u80FD\u4F18\u4E8E\u624B\u52A8\u904D\u5386\n return template.replace(regex, (match, key) => {\n // \u5982\u679C key \u5B58\u5728\u4E8E replacements \u4E2D\uFF0C\u5219\u8FD4\u56DE\u5BF9\u5E94\u7684\u503C\n // \u5426\u5219\u4FDD\u6301\u539F\u6837\uFF08\u8FD4\u56DE\u6574\u4E2A\u5339\u914D\u5185\u5BB9\uFF09\n return replacements[key] !== undefined ? replacements[key] : match\n })\n}\n\n/**\n * \u6279\u91CF\u5B57\u7B26\u4E32\u6A21\u677F\u66FF\u6362\u51FD\u6570\uFF08\u7528\u4E8E\u4E00\u6B21\u6027\u66FF\u6362\u591A\u4E2A\u6A21\u677F\uFF09\n * @param templates \u6A21\u677F\u5B57\u7B26\u4E32\u6570\u7EC4\n * @param replacements \u66FF\u6362\u5BF9\u8C61\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"}\"\n * @returns \u66FF\u6362\u540E\u7684\u5B57\u7B26\u4E32\u6570\u7EC4\n *\n * @example\n * ```ts\n * replaceTemplates(\n * [\"Hello {name}!\", \"You have {count} items\"],\n * { name: \"John\", count: \"5\" }\n * )\n * // => [\"Hello John!\", \"You have 5 items\"]\n *\n * replaceTemplates(\n * [\"Hello {{name}}!\", \"Price: {{amount}}\"],\n * { name: \"John\", amount: \"$100\" },\n * \"{{\",\n * \"}}\"\n * )\n * // => [\"Hello John!\", \"Price: $100\"]\n * ```\n */\nexport function replaceTemplates(\n templates: string[],\n replacements: ReplacementMap,\n beginSeg: string = '{',\n endSeg: string = '}',\n): string[] {\n return templates.map((template) => replaceTemplate(template, replacements, beginSeg, endSeg))\n}\n\n/**\n * \u4ECE\u6A21\u677F\u5B57\u7B26\u4E32\u4E2D\u63D0\u53D6\u6240\u6709\u5360\u4F4D\u7B26\u952E\u540D\n * @param template \u6A21\u677F\u5B57\u7B26\u4E32\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"}\"\n * @returns \u5360\u4F4D\u7B26\u952E\u540D\u6570\u7EC4\uFF08\u53BB\u91CD\uFF09\n *\n * @example\n * ```ts\n * extractPlaceholders(\"Hello {name}, you have {count} new {count} messages\")\n * // => [\"name\", \"count\"]\n *\n * extractPlaceholders(\"Hello {{name}}, price is {{amount}}\", \"{{\", \"}}\")\n * // => [\"name\", \"amount\"]\n * ```\n */\nexport function extractPlaceholders(template: string, beginSeg: string = '{', endSeg: string = '}'): string[] {\n if (!template) return []\n\n const regex = getRegex(beginSeg, endSeg)\n const keys = new Set<string>()\n let match: RegExpExecArray | null\n\n // \u4F7F\u7528 exec \u5FAA\u73AF\u66FF\u4EE3 matchAll \u4EE5\u4FDD\u8BC1\u517C\u5BB9\u6027\n while ((match = regex.exec(template)) !== null) {\n keys.add(match[1])\n }\n\n return Array.from(keys)\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,EAAA,oBAAAC,EAAA,qBAAAC,IAAA,eAAAC,EAAAL,GAQA,MAAMM,EAAa,IAAI,IAOvB,SAASC,EAAaC,EAAqB,CACzC,OAAOA,EAAI,QAAQ,sBAAuB,MAAM,CAClD,CAQA,SAASC,EAASC,EAAkBC,EAAwB,CAC1D,MAAMC,EAAW,GAAGF,CAAQ,IAAIC,CAAM,GAEtC,GAAIL,EAAW,IAAIM,CAAQ,EACzB,OAAON,EAAW,IAAIM,CAAQ,EAKhC,MAAMC,EAAeN,EAAaG,CAAQ,EACpCI,EAAaP,EAAaI,CAAM,EAChCI,EAAQ,IAAI,OAAO,GAAGF,CAAY,mBAAmBC,CAAU,GAAI,GAAG,EAE5E,OAAAR,EAAW,IAAIM,EAAUG,CAAK,EACvBA,CACT,CAyBO,SAASZ,EACda,EACAC,EACAP,EAAmB,IACnBC,EAAiB,IACT,CAER,GADI,CAACK,GACD,CAACC,GAAgB,OAAO,KAAKA,CAAY,EAAE,SAAW,EAAG,OAAOD,EAEpE,MAAMD,EAAQN,EAASC,EAAUC,CAAM,EAGvC,OAAOK,EAAS,QAAQD,EAAO,CAACG,EAAOC,IAG9BF,EAAaE,CAAG,IAAM,OAAYF,EAAaE,CAAG,EAAID,CAC9D,CACH,CA2BO,SAASd,EACdgB,EACAH,EACAP,EAAmB,IACnBC,EAAiB,IACP,CACV,OAAOS,EAAU,IAAKJ,GAAab,EAAgBa,EAAUC,EAAcP,EAAUC,CAAM,CAAC,CAC9F,CAkBO,SAAST,EAAoBc,EAAkBN,EAAmB,IAAKC,EAAiB,IAAe,CAC5G,GAAI,CAACK,EAAU,MAAO,CAAC,EAEvB,MAAMD,EAAQN,EAASC,EAAUC,CAAM,EACjCU,EAAO,IAAI,IACjB,IAAIH,EAGJ,MAAQA,EAAQH,EAAM,KAAKC,CAAQ,KAAO,MACxCK,EAAK,IAAIH,EAAM,CAAC,CAAC,EAGnB,OAAO,MAAM,KAAKG,CAAI,CACxB",
6
+ "names": ["textFormat_exports", "__export", "extractPlaceholders", "replaceTemplate", "replaceTemplates", "__toCommonJS", "regexCache", "escapeRegExp", "str", "getRegex", "beginSeg", "endSeg", "cacheKey", "escapedBegin", "escapedEnd", "regex", "template", "replacements", "match", "key", "templates", "keys"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var A=Object.create;var N=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(s,l)=>{for(var o in l)N(s,o,{get:l[o],enumerable:!0})},U=(s,l,o,p)=>{if(l&&typeof l=="object"||typeof l=="function")for(let n of Z(l))!J.call(s,n)&&n!==o&&N(s,n,{get:()=>l[n],enumerable:!(p=O(l,n))||p.enumerable});return s};var T=(s,l,o)=>(o=s!=null?A(F(s)):{},U(l||!s||!s.__esModule?N(o,"default",{value:s,enumerable:!0}):o,s)),W=s=>U(N({},"__esModule",{value:!0}),s);var ee={};K(ee,{default:()=>X});module.exports=W(ee);var e=require("react/jsx-runtime"),c=T(require("react")),H=require("react-responsive"),j=require("../../shared/Styles.js"),C=T(require("../../components/picture.js")),_=T(require("../../components/button.js")),z=require("../../components/heading.js"),D=require("../VideoModal/index.js"),$=require("../../components/gird.js"),Q=T(require("../Title/index.js")),u=require("../../helpers/utils.js"),P=T(require("../SwiperBox/index.js")),S=require("../../shared/mimeType.js"),k=require("../../components/tabs.js"),Y=require("../../hooks/useExposure.js"),V=require("../../shared/trackUrlRef.js"),q=require("../../shared/track.js");const w="image",b="p1_banner",M=({data:s,configuration:l,jIndex:o,spanType:p,title:n})=>{const[y,f]=(0,c.useState)(!1),B=(0,H.useMediaQuery)({query:"(max-width: 768px)"}),x=(0,c.useRef)(null),L=()=>{if(p)switch(p){case"full":return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(l?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,Y.useExposure)(x,{componentType:w,componentName:b,position:o,componentTitle:s.title,componentDescription:s.description,navigation:l?.activeTab}),(0,c.useEffect)(()=>{f(B)},[B]);const{theme:I="light",title:m,description:h,imageUrl:r,primaryButton:d,secondaryButton:i,imageMobileUrl:g,blockLink:v,video:t,youtubeId:a,isYouTube:G}=s,R="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,u.cn)("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",L(),{"rounded-2xl":l?.shape==="rounded","aiui-dark":I==="dark","h-[400px]":y},"text-info-primary"),ref:x,children:[(v||i.link)&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,V.trackUrlRef)(v||i.link,`${w}_${b}`),"data-headless-type-name":`${w}#${b}`,"data-headless-title-desc-button":`${m}#${h}`,"data-headless-nav-postion":`${l?.activeTab}#${o}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,S.isVideo)(r?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden overflow-hidden w-full h-full object-cover",children:(0,e.jsx)("source",{src:r?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:r?.url,alt:r?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${r?.width}/${r?.height}`}}),(0,S.isVideo)(g?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block overflow-hidden w-full h-full object-cover",children:(0,e.jsx)("source",{src:g?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:g?.url||r?.url,alt:g?.alt||r?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,u.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":s?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(z.Heading,{size:3,as:"h3",className:"item-title",html:m}),(0,e.jsx)(z.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]",html:h})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[i&&i.text&&(0,e.jsxs)(_.default,{"aria-label":m??h,className:(0,u.cn)(R,"link-left"),variant:"secondary",as:"a",href:(0,V.trackUrlRef)(i.link,`${w}_${b}`),"data-headless-type-name":`${w}#${b}`,"data-headless-title-desc-button":`${m}#${h}#${i.text}`,"data-headless-nav-postion":`${l?.activeTab}#${o}`,children:[i.text,(0,e.jsx)("span",{className:"sr-only",children:m??h})]}),d&&d.text&&(0,e.jsx)(_.default,{"aria-label":m??h,className:(0,u.cn)(R,"link-right"),variant:"primary",as:"a",href:(0,V.trackUrlRef)(d.link,`${w}_${b}`),"data-headless-type-name":`${w}#${b}`,"data-headless-title-desc-button":`${m}#${h}#${d.text}`,"data-headless-nav-postion":`${l?.activeTab}#${o}`,children:d.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20",children:(t?.url||a)&&(0,e.jsx)("button",{onClick:()=>{l?.onVideoPlayBtnClick?.(t?.url||a,G)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})})]})},E=c.default.forwardRef((s,l)=>{const{shape:o,sectionTitle:p,groupByTab:n=!1,items:y=[],carousel:f}=s.data,[B,x]=(0,c.useState)(!1),[L,I]=(0,c.useState)(""),[m,h]=(0,c.useState)(""),r=t=>{switch(t){case"full":return 12;case"half":return 6;case"one-third":return 4}},d=y.map(t=>t.tabName).filter(Boolean).filter((t,a,G)=>G.indexOf(t)===a),i=(t,a)=>{x(!0),a?h?.(t||""):I?.(t||"")},g=(t,a)=>{switch(t){case 1:return 1;case 2:return 2;default:return a?2.3:3}},v=d.map(t=>({tabName:t,items:y.filter(a=>a.tabName===t)})).reduce((t,a)=>(t[a.tabName]=a.items,t),{});return(0,e.jsxs)("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:l,className:(0,u.cn)("multiLayoutGraphicBlock","text-info-primary",s.className),children:[p&&(0,e.jsx)(Q.default,{data:{title:p},className:"section-title"}),n?(0,e.jsxs)(k.Tabs,{shape:o,align:"left",defaultValue:(0,u.spaceToHyphen)(d[0]),children:[(0,e.jsx)(k.TabsList,{children:d.map((t,a)=>(0,e.jsx)(k.TabsTrigger,{value:(0,u.spaceToHyphen)(t),onClick:()=>{(0,q.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:w,component_name:b,component_title:p,component_position:1,navigation:t,button_name:t}})},children:t},a))}),d.map((t,a)=>(0,e.jsx)(k.TabsContent,{value:(0,u.spaceToHyphen)(t),className:"desktop:mt-[36px] mt-[24px] w-full",children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(P.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:v?.[t]||[],configuration:{shape:o,isTab:n,activeTab:t,title:p,num:v?.[t]?.length||0,onVideoPlayBtnClick:i}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:g(v?.[t]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:g(v?.[t]?.length||0)}}}),f&&f?.items.length>0?(0,e.jsx)(P.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:f?.items||[],configuration:{shape:o,isTab:n,onVideoPlayBtnClick:i,title:p}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},a))]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)($.Grid,{className:"w-full",children:[y.map((t,a)=>(0,e.jsx)($.GridItem,{span:r(t.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(M,{data:t,configuration:{shape:o,onVideoPlayBtnClick:i,title:p},jIndex:a,spanType:t.width})},`${t?.title||""}${a}`)),y.map((t,a)=>(0,e.jsx)($.GridItem,{span:r("full"),className:"laptop:hidden block",children:(0,e.jsx)(M,{data:t,configuration:{shape:o,onVideoPlayBtnClick:i,title:p},jIndex:a,spanType:"full"})},`${t?.title||""}${a}`))]}),f&&f?.items.length>0?(0,e.jsx)(P.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:f?.items||[],configuration:{shape:o,onVideoPlayBtnClick:i,title:p}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),B&&(0,e.jsx)(D.VideoModal,{visible:B,youTubeId:m,videoUrl:L,onCloseModal:()=>x(!1)})]})});E.displayName="MultiLayoutGraphicBlock";var X=(0,j.withLayout)(E);
1
+ "use strict";var A=Object.create;var N=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(s,l)=>{for(var o in l)N(s,o,{get:l[o],enumerable:!0})},U=(s,l,o,p)=>{if(l&&typeof l=="object"||typeof l=="function")for(let n of Z(l))!J.call(s,n)&&n!==o&&N(s,n,{get:()=>l[n],enumerable:!(p=O(l,n))||p.enumerable});return s};var T=(s,l,o)=>(o=s!=null?A(F(s)):{},U(l||!s||!s.__esModule?N(o,"default",{value:s,enumerable:!0}):o,s)),W=s=>U(N({},"__esModule",{value:!0}),s);var ee={};K(ee,{default:()=>X});module.exports=W(ee);var e=require("react/jsx-runtime"),c=T(require("react")),H=require("react-responsive"),j=require("../../shared/Styles.js"),C=T(require("../../components/picture.js")),_=T(require("../../components/button.js")),z=require("../../components/heading.js"),D=require("../VideoModal/index.js"),$=require("../../components/gird.js"),Q=T(require("../Title/index.js")),u=require("../../helpers/utils.js"),P=T(require("../SwiperBox/index.js")),S=require("../../shared/mimeType.js"),k=require("../../components/tabs.js"),Y=require("../../hooks/useExposure.js"),V=require("../../shared/trackUrlRef.js"),q=require("../../shared/track.js");const w="image",b="p1_banner",M=({data:s,configuration:l,jIndex:o,spanType:p,title:n})=>{const[y,f]=(0,c.useState)(!1),B=(0,H.useMediaQuery)({query:"(max-width: 768px)"}),x=(0,c.useRef)(null),L=()=>{if(p)switch(p){case"full":return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(l?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,Y.useExposure)(x,{componentType:w,componentName:b,position:o,componentTitle:s.title,componentDescription:s.description,navigation:l?.activeTab}),(0,c.useEffect)(()=>{f(B)},[B]);const{theme:I="light",title:m,description:h,imageUrl:r,primaryButton:d,secondaryButton:i,imageMobileUrl:g,blockLink:v,video:t,youtubeId:a,isYouTube:G}=s,R="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,u.cn)("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",L(),{"rounded-2xl":l?.shape==="rounded","aiui-dark":I==="dark","h-[400px]":y},"text-info-primary"),ref:x,children:[(v||i.link)&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,V.trackUrlRef)(v||i.link,`${w}_${b}`),"data-headless-type-name":`${w}#${b}`,"data-headless-title-desc-button":`${m}#${h}`,"data-headless-nav-postion":`${l?.activeTab}#${o}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,S.isVideo)(r?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden overflow-hidden w-full h-full object-cover",children:(0,e.jsx)("source",{src:r?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:r?.url,alt:r?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${r?.width}/${r?.height}`}}),(0,S.isVideo)(g?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block overflow-hidden w-full h-full object-cover",children:(0,e.jsx)("source",{src:g?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:g?.url||r?.url,alt:g?.alt||r?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,u.cn)("absolutestyle laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"fullstyle laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":s?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(z.Heading,{size:3,as:"h3",className:"item-title",html:m}),(0,e.jsx)(z.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]",html:h})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[i&&i.text&&(0,e.jsxs)(_.default,{"aria-label":m??h,className:(0,u.cn)(R,"link-left"),variant:"secondary",as:"a",href:(0,V.trackUrlRef)(i.link,`${w}_${b}`),"data-headless-type-name":`${w}#${b}`,"data-headless-title-desc-button":`${m}#${h}#${i.text}`,"data-headless-nav-postion":`${l?.activeTab}#${o}`,children:[i.text,(0,e.jsx)("span",{className:"sr-only",children:m??h})]}),d&&d.text&&(0,e.jsx)(_.default,{"aria-label":m??h,className:(0,u.cn)(R,"link-right"),variant:"primary",as:"a",href:(0,V.trackUrlRef)(d.link,`${w}_${b}`),"data-headless-type-name":`${w}#${b}`,"data-headless-title-desc-button":`${m}#${h}#${d.text}`,"data-headless-nav-postion":`${l?.activeTab}#${o}`,children:d.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20",children:(t?.url||a)&&(0,e.jsx)("button",{onClick:()=>{l?.onVideoPlayBtnClick?.(t?.url||a,G)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})})]})},E=c.default.forwardRef((s,l)=>{const{shape:o,sectionTitle:p,groupByTab:n=!1,items:y=[],carousel:f}=s.data,[B,x]=(0,c.useState)(!1),[L,I]=(0,c.useState)(""),[m,h]=(0,c.useState)(""),r=t=>{switch(t){case"full":return 12;case"half":return 6;case"one-third":return 4}},d=y.map(t=>t.tabName).filter(Boolean).filter((t,a,G)=>G.indexOf(t)===a),i=(t,a)=>{x(!0),a?h?.(t||""):I?.(t||"")},g=(t,a)=>{switch(t){case 1:return 1;case 2:return 2;default:return a?2.3:3}},v=d.map(t=>({tabName:t,items:y.filter(a=>a.tabName===t)})).reduce((t,a)=>(t[a.tabName]=a.items,t),{});return(0,e.jsxs)("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:l,className:(0,u.cn)("multiLayoutGraphicBlock","text-info-primary",s.className),children:[p&&(0,e.jsx)(Q.default,{data:{title:p},className:"section-title"}),n?(0,e.jsxs)(k.Tabs,{shape:o,align:"left",defaultValue:(0,u.spaceToHyphen)(d[0]),children:[(0,e.jsx)(k.TabsList,{children:d.map((t,a)=>(0,e.jsx)(k.TabsTrigger,{value:(0,u.spaceToHyphen)(t),onClick:()=>{(0,q.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:w,component_name:b,component_title:p,component_position:1,navigation:t,button_name:t}})},children:t},a))}),d.map((t,a)=>(0,e.jsx)(k.TabsContent,{value:(0,u.spaceToHyphen)(t),className:"desktop:mt-[36px] mt-[24px] w-full",children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(P.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:v?.[t]||[],configuration:{shape:o,isTab:n,activeTab:t,title:p,num:v?.[t]?.length||0,onVideoPlayBtnClick:i}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:g(v?.[t]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:g(v?.[t]?.length||0)}}}),f&&f?.items.length>0?(0,e.jsx)(P.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:f?.items||[],configuration:{shape:o,isTab:n,onVideoPlayBtnClick:i,title:p}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},a))]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)($.Grid,{className:"w-full",children:[y.map((t,a)=>(0,e.jsx)($.GridItem,{span:r(t.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(M,{data:t,configuration:{shape:o,onVideoPlayBtnClick:i,title:p},jIndex:a,spanType:t.width})},`${t?.title||""}${a}`)),y.map((t,a)=>(0,e.jsx)($.GridItem,{span:r("full"),className:"laptop:hidden block",children:(0,e.jsx)(M,{data:t,configuration:{shape:o,onVideoPlayBtnClick:i,title:p},jIndex:a,spanType:"full"})},`${t?.title||""}${a}`))]}),f&&f?.items.length>0?(0,e.jsx)(P.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:f?.items||[],configuration:{shape:o,onVideoPlayBtnClick:i,title:p}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),B&&(0,e.jsx)(D.VideoModal,{visible:B,youTubeId:m,videoUrl:L,onCloseModal:()=>x(!1)})]})});E.displayName="MultiLayoutGraphicBlock";var X=(0,j.withLayout)(E);
2
2
  //# sourceMappingURL=MultiLayoutGraphicBlock.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.tsx"],
4
- "sourcesContent": ["import React, { useState, useEffect, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport Title from '../Title/index.js'\nimport { cn, spaceToHyphen } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'image'\nconst componentName = 'p1_banner'\n\nconst ItemBlock = ({\n data: item,\n configuration,\n jIndex,\n spanType,\n title: titleProp,\n}: {\n data: Item\n configuration?: any\n jIndex?: number\n spanType?: string\n title?: string\n}) => {\n const [isMobile, setIsMobile] = useState<boolean>(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n const ref = useRef<HTMLDivElement>(null)\n\n const handleAspect = () => {\n if (spanType) {\n switch (spanType) {\n case 'full':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 'half':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 'one-third':\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n } else {\n switch (configuration?.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n }\n }\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: jIndex,\n componentTitle: item.title,\n componentDescription: item.description,\n navigation: configuration?.activeTab,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const {\n theme = 'light',\n title,\n description,\n imageUrl,\n primaryButton,\n secondaryButton,\n imageMobileUrl,\n blockLink,\n video,\n youtubeId,\n isYouTube,\n } = item\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <div\n className={cn(\n 'item-wrapper cursor-pointer',\n 'text-info-primary group relative box-border w-full overflow-hidden',\n handleAspect(),\n {\n 'rounded-2xl': configuration?.shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n 'h-[400px]': isMobile,\n },\n `text-info-primary`\n )}\n ref={ref}\n >\n {(blockLink || secondaryButton.link) && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink || secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n )}\n <div className=\"absolute inset-0\">\n {isVideo(imageUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:block hidden overflow-hidden w-full h-full object-cover\">\n <source src={imageUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageUrl?.url}\n alt={imageUrl?.alt || ''}\n className=\"tablet:block hidden h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 group-hover:scale-105 object-cover\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n )}\n {isVideo(imageMobileUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:hidden block overflow-hidden w-full h-full object-cover\">\n <source src={imageMobileUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageMobileUrl?.url || imageUrl?.url}\n alt={imageMobileUrl?.alt || imageUrl?.alt || ''}\n className=\"tablet:hidden block h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 object-cover\"\n />\n )}\n <div\n className={cn(\n 'laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4',\n {\n 'laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto': item?.width === 'full',\n }\n )}\n >\n <div className=\"flex flex-col gap-1\">\n <Heading size={3} as=\"h3\" className=\"item-title\" html={title} />\n <Heading\n as=\"h4\"\n className=\"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]\"\n html={description}\n />\n </div>\n <div className=\"lg-desktop:gap-3 flex gap-2\">\n {secondaryButton && secondaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-left')}\n variant=\"secondary\"\n as=\"a\"\n href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${secondaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {secondaryButton.text}\n <span className=\"sr-only\">{title ?? description}</span>\n </Button>\n )}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-right')}\n variant=\"primary\"\n as=\"a\"\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${primaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n </div>\n <div>\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20\">\n {(video?.url || youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(video?.url || youtubeId, isYouTube)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = props.data\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const handleVideoPlayBtnClick = (url: string, isYouTube: boolean) => {\n setVisible(true)\n if (isYouTube) {\n setYouTubeId?.(url || '')\n } else {\n setVideoUrl?.(url || '')\n }\n }\n const handleTabNumber = (num: Number, flag?: boolean) => {\n switch (num) {\n case 1:\n return 1\n case 2:\n return 2\n default:\n return flag ? 2.3 : 3\n }\n }\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section\n data-ui-component-id=\"MultiLayoutGraphicBlock\"\n ref={ref}\n className={cn('multiLayoutGraphicBlock', 'text-info-primary', props.className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={spaceToHyphen(tabNames[0]!)}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger\n key={index}\n value={spaceToHyphen(tabName!)}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: sectionTitle,\n component_position: 1,\n navigation: tabName,\n button_name: tabName,\n },\n })\n }}\n >\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={spaceToHyphen(tabName!)} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock1'}\n data={{\n list: tabItemsMaps?.[tabName] || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n activeTab: tabName,\n title: sectionTitle,\n num: tabItemsMaps?.[tabName]?.length || 0,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0, true),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0),\n },\n }}\n />\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock2'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => {\n return (\n <GridItem\n key={`${item?.title || ''}${index}`}\n span={getSpan(item.width ?? 'full')}\n className=\"laptop:block hidden\"\n >\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={item.width}\n />\n </GridItem>\n )\n })}\n {items.map((item, index) => (\n <GridItem key={`${item?.title || ''}${index}`} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={'full'}\n />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock3'}\n data={{\n list: carousel?.items || [],\n configuration: { shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n )}\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </section>\n )\n})\n\nMultiLayoutGraphicBlock.displayName = 'MultiLayoutGraphicBlock'\n\nexport default withLayout(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
5
- "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,IAAA,eAAAC,EAAAH,IA6GQ,IAAAI,EAAA,6BA7GRC,EAAmD,oBACnDC,EAA8B,4BAE9BC,EAA2B,kCAC3BC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAwB,uCACxBC,EAA2B,kCAC3BC,EAA+B,oCAC/BC,EAAkB,gCAClBC,EAAkC,kCAClCC,EAAsB,oCACtBC,EAAwB,oCACxBC,EAAyD,oCACzDC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAAwB,iCAExB,MAAMC,EAAgB,QAChBC,EAAgB,YAEhBC,EAAY,CAAC,CACjB,KAAMC,EACN,cAAAC,EACA,OAAAC,EACA,SAAAC,EACA,MAAOC,CACT,IAMM,CACJ,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAkB,EAAK,EACjDC,KAAa,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EAE1DC,KAAM,UAAuB,IAAI,EAEjCC,EAAe,IAAM,CACzB,GAAIN,EACF,OAAQA,EAAU,CAChB,IAAK,OACH,MAAO,8LACT,IAAK,OACH,MAAO,4LACT,IAAK,YACH,MAAO,4LACT,QACE,MAAO,2LACX,KAEA,QAAQF,GAAe,IAAK,CAC1B,IAAK,GACH,MAAO,8LACT,IAAK,GACH,MAAO,4LACT,IAAK,GACH,MAAO,4LACT,QACE,MAAO,2LACX,CAEJ,KAEA,eAAYO,EAAK,CACf,cAAeX,EACf,cAAeC,EACf,SAAUI,EACV,eAAgBF,EAAK,MACrB,qBAAsBA,EAAK,YAC3B,WAAYC,GAAe,SAC7B,CAAC,KAED,aAAU,IAAM,CACdK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GAAU,OAAS,CAAC,EAC1B,cAAe,CAAE,MAAOJ,EAAO,oBAAqBgB,EAAyB,MAAOf,CAAa,CACnG,EACA,MAAO7B,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACE,MACN,EAEDiC,MACC,OAAC,cACC,QAASA,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CAAC,EAEDT,EAAwB,YAAc,0BAEtC,IAAO9C,KAAQ,cAAW8C,CAAuB",
4
+ "sourcesContent": ["import React, { useState, useEffect, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport Title from '../Title/index.js'\nimport { cn, spaceToHyphen } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'image'\nconst componentName = 'p1_banner'\n\nconst ItemBlock = ({\n data: item,\n configuration,\n jIndex,\n spanType,\n title: titleProp,\n}: {\n data: Item\n configuration?: any\n jIndex?: number\n spanType?: string\n title?: string\n}) => {\n const [isMobile, setIsMobile] = useState<boolean>(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n const ref = useRef<HTMLDivElement>(null)\n\n const handleAspect = () => {\n if (spanType) {\n switch (spanType) {\n case 'full':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 'half':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 'one-third':\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n } else {\n switch (configuration?.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n }\n }\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: jIndex,\n componentTitle: item.title,\n componentDescription: item.description,\n navigation: configuration?.activeTab,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const {\n theme = 'light',\n title,\n description,\n imageUrl,\n primaryButton,\n secondaryButton,\n imageMobileUrl,\n blockLink,\n video,\n youtubeId,\n isYouTube,\n } = item\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <div\n className={cn(\n 'item-wrapper cursor-pointer',\n 'text-info-primary group relative box-border w-full overflow-hidden',\n handleAspect(),\n {\n 'rounded-2xl': configuration?.shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n 'h-[400px]': isMobile,\n },\n `text-info-primary`\n )}\n ref={ref}\n >\n {(blockLink || secondaryButton.link) && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink || secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n )}\n <div className=\"absolute inset-0\">\n {isVideo(imageUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:block hidden overflow-hidden w-full h-full object-cover\">\n <source src={imageUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageUrl?.url}\n alt={imageUrl?.alt || ''}\n className=\"tablet:block hidden h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 group-hover:scale-105 object-cover\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n )}\n {isVideo(imageMobileUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:hidden block overflow-hidden w-full h-full object-cover\">\n <source src={imageMobileUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageMobileUrl?.url || imageUrl?.url}\n alt={imageMobileUrl?.alt || imageUrl?.alt || ''}\n className=\"tablet:hidden block h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 object-cover\"\n />\n )}\n <div\n className={cn(\n 'absolutestyle laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4',\n {\n 'fullstyle laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto': item?.width === 'full',\n }\n )}\n >\n <div className=\"flex flex-col gap-1\">\n <Heading size={3} as=\"h3\" className=\"item-title\" html={title} />\n <Heading\n as=\"h4\"\n className=\"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]\"\n html={description}\n />\n </div>\n <div className=\"lg-desktop:gap-3 flex gap-2\">\n {secondaryButton && secondaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-left')}\n variant=\"secondary\"\n as=\"a\"\n href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${secondaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {secondaryButton.text}\n <span className=\"sr-only\">{title ?? description}</span>\n </Button>\n )}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-right')}\n variant=\"primary\"\n as=\"a\"\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${primaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n </div>\n <div>\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20\">\n {(video?.url || youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(video?.url || youtubeId, isYouTube)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = props.data\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const handleVideoPlayBtnClick = (url: string, isYouTube: boolean) => {\n setVisible(true)\n if (isYouTube) {\n setYouTubeId?.(url || '')\n } else {\n setVideoUrl?.(url || '')\n }\n }\n const handleTabNumber = (num: Number, flag?: boolean) => {\n switch (num) {\n case 1:\n return 1\n case 2:\n return 2\n default:\n return flag ? 2.3 : 3\n }\n }\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section\n data-ui-component-id=\"MultiLayoutGraphicBlock\"\n ref={ref}\n className={cn('multiLayoutGraphicBlock', 'text-info-primary', props.className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={spaceToHyphen(tabNames[0]!)}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger\n key={index}\n value={spaceToHyphen(tabName!)}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: sectionTitle,\n component_position: 1,\n navigation: tabName,\n button_name: tabName,\n },\n })\n }}\n >\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={spaceToHyphen(tabName!)} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock1'}\n data={{\n list: tabItemsMaps?.[tabName] || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n activeTab: tabName,\n title: sectionTitle,\n num: tabItemsMaps?.[tabName]?.length || 0,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0, true),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0),\n },\n }}\n />\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock2'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => {\n return (\n <GridItem\n key={`${item?.title || ''}${index}`}\n span={getSpan(item.width ?? 'full')}\n className=\"laptop:block hidden\"\n >\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={item.width}\n />\n </GridItem>\n )\n })}\n {items.map((item, index) => (\n <GridItem key={`${item?.title || ''}${index}`} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={'full'}\n />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock3'}\n data={{\n list: carousel?.items || [],\n configuration: { shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n )}\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </section>\n )\n})\n\nMultiLayoutGraphicBlock.displayName = 'MultiLayoutGraphicBlock'\n\nexport default withLayout(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
5
+ "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,IAAA,eAAAC,EAAAH,IA6GQ,IAAAI,EAAA,6BA7GRC,EAAmD,oBACnDC,EAA8B,4BAE9BC,EAA2B,kCAC3BC,EAAoB,0CACpBC,EAAmB,yCACnBC,EAAwB,uCACxBC,EAA2B,kCAC3BC,EAA+B,oCAC/BC,EAAkB,gCAClBC,EAAkC,kCAClCC,EAAsB,oCACtBC,EAAwB,oCACxBC,EAAyD,oCACzDC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAAwB,iCAExB,MAAMC,EAAgB,QAChBC,EAAgB,YAEhBC,EAAY,CAAC,CACjB,KAAMC,EACN,cAAAC,EACA,OAAAC,EACA,SAAAC,EACA,MAAOC,CACT,IAMM,CACJ,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAkB,EAAK,EACjDC,KAAa,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EAE1DC,KAAM,UAAuB,IAAI,EAEjCC,EAAe,IAAM,CACzB,GAAIN,EACF,OAAQA,EAAU,CAChB,IAAK,OACH,MAAO,8LACT,IAAK,OACH,MAAO,4LACT,IAAK,YACH,MAAO,4LACT,QACE,MAAO,2LACX,KAEA,QAAQF,GAAe,IAAK,CAC1B,IAAK,GACH,MAAO,8LACT,IAAK,GACH,MAAO,4LACT,IAAK,GACH,MAAO,4LACT,QACE,MAAO,2LACX,CAEJ,KAEA,eAAYO,EAAK,CACf,cAAeX,EACf,cAAeC,EACf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,GAAYA,GAAU,MAAM,OAAS,KACpC,OAAC,EAAAsB,QAAA,CACC,UAAU,oBACV,GAAI,2BACJ,KAAM,CACJ,KAAMtB,GAAU,OAAS,CAAC,EAC1B,cAAe,CAAE,MAAOJ,EAAO,oBAAqBgB,EAAyB,MAAOf,CAAa,CACnG,EACA,MAAO7B,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACE,MACN,EAEDiC,MACC,OAAC,cACC,QAASA,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CAAC,EAEDT,EAAwB,YAAc,0BAEtC,IAAO9C,KAAQ,cAAW8C,CAAuB",
6
6
  "names": ["MultiLayoutGraphicBlock_exports", "__export", "MultiLayoutGraphicBlock_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_responsive", "import_Styles", "import_picture", "import_button", "import_heading", "import_VideoModal", "import_gird", "import_Title", "import_utils", "import_SwiperBox", "import_mimeType", "import_tabs", "import_useExposure", "import_trackUrlRef", "import_track", "componentType", "componentName", "ItemBlock", "item", "configuration", "jIndex", "spanType", "titleProp", "isMobile", "setIsMobile", "mediaQuery", "ref", "handleAspect", "theme", "title", "description", "imageUrl", "primaryButton", "secondaryButton", "imageMobileUrl", "blockLink", "video", "youtubeId", "isYouTube", "lgButtonSize", "Picture", "Button", "MultiLayoutGraphicBlock", "React", "props", "shape", "sectionTitle", "groupByTab", "items", "carousel", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "getSpan", "width", "tabNames", "index", "arr", "handleVideoPlayBtnClick", "url", "handleTabNumber", "num", "flag", "tabItemsMaps", "tabName", "acc", "cur", "Title", "SwiperBox"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var m=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var x=(p,l)=>{for(var o in l)m(p,o,{get:l[o],enumerable:!0})},n=(p,l,o,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let t of c(l))!g.call(p,t)&&t!==o&&m(p,t,{get:()=>l[t],enumerable:!(a=r(l,t))||a.enumerable});return p};var f=p=>n(m({},"__esModule",{value:!0}),p);var S={};x(S,{default:()=>I});module.exports=f(S);var e=require("react/jsx-runtime"),y=require("../../helpers/utils.js"),b=require("../SwiperBox/index.js"),d=require("../../shared/Styles.js"),s=require("../../components/index.js");const u=p=>{const{data:l,className:o}=p,{list:a}=l;return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)("div",{className:"",children:(0,e.jsx)("div",{className:"grid desktop:grid-cols-3 tablet:grid-cols-2 grid-cols-1 gap-4",children:a.map((t,i)=>(0,e.jsxs)("div",{className:" relative rounded-2xl lg-desktop:aspect-[543/320] laptop:aspect-[440/280] tablet:aspect-[346/240] aspect-[358/240] overflow-hidden",children:[(0,e.jsx)(s.Picture,{className:"w-full",imgClassName:"",source:`${t?.img?.url}, ${t?.padImg?.url} 1439, ${t?.miniImg?.url} 1023, ${t?.mobileImg?.url} 767`}),(0,e.jsxs)("div",{className:"absolute laptop:bottom-[24px] lg-desktop:bottom-[32px] bottom-[16px] left-0 laptop:px-[24px] lg-desktop:px-[32px] px-[16px]",children:[" ",(0,e.jsx)(s.Text,{html:t?.title,className:"text-[20px] lg-desktop:text-[24px] [&_*_strong]:!font-bold leading-[1.2] text-[#1d1d1f]"}),(0,e.jsx)(s.Text,{html:t?.desc,className:"text-[14px] line-clamp-1 lg-desktop:text-[16px] leading-[1.4] text-[#1d1d1f]"})]})]},i))})})})};var I=(0,d.withLayout)(u);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/SelectStore/index.tsx"],
4
+ "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\n\nexport type SelectStoreDataType = {\n title: string\n desc: string\n img: Img\n mobileImg: Img\n padImg: Img\n miniImg: Img\n // pay: {\n // img: Img\n // }[]\n // delivery: {\n // img: Img\n // }[]\n // service: {\n // title: string\n // img: Img\n // }[]\n}\n\ntype SelectStoreType = {\n data: {\n list: SelectStoreDataType[]\n }\n className?: string\n}\n\nconst SelectStore = (props: SelectStoreType) => {\n const { data, className } = props\n const { list } = data\n // const number = list?.[2]?.service?.length || 0\n return (\n <>\n <div className=''>\n <div className='grid desktop:grid-cols-3 tablet:grid-cols-2 grid-cols-1 gap-4'>\n {list.map((item, index) => (\n <div key={index} className=' relative rounded-2xl lg-desktop:aspect-[543/320] laptop:aspect-[440/280] tablet:aspect-[346/240] aspect-[358/240] overflow-hidden'>\n <Picture\n className=\"w-full\"\n imgClassName=\"\"\n source={`${item?.img?.url}, ${item?.padImg?.url} 1439, ${item?.miniImg?.url} 1023, ${item?.mobileImg?.url} 767`}\n />\n <div className='absolute laptop:bottom-[24px] lg-desktop:bottom-[32px] bottom-[16px] left-0 laptop:px-[24px] lg-desktop:px-[32px] px-[16px]'> <Text html={item?.title} className='text-[20px] lg-desktop:text-[24px] [&_*_strong]:!font-bold leading-[1.2] text-[#1d1d1f]'/>\n <Text html={item?.desc} className='text-[14px] line-clamp-1 lg-desktop:text-[16px] leading-[1.4] text-[#1d1d1f]'/>\n </div>\n </div>\n ))}\n </div>\n {/* <div className='grid desktop:grid-cols-3 tablet:grid-cols-2 grid-cols-1 gap-4'>\n {list.map((item, index) => (\n <div key={index} className='bg-[#EAEAEC] rounded-2xl min-h-[240px] laptop:min-h-[280px] lg-desktop:min-h-[320px]'>\n <div className='flex flex-col laptop:p-[24px] lg-desktop:p-[32px] p-[16px] justify-start h-full'>\n <div className=\"flex flex-col justify-center flex-1\">\n \n {item?.pay && (\n <div className='flex gap-[16px] flex-wrap items-center justify-center laptop:gap-[24px]'>\n {item?.pay?.map((pay, ind)=>{\n return (\n <div key={ind} className='laptop:w-[60px] w-[48px]'>\n <Picture\n className=\" w-full\"\n imgClassName=\"\"\n source={pay?.img?.url}\n alt={pay?.img?.alt || ''}\n />\n </div>\n )\n })}\n </div>\n )}\n \n {\n item?.delivery && (\n <div className='flex gap-[24px] items-center justify-center'>\n {item?.delivery?.map((delivery, ind)=>{\n return (\n <div key={ind} className=''>\n <Picture\n className={` ${ind === 0 ? 'laptop:w-[174px] w-[116px]' : 'laptop:w-[75px] w-[50px]'}`}\n imgClassName=\"\"\n source={delivery?.img?.url}\n alt={delivery?.img?.alt || ''}\n />\n </div>\n )\n })}\n </div>\n ) \n }\n \n {\n item?.service && (\n <div className=' desktop:gap-[24px] gap-[8px] tablet:gap-[12px] laptop:gap-[28px] grid l-tablet:grid-cols-2 tablet:flex flex-wrap desktop:grid-cols-4 items-center justify-center'>\n {item?.service?.map((service, ind)=>{\n // \u5224\u65AD\uFF1A\u53EA\u5BF9\u7B2C\u4E94\u6761\uFF08index === 4\uFF09\u5E94\u7528\u54CD\u5E94\u5F0F\u663E\u793A/\u9690\u85CF\n const isFifth = ind === 4;\n return (\n <div key={ind} className={`\n flex flex-col items-center desktop:h-full w-[157px] justify-start desktop:w-[81px]\n ${isFifth ? 'laptop:flex desktop:hidden hidden' : ''} \n `}>\n <div className='w-[70px] desktop:w-[54px]'>\n <Picture\n className=\"\"\n imgClassName=\"w-full h-auto\"\n source={service?.img?.url}\n alt={service?.img?.alt || ''}\n />\n </div>\n <div className='text-center'>\n <Text html={service?.title} className=' font-bold text-[12px] mt-[8px] leading-[1.4]' />\n </div>\n </div>\n )\n })}\n </div>\n )\n }\n </div>\n <div className='mt-auto'>\n <Text html={item?.title} className='text-[20px] lg-desktop:text-[24px] [&_*_strong]:!font-bold leading-[1.2] text-[#1d1d1f]'/>\n <Text html={item?.desc} className='text-[14px] line-clamp-1 lg-desktop:text-[16px] leading-[1.4] text-[#1d1d1f]'/>\n </div>\n \n </div>\n </div>\n ))}\n </div> */}\n </div>\n </>\n )\n}\n\nexport default withLayout(SelectStore)\n"],
5
+ "mappings": "sbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsCI,IAAAI,EAAA,6BArCJC,EAAmB,kCACnBC,EAAsB,iCAEtBC,EAA2B,kCAC3BC,EAA8B,qCA4B9B,MAAMC,EAAeC,GAA2B,CAC9C,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,KAAAG,CAAK,EAAIF,EAEjB,SACE,mBACE,mBAAC,OAAI,UAAU,GACb,mBAAC,OAAI,UAAU,gEACZ,SAAAE,EAAK,IAAI,CAACC,EAAMC,OACf,QAAC,OAAgB,UAAU,qIACnB,oBAAC,WACC,UAAU,SACV,aAAa,GACb,OAAQ,GAAGD,GAAM,KAAK,GAAG,KAAKA,GAAM,QAAQ,GAAG,UAAUA,GAAM,SAAS,GAAG,UAAUA,GAAM,WAAW,GAAG,OAC3G,KACJ,QAAC,OAAI,UAAU,8HAA8H,kCAAkB,OAAC,QAAK,KAAMA,GAAM,MAAO,UAAU,0FAAyF,KACzR,OAAC,QAAK,KAAMA,GAAM,KAAM,UAAU,+EAA8E,GAClH,IARMC,CASV,CACD,EACH,EAiFF,EACF,CAEJ,EAEA,IAAOb,KAAQ,cAAWO,CAAW",
6
+ "names": ["SelectStore_exports", "__export", "SelectStore_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_SwiperBox", "import_Styles", "import_components", "SelectStore", "props", "data", "className", "list", "item", "index"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var te=Object.create;var g=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var ae=(e,t)=>{for(var r in t)g(e,r,{get:t[r],enumerable:!0})},L=(e,t,r,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of se(t))!ie.call(e,i)&&i!==r&&g(e,i,{get:()=>t[i],enumerable:!(f=ne(t,i))||f.enumerable});return e};var v=(e,t,r)=>(r=e!=null?te(re(e)):{},L(t||!e||!e.__esModule?g(r,"default",{value:e,enumerable:!0}):r,e)),oe=e=>L(g({},"__esModule",{value:!0}),e);var ue={};ae(ue,{default:()=>pe});module.exports=oe(ue);var c=require("react/jsx-runtime"),n=v(require("react")),N=require("../../helpers/utils.js"),O=v(require("./tabSwitch.js")),A=v(require("../Title/index.js")),$=v(require("../SwiperBox/index.js")),q=require("../../shared/Styles.js"),D=require("../../shared/track.js"),z=require("react-responsive"),b=require("./shelfDisplayItem.js");const le="image",ce="product_shelf";function me(e){const t=(0,n.useRef)(null),[r,f]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(r)return;const i=t.current;if(!i||typeof IntersectionObserver>"u")return;const p=new IntersectionObserver(([a])=>{a.isIntersecting&&(f(!0),p.disconnect())},e);return p.observe(i),()=>p.disconnect()},[r,e]),[t,r]}const fe=n.default.forwardRef(({key:e,data:t,event:r,buildData:f,breakpoints:i,className:p="",recommendedData:a,target:Q="_self",isDisplayGudgments:R=!1,isDisplayBackImage:W=!1},j)=>{const{productsTab:d=[],productsCard:F=[],title:M,isShowTab:_=!0,tabShape:G="square",isShowTag:J=!1,isShowOriginalPrice:K=!0,isShowRecommendedCard:U=!1,...X}=t,[P,V]=(0,n.useState)(""),[m,y]=(0,n.useState)([]),x=(0,n.useRef)(!1),S=(0,n.useRef)(!1),E=(0,n.useRef)(null),Y=(0,z.useMediaQuery)({query:"(max-width: 768px)"}),[Z,H]=me({threshold:0}),h=m?.length<=1&&R,u=!Y&&m?.length<=2&&R,T=s=>{switch(s){case 1440:return u?m?.length:4;case 1024:return u?m?.length:3;default:return u?m?.length:2.3}},B=()=>{(0,D.gaTrack)({event:"ga4Event",event_name:"view_item_list",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:a?.map((s,k)=>{const o=s?.variants?.find(l=>l?.sku===s?.sku)||s?.variants?.[0];return{item_id:s?.sku||o?.sku,item_name:s?.name,item_variant:o?.name,price:o?.price,index:k+1}})}})},I=(s,k)=>{if(k){const w=a?.map?.(o=>({...o,isShowRecommended:!0}));y(w?.length?w||[]:[])}else if(Array.isArray(s)){const o=s?.map?.(l=>{const C=f?.products?.find(ee=>ee?.handle===l?.handle);if(C)return{sku:l.sku,isShowRecommended:!1,custom_name:l.custom_name,custom_description:l.custom_description,...C}})?.filter(l=>l);y(o?.length?o||[]:[])}else y([])};return(0,n.useImperativeHandle)(j,()=>E.current),(0,n.useEffect)(()=>{H&&a?.length&&!x.current&&(x.current=!0,B())},[H,a]),(0,n.useEffect)(()=>{if(!S.current){if(!S.current&&a?.length&&(S.current=!0),_){V(d?.[0]?.tab||""),I(d?.[0]?.data||[],d?.[0]?.isShowRecommendedTab);return}I(F,U)}},[a]),(0,c.jsxs)("div",{ref:E,className:(0,N.cn)("shelf-display-wrap w-full",p,{"aiui-dark":t?.theme==="dark"}),children:[M&&(0,c.jsx)(A.default,{data:{title:M}}),_&&(0,c.jsx)("div",{className:"md-tablet:w-full md-tablet:overflow-hidden",children:(0,c.jsx)(O.default,{value:P,tabs:d,tabShape:G,onTabClick:s=>{if(V(s?.tab),I(s?.data||[],s?.isShowRecommendedTab),!s?.isShowRecommendedTab){(0,D.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:le,component_name:ce,component_title:t?.title,component_position:1,navigation:s?.tab}});return}B()}})}),(0,c.jsx)("div",{ref:Z,className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:(0,c.jsx)($.default,{data:{list:m,configuration:{...X,event:r,isShowTag:J,isShowOriginalPrice:K,target:Q,itemLength:m?.length,isDisplayBackImage:W}},id:`ShelfDisplay${e}${P}`,className:`${_?"mt-6":""} !overflow-visible`,itemClassName:u?"flex-1":"",Slide:u?b.ShelfDisplayHorizontalItem:b.ShelfDisplayWrapItem,breakpoints:i||{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:h?1:1.2},768:{spaceBetween:h?0:16,freeMode:!1,slidesPerView:T()},1024:{spaceBetween:h?0:16,freeMode:!1,slidesPerView:T(1024)},1440:{spaceBetween:h?0:16,freeMode:!1,slidesPerView:T(1440)}}})})]})});var pe=(0,q.withLayout)(fe);
1
+ "use strict";"use client";var ae=Object.create;var w=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var re=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var le=(e,s)=>{for(var n in s)w(e,n,{get:s[n],enumerable:!0})},V=(e,s,n,f)=>{if(s&&typeof s=="object"||typeof s=="function")for(let l of ie(s))!oe.call(e,l)&&l!==n&&w(e,l,{get:()=>s[l],enumerable:!(f=ne(s,l))||f.enumerable});return e};var g=(e,s,n)=>(n=e!=null?ae(re(e)):{},V(s||!e||!e.__esModule?w(n,"default",{value:e,enumerable:!0}):n,e)),me=e=>V(w({},"__esModule",{value:!0}),e);var de={};le(de,{default:()=>ue});module.exports=me(de);var o=require("react/jsx-runtime"),a=g(require("react")),L=require("../../helpers/utils.js"),N=g(require("./tabSwitch.js")),A=g(require("../Title/index.js")),$=g(require("../SwiperBox/index.js")),q=require("../../shared/Styles.js"),D=require("../../shared/track.js"),O=require("react-responsive"),z=require("../../hooks/useRollout.js"),_=require("./shelfDisplayItem.js");const ce="image",pe="product_shelf",fe=a.default.forwardRef(({key:e,data:s,event:n,buildData:f,breakpoints:l,className:Q="",recommendedData:c,target:W="_self",metafields:j,isDisplayGudgments:R=!1,isDisplayBackImage:F=!1},G)=>{const{productsTab:u=[],productsCard:J=[],title:I,isShowTab:v=!0,tabShape:K="square",isShowTag:U=!1,isShowOriginalPrice:X=!0,isShowRecommendedCard:Y=!1,...Z}=s,[M,P]=(0,a.useState)(""),[m,b]=(0,a.useState)([]),x=(0,a.useRef)(!1),S=(0,a.useRef)(!1),H=(0,a.useRef)(null),ee=(0,O.useMediaQuery)({query:"(max-width: 768px)"}),[te,B]=(0,z.useRollout)({threshold:0}),d=m?.length<=1&&R,p=!ee&&m?.length<=2&&R,y=t=>{switch(t){case 1440:return p?m?.length:4;case 1024:return p?m?.length:3;default:return p?m?.length:2.3}},C=()=>{(0,D.gaTrack)({event:"ga4Event",event_name:"view_item_list",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:c?.map((t,k)=>{const r=t?.variants?.find(i=>i?.sku===t?.sku)||t?.variants?.[0];return{item_id:t?.sku||r?.sku,item_name:t?.name,item_variant:r?.name,price:r?.price,index:k+1}})}})},T=(t,k)=>{if(k){const h=c?.map?.(r=>({...r,isShowRecommended:!0}));b(h?.length?h||[]:[])}else if(Array.isArray(t)){const r=t?.map?.(i=>{const E=f?.products?.find(se=>se?.handle===i?.handle);if(E)return{sku:i.sku,isShowRecommended:!1,custom_name:i.custom_name,custom_description:i.custom_description,custom_image:i.custom_image,custom_theme:i.custom_theme,...E}})?.filter(i=>i);b(r?.length?r||[]:[])}else b([])};return(0,a.useImperativeHandle)(G,()=>H.current),(0,a.useEffect)(()=>{B&&c?.length&&!x.current&&(x.current=!0,C())},[B,c]),(0,a.useEffect)(()=>{if(!S.current){if(!S.current&&c?.length&&(S.current=!0),v){P(u?.[0]?.tab||""),T(u?.[0]?.data||[],u?.[0]?.isShowRecommendedTab);return}T(J,Y)}},[c]),(0,o.jsxs)("div",{ref:H,className:(0,L.cn)("shelf-display-wrap w-full",Q,{"aiui-dark":s?.theme==="dark"}),children:[I&&(0,o.jsx)(A.default,{data:{title:I}}),v&&(0,o.jsx)("div",{className:"md-tablet:w-full md-tablet:overflow-hidden",children:(0,o.jsx)(N.default,{value:M,tabs:u,tabShape:K,onTabClick:t=>{if(P(t?.tab),T(t?.data||[],t?.isShowRecommendedTab),!t?.isShowRecommendedTab){(0,D.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:ce,component_name:pe,component_title:s?.title,component_position:1,navigation:t?.tab}});return}C()}})}),(0,o.jsx)("div",{ref:te,className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:(0,o.jsx)($.default,{data:{list:m,configuration:{...Z,event:n,isShowTag:U,isShowOriginalPrice:X,target:W,metafields:j,itemLength:m?.length,isDisplayBackImage:F}},id:`ShelfDisplay${e}${M}`,className:`${v?"mt-6":""} !overflow-visible shelf-display-swiper-box`,itemClassName:p?"flex-1":"",Slide:p?_.ShelfDisplayHorizontalItem:_.ShelfDisplayWrapItem,breakpoints:l||{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:d?1:1.2},768:{spaceBetween:d?0:16,freeMode:!1,slidesPerView:y()},1024:{spaceBetween:d?0:16,freeMode:!1,slidesPerView:y(1024)},1440:{spaceBetween:d?0:16,freeMode:!1,slidesPerView:y(1440)}}})})]})});var ue=(0,q.withLayout)(fe);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport TabSwitch from './tabSwitch.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { ShelfDisplayWrapItem, ShelfDisplayHorizontalItem } from './shelfDisplayItem.js'\nimport type { ShelfDisplayProps, ShelfDisplayItem } from './shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nfunction useOnceInView<T extends Element>(options: any) {\n const ref = useRef<T>(null)\n const [inView, setInView] = useState(false)\n\n useEffect(() => {\n if (inView) return // \u5DF2\u8FDB\u5165\u8FC7\uFF0C\u5219\u4E0D\u518D\u89C2\u5BDF\n const el = ref.current\n if (!el || typeof IntersectionObserver === 'undefined') return\n\n const observer = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) {\n setInView(true)\n observer.disconnect() // \u505C\u6B62\u89C2\u5BDF\n }\n }, options)\n\n observer.observe(el)\n return () => observer.disconnect()\n }, [inView, options])\n\n return [ref, inView]\n}\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n (\n {\n key,\n data,\n event,\n buildData,\n breakpoints,\n className = '',\n recommendedData,\n target = '_self',\n isDisplayGudgments = false,\n isDisplayBackImage = false,\n },\n ref\n ) => {\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const isView = useRef<boolean>(false)\n const isRecommend = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const [viewRef, inView] = useOnceInView<HTMLDivElement>({ threshold: 0 })\n\n const isOnce = currentItems?.length <= 1 && isDisplayGudgments\n const isShowGudgments = !isMobile && currentItems?.length <= 2 && isDisplayGudgments\n\n const showItemLength = (size?: number) => {\n switch (size) {\n case 1440:\n return isShowGudgments ? currentItems?.length : 4\n case 1024:\n return isShowGudgments ? currentItems?.length : 3\n default:\n return isShowGudgments ? currentItems?.length : 2.3\n }\n }\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[], flag: boolean) => {\n if (flag) {\n const newCurrentData = recommendedData?.map?.(item => {\n return {\n ...item,\n isShowRecommended: true,\n }\n })\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n const isArray = Array.isArray(currentData)\n if (isArray) {\n const newCurrentData = currentData\n ?.map?.(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n isShowRecommended: false,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n setCurrentItems([])\n }\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n // \u7B97\u6CD5\u6570\u636E\u4F1A\u7A0D\u5FAE\u5EF6\u8FDF\uFF0C\u6240\u4EE5\u9700\u76D1\u542CrecommendedData\uFF0C\u4E3A\u4E86\u9632\u6B62\u5728\u6709\u7B97\u6CD5\u6570\u636E\u4E14\u5BF9\u9ED8\u8BA4\u6E32\u67D3\u7B2C\u4E00\u4E2A\u540E\u53CD\u590D\u89E6\u53D1\uFF0C\u7528isRecommend\u5173\u95ED\n useEffect(() => {\n if (isRecommend.current) return\n if (!isRecommend.current && recommendedData?.length) {\n isRecommend.current = true\n }\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [], productsTab?.[0]?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n }, [recommendedData])\n\n return (\n <div\n ref={innerRef}\n className={cn('shelf-display-wrap w-full', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <div className=\"md-tablet:w-full md-tablet:overflow-hidden\">\n <TabSwitch\n value={tabId}\n tabs={productsTab}\n tabShape={tabShape}\n onTabClick={v => {\n setTabId(v?.tab)\n handleCurrentTab(v?.data || [], v?.isShowRecommendedTab)\n if (!v?.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: v?.tab,\n },\n })\n return\n }\n gackViewEvent()\n }}\n />\n </div>\n )}\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n <SwiperBox\n data={{\n list: currentItems,\n configuration: {\n ...other,\n event: event,\n isShowTag,\n isShowOriginalPrice,\n target: target,\n itemLength: currentItems?.length,\n isDisplayBackImage: isDisplayBackImage,\n },\n }}\n id={`ShelfDisplay${key}${tabId}`}\n className={`${isShowTab ? 'mt-6' : ''} !overflow-visible`}\n itemClassName={isShowGudgments ? 'flex-1' : ''}\n Slide={isShowGudgments ? ShelfDisplayHorizontalItem : ShelfDisplayWrapItem}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: isOnce ? 1 : 1.2,\n },\n 768: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(),\n },\n 1024: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1024),\n },\n 1440: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1440),\n },\n }\n }\n />\n </div>\n </div>\n )\n }\n)\n\nexport default withLayout(ShelfDisplay)\n"],
5
- "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA0KM,IAAAI,EAAA,6BAzKNC,EAAwE,oBACxEC,EAAmB,kCACnBC,EAAsB,6BACtBC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAwB,iCACxBC,EAA8B,4BAC9BC,EAAiE,iCAGjE,MAAMC,GAAgB,QAChBC,GAAgB,gBAEtB,SAASC,GAAiCC,EAAc,CACtD,MAAMC,KAAM,UAAU,IAAI,EACpB,CAACC,EAAQC,CAAS,KAAI,YAAS,EAAK,EAE1C,sBAAU,IAAM,CACd,GAAID,EAAQ,OACZ,MAAME,EAAKH,EAAI,QACf,GAAI,CAACG,GAAM,OAAO,qBAAyB,IAAa,OAExD,MAAMC,EAAW,IAAI,qBAAqB,CAAC,CAACC,CAAK,IAAM,CACjDA,EAAM,iBACRH,EAAU,EAAI,EACdE,EAAS,WAAW,EAExB,EAAGL,CAAO,EAEV,OAAAK,EAAS,QAAQD,CAAE,EACZ,IAAMC,EAAS,WAAW,CACnC,EAAG,CAACH,EAAQF,CAAO,CAAC,EAEb,CAACC,EAAKC,CAAM,CACrB,CAEA,MAAMK,GAAe,EAAAC,QAAM,WACzB,CACE,CACE,IAAAC,EACA,KAAAC,EACA,MAAAC,EACA,UAAAC,EACA,YAAAC,EACA,UAAAC,EAAY,GACZ,gBAAAC,EACA,OAAAC,EAAS,QACT,mBAAAC,EAAqB,GACrB,mBAAAC,EAAqB,EACvB,EACAjB,IACG,CACH,KAAM,CACJ,YAAAkB,EAAc,CAAC,EACf,aAAAC,EAAe,CAAC,EAChB,MAAAC,EACA,UAAAC,EAAY,GACZ,SAA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FAhB,EAASgB,GAAG,GAAG,EACfC,EAAiBD,GAAG,MAAQ,CAAC,EAAGA,GAAG,oBAAoB,EACnD,CAACA,GAAG,qBAAsB,IAC5B,WAAQ,CACN,MAAO,WACP,WAAY,kBACZ,iBAAkB,CAChB,WAAY,YACZ,eAAgBhD,GAChB,eAAgBC,GAChB,gBAAiBY,GAAM,MACvB,mBAAoB,EACpB,WAAYmC,GAAG,GACjB,CACF,CAAC,EACD,MACF,CACAJ,EAAc,CAChB,EACF,EACF,KAEF,OAAC,OACC,IAAKL,EACL,UAAU,2FAEV,mBAAC,EAAAkB,QAAA,CACC,KAAM,CACJ,KAAMxB,EACN,cAAe,CACb,GAAGH,EACH,MAAOhB,EACP,UAAAa,EACA,oBAAAC,EACA,OAAQT,EACR,WAAYc,GAAc,OAC1B,mBAAoBZ,CACtB,CACF,EACA,GAAI,eAAeT,CAAG,GAAGmB,CAAK,GAC9B,UAAW,GAAGN,EAAY,OAAS,EAAE,qBACrC,cAAegB,EAAkB,SAAW,GAC5C,MAAOA,EAAkB,6BAA6B,uBACtD,YACEzB,GAAe,CACb,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAewB,EAAS,EAAI,GAC9B,EACA,IAAK,CACH,aAAcA,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,CAChC,EACA,KAAM,CACJ,aAAcF,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,IAAI,CACpC,EACA,KAAM,CACJ,aAAcF,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,IAAI,CACpC,CACF,EAEJ,EACF,GACF,CAEJ,CACF,EAEA,IAAOtD,MAAQ,cAAWsB,EAAY",
6
- "names": ["ShelfDisplay_exports", "__export", "ShelfDisplay_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_tabSwitch", "import_Title", "import_SwiperBox", "import_Styles", "import_track", "import_react_responsive", "import_shelfDisplayItem", "componentType", "componentName", "useOnceInView", "options", "ref", "inView", "setInView", "el", "observer", "entry", "ShelfDisplay", "React", "key", "data", "event", "buildData", "breakpoints", "className", "recommendedData", "target", "isDisplayGudgments", "isDisplayBackImage", "productsTab", "productsCard", "title", "isShowTab", "tabShape", "isShowTag", "isShowOriginalPrice", "isShowRecommendedCard", "other", "tabId", "setTabId", "currentItems", "setCurrentItems", "isView", "isRecommend", "innerRef", "isMobile", "viewRef", "isOnce", "isShowGudgments", "showItemLength", "size", "gackViewEvent", "item", "index", "variant", "v", "handleCurrentTab", "currentData", "flag", "newCurrentData", "findData", "params", "Title", "TabSwitch", "SwiperBox"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport TabSwitch from './tabSwitch.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useRollout } from '../../hooks/useRollout.js'\nimport { ShelfDisplayWrapItem, ShelfDisplayHorizontalItem } from './shelfDisplayItem.js'\nimport type { ShelfDisplayProps, ShelfDisplayItem } from './shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n (\n {\n key,\n data,\n event,\n buildData,\n breakpoints,\n className = '',\n recommendedData,\n target = '_self',\n metafields,\n isDisplayGudgments = false,\n isDisplayBackImage = false,\n },\n ref\n ) => {\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const isView = useRef<boolean>(false)\n const isRecommend = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const [viewRef, inView] = useRollout<HTMLDivElement>({ threshold: 0 })\n\n const isOnce = currentItems?.length <= 1 && isDisplayGudgments\n const isShowGudgments = !isMobile && currentItems?.length <= 2 && isDisplayGudgments\n\n const showItemLength = (size?: number) => {\n switch (size) {\n case 1440:\n return isShowGudgments ? currentItems?.length : 4\n case 1024:\n return isShowGudgments ? currentItems?.length : 3\n default:\n return isShowGudgments ? currentItems?.length : 2.3\n }\n }\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[], flag: boolean) => {\n if (flag) {\n const newCurrentData = recommendedData?.map?.(item => {\n return {\n ...item,\n isShowRecommended: true,\n }\n })\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n const isArray = Array.isArray(currentData)\n if (isArray) {\n const newCurrentData = currentData\n ?.map?.(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n isShowRecommended: false,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n custom_image: item.custom_image,\n custom_theme: item.custom_theme,\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n setCurrentItems([])\n }\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n // \u7B97\u6CD5\u6570\u636E\u4F1A\u7A0D\u5FAE\u5EF6\u8FDF\uFF0C\u6240\u4EE5\u9700\u76D1\u542CrecommendedData\uFF0C\u4E3A\u4E86\u9632\u6B62\u5728\u6709\u7B97\u6CD5\u6570\u636E\u4E14\u5BF9\u9ED8\u8BA4\u6E32\u67D3\u7B2C\u4E00\u4E2A\u540E\u53CD\u590D\u89E6\u53D1\uFF0C\u7528isRecommend\u5173\u95ED\n useEffect(() => {\n if (isRecommend.current) return\n if (!isRecommend.current && recommendedData?.length) {\n isRecommend.current = true\n }\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [], productsTab?.[0]?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n }, [recommendedData])\n\n return (\n <div\n ref={innerRef}\n className={cn('shelf-display-wrap w-full', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <div className=\"md-tablet:w-full md-tablet:overflow-hidden\">\n <TabSwitch\n value={tabId}\n tabs={productsTab}\n tabShape={tabShape}\n onTabClick={v => {\n setTabId(v?.tab)\n handleCurrentTab(v?.data || [], v?.isShowRecommendedTab)\n if (!v?.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: v?.tab,\n },\n })\n return\n }\n gackViewEvent()\n }}\n />\n </div>\n )}\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n <SwiperBox\n data={{\n list: currentItems,\n configuration: {\n ...other,\n event: event,\n isShowTag,\n isShowOriginalPrice,\n target: target,\n metafields: metafields,\n itemLength: currentItems?.length,\n isDisplayBackImage: isDisplayBackImage,\n },\n }}\n id={`ShelfDisplay${key}${tabId}`}\n className={`${isShowTab ? 'mt-6' : ''} !overflow-visible shelf-display-swiper-box`}\n itemClassName={isShowGudgments ? 'flex-1' : ''}\n Slide={isShowGudgments ? ShelfDisplayHorizontalItem : ShelfDisplayWrapItem}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: isOnce ? 1 : 1.2,\n },\n 768: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(),\n },\n 1024: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1024),\n },\n 1440: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1440),\n },\n }\n }\n />\n </div>\n </div>\n )\n }\n)\n\nexport default withLayout(ShelfDisplay)\n"],
5
+ "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAsJM,IAAAI,EAAA,6BArJNC,EAAwE,oBACxEC,EAAmB,kCACnBC,EAAsB,6BACtBC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAwB,iCACxBC,EAA8B,4BAC9BC,EAA2B,qCAC3BC,EAAiE,iCAGjE,MAAMC,GAAgB,QAChBC,GAAgB,gBAEhBC,GAAe,EAAAC,QAAM,WACzB,CACE,CACE,IAAAC,EACA,KAAAC,EACA,MAAAC,EACA,UAAAC,EACA,YAAAC,EACA,UAAAC,EAAY,GACZ,gBAAAC,EACA,OAAAC,EAAS,QACT,WAAAC,EACA,mBAAAC,EAAqB,GACrB,mBAAAC,EAAqB,EACvB,EACAC,IACG,CACH,KAAM,CACJ,YAAAC,EAAc,CAAC,EACf,aAAAC,EAAe,CAAC,EAChB,MAAAC,EACA,UAAAC,EAAY,GACZ,SAAAC,EAAW,SACX,UAAAC,EAAY,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CAGf,GAFAjB,EAASiB,GAAG,GAAG,EACfC,EAAiBD,GAAG,MAAQ,CAAC,EAAGA,GAAG,oBAAoB,EACnD,CAACA,GAAG,qBAAsB,IAC5B,WAAQ,CACN,MAAO,WACP,WAAY,kBACZ,iBAAkB,CAChB,WAAY,YACZ,eAAgB3C,GAChB,eAAgBC,GAChB,gBAAiBI,GAAM,MACvB,mBAAoB,EACpB,WAAYsC,GAAG,GACjB,CACF,CAAC,EACD,MACF,CACAJ,EAAc,CAChB,EACF,EACF,KAEF,OAAC,OACC,IAAKN,GACL,UAAU,2FAEV,mBAAC,EAAAmB,QAAA,CACC,KAAM,CACJ,KAAMzB,EACN,cAAe,CACb,GAAGH,EACH,MAAOlB,EACP,UAAAe,EACA,oBAAAC,EACA,OAAQX,EACR,WAAYC,EACZ,WAAYe,GAAc,OAC1B,mBAAoBb,CACtB,CACF,EACA,GAAI,eAAeV,CAAG,GAAGqB,CAAK,GAC9B,UAAW,GAAGN,EAAY,OAAS,EAAE,8CACrC,cAAeiB,EAAkB,SAAW,GAC5C,MAAOA,EAAkB,6BAA6B,uBACtD,YACE5B,GAAe,CACb,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe2B,EAAS,EAAI,GAC9B,EACA,IAAK,CACH,aAAcA,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,CAChC,EACA,KAAM,CACJ,aAAcF,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,IAAI,CACpC,EACA,KAAM,CACJ,aAAcF,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,IAAI,CACpC,CACF,EAEJ,EACF,GACF,CAEJ,CACF,EAEA,IAAOlD,MAAQ,cAAWe,EAAY",
6
+ "names": ["ShelfDisplay_exports", "__export", "ShelfDisplay_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_tabSwitch", "import_Title", "import_SwiperBox", "import_Styles", "import_track", "import_react_responsive", "import_useRollout", "import_shelfDisplayItem", "componentType", "componentName", "ShelfDisplay", "React", "key", "data", "event", "buildData", "breakpoints", "className", "recommendedData", "target", "metafields", "isDisplayGudgments", "isDisplayBackImage", "ref", "productsTab", "productsCard", "title", "isShowTab", "tabShape", "isShowTag", "isShowOriginalPrice", "isShowRecommendedCard", "other", "tabId", "setTabId", "currentItems", "setCurrentItems", "isView", "isRecommend", "innerRef", "isMobile", "viewRef", "inView", "isOnce", "isShowGudgments", "showItemLength", "size", "gackViewEvent", "item", "index", "variant", "v", "handleCurrentTab", "currentData", "flag", "newCurrentData", "findData", "params", "Title", "TabSwitch", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var h=(n,e)=>{for(var t in e)c(n,t,{get:e[t],enumerable:!0})},S=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of f(e))!D.call(n,i)&&i!==t&&c(n,i,{get:()=>e[i],enumerable:!(r=b(e,i))||r.enumerable});return n};var v=n=>S(c({},"__esModule",{value:!0}),n);var P={};h(P,{PRICE_SYMBOL:()=>s,formatPrice:()=>l,formatVariantPrice:()=>E,languageTerritory:()=>d});module.exports=v(P);const s={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED"},d=n=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",eu:"en",fr:"de-DE","eu-es":"de-DE","eu-fr":"de-DE","eu-it":"de-DE","eu-de":"de-DE","eu-en":"en-US","cz-en":"de-DE",nl:"de-DE",de:"de-DE",vn:"vi-vn",sg:"en-sg","ae-en":"ae-en",plus:"en-us",cl:"es-cl",dk:"en-dk",fi:"en-fi",no:"en-no",is:"en-is",se:"en-se"})[n]||"";function l({amount:n,currencyCode:e,locale:t,maximumFractionDigits:r,minimumFractionDigits:i,removeTrailingZeros:o=!1}){let a=new Intl.NumberFormat(d(t),{style:"currency",currency:e||"USD",minimumFractionDigits:r===0?0:i,maximumFractionDigits:r}).format(n);return["eu-de","eu-en","de","eu"].includes(t)&&(a=a?.toString()?.replace(/[\s]/g,"")),o&&(a=a.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),a}function E({amount:n,baseAmount:e,currencyCode:t,locale:r,maximumFractionDigits:i,minimumFractionDigits:o,removeTrailingZeros:u}){if(typeof Intl>"u")return{price:`${s[r]}${n}`,basePrice:`${s[r]}${e}`,discount:`${s[r]}${e-n||0}`};const a=e>n,p=new Intl.NumberFormat(d(r),{style:"percent"}),m=a?p.format((e-n)/e):null,g=l({amount:n,currencyCode:t,locale:r,removeTrailingZeros:u}),y=a?l({amount:e,currencyCode:t,locale:r,maximumFractionDigits:i,minimumFractionDigits:o,removeTrailingZeros:u}):void 0;return{price:g,basePrice:y,discount:m}}
1
+ "use strict";var S=Object.create;var u=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var $=(e,n)=>{for(var r in n)u(e,r,{get:n[r],enumerable:!0})},f=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of P(n))!T.call(e,i)&&i!==r&&u(e,i,{get:()=>n[i],enumerable:!(t=v(n,i))||t.enumerable});return e};var k=(e,n,r)=>(r=e!=null?S(E(e)):{},f(n||!e||!e.__esModule?u(r,"default",{value:e,enumerable:!0}):r,e)),w=e=>f(u({},"__esModule",{value:!0}),e);var C={};$(C,{PRICE_SYMBOL:()=>c,formatPrice:()=>m,formatVariantPrice:()=>x,languageTerritory:()=>g});module.exports=w(C);var b=k(require("decimal.js"));const c={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",fr:"\u20AC",de:"\u20AC",nl:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED"},g=e=>({us:"en-US",uk:"en-GB",ca:"en-CA",eu:"en",fr:"fr-FR",au:"en-AU",my:"en-my","eu-es":"de-DE","eu-fr":"de-DE","eu-it":"de-DE","eu-de":"de-DE","eu-en":"en-US","cz-en":"de-DE","ca-fr":"fr-FR",nl:"de-DE",de:"de-DE",vn:"vi-vn",sg:"en-sg","ae-en":"ae-en",plus:"en-us",cl:"es-cl",dk:"en-dk",fi:"en-fi",no:"en-no",is:"en-is",se:"en-se","eu-pl":"pl-PL"})[e]||"";function m({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:i,removeTrailingZeros:l=!1}){const o=r==="nl"?"EUR":n||"USD",s=g(r);if(!s)return null;let a=new Intl.NumberFormat(s,{style:"currency",currency:o,minimumFractionDigits:t===0?0:i,maximumFractionDigits:t})?.format?.(e);return["eu-de","eu-en","de","eu"].includes(r)&&(a=a?.toString()?.replace?.(/[\s]/g,"")),l&&(a=a?.replace?.(/(\.\d*?[1-9])0+\b/,"$1")?.replace?.(/\.0+\b/,"")?.replace?.(/(\,\d*?[1-9])0+\b/,"$1")?.replace?.(/\,0+\b/,"")),a}function x({amount:e,baseAmount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:l,removeTrailingZeros:o}){if(typeof Intl>"u")return{price:`${c[t]}${e}`,basePrice:`${c[t]}${n}`,discount:`${c[t]}${n-e||0}`};const s=n>e;let d=null;const a=g(t);if(a){const p=new Intl.NumberFormat(a,{style:"percent"});d=s?p.format((n-e)/n):null}let y;if(s){const p=new b.default(n).sub(e||0).toNumber();y=m({amount:p,currencyCode:r||"USD",locale:t,maximumFractionDigits:2})}const D=m({amount:e,currencyCode:r,locale:t,removeTrailingZeros:o}),h=s?m({amount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:l,removeTrailingZeros:o}):void 0;return{price:D,basePrice:h,discount:d,discountAmount:y}}
2
2
  //# sourceMappingURL=shelfDisplay.js.map