@salla.sa/twilight-components 2.14.523 → 2.14.524

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 (337) hide show
  1. package/dist/cjs/{filepond-DCHVhc44.js → filepond-BVaAyFoF.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-CfA-n2Oh.js → filepond-plugin-file-poster-D_7P3fIq.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DZQkwEKK.js → filepond-plugin-file-validate-size-wpUbEEJQ.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-Dl8je2Fu.js → filepond-plugin-file-validate-type-DnsofxYi.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-BzYslA6t.js → filepond-plugin-image-edit-BN8NNj8r.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-D856YsXh.js → filepond-plugin-image-exif-orientation-Bh2lasm5.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CYa8C4oD.js → filepond-plugin-image-preview-CEuvK6zb.js} +1 -1
  8. package/dist/cjs/{functions-DG_jVKBR.js → functions-BsqbMNo6.js} +1 -1
  9. package/dist/cjs/{index-EWm59_5l.js → index-B2m0lkUU.js} +6 -6
  10. package/dist/cjs/{index-D-YSscuC.js → index-D5DmfeX9.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-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-booking-field_7.cjs.entry.js +10 -10
  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 +1 -1
  28. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  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 +1 -1
  32. package/dist/cjs/salla-count-down_2.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.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-loyalty-exchange-product-card_5.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  49. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  50. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  54. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-shipments.cjs.entry.js +41 -4
  77. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  107. package/dist/cjs/{tracked-promise-C2tbWLf_.js → tracked-promise-DV7LEYsU.js} +1 -1
  108. package/dist/cjs/twilight.cjs.js +2 -2
  109. package/dist/cjs/{vanilla-picker-BXezTQQL.js → vanilla-picker-CXvH2EWT.js} +1 -1
  110. package/dist/collection/Helpers/latest-request.js +31 -0
  111. package/dist/collection/components/salla-order-shipments/salla-order-shipments.js +12 -3
  112. package/dist/components/index.js +2 -2
  113. package/dist/components/salla-order-shipments.js +40 -3
  114. package/dist/esm/{filepond-DQ6pHM8K.js → filepond-DTzVnm2p.js} +1 -1
  115. package/dist/esm/{filepond-plugin-file-poster-Cin3Drv6.js → filepond-plugin-file-poster-Bgus9Ofh.js} +1 -1
  116. package/dist/esm/{filepond-plugin-file-validate-size-Bo-SgRcF.js → filepond-plugin-file-validate-size-B8PRvgIP.js} +1 -1
  117. package/dist/esm/{filepond-plugin-file-validate-type-DvBZJiZ0.js → filepond-plugin-file-validate-type-CAs60OfK.js} +1 -1
  118. package/dist/esm/{filepond-plugin-image-edit-DTVE32mN.js → filepond-plugin-image-edit-5pQX-bqs.js} +1 -1
  119. package/dist/esm/{filepond-plugin-image-exif-orientation-W7UUFbyD.js → filepond-plugin-image-exif-orientation-CQmP0y_L.js} +1 -1
  120. package/dist/esm/{filepond-plugin-image-preview-DGuRiudm.js → filepond-plugin-image-preview-DdIiCGg1.js} +1 -1
  121. package/dist/esm/{functions-D7FvvD3w.js → functions-DpljrYCU.js} +1 -1
  122. package/dist/esm/{index-Bg8UYNC5.js → index-DPAGXd41.js} +1 -1
  123. package/dist/esm/{index-BM5d07q2.js → index-Dm54yhRt.js} +6 -6
  124. package/dist/esm/loader.js +3 -3
  125. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  126. package/dist/esm/salla-accordion_6.entry.js +1 -1
  127. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  128. package/dist/esm/salla-advertisement.entry.js +1 -1
  129. package/dist/esm/salla-alert_2.entry.js +1 -1
  130. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  131. package/dist/esm/salla-apps-icons.entry.js +1 -1
  132. package/dist/esm/salla-badge.entry.js +1 -1
  133. package/dist/esm/salla-basket-gap.entry.js +1 -1
  134. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  135. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  136. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  137. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  138. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  139. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  140. package/dist/esm/salla-comment-factors.entry.js +1 -1
  141. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  142. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  143. package/dist/esm/salla-contacts.entry.js +1 -1
  144. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  145. package/dist/esm/salla-count-down_2.entry.js +1 -1
  146. package/dist/esm/salla-custom-fields.entry.js +1 -1
  147. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  148. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  149. package/dist/esm/salla-filters-widget.entry.js +1 -1
  150. package/dist/esm/salla-filters.entry.js +1 -1
  151. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  152. package/dist/esm/salla-gifting.entry.js +1 -1
  153. package/dist/esm/salla-hook.entry.js +1 -1
  154. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  155. package/dist/esm/salla-installment.entry.js +1 -1
  156. package/dist/esm/salla-list-tile.entry.js +1 -1
  157. package/dist/esm/salla-localization-modal.entry.js +1 -1
  158. package/dist/esm/salla-login-modal.entry.js +1 -1
  159. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  160. package/dist/esm/salla-loyalty-exchange-product-card_5.entry.js +3 -3
  161. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  162. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  163. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  164. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  165. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  166. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  167. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  168. package/dist/esm/salla-loyalty.entry.js +1 -1
  169. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  170. package/dist/esm/salla-map_2.entry.js +1 -1
  171. package/dist/esm/salla-menu.entry.js +1 -1
  172. package/dist/esm/salla-metadata.entry.js +1 -1
  173. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  174. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  175. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  176. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  177. package/dist/esm/salla-notification-item.entry.js +1 -1
  178. package/dist/esm/salla-notifications.entry.js +1 -1
  179. package/dist/esm/salla-offer-modal.entry.js +1 -1
  180. package/dist/esm/salla-offer.entry.js +1 -1
  181. package/dist/esm/salla-order-branch.entry.js +1 -1
  182. package/dist/esm/salla-order-cancel.entry.js +1 -1
  183. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  184. package/dist/esm/salla-order-details-options.entry.js +1 -1
  185. package/dist/esm/salla-order-details.entry.js +1 -1
  186. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  187. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  188. package/dist/esm/salla-order-edit.entry.js +1 -1
  189. package/dist/esm/salla-order-shipments.entry.js +41 -4
  190. package/dist/esm/salla-order-summary.entry.js +1 -1
  191. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  192. package/dist/esm/salla-orders.entry.js +1 -1
  193. package/dist/esm/salla-payments.entry.js +1 -1
  194. package/dist/esm/salla-placeholder.entry.js +1 -1
  195. package/dist/esm/salla-price-range.entry.js +1 -1
  196. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  197. package/dist/esm/salla-product-card_2.entry.js +1 -1
  198. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  199. package/dist/esm/salla-products-list.entry.js +1 -1
  200. package/dist/esm/salla-quick-order.entry.js +1 -1
  201. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  202. package/dist/esm/salla-rating-modal.entry.js +1 -1
  203. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  204. package/dist/esm/salla-scopes.entry.js +1 -1
  205. package/dist/esm/salla-search.entry.js +1 -1
  206. package/dist/esm/salla-skeleton.entry.js +1 -1
  207. package/dist/esm/salla-slider.entry.js +1 -1
  208. package/dist/esm/salla-social-share.entry.js +1 -1
  209. package/dist/esm/salla-social.entry.js +1 -1
  210. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  211. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  212. package/dist/esm/salla-tooltip.entry.js +1 -1
  213. package/dist/esm/salla-trust-badges.entry.js +1 -1
  214. package/dist/esm/salla-user-menu.entry.js +1 -1
  215. package/dist/esm/salla-user-profile.entry.js +1 -1
  216. package/dist/esm/salla-user-settings.entry.js +1 -1
  217. package/dist/esm/salla-verify.entry.js +1 -1
  218. package/dist/esm/salla-wallet.entry.js +1 -1
  219. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  220. package/dist/esm/{tracked-promise-C6Ob-qmO.js → tracked-promise-B8yCrzxY.js} +1 -1
  221. package/dist/esm/twilight.js +3 -3
  222. package/dist/esm/{vanilla-picker-DgInak8N.js → vanilla-picker-DFISd8Ab.js} +1 -1
  223. package/dist/twilight/{p-7b0fd2d3.entry.js → p-00d22240.entry.js} +1 -1
  224. package/dist/twilight/{p-8bcbf94b.entry.js → p-01277c1f.entry.js} +1 -1
  225. package/dist/twilight/{p-29396bf6.entry.js → p-042fe473.entry.js} +1 -1
  226. package/dist/twilight/{p-1eb9b42d.entry.js → p-066b78d8.entry.js} +1 -1
  227. package/dist/twilight/{p-d5d107ea.entry.js → p-074f8d80.entry.js} +1 -1
  228. package/dist/twilight/{p-7741fc5c.entry.js → p-083bc1c5.entry.js} +1 -1
  229. package/dist/twilight/{p-2562e44b.entry.js → p-08c61694.entry.js} +1 -1
  230. package/dist/twilight/{p-55d1c6c9.entry.js → p-0b74b865.entry.js} +1 -1
  231. package/dist/twilight/{p-abc35ead.entry.js → p-0e24390e.entry.js} +1 -1
  232. package/dist/twilight/{p-c16c5ef5.entry.js → p-18dc5f4f.entry.js} +1 -1
  233. package/dist/twilight/{p-a560ee5f.entry.js → p-1ca4cb0a.entry.js} +1 -1
  234. package/dist/twilight/{p-2ac41a04.entry.js → p-1daa6531.entry.js} +1 -1
  235. package/dist/twilight/{p-8db3e0c5.entry.js → p-24901c56.entry.js} +1 -1
  236. package/dist/twilight/{p-1062425d.entry.js → p-2798756b.entry.js} +1 -1
  237. package/dist/twilight/{p-e45ead59.entry.js → p-282d3b67.entry.js} +1 -1
  238. package/dist/twilight/{p-af6f8519.entry.js → p-2b52c465.entry.js} +1 -1
  239. package/dist/twilight/{p-e99c1765.entry.js → p-2ca2dc2a.entry.js} +1 -1
  240. package/dist/twilight/{p-1de72efd.entry.js → p-2db47792.entry.js} +1 -1
  241. package/dist/twilight/{p-abf4c948.entry.js → p-2dbea343.entry.js} +1 -1
  242. package/dist/twilight/{p-6dcd7b46.entry.js → p-2e9f26cf.entry.js} +1 -1
  243. package/dist/twilight/{p-a3aef8bb.entry.js → p-31d66e74.entry.js} +1 -1
  244. package/dist/twilight/{p-9b28408b.entry.js → p-32f66a87.entry.js} +1 -1
  245. package/dist/twilight/{p-b8e31d81.entry.js → p-34bb17c9.entry.js} +1 -1
  246. package/dist/twilight/{p-DnmPgY_G.js → p-3Tx29o41.js} +1 -1
  247. package/dist/twilight/{p-ac6abf15.entry.js → p-4364da4b.entry.js} +1 -1
  248. package/dist/twilight/{p-bfc96cf2.entry.js → p-4467ceb0.entry.js} +1 -1
  249. package/dist/twilight/{p-b2a4ebbb.entry.js → p-44ce2c67.entry.js} +1 -1
  250. package/dist/twilight/{p-3e3b4ace.entry.js → p-453ac18c.entry.js} +1 -1
  251. package/dist/twilight/{p-d1b29d76.entry.js → p-4c3b7f11.entry.js} +1 -1
  252. package/dist/twilight/{p-bad00f10.entry.js → p-4f5916dd.entry.js} +1 -1
  253. package/dist/twilight/{p-45f5fa27.entry.js → p-5acbcd72.entry.js} +1 -1
  254. package/dist/twilight/{p-0a1790b8.entry.js → p-6417da90.entry.js} +1 -1
  255. package/dist/twilight/{p-a43ce575.entry.js → p-6aa57467.entry.js} +1 -1
  256. package/dist/twilight/{p-23dc064a.entry.js → p-6c0de09b.entry.js} +1 -1
  257. package/dist/twilight/{p-65dd99ed.entry.js → p-6d989923.entry.js} +1 -1
  258. package/dist/twilight/{p-45729b8e.entry.js → p-6f20f79a.entry.js} +1 -1
  259. package/dist/twilight/{p-ce653f7c.entry.js → p-6fe98a4d.entry.js} +1 -1
  260. package/dist/twilight/{p-1966d0ca.entry.js → p-70e2d99d.entry.js} +1 -1
  261. package/dist/twilight/{p-ee69544b.entry.js → p-71aeefcf.entry.js} +1 -1
  262. package/dist/twilight/{p-66312912.entry.js → p-7622f77e.entry.js} +1 -1
  263. package/dist/twilight/{p-70d1e905.entry.js → p-764b05c3.entry.js} +1 -1
  264. package/dist/twilight/{p-ace9d8f0.entry.js → p-811d6f89.entry.js} +1 -1
  265. package/dist/twilight/{p-aba9e8c2.entry.js → p-82e55dfd.entry.js} +1 -1
  266. package/dist/twilight/{p-bc0558d2.entry.js → p-8493acd8.entry.js} +1 -1
  267. package/dist/twilight/{p-afe7c1ba.entry.js → p-85ffcb0d.entry.js} +1 -1
  268. package/dist/twilight/{p-6f0215ec.entry.js → p-865393ae.entry.js} +1 -1
  269. package/dist/twilight/{p-42fc5f2f.entry.js → p-879904a5.entry.js} +1 -1
  270. package/dist/twilight/p-8a789d76.entry.js +4 -0
  271. package/dist/twilight/{p-9fdbb0fe.entry.js → p-8d2a1e57.entry.js} +1 -1
  272. package/dist/twilight/{p-42551c8c.entry.js → p-8e05dbd7.entry.js} +1 -1
  273. package/dist/twilight/{p-e060ee6b.entry.js → p-90929ee0.entry.js} +1 -1
  274. package/dist/twilight/{p-afe2670a.entry.js → p-92cf1e0d.entry.js} +1 -1
  275. package/dist/twilight/{p-719cd9a6.entry.js → p-96d471a9.entry.js} +1 -1
  276. package/dist/twilight/{p-7dd8a87f.entry.js → p-9f88fd32.entry.js} +1 -1
  277. package/dist/twilight/{p-CHQutKQ7.js → p-BdU8gNuL.js} +1 -1
  278. package/dist/twilight/{p-kYkXTeTb.js → p-Bmtik9Kw.js} +1 -1
  279. package/dist/twilight/{p-Cvx2P5Pg.js → p-Bsy6Ioog.js} +1 -1
  280. package/dist/twilight/{p-Cc9owUMd.js → p-CK_JEpA3.js} +1 -1
  281. package/dist/twilight/{p-JQryHMzJ.js → p-CQ_QHwLy.js} +1 -1
  282. package/dist/twilight/{p-lri6csDE.js → p-C_YmM4Ke.js} +1 -1
  283. package/dist/twilight/{p-BbNEoGml.js → p-CfrlyZxh.js} +1 -1
  284. package/dist/twilight/{p-DaCdMnag.js → p-D6U543Hv.js} +1 -1
  285. package/dist/twilight/{p-CyUI27N5.js → p-DOQPe4jW.js} +1 -1
  286. package/dist/twilight/{p-BM5d07q2.js → p-Dm54yhRt.js} +1 -1
  287. package/dist/twilight/{p-e-mxvhkF.js → p-N0-g_Ku2.js} +2 -2
  288. package/dist/twilight/{p-26cac2a2.entry.js → p-a26fb2b5.entry.js} +1 -1
  289. package/dist/twilight/p-a307c408.entry.js +4 -0
  290. package/dist/twilight/{p-e9259ff2.entry.js → p-a5070e48.entry.js} +1 -1
  291. package/dist/twilight/{p-e0a0653e.entry.js → p-a7643570.entry.js} +1 -1
  292. package/dist/twilight/{p-9c1e5214.entry.js → p-acfc17d6.entry.js} +1 -1
  293. package/dist/twilight/{p-1865bb17.entry.js → p-b089053b.entry.js} +1 -1
  294. package/dist/twilight/{p-3f1b74c4.entry.js → p-b53f24e0.entry.js} +1 -1
  295. package/dist/twilight/{p-ff5fc7fa.entry.js → p-b775c3a7.entry.js} +1 -1
  296. package/dist/twilight/{p-d23989f3.entry.js → p-b9228f9e.entry.js} +1 -1
  297. package/dist/twilight/{p-80bdb370.entry.js → p-bbad7f4d.entry.js} +1 -1
  298. package/dist/twilight/{p-a4d7223f.entry.js → p-bc633deb.entry.js} +1 -1
  299. package/dist/twilight/{p-5c5f6ad3.entry.js → p-bd31410b.entry.js} +1 -1
  300. package/dist/twilight/{p-9fb0a8ad.entry.js → p-be71261f.entry.js} +1 -1
  301. package/dist/twilight/{p-b3f60292.entry.js → p-bf7b92c5.entry.js} +1 -1
  302. package/dist/twilight/p-c38bfc00.entry.js +4 -0
  303. package/dist/twilight/{p-5ce9e4e4.entry.js → p-c55ed08e.entry.js} +1 -1
  304. package/dist/twilight/{p-30089930.entry.js → p-c88af64d.entry.js} +1 -1
  305. package/dist/twilight/{p-8b16e8b8.entry.js → p-cd0f27b8.entry.js} +1 -1
  306. package/dist/twilight/{p-82384661.entry.js → p-ce888cc2.entry.js} +1 -1
  307. package/dist/twilight/{p-04756108.entry.js → p-d171016f.entry.js} +1 -1
  308. package/dist/twilight/{p-b827f3d2.entry.js → p-d34ee17e.entry.js} +1 -1
  309. package/dist/twilight/{p-5aa658d1.entry.js → p-d5262ac3.entry.js} +1 -1
  310. package/dist/twilight/{p-b5203de2.entry.js → p-d594a28c.entry.js} +1 -1
  311. package/dist/twilight/{p-90ea6647.entry.js → p-d6146737.entry.js} +1 -1
  312. package/dist/twilight/{p-beb0a808.entry.js → p-d8909798.entry.js} +1 -1
  313. package/dist/twilight/{p-3c5c8040.entry.js → p-d8d26e4b.entry.js} +1 -1
  314. package/dist/twilight/{p-9e1645b7.entry.js → p-d9a53204.entry.js} +1 -1
  315. package/dist/twilight/{p-dec7ad63.entry.js → p-df1badad.entry.js} +1 -1
  316. package/dist/twilight/{p-fdfa010d.entry.js → p-e14dc1a9.entry.js} +1 -1
  317. package/dist/twilight/{p-78ed3c14.entry.js → p-e4c40a79.entry.js} +1 -1
  318. package/dist/twilight/{p-7cdfa2ed.entry.js → p-e6255c72.entry.js} +1 -1
  319. package/dist/twilight/{p-c82feb7c.entry.js → p-e775748f.entry.js} +1 -1
  320. package/dist/twilight/{p-01f81bed.entry.js → p-e8cc3acd.entry.js} +1 -1
  321. package/dist/twilight/{p-f443ae10.entry.js → p-eb1e775a.entry.js} +1 -1
  322. package/dist/twilight/{p-c98be632.entry.js → p-edae5524.entry.js} +1 -1
  323. package/dist/twilight/{p-698f2e97.entry.js → p-f1639848.entry.js} +1 -1
  324. package/dist/twilight/{p-62ff80dc.entry.js → p-f351fca5.entry.js} +1 -1
  325. package/dist/twilight/{p-0e4332c5.entry.js → p-f6b097ee.entry.js} +1 -1
  326. package/dist/twilight/{p-2aa80a12.entry.js → p-f9f3639d.entry.js} +1 -1
  327. package/dist/twilight/{p-a6a1affc.entry.js → p-fcc76e96.entry.js} +1 -1
  328. package/dist/twilight/{p-66714663.entry.js → p-fcfd176b.entry.js} +1 -1
  329. package/dist/twilight/{p-f72a852a.entry.js → p-ff58cb8e.entry.js} +1 -1
  330. package/dist/twilight/twilight.esm.js +1 -1
  331. package/dist/types/Helpers/latest-request.d.ts +18 -0
  332. package/dist/types/components/salla-order-shipments/interfaces.d.ts +6 -0
  333. package/dist/types/components/salla-order-shipments/salla-order-shipments.d.ts +2 -0
  334. package/package.json +5 -5
  335. package/dist/twilight/p-3fb2daff.entry.js +0 -4
  336. package/dist/twilight/p-d97d37ec.entry.js +0 -4
  337. package/dist/twilight/p-e2e84b7e.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as i,a as e}from"./p-BM5d07q2.js";const a=class{constructor(t){s(this,t),this.menuOpen=!1,this.hasProducts=!1,this.specificMode=!1,this.selectedIds=[],this.loadedProductCount=0,this.isSharing=!1,this.shareUrl="",this.isListSyncPaused=!1,this.translationDefaults={"pages.wishlist.share":{ar:"شارك",en:"Share"},"pages.wishlist.share_all":{ar:"مشاركة القائمة",en:"Share the list"},"pages.wishlist.share_specific":{ar:"مشاركة منتجات محددة",en:"Share specific items"},"pages.wishlist.share_list_title":{ar:"مشاركة قائمة الأمنيات",en:"Share wishlist"},"pages.wishlist.select_all":{ar:"تحديد الكل",en:"Select all"},"common.elements.cancel":{ar:"إلغاء",en:"Cancel"}},this.onSelectionChanged=s=>{this.selectedIds=s?.ids||[],this.shareUrl="",this.socialShare?.close(),this.syncLoadedProductCount()},this.onDocumentClick=s=>{this.menuOpen&&!this.host.contains(s.target)&&(this.menuOpen=!1)},this.onProductsFetched=s=>{"wishlist"===s?.source&&(this.isListSyncPaused=!1,this.syncHasProducts(!!s?.data?.length),this.syncLoadedProductCount())}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.registerTranslationDefaults(),this.loadTranslations(),Salla.event.on("salla-products-list::selection.changed",this.onSelectionChanged),Salla.event.on("salla-products-list::products.fetched",this.onProductsFetched),document.addEventListener("click",this.onDocumentClick)}componentDidLoad(){this.initPageTitleAlignment(),this.productsList=this.host.parentElement?.querySelector("salla-products-list"),this.productsList?(this.syncHasProducts(),this.productsObserver=new MutationObserver((()=>{this.syncHasProducts()})),this.productsObserver.observe(this.productsList,{childList:!0,subtree:!0})):Salla.logger?.warn?.("[salla-wishlist-actions] no sibling salla-products-list found")}disconnectedCallback(){Salla.event.off("salla-products-list::selection.changed",this.onSelectionChanged),Salla.event.off("salla-products-list::products.fetched",this.onProductsFetched),document.removeEventListener("click",this.onDocumentClick),this.productsObserver?.disconnect(),this.pageTitleObserver?.disconnect(),this.pageTitleRetryTimeout&&window.clearTimeout(this.pageTitleRetryTimeout),this.resetPageTitleAlignment()}initPageTitleAlignment(){if(this.syncPageTitleAlignment(),this.pageTitle)return;requestAnimationFrame((()=>this.syncPageTitleAlignment())),this.pageTitleRetryTimeout=window.setTimeout((()=>this.syncPageTitleAlignment()),300);const s=this.host.closest(".main-content")??this.host.parentElement;s&&!this.pageTitle&&(this.pageTitleObserver=new MutationObserver((()=>{this.pageTitle?this.pageTitleObserver?.disconnect():(this.syncPageTitleAlignment(),this.pageTitle&&this.pageTitleObserver?.disconnect())})),this.pageTitleObserver.observe(s,{childList:!0,subtree:!0}))}findPageTitle(){const s=this.host.parentElement;if(s)for(const t of Array.from(s.children)){if(t===this.host)break;if("H1"===t.tagName)return t;const s=t.querySelector("h1");if(s)return s}const t=this.host.closest(".main-content");if(t){const s=t.querySelector("h1");if(s&&!this.host.contains(s))return s}return document.querySelector(".main-content h1, main h1")}syncPageTitleAlignment(){if(this.pageTitle)return;const s=this.findPageTitle();s&&(this.pageTitle=s,s.classList.add(a.pageTitleClass))}resetPageTitleAlignment(){this.pageTitle?.classList.remove(a.pageTitleClass),this.pageTitle=void 0}registerTranslationDefaults(){const s=Object.entries(this.translationDefaults).reduce(((s,[t,i])=>(Salla.lang.get(t)===t&&(s[t]=i),s)),{});Object.keys(s).length&&Salla.lang.addBulk(s)}loadTranslations(){this.shareLabel=Salla.lang.get("pages.wishlist.share"),this.shareAllLabel=Salla.lang.get("pages.wishlist.share_all"),this.shareSpecificLabel=Salla.lang.get("pages.wishlist.share_specific"),this.selectAllLabel=Salla.lang.get("pages.wishlist.select_all"),this.cancelLabel=Salla.lang.get("common.elements.cancel"),this.shareModalTitle=Salla.lang.get("pages.wishlist.share_list_title")}get selectedCount(){return this.selectedIds.length}get isAllSelected(){return this.loadedProductCount>0&&this.selectedCount===this.loadedProductCount}get isPartiallySelected(){return this.selectedCount>0&&this.selectedCount<this.loadedProductCount}async syncLoadedProductCount(){if(!this.productsList)return void(this.loadedProductCount=0);if(this.isListSyncPaused&&this.specificMode)return;const s=await this.productsList.getLoadedProducts();this.loadedProductCount=s.length}syncSelectAllCheckboxState(){this.selectAllCheckbox&&(this.selectAllCheckbox.checked=this.isAllSelected,this.selectAllCheckbox.indeterminate=this.isPartiallySelected)}componentDidRender(){this.syncSelectAllCheckboxState()}pauseListSync(){this.isListSyncPaused=!0,window.setTimeout((()=>{this.isListSyncPaused&&(this.isListSyncPaused=!1,this.syncHasProducts())}),3e3)}async syncHasProducts(s){if(!this.isListSyncPaused||"boolean"==typeof s){if("boolean"==typeof s)this.hasProducts=s;else if(this.productsList){const s=await this.productsList.getLoadedProducts();if(0===s.length&&this.specificMode)return;this.hasProducts=s.length>0,this.loadedProductCount=s.length}else this.hasProducts=!1,this.loadedProductCount=0;this.hasProducts||(this.menuOpen=!1,this.specificMode&&await this.cancelSpecific())}}toggleMenu(){this.hasProducts&&(this.menuOpen=!this.menuOpen)}async toggleSelectAll(){this.productsList&&(this.isAllSelected?await this.productsList.clearSelection():await this.productsList.selectAll())}async shareSpecific(){this.menuOpen=!1,this.specificMode=!0,this.pauseListSync(),this.productsList&&(this.productsList.selectable=!0)}async cancelSpecific(){this.specificMode=!1,this.selectedIds=[],this.pauseListSync(),this.productsList&&(await this.productsList.clearSelection(),this.productsList.selectable=!1)}async shareAll(){this.menuOpen=!1,await this.processShare([],!0)}async shareSelected(){this.selectedCount&&await this.processShare(this.selectedIds,!1)}async processShare(s,t=!1){if((t||s?.length)&&!this.isSharing){this.isSharing=!0;try{const i=await salla.wishlist.share(s,t),e=i?.data?.url||i?.url||"";if(!e||!this.socialShare)return;this.shareUrl=e,this.socialShare.url=e,await this.socialShare.refresh(),await this.socialShare.open()}catch(s){Salla.logger?.warn?.("[salla-wishlist-actions] share failed",s)}finally{this.isSharing=!1}}}render(){return t(i,{key:"de4a2a4d63c8b5564d94b8dc0fb44a8f3680b5c4"},t("div",{key:"6b8b55564d4309018e354aa59d78759023cd80e3",class:"s-wishlist-actions"},t("div",{key:"d7596fe51a790b13dadcacaaa22cbb571f66baf3",class:"s-wishlist-actions-bar flex items-center justify-end gap-3 mb-3"},t("div",{key:"acd83930774ca11cc9e8294f694a3a7376abbf1c",class:"s-wishlist-actions-dropdown relative"},t("salla-button",{key:"98d82f820182210e0e7ac0e8709adfcb6081475b",color:"primary",fill:"outline",type:"button",disabled:!this.hasProducts,"aria-haspopup":"true","aria-expanded":this.menuOpen?"true":"false",onClick:()=>this.toggleMenu()},t("div",{key:"67d68071fa2292a02f20b4fd7e4c2ac484b8a757",class:"flex flex-row justify-center items-center gap-2"},t("svg",{key:"7b711f7fe2af9fefc4d8c0d99b5f910a776deef0",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 32 32",style:{width:"16px",height:"16px"}},t("path",{key:"ea624787c3344073a5cef9b3e487232536666ffd",d:"M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.941 0 5.333-2.392 5.333-5.333s-2.392-5.333-5.333-5.333-5.333 2.392-5.333 5.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-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.667zM26.667 29.333c-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"})),this.shareLabel,t("svg",{key:"e282eedc748300a522d39e47447c97952e8a8373",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 32 32",style:{width:"16px",height:"16px"}},t("path",{key:"ac4f11ce0b1401d3da483802a5ac32fe4a02c337",d:"M26.212 10.996c-0.556-0.484-1.396-0.428-1.881 0.127l-8.331 9.519-8.331-9.52c-0.485-0.555-1.327-0.611-1.881-0.125s-0.609 1.328-0.124 1.881l9.333 10.667c0.253 0.291 0.617 0.456 1.003 0.456s0.749-0.165 1.003-0.456l9.333-10.667c0.485-0.553 0.429-1.396-0.124-1.881z"})))),this.menuOpen&&t("ul",{key:"a066397a5700f00d3b0b66403886d41b7f21358b",class:"s-wishlist-actions-menu absolute z-20 mt-1 bg-white rounded-lg shadow overflow-hidden"},t("li",{key:"ee40d5a36486e8573f21671ffb53aece1443db15"},t("button",{key:"c686ae70fa97719ea926864de4a4bf767492f0ca",type:"button",class:"s-wishlist-actions-menu-item",onClick:()=>this.shareAll()},this.shareAllLabel)),t("li",{key:"96ccd67e69dc1a2f086f19614163779d29eb0dd3"},t("button",{key:"0cf1e565c12148c8f4fe875a2b37a78d50e8f959",type:"button",class:"s-wishlist-actions-menu-item",onClick:()=>this.shareSpecific()},this.shareSpecificLabel)))),t("salla-social-share",{key:"728c700ea2b44d766fea3f6c2e71a81c06365466",class:"s-wishlist-actions-social",ref:s=>this.socialShare=s,url:this.shareUrl,mode:"modal",modalTitle:this.shareModalTitle},t("span",{key:"59663da21c4433cf14461a3f9553ca69e9c4fbd6",slot:"widget",class:"s-wishlist-actions-social-anchor","aria-hidden":"true"}))),this.specificMode&&t("div",{key:"ab6c6a841da23bb3011a6f0ea2bfb8feb3bf8d3f",class:"s-wishlist-actions-panel flex items-center justify-between gap-4 flex-wrap p-4 mt-3 mb-3 bg-white rounded-lg"},t("label",{key:"95594e45d0a8445e77ceb58577543630f8439e9b",class:"s-wishlist-actions-panel-select-all flex items-center gap-2 cursor-pointer"},t("input",{key:"9652181ae51b2ac2fd5a1dfe26bb4c47e824d08b",type:"checkbox",class:"s-products-list-select-checkbox s-wishlist-actions-select-all",checked:this.isAllSelected,ref:s=>this.selectAllCheckbox=s,"aria-label":this.selectAllLabel,onChange:()=>this.toggleSelectAll()}),t("span",{key:"44edd31549879720fc75ae6d6750d8f0b5e263c2",class:"s-wishlist-actions-panel-title text-sm font-bold text-gray-700"},this.shareSpecificLabel," (",this.selectedCount,")")),t("div",{key:"d3f3ab61ed24868e2cff353f821406d71aa4377b",class:"s-wishlist-actions-panel-buttons flex items-center gap-2"},t("salla-button",{key:"c21a5e80fa4c69f9112249c86f6e17512d937b6e",class:"s-wishlist-actions-cancel",color:"light",fill:"outline",type:"button",onClick:()=>this.cancelSpecific()},this.cancelLabel),t("salla-button",{key:"1894863700ac921d131629eb21d6f38d89e29cc6",class:"s-wishlist-actions-share",color:"primary",fill:"outline",type:"button",disabled:!this.selectedCount,loading:this.isSharing,onClick:()=>this.shareSelected()},this.shareLabel)))))}get host(){return e(this)}};a.pageTitleClass="s-wishlist-actions-page-title",a.style=':host{display:block}.s-wishlist-actions-menu{min-width:200px;inset-inline-end:0;inset-inline-start:auto;list-style:none;margin:0;padding:4px 0;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}.s-wishlist-actions-menu-item{display:block;width:100%;padding:10px 16px;text-align:start;font-size:0.875rem;color:#374151;background:transparent;cursor:pointer;white-space:nowrap}.s-wishlist-actions-menu-item:hover{background-color:#f3f4f6;color:var(--color-primary)}.s-wishlist-actions-panel{box-shadow:0 1px 3px rgba(0, 0, 0, 0.08)}.s-wishlist-actions-panel-select-all{user-select:none}.s-wishlist-actions-select-all:indeterminate,.s-wishlist-actions-select-all:indeterminate:hover,.s-wishlist-actions-select-all:indeterminate:focus{background-color:var(--color-primary);border-color:var(--color-primary)}.s-wishlist-actions-select-all:indeterminate::after{content:"";position:absolute;top:50%;left:50%;width:10px;height:2px;background:#fff;border:none;transform:translate(-50%, -50%)}.s-wishlist-actions-social-anchor{display:none}h1.s-wishlist-actions-page-title{text-align:start !important}';export{a as salla_wishlist_actions}
4
+ import{r as s,h as t,H as i,a as e}from"./p-Dm54yhRt.js";const a=class{constructor(t){s(this,t),this.menuOpen=!1,this.hasProducts=!1,this.specificMode=!1,this.selectedIds=[],this.loadedProductCount=0,this.isSharing=!1,this.shareUrl="",this.isListSyncPaused=!1,this.translationDefaults={"pages.wishlist.share":{ar:"شارك",en:"Share"},"pages.wishlist.share_all":{ar:"مشاركة القائمة",en:"Share the list"},"pages.wishlist.share_specific":{ar:"مشاركة منتجات محددة",en:"Share specific items"},"pages.wishlist.share_list_title":{ar:"مشاركة قائمة الأمنيات",en:"Share wishlist"},"pages.wishlist.select_all":{ar:"تحديد الكل",en:"Select all"},"common.elements.cancel":{ar:"إلغاء",en:"Cancel"}},this.onSelectionChanged=s=>{this.selectedIds=s?.ids||[],this.shareUrl="",this.socialShare?.close(),this.syncLoadedProductCount()},this.onDocumentClick=s=>{this.menuOpen&&!this.host.contains(s.target)&&(this.menuOpen=!1)},this.onProductsFetched=s=>{"wishlist"===s?.source&&(this.isListSyncPaused=!1,this.syncHasProducts(!!s?.data?.length),this.syncLoadedProductCount())}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.registerTranslationDefaults(),this.loadTranslations(),Salla.event.on("salla-products-list::selection.changed",this.onSelectionChanged),Salla.event.on("salla-products-list::products.fetched",this.onProductsFetched),document.addEventListener("click",this.onDocumentClick)}componentDidLoad(){this.initPageTitleAlignment(),this.productsList=this.host.parentElement?.querySelector("salla-products-list"),this.productsList?(this.syncHasProducts(),this.productsObserver=new MutationObserver((()=>{this.syncHasProducts()})),this.productsObserver.observe(this.productsList,{childList:!0,subtree:!0})):Salla.logger?.warn?.("[salla-wishlist-actions] no sibling salla-products-list found")}disconnectedCallback(){Salla.event.off("salla-products-list::selection.changed",this.onSelectionChanged),Salla.event.off("salla-products-list::products.fetched",this.onProductsFetched),document.removeEventListener("click",this.onDocumentClick),this.productsObserver?.disconnect(),this.pageTitleObserver?.disconnect(),this.pageTitleRetryTimeout&&window.clearTimeout(this.pageTitleRetryTimeout),this.resetPageTitleAlignment()}initPageTitleAlignment(){if(this.syncPageTitleAlignment(),this.pageTitle)return;requestAnimationFrame((()=>this.syncPageTitleAlignment())),this.pageTitleRetryTimeout=window.setTimeout((()=>this.syncPageTitleAlignment()),300);const s=this.host.closest(".main-content")??this.host.parentElement;s&&!this.pageTitle&&(this.pageTitleObserver=new MutationObserver((()=>{this.pageTitle?this.pageTitleObserver?.disconnect():(this.syncPageTitleAlignment(),this.pageTitle&&this.pageTitleObserver?.disconnect())})),this.pageTitleObserver.observe(s,{childList:!0,subtree:!0}))}findPageTitle(){const s=this.host.parentElement;if(s)for(const t of Array.from(s.children)){if(t===this.host)break;if("H1"===t.tagName)return t;const s=t.querySelector("h1");if(s)return s}const t=this.host.closest(".main-content");if(t){const s=t.querySelector("h1");if(s&&!this.host.contains(s))return s}return document.querySelector(".main-content h1, main h1")}syncPageTitleAlignment(){if(this.pageTitle)return;const s=this.findPageTitle();s&&(this.pageTitle=s,s.classList.add(a.pageTitleClass))}resetPageTitleAlignment(){this.pageTitle?.classList.remove(a.pageTitleClass),this.pageTitle=void 0}registerTranslationDefaults(){const s=Object.entries(this.translationDefaults).reduce(((s,[t,i])=>(Salla.lang.get(t)===t&&(s[t]=i),s)),{});Object.keys(s).length&&Salla.lang.addBulk(s)}loadTranslations(){this.shareLabel=Salla.lang.get("pages.wishlist.share"),this.shareAllLabel=Salla.lang.get("pages.wishlist.share_all"),this.shareSpecificLabel=Salla.lang.get("pages.wishlist.share_specific"),this.selectAllLabel=Salla.lang.get("pages.wishlist.select_all"),this.cancelLabel=Salla.lang.get("common.elements.cancel"),this.shareModalTitle=Salla.lang.get("pages.wishlist.share_list_title")}get selectedCount(){return this.selectedIds.length}get isAllSelected(){return this.loadedProductCount>0&&this.selectedCount===this.loadedProductCount}get isPartiallySelected(){return this.selectedCount>0&&this.selectedCount<this.loadedProductCount}async syncLoadedProductCount(){if(!this.productsList)return void(this.loadedProductCount=0);if(this.isListSyncPaused&&this.specificMode)return;const s=await this.productsList.getLoadedProducts();this.loadedProductCount=s.length}syncSelectAllCheckboxState(){this.selectAllCheckbox&&(this.selectAllCheckbox.checked=this.isAllSelected,this.selectAllCheckbox.indeterminate=this.isPartiallySelected)}componentDidRender(){this.syncSelectAllCheckboxState()}pauseListSync(){this.isListSyncPaused=!0,window.setTimeout((()=>{this.isListSyncPaused&&(this.isListSyncPaused=!1,this.syncHasProducts())}),3e3)}async syncHasProducts(s){if(!this.isListSyncPaused||"boolean"==typeof s){if("boolean"==typeof s)this.hasProducts=s;else if(this.productsList){const s=await this.productsList.getLoadedProducts();if(0===s.length&&this.specificMode)return;this.hasProducts=s.length>0,this.loadedProductCount=s.length}else this.hasProducts=!1,this.loadedProductCount=0;this.hasProducts||(this.menuOpen=!1,this.specificMode&&await this.cancelSpecific())}}toggleMenu(){this.hasProducts&&(this.menuOpen=!this.menuOpen)}async toggleSelectAll(){this.productsList&&(this.isAllSelected?await this.productsList.clearSelection():await this.productsList.selectAll())}async shareSpecific(){this.menuOpen=!1,this.specificMode=!0,this.pauseListSync(),this.productsList&&(this.productsList.selectable=!0)}async cancelSpecific(){this.specificMode=!1,this.selectedIds=[],this.pauseListSync(),this.productsList&&(await this.productsList.clearSelection(),this.productsList.selectable=!1)}async shareAll(){this.menuOpen=!1,await this.processShare([],!0)}async shareSelected(){this.selectedCount&&await this.processShare(this.selectedIds,!1)}async processShare(s,t=!1){if((t||s?.length)&&!this.isSharing){this.isSharing=!0;try{const i=await salla.wishlist.share(s,t),e=i?.data?.url||i?.url||"";if(!e||!this.socialShare)return;this.shareUrl=e,this.socialShare.url=e,await this.socialShare.refresh(),await this.socialShare.open()}catch(s){Salla.logger?.warn?.("[salla-wishlist-actions] share failed",s)}finally{this.isSharing=!1}}}render(){return t(i,{key:"de4a2a4d63c8b5564d94b8dc0fb44a8f3680b5c4"},t("div",{key:"6b8b55564d4309018e354aa59d78759023cd80e3",class:"s-wishlist-actions"},t("div",{key:"d7596fe51a790b13dadcacaaa22cbb571f66baf3",class:"s-wishlist-actions-bar flex items-center justify-end gap-3 mb-3"},t("div",{key:"acd83930774ca11cc9e8294f694a3a7376abbf1c",class:"s-wishlist-actions-dropdown relative"},t("salla-button",{key:"98d82f820182210e0e7ac0e8709adfcb6081475b",color:"primary",fill:"outline",type:"button",disabled:!this.hasProducts,"aria-haspopup":"true","aria-expanded":this.menuOpen?"true":"false",onClick:()=>this.toggleMenu()},t("div",{key:"67d68071fa2292a02f20b4fd7e4c2ac484b8a757",class:"flex flex-row justify-center items-center gap-2"},t("svg",{key:"7b711f7fe2af9fefc4d8c0d99b5f910a776deef0",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 32 32",style:{width:"16px",height:"16px"}},t("path",{key:"ea624787c3344073a5cef9b3e487232536666ffd",d:"M26.667 21.333c-1.699 0-3.196 0.812-4.173 2.052l-11.912-5.211c0.044-0.276 0.085-0.553 0.085-0.841 0-0.472-0.081-0.923-0.197-1.359l12.361-6.952c0.971 1.009 2.328 1.644 3.836 1.644 2.941 0 5.333-2.392 5.333-5.333s-2.392-5.333-5.333-5.333-5.333 2.392-5.333 5.333c0 0.472 0.081 0.923 0.197 1.359l-12.361 6.952c-0.971-1.009-2.328-1.644-3.836-1.644-2.941 0-5.333 2.392-5.333 5.333s2.392 5.333 5.333 5.333c1.699 0 3.196-0.812 4.173-2.052l11.912 5.211c-0.044 0.276-0.085 0.553-0.085 0.841 0 2.941 2.392 5.333 5.333 5.333s5.333-2.392 5.333-5.333-2.392-5.333-5.333-5.333zM26.667 2.667c1.471 0 2.667 1.196 2.667 2.667s-1.196 2.667-2.667 2.667-2.667-1.196-2.667-2.667 1.196-2.667 2.667-2.667zM5.333 20c-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.667zM26.667 29.333c-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"})),this.shareLabel,t("svg",{key:"e282eedc748300a522d39e47447c97952e8a8373",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 32 32",style:{width:"16px",height:"16px"}},t("path",{key:"ac4f11ce0b1401d3da483802a5ac32fe4a02c337",d:"M26.212 10.996c-0.556-0.484-1.396-0.428-1.881 0.127l-8.331 9.519-8.331-9.52c-0.485-0.555-1.327-0.611-1.881-0.125s-0.609 1.328-0.124 1.881l9.333 10.667c0.253 0.291 0.617 0.456 1.003 0.456s0.749-0.165 1.003-0.456l9.333-10.667c0.485-0.553 0.429-1.396-0.124-1.881z"})))),this.menuOpen&&t("ul",{key:"a066397a5700f00d3b0b66403886d41b7f21358b",class:"s-wishlist-actions-menu absolute z-20 mt-1 bg-white rounded-lg shadow overflow-hidden"},t("li",{key:"ee40d5a36486e8573f21671ffb53aece1443db15"},t("button",{key:"c686ae70fa97719ea926864de4a4bf767492f0ca",type:"button",class:"s-wishlist-actions-menu-item",onClick:()=>this.shareAll()},this.shareAllLabel)),t("li",{key:"96ccd67e69dc1a2f086f19614163779d29eb0dd3"},t("button",{key:"0cf1e565c12148c8f4fe875a2b37a78d50e8f959",type:"button",class:"s-wishlist-actions-menu-item",onClick:()=>this.shareSpecific()},this.shareSpecificLabel)))),t("salla-social-share",{key:"728c700ea2b44d766fea3f6c2e71a81c06365466",class:"s-wishlist-actions-social",ref:s=>this.socialShare=s,url:this.shareUrl,mode:"modal",modalTitle:this.shareModalTitle},t("span",{key:"59663da21c4433cf14461a3f9553ca69e9c4fbd6",slot:"widget",class:"s-wishlist-actions-social-anchor","aria-hidden":"true"}))),this.specificMode&&t("div",{key:"ab6c6a841da23bb3011a6f0ea2bfb8feb3bf8d3f",class:"s-wishlist-actions-panel flex items-center justify-between gap-4 flex-wrap p-4 mt-3 mb-3 bg-white rounded-lg"},t("label",{key:"95594e45d0a8445e77ceb58577543630f8439e9b",class:"s-wishlist-actions-panel-select-all flex items-center gap-2 cursor-pointer"},t("input",{key:"9652181ae51b2ac2fd5a1dfe26bb4c47e824d08b",type:"checkbox",class:"s-products-list-select-checkbox s-wishlist-actions-select-all",checked:this.isAllSelected,ref:s=>this.selectAllCheckbox=s,"aria-label":this.selectAllLabel,onChange:()=>this.toggleSelectAll()}),t("span",{key:"44edd31549879720fc75ae6d6750d8f0b5e263c2",class:"s-wishlist-actions-panel-title text-sm font-bold text-gray-700"},this.shareSpecificLabel," (",this.selectedCount,")")),t("div",{key:"d3f3ab61ed24868e2cff353f821406d71aa4377b",class:"s-wishlist-actions-panel-buttons flex items-center gap-2"},t("salla-button",{key:"c21a5e80fa4c69f9112249c86f6e17512d937b6e",class:"s-wishlist-actions-cancel",color:"light",fill:"outline",type:"button",onClick:()=>this.cancelSpecific()},this.cancelLabel),t("salla-button",{key:"1894863700ac921d131629eb21d6f38d89e29cc6",class:"s-wishlist-actions-share",color:"primary",fill:"outline",type:"button",disabled:!this.selectedCount,loading:this.isSharing,onClick:()=>this.shareSelected()},this.shareLabel)))))}get host(){return e(this)}};a.pageTitleClass="s-wishlist-actions-page-title",a.style=':host{display:block}.s-wishlist-actions-menu{min-width:200px;inset-inline-end:0;inset-inline-start:auto;list-style:none;margin:0;padding:4px 0;box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}.s-wishlist-actions-menu-item{display:block;width:100%;padding:10px 16px;text-align:start;font-size:0.875rem;color:#374151;background:transparent;cursor:pointer;white-space:nowrap}.s-wishlist-actions-menu-item:hover{background-color:#f3f4f6;color:var(--color-primary)}.s-wishlist-actions-panel{box-shadow:0 1px 3px rgba(0, 0, 0, 0.08)}.s-wishlist-actions-panel-select-all{user-select:none}.s-wishlist-actions-select-all:indeterminate,.s-wishlist-actions-select-all:indeterminate:hover,.s-wishlist-actions-select-all:indeterminate:focus{background-color:var(--color-primary);border-color:var(--color-primary)}.s-wishlist-actions-select-all:indeterminate::after{content:"";position:absolute;top:50%;left:50%;width:10px;height:2px;background:#fff;border:none;transform:translate(-50%, -50%)}.s-wishlist-actions-social-anchor{display:none}h1.s-wishlist-actions-page-title{text-align:start !important}';export{a as salla_wishlist_actions}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as s}from"./p-BM5d07q2.js";import{S as l}from"./p-D4oPi1Ov.js";import{S as t}from"./p-8Tsmrwno.js";const e=class{constructor(s){a(this,s),this.activeTabType="",this.tabsKey=0,this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.event.on("loyalty::open",(()=>this.open())),salla.auth.event.onLoggedIn((()=>{this.is_loggedin=!0})),salla.onReady((()=>{this.is_loggedin=salla.config.isUser()})),salla.lang.onLoaded((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0})),salla.cart.event.onUpdated((a=>{this.prizePoints=a.loyalty.prize?.points,this.prizeTitle=a.loyalty.prize?.title,this.customerPoints=a.loyalty.customer_points||this.customerPoints}))}onTabSelected(a){const s=this.loyaltyProgram?.prizes.find((s=>s.title===a.detail?.name));s&&(this.activeTabType=s.type)}setSelectedPrizeItem(a){this.selectedItem=this.selectedItem&&this.selectedItem?.id==a.id?void 0:a}handleLongText(a){return a.length>150?a.substring(0,150)+"...":a}prizeItem(a){return s("div",{onClick:()=>this.setSelectedPrizeItem(a),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==a.id,"s-loyalty-prize-item":!0}},s("img",{class:"s-loyalty-prize-item-image",src:a.image,alt:a.name}),s("div",{class:"s-loyalty-prize-item-title"},a.name),s("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(a.description)),s("div",{class:"s-loyalty-prize-item-points"},a.cost_points," ",salla.lang.get("pages.loyalty_program.point"),s("div",{class:"s-loyalty-prize-item-check"},s("div",null))))}getConfirmationModal(){return[s("salla-placeholder",{alignment:"center",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">\n<title>star3</title>\n <defs>\n <style>\n .a {\n fill: none !important;\n }\n\n .b {\n fill: #ff9e01;\n }\n\n .c {\n fill: #fff;\n opacity: 0.1;\n }\n\n </style>\n </defs>\n <g transform="translate(-683 -269)">\n <rect class="a" width="80" height="80" transform="translate(683 269)" />\n <g transform="translate(684.539 261.216)">\n <path class="b"\n d="M110.117,37.062,90.024,35.2,82.043,16.665a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l17.351-10.3,17.351,10.3a1.61,1.61,0,0,0,2.393-1.739L95.871,53.192l15.16-13.318A1.61,1.61,0,0,0,110.117,37.062Z"\n transform="translate(-42.104 -4.011)" />\n <g transform="translate(0 10.971)">\n <path class="b"\n d="M93.54,12.016c1.024,1.423,3.915,7.533,5.568,11.094a.559.559,0,0,1-.891.641c-2.853-2.7-7.73-7.377-8.754-8.8a2.512,2.512,0,0,1,4.077-2.935Z"\n transform="translate(-75.621 -10.971)" />\n <path class="b"\n d="M360.909,12.016c-1.024,1.423-3.915,7.533-5.568,11.094a.559.559,0,0,0,.891.641c2.853-2.7,7.73-7.377,8.754-8.8a2.512,2.512,0,0,0-4.077-2.935Z"\n transform="translate(-301.908 -10.971)" />\n <path class="b"\n d="M427.538,284.659c-1.667-.543-8.366-1.441-12.261-1.934a.559.559,0,0,0-.34,1.044c3.436,1.9,9.377,5.123,11.044,5.666a2.512,2.512,0,0,0,1.558-4.776Z"\n transform="translate(-352.351 -241.894)" />\n <path class="b"\n d="M1.734,284.659c1.667-.543,8.366-1.441,12.261-1.934a.559.559,0,0,1,.34,1.044c-3.436,1.9-9.377,5.123-11.044,5.666a2.512,2.512,0,0,1-1.558-4.776Z"\n transform="translate(0 -241.894)" />\n <path class="b"\n d="M239.794,412.414c0-1.753,1.224-8.4,1.963-12.257a.559.559,0,0,1,1.1,0c.739,3.855,1.963,10.5,1.963,12.257a2.512,2.512,0,0,1-5.023,0Z"\n transform="translate(-203.768 -341.301)" />\n </g>\n <path class="c"\n d="M84.945,23.4l-2.9-6.74a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l2.309-1.371A125,125,0,0,1,84.945,23.4Z"\n transform="translate(-42.104 -4.011)" />\n </g>\n </g>\n</svg>\n',class:"s-loyalty-confirmation-modal-content"},s("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),s("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",s("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",s("strong",null,this.selectedItem?.name)," )")),s("div",{class:"s-loyalty-confirmation-actions"},s("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),s("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return s("slot",{name:"points-applied-widget"},s("salla-list-tile",{class:"s-loyalty-after-exchange"},s("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle,"   -   ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),s("div",{slot:"action",class:"s-loyalty-after-exchange-action"},s("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},s("span",{innerHTML:t})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((a=>{this.loyaltyProgram=a.data,this.activeTabType=this.loyaltyProgram.prizes[0]?.type||"",this.tabsKey++})).catch((a=>{this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data})).finally((()=>this.modal?.stopLoading()))):salla.event.dispatch("login::open")}async close(){return this.modal.close()}async resetExchange(){return await salla.loyalty.reset()}getApiErrorMessage(a){return a?.response?.data?.error?.message||a?.response?.data?.message||("string"==typeof a?a:null)||salla.lang.get("common.errors.error_occurred")}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((a=>console.log(a)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((a=>console.log(a)))}async exchangeLoyaltyPoint(){this.buttonLoading=!0;const a=this.selectedItem;await salla.loyalty.exchange(a?.id).then((async()=>{"FREE_PRODUCT"==a?.key&&salla.url.is_page("cart")&&window.location.reload(),await this.cancelProcess()})).catch((a=>{salla.notify.error(this.getApiErrorMessage(a))})),this.buttonLoading=!1}render(){return this.prizePoints?this.getAfterExchangeUI():[s("slot",{name:"widget"},this.customerPoints?s("salla-list-tile",{class:"s-loyalty-widget"},s("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:l}),s("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,s("salla-button",{shape:"link",color:"primary",onClick:()=>salla.event.dispatch("loyalty::open")},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_point_exchange_now"):salla.lang.get("blocks.header.login")))):""),s("salla-modal",{noPadding:!0,width:"sm",ref:a=>this.confirmationModal=a},this.getConfirmationModal()),s("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:a=>this.modal=a},s("div",{slot:"loading"},s("div",{class:"s-loyalty-skeleton"},s("salla-list-tile",{class:"s-loyalty-header"},s("div",{slot:"icon",class:"s-loyalty-header-icon"},s("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),s("div",{slot:"title",class:"s-loyalty-header-title mb-5"},s("salla-skeleton",{height:"15px",width:"50%"})),s("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},s("salla-skeleton",{height:"10px"}),s("salla-skeleton",{height:"10px",width:"75%"}))),s("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>s("div",{class:"s-loyalty-prize-item swiper-slide"},s("salla-skeleton",{height:"9rem"}),s("div",{class:"s-loyalty-prize-item-title"},s("salla-skeleton",{height:"15px",width:"75%"})),s("div",{class:"s-loyalty-prize-item-subtitle"},s("salla-skeleton",{height:"10px",width:"50%"}),s("salla-skeleton",{height:"10px",width:"25%"})),s("div",{class:"s-loyalty-prize-item-points"},s("salla-skeleton",{height:"15px",width:"100px"}),s("div",{class:"s-loyalty-prize-item-check"},s("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[s("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},s("div",{slot:"icon",class:"s-loyalty-header-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="54.079" height="53.191" viewBox="0 0 54.079 53.191"><defs><style>.a{fill:#ee9d0d;}.b{fill:#c7830b;}.c{fill:#ea2b2d;}.d{fill:#cb2527;}.e{fill:#6699ce;}.f{fill:#faa6b2;}.g{fill:#a6deff;}.h{fill:#eeb436;}.i{fill:#f72d2f;}</style></defs><path class="a" d="M40,248H77.3v25.88a2.1,2.1,0,0,1-2.1,2.1H42.1a2.1,2.1,0,0,1-2.1-2.1Z" transform="translate(-38.135 -222.787)"/><path class="b" d="M250.632,248.711v12.755L236.2,248h13.67Z" transform="translate(-211.463 -222.787)"/><path class="b" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="c" d="M226.194,32.048l-.5.185a5.035,5.035,0,0,0-3.072,3.292l-.468,1.585-.759.414a5.035,5.035,0,0,0-2.422,3l8.865,8.271,5.09-5.456.262-6.205a5.191,5.191,0,0,0-7-5.083Z" transform="translate(-196.246 -31.722)"/><path class="c" d="M358.628,175.48l-.15.509a5.034,5.034,0,0,1-3.072,3.292l-1.55.577-.359.785a5.034,5.034,0,0,1-2.822,2.624L341.81,175l5.09-5.455,6.172-.69a5.191,5.191,0,0,1,5.555,6.629Z" transform="translate(-304.761 -152.837)"/><path class="d" d="M168,248h7.461v27.978H168Z" transform="translate(-151.213 -222.787)"/><path class="c" d="M40,336H77.3v7.461H40Z" transform="translate(-38.135 -300.528)"/><path class="d" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="a" d="M2.1,0H40.8a2.1,2.1,0,0,1,2.1,2.1V9.326H0V2.1A2.1,2.1,0,0,1,2.1,0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 18.641, 4.976)"/><path class="d" d="M0,0H9.326V9.326H0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 30.912, 16.424)"/><path class="d" d="M286.857,79.389a.931.931,0,0,1-.74-.365l-.615-.8a12.516,12.516,0,0,1-2.528-9,.933.933,0,0,1,1.855.2,10.66,10.66,0,0,0,2.153,7.667l.615.8a.933.933,0,0,1-.739,1.5Z" transform="translate(-252.718 -64.113)"/><path class="c" d="M185.485,178.151l-.039.014a30.78,30.78,0,0,1-12.034,1.906l-2.381-.1,4.092,3.817-1.181,4,3.728-1.206a30.775,30.775,0,0,0,9.833-5.315l.71-.572Z" transform="translate(-153.891 -161.081)"/><path class="d" d="M363.834,194.779a12.51,12.51,0,0,1-6.93-2.1l-.843-.559a.933.933,0,1,1,1.031-1.554l.842.558a10.659,10.659,0,0,0,7.8,1.618.933.933,0,1,1,.328,1.836A12.663,12.663,0,0,1,363.834,194.779Z" transform="translate(-316.982 -171.914)"/><path class="c" d="M275,202.524l-.012.04a30.776,30.776,0,0,0-1.069,12.137l.265,2.369-4.092-3.817-3.909,1.455.945-3.8a30.776,30.776,0,0,1,4.622-10.177l.521-.748Z" transform="translate(-237.949 -180.364)"/><circle class="e" cx="1.865" cy="1.865" r="1.865" transform="translate(10.259 0.032)"/><circle class="f" cx="1.865" cy="1.865" r="1.865" transform="translate(0 21.482)"/><path class="g" d="M36.663,36.663a.933.933,0,0,1-.885-.638l-.048-.143a2.946,2.946,0,0,0-2.8-2.017.933.933,0,1,1,0-1.865A4.808,4.808,0,0,1,37.5,35.292l.048.143a.933.933,0,0,1-.885,1.228Z" transform="translate(-31.067 -31.968)"/><path class="g" d="M79.493,194.438a.929.929,0,0,1-.506-.15l-.185-.12a2.074,2.074,0,0,0-2.192-.047.933.933,0,0,1-.947-1.607,3.929,3.929,0,0,1,4.153.088l.185.12a.933.933,0,0,1-.508,1.716Z" transform="translate(-69.235 -173.283)"/><path class="h" d="M27.751,85.141l2.88,2.644,3.811-.874-1.624,3.556,2.008,3.354-3.884-.446-2.569,2.946L27.6,92.49,24,90.957l3.4-1.922Z" transform="translate(-24 -78.914)"/><path class="h" d="M82.174,227.375l-.959,3.772,2.564,2.928-3.884.254L77.9,237.673l-1.442-3.615-3.8-.862,2.993-2.488-.353-3.876,3.291,2.078Z" transform="translate(-66.992 -204.086)"/><path class="i" d="M300.471,141.9l-5.455-5.09,5.09-5.456a8.342,8.342,0,0,1,5.455,5.09Z" transform="translate(-263.422 -119.737)"/></svg>'}),s("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),s("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),s("salla-tabs",{key:this.tabsKey},this.loyaltyProgram.prizes.map((a=>s("salla-tab-header",{slot:"header",name:a.title},s("span",null,a.title)))),this.loyaltyProgram.prizes.map(((a,l)=>s("salla-tab-content",{slot:"content",name:a.title},s("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+l,type:"carousel"},s("div",{slot:"items"},a.items.map((a=>this.prizeItem(a))))))))),"FREE_PRODUCT"===this.activeTabType?.toUpperCase()&&(salla.config.get("store.features")||[]).includes("loyalty-system-v2")?s("a",{href:salla.url.get(""),class:"s-loyalty-program-redeem-btn s-button-element s-button-btn s-button-solid s-button-wide s-button-primary s-button-wrap"},salla.lang.get("pages.loyalty_program.shop_now")):s("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:s("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?s("span",{slot:"description"},this.errorMessage):""))]}};e.style="";export{e as salla_loyalty}
4
+ import{r as a,h as s}from"./p-Dm54yhRt.js";import{S as t}from"./p-D4oPi1Ov.js";import{S as l}from"./p-8Tsmrwno.js";const e=class{constructor(s){a(this,s),this.activeTabType="",this.tabsKey=0,this.selectedItem=void 0,this.allowEmail=!0,this.allowMobile=!0,this.requireEmail=!1,salla.event.on("loyalty::open",(()=>this.open())),salla.auth.event.onLoggedIn((()=>{this.is_loggedin=!0})),salla.onReady((()=>{this.is_loggedin=salla.config.isUser()})),salla.lang.onLoaded((()=>{this.guestMessage=salla.lang.get("pages.loyalty_program.guest_message"),this.translationLoaded=!0})),salla.cart.event.onUpdated((a=>{this.prizePoints=a.loyalty.prize?.points,this.prizeTitle=a.loyalty.prize?.title,this.customerPoints=a.loyalty.customer_points||this.customerPoints}))}onTabSelected(a){const s=this.loyaltyProgram?.prizes.find((s=>s.title===a.detail?.name));s&&(this.activeTabType=s.type)}setSelectedPrizeItem(a){this.selectedItem=this.selectedItem&&this.selectedItem?.id==a.id?void 0:a}handleLongText(a){return a.length>150?a.substring(0,150)+"...":a}prizeItem(a){return s("div",{onClick:()=>this.setSelectedPrizeItem(a),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==a.id,"s-loyalty-prize-item":!0}},s("img",{class:"s-loyalty-prize-item-image",src:a.image,alt:a.name}),s("div",{class:"s-loyalty-prize-item-title"},a.name),s("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(a.description)),s("div",{class:"s-loyalty-prize-item-points"},a.cost_points," ",salla.lang.get("pages.loyalty_program.point"),s("div",{class:"s-loyalty-prize-item-check"},s("div",null))))}getConfirmationModal(){return[s("salla-placeholder",{alignment:"center",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="80" height="80" viewBox="0 0 80 80">\n<title>star3</title>\n <defs>\n <style>\n .a {\n fill: none !important;\n }\n\n .b {\n fill: #ff9e01;\n }\n\n .c {\n fill: #fff;\n opacity: 0.1;\n }\n\n </style>\n </defs>\n <g transform="translate(-683 -269)">\n <rect class="a" width="80" height="80" transform="translate(683 269)" />\n <g transform="translate(684.539 261.216)">\n <path class="b"\n d="M110.117,37.062,90.024,35.2,82.043,16.665a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l17.351-10.3,17.351,10.3a1.61,1.61,0,0,0,2.393-1.739L95.871,53.192l15.16-13.318A1.61,1.61,0,0,0,110.117,37.062Z"\n transform="translate(-42.104 -4.011)" />\n <g transform="translate(0 10.971)">\n <path class="b"\n d="M93.54,12.016c1.024,1.423,3.915,7.533,5.568,11.094a.559.559,0,0,1-.891.641c-2.853-2.7-7.73-7.377-8.754-8.8a2.512,2.512,0,0,1,4.077-2.935Z"\n transform="translate(-75.621 -10.971)" />\n <path class="b"\n d="M360.909,12.016c-1.024,1.423-3.915,7.533-5.568,11.094a.559.559,0,0,0,.891.641c2.853-2.7,7.73-7.377,8.754-8.8a2.512,2.512,0,0,0-4.077-2.935Z"\n transform="translate(-301.908 -10.971)" />\n <path class="b"\n d="M427.538,284.659c-1.667-.543-8.366-1.441-12.261-1.934a.559.559,0,0,0-.34,1.044c3.436,1.9,9.377,5.123,11.044,5.666a2.512,2.512,0,0,0,1.558-4.776Z"\n transform="translate(-352.351 -241.894)" />\n <path class="b"\n d="M1.734,284.659c1.667-.543,8.366-1.441,12.261-1.934a.559.559,0,0,1,.34,1.044c-3.436,1.9-9.377,5.123-11.044,5.666a2.512,2.512,0,0,1-1.558-4.776Z"\n transform="translate(0 -241.894)" />\n <path class="b"\n d="M239.794,412.414c0-1.753,1.224-8.4,1.963-12.257a.559.559,0,0,1,1.1,0c.739,3.855,1.963,10.5,1.963,12.257a2.512,2.512,0,0,1-5.023,0Z"\n transform="translate(-203.768 -341.301)" />\n </g>\n <path class="c"\n d="M84.945,23.4l-2.9-6.74a1.61,1.61,0,0,0-2.958,0L71.1,35.2,51.011,37.062a1.61,1.61,0,0,0-.914,2.813l15.16,13.318L60.821,72.878a1.61,1.61,0,0,0,2.393,1.739l2.309-1.371A125,125,0,0,1,84.945,23.4Z"\n transform="translate(-42.104 -4.011)" />\n </g>\n </g>\n</svg>\n',class:"s-loyalty-confirmation-modal-content"},s("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),s("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",s("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",s("strong",null,this.selectedItem?.name)," )")),s("div",{class:"s-loyalty-confirmation-actions"},s("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),s("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return s("slot",{name:"points-applied-widget"},s("salla-list-tile",{class:"s-loyalty-after-exchange"},s("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle,"   -   ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),s("div",{slot:"action",class:"s-loyalty-after-exchange-action"},s("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},s("span",{innerHTML:l})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((a=>{this.loyaltyProgram=a.data,this.activeTabType=this.loyaltyProgram.prizes[0]?.type||"",this.tabsKey++})).catch((a=>{this.hasError=!0,this.errorMessage=a.response?.data?.error?.message||a.response?.data})).finally((()=>this.modal?.stopLoading()))):salla.event.dispatch("login::open")}async close(){return this.modal.close()}async resetExchange(){return await salla.loyalty.reset()}getApiErrorMessage(a){return a?.response?.data?.error?.message||a?.response?.data?.message||("string"==typeof a?a:null)||salla.lang.get("common.errors.error_occurred")}async openConfirmation(){return await this.modal.close().then((()=>this.confirmationModal?.open())).catch((a=>console.log(a)))}async cancelProcess(){return await this.confirmationModal.close().then((()=>this.selectedItem=null)).catch((a=>console.log(a)))}async exchangeLoyaltyPoint(){this.buttonLoading=!0;const a=this.selectedItem;await salla.loyalty.exchange(a?.id).then((async()=>{"FREE_PRODUCT"==a?.key&&salla.url.is_page("cart")&&window.location.reload(),await this.cancelProcess()})).catch((a=>{salla.notify.error(this.getApiErrorMessage(a))})),this.buttonLoading=!1}render(){return this.prizePoints?this.getAfterExchangeUI():[s("slot",{name:"widget"},this.customerPoints?s("salla-list-tile",{class:"s-loyalty-widget"},s("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:t}),s("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,s("salla-button",{shape:"link",color:"primary",onClick:()=>salla.event.dispatch("loyalty::open")},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_point_exchange_now"):salla.lang.get("blocks.header.login")))):""),s("salla-modal",{noPadding:!0,width:"sm",ref:a=>this.confirmationModal=a},this.getConfirmationModal()),s("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:a=>this.modal=a},s("div",{slot:"loading"},s("div",{class:"s-loyalty-skeleton"},s("salla-list-tile",{class:"s-loyalty-header"},s("div",{slot:"icon",class:"s-loyalty-header-icon"},s("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),s("div",{slot:"title",class:"s-loyalty-header-title mb-5"},s("salla-skeleton",{height:"15px",width:"50%"})),s("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},s("salla-skeleton",{height:"10px"}),s("salla-skeleton",{height:"10px",width:"75%"}))),s("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>s("div",{class:"s-loyalty-prize-item swiper-slide"},s("salla-skeleton",{height:"9rem"}),s("div",{class:"s-loyalty-prize-item-title"},s("salla-skeleton",{height:"15px",width:"75%"})),s("div",{class:"s-loyalty-prize-item-subtitle"},s("salla-skeleton",{height:"10px",width:"50%"}),s("salla-skeleton",{height:"10px",width:"25%"})),s("div",{class:"s-loyalty-prize-item-points"},s("salla-skeleton",{height:"15px",width:"100px"}),s("div",{class:"s-loyalty-prize-item-check"},s("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[s("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},s("div",{slot:"icon",class:"s-loyalty-header-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="54.079" height="53.191" viewBox="0 0 54.079 53.191"><defs><style>.a{fill:#ee9d0d;}.b{fill:#c7830b;}.c{fill:#ea2b2d;}.d{fill:#cb2527;}.e{fill:#6699ce;}.f{fill:#faa6b2;}.g{fill:#a6deff;}.h{fill:#eeb436;}.i{fill:#f72d2f;}</style></defs><path class="a" d="M40,248H77.3v25.88a2.1,2.1,0,0,1-2.1,2.1H42.1a2.1,2.1,0,0,1-2.1-2.1Z" transform="translate(-38.135 -222.787)"/><path class="b" d="M250.632,248.711v12.755L236.2,248h13.67Z" transform="translate(-211.463 -222.787)"/><path class="b" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="c" d="M226.194,32.048l-.5.185a5.035,5.035,0,0,0-3.072,3.292l-.468,1.585-.759.414a5.035,5.035,0,0,0-2.422,3l8.865,8.271,5.09-5.456.262-6.205a5.191,5.191,0,0,0-7-5.083Z" transform="translate(-196.246 -31.722)"/><path class="c" d="M358.628,175.48l-.15.509a5.034,5.034,0,0,1-3.072,3.292l-1.55.577-.359.785a5.034,5.034,0,0,1-2.822,2.624L341.81,175l5.09-5.455,6.172-.69a5.191,5.191,0,0,1,5.555,6.629Z" transform="translate(-304.761 -152.837)"/><path class="d" d="M168,248h7.461v27.978H168Z" transform="translate(-151.213 -222.787)"/><path class="c" d="M40,336H77.3v7.461H40Z" transform="translate(-38.135 -300.528)"/><path class="d" d="M333.957,336v3.207L330.52,336Z" transform="translate(-294.787 -300.528)"/><path class="a" d="M2.1,0H40.8a2.1,2.1,0,0,1,2.1,2.1V9.326H0V2.1A2.1,2.1,0,0,1,2.1,0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 18.641, 4.976)"/><path class="d" d="M0,0H9.326V9.326H0Z" transform="matrix(0.731, 0.682, -0.682, 0.731, 30.912, 16.424)"/><path class="d" d="M286.857,79.389a.931.931,0,0,1-.74-.365l-.615-.8a12.516,12.516,0,0,1-2.528-9,.933.933,0,0,1,1.855.2,10.66,10.66,0,0,0,2.153,7.667l.615.8a.933.933,0,0,1-.739,1.5Z" transform="translate(-252.718 -64.113)"/><path class="c" d="M185.485,178.151l-.039.014a30.78,30.78,0,0,1-12.034,1.906l-2.381-.1,4.092,3.817-1.181,4,3.728-1.206a30.775,30.775,0,0,0,9.833-5.315l.71-.572Z" transform="translate(-153.891 -161.081)"/><path class="d" d="M363.834,194.779a12.51,12.51,0,0,1-6.93-2.1l-.843-.559a.933.933,0,1,1,1.031-1.554l.842.558a10.659,10.659,0,0,0,7.8,1.618.933.933,0,1,1,.328,1.836A12.663,12.663,0,0,1,363.834,194.779Z" transform="translate(-316.982 -171.914)"/><path class="c" d="M275,202.524l-.012.04a30.776,30.776,0,0,0-1.069,12.137l.265,2.369-4.092-3.817-3.909,1.455.945-3.8a30.776,30.776,0,0,1,4.622-10.177l.521-.748Z" transform="translate(-237.949 -180.364)"/><circle class="e" cx="1.865" cy="1.865" r="1.865" transform="translate(10.259 0.032)"/><circle class="f" cx="1.865" cy="1.865" r="1.865" transform="translate(0 21.482)"/><path class="g" d="M36.663,36.663a.933.933,0,0,1-.885-.638l-.048-.143a2.946,2.946,0,0,0-2.8-2.017.933.933,0,1,1,0-1.865A4.808,4.808,0,0,1,37.5,35.292l.048.143a.933.933,0,0,1-.885,1.228Z" transform="translate(-31.067 -31.968)"/><path class="g" d="M79.493,194.438a.929.929,0,0,1-.506-.15l-.185-.12a2.074,2.074,0,0,0-2.192-.047.933.933,0,0,1-.947-1.607,3.929,3.929,0,0,1,4.153.088l.185.12a.933.933,0,0,1-.508,1.716Z" transform="translate(-69.235 -173.283)"/><path class="h" d="M27.751,85.141l2.88,2.644,3.811-.874-1.624,3.556,2.008,3.354-3.884-.446-2.569,2.946L27.6,92.49,24,90.957l3.4-1.922Z" transform="translate(-24 -78.914)"/><path class="h" d="M82.174,227.375l-.959,3.772,2.564,2.928-3.884.254L77.9,237.673l-1.442-3.615-3.8-.862,2.993-2.488-.353-3.876,3.291,2.078Z" transform="translate(-66.992 -204.086)"/><path class="i" d="M300.471,141.9l-5.455-5.09,5.09-5.456a8.342,8.342,0,0,1,5.455,5.09Z" transform="translate(-263.422 -119.737)"/></svg>'}),s("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),s("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),s("salla-tabs",{key:this.tabsKey},this.loyaltyProgram.prizes.map((a=>s("salla-tab-header",{slot:"header",name:a.title},s("span",null,a.title)))),this.loyaltyProgram.prizes.map(((a,t)=>s("salla-tab-content",{slot:"content",name:a.title},s("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+t,type:"carousel"},s("div",{slot:"items"},a.items.map((a=>this.prizeItem(a))))))))),"FREE_PRODUCT"===this.activeTabType?.toUpperCase()&&(salla.config.get("store.features")||[]).includes("loyalty-system-v2")?s("a",{href:salla.url.get(""),class:"s-loyalty-program-redeem-btn s-button-element s-button-btn s-button-solid s-button-wide s-button-primary s-button-wrap"},salla.lang.get("pages.loyalty_program.shop_now")):s("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:s("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?s("span",{slot:"description"},this.errorMessage):""))]}};e.style="";export{e as salla_loyalty}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as a,a as e}from"./p-BM5d07q2.js";import{S as i}from"./p-Ctkfc4K-.js";import{S as c}from"./p-CXRKXFgT.js";import{T as r}from"./p-CJUR4sUM.js";import{A as o}from"./p-DCZbpt2a.js";import{P as n}from"./p-DY4LZmNP.js";import{a as l}from"./p-CgtvEd63.js";const h=class{constructor(t){s(this,t),this.internalOffers=[],this.showAll=!1,this.freeLabel="",this.receivedOffer="",this.discountAmountLabel="",this.showMoreOffers="",this.icons={DiscountCouponIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n',GiftIcon:c,FireIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n',SpecialDiscountIcon:i,TagMoneyIcon:r},this.visibleOffersCount=3,this.handleCartItemUpdated=s=>{const t=s.data?.cart?.items?.find((s=>String(s.id)===String(this.itemId)));t&&(this.internalQuantity=t.quantity,this.internalOffers=t.detailed_offers||[],this.internalProductPrice=t.product_price)},this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady(),await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam"),this.receivedOffer=salla.lang.get("pages.cart.received_offer"),this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount"),this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")})),this.internalQuantity=this.quantity,this.internalOffers=this.parseOffers(this.offers),this.internalProductPrice=this.productPrice}componentDidLoad(){Salla.cart.event.onLatestFetched(this.handleCartItemUpdated),Salla.cart.event.onItemUpdated(this.handleCartItemUpdated),Salla.cart.event.onCouponAdded(this.handleCartItemUpdated),Salla.cart.event.onCouponDeleted(this.handleCartItemUpdated)}parseOffers(s){try{if("string"!=typeof s)return console.warn("Offers is not a string. Returning as-is.",s),Array.isArray(s)?s:[];const t=JSON.parse(s||"[]");return Array.isArray(t)?t:[]}catch(s){return console.error("Failed to parse offers",s),[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(s,t){return s-t.free_quantity}renderOffer(s,a){const e=this.getPaidQty(s,a);return t("div",{class:"s-cart-item-offers-box"},a.free_quantity>0&&e>0&&t("div",{class:"s-cart-item-offers-paid-free"},t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(e)," × ",t("span",{innerHTML:salla.money(this.internalProductPrice)})),t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(a.free_quantity)," ×",t("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),t("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),t("div",{class:"s-cart-item-offers-details"},t("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[a.discount_icon]||""}),t("div",null,t("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",a.offer_name)),t("p",{class:"s-cart-item-offers-discount"},t("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(a.discount_amount.toFixed(2)))})))))}render(){return this.internalOffers?.length?t("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((s=>this.renderOffer(this.internalQuantity,s))),this.internalOffers?.length>this.visibleOffersCount&&t("div",{class:"s-cart-item-offers-show-more"},t("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},t("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,t("span",{innerHTML:o,class:{"s-cart-item-offers-arrow-icon":!0,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&t("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((s=>this.renderOffer(this.internalQuantity,s))))):null}};h.style=":host{display:block}";const f=class{constructor(t){s(this,t),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",this.handleCheckoutClick=s=>{salla.mobile?.isSpaWebview?.()&&salla.mobile.openCheckout&&(s.preventDefault(),salla.mobile.openCheckout(this.getCartLink()))},salla.cart.event.onUpdated((s=>{this.cartSummaryCount=s.count||0,this.cartSummaryTotal=s.total||0}))}async animateToCart(s){if(document.querySelectorAll(".s-cart-thumb").forEach((s=>s.remove())),!s?.src)return void salla.log("Failed to get the img element");let t=this.host.querySelector("#s-cart-icon"),a=t.getBoundingClientRect(),e=a.top+window.scrollY,i=a.left+window.scrollX,c=s.getBoundingClientRect(),r=s.offsetWidth+"px",o=s.offsetHeight+"px",n=c.top,h=c.left,f=document.createElement("img");f.src=s.getAttribute("src"),f.className="s-cart-thumb",f.setAttribute("style","object-fit:cover; width:"+r+"; height:"+o+"; top:"+n+"px; left:"+h+"px;z-index:99999999; "),document.body.append(f);let d=document.querySelector(".s-cart-thumb");t.classList.remove("animated","rubberBand"),(new l.timeline).add({targets:d,width:[150,30],height:[150,30],top:[n,window.scrollY>0?e-window.scrollY-40:e-40],left:[h,i],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:d,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?e-window.scrollY-40:e-40,window.scrollY>0?e-window.scrollY+10:e+10],left:[i,i+10]},"-=500").add({complete:function(){t.classList.add("animated","rubberBand"),d.remove()}},"-=1700")}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}getCartLink(){let s=salla.url.get("cart");const t=salla.storage.get("scope")||salla.config.get("store.scope");if(t&&t.id)try{const a=new URL(s);return a.searchParams.set("scope",t.id),t.allocation_type&&a.searchParams.set("allocation_type",t.allocation_type),t.allocation_id&&a.searchParams.set("allocation_id",t.allocation_id),a.toString()}catch(a){const e=s.includes("?")?"&":"?",i=new URLSearchParams;return i.set("scope",String(t.id)),t.allocation_type&&i.set("allocation_type",t.allocation_type),t.allocation_id&&i.set("allocation_id",t.allocation_id),`${s}${e}${i.toString()}`}return s}render(){return t(a,{key:"27e472fb912afff849c94a8a93a9a71778c6819d"},t("a",{key:"f9ef99f2a7205fcfdc0bdd799b1b751ab40bcb35",class:"s-cart-summary-wrapper",href:this.getCartLink(),onClick:this.handleCheckoutClick},t("div",{key:"1b0d26d3e17b0fb5d6b2cbdc1cd14c079a5fb47b",id:"s-cart-icon"},t("slot",{key:"3c64b2afa8782a4018dd086e657f16373a91f997",name:"icon"},t("i",{key:"46f1cebfa346e20d27f8ffed1206c05828be004a",class:"s-cart-summary-icon",innerHTML:n}))),t("span",{key:"72bd9fc2d2949b74109b9e57e823c4c4cc99d287",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),t("p",{key:"d65efd069e4f5968c8f592bf341b35853b000bda",class:"s-cart-summary-content"},this.showCartLabel&&t("span",{key:"ecbd5350d56131aee746913bb7c6e662431f7001",class:"s-cart-summary-label"},this.cartLabel),t("b",{key:"aeebd5d52966dc183111e49289061c3649087a8f",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return e(this)}};f.style="";export{h as salla_cart_item_offers,f as salla_cart_summary}
4
+ import{r as s,h as t,H as a,a as e}from"./p-Dm54yhRt.js";import{S as i}from"./p-Ctkfc4K-.js";import{S as c}from"./p-CXRKXFgT.js";import{T as r}from"./p-CJUR4sUM.js";import{A as o}from"./p-DCZbpt2a.js";import{P as n}from"./p-DY4LZmNP.js";import{a as l}from"./p-CgtvEd63.js";const h=class{constructor(t){s(this,t),this.internalOffers=[],this.showAll=!1,this.freeLabel="",this.receivedOffer="",this.discountAmountLabel="",this.showMoreOffers="",this.icons={DiscountCouponIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>discount-coupon</title>\n<path d="M27 28h-22c-0.552 0-1-0.448-1-1v0c0-1.657-1.343-3-3-3v0c-0.552 0-1-0.448-1-1v0-12c0-0.552 0.448-1 1-1v0c1.657 0 3-1.343 3-3v0c0-0.552 0.448-1 1-1v0h22c0.552 0 1 0.448 1 1v0c0 1.657 1.343 3 3 3v0c0.552 0 1 0.448 1 1v0 12c0 0.552-0.448 1-1 1v0c-1.657 0-3 1.343-3 3v0c0 0.552-0.448 1-1 1v0zM5.9 26h20.2c0.415-1.964 1.936-3.485 3.867-3.894l0.033-0.006v-10.2c-1.964-0.415-3.485-1.936-3.894-3.867l-0.006-0.033h-20.2c-0.415 1.964-1.936 3.485-3.867 3.894l-0.033 0.006v10.2c1.964 0.415 3.485 1.936 3.894 3.867l0.006 0.033zM20 7h2v3h-2v-3zM20 12h2v4h-2v-4zM20 18h2v4h-2v-4zM20 24h2v3h-2v-3zM9 16c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM9 12c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM15 24c-1.657 0-3-1.343-3-3s1.343-3 3-3c1.657 0 3 1.343 3 3v0c0 1.657-1.343 3-3 3v0zM15 20c-0.552 0-1 0.448-1 1s0.448 1 1 1c0.552 0 1-0.448 1-1v0c0-0.552-0.448-1-1-1v0zM7 24c-0.552-0-1-0.448-1-1 0-0.244 0.088-0.468 0.233-0.642l-0.001 0.002 10-12c0.185-0.221 0.461-0.36 0.769-0.36 0.553 0 1.001 0.448 1.001 1.001 0 0.245-0.088 0.469-0.233 0.643l0.001-0.002-10 12c-0.185 0.22-0.46 0.358-0.767 0.358-0.001 0-0.002 0-0.003 0h0z"></path>\n</svg>\n',GiftIcon:c,FireIcon:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>fire</title>\n<path d="M21.56 3.009c-0.052-0.047-0.116-0.065-0.173-0.103-0.073-0.048-0.143-0.1-0.223-0.132-0.083-0.033-0.165-0.047-0.252-0.063-0.081-0.016-0.16-0.035-0.243-0.035-0.089 0-0.172 0.020-0.26 0.037-0.080 0.016-0.159 0.028-0.236 0.059-0.084 0.035-0.157 0.088-0.235 0.14-0.053 0.036-0.115 0.053-0.165 0.097-0.049 0.044-0.988 0.895-2.288 2.255-2.364-2.839-4.476-4.815-4.576-4.908-0.056-0.052-0.127-0.075-0.188-0.115-0.075-0.049-0.143-0.105-0.224-0.137-0.080-0.032-0.163-0.041-0.245-0.057-0.085-0.016-0.167-0.040-0.252-0.040-0.084 0-0.163 0.023-0.245 0.039-0.087 0.016-0.172 0.025-0.253 0.059-0.080 0.032-0.147 0.087-0.22 0.135-0.063 0.041-0.133 0.064-0.189 0.116-0.453 0.423-11.092 10.408-11.092 18.095 0 7.977 4.935 13.549 12 13.549h8.667c6.673 0 11.333-5.115 11.333-12.439 0-7.052-10.013-16.167-10.44-16.552zM20.667 29.333h-7.777c-2.924 0-4.889-2.044-4.889-5.084 0-2.317 2.816-6.441 4.888-8.887 0.76 0.909 2.755 3.397 3.969 5.869 0.212 0.431 0.639 0.715 1.117 0.743 0.489 0.031 0.937-0.203 1.197-0.605 0.552-0.849 1.109-1.596 1.497-2.093 1.491 1.897 3.331 4.78 3.331 6.399 0 2.188-1.34 3.659-3.333 3.659zM26.537 27.052c0.081-0.44 0.129-0.899 0.129-1.377 0-3.269-3.713-7.847-4.46-8.735l-0.523-0.617c-0.507-0.599-1.528-0.599-2.035 0l-0.531 0.627c-0.147 0.175-0.495 0.599-0.936 1.187-1.595-2.597-3.495-4.776-3.595-4.889l-0.697-0.793c-0.507-0.577-1.499-0.577-2.004 0l-0.697 0.795c-0.6 0.684-5.856 6.803-5.856 11.001 0 0.881 0.127 1.712 0.356 2.484-1.896-1.933-3.023-4.821-3.023-8.283 0-4.915 6.073-11.997 9.329-15.255 1.001 1.008 2.692 2.789 4.368 4.927 0.243 0.309 0.609 0.496 1.001 0.509h0.048c0.376 0 0.735-0.159 0.988-0.439 0.889-0.981 1.693-1.795 2.269-2.359 3.051 2.965 8.663 9.323 8.663 13.727 0 3.171-1.031 5.769-2.796 7.491z"></path>\n</svg>\n',SpecialDiscountIcon:i,TagMoneyIcon:r},this.visibleOffersCount=3,this.handleCartItemUpdated=s=>{const t=s.data?.cart?.items?.find((s=>String(s.id)===String(this.itemId)));t&&(this.internalQuantity=t.quantity,this.internalOffers=t.detailed_offers||[],this.internalProductPrice=t.product_price)},this.toggleShowAll=()=>{this.showAll=!this.showAll}}async componentWillLoad(){await Salla.onReady(),await salla.lang.onLoaded((()=>{this.freeLabel=salla.lang.get("common.elements.freeExclam"),this.receivedOffer=salla.lang.get("pages.cart.received_offer"),this.discountAmountLabel=salla.lang.get("pages.cart.discount_amount"),this.showMoreOffers=salla.lang.get("pages.cart.show_more_offers")})),this.internalQuantity=this.quantity,this.internalOffers=this.parseOffers(this.offers),this.internalProductPrice=this.productPrice}componentDidLoad(){Salla.cart.event.onLatestFetched(this.handleCartItemUpdated),Salla.cart.event.onItemUpdated(this.handleCartItemUpdated),Salla.cart.event.onCouponAdded(this.handleCartItemUpdated),Salla.cart.event.onCouponDeleted(this.handleCartItemUpdated)}parseOffers(s){try{if("string"!=typeof s)return console.warn("Offers is not a string. Returning as-is.",s),Array.isArray(s)?s:[];const t=JSON.parse(s||"[]");return Array.isArray(t)?t:[]}catch(s){return console.error("Failed to parse offers",s),[]}}get visibleOffers(){return this.internalOffers.slice(0,this.visibleOffersCount)}get hiddenOffers(){return this.internalOffers.slice(this.visibleOffersCount)}getPaidQty(s,t){return s-t.free_quantity}renderOffer(s,a){const e=this.getPaidQty(s,a);return t("div",{class:"s-cart-item-offers-box"},a.free_quantity>0&&e>0&&t("div",{class:"s-cart-item-offers-paid-free"},t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(e)," × ",t("span",{innerHTML:salla.money(this.internalProductPrice)})),t("div",{class:"s-cart-item-offers-line"},salla.helpers.number(a.free_quantity)," ×",t("span",{class:"s-cart-item-offers-regular-price",innerHTML:salla.money(this.internalProductPrice)}),t("span",{class:"s-cart-item-offers-free-label"},this.freeLabel))),t("div",{class:"s-cart-item-offers-details"},t("span",{class:"s-cart-item-offers-icon",innerHTML:this.icons[a.discount_icon]||""}),t("div",null,t("p",{class:"s-cart-item-offers-title"},this.receivedOffer.replace(":offer",a.offer_name)),t("p",{class:"s-cart-item-offers-discount"},t("span",{innerHTML:this.discountAmountLabel.replace(":amount",salla.money(a.discount_amount.toFixed(2)))})))))}render(){return this.internalOffers?.length?t("div",{class:"s-cart-item-offers-container",id:`offers_list_${this.itemId}`},this.visibleOffers.map((s=>this.renderOffer(this.internalQuantity,s))),this.internalOffers?.length>this.visibleOffersCount&&t("div",{class:"s-cart-item-offers-show-more"},t("button",{class:"s-cart-item-offers-show-more-btn",onClick:this.toggleShowAll,type:"button"},t("span",{class:"s-cart-item-offers-show-more-label"},"+",this.hiddenOffers.length," ",this.showMoreOffers,t("span",{innerHTML:o,class:{"s-cart-item-offers-arrow-icon":!0,"s-cart-item-offers-arrow-open":this.showAll}})))),this.showAll&&t("div",{class:"s-cart-item-offers-collapsed",id:`offers_${this.itemId}`},this.hiddenOffers.map((s=>this.renderOffer(this.internalQuantity,s))))):null}};h.style=":host{display:block}";const f=class{constructor(t){s(this,t),this.cartSummaryCount=salla.storage.get("cart.summary.count")||0,this.cartSummaryTotal=salla.storage.get("cart.summary.total")||0,this.cartLabel="ar"===salla.config.get("user.language_code")?"السلة":"Cart",this.handleCheckoutClick=s=>{salla.mobile?.isSpaWebview?.()&&salla.mobile.openCheckout&&(s.preventDefault(),salla.mobile.openCheckout(this.getCartLink()))},salla.cart.event.onUpdated((s=>{this.cartSummaryCount=s.count||0,this.cartSummaryTotal=s.total||0}))}async animateToCart(s){if(document.querySelectorAll(".s-cart-thumb").forEach((s=>s.remove())),!s?.src)return void salla.log("Failed to get the img element");let t=this.host.querySelector("#s-cart-icon"),a=t.getBoundingClientRect(),e=a.top+window.scrollY,i=a.left+window.scrollX,c=s.getBoundingClientRect(),r=s.offsetWidth+"px",o=s.offsetHeight+"px",n=c.top,h=c.left,f=document.createElement("img");f.src=s.getAttribute("src"),f.className="s-cart-thumb",f.setAttribute("style","object-fit:cover; width:"+r+"; height:"+o+"; top:"+n+"px; left:"+h+"px;z-index:99999999; "),document.body.append(f);let d=document.querySelector(".s-cart-thumb");t.classList.remove("animated","rubberBand"),(new l.timeline).add({targets:d,width:[150,30],height:[150,30],top:[n,window.scrollY>0?e-window.scrollY-40:e-40],left:[h,i],borderRadius:["20%","50%"],easing:"easeOutExpo",duration:1200},"+=200").add({targets:d,width:[30,0],height:[30,0],opacity:[1,0],easing:"easeOutExpo",top:[window.scrollY>0?e-window.scrollY-40:e-40,window.scrollY>0?e-window.scrollY+10:e+10],left:[i,i+10]},"-=500").add({complete:function(){t.classList.add("animated","rubberBand"),d.remove()}},"-=1700")}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}getCartLink(){let s=salla.url.get("cart");const t=salla.storage.get("scope")||salla.config.get("store.scope");if(t&&t.id)try{const a=new URL(s);return a.searchParams.set("scope",t.id),t.allocation_type&&a.searchParams.set("allocation_type",t.allocation_type),t.allocation_id&&a.searchParams.set("allocation_id",t.allocation_id),a.toString()}catch(a){const e=s.includes("?")?"&":"?",i=new URLSearchParams;return i.set("scope",String(t.id)),t.allocation_type&&i.set("allocation_type",t.allocation_type),t.allocation_id&&i.set("allocation_id",t.allocation_id),`${s}${e}${i.toString()}`}return s}render(){return t(a,{key:"27e472fb912afff849c94a8a93a9a71778c6819d"},t("a",{key:"f9ef99f2a7205fcfdc0bdd799b1b751ab40bcb35",class:"s-cart-summary-wrapper",href:this.getCartLink(),onClick:this.handleCheckoutClick},t("div",{key:"1b0d26d3e17b0fb5d6b2cbdc1cd14c079a5fb47b",id:"s-cart-icon"},t("slot",{key:"3c64b2afa8782a4018dd086e657f16373a91f997",name:"icon"},t("i",{key:"46f1cebfa346e20d27f8ffed1206c05828be004a",class:"s-cart-summary-icon",innerHTML:n}))),t("span",{key:"72bd9fc2d2949b74109b9e57e823c4c4cc99d287",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),t("p",{key:"d65efd069e4f5968c8f592bf341b35853b000bda",class:"s-cart-summary-content"},this.showCartLabel&&t("span",{key:"ecbd5350d56131aee746913bb7c6e662431f7001",class:"s-cart-summary-label"},this.cartLabel),t("b",{key:"aeebd5d52966dc183111e49289061c3649087a8f",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return e(this)}};f.style="";export{h as salla_cart_item_offers,f as salla_cart_summary}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as s,H as r}from"./p-BM5d07q2.js";const t=250,a={customer:"أُلغي الطلب من قِبل العميل",merchant:"أُلغي الطلب من قِبل المتجر"},o=[["pages.orders.cancel_modal_title","إلغاء الطلب","Cancel order"],["pages.orders.cancel_reason_title","لماذا ترغب في إلغاء الطلب؟","Why do you want to cancel this order?"],["pages.orders.cancel_reason_subtitle","ساعدنا نعرف السبب لتحسين تجربتك.","Help us understand why to improve your experience."],["pages.orders.cancel_reason_confirm","تأكيد إلغاء الطلب","Confirm order cancellation"],["pages.orders.cancel_reason_back","تراجع","Go back"],["pages.orders.cancel_reason_note_placeholder","اذكر السبب","Mention the reason"],["pages.orders.cancelled_by_customer",a.customer,"Order cancelled by the customer"],["pages.orders.cancelled_by_merchant",a.merchant,"Order cancelled by the merchant"],["pages.orders.cancel_reason_char_limit","يتجاوز النص حد الأحرف المسموح","Text exceeds the allowed character limit"]],n=e=>{if(!e)return null;try{const s="string"==typeof e?JSON.parse(e):e;return s&&"object"==typeof s?s:null}catch{return null}},c=e=>e.filter((e=>!1!==e.is_active)).sort(((e,s)=>(e.sort??0)-(s.sort??0))),l=class{constructor(s){e(this,s),this.reasons=[],this.selectedReasonId=null,this.reasonNote="",this.confirmLoading=!1,this.loading=!0,this.modalTitleLabel="",this.questionLabel="",this.subtitleLabel="",this.confirmLabel="",this.backLabel="",this.notePlaceholder="",this.charLimitLabel="",salla.lang.onLoaded((()=>{const e=salla.lang.messages?.["ar.trans"],s=salla.lang.messages?.["en.trans"];if(e&&s&&salla.helpers?.setNested)for(const[r,t,a]of o)salla.helpers.setNested(e,r,t),salla.helpers.setNested(s,r,a);this.refreshLabels()}))}onCancellationReasonsChange(){this.load()}async componentWillLoad(){await salla.onReady(),this.refreshLabels(),await this.load()}refreshLabels(){const e=(e,s)=>salla.lang.getWithDefault(e,s);this.modalTitleLabel=e("pages.orders.cancel_modal_title","إلغاء الطلب"),this.questionLabel=e("pages.orders.cancel_reason_title","لماذا ترغب في إلغاء الطلب؟"),this.subtitleLabel=e("pages.orders.cancel_reason_subtitle","ساعدنا نعرف السبب لتحسين تجربتك."),this.confirmLabel=e("pages.orders.cancel_reason_confirm","تأكيد إلغاء الطلب"),this.backLabel=e("pages.orders.cancel_reason_back","تراجع"),this.notePlaceholder=e("pages.orders.cancel_reason_note_placeholder","اذكر السبب"),this.charLimitLabel=e("pages.orders.cancel_reason_char_limit","يتجاوز النص حد الأحرف المسموح")}get resolvedOrderId(){const e=this.orderId??this.pageOrder?.id??salla.config.get("page.id"),s=Number(e);return Number.isFinite(s)?s:e}readPageOrder(){const e=document.querySelector("salla-order-totals-card");return e?n(e.order??e.getAttribute("order")):null}waitForPageOrder(){const e=this.readPageOrder();return e?Promise.resolve(e):"undefined"==typeof MutationObserver?Promise.resolve().then((()=>this.readPageOrder())):new Promise((e=>{let s=!1;const r=()=>{s||(s=!0,a.disconnect(),clearTimeout(o),e(this.readPageOrder()))},t=document.querySelector("salla-order-totals-card"),a=new MutationObserver(r);a.observe(t??document.documentElement,t?{attributes:!0,attributeFilter:["order"]}:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["order"]});const o=setTimeout(r,2500)}))}cancelledByLabel(e){return salla.lang.getWithDefault(`pages.orders.cancelled_by_${e}`,a[e])}mountCancelledHeader(e=0){const s=this.orderCancelledReason,r=s?.reasons[0];if(!r||document.querySelector("[data-salla-order-cancelled-reason]"))return;const t=document.querySelector("td.single-order-header-item:not(.flex)");if(!t)return void(e<20&&requestAnimationFrame((()=>this.mountCancelledHeader(e+1))));const a=document.createElement("td");a.className="s-order-cancel-cancelled-header-item",a.setAttribute("data-salla-order-cancelled-reason","");const o=document.createElement("div");o.className="s-order-cancel-cancelled-header-label",o.textContent=this.cancelledByLabel(s.cancelled_by);const n=document.createElement("b");n.className="s-order-cancel-cancelled-header-reason",n.textContent=r,n.title=r,a.append(o,n),t.insertAdjacentElement("afterend",a)}purgeLegacyModal(){if(this.reasons.length)for(const e of document.querySelectorAll("salla-modal#modal-order-cancel:not([data-salla-order-cancel])"))e.remove()}applyPageOrder(e){this.pageOrder=e,this.orderCancelledReason=(e=>{const s=n(e),r=Array.isArray(s?.reasons)?s.reasons.filter((e=>"string"==typeof e&&e.length>0)):[];return r.length?{cancelled_by:"merchant"===s?.cancelled_by?"merchant":"customer",reasons:r}:null})(e.order_cancelled_reason)??void 0}async load(){this.loading=!0;try{const e=(e=>{if(null==e||""===e)return null;const s="string"==typeof e?n(e):e;return Array.isArray(s)&&s.length?s:null})(this.cancellationReasons);if(!this.pageOrder){const e=this.readPageOrder();e&&this.applyPageOrder(e)}if(this.pageOrder||e)this.pageOrder||this.waitForPageOrder().then((e=>{e&&(this.applyPageOrder(e),this.mountCancelledHeader())}));else{const e=await this.waitForPageOrder();e&&this.applyPageOrder(e)}const s=this.pageOrder;this.reasons=e?c(e):s?c(Array.isArray(s.cancellation_reasons)?s.cancellation_reasons:[]):[]}finally{this.loading=!1,this.purgeLegacyModal(),this.mountCancelledHeader()}}reasonLabel(e){const s=salla.lang.getLocale?.()||"ar";return e.translations?.[s]?.name||e.name}get hasOtherSelected(){return null!==this.selectedReasonId&&this.reasons.some((e=>e.id===this.selectedReasonId&&"other"===e.slug))}get canConfirm(){if(null===this.selectedReasonId)return!1;if(!this.hasOtherSelected)return!0;const e=this.reasonNote.trim().length;return e>0&&e<=t}selectReason(e){if(this.selectedReasonId===e)return"other"===this.reasons.find((s=>s.id===e))?.slug&&(this.reasonNote=""),void(this.selectedReasonId=null);if("other"===this.reasons.find((e=>e.id===this.selectedReasonId))?.slug&&(this.reasonNote=""),this.selectedReasonId=e,this.reasons.length&&this.reasons[this.reasons.length-1].id===e){const s=setTimeout((()=>{requestAnimationFrame((()=>{document.getElementById(`s-order-cancel-reason-${e}`)?.scrollIntoView({block:"start",behavior:"smooth"});const r=document.querySelector(".s-order-cancel-textarea");r?.focus(),clearTimeout(s)}))}),200)}}resetForm(){this.selectedReasonId=null,this.reasonNote="",this.confirmLoading=!1}setReasonNote(e){this.reasonNote=e.target.value}onKeyActivate(e,s){"Enter"!==e.key&&" "!==e.key||s()}async confirmCancel(){if(this.canConfirm&&!this.confirmLoading){this.confirmLoading=!0;try{const e=this.hasOtherSelected?this.reasonNote.trim():"",s={reasons:[String(this.selectedReasonId)],...e&&{reason_note:e}};await salla.order.api.cancel(this.resolvedOrderId,s),window.location.reload()}catch{this.confirmLoading=!1}}}render(){return this.loading||!this.reasons.length?s(r,{class:"s-order-cancel-wrapper"}):s(r,{class:"s-order-cancel-wrapper"},s("salla-modal",{id:"modal-order-cancel",class:"s-order-cancel-modal","data-salla-order-cancel":"",ref:e=>{this.modal=e,e?.setTitle?.(this.modalTitleLabel)},width:"sm",onModalVisibilityChanged:e=>!e.detail&&this.resetForm()},s("div",{class:"s-order-cancel-content"},s("div",{class:"s-order-cancel-intro"},s("p",{class:"s-order-cancel-heading"},this.questionLabel),s("p",{class:"s-order-cancel-subtitle"},this.subtitleLabel)),s("div",{class:"s-order-cancel-reasons s-scrollbar"},this.reasons.map((e=>{const r=`s-order-cancel-reason-${e.id}`;return s("label",{key:e.id,class:"s-order-cancel-reason",htmlFor:r},s("input",{type:"radio",name:"cancellation_reason",id:r,class:"s-order-cancel-radio s-radio",checked:this.selectedReasonId===e.id,onChange:()=>this.selectReason(e.id)}),s("span",{class:"s-order-cancel-reason-label"},this.reasonLabel(e)))}))),this.hasOtherSelected&&s("div",{class:"s-order-cancel-other-field"},s("textarea",{class:"s-order-cancel-textarea",placeholder:this.notePlaceholder,value:this.reasonNote,onInput:e=>this.setReasonNote(e)}),s("p",{class:{"s-order-cancel-counter":!0,"s-order-cancel-counter--limit":this.reasonNote.length>=t}},this.reasonNote.length>=t&&`${this.charLimitLabel} `,t,"/",this.reasonNote.length)),s("div",{class:"s-order-cancel-actions"},s("salla-button",{color:"primary",class:"w-full",width:"wide",disabled:!this.canConfirm,loading:this.confirmLoading,onClick:()=>this.confirmCancel(),onKeyDown:e=>this.onKeyActivate(e,(()=>this.confirmCancel()))},this.confirmLabel),s("salla-button",{class:"w-full",width:"wide",fill:"outline",color:"gray",onClick:()=>this.modal?.close(),onKeyDown:e=>this.onKeyActivate(e,(()=>this.modal?.close()))},this.backLabel)))))}static get watchers(){return{cancellationReasons:["onCancellationReasonsChange"]}}};l.style='.s-order-cancel-reason .s-order-cancel-radio::before,.s-order-cancel-reason .s-radio::before{content:"";width:10px;height:10px;border-radius:50%;transform:scale(0);transition:120ms transform ease-in-out;background-color:#fff;box-shadow:inset 1em 1em #fff}.s-order-cancel-reason .s-order-cancel-radio:checked::before,.s-order-cancel-reason .s-radio:checked::before{transform:scale(1);background-color:var(--color-primary);box-shadow:inset 1em 1em var(--color-primary)}';export{l as salla_order_cancel}
4
+ import{r as e,h as s,H as r}from"./p-Dm54yhRt.js";const t=250,a={customer:"أُلغي الطلب من قِبل العميل",merchant:"أُلغي الطلب من قِبل المتجر"},o=[["pages.orders.cancel_modal_title","إلغاء الطلب","Cancel order"],["pages.orders.cancel_reason_title","لماذا ترغب في إلغاء الطلب؟","Why do you want to cancel this order?"],["pages.orders.cancel_reason_subtitle","ساعدنا نعرف السبب لتحسين تجربتك.","Help us understand why to improve your experience."],["pages.orders.cancel_reason_confirm","تأكيد إلغاء الطلب","Confirm order cancellation"],["pages.orders.cancel_reason_back","تراجع","Go back"],["pages.orders.cancel_reason_note_placeholder","اذكر السبب","Mention the reason"],["pages.orders.cancelled_by_customer",a.customer,"Order cancelled by the customer"],["pages.orders.cancelled_by_merchant",a.merchant,"Order cancelled by the merchant"],["pages.orders.cancel_reason_char_limit","يتجاوز النص حد الأحرف المسموح","Text exceeds the allowed character limit"]],n=e=>{if(!e)return null;try{const s="string"==typeof e?JSON.parse(e):e;return s&&"object"==typeof s?s:null}catch{return null}},c=e=>e.filter((e=>!1!==e.is_active)).sort(((e,s)=>(e.sort??0)-(s.sort??0))),l=class{constructor(s){e(this,s),this.reasons=[],this.selectedReasonId=null,this.reasonNote="",this.confirmLoading=!1,this.loading=!0,this.modalTitleLabel="",this.questionLabel="",this.subtitleLabel="",this.confirmLabel="",this.backLabel="",this.notePlaceholder="",this.charLimitLabel="",salla.lang.onLoaded((()=>{const e=salla.lang.messages?.["ar.trans"],s=salla.lang.messages?.["en.trans"];if(e&&s&&salla.helpers?.setNested)for(const[r,t,a]of o)salla.helpers.setNested(e,r,t),salla.helpers.setNested(s,r,a);this.refreshLabels()}))}onCancellationReasonsChange(){this.load()}async componentWillLoad(){await salla.onReady(),this.refreshLabels(),await this.load()}refreshLabels(){const e=(e,s)=>salla.lang.getWithDefault(e,s);this.modalTitleLabel=e("pages.orders.cancel_modal_title","إلغاء الطلب"),this.questionLabel=e("pages.orders.cancel_reason_title","لماذا ترغب في إلغاء الطلب؟"),this.subtitleLabel=e("pages.orders.cancel_reason_subtitle","ساعدنا نعرف السبب لتحسين تجربتك."),this.confirmLabel=e("pages.orders.cancel_reason_confirm","تأكيد إلغاء الطلب"),this.backLabel=e("pages.orders.cancel_reason_back","تراجع"),this.notePlaceholder=e("pages.orders.cancel_reason_note_placeholder","اذكر السبب"),this.charLimitLabel=e("pages.orders.cancel_reason_char_limit","يتجاوز النص حد الأحرف المسموح")}get resolvedOrderId(){const e=this.orderId??this.pageOrder?.id??salla.config.get("page.id"),s=Number(e);return Number.isFinite(s)?s:e}readPageOrder(){const e=document.querySelector("salla-order-totals-card");return e?n(e.order??e.getAttribute("order")):null}waitForPageOrder(){const e=this.readPageOrder();return e?Promise.resolve(e):"undefined"==typeof MutationObserver?Promise.resolve().then((()=>this.readPageOrder())):new Promise((e=>{let s=!1;const r=()=>{s||(s=!0,a.disconnect(),clearTimeout(o),e(this.readPageOrder()))},t=document.querySelector("salla-order-totals-card"),a=new MutationObserver(r);a.observe(t??document.documentElement,t?{attributes:!0,attributeFilter:["order"]}:{childList:!0,subtree:!0,attributes:!0,attributeFilter:["order"]});const o=setTimeout(r,2500)}))}cancelledByLabel(e){return salla.lang.getWithDefault(`pages.orders.cancelled_by_${e}`,a[e])}mountCancelledHeader(e=0){const s=this.orderCancelledReason,r=s?.reasons[0];if(!r||document.querySelector("[data-salla-order-cancelled-reason]"))return;const t=document.querySelector("td.single-order-header-item:not(.flex)");if(!t)return void(e<20&&requestAnimationFrame((()=>this.mountCancelledHeader(e+1))));const a=document.createElement("td");a.className="s-order-cancel-cancelled-header-item",a.setAttribute("data-salla-order-cancelled-reason","");const o=document.createElement("div");o.className="s-order-cancel-cancelled-header-label",o.textContent=this.cancelledByLabel(s.cancelled_by);const n=document.createElement("b");n.className="s-order-cancel-cancelled-header-reason",n.textContent=r,n.title=r,a.append(o,n),t.insertAdjacentElement("afterend",a)}purgeLegacyModal(){if(this.reasons.length)for(const e of document.querySelectorAll("salla-modal#modal-order-cancel:not([data-salla-order-cancel])"))e.remove()}applyPageOrder(e){this.pageOrder=e,this.orderCancelledReason=(e=>{const s=n(e),r=Array.isArray(s?.reasons)?s.reasons.filter((e=>"string"==typeof e&&e.length>0)):[];return r.length?{cancelled_by:"merchant"===s?.cancelled_by?"merchant":"customer",reasons:r}:null})(e.order_cancelled_reason)??void 0}async load(){this.loading=!0;try{const e=(e=>{if(null==e||""===e)return null;const s="string"==typeof e?n(e):e;return Array.isArray(s)&&s.length?s:null})(this.cancellationReasons);if(!this.pageOrder){const e=this.readPageOrder();e&&this.applyPageOrder(e)}if(this.pageOrder||e)this.pageOrder||this.waitForPageOrder().then((e=>{e&&(this.applyPageOrder(e),this.mountCancelledHeader())}));else{const e=await this.waitForPageOrder();e&&this.applyPageOrder(e)}const s=this.pageOrder;this.reasons=e?c(e):s?c(Array.isArray(s.cancellation_reasons)?s.cancellation_reasons:[]):[]}finally{this.loading=!1,this.purgeLegacyModal(),this.mountCancelledHeader()}}reasonLabel(e){const s=salla.lang.getLocale?.()||"ar";return e.translations?.[s]?.name||e.name}get hasOtherSelected(){return null!==this.selectedReasonId&&this.reasons.some((e=>e.id===this.selectedReasonId&&"other"===e.slug))}get canConfirm(){if(null===this.selectedReasonId)return!1;if(!this.hasOtherSelected)return!0;const e=this.reasonNote.trim().length;return e>0&&e<=t}selectReason(e){if(this.selectedReasonId===e)return"other"===this.reasons.find((s=>s.id===e))?.slug&&(this.reasonNote=""),void(this.selectedReasonId=null);if("other"===this.reasons.find((e=>e.id===this.selectedReasonId))?.slug&&(this.reasonNote=""),this.selectedReasonId=e,this.reasons.length&&this.reasons[this.reasons.length-1].id===e){const s=setTimeout((()=>{requestAnimationFrame((()=>{document.getElementById(`s-order-cancel-reason-${e}`)?.scrollIntoView({block:"start",behavior:"smooth"});const r=document.querySelector(".s-order-cancel-textarea");r?.focus(),clearTimeout(s)}))}),200)}}resetForm(){this.selectedReasonId=null,this.reasonNote="",this.confirmLoading=!1}setReasonNote(e){this.reasonNote=e.target.value}onKeyActivate(e,s){"Enter"!==e.key&&" "!==e.key||s()}async confirmCancel(){if(this.canConfirm&&!this.confirmLoading){this.confirmLoading=!0;try{const e=this.hasOtherSelected?this.reasonNote.trim():"",s={reasons:[String(this.selectedReasonId)],...e&&{reason_note:e}};await salla.order.api.cancel(this.resolvedOrderId,s),window.location.reload()}catch{this.confirmLoading=!1}}}render(){return this.loading||!this.reasons.length?s(r,{class:"s-order-cancel-wrapper"}):s(r,{class:"s-order-cancel-wrapper"},s("salla-modal",{id:"modal-order-cancel",class:"s-order-cancel-modal","data-salla-order-cancel":"",ref:e=>{this.modal=e,e?.setTitle?.(this.modalTitleLabel)},width:"sm",onModalVisibilityChanged:e=>!e.detail&&this.resetForm()},s("div",{class:"s-order-cancel-content"},s("div",{class:"s-order-cancel-intro"},s("p",{class:"s-order-cancel-heading"},this.questionLabel),s("p",{class:"s-order-cancel-subtitle"},this.subtitleLabel)),s("div",{class:"s-order-cancel-reasons s-scrollbar"},this.reasons.map((e=>{const r=`s-order-cancel-reason-${e.id}`;return s("label",{key:e.id,class:"s-order-cancel-reason",htmlFor:r},s("input",{type:"radio",name:"cancellation_reason",id:r,class:"s-order-cancel-radio s-radio",checked:this.selectedReasonId===e.id,onChange:()=>this.selectReason(e.id)}),s("span",{class:"s-order-cancel-reason-label"},this.reasonLabel(e)))}))),this.hasOtherSelected&&s("div",{class:"s-order-cancel-other-field"},s("textarea",{class:"s-order-cancel-textarea",placeholder:this.notePlaceholder,value:this.reasonNote,onInput:e=>this.setReasonNote(e)}),s("p",{class:{"s-order-cancel-counter":!0,"s-order-cancel-counter--limit":this.reasonNote.length>=t}},this.reasonNote.length>=t&&`${this.charLimitLabel} `,t,"/",this.reasonNote.length)),s("div",{class:"s-order-cancel-actions"},s("salla-button",{color:"primary",class:"w-full",width:"wide",disabled:!this.canConfirm,loading:this.confirmLoading,onClick:()=>this.confirmCancel(),onKeyDown:e=>this.onKeyActivate(e,(()=>this.confirmCancel()))},this.confirmLabel),s("salla-button",{class:"w-full",width:"wide",fill:"outline",color:"gray",onClick:()=>this.modal?.close(),onKeyDown:e=>this.onKeyActivate(e,(()=>this.modal?.close()))},this.backLabel)))))}static get watchers(){return{cancellationReasons:["onCancellationReasonsChange"]}}};l.style='.s-order-cancel-reason .s-order-cancel-radio::before,.s-order-cancel-reason .s-radio::before{content:"";width:10px;height:10px;border-radius:50%;transform:scale(0);transition:120ms transform ease-in-out;background-color:#fff;box-shadow:inset 1em 1em #fff}.s-order-cancel-reason .s-order-cancel-radio:checked::before,.s-order-cancel-reason .s-radio:checked::before{transform:scale(1);background-color:var(--color-primary);box-shadow:inset 1em 1em var(--color-primary)}';export{l as salla_order_cancel}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as a,H as t,a as l}from"./p-BM5d07q2.js";const i=class{constructor(a){s(this,a),this.apps=salla.config.get("store.apps"),this.appSlot=this.host.querySelector('[slot="app"]')?.innerHTML||'<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />',salla.onReady((()=>{this.apps=salla.config.get("store.apps")})),salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(!Array.isArray(s)||s.length)return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":!0,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){this.host.querySelector('[slot="app"]')?.remove()}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_apps_icons}
4
+ import{r as s,h as a,H as t,a as l}from"./p-Dm54yhRt.js";const i=class{constructor(a){s(this,a),this.apps=salla.config.get("store.apps"),this.appSlot=this.host.querySelector('[slot="app"]')?.innerHTML||'<img alt="{name}" src="{icon}" width="135" height="40" decoding="async" loading="lazy" />',salla.onReady((()=>{this.apps=salla.config.get("store.apps")})),salla.lang.onLoaded((()=>{this.appsTitle=salla.lang.get("blocks.footer.download_apps")}))}getAppsArray(){return Object.entries(this.apps).map((([s,a])=>({name:s,value:a})))}componentWillLoad(){return new Promise((s=>salla.onReady(s)))}render(){const s=this.getAppsArray();if(!Array.isArray(s)||s.length)return a(t,{class:"s-apps-icons"},!this.hideTitle&&a("h3",null,this.appsTitle),a("div",{class:{"s-apps-icons-list":!0,vertical:this.vertical}},s.map(((s,t)=>a("a",{key:t,href:s.value,rel:"noreferrer",target:"_blank",class:"s-apps-icons-item",id:"app-slot",innerHTML:this.appSlot.replace(/\{icon\}/g,salla.url.cdn(`images/${s.name}.png`)).replace(/\{name\}/g,s.name)})))))}componentDidRender(){this.host.querySelector('[slot="app"]')?.remove()}get host(){return l(this)}};i.style=":host{display:block}";export{i as salla_apps_icons}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as l,a as s}from"./p-BM5d07q2.js";const e=class{constructor(l){a(this,l),this.languageNames={ar:"العربية",en:"English",sq:"shqip",hy:"հայերէն",bg:"български",zh:"汉语",hr:"hrvatski",cs:"čeština",da:"dansk",nl:"dutch",et:"eesti keel",fi:"suomen kieli",fr:"Français",de:"Deutsch",el:"Ελληνικά",hi:"हिन्दी",hu:"magyar",ind:"bahasa Indonesia",ga:"Gaeilge",it:"Italiano",ja:"日本語",ko:"한국어",lv:"latviešu",mt:"Maltese",fa:"فارسی",pl:"Polish",pt:"português",ro:"română",ru:"русский",sl:"slovenščina",es:"Español",sv:"svenska",tl:"Tagalog (Filipino)",tr:"Türkçe",uk:"украї́нська",ur:"اُردُو",ms:"Bahasa Malaysia"},this.currenciesList={SAR:{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"},USD:{en:"US Dollar",ar:"دولار أمريكي",symbol:"$"},EUR:{en:"Euro",ar:"يورو",symbol:"€"},AED:{en:"UAE Dirham",ar:"درهم اماراتي",symbol:"د.إ"},KWD:{en:"Kuwaiti Dinar",ar:"دينار كويتي",symbol:"د.ك"},BHD:{en:"Bahraini Dinar",ar:"دينار بحريني",symbol:"د.ب"},QAR:{en:"Qatari Riyal",ar:"ريال قطري",symbol:"ر.ق"},OMR:{en:"Omani Rial",ar:"ريال عماني",symbol:"ر.ع"},AUD:{en:"Australian Dollar",ar:"دولار استرالي",symbol:"$"},CAD:{en:"Canadian Dollar",ar:"دولار كندي",symbol:"$"},CNY:{en:"Renminbi",ar:"رنمينبي",symbol:"¥"},EGP:{en:"Egyptian Pound",ar:"جنيه مصري",symbol:"ج.م"},GBP:{en:"Pound Sterling",ar:"جنيه استرليني",symbol:"£"},IDR:{en:"Indonesian Rupiah",ar:"روبية إندونيسية",symbol:"Rp"},INR:{en:"Indian Rupee",ar:"روبية هندية",symbol:"₹"},JPY:{en:"Japanese Yen",ar:"ين ياباني",symbol:"¥"},MYR:{en:"Malaysian Ringgit",ar:"رينغيت ماليزي",symbol:"RM"},PKR:{en:"Pakistani Rupee",ar:"روبية باكستانية",symbol:"Rs."},SEK:{en:"Swedish Krona",ar:"كرونة سويدية",symbol:"kr"},SGD:{en:"Singapore Dollar",ar:"دولار سنغافوري",symbol:"$"},TRY:{en:"Turkish Lira",ar:"ليرة تركية",symbol:"₺"},IQD:{en:"Iraqi Dinar",ar:"دينار عراقي",symbol:"د.ع"},LBP:{en:"Lebanese Pound",ar:"ليرة لبنانية",symbol:"ل.ل"},MRO:{en:"Mauritanian Ouguiya",ar:"أوقية موريتانية",symbol:"UM"},SDG:{en:"Sudanese Pound",ar:"جنيه سوداني",symbol:"SDG"},SYP:{en:"Syrian Pound",ar:"ليرة سورية",symbol:"ل.س"},TND:{en:"Tunisian Dinar",ar:"دينار تونسي",symbol:"د.ت"},JOD:{en:"Jordanian Dinar",ar:"دينار أردني",symbol:"JOD"},DZD:{en:"Algerian Dinar",ar:"دينار جزائري",symbol:"دج"},MAD:{en:"Moroccan Dirham",ar:"درهم مغربي",symbol:"د.م."},LYD:{en:"Libyan Dinar",ar:"دينار ليبي",symbol:"LD"},YER:{en:"Yemeni Riyal",ar:"ريال يمني",symbol:"ر.ي"},ILS:{en:"New Shekel",ar:"شيكل جديد",symbol:"₪"}},this.arabicCurrencies=["SAR","AED","KWD","BHD","QAR","OMR","EGP","IQD","LBP","SYP","TND","DZD","MAD","YER"],this.languages=[],this.currencies=[],this.hasError=!1,this.showTrigger=!1,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">{symbol}</small></label>'}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),Salla.event.on("localization::open",(()=>this.open())),Salla.event.on("currency::open",(()=>this.openUnlessNative())),Salla.event.on("language::open",(()=>this.openUnlessNative())),this.language||(this.language=Salla.config.get("user.language_code")),this.currency||(this.currency=Salla.config.get("user.currency_code")),Salla.api.withoutNotifier((()=>this.getCurrencies())).catch((()=>null))}openUnlessNative(){Salla.config.isMobileApp()||this.open()}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()}getCurrency(a){const l=a||this.currency;if(this.currenciesList[l])return this.currenciesList[l];const s=this.currencies.find((a=>a.code===l));if(s){const a=this.escapeHtml(String(s.name||l));return{en:a,ar:a,symbol:this.escapeHtml(String((s.symbol||"").trim()||l))}}return{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"}}getLanguageName(){return this.languageNames[this.language]||this.language||""}getCurrencySymbol(a){return"SAR"===(a=a||this.currency)?'<i class="sicon-sar"></i>':"ar"!==this.language&&this.arabicCurrencies.includes(a)?a:this.getCurrency(a).symbol}getCurrencyName(a){return"ar"===this.language?this.getCurrency(a).ar:this.getCurrency(a).en}escapeHtml(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async getLanguages(){return this.languages.length>1?null:await Salla.config.languages().then((a=>this.languages=a))}async getCurrencies(){return 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[this.showTrigger?l("button",{type:"button",onClick:()=>this.open(),class:"s-localization-modal-trigger-btn"},l("span",null,this.getLanguageName()),l("span",{class:"s-localization-modal-trigger-separator"},"|")," ",l("span",{innerHTML:this.getCurrencySymbol()})):"",l("salla-modal",{key:"ef56534e6aadef517af7e5af725cd3b27afe8827",isLoading:!0,class:"s-hidden",ref:a=>this.modal=a,width:"xs"},l("div",{key:"47072c8447350fb18a5bd960335f9a907ffcdae5",slot:"loading"},l("div",{key:"96cf1ac3b2dc9f67ae831393285f20935d0312fd",class:"s-localization-modal-skeleton"},l("salla-skeleton",{key:"7c2ca11ecb4d3fd62ad4c74e5187acfa313d7dbf",width:"25%",height:"15px"}),l("div",{key:"96e7d7eadf414867716fd513b1daa3417b1a02c4",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:"3e02caddbc6de924dc902516f74e93f488556545",width:"25%",height:"15px"}),l("div",{key:"fd93fce5cd7ce64dfd356ea9f105f53368d7faf6",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:"0a8a92e3a2d99c2188767f5065e4efdae26d21c1",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,this.getCurrencyName(a.code)).replace(/\{code\}/g,a.code).replace(/\{symbol\}/g,this.getCurrencySymbol(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}
4
+ import{r as a,h as l,a as s}from"./p-Dm54yhRt.js";const e=class{constructor(l){a(this,l),this.languageNames={ar:"العربية",en:"English",sq:"shqip",hy:"հայերէն",bg:"български",zh:"汉语",hr:"hrvatski",cs:"čeština",da:"dansk",nl:"dutch",et:"eesti keel",fi:"suomen kieli",fr:"Français",de:"Deutsch",el:"Ελληνικά",hi:"हिन्दी",hu:"magyar",ind:"bahasa Indonesia",ga:"Gaeilge",it:"Italiano",ja:"日本語",ko:"한국어",lv:"latviešu",mt:"Maltese",fa:"فارسی",pl:"Polish",pt:"português",ro:"română",ru:"русский",sl:"slovenščina",es:"Español",sv:"svenska",tl:"Tagalog (Filipino)",tr:"Türkçe",uk:"украї́нська",ur:"اُردُو",ms:"Bahasa Malaysia"},this.currenciesList={SAR:{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"},USD:{en:"US Dollar",ar:"دولار أمريكي",symbol:"$"},EUR:{en:"Euro",ar:"يورو",symbol:"€"},AED:{en:"UAE Dirham",ar:"درهم اماراتي",symbol:"د.إ"},KWD:{en:"Kuwaiti Dinar",ar:"دينار كويتي",symbol:"د.ك"},BHD:{en:"Bahraini Dinar",ar:"دينار بحريني",symbol:"د.ب"},QAR:{en:"Qatari Riyal",ar:"ريال قطري",symbol:"ر.ق"},OMR:{en:"Omani Rial",ar:"ريال عماني",symbol:"ر.ع"},AUD:{en:"Australian Dollar",ar:"دولار استرالي",symbol:"$"},CAD:{en:"Canadian Dollar",ar:"دولار كندي",symbol:"$"},CNY:{en:"Renminbi",ar:"رنمينبي",symbol:"¥"},EGP:{en:"Egyptian Pound",ar:"جنيه مصري",symbol:"ج.م"},GBP:{en:"Pound Sterling",ar:"جنيه استرليني",symbol:"£"},IDR:{en:"Indonesian Rupiah",ar:"روبية إندونيسية",symbol:"Rp"},INR:{en:"Indian Rupee",ar:"روبية هندية",symbol:"₹"},JPY:{en:"Japanese Yen",ar:"ين ياباني",symbol:"¥"},MYR:{en:"Malaysian Ringgit",ar:"رينغيت ماليزي",symbol:"RM"},PKR:{en:"Pakistani Rupee",ar:"روبية باكستانية",symbol:"Rs."},SEK:{en:"Swedish Krona",ar:"كرونة سويدية",symbol:"kr"},SGD:{en:"Singapore Dollar",ar:"دولار سنغافوري",symbol:"$"},TRY:{en:"Turkish Lira",ar:"ليرة تركية",symbol:"₺"},IQD:{en:"Iraqi Dinar",ar:"دينار عراقي",symbol:"د.ع"},LBP:{en:"Lebanese Pound",ar:"ليرة لبنانية",symbol:"ل.ل"},MRO:{en:"Mauritanian Ouguiya",ar:"أوقية موريتانية",symbol:"UM"},SDG:{en:"Sudanese Pound",ar:"جنيه سوداني",symbol:"SDG"},SYP:{en:"Syrian Pound",ar:"ليرة سورية",symbol:"ل.س"},TND:{en:"Tunisian Dinar",ar:"دينار تونسي",symbol:"د.ت"},JOD:{en:"Jordanian Dinar",ar:"دينار أردني",symbol:"JOD"},DZD:{en:"Algerian Dinar",ar:"دينار جزائري",symbol:"دج"},MAD:{en:"Moroccan Dirham",ar:"درهم مغربي",symbol:"د.م."},LYD:{en:"Libyan Dinar",ar:"دينار ليبي",symbol:"LD"},YER:{en:"Yemeni Riyal",ar:"ريال يمني",symbol:"ر.ي"},ILS:{en:"New Shekel",ar:"شيكل جديد",symbol:"₪"}},this.arabicCurrencies=["SAR","AED","KWD","BHD","QAR","OMR","EGP","IQD","LBP","SYP","TND","DZD","MAD","YER"],this.languages=[],this.currencies=[],this.hasError=!1,this.showTrigger=!1,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">{symbol}</small></label>'}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),Salla.event.on("localization::open",(()=>this.open())),Salla.event.on("currency::open",(()=>this.openUnlessNative())),Salla.event.on("language::open",(()=>this.openUnlessNative())),this.language||(this.language=Salla.config.get("user.language_code")),this.currency||(this.currency=Salla.config.get("user.currency_code")),Salla.api.withoutNotifier((()=>this.getCurrencies())).catch((()=>null))}openUnlessNative(){Salla.config.isMobileApp()||this.open()}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()}getCurrency(a){const l=a||this.currency;if(this.currenciesList[l])return this.currenciesList[l];const s=this.currencies.find((a=>a.code===l));if(s){const a=this.escapeHtml(String(s.name||l));return{en:a,ar:a,symbol:this.escapeHtml(String((s.symbol||"").trim()||l))}}return{en:"Saudi Riyal",ar:"ريال سعودي",symbol:"ر.س"}}getLanguageName(){return this.languageNames[this.language]||this.language||""}getCurrencySymbol(a){return"SAR"===(a=a||this.currency)?'<i class="sicon-sar"></i>':"ar"!==this.language&&this.arabicCurrencies.includes(a)?a:this.getCurrency(a).symbol}getCurrencyName(a){return"ar"===this.language?this.getCurrency(a).ar:this.getCurrency(a).en}escapeHtml(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}async getLanguages(){return this.languages.length>1?null:await Salla.config.languages().then((a=>this.languages=a))}async getCurrencies(){return 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[this.showTrigger?l("button",{type:"button",onClick:()=>this.open(),class:"s-localization-modal-trigger-btn"},l("span",null,this.getLanguageName()),l("span",{class:"s-localization-modal-trigger-separator"},"|")," ",l("span",{innerHTML:this.getCurrencySymbol()})):"",l("salla-modal",{key:"ef56534e6aadef517af7e5af725cd3b27afe8827",isLoading:!0,class:"s-hidden",ref:a=>this.modal=a,width:"xs"},l("div",{key:"47072c8447350fb18a5bd960335f9a907ffcdae5",slot:"loading"},l("div",{key:"96cf1ac3b2dc9f67ae831393285f20935d0312fd",class:"s-localization-modal-skeleton"},l("salla-skeleton",{key:"7c2ca11ecb4d3fd62ad4c74e5187acfa313d7dbf",width:"25%",height:"15px"}),l("div",{key:"96e7d7eadf414867716fd513b1daa3417b1a02c4",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:"3e02caddbc6de924dc902516f74e93f488556545",width:"25%",height:"15px"}),l("div",{key:"fd93fce5cd7ce64dfd356ea9f105f53368d7faf6",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:"0a8a92e3a2d99c2188767f5065e4efdae26d21c1",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,this.getCurrencyName(a.code)).replace(/\{code\}/g,a.code).replace(/\{symbol\}/g,this.getCurrencySymbol(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}