@salla.sa/twilight-components 2.14.483 → 2.14.485

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 (322) hide show
  1. package/dist/cjs/{Helper-CgGR9Qf8.js → Helper-DvyEpCgx.js} +13 -0
  2. package/dist/cjs/{filepond-B7JshNP-.js → filepond-B1h9ltVJ.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-Bxw84EJ9.js → filepond-plugin-file-poster-B4zD4xns.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-D7z9bzxr.js → filepond-plugin-file-validate-size-CIX5-X21.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-CImB-IPQ.js → filepond-plugin-file-validate-type-D1NcjxUw.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-CUJXTddu.js → filepond-plugin-image-edit-Bb7P11BN.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-C3mcn9KI.js → filepond-plugin-image-exif-orientation-C4HNrnSA.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-BI1YsBYj.js → filepond-plugin-image-preview-DeMAP_C9.js} +1 -1
  9. package/dist/cjs/{functions-JdrYDQKu.js → functions-COuh9Ohq.js} +1 -1
  10. package/dist/cjs/{index-UdJx6iBO.js → index-8pwFZzoL.js} +8 -8
  11. package/dist/cjs/{index-D3Wa_I8P.js → index-jbrJkd9L.js} +1 -1
  12. package/dist/cjs/loader.cjs.js +2 -2
  13. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  15. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  16. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-booking-field_7.cjs.entry.js +11 -11
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-comment-form_8.cjs.entry.js +2 -2
  27. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  35. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  36. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  51. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-notifications.cjs.entry.js +2 -2
  63. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-options-modal_3.cjs.entry.js +17 -2
  73. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  76. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-products-list.cjs.entry.js +44 -17
  82. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  85. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  87. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  101. package/dist/cjs/{tracked-promise-DENdU5n-.js → tracked-promise-BOMQ9hTv.js} +1 -1
  102. package/dist/cjs/twilight.cjs.js +2 -2
  103. package/dist/cjs/{vanilla-picker-CMF_WtgH.js → vanilla-picker-DM7x_-2X.js} +1 -1
  104. package/dist/collection/Helpers/Helper.js +13 -0
  105. package/dist/collection/components/salla-products-list/salla-products-list.js +42 -15
  106. package/dist/collection/components/salla-products-slider/salla-products-slider.js +18 -0
  107. package/dist/components/Helper.js +13 -0
  108. package/dist/components/index.js +8 -8
  109. package/dist/components/salla-products-list2.js +42 -15
  110. package/dist/components/salla-products-slider2.js +17 -0
  111. package/dist/esm/{Helper-BXj4f_Qj.js → Helper-CD8d-Brd.js} +13 -0
  112. package/dist/esm/{filepond-DwduE1q7.js → filepond-DHzuRfQN.js} +1 -1
  113. package/dist/esm/{filepond-plugin-file-poster-Cg5uryRV.js → filepond-plugin-file-poster-BxdBxR7d.js} +1 -1
  114. package/dist/esm/{filepond-plugin-file-validate-size-CI1Sj8kr.js → filepond-plugin-file-validate-size-C-0L9g1L.js} +1 -1
  115. package/dist/esm/{filepond-plugin-file-validate-type-JUm4bC13.js → filepond-plugin-file-validate-type-OyHjZUCW.js} +1 -1
  116. package/dist/esm/{filepond-plugin-image-edit-BrJ55gLP.js → filepond-plugin-image-edit-BIfGCYQ5.js} +1 -1
  117. package/dist/esm/{filepond-plugin-image-exif-orientation-BkQECx1u.js → filepond-plugin-image-exif-orientation-DJlKxr63.js} +1 -1
  118. package/dist/esm/{filepond-plugin-image-preview-nIxzaSJG.js → filepond-plugin-image-preview-B2DpOs_r.js} +1 -1
  119. package/dist/esm/{functions-BzIvfM0W.js → functions-DT-OwuY-.js} +1 -1
  120. package/dist/esm/{index-CFOfZPpP.js → index-D449pxDB.js} +1 -1
  121. package/dist/esm/{index-CPL9CY3o.js → index-DJPd6DKq.js} +8 -8
  122. package/dist/esm/loader.js +3 -3
  123. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  124. package/dist/esm/salla-accordion_6.entry.js +2 -2
  125. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  126. package/dist/esm/salla-advertisement.entry.js +1 -1
  127. package/dist/esm/salla-alert_2.entry.js +1 -1
  128. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  129. package/dist/esm/salla-apps-icons.entry.js +1 -1
  130. package/dist/esm/salla-badge.entry.js +1 -1
  131. package/dist/esm/salla-booking-field_7.entry.js +11 -11
  132. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  133. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  134. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  135. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  136. package/dist/esm/salla-comment-form_8.entry.js +2 -2
  137. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  138. package/dist/esm/salla-contacts.entry.js +1 -1
  139. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  140. package/dist/esm/salla-count-down.entry.js +1 -1
  141. package/dist/esm/salla-custom-fields.entry.js +1 -1
  142. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  143. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  144. package/dist/esm/salla-filters-widget.entry.js +2 -2
  145. package/dist/esm/salla-filters.entry.js +2 -2
  146. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  147. package/dist/esm/salla-gifting.entry.js +1 -1
  148. package/dist/esm/salla-hook.entry.js +1 -1
  149. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  150. package/dist/esm/salla-installment.entry.js +1 -1
  151. package/dist/esm/salla-list-tile.entry.js +1 -1
  152. package/dist/esm/salla-localization-modal.entry.js +1 -1
  153. package/dist/esm/salla-login-modal.entry.js +1 -1
  154. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  155. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  156. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  157. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  158. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  159. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  160. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  161. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  162. package/dist/esm/salla-loyalty.entry.js +1 -1
  163. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  164. package/dist/esm/salla-map_2.entry.js +1 -1
  165. package/dist/esm/salla-menu.entry.js +1 -1
  166. package/dist/esm/salla-metadata.entry.js +1 -1
  167. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  168. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  169. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  170. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  171. package/dist/esm/salla-notification-item.entry.js +1 -1
  172. package/dist/esm/salla-notifications.entry.js +2 -2
  173. package/dist/esm/salla-offer-modal.entry.js +1 -1
  174. package/dist/esm/salla-offer.entry.js +1 -1
  175. package/dist/esm/salla-order-branch.entry.js +1 -1
  176. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  177. package/dist/esm/salla-order-details-options.entry.js +1 -1
  178. package/dist/esm/salla-order-details.entry.js +1 -1
  179. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  180. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  181. package/dist/esm/salla-order-edit.entry.js +1 -1
  182. package/dist/esm/salla-order-options-modal_3.entry.js +17 -2
  183. package/dist/esm/salla-order-summary.entry.js +1 -1
  184. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  185. package/dist/esm/salla-orders.entry.js +2 -2
  186. package/dist/esm/salla-payments.entry.js +1 -1
  187. package/dist/esm/salla-placeholder.entry.js +1 -1
  188. package/dist/esm/salla-price-range.entry.js +1 -1
  189. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  190. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  191. package/dist/esm/salla-products-list.entry.js +44 -17
  192. package/dist/esm/salla-quick-order.entry.js +1 -1
  193. package/dist/esm/salla-rating-modal.entry.js +2 -2
  194. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  195. package/dist/esm/salla-scopes.entry.js +1 -1
  196. package/dist/esm/salla-search.entry.js +2 -2
  197. package/dist/esm/salla-skeleton.entry.js +1 -1
  198. package/dist/esm/salla-slider.entry.js +1 -1
  199. package/dist/esm/salla-social-share.entry.js +1 -1
  200. package/dist/esm/salla-social.entry.js +1 -1
  201. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  202. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  203. package/dist/esm/salla-tooltip.entry.js +1 -1
  204. package/dist/esm/salla-trust-badges.entry.js +1 -1
  205. package/dist/esm/salla-user-menu.entry.js +1 -1
  206. package/dist/esm/salla-user-profile.entry.js +1 -1
  207. package/dist/esm/salla-user-settings.entry.js +1 -1
  208. package/dist/esm/salla-verify.entry.js +1 -1
  209. package/dist/esm/salla-wallet.entry.js +1 -1
  210. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  211. package/dist/esm/{tracked-promise-CoSLxVRo.js → tracked-promise-CNnq4c_E.js} +1 -1
  212. package/dist/esm/twilight.js +3 -3
  213. package/dist/esm/{vanilla-picker-BNfzIAYB.js → vanilla-picker-DQDhWp1B.js} +1 -1
  214. package/dist/twilight/{p-3b958e78.entry.js → p-005c08fe.entry.js} +1 -1
  215. package/dist/twilight/{p-120cbae1.entry.js → p-01fd381b.entry.js} +1 -1
  216. package/dist/twilight/{p-f7ebf444.entry.js → p-029c7342.entry.js} +1 -1
  217. package/dist/twilight/{p-b57981d4.entry.js → p-07e93d60.entry.js} +1 -1
  218. package/dist/twilight/{p-60024239.entry.js → p-0ade8936.entry.js} +1 -1
  219. package/dist/twilight/{p-f995bf04.entry.js → p-1620eaa3.entry.js} +1 -1
  220. package/dist/twilight/{p-df1cdb0d.entry.js → p-17b0b92b.entry.js} +1 -1
  221. package/dist/twilight/{p-34a187cf.entry.js → p-17f9907e.entry.js} +1 -1
  222. package/dist/twilight/{p-12a111fe.entry.js → p-1b506134.entry.js} +1 -1
  223. package/dist/twilight/{p-7cdb34ae.entry.js → p-1b9272d4.entry.js} +1 -1
  224. package/dist/twilight/{p-4a79b461.entry.js → p-1dc4ab57.entry.js} +1 -1
  225. package/dist/twilight/{p-976fe135.entry.js → p-1fc50a13.entry.js} +1 -1
  226. package/dist/twilight/{p-5b6a819a.entry.js → p-2270652d.entry.js} +1 -1
  227. package/dist/twilight/{p-0e8ffb12.entry.js → p-23a8870b.entry.js} +1 -1
  228. package/dist/twilight/{p-208e0041.entry.js → p-2566c361.entry.js} +1 -1
  229. package/dist/twilight/{p-f96a86a0.entry.js → p-2646c71c.entry.js} +1 -1
  230. package/dist/twilight/{p-866ae3dc.entry.js → p-26603c81.entry.js} +1 -1
  231. package/dist/twilight/{p-7aa2cb4d.entry.js → p-2794a82d.entry.js} +1 -1
  232. package/dist/twilight/{p-dd0d6d13.entry.js → p-2d6f9f9e.entry.js} +1 -1
  233. package/dist/twilight/{p-f4906774.entry.js → p-2e1cf59c.entry.js} +1 -1
  234. package/dist/twilight/{p-DW5X0KUQ.js → p-2xUZDJ04.js} +1 -1
  235. package/dist/twilight/{p-257fbf4d.entry.js → p-302bc68d.entry.js} +1 -1
  236. package/dist/twilight/{p-d7a88a71.entry.js → p-309914e6.entry.js} +1 -1
  237. package/dist/twilight/{p-ce12be93.entry.js → p-329f2f11.entry.js} +1 -1
  238. package/dist/twilight/{p-f174316c.entry.js → p-32eea65f.entry.js} +1 -1
  239. package/dist/twilight/{p-fc5654d2.entry.js → p-32ef12bb.entry.js} +1 -1
  240. package/dist/twilight/{p-2def11f1.entry.js → p-3a103253.entry.js} +1 -1
  241. package/dist/twilight/{p-5a1797c8.entry.js → p-3c4b0b05.entry.js} +1 -1
  242. package/dist/twilight/{p-74a9bc1e.entry.js → p-40256161.entry.js} +1 -1
  243. package/dist/twilight/{p-ddc1bc0d.entry.js → p-431b9986.entry.js} +1 -1
  244. package/dist/twilight/{p-d27249b5.entry.js → p-445b3e07.entry.js} +1 -1
  245. package/dist/twilight/{p-3dee0f70.entry.js → p-48b68862.entry.js} +1 -1
  246. package/dist/twilight/{p-7645015f.entry.js → p-4a31a4dd.entry.js} +1 -1
  247. package/dist/twilight/{p-b6c15b67.entry.js → p-566bae1e.entry.js} +1 -1
  248. package/dist/twilight/{p-e3d7e3c8.entry.js → p-58e39fe9.entry.js} +1 -1
  249. package/dist/twilight/{p-cec8779e.entry.js → p-5c7dd67e.entry.js} +1 -1
  250. package/dist/twilight/{p-324a7ef6.entry.js → p-5cd703c2.entry.js} +1 -1
  251. package/dist/twilight/{p-75f932ca.entry.js → p-5e39f770.entry.js} +1 -1
  252. package/dist/twilight/{p-822715db.entry.js → p-6181acb5.entry.js} +1 -1
  253. package/dist/twilight/{p-456ac86d.entry.js → p-6466fd9c.entry.js} +1 -1
  254. package/dist/twilight/{p-2f1d030d.entry.js → p-67ac0915.entry.js} +1 -1
  255. package/dist/twilight/{p-2f38b7e4.entry.js → p-69926ae5.entry.js} +1 -1
  256. package/dist/twilight/{p-27d113b9.entry.js → p-6e8a0f83.entry.js} +1 -1
  257. package/dist/twilight/{p-80f079b3.entry.js → p-74abfefb.entry.js} +1 -1
  258. package/dist/twilight/{p-4970584a.entry.js → p-74ba62ad.entry.js} +1 -1
  259. package/dist/twilight/{p-33afa437.entry.js → p-7547a8c3.entry.js} +1 -1
  260. package/dist/twilight/{p-10a86f9e.entry.js → p-78854c4a.entry.js} +1 -1
  261. package/dist/twilight/{p-fb469c8a.entry.js → p-7afc3b39.entry.js} +1 -1
  262. package/dist/twilight/{p-158ddb37.entry.js → p-7baf04d3.entry.js} +1 -1
  263. package/dist/twilight/{p-1b33acf6.entry.js → p-7dedb31c.entry.js} +1 -1
  264. package/dist/twilight/{p-d2fb2da6.entry.js → p-7f788909.entry.js} +1 -1
  265. package/dist/twilight/{p-7d55faee.entry.js → p-800e069d.entry.js} +1 -1
  266. package/dist/twilight/{p-bdeb8fdc.entry.js → p-80fc1a7b.entry.js} +1 -1
  267. package/dist/twilight/p-83b8d7cf.entry.js +4 -0
  268. package/dist/twilight/{p-0696998f.entry.js → p-859f2c19.entry.js} +1 -1
  269. package/dist/twilight/{p-9b98eda2.entry.js → p-8f672cef.entry.js} +1 -1
  270. package/dist/twilight/{p-a92022bc.entry.js → p-91884639.entry.js} +1 -1
  271. package/dist/twilight/{p-110e5099.entry.js → p-9248a9b8.entry.js} +1 -1
  272. package/dist/twilight/{p-909275e1.entry.js → p-93e3a6b1.entry.js} +1 -1
  273. package/dist/twilight/{p-3c04469e.entry.js → p-985f8781.entry.js} +1 -1
  274. package/dist/twilight/{p-666611e5.entry.js → p-9c52e63b.entry.js} +1 -1
  275. package/dist/twilight/{p-63626e90.entry.js → p-9f003164.entry.js} +1 -1
  276. package/dist/twilight/p-BG-PTfCd.js +4 -0
  277. package/dist/twilight/{p-Bvu4BGoi.js → p-BG50tuBF.js} +1 -1
  278. package/dist/twilight/{p-BzPtXZ8b.js → p-BL8emH6B.js} +1 -1
  279. package/dist/twilight/{p-ChXaJaVQ.js → p-Bnff9Ut3.js} +1 -1
  280. package/dist/twilight/{p-BcbKK1Xp.js → p-C-3GuKNW.js} +1 -1
  281. package/dist/twilight/{p-CSKE9PmZ.js → p-C4k3wAWB.js} +1 -1
  282. package/dist/twilight/{p-Jx-87Pvn.js → p-Ce51TrKH.js} +1 -1
  283. package/dist/twilight/{p-DArQ56Y5.js → p-Cve96fFs.js} +1 -1
  284. package/dist/twilight/p-DJPd6DKq.js +5 -0
  285. package/dist/twilight/{p-_Jg561eU.js → p-DXqzsbXl.js} +1 -1
  286. package/dist/twilight/{p-9eed2e81.entry.js → p-a20d0254.entry.js} +1 -1
  287. package/dist/twilight/{p-00ac20ac.entry.js → p-a92549f6.entry.js} +1 -1
  288. package/dist/twilight/{p-BbzxbdV_.js → p-aMw12tPb.js} +1 -1
  289. package/dist/twilight/{p-931481f2.entry.js → p-adb4eed7.entry.js} +1 -1
  290. package/dist/twilight/{p-5f10dcbb.entry.js → p-af769e0a.entry.js} +1 -1
  291. package/dist/twilight/{p-25d87b51.entry.js → p-b94fe237.entry.js} +1 -1
  292. package/dist/twilight/{p-348e706d.entry.js → p-bff68f44.entry.js} +1 -1
  293. package/dist/twilight/{p-3607b38e.entry.js → p-c06f0822.entry.js} +1 -1
  294. package/dist/twilight/{p-29fd2c2e.entry.js → p-c1aa61bc.entry.js} +1 -1
  295. package/dist/twilight/{p-d0e713bf.entry.js → p-c2284ac3.entry.js} +1 -1
  296. package/dist/twilight/{p-3161b8ae.entry.js → p-c31600a9.entry.js} +1 -1
  297. package/dist/twilight/{p-1e71fea1.entry.js → p-c88eb0de.entry.js} +1 -1
  298. package/dist/twilight/{p-e8d76141.entry.js → p-ca0fa22b.entry.js} +1 -1
  299. package/dist/twilight/{p-073299af.entry.js → p-cbb75c0b.entry.js} +1 -1
  300. package/dist/twilight/{p-a4f5a886.entry.js → p-cf17ece0.entry.js} +1 -1
  301. package/dist/twilight/{p-f36bc567.entry.js → p-d21bdb22.entry.js} +1 -1
  302. package/dist/twilight/{p-05509b03.entry.js → p-d886da88.entry.js} +1 -1
  303. package/dist/twilight/{p-0f1c9e60.entry.js → p-da010601.entry.js} +1 -1
  304. package/dist/twilight/{p-340dd50d.entry.js → p-dac3e978.entry.js} +1 -1
  305. package/dist/twilight/{p-a8551a6e.entry.js → p-dafb763f.entry.js} +1 -1
  306. package/dist/twilight/{p-3fde1a58.entry.js → p-e056c218.entry.js} +1 -1
  307. package/dist/twilight/{p-cdbf3ed7.entry.js → p-e492ab39.entry.js} +1 -1
  308. package/dist/twilight/{p-4804edb7.entry.js → p-e625c6a1.entry.js} +1 -1
  309. package/dist/twilight/{p-f93423c4.entry.js → p-f13b397a.entry.js} +1 -1
  310. package/dist/twilight/{p-b4079e50.entry.js → p-f60e5ac2.entry.js} +1 -1
  311. package/dist/twilight/{p-c07e239e.entry.js → p-f8ccc247.entry.js} +1 -1
  312. package/dist/twilight/{p-9df9f164.entry.js → p-f8eb9db2.entry.js} +1 -1
  313. package/dist/twilight/{p-32c59462.entry.js → p-fe9451ac.entry.js} +1 -1
  314. package/dist/twilight/{p-jKgGFpyH.js → p-tC9eMgA8.js} +1 -1
  315. package/dist/twilight/twilight.esm.js +1 -1
  316. package/dist/types/Helpers/Helper.d.ts +1 -0
  317. package/dist/types/components/salla-products-list/salla-products-list.d.ts +4 -0
  318. package/dist/types/components/salla-products-slider/salla-products-slider.d.ts +4 -0
  319. package/package.json +5 -5
  320. package/dist/twilight/p-CPL9CY3o.js +0 -5
  321. package/dist/twilight/p-Da1jq8Qo.js +0 -4
  322. package/dist/twilight/p-c37d3334.entry.js +0 -4
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{f as t}from"./p-CPL9CY3o.js";function r(r,s={}){return s=Object.assign({initialData:void 0,initialStatus:"idle"},s),(i,o)=>{const e=Object.assign((function(...s){const i=r=>{Object.assign(this[o],r),t(this)};return i({status:"pending",error:void 0}),r.call(this,...s).then((t=>(i({status:"success",data:t,error:void 0}),t)),(t=>(i({status:"error",error:t}),Promise.reject(t))))}),{status:s.initialStatus,data:s.initialData,error:void 0});Object.defineProperty(i,o,{value:e})}}export{r as T}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,c as s,h as i,H as e,a as r}from"./p-CPL9CY3o.js";import{a as o}from"./p-CgtvEd63.js";import{S as a}from"./p-DiKTtDW5.js";import{H as l}from"./p-BcbKK1Xp.js";const n=class{constructor(i){t(this,i),this.productsFetched=s(this,"productsFetched"),this.selectionChanged=s(this,"selectionChanged"),this.autoload=!1,this.productCardComponent="custom-salla-product-card",this.selectable=!1,this.page=1,this.placeholderText=salla.lang.get("pages.categories.no_products"),this.endOfText=salla.lang.get("common.elements.end_of_content"),this.failedLoadMore=salla.lang.get("common.elements.failed_to_load_more"),this.currentPage=salla.config.get("page"),this.filtersSnapshot=[],this.selectedProducts=new Map,this.lastViewedProductKey="lastViewedProductId",this.filtersKey="filters",this.infiniteScrollStateKey="infiniteScrollState",this.prevCategoryIdKey="prevCategoryId",this.isProcessing=!1,this.scrollTimeout=null,this.boundScrollToLastViewedProduct=()=>this.scrollToLastViewedProduct(),this.boundHandleScroll=()=>this.handleScroll(),this.specialPagesWithoutIds={"product.index.latest":"latest","product.index.offers":"offers","product.index.search":"search","product.index.sales":"sales"},this.onWishlistItemRemoved=(t,s)=>{if("wishlist"!==this.getSource()||!this.wrapper)return;const i=String(s),e=this.hasCustomComponent?this.productCardComponent:"salla-product-card";for(const t of Array.from(this.wrapper.children)){const s=t,r=t.querySelector(e),o=s.product?.id??r?.product?.id;if(null!=o&&String(o)===i){t.remove();break}}for(const t of Array.from(this.wrapper.children)){if(!t.classList.contains("s-products-list-selectable-item"))continue;const s=t;if(null!=s.product?.id&&String(s.product.id)===i&&!t.querySelector(e)){t.remove();break}}if(this.selectable){for(const t of Array.from(this.selectedProducts.keys()))String(t)===i&&this.selectedProducts.delete(t);this.emitSelection()}},this.includes=l.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),l.setIncludes(this.includes),salla.lang.onLoaded((()=>{this.placeholderText=salla.lang.get("pages.categories.no_products"),this.endOfText=salla.lang.get("common.elements.end_of_content"),this.failedLoadMore=salla.lang.get("common.elements.failed_to_load_more"),this.currentPage=salla.config.get("page")}))}connectedCallback(){"scrollRestoration"in history&&(history.scrollRestoration="manual"),window.addEventListener("DOMContentLoaded",this.boundScrollToLastViewedProduct),salla.event.on("salla-filters::changed",(t=>this.setFilters(t))),salla.event.on("wishlist::removed",this.onWishlistItemRemoved)}disconnectedCallback(){window.removeEventListener("DOMContentLoaded",this.boundScrollToLastViewedProduct),window.removeEventListener("scroll",this.boundHandleScroll),salla.event.off("wishlist::removed",this.onWishlistItemRemoved)}async setFilters(t){if(t&&JSON.stringify(t)!==JSON.stringify(this.parsedFilters))return window.scrollTo({top:0,behavior:"smooth"}),this.parsedFilters=JSON.parse(JSON.stringify(t)),"product.index"==this.currentPage?.slug&&this.parsedFilters&&this.parsedFilters.category_id&&(this.currentCategoryIdFilter=[this.parsedFilters.category_id]),this.reload()}async reload(){!this.autoload&&this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="none"),this.hasInfiniteScroll&&salla.infiniteScroll.destroy(this.infiniteScroll),await this.buildNextPageUrl(),this.wrapper.innerHTML="",this.hasInfiniteScroll?this.init():this.getInitialData(),this.showPlaceholder&&(this.showPlaceholder=!1,this.placeholderLoader=document.createElement("div"),this.placeholderLoader.classList.add("s-products-list-loading-wrapper"),this.placeholderLoader.style.display="inherit",this.placeholderLoader.innerHTML='<span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"></span>',this.host.insertAdjacentElement("afterend",this.placeholderLoader))}isFilterable(){return salla.config.get("store.settings.product.filters")&&this.filtersResults}getCachedFilters(){return Array.isArray(this.filtersSnapshot)&&this.filtersSnapshot.length?JSON.parse(JSON.stringify(this.filtersSnapshot)):null}emitFilters(t){if(!this.isFilterable())return;if(t.filters)return this.filtersResults=!0,this.filtersSnapshot=JSON.parse(JSON.stringify(t.filters)),void salla.event.emit("filters::fetched",{filters:t.filters});const s=t.cursor?.current>1?this.getCachedFilters():null;if(s)return this.filtersResults=!0,void salla.event.emit("filters::fetched",{filters:s});this.filtersSnapshot=[],salla.event.emit("filters::hidden")}isSourceWithoutValue(){const t=this.getSource();if("wishlist"===t){const t=new URLSearchParams(window.location.search);return!(t.has("source_value")||t.has("source_value[]")||this.sourceValue)}return["offers","latest","sales","top-rated","reorder"].includes(t)}animateItems(){o({targets:"salla-products-list salla-product-card",opacity:[0,1],duration:1200,translateY:[20,0],delay:function(t,s){return 100*s}})}async initBaseNextPageUrl(t){this.nextPage=salla.url.api(`products?source=${t}`),this.includes?.length&&(this.nextPage+=`&includes[]=${this.includes.join("&includes[]=")}`),this.limit&&(this.nextPage+=`&per_page=${this.limit>32?32:this.limit}`),this.sortBy&&(this.nextPage+=`&sort=${this.sortBy}`),"preview"===salla.config.get("theme.mode")&&(this.nextPage+="&use_username_url=1"),this.nextPage+="&filterable=1";for(const[t,s]of Object.entries(this.parsedFilters||{}))if("source_value"!==t&&"source_value[]"!==t)if(["string","number"].includes(typeof s))this.nextPage+=`&filters[${encodeURIComponent(t)}]=${encodeURIComponent(s)}`;else if(Array.isArray(s))s.forEach((s=>this.nextPage+=`&filters[${encodeURIComponent(t)}][]=${encodeURIComponent(s)}`));else if("object"==typeof s)for(const[i,e]of Object.entries(s))this.nextPage+=`&filters[${encodeURIComponent(t)}][${encodeURIComponent(i)}]=${encodeURIComponent(e)}`;this.nextPage=await this.applyBeforeBuildListUrl(this.nextPage)}async buildNextPageUrl(){let t=this.getSource();if("json"===t)return;const s=sessionStorage.getItem(this.infiniteScrollStateKey);if(s){const{nextPage:t}=JSON.parse(s);if(!t)return}if(await this.initBaseNextPageUrl(t),!this.isSourceWithoutValue())if(["search","related","landing-page"].includes(t))this.nextPage+=`&source_value=${this.getSourceValue()}`;else try{this.nextPage+=`&source_value[]=${this.getSourceValue().join("&source_value[]=")}`}catch(s){salla.logger.warn(`source-value prop should be array of ids ex source-value="[1,2,3]" for the source [${t}]`),this.sourceValueIsValid=!1}}loading(t=!0,s=!1){if(t){let t=s&&!this.autoload?this.btnLoader:this.loader;t&&(t.style.display="inherit")}else this.autoload||this.btnLoader&&(this.btnLoader.style.display="none"),this.loader&&(this.loader.style.display="none")}getItemHTML(t){"landing-page"===this.getSource()&&(t.url="");const s=document.createElement(this.hasCustomComponent?this.productCardComponent:"salla-product-card");return s.product=t,this.compactCards&&(s.compact=!0,s.toggleAttribute("compact",!0)),this.applyLandingPageStyles(s),this.applyHorizontalCardStyles(s),s.addEventListener("click",(s=>{s.target.closest("a")&&(l.saveProductSource(this.getSource()),this.hasInfiniteScroll&&(this.takeStateSnapshot(),sessionStorage.setItem(this.lastViewedProductKey,t.id)))})),this.selectable?this.wrapSelectableItem(s,t):s}wrapSelectableItem(t,s){const i=document.createElement("div");i.className="s-products-list-selectable-item",i.product=s;const e=this.selectedProducts.has(s.id);e&&i.classList.add("s-products-list-item-selected");const r=document.createElement("label");r.className="s-products-list-select-control",r.setAttribute("aria-label",salla.lang.get("common.elements.select","تحديد"));const o=document.createElement("input");return o.type="checkbox",o.className="s-products-list-select-checkbox",o.checked=e,o.addEventListener("change",(()=>this.toggleSelection(s,i,o.checked))),r.appendChild(o),i.appendChild(r),i.appendChild(t),i}toggleSelection(t,s,i){i?(this.selectedProducts.set(t.id,t),s?.classList.add("s-products-list-item-selected")):(this.selectedProducts.delete(t.id),s?.classList.remove("s-products-list-item-selected")),this.emitSelection()}emitSelection(){const t=Array.from(this.selectedProducts.values()),s=Array.from(this.selectedProducts.keys()),i={ids:s,products:t,count:s.length};this.selectionChanged.emit(i),salla.event.emit("salla-products-list::selection.changed",i)}onSelectableChanged(t,s){t!==s&&this.isReady&&this.wrapper&&(t||(this.selectedProducts.clear(),this.emitSelection()),this.reload())}applyLandingPageStyles(t){"landing-page"!==this.getSource()||this.hasCustomComponent||(t.toggleAttribute("hide-add-btn",!0),t.classList.add("s-product-card-fit-height"))}applyHorizontalCardStyles(t){this.horizontalCards&&(t.toggleAttribute("horizontal",!0),this.hasCustomComponent||t.toggleAttribute("shadow-on-hover",!0))}waitForResizing(t){let s=null;return new Promise((i=>{const e=new ResizeObserver((()=>{clearTimeout(s),s=setTimeout((()=>{e.disconnect(),i(null)}),160)}));e.observe(t)}))}waitForLayoutStable(t){let s=null;return new Promise((i=>{const e=new MutationObserver((()=>{clearTimeout(s),s=setTimeout((()=>{e.disconnect(),i(null)}),160)}));e.observe(t,{childList:!0,subtree:!0,attributes:!0})}))}async waitForStableLayout(t){return await Promise.allSettled([this.waitForResizing(t),this.waitForLayoutStable(t)])}scrollToLastViewedProduct(){const t=sessionStorage.getItem(this.lastViewedProductKey);t&&!salla.url.is_page("product.single")&&this.isElementLoaded(`[id*="${t}"]`).then((()=>{const s=this.wrapper?.querySelector(`[id*="${t}"]`);if(!s)return;const i=()=>{const t=()=>{s.scrollIntoView({block:"start",behavior:"instant"});const t=matchMedia("(max-width: 1024px)").matches?"header .inner":"ul.main-menu",i=window?.header_is_sticky?document.querySelector(t)?.getBoundingClientRect()?.height??56:0,e=parseInt(getComputedStyle(this.wrapper).rowGap)??16;scrollBy({top:-1*(i+e),behavior:"instant"})};requestAnimationFrame(t),s.querySelectorAll("img.lazy").forEach((s=>{const i=s,e=()=>{requestAnimationFrame(t),i.onload=i.onerror=null};i.onload=e,i.onerror=e})),this.removeScrollRestorationSession()};this.waitForStableLayout(this.host).then((()=>requestAnimationFrame(i)))}))}isElementLoaded(t){return new Promise((s=>{const i=setInterval((()=>{if(document.querySelector(t))return clearInterval(i),s(document.querySelector(t))}),50)}))}takeStateSnapshot(){const t=[];for(let s=0;s<this.wrapper.children.length;s++){const i=this.wrapper.children?.[s];t.push(i.product)}const s={pageIndex:Math.max((this.infiniteScroll?.pageIndex??1)-1,1),nextPage:this.nextPage,currentPageData:t};if(this.isFilterable()){const t=sessionStorage.getItem(this.filtersKey);sessionStorage.setItem(this.filtersKey,t||JSON.stringify(this.filtersSnapshot))}sessionStorage.setItem(this.infiniteScrollStateKey,JSON.stringify(s));let i=salla.config.get("page.id");const e=Object.keys(this.specialPagesWithoutIds).find((t=>salla.url.is_page(t)));e?i=this.specialPagesWithoutIds[e]:null!==i&&(i=String(i)),sessionStorage.setItem(this.prevCategoryIdKey,i)}removeScrollRestorationSession(){this.isFilterable()||sessionStorage.removeItem(this.filtersKey),sessionStorage.removeItem(this.infiniteScrollStateKey),sessionStorage.removeItem(this.lastViewedProductKey),sessionStorage.removeItem(this.prevCategoryIdKey)}loadStoredScrollState(){const t=sessionStorage.getItem(this.infiniteScrollStateKey),s=sessionStorage.getItem(this.filtersKey),i=sessionStorage.getItem(this.prevCategoryIdKey),e=this.specialPagesWithoutIds[salla.config.get("page.slug")]||null,r=salla.config.get("page.id"),o=salla.url.is_page("index"),a=salla.url.is_page("product.single"),l=e?i!==e:i!==String(r);if(i&&l&&!o&&!a||o&&!this.hasInfiniteScroll)return this.removeScrollRestorationSession(),this.switchToNormalBehavior=!0,!1;if(a)return this.switchToNormalBehavior=!0,!1;if(t)try{const{pageIndex:i,nextPage:e,currentPageData:r}=JSON.parse(t);if(s&&"undefined"!==s){const t=JSON.parse(s);this.filtersSnapshot=JSON.parse(JSON.stringify(t)),salla.event.emit("filters::fetched",{filters:t})}this.page=i,this.nextPage=e;for(let t=0;t<r.length;t++)this.wrapper.append(this.getItemHTML(r?.[t]));return!0}catch(t){console.error("Failed to load stored scroll state:",t),this.removeScrollRestorationSession()}return!1}getSource(){return l.getProductsSource(this.source)}isAuxiliaryProductsListSource(){return["json","selected","related","landing-page","recently"].includes(this.getSource())}getSourceValue(){if("wishlist"===this.getSource()){const t=new URLSearchParams(window.location.search),s=t.getAll("source_value[]").length?t.getAll("source_value[]"):t.getAll("source_value");if(s.length)return s}return this.currentCategoryIdFilter?this.currentCategoryIdFilter:l.getProductsSourceValue(this.source,this.sourceValue)}logFetchError(t,s,i,e,r){try{const o=r&&"object"==typeof r?r:null,a=this.getSourceValue();salla.analytics?.log("salla::products.list.fetch.error",{errorPhase:t,source:this.getSource(),sourceValue:"string"==typeof a&&a.length>200?`${a.slice(0,200)}…`:Array.isArray(a)?{length:a.length}:a,pageIndex:this.infiniteScroll?.pageIndex,fetchPath:i,httpStatus:e?.status,httpStatusText:e?.statusText,responseUrl:e?.url,...o&&{dataCount:Array.isArray(o.data)?o.data.length:void 0,responseKeys:Object.keys(o).slice(0,15),filtersCount:Array.isArray(o.filters)?o.filters.length:void 0},errorMessage:s instanceof Error?s.message:String(s),..."processing"===t&&s instanceof Error&&s.stack?{errorStack:s.stack.slice(0,500)}:{}})}catch{}}appendDataLayer(t){"object"==typeof dataLayer&&Array.isArray(dataLayer)&&dataLayer.push({event:"impressions",ecommerce:{currencyCode:salla.config.currency().code,impressions:t.map(((t,s)=>({id:t.id,name:t.name,price:t.price,brand:t.brand?.name||"",quantity:t.quantity,categories:[{name:t.category?.name||salla.config.get("page.title"),id:salla.config.get("page.id")}],category:t.category?.name||salla.config.get("page.title"),position:s+1})))}})}initiateInfiniteScroll(){if(!this.hasInfiniteScroll)return;const t=this.autoload&&this.includes&&this.includes.length>0;this.infiniteScroll=salla.infiniteScroll.initiate(this.wrapper,this.wrapper,{path:()=>this.nextPage,history:!1,nextPage:this.nextPage,scrollThreshold:!t&&!!this.autoload&&100,loadOnScroll:!t&&this.autoload},!0),this.infiniteScroll.pageIndex=this.page,this.infiniteScroll?.on("request",(()=>{this.loading(!0,!this.autoload)})),t&&window.addEventListener("scroll",this.boundHandleScroll),this.infiniteScroll?.on("load",(async(t,s,i)=>{if(!this.isProcessing){this.isProcessing=!0;try{if(!t.data?.length&&2===this.infiniteScroll.pageIndex)return this.showPlaceholder=!0,salla.infiniteScroll.destroy(this.infiniteScroll),this.loading(!1),void(this.placeholderLoader&&this.placeholderLoader.remove());this.includes&&await this.injectAndProcessData(t);const s=await this.handleResponse(t);this.infiniteScroll.appendItems(s),2===this.infiniteScroll.pageIndex&&(!this.autoload&&this.nextPage&&(this.loadMoreWrapper.style.display="block"),this.animateItems())}catch(e){console.error("Error during load:",e),this.logFetchError("processing",e,"string"==typeof s?s:void 0,i,t)}finally{this.isProcessing=!1}}})),this.infiniteScroll?.on("error",((t,s,i)=>{const e=i;this.status.querySelector(".s-infinite-scroll-error").classList.remove("s-hidden"),this.placeholderLoader&&this.placeholderLoader.remove(),this.loading(!1),this.isProcessing=!1,this.logFetchError("fetch",t,s,e)})),salla.onReady((()=>{sessionStorage.getItem(this.infiniteScrollStateKey)||this.manualLoadNextPage()}))}handleScroll(){this.isProcessing||this.scrollTimeout||(this.scrollTimeout=setTimeout((()=>{this.scrollTimeout=null,requestAnimationFrame((()=>{const t=this.wrapper.getBoundingClientRect(),s=window.innerHeight;t.bottom-s<=200&&!this.isProcessing&&this.nextPage&&this.manualLoadNextPage()}))}),200))}manualLoadNextPage(){this.nextPage&&this.infiniteScroll.loadNextPage()}async applyBeforeBuildListUrl(t){try{const s={component:this,url:t};return await salla.hooks.call("salla-products-list","beforeBuildListUrl",s),s.url}catch(s){return salla.logger.warn("beforeBuildListUrl hook failed",s?.message),t}}async resolveNextPageFromCursor(t){return t.cursor?t.cursor.next?await this.applyBeforeBuildListUrl(t.cursor.next):t.cursor.next:this.nextPage}async injectAndProcessData(t){try{await l.injectExtraFieldsToResponse(t)}catch(t){console.error("Error injecting data:",t)}}getInitialData(){return this.loading(),salla.api.withoutNotifier((()=>salla.product.api.fetch({source:l.getApiSource(this.getSource()),source_value:this.getSourceValue(),limit:this.limit}).then((async t=>t.data.length?(await l.injectExtraFieldsToResponse(t),this.firstPageResponse?void(await this.handleResponse(t)).forEach((t=>this.wrapper.append(t))):(this.firstPageResponse=t,void(this.nextPage=await this.resolveNextPageFromCursor(t)))):(this.showPlaceholder=!0,this.placeholderLoader&&this.placeholderLoader.remove(),void this.loading(!1))))))}async loadMore(){this.infiniteScroll?.loadNextPage()}async getSelected(){return{ids:Array.from(this.selectedProducts.keys()),products:Array.from(this.selectedProducts.values())}}async getLoadedProducts(){const t=[];if(!this.wrapper)return t;for(let s=0;s<this.wrapper.children.length;s++){const i=this.wrapper.children[s];i?.product&&t.push(i.product)}return t}async selectAll(){if(this.selectable&&this.wrapper){for(let t=0;t<this.wrapper.children.length;t++){const s=this.wrapper.children[t];if(s?.product){this.selectedProducts.set(s.product.id,s.product),s.classList.add("s-products-list-item-selected");const t=s.querySelector(".s-products-list-select-checkbox");t&&(t.checked=!0)}}this.emitSelection()}}async clearSelection(){this.selectedProducts.clear(),this.wrapper&&(this.wrapper.querySelectorAll(".s-products-list-select-checkbox").forEach((t=>t.checked=!1)),this.wrapper.querySelectorAll(".s-products-list-item-selected").forEach((t=>t.classList.remove("s-products-list-item-selected")))),this.emitSelection()}componentWillLoad(){return salla.onReady().then((async()=>{this.hasCustomComponent=!!customElements.get(this.productCardComponent),this.sourceValueIsValid=!(!this.getSourceValue()&&!this.isSourceWithoutValue()),this.hasInfiniteScroll=!this.isAuxiliaryProductsListSource()&&!this.limit;let t=new URLSearchParams(window.location.search);try{this.sortBy=this.sortBy||t.get("sort")||t.get("by"),this.parsedFilters=l.extractFiltersFromUrl(t),this.parsedFilters&&this.parsedFilters.category_id&&(this.currentCategoryIdFilter=[this.parsedFilters.category_id])}catch(t){salla.logger.warn("failed to get filters from url",t.message)}if(await this.buildNextPageUrl(),this.isReady=!0,!sessionStorage.getItem(this.infiniteScrollStateKey))if(this.sourceValueIsValid){if(!this.hasInfiniteScroll){if("json"===this.getSource())return this.getSourceValue().length?void setTimeout((()=>{this.getSourceValue().map((t=>this.wrapper.append(this.getItemHTML(t))))})):void(this.showPlaceholder=!0);if("selected"!==this.getSource()||this.getSourceValue().length)return this.getInitialData();this.showPlaceholder=!0}}else salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`)}))}async componentDidLoad(){this.hasInfiniteScroll&&this.init(),await Salla.hooks.registerComponent("salla-products-list",this),this.loadStoredScrollState()?(this.autoload?!this.nextPage&&this.loading(!1):this.nextPage?this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="block"):(this.loadMoreWrapper&&(this.loadMoreWrapper.style.display="none"),this.status.querySelector(".s-infinite-scroll-last").classList.remove("s-hidden")),this.scrollToLastViewedProduct()):!this.firstPageResponse&&this.switchToNormalBehavior?this.getInitialData().then((async()=>{this.firstPageResponse?((await this.handleResponse(this.firstPageResponse,!1)).forEach((t=>{this.wrapper.append(t)})),setTimeout((()=>{if(!this.autoload&&this.nextPage&&1==this.infiniteScroll.pageIndex){const t=this.host.querySelector(".s-infinite-scroll-wrapper");t&&(t.style.display="block")}}))):console.error("No response received after getInitialData.")})).catch((t=>{console.error("Error during initial data fetch:",t)})):this.firstPageResponse&&(await this.handleResponse(this.firstPageResponse,!1)).forEach((t=>this.wrapper.append(t)))}canRender(){return this.sourceValueIsValid&&this.isReady}render(){return this.canRender()?this.showPlaceholder?i("div",{class:"s-products-list-placeholder"},i("span",{innerHTML:a}),i("p",null,this.placeholderText)):i(e,{class:"s-products-list"},i("div",{class:{"s-products-list-wrapper":!0,"s-products-list-horizontal-cards":this.horizontalCards&&!this.filtersResults,"s-products-list-vertical-cards":!this.horizontalCards&&!this.rowCards&&!this.filtersResults,"s-products-list-row-cards":this.rowCards,"s-products-list-compact-cards":this.compactCards,"s-products-list-filters-results":this.filtersResults},ref:t=>this.wrapper=t}),i("div",{class:"s-infinite-scroll-status",ref:t=>this.status=t},i("p",{class:"s-infinite-scroll-last infinite-scroll-last s-hidden"},this.endOfText),i("p",{class:"s-infinite-scroll-error infinite-scroll-error s-hidden"},this.failedLoadMore)),this.autoload&&i("div",{class:"s-products-list-loading-wrapper",style:{display:"none"},ref:t=>this.loader=t},i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"})),this.hasInfiniteScroll&&this.nextPage&&!this.autoload?i("div",{class:"s-infinite-scroll-wrapper",style:{display:"none"},ref:t=>this.loadMoreWrapper=t},i("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},i("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),i("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader",ref:t=>this.btnLoader=t,style:{display:"none"}}))):""):""}init(){this.initiateInfiniteScroll(),this.loading()}async handleResponse(t,s=!0){if(!t)return[];let i=this.getSource();if(1===t.cursor?.current){if(!this.isAuxiliaryProductsListSource()){let s=l.getPageTitleForSource(i);try{if("search"===this.getSource())s=salla.lang.get("common.elements.search_about",{word:this.getSourceValue()});else if(!s){let i=this.parsedFilters.category_id||this.getSourceValue()[0];s=t.filters?.find((t=>"category_id"===t.key))?.values?.find((t=>t.key===i))?.value??""}s+=(s?" - ":"")+salla.lang.choice("blocks.header.products_count",t.data?.length),15===t.data.length&&(s=s.replace(t.data.length,salla.lang.get("common.elements.more_than")+" "+t.data.length)),t.title=s}catch(t){salla.logger.error("Error::falid to handle response",t)}}l.generateProductSchema(t.data)}this.appendDataLayer(t.data),t.nextPage=this.nextPage,t.source=this.getSource(),t.sourceValue=this.getSourceValue(),salla.event.emit("salla-products-list::products.fetched",t),this.productsFetched.emit(t),this.emitFilters(t),s&&(this.nextPage=await this.resolveNextPageFromCursor(t)),this.loading(!1),this.placeholderLoader&&this.placeholderLoader.remove(),this.hasInfiniteScroll&&!this.nextPage&&(this.infiniteScroll.option({scrollThreshold:!1,loadOnScroll:!1}),this.status.querySelector(".s-infinite-scroll-last").classList.remove("s-hidden"));const e=[];for(let s=0;s<t.data.length;s++)e.push(this.getItemHTML(t.data?.[s]));return e}get host(){return r(this)}static get watchers(){return{selectable:["onSelectableChanged"]}}};n.style='.s-products-list-selectable-item{position:relative;border-radius:0.5rem;transition:box-shadow 0.15s ease-in-out}.s-products-list-item-selected{box-shadow:0 0 0 2px var(--color-primary)}.s-products-list-select-control{position:absolute;top:10px;inset-inline-start:10px;z-index:5;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.s-products-list-select-checkbox{appearance:none;-webkit-appearance:none;-moz-appearance:none;position:relative;width:22px;height:22px;margin:0;cursor:pointer;color:var(--color-primary);border:1px solid rgba(0, 0, 0, 0.15);border-radius:6px;background-color:#fff;box-shadow:0 1px 3px rgba(0, 0, 0, 0.2);transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out}.s-products-list-select-checkbox:hover{border-color:var(--color-primary)}.s-products-list-select-checkbox:focus,.s-products-list-select-checkbox:focus-visible{outline:none;border-color:var(--color-primary);box-shadow:0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 3px color-mix(in srgb, var(--color-primary) 30%, transparent)}.s-products-list-select-checkbox:checked,.s-products-list-select-checkbox:checked:hover,.s-products-list-select-checkbox:checked:focus{background-color:var(--color-primary);border-color:var(--color-primary)}.s-products-list-select-checkbox:checked::after{content:"";position:absolute;top:50%;left:50%;width:5px;height:10px;border:solid #fff;border-width:0 2px 2px 0;transform:translate(-50%, -60%) rotate(45deg)}.s-products-list-row-cards .s-products-list-select-control{top:50%;inset-inline-start:14px;transform:translateY(-50%)}.s-products-list-row-cards .s-products-list-selectable-item>:not(.s-products-list-select-control){padding-inline-start:2.75rem}';export{n as salla_products_list}