@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
@@ -9,10 +9,13 @@ import Helper from "../../Helpers/Helper";
9
9
  import ImageIcon from "../../assets/svg/image.svg";
10
10
  import WhatsappIcon from "../../assets/svg/whatsapp2.svg";
11
11
  import MailIcon from "../../assets/svg/mail.svg";
12
+ import { buildMediaUploadAccept } from "../salla-file-upload/upload-limits";
13
+ import { MAX_IMAGE_UPLOAD_LIMIT, MAX_PARALLEL_UPLOADS, MAX_VIDEO_DURATION, MAX_VIDEO_FILE_SIZE, MAX_VIDEO_UPLOAD_LIMIT, countMediaByType, createPreloadedMediaItem, getMediaUrlsByType, isVideoUrl, normalizeSubmittedMedia, parseMediaField, removeUploadedImage, splitMediaUrls, syncHiddenMediaInputs, } from "./rating-modal-media";
12
14
  export class SallaRatingModalV2 {
13
15
  constructor() {
14
16
  this.hasError = false;
15
17
  this.showContactWidget = true;
18
+ this.errorMessage = '';
16
19
  this.images = [];
17
20
  this.productImages = {};
18
21
  this.editItemImages = [];
@@ -27,7 +30,12 @@ export class SallaRatingModalV2 {
27
30
  this.shouldOpenDeleteModal = false;
28
31
  this.editItem = null;
29
32
  this.allowAttachImages = false;
33
+ this.allowAttachVideos = false;
30
34
  this.allowContactSupport = false;
35
+ this.uploadCounts = {};
36
+ this.uploadImageCounts = {};
37
+ this.uploadVideoCounts = {};
38
+ this.hasUploadsInProgress = false;
31
39
  this.loyaltyImageRatingPoints = 0;
32
40
  this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
33
41
  this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
@@ -48,13 +56,19 @@ export class SallaRatingModalV2 {
48
56
  });
49
57
  this.contentRefs = [];
50
58
  this.hiddenInputs = [];
59
+ this.hiddenVideoInputs = [];
60
+ this.uploadingByProductId = {};
51
61
  this.userFilledFactorKeys = {};
52
62
  this.boundRatingRows = new WeakSet();
53
63
  this.stepsCount = 0;
54
64
  this.currentIndex = 0;
55
65
  this.submitted = [];
56
- this.MAX_UPLOAD_LIMIT = 3;
57
66
  this.thanksCountdownInterval = null;
67
+ this.MAX_IMAGE_UPLOAD_LIMIT = MAX_IMAGE_UPLOAD_LIMIT;
68
+ this.MAX_VIDEO_UPLOAD_LIMIT = MAX_VIDEO_UPLOAD_LIMIT;
69
+ this.MAX_VIDEO_FILE_SIZE = MAX_VIDEO_FILE_SIZE;
70
+ this.MAX_VIDEO_DURATION = MAX_VIDEO_DURATION;
71
+ this.MAX_PARALLEL_UPLOADS = MAX_PARALLEL_UPLOADS;
58
72
  this.scheduleWizardSetup = false;
59
73
  salla.lang.onLoaded(() => {
60
74
  this.contactUsLabel = salla.lang.get('blocks.footer.social');
@@ -85,8 +99,20 @@ export class SallaRatingModalV2 {
85
99
  await setNestedAsync('en.trans', 'pages.rating.review_deleted_successfully', 'The review has been successfully deleted.');
86
100
  await setNestedAsync('ar.trans', 'pages.rating.images_count', 'الصور ( :current من أصل :total )');
87
101
  await setNestedAsync('en.trans', 'pages.rating.images_count', 'Images ( :current of :total )');
88
- await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`);
89
- await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`);
102
+ await setNestedAsync('ar.trans', 'pages.rating.media_count', 'الصور (:imageCurrent/:imageTotal) · الفيديو (:videoCurrent/:videoTotal)');
103
+ await setNestedAsync('en.trans', 'pages.rating.media_count', 'Images (:imageCurrent/:imageTotal) · Videos (:videoCurrent/:videoTotal)');
104
+ await setNestedAsync('ar.trans', 'common.uploader.allowed_videos_types', 'يُسمح بفيديوهات mp4 أو mov أو avi أو mkv');
105
+ await setNestedAsync('en.trans', 'common.uploader.allowed_videos_types', 'Videos in mp4, mov, avi, or mkv format are allowed.');
106
+ await setNestedAsync('ar.trans', 'pages.rating.videos_count', 'الفيديو ( :current من أصل :total )');
107
+ await setNestedAsync('en.trans', 'pages.rating.videos_count', 'Videos ( :current of :total )');
108
+ await setNestedAsync('ar.trans', 'common.uploader.allowed_media_types', 'يُسمح بصور jpg أو jpeg أو png وفيديوهات mp4 أو mov أو avi أو mkv');
109
+ 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.');
110
+ await setNestedAsync('ar.trans', 'common.uploader.max_three_images', `أضف حتى ${MAX_IMAGE_UPLOAD_LIMIT} صور و ${MAX_VIDEO_UPLOAD_LIMIT} فيديوهات كحد أقصى`);
111
+ await setNestedAsync('en.trans', 'common.uploader.max_three_images', `Add up to ${MAX_IMAGE_UPLOAD_LIMIT} images and ${MAX_VIDEO_UPLOAD_LIMIT} videos maximum.`);
112
+ await setNestedAsync('ar.trans', 'common.uploader.max_images_count', 'أضف :count صور كحد أقصى');
113
+ await setNestedAsync('en.trans', 'common.uploader.max_images_count', 'Add up to :count images maximum.');
114
+ await setNestedAsync('ar.trans', 'common.uploader.max_videos_count', 'أضف :count فيديوهات كحد أقصى');
115
+ await setNestedAsync('en.trans', 'common.uploader.max_videos_count', 'Add up to :count videos maximum.');
90
116
  await setNestedAsync('ar.trans', 'common.elements.confirm_delete', 'تأكيد الحذف');
91
117
  await setNestedAsync('en.trans', 'common.elements.confirm_delete', 'Confirm deletion');
92
118
  await setNestedAsync('ar.trans', 'pages.rating.rate_required_factors', 'يرجى تقييم جميع المعايير لإتمام مراجعتك.');
@@ -96,8 +122,8 @@ export class SallaRatingModalV2 {
96
122
  await setNestedAsync('ar.trans', 'pages.rating.loyalty_points_for_images', 'اكسب :points نقطة ولاء عند إضافة صور لتقييمك!');
97
123
  await setNestedAsync('en.trans', 'pages.rating.loyalty_points_for_images', 'Earn :points loyalty points when adding photos to your review!');
98
124
  this.dragAndDropFilesLabel = salla.lang.get('common.uploader.drag_and_drop_files');
99
- this.allowedImagesTypesLabel = salla.lang.get('common.uploader.allowed_images_types');
100
- this.threeImagesMax = salla.lang.get('common.uploader.max_three_images');
125
+ this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
126
+ this.threeImagesMax = this.getMaxUploadHintLabel();
101
127
  this.contactSubjectLabel = salla.lang.get('pages.rating.contact_subject');
102
128
  this.editReviewLabel = salla.lang.get('pages.rating.edit_review');
103
129
  this.areYouSureLabel = salla.lang.get('pages.rating.are_you_sure_you_want_to_delete_review');
@@ -124,7 +150,70 @@ export class SallaRatingModalV2 {
124
150
  this.orderId = salla.config.get('page.id');
125
151
  }
126
152
  this.allowAttachImages = !!salla.config.get('store.settings.rating.allow_attach_images');
153
+ this.allowAttachVideos = !!salla.config.get('store.settings.rating.allow_attach_videos');
127
154
  this.allowContactSupport = !!salla.config.get('store.settings.rating.allow_contact_support');
155
+ this.refreshMediaLabels();
156
+ }
157
+ canAttachMedia() {
158
+ return this.allowAttachImages || this.allowAttachVideos;
159
+ }
160
+ getMediaUploadAccept() {
161
+ return buildMediaUploadAccept(this.allowAttachImages, this.allowAttachVideos);
162
+ }
163
+ refreshMediaLabels() {
164
+ this.allowedImagesTypesLabel = this.getAllowedMediaTypesLabel();
165
+ this.threeImagesMax = this.getMaxUploadHintLabel();
166
+ }
167
+ getAllowedMediaTypesLabel() {
168
+ if (this.allowAttachImages && this.allowAttachVideos) {
169
+ return salla.lang.get('common.uploader.allowed_media_types');
170
+ }
171
+ if (this.allowAttachImages) {
172
+ return salla.lang.get('common.uploader.allowed_images_types');
173
+ }
174
+ if (this.allowAttachVideos) {
175
+ return salla.lang.get('common.uploader.allowed_videos_types');
176
+ }
177
+ return '';
178
+ }
179
+ getMaxUploadHintLabel() {
180
+ if (this.allowAttachImages && this.allowAttachVideos) {
181
+ return salla.lang.get('common.uploader.max_three_images');
182
+ }
183
+ if (this.allowAttachImages) {
184
+ return salla.lang.get('common.uploader.max_images_count', {
185
+ count: this.MAX_IMAGE_UPLOAD_LIMIT,
186
+ });
187
+ }
188
+ if (this.allowAttachVideos) {
189
+ return salla.lang.get('common.uploader.max_videos_count', {
190
+ count: this.MAX_VIDEO_UPLOAD_LIMIT,
191
+ });
192
+ }
193
+ return '';
194
+ }
195
+ setUploadCount(productId, count, imageCount, videoCount) {
196
+ this.uploadCounts = { ...this.uploadCounts, [productId]: count };
197
+ if (imageCount != null) {
198
+ this.uploadImageCounts = { ...this.uploadImageCounts, [productId]: imageCount };
199
+ }
200
+ if (videoCount != null) {
201
+ this.uploadVideoCounts = { ...this.uploadVideoCounts, [productId]: videoCount };
202
+ }
203
+ }
204
+ setUploaderProcessing(productId, uploading) {
205
+ this.uploadingByProductId = { ...this.uploadingByProductId, [productId]: uploading };
206
+ this.hasUploadsInProgress = Object.values(this.uploadingByProductId).some(Boolean);
207
+ }
208
+ scheduleUploaderHeightRefresh() {
209
+ [50, 150, 350].forEach(delay => {
210
+ setTimeout(() => this.updateBodyHeight(), delay);
211
+ });
212
+ }
213
+ handleGalleryCountUpdate(productId, detail) {
214
+ this.setUploadCount(productId, detail.count, detail.imageCount, detail.videoCount);
215
+ this.setUploaderProcessing(productId, !!detail.uploading);
216
+ this.scheduleUploaderHeightRefresh();
128
217
  }
129
218
  /** Encrypted order id from page config / prop — used to fetch order details. */
130
219
  getRatingOrderId() {
@@ -270,7 +359,7 @@ export class SallaRatingModalV2 {
270
359
  return new Promise(resolve => {
271
360
  setTimeout(() => {
272
361
  this.modal
273
- .open()
362
+ ?.open()
274
363
  .then(() => this.order ||
275
364
  salla.api
276
365
  .withoutNotifier(() => salla.rating.api.order(this.getRatingOrderId()))
@@ -279,7 +368,7 @@ export class SallaRatingModalV2 {
279
368
  this.productReviewFactors = await this.fetchAllProductReviewFactors(res.data);
280
369
  }))
281
370
  .then(() => this.readyUpLoyaltyPoints())
282
- .then(() => this.modal.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
371
+ .then(() => this.modal?.setTitle(`${salla.lang.get('pages.rating.rate_order')} <span class="unicode">(#${this.order.id})</span>`))
283
372
  .then(() => {
284
373
  // Initialize productImages for all products
285
374
  const initialImages = {};
@@ -287,14 +376,15 @@ export class SallaRatingModalV2 {
287
376
  initialImages[item.product.id] = [];
288
377
  }
289
378
  this.productImages = initialImages;
379
+ this.uploadCounts = Object.fromEntries(Object.keys(initialImages).map(productId => [Number(productId), 0]));
290
380
  })
291
- .then(() => this.modal.stopLoading())
381
+ .then(() => this.modal?.stopLoading())
292
382
  .then(() => this.afterOrderLoaded())
293
- .catch(e => {
383
+ .catch((e) => {
294
384
  resolve(false);
295
385
  this.hasError = true;
296
386
  this.errorMessage = e.response?.data?.error?.message || e.response?.data;
297
- this.modal.stopLoading();
387
+ this.modal?.stopLoading();
298
388
  });
299
389
  resolve(true);
300
390
  }, 50);
@@ -316,7 +406,10 @@ export class SallaRatingModalV2 {
316
406
  this.editFactorRatings = { ...this.buildEditFactorRatings(this.editItem.product.id) };
317
407
  this.markExistingFactorRatingsAsUserFilled(this.editItem.product.id, this.editFactorRatings);
318
408
  }
319
- this.editModal.open();
409
+ this.editModal?.open();
410
+ if (this.editType === 'product' && this.canAttachMedia()) {
411
+ this.scheduleUploaderHeightRefresh();
412
+ }
320
413
  }
321
414
  catch (e) {
322
415
  this.hasError = true;
@@ -327,28 +420,56 @@ export class SallaRatingModalV2 {
327
420
  const endpoint = `rating/${feedbackId}/show`;
328
421
  const response = await salla.api.request(endpoint);
329
422
  this.editItem = response.data;
330
- if (this.allowAttachImages && this.editType == 'product' && this.editItem.images.length) {
331
- this.editItemImages = this.editItem.images.map(img => {
332
- return { id: `${Math.floor(100 + Math.random() * 900)}`, url: img };
333
- });
423
+ if (this.canAttachMedia() && this.editType == 'product') {
424
+ const imageUrls = (this.editItem.images || []).filter(Boolean);
425
+ const videoUrls = (this.editItem.videos || []).filter(Boolean);
426
+ let mediaUrls = [...imageUrls, ...videoUrls];
427
+ if (!videoUrls.length && imageUrls.length) {
428
+ const split = splitMediaUrls(imageUrls);
429
+ mediaUrls = [...split.images, ...split.videos];
430
+ }
431
+ mediaUrls = mediaUrls.filter(url => isVideoUrl(url) ? this.allowAttachVideos : this.allowAttachImages);
432
+ if (mediaUrls.length) {
433
+ this.editItemImages = mediaUrls.map(url => createPreloadedMediaItem(url));
434
+ const mediaCounts = countMediaByType(this.editItemImages);
435
+ this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
436
+ }
334
437
  }
335
438
  }
336
439
  async editReview() {
440
+ if (this.hasUploadsInProgress)
441
+ return;
337
442
  const endpoint = `rating/${this.editFeedbackId}`;
338
443
  let data;
339
444
  if (this.editType === 'product') {
340
- const container = this.editModal.querySelector('[data-type="products"]') || this.currentTab;
445
+ const container = this.editModal?.querySelector('[data-type="products"]') || this.currentTab;
341
446
  data = this.buildProductRatingPayload(this.collectFormData(container), container);
342
447
  if (!data.product_id && this.editItem?.product?.id) {
343
448
  data.product_id = String(this.editItem.product.id);
344
449
  }
450
+ if (this.canAttachMedia()) {
451
+ const { images, videos } = getMediaUrlsByType(this.editItemImages);
452
+ if (this.allowAttachImages) {
453
+ data.images = images;
454
+ }
455
+ if (this.allowAttachVideos) {
456
+ data.videos = videos;
457
+ }
458
+ }
459
+ normalizeSubmittedMedia(data, this.allowAttachImages, this.allowAttachVideos);
345
460
  }
346
461
  else {
347
462
  data = this.collectFormData(this.editModal);
348
- data.images && (data.images = data.images.split(','));
463
+ if (data.images) {
464
+ data.images = parseMediaField(data.images);
465
+ }
466
+ if (data.videos) {
467
+ data.videos = parseMediaField(data.videos);
468
+ }
469
+ normalizeSubmittedMedia(data, this.allowAttachImages, this.allowAttachVideos);
349
470
  }
350
- await salla.api.request(endpoint, data, 'put').then(res => {
351
- this.editModal.close();
471
+ await salla.api.request(endpoint, data, 'put').then((res) => {
472
+ this.editModal?.close();
352
473
  salla.notify.success(res.message || this.updatedSuccessfullyLabel);
353
474
  setTimeout(() => {
354
475
  window.location.reload();
@@ -362,14 +483,14 @@ export class SallaRatingModalV2 {
362
483
  this.shouldOpenDeleteModal = true;
363
484
  return new Promise(resolve => {
364
485
  setTimeout(() => {
365
- this.deleteModal.open().then(() => resolve(true));
486
+ this.deleteModal?.open().then(() => resolve(true));
366
487
  }, 50);
367
488
  });
368
489
  }
369
490
  async deleteReview() {
370
491
  const endpoint = `rating/${this.deleteFeedbackId}`;
371
492
  await salla.api.request(endpoint, null, 'delete').then(() => {
372
- this.deleteModal.close();
493
+ this.deleteModal?.close();
373
494
  salla.notify.success(this.deletedSuccessfullyLabel);
374
495
  setTimeout(() => {
375
496
  window.location.reload();
@@ -380,12 +501,12 @@ export class SallaRatingModalV2 {
380
501
  * Show the rating modal
381
502
  */
382
503
  async close() {
383
- return this.modal.close();
504
+ return this.modal?.close();
384
505
  }
385
506
  // handle wizard
386
507
  handleWizard() {
387
- this.steps = this.modal.querySelectorAll('.s-rating-modal-step');
388
- this.dots = this.modal.querySelectorAll('.s-rating-modal-step-dot');
508
+ this.steps = this.modal?.querySelectorAll('.s-rating-modal-step');
509
+ this.dots = this.modal?.querySelectorAll('.s-rating-modal-step-dot');
389
510
  if (this.stepsCount === 0) {
390
511
  this.showThankYou();
391
512
  return;
@@ -401,18 +522,18 @@ export class SallaRatingModalV2 {
401
522
  }
402
523
  showActiveStep(current = null) {
403
524
  this.refreshWizardRefs();
404
- this.currentTab = current || this.steps[this.currentIndex];
525
+ this.currentTab = current || this.steps?.[this.currentIndex];
405
526
  if (!this.currentTab) {
406
527
  return;
407
528
  }
408
- 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);
529
+ 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);
409
530
  if (this.currentIndex !== 0) {
410
531
  // the animation
411
532
  Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-unactive', 's-rating-modal-hidden', () => true);
412
533
  setTimeout(() => Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-active', 's-rating-modal-unactive', () => true), 300);
413
534
  }
414
535
  // Btn text
415
- const nextType = this.steps[this.currentIndex + 1]?.dataset.type;
536
+ const nextType = this.steps?.[this.currentIndex + 1]?.dataset.type;
416
537
  this.nextBtn?.setText(nextType
417
538
  ? `${salla.lang.get('pages.rating.rate')} ${salla.lang.get(`pages.rating.${nextType}`)}`
418
539
  : salla.lang.get('pages.rating.send_ratings'));
@@ -437,13 +558,15 @@ export class SallaRatingModalV2 {
437
558
  this.showActiveStep();
438
559
  }
439
560
  async submit() {
561
+ if (this.hasUploadsInProgress)
562
+ return;
440
563
  this.refreshWizardRefs();
441
564
  try {
442
565
  if (!this.submittedBefore()) {
443
566
  this.validate();
444
567
  }
445
568
  salla.config.canLeave = false;
446
- await this.nextBtn.load();
569
+ await this.nextBtn?.load();
447
570
  if (!this.submittedBefore()) {
448
571
  await this.sendFeedback();
449
572
  }
@@ -461,7 +584,7 @@ export class SallaRatingModalV2 {
461
584
  }
462
585
  }
463
586
  finally {
464
- this.nextBtn.stop();
587
+ this.nextBtn?.stop();
465
588
  salla.config.canLeave = true;
466
589
  }
467
590
  }
@@ -489,6 +612,9 @@ export class SallaRatingModalV2 {
489
612
  inputs.push(input);
490
613
  };
491
614
  container.querySelectorAll('[name]').forEach((input) => {
615
+ if (input.closest('salla-file-upload')) {
616
+ return;
617
+ }
492
618
  addInput(input);
493
619
  });
494
620
  container.querySelectorAll('salla-rating-stars').forEach((stars) => {
@@ -509,25 +635,28 @@ export class SallaRatingModalV2 {
509
635
  return [];
510
636
  }
511
637
  validate(rating = null, type = null) {
512
- if (!rating && this.currentTab.dataset.type === 'products') {
638
+ if (!rating && this.currentTab?.dataset?.type === 'products') {
513
639
  const ratingForms = this.currentTab.querySelectorAll('.rating-outer-form');
514
- ratingForms.forEach(ratingForm => this.validate(ratingForm, 'product'));
640
+ ratingForms.forEach((ratingForm) => this.validate(ratingForm, 'product'));
515
641
  return;
516
642
  }
517
- rating = rating || this.currentTab;
518
- const mainRatingRow = rating.querySelector('.s-rating-modal-product-rating-row-main');
519
- const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || rating);
643
+ const resolvedRating = rating ?? this.currentTab;
644
+ if (!resolvedRating) {
645
+ return;
646
+ }
647
+ const mainRatingRow = resolvedRating.querySelector('.s-rating-modal-product-rating-row-main');
648
+ const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || resolvedRating);
520
649
  const stars = mainRatingInput?.value;
521
- const validationMessage = rating.querySelector('.s-rating-modal-validation-msg');
522
- type = type || rating.dataset.type;
650
+ const validationMessage = resolvedRating.querySelector('.s-rating-modal-validation-msg');
651
+ const resolvedType = type || resolvedRating.getAttribute('data-type');
523
652
  if (!stars) {
524
653
  validationMessage.innerHTML = salla.lang
525
- .get(`pages.rating.rate_${type}_stars`)
654
+ .get(`pages.rating.rate_${resolvedType}_stars`)
526
655
  .replace(' (:item)', '');
527
656
  throw new Error(validationMessage.innerHTML);
528
657
  }
529
- if (type === 'product') {
530
- const requiredFactorRows = Array.from(rating.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]'));
658
+ if (resolvedType === 'product') {
659
+ const requiredFactorRows = Array.from(resolvedRating.querySelectorAll('.s-rating-modal-product-factor-row[data-required="true"]'));
531
660
  const hasMissingRequiredFactor = requiredFactorRows.some((row) => {
532
661
  const factorStarsInput = this.getRatingHiddenInput(row);
533
662
  return !factorStarsInput?.value;
@@ -537,9 +666,13 @@ export class SallaRatingModalV2 {
537
666
  throw new Error(validationMessage.innerHTML);
538
667
  }
539
668
  }
540
- validationMessage.innerHTML = '';
669
+ if (validationMessage) {
670
+ validationMessage.innerHTML = '';
671
+ }
541
672
  }
542
673
  collectFormData(container = this.currentTab) {
674
+ if (!container)
675
+ return {};
543
676
  const data = {};
544
677
  this.collectNamedInputs(container).forEach((input) => {
545
678
  const inputData = salla.helpers.inputData(input.name, input.value, data);
@@ -548,6 +681,8 @@ export class SallaRatingModalV2 {
548
681
  return data;
549
682
  }
550
683
  buildProductRatingPayload(data, container = this.currentTab) {
684
+ if (!container)
685
+ return {};
551
686
  if (!data.rating) {
552
687
  const mainRatingRow = container.querySelector('.s-rating-modal-product-rating-row-main');
553
688
  const mainRatingInput = this.getRatingHiddenInput(mainRatingRow || container);
@@ -557,15 +692,24 @@ export class SallaRatingModalV2 {
557
692
  }
558
693
  const productId = Number(data.product_id);
559
694
  let images = [];
695
+ let videos = [];
560
696
  if (data.images) {
561
- images =
562
- typeof data.images === 'string' ? data.images.split(',').filter(Boolean) : data.images;
697
+ images = parseMediaField(data.images);
698
+ }
699
+ else if (this.editMode && this.canAttachMedia() && productId) {
700
+ images = getMediaUrlsByType(this.editItemImages).images;
701
+ }
702
+ else if (this.canAttachMedia() && productId) {
703
+ images = getMediaUrlsByType(this.productImages[productId] || []).images;
563
704
  }
564
- else if (this.editMode && this.allowAttachImages && productId) {
565
- images = this.editItemImages.map(img => img.url);
705
+ if (data.videos) {
706
+ videos = parseMediaField(data.videos);
566
707
  }
567
- else if (this.allowAttachImages && productId) {
568
- images = (this.productImages[productId] || []).map(img => img.url);
708
+ else if (this.editMode && this.canAttachMedia() && productId) {
709
+ videos = getMediaUrlsByType(this.editItemImages).videos;
710
+ }
711
+ else if (this.canAttachMedia() && productId) {
712
+ videos = getMediaUrlsByType(this.productImages[productId] || []).videos;
569
713
  }
570
714
  const factors = this.normalizeFactorsList(data.factors)
571
715
  .filter(factor => factor?.id && factor?.rating)
@@ -573,15 +717,21 @@ export class SallaRatingModalV2 {
573
717
  id: String(factor.id),
574
718
  rating: String(factor.rating),
575
719
  }));
576
- return {
720
+ const payload = {
577
721
  order_id: this.getSubmitOrderId(),
578
722
  product_id: String(data.product_id),
579
723
  rating: String(data.rating),
580
724
  comment: data.comment || data.content || '',
581
- images,
582
725
  factors,
583
726
  type: 'products',
584
727
  };
728
+ if (this.allowAttachImages) {
729
+ payload.images = images;
730
+ }
731
+ if (this.allowAttachVideos) {
732
+ payload.videos = videos;
733
+ }
734
+ return payload;
585
735
  }
586
736
  async sendFeedback() {
587
737
  this.refreshWizardRefs();
@@ -602,6 +752,9 @@ export class SallaRatingModalV2 {
602
752
  }
603
753
  data.order_id = this.getSubmitOrderId();
604
754
  data.type = stepType;
755
+ if (!stepType) {
756
+ return;
757
+ }
605
758
  const res = await salla.rating.api[stepType](data);
606
759
  this.submitted.push(this.currentIndex);
607
760
  return res;
@@ -616,6 +769,8 @@ export class SallaRatingModalV2 {
616
769
  let seconds = 10;
617
770
  this.clearThanksCountdown();
618
771
  this.thanksCountdownInterval = setInterval(() => {
772
+ if (!this.thanksTime)
773
+ return;
619
774
  this.thanksTime.innerHTML = `00:0${seconds--}`;
620
775
  if (seconds > 0) {
621
776
  return;
@@ -624,7 +779,7 @@ export class SallaRatingModalV2 {
624
779
  this.thanksTime.remove();
625
780
  this.close().then(() => window.location.reload());
626
781
  }, 1000);
627
- this.modal.querySelector('.s-rating-modal-footer').classList.add('s-rating-modal-unvisiable');
782
+ this.modal?.querySelector('.s-rating-modal-footer')?.classList.add('s-rating-modal-unvisiable');
628
783
  this.showActiveStep(this.thanksTab);
629
784
  }
630
785
  getFilepondPlaceholder() {
@@ -932,26 +1087,41 @@ export class SallaRatingModalV2 {
932
1087
  }, {});
933
1088
  }
934
1089
  renderProductStep(item, index) {
935
- 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 => {
1090
+ 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 => {
1091
+ if (el)
1092
+ this.contentRefs[index] = el;
1093
+ } }, 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 => {
1094
+ const productId = item.product.id;
1095
+ const nextImages = [...(this.productImages[productId] || []), e.detail];
936
1096
  this.productImages = {
937
1097
  ...this.productImages,
938
- [item.product.id]: [...(this.productImages[item.product.id] || []), e.detail],
1098
+ [productId]: nextImages,
939
1099
  };
940
- this.hiddenInputs[index].value = this.productImages[item.product.id]
941
- .map(img => img.url)
942
- .join(',');
1100
+ const mediaCounts = countMediaByType(nextImages);
1101
+ this.setUploadCount(productId, nextImages.length, mediaCounts.image, mediaCounts.video);
1102
+ syncHiddenMediaInputs(this.hiddenInputs[index], this.hiddenVideoInputs[index], nextImages);
1103
+ this.scheduleUploaderHeightRefresh();
943
1104
  }, onRemoved: e => {
944
1105
  const removedId = e.detail;
945
- if (!removedId || !this.productImages[item.product.id])
1106
+ const productId = item.product.id;
1107
+ if (!removedId || !this.productImages[productId])
946
1108
  return;
1109
+ const nextImages = removeUploadedImage(this.productImages[productId], removedId);
947
1110
  this.productImages = {
948
1111
  ...this.productImages,
949
- [item.product.id]: this.productImages[item.product.id].filter(img => img.id !== removedId),
1112
+ [productId]: nextImages,
950
1113
  };
951
- this.hiddenInputs[index].value = this.productImages[item.product.id]
952
- .map(img => img.url)
953
- .join(',');
954
- }, 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))))));
1114
+ const mediaCounts = countMediaByType(nextImages);
1115
+ this.setUploadCount(productId, nextImages.length, mediaCounts.image, mediaCounts.video);
1116
+ syncHiddenMediaInputs(this.hiddenInputs[index], this.hiddenVideoInputs[index], nextImages);
1117
+ this.scheduleUploaderHeightRefresh();
1118
+ }, 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 => {
1119
+ if (el)
1120
+ this.hiddenInputs[index] = el;
1121
+ } })), this.allowAttachVideos && (h("input", { type: "hidden", name: "videos", value: getMediaUrlsByType(this.productImages[item.product.id] || []).videos.join(','), ref: el => {
1122
+ if (el)
1123
+ this.hiddenVideoInputs[index] = el;
1124
+ } })), this.renderUploadedImagesCount(item.product.id))))));
955
1125
  }
956
1126
  renderProductReviewFactors(productId, index, options = {}) {
957
1127
  const factors = this.productReviewFactors[productId] || [];
@@ -971,16 +1141,22 @@ export class SallaRatingModalV2 {
971
1141
  const normalized = Number(byId ?? byName ?? byIndex);
972
1142
  return Number.isNaN(normalized) ? undefined : normalized;
973
1143
  };
974
- 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 ||
1144
+ 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 ||
975
1145
  typeof getPrefilledFactorRating(factor, factorIndex) === 'number', withLabel: true, labelBeforeStars: true, tag: false }))))));
976
1146
  }
977
1147
  handleSendEmail() {
1148
+ if (!this.order) {
1149
+ return;
1150
+ }
978
1151
  const subject = `${this.contactSubjectLabel} #${this.order.id}`;
979
1152
  const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
980
1153
  const mailtoLink = `mailto:${salla.config.get('store.contacts.email')}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
981
1154
  window.open(mailtoLink, '_blank');
982
1155
  }
983
1156
  handleSendWhatsApp() {
1157
+ if (!this.order) {
1158
+ return;
1159
+ }
984
1160
  const body = this.contact_body(salla.config.get('store.name'), this.order.id, this.getCustomerName());
985
1161
  const whatsappLink = `https://wa.me/${salla.config.get('store.contacts.whatsapp')}?text=${encodeURIComponent(body)}`;
986
1162
  window.open(whatsappLink, '_blank');
@@ -998,9 +1174,16 @@ export class SallaRatingModalV2 {
998
1174
  this.productFactorRatings = {};
999
1175
  this.editMainRating = undefined;
1000
1176
  this.userFilledFactorKeys = {};
1177
+ this.uploadingByProductId = {};
1178
+ this.hasUploadsInProgress = false;
1001
1179
  this.hiddenInputs[1] && (this.hiddenInputs[1].value = '');
1002
- this.deleteFeedbackId = null;
1003
- this.editFeedbackId = null;
1180
+ this.editHiddenVideosInput && (this.editHiddenVideosInput.value = '');
1181
+ if (this.body) {
1182
+ this.body.style.height = '';
1183
+ this.body.style.minHeight = '';
1184
+ }
1185
+ this.deleteFeedbackId = undefined;
1186
+ this.editFeedbackId = undefined;
1004
1187
  this.shouldOpenDeleteModal = false;
1005
1188
  this.editMode = false;
1006
1189
  this.deleteMode = false;
@@ -1011,37 +1194,90 @@ export class SallaRatingModalV2 {
1011
1194
  this.loyaltyImageRatingPoints = 0;
1012
1195
  }
1013
1196
  getDeleteModal() {
1014
- 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)))));
1197
+ return (h("salla-modal", { ref: modal => {
1198
+ if (modal)
1199
+ this.deleteModal = modal;
1200
+ }, width: "xs", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-delete-wrapper", ref: el => {
1201
+ if (el)
1202
+ this.body = el;
1203
+ } }, 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)))));
1015
1204
  }
1016
1205
  renderUploadedImagesCount(productId) {
1017
- // In edit mode, use editItemImages; in default mode, use productImages
1018
- const imageCount = this.editMode
1019
- ? this.editItemImages.length
1020
- : (this.productImages[productId] || []).length;
1021
- return (h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.images_count', imageCount, {
1022
- current: imageCount,
1023
- total: this.MAX_UPLOAD_LIMIT,
1024
- })));
1206
+ const items = this.editMode ? this.editItemImages : this.productImages[productId] || [];
1207
+ const mediaCounts = countMediaByType(items);
1208
+ const imageCount = this.uploadImageCounts[productId] ?? mediaCounts.image;
1209
+ const videoCount = this.uploadVideoCounts[productId] ?? mediaCounts.video;
1210
+ if (this.allowAttachImages && this.allowAttachVideos) {
1211
+ return (h("span", { class: "s-rating-modal-upload-count" }, salla.lang.get('pages.rating.media_count', {
1212
+ imageCurrent: imageCount,
1213
+ imageTotal: this.MAX_IMAGE_UPLOAD_LIMIT,
1214
+ videoCurrent: videoCount,
1215
+ videoTotal: this.MAX_VIDEO_UPLOAD_LIMIT,
1216
+ })));
1217
+ }
1218
+ if (this.allowAttachImages) {
1219
+ return (h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.images_count', imageCount, {
1220
+ current: imageCount,
1221
+ total: this.MAX_IMAGE_UPLOAD_LIMIT,
1222
+ })));
1223
+ }
1224
+ if (this.allowAttachVideos) {
1225
+ return (h("span", { class: "s-rating-modal-upload-count" }, salla.lang.choice('pages.rating.videos_count', videoCount, {
1226
+ current: videoCount,
1227
+ total: this.MAX_VIDEO_UPLOAD_LIMIT,
1228
+ })));
1229
+ }
1230
+ return null;
1025
1231
  }
1026
1232
  getEditModal() {
1027
- 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, {
1233
+ return (h("salla-modal", { ref: modal => {
1234
+ if (modal)
1235
+ this.editModal = modal;
1236
+ }, width: "md", onModalVisibilityChanged: isOpen => this.resetData(isOpen) }, h("div", { class: "s-rating-modal-edit-wrapper", ref: el => {
1237
+ if (el)
1238
+ this.body = el;
1239
+ } }, 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 => {
1240
+ if (currentTab)
1241
+ this.currentTab = currentTab;
1242
+ } }, 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 => {
1243
+ if (currentTab)
1244
+ this.currentTab = currentTab;
1245
+ } }, 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 => {
1246
+ if (currentTab)
1247
+ this.currentTab = currentTab;
1248
+ } }, 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, {
1028
1249
  fieldPrefix: '',
1029
1250
  mainRating: this.editMainRating ?? Number(this.editItem.stars ?? this.editItem.rating),
1030
1251
  factorRatings: this.editFactorRatings,
1031
1252
  alwaysEditable: true,
1032
- }), 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 => {
1253
+ }), 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 => {
1254
+ if (el)
1255
+ this.contentRefs[1] = el;
1256
+ } }, 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 => {
1033
1257
  this.editItemImages = [
1034
1258
  ...this.editItemImages,
1035
1259
  e.detail,
1036
1260
  ];
1037
- this.hiddenInputs[1].value = this.editItemImages.map(img => img.url).join();
1261
+ const mediaCounts = countMediaByType(this.editItemImages);
1262
+ this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
1263
+ syncHiddenMediaInputs(this.hiddenInputs[1], this.editHiddenVideosInput, this.editItemImages);
1264
+ this.scheduleUploaderHeightRefresh();
1038
1265
  }, onRemoved: e => {
1039
1266
  const removedId = e.detail;
1040
1267
  if (!removedId)
1041
1268
  return;
1042
- this.editItemImages = this.editItemImages.filter(img => img.id !== removedId);
1043
- this.hiddenInputs[1].value = this.editItemImages.map(img => img.url).join();
1044
- }, 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)))));
1269
+ this.editItemImages = removeUploadedImage(this.editItemImages, removedId);
1270
+ const mediaCounts = countMediaByType(this.editItemImages);
1271
+ this.setUploadCount(this.editItem.product.id, this.editItemImages.length, mediaCounts.image, mediaCounts.video);
1272
+ syncHiddenMediaInputs(this.hiddenInputs[1], this.editHiddenVideosInput, this.editItemImages);
1273
+ this.scheduleUploaderHeightRefresh();
1274
+ }, 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 => {
1275
+ if (el)
1276
+ this.hiddenInputs[1] = el;
1277
+ } })), this.allowAttachVideos && (h("input", { type: "hidden", name: "videos", value: getMediaUrlsByType(this.editItemImages).videos.join(','), ref: el => {
1278
+ if (el)
1279
+ this.editHiddenVideosInput = el;
1280
+ } })), 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)))));
1045
1281
  }
1046
1282
  render() {
1047
1283
  if (this.deleteMode) {
@@ -1051,14 +1287,32 @@ export class SallaRatingModalV2 {
1051
1287
  return h(Host, { class: "s-rating-modal" }, this.getEditModal());
1052
1288
  }
1053
1289
  if (this.defaultMode) {
1054
- 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 ? ([
1055
- 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() &&
1056
- 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) }))),
1290
+ 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 => {
1291
+ if (modal)
1292
+ this.modal = modal;
1293
+ } }, 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 ? ([
1294
+ h("div", { class: "s-rating-modal-wrapper", ref: el => {
1295
+ if (el)
1296
+ this.body = el;
1297
+ } }, 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() &&
1298
+ 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 => {
1299
+ if (el)
1300
+ this.thanksTab = el;
1301
+ } }, 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 => {
1302
+ if (el)
1303
+ this.thanksTime = el;
1304
+ } }))),
1057
1305
  this.allowContactSupport &&
1058
1306
  this.showContactWidget &&
1059
1307
  (salla.config.get('store.contacts.whatsapp') ||
1060
1308
  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: MailIcon }))))) : (''),
1061
- 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'))),
1309
+ h("div", { class: "s-rating-modal-footer" }, h("button", { ref: el => {
1310
+ if (el)
1311
+ this.backBtn = el;
1312
+ }, 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 => {
1313
+ if (el)
1314
+ this.nextBtn = el;
1315
+ }, onClick: () => this.submit() }, salla.lang.get('common.elements.next'))),
1062
1316
  ]) : (h("salla-placeholder", { alignment: "center" })))));
1063
1317
  }
1064
1318
  }
@@ -1099,7 +1353,7 @@ export class SallaRatingModalV2 {
1099
1353
  "references": {}
1100
1354
  },
1101
1355
  "required": false,
1102
- "optional": false,
1356
+ "optional": true,
1103
1357
  "docs": {
1104
1358
  "tags": [],
1105
1359
  "text": "The order id, to rate on its products & shipping"
@@ -1134,7 +1388,12 @@ export class SallaRatingModalV2 {
1134
1388
  "deleteFeedbackId": {},
1135
1389
  "editItem": {},
1136
1390
  "allowAttachImages": {},
1391
+ "allowAttachVideos": {},
1137
1392
  "allowContactSupport": {},
1393
+ "uploadCounts": {},
1394
+ "uploadImageCounts": {},
1395
+ "uploadVideoCounts": {},
1396
+ "hasUploadsInProgress": {},
1138
1397
  "loyaltyImageRatingPoints": {}
1139
1398
  };
1140
1399
  }
@@ -1149,6 +1408,10 @@ export class SallaRatingModalV2 {
1149
1408
  "location": "global",
1150
1409
  "id": "global::Promise"
1151
1410
  },
1411
+ "OrderFeedbackResponse": {
1412
+ "location": "global",
1413
+ "id": "global::OrderFeedbackResponse"
1414
+ },
1152
1415
  "Record": {
1153
1416
  "location": "global",
1154
1417
  "id": "global::Record"
@@ -1188,10 +1451,10 @@ export class SallaRatingModalV2 {
1188
1451
  },
1189
1452
  "openDeleteModal": {
1190
1453
  "complexType": {
1191
- "signature": "(params: any) => Promise<unknown>",
1454
+ "signature": "(params: { feedback_id: number; }) => Promise<unknown>",
1192
1455
  "parameters": [{
1193
1456
  "name": "params",
1194
- "type": "any",
1457
+ "type": "{ feedback_id: number; }",
1195
1458
  "docs": ""
1196
1459
  }],
1197
1460
  "references": {