@salla.sa/twilight-components 2.14.549 → 2.14.551

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 (341) hide show
  1. package/dist/cjs/{Helper-6RI07gZo.js → Helper-D1YsoJud.js} +46 -0
  2. package/dist/cjs/{filepond-COUccQWv.js → filepond-C99K1KEB.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-B_yyvbJ6.js → filepond-plugin-file-poster-CggRjTNg.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-KDZtJpSs.js → filepond-plugin-file-validate-size-B009kdAV.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-Dbm_-1V2.js → filepond-plugin-file-validate-type-DZs9-bai.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-C-q8yFXi.js → filepond-plugin-image-edit-DNNheErX.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-C2Q2chpj.js → filepond-plugin-image-exif-orientation-ChN0IpOy.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-DVK8eIMv.js → filepond-plugin-image-preview-BZo2ftGo.js} +1 -1
  9. package/dist/cjs/{index-CSq9uCjw.js → index-0JUvtl0d.js} +6 -2
  10. package/dist/cjs/{intlTelInput-NQOLNYxO.js → intlTelInput-D84-rI5D.js} +1 -1
  11. package/dist/cjs/loader.cjs.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 +2 -2
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  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-applied-filters.cjs.entry.js +175 -0
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +10 -11
  38. package/dist/cjs/salla-filters.cjs.entry.js +14 -79
  39. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  62. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  77. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  83. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
  86. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  87. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  91. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  105. package/dist/cjs/twilight.cjs.js +2 -2
  106. package/dist/cjs/{vanilla-picker-My41190Y.js → vanilla-picker-D8r5xyK7.js} +1 -1
  107. package/dist/collection/Helpers/Helper.js +28 -0
  108. package/dist/collection/collection-manifest.json +1 -0
  109. package/dist/collection/components/salla-applied-filters/salla-applied-filters.css +115 -0
  110. package/dist/collection/components/salla-applied-filters/salla-applied-filters.js +185 -0
  111. package/dist/collection/components/salla-filters/salla-filters.css +0 -119
  112. package/dist/collection/components/salla-filters/salla-filters.js +27 -73
  113. package/dist/components/Helper.js +47 -1
  114. package/dist/components/index.js +2 -2
  115. package/dist/components/salla-applied-filters.d.ts +11 -0
  116. package/dist/components/salla-applied-filters.js +195 -0
  117. package/dist/components/salla-filters-widget2.js +2 -21
  118. package/dist/components/salla-filters.js +10 -76
  119. package/dist/esm/{Helper-CBmYxrzX.js → Helper-DsjZ6kte.js} +47 -1
  120. package/dist/esm/{filepond-CA4TWKuz.js → filepond-DuMUHI7t.js} +1 -1
  121. package/dist/esm/{filepond-plugin-file-poster-C4_NyGjO.js → filepond-plugin-file-poster-Dv25V2UU.js} +1 -1
  122. package/dist/esm/{filepond-plugin-file-validate-size-DVV7mZ-K.js → filepond-plugin-file-validate-size-Dxl4yPm6.js} +1 -1
  123. package/dist/esm/{filepond-plugin-file-validate-type-DT1IX9KM.js → filepond-plugin-file-validate-type-C602myuq.js} +1 -1
  124. package/dist/esm/{filepond-plugin-image-edit-RrqhOPfq.js → filepond-plugin-image-edit-DLd3ht_R.js} +1 -1
  125. package/dist/esm/{filepond-plugin-image-exif-orientation-Dc9_Qlva.js → filepond-plugin-image-exif-orientation-BaQ5DNLu.js} +1 -1
  126. package/dist/esm/{filepond-plugin-image-preview-Iu7ULzAy.js → filepond-plugin-image-preview-C-RFNs7l.js} +1 -1
  127. package/dist/esm/{index-C0qiFNJn.js → index-BsIeN-bg.js} +6 -2
  128. package/dist/esm/{intlTelInput-CrkMI_sC.js → intlTelInput-Cf6zBu5Y.js} +1 -1
  129. package/dist/esm/loader.js +3 -3
  130. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  131. package/dist/esm/salla-accordion_6.entry.js +2 -2
  132. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  133. package/dist/esm/salla-advertisement.entry.js +1 -1
  134. package/dist/esm/salla-alert_2.entry.js +1 -1
  135. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  136. package/dist/esm/salla-applied-filters.entry.js +173 -0
  137. package/dist/esm/salla-apps-icons.entry.js +1 -1
  138. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  139. package/dist/esm/salla-badge.entry.js +1 -1
  140. package/dist/esm/salla-basket-gap.entry.js +1 -1
  141. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  142. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  143. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  144. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  145. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  146. package/dist/esm/salla-comment-factors.entry.js +1 -1
  147. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  148. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  149. package/dist/esm/salla-contacts.entry.js +1 -1
  150. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  151. package/dist/esm/salla-count-down.entry.js +1 -1
  152. package/dist/esm/salla-custom-fields.entry.js +1 -1
  153. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  154. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  155. package/dist/esm/salla-filters-widget.entry.js +2 -3
  156. package/dist/esm/salla-filters.entry.js +8 -73
  157. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  158. package/dist/esm/salla-gifting.entry.js +1 -1
  159. package/dist/esm/salla-hook.entry.js +1 -1
  160. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  161. package/dist/esm/salla-installment.entry.js +1 -1
  162. package/dist/esm/salla-list-tile.entry.js +1 -1
  163. package/dist/esm/salla-localization-modal.entry.js +1 -1
  164. package/dist/esm/salla-login-modal.entry.js +1 -1
  165. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  166. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  167. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  168. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  169. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  170. package/dist/esm/salla-loyalty.entry.js +1 -1
  171. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  172. package/dist/esm/salla-map_2.entry.js +1 -1
  173. package/dist/esm/salla-menu.entry.js +1 -1
  174. package/dist/esm/salla-metadata.entry.js +1 -1
  175. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  176. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  177. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  178. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  179. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  180. package/dist/esm/salla-offer-modal.entry.js +1 -1
  181. package/dist/esm/salla-offer.entry.js +1 -1
  182. package/dist/esm/salla-order-branch.entry.js +1 -1
  183. package/dist/esm/salla-order-cancel.entry.js +1 -1
  184. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  185. package/dist/esm/salla-order-details-options.entry.js +1 -1
  186. package/dist/esm/salla-order-details.entry.js +1 -1
  187. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  188. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  189. package/dist/esm/salla-order-edit.entry.js +1 -1
  190. package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
  191. package/dist/esm/salla-order-shipments.entry.js +1 -1
  192. package/dist/esm/salla-order-summary.entry.js +1 -1
  193. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  194. package/dist/esm/salla-orders.entry.js +2 -2
  195. package/dist/esm/salla-payments.entry.js +1 -1
  196. package/dist/esm/salla-placeholder.entry.js +1 -1
  197. package/dist/esm/salla-price-range.entry.js +1 -1
  198. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  199. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  200. package/dist/esm/salla-products-list.entry.js +2 -2
  201. package/dist/esm/salla-products-slider.entry.js +2 -2
  202. package/dist/esm/salla-quick-order.entry.js +1 -1
  203. package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
  204. package/dist/esm/salla-rating-modal.entry.js +2 -2
  205. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  206. package/dist/esm/salla-review-order-item.entry.js +1 -1
  207. package/dist/esm/salla-scopes.entry.js +1 -1
  208. package/dist/esm/salla-search.entry.js +2 -2
  209. package/dist/esm/salla-skeleton.entry.js +1 -1
  210. package/dist/esm/salla-slider.entry.js +1 -1
  211. package/dist/esm/salla-social-share.entry.js +1 -1
  212. package/dist/esm/salla-social.entry.js +1 -1
  213. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  214. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  215. package/dist/esm/salla-tooltip.entry.js +1 -1
  216. package/dist/esm/salla-trust-badges.entry.js +1 -1
  217. package/dist/esm/salla-user-menu.entry.js +1 -1
  218. package/dist/esm/salla-user-profile.entry.js +1 -1
  219. package/dist/esm/salla-user-settings.entry.js +1 -1
  220. package/dist/esm/salla-verify.entry.js +1 -1
  221. package/dist/esm/salla-wallet.entry.js +1 -1
  222. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  223. package/dist/esm/twilight.js +3 -3
  224. package/dist/esm/{vanilla-picker-Cf9pEgos.js → vanilla-picker-S7qZ7YZm.js} +1 -1
  225. package/dist/twilight/{p-2a64e50b.entry.js → p-01406425.entry.js} +1 -1
  226. package/dist/twilight/{p-i-tkvIE0.js → p-035DwuUC.js} +1 -1
  227. package/dist/twilight/{p-bbd2cb8c.entry.js → p-07adeb89.entry.js} +1 -1
  228. package/dist/twilight/{p-e806b976.entry.js → p-0944d367.entry.js} +1 -1
  229. package/dist/twilight/{p-e190e1cf.entry.js → p-0a332226.entry.js} +1 -1
  230. package/dist/twilight/{p-adbf6324.entry.js → p-0e3d72ab.entry.js} +1 -1
  231. package/dist/twilight/{p-368beadc.entry.js → p-1118bee2.entry.js} +1 -1
  232. package/dist/twilight/{p-a37a692a.entry.js → p-13c4b450.entry.js} +1 -1
  233. package/dist/twilight/{p-e36310e2.entry.js → p-18639885.entry.js} +1 -1
  234. package/dist/twilight/{p-dc7f11e4.entry.js → p-18a604c5.entry.js} +1 -1
  235. package/dist/twilight/{p-5364f42e.entry.js → p-1abe8321.entry.js} +1 -1
  236. package/dist/twilight/{p-27b6fd51.entry.js → p-1bf18c56.entry.js} +1 -1
  237. package/dist/twilight/{p-c3bed022.entry.js → p-211324e6.entry.js} +1 -1
  238. package/dist/twilight/p-22cb8a9c.entry.js +4 -0
  239. package/dist/twilight/{p-c2005d4a.entry.js → p-2331e63a.entry.js} +1 -1
  240. package/dist/twilight/{p-ab86dc29.entry.js → p-27456209.entry.js} +1 -1
  241. package/dist/twilight/{p-c72a1861.entry.js → p-2a3d30d1.entry.js} +1 -1
  242. package/dist/twilight/{p-4d149e9e.entry.js → p-2a683382.entry.js} +1 -1
  243. package/dist/twilight/{p-7e26332e.entry.js → p-2bef08e8.entry.js} +1 -1
  244. package/dist/twilight/{p-73db9793.entry.js → p-2c48bb97.entry.js} +1 -1
  245. package/dist/twilight/p-2df31e90.entry.js +4 -0
  246. package/dist/twilight/{p-7122a097.entry.js → p-2ff7bb22.entry.js} +1 -1
  247. package/dist/twilight/{p-ed5d8787.entry.js → p-357b5593.entry.js} +1 -1
  248. package/dist/twilight/{p-8c086859.entry.js → p-3aa6fa7d.entry.js} +1 -1
  249. package/dist/twilight/{p-a5185029.entry.js → p-3c2cc4fe.entry.js} +1 -1
  250. package/dist/twilight/{p-c15eeb62.entry.js → p-3fb485a6.entry.js} +1 -1
  251. package/dist/twilight/{p-e4c3ca60.entry.js → p-43f8f33b.entry.js} +1 -1
  252. package/dist/twilight/{p-354da069.entry.js → p-47713dd1.entry.js} +1 -1
  253. package/dist/twilight/{p-86cec54b.entry.js → p-49738042.entry.js} +1 -1
  254. package/dist/twilight/{p-499ccb8b.entry.js → p-49f9e536.entry.js} +1 -1
  255. package/dist/twilight/{p-945b3f38.entry.js → p-4ef06a6f.entry.js} +1 -1
  256. package/dist/twilight/{p-55c716a4.entry.js → p-501c0798.entry.js} +1 -1
  257. package/dist/twilight/{p-a5f477fd.entry.js → p-523572e9.entry.js} +1 -1
  258. package/dist/twilight/{p-f3bd1c09.entry.js → p-54974d98.entry.js} +1 -1
  259. package/dist/twilight/{p-a9554697.entry.js → p-56845467.entry.js} +1 -1
  260. package/dist/twilight/{p-3c99951e.entry.js → p-569c6d6c.entry.js} +1 -1
  261. package/dist/twilight/{p-14f2c393.entry.js → p-56f164bb.entry.js} +1 -1
  262. package/dist/twilight/{p-8fa81b10.entry.js → p-5918dd8d.entry.js} +1 -1
  263. package/dist/twilight/{p-95117a08.entry.js → p-5ba2eb55.entry.js} +1 -1
  264. package/dist/twilight/{p-28efc3a8.entry.js → p-5cd4b67f.entry.js} +1 -1
  265. package/dist/twilight/{p-bf9cc549.entry.js → p-5dfd449d.entry.js} +1 -1
  266. package/dist/twilight/{p-a30ae3e6.entry.js → p-683db553.entry.js} +1 -1
  267. package/dist/twilight/{p-d322a3e8.entry.js → p-68d754be.entry.js} +1 -1
  268. package/dist/twilight/{p-84181d45.entry.js → p-6a746b8a.entry.js} +1 -1
  269. package/dist/twilight/{p-0357b501.entry.js → p-6c5a1ded.entry.js} +1 -1
  270. package/dist/twilight/{p-4358c48e.entry.js → p-6d787fa0.entry.js} +1 -1
  271. package/dist/twilight/{p-6da4a9b3.entry.js → p-6edd1008.entry.js} +1 -1
  272. package/dist/twilight/{p-7bdf543a.entry.js → p-6f3516a1.entry.js} +1 -1
  273. package/dist/twilight/{p-a72bf47b.entry.js → p-6f58ac6a.entry.js} +1 -1
  274. package/dist/twilight/{p-4cfccc31.entry.js → p-704553fb.entry.js} +1 -1
  275. package/dist/twilight/{p-f51a1326.entry.js → p-709c2184.entry.js} +1 -1
  276. package/dist/twilight/{p-453f92f9.entry.js → p-83a5b8a4.entry.js} +1 -1
  277. package/dist/twilight/{p-c0d89d74.entry.js → p-847cdd79.entry.js} +1 -1
  278. package/dist/twilight/p-84cffb13.entry.js +4 -0
  279. package/dist/twilight/{p-dc51e991.entry.js → p-869fe4c0.entry.js} +1 -1
  280. package/dist/twilight/{p-32af49cd.entry.js → p-8711224a.entry.js} +1 -1
  281. package/dist/twilight/{p-ee7530fe.entry.js → p-8ebb86ce.entry.js} +1 -1
  282. package/dist/twilight/{p-875beddd.entry.js → p-9025e5d9.entry.js} +1 -1
  283. package/dist/twilight/{p-4a8b3e89.entry.js → p-906b36e3.entry.js} +1 -1
  284. package/dist/twilight/{p-a9b9deb9.entry.js → p-90f29c99.entry.js} +1 -1
  285. package/dist/twilight/{p-42efd1b1.entry.js → p-9dd126e2.entry.js} +1 -1
  286. package/dist/twilight/{p-a909aff5.entry.js → p-9f431f78.entry.js} +1 -1
  287. package/dist/twilight/{p-5be5be8b.entry.js → p-9fdbe8a0.entry.js} +1 -1
  288. package/dist/twilight/{p-CW2JQnYK.js → p-B3oo4tIx.js} +1 -1
  289. package/dist/twilight/p-BRZVMxhy.js +9 -0
  290. package/dist/twilight/{p-C0qiFNJn.js → p-BsIeN-bg.js} +1 -1
  291. package/dist/twilight/{p-ClV-F79e.js → p-CPiqlSTo.js} +1 -1
  292. package/dist/twilight/{p-CyO2XGkr.js → p-CaCiueRc.js} +1 -1
  293. package/dist/twilight/p-D6rFREuQ.js +4 -0
  294. package/dist/twilight/{p-BeFR_h3q.js → p-DNS31w5e.js} +1 -1
  295. package/dist/twilight/{p-l7Rr63jq.js → p-DeX830vG.js} +1 -1
  296. package/dist/twilight/{p-b5028411.entry.js → p-a01f64e7.entry.js} +1 -1
  297. package/dist/twilight/{p-344f751a.entry.js → p-a037e47d.entry.js} +1 -1
  298. package/dist/twilight/{p-709af483.entry.js → p-a0ed97f5.entry.js} +1 -1
  299. package/dist/twilight/{p-8f2f8693.entry.js → p-a30390a7.entry.js} +1 -1
  300. package/dist/twilight/{p-b3ba53c5.entry.js → p-a344db00.entry.js} +1 -1
  301. package/dist/twilight/{p-b6d259be.entry.js → p-a3579980.entry.js} +1 -1
  302. package/dist/twilight/{p-7a1169f6.entry.js → p-a46a9d28.entry.js} +1 -1
  303. package/dist/twilight/{p-33c2f3bc.entry.js → p-a64771f7.entry.js} +1 -1
  304. package/dist/twilight/{p-a243d3cc.entry.js → p-a8316527.entry.js} +1 -1
  305. package/dist/twilight/{p-e2d501f5.entry.js → p-a9ef3c52.entry.js} +1 -1
  306. package/dist/twilight/{p-ecaf7d87.entry.js → p-aa8962f8.entry.js} +1 -1
  307. package/dist/twilight/{p-0dea4239.entry.js → p-aa91a230.entry.js} +1 -1
  308. package/dist/twilight/{p-b2662a4f.entry.js → p-af348a67.entry.js} +1 -1
  309. package/dist/twilight/{p-1adf1893.entry.js → p-b1e0bc90.entry.js} +1 -1
  310. package/dist/twilight/{p-0d44c47f.entry.js → p-b238c74b.entry.js} +1 -1
  311. package/dist/twilight/{p-6da0b2b3.entry.js → p-b5a2342c.entry.js} +1 -1
  312. package/dist/twilight/{p-b73b7e15.entry.js → p-be0ac755.entry.js} +1 -1
  313. package/dist/twilight/{p-6bedb896.entry.js → p-cdba9d35.entry.js} +1 -1
  314. package/dist/twilight/{p-fba13fd5.entry.js → p-d5215891.entry.js} +1 -1
  315. package/dist/twilight/{p-a8561cc8.entry.js → p-e3e2baa2.entry.js} +1 -1
  316. package/dist/twilight/{p-7f11af86.entry.js → p-e875f53e.entry.js} +1 -1
  317. package/dist/twilight/{p-ae96e338.entry.js → p-ea968ba3.entry.js} +1 -1
  318. package/dist/twilight/{p-88148fed.entry.js → p-eb3a095b.entry.js} +1 -1
  319. package/dist/twilight/{p-c82b8aa7.entry.js → p-ebc6ba28.entry.js} +1 -1
  320. package/dist/twilight/{p-b8da968d.entry.js → p-ecdbd18f.entry.js} +1 -1
  321. package/dist/twilight/{p-4ebdef90.entry.js → p-ef145c1e.entry.js} +1 -1
  322. package/dist/twilight/{p-5d71c16a.entry.js → p-efe6493f.entry.js} +1 -1
  323. package/dist/twilight/{p-5d261682.entry.js → p-f037e508.entry.js} +1 -1
  324. package/dist/twilight/{p-34889d17.entry.js → p-f4f355e5.entry.js} +1 -1
  325. package/dist/twilight/{p-862f7fda.entry.js → p-fed3efba.entry.js} +1 -1
  326. package/dist/twilight/{p-b217fea1.entry.js → p-ff37c2af.entry.js} +1 -1
  327. package/dist/twilight/{p-yV2X3Oc1.js → p-mgSPapOV.js} +1 -1
  328. package/dist/twilight/{p-C7NprL2x.js → p-wqmCmzsY.js} +1 -1
  329. package/dist/twilight/twilight.esm.js +1 -1
  330. package/dist/types/Helpers/Helper.d.ts +10 -0
  331. package/dist/types/components/salla-applied-filters/salla-applied-filters.d.ts +37 -0
  332. package/dist/types/components/salla-filters/salla-filters.d.ts +3 -11
  333. package/dist/types/components.d.ts +17 -0
  334. package/package.json +5 -5
  335. package/dist/cjs/interfaces-DZDQwN6-.js +0 -23
  336. package/dist/esm/interfaces-DL4h2bc3.js +0 -23
  337. package/dist/twilight/p-01b52f2f.entry.js +0 -4
  338. package/dist/twilight/p-B3th5No1.js +0 -9
  339. package/dist/twilight/p-DL4h2bc3.js +0 -4
  340. package/dist/twilight/p-DOBDDG4K.js +0 -4
  341. package/dist/twilight/p-c55c576c.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 r,a,H as o}from"./p-C0qiFNJn.js";import{S as i}from"./p-D4oPi1Ov.js";const e=class{constructor(r){t(this,r),this.resolveFn=null,this.rejectFn=null,this.optionsRefs=new Map,this.changeHandler=null,this.submitCallback=null,this.orderOptions=[],this.basePrice=0,this.liveTotal=0,this.isSubmitting=!1,this.sessionId=0,this.paymentMode="default",this.title="",this.subtitle="",this.submitLabel="",this.totalLabel="",this.requiredMessage="",this.handleClose=()=>{this.isSubmitting||(this.rejectFn?.({reason:"dismissed"}),this.resolveFn=null,this.rejectFn=null,this.detachChangeListener(),this.reset())},salla.lang.onLoaded((()=>this.loadTranslations()))}componentWillLoad(){this.loadTranslations()}loadTranslations(){this.title=salla.lang.get("blocks.order_options.title"),this.subtitle=salla.lang.get("blocks.order_options.subtitle"),this.submitLabel=salla.lang.get("blocks.order_options.continue"),this.totalLabel=salla.lang.get("blocks.order_options.total"),this.requiredMessage=salla.lang.get("blocks.order_options.required_message")}async open(t){return this.orderOptions=(Array.isArray(t.orderOptions)?t.orderOptions:[]).map((t=>({...t,details:t.details??[]}))),this.basePrice=Number(t.basePrice)||0,this.liveTotal=this.basePrice+this.seedOptionsPrice(this.orderOptions),this.isSubmitting=!1,this.sessionId++,this.optionsRefs.clear(),this.submitCallback=t.onSubmit??null,this.paymentMode=t.paymentMode??"default",await(this.modal?.open()),this.attachChangeListener(),new Promise(((t,r)=>{this.resolveFn=t,this.rejectFn=r}))}async close(){await(this.modal?.close())}collectOrderOptionsSync(){const t=[];for(const[,r]of this.optionsRefs)r&&r.querySelectorAll('[name^="options["],[name*="[options]["]').forEach((r=>{if(r instanceof HTMLInputElement&&("radio"===r.type||"checkbox"===r.type)&&!r.checked)return;const a=r.name.match(/(?:^|\[)options\]?\[(\d+)\]/);if(!a)return;const o=r.value;if(""===o||null==o)return;const i=Number(o);t.push({id:Number(a[1]),value:Number.isFinite(i)&&o===String(i)?i:o})}));return t}validateSync(){let t=!0;for(const[,r]of this.optionsRefs)r&&r.querySelectorAll("[required]").forEach((r=>{r.disabled||r.closest(".hidden")||"reportValidity"in r&&!r.reportValidity()&&(t=!1)}));return t}seedOptionsPrice(t){let r=0;return t.forEach((t=>{(t.details||[]).forEach((t=>{t.is_selected&&(r+=Number(t.total_price??t.additional_price)||0)}))})),r}attachChangeListener(){this.detachChangeListener(),this.changeHandler=()=>this.recomputeTotal(),salla.event.on("product-options::change",this.changeHandler)}detachChangeListener(){this.changeHandler&&(salla.event.off("product-options::change",this.changeHandler),this.changeHandler=null)}async recomputeTotal(){let t=0;for(const[,r]of this.optionsRefs)r&&(("function"==typeof r.getSelectedOptions?await r.getSelectedOptions():[])||[]).forEach((r=>{t+=Number(r.total_price??r.additional_price)||0}));this.liveTotal=this.basePrice+t}handleSubmit(){if(this.isSubmitting)return;if(!this.validateSync())return void salla.notify?.error?.(this.requiredMessage);this.isSubmitting=!0;const t=this.collectOrderOptionsSync(),r=Math.round(100*this.liveTotal)/100;try{this.submitCallback?.(t,r)}catch(t){salla?.logger?.warn?.("order-options modal onSubmit threw",t)}this.resolveFn?.({orderOptions:t}),this.resolveFn=null,this.rejectFn=null,this.submitCallback=null,this.detachChangeListener(),this.modal?.close().then((()=>this.reset())),this.isSubmitting=!1}reset(){this.orderOptions=[],this.optionsRefs.clear(),this.liveTotal=0}render(){const t=salla.money(Math.round(100*this.liveTotal)/100);return r("salla-modal",{key:"e84a40e1a27447d58ca5651a7ed76cbcf886495c",ref:t=>this.modal=t,class:"s-order-options-modal-host",width:"md","modal-title":this.title,onModalVisibilityChanged:t=>{t.detail||this.handleClose()}},r("div",{key:"fafa3cdeb22787d4a02f3fc8afb70770e1c3b4b5",class:"s-order-options-modal-body"},r("p",{key:"c563c24e1b8744f3248328ec16a18c5a668e7949",class:"s-order-options-modal-subtitle"},this.subtitle),r("div",{key:"475599cc47435b077d2321573328321888e60aa6",class:"s-order-options-modal-fields"},this.orderOptions.length>0&&r("salla-product-options",{key:this.sessionId,ref:t=>{t&&(this.optionsRefs.set("order-options",t),t.seedSelectedOptions?.())},"product-id":`order-options-${this.orderOptions[0]?.id}`,"unique-key":"order-options",options:JSON.stringify(this.orderOptions),"hide-out-label":"1","no-padding":!0}))),r("div",{key:"e00641853937f745c8cc798c7f9e15b389faf540",slot:"footer",class:"s-order-options-modal-footer"},"apple-pay"===this.paymentMode?r("div",{class:"s-order-options-modal-apple-pay-wrap"},r("div",{class:"s-order-options-modal-apple-pay-total"},r("span",{class:"s-order-options-modal-apple-pay-label"},this.totalLabel),r("span",{class:"s-order-options-modal-apple-pay-amount",innerHTML:t})),r("apple-pay-button",{locale:salla?.config?.get?.("user.language_code")||"ar",buttonstyle:"black",type:"buy",class:"s-order-options-modal-apple-pay",onClick:()=>this.handleSubmit()})):r("salla-button",{type:"button",color:"primary",fill:"solid",width:"wide",loading:this.isSubmitting,onClick:()=>this.handleSubmit()},r("span",{class:"s-order-options-modal-cta-content"},r("span",{class:"s-order-options-modal-cta-text"},this.submitLabel),r("span",{class:"s-order-options-modal-cta-total",innerHTML:t})))))}get host(){return a(this)}};e.style="/*!twlt*/.s-order-options-modal-host .s-modal-header-inner,.s-order-options-modal-host .s-modal-header-content,.s-order-options-modal-host .s-modal-title{text-align:start !important}.s-order-options-modal-apple-pay{display:block;width:100%;--apple-pay-button-width:100%;--apple-pay-button-height:44px;--apple-pay-button-border-radius:0.75rem}.s-order-options-modal-apple-pay-wrap{display:flex;flex-direction:column;gap:0.75rem;width:100%}.s-order-options-modal-apple-pay-total{display:flex;align-items:center;justify-content:space-between;gap:0.5rem}.s-order-options-modal-apple-pay-label,.s-order-options-modal-apple-pay-amount{font-size:1.125rem;line-height:1.5rem;font-weight:700;color:#111827}.static{position:static}.block{display:block}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-order-options-modal-body{display:block}.s-order-options-modal-subtitle{margin-bottom:1rem;font-size:0.875rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-order-options-modal-fields{display:flex;flex-direction:column;gap:1rem}.s-order-options-modal-item{display:block}.s-order-options-modal-footer{display:flex;width:100%;align-items:center}.s-order-options-modal-cta-content{display:flex;align-items:center;gap:0.25rem}.s-order-options-modal-cta-text{font-weight:700}.s-order-options-modal-cta-total{font-weight:700}";var s='\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>heart</title>\n<path d="M23.333 2.267c-3.547 0-5.779 1.605-7.333 3.061-1.555-1.456-3.787-3.061-7.333-3.061-5.955 0-8.667 5.045-8.667 9.733 0 8.503 10.147 14.735 15.513 16.841 0.156 0.061 0.321 0.092 0.487 0.092s0.331-0.031 0.487-0.092c5.367-2.107 15.513-8.339 15.513-16.841 0-4.688-2.712-9.733-8.667-9.733zM16 26.161c-5.537-2.309-13.333-7.799-13.333-14.161 0-3.517 1.856-7.067 6-7.067 2.983 0 4.656 1.451 6.384 3.203 0.5 0.508 1.399 0.508 1.899 0 1.728-1.752 3.401-3.203 6.384-3.203 4.144 0 6 3.549 6 7.067 0 6.363-7.796 11.852-13.333 14.161z"></path>\n</svg>\n';const d=class{constructor(r){if(t(this,r),salla.onReady((()=>{this.fitImageHeight=salla.config.get("store.settings.product.fit_type"),salla.wishlist.event.onAdded(((t,r)=>this.toggleFavoriteIcon(!0,r))),salla.wishlist.event.onRemoved(((t,r)=>this.toggleFavoriteIcon(!1,r))),this.placeholder=salla.url.asset(salla.config.get("theme.settings.placeholder"))})),salla.lang.onLoaded((()=>{this.remained=salla.lang.get("pages.products.remained"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.startingPrice=salla.lang.get("pages.products.starting_price"),this.addToCart=salla.lang.get("pages.cart.add_to_cart"),this.outOfStock=salla.lang.get("pages.products.out_of_stock")})),this.product)try{this.productData="object"==typeof this.product?this.product:JSON.parse(this.product)}catch(t){salla.log("Bad json passed via product prop")}}initCircleBar(){let t=this.productData.quantity/(this.productData.quantity>100?2*this.productData.quantity:100)*100;this.pie.querySelector(".s-product-card-content-pie-svg-bar").style.strokeDashoffset=100-t}toggleFavoriteIcon(t=!0,r=null){r&&r!==this.productData.id||this.wishlistBtn?.classList.toggle("s-product-card-wishlist-added",t)}isInWishlist(){return salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)}async handleWishlistClick(){const t=this.isInWishlist();this.toggleFavoriteIcon(!t);try{await salla.wishlist.toggle(this.productData.id)}catch{this.toggleFavoriteIcon(t)}}formatDate(t){let r=new Date(t);return`${r.getFullYear()}-${r.getMonth()+1}-${r.getDate()}`}getProductBadge(){return this.productData.promotion_title?r("div",{class:"s-product-card-promotion-title"},this.productData.promotion_title):this.showQuantity&&this.productData?.quantity?r("div",{class:"s-product-card-quantity"},this.remained," ",salla.helpers.number(this.productData?.quantity)):this.showQuantity&&this.productData?.is_out_of_stock?r("div",{class:"s-product-card-out-badge"},this.outOfStock):""}getPriceFormat(t){return t&&0!=t?salla.money(t):salla.config.get("store.settings.product.show_price_as_dash")?"-":""}getProductPrice(){return this.productData.is_on_sale?r("div",{class:"s-product-card-sale-price"},r("h4",{innerHTML:this.getPriceFormat(this.productData.sale_price)}),r("span",{innerHTML:this.getPriceFormat(this.productData?.regular_price)})):this.productData.starting_price?r("div",{class:"s-product-card-starting-price"},r("p",null,this.startingPrice),r("h4",{innerHTML:this.getPriceFormat(this.productData?.starting_price)})):r("h4",{class:"s-product-card-price",innerHTML:this.getPriceFormat(this.productData?.price)})}render(){const t={"s-product-card-entry":!0,"s-product-card-vertical":!this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-horizontal":this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-fit-height":this.fitImageHeight&&!this.isSpecial&&!this.fullImage&&!this.minimal,"s-product-card-special":this.isSpecial,"s-product-card-full-image":this.fullImage,"s-product-card-minimal":this.minimal,"s-product-card-compact":this.compact,"s-product-card-donation":this.productData?.donation,"s-product-card-shadow":this.shadowOnHover,"s-product-card-out-of-stock":this.productData?.is_out_of_stock},a=this.productData?.url?{href:this.productData.url,title:`Learn more about ${this.productData?.name}`}:{};return r(o,{key:"c5a6d2bc2fcf23da1a41ab8b19b2e981fb111e30",id:`product-${this.productData?.id}`,class:t},r("div",{key:"e8d5105e4dbe367c612d62ef1dd6c95d04f440b0",class:this.fullImage?"s-product-card-image-full":"s-product-card-image"},r("a",{key:"8714997fcb48ef0eaabdf0a52cb775514e53db56",...a},r("img",{key:"eebd3c1dde0894037a7723c46e2f07f6a5aef939",class:`s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)?"contain":this.fitImageHeight?this.fitImageHeight:"cover"} lazy`,src:this.placeholder,alt:this.productData?.image?.alt||this.productData?.name,"data-src":this.productData?.image?.url||this.productData?.thumbnail}),this.fullImage||this.minimal?"":this.getProductBadge()),this.fullImage&&r("a",{key:"72e240315320e976dcad8d3f027711b9c1d7bcf1",...a,class:"s-product-card-overlay"}),this.horizontal||this.fullImage?"":r("salla-button",{shape:"icon",fill:"none",color:"light",loading:!1,"aria-label":"Add or remove to wishlist",ref:t=>this.wishlistBtn=t,class:"s-product-card-wishlist-btn animated",onClick:()=>this.handleWishlistClick()},r("span",{innerHTML:s}))),r("div",{key:"2f0186ffc102488824cd7c346f4e07439474fc26",class:"s-product-card-content"},this.isSpecial&&this.productData?.quantity?r("div",{class:"s-product-card-content-pie",ref:t=>this.pie=t},r("span",null,r("b",null,salla.helpers.number(this.productData?.quantity)),this.remained),r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -1 36 34",class:"s-product-card-content-pie-svg"},r("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-base"}),r("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-bar"}))):"",r("div",{key:"d50ea0726d25bf3b551050e906fc615bc682e694",class:{"s-product-card-content-main":!0,"s-product-card-content-extra-padding":this.isSpecial}},r("h3",{key:"e4f39676d661a01d1aa6352cac7be6e764fa8687",class:"s-product-card-content-title"},r("a",{key:"0aacc2e00a0db730d1e803da34336085082df75d",...a},this.productData?.name)),this.productData?.subtitle&&!this.minimal?r("p",{class:"s-product-card-content-subtitle"},this.productData?.subtitle):""),!this.productData?.donation||this.minimal||this.fullImage?"":[r("salla-progress-bar",{donation:this.productData?.donation}),r("div",{class:"s-product-card-donation-input"},this.productData?.donation?.can_donate?[r("label",{htmlFor:"donation-amount"},this.donationAmount," ",r("span",null,"*")),r("input",{type:"text",onInput:t=>{salla.helpers.inputDigitsOnly(t.target),this.addBtn.donatingAmount=t.target.value},id:"donation-amount",name:"donating_amount",class:"s-form-control",placeholder:this.donationAmount})]:"")],r("div",{key:"445a1e16fee6ebb6ab5012aca324d3845991d13e",class:{"s-product-card-content-sub":!0,"s-product-card-content-extra-padding":this.isSpecial}},this.getProductPrice(),this.productData?.rating?.stars&&!this.minimal?r("div",{class:"s-product-card-rating"},r("span",{innerHTML:i}),r("span",null,this.productData.rating.stars)):""),this.isSpecial&&this.productData.discount_ends?r("salla-count-down",{date:this.formatDate(this.productData.discount_ends),"end-of-day":!0,boxed:!0,labeled:!0}):"",this.hideAddBtn||this.compact?"":r("div",{class:"s-product-card-content-footer"},r("salla-add-product-button",{fill:"outline",width:"wide",ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type},r("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label)),this.horizontal||this.fullImage?r("salla-button",{shape:"icon",fill:"none",color:"light",loading:!1,ref:t=>this.wishlistBtn=t,"aria-label":"Add or remove to wishlist",class:"s-product-card-wishlist-btn animated",onClick:()=>this.handleWishlistClick(),"data-id":"{{ product.id }}"},r("span",{class:"text-xl",innerHTML:s})):"")),!this.hideAddBtn&&this.compact?r("div",{class:"s-product-card-content-footer"},r("salla-add-product-button",{ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type,class:"s-add-product-button-compact"},r("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label))):"")}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy")),this.productData?.quantity&&this.isSpecial&&this.initCircleBar(),!salla.config.isGuest()&&salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)&&this.toggleFavoriteIcon()}static get assetsDirs(){return["assets"]}get host(){return a(this)}};d.style='/*!twlt*/.s-product-card-image::before{font-family:"sallaicons";content:"\\ec1f" !important}.s-product-card-content-pie-svg circle{transition:stroke-dashoffset 1s linear;-webkit-transition:stroke-dashoffset 1s linear;-moz-transition:stroke-dashoffset 1s linear;-ms-transition:stroke-dashoffset 1s linear;-o-transition:stroke-dashoffset 1s linear;stroke:#E8EDF2;stroke-width:2px;stroke-linecap:round;fill:none}.s-product-card-content-pie-svg-bar{stroke:var(--color-primary) !important;stroke-dasharray:100 100;stroke-dashoffset:100}.text-xl{font-size:1.25rem;line-height:1.75rem}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.s-form-control{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-form-control:focus{border-color:var(--color-primary);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-product-card-entry{position:relative;display:flex;height:100%;justify-content:space-between;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-product-card-shadow:hover{box-shadow:5px 10px 30px #2b2d340d}.s-product-card-out-of-stock img.loaded{--tw-grayscale:grayscale(100%);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-product-card-overlay{position:absolute;top:0px;bottom:0px;left:0px;right:0px;--tw-bg-opacity:1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));opacity:0.5;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:700ms}.s-product-card-overlay:hover{opacity:0.4}.s-product-card-vertical{flex-direction:column}.s-product-card-vertical .s-product-card-image{flex:1 1 0%;border-top-left-radius:var(--s-radius, 0.25rem);border-top-right-radius:var(--s-radius, 0.25rem)}.s-product-card-vertical .s-product-card-wishlist-btn{position:absolute;top:0.5rem;right:0.5rem;opacity:0.75}.s-product-card-vertical .s-product-card-wishlist-btn:hover{opacity:1}@media (min-width: 768px){.s-product-card-vertical .s-product-card-wishlist-btn{right:0.5rem}}.s-product-card-vertical .s-product-card-wishlist-btn:where([dir="rtl"],[dir="rtl"] *){left:0.5rem;right:unset}@media (min-width: 768px){.s-product-card-vertical .s-product-card-wishlist-btn:where([dir="rtl"],[dir="rtl"] *){left:0.5rem;right:unset}}.s-product-card-minimal .s-product-card-wishlist-btn{position:absolute;top:0px;right:0px;opacity:0.75}.s-product-card-minimal .s-product-card-wishlist-btn:hover{opacity:1}@media (min-width: 768px){.s-product-card-minimal .s-product-card-wishlist-btn{right:0px}}.s-product-card-minimal .s-product-card-wishlist-btn:where([dir="rtl"],[dir="rtl"] *){left:0px;right:unset}@media (min-width: 768px){.s-product-card-minimal .s-product-card-wishlist-btn:where([dir="rtl"],[dir="rtl"] *){left:0px;right:unset}}.s-product-card-minimal .s-product-card-image{width:8rem}@media (min-width: 640px){.s-product-card-minimal .s-product-card-image{width:14rem}}@media (min-width: 1024px){.s-product-card-minimal .s-product-card-image{width:7rem}}.s-product-card-minimal .s-product-card-content-title a{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.s-product-card-minimal .s-product-card-content{display:flex;flex:1 1 0%;flex-direction:column;overflow:hidden;padding:1.25rem}.s-product-card-minimal .s-product-card-wishlist-btn button{margin:0px;background-color:transparent}.s-product-card-minimal .s-product-card-wishlist-btn button svg,.s-product-card-full-image .s-product-card-wishlist-btn button svg{height:1rem;width:1rem;fill:#fff}.s-product-card-vertical .s-product-card-wishlist-btn button{margin:0px;--tw-bg-opacity:1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1)) !important}.s-product-card-wishlist-btn button:hover svg{fill:#4b5563}.s-product-card-fit-height .s-product-card-image{height:11rem;max-height:15rem}.s-product-card-quantity{position:absolute;bottom:0.25rem;left:50%;z-index:1;max-width:calc(100% - 60px);--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));border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.75rem;line-height:1rem;font-weight:700;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-product-card-quantity{padding-top:0.5rem;padding-bottom:0.5rem}}.s-product-card-promotion-title{position:absolute;top:1rem;left:0px;z-index:1;max-width:calc(100% - 60px);border-top-right-radius:var(--s-radius, 0.25rem);border-bottom-right-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.75rem;line-height:1rem;font-weight:700;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-product-card-promotion-title{padding-top:0.5rem;padding-bottom:0.5rem}}.s-product-card-promotion-title:where([dir="rtl"],[dir="rtl"] *){right:0px;left:unset;border-top-left-radius:var(--s-radius, 0.25rem);border-bottom-left-radius:var(--s-radius, 0.25rem);border-top-right-radius:0px;border-bottom-right-radius:0px}.s-product-card-out-badge{position:absolute;bottom:0.5rem;left:50%;z-index:1;max-width:calc(100% - 60px);--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));border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.75rem;line-height:1rem;font-weight:700;--tw-text-opacity:1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-product-card-out-badge{padding-top:0.5rem;padding-bottom:0.5rem}}.s-product-card-image{position:relative;height:100%;width:100%;flex-shrink:0;overflow:hidden;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-product-card-image::before{position:absolute;top:50%;left:50%;display:inline-block;--tw-translate-x:-50%;--tw-translate-y:-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));font-size:1.875rem;line-height:2.25rem;content:var(--tw-content);--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-product-card-image:hover{opacity:0.9}.s-product-card-image img{height:100%;width:100%;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-product-card-image img.lazy{opacity:0}.s-product-card-image img.loaded{position:relative;opacity:1}.s-product-card-content{position:relative;display:flex;flex-direction:column;padding:0.75rem}@media (min-width: 640px){.s-product-card-content{padding:1.25rem}}.s-product-card-content-title{margin-bottom:0.625rem;max-width:100%;line-height:1.5rem}.s-product-card-content-subtitle{margin-bottom:0.625rem;font-size:0.875rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-product-card-special .s-product-card-content-main,special .s-product-card-content-sub{padding-right:6rem}.s-product-card-special .s-product-card-content-main:where([dir="rtl"],[dir="rtl"] *),special .s-product-card-content-sub:where([dir="rtl"],[dir="rtl"] *){padding-left:6rem;padding-right:0px}.s-product-card-donation-input{flex:1 1 0%}.s-product-card-donation-input label{margin-bottom:0.625rem;display:block;font-size:0.875rem;line-height:1.25rem}.s-product-card-donation-input label span{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-product-card-content-title a{display:block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-product-card-content-title a:hover{color:var(--color-primary)}.s-product-card-content-sub{margin-bottom:1.25rem;display:flex;width:100%;align-items:center;justify-content:space-between}.s-product-card-rating{display:flex;align-items:center}.s-product-card-rating>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem * var(--tw-space-x-reverse));margin-left:calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-card-rating{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-product-card-rating:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-card-rating span svg{margin-bottom:3px;height:1rem;width:1rem;fill:#fbbf24}.s-product-card-content-footer{margin-top:auto;display:flex;align-items:center}.s-product-card-sale-price>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem * var(--tw-space-x-reverse));margin-left:calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-card-sale-price:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-card-sale-price h4{display:inline-block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-product-card-sale-price span{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-product-card-starting-price{display:flex;width:100%;align-items:center;justify-content:space-between}.s-product-card-starting-price h4{display:inline-block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-product-card-price{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-product-card-image-cover{object-fit:cover}.s-product-card-image-contain{object-fit:contain}.s-product-card-content-pie{position:absolute;top:0.625rem;right:1.25rem;display:flex;height:72px;width:72px;align-items:center;justify-content:center;color:var(--color-primary)}.s-product-card-content-pie:where([dir="rtl"],[dir="rtl"] *){left:1.25rem;right:unset}.s-product-card-content-pie span{position:absolute;top:43%;left:50%;display:flex;--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));flex-direction:column;align-items:center;justify-content:center;text-align:center;font-size:0.75rem;line-height:1rem;line-height:1;--tw-text-opacity:1;color:rgb(124 128 130 / var(--tw-text-opacity, 1))}.s-product-card-content-pie span b{font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary)}.s-product-card-content-extra-padding{padding-right:6rem}.s-product-card-content-extra-padding:where([dir="rtl"],[dir="rtl"] *){padding-left:6rem;padding-right:0px}.s-product-card-wishlist-added svg{fill:#ef4444}.s-product-card-horizontal .s-product-card-image{height:auto;width:8rem}@media (min-width: 640px){.s-product-card-horizontal .s-product-card-image{width:14rem}}.s-product-card-horizontal .s-product-card-image:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:var(--s-radius, 0.25rem);border-bottom-left-radius:var(--s-radius, 0.25rem)}.s-product-card-horizontal .s-product-card-image:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:var(--s-radius, 0.25rem);border-bottom-right-radius:var(--s-radius, 0.25rem)}.s-product-card-horizontal .s-product-card-quantity{max-width:unset}.s-product-card-horizontal .s-product-card-content-title a{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.s-product-card-horizontal .s-product-card-promotion-title{max-width:unset}.s-product-card-horizontal .s-product-card-out-badge{max-width:unset}.s-product-card-horizontal .s-product-card-content{margin-bottom:0.625rem;width:100%}.s-product-card-full-image{height:20rem;overflow:hidden}@media (min-width: 768px){.s-product-card-full-image{height:auto}}.s-product-card-full-image .s-product-card-content{position:absolute;bottom:0px;z-index:10;width:100%;padding-left:2.5rem;padding-right:2.5rem;padding-top:1.25rem;padding-bottom:1.75rem}.s-product-card-full-image img{position:relative;height:100%;width:100%;overflow:hidden;border-radius:var(--s-radius, 0.25rem)}.s-product-card-full-image img:hover{opacity:0.9}.s-product-card-full-image .s-product-card-image a{height:100%;width:100%}.s-product-card-full-image .s-product-card-content-title a{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-full-image .s-product-card-content-title a:hover{color:var(--color-primary)}.s-product-card-full-image .s-product-card-content-subtitle{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-full-image .s-product-card-price{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-full-image .s-product-card-sale-price{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-full-image .s-product-card-sale-price span{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-image-full{width:100%}.s-product-card-compact{display:flex;cursor:pointer;flex-direction:row;align-items:center;gap:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0.75rem;padding-bottom:0.75rem;padding-left:0px;padding-right:0px;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-product-card-compact .s-product-card-content-footer{margin-top:0px;flex-shrink:0}.s-product-card-compact .s-add-product-button-compact salla-button .s-button-btn{height:2rem;border-radius:0.375rem;border-width:1px;border-color:var(--color-primary);background-color:transparent;padding-left:0.75rem;padding-right:0.75rem;font-size:0.75rem;line-height:1rem;font-weight:500;color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-product-card-compact .s-add-product-button-compact salla-button .s-button-btn:hover{border-color:var(--color-primary);background-color:var(--color-primary);--tw-bg-opacity:0.1;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-compact .s-product-card-content{min-width:0px;flex:1 1 0%;padding:0px;text-align:right}.s-product-card-compact .s-product-card-content-main{margin-bottom:0.25rem}.s-product-card-compact .s-product-card-content-title{font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.25;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-product-card-compact .s-product-card-content-title a{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;display:block}.s-product-card-compact .s-product-card-content-subtitle{margin-top:0.25rem;display:none;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-product-card-compact .s-product-card-content-sub{display:flex;align-items:center;justify-content:flex-start;gap:0.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-product-card-compact .s-product-card-content-sub h4{margin:0px;font-weight:400}.s-product-card-compact .s-product-card-content-sub .s-product-card-price{font-weight:400}.s-product-card-compact .s-product-card-image{height:5rem;width:5rem;flex-shrink:0;border-radius:0.375rem}.s-product-card-compact .s-product-card-image img{height:100%;width:100%;border-radius:0.375rem;object-fit:cover}.s-product-card-compact .s-product-card-promotion-title{display:none}';export{e as salla_order_options_modal,d as salla_product_card}
4
+ import{r as t,h as r,a,H as o}from"./p-BsIeN-bg.js";import{S as i}from"./p-D4oPi1Ov.js";const e=class{constructor(r){t(this,r),this.resolveFn=null,this.rejectFn=null,this.optionsRefs=new Map,this.changeHandler=null,this.submitCallback=null,this.orderOptions=[],this.basePrice=0,this.liveTotal=0,this.isSubmitting=!1,this.sessionId=0,this.paymentMode="default",this.title="",this.subtitle="",this.submitLabel="",this.totalLabel="",this.requiredMessage="",this.handleClose=()=>{this.isSubmitting||(this.rejectFn?.({reason:"dismissed"}),this.resolveFn=null,this.rejectFn=null,this.detachChangeListener(),this.reset())},salla.lang.onLoaded((()=>this.loadTranslations()))}componentWillLoad(){this.loadTranslations()}loadTranslations(){this.title=salla.lang.get("blocks.order_options.title"),this.subtitle=salla.lang.get("blocks.order_options.subtitle"),this.submitLabel=salla.lang.get("blocks.order_options.continue"),this.totalLabel=salla.lang.get("blocks.order_options.total"),this.requiredMessage=salla.lang.get("blocks.order_options.required_message")}async open(t){return this.orderOptions=(Array.isArray(t.orderOptions)?t.orderOptions:[]).map((t=>({...t,details:t.details??[]}))),this.basePrice=Number(t.basePrice)||0,this.liveTotal=this.basePrice+this.seedOptionsPrice(this.orderOptions),this.isSubmitting=!1,this.sessionId++,this.optionsRefs.clear(),this.submitCallback=t.onSubmit??null,this.paymentMode=t.paymentMode??"default",await(this.modal?.open()),this.attachChangeListener(),new Promise(((t,r)=>{this.resolveFn=t,this.rejectFn=r}))}async close(){await(this.modal?.close())}collectOrderOptionsSync(){const t=[];for(const[,r]of this.optionsRefs)r&&r.querySelectorAll('[name^="options["],[name*="[options]["]').forEach((r=>{if(r instanceof HTMLInputElement&&("radio"===r.type||"checkbox"===r.type)&&!r.checked)return;const a=r.name.match(/(?:^|\[)options\]?\[(\d+)\]/);if(!a)return;const o=r.value;if(""===o||null==o)return;const i=Number(o);t.push({id:Number(a[1]),value:Number.isFinite(i)&&o===String(i)?i:o})}));return t}validateSync(){let t=!0;for(const[,r]of this.optionsRefs)r&&r.querySelectorAll("[required]").forEach((r=>{r.disabled||r.closest(".hidden")||"reportValidity"in r&&!r.reportValidity()&&(t=!1)}));return t}seedOptionsPrice(t){let r=0;return t.forEach((t=>{(t.details||[]).forEach((t=>{t.is_selected&&(r+=Number(t.total_price??t.additional_price)||0)}))})),r}attachChangeListener(){this.detachChangeListener(),this.changeHandler=()=>this.recomputeTotal(),salla.event.on("product-options::change",this.changeHandler)}detachChangeListener(){this.changeHandler&&(salla.event.off("product-options::change",this.changeHandler),this.changeHandler=null)}async recomputeTotal(){let t=0;for(const[,r]of this.optionsRefs)r&&(("function"==typeof r.getSelectedOptions?await r.getSelectedOptions():[])||[]).forEach((r=>{t+=Number(r.total_price??r.additional_price)||0}));this.liveTotal=this.basePrice+t}handleSubmit(){if(this.isSubmitting)return;if(!this.validateSync())return void salla.notify?.error?.(this.requiredMessage);this.isSubmitting=!0;const t=this.collectOrderOptionsSync(),r=Math.round(100*this.liveTotal)/100;try{this.submitCallback?.(t,r)}catch(t){salla?.logger?.warn?.("order-options modal onSubmit threw",t)}this.resolveFn?.({orderOptions:t}),this.resolveFn=null,this.rejectFn=null,this.submitCallback=null,this.detachChangeListener(),this.modal?.close().then((()=>this.reset())),this.isSubmitting=!1}reset(){this.orderOptions=[],this.optionsRefs.clear(),this.liveTotal=0}render(){const t=salla.money(Math.round(100*this.liveTotal)/100);return r("salla-modal",{key:"e84a40e1a27447d58ca5651a7ed76cbcf886495c",ref:t=>this.modal=t,class:"s-order-options-modal-host",width:"md","modal-title":this.title,onModalVisibilityChanged:t=>{t.detail||this.handleClose()}},r("div",{key:"fafa3cdeb22787d4a02f3fc8afb70770e1c3b4b5",class:"s-order-options-modal-body"},r("p",{key:"c563c24e1b8744f3248328ec16a18c5a668e7949",class:"s-order-options-modal-subtitle"},this.subtitle),r("div",{key:"475599cc47435b077d2321573328321888e60aa6",class:"s-order-options-modal-fields"},this.orderOptions.length>0&&r("salla-product-options",{key:this.sessionId,ref:t=>{t&&(this.optionsRefs.set("order-options",t),t.seedSelectedOptions?.())},"product-id":`order-options-${this.orderOptions[0]?.id}`,"unique-key":"order-options",options:JSON.stringify(this.orderOptions),"hide-out-label":"1","no-padding":!0}))),r("div",{key:"e00641853937f745c8cc798c7f9e15b389faf540",slot:"footer",class:"s-order-options-modal-footer"},"apple-pay"===this.paymentMode?r("div",{class:"s-order-options-modal-apple-pay-wrap"},r("div",{class:"s-order-options-modal-apple-pay-total"},r("span",{class:"s-order-options-modal-apple-pay-label"},this.totalLabel),r("span",{class:"s-order-options-modal-apple-pay-amount",innerHTML:t})),r("apple-pay-button",{locale:salla?.config?.get?.("user.language_code")||"ar",buttonstyle:"black",type:"buy",class:"s-order-options-modal-apple-pay",onClick:()=>this.handleSubmit()})):r("salla-button",{type:"button",color:"primary",fill:"solid",width:"wide",loading:this.isSubmitting,onClick:()=>this.handleSubmit()},r("span",{class:"s-order-options-modal-cta-content"},r("span",{class:"s-order-options-modal-cta-text"},this.submitLabel),r("span",{class:"s-order-options-modal-cta-total",innerHTML:t})))))}get host(){return a(this)}};e.style="/*!twlt*/.s-order-options-modal-host .s-modal-header-inner,.s-order-options-modal-host .s-modal-header-content,.s-order-options-modal-host .s-modal-title{text-align:start !important}.s-order-options-modal-apple-pay{display:block;width:100%;--apple-pay-button-width:100%;--apple-pay-button-height:44px;--apple-pay-button-border-radius:0.75rem}.s-order-options-modal-apple-pay-wrap{display:flex;flex-direction:column;gap:0.75rem;width:100%}.s-order-options-modal-apple-pay-total{display:flex;align-items:center;justify-content:space-between;gap:0.5rem}.s-order-options-modal-apple-pay-label,.s-order-options-modal-apple-pay-amount{font-size:1.125rem;line-height:1.5rem;font-weight:700;color:#111827}.static{position:static}.block{display:block}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-order-options-modal-body{display:block}.s-order-options-modal-subtitle{margin-bottom:1rem;font-size:0.875rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-order-options-modal-fields{display:flex;flex-direction:column;gap:1rem}.s-order-options-modal-item{display:block}.s-order-options-modal-footer{display:flex;width:100%;align-items:center}.s-order-options-modal-cta-content{display:flex;align-items:center;gap:0.25rem}.s-order-options-modal-cta-text{font-weight:700}.s-order-options-modal-cta-total{font-weight:700}";var s='\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>heart</title>\n<path d="M23.333 2.267c-3.547 0-5.779 1.605-7.333 3.061-1.555-1.456-3.787-3.061-7.333-3.061-5.955 0-8.667 5.045-8.667 9.733 0 8.503 10.147 14.735 15.513 16.841 0.156 0.061 0.321 0.092 0.487 0.092s0.331-0.031 0.487-0.092c5.367-2.107 15.513-8.339 15.513-16.841 0-4.688-2.712-9.733-8.667-9.733zM16 26.161c-5.537-2.309-13.333-7.799-13.333-14.161 0-3.517 1.856-7.067 6-7.067 2.983 0 4.656 1.451 6.384 3.203 0.5 0.508 1.399 0.508 1.899 0 1.728-1.752 3.401-3.203 6.384-3.203 4.144 0 6 3.549 6 7.067 0 6.363-7.796 11.852-13.333 14.161z"></path>\n</svg>\n';const d=class{constructor(r){if(t(this,r),salla.onReady((()=>{this.fitImageHeight=salla.config.get("store.settings.product.fit_type"),salla.wishlist.event.onAdded(((t,r)=>this.toggleFavoriteIcon(!0,r))),salla.wishlist.event.onRemoved(((t,r)=>this.toggleFavoriteIcon(!1,r))),this.placeholder=salla.url.asset(salla.config.get("theme.settings.placeholder"))})),salla.lang.onLoaded((()=>{this.remained=salla.lang.get("pages.products.remained"),this.donationAmount=salla.lang.get("pages.products.donation_amount"),this.startingPrice=salla.lang.get("pages.products.starting_price"),this.addToCart=salla.lang.get("pages.cart.add_to_cart"),this.outOfStock=salla.lang.get("pages.products.out_of_stock")})),this.product)try{this.productData="object"==typeof this.product?this.product:JSON.parse(this.product)}catch(t){salla.log("Bad json passed via product prop")}}initCircleBar(){let t=this.productData.quantity/(this.productData.quantity>100?2*this.productData.quantity:100)*100;this.pie.querySelector(".s-product-card-content-pie-svg-bar").style.strokeDashoffset=100-t}toggleFavoriteIcon(t=!0,r=null){r&&r!==this.productData.id||this.wishlistBtn?.classList.toggle("s-product-card-wishlist-added",t)}isInWishlist(){return salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)}async handleWishlistClick(){const t=this.isInWishlist();this.toggleFavoriteIcon(!t);try{await salla.wishlist.toggle(this.productData.id)}catch{this.toggleFavoriteIcon(t)}}formatDate(t){let r=new Date(t);return`${r.getFullYear()}-${r.getMonth()+1}-${r.getDate()}`}getProductBadge(){return this.productData.promotion_title?r("div",{class:"s-product-card-promotion-title"},this.productData.promotion_title):this.showQuantity&&this.productData?.quantity?r("div",{class:"s-product-card-quantity"},this.remained," ",salla.helpers.number(this.productData?.quantity)):this.showQuantity&&this.productData?.is_out_of_stock?r("div",{class:"s-product-card-out-badge"},this.outOfStock):""}getPriceFormat(t){return t&&0!=t?salla.money(t):salla.config.get("store.settings.product.show_price_as_dash")?"-":""}getProductPrice(){return this.productData.is_on_sale?r("div",{class:"s-product-card-sale-price"},r("h4",{innerHTML:this.getPriceFormat(this.productData.sale_price)}),r("span",{innerHTML:this.getPriceFormat(this.productData?.regular_price)})):this.productData.starting_price?r("div",{class:"s-product-card-starting-price"},r("p",null,this.startingPrice),r("h4",{innerHTML:this.getPriceFormat(this.productData?.starting_price)})):r("h4",{class:"s-product-card-price",innerHTML:this.getPriceFormat(this.productData?.price)})}render(){const t={"s-product-card-entry":!0,"s-product-card-vertical":!this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-horizontal":this.horizontal&&!this.fullImage&&!this.minimal,"s-product-card-fit-height":this.fitImageHeight&&!this.isSpecial&&!this.fullImage&&!this.minimal,"s-product-card-special":this.isSpecial,"s-product-card-full-image":this.fullImage,"s-product-card-minimal":this.minimal,"s-product-card-compact":this.compact,"s-product-card-donation":this.productData?.donation,"s-product-card-shadow":this.shadowOnHover,"s-product-card-out-of-stock":this.productData?.is_out_of_stock},a=this.productData?.url?{href:this.productData.url,title:`Learn more about ${this.productData?.name}`}:{};return r(o,{key:"c5a6d2bc2fcf23da1a41ab8b19b2e981fb111e30",id:`product-${this.productData?.id}`,class:t},r("div",{key:"e8d5105e4dbe367c612d62ef1dd6c95d04f440b0",class:this.fullImage?"s-product-card-image-full":"s-product-card-image"},r("a",{key:"8714997fcb48ef0eaabdf0a52cb775514e53db56",...a},r("img",{key:"eebd3c1dde0894037a7723c46e2f07f6a5aef939",class:`s-product-card-image-${salla.url.is_placeholder(this.productData?.image?.url)?"contain":this.fitImageHeight?this.fitImageHeight:"cover"} lazy`,src:this.placeholder,alt:this.productData?.image?.alt||this.productData?.name,"data-src":this.productData?.image?.url||this.productData?.thumbnail}),this.fullImage||this.minimal?"":this.getProductBadge()),this.fullImage&&r("a",{key:"72e240315320e976dcad8d3f027711b9c1d7bcf1",...a,class:"s-product-card-overlay"}),this.horizontal||this.fullImage?"":r("salla-button",{shape:"icon",fill:"none",color:"light",loading:!1,"aria-label":"Add or remove to wishlist",ref:t=>this.wishlistBtn=t,class:"s-product-card-wishlist-btn animated",onClick:()=>this.handleWishlistClick()},r("span",{innerHTML:s}))),r("div",{key:"2f0186ffc102488824cd7c346f4e07439474fc26",class:"s-product-card-content"},this.isSpecial&&this.productData?.quantity?r("div",{class:"s-product-card-content-pie",ref:t=>this.pie=t},r("span",null,r("b",null,salla.helpers.number(this.productData?.quantity)),this.remained),r("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -1 36 34",class:"s-product-card-content-pie-svg"},r("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-base"}),r("circle",{cx:"16",cy:"16",r:"15.9155",class:"s-product-card-content-pie-svg-bar"}))):"",r("div",{key:"d50ea0726d25bf3b551050e906fc615bc682e694",class:{"s-product-card-content-main":!0,"s-product-card-content-extra-padding":this.isSpecial}},r("h3",{key:"e4f39676d661a01d1aa6352cac7be6e764fa8687",class:"s-product-card-content-title"},r("a",{key:"0aacc2e00a0db730d1e803da34336085082df75d",...a},this.productData?.name)),this.productData?.subtitle&&!this.minimal?r("p",{class:"s-product-card-content-subtitle"},this.productData?.subtitle):""),!this.productData?.donation||this.minimal||this.fullImage?"":[r("salla-progress-bar",{donation:this.productData?.donation}),r("div",{class:"s-product-card-donation-input"},this.productData?.donation?.can_donate?[r("label",{htmlFor:"donation-amount"},this.donationAmount," ",r("span",null,"*")),r("input",{type:"text",onInput:t=>{salla.helpers.inputDigitsOnly(t.target),this.addBtn.donatingAmount=t.target.value},id:"donation-amount",name:"donating_amount",class:"s-form-control",placeholder:this.donationAmount})]:"")],r("div",{key:"445a1e16fee6ebb6ab5012aca324d3845991d13e",class:{"s-product-card-content-sub":!0,"s-product-card-content-extra-padding":this.isSpecial}},this.getProductPrice(),this.productData?.rating?.stars&&!this.minimal?r("div",{class:"s-product-card-rating"},r("span",{innerHTML:i}),r("span",null,this.productData.rating.stars)):""),this.isSpecial&&this.productData.discount_ends?r("salla-count-down",{date:this.formatDate(this.productData.discount_ends),"end-of-day":!0,boxed:!0,labeled:!0}):"",this.hideAddBtn||this.compact?"":r("div",{class:"s-product-card-content-footer"},r("salla-add-product-button",{fill:"outline",width:"wide",ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type},r("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label)),this.horizontal||this.fullImage?r("salla-button",{shape:"icon",fill:"none",color:"light",loading:!1,ref:t=>this.wishlistBtn=t,"aria-label":"Add or remove to wishlist",class:"s-product-card-wishlist-btn animated",onClick:()=>this.handleWishlistClick(),"data-id":"{{ product.id }}"},r("span",{class:"text-xl",innerHTML:s})):"")),!this.hideAddBtn&&this.compact?r("div",{class:"s-product-card-content-footer"},r("salla-add-product-button",{ref:t=>this.addBtn=t,"product-id":this.productData.id,"product-status":this.productData.status,"product-type":this.productData.type,class:"s-add-product-button-compact"},r("slot",{name:"add-to-cart-label"},this.productData.add_to_cart_label))):"")}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy")),this.productData?.quantity&&this.isSpecial&&this.initCircleBar(),!salla.config.isGuest()&&salla.storage.get("salla::wishlist",[]).includes(this.productData?.id)&&this.toggleFavoriteIcon()}static get assetsDirs(){return["assets"]}get host(){return a(this)}};d.style='/*!twlt*/.s-product-card-image::before{font-family:"sallaicons";content:"\\ec1f" !important}.s-product-card-content-pie-svg circle{transition:stroke-dashoffset 1s linear;-webkit-transition:stroke-dashoffset 1s linear;-moz-transition:stroke-dashoffset 1s linear;-ms-transition:stroke-dashoffset 1s linear;-o-transition:stroke-dashoffset 1s linear;stroke:#E8EDF2;stroke-width:2px;stroke-linecap:round;fill:none}.s-product-card-content-pie-svg-bar{stroke:var(--color-primary) !important;stroke-dasharray:100 100;stroke-dashoffset:100}.text-xl{font-size:1.25rem;line-height:1.75rem}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.has-error .s-form-control,.has-error .s-tel-input-control,.has-error .s-datetime-picker-input{border-color:#ff443a;color:#ff443a}.s-form-control{display:block;width:100%;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-form-control:focus{border-color:var(--color-primary);--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000)}.s-product-card-entry{position:relative;display:flex;height:100%;justify-content:space-between;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));transition-property:box-shadow;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-product-card-shadow:hover{box-shadow:5px 10px 30px #2b2d340d}.s-product-card-out-of-stock img.loaded{--tw-grayscale:grayscale(100%);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-product-card-overlay{position:absolute;top:0px;bottom:0px;left:0px;right:0px;--tw-bg-opacity:1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1));opacity:0.5;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:700ms}.s-product-card-overlay:hover{opacity:0.4}.s-product-card-vertical{flex-direction:column}.s-product-card-vertical .s-product-card-image{flex:1 1 0%;border-top-left-radius:var(--s-radius, 0.25rem);border-top-right-radius:var(--s-radius, 0.25rem)}.s-product-card-vertical .s-product-card-wishlist-btn{position:absolute;top:0.5rem;right:0.5rem;opacity:0.75}.s-product-card-vertical .s-product-card-wishlist-btn:hover{opacity:1}@media (min-width: 768px){.s-product-card-vertical .s-product-card-wishlist-btn{right:0.5rem}}.s-product-card-vertical .s-product-card-wishlist-btn:where([dir="rtl"],[dir="rtl"] *){left:0.5rem;right:unset}@media (min-width: 768px){.s-product-card-vertical .s-product-card-wishlist-btn:where([dir="rtl"],[dir="rtl"] *){left:0.5rem;right:unset}}.s-product-card-minimal .s-product-card-wishlist-btn{position:absolute;top:0px;right:0px;opacity:0.75}.s-product-card-minimal .s-product-card-wishlist-btn:hover{opacity:1}@media (min-width: 768px){.s-product-card-minimal .s-product-card-wishlist-btn{right:0px}}.s-product-card-minimal .s-product-card-wishlist-btn:where([dir="rtl"],[dir="rtl"] *){left:0px;right:unset}@media (min-width: 768px){.s-product-card-minimal .s-product-card-wishlist-btn:where([dir="rtl"],[dir="rtl"] *){left:0px;right:unset}}.s-product-card-minimal .s-product-card-image{width:8rem}@media (min-width: 640px){.s-product-card-minimal .s-product-card-image{width:14rem}}@media (min-width: 1024px){.s-product-card-minimal .s-product-card-image{width:7rem}}.s-product-card-minimal .s-product-card-content-title a{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.s-product-card-minimal .s-product-card-content{display:flex;flex:1 1 0%;flex-direction:column;overflow:hidden;padding:1.25rem}.s-product-card-minimal .s-product-card-wishlist-btn button{margin:0px;background-color:transparent}.s-product-card-minimal .s-product-card-wishlist-btn button svg,.s-product-card-full-image .s-product-card-wishlist-btn button svg{height:1rem;width:1rem;fill:#fff}.s-product-card-vertical .s-product-card-wishlist-btn button{margin:0px;--tw-bg-opacity:1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1)) !important}.s-product-card-wishlist-btn button:hover svg{fill:#4b5563}.s-product-card-fit-height .s-product-card-image{height:11rem;max-height:15rem}.s-product-card-quantity{position:absolute;bottom:0.25rem;left:50%;z-index:1;max-width:calc(100% - 60px);--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));border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.75rem;line-height:1rem;font-weight:700;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-product-card-quantity{padding-top:0.5rem;padding-bottom:0.5rem}}.s-product-card-promotion-title{position:absolute;top:1rem;left:0px;z-index:1;max-width:calc(100% - 60px);border-top-right-radius:var(--s-radius, 0.25rem);border-bottom-right-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.75rem;line-height:1rem;font-weight:700;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-product-card-promotion-title{padding-top:0.5rem;padding-bottom:0.5rem}}.s-product-card-promotion-title:where([dir="rtl"],[dir="rtl"] *){right:0px;left:unset;border-top-left-radius:var(--s-radius, 0.25rem);border-bottom-left-radius:var(--s-radius, 0.25rem);border-top-right-radius:0px;border-bottom-right-radius:0px}.s-product-card-out-badge{position:absolute;bottom:0.5rem;left:50%;z-index:1;max-width:calc(100% - 60px);--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));border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-left:0.625rem;padding-right:0.625rem;padding-top:0.375rem;padding-bottom:0.375rem;font-size:0.75rem;line-height:1rem;font-weight:700;--tw-text-opacity:1;color:rgb(153 153 153 / var(--tw-text-opacity, 1))}@media (min-width: 768px){.s-product-card-out-badge{padding-top:0.5rem;padding-bottom:0.5rem}}.s-product-card-image{position:relative;height:100%;width:100%;flex-shrink:0;overflow:hidden;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-product-card-image::before{position:absolute;top:50%;left:50%;display:inline-block;--tw-translate-x:-50%;--tw-translate-y:-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));font-size:1.875rem;line-height:2.25rem;content:var(--tw-content);--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-product-card-image:hover{opacity:0.9}.s-product-card-image img{height:100%;width:100%;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-product-card-image img.lazy{opacity:0}.s-product-card-image img.loaded{position:relative;opacity:1}.s-product-card-content{position:relative;display:flex;flex-direction:column;padding:0.75rem}@media (min-width: 640px){.s-product-card-content{padding:1.25rem}}.s-product-card-content-title{margin-bottom:0.625rem;max-width:100%;line-height:1.5rem}.s-product-card-content-subtitle{margin-bottom:0.625rem;font-size:0.875rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-product-card-special .s-product-card-content-main,special .s-product-card-content-sub{padding-right:6rem}.s-product-card-special .s-product-card-content-main:where([dir="rtl"],[dir="rtl"] *),special .s-product-card-content-sub:where([dir="rtl"],[dir="rtl"] *){padding-left:6rem;padding-right:0px}.s-product-card-donation-input{flex:1 1 0%}.s-product-card-donation-input label{margin-bottom:0.625rem;display:block;font-size:0.875rem;line-height:1.25rem}.s-product-card-donation-input label span{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-product-card-content-title a{display:block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-product-card-content-title a:hover{color:var(--color-primary)}.s-product-card-content-sub{margin-bottom:1.25rem;display:flex;width:100%;align-items:center;justify-content:space-between}.s-product-card-rating{display:flex;align-items:center}.s-product-card-rating>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem * var(--tw-space-x-reverse));margin-left:calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-card-rating{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-product-card-rating:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-card-rating span svg{margin-bottom:3px;height:1rem;width:1rem;fill:#fbbf24}.s-product-card-content-footer{margin-top:auto;display:flex;align-items:center}.s-product-card-sale-price>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.25rem * var(--tw-space-x-reverse));margin-left:calc(0.25rem * calc(1 - var(--tw-space-x-reverse)))}.s-product-card-sale-price:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-product-card-sale-price h4{display:inline-block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-product-card-sale-price span{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-product-card-starting-price{display:flex;width:100%;align-items:center;justify-content:space-between}.s-product-card-starting-price h4{display:inline-block;font-size:0.875rem;line-height:1.25rem;font-weight:700;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-product-card-price{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-product-card-image-cover{object-fit:cover}.s-product-card-image-contain{object-fit:contain}.s-product-card-content-pie{position:absolute;top:0.625rem;right:1.25rem;display:flex;height:72px;width:72px;align-items:center;justify-content:center;color:var(--color-primary)}.s-product-card-content-pie:where([dir="rtl"],[dir="rtl"] *){left:1.25rem;right:unset}.s-product-card-content-pie span{position:absolute;top:43%;left:50%;display:flex;--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));flex-direction:column;align-items:center;justify-content:center;text-align:center;font-size:0.75rem;line-height:1rem;line-height:1;--tw-text-opacity:1;color:rgb(124 128 130 / var(--tw-text-opacity, 1))}.s-product-card-content-pie span b{font-size:1.25rem;line-height:1.75rem;font-weight:700;color:var(--color-primary)}.s-product-card-content-extra-padding{padding-right:6rem}.s-product-card-content-extra-padding:where([dir="rtl"],[dir="rtl"] *){padding-left:6rem;padding-right:0px}.s-product-card-wishlist-added svg{fill:#ef4444}.s-product-card-horizontal .s-product-card-image{height:auto;width:8rem}@media (min-width: 640px){.s-product-card-horizontal .s-product-card-image{width:14rem}}.s-product-card-horizontal .s-product-card-image:where([dir="ltr"],[dir="ltr"] *){border-top-left-radius:var(--s-radius, 0.25rem);border-bottom-left-radius:var(--s-radius, 0.25rem)}.s-product-card-horizontal .s-product-card-image:where([dir="rtl"],[dir="rtl"] *){border-top-right-radius:var(--s-radius, 0.25rem);border-bottom-right-radius:var(--s-radius, 0.25rem)}.s-product-card-horizontal .s-product-card-quantity{max-width:unset}.s-product-card-horizontal .s-product-card-content-title a{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.s-product-card-horizontal .s-product-card-promotion-title{max-width:unset}.s-product-card-horizontal .s-product-card-out-badge{max-width:unset}.s-product-card-horizontal .s-product-card-content{margin-bottom:0.625rem;width:100%}.s-product-card-full-image{height:20rem;overflow:hidden}@media (min-width: 768px){.s-product-card-full-image{height:auto}}.s-product-card-full-image .s-product-card-content{position:absolute;bottom:0px;z-index:10;width:100%;padding-left:2.5rem;padding-right:2.5rem;padding-top:1.25rem;padding-bottom:1.75rem}.s-product-card-full-image img{position:relative;height:100%;width:100%;overflow:hidden;border-radius:var(--s-radius, 0.25rem)}.s-product-card-full-image img:hover{opacity:0.9}.s-product-card-full-image .s-product-card-image a{height:100%;width:100%}.s-product-card-full-image .s-product-card-content-title a{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-full-image .s-product-card-content-title a:hover{color:var(--color-primary)}.s-product-card-full-image .s-product-card-content-subtitle{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-full-image .s-product-card-price{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-full-image .s-product-card-sale-price{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-full-image .s-product-card-sale-price span{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-image-full{width:100%}.s-product-card-compact{display:flex;cursor:pointer;flex-direction:row;align-items:center;gap:0.75rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-top:0.75rem;padding-bottom:0.75rem;padding-left:0px;padding-right:0px;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-product-card-compact .s-product-card-content-footer{margin-top:0px;flex-shrink:0}.s-product-card-compact .s-add-product-button-compact salla-button .s-button-btn{height:2rem;border-radius:0.375rem;border-width:1px;border-color:var(--color-primary);background-color:transparent;padding-left:0.75rem;padding-right:0.75rem;font-size:0.75rem;line-height:1rem;font-weight:500;color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:200ms}.s-product-card-compact .s-add-product-button-compact salla-button .s-button-btn:hover{border-color:var(--color-primary);background-color:var(--color-primary);--tw-bg-opacity:0.1;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-product-card-compact .s-product-card-content{min-width:0px;flex:1 1 0%;padding:0px;text-align:right}.s-product-card-compact .s-product-card-content-main{margin-bottom:0.25rem}.s-product-card-compact .s-product-card-content-title{font-size:0.875rem;line-height:1.25rem;font-weight:600;line-height:1.25;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-product-card-compact .s-product-card-content-title a{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;display:block}.s-product-card-compact .s-product-card-content-subtitle{margin-top:0.25rem;display:none;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-product-card-compact .s-product-card-content-sub{display:flex;align-items:center;justify-content:flex-start;gap:0.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-product-card-compact .s-product-card-content-sub h4{margin:0px;font-weight:400}.s-product-card-compact .s-product-card-content-sub .s-product-card-price{font-weight:400}.s-product-card-compact .s-product-card-image{height:5rem;width:5rem;flex-shrink:0;border-radius:0.375rem}.s-product-card-compact .s-product-card-image img{height:100%;width:100%;border-radius:0.375rem;object-fit:cover}.s-product-card-compact .s-product-card-promotion-title{display:none}';export{e as salla_order_options_modal,d as salla_product_card}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as s,a}from"./p-C0qiFNJn.js";import{S as r}from"./p-Ctkfc4K-.js";import{l as i}from"./p-BChI23pG.js";import{T as o}from"./p-CJUR4sUM.js";import{A as c}from"./p-DCZbpt2a.js";import{P as n}from"./p-DY4LZmNP.js";import{a as l}from"./p-CgtvEd63.js";const f=class{constructor(e){t(this,e),this.internalOffers=[],this.showAll=!1,this.freeLabel="",this.receivedOffer="",this.discountAmountLabel="",this.showMoreOffers="",this.icons={DiscountCouponIcon:'\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>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n',GiftIcon:i,FireIcon:'\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>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n',SpecialDiscountIcon:r,TagMoneyIcon:o},this.visibleOffersCount=3,this.handleCartItemUpdated=t=>{const e=t.data?.cart?.items?.find((t=>String(t.id)===String(this.itemId)));e&&(this.internalQuantity=e.quantity,this.internalOffers=e.detailed_offers||[],this.internalProductPrice=e.product_price)},this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady(),await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam"),this.receivedOffer=salla.lang.get("pages.cart.received_offer"),this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount"),this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")})),this.internalQuantity=this.quantity,this.internalOffers=this.parseOffers(this.offers),this.internalProductPrice=this.productPrice}componentDidLoad(){Salla.cart.event.onLatestFetched(this.handleCartItemUpdated),Salla.cart.event.onItemUpdated(this.handleCartItemUpdated),Salla.cart.event.onCouponAdded(this.handleCartItemUpdated),Salla.cart.event.onCouponDeleted(this.handleCartItemUpdated)}parseOffers(t){try{if("string"!=typeof t)return console.warn("Offers is not a string. Returning as-is.",t),Array.isArray(t)?t:[];const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch(t){return console.error("Failed to parse offers",t),[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(t,e){return t-e.free_quantity}renderOffer(t,s){const a=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&a>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(a)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))}render(){return this.internalOffers?.length?e("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((t=>this.renderOffer(this.internalQuantity,t))),this.internalOffers?.length>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:c,class:{"s-cart-item-offers-arrow-icon":!0,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((t=>this.renderOffer(this.internalQuantity,t))))):null}};f.style="/*!twlt*/:host{display:block}.s-cart-item-offers-box{margin-bottom:0.75rem}.s-cart-item-offers-container{margin-top:1.25rem}.s-cart-item-offers-paid-free{margin-bottom:0.75rem}.s-cart-item-offers-paid-free>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.25rem * var(--tw-space-y-reverse))}.s-cart-item-offers-paid-free{font-weight:500}.s-cart-item-offers-line{text-align:start}.s-cart-item-offers-regular-price{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-item-offers-free-label{margin-left:0.5rem;margin-right:0.5rem;display:inline-block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-details{display:flex;align-items:flex-start;gap:0.625rem;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon{--tw-translate-y:-3px;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));font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon svg{width:18px;fill:currentColor}.s-cart-item-offers-title{margin-bottom:0.5rem;font-weight:500}.s-cart-item-offers-message{font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-discount{margin-top:0px;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-cart-item-offers-show-more-btn{display:flex;align-items:center;justify-content:flex-start !important;background-color:transparent !important;padding-left:0px !important;padding-right:0px !important;font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-show-more-btn:hover{--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-arrow-icon{margin-left:0.125rem;margin-right:0.125rem;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-item-offers-arrow-open{--tw-rotate:-180deg;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-cart-item-offers-show-more-btn svg{width:18px}.s-cart-item-offers-show-more-label{display:flex;align-items:center}.s-cart-item-offers-collapsed{margin-top:0.5rem}";const m=class{constructor(e){t(this,e),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",this.handleCheckoutClick=t=>{salla.mobile?.isSpaWebview?.()&&salla.mobile.openCheckout&&(t.preventDefault(),salla.mobile.openCheckout(this.getCartLink()))},salla.cart.event.onUpdated((t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0}))}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!t?.src)return void salla.log("Failed to get the img element");let e=this.host.querySelector("#s-cart-icon"),s=e.getBoundingClientRect(),a=s.top+window.scrollY,r=s.left+window.scrollX,i=t.getBoundingClientRect(),o=t.offsetWidth+"px",c=t.offsetHeight+"px",n=i.top,f=i.left,m=document.createElement("img");m.src=t.getAttribute("src"),m.className="s-cart-thumb",m.setAttribute("style","object-fit:cover; width:"+o+"; height:"+c+"; top:"+n+"px; left:"+f+"px;z-index:99999999; "),document.body.append(m);let h=document.querySelector(".s-cart-thumb");e.classList.remove("animated","rubberBand"),(new l.timeline).add({targets:h,width:[150,30],height:[150,30],top:[n,window.scrollY>0?a-window.scrollY-40:a-40],left:[f,r],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:h,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?a-window.scrollY-40:a-40,window.scrollY>0?a-window.scrollY+10:a+10],left:[r,r+10]},"-=500").add({complete:function(){e.classList.add("animated","rubberBand"),h.remove()}},"-=1700")}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const e=salla.storage.get("scope")||salla.config.get("store.scope");if(e&&e.id)try{const s=new URL(t);return s.searchParams.set("scope",e.id),e.allocation_type&&s.searchParams.set("allocation_type",e.allocation_type),e.allocation_id&&s.searchParams.set("allocation_id",e.allocation_id),s.toString()}catch(s){const a=t.includes("?")?"&":"?",r=new URLSearchParams;return r.set("scope",String(e.id)),e.allocation_type&&r.set("allocation_type",e.allocation_type),e.allocation_id&&r.set("allocation_id",e.allocation_id),`${t}${a}${r.toString()}`}return t}render(){return e(s,{key:"27e472fb912afff849c94a8a93a9a71778c6819d"},e("a",{key:"f9ef99f2a7205fcfdc0bdd799b1b751ab40bcb35",class:"s-cart-summary-wrapper",href:this.getCartLink(),onClick:this.handleCheckoutClick},e("div",{key:"1b0d26d3e17b0fb5d6b2cbdc1cd14c079a5fb47b",id:"s-cart-icon"},e("slot",{key:"3c64b2afa8782a4018dd086e657f16373a91f997",name:"icon"},e("i",{key:"46f1cebfa346e20d27f8ffed1206c05828be004a",class:"s-cart-summary-icon",innerHTML:n}))),e("span",{key:"72bd9fc2d2949b74109b9e57e823c4c4cc99d287",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),e("p",{key:"d65efd069e4f5968c8f592bf341b35853b000bda",class:"s-cart-summary-content"},this.showCartLabel&&e("span",{key:"ecbd5350d56131aee746913bb7c6e662431f7001",class:"s-cart-summary-label"},this.cartLabel),e("b",{key:"aeebd5d52966dc183111e49289061c3649087a8f",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return a(this)}};m.style='/*!twlt*/.block{display:block}.s-cart-summary-wrapper{text-decoration:none;color:var(--color-text);transition:all .5s cubic-bezier(0.2, 1, 0.3, 1);align-items:center;font-weight:bolder;position:relative;display:inline-flex}.s-cart-thumb{position:fixed;transition:all 0.3s cubic-bezier(0.2, 1, 0.3, 1)}.s-cart-summary-icon svg{height:1.25rem;width:1.25rem;fill:var(--color-text)}.s-cart-summary-count{position:absolute;top:-8px;left:-15px;display:inline-flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-cart-summary-count:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-15px}';export{f as salla_cart_item_offers,m as salla_cart_summary}
4
+ import{r as t,h as e,H as s,a}from"./p-BsIeN-bg.js";import{S as r}from"./p-Ctkfc4K-.js";import{l as i}from"./p-BChI23pG.js";import{T as o}from"./p-CJUR4sUM.js";import{A as c}from"./p-DCZbpt2a.js";import{P as n}from"./p-DY4LZmNP.js";import{a as l}from"./p-CgtvEd63.js";const f=class{constructor(e){t(this,e),this.internalOffers=[],this.showAll=!1,this.freeLabel="",this.receivedOffer="",this.discountAmountLabel="",this.showMoreOffers="",this.icons={DiscountCouponIcon:'\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>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n',GiftIcon:i,FireIcon:'\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>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n',SpecialDiscountIcon:r,TagMoneyIcon:o},this.visibleOffersCount=3,this.handleCartItemUpdated=t=>{const e=t.data?.cart?.items?.find((t=>String(t.id)===String(this.itemId)));e&&(this.internalQuantity=e.quantity,this.internalOffers=e.detailed_offers||[],this.internalProductPrice=e.product_price)},this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady(),await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam"),this.receivedOffer=salla.lang.get("pages.cart.received_offer"),this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount"),this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")})),this.internalQuantity=this.quantity,this.internalOffers=this.parseOffers(this.offers),this.internalProductPrice=this.productPrice}componentDidLoad(){Salla.cart.event.onLatestFetched(this.handleCartItemUpdated),Salla.cart.event.onItemUpdated(this.handleCartItemUpdated),Salla.cart.event.onCouponAdded(this.handleCartItemUpdated),Salla.cart.event.onCouponDeleted(this.handleCartItemUpdated)}parseOffers(t){try{if("string"!=typeof t)return console.warn("Offers is not a string. Returning as-is.",t),Array.isArray(t)?t:[];const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch(t){return console.error("Failed to parse offers",t),[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(t,e){return t-e.free_quantity}renderOffer(t,s){const a=this.getPaidQty(t,s);return e("div",{class:"s-cart-item-offers-box"},s.free_quantity>0&&a>0&&e("div",{class:"s-cart-item-offers-paid-free"},e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(a)," × ",e("span",{innerHTML:salla.money(this.internalProductPrice)})),e("div",{class:"s-cart-item-offers-line"},salla.helpers.number(s.free_quantity)," ×",e("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),e("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),e("div",{class:"s-cart-item-offers-details"},e("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[s.discount_icon]||""}),e("div",null,e("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",s.offer_name)),e("p",{class:"s-cart-item-offers-discount"},e("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(s.discount_amount.toFixed(2)))})))))}render(){return this.internalOffers?.length?e("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((t=>this.renderOffer(this.internalQuantity,t))),this.internalOffers?.length>this.visibleOffersCount&&e("div",{class:"s-cart-item-offers-show-more"},e("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},e("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,e("span",{innerHTML:c,class:{"s-cart-item-offers-arrow-icon":!0,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&e("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((t=>this.renderOffer(this.internalQuantity,t))))):null}};f.style="/*!twlt*/:host{display:block}.s-cart-item-offers-box{margin-bottom:0.75rem}.s-cart-item-offers-container{margin-top:1.25rem}.s-cart-item-offers-paid-free{margin-bottom:0.75rem}.s-cart-item-offers-paid-free>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.25rem * var(--tw-space-y-reverse))}.s-cart-item-offers-paid-free{font-weight:500}.s-cart-item-offers-line{text-align:start}.s-cart-item-offers-regular-price{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-cart-item-offers-free-label{margin-left:0.5rem;margin-right:0.5rem;display:inline-block;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-details{display:flex;align-items:flex-start;gap:0.625rem;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon{--tw-translate-y:-3px;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));font-size:1.125rem;line-height:1.75rem;font-weight:700;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.s-cart-item-offers-icon svg{width:18px;fill:currentColor}.s-cart-item-offers-title{margin-bottom:0.5rem;font-weight:500}.s-cart-item-offers-message{font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-discount{margin-top:0px;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-cart-item-offers-show-more-btn{display:flex;align-items:center;justify-content:flex-start !important;background-color:transparent !important;padding-left:0px !important;padding-right:0px !important;font-size:0.875rem;line-height:1.25rem}.s-cart-item-offers-show-more-btn:hover{--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-cart-item-offers-arrow-icon{margin-left:0.125rem;margin-right:0.125rem;transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-cart-item-offers-arrow-open{--tw-rotate:-180deg;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-cart-item-offers-show-more-btn svg{width:18px}.s-cart-item-offers-show-more-label{display:flex;align-items:center}.s-cart-item-offers-collapsed{margin-top:0.5rem}";const m=class{constructor(e){t(this,e),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",this.handleCheckoutClick=t=>{salla.mobile?.isSpaWebview?.()&&salla.mobile.openCheckout&&(t.preventDefault(),salla.mobile.openCheckout(this.getCartLink()))},salla.cart.event.onUpdated((t=>{this.cartSummaryCount=t.count||0,this.cartSummaryTotal=t.total||0}))}async animateToCart(t){if(document.querySelectorAll(".s-cart-thumb").forEach((t=>t.remove())),!t?.src)return void salla.log("Failed to get the img element");let e=this.host.querySelector("#s-cart-icon"),s=e.getBoundingClientRect(),a=s.top+window.scrollY,r=s.left+window.scrollX,i=t.getBoundingClientRect(),o=t.offsetWidth+"px",c=t.offsetHeight+"px",n=i.top,f=i.left,m=document.createElement("img");m.src=t.getAttribute("src"),m.className="s-cart-thumb",m.setAttribute("style","object-fit:cover; width:"+o+"; height:"+c+"; top:"+n+"px; left:"+f+"px;z-index:99999999; "),document.body.append(m);let h=document.querySelector(".s-cart-thumb");e.classList.remove("animated","rubberBand"),(new l.timeline).add({targets:h,width:[150,30],height:[150,30],top:[n,window.scrollY>0?a-window.scrollY-40:a-40],left:[f,r],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:h,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?a-window.scrollY-40:a-40,window.scrollY>0?a-window.scrollY+10:a+10],left:[r,r+10]},"-=500").add({complete:function(){e.classList.add("animated","rubberBand"),h.remove()}},"-=1700")}componentWillLoad(){return new Promise((t=>salla.onReady(t)))}getCartLink(){let t=salla.url.get("cart");const e=salla.storage.get("scope")||salla.config.get("store.scope");if(e&&e.id)try{const s=new URL(t);return s.searchParams.set("scope",e.id),e.allocation_type&&s.searchParams.set("allocation_type",e.allocation_type),e.allocation_id&&s.searchParams.set("allocation_id",e.allocation_id),s.toString()}catch(s){const a=t.includes("?")?"&":"?",r=new URLSearchParams;return r.set("scope",String(e.id)),e.allocation_type&&r.set("allocation_type",e.allocation_type),e.allocation_id&&r.set("allocation_id",e.allocation_id),`${t}${a}${r.toString()}`}return t}render(){return e(s,{key:"27e472fb912afff849c94a8a93a9a71778c6819d"},e("a",{key:"f9ef99f2a7205fcfdc0bdd799b1b751ab40bcb35",class:"s-cart-summary-wrapper",href:this.getCartLink(),onClick:this.handleCheckoutClick},e("div",{key:"1b0d26d3e17b0fb5d6b2cbdc1cd14c079a5fb47b",id:"s-cart-icon"},e("slot",{key:"3c64b2afa8782a4018dd086e657f16373a91f997",name:"icon"},e("i",{key:"46f1cebfa346e20d27f8ffed1206c05828be004a",class:"s-cart-summary-icon",innerHTML:n}))),e("span",{key:"72bd9fc2d2949b74109b9e57e823c4c4cc99d287",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),e("p",{key:"d65efd069e4f5968c8f592bf341b35853b000bda",class:"s-cart-summary-content"},this.showCartLabel&&e("span",{key:"ecbd5350d56131aee746913bb7c6e662431f7001",class:"s-cart-summary-label"},this.cartLabel),e("b",{key:"aeebd5d52966dc183111e49289061c3649087a8f",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return a(this)}};m.style='/*!twlt*/.block{display:block}.s-cart-summary-wrapper{text-decoration:none;color:var(--color-text);transition:all .5s cubic-bezier(0.2, 1, 0.3, 1);align-items:center;font-weight:bolder;position:relative;display:inline-flex}.s-cart-thumb{position:fixed;transition:all 0.3s cubic-bezier(0.2, 1, 0.3, 1)}.s-cart-summary-icon svg{height:1.25rem;width:1.25rem;fill:var(--color-text)}.s-cart-summary-count{position:absolute;top:-8px;left:-15px;display:inline-flex;height:1.25rem;width:1.25rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(248 113 113 / var(--tw-bg-opacity, 1));padding:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.s-cart-summary-count:where([dir="rtl"],[dir="rtl"] *){left:unset;right:-15px}';export{f as salla_cart_item_offers,m as salla_cart_summary}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as o}from"./p-C0qiFNJn.js";import{T as t}from"./p-CJUR4sUM.js";import{i as r}from"./p-DqDX5na4.js";const n=class{constructor(o){e(this,o),this.coupon=null,this.isLoading=!0,this.titlePercentTpl="",this.titleFixedTpl="",this.badgeLabel="",this.minSpendTpl="",this.expiresTpl="",this.shopNowLabel="",this.copyLabel="",this.copiedLabel=""}componentWillLoad(){Salla.onReady().then((()=>Salla.lang.onLoaded())).then((()=>(this.loadTranslations(),this.loadCoupon()))).catch((()=>{this.isLoading=!1}))}loadTranslations(){this.titlePercentTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_percent")||"",this.titleFixedTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_fixed")||"",this.badgeLabel=Salla.lang.get("pages.thank_you.next_order_coupon_badge")||"",this.minSpendTpl=Salla.lang.get("pages.thank_you.next_order_coupon_min_spend")||"",this.expiresTpl=Salla.lang.get("pages.thank_you.next_order_coupon_expires")||"",this.shopNowLabel=Salla.lang.get("pages.thank_you.next_order_coupon_shop_now")||"",this.copyLabel=Salla.lang.get("common.elements.copy")||"",this.copiedLabel=Salla.lang.get("pages.thank_you.next_order_coupon_copied")||""}async loadCoupon(){try{const e=await salla.api.request("coupons",{params:{type:"thankyou"}}),o=e?.data,t=Array.isArray(o)?o:Array.isArray(o?.data)?o.data:[];this.coupon=t[0]??null}catch{this.coupon=null}finally{this.isLoading=!1}}async copyCode(){if(this.coupon)try{await navigator.clipboard.writeText(this.coupon.code),salla.notify.success(this.copiedLabel),salla.event.dispatch("salla::next-order-coupon.code.copied",{code:this.coupon.code})}catch{}}isPercentage(){return"P"===this.coupon?.type||"percentage"===this.coupon?.type}formatAmount(){if(!this.coupon)return"";if(this.isPercentage())return`${salla.helpers.number(this.coupon.amount)}%`;const e=this.coupon.amount;return o("span","object"==typeof e&&e.amount?{innerHTML:salla.money(e.amount,e.currency)}:{innerHTML:salla.money(e)})}formatMinSpend(){const e=this.coupon?.minimum_amount;return e&&("object"!=typeof e||e.amount)?"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):salla.money(e.amount,e.currency):""}formatExpiry(){const e=this.coupon?.expiry_date;return e?new Date(e).toLocaleDateString(Salla.lang.locale||"en-GB"):""}renderSkeleton(){return o("div",{class:"s-next-order-coupon-wrapper s-next-order-coupon-skeleton"},o("div",{class:"s-next-order-coupon-inner"},o("div",{class:"s-next-order-coupon-info"},o("salla-skeleton",{type:"normal",width:"48px",height:"48px"}),o("div",{class:"s-next-order-coupon-details"},o("salla-skeleton",{height:"14px",width:"220px"}),o("salla-skeleton",{height:"12px",width:"140px"}))),o("div",{class:"s-next-order-coupon-actions"},o("salla-skeleton",{height:"40px",width:"140px"}),o("salla-skeleton",{height:"40px",width:"100px"}))))}renderTitle(){const e=this.formatAmount(),t=this.isPercentage()?this.titlePercentTpl:this.titleFixedTpl,r=this.isPercentage()?":amount%":":amount",n=t.split(r);return o("p",{class:"s-next-order-coupon-title"},n[0],o("span",{class:"s-next-order-coupon-amount"},e),n[1]||"")}render(){if(this.isLoading)return this.renderSkeleton();if(!this.coupon)return null;const e=this.formatMinSpend(),n=this.formatExpiry();return o("div",{class:"s-next-order-coupon-wrapper"},o("div",{class:"s-next-order-coupon-inner"},o("div",{class:"s-next-order-coupon-info"},o("div",{class:"s-next-order-coupon-icon-wrap"},o("span",{class:"s-next-order-coupon-icon-bg"}),o("span",{class:"s-next-order-coupon-icon",innerHTML:t})),o("div",{class:"s-next-order-coupon-details"},o("div",{class:"s-next-order-coupon-title-row"},this.renderTitle(),o("span",{class:"s-next-order-coupon-badge"},o("span",{class:"s-next-order-coupon-badge-bg"}),o("span",{class:"s-next-order-coupon-badge-text"},this.badgeLabel))),(e||n)&&o("p",{class:"s-next-order-coupon-meta"},e&&o("span",{innerHTML:this.minSpendTpl.replace(":amount",e)}),n&&o("span",null,this.expiresTpl.replace(":date",n))))),o("div",{class:"s-next-order-coupon-actions"},o("div",{class:"s-next-order-coupon-code-box"},o("span",{class:"s-next-order-coupon-code-text"},this.coupon.code),o("salla-button",{shape:"link",class:"s-next-order-coupon-copy-btn",title:this.copyLabel,onClick:()=>this.copyCode()},o("span",{class:"s-next-order-coupon-copy-icon",innerHTML:r}))),o("salla-button",{href:salla.url.get(""),class:"s-next-order-coupon-shop-btn"},this.shopNowLabel))))}};n.style="/*!twlt*/:host{display:block}.fixed{position:fixed}.s-next-order-coupon-wrapper{margin-bottom:1.5rem;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:1rem}@media (min-width: 768px){.s-next-order-coupon-wrapper{margin-bottom:2rem;padding-left:2rem;padding-right:2rem}}.s-next-order-coupon-inner{display:flex;flex-direction:column;gap:1rem}@media (min-width: 768px){.s-next-order-coupon-inner{flex-direction:row;align-items:center;justify-content:space-between}}.s-next-order-coupon-info{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-next-order-coupon-icon-wrap{position:relative;display:flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:var(--s-radius, 0.25rem)}.s-next-order-coupon-icon-bg{position:absolute;inset:0px;border-radius:var(--s-radius, 0.25rem);background-color:var(--color-primary);opacity:0.25}.s-next-order-coupon-icon{position:relative;color:var(--color-primary)}.s-next-order-coupon-icon svg{height:1.5rem;width:1.75rem;fill:currentColor}.s-next-order-coupon-details{display:flex;min-width:0px;flex-direction:column;gap:0.5rem}.s-next-order-coupon-title-row{display:flex;flex-wrap:wrap;align-items:center;gap:0.375rem}.s-next-order-coupon-title{font-size:1rem;line-height:1.5rem;font-weight:700;line-height:1.375}.s-next-order-coupon-amount{color:var(--color-primary)}.s-next-order-coupon-badge{position:relative;display:inline-flex;height:1.5rem;align-items:center;border-radius:9999px;padding-left:0.75rem;padding-right:0.75rem;font-size:0.75rem;line-height:1rem;color:var(--color-primary)}.s-next-order-coupon-badge-bg{position:absolute;inset:0px;border-radius:9999px;background-color:var(--color-primary);opacity:0.25}.s-next-order-coupon-badge-text{position:relative}.s-next-order-coupon-meta{display:flex;flex-wrap:wrap;column-gap:0.25rem;font-size:0.875rem;line-height:1.25rem;line-height:1.375;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-next-order-coupon-actions{display:flex;flex-direction:column;gap:0.75rem}@media (min-width: 768px){.s-next-order-coupon-actions{flex-shrink:0;flex-direction:row;align-items:center}}.s-next-order-coupon-code-box{display:flex;height:2.5rem;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.375rem;border-width:1px;border-style:dashed;border-color:var(--color-primary);padding-left:1rem;padding-right:1rem}@media (min-width: 768px){.s-next-order-coupon-code-box{width:auto}}.s-next-order-coupon-code-text{font-size:1rem;line-height:1.5rem;line-height:1;letter-spacing:0.025em}.s-next-order-coupon-copy-btn{display:flex;height:auto !important;align-items:center;padding:0px !important}.s-next-order-coupon-copy-icon{pointer-events:none;color:var(--color-primary)}.s-next-order-coupon-copy-icon svg{height:1rem;width:1rem;fill:currentColor}.s-next-order-coupon-shop-btn{width:100%;white-space:nowrap;text-align:center}@media (min-width: 768px){.s-next-order-coupon-shop-btn{width:auto}}@keyframes pulse{50%{opacity:.5}}.s-next-order-coupon-skeleton{animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}";export{n as salla_next_order_coupon}
4
+ import{r as e,h as o}from"./p-BsIeN-bg.js";import{T as t}from"./p-CJUR4sUM.js";import{i as r}from"./p-DqDX5na4.js";const n=class{constructor(o){e(this,o),this.coupon=null,this.isLoading=!0,this.titlePercentTpl="",this.titleFixedTpl="",this.badgeLabel="",this.minSpendTpl="",this.expiresTpl="",this.shopNowLabel="",this.copyLabel="",this.copiedLabel=""}componentWillLoad(){Salla.onReady().then((()=>Salla.lang.onLoaded())).then((()=>(this.loadTranslations(),this.loadCoupon()))).catch((()=>{this.isLoading=!1}))}loadTranslations(){this.titlePercentTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_percent")||"",this.titleFixedTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_fixed")||"",this.badgeLabel=Salla.lang.get("pages.thank_you.next_order_coupon_badge")||"",this.minSpendTpl=Salla.lang.get("pages.thank_you.next_order_coupon_min_spend")||"",this.expiresTpl=Salla.lang.get("pages.thank_you.next_order_coupon_expires")||"",this.shopNowLabel=Salla.lang.get("pages.thank_you.next_order_coupon_shop_now")||"",this.copyLabel=Salla.lang.get("common.elements.copy")||"",this.copiedLabel=Salla.lang.get("pages.thank_you.next_order_coupon_copied")||""}async loadCoupon(){try{const e=await salla.api.request("coupons",{params:{type:"thankyou"}}),o=e?.data,t=Array.isArray(o)?o:Array.isArray(o?.data)?o.data:[];this.coupon=t[0]??null}catch{this.coupon=null}finally{this.isLoading=!1}}async copyCode(){if(this.coupon)try{await navigator.clipboard.writeText(this.coupon.code),salla.notify.success(this.copiedLabel),salla.event.dispatch("salla::next-order-coupon.code.copied",{code:this.coupon.code})}catch{}}isPercentage(){return"P"===this.coupon?.type||"percentage"===this.coupon?.type}formatAmount(){if(!this.coupon)return"";if(this.isPercentage())return`${salla.helpers.number(this.coupon.amount)}%`;const e=this.coupon.amount;return o("span","object"==typeof e&&e.amount?{innerHTML:salla.money(e.amount,e.currency)}:{innerHTML:salla.money(e)})}formatMinSpend(){const e=this.coupon?.minimum_amount;return e&&("object"!=typeof e||e.amount)?"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):salla.money(e.amount,e.currency):""}formatExpiry(){const e=this.coupon?.expiry_date;return e?new Date(e).toLocaleDateString(Salla.lang.locale||"en-GB"):""}renderSkeleton(){return o("div",{class:"s-next-order-coupon-wrapper s-next-order-coupon-skeleton"},o("div",{class:"s-next-order-coupon-inner"},o("div",{class:"s-next-order-coupon-info"},o("salla-skeleton",{type:"normal",width:"48px",height:"48px"}),o("div",{class:"s-next-order-coupon-details"},o("salla-skeleton",{height:"14px",width:"220px"}),o("salla-skeleton",{height:"12px",width:"140px"}))),o("div",{class:"s-next-order-coupon-actions"},o("salla-skeleton",{height:"40px",width:"140px"}),o("salla-skeleton",{height:"40px",width:"100px"}))))}renderTitle(){const e=this.formatAmount(),t=this.isPercentage()?this.titlePercentTpl:this.titleFixedTpl,r=this.isPercentage()?":amount%":":amount",n=t.split(r);return o("p",{class:"s-next-order-coupon-title"},n[0],o("span",{class:"s-next-order-coupon-amount"},e),n[1]||"")}render(){if(this.isLoading)return this.renderSkeleton();if(!this.coupon)return null;const e=this.formatMinSpend(),n=this.formatExpiry();return o("div",{class:"s-next-order-coupon-wrapper"},o("div",{class:"s-next-order-coupon-inner"},o("div",{class:"s-next-order-coupon-info"},o("div",{class:"s-next-order-coupon-icon-wrap"},o("span",{class:"s-next-order-coupon-icon-bg"}),o("span",{class:"s-next-order-coupon-icon",innerHTML:t})),o("div",{class:"s-next-order-coupon-details"},o("div",{class:"s-next-order-coupon-title-row"},this.renderTitle(),o("span",{class:"s-next-order-coupon-badge"},o("span",{class:"s-next-order-coupon-badge-bg"}),o("span",{class:"s-next-order-coupon-badge-text"},this.badgeLabel))),(e||n)&&o("p",{class:"s-next-order-coupon-meta"},e&&o("span",{innerHTML:this.minSpendTpl.replace(":amount",e)}),n&&o("span",null,this.expiresTpl.replace(":date",n))))),o("div",{class:"s-next-order-coupon-actions"},o("div",{class:"s-next-order-coupon-code-box"},o("span",{class:"s-next-order-coupon-code-text"},this.coupon.code),o("salla-button",{shape:"link",class:"s-next-order-coupon-copy-btn",title:this.copyLabel,onClick:()=>this.copyCode()},o("span",{class:"s-next-order-coupon-copy-icon",innerHTML:r}))),o("salla-button",{href:salla.url.get(""),class:"s-next-order-coupon-shop-btn"},this.shopNowLabel))))}};n.style="/*!twlt*/:host{display:block}.fixed{position:fixed}.s-next-order-coupon-wrapper{margin-bottom:1.5rem;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;padding-top:1rem;padding-bottom:1rem}@media (min-width: 768px){.s-next-order-coupon-wrapper{margin-bottom:2rem;padding-left:2rem;padding-right:2rem}}.s-next-order-coupon-inner{display:flex;flex-direction:column;gap:1rem}@media (min-width: 768px){.s-next-order-coupon-inner{flex-direction:row;align-items:center;justify-content:space-between}}.s-next-order-coupon-info{display:flex;min-width:0px;flex:1 1 0%;align-items:center;gap:0.75rem}.s-next-order-coupon-icon-wrap{position:relative;display:flex;height:3rem;width:3rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:var(--s-radius, 0.25rem)}.s-next-order-coupon-icon-bg{position:absolute;inset:0px;border-radius:var(--s-radius, 0.25rem);background-color:var(--color-primary);opacity:0.25}.s-next-order-coupon-icon{position:relative;color:var(--color-primary)}.s-next-order-coupon-icon svg{height:1.5rem;width:1.75rem;fill:currentColor}.s-next-order-coupon-details{display:flex;min-width:0px;flex-direction:column;gap:0.5rem}.s-next-order-coupon-title-row{display:flex;flex-wrap:wrap;align-items:center;gap:0.375rem}.s-next-order-coupon-title{font-size:1rem;line-height:1.5rem;font-weight:700;line-height:1.375}.s-next-order-coupon-amount{color:var(--color-primary)}.s-next-order-coupon-badge{position:relative;display:inline-flex;height:1.5rem;align-items:center;border-radius:9999px;padding-left:0.75rem;padding-right:0.75rem;font-size:0.75rem;line-height:1rem;color:var(--color-primary)}.s-next-order-coupon-badge-bg{position:absolute;inset:0px;border-radius:9999px;background-color:var(--color-primary);opacity:0.25}.s-next-order-coupon-badge-text{position:relative}.s-next-order-coupon-meta{display:flex;flex-wrap:wrap;column-gap:0.25rem;font-size:0.875rem;line-height:1.25rem;line-height:1.375;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-next-order-coupon-actions{display:flex;flex-direction:column;gap:0.75rem}@media (min-width: 768px){.s-next-order-coupon-actions{flex-shrink:0;flex-direction:row;align-items:center}}.s-next-order-coupon-code-box{display:flex;height:2.5rem;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.375rem;border-width:1px;border-style:dashed;border-color:var(--color-primary);padding-left:1rem;padding-right:1rem}@media (min-width: 768px){.s-next-order-coupon-code-box{width:auto}}.s-next-order-coupon-code-text{font-size:1rem;line-height:1.5rem;line-height:1;letter-spacing:0.025em}.s-next-order-coupon-copy-btn{display:flex;height:auto !important;align-items:center;padding:0px !important}.s-next-order-coupon-copy-icon{pointer-events:none;color:var(--color-primary)}.s-next-order-coupon-copy-icon svg{height:1rem;width:1rem;fill:currentColor}.s-next-order-coupon-shop-btn{width:100%;white-space:nowrap;text-align:center}@media (min-width: 768px){.s-next-order-coupon-shop-btn{width:auto}}@keyframes pulse{50%{opacity:.5}}.s-next-order-coupon-skeleton{animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite}";export{n as salla_next_order_coupon}
@@ -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-C0qiFNJn.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-BsIeN-bg.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,h as a,H as s,a as r}from"./p-C0qiFNJn.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-BsIeN-bg.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 t,h as e,H as r}from"./p-C0qiFNJn.js";const i=class{constructor(e){t(this,e),this.parsedSections=[]}parseProducts(t){let e=[];if("string"==typeof t)try{const r=JSON.parse(t);e=this.extractSections(r)}catch(r){console.error("Invalid JSON passed to bundleSections prop:",t),e=[]}else t&&(e=this.extractSections(t));this.parsedSections=e}extractSections(t){return t.bundle&&t.bundle.sections&&Array.isArray(t.bundle.sections)?t.bundle.sections:Array.isArray(t)?t:t.sections&&Array.isArray(t.sections)?t.sections:(console.warn("No valid sections found in data:",t),[])}isCartPage(){return salla.url.is_page("cart")}renderCartPage(){return e("salla-multiple-bundle-product-cart",{sections:this.parsedSections})}renderDetailsPage(){return e("salla-multiple-bundle-product-details",{sections:this.parsedSections})}componentWillLoad(){this.parseProducts(this.bundleSections)}render(){return e(r,{key:"db7efe81ce29dd1bc45cc5f1dbd45b6b03e31de8",class:"s-multiple-bundle-product-wrapper"},this.isCartPage()?this.renderCartPage():this.renderDetailsPage())}static get watchers(){return{bundleSections:["parseProducts"]}}};i.style="/*!twlt*/:host{display:block}.visible{visibility:visible}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.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-multiple-bundle-product-wrapper{margin-bottom:1.25rem;display:block}.s-multiple-bundle-product-wrapper-sections{display:flex;flex-direction:column;gap:1rem}.s-multiple-bundle-product-wrapper-slider .swiper{display:block !important}.s-multiple-bundle-product-wrapper-slider .swiper-pagination{position:static}.s-multiple-bundle-product-wrapper-slider .swiper-pagination .swiper-pagination-bullet{height:8px;width:8px}.s-multiple-bundle-product-slide-one-third{height:auto;width:100% !important}@media (min-width: 640px){.s-multiple-bundle-product-slide-one-third{width:100% !important}}@media (min-width: 768px){.s-multiple-bundle-product-slide-one-third{width:50% !important}}@media (min-width: 1024px){.s-multiple-bundle-product-slide-one-third{width:35.7% !important}}.s-multiple-bundle-product-slide-one-third-disabled{pointer-events:none;cursor:not-allowed}.s-multiple-bundle-product-slide-one-third-disabled .s-multiple-bundle-product-image-wrapper{opacity:0.5}.s-multiple-bundle-product-slide-one-third-disabled .s-multiple-bundle-product-button{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-card{position:relative;display:flex;height:100%;width:100%;flex-direction:column;overflow:hidden;border-radius:0.5rem;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-multiple-bundle-product-checkbox{position:absolute;top:0.25rem;right:0.5rem;height:1rem;width:1rem;border-radius:var(--s-radius, 0.25rem);--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));accent-color:#16a34a}.s-multiple-bundle-product-image-wrapper{display:flex;height:200px;justify-content:center}.s-multiple-bundle-product-image{width:100%;object-fit:cover}.s-multiple-bundle-product-content-wrapper{padding:0.5rem;line-height:1rem}.s-multiple-bundle-product-content{display:flex;align-items:flex-start;justify-content:space-between;gap:0.5rem}.s-multiple-bundle-product-details{display:flex;flex-direction:column}.s-multiple-bundle-product-title-wrapper{flex:1 1 0%}.s-multiple-bundle-product-title{font-size:9px;font-weight:500;line-height:1rem;--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-price-wrapper{display:flex;align-items:center;gap:0.25rem}.s-multiple-bundle-product-price{font-size:9px;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-price-discount{margin-left:0.5rem;font-size:8px;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-multiple-bundle-product-button{display:flex;align-items:center;gap:0.25rem;border-radius:0.5rem;border-width:0px;text-align:start;font-size:10px;font-weight:700;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1));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-multiple-bundle-product-button:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-button-icon{font-size:10px;font-weight:700}.s-multiple-bundle-product-button-icon svg{height:1rem;width:1rem;fill:#16a34a}.s-multiple-bundle-product-button-disabled-icon{pointer-events:none;opacity:0.5}.s-multiple-bundle-product-badge{display:flex;flex-shrink:0;align-items:center;gap:0.25rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;font-size:7px;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-options-modal-footer{display:flex;justify-content:flex-end}.s-multiple-bundle-product-options-modal-slider{margin-top:1.25rem;display:flex;gap:1.25rem}.s-multiple-bundle-product-options-modal-slider .s-slider-container .swiper-slide{display:flex;align-items:center;justify-content:center}.s-multiple-bundle-product-options-modal-slider .s-slider-thumbs{margin-top:0px !important}.s-multiple-bundle-product-options-modal-slider .s-slider-thumbs-container{position:static;margin:0px !important;width:40px !important;transform:none !important;padding-left:0px !important;padding-right:0px !important;padding-top:0.5rem !important;padding-bottom:0.5rem !important}.s-multiple-bundle-product-options-modal-slider .s-slider-thumbs-container .swiper-slide{margin-top:0px !important;display:flex !important;height:40px !important;width:100%;align-items:center;justify-content:center;padding:0.25rem}.s-multiple-bundle-product-cart-header-wrapper{width:100%}.s-multiple-bundle-product-cart-header{display:flex;align-items:center;gap:1rem}.s-multiple-bundle-product-cart-header-no-options{justify-content:space-between}.s-multiple-bundle-product-cart-header-content{display:flex;align-items:center;gap:1rem}.s-multiple-bundle-product-cart-header-remove-button{display:flex;align-items:center;gap:0.25rem}.s-multiple-bundle-product-cart-body-remove-button{display:flex;align-items:center;justify-content:flex-end;gap:0.25rem}.s-multiple-bundle-product-cart-header-image-wrapper{position:relative;flex-shrink:0;overflow:hidden}.s-multiple-bundle-product-cart-header-image{height:4rem;width:4rem;flex:none;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));object-fit:cover;object-position:center}.s-multiple-bundle-product-cart-header-content-details>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.25rem * var(--tw-space-y-reverse))}.s-multiple-bundle-product-cart-header-content-details-title{font-size:1rem;font-weight:500;line-height:1.5rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-cart-header-content-details-price{display:flex;align-items:center;gap:0.25rem}.s-multiple-bundle-product-cart-header-content-details-price-regular{font-size:0.75rem;line-height:1rem;font-weight:700;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-cart-header-content-details-price-sale{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-multiple-bundle-product-cart-header-content-details-quantity{display:flex;align-items:center;gap:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-cart-header-content-details-title-link{font-size:1rem;line-height:1.5rem;font-weight:500}.s-multiple-bundle-product-options-modal-slider-thumb{height:100%;width:100%;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));object-fit:cover}";export{i as salla_multiple_bundle_product}
4
+ import{r as t,h as e,H as r}from"./p-BsIeN-bg.js";const i=class{constructor(e){t(this,e),this.parsedSections=[]}parseProducts(t){let e=[];if("string"==typeof t)try{const r=JSON.parse(t);e=this.extractSections(r)}catch(r){console.error("Invalid JSON passed to bundleSections prop:",t),e=[]}else t&&(e=this.extractSections(t));this.parsedSections=e}extractSections(t){return t.bundle&&t.bundle.sections&&Array.isArray(t.bundle.sections)?t.bundle.sections:Array.isArray(t)?t:t.sections&&Array.isArray(t.sections)?t.sections:(console.warn("No valid sections found in data:",t),[])}isCartPage(){return salla.url.is_page("cart")}renderCartPage(){return e("salla-multiple-bundle-product-cart",{sections:this.parsedSections})}renderDetailsPage(){return e("salla-multiple-bundle-product-details",{sections:this.parsedSections})}componentWillLoad(){this.parseProducts(this.bundleSections)}render(){return e(r,{key:"db7efe81ce29dd1bc45cc5f1dbd45b6b03e31de8",class:"s-multiple-bundle-product-wrapper"},this.isCartPage()?this.renderCartPage():this.renderDetailsPage())}static get watchers(){return{bundleSections:["parseProducts"]}}};i.style="/*!twlt*/:host{display:block}.visible{visibility:visible}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.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-multiple-bundle-product-wrapper{margin-bottom:1.25rem;display:block}.s-multiple-bundle-product-wrapper-sections{display:flex;flex-direction:column;gap:1rem}.s-multiple-bundle-product-wrapper-slider .swiper{display:block !important}.s-multiple-bundle-product-wrapper-slider .swiper-pagination{position:static}.s-multiple-bundle-product-wrapper-slider .swiper-pagination .swiper-pagination-bullet{height:8px;width:8px}.s-multiple-bundle-product-slide-one-third{height:auto;width:100% !important}@media (min-width: 640px){.s-multiple-bundle-product-slide-one-third{width:100% !important}}@media (min-width: 768px){.s-multiple-bundle-product-slide-one-third{width:50% !important}}@media (min-width: 1024px){.s-multiple-bundle-product-slide-one-third{width:35.7% !important}}.s-multiple-bundle-product-slide-one-third-disabled{pointer-events:none;cursor:not-allowed}.s-multiple-bundle-product-slide-one-third-disabled .s-multiple-bundle-product-image-wrapper{opacity:0.5}.s-multiple-bundle-product-slide-one-third-disabled .s-multiple-bundle-product-button{--tw-text-opacity:1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-card{position:relative;display:flex;height:100%;width:100%;flex-direction:column;overflow:hidden;border-radius:0.5rem;border-width:1px;border-style:solid;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-multiple-bundle-product-checkbox{position:absolute;top:0.25rem;right:0.5rem;height:1rem;width:1rem;border-radius:var(--s-radius, 0.25rem);--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));accent-color:#16a34a}.s-multiple-bundle-product-image-wrapper{display:flex;height:200px;justify-content:center}.s-multiple-bundle-product-image{width:100%;object-fit:cover}.s-multiple-bundle-product-content-wrapper{padding:0.5rem;line-height:1rem}.s-multiple-bundle-product-content{display:flex;align-items:flex-start;justify-content:space-between;gap:0.5rem}.s-multiple-bundle-product-details{display:flex;flex-direction:column}.s-multiple-bundle-product-title-wrapper{flex:1 1 0%}.s-multiple-bundle-product-title{font-size:9px;font-weight:500;line-height:1rem;--tw-text-opacity:1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-price-wrapper{display:flex;align-items:center;gap:0.25rem}.s-multiple-bundle-product-price{font-size:9px;font-weight:700;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-price-discount{margin-left:0.5rem;font-size:8px;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-multiple-bundle-product-button{display:flex;align-items:center;gap:0.25rem;border-radius:0.5rem;border-width:0px;text-align:start;font-size:10px;font-weight:700;--tw-text-opacity:1;color:rgb(22 163 74 / var(--tw-text-opacity, 1));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-multiple-bundle-product-button:hover{--tw-text-opacity:1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-button-icon{font-size:10px;font-weight:700}.s-multiple-bundle-product-button-icon svg{height:1rem;width:1rem;fill:#16a34a}.s-multiple-bundle-product-button-disabled-icon{pointer-events:none;opacity:0.5}.s-multiple-bundle-product-badge{display:flex;flex-shrink:0;align-items:center;gap:0.25rem;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));padding-left:0.5rem;padding-right:0.5rem;font-size:7px;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-options-modal-footer{display:flex;justify-content:flex-end}.s-multiple-bundle-product-options-modal-slider{margin-top:1.25rem;display:flex;gap:1.25rem}.s-multiple-bundle-product-options-modal-slider .s-slider-container .swiper-slide{display:flex;align-items:center;justify-content:center}.s-multiple-bundle-product-options-modal-slider .s-slider-thumbs{margin-top:0px !important}.s-multiple-bundle-product-options-modal-slider .s-slider-thumbs-container{position:static;margin:0px !important;width:40px !important;transform:none !important;padding-left:0px !important;padding-right:0px !important;padding-top:0.5rem !important;padding-bottom:0.5rem !important}.s-multiple-bundle-product-options-modal-slider .s-slider-thumbs-container .swiper-slide{margin-top:0px !important;display:flex !important;height:40px !important;width:100%;align-items:center;justify-content:center;padding:0.25rem}.s-multiple-bundle-product-cart-header-wrapper{width:100%}.s-multiple-bundle-product-cart-header{display:flex;align-items:center;gap:1rem}.s-multiple-bundle-product-cart-header-no-options{justify-content:space-between}.s-multiple-bundle-product-cart-header-content{display:flex;align-items:center;gap:1rem}.s-multiple-bundle-product-cart-header-remove-button{display:flex;align-items:center;gap:0.25rem}.s-multiple-bundle-product-cart-body-remove-button{display:flex;align-items:center;justify-content:flex-end;gap:0.25rem}.s-multiple-bundle-product-cart-header-image-wrapper{position:relative;flex-shrink:0;overflow:hidden}.s-multiple-bundle-product-cart-header-image{height:4rem;width:4rem;flex:none;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));object-fit:cover;object-position:center}.s-multiple-bundle-product-cart-header-content-details>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0.25rem * var(--tw-space-y-reverse))}.s-multiple-bundle-product-cart-header-content-details-title{font-size:1rem;font-weight:500;line-height:1.5rem;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-cart-header-content-details-price{display:flex;align-items:center;gap:0.25rem}.s-multiple-bundle-product-cart-header-content-details-price-regular{font-size:0.75rem;line-height:1rem;font-weight:700;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-cart-header-content-details-price-sale{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-multiple-bundle-product-cart-header-content-details-quantity{display:flex;align-items:center;gap:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.s-multiple-bundle-product-cart-header-content-details-title-link{font-size:1rem;line-height:1.5rem;font-weight:500}.s-multiple-bundle-product-options-modal-slider-thumb{height:100%;width:100%;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));object-fit:cover}";export{i as salla_multiple_bundle_product}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,a as r}from"./p-C0qiFNJn.js";import{S as o}from"./p-Ctkfc4K-.js";import{T as i,C as a}from"./p-DRvZV5oe.js";const l=class{constructor(t){e(this,t),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(e=>this.open(e))),salla.product.event.onOfferExisted((e=>{salla.storage.get("remember-offer-"+e.id)?salla.log("User selected to don't show this offer again."):this.open(e.product_id)}))}emitPromotionViewed(e){e&&salla.event.emit("promotion::viewed",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(e){e&&salla.event.emit("promotion::clicked",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}async open(e){return this.productID=e,this.hasError=!1,this.modal.loading(),await salla.api.withoutNotifier((()=>salla.product.offers(e))).then((e=>{e.data&&e.data.length&&(this.modal.open(),this.showOffer(e.data[0]))})).catch((e=>{this.hasError=!0,this.errorMessage=e.response?.data?.error?.message||e.response?.data,this.modal.open()})).finally((()=>{this.modal.visible&&setTimeout((()=>this.modal.stopLoading()),1e3)}))}async showOffer(e){this.offer=e,this.offer_name=e.name,this.offer_message=e.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length?this.offer_type="categories":this.offer.get.brands?.length?this.offer_type="brands":this.offer.get.tags?.length&&(this.offer_type="tags"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(e){salla.storage.set("remember-offer-"+this.offer.id,e.target.checked)}addToCart(e){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,e,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return t("div",{class:"s-offer-modal-discount-table"},t("table",null,t("tbody",null,this.offer.get.discounts_table?.map((e=>t("tr",null,t("td",null,e.text),t("td",{class:"s-offer-modal-discount-table-cell"},t("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(e.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const e=this.offer.get.products?.length||0,r={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,e),spaceBetween:16},1024:{slidesPerView:Math.min(3,e),spaceBetween:16}}};return t("salla-products-slider",{key:(this.offer.get.products?.map((e=>e.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((e=>e.id))||[]).join(",")}]`,"slider-config":JSON.stringify(r)})}return this.offer.get.categories?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.categories.map((e=>t("a",{href:e.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,i).replace(/\{name\}/g,e.name).replace(/\{url\}/g,e.urls.customer)}))))):this.offer.get.brands?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.brands?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.brands?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.brands.map((e=>t("a",{href:e.url||salla.url.create("brands",e.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-brand-item"},t("div",{class:"s-offer-modal-brand-logo"},t("img",{src:e.logo,alt:e.name})),t("span",{class:"s-offer-modal-badge-text"},e.name)))))):this.offer.get.tags?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.tags?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.tags?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.tags.map((e=>t("a",{href:e.url||salla.url.create("tags",e.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-tag-item"},t("span",{class:"s-offer-modal-badge-icon",innerHTML:i}),t("span",{class:"s-offer-modal-badge-text"},e.name)))))):void 0}render(){return t("salla-modal",{key:"570466318b6cd66a7a8b3dd0d80424c2fd73328d","has-skeleton":!0,"sub-title":this.offer_message,ref:e=>this.modal=e,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},t("div",{key:"ded0c8df17d5e5c1d6e77b8e1be469e69d3ee12f",slot:"loading"},t("div",{key:"fc96c54fcecc896b3e5a1838e2d07d545fce2f85",class:"s-offer-modal-skeleton"},t("div",{key:"ee7a6f25aabbf4263b43fc7545bbb2c7bfca9b3a",class:"s-offer-modal-skeleton-header"},t("salla-skeleton",{key:"9604f5f33d1d8e074cc3c314addb945b087431ee",type:"circle",height:"80px",width:"80px"}),t("salla-skeleton",{key:"65194ecfee0a01f7c38aa72f7ce2c8c81c893b1f",height:"15px",width:"50%"}),t("salla-skeleton",{key:"21d466bf32f435a511dcece76f51f4052089c130",height:"10px",width:"30%"})),t("div",{key:"53fb44c7c60ca8236dc7ec60ff65cb71df39c03b",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>t("div",{class:"s-offer-modal-skeleton-item"},t("salla-skeleton",{height:"9rem"}),t("div",{class:"s-offer-modal-skeleton-item-title"},t("salla-skeleton",{height:"15px",width:"100%"})),t("div",{class:"s-offer-modal-skeleton-item-subtitle"},t("salla-skeleton",{height:"9px",width:"50%"}),t("div",{innerHTML:a})))))),t("div",{key:"52ad47514b0c00b73ec7d98073b09d21ce6a2b12",class:"s-offer-modal-skeleton-footer"},t("salla-skeleton",{key:"a271e30ab34d96731cc1f51c32cba9aaefee1953",height:"15px",width:"50%"}),t("salla-skeleton",{key:"6e199a5b1283c9d82588c60c712d3799b88c5c8d",height:"15px",width:"30%"})))),this.hasError||null===this.offer?t("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?t("span",{slot:"description"},this.errorMessage):""):[t("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:o}),this.getOfferContent(),t("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?t("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",t("label",{class:"s-offer-modal-remember-label"},t("input",{type:"checkbox",onChange:e=>this.rememberMe(e),class:"s-offer-modal-remember-input"}),"  ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return r(this)}};l.style='/*!twlt*/.s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}.visible{visibility:visible}.table{display:table}.outline{outline-style:solid}.s-loyalty-placeholder{display:flex;align-items:center;justify-content:center}.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-modal-header{flex-direction:column}.s-offer-modal-body{display:flex;overflow-x:auto;margin-left:-32px;margin-right:-32px;padding-left:32px;padding-right:32px;gap:24px;padding-bottom:32px;-webkit-overflow-scrolling:touch}.s-offer-modal-body::-webkit-scrollbar{display:none}.s-offer-modal-badge{margin-bottom:0.625rem;display:inline-flex;align-items:center;justify-content:center;border-radius:1.5rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-top:0.625rem;padding-bottom:0.625rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-modal-badge:where([dir="ltr"],[dir="ltr"] *){margin-left:0.625rem}.s-offer-modal-badge:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-offer-modal-badge-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.375rem}.s-offer-modal-badge-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.375rem}.s-offer-modal-badge-icon svg{margin-bottom:1rem;display:inline-block;height:1.5rem;width:1.5rem;fill:var(--color-primary)}.s-offer-modal-badge-text{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-offer-modal-cat-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));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:500ms}.s-offer-modal-cat-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));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:500ms}.s-offer-modal-brand-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-logo{margin-bottom:0.75rem;height:4rem;width:4rem;object-fit:contain}.s-offer-modal-brand-logo img{height:100%;width:100%;object-fit:contain}.s-offer-modal-tag-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));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:500ms}.s-offer-modal-tag-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-product.swiper-slide{display:flex;width:70%;flex-shrink:0;flex-grow:1;flex-direction:column}@media (min-width: 640px){.s-offer-modal-product.swiper-slide{width:40%}}@media (min-width: 1024px){.s-offer-modal-product.swiper-slide{width:28%}}.s-offer-modal-product-image-wrap{position:relative;margin-bottom:1rem;display:block;height:8rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-offer-modal-product-image{height:100%;width:100%;object-fit:cover}.s-offer-modal-not-available{--tw-grayscale:grayscale(100%);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-offer-modal-product-info{margin-bottom:1rem}.s-offer-modal-product-name{margin-bottom:0.375rem;display:inline-block;width:11rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-offer-modal-product-name:hover{color:var(--color-primary)}.s-offer-modal-product-price{margin-bottom:1.25rem;display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700}@media (min-width: 768px){.s-offer-modal-product-price{margin-bottom:0px}}@media (min-width: 640px){.s-offer-modal-product-price:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-offer-modal-product-price:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}}.s-offer-modal-product-sale-price{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-modal-product-old-price{margin-left:0.25rem;margin-right:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-offer-modal-btn-wrap{margin-top:auto}.s-offer-modal-header-icon{display:inline-flex;height:4rem;width:4rem;flex-shrink:0;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-offer-modal-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-offer-modal-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-offer-modal-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-offer-modal-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-offer-modal-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-offer-modal-header-icon svg{height:1.75rem;width:1.75rem;flex-shrink:0;fill:#9ca3af}.s-offer-modal-footer{margin-top:1rem;display:flex;flex-direction:column;justify-content:space-between;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-offer-modal-footer{margin-top:2rem;flex-direction:row}}.s-offer-modal-expiry{margin-bottom:1.25rem}@media (min-width: 768px){.s-offer-modal-expiry{margin-bottom:0px}}.s-offer-modal-remember-label{display:flex;cursor:pointer;font-size:0.875rem;line-height:1.25rem;font-weight:500;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-offer-modal-remember-label:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-offer-modal-remember-label:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-offer-modal-remember-label:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}}.s-offer-modal-remember-input{height:1.5rem;width:1.5rem;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-offer-modal-remember-input:focus{--tw-ring-color:transparent}.s-offer-modal-slider-centered .swiper-wrapper{justify-content:center}.s-offer-modal-slider-centered .s-offer-modal-slider-item{display:flex;max-width:28%;flex-shrink:0;flex-grow:1;flex-direction:column}.s-offer-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-offer-modal-skeleton-items{margin-top:1.5rem;margin-bottom:1.5rem;display:flex;width:100%;align-items:center}.s-offer-modal-skeleton-item{position:relative;margin-right:1.25rem;width:33.333333%;cursor:unset !important;text-align:center}.s-offer-modal-skeleton-item:last-child{margin-right:0px}.s-offer-modal-skeleton-item:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:1.25rem}.s-offer-modal-skeleton-item:last-child:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-offer-modal-skeleton-header{width:100%}.s-offer-modal-skeleton-header salla-skeleton{margin-left:auto;margin-right:auto}.s-offer-modal-skeleton-header salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-offer-modal-skeleton-header salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-offer-modal-skeleton-header salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-offer-modal-skeleton-item-subtitle{display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-modal-skeleton-item-subtitle div svg{height:1rem;width:1rem;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-offer-modal-skeleton-item-title{margin-top:0.75rem;margin-bottom:0.75rem}.s-offer-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-modal-discount-table{width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(238 238 238 / var(--tw-border-opacity, 1))}.s-offer-modal-discount-table table{width:100%;text-align:left;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(119 119 119 / var(--tw-text-opacity, 1))}.s-offer-modal-discount-table tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(238 238 238 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-offer-modal-discount-table tr:last-child{border-bottom-width:0px}.s-offer-modal-discount-table tr td{padding-top:1rem;padding-bottom:1rem;padding-left:1.5rem;padding-right:1.5rem}.s-offer-modal-discount-table tr td:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-offer-modal-discount-table-cell{text-align:right}.s-offer-modal-discount-table-cell:where([dir="rtl"],[dir="rtl"] *){text-align:left !important}.s-offer-modal-type-discounts-table .s-modal-body{position:relative !important}';export{l as salla_offer_modal}
4
+ import{r as e,h as t,a as r}from"./p-BsIeN-bg.js";import{S as o}from"./p-Ctkfc4K-.js";import{T as i,C as a}from"./p-DRvZV5oe.js";const l=class{constructor(t){e(this,t),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(e=>this.open(e))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(e=>this.open(e))),salla.product.event.onOfferExisted((e=>{salla.storage.get("remember-offer-"+e.id)?salla.log("User selected to don't show this offer again."):this.open(e.product_id)}))}emitPromotionViewed(e){e&&salla.event.emit("promotion::viewed",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(e){e&&salla.event.emit("promotion::clicked",[{id:e.id?.toString(),creative:e.message,name:e.name,position:`${this.offer_type}_offer_modal`}])}async open(e){return this.productID=e,this.hasError=!1,this.modal.loading(),await salla.api.withoutNotifier((()=>salla.product.offers(e))).then((e=>{e.data&&e.data.length&&(this.modal.open(),this.showOffer(e.data[0]))})).catch((e=>{this.hasError=!0,this.errorMessage=e.response?.data?.error?.message||e.response?.data,this.modal.open()})).finally((()=>{this.modal.visible&&setTimeout((()=>this.modal.stopLoading()),1e3)}))}async showOffer(e){this.offer=e,this.offer_name=e.name,this.offer_message=e.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length?this.offer_type="categories":this.offer.get.brands?.length?this.offer_type="brands":this.offer.get.tags?.length&&(this.offer_type="tags"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(e){salla.storage.set("remember-offer-"+this.offer.id,e.target.checked)}addToCart(e){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,e,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return t("div",{class:"s-offer-modal-discount-table"},t("table",null,t("tbody",null,this.offer.get.discounts_table?.map((e=>t("tr",null,t("td",null,e.text),t("td",{class:"s-offer-modal-discount-table-cell"},t("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(e.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const e=this.offer.get.products?.length||0,r={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,e),spaceBetween:16},1024:{slidesPerView:Math.min(3,e),spaceBetween:16}}};return t("salla-products-slider",{key:(this.offer.get.products?.map((e=>e.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((e=>e.id))||[]).join(",")}]`,"slider-config":JSON.stringify(r)})}return this.offer.get.categories?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.categories.map((e=>t("a",{href:e.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,i).replace(/\{name\}/g,e.name).replace(/\{url\}/g,e.urls.customer)}))))):this.offer.get.brands?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.brands?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.brands?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.brands.map((e=>t("a",{href:e.url||salla.url.create("brands",e.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-brand-item"},t("div",{class:"s-offer-modal-brand-logo"},t("img",{src:e.logo,alt:e.name})),t("span",{class:"s-offer-modal-badge-text"},e.name)))))):this.offer.get.tags?.length?t("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.tags?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.tags?.length<=2?"false":"true"},t("div",{slot:"items"},this.offer.get.tags.map((e=>t("a",{href:e.url||salla.url.create("tags",e.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-tag-item"},t("span",{class:"s-offer-modal-badge-icon",innerHTML:i}),t("span",{class:"s-offer-modal-badge-text"},e.name)))))):void 0}render(){return t("salla-modal",{key:"570466318b6cd66a7a8b3dd0d80424c2fd73328d","has-skeleton":!0,"sub-title":this.offer_message,ref:e=>this.modal=e,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},t("div",{key:"ded0c8df17d5e5c1d6e77b8e1be469e69d3ee12f",slot:"loading"},t("div",{key:"fc96c54fcecc896b3e5a1838e2d07d545fce2f85",class:"s-offer-modal-skeleton"},t("div",{key:"ee7a6f25aabbf4263b43fc7545bbb2c7bfca9b3a",class:"s-offer-modal-skeleton-header"},t("salla-skeleton",{key:"9604f5f33d1d8e074cc3c314addb945b087431ee",type:"circle",height:"80px",width:"80px"}),t("salla-skeleton",{key:"65194ecfee0a01f7c38aa72f7ce2c8c81c893b1f",height:"15px",width:"50%"}),t("salla-skeleton",{key:"21d466bf32f435a511dcece76f51f4052089c130",height:"10px",width:"30%"})),t("div",{key:"53fb44c7c60ca8236dc7ec60ff65cb71df39c03b",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>t("div",{class:"s-offer-modal-skeleton-item"},t("salla-skeleton",{height:"9rem"}),t("div",{class:"s-offer-modal-skeleton-item-title"},t("salla-skeleton",{height:"15px",width:"100%"})),t("div",{class:"s-offer-modal-skeleton-item-subtitle"},t("salla-skeleton",{height:"9px",width:"50%"}),t("div",{innerHTML:a})))))),t("div",{key:"52ad47514b0c00b73ec7d98073b09d21ce6a2b12",class:"s-offer-modal-skeleton-footer"},t("salla-skeleton",{key:"a271e30ab34d96731cc1f51c32cba9aaefee1953",height:"15px",width:"50%"}),t("salla-skeleton",{key:"6e199a5b1283c9d82588c60c712d3799b88c5c8d",height:"15px",width:"30%"})))),this.hasError||null===this.offer?t("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?t("span",{slot:"description"},this.errorMessage):""):[t("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:o}),this.getOfferContent(),t("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?t("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",t("label",{class:"s-offer-modal-remember-label"},t("input",{type:"checkbox",onChange:e=>this.rememberMe(e),class:"s-offer-modal-remember-input"}),"  ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return r(this)}};l.style='/*!twlt*/.s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}.visible{visibility:visible}.table{display:table}.outline{outline-style:solid}.s-loyalty-placeholder{display:flex;align-items:center;justify-content:center}.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-modal-header{flex-direction:column}.s-offer-modal-body{display:flex;overflow-x:auto;margin-left:-32px;margin-right:-32px;padding-left:32px;padding-right:32px;gap:24px;padding-bottom:32px;-webkit-overflow-scrolling:touch}.s-offer-modal-body::-webkit-scrollbar{display:none}.s-offer-modal-badge{margin-bottom:0.625rem;display:inline-flex;align-items:center;justify-content:center;border-radius:1.5rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding-top:0.625rem;padding-bottom:0.625rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-offer-modal-badge:where([dir="ltr"],[dir="ltr"] *){margin-left:0.625rem}.s-offer-modal-badge:where([dir="rtl"],[dir="rtl"] *){margin-left:0.625rem}.s-offer-modal-badge-icon:where([dir="ltr"],[dir="ltr"] *){margin-left:0.375rem}.s-offer-modal-badge-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.375rem}.s-offer-modal-badge-icon svg{margin-bottom:1rem;display:inline-block;height:1.5rem;width:1.5rem;fill:var(--color-primary)}.s-offer-modal-badge-text{font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-offer-modal-cat-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));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:500ms}.s-offer-modal-cat-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));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:500ms}.s-offer-modal-brand-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-brand-logo{margin-bottom:0.75rem;height:4rem;width:4rem;object-fit:contain}.s-offer-modal-brand-logo img{height:100%;width:100%;object-fit:contain}.s-offer-modal-tag-item.swiper-slide{margin-top:1rem;margin-bottom:1rem;display:flex;height:9rem;max-width:180px;flex-direction:column;align-items:center;justify-content:center;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.75rem;text-align:center;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));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:500ms}.s-offer-modal-tag-item.swiper-slide:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1));--tw-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-offer-modal-product.swiper-slide{display:flex;width:70%;flex-shrink:0;flex-grow:1;flex-direction:column}@media (min-width: 640px){.s-offer-modal-product.swiper-slide{width:40%}}@media (min-width: 1024px){.s-offer-modal-product.swiper-slide{width:28%}}.s-offer-modal-product-image-wrap{position:relative;margin-bottom:1rem;display:block;height:8rem;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.s-offer-modal-product-image{height:100%;width:100%;object-fit:cover}.s-offer-modal-not-available{--tw-grayscale:grayscale(100%);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-offer-modal-product-info{margin-bottom:1rem}.s-offer-modal-product-name{margin-bottom:0.375rem;display:inline-block;width:11rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1));transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-offer-modal-product-name:hover{color:var(--color-primary)}.s-offer-modal-product-price{margin-bottom:1.25rem;display:flex;width:100%;align-items:center;font-size:0.875rem;line-height:1.25rem;font-weight:700}@media (min-width: 768px){.s-offer-modal-product-price{margin-bottom:0px}}@media (min-width: 640px){.s-offer-modal-product-price:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-offer-modal-product-price:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}}.s-offer-modal-product-sale-price{--tw-text-opacity:1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.s-offer-modal-product-old-price{margin-left:0.25rem;margin-right:0.25rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-offer-modal-btn-wrap{margin-top:auto}.s-offer-modal-header-icon{display:inline-flex;height:4rem;width:4rem;flex-shrink:0;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-offer-modal-header-icon{margin-left:auto;margin-right:auto;margin-bottom:1rem;height:5rem;width:5rem}}.s-offer-modal-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0.5rem}@media (min-width: 640px){.s-offer-modal-header-icon:where([dir="ltr"],[dir="ltr"] *){margin-right:0px}}.s-offer-modal-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0.5rem}@media (min-width: 640px){.s-offer-modal-header-icon:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}}.s-offer-modal-header-icon svg{height:1.75rem;width:1.75rem;flex-shrink:0;fill:#9ca3af}.s-offer-modal-footer{margin-top:1rem;display:flex;flex-direction:column;justify-content:space-between;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-offer-modal-footer{margin-top:2rem;flex-direction:row}}.s-offer-modal-expiry{margin-bottom:1.25rem}@media (min-width: 768px){.s-offer-modal-expiry{margin-bottom:0px}}.s-offer-modal-remember-label{display:flex;cursor:pointer;font-size:0.875rem;line-height:1.25rem;font-weight:500;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-offer-modal-remember-label:hover{--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}@media (min-width: 640px){.s-offer-modal-remember-label:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-offer-modal-remember-label:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}}.s-offer-modal-remember-input{height:1.5rem;width:1.5rem;border-radius:0.375rem;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));color:var(--color-primary)}.s-offer-modal-remember-input:focus{--tw-ring-color:transparent}.s-offer-modal-slider-centered .swiper-wrapper{justify-content:center}.s-offer-modal-slider-centered .s-offer-modal-slider-item{display:flex;max-width:28%;flex-shrink:0;flex-grow:1;flex-direction:column}.s-offer-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-offer-modal-skeleton-items{margin-top:1.5rem;margin-bottom:1.5rem;display:flex;width:100%;align-items:center}.s-offer-modal-skeleton-item{position:relative;margin-right:1.25rem;width:33.333333%;cursor:unset !important;text-align:center}.s-offer-modal-skeleton-item:last-child{margin-right:0px}.s-offer-modal-skeleton-item:where([dir="rtl"],[dir="rtl"] *){margin-right:0px;margin-left:1.25rem}.s-offer-modal-skeleton-item:last-child:where([dir="rtl"],[dir="rtl"] *){margin-left:0px}.s-offer-modal-skeleton-header{width:100%}.s-offer-modal-skeleton-header salla-skeleton{margin-left:auto;margin-right:auto}.s-offer-modal-skeleton-header salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-offer-modal-skeleton-header salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-offer-modal-skeleton-header salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-offer-modal-skeleton-item-subtitle{display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-modal-skeleton-item-subtitle div svg{height:1rem;width:1rem;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-offer-modal-skeleton-item-title{margin-top:0.75rem;margin-bottom:0.75rem}.s-offer-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;align-items:center;justify-content:space-between}.s-offer-modal-discount-table{width:100%;border-width:1px;--tw-border-opacity:1;border-color:rgb(238 238 238 / var(--tw-border-opacity, 1))}.s-offer-modal-discount-table table{width:100%;text-align:left;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(119 119 119 / var(--tw-text-opacity, 1))}.s-offer-modal-discount-table tr{border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(238 238 238 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(252 252 252 / var(--tw-bg-opacity, 1))}.s-offer-modal-discount-table tr:last-child{border-bottom-width:0px}.s-offer-modal-discount-table tr td{padding-top:1rem;padding-bottom:1rem;padding-left:1.5rem;padding-right:1.5rem}.s-offer-modal-discount-table tr td:where([dir="rtl"],[dir="rtl"] *){text-align:right}.s-offer-modal-discount-table-cell{text-align:right}.s-offer-modal-discount-table-cell:where([dir="rtl"],[dir="rtl"] *){text-align:left !important}.s-offer-modal-type-discounts-table .s-modal-body{position:relative !important}';export{l as salla_offer_modal}