@salla.sa/twilight-components 2.14.416 → 2.14.418

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 (303) hide show
  1. package/dist/cjs/{filepond-CBG90JEP.js → filepond-C1_8U7ht.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-JwH-NbLr.js → filepond-plugin-file-poster-C2QZkcu0.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-B_RE-gPk.js → filepond-plugin-file-validate-size-CbVRd24w.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DdcCt3Gt.js → filepond-plugin-file-validate-type-63RP4vcL.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-jZdP7Wd2.js → filepond-plugin-image-edit-CjWMhhkZ.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-ZMSOR6_7.js → filepond-plugin-image-exif-orientation-CJxStqYG.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-ICjNuZvr.js → filepond-plugin-image-preview--RTa59Q8.js} +1 -1
  8. package/dist/cjs/{functions-4ojGKP4U.js → functions-T48FHZw8.js} +1 -1
  9. package/dist/cjs/{index-hYJfBKqA.js → index-CQ4zjhzH.js} +1 -1
  10. package/dist/cjs/{index-CCPcy3yV.js → index-DO_QXaSt.js} +2 -2
  11. package/dist/cjs/loader.cjs.js +1 -1
  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 +3 -2
  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-booking-field_7.cjs.entry.js +10 -10
  21. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +10 -9
  22. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-delivery-promise.cjs.entry.js +2 -2
  31. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  43. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  44. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  45. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  48. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-map.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-progress-bar.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-reward-action_4.cjs.entry.js +3 -3
  78. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-slider.cjs.entry.js +12 -5
  82. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  93. package/dist/cjs/{tracked-promise-DZzEOWGH.js → tracked-promise-BnNAgCN_.js} +1 -1
  94. package/dist/cjs/twilight.cjs.js +1 -1
  95. package/dist/cjs/{vanilla-picker-BxCWwAM4.js → vanilla-picker-wbE79zwn.js} +1 -1
  96. package/dist/collection/components/salla-bought-together/salla-bought-together.js +1 -0
  97. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +9 -8
  98. package/dist/collection/components/salla-delivery-promise/salla-delivery-promise.js +1 -1
  99. package/dist/collection/components/salla-product-options/salla-product-options.js +1 -1
  100. package/dist/collection/components/salla-slider/salla-slider.js +12 -5
  101. package/dist/components/index.js +2 -2
  102. package/dist/components/salla-bought-together.js +1 -0
  103. package/dist/components/salla-bullet-delivery.js +9 -8
  104. package/dist/components/salla-delivery-promise.js +1 -1
  105. package/dist/components/salla-product-options2.js +1 -1
  106. package/dist/components/salla-slider2.js +11 -4
  107. package/dist/esm/{filepond-CNTsYc8S.js → filepond-BaqNYv3C.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-poster-DLCidc-Q.js → filepond-plugin-file-poster-nENZqIRv.js} +1 -1
  109. package/dist/esm/{filepond-plugin-file-validate-size-CZGLWF5m.js → filepond-plugin-file-validate-size-DGOq4RG8.js} +1 -1
  110. package/dist/esm/{filepond-plugin-file-validate-type-CKJi-jQD.js → filepond-plugin-file-validate-type-DwM-3UO7.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-edit-4Xk79kLy.js → filepond-plugin-image-edit-BCqDiFWK.js} +1 -1
  112. package/dist/esm/{filepond-plugin-image-exif-orientation-BzeDXlDj.js → filepond-plugin-image-exif-orientation-DiuxhjrQ.js} +1 -1
  113. package/dist/esm/{filepond-plugin-image-preview-D0PgvnTL.js → filepond-plugin-image-preview-DbFvPPQQ.js} +1 -1
  114. package/dist/esm/{functions-FT2ic5VF.js → functions-JPNAXx4d.js} +1 -1
  115. package/dist/esm/{index-C9LfegwO.js → index-BwsreBbG.js} +2 -2
  116. package/dist/esm/{index-hvP60PR-.js → index-DElBWCVR.js} +1 -1
  117. package/dist/esm/loader.js +2 -2
  118. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  119. package/dist/esm/salla-accordion_6.entry.js +1 -1
  120. package/dist/esm/salla-add-product-button_5.entry.js +3 -2
  121. package/dist/esm/salla-advertisement.entry.js +1 -1
  122. package/dist/esm/salla-alert_2.entry.js +1 -1
  123. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  124. package/dist/esm/salla-apps-icons.entry.js +1 -1
  125. package/dist/esm/salla-badge.entry.js +1 -1
  126. package/dist/esm/salla-booking-field_7.entry.js +10 -10
  127. package/dist/esm/salla-bullet-delivery.entry.js +10 -9
  128. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  129. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  130. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  131. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  132. package/dist/esm/salla-contacts.entry.js +1 -1
  133. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  134. package/dist/esm/salla-count-down.entry.js +1 -1
  135. package/dist/esm/salla-custom-fields.entry.js +1 -1
  136. package/dist/esm/salla-delivery-promise.entry.js +2 -2
  137. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  138. package/dist/esm/salla-filters-widget.entry.js +1 -1
  139. package/dist/esm/salla-filters.entry.js +1 -1
  140. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  141. package/dist/esm/salla-gifting.entry.js +1 -1
  142. package/dist/esm/salla-hook.entry.js +1 -1
  143. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  144. package/dist/esm/salla-installment.entry.js +1 -1
  145. package/dist/esm/salla-list-tile.entry.js +1 -1
  146. package/dist/esm/salla-localization-modal.entry.js +1 -1
  147. package/dist/esm/salla-login-modal.entry.js +1 -1
  148. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  149. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  150. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  151. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  152. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  153. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  154. package/dist/esm/salla-loyalty.entry.js +1 -1
  155. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  156. package/dist/esm/salla-map.entry.js +1 -1
  157. package/dist/esm/salla-menu.entry.js +1 -1
  158. package/dist/esm/salla-metadata.entry.js +1 -1
  159. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  160. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  161. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  162. package/dist/esm/salla-notification-item.entry.js +1 -1
  163. package/dist/esm/salla-notifications.entry.js +1 -1
  164. package/dist/esm/salla-offer-modal.entry.js +1 -1
  165. package/dist/esm/salla-offer.entry.js +1 -1
  166. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  167. package/dist/esm/salla-order-details-options.entry.js +1 -1
  168. package/dist/esm/salla-order-details.entry.js +1 -1
  169. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  170. package/dist/esm/salla-order-edit.entry.js +1 -1
  171. package/dist/esm/salla-order-summary.entry.js +1 -1
  172. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  173. package/dist/esm/salla-orders.entry.js +1 -1
  174. package/dist/esm/salla-payments.entry.js +1 -1
  175. package/dist/esm/salla-placeholder.entry.js +1 -1
  176. package/dist/esm/salla-price-range.entry.js +1 -1
  177. package/dist/esm/salla-product-card_2.entry.js +1 -1
  178. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  179. package/dist/esm/salla-products-list.entry.js +1 -1
  180. package/dist/esm/salla-progress-bar.entry.js +1 -1
  181. package/dist/esm/salla-quick-order.entry.js +1 -1
  182. package/dist/esm/salla-rating-modal.entry.js +1 -1
  183. package/dist/esm/salla-reward-action_4.entry.js +3 -3
  184. package/dist/esm/salla-scopes.entry.js +1 -1
  185. package/dist/esm/salla-search.entry.js +1 -1
  186. package/dist/esm/salla-skeleton.entry.js +1 -1
  187. package/dist/esm/salla-slider.entry.js +12 -5
  188. package/dist/esm/salla-social-share.entry.js +1 -1
  189. package/dist/esm/salla-social.entry.js +1 -1
  190. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  191. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  192. package/dist/esm/salla-tooltip.entry.js +1 -1
  193. package/dist/esm/salla-trust-badges.entry.js +1 -1
  194. package/dist/esm/salla-user-menu.entry.js +1 -1
  195. package/dist/esm/salla-user-profile.entry.js +1 -1
  196. package/dist/esm/salla-user-settings.entry.js +1 -1
  197. package/dist/esm/salla-verify.entry.js +1 -1
  198. package/dist/esm/salla-wallet.entry.js +1 -1
  199. package/dist/esm/{tracked-promise-1pTB63_W.js → tracked-promise-BD-FZk2P.js} +1 -1
  200. package/dist/esm/twilight.js +2 -2
  201. package/dist/esm/{vanilla-picker-BJ2CkMLp.js → vanilla-picker-CqoFxJJE.js} +1 -1
  202. package/dist/twilight/{p-b0d7b80f.entry.js → p-03c39b2d.entry.js} +1 -1
  203. package/dist/twilight/{p-15c0dccc.entry.js → p-0654ccca.entry.js} +1 -1
  204. package/dist/twilight/{p-64e02dcb.entry.js → p-069485ec.entry.js} +1 -1
  205. package/dist/twilight/{p-17e390e3.entry.js → p-0a786447.entry.js} +1 -1
  206. package/dist/twilight/{p-90dd4bf6.entry.js → p-0bf11f89.entry.js} +1 -1
  207. package/dist/twilight/{p-560960db.entry.js → p-10884e6e.entry.js} +1 -1
  208. package/dist/twilight/{p-25031ff2.entry.js → p-167f5262.entry.js} +1 -1
  209. package/dist/twilight/{p-5610e4e2.entry.js → p-19e82de2.entry.js} +1 -1
  210. package/dist/twilight/{p-118f29f4.entry.js → p-1c1ac203.entry.js} +1 -1
  211. package/dist/twilight/{p-148da2c3.entry.js → p-1c3e0dbc.entry.js} +1 -1
  212. package/dist/twilight/{p-533620ec.entry.js → p-201926a3.entry.js} +1 -1
  213. package/dist/twilight/{p-b74f020c.entry.js → p-25104b13.entry.js} +1 -1
  214. package/dist/twilight/{p-72f652ae.entry.js → p-29fc145b.entry.js} +1 -1
  215. package/dist/twilight/{p-dadaf42d.entry.js → p-2bd83486.entry.js} +1 -1
  216. package/dist/twilight/{p-4be163d5.entry.js → p-2f833767.entry.js} +1 -1
  217. package/dist/twilight/p-36048354.entry.js +4 -0
  218. package/dist/twilight/{p-b20200b3.entry.js → p-3f50a52d.entry.js} +1 -1
  219. package/dist/twilight/{p-16a47df9.entry.js → p-4110e600.entry.js} +1 -1
  220. package/dist/twilight/{p-762b495a.entry.js → p-44db7163.entry.js} +1 -1
  221. package/dist/twilight/{p-7e21eca0.entry.js → p-46088f51.entry.js} +1 -1
  222. package/dist/twilight/{p-f808105e.entry.js → p-4807586a.entry.js} +1 -1
  223. package/dist/twilight/{p-d4f9ff15.entry.js → p-4c57de7b.entry.js} +1 -1
  224. package/dist/twilight/{p-98058dd5.entry.js → p-4edf67be.entry.js} +1 -1
  225. package/dist/twilight/{p-cacc01e0.entry.js → p-57451f00.entry.js} +1 -1
  226. package/dist/twilight/{p-5dad49a3.entry.js → p-57e0b11b.entry.js} +1 -1
  227. package/dist/twilight/{p-b446cc66.entry.js → p-580441f5.entry.js} +1 -1
  228. package/dist/twilight/{p-662655e4.entry.js → p-59657a19.entry.js} +1 -1
  229. package/dist/twilight/{p-0c00ce12.entry.js → p-5ac81ffe.entry.js} +1 -1
  230. package/dist/twilight/{p-73717694.entry.js → p-5b371b1f.entry.js} +1 -1
  231. package/dist/twilight/p-60878c2e.entry.js +4 -0
  232. package/dist/twilight/p-60d875cc.entry.js +4 -0
  233. package/dist/twilight/{p-ea9375cd.entry.js → p-61215f22.entry.js} +1 -1
  234. package/dist/twilight/{p-fe32d556.entry.js → p-681953ef.entry.js} +1 -1
  235. package/dist/twilight/{p-2e278955.entry.js → p-695e3211.entry.js} +1 -1
  236. package/dist/twilight/p-7a33e83b.entry.js +4 -0
  237. package/dist/twilight/{p-a3a51648.entry.js → p-7d3722ad.entry.js} +1 -1
  238. package/dist/twilight/{p-ad1bf35d.entry.js → p-7d492d3c.entry.js} +1 -1
  239. package/dist/twilight/{p-8541ea88.entry.js → p-86cfa253.entry.js} +1 -1
  240. package/dist/twilight/{p-9b987f30.entry.js → p-9134d94d.entry.js} +1 -1
  241. package/dist/twilight/{p-c9624543.entry.js → p-91d74168.entry.js} +1 -1
  242. package/dist/twilight/{p-07c8d18a.entry.js → p-993bdcbe.entry.js} +1 -1
  243. package/dist/twilight/{p-5490ab3c.entry.js → p-9c73e42a.entry.js} +1 -1
  244. package/dist/twilight/{p-5cb3e470.entry.js → p-9d8e4e7c.entry.js} +1 -1
  245. package/dist/twilight/{p-CHhAfu1h.js → p-BuNOvMeU.js} +1 -1
  246. package/dist/twilight/{p-C9LfegwO.js → p-BwsreBbG.js} +1 -1
  247. package/dist/twilight/{p-Djj7vaV-.js → p-CEuTw3-D.js} +1 -1
  248. package/dist/twilight/{p-BsKHACid.js → p-CTyl0UJE.js} +1 -1
  249. package/dist/twilight/{p-gVQiSPdv.js → p-CbukOCNI.js} +1 -1
  250. package/dist/twilight/{p-dD0Tdyf6.js → p-Cw0Ky-u0.js} +1 -1
  251. package/dist/twilight/{p-CmyHU1sa.js → p-DPgASjJ8.js} +1 -1
  252. package/dist/twilight/{p-DdKxjqvN.js → p-DlGhggDp.js} +1 -1
  253. package/dist/twilight/{p-ByakzLkB.js → p-Dw7mGaHj.js} +1 -1
  254. package/dist/twilight/{p-l16goxRo.js → p-GgHo6Cr_.js} +1 -1
  255. package/dist/twilight/{p-Dc0Qm0uU.js → p-LWKLIOwS.js} +1 -1
  256. package/dist/twilight/{p-79fdc643.entry.js → p-a00015ec.entry.js} +1 -1
  257. package/dist/twilight/{p-822281b4.entry.js → p-a3a0bafa.entry.js} +1 -1
  258. package/dist/twilight/{p-823e1484.entry.js → p-a96ec635.entry.js} +1 -1
  259. package/dist/twilight/{p-087eee5a.entry.js → p-aaff5603.entry.js} +1 -1
  260. package/dist/twilight/{p-3c736f19.entry.js → p-ab5e0aef.entry.js} +1 -1
  261. package/dist/twilight/{p-33623d50.entry.js → p-ac008da7.entry.js} +1 -1
  262. package/dist/twilight/{p-a46d7111.entry.js → p-ad762138.entry.js} +1 -1
  263. package/dist/twilight/{p-fa9b08c3.entry.js → p-af1474dd.entry.js} +1 -1
  264. package/dist/twilight/{p-564cab70.entry.js → p-af84c7b8.entry.js} +1 -1
  265. package/dist/twilight/{p-f1090939.entry.js → p-b4fd50ef.entry.js} +1 -1
  266. package/dist/twilight/{p-b566c6d4.entry.js → p-b6ac7a22.entry.js} +1 -1
  267. package/dist/twilight/{p-a272ffbc.entry.js → p-b6dce61a.entry.js} +1 -1
  268. package/dist/twilight/{p-3e238107.entry.js → p-b737dbcb.entry.js} +1 -1
  269. package/dist/twilight/{p-7fcf1cfc.entry.js → p-b9062150.entry.js} +1 -1
  270. package/dist/twilight/{p-ed019625.entry.js → p-b9c9c487.entry.js} +1 -1
  271. package/dist/twilight/{p-af4d286b.entry.js → p-c0b690b2.entry.js} +1 -1
  272. package/dist/twilight/{p-72b20bca.entry.js → p-c1d4db6f.entry.js} +1 -1
  273. package/dist/twilight/{p-d87bdad9.entry.js → p-c5e18341.entry.js} +1 -1
  274. package/dist/twilight/{p-c38d3943.entry.js → p-c968dab0.entry.js} +1 -1
  275. package/dist/twilight/{p-089387e7.entry.js → p-cd6fc43c.entry.js} +1 -1
  276. package/dist/twilight/{p-0a076256.entry.js → p-ce588635.entry.js} +1 -1
  277. package/dist/twilight/{p-2a7d689e.entry.js → p-ceb9458e.entry.js} +1 -1
  278. package/dist/twilight/{p-f66c6dfe.entry.js → p-d0cf9b68.entry.js} +1 -1
  279. package/dist/twilight/{p-d4772204.entry.js → p-d469525b.entry.js} +1 -1
  280. package/dist/twilight/p-d739ae41.entry.js +4 -0
  281. package/dist/twilight/{p-cfdfe7bb.entry.js → p-d9c4d2ed.entry.js} +1 -1
  282. package/dist/twilight/{p-9ba16790.entry.js → p-dcc65eb2.entry.js} +1 -1
  283. package/dist/twilight/{p-48ade533.entry.js → p-e07f938a.entry.js} +1 -1
  284. package/dist/twilight/{p-31a72c7a.entry.js → p-e5325563.entry.js} +1 -1
  285. package/dist/twilight/{p-944e24bf.entry.js → p-edaba475.entry.js} +1 -1
  286. package/dist/twilight/{p-Dg-WfT5N.js → p-f-qXMnue.js} +1 -1
  287. package/dist/twilight/{p-d2bd6c7b.entry.js → p-f2815da9.entry.js} +1 -1
  288. package/dist/twilight/{p-bf38e653.entry.js → p-f653f2bb.entry.js} +1 -1
  289. package/dist/twilight/{p-4ea6a5ef.entry.js → p-f73c7b43.entry.js} +1 -1
  290. package/dist/twilight/{p-b9147a32.entry.js → p-f7b21078.entry.js} +1 -1
  291. package/dist/twilight/{p-957bf09f.entry.js → p-f88806d7.entry.js} +1 -1
  292. package/dist/twilight/{p-cc44fd26.entry.js → p-fbe07d2d.entry.js} +1 -1
  293. package/dist/twilight/{p-3308b003.entry.js → p-fec6b08b.entry.js} +1 -1
  294. package/dist/twilight/{p-f120ac27.entry.js → p-ff90dbf0.entry.js} +1 -1
  295. package/dist/twilight/twilight.esm.js +1 -1
  296. package/dist/types/components/salla-slider/salla-slider.d.ts +1 -1
  297. package/dist/types/components.d.ts +2 -2
  298. package/package.json +5 -5
  299. package/dist/twilight/p-9f5e9373.entry.js +0 -4
  300. package/dist/twilight/p-a27be3a6.entry.js +0 -4
  301. package/dist/twilight/p-b50a6baf.entry.js +0 -4
  302. package/dist/twilight/p-e1ea6d97.entry.js +0 -4
  303. package/dist/twilight/p-fafe3d2d.entry.js +0 -4
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as a,a as e}from"./p-C9LfegwO.js";import{S as c}from"./p-Ctkfc4K-.js";import{S as i}from"./p-CXRKXFgT.js";import{A as r}from"./p-DCZbpt2a.js";import{P as o}from"./p-DY4LZmNP.js";import{a as n}from"./p-CgtvEd63.js";const l=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:i,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:c,TagMoneyIcon:'\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>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n'},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:r,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}};l.style=":host{display:block}";const h=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",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,c=a.left+window.scrollX,i=s.getBoundingClientRect(),r=s.offsetWidth+"px",o=s.offsetHeight+"px",l=i.top,h=i.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:"+l+"px; left:"+h+"px;z-index:99999999; "),document.body.append(f);let d=document.querySelector(".s-cart-thumb");t.classList.remove("animated","rubberBand"),(new n.timeline).add({targets:d,width:[150,30],height:[150,30],top:[l,window.scrollY>0?e-window.scrollY-40:e-40],left:[h,c],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:[c,c+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("?")?"&":"?",c=new URLSearchParams;return c.set("scope",String(t.id)),t.allocation_type&&c.set("allocation_type",t.allocation_type),t.allocation_id&&c.set("allocation_id",t.allocation_id),`${s}${e}${c.toString()}`}return s}render(){return t(a,{key:"4d80eb7d5ea545740fd4c631b98297164e4afded"},t("a",{key:"f32a160c33514e98a35067eb8dc07aa15b7ddb9b",class:"s-cart-summary-wrapper",href:this.getCartLink()},t("div",{key:"b8ab102d86c3448d03403bade826d42c2fcee681",id:"s-cart-icon"},t("slot",{key:"2dae30fcc74ef4c6e74d25f745aea0893cdb87c9",name:"icon"},t("i",{key:"df69ad3f3e7affe12ce26d6e16aa2e9e4670f2fc",class:"s-cart-summary-icon",innerHTML:o}))),t("span",{key:"98927818c1f6b6e7138a8f818da96054c2d44b62",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),t("p",{key:"71a40df1d13608e4c9a988ee927ae5ebf1482635",class:"s-cart-summary-content"},this.showCartLabel&&t("span",{key:"9e8e2c66c3784ccebfc4bfba5ab2554a927b172c",class:"s-cart-summary-label"},this.cartLabel),t("b",{key:"bbc35cf2a4e793c3cf4d1a637740683569fd306d",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return e(this)}};h.style="";export{l as salla_cart_item_offers,h as salla_cart_summary}
4
+ import{r as s,h as t,H as a,a as e}from"./p-BwsreBbG.js";import{S as c}from"./p-Ctkfc4K-.js";import{S as i}from"./p-CXRKXFgT.js";import{A as r}from"./p-DCZbpt2a.js";import{P as o}from"./p-DY4LZmNP.js";import{a as n}from"./p-CgtvEd63.js";const l=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:i,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:c,TagMoneyIcon:'\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>tag-money</title>\n<path d="M20.567 11.433c-0.521-0.521-1.364-0.521-1.885 0l-0.524 0.524c-1.28-0.819-3.091-0.681-4.191 0.419-0.631 0.631-0.976 1.468-0.976 2.359 0 0.889 0.347 1.727 0.976 2.357l0.943 0.943c0.171 0.171 0.195 0.368 0.195 0.472s-0.025 0.301-0.196 0.472c-0.169 0.169-0.367 0.195-0.471 0.195s-0.301-0.025-0.472-0.195l-2.357-2.357c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l0.944 0.941-0.472 0.472c-0.521 0.521-0.521 1.364 0 1.885 0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l0.519-0.519c0.54 0.359 1.173 0.553 1.837 0.553 0.892 0 1.729-0.348 2.357-0.976 0.631-0.631 0.976-1.467 0.976-2.357s-0.347-1.727-0.976-2.357l-0.943-0.943c-0.26-0.26-0.26-0.684 0-0.944 0.259-0.259 0.683-0.261 0.944 0l1.885 1.887c0.521 0.521 1.364 0.521 1.885 0 0.521-0.52 0.521-1.364 0-1.885l-0.472-0.472 0.472-0.472c0.521-0.521 0.521-1.365 0.001-1.887zM28 0h-9.344c-1.059 0-2.056 0.411-2.809 1.153l-14.673 14.456c-1.56 1.56-1.561 4.097-0.001 5.657l9.56 9.56c0.755 0.755 1.76 1.172 2.828 1.173h0.003c1.068 0 2.072-0.416 2.833-1.179l14.451-14.668c0.743-0.753 1.153-1.751 1.153-2.809v-9.344c0-2.205-1.795-4-4-4zM29.333 13.344c0 0.353-0.137 0.685-0.385 0.937l-14.444 14.661c-0.252 0.252-0.587 0.391-0.941 0.391-0.001 0-0.001 0-0.001 0-0.356-0.001-0.691-0.139-0.943-0.392l-9.561-9.56c-0.52-0.52-0.52-1.365-0.005-1.88l14.667-14.449c0.253-0.248 0.585-0.385 0.937-0.385h9.344c0.736 0 1.333 0.597 1.333 1.333zM24 6.673c-0.737 0-1.333 0.604-1.333 1.341s0.596 1.333 1.333 1.333 1.333-0.596 1.333-1.333v-0.015c0-0.737-0.596-1.327-1.333-1.327z"></path>\n</svg>\n'},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:r,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}};l.style=":host{display:block}";const h=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",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,c=a.left+window.scrollX,i=s.getBoundingClientRect(),r=s.offsetWidth+"px",o=s.offsetHeight+"px",l=i.top,h=i.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:"+l+"px; left:"+h+"px;z-index:99999999; "),document.body.append(f);let d=document.querySelector(".s-cart-thumb");t.classList.remove("animated","rubberBand"),(new n.timeline).add({targets:d,width:[150,30],height:[150,30],top:[l,window.scrollY>0?e-window.scrollY-40:e-40],left:[h,c],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:[c,c+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("?")?"&":"?",c=new URLSearchParams;return c.set("scope",String(t.id)),t.allocation_type&&c.set("allocation_type",t.allocation_type),t.allocation_id&&c.set("allocation_id",t.allocation_id),`${s}${e}${c.toString()}`}return s}render(){return t(a,{key:"4d80eb7d5ea545740fd4c631b98297164e4afded"},t("a",{key:"f32a160c33514e98a35067eb8dc07aa15b7ddb9b",class:"s-cart-summary-wrapper",href:this.getCartLink()},t("div",{key:"b8ab102d86c3448d03403bade826d42c2fcee681",id:"s-cart-icon"},t("slot",{key:"2dae30fcc74ef4c6e74d25f745aea0893cdb87c9",name:"icon"},t("i",{key:"df69ad3f3e7affe12ce26d6e16aa2e9e4670f2fc",class:"s-cart-summary-icon",innerHTML:o}))),t("span",{key:"98927818c1f6b6e7138a8f818da96054c2d44b62",class:"s-cart-summary-count"},salla.helpers.number(this.cartSummaryCount)),t("p",{key:"71a40df1d13608e4c9a988ee927ae5ebf1482635",class:"s-cart-summary-content"},this.showCartLabel&&t("span",{key:"9e8e2c66c3784ccebfc4bfba5ab2554a927b172c",class:"s-cart-summary-label"},this.cartLabel),t("b",{key:"bbc35cf2a4e793c3cf4d1a637740683569fd306d",class:"s-cart-summary-total",innerHTML:salla.money(this.cartSummaryTotal)}))))}get host(){return e(this)}};h.style="";export{l as salla_cart_item_offers,h as salla_cart_summary}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,c as t,h as s,H as i}from"./p-C9LfegwO.js";import{a}from"./p-BedNk7k1.js";const l=class{constructor(s){e(this,s),this.changed=t(this,"changed"),this.min=0,this.max=1e4,this.moreThanLabel="أكثر من",this.lessThanLabel="أقل من",this.toLabel="الى",this.fromLabel="من",this.typing=!1,this.isMin=!1,this.isRTL=salla.config.get("theme.is_rtl",!0),this.filterValues=[]}connectedCallback(){if(this.filtersData&&this.filtersData?.price&&(this.minPrice=this.filtersData.price.min,this.maxPrice=this.filtersData.price.max),salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel),this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel),this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel),this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)})),1==this.option.values.length)return;if(this.option.values.length<=5)return void(this.filterValues=this.option.values);const e=Math.ceil(this.option.values.length/5);for(let t=0;t<this.option.values.length;t+=e)this.filterValues.push(this.option.values.slice(t,t+e).reduce(((e,t)=>(e.to=t.to,e.count+=t.count,e))))}async reset(){this.minInput.value=null,this.maxInput.value=null,this.minPrice=null,this.maxPrice=null}getPriceLabel(e){return isNaN(e.from)||e.from<1?`${this.lessThanLabel} ${salla.money(e.to)}`:isNaN(e.to)||e.to<1?`${this.moreThanLabel} ${salla.money(e.from)}`:`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){e&&(e>this.max||this.maxPrice&&e>this.maxPrice)||(e<this.min?this.minPrice=this.min:e&&(this.minPrice=e))}maxInputValidation(e){e&&(e<this.min||this.minPrice&&e<this.minPrice)||e>this.max&&(this.maxPrice=this.max)}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput),salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?1*+this.minPrice:null,s=this.maxPrice?1*+this.maxPrice:null;this.maxPrice||(this.maxPrice=""),this.isMin?this.minInputValidation(t):(this.minPrice||(this.minPrice=0),this.maxInputValidation(s)),this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from,this.maxPrice="*"!==t.to?t.to:"",this.changedEventHandler(e)}isChecked(e){return!(!this.minPrice&&!this.maxPrice)&&(((e.from<1||"*"==e.from)&&0==this.minPrice||e.from==this.minPrice)&&("*"==e.to||!e.to||e.to==this.maxPrice))}handleMinPrice(e){this.isMin=!0;const t=e.target.value;this.minPrice=""===t?0:t}handleMaxPrice(e){this.isMin=!1;const t=e.target.value;this.maxPrice=void 0===t?"":t}render(){return s(i,{key:"996f527f5a36ea273b0d8c195e35dc3efbdf62f2"},this.filterValues.map(((e,t)=>s("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},s("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),s("span",{innerHTML:this.getPriceLabel(e)})))),s("div",{key:"bfa8f970eb1e9c5d2b9678e5271aa04208b39289",class:"flex justify-center items-center"},s("div",{key:"59cd51f388f36a38e2bd036d27b7abe001fed9d0",class:"relative max-w-xl w-full"},s("div",{key:"226bd18705572502c7da11022a8ce02dc08d4d21",class:"s-price-range-inputs"},s("div",{key:"0ebfdced114308e82075cd153bef0020daa15bf6",class:"s-price-range-relative"},s("div",{key:"c3dacef6133e2b05eca8d643d1c8ce3f5b991548",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"b2451e091d93f85f268fc80e30e24f5f71c2628c",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),s("div",{key:"00c07380972b65eac5fac5688b99d21277f65d39",class:"s-price-range-gray-text"}," -"),s("div",{key:"403e98ad682f08946ccd191715ff37401a376722",class:"s-price-range-relative"},s("div",{key:"a1b0729fc40c17b9be68dd2c76a3afa1e99d8a62",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"5f5e5a202f4b11cde88ae954fa352b71886fe30e",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),s("salla-button",{key:"dd4899512e03f10c18e74f4d2434406dc6922a50",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},s("span",{key:"98d023ccfe7e26278259bf690a1d7a4323a704fc",innerHTML:this.isRTL?a:'\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>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n'}))))))}componentDidLoad(){this.isReady=!0}};l.style=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";export{l as salla_price_range}
4
+ import{r as e,c as t,h as s,H as i}from"./p-BwsreBbG.js";import{a}from"./p-BedNk7k1.js";const l=class{constructor(s){e(this,s),this.changed=t(this,"changed"),this.min=0,this.max=1e4,this.moreThanLabel="أكثر من",this.lessThanLabel="أقل من",this.toLabel="الى",this.fromLabel="من",this.typing=!1,this.isMin=!1,this.isRTL=salla.config.get("theme.is_rtl",!0),this.filterValues=[]}connectedCallback(){if(this.filtersData&&this.filtersData?.price&&(this.minPrice=this.filtersData.price.min,this.maxPrice=this.filtersData.price.max),salla.lang.onLoaded((()=>{this.moreThanLabel=salla.lang.getWithDefault("common.elements.more_than",this.moreThanLabel),this.lessThanLabel=salla.lang.getWithDefault("common.elements.less_than",this.lessThanLabel),this.toLabel=salla.lang.getWithDefault("common.elements.to",this.toLabel),this.fromLabel=salla.lang.getWithDefault("common.elements.from",this.fromLabel)})),1==this.option.values.length)return;if(this.option.values.length<=5)return void(this.filterValues=this.option.values);const e=Math.ceil(this.option.values.length/5);for(let t=0;t<this.option.values.length;t+=e)this.filterValues.push(this.option.values.slice(t,t+e).reduce(((e,t)=>(e.to=t.to,e.count+=t.count,e))))}async reset(){this.minInput.value=null,this.maxInput.value=null,this.minPrice=null,this.maxPrice=null}getPriceLabel(e){return isNaN(e.from)||e.from<1?`${this.lessThanLabel} ${salla.money(e.to)}`:isNaN(e.to)||e.to<1?`${this.moreThanLabel} ${salla.money(e.from)}`:`${salla.money(e.from)} ${this.toLabel} ${salla.money(e.to)}`}minInputValidation(e){e&&(e>this.max||this.maxPrice&&e>this.maxPrice)||(e<this.min?this.minPrice=this.min:e&&(this.minPrice=e))}maxInputValidation(e){e&&(e<this.min||this.minPrice&&e<this.minPrice)||e>this.max&&(this.maxPrice=this.max)}async changedEventHandler(e){salla.helpers.inputDigitsOnly(this.minInput),salla.helpers.inputDigitsOnly(this.maxInput);const t=this.minPrice?1*+this.minPrice:null,s=this.maxPrice?1*+this.maxPrice:null;this.maxPrice||(this.maxPrice=""),this.isMin?this.minInputValidation(t):(this.minPrice||(this.minPrice=0),this.maxInputValidation(s)),this.isReady&&this.changed.emit({event:e,option:this.option,value:{max:this.maxPrice,min:this.minPrice}})}handleMinMaxPrice(e,t){this.minPrice=t.from,this.maxPrice="*"!==t.to?t.to:"",this.changedEventHandler(e)}isChecked(e){return!(!this.minPrice&&!this.maxPrice)&&(((e.from<1||"*"==e.from)&&0==this.minPrice||e.from==this.minPrice)&&("*"==e.to||!e.to||e.to==this.maxPrice))}handleMinPrice(e){this.isMin=!0;const t=e.target.value;this.minPrice=""===t?0:t}handleMaxPrice(e){this.isMin=!1;const t=e.target.value;this.maxPrice=void 0===t?"":t}render(){return s(i,{key:"996f527f5a36ea273b0d8c195e35dc3efbdf62f2"},this.filterValues.map(((e,t)=>s("label",{class:"s-filters-label",htmlFor:`${this.option.key}-${t}`,key:t},s("input",{id:`${this.option.key}-${t}`,name:"price",type:"radio",checked:this.isChecked(e),class:"s-filters-radio",onChange:t=>this.handleMinMaxPrice(t,e)}),s("span",{innerHTML:this.getPriceLabel(e)})))),s("div",{key:"bfa8f970eb1e9c5d2b9678e5271aa04208b39289",class:"flex justify-center items-center"},s("div",{key:"59cd51f388f36a38e2bd036d27b7abe001fed9d0",class:"relative max-w-xl w-full"},s("div",{key:"226bd18705572502c7da11022a8ce02dc08d4d21",class:"s-price-range-inputs"},s("div",{key:"0ebfdced114308e82075cd153bef0020daa15bf6",class:"s-price-range-relative"},s("div",{key:"c3dacef6133e2b05eca8d643d1c8ce3f5b991548",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"b2451e091d93f85f268fc80e30e24f5f71c2628c",type:"number",maxlength:"5",ref:e=>this.minInput=e,onBlur:e=>this.handleMinPrice(e),value:this.minPrice,placeholder:this.fromLabel,class:"s-price-range-number-input"})),s("div",{key:"00c07380972b65eac5fac5688b99d21277f65d39",class:"s-price-range-gray-text"}," -"),s("div",{key:"403e98ad682f08946ccd191715ff37401a376722",class:"s-price-range-relative"},s("div",{key:"a1b0729fc40c17b9be68dd2c76a3afa1e99d8a62",class:"s-price-range-currency"}," ",salla.config.currency().symbol),s("input",{key:"5f5e5a202f4b11cde88ae954fa352b71886fe30e",type:"number",maxlength:"5",ref:e=>this.maxInput=e,onBlur:e=>this.handleMaxPrice(e),value:this.maxPrice,placeholder:this.toLabel,class:"s-price-range-number-input","aria-describedby":"price-currency"})),s("salla-button",{key:"dd4899512e03f10c18e74f4d2434406dc6922a50",color:"gray",shape:"icon",size:"small",fill:"outline",onClick:e=>this.changedEventHandler(e)},s("span",{key:"98d023ccfe7e26278259bf690a1d7a4323a704fc",innerHTML:this.isRTL?a:'\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>arrow-right</title>\n<path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>\n</svg>\n'}))))))}componentDidLoad(){this.isReady=!0}};l.style=":host{display:block}.rtl .rtl-range-slider,[dir=rtl] .rtl-range-slider{transform:rotateY(180deg)}.rtl .rtl-range-numbers,[dir=rtl] .rtl-range-numbers{flex-direction:row-reverse}.rtl .form-select,.rtl select,[dir=rtl] .form-select,[dir=rtl] select{background-position:left 0.5rem center;padding-right:12px}.rtl .menu-divide li:not(:last-child):after,[dir=rtl] .menu-divide li:not(:last-child):after{left:0;right:auto}input[type=range]::-webkit-slider-thumb{pointer-events:all;width:24px;height:24px;-webkit-appearance:none}[type=checkbox]:checked{background-size:80%}";export{l as salla_price_range}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as t,H as s,a as e}from"./p-C9LfegwO.js";const i=class{constructor(t){if(a(this,t),this.entity="product",this.specs=[],this.download=salla.lang.get("pages.thank_you.download"),this.entityId)try{return void(this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId))}catch(a){salla.log("Bad json passed via entityId prop")}}getValue(a){if("file"===a.type)return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`;if("url"===a.type)return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`;if("date"===a.type){const t=new Date(a.value);return`${String(t.getDate()).padStart(2,"0")}/${String(t.getMonth()+1).padStart(2,"0")}/${t.getFullYear()}`}return a.value}async componentWillLoad(){if(await salla.onReady(),!salla.config.get("store.features")?.includes("custom-fields"))return salla.logger.error("feature custom-fields is not activated");if(this.entityId||!salla.url.is_page("product.single")&&!salla.url.is_page("product.showNewUrls")||(this.entityId=salla.config.get("page.id")),!this.entityId)return salla.logger.error("can't render salla-metadata without enity-id prop!");await salla.lang.onLoaded(),this.download=salla.lang.get("pages.thank_you.download");const a=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=a.data[0]?.sections}render(){if(this.specs.length)return t(s,{class:"s-metadata-wrapper"},this.specs.map((a=>t("div",{class:"s-metadata-box"},t("div",{class:"s-metadata-box-header"},t("i",{class:"sicon-list"}),a.name),a.fields.map((a=>t("div",{class:"s-metadata-row"},t("p",{class:"s-metadata-row-name"},a.name),t("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};i.style="";export{i as salla_metadata}
4
+ import{r as a,h as s,H as t,a as e}from"./p-BwsreBbG.js";const i=class{constructor(s){if(a(this,s),this.entity="product",this.specs=[],this.download=salla.lang.get("pages.thank_you.download"),this.entityId)try{return void(this.entityId=Array.isArray(this.entityId)?this.entityId:JSON.parse(this.entityId))}catch(a){salla.log("Bad json passed via entityId prop")}}getValue(a){if("file"===a.type)return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`;if("url"===a.type)return`<a href="${a.value}" class="text-blue-700 underline" target="_blank">${a.value}</a>`;if("date"===a.type){const s=new Date(a.value);return`${String(s.getDate()).padStart(2,"0")}/${String(s.getMonth()+1).padStart(2,"0")}/${s.getFullYear()}`}return a.value}async componentWillLoad(){if(await salla.onReady(),!salla.config.get("store.features")?.includes("custom-fields"))return salla.logger.error("feature custom-fields is not activated");if(this.entityId||!salla.url.is_page("product.single")&&!salla.url.is_page("product.showNewUrls")||(this.entityId=salla.config.get("page.id")),!this.entityId)return salla.logger.error("can't render salla-metadata without enity-id prop!");await salla.lang.onLoaded(),this.download=salla.lang.get("pages.thank_you.download");const a=await Salla.api.metadata.fetchValues(this.entity,this.entityId);this.specs=a.data[0]?.sections}render(){if(this.specs.length)return s(t,{class:"s-metadata-wrapper"},this.specs.map((a=>s("div",{class:"s-metadata-box"},s("div",{class:"s-metadata-box-header"},s("i",{class:"sicon-list"}),a.name),a.fields.map((a=>s("div",{class:"s-metadata-row"},s("p",{class:"s-metadata-row-name"},a.name),s("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};i.style="";export{i as salla_metadata}
@@ -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 o}from"./p-C9LfegwO.js";const c=class{constructor(a){s(this,a),this.availableCoupons=[],this.cartTotal=0,this.currentCoupon="",this.couponInputValue="",this.couponError="",this.isApplying=!1,this.isHandlingInternalError=!1,this.cartUpdatedHandler=s=>{this.cartTotal=s.sub_total??s.total??0;const a=s.coupon||"";a!==this.currentCoupon&&(this.currentCoupon=a,this.couponInputValue=a),this.couponError=""},this.couponAddedHandler=()=>{},this.couponAdditionFailedHandler=s=>{this.isApplying||this.isHandlingInternalError||this.showCouponError(s?.message||salla.lang.get("pages.cart.coupon_application_error"))},this.couponDeletedHandler=()=>{},this.onKeyUp=s=>{"Enter"===s.key&&this.couponButtonRef?.click(),this.couponError=""},this.onInput=s=>{this.couponInputValue=s.target.value}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.loadCouponsData(),this.loadCartTotal(),this.setupCartEventListeners()}componentDidLoad(){this.setupCouponInputEvents()}setupCartEventListeners(){salla.event.on("cart::updated",this.cartUpdatedHandler),salla.event.on("cart::coupon.added",this.couponAddedHandler),salla.event.on("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.on("cart::coupon.deleted",this.couponDeletedHandler)}disconnectedCallback(){this.couponInputRef?.removeEventListener("keyup",this.onKeyUp),this.couponInputRef?.removeEventListener("input",this.onInput),salla.event.off("cart::updated",this.cartUpdatedHandler),salla.event.off("cart::coupon.added",this.couponAddedHandler),salla.event.off("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.off("cart::coupon.deleted",this.couponDeletedHandler)}async selectCoupon(s){const a=this.availableCoupons.find((a=>a.code===s));if(a){if(!this.isEligible(a))throw new Error("Coupon not eligible: minimum cart amount not met");try{await this.applyCoupon(s),this.host.dispatchEvent(new CustomEvent("salla::cart-coupons.coupon.selected",{detail:a,bubbles:!0}))}catch(s){throw s}}return a}async loadCouponsData(){try{const s=await salla.api.request("coupons"),a=s?.data,t=Array.isArray(a)?a:Array.isArray(a?.data)?a.data:[];this.availableCoupons=t}catch(s){console.warn("Failed to load coupons:",s),this.availableCoupons=[]}}loadCartTotal(){const s=salla.storage.get("cart");this.cartTotal=s?.summary?.sub_total??s?.sub_total??0,this.currentCoupon=s?.coupon||"",this.couponInputValue=s?.coupon||""}setupCouponInputEvents(){this.couponInputRef&&this.couponButtonRef&&(this.couponInputRef.addEventListener("keyup",this.onKeyUp),this.couponInputRef.addEventListener("input",this.onInput))}async handleCouponButtonClick(){if(this.isApplying)return;const s=!!this.currentCoupon;if(s||this.couponInputValue.trim()){this.isApplying=!0,this.isHandlingInternalError=!0;try{s?await salla.cart.deleteCoupon():await salla.cart.addCoupon(this.couponInputValue.trim())}catch(s){this.showCouponError(s.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}showCouponError(s){this.couponError=s}handleCouponClick(s){this.applyCoupon(s.code,!1).catch((()=>{}))}async applyCoupon(s,a=!0){if(this.isApplying){if(a)throw new Error("Coupon application already in progress")}else{this.couponInputValue=s,this.couponError="",this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(s.trim())}catch(s){if(this.showCouponError(s.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error")),a)throw s}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}formatMainAmount(s){if("percentage"===s.type)return`${salla.helpers.number("object"==typeof s.amount?s.amount.amount:s.amount)}%`;{const t="object"==typeof s.amount?s.amount:{amount:s.amount,currency:s.minimum_amount?.currency||salla.config.get("store.currency.code","SAR")};return a("span",{innerHTML:salla.money(t.amount,t.currency)})}}isEligible(s){return!(s.minimum_amount&&this.cartTotal<parseFloat(s.minimum_amount.amount))}renderCouponCard(s){const t=this.isEligible(s);return a("div",{class:"s-cart-coupons-slide-one-fourth swiper-slide"},a("div",{class:"s-cart-coupons-card "+(!t||this.isApplying?"s-cart-coupons-disabled":""),onClick:()=>t&&!this.isApplying&&this.handleCouponClick(s)},a("div",{class:"s-cart-coupons-top-section"},a("div",{class:"s-cart-coupons-discount-values"},a("div",{class:"s-cart-coupons-main-amount"},this.formatMainAmount(s)),s.free_shipping?a("div",{class:"s-cart-coupons-secondary-info"},"+ ",salla.lang.get("pages.cart.free_shipping")):s.maximum_amount&&a("div",{class:"s-cart-coupons-secondary-info"},salla.lang.get("pages.cart.up_to")," ",a("span",{innerHTML:salla.money(s.maximum_amount.amount,s.maximum_amount.currency)}))),a("div",{class:"s-cart-coupons-code"},s.code)),a("div",{class:"s-cart-coupons-divider"}),a("div",{class:"s-cart-coupons-bottom-section"},a("div",{class:"s-cart-coupons-terms"},null!=s.remaining_days&&a("div",{class:"s-cart-coupons-expiry "+(s.remaining_days<=3?"s-cart-coupons-expiry-warning":"")},0===s.remaining_days?salla.lang.get("pages.cart.expires_today"):`${salla.lang.get("pages.cart.expires_after")} ${s.remaining_days} ${salla.lang.get("pages.cart.day")}`),s.minimum_amount&&parseFloat(s.minimum_amount.amount)>0&&a("div",{class:"s-cart-coupons-minimum"},salla.lang.get("pages.cart.minimum")," ",a("span",{innerHTML:salla.money(s.minimum_amount.amount,s.minimum_amount.currency)}))),a("div",{class:"s-cart-coupons-action"},t?salla.lang.get("pages.cart.save_coupon"):salla.lang.get("pages.cart.coupon_not_compatible")))))}render(){return a(t,{key:"95e65153874488ea19570a11d82eca2a054dd12f"},a("div",{key:"1bbcebf392b3cbe9a771d2fead982c6d467920a2",class:"s-cart-coupons-wrapper"},a("div",{key:"f43ff91fbe2661f7c533d1ded01910bf9cdd04bc",class:"s-cart-coupons-input-section"},a("label",{key:"47b768adf09859842a329174ed670e0ed6eb38e5",htmlFor:"coupon-input",class:"s-cart-coupons-coupon-label"},salla.lang.get("pages.cart.have_coupon")),a("div",{key:"0119d436bd813f0aed13b15178644f393f23c448",class:"s-cart-coupons-coupon-input-container"},a("input",{key:"48daad1665830075e676843c96f99af147a7272c",type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:!!this.currentCoupon||this.isApplying,ref:s=>this.couponInputRef=s,"aria-label":salla.lang.get("pages.cart.apply_coupon")}),a("salla-button",{key:"9e01ec3c8bd3a28b5dd00d028fd8d0b29a1f0f63",ref:s=>this.couponButtonRef=s,class:"s-cart-coupons-coupon-button "+(this.currentCoupon?"s-cart-coupons-coupon-button-remove":"s-cart-coupons-coupon-button-apply"),color:this.currentCoupon?"danger":"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleCouponButtonClick()},this.currentCoupon?a("i",{class:"sicon-cancel"}):a("span",null,salla.lang.get("pages.cart.save_coupon")))),this.couponError&&a("span",{key:"0b46e12e0ece78bb96180004a30154cf5229c930",class:"s-cart-coupons-coupon-error"},this.couponError)),this.availableCoupons&&this.availableCoupons.length>0&&a("salla-slider",{key:"6df6dc30d63f8e158ce65392ae682f03d09ee014",type:"carousel",showControls:!1,class:"s-cart-coupons-slider"},a("div",{key:"adc4343bc2f217bdcf03a769b19363a363ca1ccb",slot:"items"},this.availableCoupons.map((s=>this.renderCouponCard(s)))))))}get host(){return o(this)}};c.style="";export{c as salla_cart_coupons}
4
+ import{r as s,h as a,H as t,a as o}from"./p-BwsreBbG.js";const c=class{constructor(a){s(this,a),this.availableCoupons=[],this.cartTotal=0,this.currentCoupon="",this.couponInputValue="",this.couponError="",this.isApplying=!1,this.isHandlingInternalError=!1,this.cartUpdatedHandler=s=>{this.cartTotal=s.sub_total??s.total??0;const a=s.coupon||"";a!==this.currentCoupon&&(this.currentCoupon=a,this.couponInputValue=a),this.couponError=""},this.couponAddedHandler=()=>{},this.couponAdditionFailedHandler=s=>{this.isApplying||this.isHandlingInternalError||this.showCouponError(s?.message||salla.lang.get("pages.cart.coupon_application_error"))},this.couponDeletedHandler=()=>{},this.onKeyUp=s=>{"Enter"===s.key&&this.couponButtonRef?.click(),this.couponError=""},this.onInput=s=>{this.couponInputValue=s.target.value}}async componentWillLoad(){await Salla.onReady(),await Salla.lang.onLoaded(),this.loadCouponsData(),this.loadCartTotal(),this.setupCartEventListeners()}componentDidLoad(){this.setupCouponInputEvents()}setupCartEventListeners(){salla.event.on("cart::updated",this.cartUpdatedHandler),salla.event.on("cart::coupon.added",this.couponAddedHandler),salla.event.on("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.on("cart::coupon.deleted",this.couponDeletedHandler)}disconnectedCallback(){this.couponInputRef?.removeEventListener("keyup",this.onKeyUp),this.couponInputRef?.removeEventListener("input",this.onInput),salla.event.off("cart::updated",this.cartUpdatedHandler),salla.event.off("cart::coupon.added",this.couponAddedHandler),salla.event.off("cart::coupon.addition.failed",this.couponAdditionFailedHandler),salla.event.off("cart::coupon.deleted",this.couponDeletedHandler)}async selectCoupon(s){const a=this.availableCoupons.find((a=>a.code===s));if(a){if(!this.isEligible(a))throw new Error("Coupon not eligible: minimum cart amount not met");try{await this.applyCoupon(s),this.host.dispatchEvent(new CustomEvent("salla::cart-coupons.coupon.selected",{detail:a,bubbles:!0}))}catch(s){throw s}}return a}async loadCouponsData(){try{const s=await salla.api.request("coupons"),a=s?.data,t=Array.isArray(a)?a:Array.isArray(a?.data)?a.data:[];this.availableCoupons=t}catch(s){console.warn("Failed to load coupons:",s),this.availableCoupons=[]}}loadCartTotal(){const s=salla.storage.get("cart");this.cartTotal=s?.summary?.sub_total??s?.sub_total??0,this.currentCoupon=s?.coupon||"",this.couponInputValue=s?.coupon||""}setupCouponInputEvents(){this.couponInputRef&&this.couponButtonRef&&(this.couponInputRef.addEventListener("keyup",this.onKeyUp),this.couponInputRef.addEventListener("input",this.onInput))}async handleCouponButtonClick(){if(this.isApplying)return;const s=!!this.currentCoupon;if(s||this.couponInputValue.trim()){this.isApplying=!0,this.isHandlingInternalError=!0;try{s?await salla.cart.deleteCoupon():await salla.cart.addCoupon(this.couponInputValue.trim())}catch(s){this.showCouponError(s.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error"))}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}else this.showCouponError(salla.lang.get("pages.cart.enter_coupon_code"))}showCouponError(s){this.couponError=s}handleCouponClick(s){this.applyCoupon(s.code,!1).catch((()=>{}))}async applyCoupon(s,a=!0){if(this.isApplying){if(a)throw new Error("Coupon application already in progress")}else{this.couponInputValue=s,this.couponError="",this.isApplying=!0,this.isHandlingInternalError=!0;try{await salla.cart.addCoupon(s.trim())}catch(s){if(this.showCouponError(s.response?.data?.error?.message||salla.lang.get("pages.cart.coupon_application_error")),a)throw s}finally{this.isApplying=!1,setTimeout((()=>{this.isHandlingInternalError=!1}),100)}}}formatMainAmount(s){if("percentage"===s.type)return`${salla.helpers.number("object"==typeof s.amount?s.amount.amount:s.amount)}%`;{const t="object"==typeof s.amount?s.amount:{amount:s.amount,currency:s.minimum_amount?.currency||salla.config.get("store.currency.code","SAR")};return a("span",{innerHTML:salla.money(t.amount,t.currency)})}}isEligible(s){return!(s.minimum_amount&&this.cartTotal<parseFloat(s.minimum_amount.amount))}renderCouponCard(s){const t=this.isEligible(s);return a("div",{class:"s-cart-coupons-slide-one-fourth swiper-slide"},a("div",{class:"s-cart-coupons-card "+(!t||this.isApplying?"s-cart-coupons-disabled":""),onClick:()=>t&&!this.isApplying&&this.handleCouponClick(s)},a("div",{class:"s-cart-coupons-top-section"},a("div",{class:"s-cart-coupons-discount-values"},a("div",{class:"s-cart-coupons-main-amount"},this.formatMainAmount(s)),s.free_shipping?a("div",{class:"s-cart-coupons-secondary-info"},"+ ",salla.lang.get("pages.cart.free_shipping")):s.maximum_amount&&a("div",{class:"s-cart-coupons-secondary-info"},salla.lang.get("pages.cart.up_to")," ",a("span",{innerHTML:salla.money(s.maximum_amount.amount,s.maximum_amount.currency)}))),a("div",{class:"s-cart-coupons-code"},s.code)),a("div",{class:"s-cart-coupons-divider"}),a("div",{class:"s-cart-coupons-bottom-section"},a("div",{class:"s-cart-coupons-terms"},null!=s.remaining_days&&a("div",{class:"s-cart-coupons-expiry "+(s.remaining_days<=3?"s-cart-coupons-expiry-warning":"")},0===s.remaining_days?salla.lang.get("pages.cart.expires_today"):`${salla.lang.get("pages.cart.expires_after")} ${s.remaining_days} ${salla.lang.get("pages.cart.day")}`),s.minimum_amount&&parseFloat(s.minimum_amount.amount)>0&&a("div",{class:"s-cart-coupons-minimum"},salla.lang.get("pages.cart.minimum")," ",a("span",{innerHTML:salla.money(s.minimum_amount.amount,s.minimum_amount.currency)}))),a("div",{class:"s-cart-coupons-action"},t?salla.lang.get("pages.cart.save_coupon"):salla.lang.get("pages.cart.coupon_not_compatible")))))}render(){return a(t,{key:"95e65153874488ea19570a11d82eca2a054dd12f"},a("div",{key:"1bbcebf392b3cbe9a771d2fead982c6d467920a2",class:"s-cart-coupons-wrapper"},a("div",{key:"f43ff91fbe2661f7c533d1ded01910bf9cdd04bc",class:"s-cart-coupons-input-section"},a("label",{key:"47b768adf09859842a329174ed670e0ed6eb38e5",htmlFor:"coupon-input",class:"s-cart-coupons-coupon-label"},salla.lang.get("pages.cart.have_coupon")),a("div",{key:"0119d436bd813f0aed13b15178644f393f23c448",class:"s-cart-coupons-coupon-input-container"},a("input",{key:"48daad1665830075e676843c96f99af147a7272c",type:"text",id:"coupon-input",name:"coupon",class:"form-input "+(this.couponError?"s-coupon-input-error":""),placeholder:salla.lang.get("pages.cart.coupon_placeholder"),value:this.couponInputValue,disabled:!!this.currentCoupon||this.isApplying,ref:s=>this.couponInputRef=s,"aria-label":salla.lang.get("pages.cart.apply_coupon")}),a("salla-button",{key:"9e01ec3c8bd3a28b5dd00d028fd8d0b29a1f0f63",ref:s=>this.couponButtonRef=s,class:"s-cart-coupons-coupon-button "+(this.currentCoupon?"s-cart-coupons-coupon-button-remove":"s-cart-coupons-coupon-button-apply"),color:this.currentCoupon?"danger":"primary",loading:this.isApplying,"loader-position":"center",onClick:()=>this.handleCouponButtonClick()},this.currentCoupon?a("i",{class:"sicon-cancel"}):a("span",null,salla.lang.get("pages.cart.save_coupon")))),this.couponError&&a("span",{key:"0b46e12e0ece78bb96180004a30154cf5229c930",class:"s-cart-coupons-coupon-error"},this.couponError)),this.availableCoupons&&this.availableCoupons.length>0&&a("salla-slider",{key:"6df6dc30d63f8e158ce65392ae682f03d09ee014",type:"carousel",showControls:!1,class:"s-cart-coupons-slider"},a("div",{key:"adc4343bc2f217bdcf03a769b19363a363ca1ccb",slot:"items"},this.availableCoupons.map((s=>this.renderCouponCard(s)))))))}get host(){return o(this)}};c.style="";export{c as salla_cart_coupons}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as l}from"./p-C9LfegwO.js";import{S as s}from"./p-D4oPi1Ov.js";import{S as t}from"./p-8Tsmrwno.js";const e=class{constructor(l){a(this,l),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}))}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 l("div",{onClick:()=>this.setSelectedPrizeItem(a),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==a.id,"s-loyalty-prize-item":!0}},l("img",{class:"s-loyalty-prize-item-image",src:a.image,alt:a.name}),l("div",{class:"s-loyalty-prize-item-title"},a.name),l("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(a.description)),l("div",{class:"s-loyalty-prize-item-points"},a.cost_points," ",salla.lang.get("pages.loyalty_program.point"),l("div",{class:"s-loyalty-prize-item-check"},l("div",null))))}getConfirmationModal(){return[l("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"},l("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),l("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",l("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",l("strong",null,this.selectedItem?.name)," )")),l("div",{class:"s-loyalty-confirmation-actions"},l("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),l("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return l("slot",{name:"points-applied-widget"},l("salla-list-tile",{class:"s-loyalty-after-exchange"},l("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle,"   -   ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),l("div",{slot:"action",class:"s-loyalty-after-exchange-action"},l("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},l("span",{innerHTML:t})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((a=>{this.loyaltyProgram=a.data})).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()}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(){return this.buttonLoading=!0,await salla.loyalty.exchange(this.selectedItem?.id).then((()=>"FREE_PRODUCT"==this.selectedItem.key&&salla.url.is_page("cart")&&window.location.reload())).finally((()=>{this.buttonLoading=!1,this.cancelProcess()}))}render(){return this.prizePoints?this.getAfterExchangeUI():[l("slot",{name:"widget"},this.customerPoints?l("salla-list-tile",{class:"s-loyalty-widget"},l("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:s}),l("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,l("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")))):""),l("salla-modal",{noPadding:!0,width:"sm",ref:a=>this.confirmationModal=a},this.getConfirmationModal()),l("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:a=>this.modal=a},l("div",{slot:"loading"},l("div",{class:"s-loyalty-skeleton"},l("salla-list-tile",{class:"s-loyalty-header"},l("div",{slot:"icon",class:"s-loyalty-header-icon"},l("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),l("div",{slot:"title",class:"s-loyalty-header-title mb-5"},l("salla-skeleton",{height:"15px",width:"50%"})),l("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},l("salla-skeleton",{height:"10px"}),l("salla-skeleton",{height:"10px",width:"75%"}))),l("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>l("div",{class:"s-loyalty-prize-item swiper-slide"},l("salla-skeleton",{height:"9rem"}),l("div",{class:"s-loyalty-prize-item-title"},l("salla-skeleton",{height:"15px",width:"75%"})),l("div",{class:"s-loyalty-prize-item-subtitle"},l("salla-skeleton",{height:"10px",width:"50%"}),l("salla-skeleton",{height:"10px",width:"25%"})),l("div",{class:"s-loyalty-prize-item-points"},l("salla-skeleton",{height:"15px",width:"100px"}),l("div",{class:"s-loyalty-prize-item-check"},l("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[l("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},l("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>'}),l("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),l("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),l("salla-tabs",null,this.loyaltyProgram.prizes.map((a=>l("salla-tab-header",{slot:"header",name:a.title},l("span",null,a.title)))),this.loyaltyProgram.prizes.map(((a,s)=>l("salla-tab-content",{slot:"content",name:a.title},l("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+s,type:"carousel"},l("div",{slot:"items"},a.items.map((a=>this.prizeItem(a))))))))),l("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:l("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?l("span",{slot:"description"},this.errorMessage):""))]}};e.style="";export{e as salla_loyalty}
4
+ import{r as a,h as l}from"./p-BwsreBbG.js";import{S as s}from"./p-D4oPi1Ov.js";import{S as t}from"./p-8Tsmrwno.js";const e=class{constructor(l){a(this,l),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}))}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 l("div",{onClick:()=>this.setSelectedPrizeItem(a),class:{"s-loyalty-prize-item-selected":!!this.selectedItem&&this.selectedItem?.id==a.id,"s-loyalty-prize-item":!0}},l("img",{class:"s-loyalty-prize-item-image",src:a.image,alt:a.name}),l("div",{class:"s-loyalty-prize-item-title"},a.name),l("div",{class:"s-loyalty-prize-item-subtitle"},this.handleLongText(a.description)),l("div",{class:"s-loyalty-prize-item-points"},a.cost_points," ",salla.lang.get("pages.loyalty_program.point"),l("div",{class:"s-loyalty-prize-item-check"},l("div",null))))}getConfirmationModal(){return[l("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"},l("div",{slot:"title",class:"s-loyalty-confirmation-title"},salla.lang.get("pages.loyalty_program.exchange_points")),l("div",{slot:"description"},salla.lang.get("pages.loyalty_program.are_you_sure_to_exchange")," ( ",l("strong",null,this.selectedItem?.cost_points)," ",salla.lang.get("pages.loyalty_program.point")," ) ",salla.lang.get("pages.loyalty_program.for")," ( ",l("strong",null,this.selectedItem?.name)," )")),l("div",{class:"s-loyalty-confirmation-actions"},l("salla-button",{fill:"outline",width:"wide",onClick:()=>this.cancelProcess()},salla.lang.get("pages.loyalty_program.cancellation")),l("salla-button",{loading:this.buttonLoading,width:"wide",onClick:()=>this.exchangeLoyaltyPoint()},salla.lang.get("pages.loyalty_program.confirm")))]}getAfterExchangeUI(){return l("slot",{name:"points-applied-widget"},l("salla-list-tile",{class:"s-loyalty-after-exchange"},l("div",{slot:"title",class:"s-loyalty-after-exchange-title"},this.prizeTitle,"   -   ",this.prizePoints," ",salla.lang.get("pages.loyalty_program.point")),l("div",{slot:"action",class:"s-loyalty-after-exchange-action"},l("salla-button",{class:"s-loyalty-after-exchange-reset",shape:"icon",fill:"outline",color:"danger",size:"small",onClick:()=>this.resetExchange()},l("span",{innerHTML:t})))))}async open(){return this.is_loggedin?(this.modal?.open(),await salla.loyalty.getProgram().then((a=>{this.loyaltyProgram=a.data})).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()}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(){return this.buttonLoading=!0,await salla.loyalty.exchange(this.selectedItem?.id).then((()=>"FREE_PRODUCT"==this.selectedItem.key&&salla.url.is_page("cart")&&window.location.reload())).finally((()=>{this.buttonLoading=!1,this.cancelProcess()}))}render(){return this.prizePoints?this.getAfterExchangeUI():[l("slot",{name:"widget"},this.customerPoints?l("salla-list-tile",{class:"s-loyalty-widget"},l("div",{slot:"icon",class:"s-loyalty-widget-icon",innerHTML:s}),l("div",{slot:"subtitle"},this.customerPoints?salla.lang.get("pages.loyalty_program.cart_total_point_summary",{balance:this.customerPoints}):this.guestMessage,l("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")))):""),l("salla-modal",{noPadding:!0,width:"sm",ref:a=>this.confirmationModal=a},this.getConfirmationModal()),l("salla-modal",{isLoading:!0,"has-skeleton":!0,width:"md",ref:a=>this.modal=a},l("div",{slot:"loading"},l("div",{class:"s-loyalty-skeleton"},l("salla-list-tile",{class:"s-loyalty-header"},l("div",{slot:"icon",class:"s-loyalty-header-icon"},l("salla-skeleton",{type:"circle",height:"6rem",width:"6rem"})),l("div",{slot:"title",class:"s-loyalty-header-title mb-5"},l("salla-skeleton",{height:"15px",width:"50%"})),l("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},l("salla-skeleton",{height:"10px"}),l("salla-skeleton",{height:"10px",width:"75%"}))),l("div",{class:"s-loyalty-skeleton-cards"},[...Array(3)].map((()=>l("div",{class:"s-loyalty-prize-item swiper-slide"},l("salla-skeleton",{height:"9rem"}),l("div",{class:"s-loyalty-prize-item-title"},l("salla-skeleton",{height:"15px",width:"75%"})),l("div",{class:"s-loyalty-prize-item-subtitle"},l("salla-skeleton",{height:"10px",width:"50%"}),l("salla-skeleton",{height:"10px",width:"25%"})),l("div",{class:"s-loyalty-prize-item-points"},l("salla-skeleton",{height:"15px",width:"100px"}),l("div",{class:"s-loyalty-prize-item-check"},l("salla-skeleton",{height:"1rem",width:"1rem",type:"circle"}))))))))),!this.hasError&&this.loyaltyProgram?[l("salla-list-tile",{id:"s-loyalty-header",class:"s-loyalty-header"},l("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>'}),l("div",{slot:"title",class:"s-loyalty-header-title"},this.loyaltyProgram.prize_promotion_title),l("div",{slot:"subtitle",class:"s-loyalty-header-subtitle"},this.loyaltyProgram.prize_promotion_description)),l("salla-tabs",null,this.loyaltyProgram.prizes.map((a=>l("salla-tab-header",{slot:"header",name:a.title},l("span",null,a.title)))),this.loyaltyProgram.prizes.map(((a,s)=>l("salla-tab-content",{slot:"content",name:a.title},l("salla-slider",{class:"s-loyalty-slider",loop:!1,"controls-outer":!0,id:"loyalty-popup-slider-"+s,type:"carousel"},l("div",{slot:"items"},a.items.map((a=>this.prizeItem(a))))))))),l("salla-button",{disabled:!this.selectedItem,width:"wide",class:"s-loyalty-program-redeem-btn",onClick:()=>this.openConfirmation()},salla.lang.get("pages.loyalty_program.exchange_points"))]:l("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?l("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 t,h as i,H as e}from"./p-C9LfegwO.js";var s,a;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product"}(s||(s={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(a||(a={}));const l=class{constructor(i){t(this,i),this.offer=null,this.products={},this.isLoading=!1,this.canRender=!0}componentWillLoad(){salla.onReady().then((()=>{if(!salla.config.get("store.features")?.includes("conditional-offer")||""!==salla.storage.get("cart")&&!salla.storage.get("cart")?.summary?.count)throw new Error("feature or cart object does not existed")})).then((()=>salla.api.cart.offers())).then((({data:t})=>{if(this.offer=t.find((t=>"conditional"===t.type)),this.offer)return this.isLoading=!0,this.offer.details.discounts.unshift({value:0,min_spend:0}),this.updateInitialOfferValue();this.canRender=!1})).then((()=>{if(this.offer)return this.getProducts()})).then((()=>{this.offer&&salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=!1,salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=!1}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t)).filter(Boolean);if(t.length>0)return salla.product.fetch({source:"selected",source_value:t}).then((t=>{const i=t?.data;if(i&&Array.isArray(i)){const t={...this.products};i.forEach((({id:i,url:e,image:s,name:a,price:l})=>{i&&a&&s?.url&&e&&void 0!==l&&(t[i]={url:e,image:s,name:a,price:l})})),this.products=t}}))}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){const e=this.offer.details.based_on===a.PRODUCT_COUNT?t?.reduce(((t,{quantity:i})=>t+i),0)??0:i;return this.offer={...this.offer,details:{...this.offer?.details,current_value:e}},this.offer}renderTooltip(t){const e=t.value,s=this.products[e];return s?i("salla-tooltip",{class:"absolute left-0 -top-2",targetId:`avatar-product-${e}`,theme:"dark"},i("div",{class:"flex gap-3 text-start"},s?.image?.url&&i("img",{src:s.image.url,alt:s?.image?.alt||s.name||"",class:"w-12 h-12 object-cover rounded-lg flex-shrink-0",loading:"lazy",decoding:"async"}),i("div",{class:"flex-1"},i("div",{class:"leading-tight mb-1"},s.name),i("div",{class:"text-xs text-gray-300",innerHTML:salla.money(s.price)})))):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),null)}getCheckpointContent(t){if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return i("span",{innerHTML:salla.money(t.value)});if(t.type!==s.FREE_PRODUCT)return salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`),"";const e=this.products[t.value];return e?i("a",{class:"s-conditional-offer-product-link",href:e.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:e?.image?.alt||"",src:e?.image?.url})):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),"")}getOfferType(t){const i=this.offer.details?.based_on;if(i===a.PRODUCT_COUNT)try{return salla.lang.choice("blocks.header.products_count",t.min_spend)}catch(i){return salla.logger.warn("salla-conditional-offer:: invalid products_count interval",i),`${t.min_spend}`}return i===a.PRODUCT_PURCHASE?salla.money(t.min_spend):(salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${i}`),`${t.min_spend}`)}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,a){const l=(t-i)*(a-s)/(e-i)+s;return l===Number.POSITIVE_INFINITY?100:l===Number.NEGATIVE_INFINITY?0:this.clamp(l,0,100)}getCheckPointView(t,e){const a=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend)),l=this.mapValueRanges(this.offer.details.current_value,this.offer.details.discounts[a-1]?.min_spend??0,t.min_spend,0,100),n=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${l}%`}})),i("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint "+(n?"s-conditional-offer-active-checkpoint":"")},i("div",{class:"s-conditional-offer-item-avatar-content "+(n?"active":""),id:t.type===s.FREE_PRODUCT?`avatar-product-${t.value}`:`avatar-${t.value??e}`},this.products&&this.getCheckpointContent(t)),this.products&&t.type===s.FREE_PRODUCT&&this.renderTooltip(t),i("div",{class:"s-conditional-offer-checkpoint-label "+(n?"active":""),innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":!0,"first-checkpoint":0===e,active:n,hidden:0===e,"sm:block":0===e},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){return this.canRender?this.isLoading?this.getLoadingSkeletonView():this.offer?i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e)))))):null:null}};l.style=":host{display:block}";export{l as salla_conditional_offer}
4
+ import{r as t,h as i,H as e}from"./p-BwsreBbG.js";var s,a;!function(t){t.PERCENTAGE="percentage",t.FIXED="fixed",t.FREE_PRODUCT="free_product"}(s||(s={})),function(t){t.PRODUCT_COUNT="products_count",t.PRODUCT_PURCHASE="order_amount"}(a||(a={}));const l=class{constructor(i){t(this,i),this.offer=null,this.products={},this.isLoading=!1,this.canRender=!0}componentWillLoad(){salla.onReady().then((()=>{if(!salla.config.get("store.features")?.includes("conditional-offer")||""!==salla.storage.get("cart")&&!salla.storage.get("cart")?.summary?.count)throw new Error("feature or cart object does not existed")})).then((()=>salla.api.cart.offers())).then((({data:t})=>{if(this.offer=t.find((t=>"conditional"===t.type)),this.offer)return this.isLoading=!0,this.offer.details.discounts.unshift({value:0,min_spend:0}),this.updateInitialOfferValue();this.canRender=!1})).then((()=>{if(this.offer)return this.getProducts()})).then((()=>{this.offer&&salla.event.on("cart::updated",(t=>this.updateOfferValues(t)))})).catch((t=>{this.canRender=!1,salla.logger.warn("salla-conditional-offer:: ",t)})).finally((()=>{this.isLoading=!1}))}getProducts(){const t=this.offer.details.discounts.filter((({type:t})=>t===s.FREE_PRODUCT)).map((({value:t})=>t)).filter(Boolean);if(t.length>0)return salla.product.fetch({source:"selected",source_value:t}).then((t=>{const i=t?.data;if(i&&Array.isArray(i)){const t={...this.products};i.forEach((({id:i,url:e,image:s,name:a,price:l})=>{i&&a&&s?.url&&e&&void 0!==l&&(t[i]={url:e,image:s,name:a,price:l})})),this.products=t}}))}updateInitialOfferValue(){return salla.api.cart.details().then((({data:{cart:t}})=>this.updateOfferValues(t)))}updateOfferValues({items:t,sub_total:i}){const e=this.offer.details.based_on===a.PRODUCT_COUNT?t?.reduce(((t,{quantity:i})=>t+i),0)??0:i;return this.offer={...this.offer,details:{...this.offer?.details,current_value:e}},this.offer}renderTooltip(t){const e=t.value,s=this.products[e];return s?i("salla-tooltip",{class:"absolute left-0 -top-2",targetId:`avatar-product-${e}`,theme:"dark"},i("div",{class:"flex gap-3 text-start"},s?.image?.url&&i("img",{src:s.image.url,alt:s?.image?.alt||s.name||"",class:"w-12 h-12 object-cover rounded-lg flex-shrink-0",loading:"lazy",decoding:"async"}),i("div",{class:"flex-1"},i("div",{class:"leading-tight mb-1"},s.name),i("div",{class:"text-xs text-gray-300",innerHTML:salla.money(s.price)})))):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),null)}getCheckpointContent(t){if(t.type===s.PERCENTAGE)return`${t.value}%`;if(t.type===s.FIXED)return i("span",{innerHTML:salla.money(t.value)});if(t.type!==s.FREE_PRODUCT)return salla.logger.error(`salla-conditional-offer:: unexpected type (${t.type})!`),"";const e=this.products[t.value];return e?i("a",{class:"s-conditional-offer-product-link",href:e.url},i("img",{class:"s-conditional-offer-checkpoint-image-content",loading:"lazy",decoding:"async",alt:e?.image?.alt||"",src:e?.image?.url})):(salla.logger.error(`salla-conditional-offer:: there is no product with id (${t.value})!`),"")}getOfferType(t){const i=this.offer.details?.based_on;if(i===a.PRODUCT_COUNT)try{return salla.lang.choice("blocks.header.products_count",t.min_spend)}catch(i){return salla.logger.warn("salla-conditional-offer:: invalid products_count interval",i),`${t.min_spend}`}return i===a.PRODUCT_PURCHASE?salla.money(t.min_spend):(salla.logger.warn(`salla-conditional-offer:: Unexpected offer detail's based_on value: ${i}`),`${t.min_spend}`)}clamp(t,i,e){return Math.max(i,Math.min(t,e))}mapValueRanges(t,i,e,s,a){const l=(t-i)*(a-s)/(e-i)+s;return l===Number.POSITIVE_INFINITY?100:l===Number.NEGATIVE_INFINITY?0:this.clamp(l,0,100)}getCheckPointView(t,e){const a=this.offer.details.discounts.findIndex((({min_spend:i})=>i===t.min_spend)),l=this.mapValueRanges(this.offer.details.current_value,this.offer.details.discounts[a-1]?.min_spend??0,t.min_spend,0,100),n=t.min_spend<=this.offer.details.current_value;return i("div",{class:"s-conditional-offer-checkpoint-container"},e>0?[i("div",{key:"progress-line",class:"s-conditional-offer-progress-line-container"},i("div",{class:"s-conditional-offer-progress-line-inactive"}),i("div",{class:"s-conditional-offer-progress-line-active",style:{width:`${l}%`}})),i("div",{key:"checkpoint",class:"s-conditional-offer-checkpoint "+(n?"s-conditional-offer-active-checkpoint":"")},i("div",{class:"s-conditional-offer-item-avatar-content "+(n?"active":""),id:t.type===s.FREE_PRODUCT?`avatar-product-${t.value}`:`avatar-${t.value??e}`},this.products&&this.getCheckpointContent(t)),this.products&&t.type===s.FREE_PRODUCT&&this.renderTooltip(t),i("div",{class:"s-conditional-offer-checkpoint-label "+(n?"active":""),innerHTML:this.getOfferType(t)}))]:i("div",{key:"label",class:{"s-conditional-offer-checkpoint-label":!0,"first-checkpoint":0===e,active:n,hidden:0===e,"sm:block":0===e},innerHTML:this.getOfferType(t)}))}getLoadingSkeletonView(){return i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-skeleton-inner-container"},i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"30%"})),i("div",{class:"s-conditional-offer-skeleton-subtitle"},i("salla-skeleton",{height:"16px",width:"35%"})),i("div",{class:"s-conditional-offer-skeleton-checkpoints-wrapper"},Array(3).fill(null).map((()=>[i("salla-skeleton",{key:"checkpoint-line",height:"8px"}),i("div",{key:"checkpoint"},i("salla-skeleton",{height:"60px",width:"60px",type:"circle"}))])))))}render(){return this.canRender?this.isLoading?this.getLoadingSkeletonView():this.offer?i(e,{class:"s-conditional-offer-container"},i("div",{class:"s-conditional-offer-title-wrapper"},i("div",{class:"s-conditional-offer-title"},this.offer.title),this.offer.description?i("div",{class:"s-conditional-offer-subtitle"},this.offer.description," ",i("i",{class:"sicon-information"})):null),i("div",{class:"s-conditional-offer-progress-container"},this.offer.details.discounts.map(((t,e)=>i("div",{class:{"flex-1":e>0},key:t.min_spend},this.getCheckPointView(t,e)))))):null:null}};l.style=":host{display:block}";export{l as salla_conditional_offer}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as c,H as s,c as e,a as t}from"./p-C9LfegwO.js";import{p as d,m as o}from"./p-DfeagqF1.js";const i=class{constructor(c){a(this,c)}render(){return c(s,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},c("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))}};i.style="";const r=class{constructor(c){a(this,c),this.accordionToggle=e(this,"accordionToggle"),this.collapsible=!1,this.collapsed=!0}emitCollapsePanel(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})}toggleCollapse(){this.collapsible&&(this.collapsed=!this.collapsed,this.host.parentElement?.setAttribute("data-collapsed",this.collapsed.toString()),this.host.parentElement?.querySelector("salla-accordion-body")?.setAttribute("data-collapsed",this.collapsed.toString()),this.emitCollapsePanel())}render(){return c(s,{key:"9d88d243306cdf451c20d7068fbb9f48807b22e9","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},c("div",{key:"bad4c5a913ce1c4581b09c0b6d96fcbdb4236638",class:"s-accordion-head-wrapper-start"},c("slot",{key:"acb83cec8cbca5771a9f84e81c0b955c3edad731",name:"title"}),c("slot",{key:"a4ad42ea6fad4f452c4c218a9ee02dca0adb4a67",name:"progress"}),c("slot",{key:"96ab95d413dc906ac299079f4008816f01881990",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&c("div",{key:"8f9666a5038cd7b1ac6e357c6920ea26d31c5f03",class:"s-accordion-head-wrapper-end"},c("slot",{key:"14895e8c1385e91c14f046c9ae38ce5e4a4c9a60",name:"note"}),this.collapsible&&c("button",{key:"97dc7fabbb207fcc8b68ebf0a86f6c8a980dca13",class:{"s-accordion-head-wrapper-toggle":!0,active:!this.collapsed},onClick:a=>{a.stopPropagation(),this.toggleCollapse()}},c("span",{key:"3b24faf71dcd332663a354310b2ce09f7879eddc",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?d:o}))))}get host(){return t(this)}};r.style="";export{i as salla_accordion_body,r as salla_accordion_head}
4
+ import{r as a,h as c,H as s,c as e,a as t}from"./p-BwsreBbG.js";import{p as d,m as o}from"./p-DfeagqF1.js";const r=class{constructor(c){a(this,c)}render(){return c(s,{key:"298d42a5bf1bcefdb181ec35060220cf749b56ed",class:"s-accordion-body-wrapper"},c("slot",{key:"6ab081e8b71b5dc69fb66fbdec82b4725ab53b0d"}))}};r.style="";const i=class{constructor(c){a(this,c),this.accordionToggle=e(this,"accordionToggle"),this.collapsible=!1,this.collapsed=!0}emitCollapsePanel(){this.accordionToggle.emit({payload:{collapsed:this.collapsed}})}toggleCollapse(){this.collapsible&&(this.collapsed=!this.collapsed,this.host.parentElement?.setAttribute("data-collapsed",this.collapsed.toString()),this.host.parentElement?.querySelector("salla-accordion-body")?.setAttribute("data-collapsed",this.collapsed.toString()),this.emitCollapsePanel())}render(){return c(s,{key:"9d88d243306cdf451c20d7068fbb9f48807b22e9","data-collapsed":this.collapsed.toString(),onClick:()=>this.toggleCollapse(),class:"s-accordion-head-wrapper"},c("div",{key:"bad4c5a913ce1c4581b09c0b6d96fcbdb4236638",class:"s-accordion-head-wrapper-start"},c("slot",{key:"acb83cec8cbca5771a9f84e81c0b955c3edad731",name:"title"}),c("slot",{key:"a4ad42ea6fad4f452c4c218a9ee02dca0adb4a67",name:"progress"}),c("slot",{key:"96ab95d413dc906ac299079f4008816f01881990",name:"html"})),(this.collapsible||this.host.querySelector('[slot="note"]'))&&c("div",{key:"8f9666a5038cd7b1ac6e357c6920ea26d31c5f03",class:"s-accordion-head-wrapper-end"},c("slot",{key:"14895e8c1385e91c14f046c9ae38ce5e4a4c9a60",name:"note"}),this.collapsible&&c("button",{key:"97dc7fabbb207fcc8b68ebf0a86f6c8a980dca13",class:{"s-accordion-head-wrapper-toggle":!0,active:!this.collapsed},onClick:a=>{a.stopPropagation(),this.toggleCollapse()}},c("span",{key:"3b24faf71dcd332663a354310b2ce09f7879eddc",class:"s-accordion-head-wrapper-toggle-icon",innerHTML:this.collapsed?d:o}))))}get host(){return t(this)}};i.style="";export{r as salla_accordion_body,i as salla_accordion_head}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,c as e,h as i}from"./p-C9LfegwO.js";import{C as t}from"./p-C6jIkM-X.js";import{F as l}from"./p-OF8QcbMM.js";const a=class{constructor(i){s(this,i),this.fieldChanged=e(this,"fieldChanged"),this.fileUploaded=e(this,"fileUploaded"),this.isEditable=!0,this.fieldErrors={},this.isSubmitting=!1}get dragAndDropText(){return salla.lang.get("common.uploader.drag_and_drop")}get browseText(){return salla.lang.get("common.uploader.browse")}get saveButtonText(){return salla.lang.get("common.elements.save")}async setFields(s){this.parsedFields=s}async getFieldValues(){return this.parsedFields?.reduce(((s,e)=>(s[`custom_fields[${e.id}]`]=e.value,s)),{})||{}}async validateFields(){if(!this.parsedFields)return!0;const s=this.parsedFields.reduce(((s,e)=>(!e.required||e.value&&""!==e.value||(s[e.id.toString()]=`${e.label} is required`),s)),{});return this.fieldErrors=s,0===Object.keys(s).length}handleFieldChange(s,e){const i=e.target.value;s.value=i,this.clearFieldError(s.id);const t=!(s.required&&!i);t||this.setFieldError(s.id,`${s.label} is required`),this.fieldChanged.emit({fieldId:s.id,value:i,isValid:t})}handleFileUpload(s,e){const{error:i,file:t}=e.detail,l=!i;this.clearFieldError(s.id),l?s.value=t:this.setFieldError(s.id,"File upload failed"),this.fileUploaded.emit({fieldId:s.id,file:t,isValid:l})}clearFieldError(s){this.fieldErrors={...this.fieldErrors},delete this.fieldErrors[s]}setFieldError(s,e){this.fieldErrors={...this.fieldErrors,[s]:e}}renderTextField(s){return i("input",{disabled:!this.isEditable,type:s.type,id:`custom-field-${s.id}`,value:s.value?.toString()||"",onChange:e=>this.handleFieldChange(s,e),name:`${s.id}`,class:"form-input",required:s.required})}renderFileField(s){return i("salla-file-upload",{url:salla.url.api("upload"),id:`custom-field-${s.id}`,name:`${s.id}`,type:"registration",value:s.value,height:"120px",onAdded:e=>this.handleFileUpload(s,e),required:s.required,disabled:!this.isEditable,onUploaded:s=>{s.target.value=s.target.value?.url},allowRemove:!0,onRemoved:e=>{e.preventDefault(),e.stopPropagation(),s.value="",e.target.value=""},payloadName:"files[]",payloadParams:{type:"registration"},"instant-upload":!0},i("div",{class:"s-custom-fields-filepond-placeholder"},i("span",{class:"s-custom-fields-filepond-placeholder-icon"},i("i",{innerHTML:t})),i("p",{class:"s-custom-fields-filepond-placeholder-text"},this.dragAndDropText),i("span",{class:"filepond--label-action"},this.browseText)))}renderField(s){return i("div",{class:"s-custom-fields-field",key:s.id},i("label",{class:"s-custom-fields-field-label",htmlFor:`custom-field-${s.id}`},s.label,s.required&&i("span",{class:"s-custom-fields-required"},"*")),i("div",null,s.type===l.Photo?this.renderFileField(s):this.renderTextField(s),this.fieldErrors[s.id]&&i("p",{class:"s-custom-fields-error"},this.fieldErrors[s.id])))}componentWillLoad(){this.parsedFields=this.parseFields(this.fields)}parseFields(s){return s?"string"==typeof s?JSON.parse(s):Array.isArray(s)?s:[]:[]}async handleSubmit(s){s.preventDefault(),this.isSubmitting=!0;try{const e={},i=s.target.elements;for(let s=0;s<i.length;s++){const t=i[s];t.name&&!t.name.startsWith("hidden")&&t.value&&(e[t.name]=t.value)}await salla.api.profile.updateCustomFields({id:salla.config.get("store.id"),fields:e})}finally{this.isSubmitting=!1}}render(){return this.parsedFields?.length?i("form",{class:"s-custom-fields-wrapper",onSubmit:this.handleSubmit},this.parsedFields.map((s=>this.renderField(s))),i("salla-button",{type:"submit",loading:this.isSubmitting,disabled:this.isSubmitting||!this.isEditable,"loader-position":"end",class:"s-custom-fields-submit-btn"},this.saveButtonText)):null}};a.style=":host{display:block}";export{a as salla_custom_fields}
4
+ import{r as s,c as e,h as i}from"./p-BwsreBbG.js";import{C as t}from"./p-C6jIkM-X.js";import{F as l}from"./p-OF8QcbMM.js";const a=class{constructor(i){s(this,i),this.fieldChanged=e(this,"fieldChanged"),this.fileUploaded=e(this,"fileUploaded"),this.isEditable=!0,this.fieldErrors={},this.isSubmitting=!1}get dragAndDropText(){return salla.lang.get("common.uploader.drag_and_drop")}get browseText(){return salla.lang.get("common.uploader.browse")}get saveButtonText(){return salla.lang.get("common.elements.save")}async setFields(s){this.parsedFields=s}async getFieldValues(){return this.parsedFields?.reduce(((s,e)=>(s[`custom_fields[${e.id}]`]=e.value,s)),{})||{}}async validateFields(){if(!this.parsedFields)return!0;const s=this.parsedFields.reduce(((s,e)=>(!e.required||e.value&&""!==e.value||(s[e.id.toString()]=`${e.label} is required`),s)),{});return this.fieldErrors=s,0===Object.keys(s).length}handleFieldChange(s,e){const i=e.target.value;s.value=i,this.clearFieldError(s.id);const t=!(s.required&&!i);t||this.setFieldError(s.id,`${s.label} is required`),this.fieldChanged.emit({fieldId:s.id,value:i,isValid:t})}handleFileUpload(s,e){const{error:i,file:t}=e.detail,l=!i;this.clearFieldError(s.id),l?s.value=t:this.setFieldError(s.id,"File upload failed"),this.fileUploaded.emit({fieldId:s.id,file:t,isValid:l})}clearFieldError(s){this.fieldErrors={...this.fieldErrors},delete this.fieldErrors[s]}setFieldError(s,e){this.fieldErrors={...this.fieldErrors,[s]:e}}renderTextField(s){return i("input",{disabled:!this.isEditable,type:s.type,id:`custom-field-${s.id}`,value:s.value?.toString()||"",onChange:e=>this.handleFieldChange(s,e),name:`${s.id}`,class:"form-input",required:s.required})}renderFileField(s){return i("salla-file-upload",{url:salla.url.api("upload"),id:`custom-field-${s.id}`,name:`${s.id}`,type:"registration",value:s.value,height:"120px",onAdded:e=>this.handleFileUpload(s,e),required:s.required,disabled:!this.isEditable,onUploaded:s=>{s.target.value=s.target.value?.url},allowRemove:!0,onRemoved:e=>{e.preventDefault(),e.stopPropagation(),s.value="",e.target.value=""},payloadName:"files[]",payloadParams:{type:"registration"},"instant-upload":!0},i("div",{class:"s-custom-fields-filepond-placeholder"},i("span",{class:"s-custom-fields-filepond-placeholder-icon"},i("i",{innerHTML:t})),i("p",{class:"s-custom-fields-filepond-placeholder-text"},this.dragAndDropText),i("span",{class:"filepond--label-action"},this.browseText)))}renderField(s){return i("div",{class:"s-custom-fields-field",key:s.id},i("label",{class:"s-custom-fields-field-label",htmlFor:`custom-field-${s.id}`},s.label,s.required&&i("span",{class:"s-custom-fields-required"},"*")),i("div",null,s.type===l.Photo?this.renderFileField(s):this.renderTextField(s),this.fieldErrors[s.id]&&i("p",{class:"s-custom-fields-error"},this.fieldErrors[s.id])))}componentWillLoad(){this.parsedFields=this.parseFields(this.fields)}parseFields(s){return s?"string"==typeof s?JSON.parse(s):Array.isArray(s)?s:[]:[]}async handleSubmit(s){s.preventDefault(),this.isSubmitting=!0;try{const e={},i=s.target.elements;for(let s=0;s<i.length;s++){const t=i[s];t.name&&!t.name.startsWith("hidden")&&t.value&&(e[t.name]=t.value)}await salla.api.profile.updateCustomFields({id:salla.config.get("store.id"),fields:e})}finally{this.isSubmitting=!1}}render(){return this.parsedFields?.length?i("form",{class:"s-custom-fields-wrapper",onSubmit:this.handleSubmit},this.parsedFields.map((s=>this.renderField(s))),i("salla-button",{type:"submit",loading:this.isSubmitting,disabled:this.isSubmitting||!this.isEditable,"loader-position":"end",class:"s-custom-fields-submit-btn"},this.saveButtonText)):null}};a.style=":host{display:block}";export{a as salla_custom_fields}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as a,H as s}from"./p-C9LfegwO.js";const c=class{constructor(a){e(this,a),this.translationLoaded=!1,this.icon='\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>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return a(s,{key:"85a52f39cc2012ca1a3c6d143d06b81981d761aa",class:this.alignmentClass()},a("div",{key:"35be844bc3883f3451344bbeedb4b24f9c218f7a",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),a("div",{key:"58152da7774e79fdb09465087b741212a3982cf2",class:"s-placeholder-title"},a("slot",{key:"f9953085b498043920fd03ae44a082e0fb1a02d2",name:"title"},a("span",{key:"989633e3165d187c6d3b36e0cdfa2cb10466c6da"},salla.lang.get("common.elements.no_options")))),a("div",{key:"bfbcbb5a2f9561292e5a6850eb43f5bfea8bd040",class:"s-placeholder-description"},a("slot",{key:"4592587daaaa41c67cd7670eea7d5e7e3d8635d7",name:"description"},a("span",{key:"4b1e3c4a453b8dbc5139b40ebddb94d8c2d1c465"},salla.lang.get("common.errors.empty_results")))))}};c.style="";export{c as salla_placeholder}
4
+ import{r as e,h as s,H as a}from"./p-BwsreBbG.js";const c=class{constructor(s){e(this,s),this.translationLoaded=!1,this.icon='\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>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md",salla.lang.onLoaded((()=>{this.translationLoaded=!0}))}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return s(a,{key:"85a52f39cc2012ca1a3c6d143d06b81981d761aa",class:this.alignmentClass()},s("div",{key:"35be844bc3883f3451344bbeedb4b24f9c218f7a",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),s("div",{key:"58152da7774e79fdb09465087b741212a3982cf2",class:"s-placeholder-title"},s("slot",{key:"f9953085b498043920fd03ae44a082e0fb1a02d2",name:"title"},s("span",{key:"989633e3165d187c6d3b36e0cdfa2cb10466c6da"},salla.lang.get("common.elements.no_options")))),s("div",{key:"bfbcbb5a2f9561292e5a6850eb43f5bfea8bd040",class:"s-placeholder-description"},s("slot",{key:"4592587daaaa41c67cd7670eea7d5e7e3d8635d7",name:"description"},s("span",{key:"4b1e3c4a453b8dbc5139b40ebddb94d8c2d1c465"},salla.lang.get("common.errors.empty_results")))))}};c.style="";export{c as salla_placeholder}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as o,a as e}from"./p-C9LfegwO.js";const i=class{constructor(o){t(this,o),this.theme="default",this.show=!1,this.targetElement=null}handleMouseOver(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!0)}handleMouseOut(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!1)}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){const t=["default","dark"].includes(this.theme)?this.theme:"default";return o("div",{key:"e5e8f78265e0abb1d4130fd084573c6cff1ecb2c",class:"s-tooltip-container"},o("div",{key:"4dc98906dfd28c6e2d97b51329c07046eb15179c",class:`s-tooltip-item s-tooltip-item--${t}`,style:{display:this.show?"block":"none"}},this.text?o("span",null,this.text):o("slot",null)))}get el(){return e(this)}};i.style='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}';export{i as salla_tooltip}
4
+ import{r as t,h as o,a as e}from"./p-BwsreBbG.js";const i=class{constructor(o){t(this,o),this.theme="default",this.show=!1,this.targetElement=null}handleMouseOver(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!0)}handleMouseOut(t){this.targetElement&&this.targetElement.contains(t.target)&&(this.show=!1)}componentDidLoad(){this.targetElement=document.getElementById(this.targetId)}render(){const t=["default","dark"].includes(this.theme)?this.theme:"default";return o("div",{key:"e5e8f78265e0abb1d4130fd084573c6cff1ecb2c",class:"s-tooltip-container"},o("div",{key:"4dc98906dfd28c6e2d97b51329c07046eb15179c",class:`s-tooltip-item s-tooltip-item--${t}`,style:{display:this.show?"block":"none"}},this.text?o("span",null,this.text):o("slot",null)))}get el(){return e(this)}};i.style='.s-tooltip-container{position:relative;display:inline-block}.s-tooltip-item{position:absolute;transform:translateX(-39%);background-color:#baf3e6;color:#004d5a;bottom:100%;left:50%;text-align:center;border-radius:5px;z-index:1;white-space:nowrap;opacity:0;transition:opacity 0.3s;pointer-events:none;margin:0 0 16px 8px;padding:12px;max-width:150px;width:190px;white-space:normal;opacity:1}.s-tooltip-item::after{content:"";position:absolute;bottom:-10px;left:50%;margin-left:-5px;border-width:5px;border-style:solid;border-color:#baf3e6 transparent transparent transparent}.s-tooltip-item:dir(ltr){transform:translateX(-72%)}.s-tooltip-item--dark{background-color:#555555;color:white;padding:5px 15px;border-radius:8px;font-size:12px;font-weight:normal;max-width:330px;width:max-content}.s-tooltip-item--dark::after{border-color:#555555 transparent transparent transparent}';export{i as salla_tooltip}
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import{r as s,h as e,H as i,a as t}from"./p-BwsreBbG.js";function l(s,e){localStorage.getItem("salla-delivery-promise-debug")&&(void 0!==e?console.log(s,e):console.log(s))}function r(){const s=(Boolean(salla.config.get("store.settings.bullet_delivery.settings.remember_last_session"))?salla.storage.store:salla.storage.session).get("bullet_delivery_intent");return s&&"object"==typeof s?s:null}const a={deliveryTo:"توصيل إلى",pickupFromBranch:"الاستلام من فرع",noResults:"لا توجد نتائج",selectCity:"اختر المدينة",changeCityTitle:"تغيير المدينة",changeCitySubtitle:"",cityFieldLabel:"المدينة",modalSearchPlaceholder:"ابحث عن مدينة",confirmAddress:"تأكيد العنوان",errorDeliveryPromise:"لا يتوفر وعد تسليم لهذه المدينة",errorPickupPromise:"لا يتوفر وعد تسليم لهذا الفرع"};function o(s){const e=salla.config.get("user.language_code");return e&&"ar"!==e&&s.name_en?.trim()?s.name_en.trim():s.name}const n=class{constructor(e){s(this,e),this.isDeliveryPromiseEnabled=!1,this.isLoginCycleEnabled=!1,this.canRender=!1,this.labels=a,this.selectedLabel=null,this.deliveryMessage=null,this.hasError=!1,this.errorMessage="",this.isLoadingPromises=!1,this.selectedCityLoginCycle=null,this.selectedBranchLoginCycle=null,this.cities=[],this.selectedCity=null,this.isLoadingCities=!1,this.modalSearchQuery="",this.cityPendingSelection=null,this.isCityPopoverOpen=!1,this.onBulletDeliveryConfirmed=()=>{this.applyBulletIntent()},this.handleModalSearchInput=s=>{this.modalSearchQuery=s.target.value,this.isCityPopoverOpen=!0},this.handleModalComboboxActivate=()=>{this.isCityPopoverOpen=!0},this.handleHeaderClick=s=>{s.stopPropagation(),this.isLoginCycleEnabled?this.openBulletDeliveryModal():this.openCityChangeModal()}}async componentDidLoad(){await salla.onReady(),await salla.lang.onLoaded(),this.labels={deliveryTo:salla.lang.getWithDefault("pages.products.promise_deliver_to",a.deliveryTo),pickupFromBranch:salla.lang.getWithDefault("pages.products.promise_pickup_from_branch",a.pickupFromBranch),noResults:salla.lang.getWithDefault("common.elements.no_options",a.noResults),selectCity:salla.lang.getWithDefault("common.elements.select_city",a.selectCity),changeCityTitle:salla.lang.getWithDefault("pages.products.promise_change_city_title",a.changeCityTitle),changeCitySubtitle:salla.lang.getWithDefault("pages.products.promise_change_city_subtitle","قد تتغيّر مدة التوصيل حسب المدينة."),cityFieldLabel:salla.lang.getWithDefault("pages.products.promise_city_field",a.cityFieldLabel),modalSearchPlaceholder:salla.lang.getWithDefault("pages.products.promise_search_city",a.modalSearchPlaceholder),confirmAddress:salla.lang.getWithDefault("pages.checkout.confirm_address",a.confirmAddress),errorDeliveryPromise:salla.lang.getWithDefault("pages.products.promise_delivery_not_available",a.errorDeliveryPromise),errorPickupPromise:salla.lang.getWithDefault("pages.products.promise_pickup_not_available",a.errorPickupPromise)},this.isDeliveryPromiseEnabled=salla.config.get("store.features",[]).includes("delivery-promises"),this.isLoginCycleEnabled=salla.config.get("store.features",[]).includes("bullet-delivery-v2"),this.productId=salla.config.get("page.id"),this.isDeliveryPromiseEnabled?this.isLoginCycleEnabled?(this.applyBulletIntent(),this.canRender=!0,window.addEventListener("bulletDeliveryConfirmed",this.onBulletDeliveryConfirmed)):(this.selectedLabel=`${this.labels.deliveryTo} ${this.labels.selectCity}`,await this.loadCities()):this.canRender=!1}disconnectedCallback(){window.removeEventListener("bulletDeliveryConfirmed",this.onBulletDeliveryConfirmed)}applyBulletIntent(){const s=function(){const s=r();if(!s)return null;if("address"===s.type){const e=s.address_details?.city,i=null!=e?.id?Number(e.id):null!=s.city_id?Number(s.city_id):null,t=e?.name?.trim()||"";return null!=i?{type:"address",option:{id:i,name:t}}:null}if("branch"===s.type){const e=null!=s.branch_id?Number(s.branch_id):null!=s.branch_details?.id?Number(s.branch_details.id):null,i=s.branch_details?.name?.trim()||"";return null!=e?{type:"branch",option:{id:e,name:i}}:null}return null}();if(!s)return this.selectedLabel=`${this.labels.deliveryTo} ${this.labels.selectCity}`,this.selectedCityLoginCycle=null,this.selectedBranchLoginCycle=null,void(this.deliveryMessage=null);"address"===s.type?(this.selectedCityLoginCycle=s.option,this.selectedBranchLoginCycle=null,this.selectedLabel=`${this.labels.deliveryTo} ${s.option.name||this.labels.selectCity}`,this.loadDeliveryMessage(s.option.id,"city")):(this.selectedBranchLoginCycle=s.option,this.selectedCityLoginCycle=null,this.selectedLabel=`${this.labels.pickupFromBranch} ${s.option.name}`,this.loadDeliveryMessage(s.option.id,"branch"))}openBulletDeliveryModal(){salla.event.emit("salla::bullet-delivery.modal.open.requested",function(){const s=r(),e={};if("address"===s?.type&&null!=s.address_id&&(e.preselected_address_id=Number(s.address_id)),"branch"===s?.type){const i=s.branch_id??s.branch_details?.id;null!=i&&(e.preselected_branch_id=Number(i))}return e}())}async loadCities(){this.isLoadingCities=!0,this.hasError=!1;try{const{cities:s,preselected:e}=await async function(s){l("fetchCities start",{productId:s});const e=await salla.api.request(salla.url.api(`products/${s}/delivery-promises/cities`));if(!e.success||!Array.isArray(e.data)||0===e.data.length)return l("fetchCities: no data",{response:e}),{cities:[],preselected:void 0};const i=e.data.find((s=>s.is_selected));return l("fetchCities success",{count:e.data.length,preselected:i}),{cities:e.data,preselected:i}}(this.productId);if(0===s.length)return void(this.canRender=!1);this.cities=s,e&&(this.selectedCity=e,this.selectedLabel=`${this.labels.deliveryTo} ${o(e)}`,await this.loadDeliveryMessage(e.id,"city")),this.canRender=!0}catch(s){this.hasError=!0,this.errorMessage=s.message||"Failed to load cities",this.canRender=!1}finally{this.isLoadingCities=!1}}async loadDeliveryMessage(s,e){this.isLoadingPromises=!0,this.hasError=!1,this.deliveryMessage=null;try{this.deliveryMessage=await async function(s,e,i,t){l("fetchDeliveryMessage start",{productId:s,id:e,optionType:i});let r="";r="city"!==i||t?`?reference_id=${e}&reference_type=${i}`:`?reference_id=${e}`;const a=await salla.api.withoutNotifier((()=>salla.api.request(salla.url.api(`products/${s}/delivery-promises${r}`))));if(!a.success)throw l("fetchDeliveryMessage error",{response:a}),new Error(a.error?.message||"Failed to fetch delivery promise");const o=a.data?.message?.trim();return l("fetchDeliveryMessage success",{message:o}),o||null}(this.productId,s,e,this.isLoginCycleEnabled)}catch(s){this.hasError=!0,this.errorMessage="city"===e?this.labels.errorDeliveryPromise:this.labels.errorPickupPromise}finally{this.isLoadingPromises=!1}}async openCityChangeModal(){this.cityModalRef&&(this.cityPendingSelection=null,this.modalSearchQuery="",this.isCityPopoverOpen=!1,await this.cityModalRef.setTitle(this.labels.changeCityTitle),await this.cityModalRef.open())}handleModalSelectCity(s){this.cityPendingSelection=s,this.modalSearchQuery=o(s),this.isCityPopoverOpen=!1}async handleConfirmCityModal(){if(!this.cityPendingSelection)return void await(this.cityModalRef?.close());const s=this.cityPendingSelection;this.selectedCity=s,this.selectedLabel=`${this.labels.deliveryTo} ${o(s)}`,await this.loadDeliveryMessage(s.id,"city"),await(this.cityModalRef?.close())}renderLoadingSkeleton(){return e(i,{class:"s-delivery-promise-wrapper s-delivery-promise-skeleton"},e("div",{class:"s-delivery-promise-container"},e("div",{class:"s-delivery-promise-header s-delivery-promise-header-skeleton"},e("div",{class:"s-delivery-promise-location"},e("salla-skeleton",{height:"14px",width:"180px"})),e("salla-skeleton",{height:"18px",width:"18px"})),e("div",{class:"s-delivery-promise-loading"},e("salla-skeleton",{height:"20px",width:"80%"}))))}renderDeliveryMessage(){return this.isLoadingPromises?e("div",{class:"s-delivery-promise-loading"},e("salla-skeleton",{height:"20px",width:"80%"})):this.deliveryMessage?e("div",{class:"s-delivery-promise-message"},this.deliveryMessage):null}renderCityModalBody(){const s=function(s,e){const i=e.trim().toLowerCase();return i?s.filter((s=>s.name.toLowerCase().includes(i)||(s.name_en||"").toLowerCase().includes(i))):[...s]}(this.cities,this.modalSearchQuery);return e("div",{class:"s-delivery-promise-modal-body"},e("label",{class:"s-delivery-promise-modal-field-label",htmlFor:"s-delivery-promise-modal-search"},this.labels.cityFieldLabel,e("span",{class:"s-delivery-promise-required","aria-hidden":"true"}," *")),e("div",{class:"s-delivery-promise-modal-combobox"},e("div",{class:"s-delivery-promise-modal-search",onClick:this.handleModalComboboxActivate},e("i",{class:"sicon-search","aria-hidden":"true"}),e("input",{id:"s-delivery-promise-modal-search",type:"text",class:"form-input",placeholder:this.labels.modalSearchPlaceholder,value:this.modalSearchQuery,onInput:this.handleModalSearchInput,autocomplete:"off","aria-autocomplete":"list","aria-expanded":this.isCityPopoverOpen?"true":"false","aria-controls":"s-delivery-promise-modal-listbox"})),e("div",{id:"s-delivery-promise-modal-listbox",class:"s-delivery-promise-modal-popover",role:"listbox",hidden:!this.isCityPopoverOpen},e("div",{class:"s-delivery-promise-modal-list s-scrollbar"},0===s.length?e("div",{class:"s-delivery-promise-modal-empty"},this.labels.noResults):s.map((s=>e("button",{key:s.id,type:"button",role:"option",class:{"s-delivery-promise-modal-item":!0,"s-delivery-promise-modal-item--selected":this.cityPendingSelection?.id===s.id},"aria-selected":this.cityPendingSelection?.id===s.id?"true":"false",onClick:e=>{e.stopPropagation(),this.handleModalSelectCity(s)}},e("span",{class:"s-delivery-promise-modal-item-name"},s.name),this.cityPendingSelection?.id===s.id?e("i",{class:"sicon-check","aria-hidden":"true"}):null)))))))}renderCityChangeModal(){return this.isLoginCycleEnabled?null:e("salla-modal",{id:"s-delivery-promise-city-modal",ref:s=>{this.cityModalRef=s},class:"s-delivery-promise-city-modal",isClosable:!0,width:"md","modal-title":this.labels.changeCityTitle,subTitle:this.labels.changeCitySubtitle},this.renderCityModalBody(),e("salla-button",{slot:"footer",width:"wide",disabled:!this.cityPendingSelection,onClick:()=>this.handleConfirmCityModal()},!this.isLoadingPromises&&this.labels.confirmAddress))}render(){return this.isDeliveryPromiseEnabled?this.isLoadingCities?this.renderLoadingSkeleton():this.canRender?e(i,{class:"s-delivery-promise-wrapper"},e("div",{class:"s-delivery-promise-container"},e("div",{class:"s-delivery-promise-header",onClick:this.handleHeaderClick},e("div",{class:"s-delivery-promise-location"},e("span",{class:"s-delivery-promise-title"},this.selectedLabel)),e("i",{class:"sicon-keyboard_arrow_down s-delivery-promise-arrow"})),this.hasError&&e("div",{class:"s-delivery-promise-error"},this.errorMessage),!this.hasError&&this.renderDeliveryMessage()),this.renderCityChangeModal()):null:null}get host(){return t(this)}};export{n as salla_delivery_promise}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,c as t,h as i,H as e,a as h}from"./p-C9LfegwO.js";import{S as r}from"./p-DLNIOD9t.js";const l=class{constructor(i){s(this,i),this.verified=t(this,"verified"),this.translationLoaded=!1,this.display="modal",this.type="mobile",this.autoReload=!0,this.supportWebAuth=!0,this.resendAfter=30,this.isProfileVerify=!1,salla.lang.onLoaded((()=>{this.translationLoaded=!0,this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type),this.modal?.setTitle(this.title)})),"inline"!=this.display?(salla.event.on("profile::verification",(s=>{let t=Array.isArray(s)?s[0]:s;this.isProfileVerify=!0,this.open(t),this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type),this.modal?.setTitle(this.title)})),salla.event.on("modalClosed",(()=>{this.resendAfter=0,this.timer.innerHTML="30 : 00"}))):this.modal={open:()=>"",close:()=>"",setTitle:()=>""}}splitNumber(s){this.resetError();let t=s.data||s.target.value;t&&1!==t.length&&this.modifyNext(s.target,t)}modifyNext(s,t){s.value=t[0],t=t.substring(1),s.nextElementSibling&&t.length?this.modifyNext(s.nextElementSibling,t):s.nextElementSibling||0!==t.length?s.nextElementSibling&&0===t.length&&s.nextElementSibling.focus():s.focus()}checkAllInputs(){let s=!0;for(let t=0;t<this.otpInputs.length;t++)""===this.otpInputs[t].value&&(s=!1);return s}handleKeyUp(s){if(this.resetError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(s.key))return;let t=s.keyCode||s.charCode;s.target.value?(s.target.nextElementSibling?.focus(),s.target.nextElementSibling?.select()):[8,46].includes(t)&&(s.target.previousElementSibling?.focus(),s.target.previousElementSibling?.select()),s.target.value.length>1&&this.splitNumber(s)}handlePaste(s){this.resetError();let t=(salla.helpers.number(s.clipboardData.getData("text"))||"").replace(/[^0-9]/g,"");t=t.substring(0,this.otpInputs.length),this.otpInputs.forEach((s=>s.value="")),this.modifyNext(this.otpInputs[0],t)}handleInput(s){this.resetError(),salla.helpers.inputDigitsOnly(s.target),this.checkAllInputs()&&setTimeout((()=>{this.toggleOTPSubmit()}),100)}resetError(){this.hasError=!1,this.errorMessage=""}handleFocus(s){s.target!==this.firstOtpInput&&(""==this.firstOtpInput?.value&&this.firstOtpInput.focus(),""==s.target.previousElementSibling.value&&s.target.previousElementSibling.focus())}async getCode(){return this.code.value}async open(s){this.data=s,this.data.type=this.data.type||this.type,this.type=this.data.type,this.resendTimer(),this.otpInputs=this.body.querySelectorAll(".s-verify-input"),this.firstOtpInput=this.body.querySelector("#otp-1"),this.reset(),this.resetError(),"modal"==this.display&&this.modal?.setTitle(this.title),this.modal.open(),this.firstOtpInput?.addEventListener("input",(s=>this.splitNumber(s))),setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let s=[];if(this.otpInputs.forEach((t=>t.value&&s.push(t.value))),this.code.value=s.join(""),4===s.length)return this.btn.disable(),void this.btn.click();this.btn.enable()}reset(){this.otpInputs.forEach((s=>s.value="")),this.code.value="",this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block",this.resend.style.display="none",this.resendAfter=30;let s=setInterval((()=>{this.resendAfter<=0?(clearInterval(s),this.resend.style.display="block",this.resendMessage.style.display="none"):(this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`,this.resendAfter--)}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value="")),this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4)return this.otpInputs[this.code.value.length].focus(),void salla.log("Trying to submit without 4 digits!");let s={code:this.code.value,...this.data};return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,this.supportWebAuth))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((s=>{this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"),s.response?salla.logger.error(s):console.log("Unexpected error",s),this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return"inline"==this.display?i(e,null,this.myBody()):i("salla-modal",{width:"xs",class:"s-verify",ref:s=>this.modal=s,"modal-title":this.title},i("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:"mobile"==this.type?'\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>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n':r}),this.myBody())}myBody(){return i("div",{class:"s-verify-body",ref:s=>this.body=s},i("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),i("slot",{name:"mobile"}),i("slot",{name:"email"}),i("input",{type:"hidden",name:"code",maxlength:"4",required:!0,ref:s=>this.code=s}),i("div",{class:{"s-verify-codes":!0,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((s=>i("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:`otp-${s}`,class:{"s-verify-input":!0,"s-has-error":this.hasError},onInput:s=>this.handleInput(s),onPaste:s=>this.handlePaste(s),onKeyUp:s=>this.handleKeyUp(s),onFocus:s=>this.handleFocus(s),required:!0})))),this.hasError&&this.errorMessage?i("span",{class:"s-verify-error-message"},this.errorMessage):"",i("div",{slot:"footer",class:"s-verify-footer"},i("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:!0,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),i("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),i("b",{class:"s-verify-timer",ref:s=>this.timer=s})),i("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),i("slot",{name:"after-footer"}))}get host(){return h(this)}};l.style="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";export{l as salla_verify}
4
+ import{r as s,c as t,h as i,H as e,a as h}from"./p-BwsreBbG.js";import{S as r}from"./p-DLNIOD9t.js";const l=class{constructor(i){s(this,i),this.verified=t(this,"verified"),this.translationLoaded=!1,this.display="modal",this.type="mobile",this.autoReload=!0,this.supportWebAuth=!0,this.resendAfter=30,this.isProfileVerify=!1,salla.lang.onLoaded((()=>{this.translationLoaded=!0,this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type),this.modal?.setTitle(this.title)})),"inline"!=this.display?(salla.event.on("profile::verification",(s=>{let t=Array.isArray(s)?s[0]:s;this.isProfileVerify=!0,this.open(t),this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+t.type),this.modal?.setTitle(this.title)})),salla.event.on("modalClosed",(()=>{this.resendAfter=0,this.timer.innerHTML="30 : 00"}))):this.modal={open:()=>"",close:()=>"",setTitle:()=>""}}splitNumber(s){this.resetError();let t=s.data||s.target.value;t&&1!==t.length&&this.modifyNext(s.target,t)}modifyNext(s,t){s.value=t[0],t=t.substring(1),s.nextElementSibling&&t.length?this.modifyNext(s.nextElementSibling,t):s.nextElementSibling||0!==t.length?s.nextElementSibling&&0===t.length&&s.nextElementSibling.focus():s.focus()}checkAllInputs(){let s=!0;for(let t=0;t<this.otpInputs.length;t++)""===this.otpInputs[t].value&&(s=!1);return s}handleKeyUp(s){if(this.resetError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(s.key))return;let t=s.keyCode||s.charCode;s.target.value?(s.target.nextElementSibling?.focus(),s.target.nextElementSibling?.select()):[8,46].includes(t)&&(s.target.previousElementSibling?.focus(),s.target.previousElementSibling?.select()),s.target.value.length>1&&this.splitNumber(s)}handlePaste(s){this.resetError();let t=(salla.helpers.number(s.clipboardData.getData("text"))||"").replace(/[^0-9]/g,"");t=t.substring(0,this.otpInputs.length),this.otpInputs.forEach((s=>s.value="")),this.modifyNext(this.otpInputs[0],t)}handleInput(s){this.resetError(),salla.helpers.inputDigitsOnly(s.target),this.checkAllInputs()&&setTimeout((()=>{this.toggleOTPSubmit()}),100)}resetError(){this.hasError=!1,this.errorMessage=""}handleFocus(s){s.target!==this.firstOtpInput&&(""==this.firstOtpInput?.value&&this.firstOtpInput.focus(),""==s.target.previousElementSibling.value&&s.target.previousElementSibling.focus())}async getCode(){return this.code.value}async open(s){this.data=s,this.data.type=this.data.type||this.type,this.type=this.data.type,this.resendTimer(),this.otpInputs=this.body.querySelectorAll(".s-verify-input"),this.firstOtpInput=this.body.querySelector("#otp-1"),this.reset(),this.resetError(),"modal"==this.display&&this.modal?.setTitle(this.title),this.modal.open(),this.firstOtpInput?.addEventListener("input",(s=>this.splitNumber(s))),setTimeout((()=>this.otpInputs[0].focus()),100)}toggleOTPSubmit(){let s=[];if(this.otpInputs.forEach((t=>t.value&&s.push(t.value))),this.code.value=s.join(""),4===s.length)return this.btn.disable(),void this.btn.click();this.btn.enable()}reset(){this.otpInputs.forEach((s=>s.value="")),this.code.value="",this.otpInputs[0].focus()}resendTimer(){this.resendMessage.style.display="block",this.resend.style.display="none",this.resendAfter=30;let s=setInterval((()=>{this.resendAfter<=0?(clearInterval(s),this.resend.style.display="block",this.resendMessage.style.display="none"):(this.timer.innerHTML=`${this.resendAfter>=10?this.resendAfter:"0"+this.resendAfter} : 00`,this.resendAfter--)}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value="")),this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).finally((()=>this.resendTimer()))}submit(){if(this.code.value.length<4)return this.otpInputs[this.code.value.length].focus(),void salla.log("Trying to submit without 4 digits!");let s={code:this.code.value,...this.data};return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,this.supportWebAuth))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((s=>{this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"),s.response?salla.logger.error(s):console.log("Unexpected error",s),this.btn.stop()&&this.btn.enable()&&this.reset()}))}render(){return"inline"==this.display?i(e,null,this.myBody()):i("salla-modal",{width:"xs",class:"s-verify",ref:s=>this.modal=s,"modal-title":this.title},i("span",{slot:"icon",class:"s-verify-header-icon",innerHTML:"mobile"==this.type?'\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>android-phone</title>\n<path d="M22.667 0h-13.333c-2.941 0-5.333 2.392-5.333 5.333v21.333c0 2.941 2.392 5.333 5.333 5.333h13.333c2.941 0 5.333-2.392 5.333-5.333v-21.333c0-2.941-2.392-5.333-5.333-5.333zM25.333 26.667c0 1.471-1.196 2.667-2.667 2.667h-13.333c-1.471 0-2.667-1.196-2.667-2.667v-2.667h18.667zM25.333 21.333h-18.667v-16c0-1.471 1.196-2.667 2.667-2.667h13.333c1.471 0 2.667 1.196 2.667 2.667zM13.333 28h5.333c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n':r}),this.myBody())}myBody(){return i("div",{class:"s-verify-body",ref:s=>this.body=s},i("div",{class:"s-verify-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),i("slot",{name:"mobile"}),i("slot",{name:"email"}),i("input",{type:"hidden",name:"code",maxlength:"4",required:!0,ref:s=>this.code=s}),i("div",{class:{"s-verify-codes":!0,"has-error":this.hasError},dir:"ltr"},[1,2,3,4].map((s=>i("input",{type:"number",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",value:"",id:`otp-${s}`,class:{"s-verify-input":!0,"s-has-error":this.hasError},onInput:s=>this.handleInput(s),onPaste:s=>this.handlePaste(s),onKeyUp:s=>this.handleKeyUp(s),onFocus:s=>this.handleFocus(s),required:!0})))),this.hasError&&this.errorMessage?i("span",{class:"s-verify-error-message"},this.errorMessage):"",i("div",{slot:"footer",class:"s-verify-footer"},i("salla-button",{class:"s-verify-submit","loader-position":"center",disabled:!0,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),i("p",{class:"s-verify-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),i("b",{class:"s-verify-timer",ref:s=>this.timer=s})),i("a",{href:"#",class:"s-verify-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),i("slot",{name:"after-footer"}))}get host(){return h(this)}};l.style="salla-verify{display:block}.s-verify-input{}.s-verify-input::-webkit-outer-spin-button,.s-verify-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-verify-input[type=number]{-moz-appearance:textfield}";export{l as salla_verify}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as o}from"./p-C9LfegwO.js";const e=class{constructor(t){s(this,t),this.bordered=!0,this.placeholderImage="images/placeholder.png",this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(this.options)if("string"==typeof this.options)try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}else this.optionsData=Array.isArray(this.options)?this.options:[];else this.optionsData=[]}renderOptionValue(s){return s.is_image?t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name}))):s.color?t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}}):s.is_file?t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},salla.lang.get("common.elements.attachments")):s.is_color_picker?t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n'}))):s.is_map&&s.latitude&&s.longitude?t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:!0,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},salla.lang.get("common.elements.show_location")))):t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault(),navigator.clipboard&&navigator.clipboard.writeText(t)}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);t&&t.open&&t.open()}render(){if(!this.optionsData.length)return null;const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(o,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};e.style="";export{e as salla_order_details_options}
4
+ import{r as s,h as t,H as o}from"./p-BwsreBbG.js";const e=class{constructor(t){s(this,t),this.bordered=!0,this.placeholderImage="images/placeholder.png",this.optionsData=[]}componentWillLoad(){this.parseOptionsData()}componentWillUpdate(){this.parseOptionsData()}parseOptionsData(){if(this.options)if("string"==typeof this.options)try{this.optionsData=JSON.parse(this.options)}catch(s){this.optionsData=[]}else this.optionsData=Array.isArray(this.options)?this.options:[];else this.optionsData=[]}renderOptionValue(s){return s.is_image?t("div",{class:"s-order-details-option-image-container"},t("a",{href:s.value,target:"_blank"},t("img",{class:"s-order-details-option-image",src:s.value||this.placeholderImage,alt:s.name}))):s.color?t("span",{title:s.value,class:"s-order-details-option-color-swatch",style:{backgroundColor:s.color}}):s.is_file?t("a",{href:s.value,target:"_blank",class:"s-order-details-option-file-link"},salla.lang.get("common.elements.attachments")):s.is_color_picker?t("div",{class:"s-order-details-option-color-picker"},t("div",{class:"s-order-details-option-color-picker-content"},t("span",{class:"s-order-details-option-color-picker-text"},s.value),t("span",{class:"s-order-details-option-color-picker-swatch",style:{backgroundColor:s.value,width:"1rem"}})),t("salla-button",{onClick:t=>this.copyToClipboard(t,s.value),shape:"link",class:"s-order-details-option-color-picker-button"},t("span",{class:"s-order-details-option-color-copy-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>swap-fill</title>\n<path d="M28 10.667h-2.667c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333h2.667c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333v-2.667c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v2.667c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4v-13.333c0-2.205-1.795-4-4-4zM21.333 17.333v-13.333c0-2.205-1.795-4-4-4h-13.333c-2.205 0-4 1.795-4 4v13.333c0 2.205 1.795 4 4 4h13.333c2.205 0 4-1.795 4-4zM2.667 17.333v-13.333c0-0.736 0.599-1.333 1.333-1.333h13.333c0.735 0 1.333 0.597 1.333 1.333v13.333c0 0.736-0.599 1.333-1.333 1.333h-13.333c-0.735 0-1.333-0.597-1.333-1.333z"></path>\n</svg>\n'}))):s.is_map&&s.latitude&&s.longitude?t("salla-map",{id:`location_map_${s.id}`,class:`map_${s.id}`,zoom:15,readonly:!0,lat:s.latitude,lng:s.longitude},t("div",{slot:"button"},t("button",{type:"button",class:"s-order-details-option-map-button",onClick:()=>this.openMap(s.id)},salla.lang.get("common.elements.show_location")))):t("span",{class:"s-order-details-option-default-text"},s.display_value||s.value)}copyToClipboard(s,t){s.preventDefault(),navigator.clipboard&&navigator.clipboard.writeText(t)}openMap(s){const t=document.querySelector(`salla-map.map_${s}`);t&&t.open&&t.open()}render(){if(!this.optionsData.length)return null;const s=this.bordered?"s-order-details-options-container":"s-order-details-options-container-borderless";return t(o,{class:"s-order-details-options-wrapper"},t("h2",{class:"s-order-details-options-title"},salla.lang.get("pages.cart.item_options")),t("div",{class:s},t("dl",{class:"s-order-details-options-list"},this.optionsData.map((s=>t("div",{key:s.id,class:"s-order-details-options-item"},t("dt",{class:"s-order-details-options-item-name"},s.name,":"),t("dd",{class:s.is_image?"s-order-details-options-item-value-image":"s-order-details-options-item-value-text"},this.renderOptionValue(s))))))))}};e.style="";export{e as salla_order_details_options}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as e,a}from"./p-C9LfegwO.js";const i=class{constructor(t){s(this,t),this.loading=!0,this.saveLoading=!1,this.payload={items:{update:[],remove:[]}},this.expired=!1,this.editPreview=null,this.confirming=!1}async componentWillLoad(){await salla.onReady(),this.loadFromProp(),this.startExpiryCheck()}disconnectedCallback(){clearInterval(this.expiryInterval)}startExpiryCheck(){const s=this.order?.customer_editing_session?.ends_at;if(!s)return;const t=()=>new Date(`${s.replace(" ","T")}+03:00`).getTime()<=Date.now();t()?this.expired=!0:this.expiryInterval=setInterval((()=>{t()&&(this.expired=!0,clearInterval(this.expiryInterval))}),1e3)}loadFromProp(){try{if(!this.orderData)return void(this.error=salla.lang.getWithDefault("pages.orders.order_not_found","الطلب غير موجود"));const s="string"==typeof this.orderData?JSON.parse(this.orderData):this.orderData;this.order=s}catch(s){this.error=salla.lang.getWithDefault("pages.orders.order_not_found","الطلب غير موجود")}finally{this.loading=!1}}handleItemUpdated(s){if(!this.order)return;const{itemId:t,quantity:e,options:a}=s.detail,i=this.payload.items.update.filter((s=>s.id!==t));i.push({id:t,quantity:e,options:a??[]}),this.payload={...this.payload,items:{...this.payload.items,update:i}},this.order={...this.order,items:this.order.items.map((s=>s.id===t?{...s,quantity:e}:s))}}handleItemRemoved(s){if(!this.order)return;if(this.order.items.length<=1)return void salla.notify.error(salla.lang.getWithDefault("pages.orders.order_cannot_be_empty","لا يمكن إزالة جميع المنتجات من الطلب"));const{itemId:t}=s.detail;this.payload={...this.payload,items:{update:this.payload.items.update.filter((s=>s.id!==t)),remove:[...this.payload.items.remove,t]}},this.order={...this.order,items:this.order.items.filter((s=>s.id!==t))}}get hasChanges(){return this.payload.items.update.length>0||this.payload.items.remove.length>0}async saveOrder(){if(this.hasChanges){this.saveLoading=!0;try{const s=await salla.order.api.editOrder(this.orderId,this.payload);this.editPreview=s?.data?.data||s?.data,await(this.saveModal?.open())}catch(s){const t=s?.response?.data?.error?.message||s?.response?.data?.message;t&&salla.notify.error(t)}finally{this.saveLoading=!1}}}navigateToOrder(){const s=new URL(window.location.href);s.pathname=s.pathname.replace(/\/edit\/?$/,""),s.search="",window.location.href=s.href}handleConfirm(){this.confirming=!0,this.editPreview?.payment?.required&&this.editPreview.payment.payment_url?window.location.href=this.editPreview.payment.payment_url:this.navigateToOrder()}async cancelEditSession(){try{await salla.order.api.cancelEditSession(this.orderId),this.navigateToOrder()}catch(s){const t=s?.response?.data?.error?.message||s?.response?.data?.message;t&&salla.notify.error(t)}}renderSaveModal(){const s=this.editPreview,e=s?.totals?.remaining_amount?.amount>0,a=s?.totals?.refund_amount?.amount>0,i=s?.totals?.tax?.amount?.amount;return t("salla-modal",{ref:s=>this.saveModal=s,width:"md",onModalVisibilityChanged:async s=>{s.detail||(this.editPreview=null,this.confirming||await this.cancelEditSession(),this.confirming=!1)}},t("div",{class:"s-order-edit-modal"},t("h2",{class:"s-order-edit-modal-title"},salla.lang.getWithDefault("pages.orders.edit_summary_title","ملخص الطلب بعد التعديل")),s?.items?.length>0&&t("div",{class:"s-order-edit-modal-items"},s.items.map((s=>{const e=this.order?.items?.find((t=>t.id==s.id)),a=e?.product?.image?.url,i=s.options?.join("/ ");return t("div",{class:"s-order-edit-modal-item"},t("div",{class:"s-order-edit-modal-item-start"},a&&t("img",{src:a,alt:s.name,class:"s-order-edit-modal-item-image"}),t("div",null,t("p",{class:"s-order-edit-modal-item-name"},s.name),i&&t("span",{class:"s-order-edit-modal-item-options"},i))),t("div",{class:"s-order-edit-modal-item-end"},t("span",{class:"s-order-edit-modal-item-price",innerHTML:salla.money(s.price.amount)})))}))),s?.totals?.updated_products_total&&t("div",{class:"s-order-edit-modal-row"},t("span",{class:"s-order-edit-modal-row-label"},salla.lang.getWithDefault("pages.orders.modified_products_total","مجموع المنتجات المعدلة")),t("span",{class:"s-order-edit-modal-row-value",innerHTML:salla.money(s.totals.updated_products_total.amount)})),i>0&&t("div",{class:"s-order-edit-modal-row"},t("span",{class:"s-order-edit-modal-tax-label"},t("i",{class:"sicon-info-circle s-order-edit-modal-tax-icon"}),salla.lang.getWithDefault("pages.orders.vat","ضريبة القيمة المضافة")),t("span",{class:"s-order-edit-modal-row-value",innerHTML:salla.money(i)})),s?.totals?.total&&t("div",{class:"s-order-edit-modal-total"},t("span",{class:"s-order-edit-modal-total-label"},salla.lang.getWithDefault("pages.orders.order_total","اجمالي الطلب")),t("span",{class:"s-order-edit-modal-total-value",innerHTML:salla.money(s.totals.total.amount)})),a&&t("div",{class:"s-order-edit-modal-refund"},t("i",{class:"sicon-info-circle s-order-edit-modal-refund-icon"}),t("p",{class:"s-order-edit-modal-refund-text"},salla.lang.getWithDefault("pages.orders.refund_message","سيتم تحويل فارق المبلغ على نفس وسيلة الدفع"))),t("div",{class:"s-order-edit-modal-btn-wrapper"},t("salla-button",{onClick:()=>this.handleConfirm()},e?salla.lang.getWithDefault("pages.orders.pay_difference","دفع فارق المبلغ"):a?salla.lang.getWithDefault("pages.orders.confirm_and_receive_difference","تأكيد واستلام فارق المبلغ"):salla.lang.getWithDefault("pages.orders.confirm_changes","تأكيد التعديلات"),t("i",{class:"sicon-keyboard_arrow_left s-order-edit-modal-btn-icon"})))))}render(){if(this.loading)return t(e,null,t("salla-loading",null));if(this.expired)return t(e,null,t("div",{class:"s-order-edit-expired"},t("p",null,salla.lang.getWithDefault("pages.orders.edit_session_expired","انتهت مدة التعديل المتاحة")),t("salla-button",{onClick:()=>this.navigateToOrder()},salla.lang.getWithDefault("pages.orders.back_to_order","العودة إلى تفاصيل الطلب"))));if(this.error||!this.order)return t(e,null,t("div",{class:"no-content-placeholder"},t("i",{class:"sicon-shopping-bag icon"}),t("p",null,this.error)));const s=this.order.items&&this.order.items.length>0,a=this.order.customer_editing_session?.ends_at;return t(e,null,a&&t("div",{class:"s-order-edit-timer-wrapper"},t("salla-count-down",{prefixText:salla.lang.getWithDefault("pages.orders.edit_within","يمكنك التعديل خلال"),date:a,horizontal:!0,withButton:!0,autoSegments:!0,labeled:!1,size:"sm",color:"primary"})),t("div",{class:"s-order-edit-items-wrapper"},t("h2",{class:"s-order-edit-items-title"},salla.lang.getWithDefault("pages.orders.order_products","منتجات الطلب")),s?this.order.items.map(((s,e)=>[t("salla-order-edit-item",{key:s.id,item:s,orderId:this.orderId}),e<this.order.items.length-1?t("div",{class:"s-order-edit-items-divider"}):null])):t("div",{class:"no-content-placeholder"},t("i",{class:"sicon-shopping-bag icon"}),t("p",null,salla.lang.getWithDefault("common.elements.no_items","لا توجد عناصر")))),t("div",{class:"s-order-edit-actions"},t("salla-button",{onClick:()=>this.saveOrder(),loading:this.saveLoading,disabled:!this.hasChanges},salla.lang.getWithDefault("pages.orders.save_changes","حفظ التعديلات")),t("salla-button",{color:"gray",fill:"outline",onClick:()=>this.cancelEditSession()},salla.lang.getWithDefault("common.elements.cancel","الغاء"))),this.renderSaveModal())}get host(){return a(this)}};i.style="";export{i as salla_order_edit}
4
+ import{r as s,h as t,H as e,a}from"./p-BwsreBbG.js";const i=class{constructor(t){s(this,t),this.loading=!0,this.saveLoading=!1,this.payload={items:{update:[],remove:[]}},this.expired=!1,this.editPreview=null,this.confirming=!1}async componentWillLoad(){await salla.onReady(),this.loadFromProp(),this.startExpiryCheck()}disconnectedCallback(){clearInterval(this.expiryInterval)}startExpiryCheck(){const s=this.order?.customer_editing_session?.ends_at;if(!s)return;const t=()=>new Date(`${s.replace(" ","T")}+03:00`).getTime()<=Date.now();t()?this.expired=!0:this.expiryInterval=setInterval((()=>{t()&&(this.expired=!0,clearInterval(this.expiryInterval))}),1e3)}loadFromProp(){try{if(!this.orderData)return void(this.error=salla.lang.getWithDefault("pages.orders.order_not_found","الطلب غير موجود"));const s="string"==typeof this.orderData?JSON.parse(this.orderData):this.orderData;this.order=s}catch(s){this.error=salla.lang.getWithDefault("pages.orders.order_not_found","الطلب غير موجود")}finally{this.loading=!1}}handleItemUpdated(s){if(!this.order)return;const{itemId:t,quantity:e,options:a}=s.detail,i=this.payload.items.update.filter((s=>s.id!==t));i.push({id:t,quantity:e,options:a??[]}),this.payload={...this.payload,items:{...this.payload.items,update:i}},this.order={...this.order,items:this.order.items.map((s=>s.id===t?{...s,quantity:e}:s))}}handleItemRemoved(s){if(!this.order)return;if(this.order.items.length<=1)return void salla.notify.error(salla.lang.getWithDefault("pages.orders.order_cannot_be_empty","لا يمكن إزالة جميع المنتجات من الطلب"));const{itemId:t}=s.detail;this.payload={...this.payload,items:{update:this.payload.items.update.filter((s=>s.id!==t)),remove:[...this.payload.items.remove,t]}},this.order={...this.order,items:this.order.items.filter((s=>s.id!==t))}}get hasChanges(){return this.payload.items.update.length>0||this.payload.items.remove.length>0}async saveOrder(){if(this.hasChanges){this.saveLoading=!0;try{const s=await salla.order.api.editOrder(this.orderId,this.payload);this.editPreview=s?.data?.data||s?.data,await(this.saveModal?.open())}catch(s){const t=s?.response?.data?.error?.message||s?.response?.data?.message;t&&salla.notify.error(t)}finally{this.saveLoading=!1}}}navigateToOrder(){const s=new URL(window.location.href);s.pathname=s.pathname.replace(/\/edit\/?$/,""),s.search="",window.location.href=s.href}handleConfirm(){this.confirming=!0,this.editPreview?.payment?.required&&this.editPreview.payment.payment_url?window.location.href=this.editPreview.payment.payment_url:this.navigateToOrder()}async cancelEditSession(){try{await salla.order.api.cancelEditSession(this.orderId),this.navigateToOrder()}catch(s){const t=s?.response?.data?.error?.message||s?.response?.data?.message;t&&salla.notify.error(t)}}renderSaveModal(){const s=this.editPreview,e=s?.totals?.remaining_amount?.amount>0,a=s?.totals?.refund_amount?.amount>0,i=s?.totals?.tax?.amount?.amount;return t("salla-modal",{ref:s=>this.saveModal=s,width:"md",onModalVisibilityChanged:async s=>{s.detail||(this.editPreview=null,this.confirming||await this.cancelEditSession(),this.confirming=!1)}},t("div",{class:"s-order-edit-modal"},t("h2",{class:"s-order-edit-modal-title"},salla.lang.getWithDefault("pages.orders.edit_summary_title","ملخص الطلب بعد التعديل")),s?.items?.length>0&&t("div",{class:"s-order-edit-modal-items"},s.items.map((s=>{const e=this.order?.items?.find((t=>t.id==s.id)),a=e?.product?.image?.url,i=s.options?.join("/ ");return t("div",{class:"s-order-edit-modal-item"},t("div",{class:"s-order-edit-modal-item-start"},a&&t("img",{src:a,alt:s.name,class:"s-order-edit-modal-item-image"}),t("div",null,t("p",{class:"s-order-edit-modal-item-name"},s.name),i&&t("span",{class:"s-order-edit-modal-item-options"},i))),t("div",{class:"s-order-edit-modal-item-end"},t("span",{class:"s-order-edit-modal-item-price",innerHTML:salla.money(s.price.amount)})))}))),s?.totals?.updated_products_total&&t("div",{class:"s-order-edit-modal-row"},t("span",{class:"s-order-edit-modal-row-label"},salla.lang.getWithDefault("pages.orders.modified_products_total","مجموع المنتجات المعدلة")),t("span",{class:"s-order-edit-modal-row-value",innerHTML:salla.money(s.totals.updated_products_total.amount)})),i>0&&t("div",{class:"s-order-edit-modal-row"},t("span",{class:"s-order-edit-modal-tax-label"},t("i",{class:"sicon-info-circle s-order-edit-modal-tax-icon"}),salla.lang.getWithDefault("pages.orders.vat","ضريبة القيمة المضافة")),t("span",{class:"s-order-edit-modal-row-value",innerHTML:salla.money(i)})),s?.totals?.total&&t("div",{class:"s-order-edit-modal-total"},t("span",{class:"s-order-edit-modal-total-label"},salla.lang.getWithDefault("pages.orders.order_total","اجمالي الطلب")),t("span",{class:"s-order-edit-modal-total-value",innerHTML:salla.money(s.totals.total.amount)})),a&&t("div",{class:"s-order-edit-modal-refund"},t("i",{class:"sicon-info-circle s-order-edit-modal-refund-icon"}),t("p",{class:"s-order-edit-modal-refund-text"},salla.lang.getWithDefault("pages.orders.refund_message","سيتم تحويل فارق المبلغ على نفس وسيلة الدفع"))),t("div",{class:"s-order-edit-modal-btn-wrapper"},t("salla-button",{onClick:()=>this.handleConfirm()},e?salla.lang.getWithDefault("pages.orders.pay_difference","دفع فارق المبلغ"):a?salla.lang.getWithDefault("pages.orders.confirm_and_receive_difference","تأكيد واستلام فارق المبلغ"):salla.lang.getWithDefault("pages.orders.confirm_changes","تأكيد التعديلات"),t("i",{class:"sicon-keyboard_arrow_left s-order-edit-modal-btn-icon"})))))}render(){if(this.loading)return t(e,null,t("salla-loading",null));if(this.expired)return t(e,null,t("div",{class:"s-order-edit-expired"},t("p",null,salla.lang.getWithDefault("pages.orders.edit_session_expired","انتهت مدة التعديل المتاحة")),t("salla-button",{onClick:()=>this.navigateToOrder()},salla.lang.getWithDefault("pages.orders.back_to_order","العودة إلى تفاصيل الطلب"))));if(this.error||!this.order)return t(e,null,t("div",{class:"no-content-placeholder"},t("i",{class:"sicon-shopping-bag icon"}),t("p",null,this.error)));const s=this.order.items&&this.order.items.length>0,a=this.order.customer_editing_session?.ends_at;return t(e,null,a&&t("div",{class:"s-order-edit-timer-wrapper"},t("salla-count-down",{prefixText:salla.lang.getWithDefault("pages.orders.edit_within","يمكنك التعديل خلال"),date:a,horizontal:!0,withButton:!0,autoSegments:!0,labeled:!1,size:"sm",color:"primary"})),t("div",{class:"s-order-edit-items-wrapper"},t("h2",{class:"s-order-edit-items-title"},salla.lang.getWithDefault("pages.orders.order_products","منتجات الطلب")),s?this.order.items.map(((s,e)=>[t("salla-order-edit-item",{key:s.id,item:s,orderId:this.orderId}),e<this.order.items.length-1?t("div",{class:"s-order-edit-items-divider"}):null])):t("div",{class:"no-content-placeholder"},t("i",{class:"sicon-shopping-bag icon"}),t("p",null,salla.lang.getWithDefault("common.elements.no_items","لا توجد عناصر")))),t("div",{class:"s-order-edit-actions"},t("salla-button",{onClick:()=>this.saveOrder(),loading:this.saveLoading,disabled:!this.hasChanges},salla.lang.getWithDefault("pages.orders.save_changes","حفظ التعديلات")),t("salla-button",{color:"gray",fill:"outline",onClick:()=>this.cancelEditSession()},salla.lang.getWithDefault("common.elements.cancel","الغاء"))),this.renderSaveModal())}get host(){return a(this)}};i.style="";export{i as salla_order_edit}