@salla.sa/twilight-components 2.14.539 → 2.14.541

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 (401) hide show
  1. package/dist/cjs/{filepond-CIpOpiw6.js → filepond-CNdvfaMJ.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-CPV_SZrj.js → filepond-plugin-file-poster-Di_D3w89.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-C_XGylG1.js → filepond-plugin-file-validate-size-BiRa98qd.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-CmVS48lk.js → filepond-plugin-file-validate-type-Bolv-kyJ.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-KfqhH5F9.js → filepond-plugin-image-edit-AN6huMV9.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BfRIDxO-.js → filepond-plugin-image-exif-orientation-Bwa8QtGo.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-DlvO4sHZ.js → filepond-plugin-image-preview-CaVYLAvG.js} +1 -1
  8. package/dist/cjs/helpers-ClOJIAG8.js +89 -0
  9. package/dist/cjs/{index-CMDyFi6Q.js → index-DX2EKTCE.js} +18 -14
  10. package/dist/cjs/{intlTelInput-BK34b4sR.js → intlTelInput-DnwdGAiP.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/{salla-booking-field_7.cjs.entry.js → salla-attachment-view_9.cjs.entry.js} +1003 -40
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +2 -2
  28. package/dist/cjs/salla-comment-form_8.cjs.entry.js +14 -5
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +303 -26
  32. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +420 -84
  85. package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -5
  86. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +4 -83
  87. package/dist/cjs/salla-review-order-item.cjs.entry.js +125 -0
  88. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  104. package/dist/cjs/twilight.cjs.js +2 -2
  105. package/dist/cjs/upload-limits-C3RarAPN.js +136 -0
  106. package/dist/cjs/{vanilla-picker-DYTpjTDj.js → vanilla-picker-BUFYPi-_.js} +1 -1
  107. package/dist/collection/collection-manifest.json +16 -11
  108. package/dist/collection/components/salla-attachment-view/salla-attachment-view.css +164 -0
  109. package/dist/collection/components/salla-attachment-view/salla-attachment-view.js +250 -0
  110. package/dist/collection/components/salla-attachments/salla-attachments.css +69 -0
  111. package/dist/collection/components/salla-attachments/salla-attachments.js +375 -0
  112. package/dist/collection/components/salla-comments/salla-comment-item.js +13 -3
  113. package/dist/collection/components/salla-comments/salla-comments.css +7 -0
  114. package/dist/collection/components/salla-cookies-bar/salla-cookies-bar.css +206 -56
  115. package/dist/collection/components/salla-cookies-bar/salla-cookies-bar.js +322 -30
  116. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1 -1
  117. package/dist/collection/components/salla-file-upload/salla-file-upload.css +149 -0
  118. package/dist/collection/components/salla-file-upload/salla-file-upload.js +784 -42
  119. package/dist/collection/components/salla-file-upload/upload-limits.js +127 -0
  120. package/dist/collection/components/salla-products-slider/salla-products-slider.js +1 -1
  121. package/dist/collection/components/salla-rating-modal/rating-modal-media.js +85 -0
  122. package/dist/collection/components/salla-rating-modal/salla-rating-modal-v2.js +348 -85
  123. package/dist/collection/components/salla-rating-modal/salla-rating-modal.css +17 -7
  124. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +1 -3
  125. package/dist/collection/components/salla-review-factors-tags/helpers.js +8 -7
  126. package/dist/collection/components/salla-review-order-item/interfaces.js +1 -0
  127. package/dist/collection/components/salla-review-order-item/salla-review-order-item.js +154 -0
  128. package/dist/components/index.js +2 -2
  129. package/dist/components/salla-add-product-button2.js +40 -28
  130. package/dist/components/salla-attachment-view.d.ts +11 -0
  131. package/dist/components/salla-attachment-view.js +9 -0
  132. package/dist/components/salla-attachment-view2.js +323 -0
  133. package/dist/components/salla-attachments.d.ts +11 -0
  134. package/dist/components/salla-attachments.js +9 -0
  135. package/dist/components/salla-attachments2.js +232 -0
  136. package/dist/components/salla-basket-gap.js +46 -34
  137. package/dist/components/salla-breadcrumb.js +1 -1
  138. package/dist/components/salla-comment-factors2.js +1 -1
  139. package/dist/components/salla-comment-item2.js +26 -4
  140. package/dist/components/salla-comments.js +14 -2
  141. package/dist/components/salla-cookies-bar.js +319 -27
  142. package/dist/components/salla-custom-fields.js +28 -4
  143. package/dist/components/salla-file-upload2.js +703 -31
  144. package/dist/components/salla-gifting.js +7 -1
  145. package/dist/components/salla-loyalty-exchange-product-card2.js +46 -34
  146. package/dist/components/salla-loyalty-panel.js +8 -2
  147. package/dist/components/salla-loyalty-program.js +8 -2
  148. package/dist/components/salla-multiple-bundle-product-cart2.js +40 -28
  149. package/dist/components/salla-multiple-bundle-product-details2.js +12 -6
  150. package/dist/components/salla-multiple-bundle-product-options-modal2.js +7 -1
  151. package/dist/components/salla-multiple-bundle-product-slider2.js +1 -1
  152. package/dist/components/salla-multiple-bundle-product.js +12 -6
  153. package/dist/components/salla-offer-modal.js +8 -2
  154. package/dist/components/salla-order-edit-item2.js +36 -24
  155. package/dist/components/salla-order-edit.js +42 -30
  156. package/dist/components/salla-order-options-modal2.js +34 -22
  157. package/dist/components/salla-product-card2.js +44 -32
  158. package/dist/components/salla-product-options2.js +32 -20
  159. package/dist/components/salla-products-slider2.js +8 -2
  160. package/dist/components/salla-quick-buy2.js +36 -24
  161. package/dist/components/salla-rating-modal-v22.js +449 -97
  162. package/dist/components/salla-rating-modal.js +30 -20
  163. package/dist/components/salla-review-factors-tags2.js +9 -8
  164. package/dist/components/salla-review-order-item.d.ts +11 -0
  165. package/dist/components/salla-review-order-item.js +196 -0
  166. package/dist/components/salla-reward-details2.js +8 -2
  167. package/dist/components/salla-slider2.js +1 -1
  168. package/dist/esm/{filepond-DMUE9Fyj.js → filepond-CKsbRWmS.js} +1 -1
  169. package/dist/esm/{filepond-plugin-file-poster-DBZQTm7s.js → filepond-plugin-file-poster-B_gYCESq.js} +1 -1
  170. package/dist/esm/{filepond-plugin-file-validate-size-CrKxdsNW.js → filepond-plugin-file-validate-size-Bep6fNi3.js} +1 -1
  171. package/dist/esm/{filepond-plugin-file-validate-type-DvEJrucY.js → filepond-plugin-file-validate-type-r3uRmGIr.js} +1 -1
  172. package/dist/esm/{filepond-plugin-image-edit-C6ptCg9o.js → filepond-plugin-image-edit-BJcOlOFL.js} +1 -1
  173. package/dist/esm/{filepond-plugin-image-exif-orientation-IcgeTieF.js → filepond-plugin-image-exif-orientation-DJoDaRwQ.js} +1 -1
  174. package/dist/esm/{filepond-plugin-image-preview-CDMh74os.js → filepond-plugin-image-preview-BsuTLPS0.js} +1 -1
  175. package/dist/esm/helpers-DqXpn47Z.js +85 -0
  176. package/dist/esm/{index-CjQzkU95.js → index-BVqCTDsV.js} +18 -14
  177. package/dist/esm/{intlTelInput-Dsx2z7pR.js → intlTelInput-CD2FA0nI.js} +1 -1
  178. package/dist/esm/loader.js +3 -3
  179. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  180. package/dist/esm/salla-accordion_6.entry.js +1 -1
  181. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  182. package/dist/esm/salla-advertisement.entry.js +1 -1
  183. package/dist/esm/salla-alert_2.entry.js +1 -1
  184. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  185. package/dist/esm/salla-apps-icons.entry.js +1 -1
  186. package/dist/esm/{salla-booking-field_7.entry.js → salla-attachment-view_9.entry.js} +1002 -41
  187. package/dist/esm/salla-badge.entry.js +1 -1
  188. package/dist/esm/salla-basket-gap.entry.js +1 -1
  189. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  190. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  191. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  192. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  193. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  194. package/dist/esm/salla-comment-factors.entry.js +2 -2
  195. package/dist/esm/salla-comment-form_8.entry.js +14 -5
  196. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  197. package/dist/esm/salla-contacts.entry.js +1 -1
  198. package/dist/esm/salla-cookies-bar.entry.js +303 -26
  199. package/dist/esm/salla-count-down.entry.js +1 -1
  200. package/dist/esm/salla-custom-fields.entry.js +1 -1
  201. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  202. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  203. package/dist/esm/salla-filters-widget.entry.js +1 -1
  204. package/dist/esm/salla-filters.entry.js +1 -1
  205. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  206. package/dist/esm/salla-gifting.entry.js +1 -1
  207. package/dist/esm/salla-hook.entry.js +1 -1
  208. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  209. package/dist/esm/salla-installment.entry.js +1 -1
  210. package/dist/esm/salla-list-tile.entry.js +1 -1
  211. package/dist/esm/salla-localization-modal.entry.js +1 -1
  212. package/dist/esm/salla-login-modal.entry.js +1 -1
  213. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  214. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  215. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  216. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  217. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  218. package/dist/esm/salla-loyalty.entry.js +1 -1
  219. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  220. package/dist/esm/salla-map_2.entry.js +1 -1
  221. package/dist/esm/salla-menu.entry.js +1 -1
  222. package/dist/esm/salla-metadata.entry.js +1 -1
  223. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  224. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  225. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  226. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  227. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  228. package/dist/esm/salla-offer-modal.entry.js +1 -1
  229. package/dist/esm/salla-offer.entry.js +1 -1
  230. package/dist/esm/salla-order-branch.entry.js +1 -1
  231. package/dist/esm/salla-order-cancel.entry.js +1 -1
  232. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  233. package/dist/esm/salla-order-details-options.entry.js +1 -1
  234. package/dist/esm/salla-order-details.entry.js +1 -1
  235. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  236. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  237. package/dist/esm/salla-order-edit.entry.js +1 -1
  238. package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
  239. package/dist/esm/salla-order-shipments.entry.js +1 -1
  240. package/dist/esm/salla-order-summary.entry.js +1 -1
  241. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  242. package/dist/esm/salla-orders.entry.js +1 -1
  243. package/dist/esm/salla-payments.entry.js +1 -1
  244. package/dist/esm/salla-placeholder.entry.js +1 -1
  245. package/dist/esm/salla-price-range.entry.js +1 -1
  246. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  247. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  248. package/dist/esm/salla-products-list.entry.js +1 -1
  249. package/dist/esm/salla-products-slider.entry.js +1 -1
  250. package/dist/esm/salla-quick-order.entry.js +1 -1
  251. package/dist/esm/salla-rating-modal-v2.entry.js +420 -84
  252. package/dist/esm/salla-rating-modal.entry.js +3 -5
  253. package/dist/esm/salla-review-factors-tags.entry.js +2 -81
  254. package/dist/esm/salla-review-order-item.entry.js +123 -0
  255. package/dist/esm/salla-scopes.entry.js +1 -1
  256. package/dist/esm/salla-search.entry.js +1 -1
  257. package/dist/esm/salla-skeleton.entry.js +1 -1
  258. package/dist/esm/salla-slider.entry.js +1 -1
  259. package/dist/esm/salla-social-share.entry.js +1 -1
  260. package/dist/esm/salla-social.entry.js +1 -1
  261. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  262. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  263. package/dist/esm/salla-tooltip.entry.js +1 -1
  264. package/dist/esm/salla-trust-badges.entry.js +1 -1
  265. package/dist/esm/salla-user-menu.entry.js +1 -1
  266. package/dist/esm/salla-user-profile.entry.js +1 -1
  267. package/dist/esm/salla-user-settings.entry.js +1 -1
  268. package/dist/esm/salla-verify.entry.js +1 -1
  269. package/dist/esm/salla-wallet.entry.js +1 -1
  270. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  271. package/dist/esm/twilight.js +3 -3
  272. package/dist/esm/upload-limits-DrXX8XG8.js +121 -0
  273. package/dist/esm/{vanilla-picker-oYjMgYry.js → vanilla-picker-Ba_za9Iy.js} +1 -1
  274. package/dist/twilight/{p-49e6fe86.entry.js → p-003499a8.entry.js} +1 -1
  275. package/dist/twilight/{p-58184ae2.entry.js → p-0974f6c6.entry.js} +1 -1
  276. package/dist/twilight/{p-3052178c.entry.js → p-0a9093f1.entry.js} +1 -1
  277. package/dist/twilight/{p-cb179aba.entry.js → p-0ce2c41f.entry.js} +1 -1
  278. package/dist/twilight/{p-bbe79568.entry.js → p-0ea8365b.entry.js} +1 -1
  279. package/dist/twilight/p-1174e53e.entry.js +4 -0
  280. package/dist/twilight/{p-fe7990b7.entry.js → p-11ef8b82.entry.js} +1 -1
  281. package/dist/twilight/{p-dd5800dd.entry.js → p-13244c52.entry.js} +1 -1
  282. package/dist/twilight/{p-187a502c.entry.js → p-14689252.entry.js} +1 -1
  283. package/dist/twilight/{p-48db7b95.entry.js → p-17940d8a.entry.js} +1 -1
  284. package/dist/twilight/{p-a802826b.entry.js → p-1974f6da.entry.js} +1 -1
  285. package/dist/twilight/{p-250d7ab2.entry.js → p-1a191989.entry.js} +1 -1
  286. package/dist/twilight/{p-1d2804ac.entry.js → p-1ec6e0fe.entry.js} +1 -1
  287. package/dist/twilight/{p-5bbf829e.entry.js → p-1fcebaad.entry.js} +1 -1
  288. package/dist/twilight/{p-51a860bc.entry.js → p-2b0cf190.entry.js} +1 -1
  289. package/dist/twilight/{p-68c8772a.entry.js → p-333ea76b.entry.js} +1 -1
  290. package/dist/twilight/{p-8ef3693b.entry.js → p-337cc9f6.entry.js} +1 -1
  291. package/dist/twilight/{p-f7298462.entry.js → p-34d5c7bf.entry.js} +1 -1
  292. package/dist/twilight/{p-b1812d5c.entry.js → p-36abc50f.entry.js} +1 -1
  293. package/dist/twilight/{p-a1494e64.entry.js → p-37d9f762.entry.js} +1 -1
  294. package/dist/twilight/{p-5e9fb02d.entry.js → p-3961522a.entry.js} +1 -1
  295. package/dist/twilight/{p-1754903f.entry.js → p-39d9e02f.entry.js} +1 -1
  296. package/dist/twilight/{p-152c657e.entry.js → p-3a4bb8de.entry.js} +1 -1
  297. package/dist/twilight/{p-7c74dc6e.entry.js → p-409f95a8.entry.js} +1 -1
  298. package/dist/twilight/{p-3bc64439.entry.js → p-42952fac.entry.js} +1 -1
  299. package/dist/twilight/{p-0a1271e1.entry.js → p-436dfe93.entry.js} +1 -1
  300. package/dist/twilight/{p-44cfb2c2.entry.js → p-50c90e0a.entry.js} +1 -1
  301. package/dist/twilight/{p-31c36417.entry.js → p-5115117b.entry.js} +1 -1
  302. package/dist/twilight/{p-1fb46b43.entry.js → p-56647774.entry.js} +1 -1
  303. package/dist/twilight/{p-e020f1c3.entry.js → p-598cadf4.entry.js} +1 -1
  304. package/dist/twilight/{p-331679d8.entry.js → p-635265d1.entry.js} +1 -1
  305. package/dist/twilight/{p-1470e96a.entry.js → p-659e2280.entry.js} +1 -1
  306. package/dist/twilight/p-6a3487de.entry.js +4 -0
  307. package/dist/twilight/{p-1c31cec0.entry.js → p-6d07d195.entry.js} +1 -1
  308. package/dist/twilight/{p-91b4a1a0.entry.js → p-6ee096e8.entry.js} +1 -1
  309. package/dist/twilight/{p-37413a02.entry.js → p-723aeda4.entry.js} +1 -1
  310. package/dist/twilight/{p-ae536a61.entry.js → p-743b79ae.entry.js} +1 -1
  311. package/dist/twilight/{p-b193c991.entry.js → p-75e692d1.entry.js} +1 -1
  312. package/dist/twilight/{p-9c7fcbb0.entry.js → p-79444897.entry.js} +1 -1
  313. package/dist/twilight/{p-6ed4c9bb.entry.js → p-7b23dec7.entry.js} +1 -1
  314. package/dist/twilight/p-7bb24ad6.entry.js +4 -0
  315. package/dist/twilight/{p-c254b6fa.entry.js → p-7d9288b0.entry.js} +1 -1
  316. package/dist/twilight/{p-82c12191.entry.js → p-85f95a58.entry.js} +1 -1
  317. package/dist/twilight/{p-67e88dc4.entry.js → p-86a1f616.entry.js} +1 -1
  318. package/dist/twilight/{p-80ff5572.entry.js → p-87115499.entry.js} +1 -1
  319. package/dist/twilight/{p-cc2b960c.entry.js → p-878c2be2.entry.js} +1 -1
  320. package/dist/twilight/{p-b69e98a8.entry.js → p-89e9a91f.entry.js} +1 -1
  321. package/dist/twilight/{p-2e112687.entry.js → p-90ee37c7.entry.js} +1 -1
  322. package/dist/twilight/{p-aeb76c46.entry.js → p-96584590.entry.js} +1 -1
  323. package/dist/twilight/{p-1dd1fef0.entry.js → p-96a57e9c.entry.js} +1 -1
  324. package/dist/twilight/{p-1c369bcf.entry.js → p-978e4164.entry.js} +1 -1
  325. package/dist/twilight/{p-4058b619.entry.js → p-97fc57c1.entry.js} +1 -1
  326. package/dist/twilight/p-98b1ff35.entry.js +4 -0
  327. package/dist/twilight/{p-5d01f25c.entry.js → p-9d18525b.entry.js} +1 -1
  328. package/dist/twilight/{p-CmQyEOxJ.js → p-B83s3cRn.js} +2 -2
  329. package/dist/twilight/{p-CjQzkU95.js → p-BVqCTDsV.js} +1 -1
  330. package/dist/twilight/{p-BtymczNp.js → p-CP29f7RQ.js} +1 -1
  331. package/dist/twilight/{p-C6w35AiQ.js → p-CS-t4QAX.js} +1 -1
  332. package/dist/twilight/{p-BiyhYWus.js → p-Cluq3aDa.js} +1 -1
  333. package/dist/twilight/{p-DfJdKB52.js → p-D-zqM6k8.js} +1 -1
  334. package/dist/twilight/{p-CGDRqU6i.js → p-DJmqmO68.js} +1 -1
  335. package/dist/twilight/{p-D2uiOzVz.js → p-DgwK96eP.js} +1 -1
  336. package/dist/twilight/p-DqXpn47Z.js +4 -0
  337. package/dist/twilight/p-DrXX8XG8.js +4 -0
  338. package/dist/twilight/{p-C1wu6qA1.js → p-DzW3U8TR.js} +1 -1
  339. package/dist/twilight/{p-B9VKgTTF.js → p-JKh0XFIn.js} +1 -1
  340. package/dist/twilight/{p-699bea26.entry.js → p-a347e701.entry.js} +1 -1
  341. package/dist/twilight/{p-9fa351ab.entry.js → p-a5d08af6.entry.js} +1 -1
  342. package/dist/twilight/{p-8230c543.entry.js → p-a774f6f0.entry.js} +7 -7
  343. package/dist/twilight/p-afaa0fbe.entry.js +4 -0
  344. package/dist/twilight/p-b389b1d3.entry.js +4 -0
  345. package/dist/twilight/{p-298ff716.entry.js → p-b6d5ae9b.entry.js} +1 -1
  346. package/dist/twilight/{p-b0e86201.entry.js → p-b862c670.entry.js} +1 -1
  347. package/dist/twilight/{p-2e43ddf0.entry.js → p-bab59319.entry.js} +1 -1
  348. package/dist/twilight/{p-437fe6f1.entry.js → p-bf4c2184.entry.js} +1 -1
  349. package/dist/twilight/{p-7f73ff43.entry.js → p-c19cf93c.entry.js} +1 -1
  350. package/dist/twilight/{p-3f26f1c5.entry.js → p-c34f8c08.entry.js} +1 -1
  351. package/dist/twilight/{p-116e7555.entry.js → p-c47ecca7.entry.js} +1 -1
  352. package/dist/twilight/{p-84f35767.entry.js → p-c48f5c6b.entry.js} +1 -1
  353. package/dist/twilight/{p-40217fcc.entry.js → p-c53c2f59.entry.js} +1 -1
  354. package/dist/twilight/{p-1151ebd7.entry.js → p-cd805a38.entry.js} +1 -1
  355. package/dist/twilight/{p-4868c03c.entry.js → p-cdd8ed7f.entry.js} +1 -1
  356. package/dist/twilight/{p-9b6db6a7.entry.js → p-ced4b7ac.entry.js} +1 -1
  357. package/dist/twilight/{p-a3f00389.entry.js → p-cf3365e2.entry.js} +1 -1
  358. package/dist/twilight/p-d78998b7.entry.js +4 -0
  359. package/dist/twilight/{p-665bca88.entry.js → p-daea3207.entry.js} +1 -1
  360. package/dist/twilight/{p-664f0936.entry.js → p-dff6d623.entry.js} +1 -1
  361. package/dist/twilight/p-e04221de.entry.js +4 -0
  362. package/dist/twilight/{p-db02986a.entry.js → p-e2934193.entry.js} +1 -1
  363. package/dist/twilight/{p-14c72ffd.entry.js → p-e3dab961.entry.js} +1 -1
  364. package/dist/twilight/{p-bf183f3a.entry.js → p-e41e5fc7.entry.js} +1 -1
  365. package/dist/twilight/{p-5b03dca8.entry.js → p-e4c9cef4.entry.js} +1 -1
  366. package/dist/twilight/{p-27a0a4cc.entry.js → p-eaf9d536.entry.js} +1 -1
  367. package/dist/twilight/{p-a669483e.entry.js → p-ee2b16d7.entry.js} +1 -1
  368. package/dist/twilight/{p-fa28a89f.entry.js → p-ee3ddc23.entry.js} +1 -1
  369. package/dist/twilight/{p-54d0db9a.entry.js → p-f0a14b18.entry.js} +1 -1
  370. package/dist/twilight/{p-8fa84b87.entry.js → p-f195a63d.entry.js} +1 -1
  371. package/dist/twilight/{p-997c4966.entry.js → p-f2c688d6.entry.js} +1 -1
  372. package/dist/twilight/{p-2c6c0844.entry.js → p-f4ac8cae.entry.js} +1 -1
  373. package/dist/twilight/{p-2babb4bd.entry.js → p-f58d14ed.entry.js} +1 -1
  374. package/dist/twilight/{p-3bdba697.entry.js → p-f82cee0c.entry.js} +1 -1
  375. package/dist/twilight/{p-8ae7bf96.entry.js → p-fa17989b.entry.js} +1 -1
  376. package/dist/twilight/{p-b3fe5e44.entry.js → p-fbc075fe.entry.js} +1 -1
  377. package/dist/twilight/{p-3b6b3c54.entry.js → p-fc5d5473.entry.js} +1 -1
  378. package/dist/twilight/twilight.esm.js +1 -1
  379. package/dist/types/components/salla-attachment-view/salla-attachment-view.d.ts +47 -0
  380. package/dist/types/components/salla-attachments/salla-attachments.d.ts +73 -0
  381. package/dist/types/components/salla-comments/interfaces.d.ts +1 -0
  382. package/dist/types/components/salla-comments/salla-comment-item.d.ts +3 -1
  383. package/dist/types/components/salla-cookies-bar/salla-cookies-bar.d.ts +117 -12
  384. package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +127 -4
  385. package/dist/types/components/salla-file-upload/upload-limits.d.ts +49 -0
  386. package/dist/types/components/salla-rating-modal/rating-modal-media.d.ts +38 -0
  387. package/dist/types/components/salla-rating-modal/salla-rating-modal-v2.d.ts +30 -7
  388. package/dist/types/components/salla-review-factors-tags/helpers.d.ts +1 -1
  389. package/dist/types/components/salla-review-factors-tags/interfaces.d.ts +7 -0
  390. package/dist/types/components/salla-review-order-item/interfaces.d.ts +30 -0
  391. package/dist/types/components/salla-review-order-item/salla-review-order-item.d.ts +30 -0
  392. package/dist/types/components.d.ts +286 -11
  393. package/package.json +6 -6
  394. package/dist/twilight/p-236f371d.entry.js +0 -4
  395. package/dist/twilight/p-3c22551b.entry.js +0 -4
  396. package/dist/twilight/p-8bce41c8.entry.js +0 -4
  397. package/dist/twilight/p-e701a3dc.entry.js +0 -4
  398. package/dist/twilight/p-f1eebeda.entry.js +0 -4
  399. package/dist/twilight/p-f4bdf19e.entry.js +0 -4
  400. package/dist/twilight/p-faaf4423.entry.js +0 -4
  401. package/dist/components/{keyboard_arrow_right.js → keyboard_arrow_left.js} +6 -6
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, f as forceUpdate, h, H as Host, a as getElement } from './index-CjQzkU95.js';
4
+ import { r as registerInstance, f as forceUpdate, h, H as Host, a as getElement } from './index-BVqCTDsV.js';
5
5
  import { S as Star } from './star-CeFAfcTv.js';
6
6
  import { S as ShippingFast } from './shipping-fast-lMgMt31Q.js';
7
7
  import { C as CheckCircle2 } from './check-circle2-BV4kqbdL.js';
@@ -9,15 +9,100 @@ import { H as Helper } from './Helper-CBmYxrzX.js';
9
9
  import { I as ImageIcon } from './image-C-tzSDxw.js';
10
10
  import { W as WhatsappIcon } from './whatsapp2-CgR-T_ZS.js';
11
11
  import { e as email } from './mail-DzAIgzdz.js';
12
+ import { b as buildMediaUploadAccept } from './upload-limits-DrXX8XG8.js';
12
13
  import './anime.es-CgtvEd63.js';
13
14
 
14
- const sallaRatingModalCss = "/*!twlt*/.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-rating-row-main{margin-bottom:0.35rem;padding:0.5rem 0.6rem;border:1px solid #d1d5db;border-radius:0.45rem;background:transparent}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-rating-row-main .s-rating-modal-product-factor-name{font-size:1rem;color:#5b6470}.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.is-opened{height:auto !important;opacity:1 !important;overflow:visible !important;pointer-events:auto !important;margin-bottom:1rem}.mt-0{margin-top:0px}.block{display:block}.hidden{display:none}.px-3{padding-left:0.75rem;padding-right:0.75rem}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.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{margin-bottom:1rem;display:flex;height:7rem;width:7rem;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:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.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-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{margin-bottom:0.25rem}.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}.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%}";
15
+ const MAX_IMAGE_UPLOAD_LIMIT = 10;
16
+ const MAX_VIDEO_UPLOAD_LIMIT = 5;
17
+ const MAX_VIDEO_FILE_SIZE = '100MB';
18
+ const MAX_VIDEO_DURATION = 60;
19
+ const MAX_PARALLEL_UPLOADS = 10;
20
+ function isVideoUrl(url) {
21
+ const pathname = url.split(/[?#]/, 1)[0];
22
+ return /\.(mp4|webm|mov|avi|mkv)$/i.test(pathname);
23
+ }
24
+ function splitMediaUrls(urls) {
25
+ return urls.reduce((acc, url) => {
26
+ if (!url)
27
+ return acc;
28
+ if (isVideoUrl(url)) {
29
+ acc.videos.push(url);
30
+ }
31
+ else {
32
+ acc.images.push(url);
33
+ }
34
+ return acc;
35
+ }, { images: [], videos: [] });
36
+ }
37
+ function getMediaUrlsByType(items) {
38
+ return splitMediaUrls(items.map(item => item?.url || '').filter(Boolean));
39
+ }
40
+ function parseMediaField(value) {
41
+ if (!value)
42
+ return [];
43
+ if (Array.isArray(value))
44
+ return value.filter(Boolean);
45
+ return value
46
+ .split(',')
47
+ .map(url => url.trim())
48
+ .filter(Boolean);
49
+ }
50
+ function countMediaByType(items) {
51
+ return items.reduce((counts, item) => {
52
+ const url = item?.url || '';
53
+ if (isVideoUrl(url)) {
54
+ counts.video += 1;
55
+ }
56
+ else {
57
+ counts.image += 1;
58
+ }
59
+ return counts;
60
+ }, { image: 0, video: 0 });
61
+ }
62
+ function createPreloadedMediaItem(url) {
63
+ return { id: url, url };
64
+ }
65
+ function removeUploadedImage(images, removedId) {
66
+ const normalizedId = String(removedId);
67
+ let removed = false;
68
+ return images.filter(image => {
69
+ const imageId = image?.id !== undefined && image?.id !== null ? String(image.id) : '';
70
+ const imageUrl = String(image?.url ?? '');
71
+ const matches = imageId === normalizedId || imageUrl === normalizedId;
72
+ if (matches) {
73
+ if (removed) {
74
+ return true;
75
+ }
76
+ removed = true;
77
+ return false;
78
+ }
79
+ return true;
80
+ });
81
+ }
82
+ function syncHiddenMediaInputs(imagesInput, videosInput, items) {
83
+ const { images, videos } = getMediaUrlsByType(items);
84
+ if (imagesInput)
85
+ imagesInput.value = images.join(',');
86
+ if (videosInput)
87
+ videosInput.value = videos.join(',');
88
+ }
89
+ function normalizeSubmittedMedia(data, allowAttachImages, allowAttachVideos) {
90
+ if (!allowAttachImages) {
91
+ delete data.images;
92
+ }
93
+ if (!allowAttachVideos) {
94
+ delete data.videos;
95
+ }
96
+ }
97
+
98
+ const sallaRatingModalCss = "/*!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-rating-row-main{margin-bottom:0.35rem;padding:0.5rem 0.6rem;border:1px solid #d1d5db;border-radius:0.45rem;background:transparent}.s-rating-modal-product-factor-name{color:#5b6470;font-size:0.9rem;line-height:1.25}.s-rating-modal-product-rating-row-main .s-rating-modal-product-factor-name{font-size:1rem;color:#5b6470}.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}.mt-0{margin-top:0px}.block{display:block}.hidden{display:none}.px-3{padding-left:0.75rem;padding-right:0.75rem}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.outline{outline-style:solid}.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{margin-bottom:1rem;display:flex;height:7rem;width:7rem;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:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:700}.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-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{margin-bottom:0.25rem}.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%}";
15
99
 
16
100
  const SallaRatingModalV2 = class {
17
101
  constructor(hostRef) {
18
102
  registerInstance(this, hostRef);
19
103
  this.hasError = false;
20
104
  this.showContactWidget = true;
105
+ this.errorMessage = '';
21
106
  this.images = [];
22
107
  this.productImages = {};
23
108
  this.editItemImages = [];
@@ -32,7 +117,12 @@ const SallaRatingModalV2 = class {
32
117
  this.shouldOpenDeleteModal = false;
33
118
  this.editItem = null;
34
119
  this.allowAttachImages = false;
120
+ this.allowAttachVideos = false;
35
121
  this.allowContactSupport = false;
122
+ this.uploadCounts = {};
123
+ this.uploadImageCounts = {};
124
+ this.uploadVideoCounts = {};
125
+ this.hasUploadsInProgress = false;
36
126
  this.loyaltyImageRatingPoints = 0;
37
127
  this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
38
128
  this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
@@ -53,13 +143,19 @@ const SallaRatingModalV2 = class {
53
143
  });
54
144
  this.contentRefs = [];
55
145
  this.hiddenInputs = [];
146
+ this.hiddenVideoInputs = [];
147
+ this.uploadingByProductId = {};
56
148
  this.userFilledFactorKeys = {};
57
149
  this.boundRatingRows = new WeakSet();
58
150
  this.stepsCount = 0;
59
151
  this.currentIndex = 0;
60
152
  this.submitted = [];
61
- this.MAX_UPLOAD_LIMIT = 3;
62
153
  this.thanksCountdownInterval = null;
154
+ this.MAX_IMAGE_UPLOAD_LIMIT = MAX_IMAGE_UPLOAD_LIMIT;
155
+ this.MAX_VIDEO_UPLOAD_LIMIT = MAX_VIDEO_UPLOAD_LIMIT;
156
+ this.MAX_VIDEO_FILE_SIZE = MAX_VIDEO_FILE_SIZE;
157
+ this.MAX_VIDEO_DURATION = MAX_VIDEO_DURATION;
158
+ this.MAX_PARALLEL_UPLOADS = MAX_PARALLEL_UPLOADS;
63
159
  this.scheduleWizardSetup = false;
64
160
  salla.lang.onLoaded(() => {
65
161
  this.contactUsLabel = salla.lang.get('blocks.footer.social');
@@ -90,8 +186,20 @@ const SallaRatingModalV2 = class {
90
186
  await setNestedAsync('en.trans', 'pages.rating.review_deleted_successfully', 'The review has been successfully deleted.');
91
187
  await setNestedAsync('ar.trans', 'pages.rating.images_count', 'الصور ( :current من أصل :total )');
92
188
  await setNestedAsync('en.trans', 'pages.rating.images_count', 'Images ( :current of :total )');
93
- await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`);
94
- await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`);
189
+ await setNestedAsync('ar.trans', 'pages.rating.media_count', 'الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)');
190
+ await setNestedAsync('en.trans', 'pages.rating.media_count', 'Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)');
191
+ await setNestedAsync('ar.trans', 'common.uploader.allowed_videos_types', 'يُسمح بفيديوهات mp4 أو mov أو avi أو mkv');
192
+ await setNestedAsync('en.trans', 'common.uploader.allowed_videos_types', 'Videos in mp4, mov, avi, or mkv format are allowed.');
193
+ await setNestedAsync('ar.trans', 'pages.rating.videos_count', 'الفيديو ( :current من أصل :total )');
194
+ await setNestedAsync('en.trans', 'pages.rating.videos_count', 'Videos ( :current of :total )');
195
+ await setNestedAsync('ar.trans', 'common.uploader.allowed_media_types', 'يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv');
196
+ await setNestedAsync('en.trans', 'common.uploader.allowed_media_types', 'Images in jpg, jpeg, or png and videos in mp4, mov, avi, or mkv are allowed.');
197
+ await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `أضف حتى ${MAX_IMAGE_UPLOAD_LIMIT} صور و ${MAX_VIDEO_UPLOAD_LIMIT} فيديوهات كحد أقصى`);
198
+ await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${MAX_IMAGE_UPLOAD_LIMIT} images and ${MAX_VIDEO_UPLOAD_LIMIT} videos maximum.`);
199
+ await setNestedAsync('ar.trans', 'common.uploader.max_images_count', 'أضف :count صور كحد أقصى');
200
+ await setNestedAsync('en.trans', 'common.uploader.max_images_count', 'Add up to :count images maximum.');
201
+ await setNestedAsync('ar.trans', 'common.uploader.max_videos_count', 'أضف :count فيديوهات كحد أقصى');
202
+ await setNestedAsync('en.trans', 'common.uploader.max_videos_count', 'Add up to :count videos maximum.');
95
203
  await setNestedAsync('ar.trans', 'common.elements.confirm_delete', 'تأكيد الحذف');
96
204
  await setNestedAsync('en.trans', 'common.elements.confirm_delete', 'Confirm deletion');
97
205
  await setNestedAsync('ar.trans', 'pages.rating.rate_required_factors', 'يرجى تقييم جميع المعايير لإتمام مراجعتك.');
@@ -101,8 +209,8 @@ const SallaRatingModalV2 = class {
101
209
  await setNestedAsync('ar.trans', 'pages.rating.loyalty_points_for_images', 'اكسب :points نقطة ولاء عند إضافة صور لتقييمك!');
102
210
  await setNestedAsync('en.trans', 'pages.rating.loyalty_points_for_images', 'Earn :points loyalty points when adding photos to your review!');
103
211
  this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
104
- this.allowedImagesTypesLabel = salla.lang.get('common.uploader.allowed_images_types');
105
- this.threeImagesMax = salla.lang.get('common.uploader.max_three_images');
212
+ this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
213
+ this.threeImagesMax = this.getMaxUploadHintLabel();
106
214
  this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
107
215
  this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
108
216
  this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
@@ -129,7 +237,70 @@ const SallaRatingModalV2 = class {
129
237
  this.orderId = salla.config.get('page.id');
130
238
  }
131
239
  this.allowAttachImages = !!salla.config.get('store.settings.rating.allow_attach_images');
240
+ this.allowAttachVideos = !!salla.config.get('store.settings.rating.allow_attach_videos');
132
241
  this.allowContactSupport = !!salla.config.get('store.settings.rating.allow_contact_support');
242
+ this.refreshMediaLabels();
243
+ }
244
+ canAttachMedia() {
245
+ return this.allowAttachImages || this.allowAttachVideos;
246
+ }
247
+ getMediaUploadAccept() {
248
+ return buildMediaUploadAccept(this.allowAttachImages, this.allowAttachVideos);
249
+ }
250
+ refreshMediaLabels() {
251
+ this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
252
+ this.threeImagesMax = this.getMaxUploadHintLabel();
253
+ }
254
+ getAllowedMediaTypesLabel() {
255
+ if (this.allowAttachImages && this.allowAttachVideos) {
256
+ return salla.lang.get('common.uploader.allowed_media_types');
257
+ }
258
+ if (this.allowAttachImages) {
259
+ return salla.lang.get('common.uploader.allowed_images_types');
260
+ }
261
+ if (this.allowAttachVideos) {
262
+ return salla.lang.get('common.uploader.allowed_videos_types');
263
+ }
264
+ return '';
265
+ }
266
+ getMaxUploadHintLabel() {
267
+ if (this.allowAttachImages && this.allowAttachVideos) {
268
+ return salla.lang.get('common.uploader.max_three_images');
269
+ }
270
+ if (this.allowAttachImages) {
271
+ return salla.lang.get('common.uploader.max_images_count', {
272
+ count: this.MAX_IMAGE_UPLOAD_LIMIT,
273
+ });
274
+ }
275
+ if (this.allowAttachVideos) {
276
+ return salla.lang.get('common.uploader.max_videos_count', {
277
+ count: this.MAX_VIDEO_UPLOAD_LIMIT,
278
+ });
279
+ }
280
+ return '';
281
+ }
282
+ setUploadCount(productId, count, imageCount, videoCount) {
283
+ this.uploadCounts = { ...this.uploadCounts, [productId]: count };
284
+ if (imageCount != null) {
285
+ this.uploadImageCounts = { ...this.uploadImageCounts, [productId]: imageCount };
286
+ }
287
+ if (videoCount != null) {
288
+ this.uploadVideoCounts = { ...this.uploadVideoCounts, [productId]: videoCount };
289
+ }
290
+ }
291
+ setUploaderProcessing(productId, uploading) {
292
+ this.uploadingByProductId = { ...this.uploadingByProductId, [productId]: uploading };
293
+ this.hasUploadsInProgress = Object.values(this.uploadingByProductId).some(Boolean);
294
+ }
295
+ scheduleUploaderHeightRefresh() {
296
+ [50, 150, 350].forEach(delay => {
297
+ setTimeout(() => this.updateBodyHeight(), delay);
298
+ });
299
+ }
300
+ handleGalleryCountUpdate(productId, detail) {
301
+ this.setUploadCount(productId, detail.count, detail.imageCount, detail.videoCount);
302
+ this.setUploaderProcessing(productId, !!detail.uploading);
303
+ this.scheduleUploaderHeightRefresh();
133
304
  }
134
305
  /** Encrypted order id from page config / prop — used to fetch order details. */
135
306
  getRatingOrderId() {
@@ -275,7 +446,7 @@ const SallaRatingModalV2 = class {
275
446
  return new Promise(resolve => {
276
447
  setTimeout(() => {
277
448
  this.modal
278
- .open()
449
+ ?.open()
279
450
  .then(() => this.order ||
280
451
  salla.api
281
452
  .withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()))
@@ -284,7 +455,7 @@ const SallaRatingModalV2 = class {
284
455
  this.productReviewFactors = await this.fetchAllProductReviewFactors(res.data);
285
456
  }))
286
457
  .then(() => this.readyUpLoyaltyPoints())
287
- .then(() => this.modal.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
458
+ .then(() => this.modal?.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
288
459
  .then(() => {
289
460
  // Initialize productImages for all products
290
461
  const initialImages = {};
@@ -292,14 +463,15 @@ const SallaRatingModalV2 = class {
292
463
  initialImages[item.product.id] = [];
293
464
  }
294
465
  this.productImages = initialImages;
466
+ this.uploadCounts = Object.fromEntries(Object.keys(initialImages).map(productId => [Number(productId), 0]));
295
467
  })
296
- .then(() => this.modal.stopLoading())
468
+ .then(() => this.modal?.stopLoading())
297
469
  .then(() => this.afterOrderLoaded())
298
- .catch(e => {
470
+ .catch((e) => {
299
471
  resolve(false);
300
472
  this.hasError = true;
301
473
  this.errorMessage = e.response?.data?.error?.message || e.response?.data;
302
- this.modal.stopLoading();
474
+ this.modal?.stopLoading();
303
475
  });
304
476
  resolve(true);
305
477
  }, 50);
@@ -321,7 +493,10 @@ const SallaRatingModalV2 = class {
321
493
  this.editFactorRatings = { ...this.buildEditFactorRatings(this.editItem.product.id) };
322
494
  this.markExistingFactorRatingsAsUserFilled(this.editItem.product.id, this.editFactorRatings);
323
495
  }
324
- this.editModal.open();
496
+ this.editModal?.open();
497
+ if (this.editType === 'product' && this.canAttachMedia()) {
498
+ this.scheduleUploaderHeightRefresh();
499
+ }
325
500
  }
326
501
  catch (e) {
327
502
  this.hasError = true;
@@ -332,28 +507,56 @@ const SallaRatingModalV2 = class {
332
507
  const endpoint = `rating/${feedbackId}/show`;
333
508
  const response = await salla.api.request(endpoint);
334
509
  this.editItem = response.data;
335
- if (this.allowAttachImages && this.editType == 'product' && this.editItem.images.length) {
336
- this.editItemImages = this.editItem.images.map(img => {
337
- return { id: `${Math.floor(100 + Math.random() * 900)}`, url: img };
338
- });
510
+ if (this.canAttachMedia() && this.editType == 'product') {
511
+ const imageUrls = (this.editItem.images || []).filter(Boolean);
512
+ const videoUrls = (this.editItem.videos || []).filter(Boolean);
513
+ let mediaUrls = [...imageUrls, ...videoUrls];
514
+ if (!videoUrls.length && imageUrls.length) {
515
+ const split = splitMediaUrls(imageUrls);
516
+ mediaUrls = [...split.images, ...split.videos];
517
+ }
518
+ mediaUrls = mediaUrls.filter(url => isVideoUrl(url) ? this.allowAttachVideos : this.allowAttachImages);
519
+ if (mediaUrls.length) {
520
+ this.editItemImages = mediaUrls.map(url => createPreloadedMediaItem(url));
521
+ const mediaCounts = countMediaByType(this.editItemImages);
522
+ this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
523
+ }
339
524
  }
340
525
  }
341
526
  async editReview() {
527
+ if (this.hasUploadsInProgress)
528
+ return;
342
529
  const endpoint = `rating/${this.editFeedbackId}`;
343
530
  let data;
344
531
  if (this.editType === 'product') {
345
- const container = this.editModal.querySelector('[data-type="products"]') || this.currentTab;
532
+ const container = this.editModal?.querySelector('[data-type="products"]') || this.currentTab;
346
533
  data = this.buildProductRatingPayload(this.collectFormData(container), container);
347
534
  if (!data.product_id && this.editItem?.product?.id) {
348
535
  data.product_id = String(this.editItem.product.id);
349
536
  }
537
+ if (this.canAttachMedia()) {
538
+ const { images, videos } = getMediaUrlsByType(this.editItemImages);
539
+ if (this.allowAttachImages) {
540
+ data.images = images;
541
+ }
542
+ if (this.allowAttachVideos) {
543
+ data.videos = videos;
544
+ }
545
+ }
546
+ normalizeSubmittedMedia(data, this.allowAttachImages, this.allowAttachVideos);
350
547
  }
351
548
  else {
352
549
  data = this.collectFormData(this.editModal);
353
- data.images && (data.images = data.images.split(','));
550
+ if (data.images) {
551
+ data.images = parseMediaField(data.images);
552
+ }
553
+ if (data.videos) {
554
+ data.videos = parseMediaField(data.videos);
555
+ }
556
+ normalizeSubmittedMedia(data, this.allowAttachImages, this.allowAttachVideos);
354
557
  }
355
- await salla.api.request(endpoint, data, 'put').then(res => {
356
- this.editModal.close();
558
+ await salla.api.request(endpoint, data, 'put').then((res) => {
559
+ this.editModal?.close();
357
560
  salla.notify.success(res.message || this.updatedSuccessfullyLabel);
358
561
  setTimeout(() => {
359
562
  window.location.reload();
@@ -367,14 +570,14 @@ const SallaRatingModalV2 = class {
367
570
  this.shouldOpenDeleteModal = true;
368
571
  return new Promise(resolve => {
369
572
  setTimeout(() => {
370
- this.deleteModal.open().then(() => resolve(true));
573
+ this.deleteModal?.open().then(() => resolve(true));
371
574
  }, 50);
372
575
  });
373
576
  }
374
577
  async deleteReview() {
375
578
  const endpoint = `rating/${this.deleteFeedbackId}`;
376
579
  await salla.api.request(endpoint, null, 'delete').then(() => {
377
- this.deleteModal.close();
580
+ this.deleteModal?.close();
378
581
  salla.notify.success(this.deletedSuccessfullyLabel);
379
582
  setTimeout(() => {
380
583
  window.location.reload();
@@ -385,12 +588,12 @@ const SallaRatingModalV2 = class {
385
588
  * Show the rating modal
386
589
  */
387
590
  async close() {
388
- return this.modal.close();
591
+ return this.modal?.close();
389
592
  }
390
593
  // handle wizard
391
594
  handleWizard() {
392
- this.steps = this.modal.querySelectorAll('.s-rating-modal-step');
393
- this.dots = this.modal.querySelectorAll('.s-rating-modal-step-dot');
595
+ this.steps = this.modal?.querySelectorAll('.s-rating-modal-step');
596
+ this.dots = this.modal?.querySelectorAll('.s-rating-modal-step-dot');
394
597
  if (this.stepsCount === 0) {
395
598
  this.showThankYou();
396
599
  return;
@@ -406,18 +609,18 @@ const SallaRatingModalV2 = class {
406
609
  }
407
610
  showActiveStep(current = null) {
408
611
  this.refreshWizardRefs();
409
- this.currentTab = current || this.steps[this.currentIndex];
612
+ this.currentTab = current || this.steps?.[this.currentIndex];
410
613
  if (!this.currentTab) {
411
614
  return;
412
615
  }
413
- Helper.toggleClassIf('.s-rating-modal-step-dot', 's-rating-modal-bg-gray', 's-rating-modal-bg-primary', dot => dot != this.dots[this.currentIndex]).toggleClassIf('.s-rating-modal-step', 's-rating-modal-active', 's-rating-modal-hidden', tab => tab == this.currentTab);
616
+ Helper.toggleClassIf('.s-rating-modal-step-dot', 's-rating-modal-bg-gray', 's-rating-modal-bg-primary', (dot) => dot != this.dots?.[this.currentIndex]).toggleClassIf('.s-rating-modal-step', 's-rating-modal-active', 's-rating-modal-hidden', (tab) => tab == this.currentTab);
414
617
  if (this.currentIndex !== 0) {
415
618
  // the animation
416
619
  Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-unactive', 's-rating-modal-hidden', () => true);
417
620
  setTimeout(() => Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-active', 's-rating-modal-unactive', () => true), 300);
418
621
  }
419
622
  // Btn text
420
- const nextType = this.steps[this.currentIndex + 1]?.dataset.type;
623
+ const nextType = this.steps?.[this.currentIndex + 1]?.dataset.type;
421
624
  this.nextBtn?.setText(nextType
422
625
  ? `${salla.lang.get('pages.rating.rate')} ${salla.lang.get(`pages.rating.${nextType}`)}`
423
626
  : salla.lang.get('pages.rating.send_ratings'));
@@ -442,13 +645,15 @@ const SallaRatingModalV2 = class {
442
645
  this.showActiveStep();
443
646
  }
444
647
  async submit() {
648
+ if (this.hasUploadsInProgress)
649
+ return;
445
650
  this.refreshWizardRefs();
446
651
  try {
447
652
  if (!this.submittedBefore()) {
448
653
  this.validate();
449
654
  }
450
655
  salla.config.canLeave = false;
451
- await this.nextBtn.load();
656
+ await this.nextBtn?.load();
452
657
  if (!this.submittedBefore()) {
453
658
  await this.sendFeedback();
454
659
  }
@@ -466,7 +671,7 @@ const SallaRatingModalV2 = class {
466
671
  }
467
672
  }
468
673
  finally {
469
- this.nextBtn.stop();
674
+ this.nextBtn?.stop();
470
675
  salla.config.canLeave = true;
471
676
  }
472
677
  }
@@ -494,6 +699,9 @@ const SallaRatingModalV2 = class {
494
699
  inputs.push(input);
495
700
  };
496
701
  container.querySelectorAll('[name]').forEach((input) => {
702
+ if (input.closest('salla-file-upload')) {
703
+ return;
704
+ }
497
705
  addInput(input);
498
706
  });
499
707
  container.querySelectorAll('salla-rating-stars').forEach((stars) => {
@@ -514,25 +722,28 @@ const SallaRatingModalV2 = class {
514
722
  return [];
515
723
  }
516
724
  validate(rating = null, type = null) {
517
- if (!rating && this.currentTab.dataset.type === 'products') {
725
+ if (!rating && this.currentTab?.dataset?.type === 'products') {
518
726
  const ratingForms = this.currentTab.querySelectorAll('.rating-outer-form');
519
- ratingForms.forEach(ratingForm => this.validate(ratingForm, 'product'));
727
+ ratingForms.forEach((ratingForm) => this.validate(ratingForm, 'product'));
728
+ return;
729
+ }
730
+ const resolvedRating = rating ?? this.currentTab;
731
+ if (!resolvedRating) {
520
732
  return;
521
733
  }
522
- rating = rating || this.currentTab;
523
- const mainRatingRow = rating.querySelector('.s-rating-modal-product-rating-row-main');
524
- const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || rating);
734
+ const mainRatingRow = resolvedRating.querySelector('.s-rating-modal-product-rating-row-main');
735
+ const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || resolvedRating);
525
736
  const stars = mainRatingInput?.value;
526
- const validationMessage = rating.querySelector('.s-rating-modal-validation-msg');
527
- type = type || rating.dataset.type;
737
+ const validationMessage = resolvedRating.querySelector('.s-rating-modal-validation-msg');
738
+ const resolvedType = type || resolvedRating.getAttribute('data-type');
528
739
  if (!stars) {
529
740
  validationMessage.innerHTML = salla.lang
530
- .get(`pages.rating.rate_${type}_stars`)
741
+ .get(`pages.rating.rate_${resolvedType}_stars`)
531
742
  .replace(' (:item)', '');
532
743
  throw new Error(validationMessage.innerHTML);
533
744
  }
534
- if (type === 'product') {
535
- const requiredFactorRows = Array.from(rating.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]'));
745
+ if (resolvedType === 'product') {
746
+ const requiredFactorRows = Array.from(resolvedRating.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]'));
536
747
  const hasMissingRequiredFactor = requiredFactorRows.some((row) => {
537
748
  const factorStarsInput = this.getRatingHiddenInput(row);
538
749
  return !factorStarsInput?.value;
@@ -542,9 +753,13 @@ const SallaRatingModalV2 = class {
542
753
  throw new Error(validationMessage.innerHTML);
543
754
  }
544
755
  }
545
- validationMessage.innerHTML = '';
756
+ if (validationMessage) {
757
+ validationMessage.innerHTML = '';
758
+ }
546
759
  }
547
760
  collectFormData(container = this.currentTab) {
761
+ if (!container)
762
+ return {};
548
763
  const data = {};
549
764
  this.collectNamedInputs(container).forEach((input) => {
550
765
  const inputData = salla.helpers.inputData(input.name, input.value, data);
@@ -553,6 +768,8 @@ const SallaRatingModalV2 = class {
553
768
  return data;
554
769
  }
555
770
  buildProductRatingPayload(data, container = this.currentTab) {
771
+ if (!container)
772
+ return {};
556
773
  if (!data.rating) {
557
774
  const mainRatingRow = container.querySelector('.s-rating-modal-product-rating-row-main');
558
775
  const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || container);
@@ -562,15 +779,24 @@ const SallaRatingModalV2 = class {
562
779
  }
563
780
  const productId = Number(data.product_id);
564
781
  let images = [];
782
+ let videos = [];
565
783
  if (data.images) {
566
- images =
567
- typeof data.images === 'string' ? data.images.split(',').filter(Boolean) : data.images;
784
+ images = parseMediaField(data.images);
785
+ }
786
+ else if (this.editMode && this.canAttachMedia() && productId) {
787
+ images = getMediaUrlsByType(this.editItemImages).images;
788
+ }
789
+ else if (this.canAttachMedia() && productId) {
790
+ images = getMediaUrlsByType(this.productImages[productId] || []).images;
568
791
  }
569
- else if (this.editMode && this.allowAttachImages && productId) {
570
- images = this.editItemImages.map(img => img.url);
792
+ if (data.videos) {
793
+ videos = parseMediaField(data.videos);
571
794
  }
572
- else if (this.allowAttachImages && productId) {
573
- images = (this.productImages[productId] || []).map(img => img.url);
795
+ else if (this.editMode && this.canAttachMedia() && productId) {
796
+ videos = getMediaUrlsByType(this.editItemImages).videos;
797
+ }
798
+ else if (this.canAttachMedia() && productId) {
799
+ videos = getMediaUrlsByType(this.productImages[productId] || []).videos;
574
800
  }
575
801
  const factors = this.normalizeFactorsList(data.factors)
576
802
  .filter(factor => factor?.id && factor?.rating)
@@ -578,15 +804,21 @@ const SallaRatingModalV2 = class {
578
804
  id: String(factor.id),
579
805
  rating: String(factor.rating),
580
806
  }));
581
- return {
807
+ const payload = {
582
808
  order_id: this.getSubmitOrderId(),
583
809
  product_id: String(data.product_id),
584
810
  rating: String(data.rating),
585
811
  comment: data.comment || data.content || '',
586
- images,
587
812
  factors,
588
813
  type: 'products',
589
814
  };
815
+ if (this.allowAttachImages) {
816
+ payload.images = images;
817
+ }
818
+ if (this.allowAttachVideos) {
819
+ payload.videos = videos;
820
+ }
821
+ return payload;
590
822
  }
591
823
  async sendFeedback() {
592
824
  this.refreshWizardRefs();
@@ -607,6 +839,9 @@ const SallaRatingModalV2 = class {
607
839
  }
608
840
  data.order_id = this.getSubmitOrderId();
609
841
  data.type = stepType;
842
+ if (!stepType) {
843
+ return;
844
+ }
610
845
  const res = await salla.rating.api[stepType](data);
611
846
  this.submitted.push(this.currentIndex);
612
847
  return res;
@@ -621,6 +856,8 @@ const SallaRatingModalV2 = class {
621
856
  let seconds = 10;
622
857
  this.clearThanksCountdown();
623
858
  this.thanksCountdownInterval = setInterval(() => {
859
+ if (!this.thanksTime)
860
+ return;
624
861
  this.thanksTime.innerHTML = `00:0${seconds--}`;
625
862
  if (seconds > 0) {
626
863
  return;
@@ -629,7 +866,7 @@ const SallaRatingModalV2 = class {
629
866
  this.thanksTime.remove();
630
867
  this.close().then(() => window.location.reload());
631
868
  }, 1000);
632
- this.modal.querySelector('.s-rating-modal-footer').classList.add('s-rating-modal-unvisiable');
869
+ this.modal?.querySelector('.s-rating-modal-footer')?.classList.add('s-rating-modal-unvisiable');
633
870
  this.showActiveStep(this.thanksTab);
634
871
  }
635
872
  getFilepondPlaceholder() {
@@ -937,26 +1174,41 @@ const SallaRatingModalV2 = class {
937
1174
  }, {});
938
1175
  }
939
1176
  renderProductStep(item, index) {
940
- return (h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details" }, h("div", { class: "s-rating-modal-product-info-row" }, h("div", { class: "s-rating-modal-product-img-wrap" }, h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-product-title" }, item.product.name)), this.renderProductReviewFactors(item.product.id, 0, { fieldPrefix: '' }), h("input", { type: "hidden", name: "product_id", value: item.product.id }), h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.allowAttachImages && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => (this.contentRefs[index] = el) }, h("salla-file-upload", { name: "image", maxFilesCount: this.MAX_UPLOAD_LIMIT, imagePreviewHeight: 117, "instant-upload": true, type: "feedback", payloadName: "files[]", id: `file-${item.product.id}`, title: item.product.name, allowMultiple: true, instantUpload: true, accept: "image/png, image/jpeg, image/jpg", url: salla.url.api('upload'), onUploaded: e => {
1177
+ return (h("section", { class: "s-rating-modal-step s-rating-modal-hidden", "data-type": "products", "data-product-id": item.product.id, key: item.product.id }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details" }, h("div", { class: "s-rating-modal-product-info-row" }, h("div", { class: "s-rating-modal-product-img-wrap" }, h("img", { src: item.product.thumbnail, alt: item.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-product-title" }, item.product.name)), this.renderProductReviewFactors(item.product.id, 0, { fieldPrefix: '' }), h("input", { type: "hidden", name: "product_id", value: item.product.id }), h("textarea", { placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
1178
+ if (el)
1179
+ this.contentRefs[index] = el;
1180
+ } }, h("salla-file-upload", { name: "image", enableGallery: true, maxImagesCount: this.allowAttachImages ? this.MAX_IMAGE_UPLOAD_LIMIT : undefined, maxVideosCount: this.allowAttachVideos ? this.MAX_VIDEO_UPLOAD_LIMIT : undefined, maxVideoFileSize: this.allowAttachVideos ? this.MAX_VIDEO_FILE_SIZE : undefined, maxVideoDuration: this.allowAttachVideos ? this.MAX_VIDEO_DURATION : undefined, maxParallelUploads: this.MAX_PARALLEL_UPLOADS, imagePreviewHeight: 75, filePosterHeight: 75, "instant-upload": true, type: "feedback", payloadName: "files[]", id: `file-${item.product.id}`, title: item.product.name, allowMultiple: true, instantUpload: true, accept: this.getMediaUploadAccept(), url: salla.url.api('upload'), onUploaded: e => {
1181
+ const productId = item.product.id;
1182
+ const nextImages = [...(this.productImages[productId] || []), e.detail];
941
1183
  this.productImages = {
942
1184
  ...this.productImages,
943
- [item.product.id]: [...(this.productImages[item.product.id] || []), e.detail],
1185
+ [productId]: nextImages,
944
1186
  };
945
- this.hiddenInputs[index].value = this.productImages[item.product.id]
946
- .map(img => img.url)
947
- .join(',');
1187
+ const mediaCounts = countMediaByType(nextImages);
1188
+ this.setUploadCount(productId, nextImages.length, mediaCounts.image, mediaCounts.video);
1189
+ syncHiddenMediaInputs(this.hiddenInputs[index], this.hiddenVideoInputs[index], nextImages);
1190
+ this.scheduleUploaderHeightRefresh();
948
1191
  }, onRemoved: e => {
949
1192
  const removedId = e.detail;
950
- if (!removedId || !this.productImages[item.product.id])
1193
+ const productId = item.product.id;
1194
+ if (!removedId || !this.productImages[productId])
951
1195
  return;
1196
+ const nextImages = removeUploadedImage(this.productImages[productId], removedId);
952
1197
  this.productImages = {
953
1198
  ...this.productImages,
954
- [item.product.id]: this.productImages[item.product.id].filter(img => img.id !== removedId),
1199
+ [productId]: nextImages,
955
1200
  };
956
- this.hiddenInputs[index].value = this.productImages[item.product.id]
957
- .map(img => img.url)
958
- .join(',');
959
- }, labelIdle: this.getFilepondPlaceholder() }), h("input", { type: "hidden", name: "images", value: (this.productImages[item.product.id] || []).map(img => img.url).join(','), ref: el => (this.hiddenInputs[index] = el) }), this.renderUploadedImagesCount(item.product.id))))));
1201
+ const mediaCounts = countMediaByType(nextImages);
1202
+ this.setUploadCount(productId, nextImages.length, mediaCounts.image, mediaCounts.video);
1203
+ syncHiddenMediaInputs(this.hiddenInputs[index], this.hiddenVideoInputs[index], nextImages);
1204
+ this.scheduleUploaderHeightRefresh();
1205
+ }, labelIdle: this.getFilepondPlaceholder(), onGalleryUpdated: e => this.handleGalleryCountUpdate(item.product.id, e.detail) }), this.allowAttachImages && (h("input", { type: "hidden", name: "images", value: getMediaUrlsByType(this.productImages[item.product.id] || []).images.join(','), ref: el => {
1206
+ if (el)
1207
+ this.hiddenInputs[index] = el;
1208
+ } })), this.allowAttachVideos && (h("input", { type: "hidden", name: "videos", value: getMediaUrlsByType(this.productImages[item.product.id] || []).videos.join(','), ref: el => {
1209
+ if (el)
1210
+ this.hiddenVideoInputs[index] = el;
1211
+ } })), this.renderUploadedImagesCount(item.product.id))))));
960
1212
  }
961
1213
  renderProductReviewFactors(productId, index, options = {}) {
962
1214
  const factors = this.productReviewFactors[productId] || [];
@@ -976,16 +1228,22 @@ const SallaRatingModalV2 = class {
976
1228
  const normalized = Number(byId ?? byName ?? byIndex);
977
1229
  return Number.isNaN(normalized) ? undefined : normalized;
978
1230
  };
979
- return (h("div", { class: "s-rating-modal-product-rating-rows", ref: el => this.setupProductRatingAutofill(el, productId) }, h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-rating-row-main" }, h("span", { class: "s-rating-modal-product-factor-name" }, this.overallProductRatingLabel, h("span", { class: "s-rating-modal-product-factor-required" }, "*")), h("salla-rating-stars", { size: "medium", name: mainRatingName, key: hasMainRating ? `main-rating-${normalizedMainRating}` : 'main-rating-empty', value: hasMainRating ? normalizedMainRating : undefined, editable: hasMainRating, withLabel: true, labelBeforeStars: true, tag: false })), factors.map((factor, factorIndex) => (h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-factor-row px-3", "data-required": factor.required ? 'true' : 'false', "data-factor-key": this.getFactorKey(factor, factorIndex) }, h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'name'), value: factor.name }), !!factor.id && (h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'id'), value: String(factor.id) })), h("span", { class: "s-rating-modal-product-factor-name" }, factor.name, factor.required ? h("span", { class: "s-rating-modal-product-factor-required" }, "*") : ''), h("salla-rating-stars", { size: "medium", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'rating'), key: `factor-rating-${factor.id ?? factorIndex}-${getPrefilledFactorRating(factor, factorIndex) ?? 0}`, value: getPrefilledFactorRating(factor, factorIndex), editable: options.alwaysEditable ||
1231
+ return (h("div", { class: "s-rating-modal-product-rating-rows", ref: el => el && this.setupProductRatingAutofill(el, productId) }, h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-rating-row-main" }, h("span", { class: "s-rating-modal-product-factor-name" }, this.overallProductRatingLabel, h("span", { class: "s-rating-modal-product-factor-required" }, "*")), h("salla-rating-stars", { size: "medium", name: mainRatingName, key: hasMainRating ? `main-rating-${normalizedMainRating}` : 'main-rating-empty', value: hasMainRating ? normalizedMainRating : undefined, editable: hasMainRating, withLabel: true, labelBeforeStars: true, tag: false })), factors.map((factor, factorIndex) => (h("div", { class: "s-rating-modal-product-rating-row s-rating-modal-product-factor-row px-3", "data-required": factor.required ? 'true' : 'false', "data-factor-key": this.getFactorKey(factor, factorIndex) }, h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'name'), value: factor.name }), !!factor.id && (h("input", { type: "hidden", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'id'), value: String(factor.id) })), h("span", { class: "s-rating-modal-product-factor-name" }, factor.name, factor.required ? h("span", { class: "s-rating-modal-product-factor-required" }, "*") : ''), h("salla-rating-stars", { size: "medium", name: this.getFactorFieldName(fieldPrefix, factorIndex, 'rating'), key: `factor-rating-${factor.id ?? factorIndex}-${getPrefilledFactorRating(factor, factorIndex) ?? 0}`, value: getPrefilledFactorRating(factor, factorIndex), editable: options.alwaysEditable ||
980
1232
  typeof getPrefilledFactorRating(factor, factorIndex) === 'number', withLabel: true, labelBeforeStars: true, tag: false }))))));
981
1233
  }
982
1234
  handleSendEmail() {
1235
+ if (!this.order) {
1236
+ return;
1237
+ }
983
1238
  const subject = `${this.contactSubjectLabel} #${this.order.id}`;
984
1239
  const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
985
1240
  const mailtoLink = `mailto:${salla.config.get('store.contacts.email')}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
986
1241
  window.open(mailtoLink, '_blank');
987
1242
  }
988
1243
  handleSendWhatsApp() {
1244
+ if (!this.order) {
1245
+ return;
1246
+ }
989
1247
  const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
990
1248
  const whatsappLink = `https://wa.me/${salla.config.get('store.contacts.whatsapp')}?text=${encodeURIComponent(body)}`;
991
1249
  window.open(whatsappLink, '_blank');
@@ -1003,9 +1261,16 @@ const SallaRatingModalV2 = class {
1003
1261
  this.productFactorRatings = {};
1004
1262
  this.editMainRating = undefined;
1005
1263
  this.userFilledFactorKeys = {};
1264
+ this.uploadingByProductId = {};
1265
+ this.hasUploadsInProgress = false;
1006
1266
  this.hiddenInputs[1] && (this.hiddenInputs[1].value = '');
1007
- this.deleteFeedbackId = null;
1008
- this.editFeedbackId = null;
1267
+ this.editHiddenVideosInput && (this.editHiddenVideosInput.value = '');
1268
+ if (this.body) {
1269
+ this.body.style.height = '';
1270
+ this.body.style.minHeight = '';
1271
+ }
1272
+ this.deleteFeedbackId = undefined;
1273
+ this.editFeedbackId = undefined;
1009
1274
  this.shouldOpenDeleteModal = false;
1010
1275
  this.editMode = false;
1011
1276
  this.deleteMode = false;
@@ -1016,37 +1281,90 @@ const SallaRatingModalV2 = class {
1016
1281
  this.loyaltyImageRatingPoints = 0;
1017
1282
  }
1018
1283
  getDeleteModal() {
1019
- return (h("salla-modal", { ref: modal => (this.deleteModal = modal), width: "xs", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-delete-wrapper", ref: el => (this.body = el) }, h("h3", null, this.confirmDeletionLabel), h("p", null, this.areYouSureLabel), h("div", { class: "s-rating-modal-delete-actions" }, h("salla-button", { loaderPosition: "center", onClick: () => this.deleteReview() }, this.confirmDeleteBtn), h("salla-button", { color: "danger", fill: "outline", onClick: () => this.deleteModal.close() }, this.cancelLabel)))));
1284
+ return (h("salla-modal", { ref: modal => {
1285
+ if (modal)
1286
+ this.deleteModal = modal;
1287
+ }, width: "xs", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-delete-wrapper", ref: el => {
1288
+ if (el)
1289
+ this.body = el;
1290
+ } }, h("h3", null, this.confirmDeletionLabel), h("p", null, this.areYouSureLabel), h("div", { class: "s-rating-modal-delete-actions" }, h("salla-button", { loaderPosition: "center", onClick: () => this.deleteReview() }, this.confirmDeleteBtn), h("salla-button", { color: "danger", fill: "outline", onClick: () => this.deleteModal?.close() }, this.cancelLabel)))));
1020
1291
  }
1021
1292
  renderUploadedImagesCount(productId) {
1022
- // In edit mode, use editItemImages; in default mode, use productImages
1023
- const imageCount = this.editMode
1024
- ? this.editItemImages.length
1025
- : (this.productImages[productId] || []).length;
1026
- return (h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.images_count', imageCount, {
1027
- current: imageCount,
1028
- total: this.MAX_UPLOAD_LIMIT,
1029
- })));
1293
+ const items = this.editMode ? this.editItemImages : this.productImages[productId] || [];
1294
+ const mediaCounts = countMediaByType(items);
1295
+ const imageCount = this.uploadImageCounts[productId] ?? mediaCounts.image;
1296
+ const videoCount = this.uploadVideoCounts[productId] ?? mediaCounts.video;
1297
+ if (this.allowAttachImages && this.allowAttachVideos) {
1298
+ return (h("span", { class: "s-rating-modal-upload-count" }, salla.lang.get('pages.rating.media_count', {
1299
+ imageCurrent: imageCount,
1300
+ imageTotal: this.MAX_IMAGE_UPLOAD_LIMIT,
1301
+ videoCurrent: videoCount,
1302
+ videoTotal: this.MAX_VIDEO_UPLOAD_LIMIT,
1303
+ })));
1304
+ }
1305
+ if (this.allowAttachImages) {
1306
+ return (h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.images_count', imageCount, {
1307
+ current: imageCount,
1308
+ total: this.MAX_IMAGE_UPLOAD_LIMIT,
1309
+ })));
1310
+ }
1311
+ if (this.allowAttachVideos) {
1312
+ return (h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.videos_count', videoCount, {
1313
+ current: videoCount,
1314
+ total: this.MAX_VIDEO_UPLOAD_LIMIT,
1315
+ })));
1316
+ }
1317
+ return null;
1030
1318
  }
1031
1319
  getEditModal() {
1032
- return (h("salla-modal", { ref: modal => (this.editModal = modal), width: "md", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-edit-wrapper", ref: el => (this.body = el) }, this.editType === 'store' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "store", ref: currentTab => (this.currentTab = currentTab) }, h("div", { class: "s-rating-modal-rounded-icon" }, h("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" })), h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === 'shipping' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => (this.currentTab = currentTab) }, this.editItem.shipping.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == 'product' && this.editItem ? (h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => (this.currentTab = currentTab) }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details" }, h("div", { class: "s-rating-modal-product-info-row" }, h("div", { class: "s-rating-modal-product-img-wrap" }, h("img", { src: this.editItem.product.image.url, alt: this.editItem.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-product-title" }, this.editItem.product.name)), this.renderProductReviewFactors(this.editItem.product.id, 0, {
1320
+ return (h("salla-modal", { ref: modal => {
1321
+ if (modal)
1322
+ this.editModal = modal;
1323
+ }, width: "md", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-edit-wrapper", ref: el => {
1324
+ if (el)
1325
+ this.body = el;
1326
+ } }, this.editType === 'store' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "store", ref: currentTab => {
1327
+ if (currentTab)
1328
+ this.currentTab = currentTab;
1329
+ } }, h("div", { class: "s-rating-modal-rounded-icon" }, h("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" })), h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", value: this.editItem.content, class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType === 'shipping' && this.editItem ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step", "data-type": "shipping", ref: currentTab => {
1330
+ if (currentTab)
1331
+ this.currentTab = currentTab;
1332
+ } }, this.editItem.shipping.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.editItem.shipping.logo, class: "s-rating-modal-shipping-logo", alt: this.editItem.shipping.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.editItem.shipping.name}`), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large", editable: true, value: this.editItem.stars })), h("textarea", { name: "content", class: "s-rating-modal-comment", value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : null, this.editType == 'product' && this.editItem ? (h("section", { class: "s-rating-modal-step", "data-type": "products", ref: currentTab => {
1333
+ if (currentTab)
1334
+ this.currentTab = currentTab;
1335
+ } }, h("div", { class: "s-rating-modal-product" }, this.allowAttachImages && this.loyaltyPointsNote(), h("div", { class: "rating-outer-form", "data-stars-error": salla.lang.get('pages.rating.rate_product_stars') }, h("div", { class: "s-rating-modal-product-details" }, h("div", { class: "s-rating-modal-product-info-row" }, h("div", { class: "s-rating-modal-product-img-wrap" }, h("img", { src: this.editItem.product.image.url, alt: this.editItem.product.name, class: "s-rating-modal-product-img" })), h("h3", { class: "s-rating-modal-product-title" }, this.editItem.product.name)), this.renderProductReviewFactors(this.editItem.product.id, 0, {
1033
1336
  fieldPrefix: '',
1034
1337
  mainRating: this.editMainRating ?? Number(this.editItem.stars ?? this.editItem.rating),
1035
1338
  factorRatings: this.editFactorRatings,
1036
1339
  alwaysEditable: true,
1037
- }), h("input", { type: "hidden", name: "product_id", value: this.editItem.product.id }), h("textarea", { value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.allowAttachImages && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => (this.contentRefs[1] = el) }, h("salla-file-upload", { name: "images", allowMultiple: true, maxFilesCount: this.MAX_UPLOAD_LIMIT, imagePreviewHeight: 117, filePosterHeight: 117, "instant-upload": true, type: "feedback", files: JSON.stringify(this.editItemImages), payloadName: "files[]", id: `file-${this.editItem.product.id}`, title: this.editItem.product.name, instantUpload: true, accept: "image/png, image/jpeg, image/jpg", url: salla.url.api('upload'), onUploaded: e => {
1340
+ }), h("input", { type: "hidden", name: "product_id", value: this.editItem.product.id }), h("textarea", { value: this.editItem.content, placeholder: salla.lang.get('pages.rating.write_product_rate'), name: "comment", class: "s-rating-modal-comment" }), h("small", { class: "s-rating-modal-validation-msg" }))), this.canAttachMedia() && (h("div", { class: "s-rating-modal-uploader is-opened", ref: el => {
1341
+ if (el)
1342
+ this.contentRefs[1] = el;
1343
+ } }, h("salla-file-upload", { name: "images", allowMultiple: true, enableGallery: true, maxImagesCount: this.allowAttachImages ? this.MAX_IMAGE_UPLOAD_LIMIT : undefined, maxVideosCount: this.allowAttachVideos ? this.MAX_VIDEO_UPLOAD_LIMIT : undefined, maxVideoFileSize: this.allowAttachVideos ? this.MAX_VIDEO_FILE_SIZE : undefined, maxVideoDuration: this.allowAttachVideos ? this.MAX_VIDEO_DURATION : undefined, maxParallelUploads: this.MAX_PARALLEL_UPLOADS, imagePreviewHeight: 75, filePosterHeight: 75, "instant-upload": true, type: "feedback", files: JSON.stringify(this.editItemImages), payloadName: "files[]", id: `file-${this.editItem.product.id}`, title: this.editItem.product.name, instantUpload: true, accept: this.getMediaUploadAccept(), url: salla.url.api('upload'), onUploaded: e => {
1038
1344
  this.editItemImages = [
1039
1345
  ...this.editItemImages,
1040
1346
  e.detail,
1041
1347
  ];
1042
- this.hiddenInputs[1].value = this.editItemImages.map(img => img.url).join();
1348
+ const mediaCounts = countMediaByType(this.editItemImages);
1349
+ this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
1350
+ syncHiddenMediaInputs(this.hiddenInputs[1], this.editHiddenVideosInput, this.editItemImages);
1351
+ this.scheduleUploaderHeightRefresh();
1043
1352
  }, onRemoved: e => {
1044
1353
  const removedId = e.detail;
1045
1354
  if (!removedId)
1046
1355
  return;
1047
- this.editItemImages = this.editItemImages.filter(img => img.id !== removedId);
1048
- this.hiddenInputs[1].value = this.editItemImages.map(img => img.url).join();
1049
- }, labelIdle: this.getFilepondPlaceholder() }), h("input", { type: "hidden", name: "images", value: this.editItemImages.map(img => img.url).join(','), ref: el => (this.hiddenInputs[1] = el) }), this.renderUploadedImagesCount(this.editItem.product.id)))))) : null, h("div", { class: "s-rating-modal-footer s-rating-modal-footer-end" }, h("salla-button", { "loader-position": "center", onClick: () => this.editReview() }, this.editReviewLabel)))));
1356
+ this.editItemImages = removeUploadedImage(this.editItemImages, removedId);
1357
+ const mediaCounts = countMediaByType(this.editItemImages);
1358
+ this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
1359
+ syncHiddenMediaInputs(this.hiddenInputs[1], this.editHiddenVideosInput, this.editItemImages);
1360
+ this.scheduleUploaderHeightRefresh();
1361
+ }, labelIdle: this.getFilepondPlaceholder(), onGalleryUpdated: e => this.handleGalleryCountUpdate(this.editItem.product.id, e.detail) }), this.allowAttachImages && (h("input", { type: "hidden", name: "images", value: getMediaUrlsByType(this.editItemImages).images.join(','), ref: el => {
1362
+ if (el)
1363
+ this.hiddenInputs[1] = el;
1364
+ } })), this.allowAttachVideos && (h("input", { type: "hidden", name: "videos", value: getMediaUrlsByType(this.editItemImages).videos.join(','), ref: el => {
1365
+ if (el)
1366
+ this.editHiddenVideosInput = el;
1367
+ } })), this.renderUploadedImagesCount(this.editItem.product.id)))))) : null, h("div", { class: "s-rating-modal-footer s-rating-modal-footer-end" }, h("salla-button", { "loader-position": "center", loading: this.hasUploadsInProgress, disabled: this.hasUploadsInProgress, onClick: () => this.editReview() }, this.editReviewLabel)))));
1050
1368
  }
1051
1369
  render() {
1052
1370
  if (this.deleteMode) {
@@ -1056,14 +1374,32 @@ const SallaRatingModalV2 = class {
1056
1374
  return h(Host, { class: "s-rating-modal" }, this.getEditModal());
1057
1375
  }
1058
1376
  if (this.defaultMode) {
1059
- return (h(Host, { class: "s-rating-modal" }, h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "md", ref: modal => (this.modal = modal) }, h("div", { slot: "loading" }, h("div", { class: "s-rating-modal-skeleton" }, h("salla-skeleton", { type: "circle", height: "80px", width: "80px" }), h("salla-skeleton", { height: "15px", width: "60%" }), h("salla-skeleton", { height: "10px", width: "30%" }), h("div", { class: "s-rating-modal-skeleton-stars" }, [...Array(5)].map(v => (h("div", { key: v, innerHTML: Star })))), h("salla-skeleton", { height: "100px", width: "100%" }), h("div", { class: "s-rating-modal-skeleton-footer" }, h("salla-skeleton", { height: "40px", width: "30%" })))), !this.hasError && this.order ? ([
1060
- h("div", { class: "s-rating-modal-wrapper", ref: el => (this.body = el) }, this.isTestimonialsEnabled() ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, h("div", { class: "s-rating-modal-rounded-icon" }, h("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" })), h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), this.isProductsEnabled() &&
1061
- this.getRateableProducts().map((item, index) => this.renderProductStep(item, index)), this.isShippingEnabled() && this.order.shipping?.company ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => (this.thanksTab = el) }, h("span", { class: "s-rating-modal-icon", innerHTML: CheckCircle2 }), h("h3", { class: "s-rating-modal-thanks-title" }, salla.lang.get('pages.rating.thanks')), h("div", { class: "s-rating-modal-thanks-msg", innerHTML: this.order.thanks_message }), h("time", { class: "s-rating-modal-thanks-time", ref: el => (this.thanksTime = el) }))),
1377
+ return (h(Host, { class: "s-rating-modal" }, h("salla-modal", { class: "s-rating-modal-wrap", onModalVisibilityChanged: isOpen => this.resetData(isOpen), isLoading: true, width: "md", ref: modal => {
1378
+ if (modal)
1379
+ this.modal = modal;
1380
+ } }, h("div", { slot: "loading" }, h("div", { class: "s-rating-modal-skeleton" }, h("salla-skeleton", { type: "circle", height: "80px", width: "80px" }), h("salla-skeleton", { height: "15px", width: "60%" }), h("salla-skeleton", { height: "10px", width: "30%" }), h("div", { class: "s-rating-modal-skeleton-stars" }, [...Array(5)].map(v => (h("div", { key: v, innerHTML: Star })))), h("salla-skeleton", { height: "100px", width: "100%" }), h("div", { class: "s-rating-modal-skeleton-footer" }, h("salla-skeleton", { height: "40px", width: "30%" })))), !this.hasError && this.order ? ([
1381
+ h("div", { class: "s-rating-modal-wrapper", ref: el => {
1382
+ if (el)
1383
+ this.body = el;
1384
+ } }, this.isTestimonialsEnabled() ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "store" }, h("div", { class: "s-rating-modal-rounded-icon" }, h("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" })), h("h2", { class: "s-rating-modal-title" }, salla.lang.get('pages.rating.rate_the_store')), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_store_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), this.isProductsEnabled() &&
1385
+ this.getRateableProducts().map((item, index) => this.renderProductStep(item, index)), this.isShippingEnabled() && this.order.shipping?.company ? (h("div", { class: "rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden", "data-type": "shipping" }, h("input", { type: "hidden", name: "shipping_company_id", value: this.order.shipping.company.id }), this.order.shipping.company.logo ? (h("div", { class: "s-rating-modal-rounded-icon" }, h("img", { src: this.order.shipping.company.logo, class: "s-rating-modal-shipping-logo", alt: this.order.shipping.company.name }))) : (h("span", { class: "s-rating-modal-icon", innerHTML: ShippingFast })), h("div", { class: "s-rating-modal-title" }, ' ', `${salla.lang.get('pages.rating.rate_shipping')} ${this.order.shipping.company.name}`), h("div", { class: "s-rating-modal-stars-company" }, h("salla-rating-stars", { withLabel: true, size: "large" })), h("textarea", { name: "comment", class: "s-rating-modal-comment", placeholder: salla.lang.get('pages.rating.write_shipping_rate') }), h("small", { class: "s-rating-modal-validation-msg" }))) : (''), h("div", { class: "s-rating-modal-thanks s-rating-modal-hidden", ref: el => {
1386
+ if (el)
1387
+ this.thanksTab = el;
1388
+ } }, h("span", { class: "s-rating-modal-icon", innerHTML: CheckCircle2 }), h("h3", { class: "s-rating-modal-thanks-title" }, salla.lang.get('pages.rating.thanks')), h("div", { class: "s-rating-modal-thanks-msg", innerHTML: this.order.thanks_message }), h("time", { class: "s-rating-modal-thanks-time", ref: el => {
1389
+ if (el)
1390
+ this.thanksTime = el;
1391
+ } }))),
1062
1392
  this.allowContactSupport &&
1063
1393
  this.showContactWidget &&
1064
1394
  (salla.config.get('store.contacts.whatsapp') ||
1065
1395
  salla.config.get('store.contacts.email')) ? (h("div", { class: "s-rating-modal-contact" }, h("p", null, this.contactUsLabel), h("div", { class: "s-rating-modal-contact-icons" }, salla.config.get('store.contacts.whatsapp') && (h("span", { onClick: () => this.handleSendWhatsApp(), innerHTML: WhatsappIcon })), salla.config.get('store.contacts.email') && (h("span", { onClick: () => this.handleSendEmail(), innerHTML: email }))))) : (''),
1066
- h("div", { class: "s-rating-modal-footer" }, h("button", { ref: el => (this.backBtn = el), onClick: () => this.previousTab(), class: "s-rating-modal-btn s-rating-modal-unvisiable" }, salla.lang.get('common.elements.back')), this.stepsCount > 1 ? (h("ul", { class: "s-rating-modal-dots" }, [...Array(this.stepsCount)].map((_, v) => (h("li", { key: v, class: "s-rating-modal-bg-gray s-rating-modal-step-dot" }))))) : (''), h("salla-button", { "loader-position": "center", ref: el => (this.nextBtn = el), onClick: () => this.submit() }, salla.lang.get('common.elements.next'))),
1396
+ h("div", { class: "s-rating-modal-footer" }, h("button", { ref: el => {
1397
+ if (el)
1398
+ this.backBtn = el;
1399
+ }, onClick: () => this.previousTab(), class: "s-rating-modal-btn s-rating-modal-unvisiable" }, salla.lang.get('common.elements.back')), this.stepsCount > 1 ? (h("ul", { class: "s-rating-modal-dots" }, [...Array(this.stepsCount)].map((_, v) => (h("li", { key: v, class: "s-rating-modal-bg-gray s-rating-modal-step-dot" }))))) : (''), h("salla-button", { "loader-position": "center", loading: this.hasUploadsInProgress, disabled: this.hasUploadsInProgress, ref: el => {
1400
+ if (el)
1401
+ this.nextBtn = el;
1402
+ }, onClick: () => this.submit() }, salla.lang.get('common.elements.next'))),
1067
1403
  ]) : (h("salla-placeholder", { alignment: "center" })))));
1068
1404
  }
1069
1405
  }