@salla.sa/twilight-components 2.14.545 → 2.14.547

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 (350) hide show
  1. package/dist/cjs/{filepond-B5aWlI3l.js → filepond-DFvIrFhD.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-BYq39KHd.js → filepond-plugin-file-poster-CHg39XJj.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-Bi3TAsJv.js → filepond-plugin-file-validate-size-kGmw5h8R.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-Ck6S5TuZ.js → filepond-plugin-file-validate-type-CQSi2A-P.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-DbsdnH5j.js → filepond-plugin-image-edit-M4teY-We.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-x7TfJR-2.js → filepond-plugin-image-exif-orientation-gBQo0ofe.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CrU7vIRk.js → filepond-plugin-image-preview-DTmK0D_I.js} +1 -1
  8. package/dist/cjs/{index-DGpOR-TH.js → index-kkUUTdZu.js} +14 -14
  9. package/dist/cjs/{intlTelInput-DKAXRecW.js → intlTelInput-CVOJSgbc.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/{mail-C9D8MHae.js → mail-CO8cFZH7.js} +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +12 -5
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  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-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  28. package/dist/cjs/{salla-comment-form_8.cjs.entry.js → salla-comment-form_9.cjs.entry.js} +264 -4
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gifting.cjs.entry.js +7 -4
  40. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  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 +1 -1
  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 +1 -1
  82. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +208 -103
  85. package/dist/cjs/salla-rating-modal.cjs.entry.js +23 -8
  86. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-social-share.cjs.entry.js +4 -4
  93. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  102. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  104. package/dist/cjs/twilight.cjs.js +2 -2
  105. package/dist/cjs/{vanilla-picker-DQDSSf6Q.js → vanilla-picker-itKa_-k9.js} +1 -1
  106. package/dist/collection/collection-manifest.json +14 -12
  107. package/dist/collection/components/salla-comments/interfaces.js +12 -0
  108. package/dist/collection/components/salla-comments/salla-comment-item.js +1 -1
  109. package/dist/collection/components/salla-comments/salla-comments.js +42 -5
  110. package/dist/collection/components/salla-gifting/salla-gifting.js +6 -3
  111. package/dist/collection/components/salla-modal/salla-modal.css +11 -0
  112. package/dist/collection/components/salla-modal/salla-modal.js +33 -6
  113. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +253 -104
  114. package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +34 -21
  115. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +69 -10
  116. package/dist/collection/components/salla-rating-stars/salla-rating-stars.css +5 -0
  117. package/dist/collection/components/salla-verified-review/salla-verified-review.css +162 -0
  118. package/dist/collection/components/salla-verified-review/salla-verified-review.js +264 -0
  119. package/dist/components/index.js +2 -2
  120. package/dist/components/salla-comment-item2.js +1 -1
  121. package/dist/components/salla-comments.js +44 -1
  122. package/dist/components/salla-gifting.js +6 -3
  123. package/dist/components/salla-modal2.js +12 -4
  124. package/dist/components/salla-rating-modal-v22.js +208 -101
  125. package/dist/components/salla-rating-modal.js +1 -591
  126. package/dist/components/salla-rating-modal2.js +613 -0
  127. package/dist/components/salla-rating-stars2.js +1 -1
  128. package/dist/components/salla-verified-review.d.ts +11 -0
  129. package/dist/components/salla-verified-review.js +325 -0
  130. package/dist/esm/{filepond-wd7_MQSV.js → filepond-VE8WYfjh.js} +1 -1
  131. package/dist/esm/{filepond-plugin-file-poster-CkWxCmZT.js → filepond-plugin-file-poster-B5RS-KUm.js} +1 -1
  132. package/dist/esm/{filepond-plugin-file-validate-size-DlWS-oUK.js → filepond-plugin-file-validate-size-BdgcVHpq.js} +1 -1
  133. package/dist/esm/{filepond-plugin-file-validate-type-mdpFM1TG.js → filepond-plugin-file-validate-type-CmH44b6j.js} +1 -1
  134. package/dist/esm/{filepond-plugin-image-edit-BqPLKgZU.js → filepond-plugin-image-edit-B-XPDjr0.js} +1 -1
  135. package/dist/esm/{filepond-plugin-image-exif-orientation-CMqFjPu7.js → filepond-plugin-image-exif-orientation-ENeGT6qs.js} +1 -1
  136. package/dist/esm/{filepond-plugin-image-preview-DjCwk-CI.js → filepond-plugin-image-preview-D9RKj5A_.js} +1 -1
  137. package/dist/esm/{index-CHZfg_a9.js → index-RGVg6FYq.js} +14 -14
  138. package/dist/esm/{intlTelInput-B5Q8rrU9.js → intlTelInput-ClLDqBrH.js} +1 -1
  139. package/dist/esm/loader.js +3 -3
  140. package/dist/esm/{mail-DzAIgzdz.js → mail-DmgxDvXL.js} +2 -2
  141. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  142. package/dist/esm/salla-accordion_6.entry.js +12 -5
  143. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  144. package/dist/esm/salla-advertisement.entry.js +1 -1
  145. package/dist/esm/salla-alert_2.entry.js +1 -1
  146. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  147. package/dist/esm/salla-apps-icons.entry.js +1 -1
  148. package/dist/esm/salla-attachment-view_9.entry.js +10 -10
  149. package/dist/esm/salla-badge.entry.js +1 -1
  150. package/dist/esm/salla-basket-gap.entry.js +1 -1
  151. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  152. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  153. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  154. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  155. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  156. package/dist/esm/salla-comment-factors.entry.js +1 -1
  157. package/dist/esm/{salla-comment-form_8.entry.js → salla-comment-form_9.entry.js} +264 -5
  158. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  159. package/dist/esm/salla-contacts.entry.js +3 -3
  160. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  161. package/dist/esm/salla-count-down.entry.js +1 -1
  162. package/dist/esm/salla-custom-fields.entry.js +1 -1
  163. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  164. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  165. package/dist/esm/salla-filters-widget.entry.js +1 -1
  166. package/dist/esm/salla-filters.entry.js +1 -1
  167. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  168. package/dist/esm/salla-gifting.entry.js +7 -4
  169. package/dist/esm/salla-hook.entry.js +1 -1
  170. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  171. package/dist/esm/salla-installment.entry.js +1 -1
  172. package/dist/esm/salla-list-tile.entry.js +1 -1
  173. package/dist/esm/salla-localization-modal.entry.js +1 -1
  174. package/dist/esm/salla-login-modal.entry.js +1 -1
  175. package/dist/esm/salla-loyalty-banner_10.entry.js +3 -3
  176. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  177. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  178. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  179. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  180. package/dist/esm/salla-loyalty.entry.js +1 -1
  181. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  182. package/dist/esm/salla-map_2.entry.js +1 -1
  183. package/dist/esm/salla-menu.entry.js +1 -1
  184. package/dist/esm/salla-metadata.entry.js +1 -1
  185. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  186. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  187. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  188. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  189. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  190. package/dist/esm/salla-offer-modal.entry.js +1 -1
  191. package/dist/esm/salla-offer.entry.js +1 -1
  192. package/dist/esm/salla-order-branch.entry.js +1 -1
  193. package/dist/esm/salla-order-cancel.entry.js +1 -1
  194. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  195. package/dist/esm/salla-order-details-options.entry.js +1 -1
  196. package/dist/esm/salla-order-details.entry.js +1 -1
  197. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  198. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  199. package/dist/esm/salla-order-edit.entry.js +1 -1
  200. package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
  201. package/dist/esm/salla-order-shipments.entry.js +1 -1
  202. package/dist/esm/salla-order-summary.entry.js +1 -1
  203. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  204. package/dist/esm/salla-orders.entry.js +1 -1
  205. package/dist/esm/salla-payments.entry.js +1 -1
  206. package/dist/esm/salla-placeholder.entry.js +1 -1
  207. package/dist/esm/salla-price-range.entry.js +1 -1
  208. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  209. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  210. package/dist/esm/salla-products-list.entry.js +1 -1
  211. package/dist/esm/salla-products-slider.entry.js +1 -1
  212. package/dist/esm/salla-quick-order.entry.js +3 -3
  213. package/dist/esm/salla-rating-modal-v2.entry.js +208 -103
  214. package/dist/esm/salla-rating-modal.entry.js +23 -8
  215. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  216. package/dist/esm/salla-review-order-item.entry.js +1 -1
  217. package/dist/esm/salla-scopes.entry.js +1 -1
  218. package/dist/esm/salla-search.entry.js +1 -1
  219. package/dist/esm/salla-skeleton.entry.js +1 -1
  220. package/dist/esm/salla-slider.entry.js +1 -1
  221. package/dist/esm/salla-social-share.entry.js +4 -4
  222. package/dist/esm/salla-social.entry.js +1 -1
  223. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  224. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  225. package/dist/esm/salla-tooltip.entry.js +1 -1
  226. package/dist/esm/salla-trust-badges.entry.js +1 -1
  227. package/dist/esm/salla-user-menu.entry.js +1 -1
  228. package/dist/esm/salla-user-profile.entry.js +1 -1
  229. package/dist/esm/salla-user-settings.entry.js +1 -1
  230. package/dist/esm/salla-verify.entry.js +3 -3
  231. package/dist/esm/salla-wallet.entry.js +1 -1
  232. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  233. package/dist/esm/twilight.js +3 -3
  234. package/dist/esm/{vanilla-picker-uNDULydX.js → vanilla-picker-DWGLcuLb.js} +1 -1
  235. package/dist/twilight/{p-f07bbbc7.entry.js → p-01dee064.entry.js} +1 -1
  236. package/dist/twilight/{p-72ee7071.entry.js → p-03de43a3.entry.js} +1 -1
  237. package/dist/twilight/{p-5d9a85b0.entry.js → p-067e7e32.entry.js} +1 -1
  238. package/dist/twilight/{p-c9146d50.entry.js → p-08fa1534.entry.js} +1 -1
  239. package/dist/twilight/{p-84380d4a.entry.js → p-0adea51c.entry.js} +1 -1
  240. package/dist/twilight/{p-8fc6e860.entry.js → p-15fea4e9.entry.js} +1 -1
  241. package/dist/twilight/{p-25d9f1b2.entry.js → p-1c40b212.entry.js} +1 -1
  242. package/dist/twilight/{p-63b01300.entry.js → p-1cef7ea2.entry.js} +1 -1
  243. package/dist/twilight/{p-346366ba.entry.js → p-1f7d964d.entry.js} +1 -1
  244. package/dist/twilight/{p-832f3a98.entry.js → p-25c61f91.entry.js} +1 -1
  245. package/dist/twilight/{p-12836275.entry.js → p-272857bd.entry.js} +1 -1
  246. package/dist/twilight/{p-6d961d73.entry.js → p-2ae585c9.entry.js} +1 -1
  247. package/dist/twilight/{p-766a3291.entry.js → p-2ba184be.entry.js} +1 -1
  248. package/dist/twilight/{p-788fd019.entry.js → p-2d2e29fe.entry.js} +1 -1
  249. package/dist/twilight/{p-8780a467.entry.js → p-3286bfc2.entry.js} +1 -1
  250. package/dist/twilight/{p-345532e5.entry.js → p-36359288.entry.js} +1 -1
  251. package/dist/twilight/{p-2d01a4f5.entry.js → p-3713dbff.entry.js} +1 -1
  252. package/dist/twilight/{p-dd823fde.entry.js → p-380b8531.entry.js} +1 -1
  253. package/dist/twilight/{p-391a2ec6.entry.js → p-3ffe6fa7.entry.js} +1 -1
  254. package/dist/twilight/{p-0495bfac.entry.js → p-44595831.entry.js} +1 -1
  255. package/dist/twilight/{p-0749cc55.entry.js → p-45734a3b.entry.js} +1 -1
  256. package/dist/twilight/{p-d0d3609c.entry.js → p-459ce78a.entry.js} +1 -1
  257. package/dist/twilight/{p-419499d6.entry.js → p-4663f4da.entry.js} +1 -1
  258. package/dist/twilight/{p-28248b6b.entry.js → p-4d12b009.entry.js} +1 -1
  259. package/dist/twilight/{p-74529abb.entry.js → p-4e904400.entry.js} +1 -1
  260. package/dist/twilight/{p-67b91397.entry.js → p-541bf8ef.entry.js} +1 -1
  261. package/dist/twilight/{p-32e3daa3.entry.js → p-57516065.entry.js} +1 -1
  262. package/dist/twilight/{p-5ded000f.entry.js → p-5819795e.entry.js} +1 -1
  263. package/dist/twilight/{p-51a062cd.entry.js → p-582d081e.entry.js} +1 -1
  264. package/dist/twilight/{p-c816b198.entry.js → p-5b6fd8b5.entry.js} +1 -1
  265. package/dist/twilight/p-61bc2e97.entry.js +4 -0
  266. package/dist/twilight/{p-93aa1b67.entry.js → p-6288de29.entry.js} +1 -1
  267. package/dist/twilight/{p-9d224252.entry.js → p-66ca510c.entry.js} +1 -1
  268. package/dist/twilight/{p-f1d8729d.entry.js → p-696cb80c.entry.js} +1 -1
  269. package/dist/twilight/{p-35557962.entry.js → p-6971174e.entry.js} +1 -1
  270. package/dist/twilight/{p-3672d4f7.entry.js → p-6cc61a70.entry.js} +1 -1
  271. package/dist/twilight/{p-90e5c3ab.entry.js → p-6ec304ac.entry.js} +1 -1
  272. package/dist/twilight/{p-c287e498.entry.js → p-70ef6b79.entry.js} +1 -1
  273. package/dist/twilight/{p-e36f62a9.entry.js → p-8f1e13c5.entry.js} +1 -1
  274. package/dist/twilight/{p-afb03ee5.entry.js → p-9340d397.entry.js} +1 -1
  275. package/dist/twilight/{p-b279e0bb.entry.js → p-93ac34c7.entry.js} +1 -1
  276. package/dist/twilight/{p-64efbb2c.entry.js → p-95519dae.entry.js} +1 -1
  277. package/dist/twilight/{p-235d7596.entry.js → p-97a7d4cf.entry.js} +1 -1
  278. package/dist/twilight/{p-1419a93d.entry.js → p-9a8a1b47.entry.js} +1 -1
  279. package/dist/twilight/{p-c948a8a8.entry.js → p-9b791c53.entry.js} +1 -1
  280. package/dist/twilight/{p-c603722c.entry.js → p-9fafcedd.entry.js} +1 -1
  281. package/dist/twilight/{p-PCp-0mbL.js → p-BFco-_Zl.js} +1 -1
  282. package/dist/twilight/{p-ryHWESoh.js → p-BVamrCNR.js} +1 -1
  283. package/dist/twilight/{p-DtV7npW9.js → p-B_QMCKVO.js} +1 -1
  284. package/dist/twilight/{p-BPkSO6gd.js → p-C8tT82U5.js} +1 -1
  285. package/dist/twilight/{p-CdgES2Of.js → p-CkrRlrjj.js} +1 -1
  286. package/dist/twilight/{p-D9VjvNQq.js → p-D42LpeIl.js} +2 -2
  287. package/dist/twilight/{p-BWvO3cE-.js → p-DT4oJGXj.js} +1 -1
  288. package/dist/twilight/{p-DzAIgzdz.js → p-DmgxDvXL.js} +1 -1
  289. package/dist/twilight/{p-DO7S0QBX.js → p-DqHR-XSp.js} +1 -1
  290. package/dist/twilight/{p-ZinKLSYw.js → p-DvDYmxRj.js} +1 -1
  291. package/dist/twilight/{p-CHZfg_a9.js → p-RGVg6FYq.js} +2 -2
  292. package/dist/twilight/{p-17d49c87.entry.js → p-a0543daf.entry.js} +1 -1
  293. package/dist/twilight/p-a32e7b62.entry.js +4 -0
  294. package/dist/twilight/{p-b33392c6.entry.js → p-a4e382fb.entry.js} +1 -1
  295. package/dist/twilight/{p-fb1ad954.entry.js → p-a56851b0.entry.js} +1 -1
  296. package/dist/twilight/{p-5933ba05.entry.js → p-a8af052d.entry.js} +1 -1
  297. package/dist/twilight/{p-88f50d7e.entry.js → p-a9476bc3.entry.js} +1 -1
  298. package/dist/twilight/p-acd88f45.entry.js +4 -0
  299. package/dist/twilight/{p-aa4daadf.entry.js → p-ad884517.entry.js} +1 -1
  300. package/dist/twilight/{p-06d9e1c5.entry.js → p-aea12a46.entry.js} +1 -1
  301. package/dist/twilight/{p-2db5e829.entry.js → p-af39795f.entry.js} +1 -1
  302. package/dist/twilight/{p-0573a498.entry.js → p-aff22960.entry.js} +1 -1
  303. package/dist/twilight/{p-c81bce54.entry.js → p-b02c4a37.entry.js} +1 -1
  304. package/dist/twilight/{p-2305edcc.entry.js → p-b164cb76.entry.js} +1 -1
  305. package/dist/twilight/p-b73e784e.entry.js +4 -0
  306. package/dist/twilight/{p-82fe9f82.entry.js → p-b9a8f977.entry.js} +1 -1
  307. package/dist/twilight/{p-72f54055.entry.js → p-bbc8f3dd.entry.js} +1 -1
  308. package/dist/twilight/{p-f168109d.entry.js → p-bc9585d0.entry.js} +1 -1
  309. package/dist/twilight/{p-87e10a68.entry.js → p-bef1df8a.entry.js} +1 -1
  310. package/dist/twilight/{p-b38c4e39.entry.js → p-c1be2f63.entry.js} +1 -1
  311. package/dist/twilight/{p-69119c00.entry.js → p-c353a96a.entry.js} +1 -1
  312. package/dist/twilight/{p-5074de7d.entry.js → p-c6859fd3.entry.js} +1 -1
  313. package/dist/twilight/{p-a785b49f.entry.js → p-c7abf516.entry.js} +1 -1
  314. package/dist/twilight/{p-1ea25389.entry.js → p-cdad8f41.entry.js} +1 -1
  315. package/dist/twilight/{p-25f51a7e.entry.js → p-cf488159.entry.js} +1 -1
  316. package/dist/twilight/{p-37163aef.entry.js → p-d02688da.entry.js} +1 -1
  317. package/dist/twilight/{p-c26043ff.entry.js → p-d03e6073.entry.js} +1 -1
  318. package/dist/twilight/{p-f1dfe18b.entry.js → p-d2c1f52b.entry.js} +1 -1
  319. package/dist/twilight/{p-54e2d320.entry.js → p-d40958e4.entry.js} +1 -1
  320. package/dist/twilight/{p-ec281904.entry.js → p-d46ef139.entry.js} +1 -1
  321. package/dist/twilight/{p-2de58591.entry.js → p-d67b4059.entry.js} +1 -1
  322. package/dist/twilight/{p-c92edd6f.entry.js → p-d6ea5ca7.entry.js} +1 -1
  323. package/dist/twilight/{p-2d62c947.entry.js → p-d835a5dd.entry.js} +1 -1
  324. package/dist/twilight/{p-6c18cc72.entry.js → p-dd507247.entry.js} +1 -1
  325. package/dist/twilight/{p-c2fe2dbe.entry.js → p-df8d9655.entry.js} +1 -1
  326. package/dist/twilight/{p-98108ebe.entry.js → p-e304b491.entry.js} +1 -1
  327. package/dist/twilight/{p-ffdf5f92.entry.js → p-e9b2c4a5.entry.js} +1 -1
  328. package/dist/twilight/{p-4ac9a3b6.entry.js → p-eab06e84.entry.js} +1 -1
  329. package/dist/twilight/{p-d9b0fa64.entry.js → p-eefcc343.entry.js} +1 -1
  330. package/dist/twilight/{p-a0561bd1.entry.js → p-ef10024f.entry.js} +1 -1
  331. package/dist/twilight/{p-989f2adb.entry.js → p-f5f420c4.entry.js} +1 -1
  332. package/dist/twilight/{p-3f5bc617.entry.js → p-f8609873.entry.js} +1 -1
  333. package/dist/twilight/{p-bead6e6f.entry.js → p-f8e6aaac.entry.js} +1 -1
  334. package/dist/twilight/{p-3a8be7df.entry.js → p-f93cab86.entry.js} +1 -1
  335. package/dist/twilight/{p-93dabb47.entry.js → p-fcc66e23.entry.js} +1 -1
  336. package/dist/twilight/{p-6ff53523.entry.js → p-fd94973d.entry.js} +1 -1
  337. package/dist/twilight/{p-279a1661.entry.js → p-fd9d7372.entry.js} +1 -1
  338. package/dist/twilight/twilight.esm.js +1 -1
  339. package/dist/types/components/salla-comments/interfaces.d.ts +15 -0
  340. package/dist/types/components/salla-comments/salla-comments.d.ts +5 -2
  341. package/dist/types/components/salla-modal/salla-modal.d.ts +7 -2
  342. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +20 -5
  343. package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +10 -2
  344. package/dist/types/components/salla-verified-review/salla-verified-review.d.ts +51 -0
  345. package/dist/types/components.d.ts +59 -16
  346. package/package.json +5 -5
  347. package/dist/twilight/p-0ae39262.entry.js +0 -4
  348. package/dist/twilight/p-12f61ae1.entry.js +0 -4
  349. package/dist/twilight/p-ab41d26c.entry.js +0 -4
  350. package/dist/twilight/p-e5a3b689.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as a,H as s,a as r}from"./p-CHZfg_a9.js";const i=[{label:"100px",value:"56px"},{label:"72px",value:"64px"},{label:"96px",value:"48px"}],e=class{constructor(a){t(this,a),this.validateForms=!0,this.cartCount=0,this.cartTotal=0,this.cartTotalDiscount=0,this.cartSubTotal=0,this.cartOptionsTotal=0,this.cartShippingCost=0,this.cartTaxAmount=0,this.cartHasShipping=!1,this.isOpen=!1,this.isDesktop=!1,this.isLoading=!0,this.originalParent=null,this.originalNextSibling=null,this.bodyObserver=null,this.mediaQueryList=null,this.submitObserver=null,this.isSubmitting=!1,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,this.applyMode()},this.cartEventNames=["cart::details.fetched","cart::updated","cart::latest.fetched","cart::coupon.added","cart::coupon.deleted"],this.cartEventHandler=t=>this.applyCartData(this.extractCart(t)),this.releaseSubmitLoading=()=>{this.submitObserver?.disconnect(),this.submitObserver=null,this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.host.querySelector("#s-cart-summary-card-submit")?.removeAttribute?.("loading")},this.toggleSheet=()=>{this.isDesktop||(this.isOpen=!this.isOpen)},this.handleSubmit=async t=>{if(this.isSubmitting)return void t.preventDefault();if(this.isSubmitting=!0,this.validateForms&&!await this.validateCartForms())return t.preventDefault(),salla.notify?.error?.(salla.lang?.get?.("common.messages.required_fields")),void(this.isSubmitting=!1);const a=this.host.querySelector("#s-cart-summary-card-submit");a&&(a.load?.(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&clearTimeout(this.submitObserverTimeout),this.submitObserver=new MutationObserver((()=>{a.hasAttribute("loading")||a.setAttribute("loading","")})),this.submitObserver.observe(a,{attributes:!0,attributeFilter:["loading"]}),this.submitObserverTimeout=window.setTimeout((()=>{this.submitObserver?.disconnect(),this.submitObserver=null,a.removeAttribute?.("loading")}),1e4)),salla.cart?.submit?.(),window.setTimeout((()=>{this.isSubmitting=!1}),1500)}}componentWillLoad(){this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches,this.isDesktop&&(this.isOpen=!0),this.init()}async init(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.cartEventNames.forEach((t=>salla.event.on(t,this.cartEventHandler))),salla.event.on("cart::submit.failed",this.releaseSubmitLoading),this.fetchCart()}loadTranslations(){this.summaryLabel=salla.lang.get("pages.cart.summary"),this.itemsTotalLabel=salla.lang.get("pages.cart.items_total"),this.itemsTotalNoTaxLabel=salla.lang.get("pages.cart.items_total_without_tax"),this.optionsTotalLabel=salla.lang.get("pages.cart.order_options_total"),this.shippingCostLabel=salla.lang.get("pages.cart.shipping_cost"),this.vatTaxLabel=salla.lang.get("pages.cart.VAT_tax_amount"),this.savedLabel=salla.lang.get("pages.cart.discount"),this.discountBadge=salla.lang.get("pages.cart.saved"),this.finalTotalLabel=salla.lang.get("pages.cart.final_total"),this.pricesTaxedLabel=salla.lang.get("pages.cart.prices_taxed"),this.completeOrderLabel=salla.lang.get("pages.cart.complete_order"),this.openSummaryLabel=salla.lang.get("pages.cart.open_summary"),this.closeSummaryLabel=salla.lang.get("pages.cart.close_summary"),this.itemsCountTemplate=salla.lang.get("pages.cart.items_with_count")}num(t){if(null==t)return 0;if("number"==typeof t)return isFinite(t)?t:0;if("string"==typeof t)return parseFloat(t)||0;if("object"==typeof t){if("amount"in t)return this.num(t.amount);if("value"in t)return this.num(t.value);if("formatted"in t)return this.num(t.formatted)}return 0}breakpointPx(){return 1024}desktopMediaQuery(){return`(min-width: ${this.breakpointPx()}px)`}componentDidLoad(){this.originalParent=this.host.parentElement,this.originalNextSibling=this.host.nextSibling,this.mediaQueryList||(this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches),this.applyMode(),this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener(this.mqlChangeHandler)}applyMode(){this.isDesktop?(this.isOpen=!0,this.bodyObserver?.disconnect(),this.bodyObserver=null,this.originalParent&&this.host.parentElement!==this.originalParent&&this.originalParent.insertBefore(this.host,this.originalNextSibling?.parentNode===this.originalParent?this.originalNextSibling:null)):this.pinToBodyEnd()}pinToBodyEnd(){this.host.parentElement===document.body&&document.body.lastElementChild===this.host||document.body.appendChild(this.host),this.bodyObserver||(this.bodyObserver=new MutationObserver((()=>{this.isDesktop||document.body.lastElementChild===this.host||document.body.appendChild(this.host)})),this.bodyObserver.observe(document.body,{childList:!0}))}disconnectedCallback(){Promise.resolve().then((()=>{this.host.isConnected||(this.bodyObserver?.disconnect(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener(this.mqlChangeHandler),this.mediaQueryList=null,this.cartEventNames.forEach((t=>salla.event.off(t,this.cartEventHandler))),salla.event.off("cart::submit.failed",this.releaseSubmitLoading))}))}fetchCart(){const t=salla.config?.get?.("page.id"),a=salla.cart?.api?.details?.(t);a&&"function"==typeof a.then?a.then((t=>this.applyCartData(this.extractCart(t)))).catch((()=>this.applyCachedSummary())):this.applyCachedSummary()}applyCachedSummary(){const t=salla.storage?.get?.("cart.summary");t&&"object"==typeof t&&this.applyCartData(t),this.isLoading=!1}extractCart(t){return t?t.data?.cart?t.data.cart:t.cart?t.cart:t:null}applyCartData(t){if(!t)return;this.isLoading=!1,void 0!==t.count&&(this.cartCount=this.num(t.count)),void 0!==t.total&&(this.cartTotal=this.num(t.total));const a=t.total_discount??t.discount;void 0!==a&&(this.cartTotalDiscount=this.num(a)),void 0!==t.sub_total&&(this.cartSubTotal=this.num(t.sub_total)),void 0!==t.options_total&&(this.cartOptionsTotal=this.num(t.options_total)),void 0!==t.tax_amount&&(this.cartTaxAmount=this.num(t.tax_amount));const s=!!t.free_shipping_bar?.has_free_shipping;void 0!==t.shipping_cost?this.cartShippingCost=this.num(t.shipping_cost):void 0!==t.real_shipping_cost&&(this.cartShippingCost=s?0:this.num(t.real_shipping_cost)),this.cartHasShipping=this.cartShippingCost>0||!!t.has_shipping}async validateCartForms(){let t=!0;document.querySelectorAll('form[id^="item-"]').forEach((a=>{a.reportValidity()||(t=!1)}));const a=Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));for(const s of a)"function"!=typeof s.reportValidity||await s.reportValidity()||(t=!1);return t}decimalPlaces(t){const a=String(t),s=a.indexOf(".");return-1===s||a.includes("e")?0:a.length-s-1}roundToCurrency(t){const a=Math.min(Math.max(2,this.decimalPlaces(this.cartTotal),this.decimalPlaces(this.cartTotalDiscount)),4),s=Math.pow(10,a);return Math.round(t*s)/s}money(t){try{if("undefined"!=typeof salla&&"function"==typeof salla.money)return salla.money(t)}catch(t){}return String(t??0)}getItemsLabel(){return this.itemsCountTemplate?.replace(":count",String(this.cartCount))??""}renderSkeleton(){return a(s,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--loading":!0,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},this.isDesktop&&a("div",{class:"s-cart-summary-card-sheet-wrap s-cart-summary-card-sheet-wrap--open"},a("div",{class:"s-cart-summary-card-sheet"},a("header",{class:"s-cart-summary-card-sheet-header"},a("h3",{class:"s-cart-summary-card-sheet-title"},a("salla-skeleton",{width:"140px",height:"16px"}))),i.map((({label:t,value:s},r)=>a("div",{class:"s-cart-summary-card-line",key:r},a("salla-skeleton",{width:t,height:"16px"}),a("salla-skeleton",{width:s,height:"16px"})))))),a("div",{class:"s-cart-summary-card-bar"},a("div",{class:"s-cart-summary-card-bar-label"},a("div",{class:"s-cart-summary-card-bar-label-main"},a("salla-skeleton",{width:"90px",height:"16px"}),a("salla-skeleton",{width:"48px",height:"12px"}))),a("div",{class:"s-cart-summary-card-bar-totals"},a("div",{class:"s-cart-summary-card-bar-totals-row"},a("salla-skeleton",{width:"80px",height:"20px"})))),a("div",{class:"s-cart-summary-card-action"},a("salla-skeleton",{width:"100%",height:"44px"})))}render(){if(this.isLoading)return this.renderSkeleton();const t=this.cartTotalDiscount>0,r=this.cartTaxAmount?this.itemsTotalNoTaxLabel:this.itemsTotalLabel;return a(s,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--open":this.isOpen,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},a("div",{class:{"s-cart-summary-card-sheet-wrap":!0,"s-cart-summary-card-sheet-wrap--open":this.isOpen},"aria-hidden":this.isOpen?"false":"true"},a("div",{class:"s-cart-summary-card-sheet",style:this.isDesktop?{}:{transform:this.isOpen?"translateY(0)":"translateY(100%)",transition:"transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)"}},a("header",{class:"s-cart-summary-card-sheet-header"},a("h3",{class:"s-cart-summary-card-sheet-title"},this.summaryLabel)),a("div",{class:"s-cart-summary-card-line"},a("span",null,r),a("b",{innerHTML:this.money(this.cartSubTotal)})),this.cartOptionsTotal>0&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.optionsTotalLabel),a("b",{innerHTML:this.money(this.cartOptionsTotal)})),this.cartHasShipping&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.shippingCostLabel),a("b",{innerHTML:this.money(this.cartShippingCost)})),this.cartTaxAmount>0&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.vatTaxLabel),a("b",{innerHTML:this.money(this.cartTaxAmount)})),t&&a("div",{class:"s-cart-summary-card-line s-cart-summary-card-line--discount"},a("span",null,this.savedLabel),a("b",null,"− ",a("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),a("div",{class:"s-cart-summary-card-bar"},a("div",{class:"s-cart-summary-card-bar-label"},a("div",{class:"s-cart-summary-card-bar-label-main"},a("span",{class:"s-cart-summary-card-bar-label-text"},this.finalTotalLabel),a("span",{class:"s-cart-summary-card-bar-count"},this.getItemsLabel())),this.cartTaxAmount>0&&a("div",{class:"s-cart-summary-card-bar-label-sub"},this.pricesTaxedLabel)),a("div",{class:"s-cart-summary-card-bar-totals"},a("div",{class:"s-cart-summary-card-bar-totals-row"},t&&a("s",{class:"s-cart-summary-card-bar-original"},salla.helpers.number(this.roundToCurrency(this.cartTotal+this.cartTotalDiscount))),a("b",{class:"s-cart-summary-card-bar-total",innerHTML:this.money(this.cartTotal)}),!this.isDesktop&&a("button",{type:"button",class:"s-cart-summary-card-chevron","aria-label":this.isOpen?this.closeSummaryLabel:this.openSummaryLabel,"aria-expanded":this.isOpen?"true":"false",onClick:this.toggleSheet},a("i",{class:"sicon-keyboard_arrow_up s-cart-summary-card-chevron-icon"}))),t&&a("div",{class:"s-cart-summary-card-bar-savings-badge"},a("span",{"aria-hidden":"true"},"🎉"),a("span",null,this.discountBadge," ",a("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),a("div",{class:"s-cart-summary-card-action"},a("salla-button",{id:"s-cart-summary-card-submit",width:"wide","loader-position":"center",onClick:this.handleSubmit},this.completeOrderLabel)))}get host(){return r(this)}};e.style="/*!twlt*/:host{display:block}.sticky{position:sticky}.block{display:block}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.\\!btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.\\!btn:hover{opacity:0.8}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-cart-summary-card-sheet-title{margin-bottom:0.5rem;flex:1 1 0%;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line{margin-bottom:0.5rem;display:flex;align-items:center;justify-content:space-between;font-size:0.875rem;line-height:1.25rem}.s-cart-summary-card-line span{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line b{font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity:1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line--discount b{--tw-text-opacity:1 !important;color:rgb(220 38 38 / var(--tw-text-opacity, 1)) !important}.s-cart-summary-card-line--discount b *{--tw-text-opacity:1 !important;color:rgb(220 38 38 / var(--tw-text-opacity, 1)) !important}.s-cart-summary-card-bar-label{display:flex;flex-direction:column;gap:0.125rem}.s-cart-summary-card-bar-label-main{display:flex;align-items:baseline;gap:0.375rem}.s-cart-summary-card-bar-label-text{white-space:nowrap;font-size:1rem;line-height:1.5rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-count{white-space:nowrap;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-label-sub{font-size:11px;--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-totals{display:flex;flex-direction:column;align-items:flex-end;gap:0.375rem}.s-cart-summary-card-bar-totals-row{display:flex;align-items:center;gap:0.375rem}.s-cart-summary-card-bar-total{font-size:1rem;line-height:1.5rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-original{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-summary-card-bar-savings-badge{display:inline-flex;width:max-content;align-items:center;gap:0.25rem;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(239 251 246 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.125rem;padding-bottom:0.125rem;font-size:11px;font-weight:600;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-summary-card-chevron{display:inline-flex;height:1.5rem;width:1.5rem;cursor:pointer;align-items:center;justify-content:center;border-width:0px;background-color:transparent;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));outline:2px solid transparent;outline-offset:2px}.s-cart-summary-card-chevron-icon{display:inline-flex;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-summary-card{display:block;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (max-width: 1023px){.s-cart-summary-card{position:fixed;inset-inline:0;bottom:0;z-index:1;border-radius:24px 24px 0 0;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0.12);transition:box-shadow 0.3s ease;padding-bottom:calc(env(safe-area-inset-bottom) + 0.5rem)}}@media (min-width: 1024px){.s-cart-summary-card{position:relative;border-radius:0.5rem;box-shadow:0 2px 6px rgba(0, 0, 0, 0.05);padding:1.25rem 1.5rem;margin-bottom:1.25rem}}@media (max-width: 1023px){.s-cart-summary-card--open{border-radius:0;box-shadow:none}}.s-cart-summary-card-sheet-wrap{display:grid;grid-template-rows:0fr;transition:grid-template-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s ease}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap{position:absolute;inset-inline:0;bottom:calc(100% - 1px);background:#fff;border-radius:24px 24px 0 0;overflow:hidden;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0)}}@media (min-width: 1024px){.s-cart-summary-card-sheet-wrap{grid-template-rows:1fr}}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap--open{grid-template-rows:1fr;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0.12)}}.s-cart-summary-card-sheet{min-height:0;overflow:hidden}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap--open .s-cart-summary-card-sheet{overflow-y:auto;max-height:70vh;-webkit-overflow-scrolling:touch;padding:0.75rem 1rem 0}}.s-cart-summary-card-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:0.5rem}@media (max-width: 1023px){.s-cart-summary-card-sheet-header{padding-bottom:0.5rem}}.s-cart-summary-card-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (min-width: 1024px){.s-cart-summary-card-bar{margin-top:1rem}}@media (max-width: 1023px){.s-cart-summary-card-bar{padding:0.875rem 1rem 0.5rem;border-radius:24px 24px 0 0}.s-cart-summary-card--open .s-cart-summary-card-bar{padding-top:0;border-radius:0}}@media (min-width: 1024px){.s-cart-summary-card-action{padding-top:1rem}}@media (max-width: 1023px){.s-cart-summary-card-action{padding:0 1rem 0.75rem}}.s-cart-summary-card--open .s-cart-summary-card-chevron-icon{transform:rotate(180deg)}.s-cart-summary-card-action *:focus{outline:none}";export{e as salla_cart_summary_card}
4
+ import{r as t,h as a,H as s,a as r}from"./p-RGVg6FYq.js";const i=[{label:"100px",value:"56px"},{label:"72px",value:"64px"},{label:"96px",value:"48px"}],e=class{constructor(a){t(this,a),this.validateForms=!0,this.cartCount=0,this.cartTotal=0,this.cartTotalDiscount=0,this.cartSubTotal=0,this.cartOptionsTotal=0,this.cartShippingCost=0,this.cartTaxAmount=0,this.cartHasShipping=!1,this.isOpen=!1,this.isDesktop=!1,this.isLoading=!0,this.originalParent=null,this.originalNextSibling=null,this.bodyObserver=null,this.mediaQueryList=null,this.submitObserver=null,this.isSubmitting=!1,this.mqlChangeHandler=t=>{this.isDesktop=t.matches,this.applyMode()},this.cartEventNames=["cart::details.fetched","cart::updated","cart::latest.fetched","cart::coupon.added","cart::coupon.deleted"],this.cartEventHandler=t=>this.applyCartData(this.extractCart(t)),this.releaseSubmitLoading=()=>{this.submitObserver?.disconnect(),this.submitObserver=null,this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.host.querySelector("#s-cart-summary-card-submit")?.removeAttribute?.("loading")},this.toggleSheet=()=>{this.isDesktop||(this.isOpen=!this.isOpen)},this.handleSubmit=async t=>{if(this.isSubmitting)return void t.preventDefault();if(this.isSubmitting=!0,this.validateForms&&!await this.validateCartForms())return t.preventDefault(),salla.notify?.error?.(salla.lang?.get?.("common.messages.required_fields")),void(this.isSubmitting=!1);const a=this.host.querySelector("#s-cart-summary-card-submit");a&&(a.load?.(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&clearTimeout(this.submitObserverTimeout),this.submitObserver=new MutationObserver((()=>{a.hasAttribute("loading")||a.setAttribute("loading","")})),this.submitObserver.observe(a,{attributes:!0,attributeFilter:["loading"]}),this.submitObserverTimeout=window.setTimeout((()=>{this.submitObserver?.disconnect(),this.submitObserver=null,a.removeAttribute?.("loading")}),1e4)),salla.cart?.submit?.(),window.setTimeout((()=>{this.isSubmitting=!1}),1500)}}componentWillLoad(){this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches,this.isDesktop&&(this.isOpen=!0),this.init()}async init(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.cartEventNames.forEach((t=>salla.event.on(t,this.cartEventHandler))),salla.event.on("cart::submit.failed",this.releaseSubmitLoading),this.fetchCart()}loadTranslations(){this.summaryLabel=salla.lang.get("pages.cart.summary"),this.itemsTotalLabel=salla.lang.get("pages.cart.items_total"),this.itemsTotalNoTaxLabel=salla.lang.get("pages.cart.items_total_without_tax"),this.optionsTotalLabel=salla.lang.get("pages.cart.order_options_total"),this.shippingCostLabel=salla.lang.get("pages.cart.shipping_cost"),this.vatTaxLabel=salla.lang.get("pages.cart.VAT_tax_amount"),this.savedLabel=salla.lang.get("pages.cart.discount"),this.discountBadge=salla.lang.get("pages.cart.saved"),this.finalTotalLabel=salla.lang.get("pages.cart.final_total"),this.pricesTaxedLabel=salla.lang.get("pages.cart.prices_taxed"),this.completeOrderLabel=salla.lang.get("pages.cart.complete_order"),this.openSummaryLabel=salla.lang.get("pages.cart.open_summary"),this.closeSummaryLabel=salla.lang.get("pages.cart.close_summary"),this.itemsCountTemplate=salla.lang.get("pages.cart.items_with_count")}num(t){if(null==t)return 0;if("number"==typeof t)return isFinite(t)?t:0;if("string"==typeof t)return parseFloat(t)||0;if("object"==typeof t){if("amount"in t)return this.num(t.amount);if("value"in t)return this.num(t.value);if("formatted"in t)return this.num(t.formatted)}return 0}breakpointPx(){return 1024}desktopMediaQuery(){return`(min-width: ${this.breakpointPx()}px)`}componentDidLoad(){this.originalParent=this.host.parentElement,this.originalNextSibling=this.host.nextSibling,this.mediaQueryList||(this.mediaQueryList=window.matchMedia(this.desktopMediaQuery()),this.isDesktop=this.mediaQueryList.matches),this.applyMode(),this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.mqlChangeHandler):this.mediaQueryList.addListener(this.mqlChangeHandler)}applyMode(){this.isDesktop?(this.isOpen=!0,this.bodyObserver?.disconnect(),this.bodyObserver=null,this.originalParent&&this.host.parentElement!==this.originalParent&&this.originalParent.insertBefore(this.host,this.originalNextSibling?.parentNode===this.originalParent?this.originalNextSibling:null)):this.pinToBodyEnd()}pinToBodyEnd(){this.host.parentElement===document.body&&document.body.lastElementChild===this.host||document.body.appendChild(this.host),this.bodyObserver||(this.bodyObserver=new MutationObserver((()=>{this.isDesktop||document.body.lastElementChild===this.host||document.body.appendChild(this.host)})),this.bodyObserver.observe(document.body,{childList:!0}))}disconnectedCallback(){Promise.resolve().then((()=>{this.host.isConnected||(this.bodyObserver?.disconnect(),this.submitObserver?.disconnect(),this.submitObserverTimeout&&(clearTimeout(this.submitObserverTimeout),this.submitObserverTimeout=void 0),this.mediaQueryList?.removeEventListener?this.mediaQueryList.removeEventListener("change",this.mqlChangeHandler):this.mediaQueryList?.removeListener(this.mqlChangeHandler),this.mediaQueryList=null,this.cartEventNames.forEach((t=>salla.event.off(t,this.cartEventHandler))),salla.event.off("cart::submit.failed",this.releaseSubmitLoading))}))}fetchCart(){const t=salla.config?.get?.("page.id"),a=salla.cart?.api?.details?.(t);a&&"function"==typeof a.then?a.then((t=>this.applyCartData(this.extractCart(t)))).catch((()=>this.applyCachedSummary())):this.applyCachedSummary()}applyCachedSummary(){const t=salla.storage?.get?.("cart.summary");t&&"object"==typeof t&&this.applyCartData(t),this.isLoading=!1}extractCart(t){return t?t.data?.cart?t.data.cart:t.cart?t.cart:t:null}applyCartData(t){if(!t)return;this.isLoading=!1,void 0!==t.count&&(this.cartCount=this.num(t.count)),void 0!==t.total&&(this.cartTotal=this.num(t.total));const a=t.total_discount??t.discount;void 0!==a&&(this.cartTotalDiscount=this.num(a)),void 0!==t.sub_total&&(this.cartSubTotal=this.num(t.sub_total)),void 0!==t.options_total&&(this.cartOptionsTotal=this.num(t.options_total)),void 0!==t.tax_amount&&(this.cartTaxAmount=this.num(t.tax_amount));const s=!!t.free_shipping_bar?.has_free_shipping;void 0!==t.shipping_cost?this.cartShippingCost=this.num(t.shipping_cost):void 0!==t.real_shipping_cost&&(this.cartShippingCost=s?0:this.num(t.real_shipping_cost)),this.cartHasShipping=this.cartShippingCost>0||!!t.has_shipping}async validateCartForms(){let t=!0;document.querySelectorAll('form[id^="item-"]').forEach((a=>{a.reportValidity()||(t=!1)}));const a=Array.from(document.querySelectorAll('form[id^="item-"] salla-product-options'));for(const s of a)"function"!=typeof s.reportValidity||await s.reportValidity()||(t=!1);return t}decimalPlaces(t){const a=String(t),s=a.indexOf(".");return-1===s||a.includes("e")?0:a.length-s-1}roundToCurrency(t){const a=Math.min(Math.max(2,this.decimalPlaces(this.cartTotal),this.decimalPlaces(this.cartTotalDiscount)),4),s=Math.pow(10,a);return Math.round(t*s)/s}money(t){try{if("undefined"!=typeof salla&&"function"==typeof salla.money)return salla.money(t)}catch(t){}return String(t??0)}getItemsLabel(){return this.itemsCountTemplate?.replace(":count",String(this.cartCount))??""}renderSkeleton(){return a(s,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--loading":!0,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},this.isDesktop&&a("div",{class:"s-cart-summary-card-sheet-wrap s-cart-summary-card-sheet-wrap--open"},a("div",{class:"s-cart-summary-card-sheet"},a("header",{class:"s-cart-summary-card-sheet-header"},a("h3",{class:"s-cart-summary-card-sheet-title"},a("salla-skeleton",{width:"140px",height:"16px"}))),i.map((({label:t,value:s},r)=>a("div",{class:"s-cart-summary-card-line",key:r},a("salla-skeleton",{width:t,height:"16px"}),a("salla-skeleton",{width:s,height:"16px"})))))),a("div",{class:"s-cart-summary-card-bar"},a("div",{class:"s-cart-summary-card-bar-label"},a("div",{class:"s-cart-summary-card-bar-label-main"},a("salla-skeleton",{width:"90px",height:"16px"}),a("salla-skeleton",{width:"48px",height:"12px"}))),a("div",{class:"s-cart-summary-card-bar-totals"},a("div",{class:"s-cart-summary-card-bar-totals-row"},a("salla-skeleton",{width:"80px",height:"20px"})))),a("div",{class:"s-cart-summary-card-action"},a("salla-skeleton",{width:"100%",height:"44px"})))}render(){if(this.isLoading)return this.renderSkeleton();const t=this.cartTotalDiscount>0,r=this.cartTaxAmount?this.itemsTotalNoTaxLabel:this.itemsTotalLabel;return a(s,{class:{"s-cart-summary-card":!0,"s-cart-summary-card--open":this.isOpen,"s-cart-summary-card--desktop":this.isDesktop,"s-cart-summary-card--mobile":!this.isDesktop}},a("div",{class:{"s-cart-summary-card-sheet-wrap":!0,"s-cart-summary-card-sheet-wrap--open":this.isOpen},"aria-hidden":this.isOpen?"false":"true"},a("div",{class:"s-cart-summary-card-sheet",style:this.isDesktop?{}:{transform:this.isOpen?"translateY(0)":"translateY(100%)",transition:"transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)"}},a("header",{class:"s-cart-summary-card-sheet-header"},a("h3",{class:"s-cart-summary-card-sheet-title"},this.summaryLabel)),a("div",{class:"s-cart-summary-card-line"},a("span",null,r),a("b",{innerHTML:this.money(this.cartSubTotal)})),this.cartOptionsTotal>0&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.optionsTotalLabel),a("b",{innerHTML:this.money(this.cartOptionsTotal)})),this.cartHasShipping&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.shippingCostLabel),a("b",{innerHTML:this.money(this.cartShippingCost)})),this.cartTaxAmount>0&&a("div",{class:"s-cart-summary-card-line"},a("span",null,this.vatTaxLabel),a("b",{innerHTML:this.money(this.cartTaxAmount)})),t&&a("div",{class:"s-cart-summary-card-line s-cart-summary-card-line--discount"},a("span",null,this.savedLabel),a("b",null,"− ",a("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),a("div",{class:"s-cart-summary-card-bar"},a("div",{class:"s-cart-summary-card-bar-label"},a("div",{class:"s-cart-summary-card-bar-label-main"},a("span",{class:"s-cart-summary-card-bar-label-text"},this.finalTotalLabel),a("span",{class:"s-cart-summary-card-bar-count"},this.getItemsLabel())),this.cartTaxAmount>0&&a("div",{class:"s-cart-summary-card-bar-label-sub"},this.pricesTaxedLabel)),a("div",{class:"s-cart-summary-card-bar-totals"},a("div",{class:"s-cart-summary-card-bar-totals-row"},t&&a("s",{class:"s-cart-summary-card-bar-original"},salla.helpers.number(this.roundToCurrency(this.cartTotal+this.cartTotalDiscount))),a("b",{class:"s-cart-summary-card-bar-total",innerHTML:this.money(this.cartTotal)}),!this.isDesktop&&a("button",{type:"button",class:"s-cart-summary-card-chevron","aria-label":this.isOpen?this.closeSummaryLabel:this.openSummaryLabel,"aria-expanded":this.isOpen?"true":"false",onClick:this.toggleSheet},a("i",{class:"sicon-keyboard_arrow_up s-cart-summary-card-chevron-icon"}))),t&&a("div",{class:"s-cart-summary-card-bar-savings-badge"},a("span",{"aria-hidden":"true"},"🎉"),a("span",null,this.discountBadge," ",a("span",{innerHTML:this.money(this.cartTotalDiscount)}))))),a("div",{class:"s-cart-summary-card-action"},a("salla-button",{id:"s-cart-summary-card-submit",width:"wide","loader-position":"center",onClick:this.handleSubmit},this.completeOrderLabel)))}get host(){return r(this)}};e.style="/*!twlt*/:host{display:block}.sticky{position:sticky}.block{display:block}.transform{transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transition{transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.\\!btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.\\!btn:hover{opacity:0.8}.btn{display:inline-flex;flex:1 1 0%;align-items:center;justify-content:center;white-space:nowrap;border-radius:0.375rem;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.btn:hover{opacity:0.8}.s-cart-summary-card-sheet-title{margin-bottom:0.5rem;flex:1 1 0%;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line{margin-bottom:0.5rem;display:flex;align-items:center;justify-content:space-between;font-size:0.875rem;line-height:1.25rem}.s-cart-summary-card-line span{--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line b{font-size:1rem;line-height:1.5rem;font-weight:600;--tw-text-opacity:1;color:rgb(51 51 51 / var(--tw-text-opacity, 1))}.s-cart-summary-card-line--discount b{--tw-text-opacity:1 !important;color:rgb(220 38 38 / var(--tw-text-opacity, 1)) !important}.s-cart-summary-card-line--discount b *{--tw-text-opacity:1 !important;color:rgb(220 38 38 / var(--tw-text-opacity, 1)) !important}.s-cart-summary-card-bar-label{display:flex;flex-direction:column;gap:0.125rem}.s-cart-summary-card-bar-label-main{display:flex;align-items:baseline;gap:0.375rem}.s-cart-summary-card-bar-label-text{white-space:nowrap;font-size:1rem;line-height:1.5rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-count{white-space:nowrap;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-label-sub{font-size:11px;--tw-text-opacity:1;color:rgb(115 115 115 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-totals{display:flex;flex-direction:column;align-items:flex-end;gap:0.375rem}.s-cart-summary-card-bar-totals-row{display:flex;align-items:center;gap:0.375rem}.s-cart-summary-card-bar-total{font-size:1rem;line-height:1.5rem;font-weight:700;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-cart-summary-card-bar-original{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-summary-card-bar-savings-badge{display:inline-flex;width:max-content;align-items:center;gap:0.25rem;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(239 251 246 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;padding-top:0.125rem;padding-bottom:0.125rem;font-size:11px;font-weight:600;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-summary-card-chevron{display:inline-flex;height:1.5rem;width:1.5rem;cursor:pointer;align-items:center;justify-content:center;border-width:0px;background-color:transparent;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1));outline:2px solid transparent;outline-offset:2px}.s-cart-summary-card-chevron-icon{display:inline-flex;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-summary-card{display:block;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (max-width: 1023px){.s-cart-summary-card{position:fixed;inset-inline:0;bottom:0;z-index:1;border-radius:24px 24px 0 0;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0.12);transition:box-shadow 0.3s ease;padding-bottom:calc(env(safe-area-inset-bottom) + 0.5rem)}}@media (min-width: 1024px){.s-cart-summary-card{position:relative;border-radius:0.5rem;box-shadow:0 2px 6px rgba(0, 0, 0, 0.05);padding:1.25rem 1.5rem;margin-bottom:1.25rem}}@media (max-width: 1023px){.s-cart-summary-card--open{border-radius:0;box-shadow:none}}.s-cart-summary-card-sheet-wrap{display:grid;grid-template-rows:0fr;transition:grid-template-rows 0.4s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s ease}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap{position:absolute;inset-inline:0;bottom:calc(100% - 1px);background:#fff;border-radius:24px 24px 0 0;overflow:hidden;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0)}}@media (min-width: 1024px){.s-cart-summary-card-sheet-wrap{grid-template-rows:1fr}}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap--open{grid-template-rows:1fr;box-shadow:0 -12px 24px -12px rgba(0, 0, 0, 0.12)}}.s-cart-summary-card-sheet{min-height:0;overflow:hidden}@media (max-width: 1023px){.s-cart-summary-card-sheet-wrap--open .s-cart-summary-card-sheet{overflow-y:auto;max-height:70vh;-webkit-overflow-scrolling:touch;padding:0.75rem 1rem 0}}.s-cart-summary-card-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:0.5rem}@media (max-width: 1023px){.s-cart-summary-card-sheet-header{padding-bottom:0.5rem}}.s-cart-summary-card-bar{display:flex;align-items:flex-start;justify-content:space-between;gap:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}@media (min-width: 1024px){.s-cart-summary-card-bar{margin-top:1rem}}@media (max-width: 1023px){.s-cart-summary-card-bar{padding:0.875rem 1rem 0.5rem;border-radius:24px 24px 0 0}.s-cart-summary-card--open .s-cart-summary-card-bar{padding-top:0;border-radius:0}}@media (min-width: 1024px){.s-cart-summary-card-action{padding-top:1rem}}@media (max-width: 1023px){.s-cart-summary-card-action{padding:0 1rem 0.75rem}}.s-cart-summary-card--open .s-cart-summary-card-chevron-icon{transform:rotate(180deg)}.s-cart-summary-card-action *:focus{outline:none}";export{e as salla_cart_summary_card}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,c as t,h as d,H as r}from"./p-CHZfg_a9.js";const c=class{constructor(d){e(this,d),this.orderEditProductSelected=t(this,"orderEditProductSelected")}get productData(){if(!this.product)return{};if("object"==typeof this.product)return this.product;try{return JSON.parse(this.product)}catch(e){return{}}}handleSelectProduct(){this.orderEditProductSelected.emit({product:this.productData})}render(){const e=this.productData,t=e?.name||salla.lang.getWithDefault("common.elements.product","منتج"),c=e?.price;return d(r,{key:"7669432a4756da446e16d9a3093a067767c5dd9d"},d("button",{key:"d998dde2a1dc4eae7444fd398910c3a0699730f8",type:"button",class:"s-order-edit-product-card",onClick:()=>this.handleSelectProduct()},d("div",{key:"6a0e6eec84de332598d94be87b49564eeb2cfbc2",class:"s-order-edit-product-card-media"},e?.image?.url?d("img",{src:e.image.url,alt:e.image.alt||t,class:"s-order-edit-product-card-image"}):d("div",{class:"s-order-edit-product-card-placeholder"},d("i",{class:"sicon-shopping-bag"}))),d("div",{key:"4eeb9f7430c19f8e792b0f6856fb86a2f265eb95",class:"s-order-edit-product-card-content"},d("h3",{key:"840ae549097a53f1f297673d69e3155792a4097e",class:"s-order-edit-product-card-title"},t),null!=c&&d("p",{key:"32732854ca599fe446d0b47883b892ac17d90cae",class:"s-order-edit-product-card-price",innerHTML:salla.money(c)}))))}};c.style=":host{display:block;min-width:0}";export{c as salla_order_edit_product_card}
4
+ import{r as e,c as t,h as d,H as r}from"./p-RGVg6FYq.js";const c=class{constructor(d){e(this,d),this.orderEditProductSelected=t(this,"orderEditProductSelected")}get productData(){if(!this.product)return{};if("object"==typeof this.product)return this.product;try{return JSON.parse(this.product)}catch(e){return{}}}handleSelectProduct(){this.orderEditProductSelected.emit({product:this.productData})}render(){const e=this.productData,t=e?.name||salla.lang.getWithDefault("common.elements.product","منتج"),c=e?.price;return d(r,{key:"7669432a4756da446e16d9a3093a067767c5dd9d"},d("button",{key:"d998dde2a1dc4eae7444fd398910c3a0699730f8",type:"button",class:"s-order-edit-product-card",onClick:()=>this.handleSelectProduct()},d("div",{key:"6a0e6eec84de332598d94be87b49564eeb2cfbc2",class:"s-order-edit-product-card-media"},e?.image?.url?d("img",{src:e.image.url,alt:e.image.alt||t,class:"s-order-edit-product-card-image"}):d("div",{class:"s-order-edit-product-card-placeholder"},d("i",{class:"sicon-shopping-bag"}))),d("div",{key:"4eeb9f7430c19f8e792b0f6856fb86a2f265eb95",class:"s-order-edit-product-card-content"},d("h3",{key:"840ae549097a53f1f297673d69e3155792a4097e",class:"s-order-edit-product-card-title"},t),null!=c&&d("p",{key:"32732854ca599fe446d0b47883b892ac17d90cae",class:"s-order-edit-product-card-price",innerHTML:salla.money(c)}))))}};c.style=":host{display:block;min-width:0}";export{c as salla_order_edit_product_card}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as e,H as i,a as r}from"./p-CHZfg_a9.js";import{a as o}from"./p-CgtvEd63.js";import{S as a}from"./p-DiKTtDW5.js";import{H as n}from"./p-DOBDDG4K.js";const l=class{constructor(e){t(this,e),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 e=String(s),i=this.hasCustomComponent?this.productCardComponent:"salla-product-card";for(const t of Array.from(this.wrapper.children)){const s=t,r=t.querySelector(i),o=s.product?.id??r?.product?.id;if(null!=o&&String(o)===e){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)===e&&!t.querySelector(i)){t.remove();break}}if(this.selectable){for(const t of Array.from(this.selectedProducts.keys()))String(t)===e&&this.selectedProducts.delete(t);this.emitSelection()}},this.onWishlistStorageSynced=()=>n.syncWishlistIcons(this.wrapper,`${this.productCardComponent}, salla-product-card`),this.includes=n.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),n.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),salla.event.on("wishlist::storage.synced",this.onWishlistStorageSynced)}disconnectedCallback(){window.removeEventListener("DOMContentLoaded",this.boundScrollToLastViewedProduct),window.removeEventListener("scroll",this.boundHandleScroll),salla.event.off("wishlist::removed",this.onWishlistItemRemoved),salla.event.off("wishlist::storage.synced",this.onWishlistStorageSynced)}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.currentCategoryIdFilter=this.parsedFilters?.category_id?this.toCategoryIdFilter(this.parsedFilters.category_id):null),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[e,i]of Object.entries(s))this.nextPage+=`&filters[${encodeURIComponent(t)}][${encodeURIComponent(e)}]=${encodeURIComponent(i)}`;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=>{const e=s.target;e.closest("a")?(n.saveProductSource(this.getSource()),n.saveProductPosition(t.position),this.hasInfiniteScroll&&(this.takeStateSnapshot(),sessionStorage.setItem(this.lastViewedProductKey,t.id))):e.closest("salla-add-product-button")&&n.saveProductPosition(t.position)})),this.selectable?this.wrapSelectableItem(s,t):s}wrapSelectableItem(t,s){const e=document.createElement("div");e.className="s-products-list-selectable-item",e.product=s;const i=this.selectedProducts.has(s.id);i&&e.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=i,o.addEventListener("change",(()=>this.toggleSelection(s,e,o.checked))),r.appendChild(o),e.appendChild(r),e.appendChild(t),e}toggleSelection(t,s,e){e?(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()),e={ids:s,products:t,count:s.length};this.selectionChanged.emit(e),salla.event.emit("salla-products-list::selection.changed",e)}appendProductCards(t){this.wrapper&&((Array.isArray(t)?t:[t]).forEach((t=>this.wrapper.append(t))),this.onWishlistStorageSynced())}refreshWishlistIconsAfterHydration(){return salla.wishlist.api.syncStorageFromServer()}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((e=>{const i=new ResizeObserver((()=>{clearTimeout(s),s=setTimeout((()=>{i.disconnect(),e(null)}),160)}));i.observe(t)}))}waitForLayoutStable(t){let s=null,e=null;return new Promise((i=>{let r;const o=()=>{clearTimeout(s),clearTimeout(e),r.disconnect(),i(null)};r=new MutationObserver((()=>{clearTimeout(s),s=setTimeout(o,160)})),r.observe(t,{childList:!0,subtree:!0,attributes:!0}),e=setTimeout(o,1e3)}))}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 e=()=>{const t=()=>{s.scrollIntoView({block:"start",behavior:"instant"});const t=matchMedia("(max-width: 1024px)").matches?"header .inner":"ul.main-menu",e=window?.header_is_sticky?document.querySelector(t)?.getBoundingClientRect()?.height??56:0,i=parseInt(getComputedStyle(this.wrapper).rowGap)??16;scrollBy({top:-1*(e+i),behavior:"instant"})};requestAnimationFrame(t),s.querySelectorAll("img.lazy").forEach((s=>{const e=s,i=()=>{requestAnimationFrame(t),e.onload=e.onerror=null};e.onload=i,e.onerror=i})),this.removeScrollRestorationSession()};this.waitForStableLayout(this.host).then((()=>requestAnimationFrame(e)))}))}isElementLoaded(t){return new Promise((s=>{const e=setInterval((()=>{if(document.querySelector(t))return clearInterval(e),s(document.querySelector(t))}),50)}))}takeStateSnapshot(){const t=[];for(let s=0;s<this.wrapper.children.length;s++){const e=this.wrapper.children?.[s];t.push(e.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 e=salla.config.get("page.id");const i=Object.keys(this.specialPagesWithoutIds).find((t=>salla.url.is_page(t)));i?e=this.specialPagesWithoutIds[i]:null!==e&&(e=String(e)),sessionStorage.setItem(this.prevCategoryIdKey,e)}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),e=sessionStorage.getItem(this.prevCategoryIdKey),i=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"),n=i?e!==i:e!==String(r);if(e&&n&&!o&&!a||o&&!this.hasInfiniteScroll)return this.removeScrollRestorationSession(),this.switchToNormalBehavior=!0,!1;if(a)return this.switchToNormalBehavior=!0,!1;if(t)try{const{pageIndex:e,nextPage:i,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})}return this.page=e,this.nextPage=i,this.appendProductCards(r.map((t=>this.getItemHTML(t)))),!0}catch(t){console.error("Failed to load stored scroll state:",t),this.removeScrollRestorationSession()}return!1}getSource(){return n.getProductsSource(this.source)}isAuxiliaryProductsListSource(){return["json","selected","related","landing-page","recently"].includes(this.getSource())}toCategoryIdFilter(t){return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[t]}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:n.getProductsSourceValue(this.source,this.sourceValue)}getResponseHeader(t,s){if(!t)return;if("function"==typeof t.get)return t.get(s)||void 0;const e=t[s]??t[s.toLowerCase()];return"string"==typeof e?e:Array.isArray(e)&&"string"==typeof e[0]?e[0]:void 0}logFetchError(t,s,e,i){try{const r=s instanceof Error?s.name:void 0,o=s instanceof Error?s.message:String(s),a=i?.url||e,n=this.getResponseHeader(i?.headers,"cf-ray"),l=this.getResponseHeader(i?.headers,"cf-mitigated"),c=this.getResponseHeader(i?.headers,"server"),h="challenge"===l?.toLowerCase()||403===i?.status&&(!!n||!!c?.toLowerCase().includes("cloudflare")),d=`${r||""} ${o}`;let p="processing"===t?"processing":"unknown";"fetch"===t&&(h?p="cloudflare":/(?:^|\/)null(?:[/?#]|$)/i.test(a||"")?p="invalid_url":/timeout|timed out|abort/i.test(d)?p="timeout":!i?.status&&/fetch|network|load failed|connection/i.test(d)?p="network":i?.status&&(p="http")),salla.analytics?.log("salla::products.list.fetch.error",{errorPhase:t,failureType:p,cloudflareBlock:h,sourceList:this.getSource(),pageIndex:this.infiniteScroll?.pageIndex,httpStatus:i?.status,responseUrl:a,cfRay:n,cfMitigated:l,errorName:r,errorMessage:o.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,e)=>{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),this.onWishlistStorageSynced(),2===this.infiniteScroll.pageIndex&&(!this.autoload&&this.nextPage&&(this.loadMoreWrapper.style.display="block"),this.animateItems(),this.refreshInfiniteScrollMeasurements())}catch(t){console.error("Error during load:",t),this.logFetchError("processing",t,"string"==typeof s?s:void 0,e)}finally{this.isProcessing=!1}}})),this.infiniteScroll?.on("error",((t,s,e)=>{const i=e;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,i)})),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()}refreshInfiniteScrollMeasurements(){this.autoload&&this.infiniteScroll?.updateMeasurements&&this.waitForStableLayout(document.body).then((()=>this.infiniteScroll?.updateMeasurements?.()))}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 n.injectExtraFieldsToResponse(t)}catch(t){console.error("Error injecting data:",t)}}getInitialData(){return this.loading(),salla.api.withoutNotifier((()=>salla.product.api.fetch({source:n.getApiSource(this.getSource()),source_value:this.getSourceValue(),limit:this.limit}).catch((t=>{const s=t?.response,e=s?.request?.responseURL||t?.config?.url;throw this.logFetchError("fetch",t,e,{status:s?.status,url:e,headers:s?.headers}),t})).then((async t=>t.data.length?(await n.injectExtraFieldsToResponse(t),this.firstPageResponse?void this.appendProductCards(await this.handleResponse(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 e=this.wrapper.children[s];e?.product&&t.push(e.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=n.extractFiltersFromUrl(t),this.parsedFilters&&this.parsedFilters.category_id&&(this.currentCategoryIdFilter=this.toCategoryIdFilter(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.appendProductCards(this.getSourceValue().map((t=>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.refreshInfiniteScrollMeasurements()):!this.firstPageResponse&&this.switchToNormalBehavior?this.getInitialData().then((async()=>{this.firstPageResponse?(this.appendProductCards(await this.handleResponse(this.firstPageResponse,!1)),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&&this.appendProductCards(await this.handleResponse(this.firstPageResponse,!1)),await this.refreshWishlistIconsAfterHydration()}canRender(){return this.sourceValueIsValid&&this.isReady}render(){return this.canRender()?this.showPlaceholder?e("div",{class:"s-products-list-placeholder"},e("span",{innerHTML:a}),e("p",null,this.placeholderText)):e(i,{class:"s-products-list"},e("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}),e("div",{class:"s-infinite-scroll-status",ref:t=>this.status=t},e("p",{class:"s-infinite-scroll-last infinite-scroll-last s-hidden"},this.endOfText),e("p",{class:"s-infinite-scroll-error infinite-scroll-error s-hidden"},this.failedLoadMore)),this.autoload&&e("div",{class:"s-products-list-loading-wrapper",style:{display:"none"},ref:t=>this.loader=t},e("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"})),this.hasInfiniteScroll&&this.nextPage&&!this.autoload?e("div",{class:"s-infinite-scroll-wrapper",style:{display:"none"},ref:t=>this.loadMoreWrapper=t},e("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},e("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),e("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 e=this.getSource();if(1===t.cursor?.current){if(!this.isAuxiliaryProductsListSource()){let s=n.getPageTitleForSource(e);try{if("search"===this.getSource())s=salla.lang.get("common.elements.search_about",{word:this.getSourceValue()});else if(!s){let e=Object.keys(this.parsedFilters||{}).length?null:this.getSourceValue()[0];s=t.filters?.find((t=>"category_id"===t.key))?.values?.find((t=>t.key==e))?.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)}}n.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"));let i=await this.applyBeforeAppendItems(t.data);const r=[];for(let t=0;t<i.length;t++)r.push(this.getItemHTML(i[t]));return r}async applyBeforeAppendItems(t){const s={component:this,items:t};try{return await salla.hooks.call("salla-products-list","beforeAppendItems",s),Array.isArray(s.items)?s.items:t}catch{return t}}get host(){return r(this)}static get watchers(){return{selectable:["onSelectableChanged"]}}};l.style="/*!twlt*/.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}.sticky{position:sticky}.block{display:block}.grid{display:grid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-products-list-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-products-list-placeholder p{padding-top:0.5rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-products-list-placeholder span{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-products-list-placeholder span svg{margin-left:auto;margin-right:auto;height:4rem;width:4rem;fill:#d1d5db;text-align:center}.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-hidden{display:none}.s-offer-products-list-single-column .s-products-list-wrapper{display:grid !important;grid-template-columns:repeat(1, minmax(0, 1fr)) !important;gap:0.75rem}.s-offer-drawer-card .s-products-list-compact-cards{margin-bottom:0px !important}.s-order-edit-products-list .s-products-list-wrapper{gap:1rem;grid-template-columns:repeat(2,minmax(0,1fr))}@media (min-width: 769px){.s-order-edit-products-list .s-products-list-wrapper{grid-template-columns:repeat(3, minmax(0, 1fr))}}.s-order-edit-mobile-products-modal .products-list .s-products-list-wrapper{gap:0.625rem;grid-template-columns:repeat(2,minmax(0,1fr))}.s-products-list-wrapper{margin-bottom:2rem;display:grid}.s-products-list-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-products-list-placeholder p{padding-top:0.5rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-products-list-row-cards{display:grid;gap:1rem}.s-products-list-vertical-cards{grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.625rem}@media (min-width: 640px){.s-products-list-vertical-cards{gap:1rem}}@media (min-width: 768px){.s-products-list-vertical-cards{grid-template-columns:repeat(3, minmax(0, 1fr));gap:1.5rem}}@media (min-width: 1024px){.s-products-list-vertical-cards{grid-template-columns:repeat(4, minmax(0, 1fr))}}.s-products-list-loading-wrapper{display:flex;height:5rem;align-items:center;justify-content:center}.s-products-list-filters-results{grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.625rem}@media (min-width: 640px){.s-products-list-filters-results{gap:1rem}}@media (min-width: 768px){.s-products-list-filters-results{grid-template-columns:repeat(3, minmax(0, 1fr));gap:1.5rem}}.s-products-list-horizontal-cards{grid-template-columns:repeat(1, minmax(0, 1fr));gap:1rem}@media (min-width: 640px){.s-products-list-horizontal-cards{gap:2rem}}@media (min-width: 1024px){.s-products-list-horizontal-cards{grid-template-columns:repeat(2, minmax(0, 1fr))}}.s-products-list-compact-cards{display:flex !important;flex-direction:column !important;gap:0px !important}.s-products-list-placeholder span{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-products-list-placeholder span svg{margin-left:auto;margin-right:auto;height:4rem;width:4rem;fill:#d1d5db;text-align:center}/*!twlt*/.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-infinite-scroll-wrapper{margin-top:1rem;text-align:center}.s-infinite-scroll-last{margin:0px;text-align:center}.s-infinite-scroll-error{margin:0px;text-align:center}";export{l as salla_products_list}
4
+ import{r as t,c as s,h as e,H as i,a as r}from"./p-RGVg6FYq.js";import{a as o}from"./p-CgtvEd63.js";import{S as a}from"./p-DiKTtDW5.js";import{H as n}from"./p-DOBDDG4K.js";const l=class{constructor(e){t(this,e),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 e=String(s),i=this.hasCustomComponent?this.productCardComponent:"salla-product-card";for(const t of Array.from(this.wrapper.children)){const s=t,r=t.querySelector(i),o=s.product?.id??r?.product?.id;if(null!=o&&String(o)===e){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)===e&&!t.querySelector(i)){t.remove();break}}if(this.selectable){for(const t of Array.from(this.selectedProducts.keys()))String(t)===e&&this.selectedProducts.delete(t);this.emitSelection()}},this.onWishlistStorageSynced=()=>n.syncWishlistIcons(this.wrapper,`${this.productCardComponent}, salla-product-card`),this.includes=n.parseJson(this.includes||this.host.getAttribute("includes")),Array.isArray(this.includes)||(this.includes=null),n.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),salla.event.on("wishlist::storage.synced",this.onWishlistStorageSynced)}disconnectedCallback(){window.removeEventListener("DOMContentLoaded",this.boundScrollToLastViewedProduct),window.removeEventListener("scroll",this.boundHandleScroll),salla.event.off("wishlist::removed",this.onWishlistItemRemoved),salla.event.off("wishlist::storage.synced",this.onWishlistStorageSynced)}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.currentCategoryIdFilter=this.parsedFilters?.category_id?this.toCategoryIdFilter(this.parsedFilters.category_id):null),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[e,i]of Object.entries(s))this.nextPage+=`&filters[${encodeURIComponent(t)}][${encodeURIComponent(e)}]=${encodeURIComponent(i)}`;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=>{const e=s.target;e.closest("a")?(n.saveProductSource(this.getSource()),n.saveProductPosition(t.position),this.hasInfiniteScroll&&(this.takeStateSnapshot(),sessionStorage.setItem(this.lastViewedProductKey,t.id))):e.closest("salla-add-product-button")&&n.saveProductPosition(t.position)})),this.selectable?this.wrapSelectableItem(s,t):s}wrapSelectableItem(t,s){const e=document.createElement("div");e.className="s-products-list-selectable-item",e.product=s;const i=this.selectedProducts.has(s.id);i&&e.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=i,o.addEventListener("change",(()=>this.toggleSelection(s,e,o.checked))),r.appendChild(o),e.appendChild(r),e.appendChild(t),e}toggleSelection(t,s,e){e?(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()),e={ids:s,products:t,count:s.length};this.selectionChanged.emit(e),salla.event.emit("salla-products-list::selection.changed",e)}appendProductCards(t){this.wrapper&&((Array.isArray(t)?t:[t]).forEach((t=>this.wrapper.append(t))),this.onWishlistStorageSynced())}refreshWishlistIconsAfterHydration(){return salla.wishlist.api.syncStorageFromServer()}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((e=>{const i=new ResizeObserver((()=>{clearTimeout(s),s=setTimeout((()=>{i.disconnect(),e(null)}),160)}));i.observe(t)}))}waitForLayoutStable(t){let s=null,e=null;return new Promise((i=>{let r;const o=()=>{clearTimeout(s),clearTimeout(e),r.disconnect(),i(null)};r=new MutationObserver((()=>{clearTimeout(s),s=setTimeout(o,160)})),r.observe(t,{childList:!0,subtree:!0,attributes:!0}),e=setTimeout(o,1e3)}))}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 e=()=>{const t=()=>{s.scrollIntoView({block:"start",behavior:"instant"});const t=matchMedia("(max-width: 1024px)").matches?"header .inner":"ul.main-menu",e=window?.header_is_sticky?document.querySelector(t)?.getBoundingClientRect()?.height??56:0,i=parseInt(getComputedStyle(this.wrapper).rowGap)??16;scrollBy({top:-1*(e+i),behavior:"instant"})};requestAnimationFrame(t),s.querySelectorAll("img.lazy").forEach((s=>{const e=s,i=()=>{requestAnimationFrame(t),e.onload=e.onerror=null};e.onload=i,e.onerror=i})),this.removeScrollRestorationSession()};this.waitForStableLayout(this.host).then((()=>requestAnimationFrame(e)))}))}isElementLoaded(t){return new Promise((s=>{const e=setInterval((()=>{if(document.querySelector(t))return clearInterval(e),s(document.querySelector(t))}),50)}))}takeStateSnapshot(){const t=[];for(let s=0;s<this.wrapper.children.length;s++){const e=this.wrapper.children?.[s];t.push(e.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 e=salla.config.get("page.id");const i=Object.keys(this.specialPagesWithoutIds).find((t=>salla.url.is_page(t)));i?e=this.specialPagesWithoutIds[i]:null!==e&&(e=String(e)),sessionStorage.setItem(this.prevCategoryIdKey,e)}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),e=sessionStorage.getItem(this.prevCategoryIdKey),i=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"),n=i?e!==i:e!==String(r);if(e&&n&&!o&&!a||o&&!this.hasInfiniteScroll)return this.removeScrollRestorationSession(),this.switchToNormalBehavior=!0,!1;if(a)return this.switchToNormalBehavior=!0,!1;if(t)try{const{pageIndex:e,nextPage:i,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})}return this.page=e,this.nextPage=i,this.appendProductCards(r.map((t=>this.getItemHTML(t)))),!0}catch(t){console.error("Failed to load stored scroll state:",t),this.removeScrollRestorationSession()}return!1}getSource(){return n.getProductsSource(this.source)}isAuxiliaryProductsListSource(){return["json","selected","related","landing-page","recently"].includes(this.getSource())}toCategoryIdFilter(t){return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[t]}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:n.getProductsSourceValue(this.source,this.sourceValue)}getResponseHeader(t,s){if(!t)return;if("function"==typeof t.get)return t.get(s)||void 0;const e=t[s]??t[s.toLowerCase()];return"string"==typeof e?e:Array.isArray(e)&&"string"==typeof e[0]?e[0]:void 0}logFetchError(t,s,e,i){try{const r=s instanceof Error?s.name:void 0,o=s instanceof Error?s.message:String(s),a=i?.url||e,n=this.getResponseHeader(i?.headers,"cf-ray"),l=this.getResponseHeader(i?.headers,"cf-mitigated"),c=this.getResponseHeader(i?.headers,"server"),h="challenge"===l?.toLowerCase()||403===i?.status&&(!!n||!!c?.toLowerCase().includes("cloudflare")),d=`${r||""} ${o}`;let p="processing"===t?"processing":"unknown";"fetch"===t&&(h?p="cloudflare":/(?:^|\/)null(?:[/?#]|$)/i.test(a||"")?p="invalid_url":/timeout|timed out|abort/i.test(d)?p="timeout":!i?.status&&/fetch|network|load failed|connection/i.test(d)?p="network":i?.status&&(p="http")),salla.analytics?.log("salla::products.list.fetch.error",{errorPhase:t,failureType:p,cloudflareBlock:h,sourceList:this.getSource(),pageIndex:this.infiniteScroll?.pageIndex,httpStatus:i?.status,responseUrl:a,cfRay:n,cfMitigated:l,errorName:r,errorMessage:o.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,e)=>{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),this.onWishlistStorageSynced(),2===this.infiniteScroll.pageIndex&&(!this.autoload&&this.nextPage&&(this.loadMoreWrapper.style.display="block"),this.animateItems(),this.refreshInfiniteScrollMeasurements())}catch(t){console.error("Error during load:",t),this.logFetchError("processing",t,"string"==typeof s?s:void 0,e)}finally{this.isProcessing=!1}}})),this.infiniteScroll?.on("error",((t,s,e)=>{const i=e;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,i)})),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()}refreshInfiniteScrollMeasurements(){this.autoload&&this.infiniteScroll?.updateMeasurements&&this.waitForStableLayout(document.body).then((()=>this.infiniteScroll?.updateMeasurements?.()))}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 n.injectExtraFieldsToResponse(t)}catch(t){console.error("Error injecting data:",t)}}getInitialData(){return this.loading(),salla.api.withoutNotifier((()=>salla.product.api.fetch({source:n.getApiSource(this.getSource()),source_value:this.getSourceValue(),limit:this.limit}).catch((t=>{const s=t?.response,e=s?.request?.responseURL||t?.config?.url;throw this.logFetchError("fetch",t,e,{status:s?.status,url:e,headers:s?.headers}),t})).then((async t=>t.data.length?(await n.injectExtraFieldsToResponse(t),this.firstPageResponse?void this.appendProductCards(await this.handleResponse(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 e=this.wrapper.children[s];e?.product&&t.push(e.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=n.extractFiltersFromUrl(t),this.parsedFilters&&this.parsedFilters.category_id&&(this.currentCategoryIdFilter=this.toCategoryIdFilter(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.appendProductCards(this.getSourceValue().map((t=>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.refreshInfiniteScrollMeasurements()):!this.firstPageResponse&&this.switchToNormalBehavior?this.getInitialData().then((async()=>{this.firstPageResponse?(this.appendProductCards(await this.handleResponse(this.firstPageResponse,!1)),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&&this.appendProductCards(await this.handleResponse(this.firstPageResponse,!1)),await this.refreshWishlistIconsAfterHydration()}canRender(){return this.sourceValueIsValid&&this.isReady}render(){return this.canRender()?this.showPlaceholder?e("div",{class:"s-products-list-placeholder"},e("span",{innerHTML:a}),e("p",null,this.placeholderText)):e(i,{class:"s-products-list"},e("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}),e("div",{class:"s-infinite-scroll-status",ref:t=>this.status=t},e("p",{class:"s-infinite-scroll-last infinite-scroll-last s-hidden"},this.endOfText),e("p",{class:"s-infinite-scroll-error infinite-scroll-error s-hidden"},this.failedLoadMore)),this.autoload&&e("div",{class:"s-products-list-loading-wrapper",style:{display:"none"},ref:t=>this.loader=t},e("span",{class:"s-button-loader s-button-loader-center s-infinite-scroll-btn-loader"})),this.hasInfiniteScroll&&this.nextPage&&!this.autoload?e("div",{class:"s-infinite-scroll-wrapper",style:{display:"none"},ref:t=>this.loadMoreWrapper=t},e("button",{onClick:()=>this.loadMore(),class:"s-infinite-scroll-btn s-button-btn s-button-primary"},e("span",{class:"s-button-text s-infinite-scroll-btn-text"},this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")),e("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 e=this.getSource();if(1===t.cursor?.current){if(!this.isAuxiliaryProductsListSource()){let s=n.getPageTitleForSource(e);try{if("search"===this.getSource())s=salla.lang.get("common.elements.search_about",{word:this.getSourceValue()});else if(!s){let e=Object.keys(this.parsedFilters||{}).length?null:this.getSourceValue()[0];s=t.filters?.find((t=>"category_id"===t.key))?.values?.find((t=>t.key==e))?.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)}}n.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"));let i=await this.applyBeforeAppendItems(t.data);const r=[];for(let t=0;t<i.length;t++)r.push(this.getItemHTML(i[t]));return r}async applyBeforeAppendItems(t){const s={component:this,items:t};try{return await salla.hooks.call("salla-products-list","beforeAppendItems",s),Array.isArray(s.items)?s.items:t}catch{return t}}get host(){return r(this)}static get watchers(){return{selectable:["onSelectableChanged"]}}};l.style="/*!twlt*/.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}.sticky{position:sticky}.block{display:block}.grid{display:grid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-products-list-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-products-list-placeholder p{padding-top:0.5rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-products-list-placeholder span{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-products-list-placeholder span svg{margin-left:auto;margin-right:auto;height:4rem;width:4rem;fill:#d1d5db;text-align:center}.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-hidden{display:none}.s-offer-products-list-single-column .s-products-list-wrapper{display:grid !important;grid-template-columns:repeat(1, minmax(0, 1fr)) !important;gap:0.75rem}.s-offer-drawer-card .s-products-list-compact-cards{margin-bottom:0px !important}.s-order-edit-products-list .s-products-list-wrapper{gap:1rem;grid-template-columns:repeat(2,minmax(0,1fr))}@media (min-width: 769px){.s-order-edit-products-list .s-products-list-wrapper{grid-template-columns:repeat(3, minmax(0, 1fr))}}.s-order-edit-mobile-products-modal .products-list .s-products-list-wrapper{gap:0.625rem;grid-template-columns:repeat(2,minmax(0,1fr))}.s-products-list-wrapper{margin-bottom:2rem;display:grid}.s-products-list-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding-top:2.5rem;padding-bottom:5rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-products-list-placeholder p{padding-top:0.5rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-products-list-row-cards{display:grid;gap:1rem}.s-products-list-vertical-cards{grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.625rem}@media (min-width: 640px){.s-products-list-vertical-cards{gap:1rem}}@media (min-width: 768px){.s-products-list-vertical-cards{grid-template-columns:repeat(3, minmax(0, 1fr));gap:1.5rem}}@media (min-width: 1024px){.s-products-list-vertical-cards{grid-template-columns:repeat(4, minmax(0, 1fr))}}.s-products-list-loading-wrapper{display:flex;height:5rem;align-items:center;justify-content:center}.s-products-list-filters-results{grid-template-columns:repeat(2, minmax(0, 1fr));gap:0.625rem}@media (min-width: 640px){.s-products-list-filters-results{gap:1rem}}@media (min-width: 768px){.s-products-list-filters-results{grid-template-columns:repeat(3, minmax(0, 1fr));gap:1.5rem}}.s-products-list-horizontal-cards{grid-template-columns:repeat(1, minmax(0, 1fr));gap:1rem}@media (min-width: 640px){.s-products-list-horizontal-cards{gap:2rem}}@media (min-width: 1024px){.s-products-list-horizontal-cards{grid-template-columns:repeat(2, minmax(0, 1fr))}}.s-products-list-compact-cards{display:flex !important;flex-direction:column !important;gap:0px !important}.s-products-list-placeholder span{margin-bottom:1rem;display:flex;height:8rem;width:8rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));font-size:3rem;line-height:1;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-products-list-placeholder span svg{margin-left:auto;margin-right:auto;height:4rem;width:4rem;fill:#d1d5db;text-align:center}/*!twlt*/.s-button-btn{position:relative;display:inline-flex;flex:1 1 0%;user-select:none;flex-direction:row-reverse;align-items:center;justify-content:center;white-space:nowrap;border-radius:var(--s-radius, 0.25rem);border-style:solid;padding-left:1.5rem;padding-right:1.5rem;padding-bottom:0.625rem;padding-top:0.5rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-btn:hover{opacity:0.8}.s-button-primary{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-button-primary:hover{background-color:var(--color-primary-dark)}.s-button-text{pointer-events:none;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-button-loader{margin-left:0.5rem;margin-right:0.5rem;display:flex;align-items:center;justify-content:center;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-button-loader::before{display:inline-block;height:1rem;content:var(--tw-content);width:1rem}@keyframes spin{to{content:var(--tw-content);transform:rotate(360deg)}}.s-button-loader::before{animation:spin 1s linear infinite;border-radius:9999px;border-width:2px;border-style:solid;border-top-color:var(--color-primary);border-left-color:var(--color-primary);border-bottom-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-border-opacity:1;border-right-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-content:'';content:var(--tw-content)}.s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;margin:0px !important;--tw-translate-y:-50%;--tw-translate-x:-50%;transform:translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-infinite-scroll-wrapper{margin-top:1rem;text-align:center}.s-infinite-scroll-last{margin:0px;text-align:center}.s-infinite-scroll-error{margin:0px;text-align:center}";export{l as salla_products_list}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,a as i}from"./p-CHZfg_a9.js";const a=class{constructor(t){e(this,t),this.hasError=!1,salla.event.on("size-guide::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}async open(e){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(e))).then((e=>{this.guides=e.data})).catch((e=>{console.log(e),this.hasError=!0,this.placeholder_description=e.response?.data?.error?.message||e.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return t("salla-placeholder",{alignment:"center",iconSize:"xl"},t("div",{slot:"title"},this.placeholder_title),t("div",{slot:"description"},this.placeholder_description))}render(){return t("salla-modal",{key:"063a407b20a58cd485aab5545bc36ef7bcf97bda",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},t("span",{key:"f3020bc65b716269d77e46bf28a6ff610ebff117",slot:"icon",class:"s-product-size-guide-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),t("div",{key:"588de84c8b24de3331ff825a29e8332c1c426752",slot:"loading"},t("div",{key:"be0c2882631109efd8099d96cc9c8b22ff266893",class:"s-product-size-guide-skeleton"},t("salla-skeleton",{key:"04030e4cb75e1f49d939d1c87b97eb0fe73eff0f",height:"15px",width:"25%"}),t("div",{key:"1576c0a47284315aa3ec408d75bcbb261f230b3f",class:"s-product-size-guide-skeleton-header"},t("salla-skeleton",{key:"4edba887e3a631d1fccaa4379c3f7b9ebc8e3fb9",height:"40px"}),t("salla-skeleton",{key:"da6c9bdf9eb7cb8cd6366b9dc954055ed3f79607",height:"40px"}),t("salla-skeleton",{key:"322e2e5d0f05949a6a957b695c6f557512acc689",height:"40px"}),t("salla-skeleton",{key:"4914a613bf190d2fc7029098ba7c7fd54bdace4c",height:"40px"})),t("div",{key:"209144302d7127ffc6933519db28d9cba949827f",class:"s-product-size-guide-skeleton-content"},t("salla-skeleton",{key:"cca674f6d7fe8a88c240b38df567f2980efdb9e1",height:"15px",width:"25%"}),t("salla-skeleton",{key:"9754e50822954fa6a333634a40d4414cc1785c04",height:"10px",width:"75%"}),t("salla-skeleton",{key:"b18e8d9fb7d1ddb9766fb9b24285480dbeb6d678",height:"10px",width:"50%"}),t("salla-skeleton",{key:"6904a849b03278f8a99aa5056772f58d14ecc10e",height:"10px",width:"75%"}),t("salla-skeleton",{key:"357446cfbab8c5b5062ef582dabc5a41b987a2d6",height:"10px",width:"100%"}),t("salla-skeleton",{key:"b8d2ab21d3c68f1f7c325aac46c6574b8f62878c",height:"10px",width:"25%"}),t("salla-skeleton",{key:"578de2e17060b4b8f1d8e18e77e423b8a2ca746f",height:"10px",width:"60%"}),t("salla-skeleton",{key:"442da0c1997e968f77ef7d5ea14b507387004814",height:"10px",width:"45%"}),t("salla-skeleton",{key:"0ff2e33c0f931e577b020e83f5704454169c697a",height:"10px",width:"30%"})))),t("slot",{key:"83f7baaa539d8084e6efb898a865723fab3552ff",name:"header"}),!this.hasError&&this.guides?[t("salla-tabs",null,this.guides.map((e=>t("salla-tab-header",{slot:"header",name:e.name},t("span",null,e.name)))),this.guides.map((e=>t("salla-tab-content",{slot:"content",name:e.name},t("div",{innerHTML:e.description})))))]:this.showPlaceholder(),t("slot",{key:"598c8e9603633bbb4d89f767237eda21282b4e04",name:"footer"}))}get host(){return i(this)}};a.style='/*!twlt*/.s-product-size-guide-wrapper .s-modal-title{margin-bottom:0px !important}.s-product-size-guide-wrapper .s-tabs-content{max-height:60vh;overflow:auto}@media (min-width: 768px){.s-product-size-guide-wrapper .s-tabs-content{max-height:70vh}}.s-product-size-guide-placeholder{display:flex;align-items:center;justify-content:center}.s-product-size-guide-skeleton-table{margin-top:1.25rem;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));line-height:1.25rem}.s-product-size-guide-skeleton-table td{border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;line-height:1.25rem}.s-product-size-guide-header-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-product-size-guide-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-product-size-guide-header-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-product-size-guide-skeleton-content{margin-top:1.25rem;display:flex;flex-direction:column}.s-product-size-guide-skeleton-content>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))}.s-product-size-guide-skeleton-header{margin-top:2rem;margin-bottom:2rem;display:flex;align-items:center;justify-content:space-between}.s-product-size-guide-skeleton-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-size-guide-skeleton-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-size-guide-skeleton-header>salla-skeleton{flex:1 1 0%}';export{a as salla_product_size_guide}
4
+ import{r as e,h as t,a as i}from"./p-RGVg6FYq.js";const a=class{constructor(t){e(this,t),this.hasError=!1,salla.event.on("size-guide::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.placeholder_title=salla.lang.get("pages.products.size_guide_placeholder"),this.placeholder_description=salla.lang.get("pages.products.size_guide_placeholder_info"),this.modal_title=salla.lang.get("pages.products.size_guides")}))}async open(e){return this.modal.setTitle(this.modal_title),this.modal.open(),await salla.api.withoutNotifier((()=>salla.product.getSizeGuides(e))).then((e=>{this.guides=e.data})).catch((e=>{console.log(e),this.hasError=!0,this.placeholder_description=e.response?.data?.error?.message||e.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}showPlaceholder(){return t("salla-placeholder",{alignment:"center",iconSize:"xl"},t("div",{slot:"title"},this.placeholder_title),t("div",{slot:"description"},this.placeholder_description))}render(){return t("salla-modal",{key:"063a407b20a58cd485aab5545bc36ef7bcf97bda",class:"s-product-size-guide-wrapper",id:"salla-product-size-guide-modal",isLoading:!0,"has-skeleton":!0,width:"md",ref:e=>this.modal=e},t("span",{key:"f3020bc65b716269d77e46bf28a6ff610ebff117",slot:"icon",class:"s-product-size-guide-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>pencil-ruler</title>\n<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>\n</svg>\n'}),t("div",{key:"588de84c8b24de3331ff825a29e8332c1c426752",slot:"loading"},t("div",{key:"be0c2882631109efd8099d96cc9c8b22ff266893",class:"s-product-size-guide-skeleton"},t("salla-skeleton",{key:"04030e4cb75e1f49d939d1c87b97eb0fe73eff0f",height:"15px",width:"25%"}),t("div",{key:"1576c0a47284315aa3ec408d75bcbb261f230b3f",class:"s-product-size-guide-skeleton-header"},t("salla-skeleton",{key:"4edba887e3a631d1fccaa4379c3f7b9ebc8e3fb9",height:"40px"}),t("salla-skeleton",{key:"da6c9bdf9eb7cb8cd6366b9dc954055ed3f79607",height:"40px"}),t("salla-skeleton",{key:"322e2e5d0f05949a6a957b695c6f557512acc689",height:"40px"}),t("salla-skeleton",{key:"4914a613bf190d2fc7029098ba7c7fd54bdace4c",height:"40px"})),t("div",{key:"209144302d7127ffc6933519db28d9cba949827f",class:"s-product-size-guide-skeleton-content"},t("salla-skeleton",{key:"cca674f6d7fe8a88c240b38df567f2980efdb9e1",height:"15px",width:"25%"}),t("salla-skeleton",{key:"9754e50822954fa6a333634a40d4414cc1785c04",height:"10px",width:"75%"}),t("salla-skeleton",{key:"b18e8d9fb7d1ddb9766fb9b24285480dbeb6d678",height:"10px",width:"50%"}),t("salla-skeleton",{key:"6904a849b03278f8a99aa5056772f58d14ecc10e",height:"10px",width:"75%"}),t("salla-skeleton",{key:"357446cfbab8c5b5062ef582dabc5a41b987a2d6",height:"10px",width:"100%"}),t("salla-skeleton",{key:"b8d2ab21d3c68f1f7c325aac46c6574b8f62878c",height:"10px",width:"25%"}),t("salla-skeleton",{key:"578de2e17060b4b8f1d8e18e77e423b8a2ca746f",height:"10px",width:"60%"}),t("salla-skeleton",{key:"442da0c1997e968f77ef7d5ea14b507387004814",height:"10px",width:"45%"}),t("salla-skeleton",{key:"0ff2e33c0f931e577b020e83f5704454169c697a",height:"10px",width:"30%"})))),t("slot",{key:"83f7baaa539d8084e6efb898a865723fab3552ff",name:"header"}),!this.hasError&&this.guides?[t("salla-tabs",null,this.guides.map((e=>t("salla-tab-header",{slot:"header",name:e.name},t("span",null,e.name)))),this.guides.map((e=>t("salla-tab-content",{slot:"content",name:e.name},t("div",{innerHTML:e.description})))))]:this.showPlaceholder(),t("slot",{key:"598c8e9603633bbb4d89f767237eda21282b4e04",name:"footer"}))}get host(){return i(this)}};a.style='/*!twlt*/.s-product-size-guide-wrapper .s-modal-title{margin-bottom:0px !important}.s-product-size-guide-wrapper .s-tabs-content{max-height:60vh;overflow:auto}@media (min-width: 768px){.s-product-size-guide-wrapper .s-tabs-content{max-height:70vh}}.s-product-size-guide-placeholder{display:flex;align-items:center;justify-content:center}.s-product-size-guide-skeleton-table{margin-top:1.25rem;width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));line-height:1.25rem}.s-product-size-guide-skeleton-table td{border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.5rem;line-height:1.25rem}.s-product-size-guide-header-icon{display:inline-flex;height:3rem;width:3rem;align-items:center;justify-content:center;border-radius:9999px;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}@media (min-width: 640px){.s-product-size-guide-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-product-size-guide-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-product-size-guide-header-icon svg{height:1.25rem;width:1.25rem;flex-shrink:0;fill:#9ca3af}.s-product-size-guide-skeleton-content{margin-top:1.25rem;display:flex;flex-direction:column}.s-product-size-guide-skeleton-content>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.75rem * var(--tw-space-y-reverse))}.s-product-size-guide-skeleton-header{margin-top:2rem;margin-bottom:2rem;display:flex;align-items:center;justify-content:space-between}.s-product-size-guide-skeleton-header>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-size-guide-skeleton-header:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-size-guide-skeleton-header>salla-skeleton{flex:1 1 0%}';export{a as salla_product_size_guide}