@anker-in/headless-ui 1.0.19-temp-101406 → 1.0.19-temp-101408

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 (357) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  2. package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js +1 -1
  3. package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js.map +3 -3
  4. package/dist/cjs/biz-components/CollectionsFilters/component/filtersFun.js.map +1 -1
  5. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  6. package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
  7. package/dist/cjs/biz-components/FooterNavigation/types.d.ts +1 -2
  8. package/dist/cjs/biz-components/FooterNavigation/types.js +1 -1
  9. package/dist/cjs/biz-components/FooterNavigation/types.js.map +2 -2
  10. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +5 -6
  11. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
  12. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
  13. package/dist/cjs/biz-components/HeaderNavigation/icons/index.d.ts +1 -2
  14. package/dist/cjs/biz-components/HeaderNavigation/icons/index.js +1 -1
  15. package/dist/cjs/biz-components/HeaderNavigation/icons/index.js.map +3 -3
  16. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  17. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  18. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +2 -16
  19. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  20. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
  21. package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
  22. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
  23. package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  24. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  25. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  26. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  27. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  28. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  29. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  30. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
  31. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  32. package/dist/cjs/biz-components/Subscribe/index.d.ts +1 -7
  33. package/dist/cjs/biz-components/Subscribe/index.js +1 -1
  34. package/dist/cjs/biz-components/Subscribe/index.js.map +3 -3
  35. package/dist/cjs/biz-components/Title/index.js +1 -1
  36. package/dist/cjs/biz-components/Title/index.js.map +2 -2
  37. package/dist/cjs/biz-components/Title/types.d.ts +1 -3
  38. package/dist/cjs/biz-components/Title/types.js +1 -1
  39. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  40. package/dist/cjs/biz-components/index.d.ts +0 -25
  41. package/dist/cjs/biz-components/index.js +1 -1
  42. package/dist/cjs/biz-components/index.js.map +3 -3
  43. package/dist/cjs/components/button.js +1 -1
  44. package/dist/cjs/components/button.js.map +2 -2
  45. package/dist/cjs/components/container.js +1 -1
  46. package/dist/cjs/components/container.js.map +2 -2
  47. package/dist/cjs/components/dialog.d.ts +1 -3
  48. package/dist/cjs/components/dialog.js +1 -1
  49. package/dist/cjs/components/dialog.js.map +3 -3
  50. package/dist/cjs/components/index.d.ts +0 -1
  51. package/dist/cjs/components/index.js +1 -1
  52. package/dist/cjs/components/index.js.map +3 -3
  53. package/dist/cjs/helpers/utils.d.ts +0 -1
  54. package/dist/cjs/helpers/utils.js +1 -1
  55. package/dist/cjs/helpers/utils.js.map +3 -3
  56. package/dist/cjs/stories/shelfDisplay.stories.js +1 -644
  57. package/dist/cjs/stories/shelfDisplay.stories.js.map +2 -2
  58. package/dist/cjs/stories/tabs.stories.js +1 -1
  59. package/dist/cjs/stories/tabs.stories.js.map +3 -3
  60. package/dist/cjs/tsconfig.tsbuildinfo +1 -1
  61. package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
  62. package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js +1 -1
  63. package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js.map +3 -3
  64. package/dist/esm/biz-components/CollectionsFilters/component/filtersFun.js.map +1 -1
  65. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  66. package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
  67. package/dist/esm/biz-components/FooterNavigation/types.d.ts +1 -2
  68. package/dist/esm/biz-components/FooterNavigation/types.js +1 -1
  69. package/dist/esm/biz-components/FooterNavigation/types.js.map +2 -2
  70. package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +5 -6
  71. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
  72. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +3 -3
  73. package/dist/esm/biz-components/HeaderNavigation/icons/index.d.ts +1 -2
  74. package/dist/esm/biz-components/HeaderNavigation/icons/index.js +1 -1
  75. package/dist/esm/biz-components/HeaderNavigation/icons/index.js.map +3 -3
  76. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  77. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  78. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +2 -16
  79. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  80. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  81. package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
  82. package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
  83. package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
  84. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  85. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  86. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  87. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  88. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  89. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  90. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +9 -9
  91. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  92. package/dist/esm/biz-components/Subscribe/index.d.ts +1 -7
  93. package/dist/esm/biz-components/Subscribe/index.js +1 -1
  94. package/dist/esm/biz-components/Subscribe/index.js.map +3 -3
  95. package/dist/esm/biz-components/Title/index.js +1 -1
  96. package/dist/esm/biz-components/Title/index.js.map +2 -2
  97. package/dist/esm/biz-components/Title/types.d.ts +1 -3
  98. package/dist/esm/biz-components/index.d.ts +0 -25
  99. package/dist/esm/biz-components/index.js +1 -1
  100. package/dist/esm/biz-components/index.js.map +3 -3
  101. package/dist/esm/components/button.js +1 -1
  102. package/dist/esm/components/button.js.map +2 -2
  103. package/dist/esm/components/container.js +1 -1
  104. package/dist/esm/components/container.js.map +2 -2
  105. package/dist/esm/components/dialog.d.ts +1 -3
  106. package/dist/esm/components/dialog.js +1 -1
  107. package/dist/esm/components/dialog.js.map +3 -3
  108. package/dist/esm/components/index.d.ts +0 -1
  109. package/dist/esm/components/index.js +1 -1
  110. package/dist/esm/components/index.js.map +2 -2
  111. package/dist/esm/helpers/utils.d.ts +0 -1
  112. package/dist/esm/helpers/utils.js +1 -1
  113. package/dist/esm/helpers/utils.js.map +3 -3
  114. package/dist/esm/stories/shelfDisplay.stories.js +1 -644
  115. package/dist/esm/stories/shelfDisplay.stories.js.map +2 -2
  116. package/dist/esm/stories/tabs.stories.js +1 -1
  117. package/dist/esm/stories/tabs.stories.js.map +3 -3
  118. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  119. package/dist/tokens/base.css +1 -1
  120. package/package.json +1 -1
  121. package/style.css +0 -4
  122. package/dist/cjs/biz-components/AplusDesc/index.js +0 -2
  123. package/dist/cjs/biz-components/AplusDesc/index.js.map +0 -7
  124. package/dist/cjs/biz-components/DownLoad/index.js +0 -2
  125. package/dist/cjs/biz-components/DownLoad/index.js.map +0 -7
  126. package/dist/cjs/biz-components/Features/index.js +0 -2
  127. package/dist/cjs/biz-components/Features/index.js.map +0 -7
  128. package/dist/cjs/biz-components/FootCharger/index.js +0 -2
  129. package/dist/cjs/biz-components/FootCharger/index.js.map +0 -7
  130. package/dist/cjs/biz-components/GiftBox/index.js +0 -2
  131. package/dist/cjs/biz-components/GiftBox/index.js.map +0 -7
  132. package/dist/cjs/biz-components/GraphicMore/index.js +0 -2
  133. package/dist/cjs/biz-components/GraphicMore/index.js.map +0 -7
  134. package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js +0 -2
  135. package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js.map +0 -7
  136. package/dist/cjs/biz-components/Listing/ProductProvider.js +0 -2
  137. package/dist/cjs/biz-components/Listing/ProductProvider.js.map +0 -7
  138. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +0 -2
  139. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +0 -7
  140. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +0 -2
  141. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +0 -7
  142. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +0 -2
  143. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +0 -7
  144. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +0 -2
  145. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +0 -7
  146. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +0 -2
  147. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +0 -7
  148. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +0 -2
  149. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +0 -7
  150. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +0 -2
  151. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +0 -7
  152. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +0 -2
  153. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +0 -7
  154. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +0 -2
  155. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +0 -7
  156. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +0 -2
  157. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +0 -7
  158. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +0 -2
  159. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +0 -7
  160. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +0 -2
  161. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +0 -7
  162. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +0 -2
  163. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +0 -7
  164. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +0 -2
  165. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +0 -7
  166. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +0 -2
  167. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +0 -7
  168. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js +0 -2
  169. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +0 -7
  170. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +0 -2
  171. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +0 -7
  172. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +0 -2
  173. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +0 -7
  174. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +0 -2
  175. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +0 -7
  176. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +0 -2
  177. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +0 -7
  178. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +0 -2
  179. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +0 -7
  180. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +0 -2
  181. package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +0 -7
  182. package/dist/cjs/biz-components/Listing/components/index.js +0 -2
  183. package/dist/cjs/biz-components/Listing/components/index.js.map +0 -7
  184. package/dist/cjs/biz-components/Listing/const.js +0 -2
  185. package/dist/cjs/biz-components/Listing/const.js.map +0 -7
  186. package/dist/cjs/biz-components/Listing/hooks/use-options.js +0 -2
  187. package/dist/cjs/biz-components/Listing/hooks/use-options.js.map +0 -7
  188. package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +0 -2
  189. package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +0 -7
  190. package/dist/cjs/biz-components/Listing/hooks/use-variant.js +0 -2
  191. package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +0 -7
  192. package/dist/cjs/biz-components/Listing/hooks/useCopy.js +0 -2
  193. package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +0 -7
  194. package/dist/cjs/biz-components/Listing/index.js +0 -2
  195. package/dist/cjs/biz-components/Listing/index.js.map +0 -7
  196. package/dist/cjs/biz-components/Listing/types/graphql.js +0 -2
  197. package/dist/cjs/biz-components/Listing/types/graphql.js.map +0 -7
  198. package/dist/cjs/biz-components/Listing/types/product.js +0 -2
  199. package/dist/cjs/biz-components/Listing/types/product.js.map +0 -7
  200. package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +0 -2
  201. package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +0 -7
  202. package/dist/cjs/biz-components/Listing/types/type-helper.js +0 -2
  203. package/dist/cjs/biz-components/Listing/types/type-helper.js.map +0 -7
  204. package/dist/cjs/biz-components/Listing/types.js +0 -2
  205. package/dist/cjs/biz-components/Listing/types.js.map +0 -7
  206. package/dist/cjs/biz-components/Listing/utils/helper.js +0 -2
  207. package/dist/cjs/biz-components/Listing/utils/helper.js.map +0 -7
  208. package/dist/cjs/biz-components/Listing/utils/index.js +0 -2
  209. package/dist/cjs/biz-components/Listing/utils/index.js.map +0 -7
  210. package/dist/cjs/biz-components/NavigationSearch/index.js +0 -2
  211. package/dist/cjs/biz-components/NavigationSearch/index.js.map +0 -7
  212. package/dist/cjs/biz-components/NavigationSearch/types.js +0 -2
  213. package/dist/cjs/biz-components/NavigationSearch/types.js.map +0 -7
  214. package/dist/cjs/biz-components/SearchPage/index.js +0 -2
  215. package/dist/cjs/biz-components/SearchPage/index.js.map +0 -7
  216. package/dist/cjs/biz-components/SearchPage/types.js +0 -2
  217. package/dist/cjs/biz-components/SearchPage/types.js.map +0 -7
  218. package/dist/cjs/biz-components/SelectStore/index.js +0 -2
  219. package/dist/cjs/biz-components/SelectStore/index.js.map +0 -7
  220. package/dist/cjs/biz-components/Specs/dropdown.js +0 -3
  221. package/dist/cjs/biz-components/Specs/dropdown.js.map +0 -7
  222. package/dist/cjs/biz-components/Specs/index.js +0 -2
  223. package/dist/cjs/biz-components/Specs/index.js.map +0 -7
  224. package/dist/cjs/components/loadingDots.js +0 -42
  225. package/dist/cjs/components/loadingDots.js.map +0 -7
  226. package/dist/cjs/stories/aplusdesc.stories.js +0 -2
  227. package/dist/cjs/stories/aplusdesc.stories.js.map +0 -7
  228. package/dist/cjs/stories/download.stories.js +0 -2
  229. package/dist/cjs/stories/download.stories.js.map +0 -7
  230. package/dist/cjs/stories/features.stories.js +0 -2
  231. package/dist/cjs/stories/features.stories.js.map +0 -7
  232. package/dist/cjs/stories/footcharger.stories.js +0 -2
  233. package/dist/cjs/stories/footcharger.stories.js.map +0 -7
  234. package/dist/cjs/stories/giftbox.stories.js +0 -2
  235. package/dist/cjs/stories/giftbox.stories.js.map +0 -7
  236. package/dist/cjs/stories/graphicMore.stories.js +0 -2
  237. package/dist/cjs/stories/graphicMore.stories.js.map +0 -7
  238. package/dist/cjs/stories/selectstore.stories.js +0 -2
  239. package/dist/cjs/stories/selectstore.stories.js.map +0 -7
  240. package/dist/esm/biz-components/AplusDesc/index.js +0 -2
  241. package/dist/esm/biz-components/AplusDesc/index.js.map +0 -7
  242. package/dist/esm/biz-components/DownLoad/index.js +0 -2
  243. package/dist/esm/biz-components/DownLoad/index.js.map +0 -7
  244. package/dist/esm/biz-components/Features/index.js +0 -2
  245. package/dist/esm/biz-components/Features/index.js.map +0 -7
  246. package/dist/esm/biz-components/FootCharger/index.js +0 -2
  247. package/dist/esm/biz-components/FootCharger/index.js.map +0 -7
  248. package/dist/esm/biz-components/GiftBox/index.js +0 -2
  249. package/dist/esm/biz-components/GiftBox/index.js.map +0 -7
  250. package/dist/esm/biz-components/GraphicMore/index.js +0 -2
  251. package/dist/esm/biz-components/GraphicMore/index.js.map +0 -7
  252. package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js +0 -2
  253. package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js.map +0 -7
  254. package/dist/esm/biz-components/Listing/ProductProvider.js +0 -2
  255. package/dist/esm/biz-components/Listing/ProductProvider.js.map +0 -7
  256. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +0 -2
  257. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +0 -7
  258. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +0 -2
  259. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +0 -7
  260. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +0 -2
  261. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +0 -7
  262. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +0 -2
  263. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +0 -7
  264. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +0 -2
  265. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +0 -7
  266. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +0 -2
  267. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +0 -7
  268. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +0 -2
  269. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +0 -7
  270. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +0 -2
  271. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +0 -7
  272. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +0 -2
  273. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +0 -7
  274. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +0 -2
  275. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +0 -7
  276. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +0 -2
  277. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +0 -7
  278. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +0 -2
  279. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +0 -7
  280. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +0 -2
  281. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +0 -7
  282. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +0 -2
  283. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +0 -7
  284. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +0 -2
  285. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +0 -7
  286. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js +0 -1
  287. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/types.js.map +0 -7
  288. package/dist/esm/biz-components/Listing/components/ProductCard/index.js +0 -2
  289. package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +0 -7
  290. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +0 -2
  291. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +0 -7
  292. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +0 -2
  293. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +0 -7
  294. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +0 -1
  295. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +0 -7
  296. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +0 -2
  297. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +0 -7
  298. package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +0 -1
  299. package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +0 -7
  300. package/dist/esm/biz-components/Listing/components/index.js +0 -2
  301. package/dist/esm/biz-components/Listing/components/index.js.map +0 -7
  302. package/dist/esm/biz-components/Listing/const.js +0 -2
  303. package/dist/esm/biz-components/Listing/const.js.map +0 -7
  304. package/dist/esm/biz-components/Listing/hooks/use-options.js +0 -2
  305. package/dist/esm/biz-components/Listing/hooks/use-options.js.map +0 -7
  306. package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +0 -2
  307. package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +0 -7
  308. package/dist/esm/biz-components/Listing/hooks/use-variant.js +0 -2
  309. package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +0 -7
  310. package/dist/esm/biz-components/Listing/hooks/useCopy.js +0 -2
  311. package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +0 -7
  312. package/dist/esm/biz-components/Listing/index.js +0 -2
  313. package/dist/esm/biz-components/Listing/index.js.map +0 -7
  314. package/dist/esm/biz-components/Listing/types/graphql.js +0 -2
  315. package/dist/esm/biz-components/Listing/types/graphql.js.map +0 -7
  316. package/dist/esm/biz-components/Listing/types/product.js +0 -2
  317. package/dist/esm/biz-components/Listing/types/product.js.map +0 -7
  318. package/dist/esm/biz-components/Listing/types/productMetafields.d.js +0 -2
  319. package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +0 -7
  320. package/dist/esm/biz-components/Listing/types/type-helper.js +0 -1
  321. package/dist/esm/biz-components/Listing/types/type-helper.js.map +0 -7
  322. package/dist/esm/biz-components/Listing/types.js +0 -1
  323. package/dist/esm/biz-components/Listing/types.js.map +0 -7
  324. package/dist/esm/biz-components/Listing/utils/helper.js +0 -2
  325. package/dist/esm/biz-components/Listing/utils/helper.js.map +0 -7
  326. package/dist/esm/biz-components/Listing/utils/index.js +0 -2
  327. package/dist/esm/biz-components/Listing/utils/index.js.map +0 -7
  328. package/dist/esm/biz-components/NavigationSearch/index.js +0 -2
  329. package/dist/esm/biz-components/NavigationSearch/index.js.map +0 -7
  330. package/dist/esm/biz-components/NavigationSearch/types.js +0 -2
  331. package/dist/esm/biz-components/NavigationSearch/types.js.map +0 -7
  332. package/dist/esm/biz-components/SearchPage/index.js +0 -2
  333. package/dist/esm/biz-components/SearchPage/index.js.map +0 -7
  334. package/dist/esm/biz-components/SearchPage/types.js +0 -2
  335. package/dist/esm/biz-components/SearchPage/types.js.map +0 -7
  336. package/dist/esm/biz-components/SelectStore/index.js +0 -2
  337. package/dist/esm/biz-components/SelectStore/index.js.map +0 -7
  338. package/dist/esm/biz-components/Specs/dropdown.js +0 -3
  339. package/dist/esm/biz-components/Specs/dropdown.js.map +0 -7
  340. package/dist/esm/biz-components/Specs/index.js +0 -2
  341. package/dist/esm/biz-components/Specs/index.js.map +0 -7
  342. package/dist/esm/components/loadingDots.js +0 -42
  343. package/dist/esm/components/loadingDots.js.map +0 -7
  344. package/dist/esm/stories/aplusdesc.stories.js +0 -2
  345. package/dist/esm/stories/aplusdesc.stories.js.map +0 -7
  346. package/dist/esm/stories/download.stories.js +0 -2
  347. package/dist/esm/stories/download.stories.js.map +0 -7
  348. package/dist/esm/stories/features.stories.js +0 -2
  349. package/dist/esm/stories/features.stories.js.map +0 -7
  350. package/dist/esm/stories/footcharger.stories.js +0 -2
  351. package/dist/esm/stories/footcharger.stories.js.map +0 -7
  352. package/dist/esm/stories/giftbox.stories.js +0 -2
  353. package/dist/esm/stories/giftbox.stories.js.map +0 -7
  354. package/dist/esm/stories/graphicMore.stories.js +0 -2
  355. package/dist/esm/stories/graphicMore.stories.js.map +0 -7
  356. package/dist/esm/stories/selectstore.stories.js +0 -2
  357. package/dist/esm/stories/selectstore.stories.js.map +0 -7
@@ -1,26 +1,14 @@
1
1
  import type { Product } from '../../cpn-components/CpnProductCard/types.js';
2
2
  export interface HeaderNavigationProps {
3
3
  data: any;
4
- searchResult?: any;
5
- onSearch?: (value?: string) => void;
6
- isSearching?: boolean;
7
- keywords?: {
8
- search_term: string;
9
- search_date: string;
10
- shopify_domain: string;
11
- counts: number;
12
- }[];
13
4
  event?: {
14
5
  search?: () => void;
15
6
  cart?: () => void;
16
7
  profile?: () => void;
17
8
  livestream?: () => void;
18
- join?: () => void;
19
- login?: () => void;
20
9
  };
21
10
  buildProps: {
22
- products?: Product[];
23
- categories?: Record<string, any>;
11
+ products: Product[];
24
12
  };
25
13
  profile?: UserProfile;
26
14
  theme?: string;
@@ -44,8 +32,7 @@ export declare enum HeaderNavigationMenu {
44
32
  export declare enum HeaderNavigationBlockType {
45
33
  Sidebar = "ipc-navigation-sidebar",
46
34
  Supports = "ipc-navigation-supports",
47
- Multicol = "ipc-navigation-multicol",
48
- Links = "ipc-navigation-links"
35
+ Multicol = "ipc-navigation-multicol"
49
36
  }
50
37
  export declare enum HeaderNavigationActionBlockType {
51
38
  Search = "ipc-navigation-action-search",
@@ -58,7 +45,6 @@ export interface MobileNavigationProps {
58
45
  }
59
46
  export interface DesktopNavigationProps {
60
47
  data: any;
61
- onNavItemClick?: () => void;
62
48
  }
63
49
  type Country = {
64
50
  id?: number;
@@ -1,2 +1,2 @@
1
- "use strict";var e=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var g=(r,i)=>{for(var o in i)e(r,o,{get:i[o],enumerable:!0})},u=(r,i,o,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of d(i))!m.call(r,n)&&n!==o&&e(r,n,{get:()=>i[n],enumerable:!(t=p(i,n))||t.enumerable});return r};var l=r=>u(e({},"__esModule",{value:!0}),r);var v={};g(v,{HeaderNavigationActionBlockType:()=>c,HeaderNavigationBlockType:()=>s,HeaderNavigationMenu:()=>a});module.exports=l(v);var _=require("react"),a=(t=>(t.Primary="primary",t.Secondary="secondary",t.Third="third",t))(a||{}),s=(n=>(n.Sidebar="ipc-navigation-sidebar",n.Supports="ipc-navigation-supports",n.Multicol="ipc-navigation-multicol",n.Links="ipc-navigation-links",n))(s||{}),c=(n=>(n.Search="ipc-navigation-action-search",n.Cart="ipc-navigation-action-cart",n.Profile="ipc-navigation-action-profile",n.Livestream="ipc-navigation-action-livestream",n))(c||{});
1
+ "use strict";var e=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var u=(i,t)=>{for(var o in t)e(i,o,{get:t[o],enumerable:!0})},g=(i,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of m(t))!d.call(i,n)&&n!==o&&e(i,n,{get:()=>t[n],enumerable:!(r=c(t,n))||r.enumerable});return i};var l=i=>g(e({},"__esModule",{value:!0}),i);var b={};u(b,{HeaderNavigationActionBlockType:()=>p,HeaderNavigationBlockType:()=>s,HeaderNavigationMenu:()=>a});module.exports=l(b);var f=require("react"),a=(r=>(r.Primary="primary",r.Secondary="secondary",r.Third="third",r))(a||{}),s=(r=>(r.Sidebar="ipc-navigation-sidebar",r.Supports="ipc-navigation-supports",r.Multicol="ipc-navigation-multicol",r))(s||{}),p=(n=>(n.Search="ipc-navigation-action-search",n.Cart="ipc-navigation-action-cart",n.Profile="ipc-navigation-action-profile",n.Livestream="ipc-navigation-action-livestream",n))(p||{});
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/types.ts"],
4
- "sourcesContent": ["import React from 'react'\n\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\n\nexport interface HeaderNavigationProps {\n data: any\n searchResult?: any\n onSearch?: (value?: string) => void\n isSearching?: boolean\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n buildProps: {\n products?: Product[]\n categories?: Record<string, any>\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n theme?: string\n}\n\nexport interface MobilePrimaryNavigationData {\n actions: any\n menuOpen?: boolean\n onMenuOpenClick: () => void\n onMenuOpenClose: () => void\n}\n\nexport interface MobileSecondaryNavigationData {\n title?: string\n onMenuOpenClose: () => void\n onMenuBackClick: () => void\n}\n\nexport enum HeaderNavigationMenu {\n Primary = 'primary',\n Secondary = 'secondary',\n Third = 'third',\n}\n\nexport enum HeaderNavigationBlockType {\n Sidebar = 'ipc-navigation-sidebar',\n Supports = 'ipc-navigation-supports',\n Multicol = 'ipc-navigation-multicol',\n Links = 'ipc-navigation-links',\n}\n\nexport enum HeaderNavigationActionBlockType {\n Search = 'ipc-navigation-action-search',\n Cart = 'ipc-navigation-action-cart',\n Profile = 'ipc-navigation-action-profile',\n Livestream = 'ipc-navigation-action-livestream',\n}\n\nexport interface MobileNavigationProps {\n data: any\n}\n\nexport interface DesktopNavigationProps {\n data: any\n onNavItemClick?: () => void\n}\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,8BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAAkB,iBA4CNF,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAD,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BACXA,EAAA,MAAQ,uBAJEA,OAAA,IAOAD,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
4
+ "sourcesContent": ["import React from 'react'\n\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\n\nexport interface HeaderNavigationProps {\n data: any\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n }\n buildProps: {\n products: Product[]\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n theme?: string\n}\n\nexport interface MobilePrimaryNavigationData {\n actions: any\n menuOpen?: boolean\n onMenuOpenClick: () => void\n onMenuOpenClose: () => void\n}\n\nexport interface MobileSecondaryNavigationData {\n title?: string\n onMenuOpenClose: () => void\n onMenuBackClick: () => void\n}\n\nexport enum HeaderNavigationMenu {\n Primary = 'primary',\n Secondary = 'secondary',\n Third = 'third',\n}\n\nexport enum HeaderNavigationBlockType {\n Sidebar = 'ipc-navigation-sidebar',\n Supports = 'ipc-navigation-supports',\n Multicol = 'ipc-navigation-multicol',\n}\n\nexport enum HeaderNavigationActionBlockType {\n Search = 'ipc-navigation-action-search',\n Cart = 'ipc-navigation-action-cart',\n Profile = 'ipc-navigation-action-profile',\n Livestream = 'ipc-navigation-action-livestream',\n}\n\nexport interface MobileNavigationProps {\n data: any\n}\n\nexport interface DesktopNavigationProps {\n data: any\n}\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qCAAAE,EAAA,8BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAL,GAAA,IAAAM,EAAkB,iBAgCNF,OACVA,EAAA,QAAU,UACVA,EAAA,UAAY,YACZA,EAAA,MAAQ,QAHEA,OAAA,IAMAD,OACVA,EAAA,QAAU,yBACVA,EAAA,SAAW,0BACXA,EAAA,SAAW,0BAHDA,OAAA,IAMAD,OACVA,EAAA,OAAS,+BACTA,EAAA,KAAO,6BACPA,EAAA,QAAU,gCACVA,EAAA,WAAa,mCAJHA,OAAA",
6
6
  "names": ["types_exports", "__export", "HeaderNavigationActionBlockType", "HeaderNavigationBlockType", "HeaderNavigationMenu", "__toCommonJS", "import_react"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  export declare function WithSidebar<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any): React.ForwardRefExoticComponent<React.PropsWithoutRef<P> & React.RefAttributes<any>>;
3
- export declare function WithSupports<P extends object>(WrappedComponent: React.ComponentType<any>, { categoriesItem, currentNavItemRef, }: {
3
+ export declare function WithSupports<P extends object>(WrappedComponent: React.ComponentType<any>, { categoriesItem, currentNavItemRef, onMouseLeave, }: {
4
4
  categoriesItem: any;
5
5
  currentNavItemRef?: any;
6
6
  onMouseLeave?: () => void;
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.create;var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var m=(e,a)=>{for(var t in a)i(e,t,{get:a[t],enumerable:!0})},l=(e,a,t,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of y(a))!f.call(e,r)&&r!==t&&i(e,r,{get:()=>a[r],enumerable:!(n=p(a,r))||n.enumerable});return e};var w=(e,a,t)=>(t=e!=null?c(M(e)):{},l(a||!e||!e.__esModule?i(t,"default",{value:e,enumerable:!0}):t,e)),h=e=>l(i({},"__esModule",{value:!0}),e);var S={};m(S,{WithGroupCategory:()=>R,WithMulticol:()=>N,WithSidebar:()=>P,WithSupports:()=>b});module.exports=h(S);var d=require("react/jsx-runtime"),s=w(require("react"));function P(e,a){const t=(0,s.useMemo)(()=>{let o=null;try{o=JSON.parse(a?.components?.[0]?.sidebar?.categoriesMetadata||"{}")}catch(u){console.log("categoriesMetadata Parse error",u)}return o},[a]),n=(0,s.useMemo)(()=>{let o=null;try{o=JSON.parse(a?.components?.[0]?.sidebar?.seriesMetadata||"[]")}catch(u){console.log("seriesMetadata Parse error",u)}return o},[a]),r=s.default.forwardRef((o,u)=>(0,d.jsx)(e,{...o,ref:u,seriesMetadata:n,sidebarCategoriesMetadata:t}));return r.displayName=e.displayName||e.name||"WithSidebarDropdown",r}function b(e,{categoriesItem:a,currentNavItemRef:t}){const n=(0,s.useMemo)(()=>a?.components?.[0]?.supports,[a]),r=s.default.forwardRef((o,u)=>(0,d.jsx)(e,{...o,supportsMetadata:n,currentNavItemRef:t,ref:u}));return r.displayName=e.displayName||e.name||"WithSupportsDropdown",r}function N(e,a){const t=(0,s.useMemo)(()=>{try{return JSON.parse(a?.components?.[0]?.multicol?.multicolMetadata||"{}")}catch(r){console.log("multicolMetadata Parse error",r)}return null},[a]),n=s.default.forwardRef((r,o)=>(0,d.jsx)(e,{...r,ref:o,multicolMetadata:t}));return n.displayName=e.displayName||e.name||"WithMulticolDropdown",n}function R(e){return e?Object.values(e?.reduce((a,t)=>(a[t.group]||(a[t.group]=[]),a[t.group].push(t),a),{})):[[]]}
1
+ "use strict";var p=Object.create;var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var w=(e,a)=>{for(var t in a)i(e,t,{get:a[t],enumerable:!0})},l=(e,a,t,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of M(a))!m.call(e,r)&&r!==t&&i(e,r,{get:()=>a[r],enumerable:!(n=y(a,r))||n.enumerable});return e};var h=(e,a,t)=>(t=e!=null?p(f(e)):{},l(a||!e||!e.__esModule?i(t,"default",{value:e,enumerable:!0}):t,e)),P=e=>l(i({},"__esModule",{value:!0}),e);var g={};w(g,{WithGroupCategory:()=>S,WithMulticol:()=>R,WithSidebar:()=>b,WithSupports:()=>N});module.exports=P(g);var d=require("react/jsx-runtime"),s=h(require("react"));function b(e,a){const t=(0,s.useMemo)(()=>{let o=null;try{o=JSON.parse(a?.components?.[0]?.sidebar?.categoriesMetadata||"{}")}catch(u){console.log("categoriesMetadata Parse error",u)}return o},[a]),n=(0,s.useMemo)(()=>{let o=null;try{o=JSON.parse(a?.components?.[0]?.sidebar?.seriesMetadata||"[]")}catch(u){console.log("seriesMetadata Parse error",u)}return o},[a]),r=s.default.forwardRef((o,u)=>(0,d.jsx)(e,{...o,ref:u,seriesMetadata:n,sidebarCategoriesMetadata:t}));return r.displayName=e.displayName||e.name||"WithSidebarDropdown",r}function N(e,{categoriesItem:a,currentNavItemRef:t,onMouseLeave:n}){const r=(0,s.useMemo)(()=>a?.components?.[0]?.supports,[a]),o=s.default.forwardRef((u,c)=>(0,d.jsx)(e,{...u,supportsMetadata:r,currentNavItemRef:t,onMouseLeave:n,ref:c}));return o.displayName=e.displayName||e.name||"WithSupportsDropdown",o}function R(e,a){const t=(0,s.useMemo)(()=>{try{return JSON.parse(a?.components?.[0]?.multicol?.multicolMetadata||"{}")}catch(r){console.log("multicolMetadata Parse error",r)}return null},[a]),n=s.default.forwardRef((r,o)=>(0,d.jsx)(e,{...r,ref:o,multicolMetadata:t}));return n.displayName=e.displayName||e.name||"WithMulticolDropdown",n}function S(e){return e?Object.values(e?.reduce((a,t)=>(a[t.group]||(a[t.group]=[]),a[t.group].push(t),a),{})):[[]]}
2
2
  //# sourceMappingURL=withCategory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/withCategory.tsx"],
4
- "sourcesContent": ["import React, { useMemo } from 'react'\n\nexport function WithSidebar<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n const sidebarCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('categoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n const seriesMetadata = useMemo(() => {\n let seriesMetadata = null\n try {\n seriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.seriesMetadata || '[]')\n } catch (error) {\n console.log('seriesMetadata Parse error', error)\n }\n return seriesMetadata\n }, [categoriesItem])\n\n const withSidebarDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n seriesMetadata={seriesMetadata}\n sidebarCategoriesMetadata={sidebarCategoriesMetadata}\n />\n )\n })\n\n withSidebarDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSidebarDropdown'\n return withSidebarDropdown\n}\n\nexport function WithSupports<P extends object>(\n WrappedComponent: React.ComponentType<any>,\n {\n categoriesItem,\n currentNavItemRef,\n }: { categoriesItem: any; currentNavItemRef?: any; onMouseLeave?: () => void }\n) {\n const supportsMetadata = useMemo(() => {\n return categoriesItem?.components?.[0]?.supports\n }, [categoriesItem])\n\n const supportsDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n supportsMetadata={supportsMetadata}\n currentNavItemRef={currentNavItemRef}\n ref={ref}\n />\n )\n })\n\n supportsDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSupportsDropdown'\n return supportsDropdown\n}\n\nexport function WithMulticol<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n const multicolMetadata = useMemo(() => {\n try {\n return JSON.parse(categoriesItem?.components?.[0]?.multicol?.multicolMetadata || '{}')\n } catch (error) {\n console.log('multicolMetadata Parse error', error)\n }\n return null\n }, [categoriesItem])\n const multicolDropdown = React.forwardRef<any, P>((props, ref) => {\n return <WrappedComponent {...(props as unknown as P)} ref={ref} multicolMetadata={multicolMetadata} />\n })\n\n multicolDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithMulticolDropdown'\n return multicolDropdown\n}\n\nexport function WithGroupCategory(categories: any) {\n if (!categories) return [[]]\n return Object.values(\n categories?.reduce((acc: any, item: any) => {\n if (!acc[item.group]) {\n acc[item.group] = []\n }\n acc[item.group].push(item)\n return acc\n }, {})\n )\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,iBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAN,GA2BM,IAAAO,EAAA,6BA3BNC,EAA+B,oBAExB,SAASJ,EAA8BK,EAA4CC,EAAqB,CAE7G,MAAMC,KAA4B,WAAQ,IAAM,CAC9C,IAAIC,EAAqB,KACzB,GAAI,CACFA,EAAqB,KAAK,MAAMF,GAAgB,aAAa,CAAC,GAAG,SAAS,oBAAsB,IAAI,CACtG,OAASG,EAAO,CACd,QAAQ,IAAI,iCAAkCA,CAAK,CACrD,CACA,OAAOD,CACT,EAAG,CAACF,CAAc,CAAC,EAGbI,KAAiB,WAAQ,IAAM,CACnC,IAAIA,EAAiB,KACrB,GAAI,CACFA,EAAiB,KAAK,MAAMJ,GAAgB,aAAa,CAAC,GAAG,SAAS,gBAAkB,IAAI,CAC9F,OAASG,EAAO,CACd,QAAQ,IAAI,6BAA8BA,CAAK,CACjD,CACA,OAAOC,CACT,EAAG,CAACJ,CAAc,CAAC,EAEbK,EAAsB,EAAAC,QAAM,WAAmB,CAACC,EAAOC,OAEzD,OAACT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ulticol", "WithSidebar", "WithSupports", "__toCommonJS", "import_jsx_runtime", "import_react", "WrappedComponent", "categoriesItem", "sidebarCategoriesMetadata", "categoriesMetadata", "error", "seriesMetadata", "withSidebarDropdown", "React", "props", "ref", "currentNavItemRef", "supportsMetadata", "supportsDropdown", "multicolMetadata", "multicolDropdown", "categories", "acc", "item"]
4
+ "sourcesContent": ["import React, { useMemo } from 'react'\n\nexport function WithSidebar<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n // \u4FA7\u8FB9\u680F\u5206\u7C7B\u5143\u6570\u636E\n const sidebarCategoriesMetadata = useMemo(() => {\n let categoriesMetadata = null\n try {\n categoriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.categoriesMetadata || '{}')\n } catch (error) {\n console.log('categoriesMetadata Parse error', error)\n }\n return categoriesMetadata\n }, [categoriesItem])\n\n // \u4FA7\u8FB9\u680F\u7CFB\u5217\u5143\u6570\u636E\n const seriesMetadata = useMemo(() => {\n let seriesMetadata = null\n try {\n seriesMetadata = JSON.parse(categoriesItem?.components?.[0]?.sidebar?.seriesMetadata || '[]')\n } catch (error) {\n console.log('seriesMetadata Parse error', error)\n }\n return seriesMetadata\n }, [categoriesItem])\n\n const withSidebarDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n ref={ref}\n seriesMetadata={seriesMetadata}\n sidebarCategoriesMetadata={sidebarCategoriesMetadata}\n />\n )\n })\n\n withSidebarDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSidebarDropdown'\n return withSidebarDropdown\n}\n\nexport function WithSupports<P extends object>(\n WrappedComponent: React.ComponentType<any>,\n {\n categoriesItem,\n currentNavItemRef,\n onMouseLeave,\n }: { categoriesItem: any; currentNavItemRef?: any; onMouseLeave?: () => void }\n) {\n const supportsMetadata = useMemo(() => {\n return categoriesItem?.components?.[0]?.supports\n }, [categoriesItem])\n\n const supportsDropdown = React.forwardRef<any, P>((props, ref) => {\n return (\n <WrappedComponent\n {...(props as unknown as P)}\n supportsMetadata={supportsMetadata}\n currentNavItemRef={currentNavItemRef}\n onMouseLeave={onMouseLeave}\n ref={ref}\n />\n )\n })\n\n supportsDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithSupportsDropdown'\n return supportsDropdown\n}\n\nexport function WithMulticol<P extends object>(WrappedComponent: React.ComponentType<any>, categoriesItem: any) {\n const multicolMetadata = useMemo(() => {\n try {\n return JSON.parse(categoriesItem?.components?.[0]?.multicol?.multicolMetadata || '{}')\n } catch (error) {\n console.log('multicolMetadata Parse error', error)\n }\n return null\n }, [categoriesItem])\n const multicolDropdown = React.forwardRef<any, P>((props, ref) => {\n return <WrappedComponent {...(props as unknown as P)} ref={ref} multicolMetadata={multicolMetadata} />\n })\n\n multicolDropdown.displayName = WrappedComponent.displayName || WrappedComponent.name || 'WithMulticolDropdown'\n return multicolDropdown\n}\n\nexport function WithGroupCategory(categories: any) {\n if (!categories) return [[]]\n return Object.values(\n categories?.reduce((acc: any, item: any) => {\n if (!acc[item.group]) {\n acc[item.group] = []\n }\n acc[item.group].push(item)\n return acc\n }, {})\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,iBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,IAAA,eAAAC,EAAAN,GA2BM,IAAAO,EAAA,6BA3BNC,EAA+B,oBAExB,SAASJ,EAA8BK,EAA4CC,EAAqB,CAE7G,MAAMC,KAA4B,WAAQ,IAAM,CAC9C,IAAIC,EAAqB,KACzB,GAAI,CACFA,EAAqB,KAAK,MAAMF,GAAgB,aAAa,CAAC,GAAG,SAAS,oBAAsB,IAAI,CACtG,OAASG,EAAO,CACd,QAAQ,IAAI,iCAAkCA,CAAK,CACrD,CACA,OAAOD,CACT,EAAG,CAACF,CAAc,CAAC,EAGbI,KAAiB,WAAQ,IAAM,CACnC,IAAIA,EAAiB,KACrB,GAAI,CACFA,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,OAAO,OACZA,GAAY,OAAO,CAACC,EAAUC,KACvBD,EAAIC,EAAK,KAAK,IACjBD,EAAIC,EAAK,KAAK,EAAI,CAAC,GAErBD,EAAIC,EAAK,KAAK,EAAE,KAAKA,CAAI,EAClBD,GACN,CAAC,CAAC,CACP,EATwB,CAAC,CAAC,CAAC,CAU7B",
6
+ "names": ["withCategory_exports", "__export", "WithGroupCategory", "WithMulticol", "WithSidebar", "WithSupports", "__toCommonJS", "import_jsx_runtime", "import_react", "WrappedComponent", "categoriesItem", "sidebarCategoriesMetadata", "categoriesMetadata", "error", "seriesMetadata", "withSidebarDropdown", "React", "props", "ref", "currentNavItemRef", "onMouseLeave", "supportsMetadata", "supportsDropdown", "multicolMetadata", "multicolDropdown", "categories", "acc", "item"]
7
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)("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);
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);
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 '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,EAA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2B,EAAO,oBAAqBgB,EAAyB,MAAOf,CAAa,EACjG,OAAQa,EACR,SAAUzC,EAAK,MACjB,GATK,GAAGA,GAAM,OAAS,EAAE,GAAGyC,CAAK,EAUnC,CAEH,EACAX,EAAM,IAAI,CAAC9B,EAAMyC,OAChB,OAAC,YAA8C,KAAMH,EAAQ,MAAM,EAAG,UAAU,sBAC9E,mBAACvC,EAAA,CACC,KAAMC,EACN,cAAe,CAAE,MAAO2B,EAAO,oBAAqBgB,EAAyB,MAAOf,CAAa,EACjG,OAAQa,EACR,SAAU,OACZ,GANa,GAAGzC,GAAM,OAAS,EAAE,GAAGyC,CAAK,EAO3C,CACD,GACH,EACCV,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",
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,CACj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AAQtC,EAAK,OAAS,MAAM,EAClC,UAAU,sBAEV,mBAACD,EAAA,CACC,KAAMC,EACN,cAAe,CAAE,MAAO2B,EAAO,oBAAqBgB,EAAyB,MAAOf,CAAa,EACjG,OAAQa,EACR,SAAUzC,EAAK,MACjB,GATK,GAAGA,GAAM,OAAS,EAAE,GAAGyC,CAAK,EAUnC,CAEH,EACAX,EAAM,IAAI,CAAC9B,EAAMyC,OAChB,OAAC,YAA8C,KAAMH,EAAQ,MAAM,EAAG,UAAU,sBAC9E,mBAACvC,EAAA,CACC,KAAMC,EACN,cAAe,CAAE,MAAO2B,EAAO,oBAAqBgB,EAAyB,MAAOf,CAAa,EACjG,OAAQa,EACR,SAAU,OACZ,GANa,GAAGzC,GAAM,OAAS,EAAE,GAAGyC,CAAK,EAO3C,CACD,GACH,EACCV,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
  }
@@ -1,2 +1,2 @@
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`,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);
1
+ "use strict";"use client";var se=Object.create;var w=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var ie=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var oe=(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 ne(s))!re.call(e,l)&&l!==n&&w(e,l,{get:()=>s[l],enumerable:!(f=ae(s,l))||f.enumerable});return e};var g=(e,s,n)=>(n=e!=null?se(ie(e)):{},V(s||!e||!e.__esModule?w(n,"default",{value:e,enumerable:!0}):n,e)),le=e=>V(w({},"__esModule",{value:!0}),e);var ue={};oe(ue,{default:()=>fe});module.exports=le(ue);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 me="image",ce="product_shelf",pe=a.default.forwardRef(({key:e,data:s,event:n,buildData:f,breakpoints:l,className:Q="",recommendedData:c,target:W="_self",isDisplayGudgments:R=!1,isDisplayBackImage:j=!1},F)=>{const{productsTab:u=[],productsCard:G=[],title:I,isShowTab:v=!0,tabShape:J="square",isShowTag:K=!1,isShowOriginalPrice:U=!0,isShowRecommendedCard:X=!1,...Y}=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),Z=(0,O.useMediaQuery)({query:"(max-width: 768px)"}),[ee,B]=(0,z.useRollout)({threshold:0}),d=m?.length<=1&&R,p=!Z&&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(te=>te?.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)(F,()=>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(G,X)}},[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:J,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:me,component_name:ce,component_title:s?.title,component_position:1,navigation:t?.tab}});return}C()}})}),(0,o.jsx)("div",{ref:ee,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:{...Y,event:n,isShowTag:K,isShowOriginalPrice:U,target:W,itemLength:m?.length,isDisplayBackImage:j}},id:`ShelfDisplay${e}${M}`,className:`${v?"mt-6":""} !overflow-visible`,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 fe=(0,q.withLayout)(pe);
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 { 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\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`}\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,IAuJM,IAAAI,EAAA,6BAtJNC,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,GACZ,oBAAAC,EAAsB,GACtB,sBAAAC,EAAwB,GACxB,GAAGC,CACL,EAAInB,EAEE,CAACoB,EAAOC,CAAQ,KAAI,YAAiB,EAAE,EACvC,CAACC,EAAcC,CAAe,KAAI,YAA6B,CAAC,CAAC,EAEjEC,KAAS,UAAgB,EAAK,EAC9BC,KAAc,UAAgB,EAAK,EACnCC,K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,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,qBACrC,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"]
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 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\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,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,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,GACZ,oBAAAC,EAAsB,GACtB,sBAAAC,EAAwB,GACxB,GAAGC,CACL,EAAIlB,EAEE,CAACmB,EAAOC,CAAQ,KAAI,YAAiB,EAAE,EACvC,CAACC,EAAcC,CAAe,KAAI,YAA6B,CAAC,CAAC,EAEjEC,KAAS,UAAgB,EAAK,EAC9BC,KAAc,UAAgB,EAAK,EACnCC,KAAW,UAAuB,IAAI,EAEtCC,KAAW,iBA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,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,MAAOjB,EACP,UAAAc,EACA,oBAAAC,EACA,OAAQV,EACR,WAAYe,GAAc,OAC1B,mBAAoBb,CACtB,CACF,EACA,GAAI,eAAeT,CAAG,GAAGoB,CAAK,GAC9B,UAAW,GAAGN,EAAY,OAAS,EAAE,qBACrC,cAAeiB,EAAkB,SAAW,GAC5C,MAAOA,EAAkB,6BAA6B,uBACtD,YACE3B,GAAe,CACb,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe0B,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,IAAOjD,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", "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 S=Object.create;var s=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)s(e,r,{get:n[r],enumerable:!0})},p=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of P(n))!T.call(e,i)&&i!==r&&s(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)):{},p(n||!e||!e.__esModule?s(r,"default",{value:e,enumerable:!0}):r,e)),w=e=>p(s({},"__esModule",{value:!0}),e);var C={};$(C,{PRICE_SYMBOL:()=>o,formatPrice:()=>u,formatVariantPrice:()=>x,languageTerritory:()=>d});module.exports=w(C);var g=k(require("decimal.js"));const o={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",fr:"\u20AC",de:"\u20AC",nl:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED"},d=e=>({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"})[e]||"";function u({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:i,removeTrailingZeros:c=!1}){let a=new Intl.NumberFormat(d(r),{style:"currency",currency:n||"USD",minimumFractionDigits:t===0?0:i,maximumFractionDigits:t}).format(e);return["eu-de","eu-en","de","eu"].includes(r)&&(a=a?.toString()?.replace(/[\s]/g,"")),c&&(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:c,removeTrailingZeros:m}){if(typeof Intl>"u")return{price:`${o[t]}${e}`,basePrice:`${o[t]}${n}`,discount:`${o[t]}${n-e||0}`};const a=n>e,y=new Intl.NumberFormat(d(t),{style:"percent"}),f=a?y.format((n-e)/n):null;let l;if(a){const h=new g.default(n).sub(e||0).toNumber();l=u({amount:h,currencyCode:r||"USD",locale:t,maximumFractionDigits:2})}const b=u({amount:e,currencyCode:r,locale:t,removeTrailingZeros:m}),D=a?u({amount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:c,removeTrailingZeros:m}):void 0;return{price:b,basePrice:D,discount:f,discountAmount:l}}
1
+ "use strict";var S=Object.create;var s=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)s(e,r,{get:n[r],enumerable:!0})},p=(e,n,r,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of P(n))!T.call(e,i)&&i!==r&&s(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)):{},p(n||!e||!e.__esModule?s(r,"default",{value:e,enumerable:!0}):r,e)),w=e=>p(s({},"__esModule",{value:!0}),e);var C={};$(C,{PRICE_SYMBOL:()=>o,formatPrice:()=>u,formatVariantPrice:()=>x,languageTerritory:()=>d});module.exports=w(C);var g=k(require("decimal.js"));const o={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED"},d=e=>({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"})[e]||"";function u({amount:e,currencyCode:n,locale:r,maximumFractionDigits:t,minimumFractionDigits:i,removeTrailingZeros:c=!1}){let a=new Intl.NumberFormat(d(r),{style:"currency",currency:n||"USD",minimumFractionDigits:t===0?0:i,maximumFractionDigits:t}).format(e);return["eu-de","eu-en","de","eu"].includes(r)&&(a=a?.toString()?.replace(/[\s]/g,"")),c&&(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:c,removeTrailingZeros:m}){if(typeof Intl>"u")return{price:`${o[t]}${e}`,basePrice:`${o[t]}${n}`,discount:`${o[t]}${n-e||0}`};const a=n>e,y=new Intl.NumberFormat(d(t),{style:"percent"}),f=a?y.format((n-e)/n):null;let l;if(a){const h=new g.default(n).sub(e||0).toNumber();l=u({amount:h,currencyCode:r||"USD",locale:t,maximumFractionDigits:2})}const b=u({amount:e,currencyCode:r,locale:t,removeTrailingZeros:m}),D=a?u({amount:n,currencyCode:r,locale:t,maximumFractionDigits:i,minimumFractionDigits:c,removeTrailingZeros:m}):void 0;return{price:b,basePrice:D,discount:f,discountAmount:l}}
2
2
  //# sourceMappingURL=shelfDisplay.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplay.ts"],
4
- "sourcesContent": ["import Decimal from 'decimal.js'\nimport type { ContainerProps } from '../../types/props.js'\n/* eslint-disable no-useless-escape */\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n fr: '\u20AC',\n de: '\u20AC',\n nl: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n} as any\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',\n fr: 'de-DE',\n 'eu-es': 'de-DE',\n 'eu-fr': 'de-DE',\n 'eu-it': 'de-DE',\n 'eu-de': 'de-DE',\n 'eu-en': 'en-US',\n 'cz-en': 'de-DE',\n nl: 'de-DE',\n de: 'de-DE',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'ae-en',\n plus: 'en-us',\n cl: 'es-cl',\n dk: 'en-dk',\n fi: 'en-fi',\n no: 'en-no',\n is: 'en-is',\n se: 'en-se',\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]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale]}${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 // \u6298\u6263\u91D1\u989D\n let discountAmount;\n if (hasDiscount) { \n const savePriceAmount = new Decimal(baseAmount).sub(amount || 0).toNumber()\n discountAmount = formatPrice({\n amount: savePriceAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n })\n }\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, discountAmount }\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n}\n\nexport interface ShelfDisplayItem {\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n custom_image?: string\n custom_theme?: string\n}\n\nexport type ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowRecommendedCard?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any[]\n productsCard?: any[]\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n recommendedData?: any[]\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n className?: string\n key?: string\n target?: '_self' | '_blank'\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n metafields?: any\n isDisplayGudgments?: boolean\n isDisplayBackImage?: boolean\n}"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,gBAAAC,EAAA,uBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAN,GAAA,IAAAO,EAAoB,yBAGb,MAAML,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,KACN,EAEaG,EAAqBG,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,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G,CACtE,MAAO,SACT,CAAC,EACKU,EAAWF,EAAcC,EAAe,QAAQF,EAAaN,GAAUM,CAAU,EAAI,KAE3F,IAAII,EACJ,GAAIH,EAAa,CACf,MAAMI,EAAkB,IAAI,EAAAC,QAAQN,CAAU,EAAE,IAAIN,GAAU,CAAC,EAAE,SAAS,EAC1EU,EAAiBhB,EAAY,CAC3B,OAAQiB,EACR,aAAcV,GAAgB,MAC9B,OAAAF,EACA,sBAAuB,CACzB,CAAC,CACH,CAEA,MAAMc,EAAQnB,EAAY,CAAE,OAAAM,EAAQ,aAAAC,EAAc,OAAAF,EAAQ,oBAAAK,CAAoB,CAAC,EACzEU,EAAYP,EACdb,EAAY,CACV,OAAQY,EACR,aAAAL,EACA,OAAAF,EACA,sBAAAG,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAS,EAAO,UAAAC,EAAW,SAAAL,EAAU,eAAAC,CAAe,CACtD",
4
+ "sourcesContent": ["import Decimal from 'decimal.js'\nimport type { ContainerProps } from '../../types/props.js'\n/* eslint-disable no-useless-escape */\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n} as any\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',\n fr: 'de-DE',\n 'eu-es': 'de-DE',\n 'eu-fr': 'de-DE',\n 'eu-it': 'de-DE',\n 'eu-de': 'de-DE',\n 'eu-en': 'en-US',\n 'cz-en': 'de-DE',\n nl: 'de-DE',\n de: 'de-DE',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'ae-en',\n plus: 'en-us',\n cl: 'es-cl',\n dk: 'en-dk',\n fi: 'en-fi',\n no: 'en-no',\n is: 'en-is',\n se: 'en-se',\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]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale]}${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 // \u6298\u6263\u91D1\u989D\n let discountAmount;\n if (hasDiscount) { \n const savePriceAmount = new Decimal(baseAmount).sub(amount || 0).toNumber()\n discountAmount = formatPrice({\n amount: savePriceAmount,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n })\n }\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, discountAmount }\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n}\n\nexport interface ShelfDisplayItem {\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n custom_image?: string\n custom_theme?: string\n}\n\nexport type ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowRecommendedCard?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any[]\n productsCard?: any[]\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n recommendedData?: any[]\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n className?: string\n key?: string\n target?: '_self' | '_blank'\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n metafields?: any\n isDisplayGudgments?: boolean\n isDisplayBackImage?: boolean\n}"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,gBAAAC,EAAA,uBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAN,GAAA,IAAAO,EAAoB,yBAGb,MAAML,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,KACN,EAEaG,EAAqBG,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,KACJ,GAAI,QACJ,QAAS,QACT,QAAS,QACT,QAAS,QACT,QAAS,QACT,QAAS,QACT,QAAS,QACT,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,OACN,GAAGA,CAAM,GAAK,GAET,SAASL,EAAY,CAC1B,OAAAM,EACA,aAAAC,EACA,OAAAF,EACA,sBAAAG,EACA,sBAAAC,EACA,oBAAAC,EAAsB,EACxB,EAOG,CAQD,IAAIC,EAPmB,IAAI,KAAK,aAAaT,EAAkBG,CAAM,EAAG,CACtE,MAAO,WACP,SAAUE,GAAgB,MAC1B,sBAAuBC,IAA0B,EAAI,EAAIC,EACzD,sBAAAD,CACF,CAAC,EAEmC,OAAOF,CAAM,EAEjD,MAAI,CAAC,QAAS,QAAS,KAAM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
6
6
  "names": ["shelfDisplay_exports", "__export", "PRICE_SYMBOL", "formatPrice", "formatVariantPrice", "languageTerritory", "__toCommonJS", "import_decimal", "locale", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "baseAmount", "hasDiscount", "formatDiscount", "discount", "discountAmount", "savePriceAmount", "Decimal", "price", "basePrice"]
7
7
  }