@salla.sa/twilight-components 2.14.380 → 2.14.381

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 (291) hide show
  1. package/dist/cjs/{filepond-OhCwnn9l.js → filepond-CsqfBzs3.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-BjJJ863B.js → filepond-plugin-file-poster-BWhvanmU.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-D5nJzX3z.js → filepond-plugin-file-validate-size-noIyy5Yp.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-D13Iiqqr.js → filepond-plugin-file-validate-type-N76Wh7ZL.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-ClQqTYlQ.js → filepond-plugin-image-edit-BkgUR4kG.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BTOdKQOQ.js → filepond-plugin-image-exif-orientation-DLFISFCC.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Dsci6Rtb.js → filepond-plugin-image-preview-CtTDfIQp.js} +1 -1
  8. package/dist/cjs/{index-DH1vX5Bt.js → index-B-K6ToCR.js} +1 -1
  9. package/dist/cjs/{index-CHRvLWS8.js → index-Bxxuur88.js} +2 -2
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion-body_3.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +4 -2
  13. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +5 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +8 -2
  17. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  19. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-comment-form_8.cjs.entry.js +2 -2
  22. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-count-down_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-custom-fields.cjs.entry.js +5 -1
  27. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-hook.cjs.entry.js +6 -2
  31. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-localization-modal.cjs.entry.js +144 -43
  35. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +6 -4
  43. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +10 -6
  44. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +2 -2
  45. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-order-details.cjs.entry.js +2 -2
  52. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-rating-modal.cjs.entry.js +5 -3
  64. package/dist/cjs/salla-scopes.cjs.entry.js +5 -1
  65. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-user-menu.cjs.entry.js +4 -4
  75. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  79. package/dist/cjs/twilight.cjs.js +2 -2
  80. package/dist/cjs/{vanilla-picker-BZ7Tbldp.js → vanilla-picker-DDwsUdkB.js} +1 -1
  81. package/dist/collection/components/salla-accordion/salla-accordion.js +5 -3
  82. package/dist/collection/components/salla-advertisement/salla-advertisement.js +4 -0
  83. package/dist/collection/components/salla-app-install-alert/salla-app-install-alert.js +7 -1
  84. package/dist/collection/components/salla-custom-fields/salla-custom-fields.js +12 -8
  85. package/dist/collection/components/salla-hook/salla-hook.js +12 -5
  86. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +165 -47
  87. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +3 -2
  88. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +4 -3
  89. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +12 -9
  90. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +7 -6
  91. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +2 -2
  92. package/dist/collection/components/salla-order-details/salla-order-details.js +2 -2
  93. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +4 -2
  94. package/dist/collection/components/salla-review-card/salla-review-card.js +2 -2
  95. package/dist/collection/components/salla-scopes/salla-scopes.js +4 -0
  96. package/dist/collection/components/salla-user-menu/salla-user-menu.js +7 -7
  97. package/dist/components/index.js +2 -2
  98. package/dist/components/salla-accordion2.js +3 -1
  99. package/dist/components/salla-advertisement.js +4 -0
  100. package/dist/components/salla-app-install-alert.js +7 -1
  101. package/dist/components/salla-custom-fields.js +4 -0
  102. package/dist/components/salla-hook.js +5 -1
  103. package/dist/components/salla-localization-modal.js +144 -43
  104. package/dist/components/salla-multiple-bundle-product-cart2.js +2 -1
  105. package/dist/components/salla-multiple-bundle-product-details2.js +3 -2
  106. package/dist/components/salla-multiple-bundle-product-options-modal2.js +7 -4
  107. package/dist/components/salla-multiple-bundle-product-slider2.js +2 -1
  108. package/dist/components/salla-multiple-bundle-product.js +1 -1
  109. package/dist/components/salla-order-details.js +1 -1
  110. package/dist/components/salla-rating-modal.js +4 -2
  111. package/dist/components/salla-review-card2.js +1 -1
  112. package/dist/components/salla-scopes.js +4 -0
  113. package/dist/components/salla-user-menu.js +4 -4
  114. package/dist/esm/{filepond-BgLkbAlS.js → filepond-Dw5LLI9G.js} +1 -1
  115. package/dist/esm/{filepond-plugin-file-poster-s4m5zTQ5.js → filepond-plugin-file-poster-BQve1M8B.js} +1 -1
  116. package/dist/esm/{filepond-plugin-file-validate-size-EfVTIVeK.js → filepond-plugin-file-validate-size-Mq0exUD8.js} +1 -1
  117. package/dist/esm/{filepond-plugin-file-validate-type-Chg0gvtx.js → filepond-plugin-file-validate-type-BjZfWuzA.js} +1 -1
  118. package/dist/esm/{filepond-plugin-image-edit-DvIjoDsi.js → filepond-plugin-image-edit-B_Mw4seW.js} +1 -1
  119. package/dist/esm/{filepond-plugin-image-exif-orientation-kE8T9OkA.js → filepond-plugin-image-exif-orientation-D1rHHcpP.js} +1 -1
  120. package/dist/esm/{filepond-plugin-image-preview-BJAUCA1P.js → filepond-plugin-image-preview-CSOxFeXE.js} +1 -1
  121. package/dist/esm/{index-eEimxoFN.js → index-BpoZBzEy.js} +2 -2
  122. package/dist/esm/{index-BAJAa57P.js → index-COcTESat.js} +1 -1
  123. package/dist/esm/loader.js +3 -3
  124. package/dist/esm/salla-accordion-body_3.entry.js +1 -1
  125. package/dist/esm/salla-accordion_6.entry.js +4 -2
  126. package/dist/esm/salla-add-product-button_4.entry.js +1 -1
  127. package/dist/esm/salla-advertisement.entry.js +5 -1
  128. package/dist/esm/salla-alert_2.entry.js +1 -1
  129. package/dist/esm/salla-app-install-alert.entry.js +8 -2
  130. package/dist/esm/salla-apps-icons.entry.js +1 -1
  131. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  132. package/dist/esm/salla-bullet-delivery.entry.js +1 -1
  133. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  134. package/dist/esm/salla-comment-form_8.entry.js +2 -2
  135. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  136. package/dist/esm/salla-contacts.entry.js +1 -1
  137. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  138. package/dist/esm/salla-count-down_2.entry.js +1 -1
  139. package/dist/esm/salla-custom-fields.entry.js +5 -1
  140. package/dist/esm/salla-filters-widget.entry.js +1 -1
  141. package/dist/esm/salla-filters.entry.js +1 -1
  142. package/dist/esm/salla-gifting.entry.js +1 -1
  143. package/dist/esm/salla-hook.entry.js +6 -2
  144. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  145. package/dist/esm/salla-installment.entry.js +1 -1
  146. package/dist/esm/salla-list-tile.entry.js +1 -1
  147. package/dist/esm/salla-localization-modal.entry.js +144 -43
  148. package/dist/esm/salla-login-modal.entry.js +1 -1
  149. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  150. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  151. package/dist/esm/salla-loyalty.entry.js +1 -1
  152. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  153. package/dist/esm/salla-menu.entry.js +1 -1
  154. package/dist/esm/salla-metadata.entry.js +1 -1
  155. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +6 -4
  156. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +10 -6
  157. package/dist/esm/salla-multiple-bundle-product.entry.js +2 -2
  158. package/dist/esm/salla-notification-item.entry.js +1 -1
  159. package/dist/esm/salla-notifications.entry.js +1 -1
  160. package/dist/esm/salla-offer-modal.entry.js +1 -1
  161. package/dist/esm/salla-offer.entry.js +1 -1
  162. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  163. package/dist/esm/salla-order-details-options.entry.js +1 -1
  164. package/dist/esm/salla-order-details.entry.js +2 -2
  165. package/dist/esm/salla-order-summary.entry.js +1 -1
  166. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  167. package/dist/esm/salla-orders.entry.js +1 -1
  168. package/dist/esm/salla-payments.entry.js +1 -1
  169. package/dist/esm/salla-placeholder.entry.js +1 -1
  170. package/dist/esm/salla-price-range.entry.js +1 -1
  171. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  172. package/dist/esm/salla-products-list.entry.js +1 -1
  173. package/dist/esm/salla-products-slider.entry.js +1 -1
  174. package/dist/esm/salla-progress-bar.entry.js +1 -1
  175. package/dist/esm/salla-quick-order.entry.js +1 -1
  176. package/dist/esm/salla-rating-modal.entry.js +5 -3
  177. package/dist/esm/salla-scopes.entry.js +5 -1
  178. package/dist/esm/salla-search.entry.js +1 -1
  179. package/dist/esm/salla-skeleton.entry.js +1 -1
  180. package/dist/esm/salla-slider.entry.js +1 -1
  181. package/dist/esm/salla-social-share.entry.js +1 -1
  182. package/dist/esm/salla-social.entry.js +1 -1
  183. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  184. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  185. package/dist/esm/salla-tooltip.entry.js +1 -1
  186. package/dist/esm/salla-trust-badges.entry.js +1 -1
  187. package/dist/esm/salla-user-menu.entry.js +4 -4
  188. package/dist/esm/salla-user-profile.entry.js +1 -1
  189. package/dist/esm/salla-user-settings.entry.js +1 -1
  190. package/dist/esm/salla-verify.entry.js +1 -1
  191. package/dist/esm/salla-wallet.entry.js +1 -1
  192. package/dist/esm/twilight.js +3 -3
  193. package/dist/esm/{vanilla-picker-CQfoqkgB.js → vanilla-picker-COFfA4w_.js} +1 -1
  194. package/dist/twilight/{p-6d33240d.entry.js → p-0413c734.entry.js} +1 -1
  195. package/dist/twilight/p-04b8ab10.entry.js +4 -0
  196. package/dist/twilight/{p-8a40fabd.entry.js → p-15a594fa.entry.js} +1 -1
  197. package/dist/twilight/{p-424d54df.entry.js → p-15fd3093.entry.js} +1 -1
  198. package/dist/twilight/{p-309b6cfe.entry.js → p-17b7160b.entry.js} +1 -1
  199. package/dist/twilight/{p-f3b11c5e.entry.js → p-2199d718.entry.js} +1 -1
  200. package/dist/twilight/{p-f65b1cc4.entry.js → p-24377f25.entry.js} +1 -1
  201. package/dist/twilight/{p-38577abd.entry.js → p-264fbff6.entry.js} +1 -1
  202. package/dist/twilight/{p-52404ae1.entry.js → p-3041a8c3.entry.js} +1 -1
  203. package/dist/twilight/{p-4b8f5897.entry.js → p-30e99651.entry.js} +1 -1
  204. package/dist/twilight/{p-f7811b2e.entry.js → p-39581e5c.entry.js} +1 -1
  205. package/dist/twilight/{p-80956964.entry.js → p-3f181a96.entry.js} +1 -1
  206. package/dist/twilight/{p-b318a0ba.entry.js → p-4463abd4.entry.js} +1 -1
  207. package/dist/twilight/{p-8cdc7360.entry.js → p-4919e5a9.entry.js} +1 -1
  208. package/dist/twilight/{p-1b414a65.entry.js → p-4ffae40f.entry.js} +1 -1
  209. package/dist/twilight/{p-CNaIwBPC.js → p-4jF7OEOD.js} +1 -1
  210. package/dist/twilight/{p-0edc4cd6.entry.js → p-538189c6.entry.js} +1 -1
  211. package/dist/twilight/{p-a8be9bd2.entry.js → p-53c9c271.entry.js} +1 -1
  212. package/dist/twilight/{p-d9ea5bc0.entry.js → p-5507971f.entry.js} +1 -1
  213. package/dist/twilight/{p-4429147a.entry.js → p-5e99999b.entry.js} +1 -1
  214. package/dist/twilight/{p-8c083d22.entry.js → p-6004b9f6.entry.js} +1 -1
  215. package/dist/twilight/{p-4b18c6b6.entry.js → p-645926ff.entry.js} +1 -1
  216. package/dist/twilight/{p-4937d0bd.entry.js → p-64a71c5b.entry.js} +1 -1
  217. package/dist/twilight/{p-c3015089.entry.js → p-64e748a7.entry.js} +1 -1
  218. package/dist/twilight/{p-914fe9d5.entry.js → p-6a92b5dd.entry.js} +1 -1
  219. package/dist/twilight/{p-e3685dec.entry.js → p-6af10c58.entry.js} +1 -1
  220. package/dist/twilight/{p-e137375c.entry.js → p-7131d69f.entry.js} +1 -1
  221. package/dist/twilight/{p-14e34d12.entry.js → p-73ab234b.entry.js} +1 -1
  222. package/dist/twilight/{p-1062e8b0.entry.js → p-83f3ec31.entry.js} +1 -1
  223. package/dist/twilight/{p-6fca74f4.entry.js → p-84c228b3.entry.js} +1 -1
  224. package/dist/twilight/p-87995ef8.entry.js +4 -0
  225. package/dist/twilight/{p-0eb5078d.entry.js → p-8edc0ff0.entry.js} +1 -1
  226. package/dist/twilight/{p-8a50b0ec.entry.js → p-97fb05e9.entry.js} +1 -1
  227. package/dist/twilight/{p-e1091287.entry.js → p-984f5fdb.entry.js} +1 -1
  228. package/dist/twilight/{p-f9e74b2d.entry.js → p-98cb7b70.entry.js} +1 -1
  229. package/dist/twilight/{p-50b948f1.entry.js → p-9aea4727.entry.js} +1 -1
  230. package/dist/twilight/{p-73a0f916.entry.js → p-9f184cae.entry.js} +1 -1
  231. package/dist/twilight/{p-C0SN1Hu2.js → p-BEN319Se.js} +1 -1
  232. package/dist/twilight/{p-BA4uXDey.js → p-B_eS27OO.js} +1 -1
  233. package/dist/twilight/{p-eEimxoFN.js → p-BpoZBzEy.js} +1 -1
  234. package/dist/twilight/{p-_Nybob4I.js → p-CLHtpy_k.js} +1 -1
  235. package/dist/twilight/{p-DA2DReRj.js → p-ChWnmXKQ.js} +1 -1
  236. package/dist/twilight/{p-CBclGOrf.js → p-OV5ZDGcP.js} +1 -1
  237. package/dist/twilight/{p-0d0e9cc5.entry.js → p-a1bf8ad3.entry.js} +1 -1
  238. package/dist/twilight/{p-d1d96039.entry.js → p-a3ec6623.entry.js} +1 -1
  239. package/dist/twilight/{p-a5f45964.entry.js → p-ab35c8be.entry.js} +1 -1
  240. package/dist/twilight/p-acd0216d.entry.js +4 -0
  241. package/dist/twilight/{p-34f54667.entry.js → p-b01d274c.entry.js} +1 -1
  242. package/dist/twilight/{p-dd194e28.entry.js → p-b070f96a.entry.js} +1 -1
  243. package/dist/twilight/p-b2979968.entry.js +4 -0
  244. package/dist/twilight/{p-174f26e3.entry.js → p-bdefc2f2.entry.js} +1 -1
  245. package/dist/twilight/{p-6a0d5bf0.entry.js → p-c0540583.entry.js} +1 -1
  246. package/dist/twilight/{p-3e3ef749.entry.js → p-c1a34acb.entry.js} +1 -1
  247. package/dist/twilight/{p-1cc348bd.entry.js → p-c5b6f255.entry.js} +1 -1
  248. package/dist/twilight/{p-ba843446.entry.js → p-c5b8fb5f.entry.js} +1 -1
  249. package/dist/twilight/{p-537ea6c4.entry.js → p-c614db39.entry.js} +1 -1
  250. package/dist/twilight/{p-ca322deb.entry.js → p-c69cfce4.entry.js} +1 -1
  251. package/dist/twilight/{p-eb426d96.entry.js → p-c74dd641.entry.js} +1 -1
  252. package/dist/twilight/{p-2553c102.entry.js → p-ca62b40b.entry.js} +1 -1
  253. package/dist/twilight/{p-c4a32c32.entry.js → p-ca995389.entry.js} +1 -1
  254. package/dist/twilight/{p-8948444e.entry.js → p-d9e33667.entry.js} +1 -1
  255. package/dist/twilight/{p-b8c8437b.entry.js → p-dd01d95c.entry.js} +1 -1
  256. package/dist/twilight/{p-1cc494ac.entry.js → p-dff43324.entry.js} +1 -1
  257. package/dist/twilight/{p-1f256c22.entry.js → p-e35623f2.entry.js} +1 -1
  258. package/dist/twilight/{p-90a2dde9.entry.js → p-e4d4516c.entry.js} +1 -1
  259. package/dist/twilight/{p-2ca7ed43.entry.js → p-e66f7d14.entry.js} +1 -1
  260. package/dist/twilight/{p-s1UoXHVX.js → p-eWBd8uwT.js} +1 -1
  261. package/dist/twilight/{p-d595175e.entry.js → p-ed12b178.entry.js} +1 -1
  262. package/dist/twilight/{p-4a09432e.entry.js → p-efd9618b.entry.js} +1 -1
  263. package/dist/twilight/{p-642dbfd9.entry.js → p-f158ba7c.entry.js} +1 -1
  264. package/dist/twilight/{p-d042041b.entry.js → p-f2b27a5e.entry.js} +1 -1
  265. package/dist/twilight/{p-7f2a4dc0.entry.js → p-f60ec106.entry.js} +1 -1
  266. package/dist/twilight/{p-62713df9.entry.js → p-f625565a.entry.js} +1 -1
  267. package/dist/twilight/{p-2169fb7d.entry.js → p-f78b23ea.entry.js} +1 -1
  268. package/dist/twilight/{p-0af1c84b.entry.js → p-f7bf59b9.entry.js} +1 -1
  269. package/dist/twilight/{p-645edb0f.entry.js → p-fdad85d2.entry.js} +1 -1
  270. package/dist/twilight/{p-CeE1UK0j.js → p-rPMW4kOC.js} +1 -1
  271. package/dist/twilight/{p-C1cZE4BE.js → p-tNbreaQ2.js} +1 -1
  272. package/dist/twilight/twilight.esm.js +1 -1
  273. package/dist/types/components/salla-accordion/salla-accordion.d.ts +2 -0
  274. package/dist/types/components/salla-app-install-alert/salla-app-install-alert.d.ts +1 -0
  275. package/dist/types/components/salla-custom-fields/salla-custom-fields.d.ts +8 -0
  276. package/dist/types/components/salla-hook/salla-hook.d.ts +5 -0
  277. package/dist/types/components/salla-localization-modal/salla-localization-modal.d.ts +14 -3
  278. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.d.ts +1 -0
  279. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.d.ts +1 -0
  280. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.d.ts +5 -0
  281. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.d.ts +5 -0
  282. package/dist/types/components/salla-multiple-bundle-product/salla-multiple-bundle-product.d.ts +1 -0
  283. package/dist/types/components/salla-order-details/salla-order-details.d.ts +1 -0
  284. package/dist/types/components/salla-review-card/salla-review-card.d.ts +1 -0
  285. package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +2 -2
  286. package/dist/types/components.d.ts +120 -14
  287. package/package.json +5 -5
  288. package/dist/twilight/p-7ae2abce.entry.js +0 -4
  289. package/dist/twilight/p-c5b3b222.entry.js +0 -4
  290. package/dist/twilight/p-f1c55b22.entry.js +0 -4
  291. package/dist/twilight/p-f820bb24.entry.js +0 -4
@@ -53,6 +53,7 @@ export namespace Components {
53
53
  */
54
54
  interface SallaAccordion {
55
55
  /**
56
+ * Whether the accordion has a border. Default is false.
56
57
  * @default false
57
58
  */
58
59
  "bordered": boolean;
@@ -67,6 +68,7 @@ export namespace Components {
67
68
  */
68
69
  "collapsible": boolean;
69
70
  /**
71
+ * The size of the accordion elements.
70
72
  * @default "md"
71
73
  */
72
74
  "size": "sm" | "md" | "lg";
@@ -580,14 +582,30 @@ export namespace Components {
580
582
  "withButton"?: boolean;
581
583
  }
582
584
  interface SallaCustomFields {
585
+ /**
586
+ * The list of custom fields to render. Can be a JSON string or an array of objects.
587
+ */
583
588
  "fields": string | CustomField[];
589
+ /**
590
+ * The URL to send file uploads to.
591
+ */
584
592
  "fileUploadUrl": string;
593
+ /**
594
+ * Gets the current values of all fields, formatted for submission.
595
+ */
585
596
  "getFieldValues": () => Promise<{ [key: string]: unknown; }>;
586
597
  /**
598
+ * Whether the fields can be edited by the user.
587
599
  * @default true
588
600
  */
589
601
  "isEditable": boolean;
602
+ /**
603
+ * Update the displayed fields programmatically.
604
+ */
590
605
  "setFields": (fields: CustomField[]) => Promise<void>;
606
+ /**
607
+ * Validates all required fields and updates the error state. Returns true if valid.
608
+ */
591
609
  "validateFields": () => Promise<boolean>;
592
610
  }
593
611
  interface SallaDatetimePicker {
@@ -1244,7 +1262,14 @@ export namespace Components {
1244
1262
  "widgetTitle": string;
1245
1263
  }
1246
1264
  interface SallaHook {
1265
+ /**
1266
+ * Mounts a given HTML element into the hook position.
1267
+ * @param element The element to inject.
1268
+ */
1247
1269
  "mount": (element: HTMLElement) => Promise<void>;
1270
+ /**
1271
+ * The unique name to identify the hook position.
1272
+ */
1248
1273
  "name": string;
1249
1274
  }
1250
1275
  interface SallaInfiniteScroll {
@@ -1335,18 +1360,21 @@ export namespace Components {
1335
1360
  "close": () => Promise<HTMLElement>;
1336
1361
  /**
1337
1362
  * Current currency (existing or newly selected)
1338
- * @default salla.config.get('user.currency_code')
1339
1363
  */
1340
1364
  "currency": string;
1341
1365
  /**
1342
1366
  * Current language (existing or newly selected)
1343
- * @default salla.config.get('user.language_code')
1344
1367
  */
1345
1368
  "language": string;
1346
1369
  /**
1347
1370
  * open the component
1348
1371
  */
1349
1372
  "open": () => Promise<any>;
1373
+ /**
1374
+ * To show the trigger button or not
1375
+ * @default false
1376
+ */
1377
+ "showTrigger": boolean;
1350
1378
  /**
1351
1379
  * Change currency and language to the selected ones.
1352
1380
  */
@@ -1653,29 +1681,50 @@ export namespace Components {
1653
1681
  * }'></salla-multiple-bundle-product>
1654
1682
  */
1655
1683
  interface SallaMultipleBundleProduct {
1684
+ /**
1685
+ * The bundled sections data, given as a JSON string or parsed object.
1686
+ */
1656
1687
  "bundleSections": string;
1657
1688
  }
1658
1689
  interface SallaMultipleBundleProductCart {
1659
1690
  /**
1691
+ * The list of sections belonging to a bundle product.
1660
1692
  * @default []
1661
1693
  */
1662
1694
  "sections": BundleSection[];
1663
1695
  }
1664
1696
  interface SallaMultipleBundleProductDetails {
1665
1697
  /**
1698
+ * The list of sections belonging to a bundle product.
1666
1699
  * @default []
1667
1700
  */
1668
1701
  "sections": BundleSection[];
1669
1702
  }
1670
1703
  interface SallaMultipleBundleProductOptionsModal {
1704
+ /**
1705
+ * Closes the modal manually.
1706
+ */
1671
1707
  "close": () => Promise<void>;
1708
+ /**
1709
+ * Opens the modal manually.
1710
+ */
1672
1711
  "open": () => Promise<void>;
1712
+ /**
1713
+ * Refreshes the internal options tracking state manually.
1714
+ */
1673
1715
  "refreshOptionsState": () => Promise<void>;
1674
1716
  }
1675
1717
  interface SallaMultipleBundleProductSlider {
1718
+ /**
1719
+ * The data for the current bundle section being rendered in this slider.
1720
+ */
1676
1721
  "section": BundleSection;
1722
+ /**
1723
+ * The zero-based index of this section within the overall bundle.
1724
+ */
1677
1725
  "sectionIndex": number;
1678
1726
  /**
1727
+ * A dictionary tracking which product IDs are currently selected per section.
1679
1728
  * @default {}
1680
1729
  */
1681
1730
  "selectedProducts": { [sectionId: string]: Set<string | number> };
@@ -1729,6 +1778,9 @@ export namespace Components {
1729
1778
  * It uses the salla-accordion component to provide collapsible functionality.
1730
1779
  */
1731
1780
  interface SallaOrderDetails {
1781
+ /**
1782
+ * The payload containing order data, stringified JSON or literal object.
1783
+ */
1732
1784
  "orderDetails": string | OrderProduct;
1733
1785
  }
1734
1786
  /**
@@ -2312,6 +2364,9 @@ export namespace Components {
2312
2364
  "withLabel": boolean;
2313
2365
  }
2314
2366
  interface SallaReviewCard {
2367
+ /**
2368
+ * The review object to render, containing review text, stars, product info, and images.
2369
+ */
2315
2370
  "review": Partial<Review>;
2316
2371
  }
2317
2372
  interface SallaReviews {
@@ -2803,11 +2858,6 @@ export namespace Components {
2803
2858
  "dark": boolean;
2804
2859
  }
2805
2860
  interface SallaUserMenu {
2806
- /**
2807
- * To auto mount the login modal or not
2808
- * @default false
2809
- */
2810
- "autoMount": boolean;
2811
2861
  /**
2812
2862
  * To display the trigger as an avatar only
2813
2863
  * @default false
@@ -2828,6 +2878,11 @@ export namespace Components {
2828
2878
  * @default false
2829
2879
  */
2830
2880
  "showHeader": boolean;
2881
+ /**
2882
+ * To show the trigger button or not
2883
+ * @default false
2884
+ */
2885
+ "showTrigger": boolean;
2831
2886
  }
2832
2887
  /**
2833
2888
  * The SallaUserProfile is a versatile user profile form
@@ -4110,6 +4165,7 @@ declare namespace LocalJSX {
4110
4165
  */
4111
4166
  interface SallaAccordion {
4112
4167
  /**
4168
+ * Whether the accordion has a border. Default is false.
4113
4169
  * @default false
4114
4170
  */
4115
4171
  "bordered"?: boolean;
@@ -4124,6 +4180,7 @@ declare namespace LocalJSX {
4124
4180
  */
4125
4181
  "collapsible"?: boolean;
4126
4182
  /**
4183
+ * The size of the accordion elements.
4127
4184
  * @default "md"
4128
4185
  */
4129
4186
  "size"?: "sm" | "md" | "lg";
@@ -4614,17 +4671,30 @@ declare namespace LocalJSX {
4614
4671
  "withButton"?: boolean;
4615
4672
  }
4616
4673
  interface SallaCustomFields {
4674
+ /**
4675
+ * The list of custom fields to render. Can be a JSON string or an array of objects.
4676
+ */
4617
4677
  "fields"?: string | CustomField[];
4678
+ /**
4679
+ * The URL to send file uploads to.
4680
+ */
4618
4681
  "fileUploadUrl"?: string;
4619
4682
  /**
4683
+ * Whether the fields can be edited by the user.
4620
4684
  * @default true
4621
4685
  */
4622
4686
  "isEditable"?: boolean;
4687
+ /**
4688
+ * Emitted when a field's value changes.
4689
+ */
4623
4690
  "onFieldChanged"?: (event: SallaCustomFieldsCustomEvent<{
4624
4691
  fieldId: string | number;
4625
4692
  value: unknown;
4626
4693
  isValid: boolean;
4627
4694
  }>) => void;
4695
+ /**
4696
+ * Emitted when a file is successfully uploaded or encounters an error.
4697
+ */
4628
4698
  "onFileUploaded"?: (event: SallaCustomFieldsCustomEvent<{
4629
4699
  fieldId: string | number;
4630
4700
  file: File;
@@ -5253,6 +5323,9 @@ declare namespace LocalJSX {
5253
5323
  "widgetTitle"?: string;
5254
5324
  }
5255
5325
  interface SallaHook {
5326
+ /**
5327
+ * The unique name to identify the hook position.
5328
+ */
5256
5329
  "name"?: string;
5257
5330
  }
5258
5331
  interface SallaInfiniteScroll {
@@ -5339,14 +5412,17 @@ declare namespace LocalJSX {
5339
5412
  interface SallaLocalizationModal {
5340
5413
  /**
5341
5414
  * Current currency (existing or newly selected)
5342
- * @default salla.config.get('user.currency_code')
5343
5415
  */
5344
5416
  "currency"?: string;
5345
5417
  /**
5346
5418
  * Current language (existing or newly selected)
5347
- * @default salla.config.get('user.language_code')
5348
5419
  */
5349
5420
  "language"?: string;
5421
+ /**
5422
+ * To show the trigger button or not
5423
+ * @default false
5424
+ */
5425
+ "showTrigger"?: boolean;
5350
5426
  }
5351
5427
  interface SallaLoginModal {
5352
5428
  /**
@@ -5627,27 +5703,38 @@ declare namespace LocalJSX {
5627
5703
  * }'></salla-multiple-bundle-product>
5628
5704
  */
5629
5705
  interface SallaMultipleBundleProduct {
5706
+ /**
5707
+ * The bundled sections data, given as a JSON string or parsed object.
5708
+ */
5630
5709
  "bundleSections"?: string;
5631
5710
  }
5632
5711
  interface SallaMultipleBundleProductCart {
5633
5712
  /**
5713
+ * The list of sections belonging to a bundle product.
5634
5714
  * @default []
5635
5715
  */
5636
5716
  "sections"?: BundleSection[];
5637
5717
  }
5638
5718
  interface SallaMultipleBundleProductDetails {
5639
5719
  /**
5720
+ * The list of sections belonging to a bundle product.
5640
5721
  * @default []
5641
5722
  */
5642
5723
  "sections"?: BundleSection[];
5643
5724
  }
5644
5725
  interface SallaMultipleBundleProductOptionsModal {
5726
+ /**
5727
+ * Emitted when product options are successfully saved.
5728
+ */
5645
5729
  "onOptionsSaved"?: (event: SallaMultipleBundleProductOptionsModalCustomEvent<{
5646
5730
  productId: number;
5647
5731
  selectedOptions: SelectedOption[];
5648
5732
  sectionId?: string | number | null;
5649
5733
  productIndex?: number | null;
5650
5734
  }>) => void;
5735
+ /**
5736
+ * Emitted when a product is selected or modified via the modal.
5737
+ */
5651
5738
  "onProductSelected"?: (event: SallaMultipleBundleProductOptionsModalCustomEvent<{
5652
5739
  productId: number;
5653
5740
  sectionId: string | number;
@@ -5656,14 +5743,27 @@ declare namespace LocalJSX {
5656
5743
  }>) => void;
5657
5744
  }
5658
5745
  interface SallaMultipleBundleProductSlider {
5746
+ /**
5747
+ * Emitted when the user clicks the "options" button on a product card.
5748
+ */
5659
5749
  "onProductOptionsSelected"?: (event: SallaMultipleBundleProductSliderCustomEvent<{
5660
5750
  product: BundleProduct;
5661
5751
  sectionId: string | number;
5662
5752
  }>) => void;
5753
+ /**
5754
+ * Emitted when a product is clicked/toggled within the slider.
5755
+ */
5663
5756
  "onProductSelected"?: (event: SallaMultipleBundleProductSliderCustomEvent<{ product: BundleProduct; sectionId: string | number }>) => void;
5757
+ /**
5758
+ * The data for the current bundle section being rendered in this slider.
5759
+ */
5664
5760
  "section"?: BundleSection;
5761
+ /**
5762
+ * The zero-based index of this section within the overall bundle.
5763
+ */
5665
5764
  "sectionIndex"?: number;
5666
5765
  /**
5766
+ * A dictionary tracking which product IDs are currently selected per section.
5667
5767
  * @default {}
5668
5768
  */
5669
5769
  "selectedProducts"?: { [sectionId: string]: Set<string | number> };
@@ -5707,6 +5807,9 @@ declare namespace LocalJSX {
5707
5807
  * It uses the salla-accordion component to provide collapsible functionality.
5708
5808
  */
5709
5809
  interface SallaOrderDetails {
5810
+ /**
5811
+ * The payload containing order data, stringified JSON or literal object.
5812
+ */
5710
5813
  "orderDetails"?: string | OrderProduct;
5711
5814
  }
5712
5815
  /**
@@ -6233,6 +6336,9 @@ declare namespace LocalJSX {
6233
6336
  "withLabel"?: boolean;
6234
6337
  }
6235
6338
  interface SallaReviewCard {
6339
+ /**
6340
+ * The review object to render, containing review text, stars, product info, and images.
6341
+ */
6236
6342
  "review"?: Partial<Review>;
6237
6343
  }
6238
6344
  interface SallaReviews {
@@ -6636,11 +6742,6 @@ declare namespace LocalJSX {
6636
6742
  "dark"?: boolean;
6637
6743
  }
6638
6744
  interface SallaUserMenu {
6639
- /**
6640
- * To auto mount the login modal or not
6641
- * @default false
6642
- */
6643
- "autoMount"?: boolean;
6644
6745
  /**
6645
6746
  * To display the trigger as an avatar only
6646
6747
  * @default false
@@ -6661,6 +6762,11 @@ declare namespace LocalJSX {
6661
6762
  * @default false
6662
6763
  */
6663
6764
  "showHeader"?: boolean;
6765
+ /**
6766
+ * To show the trigger button or not
6767
+ * @default false
6768
+ */
6769
+ "showTrigger"?: boolean;
6664
6770
  }
6665
6771
  /**
6666
6772
  * The SallaUserProfile is a versatile user profile form
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "2.14.380",
3
+ "version": "2.14.381",
4
4
  "license": "GPL-3.0",
5
5
  "author": "Salla Team <support@salla.dev> (https://salla.dev)",
6
6
  "bugs": {
@@ -79,9 +79,9 @@
79
79
  "typescript": "^5.4.5"
80
80
  },
81
81
  "dependencies": {
82
- "@salla.sa/applepay": "2.14.380",
83
- "@salla.sa/twilight": "2.14.380",
84
- "@salla.sa/twilight-tailwind-theme": "2.14.380",
82
+ "@salla.sa/applepay": "2.14.381",
83
+ "@salla.sa/twilight": "2.14.381",
84
+ "@salla.sa/twilight-tailwind-theme": "2.14.381",
85
85
  "@types/node": "^20.4.8",
86
86
  "animejs": "^3.2.2",
87
87
  "filepond": "^4.30.6",
@@ -99,5 +99,5 @@
99
99
  "vanilla-lazyload": "^17.8.5",
100
100
  "vanilla-picker": "^2.12.2"
101
101
  },
102
- "gitHead": "4d2b102bdb69324759d363315e7a9a8c7ee79b51"
102
+ "gitHead": "d52f97f009a2a0f123e9a5238907b08f4d952f85"
103
103
  }
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as t,h as a,H as s,a as l}from"./p-eEimxoFN.js";const i=class{constructor(a){t(this,a),this.alertDelay=null,this.data=salla.config.get("store.app_install_prompt"),this.open=!1,this.closing=!1}connectedCallback(){salla.onReady((()=>{if(this.data=salla.config.get("store.app_install_prompt"),this.isMobileOrTabletDevice()){if(!this.data)return salla.logger.error("Failed to retrieve salla-app-install-alert config");this.ctaLink=salla.url.get("app"),this.alertDelay=setTimeout((()=>this.open=!0),3e3)}}))}disconnectedCallback(){clearTimeout(this.alertDelay)}isMobileOrTabletDevice(t=1024){if("undefined"==typeof window||"undefined"==typeof navigator||"undefined"==typeof document)return!1;const a=window.matchMedia(`(max-width: ${t}px)`).matches,s=/Macintosh|Android|iPhone|iPad|iPod/i.test(navigator.userAgent),l="ontouchstart"in window||"ontouchend"in document||navigator.maxTouchPoints>0;return s&&a&&l}closeAlert(){salla.storage.set("app_install_prompt_disabled",!0),this.closing=!0,this.host.addEventListener("animationend",(()=>{this.closing=!1,this.open=!1}),{once:!0})}render(){return this.data?a(s,{class:`s-app-install-alert-wrapper ${this.open?"open":""} ${this.closing?"closing":""}`,position:this.data.position},a("div",null,a("img",{src:this.data.icon,width:"58",height:"58",alt:`${salla.config.get("store.name")}`})),a("div",{class:"s-app-install-alert-content"},a("h2",{class:"s-app-install-alert-title"},this.data.title),a("p",{class:"s-app-install-alert-sub-title"},this.data.sub_title," "," ",a("a",{href:this.ctaLink,target:"_blank","aria-label":"download app",class:"s-app-install-alert-cta"},salla.lang.getWithDefault("blocks.footer.download_app_now","حمله الآن")))),a("button",{class:"s-app-install-alert-cancel-button","aria-label":"close alert",onClick:()=>this.closeAlert()},a("i",{class:"sicon-cancel"}))):null}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_app_install_alert}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as a,h as s,H as t,a as i}from"./p-eEimxoFN.js";import{W as e}from"./p-ZT7ehBBk.js";import{C as l}from"./p-BV4kqbdL.js";import{H as n}from"./p-CHf8XdiS.js";import{I as r}from"./p-C-tzSDxw.js";import{W as o}from"./p-CgR-T_ZS.js";import{M as d}from"./p-DmgxDvXL.js";import{a as h}from"./p-CgtvEd63.js";var g='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>shipping-fast</title>\n<path d="M10.667 14.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h8c0.736 0 1.333-0.596 1.333-1.333zM9.333 18.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM9.333 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667zM1.333 10.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.123 13.103l-3.147-3.935c-1.273-1.589-3.171-2.501-5.205-2.501h-1.437c0-2.205-1.795-4-4-4h-13.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v1.333c0 0.248 0.087 0.468 0.204 0.667-0.117 0.199-0.204 0.419-0.204 0.667v5.333c0 0.737 0.597 1.333 1.333 1.333h9.333v6.667h-1.333c-0.063 0-0.117 0.028-0.179 0.036-0.583-2.313-2.664-4.036-5.155-4.036-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c2.491 0 4.572-1.723 5.155-4.036 0.061 0.008 0.116 0.036 0.179 0.036h2.667c0.736 0 1.333-0.596 1.333-1.333v-8.399c0-0.905-0.311-1.792-0.877-2.499zM21.333 13.333v-4h1.437c1.221 0 2.36 0.547 3.124 1.501l1.997 2.499zM22.667 26.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n';const m=class{constructor(s){a(this,s),this.hasError=!1,this.showContactWidget=!0,this.images=[],this.productImages={},this.editItemImages=[],this.contact_body=(a,s,t)=>salla.lang.get("pages.rating.contact_subject",{store:a,id:s,customer:t}),this.editMode=!1,this.defaultMode=!1,this.deleteMode=!1,this.shouldOpenDeleteModal=!1,this.editItem=null,this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.contactUsLabel=salla.lang.get("blocks.footer.social"),this.allowAttachImages=salla.config.get("store.settings.rating.allow_attach_images"),this.allowContactSupport=salla.config.get("store.settings.rating.allow_contact_support"),this.contentRefs=[],this.hiddenInputs=[],this.isOpen=[],this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.MAX_UPLOAD_LIMIT=3,this.onOpen=a=>new Promise((s=>{h({targets:this.contentRefs[a],duration:100,height:this.contentRefs[a].scrollHeight,opacity:[0,1],easing:"easeOutQuart",complete:()=>s()})})),this.onClose=a=>new Promise((s=>{h({targets:this.contentRefs[a],duration:100,height:0,opacity:[1,0],easing:"easeOutQuart",complete:()=>s()})})),this.toggleUploader=async a=>{this.isOpen[a]=!this.isOpen[a],n.toggleElementClassIf(this.contentRefs[a],"is-closed","is-opened",(()=>!this.isOpen[a])),await(this.isOpen[a]?this.onOpen(a):this.onClose(a)),await new Promise((a=>setTimeout(a,101))),this.body&&this.currentTab&&setTimeout((()=>this.body.setAttribute("style",`height:${this.currentTab.offsetHeight+(this.editMode?60:0)}px`)))},salla.onReady((()=>{this.orderId=salla.config.get("page.id")})),salla.lang.onLoaded((()=>{this.contactUsLabel=salla.lang.get("blocks.footer.social");const a=(a,s,t)=>new Promise((i=>{salla.helpers.setNested(salla.lang.messages[a],s,t),i(!0)}));(async()=>{await a("ar.trans","common.uploader.drag_and_drop_files","اسحب الملفات وأفلتها هنا"),await a("en.trans","common.uploader.drag_and_drop_files","Drag and drop files here"),await a("ar.trans","common.uploader.allowed_images_types"," .jpg أو jpeg أو png يُسمح بإضافة صور بصيغة"),await a("en.trans","common.uploader.allowed_images_types","Images in jpg, jpeg, or png format are allowed."),await a("ar.trans","pages.rating.add_images","اضافة صور"),await a("en.trans","pages.rating.add_images","Add Images"),await a("ar.trans","pages.rating.edit_images","تعديل الصور"),await a("en.trans","pages.rating.edit_images","Edit Images"),await a("ar.trans","pages.rating.edit_review","تعديل التقييم"),await a("en.trans","pages.rating.edit_review","Edit review"),await a("ar.trans","pages.rating.confirm_deletion","تأكيد حذف التقييم"),await a("en.trans","pages.rating.confirm_deletion","Confirm review deletion"),await a("ar.trans","pages.rating.are_you_sure_you_want_to_delete_review","هل أنت متأكد من حذف تقييمك؟"),await a("en.trans","pages.rating.are_you_sure_you_want_to_delete_review","Are you sure you want to delete your review?"),await a("ar.trans","pages.rating.review_updated_successfully","تم تعديل التقييم بنجاح"),await a("en.trans","pages.rating.review_updated_successfully","The review has been successfully updated."),await a("ar.trans","pages.rating.review_deleted_successfully","تم حذف التقييم بنجاح"),await a("en.trans","pages.rating.review_deleted_successfully","The review has been successfully deleted."),await a("ar.trans","pages.rating.images_count","الصور ( :current من أصل :total )"),await a("en.trans","pages.rating.images_count","Images ( :current of :total )"),await a("ar.trans","common.uploader.max_three_images",`.أضف ${this.MAX_UPLOAD_LIMIT} صور كحد أقصى`),await a("en.trans","common.uploader.max_three_images",`Add up to ${this.MAX_UPLOAD_LIMIT} images maximum.`),await a("ar.trans","common.elements.confirm_delete","تأكيد الحذف"),await a("en.trans","common.elements.confirm_delete","Confirm deletion"),this.dragAndDropFilesLabel=salla.lang.get("common.uploader.drag_and_drop_files"),this.allowedImagesTypesLabel=salla.lang.get("common.uploader.allowed_images_types"),this.addImagesLabel=salla.lang.get("pages.rating.add_images"),this.threeImagesMax=salla.lang.get("common.uploader.max_three_images"),this.contactSubjectLabel=salla.lang.get("pages.rating.contact_subject"),this.editReviewLabel=salla.lang.get("pages.rating.edit_review"),this.editImagesLabel=salla.lang.get("pages.rating.edit_images"),this.areYouSureLabel=salla.lang.get("pages.rating.are_you_sure_you_want_to_delete_review"),this.confirmDeletionLabel=salla.lang.get("pages.rating.confirm_deletion"),this.cancelLabel=salla.lang.get("common.elements.cancel"),this.updatedSuccessfullyLabel=salla.lang.get("pages.rating.review_updated_successfully"),this.deletedSuccessfullyLabel=salla.lang.get("pages.rating.review_deleted_successfully"),this.confirmDeleteBtn=salla.lang.get("common.elements.confirm_delete"),this.contact_body=(a,s,t)=>salla.lang.get("pages.rating.contact_body",{store:a,id:s,customer:t})})()}))}async open(){return this.defaultMode=!0,new Promise((a=>{setTimeout((()=>{this.modal.open().then((()=>this.order||salla.api.withoutNotifier((()=>salla.rating.api.order(this.orderId?this.orderId:salla.config.get("page.id")))).then((a=>this.order=a.data)))).then((()=>this.modal.setTitle(`${salla.lang.get("pages.rating.rate_order")} <span class="unicode">(#${this.order.id})</span>`))).then((()=>{const a={};if(this.order?.products)for(const s of this.order.products)a[s.product.id]=[];this.productImages=a})).then((()=>this.modal.stopLoading())).then((()=>this.stepsCount=[this.order.testimonials_enabled,this.order.products_enabled,this.order.shipping_enabled].filter((a=>a)).length)).then((()=>setTimeout((()=>this.handleWizard()),100))).catch((s=>{a(!1),this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||s.response?.data,this.modal.stopLoading()})),a(!0)}),50)}))}async openEditModal(a){this.defaultMode=!1,this.editMode=!0,this.editType=a.type,this.editFeedbackId=a.feedback_id;try{await this.fetchEditItem(a.feedback_id),this.editModal.open()}catch(a){this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data}}async fetchEditItem(a){const s=`rating/${a}/show`,t=await salla.api.request(s);this.editItem=t.data,this.allowAttachImages&&"product"==this.editType&&this.editItem.images.length&&(this.editItemImages=this.editItem.images.map((a=>({id:`${Math.floor(100+900*Math.random())}`,url:a}))))}async editReview(){const a={};this.editModal.querySelectorAll("[name]").forEach((s=>{const t=salla.helpers.inputData(s.name,s.value,a);a[t.name]=t.value})),a.images&&(a.images=a.images.split(","));const s=`rating/${this.editFeedbackId}`;await salla.api.request(s,a,"put").then((a=>{this.editModal.close(),salla.notify.success(a.message||this.updatedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async openDeleteModal(a){return this.defaultMode=!1,this.deleteMode=!0,this.deleteFeedbackId=a.feedback_id,this.shouldOpenDeleteModal=!0,new Promise((a=>{setTimeout((()=>{this.deleteModal.open().then((()=>a(!0)))}),50)}))}async deleteReview(){const a=`rating/${this.deleteFeedbackId}`;await salla.api.request(a,null,"delete").then((()=>{this.deleteModal.close(),salla.notify.success(this.deletedSuccessfullyLabel),setTimeout((()=>{window.location.reload()}),500)}))}async close(){return this.modal.close()}handleWizard(){this.steps=this.modal.querySelectorAll(".s-rating-modal-step"),this.dots=this.modal.querySelectorAll(".s-rating-modal-step-dot"),this.showActiveStep()}showActiveStep(a=null){this.currentTab=a||this.steps[this.currentIndex],n.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(a=>a!=this.dots[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(a=>a==this.currentTab)),0!==this.currentIndex&&(n.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>n.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));const s=this.steps[this.currentIndex+1]?.dataset.type;this.nextBtn?.setText(s?`${salla.lang.get("pages.rating.rate")} ${salla.lang.get(`pages.rating.${s}`)}`:salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>this.body?.setAttribute("style",`height:${this.currentTab?.offsetHeight}px`)))}previousTab(){this.currentIndex>0&&this.currentIndex--,n.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}submit(){this.submittedBefore()||this.validate(),salla.config.canLeave=!1,this.nextBtn.load().then((()=>this.submittedBefore()||this.sendFeedback())).then((()=>this.currentTab.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((a=>a.setAttribute("disabled",""))))).then((()=>this.currentIndex<this.stepsCount&&this.currentIndex++)).then((()=>this.showActiveStep())).then((()=>n.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)))).finally((()=>{this.nextBtn.stop(),salla.config.canLeave=!0,this.currentIndex==this.stepsCount&&(this.showThankYou(),this.showContactWidget=!1)}))}submittedBefore(){return this.submitted.includes(this.currentIndex)}validate(a=null,s=null){if(!a&&"products"===this.currentTab.dataset.type)return void this.currentTab.querySelectorAll(".rating-outer-form").forEach((a=>this.validate(a,"product")));const t=(a=a||this.currentTab).querySelector(".rating_hidden_input").value,i=a.querySelector(".s-rating-modal-validation-msg");if(s=s||a.dataset.type,!t)throw i.innerHTML=salla.lang.get(`pages.rating.rate_${s}_stars`).replace(" (:item)",""),new Error(i.innerHTML);i.innerHTML=""}sendFeedback(){const a={};if(this.currentTab.querySelectorAll("[name]").forEach((s=>{const t=salla.helpers.inputData(s.name,s.value,a);a[t.name]=t.value})),this.allowAttachImages&&a.products)for(let s in a.products)a.products[s].images&&(a.products[s].images=a.products[s].images.split(","));if(0!=Object.keys(a).length)return a.order_id=this.orderId,a.type=this.currentTab.dataset.type,this.submitted.push(this.currentIndex),salla.rating.api[this.currentTab.dataset.type](a)}showThankYou(){let a=10,s=setInterval((()=>{this.thanksTime.innerHTML="00:0"+a--,a>0||(clearInterval(s),this.thanksTime.remove(),this.close().then((()=>window.location.reload())))}),1e3);this.modal.querySelector(".s-rating-modal-footer").classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}getFilepondPlaceholder(){return`<div class="s-rating-modal-filepond-placeholder"><span class="s-rating-modal-filepond-placeholder-icon">${r}</span><p class="s-rating-modal-filepond-placeholder-text">${this.dragAndDropFilesLabel}<br>\n <span> ${this.allowedImagesTypesLabel} <br> ${this.threeImagesMax} </span></p></div>`}getCustomerName(){return`${salla.config.get("user.first_name")||salla.storage.get("user.first_name")||""} ${salla.config.get("user.last_name")||salla.storage.get("user.last_name")||""}`}handleSendEmail(){const a=`${this.contactSubjectLabel} #${this.order.id}`,s=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),t=`mailto:${salla.config.get("store.contacts.email")}?subject=${encodeURIComponent(a)}&body=${encodeURIComponent(s)}`;window.open(t,"_blank")}handleSendWhatsApp(){const a=this.contact_body(salla.config.get("store.name"),this.order.id,this.getCustomerName()),s=`https://wa.me/${salla.config.get("store.contacts.whatsapp")}?text=${encodeURIComponent(a)}`;window.open(s,"_blank")}resetData(a){a.detail||(this.modal?.close(),this.editItem=null,this.editItemImages=[],this.hiddenInputs[1]&&(this.hiddenInputs[1].value=""),this.deleteFeedbackId=null,this.editFeedbackId=null,this.shouldOpenDeleteModal=!1,this.editMode=!1,this.deleteMode=!1,this.defaultMode=!1)}getDeleteModal(){return s("salla-modal",{ref:a=>this.deleteModal=a,width:"xs",onModalVisibilityChanged:a=>this.resetData(a)},s("div",{class:"s-rating-modal-delete-wrapper",ref:a=>this.body=a},s("h3",null,this.confirmDeletionLabel),s("p",null,this.areYouSureLabel),s("div",{class:"s-rating-modal-delete-actions"},s("salla-button",{loaderPosition:"center",onClick:()=>this.deleteReview()},this.confirmDeleteBtn),s("salla-button",{color:"danger",fill:"outline",onClick:()=>this.deleteModal.close()},this.cancelLabel))))}renderUploadedImagesCount(a){const t=this.editMode?this.editItemImages.length:(this.productImages[a]||[]).length;return s("span",{class:"s-rating-modal-upload-count"},salla.lang.choice("pages.rating.images_count",t,{current:t,total:this.MAX_UPLOAD_LIMIT}))}getEditModal(){return s("salla-modal",{ref:a=>this.editModal=a,width:"md",onModalVisibilityChanged:a=>this.resetData(a)},s("div",{class:"s-rating-modal-edit-wrapper",ref:a=>this.body=a},"store"===this.editType&&this.editItem?s("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"store",ref:a=>this.currentTab=a},s("div",{class:"s-rating-modal-rounded-icon"},s("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"})),s("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),s("div",{class:"s-rating-modal-stars-company"},s("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),s("textarea",{name:"content",value:this.editItem.content,class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),s("small",{class:"s-rating-modal-validation-msg"})):null,"shipping"===this.editType&&this.editItem?s("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step","data-type":"shipping",ref:a=>this.currentTab=a},this.editItem.shipping.logo?s("div",{class:"s-rating-modal-rounded-icon"},s("img",{src:this.editItem.shipping.logo,class:"s-rating-modal-shipping-logo",alt:this.editItem.shipping.name})):s("span",{class:"s-rating-modal-icon",innerHTML:g}),s("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.editItem.shipping.name}`),s("div",{class:"s-rating-modal-stars-company"},s("salla-rating-stars",{withLabel:!0,size:"large",editable:!0,value:this.editItem.stars})),s("textarea",{name:"content",class:"s-rating-modal-comment",value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),s("small",{class:"s-rating-modal-validation-msg"})):null,"product"==this.editType&&this.editItem?s("section",{class:"s-rating-modal-step","data-type":"products",ref:a=>this.currentTab=a},s("div",{class:"s-rating-modal-product"},s("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},s("div",{class:"s-rating-modal-product-img-wrap"},s("img",{src:this.editItem.product.image.url,alt:this.editItem.product.name,class:"s-rating-modal-product-img"})),s("div",{class:"s-rating-modal-product-details"},s("div",{class:"s-rating-modal-product-details-main"},s("div",null,s("h3",{class:"s-rating-modal-product-title"}," ",this.editItem.product.name),s("div",{class:"s-rating-modal-stars-product"},s("salla-rating-stars",{withLabel:!0,size:"small",editable:!0,value:this.editItem.stars}))),this.allowAttachImages&&s("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(1)},s("span",null,this.editItemImages.length?this.editImagesLabel:this.addImagesLabel),s("span",{innerHTML:r}))),s("textarea",{value:this.editItem.content,placeholder:salla.lang.get("pages.rating.write_product_rate"),name:"content",class:"s-rating-modal-comment"}),s("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&s("div",{class:"s-rating-modal-uploader is-closed",ref:a=>this.contentRefs[1]=a},s("salla-file-upload",{name:"images",allowMultiple:!0,maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,filePosterHeight:117,"instant-upload":!0,type:"feedback",files:JSON.stringify(this.editItemImages),payloadName:"files[]",id:`file-${this.editItem.product.id}`,title:this.editItem.product.name,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:a=>{this.editItemImages=[...this.editItemImages,a.detail],this.hiddenInputs[1].value=this.editItemImages.map((a=>a.url)).join()},onRemoved:a=>{const s=a.detail;s&&(this.editItemImages=this.editItemImages.filter((a=>a.id!==s)),this.hiddenInputs[1].value=this.editItemImages.map((a=>a.url)).join())},labelIdle:this.getFilepondPlaceholder()}),s("input",{type:"hidden",name:"images",value:this.editItem.images.join(","),ref:a=>this.hiddenInputs[1]=a}),this.renderUploadedImagesCount(this.editItem.product.id)))):null,s("div",{class:"s-rating-modal-footer s-rating-modal-footer-end"},s("salla-button",{"loader-position":"center",onClick:()=>this.editReview()},this.editReviewLabel))))}render(){return this.deleteMode?s(t,{class:"s-rating-modal"},this.getDeleteModal()):this.editMode?s(t,{class:"s-rating-modal"},this.getEditModal()):this.defaultMode?s(t,{class:"s-rating-modal"},s("salla-modal",{class:"s-rating-modal-wrap",onModalVisibilityChanged:a=>this.resetData(a),isLoading:!0,width:"md",ref:a=>this.modal=a},s("div",{slot:"loading"},s("div",{class:"s-rating-modal-skeleton"},s("salla-skeleton",{type:"circle",height:"80px",width:"80px"}),s("salla-skeleton",{height:"15px",width:"60%"}),s("salla-skeleton",{height:"10px",width:"30%"}),s("div",{class:"s-rating-modal-skeleton-stars"},[...Array(5)].map((a=>s("div",{key:a,innerHTML:e})))),s("salla-skeleton",{height:"100px",width:"100%"}),s("div",{class:"s-rating-modal-skeleton-footer"},s("salla-skeleton",{height:"40px",width:"30%"})))),!this.hasError&&this.order?[s("div",{class:"s-rating-modal-wrapper",ref:a=>this.body=a},this.order?.testimonials_enabled?s("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},s("div",{class:"s-rating-modal-rounded-icon"},s("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"})),s("h2",{class:"s-rating-modal-title"},salla.lang.get("pages.rating.rate_the_store")),s("div",{class:"s-rating-modal-stars-company"},s("salla-rating-stars",{withLabel:!0,size:"large"})),s("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_store_rate")}),s("small",{class:"s-rating-modal-validation-msg"})):"",this.order.products_enabled?s("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products"},this.order.products.map(((a,t)=>s("div",{class:"s-rating-modal-product",key:t},s("div",{class:"rating-outer-form","data-stars-error":salla.lang.get("pages.rating.rate_product_stars")},s("div",{class:"s-rating-modal-product-img-wrap"},s("img",{src:a.product.thumbnail,alt:a.product.name,class:"s-rating-modal-product-img"})),s("div",{class:"s-rating-modal-product-details"},s("div",{class:"s-rating-modal-product-details-main"},s("div",null,s("h3",{class:"s-rating-modal-product-title"}," ",a.product.name),s("div",{class:"s-rating-modal-stars-product"},s("salla-rating-stars",{withLabel:!0,size:"small",name:`products[${t}][rating]`}))),this.allowAttachImages&&s("salla-button",{class:"s-comments-item-like-btn mt-0",loaderPosition:"center",fill:"outline",size:"small",onClick:()=>this.toggleUploader(t)},s("span",null,this.addImagesLabel),s("span",{innerHTML:r}))),s("input",{type:"hidden",name:`products[${t}][product_id]`,value:a.product.id}),s("textarea",{placeholder:salla.lang.get("pages.rating.write_product_rate"),name:`products[${t}][comment]`,class:"s-rating-modal-comment"}),s("small",{class:"s-rating-modal-validation-msg"}))),this.allowAttachImages&&s("div",{class:"s-rating-modal-uploader is-closed",ref:a=>this.contentRefs[t]=a},s("salla-file-upload",{name:"image",maxFilesCount:this.MAX_UPLOAD_LIMIT,imagePreviewHeight:117,"instant-upload":!0,type:"feedback",payloadName:"files[]",id:`file-${a.product.id}`,title:a.product.name,allowMultiple:!0,instantUpload:!0,accept:"image/png, image/jpeg, image/jpg",url:salla.url.api("upload"),onUploaded:s=>{this.productImages={...this.productImages,[a.product.id]:[...this.productImages[a.product.id]||[],s.detail]},this.hiddenInputs[t].value=this.productImages[a.product.id].map((a=>a.url)).join(",")},onRemoved:s=>{const i=s.detail;i&&this.productImages[a.product.id]&&(this.productImages={...this.productImages,[a.product.id]:this.productImages[a.product.id].filter((a=>a.id!==i))},this.hiddenInputs[t].value=this.productImages[a.product.id].map((a=>a.url)).join(","))},labelIdle:this.getFilepondPlaceholder()}),s("input",{type:"hidden",name:`products[${t}][images]`,value:(this.productImages[a.product.id]||[]).map((a=>a.url)).join(","),ref:a=>this.hiddenInputs[t]=a}),this.renderUploadedImagesCount(a.product.id)))))):"",this.order.shipping_enabled&&this.order.shipping?.company?s("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},s("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?s("div",{class:"s-rating-modal-rounded-icon"},s("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):s("span",{class:"s-rating-modal-icon",innerHTML:g}),s("div",{class:"s-rating-modal-title"}," ",`${salla.lang.get("pages.rating.rate_shipping")} ${this.order.shipping.company.name}`),s("div",{class:"s-rating-modal-stars-company"},s("salla-rating-stars",{withLabel:!0,size:"large"})),s("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:salla.lang.get("pages.rating.write_shipping_rate")}),s("small",{class:"s-rating-modal-validation-msg"})):"",s("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:a=>this.thanksTab=a},s("span",{class:"s-rating-modal-icon",innerHTML:l}),s("h3",{class:"s-rating-modal-thanks-title"},salla.lang.get("pages.rating.thanks")),s("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),s("time",{class:"s-rating-modal-thanks-time",ref:a=>this.thanksTime=a}))),this.allowContactSupport&&this.showContactWidget&&(salla.config.get("store.contacts.whatsapp")||salla.config.get("store.contacts.email"))?s("div",{class:"s-rating-modal-contact"},s("p",null,this.contactUsLabel),s("div",{class:"s-rating-modal-contact-icons"},salla.config.get("store.contacts.whatsapp")&&s("span",{onClick:()=>this.handleSendWhatsApp(),innerHTML:o}),salla.config.get("store.contacts.email")&&s("span",{onClick:()=>this.handleSendEmail(),innerHTML:d}))):"",s("div",{class:"s-rating-modal-footer"},s("button",{ref:a=>this.backBtn=a,onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},salla.lang.get("common.elements.back")),this.stepsCount>1?s("ul",{class:"s-rating-modal-dots"},[0,1,2].slice(0,this.stepsCount).map((a=>s("li",{key:a,class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",s("salla-button",{"loader-position":"center",ref:a=>this.nextBtn=a,onClick:()=>this.submit()},salla.lang.get("common.elements.next")))]:s("salla-placeholder",{alignment:"center"}))):void 0}componentWillLoad(){salla.event.on("rating::open",(()=>this.open())),salla.event.on("rating::edit",(a=>this.openEditModal(a))),salla.event.on("rating::delete",(a=>this.openDeleteModal(a)))}componentDidLoad(){salla.event.dispatch("rating::ready",this)}get host(){return i(this)}};m.style="";export{m as salla_rating_modal}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as s,h as t,H as e,a as l}from"./p-eEimxoFN.js";import{A as i}from"./p-DCZbpt2a.js";import{B as a}from"./p-D3mWkc-3.js";import{P as o}from"./p-DY4LZmNP.js";import{W as n}from"./p-ZT7ehBBk.js";import{C as r}from"./p-BsLF_HK7.js";import{S as h}from"./p-D4oPi1Ov.js";import{l as c}from"./p-BChI23pG.js";var m='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>user-circle</title>\n<path d="M16 22.964c-4.525 0-8.447 1.713-9.993 4.365-0.371 0.636-0.156 1.452 0.48 1.823s1.453 0.156 1.823-0.48c0.855-1.465 3.624-3.041 7.689-3.041s6.835 1.576 7.689 3.041c0.249 0.424 0.696 0.661 1.155 0.661 0.228 0 0.459-0.059 0.669-0.181 0.637-0.371 0.852-1.187 0.48-1.823-1.545-2.652-5.467-4.365-9.992-4.365zM22.667 13.631c0-3.676-2.991-6.667-6.667-6.667s-6.667 2.991-6.667 6.667 2.991 6.667 6.667 6.667 6.667-2.992 6.667-6.667zM12 13.631c0-2.205 1.795-4 4-4s4 1.795 4 4-1.795 4-4 4-4-1.795-4-4zM16 0.297c-8.823 0-16 7.177-16 16 0 2.941 0.821 5.831 2.373 8.357 0.252 0.411 0.689 0.636 1.137 0.636 0.239 0 0.479-0.064 0.696-0.197 0.628-0.385 0.824-1.207 0.439-1.833-1.295-2.108-1.979-4.516-1.979-6.963 0-7.352 5.981-13.333 13.333-13.333s13.333 5.981 13.333 13.333c0 2.448-0.684 4.856-1.979 6.961-0.385 0.628-0.189 1.448 0.437 1.835 0.627 0.384 1.448 0.189 1.835-0.437 1.553-2.527 2.373-5.416 2.373-8.359 0-8.823-7.177-16-16-16z"></path>\n</svg>\n';const u=class{constructor(t){s(this,t),this.accountLoading=!1,this.opened=!1,this.notifications=salla.lang.get("common.titles.notifications"),this.orders=salla.lang.get("common.titles.orders"),this.pending_orders=salla.lang.get("common.titles.pending_orders"),this.wishlist=salla.lang.get("common.titles.wishlist"),this.profile=salla.lang.get("common.titles.profile"),this.rating=salla.lang.get("common.titles.rating"),this.wallet=salla.lang.get("common.titles.wallet"),this.settings=salla.lang.get("common.titles.settings"),this.loyalty_program=salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=salla.lang.get("blocks.header.logout"),this.hello=salla.lang.get("pages.checkout.hello"),this.first_name=salla.storage.get("user.first_name")||"",this.last_name=salla.storage.get("user.last_name")||"",this.avatar=salla.storage.get("user.avatar")||salla.url.cdn("images/avatar.png",40,40),this.badges={notifications:salla.helpers.number(salla.storage.get("user.notifications")||0),pending_orders:salla.helpers.number(salla.storage.get("user.pending_orders")||0)},this.sallaAccountEnabled=!1,this.hasBadges=Number(salla.storage.get("user.pending_orders"))>0||Number(salla.storage.get("user.notifications"))>0,this.inline=!1,this.avatarOnly=!1,this.showHeader=!1,this.relativeDropdown=!1,this.autoMount=!1,this.onClickOutside=()=>{this.opened=!1},this.OrderUpdate=0,this.items={notifications:a,orders:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>box-bankers</title>\n<path d="M28 1.333h-24c-2.205 0-4 1.795-4 4v5.333c0 0.736 0.597 1.333 1.333 1.333v14.667c0 2.205 1.795 4 4 4h21.333c2.205 0 4-1.795 4-4v-14.667c0.736 0 1.333-0.597 1.333-1.333v-5.333c0-2.205-1.795-4-4-4zM28 26.667c0 0.735-0.599 1.333-1.333 1.333h-21.333c-0.735 0-1.333-0.599-1.333-1.333v-14.667h5.333v2.667c0 1.471 1.196 2.667 2.667 2.667h8c1.471 0 2.667-1.196 2.667-2.667v-2.667h5.333zM12 14.667v-2.667h8v2.667zM29.333 9.333h-26.667v-4c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',pending_orders:o,wishlist:n,wallet:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>wallet</title>\n<path d="M28 6.667h-24c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333h24c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-24c-2.204 0-3.999 1.793-4 3.997v18.669c0 3.676 2.991 6.667 6.667 6.667h21.333c2.205 0 4-1.795 4-4v-16c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.736-0.597 1.333-1.333 1.333h-21.333c-2.205 0-4-1.795-4-4v-14.895c0.416 0.147 0.865 0.228 1.333 0.228h24c0.736 0 1.333 0.597 1.333 1.333zM22.667 14.667c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 20c-0.736 0-1.333-0.597-1.333-1.333s0.597-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.597 1.333-1.333 1.333z"></path>\n</svg>\n',loyalty_program:c,profile:m}}async componentWillLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.loadTranslations(),this.initiate(),Salla.event.on("api::token.injected",(s=>this.profileUrl=this.buildProfileUrl(s))),this.sallaAccountEnabled=Salla.config.get("store.features")?.includes("salla-account"),this.items=this.sallaAccountEnabled?{...this.items,settings:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>settings</title>\n<path d="M29.717 19.037l-1.817-1.499c0.067-0.512 0.1-1.028 0.1-1.539s-0.033-1.027-0.1-1.54l1.817-1.499c1.177-0.969 1.479-2.633 0.716-3.956l-1.159-2.009c-0.761-1.324-2.349-1.895-3.784-1.359l-2.212 0.829c-0.817-0.627-1.704-1.139-2.649-1.535l-0.388-2.332c-0.251-1.507-1.54-2.6-3.067-2.6h-2.319c-1.525 0-2.815 1.093-3.065 2.6l-0.388 2.332c-0.945 0.396-1.833 0.909-2.649 1.535l-2.212-0.829c-1.428-0.533-3.021 0.036-3.783 1.359l-1.16 2.011c-0.763 1.323-0.46 2.985 0.716 3.955l1.817 1.499c-0.067 0.513-0.1 1.029-0.1 1.54s0.033 1.027 0.1 1.539l-1.819 1.5c-1.176 0.971-1.476 2.635-0.715 3.955l1.159 2.011c0.763 1.324 2.356 1.899 3.784 1.36l2.212-0.831c0.816 0.625 1.703 1.139 2.649 1.535l0.388 2.332c0.251 1.507 1.54 2.6 3.067 2.6h2.319c1.527 0 2.816-1.093 3.065-2.6l0.389-2.332c0.947-0.396 1.833-0.909 2.649-1.535l2.212 0.831c1.432 0.539 3.023-0.035 3.783-1.36l1.16-2.011c0.76-1.32 0.459-2.984-0.717-3.956zM28.123 21.663l-1.16 2.011c-0.108 0.188-0.336 0.267-0.536 0.193l-2.931-1.1c-0.459-0.173-0.979-0.079-1.349 0.248-0.923 0.811-1.979 1.423-3.139 1.819-0.464 0.157-0.804 0.559-0.885 1.043l-0.515 3.087c-0.033 0.215-0.216 0.371-0.433 0.371h-2.319c-0.217 0-0.4-0.156-0.436-0.371l-0.513-3.087c-0.080-0.484-0.42-0.884-0.885-1.043-1.16-0.396-2.216-1.008-3.139-1.819-0.248-0.217-0.561-0.332-0.88-0.332-0.157 0-0.316 0.028-0.469 0.084l-2.931 1.1c-0.199 0.079-0.428-0.004-0.537-0.193l-1.159-2.011c-0.109-0.191-0.067-0.428 0.101-0.568l2.409-1.985c0.379-0.312 0.555-0.807 0.46-1.288-0.119-0.605-0.179-1.219-0.179-1.821 0-0.604 0.060-1.217 0.181-1.823 0.095-0.481-0.081-0.976-0.46-1.288l-2.409-1.985c-0.168-0.139-0.211-0.376-0.101-0.567l1.16-2.011c0.107-0.188 0.332-0.268 0.536-0.193l2.931 1.1c0.459 0.172 0.979 0.079 1.348-0.247 0.924-0.812 1.98-1.424 3.139-1.817 0.465-0.159 0.805-0.559 0.885-1.044l0.513-3.088c0.036-0.215 0.219-0.371 0.436-0.371h2.319c0.217 0 0.4 0.156 0.436 0.371l0.515 3.088c0.081 0.484 0.42 0.885 0.885 1.044 1.157 0.393 2.213 1.005 3.139 1.817 0.371 0.325 0.889 0.42 1.349 0.247l2.929-1.099c0.203-0.076 0.428 0.005 0.537 0.193l1.159 2.009c0.109 0.191 0.067 0.428-0.101 0.567l-2.409 1.985c-0.379 0.312-0.555 0.807-0.46 1.288 0.119 0.605 0.179 1.219 0.179 1.823 0 0.603-0.060 1.216-0.181 1.821-0.095 0.48 0.081 0.975 0.46 1.288l2.408 1.984c0.169 0.141 0.212 0.379 0.103 0.569zM16.016 10.667c-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333 5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM16.016 18.667c-1.471 0-2.667-1.196-2.667-2.667s1.196-2.667 2.667-2.667 2.667 1.196 2.667 2.667-1.196 2.667-2.667 2.667z"></path>\n</svg>\n'}:this.items,this.host.hasAttribute("with-rating")&&(this.items.rating=h),this.items.logout='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>send-out</title>\n<path d="M16 26.667h-9.333c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.736 0.597-1.333 1.333-1.333h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333h-9.333c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h9.333c0.737 0 1.333-0.596 1.333-1.333s-0.596-1.333-1.333-1.333zM29.231 15.491c-0.068-0.164-0.167-0.312-0.289-0.436l-5.332-5.332c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l3.057 3.059h-12.781c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h12.781l-3.057 3.057c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l5.332-5.332c0.124-0.123 0.221-0.271 0.289-0.435 0.135-0.325 0.135-0.693 0-1.019z"></path>\n</svg>\n';let s=Salla.storage.get("token");s||(s=""),this.profileUrl=this.buildProfileUrl(s);const t=this.host.querySelector('[slot="trigger"]');this.triggerSlot='<div class="s-user-menu-trigger"><div class="s-user-menu-avatar-wrap"><img class="s-user-menu-trigger-avatar" src="{avatar}" alt="{first_name}{last_name}" /></div><div class="s-user-menu-trigger-content"><span class="s-user-menu-trigger-hello">{hello}</span><p class="s-user-menu-trigger-name">{first_name} {last_name}</p></div> <i class="s-user-menu-trigger-icon">{icon}</i></div>',t&&(this.triggerSlot=t.innerHTML,t.innerHTML=this.replaceParams(t.innerHTML))}loadTranslations(){this.notifications=Salla.lang.get("common.titles.notifications"),this.orders=Salla.lang.get("common.titles.orders"),this.pending_orders=Salla.lang.get("common.titles.pending_orders"),this.wishlist=Salla.lang.get("common.titles.wishlist"),this.profile=Salla.lang.get("common.titles.profile"),this.hello=Salla.lang.get("pages.checkout.hello"),this.rating=Salla.lang.get("common.titles.rating"),this.wallet=Salla.lang.get("common.titles.wallet"),this.settings=Salla.lang.get("common.titles.settings"),this.loyalty_program=Salla.lang.get("pages.loyalty_program.loyalty_points"),this.logout=Salla.lang.get("blocks.header.logout")}initiate(){return Salla.config.isGuest()?this.autoMountLoginModal():(this.is_loggedIn=!0,!this.inline&&(salla.url.is_page("customer.notifications")||salla.url.is_page("customer.orders.index.pending")||salla.url.is_page("customer.profile")||(Date.now()-(salla.storage.get("user.fetched_at")||0))/1e3/60>30)?this.fetchFreshProfile():void salla.event.on("profile::info.fetched",(s=>{this.updateProfileState(s)})))}autoMountLoginModal(){this.autoMount&&(document.querySelector("salla-login-modal")||Salla.hooks.mount("body:end",document.createElement("salla-login-modal")))}fetchFreshProfile(){salla.api.token?salla.profile.api.info().then((s=>{this.updateProfileState(s)})):salla.log("trying to fetchFreshProfile before injected the token!!")}updateProfileState(s){this.badges={notifications:salla.helpers.number(s.data.notifications||0),pending_orders:salla.helpers.number(s.data.pending_orders||0)},this.hasBadges=Number(s.data.pending_orders)>0||Number(s.data.notifications)>0,this.first_name=s.data.first_name,this.last_name=s.data.last_name,this.avatar=s.data.avatar||salla.url.cdn("images/avatar.png",40,40)}async open(s){this.opened=!this.opened,s.stopPropagation(),this.opened&&window.addEventListener("click",this.onClickOutside)}menuItemClicked(s,t){"logout"===t&&(s.preventDefault(),salla.auth.logout("sall-user-menu"))}replaceParams(s){return s.replace(/\{hello\}/g,this.hello).replace(/\{first_name\}/g,this.first_name).replace(/\{last_name\}/g,this.last_name).replace(/\{avatar\}/g,this.avatar).replace(/\{icon\}/g,i)}getTheHeader(){return t("div",{class:{"s-user-menu-trigger-slot":!0,"s-user-menu-red-dot":this.hasBadges,"s-user-menu-trigger-avatar-only":this.avatarOnly},id:"trigger-slot",onClick:s=>this.open(s),onKeyUp:s=>this.open(s),innerHTML:this.replaceParams(this.triggerSlot)})}getItemAnchorLinkAttrs(s){return"profile"===s&&this.profileUrl&&this.sallaAccountEnabled?{href:this.profileUrl,target:"_blank",rel:"noopener noreferrer"}:{href:Salla.url.get("loyalty_program"===s?"loyalty":s)}}getMenuItem([s,e],l){if(("wallet"!==s||window.can_access_wallet)&&("loyalty_program"!==s||Salla.config.get("store.features").includes("loyalty-system")))return t("li",{class:{"s-user-menu-dropdown-item":!0,"s-user-menu-dropdown-item-logout":l+1===Object.entries(this.items).length}},t("a",{...this.getItemAnchorLinkAttrs(s),class:"s-user-menu-dropdown-item-link",onClick:t=>this.menuItemClicked(t,s)},t("i",{class:"s-user-menu-dropdown-item-prefix",innerHTML:e}),t("span",{class:"s-user-menu-dropdown-item-title"},this[s]),["٠","0",void 0].includes(this.badges[s])?"":t("span",{class:"s-user-menu-dropdown-item-badge"},this.badges[s])))}componentShouldUpdate(){this.opened||window.removeEventListener("click",this.onClickOutside)}render(){return t(e,null,this.is_loggedIn?this.inline?t("ul",{class:"s-user-menu-inline"},Object.entries(this.items).map(((s,t)=>this.getMenuItem(s,t)))):t("div",{class:{"s-user-menu-wrapper":!0,"s-user-menu-relative-dropdown":this.relativeDropdown}},this.getTheHeader(),t("div",{class:{"s-user-menu-toggler":!0,opened:this.opened}},t("div",{class:"s-user-menu-dropdown",onClick:s=>s.stopPropagation(),onKeyUp:s=>s.stopPropagation()},this.showHeader?t("div",{class:"s-user-menu-dropdown-header"},t("img",{src:this.avatar,alt:`${this.first_name} ${this.last_name}`}),t("div",{class:"s-user-menu-dropdown-header-content"},t("span",null,this.hello),t("p",null,this.first_name," ",this.last_name)),t("button",{type:"button",class:"s-user-menu-dropdown-header-close",innerHTML:r,onClick:()=>{this.opened=!1}})):"",t("ul",{class:"s-user-menu-dropdown-list"},Object.entries(this.items).map(((s,t)=>this.getMenuItem(s,t))))))):t("slot",{name:"login-btn"},t("button",{type:"button",class:"s-user-menu-login-btn",onClick:()=>salla.event.dispatch("login::open"),innerHTML:m})))}componentDidLoad(){document.lazyLoadInstance?.update(this.host.querySelectorAll(".lazy"))}buildProfileUrl(s){return`${Salla.config.get("account.url","https://accounts.salla.com")}/${salla.config.get("user.language_code")}/user?store=${Salla.config.get("store.id")}&info=${encodeURIComponent(s)}`}get host(){return l(this)}};u.style="";export{u as salla_user_menu}
@@ -1,4 +0,0 @@
1
- /*!
2
- * Crafted with ❤ by Salla
3
- */
4
- import{r as a,h as l,a as s}from"./p-eEimxoFN.js";const e=class{constructor(l){a(this,l),this.translationLoaded=!1,this.languages=[],this.currencies=[],this.hasError=!1,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),salla.event.on("localization::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),this.languageSlot=this.host.querySelector('[slot="language"]')?.innerHTML||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span></label>',this.currencySlot=this.host.querySelector('[slot="currency"]')?.innerHTML||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{code}</small></label>'}async open(){return this.modal.open(),await salla.api.withoutNotifier((()=>this.getLanguages())).then((()=>this.getCurrencies())).then((()=>{this.languages.length<2&&this.currencies.length<2&&this.modal.close()})).catch((a=>{console.log(a),this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async getLanguages(){return this.language=this.language||salla.config.get("user.language_code"),this.languages.length>1?null:await salla.config.languages().then((a=>this.languages=a))}async getCurrencies(){return this.currency=this.currency||salla.config.get("user.currency_code"),this.currencies.length>1?null:await salla.config.currencies().then((a=>this.currencies=Object.values(a||{})))}onChangeCurrency(a){this.currency=a.target.value}onChangeLanguage(a){this.language=a.target.value}async submit(){let a;this.btn.load().then((()=>{if(this.currency){if(this.currency!==salla.config.get("user.currency_code","SAR"))return a=window.location.href,salla.currency.api.change(this.currency)}else salla.log("There is no currency!")})).then((()=>{this.language!==salla.config.get("user.language_code","ar")&&(a=salla.helpers.addParamToUrl("lang",this.language))})).then((()=>{salla.cookie.set("s-lang",this.language),salla.cookie.set("s-curr",this.currency)})).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>{a&&(window.location.href=a.replace(`/${salla.config.get("user.language_code")}/`,`/${this.language}/`))}))}render(){return l("salla-modal",{key:"d3a45aa4cc807e1ba549514b59ada59a2397bff0",isLoading:!0,class:"s-hidden",ref:a=>this.modal=a,width:"xs"},l("div",{key:"1794f7c9e31a1a1b622363fa21905a73a8bbdb68",slot:"loading"},l("div",{key:"d55e1b7fb36f84616dde3f19955c7e5013838080",class:"s-localization-modal-skeleton"},l("salla-skeleton",{key:"7a25a0f055f401a8a63030df1ab930957668c1df",width:"25%",height:"15px"}),l("div",{key:"8e9c1aba813a5efa58dc4132a504d1612343cce6",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>l("div",{class:"s-localization-modal-skeleton-item"},l("div",{class:"s-localization-modal-skeleton-item-flex"},l("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),l("salla-skeleton",{height:"10px",width:"100px"})),l("salla-skeleton",{height:"15px",width:"20px"}))))),l("salla-skeleton",{key:"b3ef9e80a8dec053e9c0e6d10d1145d4057c98ad",width:"25%",height:"15px"}),l("div",{key:"1d062e516cc37994e34c0aa77634bc7a2311c4ff",class:"s-localization-modal-skeleton-content"},[...Array(4)].map((()=>l("div",{class:"s-localization-modal-skeleton-item"},l("div",{class:"s-localization-modal-skeleton-item-flex"},l("salla-skeleton",{type:"circle",height:"16px",width:"16px"}),l("salla-skeleton",{height:"10px",width:"100px"})),l("salla-skeleton",{height:"15px",width:"20px"}))))),l("salla-skeleton",{key:"9f7a16b0f3881882fc257ed7e1290380dea38a4c",height:"40px",width:"100%"}))),this.hasError?l("salla-placeholder",{alignment:"center"},l("span",{slot:"description"},this.errorMessage)):l("div",{class:"s-localization-modal-inner"},this.languages.length>1?l("div",{class:"s-localization-modal-section"},l("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.language")),l("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((a=>l("div",{class:"s-localization-modal-item"},l("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==a.iso_code,onChange:()=>this.language=a.iso_code,name:"language",id:"lang-"+a.code.toLowerCase(),value:a.code}),l("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,a.name).replace(/\{code\}/g,a.code).replace(/\{country_code\}/g,a.country_code)})))):l("select",{class:"s-localization-modal-select",name:"language",onChange:a=>this.onChangeLanguage(a)},this.languages.map((a=>l("option",{value:a.code,selected:this.language==a.code},a.name)))))):"",this.currencies.length>1?l("div",{class:"s-localization-modal-section"},l("label",{class:"s-localization-modal-title"},salla.lang.get("common.titles.currency")),l("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((a=>l("div",{class:"s-localization-modal-item"},l("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==a.code,onChange:()=>this.currency=a.code,id:"currency-"+a.code,value:a.code}),l("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,a.name).replace(/\{code\}/g,a.code).replace(/\{country_code\}/g,a.country_code)})))):l("select",{class:"s-localization-modal-select",name:"currency",onChange:a=>this.onChangeCurrency(a)},this.currencies.map((a=>l("option",{value:a.code,selected:this.currency==a.code},a.name)))))):"",l("salla-button",{width:"wide",ref:a=>this.btn=a,onClick:()=>this.submit()},salla.lang.get("common.elements.ok"))))}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((a=>a.replaceWith(a.firstChild))),this.host.querySelectorAll("#language-slot").forEach((a=>a.replaceWith(a.firstChild)))}get host(){return s(this)}};export{e as salla_localization_modal}