@salla.sa/twilight-components 2.14.525 → 2.14.527

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 (359) hide show
  1. package/dist/cjs/{filepond-ByG3dm7V.js → filepond-b0w4ucsY.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-HrlEnAMv.js → filepond-plugin-file-poster-DcK1l1GY.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-CQ3A10EP.js → filepond-plugin-file-validate-size-CkPhV0MZ.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-Dc9po32n.js → filepond-plugin-file-validate-type-FezmfZnb.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-CxnbovZA.js → filepond-plugin-image-edit-SjJnSovO.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-BiZSj8QH.js → filepond-plugin-image-exif-orientation-BadaWudo.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-Ca4Gfes-.js → filepond-plugin-image-preview-OycIHnPl.js} +1 -1
  8. package/dist/cjs/{functions-Eg2GfamO.js → functions-B5JSRkNf.js} +1 -1
  9. package/dist/cjs/{index-_SuY2Qj7.js → index-C8azAHop.js} +2 -2
  10. package/dist/cjs/intlTelInput-DCVpeeHH.js +4449 -0
  11. package/dist/cjs/loader.cjs.js +2 -2
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +24 -6
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-basket-gap.cjs.entry.js +5 -4
  21. package/dist/cjs/salla-booking-field_7.cjs.entry.js +32 -16
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +82 -7
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-form_8.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-count-down_2.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-banner.cjs.entry.js +2 -2
  47. package/dist/cjs/salla-loyalty-exchange-product-card_5.cjs.entry.js +3 -3
  48. package/dist/cjs/salla-loyalty-hero_2.cjs.entry.js +2 -2
  49. package/dist/cjs/salla-loyalty-panel.cjs.entry.js +3 -3
  50. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  54. package/dist/cjs/salla-loyalty-reward.cjs.entry.js +2 -2
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_2.cjs.entry.js +71 -15
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-product-card_2.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  107. package/dist/cjs/{tracked-promise-CykF7i94.js → tracked-promise-C_iMjRSx.js} +1 -1
  108. package/dist/cjs/twilight.cjs.js +2 -2
  109. package/dist/cjs/utils-BD1un9WN.js +544 -0
  110. package/dist/cjs/{vanilla-picker-CHauTUo6.js → vanilla-picker-BlVuhlOr.js} +1 -1
  111. package/dist/collection/components/salla-basket-gap/salla-basket-gap.js +4 -3
  112. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +82 -6
  113. package/dist/collection/components/salla-map/salla-map.css +20 -1
  114. package/dist/collection/components/salla-map/salla-map.js +86 -13
  115. package/dist/collection/components/salla-product-options/salla-product-options.js +27 -5
  116. package/dist/collection/components/salla-tel-input/salla-tel-input.css +25 -17
  117. package/dist/collection/components/salla-tel-input/salla-tel-input.js +21 -5
  118. package/dist/components/index.js +2 -2
  119. package/dist/components/intlTelInput.js +4447 -0
  120. package/dist/components/salla-basket-gap.js +4 -3
  121. package/dist/components/salla-bullet-delivery.js +82 -6
  122. package/dist/components/salla-map2.js +71 -14
  123. package/dist/components/salla-product-options2.js +23 -5
  124. package/dist/components/salla-tel-input2.js +23 -7
  125. package/dist/components/utils.js +542 -0
  126. package/dist/esm/{filepond-Bq2A216a.js → filepond-BRxfxd7t.js} +1 -1
  127. package/dist/esm/{filepond-plugin-file-poster-D8LMLVE0.js → filepond-plugin-file-poster-5YXrzIG7.js} +1 -1
  128. package/dist/esm/{filepond-plugin-file-validate-size-O5io_aCk.js → filepond-plugin-file-validate-size-Cf8HW8zg.js} +1 -1
  129. package/dist/esm/{filepond-plugin-file-validate-type-HotESPQF.js → filepond-plugin-file-validate-type-CYKPeh3k.js} +1 -1
  130. package/dist/esm/{filepond-plugin-image-edit-Cognw-Ke.js → filepond-plugin-image-edit-B3vxnYdF.js} +1 -1
  131. package/dist/esm/{filepond-plugin-image-exif-orientation-1R6UZIzg.js → filepond-plugin-image-exif-orientation-BbzOlsEM.js} +1 -1
  132. package/dist/esm/{filepond-plugin-image-preview-BnYXfYUb.js → filepond-plugin-image-preview-BWeaWqAq.js} +1 -1
  133. package/dist/esm/{functions-lIfge5kK.js → functions-Bni-nvUA.js} +1 -1
  134. package/dist/esm/{index-jaN78U7Z.js → index-MrxrxOqi.js} +2 -2
  135. package/dist/esm/intlTelInput-DpfK9QTH.js +4447 -0
  136. package/dist/esm/loader.js +3 -3
  137. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  138. package/dist/esm/salla-accordion_6.entry.js +1 -1
  139. package/dist/esm/salla-add-product-button_5.entry.js +24 -6
  140. package/dist/esm/salla-advertisement.entry.js +1 -1
  141. package/dist/esm/salla-alert_2.entry.js +1 -1
  142. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  143. package/dist/esm/salla-apps-icons.entry.js +1 -1
  144. package/dist/esm/salla-badge.entry.js +1 -1
  145. package/dist/esm/salla-basket-gap.entry.js +5 -4
  146. package/dist/esm/salla-booking-field_7.entry.js +32 -16
  147. package/dist/esm/salla-bullet-delivery_2.entry.js +82 -7
  148. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  149. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  150. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  151. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  152. package/dist/esm/salla-comment-factors.entry.js +1 -1
  153. package/dist/esm/salla-comment-form_8.entry.js +1 -1
  154. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  155. package/dist/esm/salla-contacts.entry.js +1 -1
  156. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  157. package/dist/esm/salla-count-down_2.entry.js +1 -1
  158. package/dist/esm/salla-custom-fields.entry.js +1 -1
  159. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  160. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  161. package/dist/esm/salla-filters-widget.entry.js +1 -1
  162. package/dist/esm/salla-filters.entry.js +1 -1
  163. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  164. package/dist/esm/salla-gifting.entry.js +1 -1
  165. package/dist/esm/salla-hook.entry.js +1 -1
  166. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  167. package/dist/esm/salla-installment.entry.js +1 -1
  168. package/dist/esm/salla-list-tile.entry.js +1 -1
  169. package/dist/esm/salla-localization-modal.entry.js +1 -1
  170. package/dist/esm/salla-login-modal.entry.js +1 -1
  171. package/dist/esm/salla-loyalty-banner.entry.js +2 -2
  172. package/dist/esm/salla-loyalty-exchange-product-card_5.entry.js +3 -3
  173. package/dist/esm/salla-loyalty-hero_2.entry.js +2 -2
  174. package/dist/esm/salla-loyalty-panel.entry.js +3 -3
  175. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  176. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  177. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  178. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  179. package/dist/esm/salla-loyalty-reward.entry.js +2 -2
  180. package/dist/esm/salla-loyalty.entry.js +1 -1
  181. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  182. package/dist/esm/salla-map_2.entry.js +71 -15
  183. package/dist/esm/salla-menu.entry.js +1 -1
  184. package/dist/esm/salla-metadata.entry.js +1 -1
  185. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  186. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  187. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  188. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  189. package/dist/esm/salla-notification-item.entry.js +1 -1
  190. package/dist/esm/salla-notifications.entry.js +1 -1
  191. package/dist/esm/salla-offer-modal.entry.js +1 -1
  192. package/dist/esm/salla-offer.entry.js +1 -1
  193. package/dist/esm/salla-order-branch.entry.js +1 -1
  194. package/dist/esm/salla-order-cancel.entry.js +1 -1
  195. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  196. package/dist/esm/salla-order-details-options.entry.js +1 -1
  197. package/dist/esm/salla-order-details.entry.js +1 -1
  198. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  199. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  200. package/dist/esm/salla-order-edit.entry.js +1 -1
  201. package/dist/esm/salla-order-shipments.entry.js +1 -1
  202. package/dist/esm/salla-order-summary.entry.js +1 -1
  203. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  204. package/dist/esm/salla-orders.entry.js +1 -1
  205. package/dist/esm/salla-payments.entry.js +1 -1
  206. package/dist/esm/salla-placeholder.entry.js +1 -1
  207. package/dist/esm/salla-price-range.entry.js +1 -1
  208. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  209. package/dist/esm/salla-product-card_2.entry.js +1 -1
  210. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  211. package/dist/esm/salla-products-list.entry.js +1 -1
  212. package/dist/esm/salla-quick-order.entry.js +1 -1
  213. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  214. package/dist/esm/salla-rating-modal.entry.js +1 -1
  215. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  216. package/dist/esm/salla-scopes.entry.js +1 -1
  217. package/dist/esm/salla-search.entry.js +1 -1
  218. package/dist/esm/salla-skeleton.entry.js +1 -1
  219. package/dist/esm/salla-slider.entry.js +1 -1
  220. package/dist/esm/salla-social-share.entry.js +1 -1
  221. package/dist/esm/salla-social.entry.js +1 -1
  222. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  223. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  224. package/dist/esm/salla-tooltip.entry.js +1 -1
  225. package/dist/esm/salla-trust-badges.entry.js +1 -1
  226. package/dist/esm/salla-user-menu.entry.js +1 -1
  227. package/dist/esm/salla-user-profile.entry.js +1 -1
  228. package/dist/esm/salla-user-settings.entry.js +1 -1
  229. package/dist/esm/salla-verify.entry.js +1 -1
  230. package/dist/esm/salla-wallet.entry.js +1 -1
  231. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  232. package/dist/esm/{tracked-promise-BLCQ8tjn.js → tracked-promise-r8GfVNie.js} +1 -1
  233. package/dist/esm/twilight.js +3 -3
  234. package/dist/esm/utils-DxnArMXe.js +542 -0
  235. package/dist/esm/{vanilla-picker-bYqL5aAx.js → vanilla-picker-odqYYCwx.js} +1 -1
  236. package/dist/twilight/{p-630eb394.entry.js → p-012f1725.entry.js} +1 -1
  237. package/dist/twilight/{p-fe4fff6c.entry.js → p-01f19c8e.entry.js} +1 -1
  238. package/dist/twilight/{p-63518f52.entry.js → p-045bbe40.entry.js} +1 -1
  239. package/dist/twilight/{p-97298e68.entry.js → p-06089393.entry.js} +1 -1
  240. package/dist/twilight/{p-3f644db4.entry.js → p-08514188.entry.js} +1 -1
  241. package/dist/twilight/{p-182fe65a.entry.js → p-08bbb599.entry.js} +1 -1
  242. package/dist/twilight/{p-b1875b29.entry.js → p-0ab0dcc6.entry.js} +1 -1
  243. package/dist/twilight/{p-0d2fe58f.entry.js → p-0d1cc718.entry.js} +1 -1
  244. package/dist/twilight/{p-49538e37.entry.js → p-112dfb27.entry.js} +1 -1
  245. package/dist/twilight/{p-702bbad3.entry.js → p-14fe0051.entry.js} +1 -1
  246. package/dist/twilight/{p-050f9310.entry.js → p-1acb62f7.entry.js} +1 -1
  247. package/dist/twilight/{p-525223a4.entry.js → p-1b999b89.entry.js} +1 -1
  248. package/dist/twilight/{p-17bc9975.entry.js → p-1f049143.entry.js} +1 -1
  249. package/dist/twilight/{p-6435138d.entry.js → p-1f0fab6c.entry.js} +1 -1
  250. package/dist/twilight/{p-44e6a827.entry.js → p-1f2d4f6d.entry.js} +1 -1
  251. package/dist/twilight/{p-e51caf6a.entry.js → p-20ae6a3d.entry.js} +1 -1
  252. package/dist/twilight/{p-25f2f9b9.entry.js → p-258f5ec9.entry.js} +1 -1
  253. package/dist/twilight/{p-7fae6196.entry.js → p-27437b3c.entry.js} +1 -1
  254. package/dist/twilight/{p-33c856af.entry.js → p-29c02546.entry.js} +1 -1
  255. package/dist/twilight/{p-602fc32b.entry.js → p-30d348b3.entry.js} +1 -1
  256. package/dist/twilight/{p-e02846cf.entry.js → p-30d8f802.entry.js} +1 -1
  257. package/dist/twilight/{p-59273278.entry.js → p-31eab38b.entry.js} +1 -1
  258. package/dist/twilight/{p-1104a7a2.entry.js → p-3983347e.entry.js} +2 -2
  259. package/dist/twilight/{p-8f2d30ee.entry.js → p-39e0472d.entry.js} +1 -1
  260. package/dist/twilight/{p-69b14e60.entry.js → p-3b68796d.entry.js} +1 -1
  261. package/dist/twilight/{p-74116ebe.entry.js → p-402227e5.entry.js} +1 -1
  262. package/dist/twilight/{p-e9181449.entry.js → p-48143622.entry.js} +1 -1
  263. package/dist/twilight/{p-aa8cb72c.entry.js → p-491a8688.entry.js} +1 -1
  264. package/dist/twilight/{p-aa48682d.entry.js → p-4a71bc5b.entry.js} +1 -1
  265. package/dist/twilight/{p-9a0c466f.entry.js → p-52d2c526.entry.js} +1 -1
  266. package/dist/twilight/{p-c3b02957.entry.js → p-58641d12.entry.js} +1 -1
  267. package/dist/twilight/{p-18ebde40.entry.js → p-5b20bc08.entry.js} +1 -1
  268. package/dist/twilight/{p-95a6174b.entry.js → p-61b090d1.entry.js} +1 -1
  269. package/dist/twilight/{p-2c9b90ce.entry.js → p-644d9658.entry.js} +1 -1
  270. package/dist/twilight/{p-2945aeb2.entry.js → p-67269624.entry.js} +1 -1
  271. package/dist/twilight/{p-0609a7bd.entry.js → p-67d0ce1c.entry.js} +1 -1
  272. package/dist/twilight/{p-6a9a4bd8.entry.js → p-6d0825be.entry.js} +1 -1
  273. package/dist/twilight/{p-f5e142d7.entry.js → p-70da8cf5.entry.js} +1 -1
  274. package/dist/twilight/{p-c619267d.entry.js → p-714be207.entry.js} +1 -1
  275. package/dist/twilight/{p-d336cca5.entry.js → p-7206a775.entry.js} +1 -1
  276. package/dist/twilight/{p-97e232e5.entry.js → p-72094246.entry.js} +1 -1
  277. package/dist/twilight/{p-8c10db42.entry.js → p-7524a81a.entry.js} +1 -1
  278. package/dist/twilight/{p-7d585e3f.entry.js → p-7a32a312.entry.js} +1 -1
  279. package/dist/twilight/{p-c9e3cb79.entry.js → p-7f923cb2.entry.js} +1 -1
  280. package/dist/twilight/{p-80928bbd.entry.js → p-8105ed54.entry.js} +1 -1
  281. package/dist/twilight/{p-373fcfb8.entry.js → p-82c51ac3.entry.js} +1 -1
  282. package/dist/twilight/{p-362875df.entry.js → p-88013de3.entry.js} +1 -1
  283. package/dist/twilight/{p-977780ec.entry.js → p-8bc4dc7e.entry.js} +1 -1
  284. package/dist/twilight/{p-505874e8.entry.js → p-8cd7ff9e.entry.js} +1 -1
  285. package/dist/twilight/{p-00cc5421.entry.js → p-8e0ddbe8.entry.js} +1 -1
  286. package/dist/twilight/{p-99a2141a.entry.js → p-90836db4.entry.js} +1 -1
  287. package/dist/twilight/{p-3eccf464.entry.js → p-93af5955.entry.js} +1 -1
  288. package/dist/twilight/{p-99141839.entry.js → p-9573a650.entry.js} +1 -1
  289. package/dist/twilight/{p-fd847a8f.entry.js → p-968e2822.entry.js} +1 -1
  290. package/dist/twilight/{p-f7ab861f.entry.js → p-9b2515ab.entry.js} +1 -1
  291. package/dist/twilight/{p-f68bc653.entry.js → p-9b768009.entry.js} +1 -1
  292. package/dist/twilight/{p-b31b5264.entry.js → p-9be5a903.entry.js} +1 -1
  293. package/dist/twilight/{p-0e52a675.entry.js → p-9df6fb80.entry.js} +1 -1
  294. package/dist/twilight/{p-BRZnimZv.js → p-BGtF1_Bf.js} +1 -1
  295. package/dist/twilight/{p-DOua19fU.js → p-BZYlNbpW.js} +1 -1
  296. package/dist/twilight/{p-rkyvWRN4.js → p-C34Ycrkk.js} +1 -1
  297. package/dist/twilight/{p-BcYGWl9T.js → p-C_BV2ex7.js} +1 -1
  298. package/dist/twilight/{p-LTkkjsSH.js → p-C_lEyosA.js} +1 -1
  299. package/dist/twilight/{p-8-u5GuKq.js → p-CcPplbOM.js} +1 -1
  300. package/dist/twilight/{p-CYTQC0eE.js → p-ChCYUlik.js} +1 -1
  301. package/dist/twilight/{p-nDdDwFvo.js → p-Cr5HDKQ9.js} +1 -1
  302. package/dist/twilight/p-DBIOj_I_.js +4 -0
  303. package/dist/twilight/p-DffCiPZo.js +4 -0
  304. package/dist/twilight/p-DxnArMXe.js +4 -0
  305. package/dist/twilight/{p-Dqih45q3.js → p-J94Exn76.js} +1 -1
  306. package/dist/twilight/{p-jaN78U7Z.js → p-MrxrxOqi.js} +1 -1
  307. package/dist/twilight/{p-e1732ee5.entry.js → p-a433dd94.entry.js} +1 -1
  308. package/dist/twilight/{p-1f2aca4d.entry.js → p-a8fe909f.entry.js} +1 -1
  309. package/dist/twilight/{p-4f2994dd.entry.js → p-a9b36fde.entry.js} +1 -1
  310. package/dist/twilight/{p-c8c5daa1.entry.js → p-ab087e8d.entry.js} +1 -1
  311. package/dist/twilight/{p-ae9c2d84.entry.js → p-ab18ee85.entry.js} +1 -1
  312. package/dist/twilight/{p-c81d2dc8.entry.js → p-ab844de4.entry.js} +1 -1
  313. package/dist/twilight/{p-4fc66f6c.entry.js → p-ac0ec991.entry.js} +1 -1
  314. package/dist/twilight/{p-3d9e2493.entry.js → p-ac8da0ee.entry.js} +1 -1
  315. package/dist/twilight/{p-b17be3dc.entry.js → p-ade37269.entry.js} +1 -1
  316. package/dist/twilight/{p-e467f5b0.entry.js → p-b22b92fb.entry.js} +1 -1
  317. package/dist/twilight/p-b28588ba.entry.js +4 -0
  318. package/dist/twilight/{p-96ac5048.entry.js → p-b33582fd.entry.js} +1 -1
  319. package/dist/twilight/p-b6f4b3ec.entry.js +4 -0
  320. package/dist/twilight/{p-3c832f6f.entry.js → p-bb7bd408.entry.js} +1 -1
  321. package/dist/twilight/{p-99224703.entry.js → p-c41cb3fa.entry.js} +1 -1
  322. package/dist/twilight/{p-a0cbccd9.entry.js → p-c45528db.entry.js} +1 -1
  323. package/dist/twilight/{p-5d2ebd77.entry.js → p-cac22061.entry.js} +1 -1
  324. package/dist/twilight/p-cadadc88.entry.js +4 -0
  325. package/dist/twilight/{p-24805db6.entry.js → p-d0696872.entry.js} +1 -1
  326. package/dist/twilight/{p-9a59e00a.entry.js → p-d4d595c1.entry.js} +1 -1
  327. package/dist/twilight/{p-323402b3.entry.js → p-d5b9d505.entry.js} +1 -1
  328. package/dist/twilight/{p-abc2e86d.entry.js → p-d76ad30b.entry.js} +1 -1
  329. package/dist/twilight/{p-9b2a7211.entry.js → p-d7957d69.entry.js} +1 -1
  330. package/dist/twilight/{p-71c122ee.entry.js → p-d9f1cd81.entry.js} +1 -1
  331. package/dist/twilight/{p-ea5068ed.entry.js → p-dd41634a.entry.js} +1 -1
  332. package/dist/twilight/{p-8678f934.entry.js → p-e43f07fc.entry.js} +1 -1
  333. package/dist/twilight/{p-d58a1f61.entry.js → p-ea3264f8.entry.js} +1 -1
  334. package/dist/twilight/{p-42057f68.entry.js → p-ea7e2466.entry.js} +1 -1
  335. package/dist/twilight/p-ec08c0b1.entry.js +4 -0
  336. package/dist/twilight/{p-1fbf590d.entry.js → p-ecf01eb1.entry.js} +1 -1
  337. package/dist/twilight/{p-1eb75e5f.entry.js → p-ef7b606e.entry.js} +1 -1
  338. package/dist/twilight/{p-6c8274a2.entry.js → p-f3aba096.entry.js} +1 -1
  339. package/dist/twilight/{p-0e39350d.entry.js → p-f67ed203.entry.js} +1 -1
  340. package/dist/twilight/{p-d7dc876f.entry.js → p-f81029b5.entry.js} +1 -1
  341. package/dist/twilight/{p-75e0cd1f.entry.js → p-fa2ff605.entry.js} +1 -1
  342. package/dist/twilight/p-faf1ca68.entry.js +4 -0
  343. package/dist/twilight/{p-c08b91d6.entry.js → p-fee87019.entry.js} +1 -1
  344. package/dist/twilight/twilight.esm.js +1 -1
  345. package/dist/types/components/salla-bullet-delivery/salla-bullet-delivery.d.ts +16 -0
  346. package/dist/types/components/salla-map/salla-map.d.ts +15 -0
  347. package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +3 -0
  348. package/dist/types/components.d.ts +4 -0
  349. package/package.json +6 -6
  350. package/dist/cjs/index-CE6R05qu.js +0 -1714
  351. package/dist/components/index3.js +0 -1712
  352. package/dist/esm/index-D_H00WFp.js +0 -1712
  353. package/dist/twilight/p-448c0d05.entry.js +0 -4
  354. package/dist/twilight/p-4a8d866d.entry.js +0 -4
  355. package/dist/twilight/p-5d036c83.entry.js +0 -4
  356. package/dist/twilight/p-Cp2FlnRu.js +0 -4
  357. package/dist/twilight/p-EpPIlSaQ.js +0 -4
  358. package/dist/twilight/p-e38c275d.entry.js +0 -4
  359. package/dist/twilight/p-f1977d52.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}from"./p-jaN78U7Z.js";import{T as o}from"./p-CJUR4sUM.js";import{i as n}from"./p-DqDX5na4.js";const e=class{constructor(t){s(this,t),this.coupon=null,this.isLoading=!0,this.titlePercentTpl="",this.titleFixedTpl="",this.badgeLabel="",this.minSpendTpl="",this.expiresTpl="",this.shopNowLabel="",this.copyLabel="",this.copiedLabel=""}componentWillLoad(){Salla.onReady().then((()=>Salla.lang.onLoaded())).then((()=>(this.loadTranslations(),this.loadCoupon()))).catch((()=>{this.isLoading=!1}))}loadTranslations(){this.titlePercentTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_percent")||"",this.titleFixedTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_fixed")||"",this.badgeLabel=Salla.lang.get("pages.thank_you.next_order_coupon_badge")||"",this.minSpendTpl=Salla.lang.get("pages.thank_you.next_order_coupon_min_spend")||"",this.expiresTpl=Salla.lang.get("pages.thank_you.next_order_coupon_expires")||"",this.shopNowLabel=Salla.lang.get("pages.thank_you.next_order_coupon_shop_now")||"",this.copyLabel=Salla.lang.get("common.elements.copy")||"",this.copiedLabel=Salla.lang.get("pages.thank_you.next_order_coupon_copied")||""}async loadCoupon(){try{const s=await salla.api.request("coupons",{params:{type:"thankyou"}}),t=s?.data,o=Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[];this.coupon=o[0]??null}catch{this.coupon=null}finally{this.isLoading=!1}}async copyCode(){if(this.coupon)try{await navigator.clipboard.writeText(this.coupon.code),salla.notify.success(this.copiedLabel),salla.event.dispatch("salla::next-order-coupon.code.copied",{code:this.coupon.code})}catch{}}isPercentage(){return"P"===this.coupon?.type||"percentage"===this.coupon?.type}formatAmount(){if(!this.coupon)return"";if(this.isPercentage())return`${salla.helpers.number(this.coupon.amount)}%`;const s=this.coupon.amount;return t("span","object"==typeof s&&s.amount?{innerHTML:salla.money(s.amount,s.currency)}:{innerHTML:salla.money(s)})}formatMinSpend(){const s=this.coupon?.minimum_amount;return s&&("object"!=typeof s||s.amount)?"string"==typeof s?s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):salla.money(s.amount,s.currency):""}formatExpiry(){const s=this.coupon?.expiry_date;return s?new Date(s).toLocaleDateString(Salla.lang.locale||"en-GB"):""}renderSkeleton(){return t("div",{class:"s-next-order-coupon-wrapper s-next-order-coupon-skeleton"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("salla-skeleton",{type:"normal",width:"48px",height:"48px"}),t("div",{class:"s-next-order-coupon-details"},t("salla-skeleton",{height:"14px",width:"220px"}),t("salla-skeleton",{height:"12px",width:"140px"}))),t("div",{class:"s-next-order-coupon-actions"},t("salla-skeleton",{height:"40px",width:"140px"}),t("salla-skeleton",{height:"40px",width:"100px"}))))}renderTitle(){const s=this.formatAmount(),o=this.isPercentage()?this.titlePercentTpl:this.titleFixedTpl,n=this.isPercentage()?":amount%":":amount",e=o.split(n);return t("p",{class:"s-next-order-coupon-title"},e[0],t("span",{class:"s-next-order-coupon-amount"},s),e[1]||"")}render(){if(this.isLoading)return this.renderSkeleton();if(!this.coupon)return null;const s=this.formatMinSpend(),e=this.formatExpiry();return t("div",{class:"s-next-order-coupon-wrapper"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("div",{class:"s-next-order-coupon-icon-wrap"},t("span",{class:"s-next-order-coupon-icon-bg"}),t("span",{class:"s-next-order-coupon-icon",innerHTML:o})),t("div",{class:"s-next-order-coupon-details"},t("div",{class:"s-next-order-coupon-title-row"},this.renderTitle(),t("span",{class:"s-next-order-coupon-badge"},t("span",{class:"s-next-order-coupon-badge-bg"}),t("span",{class:"s-next-order-coupon-badge-text"},this.badgeLabel))),(s||e)&&t("p",{class:"s-next-order-coupon-meta"},s&&t("span",{innerHTML:this.minSpendTpl.replace(":amount",s)}),e&&t("span",null,this.expiresTpl.replace(":date",e))))),t("div",{class:"s-next-order-coupon-actions"},t("div",{class:"s-next-order-coupon-code-box"},t("span",{class:"s-next-order-coupon-code-text"},this.coupon.code),t("salla-button",{shape:"link",class:"s-next-order-coupon-copy-btn",title:this.copyLabel,onClick:()=>this.copyCode()},t("span",{class:"s-next-order-coupon-copy-icon",innerHTML:n}))),t("salla-button",{href:salla.url.get(""),class:"s-next-order-coupon-shop-btn"},this.shopNowLabel))))}};e.style=":host{display:block}";export{e as salla_next_order_coupon}
4
+ import{r as s,h as t}from"./p-MrxrxOqi.js";import{T as o}from"./p-CJUR4sUM.js";import{i as n}from"./p-DqDX5na4.js";const e=class{constructor(t){s(this,t),this.coupon=null,this.isLoading=!0,this.titlePercentTpl="",this.titleFixedTpl="",this.badgeLabel="",this.minSpendTpl="",this.expiresTpl="",this.shopNowLabel="",this.copyLabel="",this.copiedLabel=""}componentWillLoad(){Salla.onReady().then((()=>Salla.lang.onLoaded())).then((()=>(this.loadTranslations(),this.loadCoupon()))).catch((()=>{this.isLoading=!1}))}loadTranslations(){this.titlePercentTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_percent")||"",this.titleFixedTpl=Salla.lang.get("pages.thank_you.next_order_coupon_title_fixed")||"",this.badgeLabel=Salla.lang.get("pages.thank_you.next_order_coupon_badge")||"",this.minSpendTpl=Salla.lang.get("pages.thank_you.next_order_coupon_min_spend")||"",this.expiresTpl=Salla.lang.get("pages.thank_you.next_order_coupon_expires")||"",this.shopNowLabel=Salla.lang.get("pages.thank_you.next_order_coupon_shop_now")||"",this.copyLabel=Salla.lang.get("common.elements.copy")||"",this.copiedLabel=Salla.lang.get("pages.thank_you.next_order_coupon_copied")||""}async loadCoupon(){try{const s=await salla.api.request("coupons",{params:{type:"thankyou"}}),t=s?.data,o=Array.isArray(t)?t:Array.isArray(t?.data)?t.data:[];this.coupon=o[0]??null}catch{this.coupon=null}finally{this.isLoading=!1}}async copyCode(){if(this.coupon)try{await navigator.clipboard.writeText(this.coupon.code),salla.notify.success(this.copiedLabel),salla.event.dispatch("salla::next-order-coupon.code.copied",{code:this.coupon.code})}catch{}}isPercentage(){return"P"===this.coupon?.type||"percentage"===this.coupon?.type}formatAmount(){if(!this.coupon)return"";if(this.isPercentage())return`${salla.helpers.number(this.coupon.amount)}%`;const s=this.coupon.amount;return t("span","object"==typeof s&&s.amount?{innerHTML:salla.money(s.amount,s.currency)}:{innerHTML:salla.money(s)})}formatMinSpend(){const s=this.coupon?.minimum_amount;return s&&("object"!=typeof s||s.amount)?"string"==typeof s?s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):salla.money(s.amount,s.currency):""}formatExpiry(){const s=this.coupon?.expiry_date;return s?new Date(s).toLocaleDateString(Salla.lang.locale||"en-GB"):""}renderSkeleton(){return t("div",{class:"s-next-order-coupon-wrapper s-next-order-coupon-skeleton"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("salla-skeleton",{type:"normal",width:"48px",height:"48px"}),t("div",{class:"s-next-order-coupon-details"},t("salla-skeleton",{height:"14px",width:"220px"}),t("salla-skeleton",{height:"12px",width:"140px"}))),t("div",{class:"s-next-order-coupon-actions"},t("salla-skeleton",{height:"40px",width:"140px"}),t("salla-skeleton",{height:"40px",width:"100px"}))))}renderTitle(){const s=this.formatAmount(),o=this.isPercentage()?this.titlePercentTpl:this.titleFixedTpl,n=this.isPercentage()?":amount%":":amount",e=o.split(n);return t("p",{class:"s-next-order-coupon-title"},e[0],t("span",{class:"s-next-order-coupon-amount"},s),e[1]||"")}render(){if(this.isLoading)return this.renderSkeleton();if(!this.coupon)return null;const s=this.formatMinSpend(),e=this.formatExpiry();return t("div",{class:"s-next-order-coupon-wrapper"},t("div",{class:"s-next-order-coupon-inner"},t("div",{class:"s-next-order-coupon-info"},t("div",{class:"s-next-order-coupon-icon-wrap"},t("span",{class:"s-next-order-coupon-icon-bg"}),t("span",{class:"s-next-order-coupon-icon",innerHTML:o})),t("div",{class:"s-next-order-coupon-details"},t("div",{class:"s-next-order-coupon-title-row"},this.renderTitle(),t("span",{class:"s-next-order-coupon-badge"},t("span",{class:"s-next-order-coupon-badge-bg"}),t("span",{class:"s-next-order-coupon-badge-text"},this.badgeLabel))),(s||e)&&t("p",{class:"s-next-order-coupon-meta"},s&&t("span",{innerHTML:this.minSpendTpl.replace(":amount",s)}),e&&t("span",null,this.expiresTpl.replace(":date",e))))),t("div",{class:"s-next-order-coupon-actions"},t("div",{class:"s-next-order-coupon-code-box"},t("span",{class:"s-next-order-coupon-code-text"},this.coupon.code),t("salla-button",{shape:"link",class:"s-next-order-coupon-copy-btn",title:this.copyLabel,onClick:()=>this.copyCode()},t("span",{class:"s-next-order-coupon-copy-icon",innerHTML:n}))),t("salla-button",{href:salla.url.get(""),class:"s-next-order-coupon-shop-btn"},this.shopNowLabel))))}};e.style=":host{display:block}";export{e as salla_next_order_coupon}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as i,a as n}from"./p-jaN78U7Z.js";import{H as l}from"./p-XnA1YTjA.js";import"./p-CgtvEd63.js";const e=class{constructor(t){s(this,t),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.lang.onLoaded((()=>{this.status.querySelector(".s-button-text").innerHTML=this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(s=!0){let t=this.status.querySelector(".s-button-text");l.toggleElementClassIf(t,"s-button-hide","s-button-show",(()=>s)),this.btnLoader.style.display=s?"inherit":"none"}render(){return this.nextPage.length>1?t(i,{class:"s-infinite-scroll-container"},t("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let s=this,t=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return s.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==t.pageIndex&&t.option({loadOnScroll:!1}),3==t.pageIndex&&t.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return n(this)}};e.style="";export{e as salla_infinite_scroll}
4
+ import{r as s,h as t,H as i,a as n}from"./p-MrxrxOqi.js";import{H as l}from"./p-XnA1YTjA.js";import"./p-CgtvEd63.js";const e=class{constructor(t){s(this,t),this.nextPage="",this.autoload=!1,this.container="salla-infinite-scroll",this.item="salla-infinite-scroll > *",this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.lang.onLoaded((()=>{this.status.querySelector(".s-button-text").innerHTML=this.loadMoreText?this.loadMoreText:salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(s=!0){let t=this.status.querySelector(".s-button-text");l.toggleElementClassIf(t,"s-button-hide","s-button-show",(()=>s)),this.btnLoader.style.display=s?"inherit":"none"}render(){return this.nextPage.length>1?t(i,{class:"s-infinite-scroll-container"},t("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let s=this,t=salla.infiniteScroll.initiate(this.container,{history:!!this.autoload&&"push",scrollThreshold:!!this.autoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return s.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==t.pageIndex&&t.option({loadOnScroll:!1}),3==t.pageIndex&&t.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return n(this)}};e.style="";export{e as salla_infinite_scroll}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as a,h as r,a as t}from"./p-jaN78U7Z.js";import{S as l}from"./p-CXRKXFgT.js";import{T as e}from"./p-EpPIlSaQ.js";const o=class{constructor(r){a(this,r)}get productId(){return this.host.dataset.productId||salla.config.get("page.id")}componentWillLoad(){return salla.onReady().then((()=>salla.lang.onLoaded())).then((()=>this.prize())).catch((a=>salla.logger.error(a)))}handleClick(){salla.config.isGuest()?salla.event.dispatch("login::open"):this.exchangeModal.open()}render(){return"success"===this.prize.status&&this.productId?r("div",{class:"s-loyalty-program-banner-container"},r("div",null,r("p",{class:"s-loyalty-program-banner-container-banner-title"},salla.lang.get("pages.loyalty_program.want_to_redeem_free_product")),r("p",{class:"s-loyalty-program-banner-container-banner-subtitle"},salla.lang.get("pages.loyalty_program.exchange_points_for_free_product",{points:this.prize.data.cost_points}))),r("button",{onClick:()=>this.handleClick()},r("span",{innerHTML:l}),r("span",null,salla.lang.get("pages.loyalty_program.exchange_points"))),r("salla-modal",{ref:a=>this.exchangeModal=a,width:"sm"},this.prize.data?r("salla-reward-exchange",{productId:Number(this.productId),prize:this.prize.data}):"")):null}get host(){return t(this)}};(function(a,r,t,l){var e,o=arguments.length,s=o<3?r:null===l?l=Object.getOwnPropertyDescriptor(r,t):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(a,r,t,l);else for(var i=a.length-1;i>=0;i--)(e=a[i])&&(s=(o<3?e(s):o>3?e(r,t,s):e(r,t))||s);o>3&&s&&Object.defineProperty(r,t,s)})([e((async function(){if(!(salla.config.get("store.features")||[]).includes("loyalty-system"))return Promise.reject("Loyalty system is not enabled for merchant");const{loyalty_prize:a}=await salla.product.api.getDetails(this.productId);return a||Promise.reject("no loyalty prize for this product")}))],o.prototype,"prize",void 0),o.style="@media (max-width: 639px){.s-loyalty-program-modal .s-modal-body{position:relative !important;left:unset !important;bottom:unset !important;max-height:100dvh;overflow-y:auto !important}}.s-loyalty-exchange-card salla-product-card .s-product-card-image,.s-loyalty-exchange-card custom-salla-product-card .s-product-card-image{flex:none;aspect-ratio:1;overflow:hidden}.s-loyalty-exchange-card-btn{padding:0 1.25rem 1.25rem;margin-top:0.75rem}.s-loyalty-program-reward-details-products-grid{display:flex;flex-wrap:wrap;gap:1rem;margin-top:0.75rem}.s-loyalty-program-reward-details-products-grid>*{flex:1 1 100%;min-width:0;touch-action:pan-y}@media (min-width: 640px){.s-loyalty-program-reward-details-products-grid>*{flex-basis:calc((100% - 1rem) / 2)}}@media (min-width: 768px){.s-loyalty-program-reward-details-products-grid>*{flex-basis:calc((100% - 2rem) / 3)}}.s-loyalty-program-reward-details-products-grid>*:only-child{max-width:320px;margin-inline:auto}.s-loyalty-program-reward-details-products-grid:has(>*:nth-child(3))>*{flex-grow:0}";export{o as salla_loyalty_banner}
4
+ import{r as a,h as r,a as t}from"./p-MrxrxOqi.js";import{S as l}from"./p-CXRKXFgT.js";import{T as e}from"./p-DBIOj_I_.js";const o=class{constructor(r){a(this,r)}get productId(){return this.host.dataset.productId||salla.config.get("page.id")}componentWillLoad(){return salla.onReady().then((()=>salla.lang.onLoaded())).then((()=>this.prize())).catch((a=>salla.logger.error(a)))}handleClick(){salla.config.isGuest()?salla.event.dispatch("login::open"):this.exchangeModal.open()}render(){return"success"===this.prize.status&&this.productId?r("div",{class:"s-loyalty-program-banner-container"},r("div",null,r("p",{class:"s-loyalty-program-banner-container-banner-title"},salla.lang.get("pages.loyalty_program.want_to_redeem_free_product")),r("p",{class:"s-loyalty-program-banner-container-banner-subtitle"},salla.lang.get("pages.loyalty_program.exchange_points_for_free_product",{points:this.prize.data.cost_points}))),r("button",{onClick:()=>this.handleClick()},r("span",{innerHTML:l}),r("span",null,salla.lang.get("pages.loyalty_program.exchange_points"))),r("salla-modal",{ref:a=>this.exchangeModal=a,width:"sm"},this.prize.data?r("salla-reward-exchange",{productId:Number(this.productId),prize:this.prize.data}):"")):null}get host(){return t(this)}};(function(a,r,t,l){var e,o=arguments.length,s=o<3?r:null===l?l=Object.getOwnPropertyDescriptor(r,t):l;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(a,r,t,l);else for(var i=a.length-1;i>=0;i--)(e=a[i])&&(s=(o<3?e(s):o>3?e(r,t,s):e(r,t))||s);o>3&&s&&Object.defineProperty(r,t,s)})([e((async function(){if(!(salla.config.get("store.features")||[]).includes("loyalty-system"))return Promise.reject("Loyalty system is not enabled for merchant");const{loyalty_prize:a}=await salla.product.api.getDetails(this.productId);return a||Promise.reject("no loyalty prize for this product")}))],o.prototype,"prize",void 0),o.style="@media (max-width: 639px){.s-loyalty-program-modal .s-modal-body{position:relative !important;left:unset !important;bottom:unset !important;max-height:100dvh;overflow-y:auto !important}}.s-loyalty-exchange-card salla-product-card .s-product-card-image,.s-loyalty-exchange-card custom-salla-product-card .s-product-card-image{flex:none;aspect-ratio:1;overflow:hidden}.s-loyalty-exchange-card-btn{padding:0 1.25rem 1.25rem;margin-top:0.75rem}.s-loyalty-program-reward-details-products-grid{display:flex;flex-wrap:wrap;gap:1rem;margin-top:0.75rem}.s-loyalty-program-reward-details-products-grid>*{flex:1 1 100%;min-width:0;touch-action:pan-y}@media (min-width: 640px){.s-loyalty-program-reward-details-products-grid>*{flex-basis:calc((100% - 1rem) / 2)}}@media (min-width: 768px){.s-loyalty-program-reward-details-products-grid>*{flex-basis:calc((100% - 2rem) / 3)}}.s-loyalty-program-reward-details-products-grid>*:only-child{max-width:320px;margin-inline:auto}.s-loyalty-program-reward-details-products-grid:has(>*:nth-child(3))>*{flex-grow:0}";export{o as salla_loyalty_banner}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as a}from"./p-jaN78U7Z.js";const c=class{constructor(t){e(this,t),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return t(a,{key:"b1b2a6bf65c40643d59f392e91cc76acaea5e89e"},t("a",{key:"4b2026fd739b243a41bfc37fcb55bc07a1a54636",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},t("div",{key:"bbc7a7133da0e471ad92a5466e9ec0481d74cdd7",class:"s-list-tile-item-icon"},t("slot",{key:"e4e338854bfc7e6843c4b87f419c9aa59970c77b",name:"icon"})),t("div",{key:"1b7b2e0a65193be521cdf6cccc314c83f853216d",class:"s-list-tile-item-content"},t("div",{key:"4e6a178d219827b1feef394ea5564769bf11ded2",class:"s-list-tile-item-title"},t("slot",{key:"75b036812aca3e00162fc8c40459b67d4db2cc6f",name:"title"})),t("div",{key:"ab0959a43214ae0eb4cf092ea3738c71ed987709",class:"s-list-tile-item-subtitle"},t("slot",{key:"e13f66fb2a0e1c5ab2a9081c808973c9f9ecca45",name:"subtitle"}))),t("div",{key:"78c7542367a41a1f8bc74bca73d2581f5c0b7bfd",class:"s-list-tile-item-action"},t("slot",{key:"14c8c0f31d29855d743b52f82d52a3bed300b25f",name:"action"}))))}};c.style="";export{c as salla_list_tile}
4
+ import{r as e,h as t,H as a}from"./p-MrxrxOqi.js";const c=class{constructor(t){e(this,t),this.href=void 0,this.target="_self"}generateClass(){return{"s-list-tile-item":!0,"s-list-tile-item-href":!!this.href}}render(){return t(a,{key:"b1b2a6bf65c40643d59f392e91cc76acaea5e89e"},t("a",{key:"4b2026fd739b243a41bfc37fcb55bc07a1a54636",class:this.generateClass(),href:this.href||"#",target:this.target,"aria-label":"List Tile Link"},t("div",{key:"bbc7a7133da0e471ad92a5466e9ec0481d74cdd7",class:"s-list-tile-item-icon"},t("slot",{key:"e4e338854bfc7e6843c4b87f419c9aa59970c77b",name:"icon"})),t("div",{key:"1b7b2e0a65193be521cdf6cccc314c83f853216d",class:"s-list-tile-item-content"},t("div",{key:"4e6a178d219827b1feef394ea5564769bf11ded2",class:"s-list-tile-item-title"},t("slot",{key:"75b036812aca3e00162fc8c40459b67d4db2cc6f",name:"title"})),t("div",{key:"ab0959a43214ae0eb4cf092ea3738c71ed987709",class:"s-list-tile-item-subtitle"},t("slot",{key:"e13f66fb2a0e1c5ab2a9081c808973c9f9ecca45",name:"subtitle"}))),t("div",{key:"78c7542367a41a1f8bc74bca73d2581f5c0b7bfd",class:"s-list-tile-item-action"},t("slot",{key:"14c8c0f31d29855d743b52f82d52a3bed300b25f",name:"action"}))))}};c.style="";export{c as salla_list_tile}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as i,a as s}from"./p-jaN78U7Z.js";const a=class{constructor(e){t(this,e),this.loading=!1,this.hasError=!1,this.productData=null}async componentWillLoad(){await salla.onReady(),await this.fetchProduct()}componentDidLoad(){this.ensureParentContainsFloats()}componentDidRender(){this.renderCardNode()}ensureParentContainsFloats(){if("left"!==this.align&&"right"!==this.align)return;const t=this.hostEl?.parentElement;if(!t)return;const e=getComputedStyle(t);"block"===e.display&&"visible"===e.overflow&&"none"===e.float&&(t.style.display="flow-root")}fetchProduct(){return this.productId?(this.loading=!0,this.hasError=!1,salla.api.withoutNotifier((()=>salla.product.api.getDetails(this.productId))).then((t=>{const e=t.data;this.productData=e??null,this.hasError=!e})).catch((()=>{this.productData=null,this.hasError=!0})).finally((()=>{this.loading=!1}))):(this.productData=null,this.loading=!1,void(this.hasError=!1))}renderCardNode(){if(!this.cardContainer)return;if(this.cardContainer.textContent="",!this.productData||this.loading||this.hasError)return;const t=window.customElements.get("custom-salla-product-card")?"custom-salla-product-card":"salla-product-card",e=document.createElement(t),i=this.source||"embed-card";e.setAttribute("source",i),e.product={...this.productData,url:this.withViewedSource(this.productData.url,i)},this.cardContainer.appendChild(e)}withViewedSource(t,e){if(!t)return t;try{const i=new URL(t,window.location.origin);return i.searchParams.set("_svs",e),i.toString()}catch{return t}}render(){const t={"s-product-card-embed-card":!0,"s-product-card-embed-card-align-left":"left"===this.align,"s-product-card-embed-card-align-right":"right"===this.align,"s-product-card-embed-card-align-center":"center"===this.align};return e(i,{key:"3d9fb0dc8473e0959bbe13b4f8c8eea7a51830ea"},this.hasError&&e("span",{key:"25228d6d007d7dcda5e5767e14d2c363abfdab3e",class:"s-product-card-embed-fallback"}),e("div",{key:"d66d592bfad1468b745f3a954c335f72ecda1e08",class:t,ref:t=>{this.cardContainer=t}}))}get hostEl(){return s(this)}};a.style='@charset "UTF-8";:host{display:inline-block;vertical-align:top;max-width:12rem}:host([align=left]){float:inline-start;margin-block-end:1em;margin-inline-end:1em;shape-outside:margin-box}:host([align=right]){float:inline-end;margin-block-end:1em;margin-inline-start:1em;shape-outside:margin-box}:host([align=center]){display:block;clear:both;margin-block:1em;margin-inline:auto}.s-product-card-embed-card{display:block}';export{a as salla_product_card_embed}
4
+ import{r as t,h as e,H as i,a as s}from"./p-MrxrxOqi.js";const a=class{constructor(e){t(this,e),this.loading=!1,this.hasError=!1,this.productData=null}async componentWillLoad(){await salla.onReady(),await this.fetchProduct()}componentDidLoad(){this.ensureParentContainsFloats()}componentDidRender(){this.renderCardNode()}ensureParentContainsFloats(){if("left"!==this.align&&"right"!==this.align)return;const t=this.hostEl?.parentElement;if(!t)return;const e=getComputedStyle(t);"block"===e.display&&"visible"===e.overflow&&"none"===e.float&&(t.style.display="flow-root")}fetchProduct(){return this.productId?(this.loading=!0,this.hasError=!1,salla.api.withoutNotifier((()=>salla.product.api.getDetails(this.productId))).then((t=>{const e=t.data;this.productData=e??null,this.hasError=!e})).catch((()=>{this.productData=null,this.hasError=!0})).finally((()=>{this.loading=!1}))):(this.productData=null,this.loading=!1,void(this.hasError=!1))}renderCardNode(){if(!this.cardContainer)return;if(this.cardContainer.textContent="",!this.productData||this.loading||this.hasError)return;const t=window.customElements.get("custom-salla-product-card")?"custom-salla-product-card":"salla-product-card",e=document.createElement(t),i=this.source||"embed-card";e.setAttribute("source",i),e.product={...this.productData,url:this.withViewedSource(this.productData.url,i)},this.cardContainer.appendChild(e)}withViewedSource(t,e){if(!t)return t;try{const i=new URL(t,window.location.origin);return i.searchParams.set("_svs",e),i.toString()}catch{return t}}render(){const t={"s-product-card-embed-card":!0,"s-product-card-embed-card-align-left":"left"===this.align,"s-product-card-embed-card-align-right":"right"===this.align,"s-product-card-embed-card-align-center":"center"===this.align};return e(i,{key:"3d9fb0dc8473e0959bbe13b4f8c8eea7a51830ea"},this.hasError&&e("span",{key:"25228d6d007d7dcda5e5767e14d2c363abfdab3e",class:"s-product-card-embed-fallback"}),e("div",{key:"d66d592bfad1468b745f3a954c335f72ecda1e08",class:t,ref:t=>{this.cardContainer=t}}))}get hostEl(){return s(this)}};a.style='@charset "UTF-8";:host{display:inline-block;vertical-align:top;max-width:12rem}:host([align=left]){float:inline-start;margin-block-end:1em;margin-inline-end:1em;shape-outside:margin-box}:host([align=right]){float:inline-end;margin-block-end:1em;margin-inline-start:1em;shape-outside:margin-box}:host([align=center]){display:block;clear:both;margin-block:1em;margin-inline:auto}.s-product-card-embed-card{display:block}';export{a as salla_product_card_embed}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as s}from"./p-jaN78U7Z.js";const i=class{constructor(t){e(this,t),this.otpInputs=[],this.deletePendingDays=null,this.currentStep="confirm",this.isDeletePending=!1,this.otpType="email",this.otpHasError=!1,this.otpErrorMessage="",this.isSubmitting=!1,this.isVerifyingOtp=!1,this.isSwitchingChannel=!1,this.resendAfter=30,this.showResendLink=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.translationDefaults={"pages.profile.delete_account":{ar:"حذف الحساب",en:"Delete account"},"pages.profile.delete_account_description":{ar:"سيُحذف حسابك وبياناتك من المتجر نهائيًا، بما في ذلك سجل طلباتك.",en:"Your account and data will be permanently deleted from the store, including your order history."},"pages.profile.delete_account_confirm_title":{ar:"هل تريد حذف حسابك؟",en:"Do you want to delete your account?"},"pages.profile.delete_account_warning":{ar:"بعد الحذف، ستفقد الوصول إلى بياناتك، بما في ذلك سجل الطلبات، وقائمة الأمنيات، وأي نقاط ولاء أو رصيد متاح في المحفظة.",en:"After deletion, you will lose access to your data, including order history, wishlist, and any loyalty points or wallet balance."},"pages.profile.cancel":{ar:"إلغاء",en:"Cancel"},"pages.profile.delete_account_otp_title":{ar:"تأكيد حذف الحساب",en:"Confirm account deletion"},"pages.profile.delete_account_otp_instruction":{ar:"للمتابعة، أدخل رمز التحقٌّق المرسل إلى:",en:"To continue, enter the verification code sent to:"},"pages.profile.delete_account_confirm_otp":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.profile.delete_account_otp_required":{ar:"يرجى إدخال رمز التحقٌّق",en:"Please enter the verification code"},"pages.profile.delete_account_send_via_phone":{ar:"إرسال عبر الهاتف",en:"Send via phone"},"pages.profile.delete_account_send_via_email":{ar:"إرسال عبر البريد الإلكتروني",en:"Send via email"},"pages.profile.delete_account_success_title":{ar:"أُرسل طلب حذف الحساب",en:"Account deletion request submitted"},"pages.profile.delete_account_success_message":{ar:"سيُحذف حسابك خلال 30 يومًا. يمكنك إلغاء الطلب بتسجيل الدخول مرة أخرى قبل اكتمال الحذف.",en:"Your account will be deleted within 30 days. You can cancel the request by signing in again before deletion is complete."},"pages.profile.ok":{ar:"موافق",en:"OK"},"pages.profile.cancel_deletion_request":{ar:"تراجع عن الحذف",en:"Withdraw deletion"},"pages.profile.delete_account_pending":{ar:"حسابك مجدول للحذف نهائيًا من المتجر خلال :days يومًا. يمكنك التراجع عن الحذف قبل انقضاء المدة.",en:"Your account will be deleted permanently from the store within :days days. You can withdraw the deletion before the deadline."},"pages.profile.delete_request_cancelled":{ar:"تم إلغاء طلب الحذف",en:"Deletion request cancelled"}},this.registerTranslationDefaults(),this.loadTranslations(),salla.onReady((()=>{this.isHiddenName=salla.config.get("user.is_hidden_name"),this.isNotifiable=salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.fetchDeleteRequestStatus(),this.isNotifiable&&this.isHiddenName||salla.event.on("profile::info.fetched",(e=>{this.isHiddenName=e.data.is_hidden_name,this.isNotifiable=e.data.is_notifiable}))})),salla.lang.onLoaded((()=>{this.registerTranslationDefaults(),this.loadTranslations()}))}getDaysUntilExecution(e){return Math.max(0,Math.ceil(((e>1e12?e:1e3*e)-Date.now())/864e5))}applyPendingMessage(){const e=salla.lang.get("pages.profile.delete_account_pending");this.deleteAccountPending=null!=this.deletePendingDays?e.replace(/:days/g,String(salla.helpers.number(this.deletePendingDays))):e}async fetchDeleteRequestStatus(){try{const e=await salla.profile.getDeleteRequest(),t=e?.data??null,s=t?.data_request||t,i=s?.status;this.isDeletePending="pending"===i;const a=s?.execution_at;this.deletePendingDays=null==a||Number.isNaN(Number(a))?null:this.getDaysUntilExecution(Number(a)),this.applyPendingMessage()}catch{}}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const e=Object.entries(this.translationDefaults).reduce(((e,[t,s])=>(salla.lang.get(t)===t&&(e[t]=s),e)),{});Object.keys(e).length&&salla.lang.addBulk(e)}loadTranslations(){this.deleteAccount=salla.lang.get("pages.profile.delete_account"),this.deleteAccountDesc=salla.lang.get("pages.profile.delete_account_description"),this.deleteConfirmTitle=salla.lang.get("pages.profile.delete_account_confirm_title"),this.deleteAccountWarning=salla.lang.get("pages.profile.delete_account_warning"),this.cancelLabel=salla.lang.get("pages.profile.cancel"),this.deleteOtpTitle=salla.lang.get("pages.profile.delete_account_otp_title"),this.deleteOtpInstruction=salla.lang.get("pages.profile.delete_account_otp_instruction"),this.deleteConfirmOtp=salla.lang.get("pages.profile.delete_account_confirm_otp"),this.sendViaPhone=salla.lang.get("pages.profile.delete_account_send_via_phone"),this.sendViaEmail=salla.lang.get("pages.profile.delete_account_send_via_email"),this.deleteSuccessTitle=salla.lang.get("pages.profile.delete_account_success_title"),this.deleteSuccessMessage=salla.lang.get("pages.profile.delete_account_success_message"),this.okLabel=salla.lang.get("pages.profile.ok"),this.cancelDeletionRequest=salla.lang.get("pages.profile.cancel_deletion_request"),this.applyPendingMessage(),this.resendAfterLabel=salla.lang.get("blocks.header.resend_after"),this.resendLabel=salla.lang.get("blocks.comments.submit"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description")}toggleSetting(e,t){salla.profile.updateSettings({name:e,value:t.target.checked})}capitalizeText(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}getOtpTarget(){return"email"===this.otpType?salla.config.get("user.email")||"":salla.config.get("user.mobile")||""}updateModalForStep(){if(this.confirmationModal)switch(this.currentStep){case"confirm":this.confirmationModal.setTitle(this.capitalizeText(this.deleteConfirmTitle));break;case"otp":this.confirmationModal.setTitle(this.capitalizeText(this.deleteOtpTitle));break;case"success":this.confirmationModal.setTitle(this.capitalizeText(this.deleteSuccessTitle))}}openDeleteModal(){this.currentStep="confirm",this.otpType="email",this.resetOtpInputs(),this.clearResendTimer(),this.updateModalForStep(),this.confirmationModal.open()}closeDeleteModal(){this.clearResendTimer(),this.confirmationModal?.close()}goBackFromOtp(){this.clearResendTimer(),this.resetOtpInputs(),this.resetOtpError(),this.currentStep="confirm",this.updateModalForStep()}async handleModalVisibilityChanged(e){if(e.detail)return;this.clearResendTimer();const t="success"===this.currentStep;t&&(this.isDeletePending=!0),this.currentStep="confirm",this.resetOtpInputs(),t&&await this.fetchDeleteRequestStatus()}formatResendTimer(e){return"00 : "+(e>=10?`${e}`:`0${e}`)}updateResendTimerDisplay(){this.timerEl&&(this.timerEl.innerHTML=this.formatResendTimer(this.resendAfter))}isDeleteRequestInFlight(){return this.isSubmitting||this.isSwitchingChannel||this.isVerifyingOtp}async initiateDeleteRequest(e="confirm"){if(!this.isDeleteRequestInFlight()){"switch"===e||"resend"===e?this.isSwitchingChannel=!0:this.isSubmitting=!0;try{await salla.profile.initiateDeleteRequest(this.otpType),this.currentStep="otp",this.updateModalForStep(),this.resetOtpInputs(),this.startResendTimer(),setTimeout((()=>this.otpInputs[0]?.focus()),100)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{"switch"===e||"resend"===e?this.isSwitchingChannel=!1:this.isSubmitting=!1}}}async switchOtpChannel(){this.isDeleteRequestInFlight()||(this.otpType="email"===this.otpType?"mobile":"email",await this.initiateDeleteRequest("switch"))}async resendOtp(){this.showResendLink&&!this.isDeleteRequestInFlight()&&await this.initiateDeleteRequest("resend")}collectOtpCode(){const e=salla.helpers.number(this.otpInputs.map((e=>e?.value||"")).join(""),!0).replace(/[^0-9]/g,"");return this.hiddenCodeInput&&(this.hiddenCodeInput.value=e),e}resetOtpError(){this.otpHasError=!1,this.otpErrorMessage=""}setOtpError(e){this.otpHasError=!0,this.otpErrorMessage=e}async verifyDeleteOtp(){if(this.isVerifyingOtp||this.isSwitchingChannel)return;const e=this.collectOtpCode();if(e.length<4)return this.setOtpError(salla.lang.get("pages.profile.delete_account_otp_required")),void this.otpInputs[e.length]?.focus();this.resetOtpError(),this.isVerifyingOtp=!0;try{const t=await salla.profile.verifyDeleteRequest({type:this.otpType,code:e});this.deleteSuccessMessage=t?.data?.message||salla.lang.get("pages.profile.delete_account_success_message"),this.clearResendTimer(),this.resetOtpInputs(),this.otpInputs=[],this.currentStep="success",this.updateModalForStep()}catch(e){this.setOtpError(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred")),this.resetOtpInputs()}finally{this.isVerifyingOtp=!1}}async confirmSuccess(){this.isDeletePending=!0,this.closeDeleteModal(),this.currentStep="confirm",await this.fetchDeleteRequestStatus()}async cancelDeleteRequest(){if(!this.isSubmitting){this.isSubmitting=!0;try{const e=(await salla.profile.cancelDeleteRequest()).message||salla.lang.get("pages.profile.delete_request_cancelled");this.isDeletePending=!1,salla.notify?.success?.(e)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{this.isSubmitting=!1}}}resetOtpInputs(){this.otpInputs.forEach((e=>{e&&(e.value="")})),this.hiddenCodeInput&&(this.hiddenCodeInput.value="")}modifyNextOtpInput(e,t){e.value=t[0],t=t.substring(1),e.nextElementSibling&&t.length?this.modifyNextOtpInput(e.nextElementSibling,t):e.nextElementSibling||0!==t.length?e.nextElementSibling&&0===t.length&&e.nextElementSibling.focus():e.focus()}splitOtpNumber(e){const t=salla.helpers.number(e.data||e.target.value||"",!0).replace(/[^0-9]/g,"");t&&1!==t.length&&this.modifyNextOtpInput(e.target,t)}allOtpInputsFilled(){return this.otpInputs.every((e=>e?.value))}handleOtpInput(e){this.resetOtpError(),e.target.value=salla.helpers.number(e.target.value||"",!0),salla.helpers.inputDigitsOnly(e.target),this.allOtpInputsFilled()&&setTimeout((()=>this.verifyDeleteOtp()),100)}handleOtpKeyUp(e){if(this.resetOtpError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(e.key))return;const t=e.keyCode||e.charCode;e.target.value?(e.target.nextElementSibling?.focus(),e.target.nextElementSibling?.select()):[8,46].includes(t)&&(e.target.previousElementSibling?.focus(),e.target.previousElementSibling?.select()),e.target.value.length>1&&this.splitOtpNumber(e)}handleOtpPaste(e){this.resetOtpError();const t=salla.helpers.number(e.clipboardData.getData("text")||"",!0).replace(/[^0-9]/g,"").substring(0,this.otpInputs.length);this.otpInputs.forEach((e=>e.value="")),this.otpInputs[0]&&this.modifyNextOtpInput(this.otpInputs[0],t)}handleOtpFocus(e){e.target!==this.otpInputs[0]&&(""===this.otpInputs[0]?.value&&this.otpInputs[0].focus(),""===e.target.previousElementSibling?.value&&e.target.previousElementSibling.focus())}startResendTimer(){this.clearResendTimer(),this.resendAfter=30,this.showResendLink=!1,this.updateResendTimerDisplay(),this.resendTimerId=setInterval((()=>{if(this.resendAfter--,this.resendAfter<=0)return this.clearResendTimer(),void(this.showResendLink=!0);this.updateResendTimerDisplay()}),1e3)}clearResendTimer(){this.resendTimerId&&(clearInterval(this.resendTimerId),this.resendTimerId=null),this.showResendLink=!1}renderUserDeleteIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",color:"currentColor",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M14.5 8C14.5 5.23858 12.2614 3 9.5 3C6.73858 3 4.5 5.23858 4.5 8C4.5 10.7614 6.73858 13 9.5 13C12.2614 13 14.5 10.7614 14.5 8Z"}),t("path",{d:"M15.5 21L18.5 18M18.5 18L21.5 15M18.5 18L15.5 15M18.5 18L21.5 21"}),t("path",{d:"M2.5 20C2.5 16.134 5.63401 13 9.5 13C10.775 13 11.9704 13.3409 13 13.9365"}))}renderConfirmStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-warning"},this.deleteAccountWarning),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--row"},t("salla-button",{width:"wide",fill:"outline",color:"danger",onClick:()=>this.closeDeleteModal()},this.capitalizeText(this.cancelLabel)),t("salla-button",{width:"wide",color:"primary",loading:this.isSubmitting,onClick:()=>this.initiateDeleteRequest()},this.capitalizeText(this.deleteAccount))))}renderOtpStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-otp-instruction"},this.deleteOtpInstruction),t("p",{class:"s-user-settings-delete-otp-target"},this.getOtpTarget()),t("input",{type:"hidden",name:"code",maxlength:"4",ref:e=>this.hiddenCodeInput=e}),t("div",{class:{"s-user-settings-delete-otp-codes":!0,"has-error":this.otpHasError},dir:"ltr"},[1,2,3,4].map((e=>t("input",{type:"text",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",id:`delete-otp-${e}`,class:{"s-user-settings-delete-otp-input":!0,"s-has-error":this.otpHasError},onInput:e=>this.handleOtpInput(e),onPaste:e=>this.handleOtpPaste(e),onKeyUp:e=>this.handleOtpKeyUp(e),onFocus:e=>this.handleOtpFocus(e),ref:t=>this.otpInputs[e-1]=t,required:!0})))),this.otpHasError&&this.otpErrorMessage?t("span",{class:"s-user-settings-delete-otp-error"},this.otpErrorMessage):"",t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{width:"wide",color:"primary",disabled:this.isSwitchingChannel,onClick:()=>this.verifyDeleteOtp()},this.capitalizeText(this.deleteConfirmOtp)),t("salla-button",{width:"wide",fill:"outline",color:"primary",disabled:this.isVerifyingOtp,onClick:()=>this.switchOtpChannel()},this.capitalizeText("email"===this.otpType?this.sendViaPhone:this.sendViaEmail))),t("p",{class:"s-user-settings-delete-otp-resend",style:{display:this.showResendLink?"none":"block"}},this.resendAfterLabel,t("b",{class:"s-user-settings-delete-otp-timer mx-1 font-bold",ref:e=>this.timerEl=e})),t("a",{href:"#",class:"s-user-settings-delete-otp-resend-link",style:{display:this.showResendLink?"block":"none"},onClick:e=>{e.preventDefault(),this.resendOtp()}},this.resendLabel))}renderSuccessStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-success-body"},this.deleteSuccessMessage),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{class:"s-user-settings-delete-success-btn",width:"wide",color:"primary",onClick:()=>this.confirmSuccess()},this.capitalizeText(this.okLabel))))}renderDeleteStep(){switch(this.currentStep){case"otp":return this.renderOtpStep();case"success":return this.renderSuccessStep();default:return this.renderConfirmStep()}}renderDeleteSectionAction(){return this.isDeletePending?t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",loading:this.isSubmitting,onClick:()=>this.cancelDeleteRequest()},this.capitalizeText(this.cancelDeletionRequest)):t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeleteModal()},this.capitalizeText(this.deleteAccount))}render(){return t(s,{key:"64356c5b57d826fce8c29cc319a9762464c7fe51",class:"s-user-settings-wrapper"},this.canHideName&&t("div",{key:"4f7b3eb703f89e4a758fca54ba1b214f6724aaea",class:"s-user-settings-section"},t("salla-list-tile",{key:"7ad109e36b278fe81a314d51e1ab68030dd96cdc"},t("div",{key:"c789b7e2c541e25aaaf336e052d1986f6429da71",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"5d7b377aefb80139527d8814ee2c636fa9c73e0f",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>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-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.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),t("div",{key:"fdb9d6130ef27cffbe4e2ef06e7b9155d0d04c2b",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),t("div",{key:"bd8592a487c79926355eeea25a5e1429bca0fd80",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),t("div",{key:"cf21ed12bb38dc3a613efac6d017a72aab38780b",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"160140e25cf8e6c4556e52c0b36ba5769618b419",class:"s-toggle"},t("input",{key:"369a694fabbd42e6c239b23c26d68f858775ffe2",class:"s-toggle-input",checked:this.isHiddenName,onChange:e=>this.toggleSetting("is_hidden_name",e),type:"checkbox"}),t("div",{key:"5952ec01913ef95d888eeb3aace14123ffd3ef6f",class:"s-toggle-switcher"}))))),t("div",{key:"885355f8435759c9359a3d9eb95d5637b1c74751",class:"s-user-settings-section"},t("salla-list-tile",{key:"93b607850b20add5384a3b28e4e58fbfcb181d53"},t("div",{key:"c795aabfdc6df0beb9c0bfcf73ad87625eb7f51b",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"a59ede027c4466a1e84e8e8b4c649c7b418dd0a3",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>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),t("div",{key:"e7af96b6f919a8be8bb126237cb3977e72a7c089",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),t("div",{key:"dab7b270443b6eddccd7df739c2bee82eb7706af",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),t("div",{key:"56a6f18c788891fe9215a57d0fcaa5cf98bd3aa5",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"1fc28780fe779099eaed7916f31cbbb681c10fe9",class:"s-toggle"},t("input",{key:"832edd6e5b806171bb913163b7d5c19dbb0833f5",class:"s-toggle-input",checked:this.isNotifiable,onChange:e=>this.toggleSetting("is_notifiable",e),type:"checkbox"}),t("div",{key:"54260d8cca19ca6914cdd3bf15093b9669fef44a",class:"s-toggle-switcher"}))))),t("div",{key:"549bae1159a55b035952a12c8dc9d2b9d660f5bf",class:"s-user-settings-section s-user-settings-section-delete-user"},t("salla-list-tile",{key:"7969327e863cd998a120f27d61621d83ef8e57d5"},t("div",{key:"acf14b5e6ce76657fe0016aa63e26851e7688cd5",slot:"icon",class:"s-user-settings-section-icon"},this.renderUserDeleteIcon()),t("div",{key:"4a38cf9d0510e784317b0eb4db2fd4589a9f71d4",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deleteAccount)),t("div",{key:"054f6a6c30f2eb9794f83a0998f20e208c7ed85a",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.isDeletePending?this.deleteAccountPending:this.deleteAccountDesc)),t("div",{key:"00d392a300b986d5d3e6f6711e6996df9731962d",slot:"action",class:"s-user-settings-section-action"},this.renderDeleteSectionAction()))),t("salla-modal",{key:"d4e8006e57d9c35267177f07b60e510ea3e53400",id:"salla-user-settings-delete-modal",width:"xs",centered:!0,showBack:"otp"===this.currentStep,isClosable:"success"!==this.currentStep,iconStyle:"success"===this.currentStep?"success":void 0,onModalVisibilityChanged:e=>this.handleModalVisibilityChanged(e),onModalBack:()=>this.goBackFromOtp(),ref:e=>this.confirmationModal=e},"success"!==this.currentStep?t("span",{slot:"icon",class:"s-user-settings-delete-icon"},this.renderUserDeleteIcon()):null,t("div",{key:this.currentStep,class:"s-user-settings-delete-step"},this.renderDeleteStep())))}};i.style=".s-modal-header-inner{display:flex;flex-direction:column !important;align-items:center !important;justify-content:center !important}.s-modal-header-content{text-align:center !important}.s-user-settings-delete-body{text-align:center}.s-user-settings-delete-icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;border-radius:9999px;border:1px solid var(--infinte-color);color:var(--infinte-color);margin:0 auto 1rem}.s-user-settings-delete-icon svg{width:1.5rem;height:1.5rem}.s-user-settings-delete-warning{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-actions--row{display:flex;gap:0.75rem;justify-content:center}.s-user-settings-delete-actions--row salla-button{flex:1}.s-user-settings-delete-actions--stack{display:flex;flex-direction:column;gap:0.75rem;margin-top:1.25rem}.s-user-settings-delete-otp-instruction{color:#6b7280;font-size:0.875rem}.s-user-settings-delete-otp-target{color:#6b7280;direction:ltr;margin-bottom:1.25rem}.s-user-settings-delete-otp-codes{display:flex;justify-content:stretch;gap:0.75rem;direction:ltr;margin-bottom:0.75rem;width:100%}.s-user-settings-delete-otp-codes.has-error{margin-bottom:0}.s-user-settings-delete-otp-input{flex:1 1 0;min-width:0;width:100%;height:3.5rem;text-align:center;border:1px solid #d1d5db;border-radius:0.5rem;font-size:1.25rem;font-weight:600;color:#111827;outline:none}.s-user-settings-delete-otp-input:focus{border-color:#004956;box-shadow:0 0 0 1px #004956}.s-user-settings-delete-otp-input.s-has-error{border-color:#ef4444 !important}.s-user-settings-delete-otp-input.s-has-error:focus{border-color:#ef4444 !important;box-shadow:0 0 0 1px #ef4444}.s-user-settings-delete-otp-input::-webkit-outer-spin-button,.s-user-settings-delete-otp-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-user-settings-delete-otp-input[type=text]{-moz-appearance:textfield}.s-user-settings-delete-otp-error{display:block;color:#ef4444;font-size:0.75rem;text-align:center;padding-top:0.75rem;margin-bottom:1.25rem}.s-user-settings-delete-otp-resend{color:#6b7280;font-size:0.75rem;margin-top:1rem;text-align:center}.s-user-settings-delete-otp-timer{font-weight:600;direction:ltr;display:inline-block}.s-user-settings-delete-otp-resend-link{display:block;color:#004956;font-size:0.875rem;margin-top:1rem;text-align:center;text-decoration:underline;cursor:pointer}.s-user-settings-delete-success-body{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-success-btn{--s-button-color:#004956}";export{i as salla_user_settings}
4
+ import{r as e,h as t,H as s}from"./p-MrxrxOqi.js";const i=class{constructor(t){e(this,t),this.otpInputs=[],this.deletePendingDays=null,this.currentStep="confirm",this.isDeletePending=!1,this.otpType="email",this.otpHasError=!1,this.otpErrorMessage="",this.isSubmitting=!1,this.isVerifyingOtp=!1,this.isSwitchingChannel=!1,this.resendAfter=30,this.showResendLink=!1,this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.translationDefaults={"pages.profile.delete_account":{ar:"حذف الحساب",en:"Delete account"},"pages.profile.delete_account_description":{ar:"سيُحذف حسابك وبياناتك من المتجر نهائيًا، بما في ذلك سجل طلباتك.",en:"Your account and data will be permanently deleted from the store, including your order history."},"pages.profile.delete_account_confirm_title":{ar:"هل تريد حذف حسابك؟",en:"Do you want to delete your account?"},"pages.profile.delete_account_warning":{ar:"بعد الحذف، ستفقد الوصول إلى بياناتك، بما في ذلك سجل الطلبات، وقائمة الأمنيات، وأي نقاط ولاء أو رصيد متاح في المحفظة.",en:"After deletion, you will lose access to your data, including order history, wishlist, and any loyalty points or wallet balance."},"pages.profile.cancel":{ar:"إلغاء",en:"Cancel"},"pages.profile.delete_account_otp_title":{ar:"تأكيد حذف الحساب",en:"Confirm account deletion"},"pages.profile.delete_account_otp_instruction":{ar:"للمتابعة، أدخل رمز التحقٌّق المرسل إلى:",en:"To continue, enter the verification code sent to:"},"pages.profile.delete_account_confirm_otp":{ar:"تأكيد الحذف",en:"Confirm deletion"},"pages.profile.delete_account_otp_required":{ar:"يرجى إدخال رمز التحقٌّق",en:"Please enter the verification code"},"pages.profile.delete_account_send_via_phone":{ar:"إرسال عبر الهاتف",en:"Send via phone"},"pages.profile.delete_account_send_via_email":{ar:"إرسال عبر البريد الإلكتروني",en:"Send via email"},"pages.profile.delete_account_success_title":{ar:"أُرسل طلب حذف الحساب",en:"Account deletion request submitted"},"pages.profile.delete_account_success_message":{ar:"سيُحذف حسابك خلال 30 يومًا. يمكنك إلغاء الطلب بتسجيل الدخول مرة أخرى قبل اكتمال الحذف.",en:"Your account will be deleted within 30 days. You can cancel the request by signing in again before deletion is complete."},"pages.profile.ok":{ar:"موافق",en:"OK"},"pages.profile.cancel_deletion_request":{ar:"تراجع عن الحذف",en:"Withdraw deletion"},"pages.profile.delete_account_pending":{ar:"حسابك مجدول للحذف نهائيًا من المتجر خلال :days يومًا. يمكنك التراجع عن الحذف قبل انقضاء المدة.",en:"Your account will be deleted permanently from the store within :days days. You can withdraw the deletion before the deadline."},"pages.profile.delete_request_cancelled":{ar:"تم إلغاء طلب الحذف",en:"Deletion request cancelled"}},this.registerTranslationDefaults(),this.loadTranslations(),salla.onReady((()=>{this.isHiddenName=salla.config.get("user.is_hidden_name"),this.isNotifiable=salla.config.get("user.is_notifiable"),this.canHideName=salla.config.get("store.settings.rating.can_customer_hide_name"),this.fetchDeleteRequestStatus(),this.isNotifiable&&this.isHiddenName||salla.event.on("profile::info.fetched",(e=>{this.isHiddenName=e.data.is_hidden_name,this.isNotifiable=e.data.is_notifiable}))})),salla.lang.onLoaded((()=>{this.registerTranslationDefaults(),this.loadTranslations()}))}getDaysUntilExecution(e){return Math.max(0,Math.ceil(((e>1e12?e:1e3*e)-Date.now())/864e5))}applyPendingMessage(){const e=salla.lang.get("pages.profile.delete_account_pending");this.deleteAccountPending=null!=this.deletePendingDays?e.replace(/:days/g,String(salla.helpers.number(this.deletePendingDays))):e}async fetchDeleteRequestStatus(){try{const e=await salla.profile.getDeleteRequest(),t=e?.data??null,s=t?.data_request||t,i=s?.status;this.isDeletePending="pending"===i;const a=s?.execution_at;this.deletePendingDays=null==a||Number.isNaN(Number(a))?null:this.getDaysUntilExecution(Number(a)),this.applyPendingMessage()}catch{}}registerTranslationDefaults(){if(!salla?.lang?.addBulk)return;const e=Object.entries(this.translationDefaults).reduce(((e,[t,s])=>(salla.lang.get(t)===t&&(e[t]=s),e)),{});Object.keys(e).length&&salla.lang.addBulk(e)}loadTranslations(){this.deleteAccount=salla.lang.get("pages.profile.delete_account"),this.deleteAccountDesc=salla.lang.get("pages.profile.delete_account_description"),this.deleteConfirmTitle=salla.lang.get("pages.profile.delete_account_confirm_title"),this.deleteAccountWarning=salla.lang.get("pages.profile.delete_account_warning"),this.cancelLabel=salla.lang.get("pages.profile.cancel"),this.deleteOtpTitle=salla.lang.get("pages.profile.delete_account_otp_title"),this.deleteOtpInstruction=salla.lang.get("pages.profile.delete_account_otp_instruction"),this.deleteConfirmOtp=salla.lang.get("pages.profile.delete_account_confirm_otp"),this.sendViaPhone=salla.lang.get("pages.profile.delete_account_send_via_phone"),this.sendViaEmail=salla.lang.get("pages.profile.delete_account_send_via_email"),this.deleteSuccessTitle=salla.lang.get("pages.profile.delete_account_success_title"),this.deleteSuccessMessage=salla.lang.get("pages.profile.delete_account_success_message"),this.okLabel=salla.lang.get("pages.profile.ok"),this.cancelDeletionRequest=salla.lang.get("pages.profile.cancel_deletion_request"),this.applyPendingMessage(),this.resendAfterLabel=salla.lang.get("blocks.header.resend_after"),this.resendLabel=salla.lang.get("blocks.comments.submit"),this.promotionalMsgs=salla.lang.get("pages.profile.promotional_messages"),this.hideMyName=salla.lang.get("pages.profile.hide_my_name"),this.hideMyNameDesc=salla.lang.get("pages.profile.hide_my_name_desc"),this.promotionalMsgsDesc=salla.lang.get("pages.profile.promotional_messages_description")}toggleSetting(e,t){salla.profile.updateSettings({name:e,value:t.target.checked})}capitalizeText(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}getOtpTarget(){return"email"===this.otpType?salla.config.get("user.email")||"":salla.config.get("user.mobile")||""}updateModalForStep(){if(this.confirmationModal)switch(this.currentStep){case"confirm":this.confirmationModal.setTitle(this.capitalizeText(this.deleteConfirmTitle));break;case"otp":this.confirmationModal.setTitle(this.capitalizeText(this.deleteOtpTitle));break;case"success":this.confirmationModal.setTitle(this.capitalizeText(this.deleteSuccessTitle))}}openDeleteModal(){this.currentStep="confirm",this.otpType="email",this.resetOtpInputs(),this.clearResendTimer(),this.updateModalForStep(),this.confirmationModal.open()}closeDeleteModal(){this.clearResendTimer(),this.confirmationModal?.close()}goBackFromOtp(){this.clearResendTimer(),this.resetOtpInputs(),this.resetOtpError(),this.currentStep="confirm",this.updateModalForStep()}async handleModalVisibilityChanged(e){if(e.detail)return;this.clearResendTimer();const t="success"===this.currentStep;t&&(this.isDeletePending=!0),this.currentStep="confirm",this.resetOtpInputs(),t&&await this.fetchDeleteRequestStatus()}formatResendTimer(e){return"00 : "+(e>=10?`${e}`:`0${e}`)}updateResendTimerDisplay(){this.timerEl&&(this.timerEl.innerHTML=this.formatResendTimer(this.resendAfter))}isDeleteRequestInFlight(){return this.isSubmitting||this.isSwitchingChannel||this.isVerifyingOtp}async initiateDeleteRequest(e="confirm"){if(!this.isDeleteRequestInFlight()){"switch"===e||"resend"===e?this.isSwitchingChannel=!0:this.isSubmitting=!0;try{await salla.profile.initiateDeleteRequest(this.otpType),this.currentStep="otp",this.updateModalForStep(),this.resetOtpInputs(),this.startResendTimer(),setTimeout((()=>this.otpInputs[0]?.focus()),100)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{"switch"===e||"resend"===e?this.isSwitchingChannel=!1:this.isSubmitting=!1}}}async switchOtpChannel(){this.isDeleteRequestInFlight()||(this.otpType="email"===this.otpType?"mobile":"email",await this.initiateDeleteRequest("switch"))}async resendOtp(){this.showResendLink&&!this.isDeleteRequestInFlight()&&await this.initiateDeleteRequest("resend")}collectOtpCode(){const e=salla.helpers.number(this.otpInputs.map((e=>e?.value||"")).join(""),!0).replace(/[^0-9]/g,"");return this.hiddenCodeInput&&(this.hiddenCodeInput.value=e),e}resetOtpError(){this.otpHasError=!1,this.otpErrorMessage=""}setOtpError(e){this.otpHasError=!0,this.otpErrorMessage=e}async verifyDeleteOtp(){if(this.isVerifyingOtp||this.isSwitchingChannel)return;const e=this.collectOtpCode();if(e.length<4)return this.setOtpError(salla.lang.get("pages.profile.delete_account_otp_required")),void this.otpInputs[e.length]?.focus();this.resetOtpError(),this.isVerifyingOtp=!0;try{const t=await salla.profile.verifyDeleteRequest({type:this.otpType,code:e});this.deleteSuccessMessage=t?.data?.message||salla.lang.get("pages.profile.delete_account_success_message"),this.clearResendTimer(),this.resetOtpInputs(),this.otpInputs=[],this.currentStep="success",this.updateModalForStep()}catch(e){this.setOtpError(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred")),this.resetOtpInputs()}finally{this.isVerifyingOtp=!1}}async confirmSuccess(){this.isDeletePending=!0,this.closeDeleteModal(),this.currentStep="confirm",await this.fetchDeleteRequestStatus()}async cancelDeleteRequest(){if(!this.isSubmitting){this.isSubmitting=!0;try{const e=(await salla.profile.cancelDeleteRequest()).message||salla.lang.get("pages.profile.delete_request_cancelled");this.isDeletePending=!1,salla.notify?.success?.(e)}catch(e){salla.notify?.error?.(e.response?.data?.error?.message||salla.lang.get("common.errors.error_occurred"))}finally{this.isSubmitting=!1}}}resetOtpInputs(){this.otpInputs.forEach((e=>{e&&(e.value="")})),this.hiddenCodeInput&&(this.hiddenCodeInput.value="")}modifyNextOtpInput(e,t){e.value=t[0],t=t.substring(1),e.nextElementSibling&&t.length?this.modifyNextOtpInput(e.nextElementSibling,t):e.nextElementSibling||0!==t.length?e.nextElementSibling&&0===t.length&&e.nextElementSibling.focus():e.focus()}splitOtpNumber(e){const t=salla.helpers.number(e.data||e.target.value||"",!0).replace(/[^0-9]/g,"");t&&1!==t.length&&this.modifyNextOtpInput(e.target,t)}allOtpInputsFilled(){return this.otpInputs.every((e=>e?.value))}handleOtpInput(e){this.resetOtpError(),e.target.value=salla.helpers.number(e.target.value||"",!0),salla.helpers.inputDigitsOnly(e.target),this.allOtpInputsFilled()&&setTimeout((()=>this.verifyDeleteOtp()),100)}handleOtpKeyUp(e){if(this.resetOtpError(),["Alt","Shift","Control","AltGraph","Ctrl"].includes(e.key))return;const t=e.keyCode||e.charCode;e.target.value?(e.target.nextElementSibling?.focus(),e.target.nextElementSibling?.select()):[8,46].includes(t)&&(e.target.previousElementSibling?.focus(),e.target.previousElementSibling?.select()),e.target.value.length>1&&this.splitOtpNumber(e)}handleOtpPaste(e){this.resetOtpError();const t=salla.helpers.number(e.clipboardData.getData("text")||"",!0).replace(/[^0-9]/g,"").substring(0,this.otpInputs.length);this.otpInputs.forEach((e=>e.value="")),this.otpInputs[0]&&this.modifyNextOtpInput(this.otpInputs[0],t)}handleOtpFocus(e){e.target!==this.otpInputs[0]&&(""===this.otpInputs[0]?.value&&this.otpInputs[0].focus(),""===e.target.previousElementSibling?.value&&e.target.previousElementSibling.focus())}startResendTimer(){this.clearResendTimer(),this.resendAfter=30,this.showResendLink=!1,this.updateResendTimerDisplay(),this.resendTimerId=setInterval((()=>{if(this.resendAfter--,this.resendAfter<=0)return this.clearResendTimer(),void(this.showResendLink=!0);this.updateResendTimerDisplay()}),1e3)}clearResendTimer(){this.resendTimerId&&(clearInterval(this.resendTimerId),this.resendTimerId=null),this.showResendLink=!1}renderUserDeleteIcon(){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",color:"currentColor",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},t("path",{d:"M14.5 8C14.5 5.23858 12.2614 3 9.5 3C6.73858 3 4.5 5.23858 4.5 8C4.5 10.7614 6.73858 13 9.5 13C12.2614 13 14.5 10.7614 14.5 8Z"}),t("path",{d:"M15.5 21L18.5 18M18.5 18L21.5 15M18.5 18L15.5 15M18.5 18L21.5 21"}),t("path",{d:"M2.5 20C2.5 16.134 5.63401 13 9.5 13C10.775 13 11.9704 13.3409 13 13.9365"}))}renderConfirmStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-warning"},this.deleteAccountWarning),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--row"},t("salla-button",{width:"wide",fill:"outline",color:"danger",onClick:()=>this.closeDeleteModal()},this.capitalizeText(this.cancelLabel)),t("salla-button",{width:"wide",color:"primary",loading:this.isSubmitting,onClick:()=>this.initiateDeleteRequest()},this.capitalizeText(this.deleteAccount))))}renderOtpStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-otp-instruction"},this.deleteOtpInstruction),t("p",{class:"s-user-settings-delete-otp-target"},this.getOtpTarget()),t("input",{type:"hidden",name:"code",maxlength:"4",ref:e=>this.hiddenCodeInput=e}),t("div",{class:{"s-user-settings-delete-otp-codes":!0,"has-error":this.otpHasError},dir:"ltr"},[1,2,3,4].map((e=>t("input",{type:"text",autocomplete:"one-time-code",pattern:"[0-9]*",inputmode:"numeric",maxlength:"1",id:`delete-otp-${e}`,class:{"s-user-settings-delete-otp-input":!0,"s-has-error":this.otpHasError},onInput:e=>this.handleOtpInput(e),onPaste:e=>this.handleOtpPaste(e),onKeyUp:e=>this.handleOtpKeyUp(e),onFocus:e=>this.handleOtpFocus(e),ref:t=>this.otpInputs[e-1]=t,required:!0})))),this.otpHasError&&this.otpErrorMessage?t("span",{class:"s-user-settings-delete-otp-error"},this.otpErrorMessage):"",t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{width:"wide",color:"primary",disabled:this.isSwitchingChannel,onClick:()=>this.verifyDeleteOtp()},this.capitalizeText(this.deleteConfirmOtp)),t("salla-button",{width:"wide",fill:"outline",color:"primary",disabled:this.isVerifyingOtp,onClick:()=>this.switchOtpChannel()},this.capitalizeText("email"===this.otpType?this.sendViaPhone:this.sendViaEmail))),t("p",{class:"s-user-settings-delete-otp-resend",style:{display:this.showResendLink?"none":"block"}},this.resendAfterLabel,t("b",{class:"s-user-settings-delete-otp-timer mx-1 font-bold",ref:e=>this.timerEl=e})),t("a",{href:"#",class:"s-user-settings-delete-otp-resend-link",style:{display:this.showResendLink?"block":"none"},onClick:e=>{e.preventDefault(),this.resendOtp()}},this.resendLabel))}renderSuccessStep(){return t("div",{class:"s-user-settings-delete-body"},t("p",{class:"s-user-settings-delete-success-body"},this.deleteSuccessMessage),t("div",{class:"s-user-settings-delete-actions s-user-settings-delete-actions--stack"},t("salla-button",{class:"s-user-settings-delete-success-btn",width:"wide",color:"primary",onClick:()=>this.confirmSuccess()},this.capitalizeText(this.okLabel))))}renderDeleteStep(){switch(this.currentStep){case"otp":return this.renderOtpStep();case"success":return this.renderSuccessStep();default:return this.renderConfirmStep()}}renderDeleteSectionAction(){return this.isDeletePending?t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",loading:this.isSubmitting,onClick:()=>this.cancelDeleteRequest()},this.capitalizeText(this.cancelDeletionRequest)):t("salla-button",{fill:"outline",color:"danger",shape:"btn",size:"medium",width:"normal",onClick:()=>this.openDeleteModal()},this.capitalizeText(this.deleteAccount))}render(){return t(s,{key:"64356c5b57d826fce8c29cc319a9762464c7fe51",class:"s-user-settings-wrapper"},this.canHideName&&t("div",{key:"4f7b3eb703f89e4a758fca54ba1b214f6724aaea",class:"s-user-settings-section"},t("salla-list-tile",{key:"7ad109e36b278fe81a314d51e1ab68030dd96cdc"},t("div",{key:"c789b7e2c541e25aaaf336e052d1986f6429da71",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"5d7b377aefb80139527d8814ee2c636fa9c73e0f",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>user-cancel</title>\n<path d="M29.885 16l1.724-1.724c0.521-0.521 0.521-1.364 0-1.885s-1.364-0.521-1.885 0l-1.724 1.724-1.724-1.724c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l1.724 1.724-1.724 1.724c-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.391l1.724-1.724 1.724 1.724c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885zM10.667 16c4.043 0 7.333-3.289 7.333-7.333s-3.291-7.333-7.333-7.333-7.333 3.289-7.333 7.333 3.291 7.333 7.333 7.333zM10.667 4c2.573 0 4.667 2.093 4.667 4.667s-2.093 4.667-4.667 4.667-4.667-2.093-4.667-4.667 2.093-4.667 4.667-4.667zM10.667 18.667c-5.881 0-10.667 3.813-10.667 8.5v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-3.217 3.588-5.833 8-5.833s8 2.616 8 5.833v2.167c0 0.736 0.596 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-2.167c0-4.687-4.785-8.5-10.667-8.5z"></path>\n</svg>\n'})),t("div",{key:"fdb9d6130ef27cffbe4e2ef06e7b9155d0d04c2b",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.hideMyName)),t("div",{key:"bd8592a487c79926355eeea25a5e1429bca0fd80",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.hideMyNameDesc)),t("div",{key:"cf21ed12bb38dc3a613efac6d017a72aab38780b",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"160140e25cf8e6c4556e52c0b36ba5769618b419",class:"s-toggle"},t("input",{key:"369a694fabbd42e6c239b23c26d68f858775ffe2",class:"s-toggle-input",checked:this.isHiddenName,onChange:e=>this.toggleSetting("is_hidden_name",e),type:"checkbox"}),t("div",{key:"5952ec01913ef95d888eeb3aace14123ffd3ef6f",class:"s-toggle-switcher"}))))),t("div",{key:"885355f8435759c9359a3d9eb95d5637b1c74751",class:"s-user-settings-section"},t("salla-list-tile",{key:"93b607850b20add5384a3b28e4e58fbfcb181d53"},t("div",{key:"c795aabfdc6df0beb9c0bfcf73ad87625eb7f51b",slot:"icon",class:"s-user-settings-section-icon"},t("span",{key:"a59ede027c4466a1e84e8e8b4c649c7b418dd0a3",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>bullhorn</title>\n<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>\n</svg>\n'})),t("div",{key:"e7af96b6f919a8be8bb126237cb3977e72a7c089",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.promotionalMsgs)),t("div",{key:"dab7b270443b6eddccd7df739c2bee82eb7706af",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.promotionalMsgsDesc)),t("div",{key:"56a6f18c788891fe9215a57d0fcaa5cf98bd3aa5",slot:"action",class:"s-user-settings-section-action"},t("label",{key:"1fc28780fe779099eaed7916f31cbbb681c10fe9",class:"s-toggle"},t("input",{key:"832edd6e5b806171bb913163b7d5c19dbb0833f5",class:"s-toggle-input",checked:this.isNotifiable,onChange:e=>this.toggleSetting("is_notifiable",e),type:"checkbox"}),t("div",{key:"54260d8cca19ca6914cdd3bf15093b9669fef44a",class:"s-toggle-switcher"}))))),t("div",{key:"549bae1159a55b035952a12c8dc9d2b9d660f5bf",class:"s-user-settings-section s-user-settings-section-delete-user"},t("salla-list-tile",{key:"7969327e863cd998a120f27d61621d83ef8e57d5"},t("div",{key:"acf14b5e6ce76657fe0016aa63e26851e7688cd5",slot:"icon",class:"s-user-settings-section-icon"},this.renderUserDeleteIcon()),t("div",{key:"4a38cf9d0510e784317b0eb4db2fd4589a9f71d4",slot:"title",class:"s-user-settings-section-title"},this.capitalizeText(this.deleteAccount)),t("div",{key:"054f6a6c30f2eb9794f83a0998f20e208c7ed85a",slot:"subtitle",class:"s-user-settings-section-subtitle"},this.capitalizeText(this.isDeletePending?this.deleteAccountPending:this.deleteAccountDesc)),t("div",{key:"00d392a300b986d5d3e6f6711e6996df9731962d",slot:"action",class:"s-user-settings-section-action"},this.renderDeleteSectionAction()))),t("salla-modal",{key:"d4e8006e57d9c35267177f07b60e510ea3e53400",id:"salla-user-settings-delete-modal",width:"xs",centered:!0,showBack:"otp"===this.currentStep,isClosable:"success"!==this.currentStep,iconStyle:"success"===this.currentStep?"success":void 0,onModalVisibilityChanged:e=>this.handleModalVisibilityChanged(e),onModalBack:()=>this.goBackFromOtp(),ref:e=>this.confirmationModal=e},"success"!==this.currentStep?t("span",{slot:"icon",class:"s-user-settings-delete-icon"},this.renderUserDeleteIcon()):null,t("div",{key:this.currentStep,class:"s-user-settings-delete-step"},this.renderDeleteStep())))}};i.style=".s-modal-header-inner{display:flex;flex-direction:column !important;align-items:center !important;justify-content:center !important}.s-modal-header-content{text-align:center !important}.s-user-settings-delete-body{text-align:center}.s-user-settings-delete-icon{display:inline-flex;align-items:center;justify-content:center;width:4rem;height:4rem;border-radius:9999px;border:1px solid var(--infinte-color);color:var(--infinte-color);margin:0 auto 1rem}.s-user-settings-delete-icon svg{width:1.5rem;height:1.5rem}.s-user-settings-delete-warning{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-actions--row{display:flex;gap:0.75rem;justify-content:center}.s-user-settings-delete-actions--row salla-button{flex:1}.s-user-settings-delete-actions--stack{display:flex;flex-direction:column;gap:0.75rem;margin-top:1.25rem}.s-user-settings-delete-otp-instruction{color:#6b7280;font-size:0.875rem}.s-user-settings-delete-otp-target{color:#6b7280;direction:ltr;margin-bottom:1.25rem}.s-user-settings-delete-otp-codes{display:flex;justify-content:stretch;gap:0.75rem;direction:ltr;margin-bottom:0.75rem;width:100%}.s-user-settings-delete-otp-codes.has-error{margin-bottom:0}.s-user-settings-delete-otp-input{flex:1 1 0;min-width:0;width:100%;height:3.5rem;text-align:center;border:1px solid #d1d5db;border-radius:0.5rem;font-size:1.25rem;font-weight:600;color:#111827;outline:none}.s-user-settings-delete-otp-input:focus{border-color:#004956;box-shadow:0 0 0 1px #004956}.s-user-settings-delete-otp-input.s-has-error{border-color:#ef4444 !important}.s-user-settings-delete-otp-input.s-has-error:focus{border-color:#ef4444 !important;box-shadow:0 0 0 1px #ef4444}.s-user-settings-delete-otp-input::-webkit-outer-spin-button,.s-user-settings-delete-otp-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.s-user-settings-delete-otp-input[type=text]{-moz-appearance:textfield}.s-user-settings-delete-otp-error{display:block;color:#ef4444;font-size:0.75rem;text-align:center;padding-top:0.75rem;margin-bottom:1.25rem}.s-user-settings-delete-otp-resend{color:#6b7280;font-size:0.75rem;margin-top:1rem;text-align:center}.s-user-settings-delete-otp-timer{font-weight:600;direction:ltr;display:inline-block}.s-user-settings-delete-otp-resend-link{display:block;color:#004956;font-size:0.875rem;margin-top:1rem;text-align:center;text-decoration:underline;cursor:pointer}.s-user-settings-delete-success-body{color:#6b7280;font-size:0.875rem;line-height:1.625;margin-bottom:1.25rem}.s-user-settings-delete-success-btn{--s-button-color:#004956}";export{i as salla_user_settings}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as e,a}from"./p-jaN78U7Z.js";import{S as t}from"./p-Ctkfc4K-.js";import{S as l}from"./p-cgSL_BIo.js";import{S as o}from"./p-D1s2kXqL.js";const i=class{constructor(e){s(this,e),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(s=>this.open(s))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(s=>this.open(s))),salla.product.event.onOfferExisted((s=>{salla.storage.get("remember-offer-"+s.id)?salla.log("User selected to don't show this offer again."):this.open(s.product_id)}))}emitPromotionViewed(s){s&&salla.event.emit("promotion::viewed",[{id:s.id?.toString(),creative:s.message,name:s.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(s){s&&salla.event.emit("promotion::clicked",[{id:s.id?.toString(),creative:s.message,name:s.name,position:`${this.offer_type}_offer_modal`}])}async open(s){return this.productID=s,this.hasError=!1,this.modal.loading(),await salla.api.withoutNotifier((()=>salla.product.offers(s))).then((s=>{s.data&&s.data.length&&(this.modal.open(),this.showOffer(s.data[0]))})).catch((s=>{this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||s.response?.data,this.modal.open()})).finally((()=>{this.modal.visible&&setTimeout((()=>this.modal.stopLoading()),1e3)}))}async showOffer(s){this.offer=s,this.offer_name=s.name,this.offer_message=s.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length?this.offer_type="categories":this.offer.get.brands?.length?this.offer_type="brands":this.offer.get.tags?.length&&(this.offer_type="tags"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(s){salla.storage.set("remember-offer-"+this.offer.id,s.target.checked)}addToCart(s){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,s,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return e("div",{class:"s-offer-modal-discount-table"},e("table",null,e("tbody",null,this.offer.get.discounts_table?.map((s=>e("tr",null,e("td",null,s.text),e("td",{class:"s-offer-modal-discount-table-cell"},e("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(s.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const s=this.offer.get.products?.length||0,a={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,s),spaceBetween:16},1024:{slidesPerView:Math.min(3,s),spaceBetween:16}}};return e("salla-products-slider",{key:(this.offer.get.products?.map((s=>s.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((s=>s.id))||[]).join(",")}]`,"slider-config":JSON.stringify(a)})}return this.offer.get.categories?.length?e("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},e("div",{slot:"items"},this.offer.get.categories.map((s=>e("a",{href:s.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,l).replace(/\{name\}/g,s.name).replace(/\{url\}/g,s.urls.customer)}))))):this.offer.get.brands?.length?e("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.brands?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.brands?.length<=2?"false":"true"},e("div",{slot:"items"},this.offer.get.brands.map((s=>e("a",{href:s.url||salla.url.create("brands",s.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-brand-item"},e("div",{class:"s-offer-modal-brand-logo"},e("img",{src:s.logo,alt:s.name})),e("span",{class:"s-offer-modal-badge-text"},s.name)))))):this.offer.get.tags?.length?e("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.tags?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.tags?.length<=2?"false":"true"},e("div",{slot:"items"},this.offer.get.tags.map((s=>e("a",{href:s.url||salla.url.create("tags",s.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-tag-item"},e("span",{class:"s-offer-modal-badge-icon",innerHTML:l}),e("span",{class:"s-offer-modal-badge-text"},s.name)))))):void 0}render(){return e("salla-modal",{key:"570466318b6cd66a7a8b3dd0d80424c2fd73328d","has-skeleton":!0,"sub-title":this.offer_message,ref:s=>this.modal=s,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},e("div",{key:"ded0c8df17d5e5c1d6e77b8e1be469e69d3ee12f",slot:"loading"},e("div",{key:"fc96c54fcecc896b3e5a1838e2d07d545fce2f85",class:"s-offer-modal-skeleton"},e("div",{key:"ee7a6f25aabbf4263b43fc7545bbb2c7bfca9b3a",class:"s-offer-modal-skeleton-header"},e("salla-skeleton",{key:"9604f5f33d1d8e074cc3c314addb945b087431ee",type:"circle",height:"80px",width:"80px"}),e("salla-skeleton",{key:"65194ecfee0a01f7c38aa72f7ce2c8c81c893b1f",height:"15px",width:"50%"}),e("salla-skeleton",{key:"21d466bf32f435a511dcece76f51f4052089c130",height:"10px",width:"30%"})),e("div",{key:"53fb44c7c60ca8236dc7ec60ff65cb71df39c03b",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>e("div",{class:"s-offer-modal-skeleton-item"},e("salla-skeleton",{height:"9rem"}),e("div",{class:"s-offer-modal-skeleton-item-title"},e("salla-skeleton",{height:"15px",width:"100%"})),e("div",{class:"s-offer-modal-skeleton-item-subtitle"},e("salla-skeleton",{height:"9px",width:"50%"}),e("div",{innerHTML:o})))))),e("div",{key:"52ad47514b0c00b73ec7d98073b09d21ce6a2b12",class:"s-offer-modal-skeleton-footer"},e("salla-skeleton",{key:"a271e30ab34d96731cc1f51c32cba9aaefee1953",height:"15px",width:"50%"}),e("salla-skeleton",{key:"6e199a5b1283c9d82588c60c712d3799b88c5c8d",height:"15px",width:"30%"})))),this.hasError||null===this.offer?e("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?e("span",{slot:"description"},this.errorMessage):""):[e("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:t}),this.getOfferContent(),e("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?e("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",e("label",{class:"s-offer-modal-remember-label"},e("input",{type:"checkbox",onChange:s=>this.rememberMe(s),class:"s-offer-modal-remember-input"}),"  ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return a(this)}};i.style=".s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}";export{i as salla_offer_modal}
4
+ import{r as s,h as e,a}from"./p-MrxrxOqi.js";import{S as t}from"./p-Ctkfc4K-.js";import{S as l}from"./p-cgSL_BIo.js";import{S as o}from"./p-D1s2kXqL.js";const i=class{constructor(e){s(this,e),this.offer=null,this.hasError=!1,this.translationLoaded=!1,this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),salla.event.on("offer-modal::open",(s=>this.open(s))),salla.lang.onLoaded((()=>{this.addToCartLabel=salla.lang.get("pages.cart.add_to_cart"),this.translationLoaded=!0})),this.categorySlot=this.host.querySelector('[slot="category"]')?.innerHTML||'<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>',salla.event.on("offer-modal::open",(s=>this.open(s))),salla.product.event.onOfferExisted((s=>{salla.storage.get("remember-offer-"+s.id)?salla.log("User selected to don't show this offer again."):this.open(s.product_id)}))}emitPromotionViewed(s){s&&salla.event.emit("promotion::viewed",[{id:s.id?.toString(),creative:s.message,name:s.name,position:`${this.offer_type}_offer_modal`}])}emitPromotionClicked(s){s&&salla.event.emit("promotion::clicked",[{id:s.id?.toString(),creative:s.message,name:s.name,position:`${this.offer_type}_offer_modal`}])}async open(s){return this.productID=s,this.hasError=!1,this.modal.loading(),await salla.api.withoutNotifier((()=>salla.product.offers(s))).then((s=>{s.data&&s.data.length&&(this.modal.open(),this.showOffer(s.data[0]))})).catch((s=>{this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||s.response?.data,this.modal.open()})).finally((()=>{this.modal.visible&&setTimeout((()=>this.modal.stopLoading()),1e3)}))}async showOffer(s){this.offer=s,this.offer_name=s.name,this.offer_message=s.message,this.offer.get.discounts_table?this.offer_type="discounts-table":this.offer.get.products?.length?this.offer_type="products":this.offer.get.categories?.length?this.offer_type="categories":this.offer.get.brands?.length?this.offer_type="brands":this.offer.get.tags?.length&&(this.offer_type="tags"),this.modal.setTitle(this.offer_name),this.emitPromotionViewed(this.offer)}rememberMe(s){salla.storage.set("remember-offer-"+this.offer.id,s.target.checked)}addToCart(s){this.emitPromotionClicked(this.offer),salla.api.withoutNotifier((()=>salla.cart.quickAdd(this.productID,s,this.offer_type))).then((()=>this.modal.close()))}getOfferContent(){if(this.offer.get.discounts_table)return e("div",{class:"s-offer-modal-discount-table"},e("table",null,e("tbody",null,this.offer.get.discounts_table?.map((s=>e("tr",null,e("td",null,s.text),e("td",{class:"s-offer-modal-discount-table-cell"},e("salla-button",{fill:"outline",shape:"btn",color:"primary",size:"medium",width:"normal",onClick:()=>this.addToCart(s.quantity)},this.addToCartLabel))))))));if(this.offer.get.products?.length){const s=this.offer.get.products?.length||0,a={slidesPerView:"auto",spaceBetween:16,breakpoints:{768:{slidesPerView:Math.min(2,s),spaceBetween:16},1024:{slidesPerView:Math.min(3,s),spaceBetween:16}}};return e("salla-products-slider",{key:(this.offer.get.products?.map((s=>s.id))||[]).join(","),source:"selected","source-value":`[${(this.offer.get.products?.map((s=>s.id))||[]).join(",")}]`,"slider-config":JSON.stringify(a)})}return this.offer.get.categories?.length?e("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.categories?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.categories?.length<=2?"false":"true"},e("div",{slot:"items"},this.offer.get.categories.map((s=>e("a",{href:s.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-cat-item",innerHTML:this.categorySlot.replace(/\{tagIcon\}/g,l).replace(/\{name\}/g,s.name).replace(/\{url\}/g,s.urls.customer)}))))):this.offer.get.brands?.length?e("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.brands?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.brands?.length<=2?"false":"true"},e("div",{slot:"items"},this.offer.get.brands.map((s=>e("a",{href:s.url||salla.url.create("brands",s.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-brand-item"},e("div",{class:"s-offer-modal-brand-logo"},e("img",{src:s.logo,alt:s.name})),e("span",{class:"s-offer-modal-badge-text"},s.name)))))):this.offer.get.tags?.length?e("salla-slider",{type:"carousel",class:{"s-offer-modal-slider-centered":this.offer.get.tags?.length<=2,"s-offer-modal-slider":!0},id:"offer-modal-slider","controls-outer":!0,"show-controls":this.offer.get.tags?.length<=2?"false":"true"},e("div",{slot:"items"},this.offer.get.tags.map((s=>e("a",{href:s.url||salla.url.create("tags",s.id),class:"s-offer-modal-badge s-offer-modal-slider-item s-offer-modal-tag-item"},e("span",{class:"s-offer-modal-badge-icon",innerHTML:l}),e("span",{class:"s-offer-modal-badge-text"},s.name)))))):void 0}render(){return e("salla-modal",{key:"570466318b6cd66a7a8b3dd0d80424c2fd73328d","has-skeleton":!0,"sub-title":this.offer_message,ref:s=>this.modal=s,isLoading:!0,class:`s-offer-modal-type-${this.offer_type?this.offer_type:""}`},e("div",{key:"ded0c8df17d5e5c1d6e77b8e1be469e69d3ee12f",slot:"loading"},e("div",{key:"fc96c54fcecc896b3e5a1838e2d07d545fce2f85",class:"s-offer-modal-skeleton"},e("div",{key:"ee7a6f25aabbf4263b43fc7545bbb2c7bfca9b3a",class:"s-offer-modal-skeleton-header"},e("salla-skeleton",{key:"9604f5f33d1d8e074cc3c314addb945b087431ee",type:"circle",height:"80px",width:"80px"}),e("salla-skeleton",{key:"65194ecfee0a01f7c38aa72f7ce2c8c81c893b1f",height:"15px",width:"50%"}),e("salla-skeleton",{key:"21d466bf32f435a511dcece76f51f4052089c130",height:"10px",width:"30%"})),e("div",{key:"53fb44c7c60ca8236dc7ec60ff65cb71df39c03b",class:"s-offer-modal-skeleton-items"},[...Array(3)].map((()=>e("div",{class:"s-offer-modal-skeleton-item"},e("salla-skeleton",{height:"9rem"}),e("div",{class:"s-offer-modal-skeleton-item-title"},e("salla-skeleton",{height:"15px",width:"100%"})),e("div",{class:"s-offer-modal-skeleton-item-subtitle"},e("salla-skeleton",{height:"9px",width:"50%"}),e("div",{innerHTML:o})))))),e("div",{key:"52ad47514b0c00b73ec7d98073b09d21ce6a2b12",class:"s-offer-modal-skeleton-footer"},e("salla-skeleton",{key:"a271e30ab34d96731cc1f51c32cba9aaefee1953",height:"15px",width:"50%"}),e("salla-skeleton",{key:"6e199a5b1283c9d82588c60c712d3799b88c5c8d",height:"15px",width:"30%"})))),this.hasError||null===this.offer?e("salla-placeholder",{class:"s-loyalty-placeholder",alignment:"center"},this.errorMessage?e("span",{slot:"description"},this.errorMessage):""):[e("span",{slot:"icon",class:"s-offer-modal-header-icon",innerHTML:t}),this.getOfferContent(),e("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?e("p",{class:"s-offer-modal-expiry"},salla.lang.get("pages.products.offer_expires_in")," ",this.offer.formatted_date):"",e("label",{class:"s-offer-modal-remember-label"},e("input",{type:"checkbox",onChange:s=>this.rememberMe(s),class:"s-offer-modal-remember-input"}),"  ",salla.lang.get("common.elements.remember_my_choice")))])}get host(){return a(this)}};i.style=".s-offer-modal-type-products .s-modal-body{min-height:690px;position:relative}";export{i as salla_offer_modal}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as e,a}from"./p-jaN78U7Z.js";import{S as t}from"./p-BscTeWDc.js";import{H as i}from"./p-XnA1YTjA.js";import"./p-CgtvEd63.js";const c=class{constructor(e){s(this,e),this.inputValue="",this.translationLoaded=!1,this.loading=!1,this.typing=!1,this.debounce=setTimeout((()=>""),1e3),this.placeholder=!1,this.inline=!1,this.oval=!1,this.height=60,this.maxWords=5,this.showAction=!1,this.productSlot=this.host.querySelector('[slot="product"]')?.innerHTML||this.getDefaultProductSlot(),salla.event.on("search::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),salla.event.on("modalClosed",(()=>this.onModalClose()))}async open(){this.inline||await this.modal.open().then((()=>setTimeout((()=>this.searchInput.focus()),300)))}onModalClose(){this.searchInput.value="",this.results=void 0,this.afterSearching(),this.container.classList.remove("s-search-no-results")}handleKeyDown(s){"Enter"===s.key&&this.search_term?.length&&(window.location.href=salla.url.get("search?q="+encodeURI(this.search_term)))}getDefaultProductSlot(){return'<div class="s-search-product-image-container"> <img class="s-search-product-image" src="{image}" alt="{name}"/></div><div class="s-search-product-details"> <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div></div>'}debounceSearch(s){this.typing=!0,clearTimeout(this.debounce),this.debounce=setTimeout((()=>{this.typing=!1,this.search_term=s.target.value}),700)}limitWordsAndSearch(s){const e=s.target.value.trim().split(/\s+/);if(e.length>this.maxWords){const s=e.slice(0,this.maxWords).join(" ");this.searchInput.value=s}this.debounceSearch(s)}getQueryParam(s){return new URLSearchParams(window.location.search).get(s)}handleActionClick(){if(this.search_term&&this.search_term.length>2)return this.search(this.search_term)}handleSearch(s){this.inputValue=s,s.length>2?this.search(s):(this.results=void 0,this.afterSearching())}search(s){this.noResults.style.display="none",this.loading=!0,salla.product.fetch({source:"search",source_value:s}).then((e=>{this.results=e,salla.event.emit("Products Searched",s)})).catch((s=>"Query is same as previous one!"!==s?this.results=void 0:null)).finally((()=>this.afterSearching(!1)))}afterSearching(s=!0){this.noResults.style.display=s||this.results?.data.length>0?"none":"block",i.toggleElementClassIf(this.container,"s-search-container-open","s-search-no-results",(()=>this.results?.data.length)),this.loading=!1,salla.product.api.previousQuery="",this.inputValue.length<3&&this.container.classList.remove("s-search-no-results")}render(){const s=e("div",{key:"ca8dec5eb90cd0893a1a3364df34ba0ee4d60891",class:{"s-search-container":!0,"s-search-inline":this.inline},ref:s=>this.container=s},e("div",{key:"212f8180ecca220a8b89231311dec6cdf3ef0b06",class:"s-search-input-wrapper"},e("span",{key:"51fb0f9a2e342afd35eb82b57f55471aa9e1519f",class:"s-search-icon-wrap"},e("span",{key:"e75117068c51c6d200e8e20fa0f00ca02ed0c61d",class:"s-search-icon",innerHTML:this.loading?'<i class="s-search-spinner-loader"/>':t})),e("input",{key:"442b1704b75a33e8c9e02da8200151a1d8e8db72",type:"search",enterkeyhint:"search",autocomplete:"off",class:"s-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder"),onInput:s=>this.limitWordsAndSearch(s),onKeyDown:s=>this.handleKeyDown(s),ref:s=>this.searchInput=s,style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}),this.showAction?e("salla-button",{loading:this.loading,class:{"s-search-action":!0,"s-search-action-oval":this.oval},onClick:()=>this.handleActionClick()},!this.loading&&e("span",{innerHTML:t})):null),e("div",{key:"f3b40ce4ec24678f6d8421f3da8ac9e1bd631c3a",class:"s-search-results"},this.results?.data.map((s=>e("a",{href:s.url+"?from=search-bar",class:{"s-search-product":!0,"s-search-product-not-available":!s.is_available},innerHTML:this.productSlot.replace(/\{name\}/g,s.name).replace(/\{price\}/g,s.price?salla.money(s.price):"").replace(/\{regular_price\}/g,s.is_on_sale&&s.regular_price?salla.money(s.regular_price):"").replace(/\{image\}/g,s.image.url)}))),e("p",{key:"fdbb21061c599a59c6d828eec80e8d591a708cca",ref:s=>this.noResults=s,class:"s-search-no-results-placeholder"},salla.lang.get("common.elements.no_options")))),a=e("salla-modal",{key:"ca90aea3fb92d1ba7d8270c26e2ecd82d5018784",position:"top",class:"s-search-modal",ref:s=>this.modal=s},s),i=e("div",{key:"73333ce51cabadc4963a9fe9d1372bb7d63925c8",class:"s-search-placeholder-wrapper s-search-inline"},e("div",{key:"77a66e9bba504557160c8c50d91f1216cc68f253",class:"s-search-input-wrapper"},e("span",{key:"18fb5ce6e3e72874e76dd1ef2c6db8718a68f778",class:"s-search-icon-wrap"},e("span",{key:"63b9e9af1c51647df734cc4d5cf7a825b922ce38",class:"s-search-icon",innerHTML:t})),e("button",{key:"b70169ed2d80ec2ad6b09952ad104824610212df",type:"button",class:"s-search-input s-search-placeholder-trigger",onClick:()=>this.open(),style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}},salla.lang.get("blocks.header.search_placeholder"))),a);return this.placeholder?i:this.inline?e("div",{class:"s-search-modal"},s):a}componentDidLoad(){this.afterSearching(),this.searchInput.value=this.getQueryParam("q")}get host(){return a(this)}static get watchers(){return{search_term:["handleSearch"]}}};c.style=".s-search-placeholder-wrapper{position:relative;display:inline-block}.s-search-input-wrapper{position:relative}.s-search-placeholder-trigger{cursor:pointer;appearance:none;text-align:start}";export{c as salla_search}
4
+ import{r as s,h as e,a}from"./p-MrxrxOqi.js";import{S as t}from"./p-BscTeWDc.js";import{H as i}from"./p-XnA1YTjA.js";import"./p-CgtvEd63.js";const c=class{constructor(e){s(this,e),this.inputValue="",this.translationLoaded=!1,this.loading=!1,this.typing=!1,this.debounce=setTimeout((()=>""),1e3),this.placeholder=!1,this.inline=!1,this.oval=!1,this.height=60,this.maxWords=5,this.showAction=!1,this.productSlot=this.host.querySelector('[slot="product"]')?.innerHTML||this.getDefaultProductSlot(),salla.event.on("search::open",(()=>this.open())),salla.lang.onLoaded((()=>{this.translationLoaded=!0})),salla.event.on("modalClosed",(()=>this.onModalClose()))}async open(){this.inline||await this.modal.open().then((()=>setTimeout((()=>this.searchInput.focus()),300)))}onModalClose(){this.searchInput.value="",this.results=void 0,this.afterSearching(),this.container.classList.remove("s-search-no-results")}handleKeyDown(s){"Enter"===s.key&&this.search_term?.length&&(window.location.href=salla.url.get("search?q="+encodeURI(this.search_term)))}getDefaultProductSlot(){return'<div class="s-search-product-image-container"> <img class="s-search-product-image" src="{image}" alt="{name}"/></div><div class="s-search-product-details"> <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price} <span class="s-search-product-regular-price">{regular_price}</span></div></div>'}debounceSearch(s){this.typing=!0,clearTimeout(this.debounce),this.debounce=setTimeout((()=>{this.typing=!1,this.search_term=s.target.value}),700)}limitWordsAndSearch(s){const e=s.target.value.trim().split(/\s+/);if(e.length>this.maxWords){const s=e.slice(0,this.maxWords).join(" ");this.searchInput.value=s}this.debounceSearch(s)}getQueryParam(s){return new URLSearchParams(window.location.search).get(s)}handleActionClick(){if(this.search_term&&this.search_term.length>2)return this.search(this.search_term)}handleSearch(s){this.inputValue=s,s.length>2?this.search(s):(this.results=void 0,this.afterSearching())}search(s){this.noResults.style.display="none",this.loading=!0,salla.product.fetch({source:"search",source_value:s}).then((e=>{this.results=e,salla.event.emit("Products Searched",s)})).catch((s=>"Query is same as previous one!"!==s?this.results=void 0:null)).finally((()=>this.afterSearching(!1)))}afterSearching(s=!0){this.noResults.style.display=s||this.results?.data.length>0?"none":"block",i.toggleElementClassIf(this.container,"s-search-container-open","s-search-no-results",(()=>this.results?.data.length)),this.loading=!1,salla.product.api.previousQuery="",this.inputValue.length<3&&this.container.classList.remove("s-search-no-results")}render(){const s=e("div",{key:"ca8dec5eb90cd0893a1a3364df34ba0ee4d60891",class:{"s-search-container":!0,"s-search-inline":this.inline},ref:s=>this.container=s},e("div",{key:"212f8180ecca220a8b89231311dec6cdf3ef0b06",class:"s-search-input-wrapper"},e("span",{key:"51fb0f9a2e342afd35eb82b57f55471aa9e1519f",class:"s-search-icon-wrap"},e("span",{key:"e75117068c51c6d200e8e20fa0f00ca02ed0c61d",class:"s-search-icon",innerHTML:this.loading?'<i class="s-search-spinner-loader"/>':t})),e("input",{key:"442b1704b75a33e8c9e02da8200151a1d8e8db72",type:"search",enterkeyhint:"search",autocomplete:"off",class:"s-search-input",placeholder:salla.lang.get("blocks.header.search_placeholder"),onInput:s=>this.limitWordsAndSearch(s),onKeyDown:s=>this.handleKeyDown(s),ref:s=>this.searchInput=s,style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}}),this.showAction?e("salla-button",{loading:this.loading,class:{"s-search-action":!0,"s-search-action-oval":this.oval},onClick:()=>this.handleActionClick()},!this.loading&&e("span",{innerHTML:t})):null),e("div",{key:"f3b40ce4ec24678f6d8421f3da8ac9e1bd631c3a",class:"s-search-results"},this.results?.data.map((s=>e("a",{href:s.url+"?from=search-bar",class:{"s-search-product":!0,"s-search-product-not-available":!s.is_available},innerHTML:this.productSlot.replace(/\{name\}/g,s.name).replace(/\{price\}/g,s.price?salla.money(s.price):"").replace(/\{regular_price\}/g,s.is_on_sale&&s.regular_price?salla.money(s.regular_price):"").replace(/\{image\}/g,s.image.url)}))),e("p",{key:"fdbb21061c599a59c6d828eec80e8d591a708cca",ref:s=>this.noResults=s,class:"s-search-no-results-placeholder"},salla.lang.get("common.elements.no_options")))),a=e("salla-modal",{key:"ca90aea3fb92d1ba7d8270c26e2ecd82d5018784",position:"top",class:"s-search-modal",ref:s=>this.modal=s},s),i=e("div",{key:"73333ce51cabadc4963a9fe9d1372bb7d63925c8",class:"s-search-placeholder-wrapper s-search-inline"},e("div",{key:"77a66e9bba504557160c8c50d91f1216cc68f253",class:"s-search-input-wrapper"},e("span",{key:"18fb5ce6e3e72874e76dd1ef2c6db8718a68f778",class:"s-search-icon-wrap"},e("span",{key:"63b9e9af1c51647df734cc4d5cf7a825b922ce38",class:"s-search-icon",innerHTML:t})),e("button",{key:"b70169ed2d80ec2ad6b09952ad104824610212df",type:"button",class:"s-search-input s-search-placeholder-trigger",onClick:()=>this.open(),style:{height:this.height+"px",borderRadius:this.oval?this.height/2+"px":""}},salla.lang.get("blocks.header.search_placeholder"))),a);return this.placeholder?i:this.inline?e("div",{class:"s-search-modal"},s):a}componentDidLoad(){this.afterSearching(),this.searchInput.value=this.getQueryParam("q")}get host(){return a(this)}static get watchers(){return{search_term:["handleSearch"]}}};c.style=".s-search-placeholder-wrapper{position:relative;display:inline-block}.s-search-input-wrapper{position:relative}.s-search-placeholder-trigger{cursor:pointer;appearance:none;text-align:start}";export{c as salla_search}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as s,a}from"./p-jaN78U7Z.js";import{P as l}from"./p-DY4LZmNP.js";import{I as o}from"./p-C-tzSDxw.js";const i=class{constructor(t){e(this,t),this.variant="info"}renderIcon(){const e=this.icon||this.variant;if("none"===e)return null;switch(e){case"success":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return t("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return t(s,{key:"e26a52cc275ac4c2e4090c113cb7e7d4d578fc11",class:`s-alert-wrapper s-alert-${this.variant}`},t("span",{key:"bdb1c6693b226a4e136e89640fcc19fbefc6e29e",class:"s-alert-icon"},this.renderIcon()),t("span",{key:"de8997f9617e74fc082ae9603bf16eac4c0a4b17",class:"s-alert-text"},this.message,t("slot",{key:"37fb1adba1fa7f0226143250632cf20b514ee06b"})))}};i.style=":host{display:block}";const n=class{constructor(t){e(this,t),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");const e=salla.lang.messages?.["ar.trans"],t=salla.lang.messages?.["en.trans"];e&&t&&(salla.helpers.setNested(e,"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(t,"common.elements.more_details","More Details"),salla.helpers.setNested(e,"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(t,"common.elements.store_price","Store Price"),salla.helpers.setNested(e,"common.elements.the_developer","المطور"),salla.helpers.setNested(t,"common.elements.the_developer","the developer"),salla.helpers.setNested(e,"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(t,"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(e,"common.elements.salla","سلة"),salla.helpers.setNested(t,"common.elements.salla","Salla"),salla.helpers.setNested(e,"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(t,"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(e,"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(t,"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100))}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((e=>{this.templateData=e.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return t("salla-drawer",{class:"s-bottom-alert-modal",ref:e=>this.drawer=e,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[t("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},t("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{innerHTML:o,class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storeFeatures)),t("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),t("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{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>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storePriceDetails)),t("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((e=>t("div",{class:"s-bottom-alert-modal-content-price-details-item"},t("i",{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>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),t("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},e.name),t("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(e.price)})))))]:""),this.templateData?.link?t("div",{class:"s-bottom-alert-modal-content-footer"},t("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},t("i",{innerHTML:l}),this.buyTheTemplate)):"")]:"")}render(){const e=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return t(s,{key:"1e598df3c91be1e357fc5d771061ec386573f968",class:"s-bottom-alert-wrapper "+(e?"s-bottom-alert-wrapper-with-template":"")},e&&t("div",{key:"20a0173dfa6a01b793f8e1e9416d295ee4e61783",class:"s-bottom-alert-logo-section"},t("img",{key:"2c9042f0ce022aeb9b2879496ec2837ed14dfe9f",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),t("span",{key:"69c2bc09acca8a535d2f982131ccc09d65ea44e6",class:"s-bottom-alert-logo-text"},this.readyStores)),t("div",{key:"553122bac6f1f11c2bcc41a92ac798b3701ebfb9",class:"s-bottom-alert-content"},t("div",{key:"e0df96405998b70c15a8320c8400fa75db77d041",class:"flex items-center gap-2"},t("div",{key:"26f241c725c763dfc25f58cdcd0f2979571a2061",class:"s-bottom-alert-icon"},t("i",this.icon?{class:this.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>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'})),t("div",{key:"5e6ba42a2924aec3b99050e8f53634716023a535",class:"s-bottom-alert-message"},this.message?this.message:e?t("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,t("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),t("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&t("div",{key:"44c4d9499736d84da97b640b8ab063a6b9dd6d3c",class:e?"s-bottom-alert-actions-group":"s-bottom-alert-action"},e?this.loading?t("salla-loading",{size:"20"}):t("div",{class:"s-bottom-alert-actions-group-container"},t("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?t("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):t("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return a(this)}};n.style=":host{display:block}";export{i as salla_alert,n as salla_bottom_alert}
4
+ import{r as e,h as t,H as s,a}from"./p-MrxrxOqi.js";import{P as l}from"./p-DY4LZmNP.js";import{I as o}from"./p-C-tzSDxw.js";const i=class{constructor(t){e(this,t),this.variant="info"}renderIcon(){const e=this.icon||this.variant;if("none"===e)return null;switch(e){case"success":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M9 16.2l-3.5-3.5L4 14.2l5 5 11-11-1.5-1.5z"}));case"warning":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));case"error":return t("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"currentColor"},t("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 \n 10 10 10-4.48 10-10S17.52 2 12 2zm5 \n 13.59L15.59 17 12 13.41 8.41 17 \n 7 15.59 10.59 12 7 8.41 8.41 7 \n 12 10.59 15.59 7 17 8.41 13.41 \n 12 17 15.59z"}));default:return t("span",{innerHTML:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.99935 18.3332C5.39697 18.3332 1.66602 14.6022 1.66602 9.99984C1.66602 5.39746 5.39697 1.6665 9.99935 1.6665C14.6017 1.6665 18.3327 5.39746 18.3327 9.99984C18.3327 14.6022 14.6017 18.3332 9.99935 18.3332ZM9.99935 16.6665C13.6813 16.6665 16.666 13.6818 16.666 9.99984C16.666 6.31794 13.6813 3.33317 9.99935 3.33317C6.31745 3.33317 3.33268 6.31794 3.33268 9.99984C3.33268 13.6818 6.31745 16.6665 9.99935 16.6665ZM9.16602 5.83317H10.8327V7.49984H9.16602V5.83317ZM9.16602 9.1665H10.8327V14.1665H9.16602V9.1665Z" fill="#417AC8"/>\n</svg>\n'})}}render(){return t(s,{key:"e26a52cc275ac4c2e4090c113cb7e7d4d578fc11",class:`s-alert-wrapper s-alert-${this.variant}`},t("span",{key:"bdb1c6693b226a4e136e89640fcc19fbefc6e29e",class:"s-alert-icon"},this.renderIcon()),t("span",{key:"de8997f9617e74fc082ae9603bf16eac4c0a4b17",class:"s-alert-text"},this.message,t("slot",{key:"37fb1adba1fa7f0226143250632cf20b514ee06b"})))}};i.style=":host{display:block}";const n=class{constructor(t){e(this,t),this.storeId=salla.config.get("store.id"),this.template=salla.config.get("store.template"),this.loading=!1,this.templateData={},this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.storePrice=salla.lang.getWithDefault("common.elements.store_price","سعر المتجر"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template"),this.isRtl=salla.config.get("theme.is_rtl",!0),this.storeName=salla.config.get("store.name"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","تفاصيل أكثر"),this.type="popup",salla.lang.onLoaded((()=>{this.defaultMessage=salla.lang.get("common.elements.experimental_and_available_store"),this.defaultActionLabel=salla.lang.get("common.elements.know_more"),this.storeFeatures=salla.lang.get("common.elements.store_features"),this.storeDetails=salla.lang.get("common.elements.store_details"),this.templateInformation=salla.lang.get("common.elements.template_information"),this.buyTheTemplate=salla.lang.get("common.elements.buy_the_template");const e=salla.lang.messages?.["ar.trans"],t=salla.lang.messages?.["en.trans"];e&&t&&(salla.helpers.setNested(e,"common.elements.more_details","تفاصيل أكثر"),salla.helpers.setNested(t,"common.elements.more_details","More Details"),salla.helpers.setNested(e,"common.elements.store_price","سعر المتجر"),salla.helpers.setNested(t,"common.elements.store_price","Store Price"),salla.helpers.setNested(e,"common.elements.the_developer","المطور"),salla.helpers.setNested(t,"common.elements.the_developer","the developer"),salla.helpers.setNested(e,"common.elements.store_price_details","السعر يشمل"),salla.helpers.setNested(t,"common.elements.store_price_details","Price Includes"),salla.helpers.setNested(e,"common.elements.salla","سلة"),salla.helpers.setNested(t,"common.elements.salla","Salla"),salla.helpers.setNested(e,"common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),salla.helpers.setNested(t,"common.elements.store_is_available_for_purchase","This ready store is available for purchase from"),salla.helpers.setNested(e,"common.elements.ready_stores","المتاجر الجاهزة"),salla.helpers.setNested(t,"common.elements.ready_stores","Ready Stores"),setTimeout((()=>{this.storePrice=salla.lang.get("common.elements.store_price"),this.theDeveloper=salla.lang.get("common.elements.the_developer"),this.storePriceDetails=salla.lang.getWithDefault("common.elements.store_price_details","السعر يشمل"),this.salla=salla.lang.getWithDefault("common.elements.salla","سلة"),this.defaultMessage=salla.lang.getWithDefault("common.elements.store_is_available_for_purchase","هذا المتجر تطويري ومتاح للشراء من"),this.readyStores=salla.lang.getWithDefault("common.elements.ready_stores","المتاجر الجاهزة"),this.moreDetailsLabel=salla.lang.getWithDefault("common.elements.more_details","More Details")}),100))}))}componentDidLoad(){this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0&&this.fetchTemplateData()}open(){return this.drawer.open()}fetchTemplateData(){if(!Object.keys(this.templateData).length)return this.loading=!0,salla.api.request("/store/template",{},"get",{"Store-Identifier":this.storeId}).then((e=>{this.templateData=e.data,this.loading=!1})).catch((()=>{this.loading=!1}))}handleAction(){"link"===this.type&&(window.location.href=this.actionUrl),"popup"===this.type&&this.open()}popup(){return t("salla-drawer",{class:"s-bottom-alert-modal",ref:e=>this.drawer=e,"no-padding":!0,onLoad:()=>{this.drawer&&Object.keys(this.templateData).length&&this.drawer.setTitle(this.storeDetails+" "+this.storeName)}},Object.keys(this.templateData).length?[t("div",{class:"s-bottom-alert-modal-inner s-scrollbar"},t("div",{class:{"s-bottom-alert-modal-content":!0}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{innerHTML:o,class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storeFeatures)),t("div",{class:"s-bottom-alert-modal-content-features",innerHTML:this.templateData?.features})]:""),t("div",{class:{"s-bottom-alert-modal-content":!0,"s-bottom-alert-modal-content-extra-padding":this.templateData?.price}},this.templateData?.features?[t("div",{class:"s-bottom-alert-modal-content-title"},t("i",{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>money-card</title>\n<path d="M17.333 14.667h-2.667c-0.736 0-1.333-0.599-1.333-1.333s0.597-1.333 1.333-1.333h4c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333h-1.333v-1.333c0-0.736-0.596-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v1.333c-2.205 0-4 1.795-4 4s1.795 4 4 4h2.667c0.736 0 1.333 0.597 1.333 1.333s-0.597 1.333-1.333 1.333h-4c-0.737 0-1.333 0.596-1.333 1.333s0.596 1.333 1.333 1.333h1.333v1.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-1.333c2.205 0 4-1.795 4-4s-1.795-4-4-4zM28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.736-0.597 1.333-1.333 1.333h-24c-0.736 0-1.333-0.597-1.333-1.333v-18.667c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-icon"}),t("span",null,this.storePriceDetails)),t("div",{class:"s-bottom-alert-modal-content-price-details"},this.templateData?.price_details?.items.map((e=>t("div",{class:"s-bottom-alert-modal-content-price-details-item"},t("i",{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>check-circle</title>\n<path d="M19.557 11.26l-4.593 6.891-2.891-1.927c-0.616-0.411-1.441-0.243-1.849 0.369-0.409 0.612-0.244 1.441 0.369 1.849l4 2.667c0.228 0.152 0.485 0.224 0.739 0.224 0.431 0 0.855-0.208 1.111-0.593l5.333-8c0.409-0.612 0.244-1.441-0.369-1.849-0.616-0.411-1.443-0.243-1.849 0.369zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n',class:"s-bottom-alert-modal-content-price-details-item-icon"}),t("span",{class:"s-bottom-alert-modal-content-price-details-item-name"},e.name),t("span",{class:"s-bottom-alert-modal-content-price-details-item-price",innerHTML:salla.money(e.price)})))))]:""),this.templateData?.link?t("div",{class:"s-bottom-alert-modal-content-footer"},t("salla-button",{color:"primary",size:"medium",width:"wide",href:this.templateData?.link},t("i",{innerHTML:l}),this.buyTheTemplate)):"")]:"")}render(){const e=this.template&&"object"==typeof this.template&&Object.keys(this.template).length>0;return t(s,{key:"1e598df3c91be1e357fc5d771061ec386573f968",class:"s-bottom-alert-wrapper "+(e?"s-bottom-alert-wrapper-with-template":"")},e&&t("div",{key:"20a0173dfa6a01b793f8e1e9416d295ee4e61783",class:"s-bottom-alert-logo-section"},t("img",{key:"2c9042f0ce022aeb9b2879496ec2837ed14dfe9f",src:"https://cdn.salla.network/images/logo/logo-light.svg",alt:"Salla",class:"s-bottom-alert-logo"}),t("span",{key:"69c2bc09acca8a535d2f982131ccc09d65ea44e6",class:"s-bottom-alert-logo-text"},this.readyStores)),t("div",{key:"553122bac6f1f11c2bcc41a92ac798b3701ebfb9",class:"s-bottom-alert-content"},t("div",{key:"e0df96405998b70c15a8320c8400fa75db77d041",class:"flex items-center gap-2"},t("div",{key:"26f241c725c763dfc25f58cdcd0f2979571a2061",class:"s-bottom-alert-icon"},t("i",this.icon?{class:this.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>info</title>\n<path d="M16 13.333c-0.737 0-1.333 0.596-1.333 1.333v9.333c0 0.737 0.596 1.333 1.333 1.333s1.333-0.596 1.333-1.333v-9.333c0-0.737-0.596-1.333-1.333-1.333zM16 7.987c-0.737 0-1.333 0.596-1.333 1.333v0.013c0 0.737 0.596 1.327 1.333 1.327s1.333-0.603 1.333-1.34-0.596-1.333-1.333-1.333zM16 0c-8.823 0-16 7.177-16 16s7.177 16 16 16 16-7.177 16-16-7.177-16-16-16zM16 29.333c-7.352 0-13.333-5.981-13.333-13.333s5.981-13.333 13.333-13.333 13.333 5.981 13.333 13.333-5.981 13.333-13.333 13.333z"></path>\n</svg>\n'})),t("div",{key:"5e6ba42a2924aec3b99050e8f53634716023a535",class:"s-bottom-alert-message"},this.message?this.message:e?t("span",{class:"flex flex-wrap items-center gap-1"},this.defaultMessage,t("span",{class:{"s-bottom-alert-message-highlight":!0},"aria-label":"Developer"},this.salla),t("span",{innerHTML:salla.money(this.template.price)})):this.defaultMessage)),"banner"!==this.type&&t("div",{key:"44c4d9499736d84da97b640b8ab063a6b9dd6d3c",class:e?"s-bottom-alert-actions-group":"s-bottom-alert-action"},e?this.loading?t("salla-loading",{size:"20"}):t("div",{class:"s-bottom-alert-actions-group-container"},t("a",{class:"s-bottom-alert-action-link",onClick:()=>this.handleAction()},this.actionLabel||this.moreDetailsLabel),this.templateData?.link?t("button",{type:"button",class:"s-bottom-alert-action-purchase-button",onClick:()=>window.open(this.templateData?.link,"_blank")},this.buyTheTemplate):null):t("salla-button",{href:this.actionUrl,size:"medium",onClick:()=>this.handleAction(),width:"normal"},this.actionLabel||this.defaultActionLabel)),"popup"===this.type&&this.popup()))}get host(){return a(this)}};n.style=":host{display:block}";export{i as salla_alert,n as salla_bottom_alert}