@salla.sa/twilight-components 3.0.17 → 3.0.18

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 (388) hide show
  1. package/dist/cjs/{Helper-DSYelC4c.js → Helper-D2VNt6eb.js} +1 -1
  2. package/dist/cjs/{filepond-l9D0Yv7b.js → filepond-DkCudLhG.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-8SrbLptI.js → filepond-plugin-file-poster-C-uxFWfW.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-DGD6oJy0.js → filepond-plugin-file-validate-size-BikXTQW2.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type-BIvrhp3w.js → filepond-plugin-file-validate-type-Drs7PouU.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-4xKikdXG.js → filepond-plugin-image-edit-hxr0h9kt.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-C3BvwxQh.js → filepond-plugin-image-exif-orientation-CVZmWU_4.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-CBq_GY0V.js → filepond-plugin-image-preview-CBjPKx-d.js} +1 -1
  9. package/dist/cjs/free-shipping-timer-6QBe5BNS.js +156 -0
  10. package/dist/cjs/{index-BAwxpXnB.js → index-CTYg2zC6.js} +2 -2
  11. package/dist/cjs/{intlTelInput-xw-HaAEN.js → intlTelInput-C9X0hKXV.js} +1 -1
  12. package/dist/cjs/loader.cjs.js +2 -2
  13. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  15. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  16. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
  20. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  22. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +166 -16
  25. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  31. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  40. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +95 -9
  41. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +18 -5
  42. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-gifting.cjs.entry.js +13 -6
  45. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  66. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  84. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-products-list.cjs.entry.js +6 -5
  91. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  92. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +7 -4
  94. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  95. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  100. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  110. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  113. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  114. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  115. package/dist/cjs/twilight.cjs.js +2 -2
  116. package/dist/cjs/{vanilla-picker-Cm_uNdps.js → vanilla-picker-BsLm8rHT.js} +1 -1
  117. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +72 -16
  118. package/dist/collection/components/salla-bullet-delivery/selector-tracker.js +106 -0
  119. package/dist/collection/components/salla-free-shipping-banner/salla-free-shipping-banner.css +18 -4
  120. package/dist/collection/components/salla-free-shipping-banner/salla-free-shipping-banner.js +94 -11
  121. package/dist/collection/components/salla-free-shipping-tag/salla-free-shipping-tag.css +6 -0
  122. package/dist/collection/components/salla-free-shipping-tag/salla-free-shipping-tag.js +18 -2
  123. package/dist/collection/components/salla-gifting/salla-gifting.css +16 -1
  124. package/dist/collection/components/salla-gifting/salla-gifting.js +11 -4
  125. package/dist/collection/components/salla-products-list/salla-products-list.js +4 -3
  126. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +5 -2
  127. package/dist/collection/shared/free-shipping-timer.js +130 -0
  128. package/dist/components/free-shipping-timer.js +150 -0
  129. package/dist/components/index.js +2 -2
  130. package/dist/components/salla-bullet-delivery.js +165 -15
  131. package/dist/components/salla-free-shipping-banner.js +95 -8
  132. package/dist/components/salla-free-shipping-tag.js +17 -3
  133. package/dist/components/salla-gifting.js +12 -5
  134. package/dist/components/salla-products-list2.js +4 -3
  135. package/dist/components/salla-rating-modal-v22.js +5 -2
  136. package/dist/docs.json +25 -5
  137. package/dist/esm/{Helper-POCi7J93.js → Helper-C1T-oD4J.js} +1 -1
  138. package/dist/esm/{filepond-Ct76xW02.js → filepond-BoWJzHeN.js} +1 -1
  139. package/dist/esm/{filepond-plugin-file-poster-C1OkzGRs.js → filepond-plugin-file-poster-B6MkMtuC.js} +1 -1
  140. package/dist/esm/{filepond-plugin-file-validate-size-gdd-69cO.js → filepond-plugin-file-validate-size-Dds_462B.js} +1 -1
  141. package/dist/esm/{filepond-plugin-file-validate-type-BaZ2QTzl.js → filepond-plugin-file-validate-type-DrfGXNay.js} +1 -1
  142. package/dist/esm/{filepond-plugin-image-edit-CsoNvf0i.js → filepond-plugin-image-edit-CN7eGg-7.js} +1 -1
  143. package/dist/esm/{filepond-plugin-image-exif-orientation-BHDSe3nH.js → filepond-plugin-image-exif-orientation-CyhxK_6R.js} +1 -1
  144. package/dist/esm/{filepond-plugin-image-preview-CD_S17z3.js → filepond-plugin-image-preview-DdKqAzT9.js} +1 -1
  145. package/dist/esm/free-shipping-timer-CnTwkF6y.js +150 -0
  146. package/dist/esm/{index-DmGAR42j.js → index-DgUQRYr2.js} +2 -2
  147. package/dist/esm/{intlTelInput-D76Q4XFx.js → intlTelInput-SwlavcFB.js} +1 -1
  148. package/dist/esm/loader.js +3 -3
  149. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  150. package/dist/esm/salla-accordion_6.entry.js +2 -2
  151. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  152. package/dist/esm/salla-advertisement.entry.js +1 -1
  153. package/dist/esm/salla-alert_2.entry.js +1 -1
  154. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  155. package/dist/esm/salla-applied-filters.entry.js +2 -2
  156. package/dist/esm/salla-apps-icons.entry.js +1 -1
  157. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  158. package/dist/esm/salla-badge.entry.js +1 -1
  159. package/dist/esm/salla-basket-gap.entry.js +1 -1
  160. package/dist/esm/salla-bullet-delivery_3.entry.js +166 -16
  161. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  162. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  163. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  164. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  165. package/dist/esm/salla-comment-factors.entry.js +1 -1
  166. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  167. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  168. package/dist/esm/salla-contacts.entry.js +1 -1
  169. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  170. package/dist/esm/salla-count-down.entry.js +1 -1
  171. package/dist/esm/salla-custom-fields.entry.js +1 -1
  172. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  173. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  174. package/dist/esm/salla-filters-widget.entry.js +2 -2
  175. package/dist/esm/salla-filters.entry.js +2 -2
  176. package/dist/esm/salla-free-shipping-banner.entry.js +94 -8
  177. package/dist/esm/salla-free-shipping-tag.entry.js +17 -4
  178. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  179. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  180. package/dist/esm/salla-gifting.entry.js +13 -6
  181. package/dist/esm/salla-hook.entry.js +1 -1
  182. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  183. package/dist/esm/salla-installment.entry.js +1 -1
  184. package/dist/esm/salla-list-tile.entry.js +1 -1
  185. package/dist/esm/salla-localization-modal.entry.js +1 -1
  186. package/dist/esm/salla-login-modal.entry.js +1 -1
  187. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  188. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  189. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  190. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  191. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  192. package/dist/esm/salla-loyalty.entry.js +1 -1
  193. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  194. package/dist/esm/salla-map_3.entry.js +1 -1
  195. package/dist/esm/salla-menu.entry.js +1 -1
  196. package/dist/esm/salla-metadata.entry.js +1 -1
  197. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  198. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  199. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  200. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  201. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  202. package/dist/esm/salla-offer-modal.entry.js +1 -1
  203. package/dist/esm/salla-offer.entry.js +1 -1
  204. package/dist/esm/salla-order-branch.entry.js +1 -1
  205. package/dist/esm/salla-order-cancel.entry.js +1 -1
  206. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  207. package/dist/esm/salla-order-details-options.entry.js +1 -1
  208. package/dist/esm/salla-order-details.entry.js +1 -1
  209. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  210. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  211. package/dist/esm/salla-order-edit.entry.js +1 -1
  212. package/dist/esm/salla-order-items.entry.js +1 -1
  213. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  214. package/dist/esm/salla-order-payment.entry.js +1 -1
  215. package/dist/esm/salla-order-rewards.entry.js +1 -1
  216. package/dist/esm/salla-order-shipments.entry.js +1 -1
  217. package/dist/esm/salla-order-summary.entry.js +1 -1
  218. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  219. package/dist/esm/salla-orders.entry.js +2 -2
  220. package/dist/esm/salla-payments.entry.js +1 -1
  221. package/dist/esm/salla-placeholder.entry.js +1 -1
  222. package/dist/esm/salla-price-range.entry.js +1 -1
  223. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  224. package/dist/esm/salla-product-card.entry.js +1 -1
  225. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  226. package/dist/esm/salla-products-list.entry.js +6 -5
  227. package/dist/esm/salla-products-slider.entry.js +2 -2
  228. package/dist/esm/salla-quick-order.entry.js +1 -1
  229. package/dist/esm/salla-rating-modal-v2.entry.js +7 -4
  230. package/dist/esm/salla-rating-modal.entry.js +2 -2
  231. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  232. package/dist/esm/salla-review-order-item.entry.js +1 -1
  233. package/dist/esm/salla-scopes.entry.js +1 -1
  234. package/dist/esm/salla-search-product-card.entry.js +1 -1
  235. package/dist/esm/salla-search.entry.js +2 -2
  236. package/dist/esm/salla-skeleton.entry.js +1 -1
  237. package/dist/esm/salla-social-share.entry.js +1 -1
  238. package/dist/esm/salla-social.entry.js +1 -1
  239. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  240. package/dist/esm/salla-thank-you-header.entry.js +1 -1
  241. package/dist/esm/salla-thank-you-page.entry.js +1 -1
  242. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  243. package/dist/esm/salla-trust-badges.entry.js +1 -1
  244. package/dist/esm/salla-user-menu.entry.js +1 -1
  245. package/dist/esm/salla-user-profile.entry.js +1 -1
  246. package/dist/esm/salla-user-settings.entry.js +1 -1
  247. package/dist/esm/salla-verify.entry.js +1 -1
  248. package/dist/esm/salla-wallet.entry.js +1 -1
  249. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  250. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  251. package/dist/esm/twilight.js +3 -3
  252. package/dist/esm/{vanilla-picker-BlIXJyvJ.js → vanilla-picker-Buy50D7t.js} +1 -1
  253. package/dist/twilight/{p-4702959a.entry.js → p-027cbda6.entry.js} +1 -1
  254. package/dist/twilight/{p-e89a1905.entry.js → p-0418c2df.entry.js} +1 -1
  255. package/dist/twilight/{p-6757344a.entry.js → p-071aa0e7.entry.js} +1 -1
  256. package/dist/twilight/{p-a53e2c74.entry.js → p-08a15c81.entry.js} +1 -1
  257. package/dist/twilight/{p-acd48ae7.entry.js → p-0ba159db.entry.js} +1 -1
  258. package/dist/twilight/{p-a17784e6.entry.js → p-0d795b58.entry.js} +1 -1
  259. package/dist/twilight/{p-e81c4521.entry.js → p-0f25fedd.entry.js} +1 -1
  260. package/dist/twilight/{p-26fec98c.entry.js → p-12a25415.entry.js} +1 -1
  261. package/dist/twilight/p-1960020c.entry.js +4 -0
  262. package/dist/twilight/{p-b38c38fe.entry.js → p-1af9db24.entry.js} +1 -1
  263. package/dist/twilight/{p-24423a8d.entry.js → p-23772523.entry.js} +1 -1
  264. package/dist/twilight/{p-1982520c.entry.js → p-254cff9a.entry.js} +1 -1
  265. package/dist/twilight/{p-0225f396.entry.js → p-259c995a.entry.js} +1 -1
  266. package/dist/twilight/{p-7df4ee74.entry.js → p-26d2b28a.entry.js} +1 -1
  267. package/dist/twilight/{p-7a985c8c.entry.js → p-34148827.entry.js} +1 -1
  268. package/dist/twilight/{p-a5d2ad5e.entry.js → p-361f6033.entry.js} +1 -1
  269. package/dist/twilight/{p-ae9c0abe.entry.js → p-37192614.entry.js} +1 -1
  270. package/dist/twilight/{p-66f6d722.entry.js → p-3a632c69.entry.js} +1 -1
  271. package/dist/twilight/{p-14752d03.entry.js → p-3d8b77f7.entry.js} +1 -1
  272. package/dist/twilight/{p-4839d408.entry.js → p-3f842f32.entry.js} +1 -1
  273. package/dist/twilight/{p-c3c99d9e.entry.js → p-419d6d71.entry.js} +1 -1
  274. package/dist/twilight/{p-fae2a8d0.entry.js → p-481f52b1.entry.js} +1 -1
  275. package/dist/twilight/{p-b819de23.entry.js → p-487b4411.entry.js} +1 -1
  276. package/dist/twilight/{p-d495cce0.entry.js → p-4891c565.entry.js} +1 -1
  277. package/dist/twilight/{p-83ccad19.entry.js → p-4a3fa153.entry.js} +1 -1
  278. package/dist/twilight/{p-4057b692.entry.js → p-4ab5ee99.entry.js} +1 -1
  279. package/dist/twilight/{p-e5545546.entry.js → p-4b70e6c4.entry.js} +1 -1
  280. package/dist/twilight/{p-5d4fadd2.entry.js → p-516e4edc.entry.js} +1 -1
  281. package/dist/twilight/{p-90d4129f.entry.js → p-53735934.entry.js} +1 -1
  282. package/dist/twilight/{p-d68625f7.entry.js → p-5694edf1.entry.js} +1 -1
  283. package/dist/twilight/{p-7750bace.entry.js → p-5bbf17dd.entry.js} +1 -1
  284. package/dist/twilight/{p-783c6346.entry.js → p-5e8d019e.entry.js} +1 -1
  285. package/dist/twilight/{p-fce39869.entry.js → p-5f6fee0e.entry.js} +1 -1
  286. package/dist/twilight/{p-f10b887a.entry.js → p-66ad7a30.entry.js} +1 -1
  287. package/dist/twilight/{p-5d775867.entry.js → p-6af8a7b6.entry.js} +1 -1
  288. package/dist/twilight/{p-b66df976.entry.js → p-6b5de500.entry.js} +1 -1
  289. package/dist/twilight/{p-120b4694.entry.js → p-6ba3808a.entry.js} +1 -1
  290. package/dist/twilight/{p-3d5e862c.entry.js → p-6c3084c9.entry.js} +1 -1
  291. package/dist/twilight/{p-dc3ff1f0.entry.js → p-6dccd40f.entry.js} +1 -1
  292. package/dist/twilight/{p-bfb70998.entry.js → p-6e52b649.entry.js} +1 -1
  293. package/dist/twilight/{p-62ba0971.entry.js → p-70dfb2b4.entry.js} +1 -1
  294. package/dist/twilight/{p-f8ff074f.entry.js → p-76584a5b.entry.js} +1 -1
  295. package/dist/twilight/{p-2e8f95d0.entry.js → p-78a56dc6.entry.js} +1 -1
  296. package/dist/twilight/{p-eb160c2e.entry.js → p-79822d99.entry.js} +1 -1
  297. package/dist/twilight/{p-8b43035f.entry.js → p-7b5f97e7.entry.js} +1 -1
  298. package/dist/twilight/{p-2a3e2404.entry.js → p-7f97335a.entry.js} +1 -1
  299. package/dist/twilight/{p-184ea04c.entry.js → p-7fd9dc36.entry.js} +1 -1
  300. package/dist/twilight/p-84b0e7a9.entry.js +4 -0
  301. package/dist/twilight/p-8766e236.entry.js +4 -0
  302. package/dist/twilight/{p-622bfb21.entry.js → p-8c1d14f0.entry.js} +1 -1
  303. package/dist/twilight/{p-20939237.entry.js → p-8c40278d.entry.js} +1 -1
  304. package/dist/twilight/{p-f9b9af72.entry.js → p-92fd20a0.entry.js} +1 -1
  305. package/dist/twilight/{p-33ff7967.entry.js → p-9cf1cfd4.entry.js} +1 -1
  306. package/dist/twilight/{p-7e854633.entry.js → p-9d15f22d.entry.js} +1 -1
  307. package/dist/twilight/{p-9eb92980.entry.js → p-9e042cce.entry.js} +1 -1
  308. package/dist/twilight/{p-cc2c52bb.entry.js → p-9e0a9a5a.entry.js} +1 -1
  309. package/dist/twilight/{p-f034968b.entry.js → p-9e65451e.entry.js} +1 -1
  310. package/dist/twilight/{p-iCJI7qYe.js → p-BK9YeXWp.js} +1 -1
  311. package/dist/twilight/{p-Dhq3oJAe.js → p-BxQMWsr9.js} +1 -1
  312. package/dist/twilight/{p-CAc7tX2K.js → p-CBLWEyM9.js} +1 -1
  313. package/dist/twilight/{p-BbZqYBfp.js → p-CCwsxMbZ.js} +1 -1
  314. package/dist/twilight/{p-Nyk6-1lq.js → p-Ca_SZn0u.js} +1 -1
  315. package/dist/twilight/{p-BwzmoZpm.js → p-CgNJWeaK.js} +1 -1
  316. package/dist/twilight/p-CnTwkF6y.js +4 -0
  317. package/dist/twilight/{p-B7rn1taO.js → p-DMvhNbgN.js} +1 -1
  318. package/dist/twilight/{p-DVWVl151.js → p-De1tLqQF.js} +1 -1
  319. package/dist/twilight/{p-DmGAR42j.js → p-DgUQRYr2.js} +1 -1
  320. package/dist/twilight/{p-De2wEjqS.js → p-NqQdbGu6.js} +1 -1
  321. package/dist/twilight/{p-Dza6OBFg.js → p-Y2ZIN9Ok.js} +1 -1
  322. package/dist/twilight/{p-6c7cae8a.entry.js → p-a44670a9.entry.js} +1 -1
  323. package/dist/twilight/{p-509ad773.entry.js → p-a5b732b3.entry.js} +1 -1
  324. package/dist/twilight/{p-2153c6fd.entry.js → p-a95b0dc1.entry.js} +1 -1
  325. package/dist/twilight/{p-37b68ef3.entry.js → p-aa35cf98.entry.js} +1 -1
  326. package/dist/twilight/{p-d6c5bf2a.entry.js → p-ac736b30.entry.js} +1 -1
  327. package/dist/twilight/{p-d2c1457e.entry.js → p-af49191f.entry.js} +1 -1
  328. package/dist/twilight/{p-8b39a9f7.entry.js → p-b0d2e31f.entry.js} +1 -1
  329. package/dist/twilight/{p-31260fae.entry.js → p-b1f808f5.entry.js} +1 -1
  330. package/dist/twilight/{p-60f4357f.entry.js → p-b3ada3d0.entry.js} +1 -1
  331. package/dist/twilight/{p-4a1aa85f.entry.js → p-b5a45f87.entry.js} +1 -1
  332. package/dist/twilight/p-b9d67694.entry.js +4 -0
  333. package/dist/twilight/{p-64d49f5d.entry.js → p-ba6dd59c.entry.js} +1 -1
  334. package/dist/twilight/p-bac25e34.entry.js +4 -0
  335. package/dist/twilight/{p-fed66bcb.entry.js → p-bb8b2c85.entry.js} +1 -1
  336. package/dist/twilight/{p-49195cb6.entry.js → p-be6f8551.entry.js} +1 -1
  337. package/dist/twilight/{p-84d725d4.entry.js → p-bed54154.entry.js} +1 -1
  338. package/dist/twilight/{p-2a8d6e7e.entry.js → p-bed68e52.entry.js} +1 -1
  339. package/dist/twilight/{p-d63ce284.entry.js → p-bfd5e263.entry.js} +1 -1
  340. package/dist/twilight/{p-cd866be6.entry.js → p-c4cf0b4d.entry.js} +1 -1
  341. package/dist/twilight/{p-fe413496.entry.js → p-cb48a5ef.entry.js} +1 -1
  342. package/dist/twilight/{p-74f206cf.entry.js → p-cdeb9bcc.entry.js} +1 -1
  343. package/dist/twilight/{p-8e8e40bc.entry.js → p-d0aeeb7f.entry.js} +1 -1
  344. package/dist/twilight/{p-8f0af317.entry.js → p-d0ff9a3e.entry.js} +1 -1
  345. package/dist/twilight/{p-e8090773.entry.js → p-d1093a59.entry.js} +1 -1
  346. package/dist/twilight/{p-86ca22d5.entry.js → p-d1121b3f.entry.js} +1 -1
  347. package/dist/twilight/{p-3a3d4cb7.entry.js → p-d1204965.entry.js} +1 -1
  348. package/dist/twilight/p-d346dabd.entry.js +4 -0
  349. package/dist/twilight/{p-0a794d6f.entry.js → p-d4fb9921.entry.js} +1 -1
  350. package/dist/twilight/{p-4c801f91.entry.js → p-d8955835.entry.js} +1 -1
  351. package/dist/twilight/{p-f4411a04.entry.js → p-d9a1bf08.entry.js} +1 -1
  352. package/dist/twilight/{p-0c6a024f.entry.js → p-da0df10b.entry.js} +1 -1
  353. package/dist/twilight/p-e24fbbb4.entry.js +4 -0
  354. package/dist/twilight/{p-07450aed.entry.js → p-e38a6793.entry.js} +1 -1
  355. package/dist/twilight/{p-0e1248c4.entry.js → p-e457e68f.entry.js} +1 -1
  356. package/dist/twilight/{p-cd7029fc.entry.js → p-e9b03e9c.entry.js} +1 -1
  357. package/dist/twilight/{p-b9695308.entry.js → p-eaf0c514.entry.js} +1 -1
  358. package/dist/twilight/{p-b87ea253.entry.js → p-ee479819.entry.js} +1 -1
  359. package/dist/twilight/p-ee65c489.entry.js +4 -0
  360. package/dist/twilight/{p-7d337f25.entry.js → p-eefced26.entry.js} +1 -1
  361. package/dist/twilight/{p-a0a57259.entry.js → p-f7a58656.entry.js} +1 -1
  362. package/dist/twilight/{p-bf29daf3.entry.js → p-f7ab5825.entry.js} +1 -1
  363. package/dist/twilight/{p-57b93850.entry.js → p-f9587127.entry.js} +1 -1
  364. package/dist/twilight/{p-89cff0c8.entry.js → p-f9e5ed10.entry.js} +1 -1
  365. package/dist/twilight/{p-e4d90663.entry.js → p-fcb1009f.entry.js} +1 -1
  366. package/dist/twilight/{p-4f794057.entry.js → p-fddf1997.entry.js} +1 -1
  367. package/dist/twilight/twilight.esm.js +1 -1
  368. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +9 -1
  369. package/dist/types/components/salla-bullet-delivery/selector-tracker.d.ts +30 -0
  370. package/dist/types/components/salla-free-shipping-banner/salla-free-shipping-banner.d.ts +19 -5
  371. package/dist/types/components/salla-free-shipping-tag/salla-free-shipping-tag.d.ts +6 -1
  372. package/dist/types/components/salla-gifting/salla-gifting.d.ts +1 -0
  373. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +1 -0
  374. package/dist/types/components.d.ts +11 -25
  375. package/dist/types/shared/free-shipping-timer.d.ts +36 -0
  376. package/package.json +5 -5
  377. package/dist/cjs/free-shipping-DkIKD6ch.js +0 -31
  378. package/dist/components/free-shipping.js +0 -29
  379. package/dist/esm/free-shipping-Brg4wsgg.js +0 -29
  380. package/dist/twilight/p-12a8aed8.entry.js +0 -4
  381. package/dist/twilight/p-40083f25.entry.js +0 -4
  382. package/dist/twilight/p-4f443e36.entry.js +0 -4
  383. package/dist/twilight/p-5b81a3d9.entry.js +0 -4
  384. package/dist/twilight/p-93f26336.entry.js +0 -4
  385. package/dist/twilight/p-Brg4wsgg.js +0 -4
  386. package/dist/twilight/p-bab5d057.entry.js +0 -4
  387. package/dist/twilight/p-c7c868b4.entry.js +0 -4
  388. package/dist/twilight/p-d5a2ba68.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as a,a as i}from"./p-DmGAR42j.js";import{i as e}from"./p-DgheRYLY.js";const r=class{constructor(t){s(this,t),this.hideTitle=!1,this.vertical=!1,this.sdkApps=null}componentWillLoad(){this.appSlot=this.host.querySelector('[slot="app"]')?.innerHTML}getTemplate(){return this.slotTemplate||this.appSlot||this.getDefaultSlot()}getDefaultSlot(){return'<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />'}connectedCallback(){e()&&(this.langUnsubscribe=salla.lang.subscribe((()=>{this.appsTitle&&this.appsTitle!==this.langTitle||(this.appsTitle=this.langTitle=salla.lang.get("blocks.footer.download_apps"))}))),e()&&salla.onReady((()=>{this.sdkApps=salla.config.get("store.apps")}))}disconnectedCallback(){this.langUnsubscribe?.()}getAppsArray(){const s=this.apps||this.sdkApps;return s?Object.entries(s).filter((([,s])=>s&&"string"==typeof s)).map((([s,t])=>({name:s,value:t}))):[]}getCdnUrl(s){return e()?salla.url.cdn(`images/${s}.png`):`https://cdn.salla.net/images/${s}.png`}componentDidRender(){this.host.querySelector('[slot="app"]')?.remove()}render(){const s=this.getAppsArray();if(0!==s.length)return t(a,{class:"s-apps-icons"},!this.hideTitle&&this.appsTitle&&t("h3",null,this.appsTitle),t("div",{class:{"s-apps-icons-list":!0,vertical:this.vertical}},s.map((s=>t("a",{key:s.name,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",innerHTML:this.getTemplate().replace(/\{icon\}/g,this.getCdnUrl(s.name)).replace(/\{name\}/g,s.name)})))))}get host(){return i(this)}};r.style="/*!twlt*/:host{display:block}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-apps-icons-list{display:flex;gap:1rem}.s-apps-icons-list.vertical{flex-direction:column}.s-apps-icons-item{line-height:1}.s-apps-icons-item:hover{color:var(--color-primary)}";export{r as salla_apps_icons}
4
+ import{r as s,h as t,H as a,a as i}from"./p-DgUQRYr2.js";import{i as e}from"./p-DgheRYLY.js";const r=class{constructor(t){s(this,t),this.hideTitle=!1,this.vertical=!1,this.sdkApps=null}componentWillLoad(){this.appSlot=this.host.querySelector('[slot="app"]')?.innerHTML}getTemplate(){return this.slotTemplate||this.appSlot||this.getDefaultSlot()}getDefaultSlot(){return'<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />'}connectedCallback(){e()&&(this.langUnsubscribe=salla.lang.subscribe((()=>{this.appsTitle&&this.appsTitle!==this.langTitle||(this.appsTitle=this.langTitle=salla.lang.get("blocks.footer.download_apps"))}))),e()&&salla.onReady((()=>{this.sdkApps=salla.config.get("store.apps")}))}disconnectedCallback(){this.langUnsubscribe?.()}getAppsArray(){const s=this.apps||this.sdkApps;return s?Object.entries(s).filter((([,s])=>s&&"string"==typeof s)).map((([s,t])=>({name:s,value:t}))):[]}getCdnUrl(s){return e()?salla.url.cdn(`images/${s}.png`):`https://cdn.salla.net/images/${s}.png`}componentDidRender(){this.host.querySelector('[slot="app"]')?.remove()}render(){const s=this.getAppsArray();if(0!==s.length)return t(a,{class:"s-apps-icons"},!this.hideTitle&&this.appsTitle&&t("h3",null,this.appsTitle),t("div",{class:{"s-apps-icons-list":!0,vertical:this.vertical}},s.map((s=>t("a",{key:s.name,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",innerHTML:this.getTemplate().replace(/\{icon\}/g,this.getCdnUrl(s.name)).replace(/\{name\}/g,s.name)})))))}get host(){return i(this)}};r.style="/*!twlt*/:host{display:block}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-apps-icons-list{display:flex;gap:1rem}.s-apps-icons-list.vertical{flex-direction:column}.s-apps-icons-item{line-height:1}.s-apps-icons-item:hover{color:var(--color-primary)}";export{r as salla_apps_icons}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as i,H as e,a as n}from"./p-DmGAR42j.js";import{A as o}from"./p-BuGRUUN_.js";import{A as l}from"./p-CcEEx00d.js";const d=class{constructor(i){t(this,i),this.optionsSaved=s(this,"optionsSaved"),this.productSelected=s(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[],this.isProductAlreadySelected=!1}generateCacheKey(t,s,i){return`${t||"unknown"}-${s||0}-${i||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.isProductAlreadySelected=!!t.isProductAlreadySelected,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const s=t.detail||t,{option:i,detail:e}=s,n=i||s.option_id&&this.product?.options?.find((t=>t.id===s.option_id||String(t.id)===String(s.option_id))),o=e||(s.id?s:null);this.product?.id&&n&&this.handleOptionChange(Number(this.product.id),n,o)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const s=t.target;if(s&&"checkbox"===s.type&&s.name&&s.name.includes("bundle[")&&s.name.includes("][id]")){const t=s.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!s.checked){if("true"===s.getAttribute("data-selection-locked"))return void(s.checked=!0);const[,i,e]=t,n=s.value,o=this.host.closest("form");this.cleanupProductDeselection({sectionId:i,productIndex:parseInt(e,10),productId:n,form:o,uncheckedInput:s})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:s,productIndex:i,productId:e,form:n,uncheckedInput:o}=t;if(this.clearProductOptions(e,s,i),n){const t=`bundle[${s}][${i}]`;Array.from(n.querySelectorAll(`input[name^="${t}"]`)).forEach((s=>{if(s===o)return;const i="hidden"===s.type,n=s.getAttribute("data-product-id")===String(e)&&s.name?.startsWith(t);(i||n)&&s.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});n.dispatchEvent(t)}))}}generateFormInputName(t,s,i){return`bundle[${t}][${s}][options][${i}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,s=this.generateCacheKey(this.sectionId,this.productIndex,t),i=document.querySelector(`salla-product-options[product-id="${t}"]`);if(i)try{const t=await i.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[s]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,s,i){const e={...this.selectedOptions};if(null==s||null==i||Number.isNaN(i)){const s=`-${String(t)}`,i=[];Object.keys(e).forEach((t=>{t.endsWith(s)&&(delete e[t],i.push(t))})),i.forEach((t=>this.bumpOptionsResetToken(t)))}else{const n=this.generateCacheKey(s,i,t);delete e[n],this.bumpOptionsResetToken(n)}this.selectedOptions=e,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,s,i){const e=this.generateCacheKey(this.sectionId,this.productIndex,t),n=document.querySelector(`salla-product-options[product-id="${t}"]`);let o=[];if(n)try{o=await n.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(o.length>0)this.selectedOptions={...this.selectedOptions,[e]:o};else if(this.selectedOptions[e]&&this.selectedOptions[e].length>0){const t=[...this.selectedOptions[e]||[]],n=t.findIndex((t=>t.option_id===s.id));n>-1?i&&null!=i.id?t[n]={...i,option_id:s.id}:t.splice(n,1):i&&null!=i.id&&t.push({...i,option_id:s.id}),this.selectedOptions={...this.selectedOptions,[e]:t}}else i&&null!=i.id&&(this.selectedOptions={...this.selectedOptions,[e]:[{...i,option_id:s.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],s=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,s),e=document.querySelector(`salla-product-options[product-id="${s}"]`);let n=[];if(e)try{n=await e.getSelectedOptions()||[];const t=this.selectedOptions[i]||[];(t.length>n.length||0===n.length&&t.length>0)&&(n=t)}catch(t){n=this.selectedOptions[i]||[]}else n=this.selectedOptions[i]||[];return 0===n.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((s=>{s.required&&(n.some((t=>t.option_id==s.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:s.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const s=this.product?.id;if(!s)return;const i=this.generateCacheKey(this.sectionId,this.productIndex,s);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){if(!this.isProductAlreadySelected&&null!=this.sectionId){const t=this.host.closest("salla-multiple-bundle-product-details");if(!await(t?.canSelectBundleProduct(this.sectionId,s)))return void salla.notify.error(salla.lang.getWithDefault("pages.products.bundle_selection_limit_reached","لا يمكنك اختيار المزيد من المنتجات في هذا القسم"))}this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${s}"]`);let e=await(t?.getSelectedOptions());if((!e||0===e.length)&&this.selectedOptions[i]?.length>0&&(e=this.selectedOptions[i]),!e||0===e.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[i]:e};const n=this.host.closest("form");if(!n)return void(this.isLoading=!1);const o=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(n.querySelectorAll(`input[name^="${o}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(n.querySelectorAll(`[data-product-id="${s}"][name^="${o}"]`)).forEach((t=>t.remove()));const l=`bundle[${this.sectionId}][${this.productIndex}][id]`,d=document.getElementById(l);if(d)d.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(s),t.dataset.productId=String(s),n.appendChild(t)}e.forEach((t=>{const i=t.option_id,e=document.createElement("input");e.type="hidden",e.name=this.generateFormInputName(this.sectionId,this.productIndex??0,i),e.value=String(t.id),e.dataset.productId=String(s),n.appendChild(e)}));const a=new window.Event("change",{bubbles:!0});n.dispatchEvent(a),this.optionsSaved.emit({productId:Number(s),selectedOptions:e,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(s),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),s=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const i=s.some((s=>s.id===t.id));return{...t,is_selected:i}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),n=this.generateCacheKey(this.sectionId,this.productIndex,t),o=this.optionsResetTokens[n]||0,l=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return i(e,{key:"8c2d6cbc15d173ceeb3a5b498e8684e0c61a5adf"},i("salla-modal",{key:"7cb8274a9304257c19a5fb8bbbfb44c98b818c83",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"9f16fe0b3fb26e4fee7f1273f875399ed0f401a7",slot:"loading"},i("salla-skeleton",{key:"0fdf6a86da8432f8f5c883466ea2fab00ae4e2d3",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"940ca77513e6aee8062b7cc8b2d04334973f6b02",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"cd14ebae116356906bb1f9dda3545e5555295b33",slot:"items"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${s+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"e40da3829870abc60dba4827c8d331152e45272c",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,"data-caption":`${this.product?.name} - Image ${s+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${s+1}`,alt:t.alt||`${this.product?.name} - ${s+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${n}-reset-${o}`,"product-id":t,"unique-key":`${n}-reset-${o}`}),i("div",{key:"6caf87769ef6ffda12dee54df32e87728e62c484",slot:"footer"},i("div",{key:"bf2ed94efbe7e2ca4dd76441783d5a8423a4454d",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"9468df838e0b677714abb4951c958f37bac2a1c2",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:l},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return n(this)}static get watchers(){return{product:["handleProductChange"]}}};d.style=":host{display:block}";const a=class{constructor(i){t(this,i),this.productSelected=s(this,"productSelected"),this.productOptionsSelected=s(this,"productOptionsSelected"),this.selectedProducts={},this.isSelectionLocked=!1,this.selectionLimit=0,this.savedOptionsByInstance={},this.handleProductClick=(t,s)=>{const i=this.selectedProducts[this.section.id]?.has(t.id)||!1,e=this.getCheckbox(this.section.id,s);if(i&&this.isSelectionLocked)return void(e&&(e.checked=!0));if(!i&&this.isMaxSelectionReached()&&1!==this.selectionLimit)return;if(1===this.selectionLimit&&!i)return void this.productSelected.emit({product:t,sectionId:this.section.id});if(!e)return;const n=!e.checked;n||(this.dispatchClearOptionsEvent(t,s),this.clearSavedOptionsState(this.section.id,s)),e.checked=n,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});e.dispatchEvent(t)})),this.productSelected.emit({product:t,sectionId:this.section.id})},this.handleOptionsClick=t=>{!this.selectedProducts[this.section.id]?.has(t.id)&&this.isMaxSelectionReached()&&1!==this.selectionLimit||this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getSelectedCount(){return this.selectedProducts[this.section?.id]?.size??0}isMaxSelectionReached(){return this.selectionLimit>1&&this.getSelectedCount()>=this.selectionLimit}isProductSelectionDisabled(t,s){return 0===t.quantity||!s&&this.isMaxSelectionReached()}getProductInstanceKey(t,s){return`${t}::${s}`}dispatchClearOptionsEvent(t,s){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:s})}handleOptionsSaved(t){const s=t.detail;if(!s)return;const{sectionId:i,productIndex:e,selectedOptions:n}=s;if(null==i||i!==this.section?.id)return;if(null==e||Number.isNaN(e))return;const o=this.getProductInstanceKey(i,e);if(n?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[o]:!0};else if(this.savedOptionsByInstance[o]){const t={...this.savedOptionsByInstance};delete t[o],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,s){const i=this.getProductInstanceKey(t,s);if(!this.savedOptionsByInstance[i])return;const e={...this.savedOptionsByInstance};delete e[i],this.savedOptionsByInstance=e}generateEventName(t,s){return`bundle[${t}][${s}][id]`}getCheckbox(t,s){const i=this.generateEventName(t,s);return this.host.querySelector(`input.s-multiple-bundle-product-checkbox[name="${i}"]`)}preventLockedDeselect(t,s){if(!this.isSelectionLocked||!s)return;t.preventDefault(),t.stopPropagation();const i=t.target;"checkbox"===i?.type&&(i.checked=!0)}render(){return i(e,{key:"fc6f9cc1bbc36bbcdfc9bc4346d818cd9ac67c92",class:"s-multiple-bundle-product-slider"},i("salla-slider",{key:"82648a1348104be40093a501ceab6ea0209ec761",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"a6d44237aaabb99aa4b4c8c3c5a986fe8d5afdc7",slot:"items"},this?.section?.products?.map(((t,s)=>{const e=this.selectedProducts[this.section.id]?.has(t.id)||!1,n=e&&this.isSelectionLocked,d=this.isProductSelectionDisabled(t,e),a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,s)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let c=salla.config.get("theme.is_rtl",!0)?o:l;return i("div",{class:"s-multiple-bundle-product-slide-one-third"+(d?" s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,s)},i("input",{id:this.generateEventName(this.section.id,s),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:e,"data-selection-locked":n?"true":void 0,name:this.generateEventName(this.section.id,s),value:t.id,onClick:t=>this.preventLockedDeselect(t,e),onChange:t=>this.preventLockedDeselect(t,e)}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},i("a",{href:t?.url||"#",target:"_blank",rel:"noopener noreferrer"},t.name))),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.regular_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:c})))))})))))}get host(){return n(this)}};a.style="";export{d as salla_multiple_bundle_product_options_modal,a as salla_multiple_bundle_product_slider}
4
+ import{r as t,c as s,h as i,H as e,a as n}from"./p-DgUQRYr2.js";import{A as o}from"./p-BuGRUUN_.js";import{A as l}from"./p-CcEEx00d.js";const d=class{constructor(i){t(this,i),this.optionsSaved=s(this,"optionsSaved"),this.productSelected=s(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[],this.isProductAlreadySelected=!1}generateCacheKey(t,s,i){return`${t||"unknown"}-${s||0}-${i||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.isProductAlreadySelected=!!t.isProductAlreadySelected,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const s=t.detail||t,{option:i,detail:e}=s,n=i||s.option_id&&this.product?.options?.find((t=>t.id===s.option_id||String(t.id)===String(s.option_id))),o=e||(s.id?s:null);this.product?.id&&n&&this.handleOptionChange(Number(this.product.id),n,o)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const s=t.target;if(s&&"checkbox"===s.type&&s.name&&s.name.includes("bundle[")&&s.name.includes("][id]")){const t=s.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!s.checked){if("true"===s.getAttribute("data-selection-locked"))return void(s.checked=!0);const[,i,e]=t,n=s.value,o=this.host.closest("form");this.cleanupProductDeselection({sectionId:i,productIndex:parseInt(e,10),productId:n,form:o,uncheckedInput:s})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:s,productIndex:i,productId:e,form:n,uncheckedInput:o}=t;if(this.clearProductOptions(e,s,i),n){const t=`bundle[${s}][${i}]`;Array.from(n.querySelectorAll(`input[name^="${t}"]`)).forEach((s=>{if(s===o)return;const i="hidden"===s.type,n=s.getAttribute("data-product-id")===String(e)&&s.name?.startsWith(t);(i||n)&&s.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});n.dispatchEvent(t)}))}}generateFormInputName(t,s,i){return`bundle[${t}][${s}][options][${i}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,s=this.generateCacheKey(this.sectionId,this.productIndex,t),i=document.querySelector(`salla-product-options[product-id="${t}"]`);if(i)try{const t=await i.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[s]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,s,i){const e={...this.selectedOptions};if(null==s||null==i||Number.isNaN(i)){const s=`-${String(t)}`,i=[];Object.keys(e).forEach((t=>{t.endsWith(s)&&(delete e[t],i.push(t))})),i.forEach((t=>this.bumpOptionsResetToken(t)))}else{const n=this.generateCacheKey(s,i,t);delete e[n],this.bumpOptionsResetToken(n)}this.selectedOptions=e,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,s,i){const e=this.generateCacheKey(this.sectionId,this.productIndex,t),n=document.querySelector(`salla-product-options[product-id="${t}"]`);let o=[];if(n)try{o=await n.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(o.length>0)this.selectedOptions={...this.selectedOptions,[e]:o};else if(this.selectedOptions[e]&&this.selectedOptions[e].length>0){const t=[...this.selectedOptions[e]||[]],n=t.findIndex((t=>t.option_id===s.id));n>-1?i&&null!=i.id?t[n]={...i,option_id:s.id}:t.splice(n,1):i&&null!=i.id&&t.push({...i,option_id:s.id}),this.selectedOptions={...this.selectedOptions,[e]:t}}else i&&null!=i.id&&(this.selectedOptions={...this.selectedOptions,[e]:[{...i,option_id:s.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],s=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,s),e=document.querySelector(`salla-product-options[product-id="${s}"]`);let n=[];if(e)try{n=await e.getSelectedOptions()||[];const t=this.selectedOptions[i]||[];(t.length>n.length||0===n.length&&t.length>0)&&(n=t)}catch(t){n=this.selectedOptions[i]||[]}else n=this.selectedOptions[i]||[];return 0===n.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((s=>{s.required&&(n.some((t=>t.option_id==s.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:s.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const s=this.product?.id;if(!s)return;const i=this.generateCacheKey(this.sectionId,this.productIndex,s);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){if(!this.isProductAlreadySelected&&null!=this.sectionId){const t=this.host.closest("salla-multiple-bundle-product-details");if(!await(t?.canSelectBundleProduct(this.sectionId,s)))return void salla.notify.error(salla.lang.getWithDefault("pages.products.bundle_selection_limit_reached","لا يمكنك اختيار المزيد من المنتجات في هذا القسم"))}this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${s}"]`);let e=await(t?.getSelectedOptions());if((!e||0===e.length)&&this.selectedOptions[i]?.length>0&&(e=this.selectedOptions[i]),!e||0===e.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[i]:e};const n=this.host.closest("form");if(!n)return void(this.isLoading=!1);const o=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(n.querySelectorAll(`input[name^="${o}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(n.querySelectorAll(`[data-product-id="${s}"][name^="${o}"]`)).forEach((t=>t.remove()));const l=`bundle[${this.sectionId}][${this.productIndex}][id]`,d=document.getElementById(l);if(d)d.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(s),t.dataset.productId=String(s),n.appendChild(t)}e.forEach((t=>{const i=t.option_id,e=document.createElement("input");e.type="hidden",e.name=this.generateFormInputName(this.sectionId,this.productIndex??0,i),e.value=String(t.id),e.dataset.productId=String(s),n.appendChild(e)}));const a=new window.Event("change",{bubbles:!0});n.dispatchEvent(a),this.optionsSaved.emit({productId:Number(s),selectedOptions:e,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(s),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),s=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const i=s.some((s=>s.id===t.id));return{...t,is_selected:i}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),n=this.generateCacheKey(this.sectionId,this.productIndex,t),o=this.optionsResetTokens[n]||0,l=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return i(e,{key:"8c2d6cbc15d173ceeb3a5b498e8684e0c61a5adf"},i("salla-modal",{key:"7cb8274a9304257c19a5fb8bbbfb44c98b818c83",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"9f16fe0b3fb26e4fee7f1273f875399ed0f401a7",slot:"loading"},i("salla-skeleton",{key:"0fdf6a86da8432f8f5c883466ea2fab00ae4e2d3",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"940ca77513e6aee8062b7cc8b2d04334973f6b02",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"cd14ebae116356906bb1f9dda3545e5555295b33",slot:"items"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${s+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"e40da3829870abc60dba4827c8d331152e45272c",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,"data-caption":`${this.product?.name} - Image ${s+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${s+1}`,alt:t.alt||`${this.product?.name} - ${s+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${n}-reset-${o}`,"product-id":t,"unique-key":`${n}-reset-${o}`}),i("div",{key:"6caf87769ef6ffda12dee54df32e87728e62c484",slot:"footer"},i("div",{key:"bf2ed94efbe7e2ca4dd76441783d5a8423a4454d",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"9468df838e0b677714abb4951c958f37bac2a1c2",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:l},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return n(this)}static get watchers(){return{product:["handleProductChange"]}}};d.style=":host{display:block}";const a=class{constructor(i){t(this,i),this.productSelected=s(this,"productSelected"),this.productOptionsSelected=s(this,"productOptionsSelected"),this.selectedProducts={},this.isSelectionLocked=!1,this.selectionLimit=0,this.savedOptionsByInstance={},this.handleProductClick=(t,s)=>{const i=this.selectedProducts[this.section.id]?.has(t.id)||!1,e=this.getCheckbox(this.section.id,s);if(i&&this.isSelectionLocked)return void(e&&(e.checked=!0));if(!i&&this.isMaxSelectionReached()&&1!==this.selectionLimit)return;if(1===this.selectionLimit&&!i)return void this.productSelected.emit({product:t,sectionId:this.section.id});if(!e)return;const n=!e.checked;n||(this.dispatchClearOptionsEvent(t,s),this.clearSavedOptionsState(this.section.id,s)),e.checked=n,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});e.dispatchEvent(t)})),this.productSelected.emit({product:t,sectionId:this.section.id})},this.handleOptionsClick=t=>{!this.selectedProducts[this.section.id]?.has(t.id)&&this.isMaxSelectionReached()&&1!==this.selectionLimit||this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getSelectedCount(){return this.selectedProducts[this.section?.id]?.size??0}isMaxSelectionReached(){return this.selectionLimit>1&&this.getSelectedCount()>=this.selectionLimit}isProductSelectionDisabled(t,s){return 0===t.quantity||!s&&this.isMaxSelectionReached()}getProductInstanceKey(t,s){return`${t}::${s}`}dispatchClearOptionsEvent(t,s){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:s})}handleOptionsSaved(t){const s=t.detail;if(!s)return;const{sectionId:i,productIndex:e,selectedOptions:n}=s;if(null==i||i!==this.section?.id)return;if(null==e||Number.isNaN(e))return;const o=this.getProductInstanceKey(i,e);if(n?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[o]:!0};else if(this.savedOptionsByInstance[o]){const t={...this.savedOptionsByInstance};delete t[o],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,s){const i=this.getProductInstanceKey(t,s);if(!this.savedOptionsByInstance[i])return;const e={...this.savedOptionsByInstance};delete e[i],this.savedOptionsByInstance=e}generateEventName(t,s){return`bundle[${t}][${s}][id]`}getCheckbox(t,s){const i=this.generateEventName(t,s);return this.host.querySelector(`input.s-multiple-bundle-product-checkbox[name="${i}"]`)}preventLockedDeselect(t,s){if(!this.isSelectionLocked||!s)return;t.preventDefault(),t.stopPropagation();const i=t.target;"checkbox"===i?.type&&(i.checked=!0)}render(){return i(e,{key:"fc6f9cc1bbc36bbcdfc9bc4346d818cd9ac67c92",class:"s-multiple-bundle-product-slider"},i("salla-slider",{key:"82648a1348104be40093a501ceab6ea0209ec761",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"a6d44237aaabb99aa4b4c8c3c5a986fe8d5afdc7",slot:"items"},this?.section?.products?.map(((t,s)=>{const e=this.selectedProducts[this.section.id]?.has(t.id)||!1,n=e&&this.isSelectionLocked,d=this.isProductSelectionDisabled(t,e),a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,s)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let c=salla.config.get("theme.is_rtl",!0)?o:l;return i("div",{class:"s-multiple-bundle-product-slide-one-third"+(d?" s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,s)},i("input",{id:this.generateEventName(this.section.id,s),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:e,"data-selection-locked":n?"true":void 0,name:this.generateEventName(this.section.id,s),value:t.id,onClick:t=>this.preventLockedDeselect(t,e),onChange:t=>this.preventLockedDeselect(t,e)}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},i("a",{href:t?.url||"#",target:"_blank",rel:"noopener noreferrer"},t.name))),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.regular_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:c})))))})))))}get host(){return n(this)}};a.style="";export{d as salla_multiple_bundle_product_options_modal,a as salla_multiple_bundle_product_slider}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as i}from"./p-DmGAR42j.js";const r=class{constructor(t){s(this,t),this.placeholderImage=salla.url.cdn("images/s-empty.png")}getProductImage(){return this.productDetails?.image?"string"==typeof this.productDetails.image?this.productDetails.image:this.productDetails.image.url||this.placeholderImage||salla.url.cdn("images/s-empty.png"):this.placeholderImage}getProductImageAlt(){return this.productDetails?.image&&"string"!=typeof this.productDetails.image?this.productDetails.image.alt||this.productDetails?.name||"":this.productDetails?.name||""}getAccordionId(){return`accordion-${this.productDetails?.id||"default"}`}getAccordionKey(){return this.productDetails?.id||"default"}shouldBeCollapsible(){return void 0!==this.collapsible?this.collapsible:this.productDetails?.options?.length>0}renderOptions(){return this.productDetails?.options?.length?t("salla-accordion-body",null,t("div",{class:"s-order-details-options"},t("salla-order-details-options",{options:this.productDetails.options}))):null}render(){if(!this.productDetails)return null;const s=this.shouldBeCollapsible();return t(i,{class:"s-order-details-bundle-wrapper"},t("salla-accordion",{key:this.getAccordionKey(),collapsed:!1,bordered:!0,collapsible:s,id:this.getAccordionId(),size:"sm"},t("salla-accordion-head",null,t("div",{class:"s-order-details-product"},t("div",{class:"s-order-details-product-content"},t("div",{class:"s-order-details-product-info"},t("div",{class:"s-order-details-product-image"},t("img",{src:this.getProductImage(),alt:this.getProductImageAlt()})),t("div",{class:"s-order-details-product-details"},t("a",{href:this.productDetails?.url||"#",class:"s-order-details-product-name"},this.productDetails?.name||""),this.productDetails?.quantity&&t("span",{class:"s-order-details-product-quantity"},"×",this.productDetails.quantity)))))),this.renderOptions()))}};r.style="";export{r as salla_order_details_multiple_bundle_product}
4
+ import{r as s,h as t,H as i}from"./p-DgUQRYr2.js";const r=class{constructor(t){s(this,t),this.placeholderImage=salla.url.cdn("images/s-empty.png")}getProductImage(){return this.productDetails?.image?"string"==typeof this.productDetails.image?this.productDetails.image:this.productDetails.image.url||this.placeholderImage||salla.url.cdn("images/s-empty.png"):this.placeholderImage}getProductImageAlt(){return this.productDetails?.image&&"string"!=typeof this.productDetails.image?this.productDetails.image.alt||this.productDetails?.name||"":this.productDetails?.name||""}getAccordionId(){return`accordion-${this.productDetails?.id||"default"}`}getAccordionKey(){return this.productDetails?.id||"default"}shouldBeCollapsible(){return void 0!==this.collapsible?this.collapsible:this.productDetails?.options?.length>0}renderOptions(){return this.productDetails?.options?.length?t("salla-accordion-body",null,t("div",{class:"s-order-details-options"},t("salla-order-details-options",{options:this.productDetails.options}))):null}render(){if(!this.productDetails)return null;const s=this.shouldBeCollapsible();return t(i,{class:"s-order-details-bundle-wrapper"},t("salla-accordion",{key:this.getAccordionKey(),collapsed:!1,bordered:!0,collapsible:s,id:this.getAccordionId(),size:"sm"},t("salla-accordion-head",null,t("div",{class:"s-order-details-product"},t("div",{class:"s-order-details-product-content"},t("div",{class:"s-order-details-product-info"},t("div",{class:"s-order-details-product-image"},t("img",{src:this.getProductImage(),alt:this.getProductImageAlt()})),t("div",{class:"s-order-details-product-details"},t("a",{href:this.productDetails?.url||"#",class:"s-order-details-product-name"},this.productDetails?.name||""),this.productDetails?.quantity&&t("span",{class:"s-order-details-product-quantity"},"×",this.productDetails.quantity)))))),this.renderOptions()))}};r.style="";export{r as salla_order_details_multiple_bundle_product}
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as t,f as i,h as a,H as s,a as e}from"./p-DgUQRYr2.js";import{S as r,a as o}from"./p-cq6TcfoH.js";import{C as n}from"./p-BV4kqbdL.js";import{H as l}from"./p-DMvhNbgN.js";import{I as d}from"./p-C-tzSDxw.js";import{W as h}from"./p-CgR-T_ZS.js";import{M as m}from"./p-DmgxDvXL.js";import{b as c}from"./p-DrXX8XG8.js";function g(t){const i=t.split(/[?#]/,1)[0];return/\.(mp4|webm|mov|avi|mkv)$/i.test(i)}function p(t){return t.reduce(((t,i)=>i?(g(i)?t.videos.push(i):t.images.push(i),t):t),{images:[],videos:[]})}function u(t){return p(t.map((t=>t?.url||"")).filter(Boolean))}function f(t){return t?Array.isArray(t)?t.filter(Boolean):t.split(",").map((t=>t.trim())).filter(Boolean):[]}function w(t){return t.reduce(((t,i)=>(g(i?.url||"")?t.video+=1:t.image+=1,t)),{image:0,video:0})}function v(t,i){const a=String(i);let s=!1;return t.filter((t=>{const i=null!=t?.id?String(t.id):"",e=String(t?.url??"");return!(i===a||e===a)||!!s||(s=!0,!1)}))}function b(t,i,a){const{images:s,videos:e}=u(a);t&&(t.value=s.join(",")),i&&(i.value=e.join(","))}function y(t,i,a){i||delete t.images,a||delete t.videos}const _="600px",x=class{constructor(i){t(this,i),this.hasError=!1,this.showContactWidget=!0,this.errorMessage="",this.images=[],this.productImages={},this.editItemImages=[],this.productReviewFactors={},this.editFactorRatings={},this.productMainRatings={},this.productFactorRatings={},this.contact_body=(t,i,a)=>salla.lang.get("pages.rating.contact_subject",{store:t,id:i,customer:a}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.allowAttachImages=!1,this.allowAttachVideos=!1,this.allowContactSupport=!1,this.uploadCounts={},this.uploadImageCounts={},this.uploadVideoCounts={},this.hasUploadsInProgress=!1,this.loyaltyImageRatingPoints=0,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.nothingToRateLabel=salla.lang.get("pages.rating.nothing_to_rate"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.requiredFactorsLabel=salla.lang.get("pages.rating.rate_required_factors"),this.rateTheFollowingLabel=salla.lang.get("pages.rating.rate_the_following_factors"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contentRefs=[],this.hiddenInputs=[],this.hiddenVideoInputs=[],this.uploadingByProductId={},this.userFilledFactorKeys={},this.boundRatingRows=new WeakSet,this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.isSubmitting=!1,this.thanksCountdownInterval=null,this.MAX_IMAGE_UPLOAD_LIMIT=10,this.MAX_VIDEO_UPLOAD_LIMIT=5,this.MAX_VIDEO_FILE_SIZE="100MB",this.MAX_VIDEO_DURATION=60,this.MAX_PARALLEL_UPLOADS=10,this.scheduleWizardSetup=!1}syncStoreSettings(){void 0===this.orderId&&(this.orderId=salla.config.get("page.id")),this.allowAttachImages=!!salla.config.get("store.settings.rating.allow_attach_images"),this.allowAttachVideos=!!salla.config.get("store.settings.rating.allow_attach_videos"),this.allowContactSupport=!!salla.config.get("store.settings.rating.allow_contact_support"),this.refreshMediaLabels()}canAttachMedia(){return this.allowAttachImages||this.allowAttachVideos}getMediaUploadAccept(){return c(this.allowAttachImages,this.allowAttachVideos)}refreshMediaLabels(){this.allowedImagesTypesLabel=this.getAllowedMediaTypesLabel(),this.threeImagesMax=this.getMaxUploadHintLabel()}getAllowedMediaTypesLabel(){return this.allowAttachImages&&this.allowAttachVideos?salla.lang.get("common.uploader.allowed_media_types"):this.allowAttachImages?salla.lang.get("common.uploader.allowed_images_types"):this.allowAttachVideos?salla.lang.get("common.uploader.allowed_videos_types"):""}getMaxUploadHintLabel(){return this.allowAttachImages&&this.allowAttachVideos?salla.lang.get("common.uploader.max_three_images"):this.allowAttachImages?salla.lang.get("common.uploader.max_images_count",{count:this.MAX_IMAGE_UPLOAD_LIMIT}):this.allowAttachVideos?salla.lang.get("common.uploader.max_videos_count",{count:this.MAX_VIDEO_UPLOAD_LIMIT}):""}setUploadCount(t,i,a,s){this.uploadCounts={...this.uploadCounts,[t]:i},null!=a&&(this.uploadImageCounts={...this.uploadImageCounts,[t]:a}),null!=s&&(this.uploadVideoCounts={...this.uploadVideoCounts,[t]:s})}setUploaderProcessing(t,i){this.uploadingByProductId={...this.uploadingByProductId,[t]:i},this.hasUploadsInProgress=Object.values(this.uploadingByProductId).some(Boolean)}scheduleUploaderHeightRefresh(){[50,150,350].forEach((t=>{setTimeout((()=>this.updateBodyHeight()),t)}))}handleGalleryCountUpdate(t,i){this.setUploadCount(t,i.count,i.imageCount,i.videoCount),this.setUploaderProcessing(t,!!i.uploading),this.scheduleUploaderHeightRefresh()}isUnverifiedReview(){return null===this.orderId&&!!this.productId}getRatingOrderId(){return this.orderId||salla.config.get("page.id")}getSubmitOrderId(){return this.orderId}isCustomerOrderShape(t){if(!t||"object"!=typeof t)return!1;const i=t;return!!i.rating&&(Array.isArray(i.items)||Array.isArray(i.products)||Array.isArray(i.rating?.product)||Array.isArray(i.rating?.products))}getBootstrapOrder(){const t=salla.config.get("page");if(this.isCustomerOrderShape(t))return t;if(t&&"object"==typeof t){const i=t;if(Array.isArray(i.products))return t;const a=i.order;if(this.isCustomerOrderShape(a))return a}}async loadCustomerOrderForEdit(){const t=this.getBootstrapOrder();if(t?.rating?.product||t?.rating?.products)this.order=t;else try{const t=await salla.api.withoutNotifier((()=>salla.order.api.getDetails(this.getRatingOrderId())));t?.data&&(this.order=t.data)}catch(t){if(!this.order){const t=await salla.api.withoutNotifier((()=>salla.rating.api.order(this.getRatingOrderId())));this.order=t.data}}}getOrderProductRatings(t=this.order){return t?.rating?[...this.normalizeToArray(t.rating.product),...this.normalizeToArray(t.rating.products)]:[]}getMatchedProductRating(t=this.order,i,a){return this.getOrderProductRatings(t).find((t=>Number(t?.id??t?.feedback_id)===Number(a)||Number(t?.product_id??t?.product?.id)===Number(i)))}hasRatingFeedback(t){const i=t?.rating;return null!=i&&""!==i&&Number(i)>0}isTestimonialsEnabled(t=this.order){return!(this.productId||!1===t?.testimonials_enabled||this.hasRatingFeedback(t?.store?.feedback)||!0!==t?.testimonials_enabled&&!t?.allowed_ratings?.testimonials_enabled)}isProductsEnabled(t=this.order){return!1!==t?.products_enabled&&this.getRateableProducts(t).length>0}isShippingEnabled(t=this.order){return!(this.productId||!1===t?.shipping_enabled||this.hasRatingFeedback(t?.shipping?.feedback)||!t?.shipping?.company||!0!==t?.shipping_enabled&&!t?.allowed_ratings?.shipping_enabled)}getOrderProducts(t=this.order){return Array.isArray(t?.products)?t.products.filter((t=>t?.product?.id)):[]}getRateableProducts(t=this.order){return this.getOrderProducts(t).filter((t=>!(this.hasRatingFeedback(t?.feedback)||this.productId&&String(t.product.id)!==String(this.productId))))}hasNothingToRate(t=this.order){if(!t)return!0;const i=!1!==t.testimonials_enabled&&(!0===t.testimonials_enabled||!!t.allowed_ratings?.testimonials_enabled),a=!(!t.shipping?.company||!1===t.shipping_enabled||!0!==t.shipping_enabled&&!t.allowed_ratings?.shipping_enabled),s=!1!==t.products_enabled&&this.getOrderProducts(t).length>0;return!i&&!a&&!s}getStepsCount(t=this.order){if(!t)return 0;let i=0;return this.isTestimonialsEnabled(t)&&i++,this.isProductsEnabled(t)&&(i+=this.getRateableProducts(t).length),this.isShippingEnabled(t)&&t.shipping?.company&&i++,i}afterOrderLoaded(){this.stepsCount=this.getStepsCount(),this.scheduleWizardSetup=!0,i(this)}async setOrder(t,i){this.orderId=t,this.productId=i,this.order=void 0,this.hasError=!1,this.errorMessage=void 0,this.showContactWidget=!0}async loadUnverifiedProductOrder(){const t=await salla.api.withoutNotifier((()=>salla.product.api.getDetails(this.productId))).catch((()=>null)),i=t?.data;this.order={products:[{feedback:void 0,product:{id:Number(this.productId),name:i?.name||"",thumbnail:i?.image?.url||salla.url.cdn("images/s-empty.png")}}],products_enabled:!0,testimonials_enabled:!1,shipping_enabled:!1,thanks_message:""},this.productReviewFactors=await this.fetchAllProductReviewFactors(this.order)}escapeHtml(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}getModalTitle(){if(this.isUnverifiedReview()){const t=this.escapeHtml(this.getRateableProducts()[0]?.product?.name||"");return`${salla.lang.get("pages.rating.rate")} ${t}`.trim()}return`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order?.id})</span>`}async open(){await salla.onReady(),this.syncStoreSettings(),this.defaultMode=!0,this.currentIndex=0,this.submitted=[];const t=this.getRatingOrderId();return new Promise((i=>{setTimeout((()=>{this.modal?.open().then((()=>this.order&&this.order.id===t||(this.isUnverifiedReview()?this.loadUnverifiedProductOrder():salla.api.withoutNotifier((()=>salla.rating.api.order(t))).then((async t=>{this.order=t.data,this.productReviewFactors=await this.fetchAllProductReviewFactors(t.data)}))))).then((()=>this.readyUpLoyaltyPoints())).then((()=>this.modal?.setTitle(this.getModalTitle()))).then((()=>{const t={};for(const i of this.getRateableProducts())t[i.product.id]=[];this.productImages=t,this.uploadCounts=Object.fromEntries(Object.keys(t).map((t=>[Number(t),0])))})).then((()=>this.modal?.stopLoading())).then((()=>this.afterOrderLoaded())).catch((t=>{i(!1),this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data,this.modal?.stopLoading()})),i(!0)}),50)}))}async openEditModal(t){await salla.onReady(),this.syncStoreSettings(),this.defaultMode=!1,this.editMode=!0,this.editType=t.type,this.editFeedbackId=t.feedback_id;try{await this.fetchEditItem(t.feedback_id),await this.readyUpLoyaltyPoints(),"product"===this.editType&&this.editItem?.product?.id&&(await this.loadCustomerOrderForEdit(),await this.ensureProductFactorsLoaded(this.editItem.product.id),this.editFactorRatings={...this.buildEditFactorRatings(this.editItem.product.id)},this.markExistingFactorRatingsAsUserFilled(this.editItem.product.id,this.editFactorRatings)),this.editModal?.open(),"product"===this.editType&&this.canAttachMedia()&&this.scheduleUploaderHeightRefresh()}catch(t){this.hasError=!0,this.errorMessage=t.response?.data?.error?.message||t.response?.data}}async fetchEditItem(t){const i=`rating/${t}/show`,a=await salla.api.request(i);if(this.editItem=a.data,this.canAttachMedia()&&"product"==this.editType){const t=(this.editItem.images||[]).filter(Boolean),i=(this.editItem.videos||[]).filter(Boolean);let a=[...t,...i];if(!i.length&&t.length){const i=p(t);a=[...i.images,...i.videos]}if(a=a.filter((t=>g(t)?this.allowAttachVideos:this.allowAttachImages)),a.length){this.editItemImages=a.map((t=>function(t){return{id:t,url:t}}(t)));const t=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,t.image,t.video)}}}async editReview(){if(this.hasUploadsInProgress)return;const t=`rating/${this.editFeedbackId}`;let i;if("product"===this.editType){const t=this.editModal?.querySelector('[data-type="products"]')||this.currentTab;if(i=this.buildProductRatingPayload(this.collectFormData(t),t),!i.product_id&&this.editItem?.product?.id&&(i.product_id=String(this.editItem.product.id)),this.canAttachMedia()){const{images:t,videos:a}=u(this.editItemImages);this.allowAttachImages&&(i.images=t),this.allowAttachVideos&&(i.videos=a)}y(i,this.allowAttachImages,this.allowAttachVideos)}else i=this.collectFormData(this.editModal),i.images&&(i.images=f(i.images)),i.videos&&(i.videos=f(i.videos)),y(i,this.allowAttachImages,this.allowAttachVideos);await salla.api.request(t,i,"put").then((t=>{this.editModal?.close(),salla.notify.success(t.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(t){return this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=t.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((t=>{setTimeout((()=>{this.deleteModal?.open().then((()=>t(!0)))}),50)}))}async deleteReview(){const t=`rating/${this.deleteFeedbackId}`;await salla.api.request(t,null,"delete").then((()=>{this.deleteModal?.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.modal?.close()}handleWizard(){if(this.steps=this.modal?.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal?.querySelectorAll(".s-rating-modal-step-dot"),0===this.stepsCount)return this.hasNothingToRate()?(this.hasError=!0,void(this.errorMessage=this.nothingToRateLabel)):void this.showThankYou();this.showActiveStep()}refreshWizardRefs(){this.modal&&(this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"))}showActiveStep(t=null){if(this.refreshWizardRefs(),this.currentTab=t||this.steps?.[this.currentIndex],!this.currentTab)return;l.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(t=>t!=this.dots?.[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(t=>t==this.currentTab)),0!==this.currentIndex&&(l.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>l.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const i=this.steps?.[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(i?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${i}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.updateBodyHeight()),0),setTimeout((()=>this.updateBodyHeight()),150)}updateBodyHeight(){this.body&&this.currentTab&&(this.body.style.height="products"!==this.currentTab.dataset.type?`${this.currentTab.offsetHeight+(this.editMode?60:0)}px`:"auto")}previousTab(){this.currentIndex>0&&this.currentIndex--,l.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}async submit(){if(!this.hasUploadsInProgress&&!this.isSubmitting){this.isSubmitting=!0;try{this.refreshWizardRefs(),this.submittedBefore()||this.validate(),salla.config.canLeave=!1,await(this.nextBtn?.load()),this.submittedBefore()||await this.sendFeedback(),this.currentTab?.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((t=>t.setAttribute("disabled",""))),this.currentIndex<this.stepsCount&&this.currentIndex++,this.showActiveStep(),l.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)),this.currentIndex===this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}finally{this.isSubmitting=!1,this.nextBtn?.stop(),salla.config.canLeave=!0}}}submittedBefore(){return this.submitted.includes(this.currentIndex)}getRatingHiddenInput(t){const i=t,a=i.querySelector?.(".rating_hidden_input");if(a?.name)return a;const s=i.querySelector?.("salla-rating-stars");return s?.shadowRoot?.querySelector(".rating_hidden_input")||null}collectNamedInputs(t){const i=new Set,a=[],s=t=>{t?.name&&!i.has(t)&&(i.add(t),a.push(t))};return t.querySelectorAll("[name]").forEach((t=>{t.closest("salla-file-upload")||s(t)})),t.querySelectorAll("salla-rating-stars").forEach((t=>{s(this.getRatingHiddenInput(t))})),a}normalizeFactorsList(t){return t?Array.isArray(t)?t:"object"==typeof t?Object.values(t).filter((t=>t&&"object"==typeof t)):[]:[]}validate(t=null,i=null){if(!t&&"products"===this.currentTab?.dataset?.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((t=>this.validate(t,"product")));const a=t??this.currentTab;if(!a)return;const s=a.querySelector(".s-rating-modal-product-rating-row-main"),e=this.getRatingHiddenInput(s||a),r=e?.value,o=a.querySelector(".s-rating-modal-validation-msg"),n=i||a.getAttribute("data-type");if(!r)throw o.innerHTML=salla.lang.get(`pages.rating.rate_${n}_stars`).replace(" (:item)",""),new Error(o.innerHTML);if("product"===n&&Array.from(a.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]')).some((t=>{const i=this.getRatingHiddenInput(t);return!i?.value})))throw o.innerHTML=this.requiredFactorsLabel,new Error(o.innerHTML);o&&(o.innerHTML="")}collectFormData(t=this.currentTab){if(!t)return{};const i={};return this.collectNamedInputs(t).forEach((t=>{const a=salla.helpers.inputData(t.name,t.value,i);i[a.name]=a.value})),i}buildProductRatingPayload(t,i=this.currentTab){if(!i)return{};if(!t.rating){const a=i.querySelector(".s-rating-modal-product-rating-row-main"),s=this.getRatingHiddenInput(a||i);s?.value&&(t.rating=s.value)}const a=Number(t.product_id);let s=[],e=[];t.images?s=f(t.images):this.editMode&&this.canAttachMedia()&&a?s=u(this.editItemImages).images:this.canAttachMedia()&&a&&(s=u(this.productImages[a]||[]).images),t.videos?e=f(t.videos):this.editMode&&this.canAttachMedia()&&a?e=u(this.editItemImages).videos:this.canAttachMedia()&&a&&(e=u(this.productImages[a]||[]).videos);const r=this.normalizeFactorsList(t.factors).filter((t=>t?.id&&t?.rating)).map((t=>({id:String(t.id),rating:String(t.rating)}))),o={order_id:this.getSubmitOrderId(),product_id:String(t.product_id),rating:String(t.rating),comment:t.comment||t.content||"",factors:r,type:"products"};return this.allowAttachImages&&(o.images=s),this.allowAttachVideos&&(o.videos=e),o}async sendFeedback(){this.refreshWizardRefs();const t=this.currentTab?.dataset?.type;if("products"===t){const t=this.collectFormData(this.currentTab),i=this.buildProductRatingPayload(t,this.currentTab);if(!i.product_id||!i.rating)throw new Error("Missing product rating data");const a=await salla.rating.api.products(i);return this.submitted.push(this.currentIndex),a}const i=this.collectFormData(this.currentTab);if(0===Object.keys(i).length)return;if(i.order_id=this.getSubmitOrderId(),i.type=t,!t)return;const a=await salla.rating.api[t](i);return this.submitted.push(this.currentIndex),a}clearThanksCountdown(){null!==this.thanksCountdownInterval&&(clearInterval(this.thanksCountdownInterval),this.thanksCountdownInterval=null)}showThankYou(){let t=10;this.clearThanksCountdown(),this.thanksCountdownInterval=setInterval((()=>{this.thanksTime&&(this.thanksTime.innerHTML="00:0"+t--,t>0||(this.clearThanksCountdown(),this.thanksTime.remove(),this.close().then((()=>window.location.reload()))))}),1e3),this.modal?.querySelector(".s-rating-modal-footer")?.classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${d}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}async readyUpLoyaltyPoints(){const t=salla.loyalty?.isFeatureEnabled?.();if(!t)return void(this.loyaltyImageRatingPoints=0);const i=salla.config.get("store.settings.rating.rating_product_points")||0,a=salla.config.get("store.settings.rating.rating_product_with_image_points")||0;this.loyaltyImageRatingPoints=Number(a)+Number(i)}loyaltyPointsNote(){if(!this.loyaltyImageRatingPoints||!this.loyaltyPointsForImagesLabel||this.isUnverifiedReview())return null;const t=a("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M10 0C13.6819 0 16.6667 2.98477 16.6667 6.66664C16.6667 9.37047 15.057 11.6984 12.7437 12.7444C11.6978 15.0575 9.3701 16.6666 6.66668 16.6666C2.98477 16.6666 0 13.6819 0 9.99998C0 7.29656 1.60918 4.96894 3.92195 3.92276C4.96827 1.60964 7.29618 0 10 0ZM6.66668 5C3.90524 5 1.66667 7.23856 1.66667 9.99998C1.66667 12.7614 3.90524 15 6.66668 15C9.4281 15 11.6667 12.7614 11.6667 9.99998C11.6667 7.23856 9.4281 5 6.66668 5ZM7.50002 5.83333V6.66664H9.16668V8.33331H5.83333C5.60322 8.33331 5.41667 8.51989 5.41667 8.74998C5.41667 8.95456 5.56407 9.12464 5.75844 9.15998L5.83333 9.16664H7.50002C8.6506 9.16664 9.58335 10.0994 9.58335 11.25C9.58335 12.4006 8.6506 13.3333 7.50002 13.3333V14.1666H5.83333V13.3333H4.16667V11.6666H7.50002C7.7301 11.6666 7.91668 11.4801 7.91668 11.25C7.91668 11.0455 7.76927 10.8753 7.57493 10.8401L7.50002 10.8333H5.83333C4.68274 10.8333 3.75 9.90056 3.75 8.74998C3.75 7.59939 4.68274 6.66664 5.83333 6.66664V5.83333H7.50002ZM10 1.66667C8.51377 1.66667 7.17893 2.31513 6.26313 3.34457C6.39704 3.33736 6.53138 3.33333 6.66668 3.33333C10.3486 3.33333 13.3333 6.3181 13.3333 9.99998C13.3333 10.1356 13.3293 10.2702 13.3213 10.4037C14.3513 9.48814 15 8.15314 15 6.66664C15 3.90524 12.7614 1.66667 10 1.66667Z",fill:"#008C56"}));return a("div",{class:"s-rating-modal-loyalty-points-note-container"},a("span",{class:"s-rating-modal-loyalty-points-note-icon"},t),a("p",{class:"s-rating-modal-loyalty-points-note-text"},this.loyaltyPointsForImagesLabel.replace(":points",String(this.loyaltyImageRatingPoints))))}normalizeReviewFactorsPayload(t){const i=t?.data??t?.factors;return Array.isArray(i)?i.flatMap((t=>{const i=Array.isArray(t?.items)?[...t.items]:null;if(i?.length){i.sort(((t,i)=>(Number(t?.sort)||0)-(Number(i?.sort)||0)));const a=!!t?.is_required;return i.filter((t=>null!=t?.id&&""!==t?.id)).map((t=>({id:t.id,name:t?.name,required:a})))}return null==t?.id||""===t?.id?[]:[{id:t.id,name:t?.name,required:t?.required??t?.is_required??!1}]})):[]}async fetchProductReviewFactors(t){try{const i=await salla.api.request(`review/factors/${t}/form`);return this.normalizeReviewFactorsPayload(i)}catch(t){return[]}}async fetchAllProductReviewFactors(t){const i=this.getRateableProducts(t);if(!i.length)return{};const a=await Promise.all(i.map((async t=>{const i=await this.fetchProductReviewFactors(t.product.id);return[t.product.id,i]})));return Object.fromEntries(a)}async ensureProductFactorsLoaded(t){if(!t||this.productReviewFactors[t])return;const i=await this.fetchProductReviewFactors(t);this.productReviewFactors={...this.productReviewFactors,[t]:i}}getFactorFieldName(t,i,a){return t?`${t}[factors][${i}][${a}]`:`factors[${i}][${a}]`}normalizeToArray(t){return null==t?[]:Array.isArray(t)?t:[t]}isFactorReviewsList(t){return Array.isArray(t)&&t.length>0&&t.every((t=>t&&"object"==typeof t&&(void 0!==t.rating||void 0!==t.stars||void 0!==t.value)))}getFactorReviewsFromRecord(t){if(!t)return[];for(const i of["factor_reviews","review_factors","factors"]){const a=t[i];if(this.isFactorReviewsList(a))return a}return[]}getEditFactorReviewsList(t){const i=[this.order,this.getBootstrapOrder()].filter(Boolean);for(const a of i){const i=this.getMatchedProductRating(a,t,this.editFeedbackId),s=this.getFactorReviewsFromRecord(i);if(s.length)return s}const a=this.getOrderProducts(this.order).find((i=>Number(i.product?.id)===Number(t))),s=[this.editItem?.factor_reviews,this.editItem?.review_factors,this.editItem?.product?.review_factors,this.editItem?.product?.factor_reviews,this.editItem?.factors,a?.factor_reviews,a?.review_factors,a?.feedback?.factor_reviews];for(const t of s)if(Array.isArray(t)&&t.length>0)return t;return[]}getFactorKey(t,i){return null!=t.id&&""!==t.id?`id:${t.id}`:t.name?`name:${t.name.trim()}`:`index:${i}`}getFactorRatingsForProduct(t){return this.editMode?this.editFactorRatings:this.productFactorRatings[t]||{}}setFactorRatingsForProduct(t,i){this.editMode?this.editFactorRatings=i:this.productFactorRatings={...this.productFactorRatings,[t]:i}}markExistingFactorRatingsAsUserFilled(t,i){const a=this.productReviewFactors[t]||[],s=new Set;a.forEach(((t,a)=>{const e=this.getFactorKey(t,a),r=void 0!==t.id?i[String(t.id)]:void 0,o=t.name?i[t.name.trim()]:void 0;void 0===r&&void 0===o&&void 0===i[`__index_${a}`]||s.add(e)})),this.userFilledFactorKeys[t]=s}shouldAutofillFactors(t){return t>=4}autofillUnfilledFactors(t,i){const a=this.productReviewFactors[t]||[];if(!a.length)return;const s=this.userFilledFactorKeys[t]||new Set,e={...this.getFactorRatingsForProduct(t)},r=this.shouldAutofillFactors(i);let o=!1;a.forEach(((t,a)=>{const n=this.getFactorKey(t,a);if(!s.has(n)){if(r)return void 0!==t.id&&(e[String(t.id)]=i),t.name&&(e[t.name.trim()]=i),e[`__index_${a}`]=i,void(o=!0);void 0!==t.id&&void 0!==e[String(t.id)]&&(delete e[String(t.id)],o=!0),t.name&&void 0!==e[t.name.trim()]&&(delete e[t.name.trim()],o=!0),void 0!==e[`__index_${a}`]&&(delete e[`__index_${a}`],o=!0)}})),o&&this.setFactorRatingsForProduct(t,e)}handleMainRatingChange(t,i){this.editMode?this.editMainRating=i:this.productMainRatings={...this.productMainRatings,[t]:i},this.autofillUnfilledFactors(t,i)}handleFactorRatingChange(t,i,a){this.userFilledFactorKeys[t]||(this.userFilledFactorKeys[t]=new Set),this.userFilledFactorKeys[t].add(i);const s=this.productReviewFactors[t]||[],e=s.findIndex(((t,a)=>this.getFactorKey(t,a)===i));if(e<0)return;const r=s[e],o={...this.getFactorRatingsForProduct(t)};void 0!==r.id&&(o[String(r.id)]=a),r.name&&(o[r.name.trim()]=a),o[`__index_${e}`]=a,this.setFactorRatingsForProduct(t,o)}setupProductRatingAutofill(t,i){t&&!this.boundRatingRows.has(t)&&(this.boundRatingRows.add(t),t.addEventListener("click",(a=>{const s=a.target;if(!s.closest(".s-rating-stars-btn-star"))return;const e=s.closest(".s-rating-modal-product-rating-row-main"),r=s.closest(".s-rating-modal-product-factor-row");requestAnimationFrame((()=>{if(e&&t.contains(e)){const t=Number(this.getRatingHiddenInput(e)?.value);t>0&&this.handleMainRatingChange(i,t)}else if(r&&t.contains(r)){const t=r.getAttribute("data-factor-key"),a=Number(this.getRatingHiddenInput(r)?.value);t&&a>0&&this.handleFactorRatingChange(i,t,a)}}))})))}buildEditFactorRatings(t){return this.getEditFactorReviewsList(t).reduce(((t,i,a)=>{const s=Number(i?.rating??i?.stars??i?.value);if(Number.isNaN(s))return t;const e=i?.id??i?.factor_id;return null!=e&&""!==e&&(t[String(e)]=s),i?.name&&(t[i.name.trim()]=s),t[`__index_${a}`]=s,t}),{})}renderProductStep(t,i){return a("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products","data-product-id":t.product.id,key:t.product.id},a("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),a("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},a("div",{class:"s-rating-modal-product-details",ref:i=>i&&this.setupProductRatingAutofill(i,t.product.id)},a("div",{class:"s-rating-modal-step-wrap"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:t.product.thumbnail,alt:t.product.name,class:"s-rating-modal-product-img"})),a("h3",{class:"s-rating-modal-title"},t.product.name),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_product_rate")),this.renderProductMainRating(t.product.id,0,{fieldPrefix:""})),this.renderProductReviewFactors(t.product.id,0,{fieldPrefix:""}),a("input",{type:"hidden",name:"product_id",value:t.product.id}),a("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"comment",class:"s-rating-modal-comment"}),a("small",{class:"s-rating-modal-validation-msg"}))),this.canAttachMedia()&&a("div",{class:"s-rating-modal-uploader is-opened",ref:t=>{t&&(this.contentRefs[i]=t)}},a("salla-file-upload",{name:"image",enableGallery:!0,maxImagesCount:this.allowAttachImages?this.MAX_IMAGE_UPLOAD_LIMIT:void 0,maxVideosCount:this.allowAttachVideos?this.MAX_VIDEO_UPLOAD_LIMIT:void 0,maxVideoFileSize:this.allowAttachVideos?this.MAX_VIDEO_FILE_SIZE:void 0,maxVideoDuration:this.allowAttachVideos?this.MAX_VIDEO_DURATION:void 0,maxParallelUploads:this.MAX_PARALLEL_UPLOADS,imagePreviewHeight:75,filePosterHeight:75,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${t.product.id}`,title:t.product.name,allowMultiple:!0,instantUpload:!0,accept:this.getMediaUploadAccept(),url:salla.url.api("upload"),onUploaded:a=>{const s=t.product.id,e=[...this.productImages[s]||[],a.detail];this.productImages={...this.productImages,[s]:e};const r=w(e);this.setUploadCount(s,e.length,r.image,r.video),b(this.hiddenInputs[i],this.hiddenVideoInputs[i],e),this.scheduleUploaderHeightRefresh()},onRemoved:a=>{const s=a.detail,e=t.product.id;if(!s||!this.productImages[e])return;const r=v(this.productImages[e],s);this.productImages={...this.productImages,[e]:r};const o=w(r);this.setUploadCount(e,r.length,o.image,o.video),b(this.hiddenInputs[i],this.hiddenVideoInputs[i],r),this.scheduleUploaderHeightRefresh()},labelIdle:this.getFilepondPlaceholder(),onGalleryUpdated:i=>this.handleGalleryCountUpdate(t.product.id,i.detail)}),this.allowAttachImages&&a("input",{type:"hidden",name:"images",value:u(this.productImages[t.product.id]||[]).images.join(","),ref:t=>{t&&(this.hiddenInputs[i]=t)}}),this.allowAttachVideos&&a("input",{type:"hidden",name:"videos",value:u(this.productImages[t.product.id]||[]).videos.join(","),ref:t=>{t&&(this.hiddenVideoInputs[i]=t)}}),this.renderUploadedImagesCount(t.product.id))))}renderProductMainRating(t,i,s={}){const e=s.fieldPrefix??`products[${i}]`,r=e?`${e}[rating]`:"rating",o=Number(s.mainRating??(this.editMode?this.editMainRating:this.productMainRatings[t])),n=!Number.isNaN(o);return a("div",{class:"s-rating-modal-stars-product s-rating-modal-product-rating-row-main"},a("salla-rating-stars",{size:"large",name:r,key:n?`main-rating-${o}`:"main-rating-empty",value:n?o:void 0,editable:n,withLabel:!0}))}renderProductReviewFactors(t,i,s={}){const e=this.productReviewFactors[t]||[],r=s.fieldPrefix??`products[${i}]`,o={...this.editMode?{}:this.productFactorRatings[t]||{},...s.factorRatings||{}},n=(t,i)=>{const a=void 0!==t.id?o[String(t.id)]:void 0,s=t.name?o[t.name.trim()]:void 0,e=Number(a??s??o[`__index_${i}`]);return Number.isNaN(e)?void 0:e};if(!e.length)return null;const l=e.some((t=>t.required));return a("div",{class:"s-rating-modal-product-factors-card"},a("div",{class:"s-rating-modal-product-factors-heading"},this.rateTheFollowingLabel,l?a("span",{class:"s-rating-modal-product-factor-required"},"*"):""),a("div",{class:"s-rating-modal-product-rating-rows"},e.map(((t,i)=>a("div",{class:"s-rating-modal-product-rating-row s-rating-modal-product-factor-row","data-required":t.required?"true":"false","data-factor-key":this.getFactorKey(t,i)},a("input",{type:"hidden",name:this.getFactorFieldName(r,i,"name"),value:t.name}),!!t.id&&a("input",{type:"hidden",name:this.getFactorFieldName(r,i,"id"),value:String(t.id)}),a("span",{class:"s-rating-modal-product-factor-name"},t.name),a("salla-rating-stars",{size:"medium",name:this.getFactorFieldName(r,i,"rating"),key:`factor-rating-${t.id??i}-${n(t,i)??0}`,value:n(t,i),editable:s.alwaysEditable||"number"==typeof n(t,i),tag:!1}))))))}handleSendEmail(){if(!this.order)return;const t=`${this.contactSubjectLabel} #${this.order.id}`,i=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),a=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(t)}&body=${encodeURIComponent(i)}`;window.open(a,"_blank")}handleSendWhatsApp(){if(!this.order)return;const t=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),i=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(t)}`;window.open(i,"_blank")}resetData(t){t.detail||(this.clearThanksCountdown(),this.modal?.close(),this.editItem=null,this.editItemImages=[],this.editFactorRatings={},this.productMainRatings={},this.productFactorRatings={},this.editMainRating=void 0,this.userFilledFactorKeys={},this.uploadingByProductId={},this.hasUploadsInProgress=!1,this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.editHiddenVideosInput&&(this.editHiddenVideosInput.value=""),this.body&&(this.body.style.height="",this.body.style.minHeight=""),this.deleteFeedbackId=void 0,this.editFeedbackId=void 0,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1,this.currentIndex=0,this.submitted=[],this.scheduleWizardSetup=!1,this.loyaltyImageRatingPoints=0)}getDeleteModal(){return a("salla-modal",{ref:t=>{t&&(this.deleteModal=t)},width:"xs",onModalVisibilityChanged:t=>this.resetData(t)},a("div",{class:"s-rating-modal-delete-wrapper",ref:t=>{t&&(this.body=t)}},a("h3",null,this.confirmDeletionLabel),a("p",null,this.areYouSureLabel),a("div",{class:"s-rating-modal-delete-actions"},a("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),a("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal?.close()},this.cancelLabel))))}renderUploadedImagesCount(t){const i=w(this.editMode?this.editItemImages:this.productImages[t]||[]),s=this.uploadImageCounts[t]??i.image,e=this.uploadVideoCounts[t]??i.video;return this.allowAttachImages&&this.allowAttachVideos?a("span",{class:"s-rating-modal-upload-count"},salla.lang.get("pages.rating.media_count",{imageCurrent:s,imageTotal:this.MAX_IMAGE_UPLOAD_LIMIT,videoCurrent:e,videoTotal:this.MAX_VIDEO_UPLOAD_LIMIT})):this.allowAttachImages?a("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",s,{current:s,total:this.MAX_IMAGE_UPLOAD_LIMIT})):this.allowAttachVideos?a("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.videos_count",e,{current:e,total:this.MAX_VIDEO_UPLOAD_LIMIT})):null}getEditModal(){return a("salla-modal",{ref:t=>{t&&(this.editModal=t)},width:"custom",customWidth:_,onModalVisibilityChanged:t=>this.resetData(t)},a("div",{class:"s-rating-modal-edit-wrapper",ref:t=>{t&&(this.body=t)}},"store"===this.editType&&this.editItem?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:t=>{t&&(this.currentTab=t)}},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),a("h2",{class:"s-rating-modal-title"},salla.config.get("store.name")),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.rate_the_store")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),a("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:t=>{t&&(this.currentTab=t)}},this.editItem.shipping.logo?a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):a("span",{class:"s-rating-modal-icon",innerHTML:r}),a("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_shipping_rate")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),a("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?a("section",{class:"s-rating-modal-step","data-type":"products",ref:t=>{t&&(this.currentTab=t)}},a("div",{class:"s-rating-modal-product"},this.allowAttachImages&&this.loyaltyPointsNote(),a("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},a("div",{class:"s-rating-modal-product-details",ref:t=>t&&this.setupProductRatingAutofill(t,this.editItem.product.id)},a("div",{class:"s-rating-modal-step-wrap"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),a("h3",{class:"s-rating-modal-title"},this.editItem.product.name),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_product_rate")),this.renderProductMainRating(this.editItem.product.id,0,{fieldPrefix:"",mainRating:this.editMainRating??Number(this.editItem.stars??this.editItem.rating)})),this.renderProductReviewFactors(this.editItem.product.id,0,{fieldPrefix:"",factorRatings:this.editFactorRatings,alwaysEditable:!0}),a("input",{type:"hidden",name:"product_id",value:this.editItem.product.id}),a("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"comment",class:"s-rating-modal-comment"}),a("small",{class:"s-rating-modal-validation-msg"}))),this.canAttachMedia()&&a("div",{class:"s-rating-modal-uploader is-opened",ref:t=>{t&&(this.contentRefs[1]=t)}},a("salla-file-upload",{name:"images",allowMultiple:!0,enableGallery:!0,maxImagesCount:this.allowAttachImages?this.MAX_IMAGE_UPLOAD_LIMIT:void 0,maxVideosCount:this.allowAttachVideos?this.MAX_VIDEO_UPLOAD_LIMIT:void 0,maxVideoFileSize:this.allowAttachVideos?this.MAX_VIDEO_FILE_SIZE:void 0,maxVideoDuration:this.allowAttachVideos?this.MAX_VIDEO_DURATION:void 0,maxParallelUploads:this.MAX_PARALLEL_UPLOADS,imagePreviewHeight:75,filePosterHeight:75,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:this.getMediaUploadAccept(),url:salla.url.api("upload"),onUploaded:t=>{this.editItemImages=[...this.editItemImages,t.detail];const i=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,i.image,i.video),b(this.hiddenInputs[1],this.editHiddenVideosInput,this.editItemImages),this.scheduleUploaderHeightRefresh()},onRemoved:t=>{const i=t.detail;if(!i)return;this.editItemImages=v(this.editItemImages,i);const a=w(this.editItemImages);this.setUploadCount(this.editItem.product.id,this.editItemImages.length,a.image,a.video),b(this.hiddenInputs[1],this.editHiddenVideosInput,this.editItemImages),this.scheduleUploaderHeightRefresh()},labelIdle:this.getFilepondPlaceholder(),onGalleryUpdated:t=>this.handleGalleryCountUpdate(this.editItem.product.id,t.detail)}),this.allowAttachImages&&a("input",{type:"hidden",name:"images",value:u(this.editItemImages).images.join(","),ref:t=>{t&&(this.hiddenInputs[1]=t)}}),this.allowAttachVideos&&a("input",{type:"hidden",name:"videos",value:u(this.editItemImages).videos.join(","),ref:t=>{t&&(this.editHiddenVideosInput=t)}}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,a("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},a("salla-button",{"loader-position":"center",loading:this.hasUploadsInProgress,disabled:this.hasUploadsInProgress,onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.deleteMode?a(s,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?a(s,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?a(s,{class:"s-rating-modal"},a("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:t=>this.resetData(t),isLoading:!0,width:"custom",customWidth:_,ref:t=>{t&&(this.modal=t)}},a("div",{slot:"loading"},a("div",{class:"s-rating-modal-skeleton"},a("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),a("salla-skeleton",{height:"15px",width:"60%"}),a("salla-skeleton",{height:"10px",width:"30%"}),a("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((t=>a("div",{key:t,innerHTML:o})))),a("salla-skeleton",{height:"100px",width:"100%"}),a("div",{class:"s-rating-modal-skeleton-footer"},a("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[a("div",{class:"s-rating-modal-wrapper",ref:t=>{t&&(this.body=t)}},this.isTestimonialsEnabled()?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),a("h2",{class:"s-rating-modal-title"},salla.config.get("store.name")),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.rate_the_store")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large"})),a("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):"",this.isProductsEnabled()&&this.getRateableProducts().map(((t,i)=>this.renderProductStep(t,i))),this.isShippingEnabled()&&this.order.shipping?.company?a("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},a("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?a("div",{class:"s-rating-modal-rounded-icon"},a("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):a("span",{class:"s-rating-modal-icon",innerHTML:r}),a("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),a("p",{class:"s-rating-modal-subtitle"},salla.lang.get("pages.rating.write_shipping_rate")),a("div",{class:"s-rating-modal-stars-company"},a("salla-rating-stars",{withLabel:!0,size:"large"})),a("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),a("small",{class:"s-rating-modal-validation-msg"})):"",a("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:t=>{t&&(this.thanksTab=t)}},a("span",{class:"s-rating-modal-icon",innerHTML:n}),a("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),a("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),a("time",{class:"s-rating-modal-thanks-time",ref:t=>{t&&(this.thanksTime=t)}}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?a("div",{class:"s-rating-modal-contact"},a("p",null,this.contactUsLabel),a("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&a("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:h}),salla.config.get("store.contacts.email")&&a("span",{onClick:()=>this.handleSendEmail(),innerHTML:m}))):"",a("div",{class:"s-rating-modal-footer"},a("button",{ref:t=>{t&&(this.backBtn=t)},onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?a("ul",{class:"s-rating-modal-dots"},[...Array(this.stepsCount)].map(((t,i)=>a("li",{key:i,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",a("salla-button",{"loader-position":"center",loading:this.hasUploadsInProgress,disabled:this.hasUploadsInProgress,ref:t=>{t&&(this.nextBtn=t)},onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:a("div",{class:"s-rating-modal-wrapper"},a("salla-placeholder",{alignment:"center"},this.errorMessage?a("span",{slot:"description"},this.errorMessage):null)))):void 0}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.registerTranslations(),this.syncStoreSettings()}registerTranslations(){salla.lang.addBulk({"common.uploader.drag_and_drop_files":{ar:"اسحب الملفات وأفلتها هنا",en:"Drag and drop files here"},"common.uploader.allowed_images_types":{ar:" .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة",en:"Images in jpg, jpeg, or png format are allowed."},"pages.rating.add_images":{ar:"اضافة صور",en:"Add Images"},"pages.rating.edit_images":{ar:"تعديل الصور",en:"Edit Images"},"pages.rating.edit_review":{ar:"تعديل التقييم",en:"Edit review"},"pages.rating.confirm_deletion":{ar:"تأكيد حذف التقييم",en:"Confirm review deletion"},"pages.rating.are_you_sure_you_want_to_delete_review":{ar:"هل أنت متأكد من حذف تقييمك؟",en:"Are you sure you want to delete your review?"},"pages.rating.review_updated_successfully":{ar:"تم تعديل التقييم بنجاح",en:"The review has been successfully updated."},"pages.rating.review_deleted_successfully":{ar:"تم حذف التقييم بنجاح",en:"The review has been successfully deleted."},"pages.rating.images_count":{ar:"الصور ( :current من أصل :total )",en:"Images ( :current of :total )"},"pages.rating.media_count":{ar:"الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)",en:"Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)"},"common.uploader.allowed_videos_types":{ar:"يُسمح بفيديوهات mp4 أو mov أو avi أو mkv",en:"Videos in mp4, mov, avi, or mkv format are allowed."},"pages.rating.videos_count":{ar:"الفيديو ( :current من أصل :total )",en:"Videos ( :current of :total )"},"common.uploader.allowed_media_types":{ar:"يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv",en:"Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed."},"common.uploader.max_three_images":{ar:"أضف حتى 10 صور و 5 فيديوهات كحد أقصى",en:"Add up to 10 images and 5 videos maximum."},"common.uploader.max_images_count":{ar:"أضف :count صور كحد أقصى",en:"Add up to :count images maximum."},"common.uploader.max_videos_count":{ar:"أضف :count فيديوهات كحد أقصى",en:"Add up to :count videos maximum."},"common.elements.confirm_delete":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.rating.rate_required_factors":{ar:"يرجى تقييم جميع المعايير لإتمام مراجعتك.",en:"Please rate all required factors to complete your review."},"pages.rating.overall_product_rating":{ar:"التقييم العام للمنتج",en:"Overall product rating"},"pages.rating.rate_the_following_factors":{ar:"كيف تقيِّم التالي؟",en:"How would you rate the following?"},"pages.rating.loyalty_points_for_images":{ar:"شاركنا صورة مع تقييمك للطلب واكسب :points نقطة ولاء",en:"Share a photo with your order review and earn :points loyalty points"},"pages.rating.nothing_to_rate":{ar:"لا يوجد شيء متاح للتقييم في هذا الطلب حاليًا.",en:"There is nothing available to rate for this order right now."}}),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=this.getAllowedMediaTypesLabel(),this.threeImagesMax=this.getMaxUploadHintLabel(),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.nothingToRateLabel=salla.lang.get("pages.rating.nothing_to_rate"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.requiredFactorsLabel=salla.lang.get("pages.rating.rate_required_factors"),this.rateTheFollowingLabel=salla.lang.get("pages.rating.rate_the_following_factors"),this.loyaltyPointsForImagesLabel=salla.lang.get("pages.rating.loyalty_points_for_images",{points:":points"}),this.contact_body=(t,i,a)=>salla.lang.get("pages.rating.contact_body",{store:t,id:i,customer:a})}componentDidRender(){this.scheduleWizardSetup&&this.defaultMode&&this.order&&(this.scheduleWizardSetup=!1,requestAnimationFrame((()=>this.handleWizard())))}disconnectedCallback(){this.clearThanksCountdown()}get host(){return e(this)}};x.style='/*!twlt*/.s-rating-modal-uploader{overflow:visible}.s-rating-modal-uploader.is-opened{height:auto !important;opacity:1 !important;overflow:visible;pointer-events:auto !important;margin-bottom:1rem}.s-rating-modal-uploader .s-file-upload-gallery{overflow:visible}.s-rating-modal-edit-wrapper,.s-rating-modal-wrapper{transition:height 0.15s ease}.s-rating-modal-product-details{padding-bottom:0.5rem}.s-rating-modal-comment{margin-top:0.35rem}.s-rating-modal-product{margin-bottom:1rem}.s-rating-modal-product-img{position:absolute !important;inset:0;display:block;width:100% !important;max-width:100% !important;height:100% !important;object-fit:cover}.s-rating-modal-product-title{font-size:0.95rem;font-weight:600;line-height:1.5;margin:0}.s-rating-modal-stars-product{margin-top:0.5rem}.s-rating-modal-loyalty-points-note-container{display:flex;align-items:center;gap:0.625rem;width:100%;margin-top:1.5rem;margin-bottom:0.75rem;padding:0.75rem;border-radius:0.5rem;background-color:#E6F4EA}.s-rating-modal-loyalty-points-note-icon{display:flex;flex-shrink:0;align-items:center;justify-content:center;width:1.25rem;height:1.25rem;color:#1B7F5C}.s-rating-modal-loyalty-points-note-icon svg{width:1.5rem;height:1.5rem;fill:currentColor}.s-rating-modal-loyalty-points-note-text{flex:1;margin:0;font-size:0.875rem;line-height:1.25rem;color:#1f2937}.s-rating-modal-product-details-main{display:flex;align-items:center;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-info-row{display:flex;align-items:center;gap:0.6rem;margin-bottom:0.5rem;padding-bottom:0;border-bottom:0}.s-rating-modal-product-main-review{width:100%;text-align:right}.s-rating-modal-product-rating-rows{display:grid;gap:0.45rem;margin:0.2rem 0 0.7rem}.s-rating-modal-product-rating-row{display:flex;align-items:center;justify-content:space-between;gap:0.75rem;min-height:2rem}.s-rating-modal-product-rating-row salla-rating-stars{flex-shrink:0}.s-rating-modal-product-rating-row .s-rating-stars-wrapper{align-items:center;min-height:1.75rem}.s-rating-modal-product-rating-row .s-rating-stars-label,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag{min-width:auto;min-height:1.25rem;line-height:1.25rem;font-size:0.8rem;color:#5b6470;white-space:nowrap;text-align:end;transition:opacity 0.15s ease}.s-rating-modal-product-rating-row .s-rating-stars-label--empty,.s-rating-modal-product-rating-row .s-rating-stars-label-without-tag--empty{opacity:0}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-factor-required{color:#f87171;margin-inline-start:0.2rem}.s-rating-modal-product-img-wrap{position:relative;width:5rem !important;min-width:5rem !important;max-width:5rem !important;height:3.5rem !important;flex-shrink:0 !important;overflow:hidden;border-radius:0.375rem;background:#f3f4f6}.s-rating-modal-uploader-closing{animation:s-rating-modal-uploader-close 220ms linear both}@keyframes s-rating-modal-uploader-close{0%{height:var(--s-rating-modal-uploader-from);opacity:1}9.09%{height:calc(var(--s-rating-modal-uploader-from) * 0.979);opacity:0.979}18.18%{height:calc(var(--s-rating-modal-uploader-from) * 0.913);opacity:0.913}27.27%{height:calc(var(--s-rating-modal-uploader-from) * 0.83);opacity:0.83}36.36%{height:calc(var(--s-rating-modal-uploader-from) * 0.749);opacity:0.749}45.45%{height:calc(var(--s-rating-modal-uploader-from) * 0.673);opacity:0.673}54.55%{height:calc(var(--s-rating-modal-uploader-from) * 0.577);opacity:0.577}63.64%{height:calc(var(--s-rating-modal-uploader-from) * 0.355);opacity:0.355}72.73%{height:calc(var(--s-rating-modal-uploader-from) * 0.136);opacity:0.136}81.82%{height:calc(var(--s-rating-modal-uploader-from) * 0.035);opacity:0.035}90.91%{height:calc(var(--s-rating-modal-uploader-from) * 0.005);opacity:0.005}100%{height:0;opacity:0}}.mt-0{margin-top:0px}.block{display:block}.inline{display:inline}.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}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-comments-item-like-btn{margin-top:0.5rem}.s-comments-item-like-btn .s-button-text{display:flex;flex-direction:row-reverse;gap:0.5rem}.s-comments-item-like-btn span svg{height:0.75rem;width:0.75rem}.s-rating-modal-wrapper{margin-bottom:1.5rem;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-edit-wrapper{margin-top:0.625rem}.s-rating-modal-footer{position:relative;display:flex;align-items:center;justify-content:space-between}.s-rating-modal-footer salla-button button{padding-left:1rem !important;padding-right:1rem !important;font-size:0.75rem !important}.s-rating-modal-btn{height:2.5rem;padding-left:1rem;padding-right:1rem;font-size:0.875rem;line-height:1.25rem;font-weight:700;color:var(--color-primary);transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:300ms}.s-rating-modal-btn:hover{color:var(--color-primary-dark)}.s-rating-modal-dots{display:flex;flex-shrink:0;flex-grow:1;justify-content:center}.s-rating-modal-dots>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.375rem * var(--tw-space-x-reverse));margin-left:calc(0.375rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-dots{text-align:center}.s-rating-modal-dots:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-step-dot{height:0.625rem;width:0.625rem;border-radius:9999px;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:300ms}.s-rating-modal-step{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-active{--tw-translate-x:0px;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));opacity:1}.s-rating-modal-unactive{--tw-translate-x:0.75rem;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));opacity:0}.s-rating-modal-hidden{display:none !important}.s-rating-modal-unvisiable{pointer-events:none;opacity:0}.s-rating-modal-step-wrap{position:relative;display:flex;flex-direction:column;align-items:center;padding-bottom:1rem}.s-rating-modal-product-details{position:relative;display:flex;flex:1 1 0%;flex-direction:column;padding-bottom:1rem}.s-rating-modal-product-details-main{display:flex;align-items:flex-start;justify-content:space-between}.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0.375rem;flex-direction:column;align-items:center}@media (min-width: 640px){.s-rating-modal-product-details-main .s-rating-stars-wrapper{margin-bottom:0px;flex-direction:row;gap:0px}}.s-rating-modal-rounded-icon{position:relative;margin-bottom:0.25rem;display:flex;height:6rem;width:6rem;align-items:center;justify-content:center;overflow:hidden;border-radius:9999px;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.s-rating-modal-title{margin-bottom:0.25rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.s-rating-modal-subtitle{margin-bottom:0.25rem;padding-left:0.5rem;padding-right:0.5rem;text-align:center;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-rating-modal-store-logo{width:4rem;object-fit:contain}.s-rating-modal-shipping-logo{height:100%;width:100%;object-fit:contain}.s-rating-modal-shipping-icon{font-size:3rem;line-height:1;color:var(--color-primary)}.s-rating-modal-comment{margin-bottom:0.5rem;height:5rem !important;width:100%;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:0.75rem;font-size:0.875rem;line-height:1.25rem;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-rating-modal-comment:focus{border-color:var(--color-primary)}.s-rating-modal-comment:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.s-rating-modal-validation-msg{margin-top:-3px;line-height:1rem;--tw-text-opacity:1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.s-rating-modal-product{margin-bottom:1.5rem}.s-rating-modal-product:last-child{margin-bottom:0px}.s-rating-modal-product .rating-outer-form{display:flex}.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}@media (min-width: 640px){.s-rating-modal-product .rating-outer-form>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.25rem * var(--tw-space-x-reverse));margin-left:calc(1.25rem * calc(1 - var(--tw-space-x-reverse)))}}.s-rating-modal-product .rating-outer-form:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-product-img-wrap{height:3.5rem;width:auto;overflow:hidden;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}@media (min-width: 640px){.s-rating-modal-product-img-wrap{width:5rem}}.s-rating-modal-product-img{position:relative;height:100%;width:100%;object-fit:cover;font-size:0px}.s-rating-modal-product-img::before{position:absolute;top:0px;left:0px;height:100%;width:100%;--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1));--tw-content:\'\';content:var(--tw-content)}.s-rating-modal-product-title{margin-bottom:0.375rem;font-size:0.875rem;font-weight:700;line-height:1.25rem}.s-rating-modal-thanks{padding-left:2rem;padding-right:2rem;text-align:center;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:500ms}.s-rating-modal-icon{display:inline-flex;height:5rem;width:5rem;align-items:center;justify-content:center;border-radius:9999px;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));color:var(--color-primary)}.s-rating-modal-icon svg{height:1.75rem;width:1.75rem;fill:var(--color-primary)}.s-rating-modal-thanks-title{margin-top:1rem;font-weight:700}.s-rating-modal-thanks-msg{margin-bottom:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-thanks-btn{height:2.5rem;flex:none;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}.s-rating-modal-thanks-btn:hover{opacity:0.8}.s-rating-modal-thanks-btn{border-width:1px;border-color:var(--color-primary);background-color:var(--color-primary);color:var(--color-primary-reverse)}.s-rating-modal-thanks-time{margin-top:0.75rem;display:block;height:1.5rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-rating-modal-product-factors-card{margin-bottom:1rem;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1));padding:1rem}.s-rating-modal-product-factors-heading{margin-bottom:0.75rem;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-rating-modal-stars-company{margin-bottom:1.25rem}.s-rating-modal-stars-company .s-rating-stars-wrapper{flex-direction:column;align-items:center;justify-content:center;gap:0.5rem}.s-rating-modal-stars-product .s-rating-stars-wrapper{flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-upload-count{font-size:0.875rem;line-height:1.25rem;font-weight:500}.s-rating-modal-bg-gray{--tw-bg-opacity:1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.s-rating-modal-bg-primary{background-color:var(--color-primary)}unicode{unicode-bidi:plaintext}.s-rating-modal-wrap .s-modal-body{position:relative !important}.s-rating-modal-skeleton{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-skeleton salla-skeleton:nth-child(1){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(2){margin-bottom:0.75rem}.s-rating-modal-skeleton salla-skeleton:nth-child(3){margin-bottom:1.25rem}.s-rating-modal-skeleton salla-skeleton:nth-child(4){margin-bottom:2rem}.s-rating-modal-skeleton-footer{margin-top:1.5rem;display:flex;width:100%;justify-content:flex-end}.s-rating-modal-skeleton-footer salla-skeleton{margin-bottom:0px !important}.s-rating-modal-skeleton-stars{margin-bottom:0.75rem;display:flex;align-items:center}.s-rating-modal-skeleton-stars>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.5rem * var(--tw-space-x-reverse));margin-left:calc(0.5rem * calc(1 - var(--tw-space-x-reverse)))}.s-rating-modal-skeleton-stars:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-rating-modal-skeleton-stars div svg{width:25px;fill:currentColor;--tw-text-opacity:1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.s-rating-modal-uploader{height:0px;opacity:0;transition-property:all;transition-duration:100ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.s-rating-modal-uploader.is-opened{margin-bottom:1.5rem;overflow:visible}.s-rating-modal-uploader.is-closed{pointer-events:none;z-index:0}.s-rating-modal-uploader .filepond--drop-label{--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.s-rating-modal-uploader .filepond--file-status .filepond--file-status-main{font-size:11px}.s-rating-modal-uploader .filepond--file-info-main{font-size:11px}.s-rating-modal-uploader li[data-filepond-item-state=\'load-invalid\'] .filepond--file-info{display:none}.s-rating-modal-filepond-placeholder-text{font-size:0.75rem !important;line-height:1rem !important}.s-rating-modal-filepond-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center}.s-rating-modal-filepond-placeholder-icon{margin-bottom:0.25rem}.s-rating-modal-filepond-placeholder-icon svg{height:1.5rem;width:1.5rem;fill:#7c8082}.s-rating-modal-contact{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between;border-radius:0.375rem;--tw-bg-opacity:1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1));padding:0.5rem}.s-rating-modal-contact p{font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-contact-icons{display:flex;align-items:center;gap:0.5rem}.s-rating-modal-contact-icons span{display:flex;cursor:pointer;align-items:center;justify-content:center;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(255 255 255 / var(--tw-bg-opacity, 1));padding:0.375rem}.s-rating-modal-contact-icons span svg{height:1rem;width:1rem;fill:var(--color-primary)}.s-rating-modal-footer-end{justify-content:flex-end}.s-rating-modal-delete-wrapper{text-align:center}.s-rating-modal-delete-wrapper h3{margin-top:1.25rem;font-size:1.125rem;line-height:1.75rem;--tw-text-opacity:1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-wrapper p{margin-top:1.25rem;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-rating-modal-delete-actions{margin-top:1.25rem;display:flex;align-items:center;gap:0.625rem}.s-rating-modal-delete-actions salla-button{width:100%}.s-rating-modal-delete-actions salla-button button{width:100%}';export{x as salla_rating_modal_v2}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as r}from"./p-DmGAR42j.js";import{s as t}from"./p-BQHBj1u_.js";import{m as a,a as i}from"./p-DfHdQUMm.js";const o=class{constructor(r){e(this,r),this.logoFailed=!1}resetLogo(){this.logoFailed=!1}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded()}charged(e){return null!=e&&/[1-9١-٩۱-۹]/.test(String(e))}row(e,t,o=!1,s=""){if(null==t||""===t)return null;const n=Number(t);return r("div",{class:{"s-order-payment-row":!0,"s-order-payment-total":o}},r("dt",null,e),Number.isFinite(n)?r("dd",{innerHTML:s+a(n,this.currency)}):r("dd",{innerHTML:i(String(t))}))}get discountList(){try{const e="string"==typeof this.discounts?JSON.parse(this.discounts):this.discounts;return Array.isArray(e)?e.map((e=>{const r=Math.abs(Number(e?.amount??e?.discount)),t="string"==typeof e?.discount?e.discount:"",a=Number.isFinite(r)&&r>0&&(!t||this.currency);return{name:e?.name,amount:a?r:t}})).filter((e=>"string"==typeof e.amount||e.amount>0)):[]}catch{return[]}}render(){const e=t(this.invoiceUrl);return r("section",{key:"315ef59766e984af72300af056bf8a6b920abbee",class:"s-order-payment-wrapper"},r("dl",{key:"ef6dec3310faaaaeafcfe3eb8ca1d0567949a005",class:"s-order-payment-list"},r("div",{key:"dd63e14441f534433d2e9b409015fcefe48fe5d3",class:"s-order-payment-row"},r("dt",{key:"a799bda3655a1efb1abb37edd24a1951083e8f1f"},salla.lang.get("pages.cart.payment_way")),r("dd",{key:"6bf67863696911d79ada40086eb9a8b8f1001145"},this.paymentLogo&&!this.logoFailed?r("span",{class:"s-order-payment-logo"},r("img",{src:this.paymentLogo,alt:this.paymentMethod||"",loading:"lazy",onError:()=>{this.logoFailed=!0}})):this.paymentMethod)),this.row(salla.lang.get("pages.thank_you.sub_total"),this.subTotal),this.discountList.map((e=>this.row(e.name,e.amount,!1,"string"==typeof e.amount?"":"-"))),this.charged(this.taxAmount)?this.row(salla.lang.get("pages.cart.tax"),this.taxAmount):null,this.charged(this.shippingCost)?this.row(salla.lang.get("pages.orders.shipping_cost"),this.shippingCost):null,this.charged(this.codCost)?this.row(salla.lang.get("pages.cart.cash_on_delivery"),this.codCost):null,this.row(salla.lang.get("pages.orders.final_total"),this.total,!0)),e?r("a",{href:e,target:"_blank",rel:"noopener","data-testid":"store-thankyou-payment-view-invoice",class:"s-order-payment-invoice"},r("span",{"aria-hidden":"true",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>receipt</title>\n<path d="M21.333 18.667h-10.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h10.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM21.333 10.667h-10.667c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h10.667c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333zM27.263 1.473c-0.453-0.225-0.993-0.176-1.396 0.127l-2.66 1.995-2.739-2.568c-0.513-0.48-1.311-0.48-1.824 0l-2.644 2.479-2.643-2.479c-0.513-0.48-1.311-0.48-1.824 0l-2.74 2.568-2.66-1.995c-0.407-0.303-0.945-0.352-1.396-0.127-0.452 0.227-0.737 0.688-0.737 1.193v26.667c0 0.505 0.285 0.967 0.737 1.193 0.451 0.223 0.992 0.176 1.396-0.127l2.66-1.995 2.739 2.568c0.513 0.481 1.311 0.481 1.824 0l2.644-2.479 2.643 2.477c0.256 0.241 0.584 0.361 0.912 0.361s0.656-0.12 0.912-0.361l2.739-2.568 2.661 1.996c0.404 0.304 0.944 0.351 1.396 0.127 0.452-0.227 0.737-0.688 0.737-1.193v-26.667c0-0.505-0.285-0.967-0.737-1.193zM25.333 26.667l-1.421-1.067c-0.519-0.388-1.239-0.352-1.712 0.093l-2.644 2.477-2.643-2.477c-0.257-0.24-0.585-0.36-0.913-0.36s-0.656 0.12-0.912 0.361l-2.643 2.477-2.644-2.477c-0.473-0.445-1.195-0.481-1.712-0.093l-1.423 1.065v-21.333l1.421 1.067c0.517 0.388 1.237 0.348 1.712-0.093l2.644-2.479 2.643 2.479c0.513 0.48 1.311 0.48 1.824 0l2.643-2.479 2.644 2.479c0.473 0.443 1.195 0.483 1.712 0.093l1.424-1.067z"></path>\n</svg>\n'}),salla.lang.get("pages.thank_you.view_invoice")):null)}static get watchers(){return{paymentLogo:["resetLogo"]}}};o.style='/*!twlt*/:host{display:block}.-my-1{margin-top:-0.25rem;margin-bottom:-0.25rem}.-my-1\\.5{margin-top:-0.375rem;margin-bottom:-0.375rem}.hidden{display:none}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-order-payment-wrapper{display:flex;width:100%;flex-direction:column;align-items:flex-end;gap:1rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface,#fff);padding:1rem}@media (min-width: 640px){.s-order-payment-wrapper{padding:1.5rem}}.s-order-payment-list{margin:0px;display:flex;width:100%;flex-direction:column;gap:0.75rem}.s-order-payment-row{display:flex;width:100%;align-items:center;gap:1rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#666)}.s-order-payment-row dt{flex:1 1 0%;text-align:start}.s-order-payment-row dd{margin:0px;display:flex;align-items:center;gap:0.25rem}.s-order-payment-logo{margin-top:-0.375rem;margin-bottom:-0.375rem;display:inline-flex;height:1.75rem;width:3.5rem;flex-shrink:0}.s-order-payment-logo img{height:100%;width:100%;object-fit:contain}.s-order-payment-logo img:where([dir="ltr"],[dir="ltr"] *){object-position:right}.s-order-payment-logo img:where([dir="rtl"],[dir="rtl"] *){object-position:left}.s-order-payment-total{font-size:1rem;font-weight:700;line-height:1.5rem;color:var(--color-text-primary,#333)}.s-order-payment-invoice{display:flex;min-height:3rem;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);font-size:1rem;line-height:1.5rem;font-weight:500;color:var(--color-text-primary,#333);text-decoration-line:none}.s-order-payment-invoice svg{height:1.25rem;width:1.25rem;fill:currentColor}';export{o as salla_order_payment}
4
+ import{r as e,h as r}from"./p-DgUQRYr2.js";import{s as t}from"./p-BQHBj1u_.js";import{m as a,a as i}from"./p-DfHdQUMm.js";const o=class{constructor(r){e(this,r),this.logoFailed=!1}resetLogo(){this.logoFailed=!1}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded()}charged(e){return null!=e&&/[1-9١-٩۱-۹]/.test(String(e))}row(e,t,o=!1,s=""){if(null==t||""===t)return null;const n=Number(t);return r("div",{class:{"s-order-payment-row":!0,"s-order-payment-total":o}},r("dt",null,e),Number.isFinite(n)?r("dd",{innerHTML:s+a(n,this.currency)}):r("dd",{innerHTML:i(String(t))}))}get discountList(){try{const e="string"==typeof this.discounts?JSON.parse(this.discounts):this.discounts;return Array.isArray(e)?e.map((e=>{const r=Math.abs(Number(e?.amount??e?.discount)),t="string"==typeof e?.discount?e.discount:"",a=Number.isFinite(r)&&r>0&&(!t||this.currency);return{name:e?.name,amount:a?r:t}})).filter((e=>"string"==typeof e.amount||e.amount>0)):[]}catch{return[]}}render(){const e=t(this.invoiceUrl);return r("section",{key:"315ef59766e984af72300af056bf8a6b920abbee",class:"s-order-payment-wrapper"},r("dl",{key:"ef6dec3310faaaaeafcfe3eb8ca1d0567949a005",class:"s-order-payment-list"},r("div",{key:"dd63e14441f534433d2e9b409015fcefe48fe5d3",class:"s-order-payment-row"},r("dt",{key:"a799bda3655a1efb1abb37edd24a1951083e8f1f"},salla.lang.get("pages.cart.payment_way")),r("dd",{key:"6bf67863696911d79ada40086eb9a8b8f1001145"},this.paymentLogo&&!this.logoFailed?r("span",{class:"s-order-payment-logo"},r("img",{src:this.paymentLogo,alt:this.paymentMethod||"",loading:"lazy",onError:()=>{this.logoFailed=!0}})):this.paymentMethod)),this.row(salla.lang.get("pages.thank_you.sub_total"),this.subTotal),this.discountList.map((e=>this.row(e.name,e.amount,!1,"string"==typeof e.amount?"":"-"))),this.charged(this.taxAmount)?this.row(salla.lang.get("pages.cart.tax"),this.taxAmount):null,this.charged(this.shippingCost)?this.row(salla.lang.get("pages.orders.shipping_cost"),this.shippingCost):null,this.charged(this.codCost)?this.row(salla.lang.get("pages.cart.cash_on_delivery"),this.codCost):null,this.row(salla.lang.get("pages.orders.final_total"),this.total,!0)),e?r("a",{href:e,target:"_blank",rel:"noopener","data-testid":"store-thankyou-payment-view-invoice",class:"s-order-payment-invoice"},r("span",{"aria-hidden":"true",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>receipt</title>\n<path d="M21.333 18.667h-10.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h10.667c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM21.333 10.667h-10.667c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333h10.667c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333zM27.263 1.473c-0.453-0.225-0.993-0.176-1.396 0.127l-2.66 1.995-2.739-2.568c-0.513-0.48-1.311-0.48-1.824 0l-2.644 2.479-2.643-2.479c-0.513-0.48-1.311-0.48-1.824 0l-2.74 2.568-2.66-1.995c-0.407-0.303-0.945-0.352-1.396-0.127-0.452 0.227-0.737 0.688-0.737 1.193v26.667c0 0.505 0.285 0.967 0.737 1.193 0.451 0.223 0.992 0.176 1.396-0.127l2.66-1.995 2.739 2.568c0.513 0.481 1.311 0.481 1.824 0l2.644-2.479 2.643 2.477c0.256 0.241 0.584 0.361 0.912 0.361s0.656-0.12 0.912-0.361l2.739-2.568 2.661 1.996c0.404 0.304 0.944 0.351 1.396 0.127 0.452-0.227 0.737-0.688 0.737-1.193v-26.667c0-0.505-0.285-0.967-0.737-1.193zM25.333 26.667l-1.421-1.067c-0.519-0.388-1.239-0.352-1.712 0.093l-2.644 2.477-2.643-2.477c-0.257-0.24-0.585-0.36-0.913-0.36s-0.656 0.12-0.912 0.361l-2.643 2.477-2.644-2.477c-0.473-0.445-1.195-0.481-1.712-0.093l-1.423 1.065v-21.333l1.421 1.067c0.517 0.388 1.237 0.348 1.712-0.093l2.644-2.479 2.643 2.479c0.513 0.48 1.311 0.48 1.824 0l2.643-2.479 2.644 2.479c0.473 0.443 1.195 0.483 1.712 0.093l1.424-1.067z"></path>\n</svg>\n'}),salla.lang.get("pages.thank_you.view_invoice")):null)}static get watchers(){return{paymentLogo:["resetLogo"]}}};o.style='/*!twlt*/:host{display:block}.-my-1{margin-top:-0.25rem;margin-bottom:-0.25rem}.-my-1\\.5{margin-top:-0.375rem;margin-bottom:-0.375rem}.hidden{display:none}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-order-payment-wrapper{display:flex;width:100%;flex-direction:column;align-items:flex-end;gap:1rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border-light,#f4f4f4);background-color:var(--color-surface,#fff);padding:1rem}@media (min-width: 640px){.s-order-payment-wrapper{padding:1.5rem}}.s-order-payment-list{margin:0px;display:flex;width:100%;flex-direction:column;gap:0.75rem}.s-order-payment-row{display:flex;width:100%;align-items:center;gap:1rem;font-size:0.875rem;line-height:1.25rem;color:var(--color-text-secondary,#666)}.s-order-payment-row dt{flex:1 1 0%;text-align:start}.s-order-payment-row dd{margin:0px;display:flex;align-items:center;gap:0.25rem}.s-order-payment-logo{margin-top:-0.375rem;margin-bottom:-0.375rem;display:inline-flex;height:1.75rem;width:3.5rem;flex-shrink:0}.s-order-payment-logo img{height:100%;width:100%;object-fit:contain}.s-order-payment-logo img:where([dir="ltr"],[dir="ltr"] *){object-position:right}.s-order-payment-logo img:where([dir="rtl"],[dir="rtl"] *){object-position:left}.s-order-payment-total{font-size:1rem;font-weight:700;line-height:1.5rem;color:var(--color-text-primary,#333)}.s-order-payment-invoice{display:flex;min-height:3rem;width:100%;align-items:center;justify-content:center;gap:0.5rem;border-radius:0.5rem;border-width:1px;border-color:var(--color-border,#eee);font-size:1rem;line-height:1.5rem;font-weight:500;color:var(--color-text-primary,#333);text-decoration-line:none}.s-order-payment-invoice svg{height:1.25rem;width:1.25rem;fill:currentColor}';export{o as salla_order_payment}