@salla.sa/twilight-components 2.14.392 → 2.14.393

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 (568) hide show
  1. package/dist/cjs/app-globals-oehrC7QI.js +39 -0
  2. package/dist/cjs/{filepond-D-ur1GA-.js → filepond-D7RVR_w_.js} +10 -5
  3. package/dist/cjs/{filepond-plugin-file-poster-DigEeKId.js → filepond-plugin-file-poster-DTuZK2ot.js} +11 -7
  4. package/dist/cjs/{filepond-plugin-file-validate-size-R9el3Yro.js → filepond-plugin-file-validate-size-DHc6pF_j.js} +1 -1
  5. package/dist/cjs/filepond-plugin-file-validate-type-DnkcvJVc.js +271 -0
  6. package/dist/cjs/{filepond-plugin-image-edit-bhI8kqN_.js → filepond-plugin-image-edit-vrZ1s7kw.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-COXZUVRV.js → filepond-plugin-image-exif-orientation-Bn5JSzQK.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-COP8QJBf.js → filepond-plugin-image-preview-8qWUFe9n.js} +1 -1
  9. package/dist/cjs/{index-CGnPURjZ.js → index-C5VeFDQ0.js} +1966 -1344
  10. package/dist/cjs/{index-BILBEE9f.js → index-CwD81m7i.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +4 -3
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +5 -5
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +19 -15
  14. package/dist/cjs/salla-add-product-button_4.cjs.entry.js +12 -10
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +3 -3
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +5 -5
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +3 -3
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +3 -3
  19. package/dist/cjs/salla-booking-field_7.cjs.entry.js +25 -23
  20. package/dist/cjs/salla-bullet-delivery.cjs.entry.js +3 -3
  21. package/dist/cjs/salla-cart-coupons.cjs.entry.js +3 -3
  22. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +5 -5
  23. package/dist/cjs/salla-comment-form_8.cjs.entry.js +17 -17
  24. package/dist/cjs/salla-conditional-offer.cjs.entry.js +3 -3
  25. package/dist/cjs/salla-contacts.cjs.entry.js +3 -3
  26. package/dist/cjs/salla-cookies-bar.cjs.entry.js +3 -3
  27. package/dist/cjs/salla-count-down.cjs.entry.js +35 -11
  28. package/dist/cjs/salla-custom-fields.cjs.entry.js +3 -3
  29. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-filters-widget.cjs.entry.js +3 -3
  31. package/dist/cjs/salla-filters.cjs.entry.js +3 -3
  32. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-gifting.cjs.entry.js +3 -3
  34. package/dist/cjs/salla-hook.cjs.entry.js +5 -2
  35. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +3 -3
  36. package/dist/cjs/salla-installment.cjs.entry.js +3 -3
  37. package/dist/cjs/salla-list-tile.cjs.entry.js +3 -3
  38. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-login-modal.cjs.entry.js +3 -3
  40. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +3 -3
  41. package/dist/cjs/salla-loyalty-program.cjs.entry.js +3 -3
  42. package/dist/cjs/salla-loyalty.cjs.entry.js +3 -3
  43. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +3 -3
  44. package/dist/cjs/salla-map.cjs.entry.js +3 -3
  45. package/dist/cjs/salla-menu.cjs.entry.js +3 -3
  46. package/dist/cjs/salla-metadata.cjs.entry.js +3 -3
  47. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +5 -5
  48. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +8 -6
  49. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +6 -4
  50. package/dist/cjs/salla-notification-item.cjs.entry.js +3 -3
  51. package/dist/cjs/salla-notifications.cjs.entry.js +50 -5
  52. package/dist/cjs/salla-offer-modal.cjs.entry.js +3 -3
  53. package/dist/cjs/salla-offer.cjs.entry.js +3 -3
  54. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +3 -3
  55. package/dist/cjs/salla-order-details-options.cjs.entry.js +3 -3
  56. package/dist/cjs/salla-order-details.cjs.entry.js +6 -4
  57. package/dist/cjs/salla-order-edit-item.cjs.entry.js +3 -3
  58. package/dist/cjs/salla-order-edit.cjs.entry.js +3 -3
  59. package/dist/cjs/salla-order-summary.cjs.entry.js +3 -3
  60. package/dist/cjs/salla-order-totals-card.cjs.entry.js +6 -4
  61. package/dist/cjs/salla-orders.cjs.entry.js +3 -3
  62. package/dist/cjs/salla-payments.cjs.entry.js +3 -3
  63. package/dist/cjs/salla-placeholder.cjs.entry.js +3 -3
  64. package/dist/cjs/salla-price-range.cjs.entry.js +3 -3
  65. package/dist/cjs/salla-product-card.cjs.entry.js +3 -3
  66. package/dist/cjs/salla-product-size-guide.cjs.entry.js +3 -3
  67. package/dist/cjs/salla-products-list.cjs.entry.js +3 -3
  68. package/dist/cjs/salla-products-slider.cjs.entry.js +3 -3
  69. package/dist/cjs/salla-progress-bar.cjs.entry.js +3 -3
  70. package/dist/cjs/salla-quick-order.cjs.entry.js +3 -3
  71. package/dist/cjs/salla-rating-modal.cjs.entry.js +3 -3
  72. package/dist/cjs/salla-scopes.cjs.entry.js +3 -3
  73. package/dist/cjs/salla-search.cjs.entry.js +6 -4
  74. package/dist/cjs/salla-skeleton.cjs.entry.js +3 -3
  75. package/dist/cjs/salla-slider.cjs.entry.js +20 -14
  76. package/dist/cjs/salla-social-share.cjs.entry.js +3 -3
  77. package/dist/cjs/salla-social.cjs.entry.js +3 -3
  78. package/dist/cjs/salla-tab-content_3.cjs.entry.js +7 -7
  79. package/dist/cjs/salla-tiered-offer.cjs.entry.js +3 -3
  80. package/dist/cjs/salla-tooltip.cjs.entry.js +3 -3
  81. package/dist/cjs/salla-trust-badges.cjs.entry.js +3 -3
  82. package/dist/cjs/salla-user-menu.cjs.entry.js +3 -3
  83. package/dist/cjs/salla-user-profile.cjs.entry.js +3 -3
  84. package/dist/cjs/salla-user-settings.cjs.entry.js +3 -3
  85. package/dist/cjs/salla-verify.cjs.entry.js +3 -3
  86. package/dist/cjs/salla-wallet.cjs.entry.js +3 -3
  87. package/dist/cjs/twilight.cjs.js +5 -4
  88. package/dist/cjs/{vanilla-picker-DI3TImGd.js → vanilla-picker-yKERbLpx.js} +1 -1
  89. package/dist/collection/collection-manifest.json +3 -2
  90. package/dist/collection/components/salla-accordion/salla-accordion-head.js +2 -2
  91. package/dist/collection/components/salla-accordion/salla-accordion.js +4 -4
  92. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +19 -19
  93. package/dist/collection/components/salla-alert/salla-alert.js +5 -5
  94. package/dist/collection/components/salla-apps-icons/salla-apps-icons.js +6 -6
  95. package/dist/collection/components/salla-booking-field/salla-booking-field.js +4 -4
  96. package/dist/collection/components/salla-bottom-alert/salla-bottom-alert.js +9 -9
  97. package/dist/collection/components/salla-bullet-delivery/salla-bullet-delivery.js +6 -3
  98. package/dist/collection/components/salla-button/salla-button.js +11 -11
  99. package/dist/collection/components/salla-cart-coupons/salla-cart-coupons.js +2 -1
  100. package/dist/collection/components/salla-cart-item-offers/salla-cart-item-offers.js +8 -8
  101. package/dist/collection/components/salla-cart-summary/salla-cart-summary.js +2 -2
  102. package/dist/collection/components/salla-color-picker/salla-color-picker.js +20 -14
  103. package/dist/collection/components/salla-comment-form/salla-comment-form.js +6 -6
  104. package/dist/collection/components/salla-comments/salla-comment-item.js +2 -3
  105. package/dist/collection/components/salla-comments/salla-comments.js +18 -17
  106. package/dist/collection/components/salla-contacts/salla-contacts.js +10 -10
  107. package/dist/collection/components/salla-count-down/salla-count-down.js +66 -42
  108. package/dist/collection/components/salla-custom-fields/salla-custom-fields.js +9 -7
  109. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +69 -65
  110. package/dist/collection/components/salla-drawer/salla-drawer.js +11 -11
  111. package/dist/collection/components/salla-file-upload/salla-file-upload.css +1 -1
  112. package/dist/collection/components/salla-file-upload/salla-file-upload.js +85 -84
  113. package/dist/collection/components/salla-filters/salla-filters.js +2 -2
  114. package/dist/collection/components/salla-filters-widget/salla-filters-widget.js +4 -5
  115. package/dist/collection/components/salla-gifting/salla-gifting.js +11 -11
  116. package/dist/collection/components/salla-hook/salla-hook.js +2 -2
  117. package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +6 -6
  118. package/dist/collection/components/salla-installment/salla-installment.js +5 -5
  119. package/dist/collection/components/salla-list-tile/salla-list-tile.js +2 -2
  120. package/dist/collection/components/salla-loading/salla-loading.js +4 -4
  121. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +5 -5
  122. package/dist/collection/components/salla-login-modal/salla-login-modal.js +14 -14
  123. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +4 -3
  124. package/dist/collection/components/salla-loyalty/salla-loyalty.js +13 -12
  125. package/dist/collection/components/salla-map/salla-map.js +14 -14
  126. package/dist/collection/components/salla-menu/salla-menu.js +10 -9
  127. package/dist/collection/components/salla-metadata/salla-metadata.js +3 -3
  128. package/dist/collection/components/salla-modal/salla-modal.js +11 -11
  129. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-cart.js +2 -2
  130. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +2 -2
  131. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +4 -2
  132. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +8 -7
  133. package/dist/collection/components/salla-multiple-bundle-product/salla-multiple-bundle-product.js +2 -2
  134. package/dist/collection/components/salla-notifications/salla-notification-item.js +2 -2
  135. package/dist/collection/components/salla-notifications/salla-notifications.js +50 -5
  136. package/dist/collection/components/salla-offer/salla-offer.js +1 -1
  137. package/dist/collection/components/salla-order-details/salla-order-details-multiple-bundle-product.js +5 -5
  138. package/dist/collection/components/salla-order-details/salla-order-details-options.js +6 -5
  139. package/dist/collection/components/salla-order-details/salla-order-details.js +4 -3
  140. package/dist/collection/components/salla-order-edit/salla-order-edit-item.js +4 -4
  141. package/dist/collection/components/salla-order-edit/salla-order-edit.js +4 -4
  142. package/dist/collection/components/salla-order-summary/salla-order-summary.js +2 -2
  143. package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +4 -3
  144. package/dist/collection/components/salla-orders/salla-orders.js +4 -4
  145. package/dist/collection/components/salla-payments/salla-payments.js +0 -1
  146. package/dist/collection/components/salla-placeholder/salla-placeholder.js +3 -3
  147. package/dist/collection/components/salla-price-range/salla-price-range.js +8 -8
  148. package/dist/collection/components/salla-product-availability/salla-product-availability.js +6 -6
  149. package/dist/collection/components/salla-product-card/salla-product-card.js +18 -18
  150. package/dist/collection/components/salla-product-options/salla-product-options.js +15 -13
  151. package/dist/collection/components/salla-products-list/salla-products-list.js +20 -21
  152. package/dist/collection/components/salla-products-slider/salla-products-slider.js +22 -23
  153. package/dist/collection/components/salla-progress-bar/salla-progress-bar.js +21 -20
  154. package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +2 -2
  155. package/dist/collection/components/salla-quick-buy/salla-quick-buy.js +16 -17
  156. package/dist/collection/components/salla-quick-order/salla-quick-order.js +11 -11
  157. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +2 -2
  158. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +8 -8
  159. package/dist/collection/components/salla-review-card/salla-review-card.js +3 -3
  160. package/dist/collection/components/salla-reviews/salla-reviews.js +16 -13
  161. package/dist/collection/components/salla-reviews-summary/salla-reviews-summary.js +2 -2
  162. package/dist/collection/components/salla-scopes/salla-scopes.js +2 -2
  163. package/dist/collection/components/salla-search/salla-search.js +6 -6
  164. package/dist/collection/components/salla-skeleton/salla-skeleton.js +3 -3
  165. package/dist/collection/components/salla-slider/salla-slider.css +9 -2
  166. package/dist/collection/components/salla-slider/salla-slider.js +25 -25
  167. package/dist/collection/components/salla-social-share/salla-social-share.js +3 -3
  168. package/dist/collection/components/salla-tabs/salla-tab-content.js +2 -2
  169. package/dist/collection/components/salla-tabs/salla-tab-header.js +5 -5
  170. package/dist/collection/components/salla-tabs/salla-tabs.js +2 -2
  171. package/dist/collection/components/salla-tel-input/salla-tel-input.js +9 -8
  172. package/dist/collection/components/salla-tooltip/salla-tooltip.js +5 -5
  173. package/dist/collection/components/salla-trust-badges/salla-trust-badges.js +1 -1
  174. package/dist/collection/components/salla-user-menu/salla-user-menu.js +5 -5
  175. package/dist/collection/components/salla-user-profile/salla-user-profile.js +1 -1
  176. package/dist/collection/components/salla-verify/salla-verify.js +4 -4
  177. package/dist/components/Helper.js +1 -432
  178. package/dist/components/_commonjsHelpers.js +1 -7
  179. package/dist/components/anime.es.js +1 -1310
  180. package/dist/components/arrow-left.js +1 -8
  181. package/dist/components/axios.js +2 -3908
  182. package/dist/components/bell-ring.js +1 -8
  183. package/dist/components/camera.js +1 -8
  184. package/dist/components/cancel.js +1 -8
  185. package/dist/components/cart.js +1 -8
  186. package/dist/components/check-circle2.js +1 -15
  187. package/dist/components/check.js +1 -8
  188. package/dist/components/facebook.js +1 -10
  189. package/dist/components/filepond-plugin-file-poster.js +3 -659
  190. package/dist/components/filepond-plugin-file-validate-size.js +2 -204
  191. package/dist/components/filepond-plugin-file-validate-type.js +3 -279
  192. package/dist/components/filepond-plugin-image-edit.js +2 -487
  193. package/dist/components/filepond-plugin-image-exif-orientation.js +2 -214
  194. package/dist/components/filepond-plugin-image-preview.js +2 -2237
  195. package/dist/components/filepond.js +3 -11282
  196. package/dist/components/gift.js +1 -8
  197. package/dist/components/image.js +1 -8
  198. package/dist/components/index.d.ts +2 -0
  199. package/dist/components/index.js +1 -8163
  200. package/dist/components/index2.js +1 -1709
  201. package/dist/components/index3.js +1 -2550
  202. package/dist/components/interfaces.js +1 -12
  203. package/dist/components/isObject.js +1 -292
  204. package/dist/components/keyboard_arrow_down.js +1 -8
  205. package/dist/components/keyboard_arrow_right.js +1 -15
  206. package/dist/components/location.js +1 -11
  207. package/dist/components/mail.js +1 -8
  208. package/dist/components/minus.js +1 -15
  209. package/dist/components/salla-accordion-body.js +1 -6
  210. package/dist/components/salla-accordion-body2.js +1 -30
  211. package/dist/components/salla-accordion-head.js +1 -6
  212. package/dist/components/salla-accordion-head2.js +1 -63
  213. package/dist/components/salla-accordion.js +1 -6
  214. package/dist/components/salla-accordion2.js +1 -68
  215. package/dist/components/salla-add-product-button.js +1 -6
  216. package/dist/components/salla-add-product-button2.js +1 -306
  217. package/dist/components/salla-advertisement.js +1 -155
  218. package/dist/components/salla-alert.js +1 -59
  219. package/dist/components/salla-app-install-alert.js +1 -91
  220. package/dist/components/salla-apps-icons.js +1 -63
  221. package/dist/components/salla-booking-field.js +1 -6
  222. package/dist/components/salla-booking-field2.js +1 -221
  223. package/dist/components/salla-bottom-alert.js +1 -214
  224. package/dist/components/salla-breadcrumb.js +1 -226
  225. package/dist/components/salla-bullet-delivery.js +1 -2114
  226. package/dist/components/salla-button.js +1 -6
  227. package/dist/components/salla-button2.js +1 -174
  228. package/dist/components/salla-cart-coupons.js +1 -284
  229. package/dist/components/salla-cart-item-offers.js +1 -143
  230. package/dist/components/salla-cart-summary.js +1 -136
  231. package/dist/components/salla-color-picker.js +1 -6
  232. package/dist/components/salla-color-picker2.js +1 -260
  233. package/dist/components/salla-comment-form.js +1 -6
  234. package/dist/components/salla-comment-form2.js +1 -64
  235. package/dist/components/salla-comment-item.js +1 -6
  236. package/dist/components/salla-comment-item2.js +1 -217
  237. package/dist/components/salla-comments.js +1 -395
  238. package/dist/components/salla-conditional-fields.js +1 -6
  239. package/dist/components/salla-conditional-fields2.js +1 -137
  240. package/dist/components/salla-conditional-offer.js +1 -194
  241. package/dist/components/salla-contacts.js +1 -125
  242. package/dist/components/salla-cookies-bar.js +1 -107
  243. package/dist/components/salla-count-down.js +1 -6
  244. package/dist/components/salla-count-down2.js +1 -247
  245. package/dist/components/salla-custom-fields.js +1 -175
  246. package/dist/components/salla-datetime-picker.js +1 -6
  247. package/dist/components/salla-datetime-picker2.js +1 -342
  248. package/dist/components/salla-delivery-promise.js +1 -263
  249. package/dist/components/salla-drawer.js +1 -6
  250. package/dist/components/salla-drawer2.js +1 -214
  251. package/dist/components/salla-file-upload.js +1 -6
  252. package/dist/components/salla-file-upload2.js +1 -583
  253. package/dist/components/salla-filters-widget.js +1 -6
  254. package/dist/components/salla-filters-widget2.js +1 -245
  255. package/dist/components/salla-filters.js +1 -253
  256. package/dist/components/salla-fulfillment-methods.js +1 -61
  257. package/dist/components/salla-gifting.js +1 -732
  258. package/dist/components/salla-hook.js +1 -47
  259. package/dist/components/salla-infinite-scroll.js +1 -112
  260. package/dist/components/salla-installment.js +1 -306
  261. package/dist/components/salla-list-tile.js +1 -6
  262. package/dist/components/salla-list-tile2.js +1 -47
  263. package/dist/components/salla-loading.js +1 -6
  264. package/dist/components/salla-loading2.js +1 -51
  265. package/dist/components/salla-localization-modal.js +1 -296
  266. package/dist/components/salla-login-modal.js +1 -6
  267. package/dist/components/salla-login-modal2.js +1 -359
  268. package/dist/components/salla-loyalty-prize-item.js +1 -39
  269. package/dist/components/salla-loyalty-program.js +1 -115
  270. package/dist/components/salla-loyalty.js +1 -304
  271. package/dist/components/salla-maintenance-alert.js +1 -57
  272. package/dist/components/salla-map.js +1 -6
  273. package/dist/components/salla-map2.js +1 -766
  274. package/dist/components/salla-menu.js +1 -165
  275. package/dist/components/salla-metadata.js +1 -97
  276. package/dist/components/salla-modal.js +1 -6
  277. package/dist/components/salla-modal2.js +1 -215
  278. package/dist/components/salla-multiple-bundle-product-cart.js +1 -6
  279. package/dist/components/salla-multiple-bundle-product-cart2.js +1 -151
  280. package/dist/components/salla-multiple-bundle-product-details.js +1 -6
  281. package/dist/components/salla-multiple-bundle-product-details2.js +1 -296
  282. package/dist/components/salla-multiple-bundle-product-options-modal.js +1 -6
  283. package/dist/components/salla-multiple-bundle-product-options-modal2.js +1 -598
  284. package/dist/components/salla-multiple-bundle-product-slider.js +1 -6
  285. package/dist/components/salla-multiple-bundle-product-slider2.js +1 -136
  286. package/dist/components/salla-multiple-bundle-product.js +1 -207
  287. package/dist/components/salla-notification-item.js +1 -6
  288. package/dist/components/salla-notification-item2.js +1 -32
  289. package/dist/components/salla-notifications.js +1 -145
  290. package/dist/components/salla-offer-modal.js +1 -328
  291. package/dist/components/salla-offer.js +1 -478
  292. package/dist/components/salla-order-details-multiple-bundle-product.js +1 -6
  293. package/dist/components/salla-order-details-multiple-bundle-product2.js +1 -122
  294. package/dist/components/salla-order-details-options.js +1 -6
  295. package/dist/components/salla-order-details-options2.js +1 -140
  296. package/dist/components/salla-order-details.js +1 -122
  297. package/dist/components/salla-order-edit-item.js +1 -6
  298. package/dist/components/salla-order-edit-item2.js +1 -181
  299. package/dist/components/salla-order-edit.js +1 -288
  300. package/dist/components/salla-order-summary.js +1 -132
  301. package/dist/components/salla-order-totals-card.js +1 -87
  302. package/dist/components/salla-orders.js +1 -271
  303. package/dist/components/salla-payments.js +1 -76
  304. package/dist/components/salla-placeholder.js +1 -6
  305. package/dist/components/salla-placeholder2.js +1 -66
  306. package/dist/components/salla-price-range.js +1 -6
  307. package/dist/components/salla-price-range2.js +1 -204
  308. package/dist/components/salla-product-availability.js +1 -6
  309. package/dist/components/salla-product-availability2.js +1 -206
  310. package/dist/components/salla-product-card.js +1 -6
  311. package/dist/components/salla-product-card2.js +1 -241
  312. package/dist/components/salla-product-options.js +1 -6
  313. package/dist/components/salla-product-options2.js +1 -962
  314. package/dist/components/salla-product-size-guide.js +1 -130
  315. package/dist/components/salla-products-list.js +1 -6
  316. package/dist/components/salla-products-list2.js +1 -812
  317. package/dist/components/salla-products-slider.js +1 -6
  318. package/dist/components/salla-products-slider2.js +1 -215
  319. package/dist/components/salla-progress-bar.js +1 -6
  320. package/dist/components/salla-progress-bar2.js +1 -94
  321. package/dist/components/salla-quantity-input.js +1 -6
  322. package/dist/components/salla-quantity-input2.js +1 -127
  323. package/dist/components/salla-quick-buy.js +1 -6
  324. package/dist/components/salla-quick-buy2.js +1 -1181
  325. package/dist/components/salla-quick-order.js +1 -299
  326. package/dist/components/salla-rating-modal.js +1 -530
  327. package/dist/components/salla-rating-stars.js +1 -6
  328. package/dist/components/salla-rating-stars2.js +1 -162
  329. package/dist/components/salla-review-card.js +1 -6
  330. package/dist/components/salla-review-card2.js +1 -198
  331. package/dist/components/salla-reviews-page.js +1 -726
  332. package/dist/components/salla-reviews-summary.js +1 -6
  333. package/dist/components/salla-reviews-summary2.js +1 -132
  334. package/dist/components/salla-reviews.js +1 -143
  335. package/dist/components/salla-scopes.js +1 -249
  336. package/dist/components/salla-search.js +1 -213
  337. package/dist/components/salla-skeleton.js +1 -6
  338. package/dist/components/salla-skeleton2.js +1 -50
  339. package/dist/components/salla-slider.js +1 -6
  340. package/dist/components/salla-slider2.js +1 -10483
  341. package/dist/components/salla-social-share.js +1 -194
  342. package/dist/components/salla-social.js +1 -89
  343. package/dist/components/salla-tab-content.js +1 -6
  344. package/dist/components/salla-tab-content2.js +1 -55
  345. package/dist/components/salla-tab-header.js +1 -6
  346. package/dist/components/salla-tab-header2.js +1 -85
  347. package/dist/components/salla-tabs.js +1 -6
  348. package/dist/components/salla-tabs2.js +1 -75
  349. package/dist/components/salla-tel-input.js +1 -6
  350. package/dist/components/salla-tel-input2.js +1 -168
  351. package/dist/components/salla-tiered-offer.js +1 -366
  352. package/dist/components/salla-tooltip.js +1 -6
  353. package/dist/components/salla-tooltip2.js +1 -57
  354. package/dist/components/salla-trust-badges.js +1 -90
  355. package/dist/components/salla-user-menu.js +1 -344
  356. package/dist/components/salla-user-profile.js +1 -203
  357. package/dist/components/salla-user-settings.js +1 -139
  358. package/dist/components/salla-verify.js +1 -303
  359. package/dist/components/salla-wallet.js +1 -114
  360. package/dist/components/search.js +1 -8
  361. package/dist/components/shopping-bag.js +1 -8
  362. package/dist/components/special-discount.js +1 -8
  363. package/dist/components/star.js +1 -8
  364. package/dist/components/star2.js +1 -8
  365. package/dist/components/vanilla-picker.js +2 -1034
  366. package/dist/components/whatsapp2.js +1 -8
  367. package/dist/esm/app-globals-BFryt7-C.js +37 -0
  368. package/dist/esm/{filepond-kTbl0kuh.js → filepond-DlGaLh8N.js} +10 -5
  369. package/dist/esm/{filepond-plugin-file-poster-CyywnjKv.js → filepond-plugin-file-poster-BTVFYcQx.js} +11 -7
  370. package/dist/esm/{filepond-plugin-file-validate-size-DgteZhje.js → filepond-plugin-file-validate-size-DGryLmWv.js} +1 -1
  371. package/dist/esm/filepond-plugin-file-validate-type-DxKfCD0V.js +269 -0
  372. package/dist/esm/{filepond-plugin-image-edit-pZ_mETE7.js → filepond-plugin-image-edit-2W7pu9hn.js} +1 -1
  373. package/dist/esm/{filepond-plugin-image-exif-orientation-CjKYl7HL.js → filepond-plugin-image-exif-orientation-OQu-IvPH.js} +1 -1
  374. package/dist/esm/{filepond-plugin-image-preview-BzJTl_2A.js → filepond-plugin-image-preview-DEW_tSNR.js} +1 -1
  375. package/dist/esm/{index-3Kis_Ivk.js → index-BDqMkCqE.js} +1 -1
  376. package/dist/esm/{index-C23tPnnH.js → index-DYB20YqN.js} +1966 -1344
  377. package/dist/esm/loader.js +4 -3
  378. package/dist/esm/salla-accordion-body_2.entry.js +5 -5
  379. package/dist/esm/salla-accordion_6.entry.js +19 -15
  380. package/dist/esm/salla-add-product-button_4.entry.js +12 -10
  381. package/dist/esm/salla-advertisement.entry.js +3 -3
  382. package/dist/esm/salla-alert_2.entry.js +5 -5
  383. package/dist/esm/salla-app-install-alert.entry.js +3 -3
  384. package/dist/esm/salla-apps-icons.entry.js +3 -3
  385. package/dist/esm/salla-booking-field_7.entry.js +25 -23
  386. package/dist/esm/salla-bullet-delivery.entry.js +3 -3
  387. package/dist/esm/salla-cart-coupons.entry.js +3 -3
  388. package/dist/esm/salla-cart-item-offers_2.entry.js +5 -5
  389. package/dist/esm/salla-comment-form_8.entry.js +17 -17
  390. package/dist/esm/salla-conditional-offer.entry.js +3 -3
  391. package/dist/esm/salla-contacts.entry.js +3 -3
  392. package/dist/esm/salla-cookies-bar.entry.js +3 -3
  393. package/dist/esm/salla-count-down.entry.js +35 -11
  394. package/dist/esm/salla-custom-fields.entry.js +3 -3
  395. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  396. package/dist/esm/salla-filters-widget.entry.js +3 -3
  397. package/dist/esm/salla-filters.entry.js +3 -3
  398. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  399. package/dist/esm/salla-gifting.entry.js +3 -3
  400. package/dist/esm/salla-hook.entry.js +5 -2
  401. package/dist/esm/salla-infinite-scroll.entry.js +3 -3
  402. package/dist/esm/salla-installment.entry.js +3 -3
  403. package/dist/esm/salla-list-tile.entry.js +3 -3
  404. package/dist/esm/salla-localization-modal.entry.js +1 -1
  405. package/dist/esm/salla-login-modal.entry.js +3 -3
  406. package/dist/esm/salla-loyalty-prize-item.entry.js +3 -3
  407. package/dist/esm/salla-loyalty-program.entry.js +3 -3
  408. package/dist/esm/salla-loyalty.entry.js +3 -3
  409. package/dist/esm/salla-maintenance-alert.entry.js +3 -3
  410. package/dist/esm/salla-map.entry.js +3 -3
  411. package/dist/esm/salla-menu.entry.js +3 -3
  412. package/dist/esm/salla-metadata.entry.js +3 -3
  413. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +5 -5
  414. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +8 -6
  415. package/dist/esm/salla-multiple-bundle-product.entry.js +6 -4
  416. package/dist/esm/salla-notification-item.entry.js +3 -3
  417. package/dist/esm/salla-notifications.entry.js +50 -5
  418. package/dist/esm/salla-offer-modal.entry.js +3 -3
  419. package/dist/esm/salla-offer.entry.js +3 -3
  420. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +3 -3
  421. package/dist/esm/salla-order-details-options.entry.js +3 -3
  422. package/dist/esm/salla-order-details.entry.js +6 -4
  423. package/dist/esm/salla-order-edit-item.entry.js +3 -3
  424. package/dist/esm/salla-order-edit.entry.js +3 -3
  425. package/dist/esm/salla-order-summary.entry.js +3 -3
  426. package/dist/esm/salla-order-totals-card.entry.js +6 -4
  427. package/dist/esm/salla-orders.entry.js +3 -3
  428. package/dist/esm/salla-payments.entry.js +3 -3
  429. package/dist/esm/salla-placeholder.entry.js +3 -3
  430. package/dist/esm/salla-price-range.entry.js +3 -3
  431. package/dist/esm/salla-product-card.entry.js +3 -3
  432. package/dist/esm/salla-product-size-guide.entry.js +3 -3
  433. package/dist/esm/salla-products-list.entry.js +3 -3
  434. package/dist/esm/salla-products-slider.entry.js +3 -3
  435. package/dist/esm/salla-progress-bar.entry.js +3 -3
  436. package/dist/esm/salla-quick-order.entry.js +3 -3
  437. package/dist/esm/salla-rating-modal.entry.js +3 -3
  438. package/dist/esm/salla-scopes.entry.js +3 -3
  439. package/dist/esm/salla-search.entry.js +6 -4
  440. package/dist/esm/salla-skeleton.entry.js +3 -3
  441. package/dist/esm/salla-slider.entry.js +20 -14
  442. package/dist/esm/salla-social-share.entry.js +3 -3
  443. package/dist/esm/salla-social.entry.js +3 -3
  444. package/dist/esm/salla-tab-content_3.entry.js +7 -7
  445. package/dist/esm/salla-tiered-offer.entry.js +3 -3
  446. package/dist/esm/salla-tooltip.entry.js +3 -3
  447. package/dist/esm/salla-trust-badges.entry.js +3 -3
  448. package/dist/esm/salla-user-menu.entry.js +3 -3
  449. package/dist/esm/salla-user-profile.entry.js +3 -3
  450. package/dist/esm/salla-user-settings.entry.js +3 -3
  451. package/dist/esm/salla-verify.entry.js +3 -3
  452. package/dist/esm/salla-wallet.entry.js +3 -3
  453. package/dist/esm/twilight.js +5 -4
  454. package/dist/esm/{vanilla-picker-CEy5x8Cf.js → vanilla-picker-Dt9vZPZF.js} +1 -1
  455. package/dist/twilight/{p-651fe6e4.entry.js → p-06fa7327.entry.js} +1 -1
  456. package/dist/twilight/{p-a50f7f70.entry.js → p-09d39785.entry.js} +1 -1
  457. package/dist/twilight/{p-744d6394.entry.js → p-0add06f9.entry.js} +1 -1
  458. package/dist/twilight/{p-f251e744.entry.js → p-105b1dab.entry.js} +1 -1
  459. package/dist/twilight/{p-407828e4.entry.js → p-108d8c8b.entry.js} +1 -1
  460. package/dist/twilight/{p-2a1871c2.entry.js → p-1875537e.entry.js} +1 -1
  461. package/dist/twilight/{p-ff6f769c.entry.js → p-18bb0181.entry.js} +1 -1
  462. package/dist/twilight/p-1daeed6e.entry.js +4 -0
  463. package/dist/twilight/{p-2aa48902.entry.js → p-1ef2602d.entry.js} +1 -1
  464. package/dist/twilight/{p-27f34c85.entry.js → p-2881bb33.entry.js} +1 -1
  465. package/dist/twilight/{p-c3d0c062.entry.js → p-293c6cf3.entry.js} +1 -1
  466. package/dist/twilight/{p-866b297b.entry.js → p-296d2dd0.entry.js} +1 -1
  467. package/dist/twilight/{p-3a5aaa20.entry.js → p-2abaa633.entry.js} +1 -1
  468. package/dist/twilight/p-2ddb3fce.entry.js +4 -0
  469. package/dist/twilight/{p-81f648a2.entry.js → p-2fe01e44.entry.js} +1 -1
  470. package/dist/twilight/p-33779828.entry.js +4 -0
  471. package/dist/twilight/p-34968e31.entry.js +4 -0
  472. package/dist/twilight/{p-3745a7d0.entry.js → p-34b670fc.entry.js} +1 -1
  473. package/dist/twilight/{p-9f23dd30.entry.js → p-3ccc532d.entry.js} +1 -1
  474. package/dist/twilight/{p-f2ee9ceb.entry.js → p-41c733c2.entry.js} +1 -1
  475. package/dist/twilight/{p-67fe5680.entry.js → p-44fa7521.entry.js} +1 -1
  476. package/dist/twilight/{p-b4f07395.entry.js → p-4932857d.entry.js} +1 -1
  477. package/dist/twilight/{p-81f6638f.entry.js → p-4fa4547a.entry.js} +1 -1
  478. package/dist/twilight/{p-ba4b672c.entry.js → p-542d3277.entry.js} +1 -1
  479. package/dist/twilight/{p-a00e249b.entry.js → p-57ff1f25.entry.js} +1 -1
  480. package/dist/twilight/{p-827edf95.entry.js → p-59ae82bd.entry.js} +1 -1
  481. package/dist/twilight/{p-82e3c734.entry.js → p-647b6d76.entry.js} +1 -1
  482. package/dist/twilight/p-665189b4.entry.js +4 -0
  483. package/dist/twilight/{p-b55da21d.entry.js → p-6f36541a.entry.js} +1 -1
  484. package/dist/twilight/{p-c8aa5377.entry.js → p-7093a427.entry.js} +1 -1
  485. package/dist/twilight/{p-f201122a.entry.js → p-748df7e6.entry.js} +1 -1
  486. package/dist/twilight/p-776c9d33.entry.js +4 -0
  487. package/dist/twilight/{p-ce9fee6d.entry.js → p-7abddca8.entry.js} +1 -1
  488. package/dist/twilight/p-7b8313ef.entry.js +4 -0
  489. package/dist/twilight/p-7bd0ede5.entry.js +4 -0
  490. package/dist/twilight/p-817b8ba5.entry.js +4 -0
  491. package/dist/twilight/{p-5ef1b170.entry.js → p-87c0ca91.entry.js} +1 -1
  492. package/dist/twilight/p-8e8d9d7d.entry.js +4 -0
  493. package/dist/twilight/{p-BHjlzmYy.js → p-8r0S6BcZ.js} +1 -1
  494. package/dist/twilight/{p-face0448.entry.js → p-94dbc1e9.entry.js} +1 -1
  495. package/dist/twilight/{p-4e00f827.entry.js → p-96a20515.entry.js} +1 -1
  496. package/dist/twilight/{p-81f76d49.entry.js → p-96d03a28.entry.js} +1 -1
  497. package/dist/twilight/{p-97df32eb.entry.js → p-96e78428.entry.js} +1 -1
  498. package/dist/twilight/{p-CU-HtXWh.js → p-BZnoSB1s.js} +1 -1
  499. package/dist/twilight/p-BkClxrC4.js +9 -0
  500. package/dist/twilight/p-Ck4zxCil.js +9 -0
  501. package/dist/twilight/{p-IoI86ovS.js → p-Cw3UBzjl.js} +1 -1
  502. package/dist/twilight/p-D1vqXXNX.js +9 -0
  503. package/dist/twilight/p-DYB20YqN.js +5 -0
  504. package/dist/twilight/p-Vl6qpttb.js +4 -0
  505. package/dist/twilight/{p-BgG5eq1x.js → p-X6Yi3bYP.js} +1 -1
  506. package/dist/twilight/{p-d022b6ec.entry.js → p-a01f1992.entry.js} +1 -1
  507. package/dist/twilight/{p-5d37cc33.entry.js → p-aa7c5de0.entry.js} +1 -1
  508. package/dist/twilight/{p-b6ded196.entry.js → p-aaa0c743.entry.js} +1 -1
  509. package/dist/twilight/{p-713590e2.entry.js → p-ad041ab5.entry.js} +1 -1
  510. package/dist/twilight/{p-d1dd1db6.entry.js → p-ad07f67a.entry.js} +1 -1
  511. package/dist/twilight/{p-f1f74b41.entry.js → p-af3c74f4.entry.js} +1 -1
  512. package/dist/twilight/p-af60e72a.entry.js +4 -0
  513. package/dist/twilight/{p-bdcf3926.entry.js → p-b17d055d.entry.js} +1 -1
  514. package/dist/twilight/{p-c68f3054.entry.js → p-b598c0f7.entry.js} +1 -1
  515. package/dist/twilight/{p-8c6db6d7.entry.js → p-b64f3155.entry.js} +1 -1
  516. package/dist/twilight/p-bNzv71Xl.js +9 -0
  517. package/dist/twilight/{p-BqCmPfAo.js → p-bScl0xMh.js} +2 -2
  518. package/dist/twilight/{p-344c1910.entry.js → p-bff4c7b3.entry.js} +1 -1
  519. package/dist/twilight/{p-1b1f9f71.entry.js → p-c091e2dc.entry.js} +1 -1
  520. package/dist/twilight/{p-775b42ec.entry.js → p-c1fd45b1.entry.js} +1 -1
  521. package/dist/twilight/{p-1c215c8c.entry.js → p-c3ffb88a.entry.js} +1 -1
  522. package/dist/twilight/{p-9deae4f4.entry.js → p-c87951a2.entry.js} +1 -1
  523. package/dist/twilight/{p-1899f283.entry.js → p-ccfe5308.entry.js} +1 -1
  524. package/dist/twilight/{p-98eb495e.entry.js → p-d337c399.entry.js} +1 -1
  525. package/dist/twilight/{p-7b717899.entry.js → p-d371d450.entry.js} +1 -1
  526. package/dist/twilight/{p-f8b6967f.entry.js → p-d4a242f8.entry.js} +1 -1
  527. package/dist/twilight/{p-194d87c6.entry.js → p-d9f5a8cd.entry.js} +1 -1
  528. package/dist/twilight/{p-ff9b33bb.entry.js → p-dd2bd5dc.entry.js} +1 -1
  529. package/dist/twilight/{p-e89812d8.entry.js → p-df6853b5.entry.js} +1 -1
  530. package/dist/twilight/{p-05663bb1.entry.js → p-e28c0773.entry.js} +1 -1
  531. package/dist/twilight/{p-a76b3dba.entry.js → p-e3b8e0e1.entry.js} +1 -1
  532. package/dist/twilight/p-e679884a.entry.js +4 -0
  533. package/dist/twilight/{p-11767786.entry.js → p-e6bbf50d.entry.js} +1 -1
  534. package/dist/twilight/{p-1ca75c99.entry.js → p-e94f217b.entry.js} +1 -1
  535. package/dist/twilight/{p-d81ad2c3.entry.js → p-eac718cd.entry.js} +1 -1
  536. package/dist/twilight/{p-85ceef78.entry.js → p-ede67a08.entry.js} +1 -1
  537. package/dist/twilight/p-efab88c5.entry.js +4 -0
  538. package/dist/twilight/{p-1dbaefb8.entry.js → p-f176d41d.entry.js} +1 -1
  539. package/dist/twilight/p-f5d15e71.entry.js +4 -0
  540. package/dist/twilight/{p-50621375.entry.js → p-f7999a6d.entry.js} +1 -1
  541. package/dist/twilight/twilight.esm.js +1 -1
  542. package/dist/types/components/salla-count-down/salla-count-down.d.ts +6 -0
  543. package/dist/types/components/salla-notifications/interfaces.d.ts +20 -0
  544. package/dist/types/components/salla-notifications/salla-notifications.d.ts +17 -0
  545. package/dist/types/components.d.ts +763 -177
  546. package/dist/types/stencil-public-runtime.d.ts +169 -11
  547. package/package.json +5 -5
  548. package/dist/cjs/filepond-plugin-file-validate-type-Dfy66STE.js +0 -287
  549. package/dist/esm/filepond-plugin-file-validate-type-BYs_scJr.js +0 -285
  550. package/dist/twilight/p-0652987b.entry.js +0 -4
  551. package/dist/twilight/p-14529fd6.entry.js +0 -4
  552. package/dist/twilight/p-1c8394db.entry.js +0 -4
  553. package/dist/twilight/p-346b55d6.entry.js +0 -4
  554. package/dist/twilight/p-3962c34c.entry.js +0 -4
  555. package/dist/twilight/p-4e9e3ab1.entry.js +0 -4
  556. package/dist/twilight/p-549f59ed.entry.js +0 -4
  557. package/dist/twilight/p-54f65187.entry.js +0 -4
  558. package/dist/twilight/p-726513f8.entry.js +0 -4
  559. package/dist/twilight/p-753464fd.entry.js +0 -4
  560. package/dist/twilight/p-AfW2b46_.js +0 -9
  561. package/dist/twilight/p-C23tPnnH.js +0 -5
  562. package/dist/twilight/p-CrYUKEsF.js +0 -9
  563. package/dist/twilight/p-HWjjIZ9_.js +0 -9
  564. package/dist/twilight/p-Ig1Tafsp.js +0 -9
  565. package/dist/twilight/p-c9001d7f.entry.js +0 -4
  566. package/dist/twilight/p-cf9573fd.entry.js +0 -4
  567. package/dist/twilight/p-e6124fab.entry.js +0 -4
  568. package/dist/twilight/p-eb5a8329.entry.js +0 -4
@@ -1,735 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
5
- import { a as anime } from './anime.es.js';
6
- import { I as IconArrowLeft } from './arrow-left.js';
7
- import { C as Cancel } from './cancel.js';
8
- import { d as defineCustomElement$b } from './salla-button2.js';
9
- import { d as defineCustomElement$a } from './salla-datetime-picker2.js';
10
- import { d as defineCustomElement$9 } from './salla-file-upload2.js';
11
- import { d as defineCustomElement$8 } from './salla-list-tile2.js';
12
- import { d as defineCustomElement$7 } from './salla-loading2.js';
13
- import { d as defineCustomElement$6 } from './salla-modal2.js';
14
- import { d as defineCustomElement$5 } from './salla-placeholder2.js';
15
- import { d as defineCustomElement$4 } from './salla-skeleton2.js';
16
- import { d as defineCustomElement$3 } from './salla-slider2.js';
17
- import { d as defineCustomElement$2 } from './salla-tel-input2.js';
18
-
19
- var Images = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20
- <title>images</title>
21
- <path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>
22
- </svg>
23
- `;
24
-
25
- var GiftSharing = `<!-- Generated by IcoMoon.io -->
26
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
27
- <title>gift-sharing</title>
28
- <path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>
29
- </svg>
30
- `;
31
-
32
- var Alert = `<!-- Generated by IcoMoon.io -->
33
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
34
- <title>alert</title>
35
- <path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>
36
- </svg>
37
- `;
38
-
39
- const sallaGiftingCss = ".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}";
40
-
41
- const SallaGifting$1 = /*@__PURE__*/ proxyCustomElement(class SallaGifting extends HTMLElement {
42
- constructor() {
43
- super();
44
- this.__registerHost();
45
- this.defaultEvent = "gifting:open";
46
- this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_or_upload');
47
- this.currentStep = 1;
48
- this.showCalendar = false;
49
- this.showGiftText = false;
50
- this.currentLang = '';
51
- this.parentClass = "is-current-step-1";
52
- this.errors = {};
53
- this.gift = undefined;
54
- this.selectedGiftTextOption = undefined;
55
- this.selectedCountryId = undefined;
56
- this.selectedCountryCode = undefined;
57
- this.loadingCities = false;
58
- this.loadingRegions = false;
59
- this.regions = [];
60
- this.selectedRegionId = undefined;
61
- this.isKSA = false;
62
- this.step2Animated = false;
63
- this.showTextArea = false;
64
- /// Gift Form Data
65
- this.selectedImage = undefined;
66
- this.uploadedImage = undefined;
67
- this.selectedText = undefined;
68
- this.hasError = false;
69
- this.timeZone = null;
70
- this.receiverCountryCode = salla.config.get('store.scope.countries')?.[0] || salla.config.get('store.store_country') || 'SA';
71
- this.hostId = `salla-gifting-${Math.random().toString(36).slice(2, 10)}`;
72
- /**
73
- * The form selector to be used to get the form data
74
- */
75
- this.formSelector = 'form.product-form, form.form--product-options';
76
- salla.lang.onLoaded(() => {
77
- this.selectImageOrUpload = salla.lang.get('blocks.buy_as_gift.select_image_or_upload');
78
- this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_for_your_gift');
79
- this.sectionTitle = salla.lang.get('blocks.buy_as_gift.gift_the_one_you_love');
80
- this.sectionSubtitle = salla.lang.get('blocks.buy_as_gift.gift_the_one_you_love_message');
81
- this.sectionBtnText = salla.lang.get('blocks.buy_as_gift.send_as_a_gift');
82
- this.giftDetails = salla.lang.get('blocks.buy_as_gift.gift_details');
83
- this.selectGiftMessage = salla.lang.get('blocks.buy_as_gift.select_gift_message');
84
- this.giftCustomText = salla.lang.get('blocks.buy_as_gift.gift_custom_text');
85
- this.textId = salla.lang.get('blocks.buy_as_gift.text_id');
86
- this.incorrectGiftText = salla.lang.get('blocks.buy_as_gift.incorrect_gift_text');
87
- this.nextStep = salla.lang.get('blocks.buy_as_gift.next_step');
88
- this.senderNameLabel = salla.lang.get('blocks.buy_as_gift.sender_name');
89
- this.receiverNameFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_name');
90
- this.receiverMobileFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_mobile');
91
- this.receiverCountryFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_country');
92
- this.ksa = salla.lang.get('pages.checkout.ksa');
93
- this.selectCity = salla.lang.get('pages.checkout.select_city');
94
- this.selectCountry = salla.lang.get('pages.checkout.select_country');
95
- this.selectCityInfo = salla.lang.get('blocks.buy_as_gift.city_info');
96
- this.receiverCityFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_city');
97
- this.receiverRegionFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_region') || salla.lang.get('pages.checkout.region');
98
- this.selectRegion = salla.lang.get('pages.checkout.select_region');
99
- this.receiverEmailFieldLabel = salla.lang.get('blocks.buy_as_gift.receiver_email');
100
- this.emailPlaceholder = salla.lang.get('common.elements.email_placeholder');
101
- this.sendLater = salla.lang.get('blocks.buy_as_gift.send_later');
102
- this.selectSendDateAndTime = salla.lang.get('blocks.buy_as_gift.select_send_date_and_time');
103
- this.canNotEditOrderAfterSelectDate = salla.lang.get('blocks.buy_as_gift.can_not_edit_order_after_select_date');
104
- this.sendGift = salla.lang.get('blocks.buy_as_gift.send_gift');
105
- this.donationRequired = salla.lang.get('pages.products.donation_amount_required');
106
- this.currentLang = salla.lang.locale;
107
- });
108
- salla.event.on(this.defaultEvent, () => {
109
- this.open();
110
- });
111
- }
112
- componentDidLoad() {
113
- salla.event.product.onPriceUpdated(() => {
114
- const quantityInput = document.querySelector(`.s-quantity-input-input`);
115
- // @ts-ignore
116
- this.quantity = quantityInput?.value;
117
- });
118
- }
119
- getFormDataFromForm() {
120
- if (!this.formSelector)
121
- return null;
122
- const form = document.querySelector(this.formSelector);
123
- if (!form)
124
- return null;
125
- return new FormData(form);
126
- }
127
- mergeObjectToFormData(obj, formData, namespace) {
128
- for (let property in obj) {
129
- if (!obj.hasOwnProperty(property) || obj[property] === undefined || obj[property] === null)
130
- continue;
131
- const formKey = namespace ? `${namespace}[${property}]` : property;
132
- if (typeof obj[property] === 'object' && obj[property] !== null && !(obj[property] instanceof File)) {
133
- this.mergeObjectToFormData(obj[property], formData, formKey);
134
- }
135
- else {
136
- formData.set(formKey, obj[property]);
137
- }
138
- }
139
- return formData;
140
- }
141
- /**
142
- * Show / Open the gifting modal window
143
- */
144
- async open() {
145
- if (salla.config.isGuest()) {
146
- salla.api.auth.setAfterLoginEvent(this.defaultEvent);
147
- salla.event.dispatch('login::open', { withoutReload: true });
148
- return;
149
- }
150
- await this.modal.open();
151
- // Determine the appropriate method to call based on the `physicalProducts` flag
152
- const giftDetailsMethod = this.productId ? () => salla.product.getGiftProductDetails(this.productId) : () => salla.cart.getGiftCartDetails();
153
- return await salla.api.withoutNotifier(giftDetailsMethod)
154
- .then((response) => {
155
- this.gift = response.data;
156
- this.senderName = this.gift.sender_name;
157
- })
158
- .catch(e => {
159
- this.hasError = true;
160
- this.errorMessage = e.response?.data?.error?.message || e.response?.data;
161
- })
162
- .finally(() => this.modal.stopLoading());
163
- }
164
- /**
165
- *
166
- * Hide / close the gifting modal window
167
- */
168
- async close() {
169
- return this.modal.close();
170
- }
171
- /**
172
- * Update the modal height based on the changes on the inner elements height for a specific step OR just a pass a new fixed height
173
- */
174
- async setWrapperHeight(asStep = 1, delay = 250, additionSpace = 0, newHeight = 0) {
175
- let currentStep = document.querySelector(`#${this.hostId} .gift-step-${asStep}`);
176
- const updateHeight = () => {
177
- let currentStepHeight = currentStep.offsetHeight;
178
- if (newHeight) {
179
- this.stepsWrapper.style.height = `${newHeight}px`;
180
- }
181
- else {
182
- this.stepsWrapper.style.height = currentStepHeight + additionSpace + 'px';
183
- }
184
- };
185
- if (this.step2Animated && asStep === 2) {
186
- requestAnimationFrame(updateHeight);
187
- }
188
- else {
189
- setTimeout(updateHeight, delay);
190
- }
191
- }
192
- toggleCalendar() {
193
- this.showCalendar = !this.showCalendar;
194
- this.setWrapperHeight(2, 150, 0);
195
- }
196
- toggleGiftText(event) {
197
- this.textSelect?.classList.remove('s-form-has-error');
198
- let dataID = event.target.children[event.target.selectedIndex].getAttribute('data-id');
199
- let customID = dataID == "custom";
200
- this.showGiftText = customID;
201
- if (dataID) {
202
- this.selectedGiftTextOption = dataID;
203
- customID ? this.selectedText = undefined : this.selectedText = event.target.value;
204
- this.setWrapperHeight(1, 150, 5);
205
- }
206
- else {
207
- // empty textarea value
208
- this.textArea.value = '';
209
- this.selectedText = undefined;
210
- this.selectedGiftTextOption = undefined;
211
- this.setWrapperHeight(1, 150, -15);
212
- }
213
- }
214
- /**
215
- *
216
- * Go to the step 2
217
- */
218
- async goToStep2() {
219
- if (!this.selectedGiftTextOption) {
220
- this.textSelect.classList.add('s-form-has-error');
221
- this.customTextArea.classList.remove('s-form-has-error');
222
- return;
223
- }
224
- else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
225
- this.textSelect.classList.remove('s-form-has-error');
226
- this.customTextArea.classList.add('s-form-has-error');
227
- return;
228
- }
229
- else {
230
- this.textSelect.classList.remove('s-form-has-error');
231
- this.customTextArea.classList.remove('s-form-has-error');
232
- }
233
- this.setWrapperHeight(2, 600, 0);
234
- let stepNextAnime = new anime.timeline();
235
- stepNextAnime.add({
236
- targets: this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),
237
- opacity: [1, 0],
238
- translateX: [0, 50],
239
- delay: anime.stagger(70),
240
- // easing: 'easeOutExpo',
241
- duration: 1200,
242
- })
243
- .add({
244
- targets: '.gift-step-2',
245
- translateX: ['-110%', 0],
246
- opacity: [0, 1],
247
- }, '-=1800')
248
- .add({
249
- targets: this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),
250
- opacity: [0, 1],
251
- translateX: [-50, 0],
252
- delay: anime.stagger(70),
253
- duration: 1200,
254
- complete: () => {
255
- this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach(item => {
256
- item.classList.remove('opacity-0');
257
- item.removeAttribute('style');
258
- });
259
- this.step2Animated = true;
260
- }
261
- }, '-=1200');
262
- this.currentStep = 2;
263
- this.parentClass = `is-current-step-${this.currentStep}`;
264
- }
265
- /**
266
- *
267
- * Go to the step 1
268
- */
269
- goToStep1(e) {
270
- e.preventDefault();
271
- let stepBackAnime = new anime.timeline({
272
- autoplay: false,
273
- });
274
- stepBackAnime.add({
275
- targets: this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),
276
- opacity: [1, 0],
277
- translateX: [0, -50],
278
- delay: anime.stagger(70),
279
- // easing: 'easeOutExpo',
280
- duration: 1200,
281
- })
282
- .add({
283
- targets: '.gift-step-1',
284
- translateX: ['110%', 0],
285
- opacity: [0, 1],
286
- }, '-=1800')
287
- .add({
288
- targets: this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),
289
- opacity: [0, 1],
290
- translateX: [50, 0],
291
- delay: anime.stagger(70),
292
- duration: 1200,
293
- complete: () => {
294
- this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach(item => {
295
- item.classList.remove('opacity-0');
296
- item.removeAttribute('style');
297
- });
298
- }
299
- }, '-=1200');
300
- stepBackAnime.play();
301
- this.step2Animated = false;
302
- this.setWrapperHeight(1, 600, 0);
303
- this.currentStep = 1;
304
- this.parentClass = `is-current-step-${this.currentStep}`;
305
- }
306
- getFilepondPlaceholder() {
307
- return `<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon">${Images}</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload ? this.selectImageOrUpload : ''}</p></div>`;
308
- }
309
- setPreview(image) {
310
- this.uploader?.classList.add('has-bg');
311
- var bg = document.querySelector(`#${this.hostId}.filepond-bg`) ? document.querySelector(`#${this.hostId} .filepond-bg`) : document.createElement('div');
312
- bg.classList.add('filepond-bg');
313
- bg.classList.remove('s-hidden');
314
- bg.style.backgroundImage = "url('" + image.url + "')";
315
- this.uploader?.querySelector('.filepond--root')?.appendChild(bg);
316
- this.uploadedImage = image.url;
317
- if (!!this.gift && this.gift.gift_images.length) {
318
- this.setWrapperHeight(1, 150, 0);
319
- }
320
- }
321
- removePreview() {
322
- this.uploader.classList.remove('has-bg');
323
- let bg = document.querySelector(`#${this.hostId} .filepond-bg`);
324
- bg.removeAttribute('style');
325
- bg.classList.add('s-hidden');
326
- this.handleRemoveImage();
327
- }
328
- handleTextAreaChange(event) {
329
- this.selectedText = event.target.value;
330
- this.customTextArea.classList.remove('s-form-has-error');
331
- }
332
- clearError(key) {
333
- if (this.errors?.[key]) {
334
- const { [key]: _, ...rest } = this.errors;
335
- this.errors = rest;
336
- }
337
- }
338
- handleSenderName(event) {
339
- this.senderName = event.target.value;
340
- this.clearError('sender_name');
341
- }
342
- handleReceiverName(event) {
343
- this.receiverName = event.target.value;
344
- this.clearError('receiver.name');
345
- }
346
- handleReceiverCity(event) {
347
- this.receiverCity = event.target.value;
348
- this.clearError('receiver.city_id');
349
- }
350
- async handleCountryChange(event) {
351
- const countryId = Number(event.target.value);
352
- this.selectedCountryId = countryId;
353
- this.clearError('receiver.country');
354
- // Find the selected country and store its country_code
355
- const selectedCountry = this.gift?.countries?.find(country => country.id == countryId);
356
- this.selectedCountryCode = selectedCountry?.country_code;
357
- this.isKSA = selectedCountry?.country_code === 'SA';
358
- // Reset region and city
359
- this.regions = [];
360
- this.selectedRegionId = undefined;
361
- this.gift = { ...this.gift, cities: [] };
362
- this.receiverCity = undefined;
363
- if (!countryId || this.gift?.countries?.length === 0) {
364
- this.selectedCountryCode = undefined;
365
- this.isKSA = false;
366
- this.setWrapperHeight(2, 0, 0);
367
- return;
368
- }
369
- if (this.isKSA) {
370
- // For KSA, fetch regions first
371
- this.loadingRegions = true;
372
- this.setWrapperHeight(2, 0, 0);
373
- try {
374
- const response = await salla.api.request(`shipping/countries/${countryId}/regions`);
375
- if (response && response.data) {
376
- this.regions = response.data;
377
- }
378
- }
379
- catch (error) {
380
- console.error('Error fetching regions:', error);
381
- }
382
- finally {
383
- this.loadingRegions = false;
384
- this.setWrapperHeight(2, 0, 0);
385
- }
386
- }
387
- else {
388
- // For non-KSA, fetch cities directly
389
- this.loadingCities = true;
390
- this.setWrapperHeight(2, 0, 0);
391
- try {
392
- const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${countryId}`);
393
- if (response && response.data) {
394
- this.gift = { ...this.gift, cities: response.data };
395
- }
396
- }
397
- catch (error) {
398
- console.error('Error fetching cities:', error);
399
- }
400
- finally {
401
- this.loadingCities = false;
402
- }
403
- }
404
- }
405
- async handleRegionChange(event) {
406
- const regionId = Number(event.target.value);
407
- this.selectedRegionId = regionId;
408
- this.clearError('receiver.region');
409
- // Reset city when region changes
410
- this.gift = { ...this.gift, cities: [] };
411
- this.receiverCity = undefined;
412
- if (!regionId)
413
- return;
414
- this.loadingCities = true;
415
- try {
416
- const response = await salla.api.request(`shipping/cities?for_branch=0&country_id=${this.selectedCountryId}&region_id=${regionId}`);
417
- if (response && response.data) {
418
- this.gift = { ...this.gift, cities: response.data };
419
- }
420
- }
421
- catch (error) {
422
- console.error('Error fetching cities:', error);
423
- }
424
- finally {
425
- this.loadingCities = false;
426
- this.setWrapperHeight(2, 0, 0);
427
- }
428
- }
429
- handleUploadImage(img) {
430
- this.uploadedImage = img;
431
- if (!!this.gift && this.gift.gift_images.length) {
432
- this.setWrapperHeight(1, 150, 0);
433
- }
434
- }
435
- handleRemoveImage() {
436
- this.uploadedImage = '';
437
- if (!!this.gift && this.gift.gift_images.length) {
438
- this.setWrapperHeight(1, 150, 0);
439
- }
440
- }
441
- // private handleReceiverEmail(event) {
442
- // this.receiverEmail = event.target.value;
443
- // }
444
- handlePhoneInputChange(event) {
445
- let phone = event.detail;
446
- this.receiverMobile = phone.number;
447
- this.receiverCountryCode = phone.country_code;
448
- this.clearError('receiver.mobile');
449
- }
450
- handleDateTimePicker(event) {
451
- this.deliveryDate = event.detail;
452
- }
453
- getCalendarClasses() {
454
- return {
455
- "s-form-group": true,
456
- "anime-item": true,
457
- "s-gifting-calendar": true,
458
- "shown": this.showCalendar,
459
- "hide": !this.showCalendar,
460
- "s-form-has-error": !!this.errors && this.errors['deliver_at']
461
- };
462
- }
463
- async submitForm() {
464
- // @ts-ignore
465
- const donatingAmount = (document.querySelector(`#donating-amount`))?.value;
466
- this.calendarFormGroup.classList.remove('s-form-has-error');
467
- if (!!this.errors) {
468
- this.errors = {};
469
- this.setWrapperHeight(2, 150, 0);
470
- }
471
- if (this.showCalendar && !this.deliveryDate) {
472
- this.calendarFormGroup.classList.add('s-form-has-error');
473
- return;
474
- }
475
- // Validate required fields
476
- const requiredFields = [
477
- { key: 'sender_name', value: this.senderName, label: this.senderNameLabel },
478
- { key: 'receiver.name', value: this.receiverName, label: this.receiverNameFieldLabel },
479
- { key: 'receiver.mobile', value: this.receiverMobile, label: this.receiverMobileFieldLabel },
480
- ...(this.physicalProducts ? [
481
- { key: 'receiver.country', value: this.selectedCountryId, label: this.receiverCountryFieldLabel },
482
- ...(this.isKSA ? [{ key: 'receiver.region', value: this.selectedRegionId, label: this.receiverRegionFieldLabel }] : []),
483
- { key: 'receiver.city_id', value: this.receiverCity, label: this.receiverCityFieldLabel },
484
- ] : []),
485
- ];
486
- const validationErrors = {};
487
- requiredFields.forEach(({ key, value, label }) => {
488
- if (!value) {
489
- validationErrors[key] = salla.lang.get('common.errors.field_required', { attribute: label });
490
- }
491
- });
492
- if (Object.keys(validationErrors).length) {
493
- this.errors = validationErrors;
494
- this.setWrapperHeight(2, 150, 0);
495
- return;
496
- }
497
- const giftPayload = {
498
- text: this.selectedText,
499
- sender_name: this.senderName,
500
- quantity: this.quantity,
501
- deliver_at: this.showCalendar ? this.deliveryDate : null,
502
- image_url: this.uploadedImage ?? this.selectedImage,
503
- donation_amount: donatingAmount ? donatingAmount : null,
504
- receiver: {
505
- name: this.receiverName,
506
- mobile_country_code: this.receiverCountryCode,
507
- mobile: this.receiverMobile,
508
- ...(this.physicalProducts && this.selectedCountryCode ? { country_code: this.selectedCountryCode } : {}),
509
- ...(this.physicalProducts && this.selectedRegionId ? { region_id: this.selectedRegionId } : {}),
510
- ...(this.receiverCity && this.physicalProducts ? { city_id: this.receiverCity } : {})
511
- },
512
- has_apple_pay: salla.helpers.hasApplePay(),
513
- };
514
- let formData;
515
- if (this.productId && this.formSelector) {
516
- formData = this.getFormDataFromForm() || new FormData();
517
- formData = this.mergeObjectToFormData(giftPayload, formData);
518
- }
519
- const addGiftMethod = this.productId
520
- ? () => salla.product.addProductGiftToCart(this.productId, formData, true)
521
- : () => salla.cart.addCartGiftToCart(giftPayload, true);
522
- return await addGiftMethod()
523
- .then(() => this.modal.close())
524
- .catch((e) => {
525
- if (e.response && e.response.status == 422) {
526
- this.errors = e.response.data.error.fields;
527
- }
528
- else {
529
- console.log(e);
530
- }
531
- this.setWrapperHeight(2, 150, 0);
532
- });
533
- }
534
- step2ItemClass(extra = '') {
535
- const base = `anime-item${this.step2Animated ? '' : ' opacity-0'}`;
536
- return extra ? `${extra} ${base}` : base;
537
- }
538
- generateClass() {
539
- return {
540
- "s-gifting-widget": true,
541
- "s-gifting-widget-vertical": !!this.vertical,
542
- "s-gifting-widget-horizontal": !this.vertical
543
- };
544
- }
545
- async handleGiftButtonClick() {
546
- if (!!this.productId && this.formSelector) {
547
- const form = document.querySelector(this.formSelector);
548
- if (!form) {
549
- console.error('SallaGifting:: Form not found in the document!');
550
- return;
551
- }
552
- if (!(form instanceof HTMLFormElement)) {
553
- console.error('SallaGifting:: The specified selector does not correspond to a form tag!');
554
- return;
555
- }
556
- if (!form.reportValidity()) {
557
- console.error('SallaGifting:: Form is not valid!');
558
- salla.error(salla.lang.get('common.messages.required_fields'));
559
- return;
560
- }
561
- }
562
- const optionsElement = document.querySelector(`salla-product-options[product-id="${this.productId}"]`);
563
- if (optionsElement && !(await optionsElement.reportValidity())) {
564
- salla.error(salla.lang.get('common.messages.required_fields'));
565
- return;
566
- }
567
- this.open();
568
- }
569
- render() {
570
- return [
571
- h("div", { key: '5d0eec8210f77d166c144704ec78bffcaf1f4ce0' }, h("salla-list-tile", { key: '19cc20b4f70bbb8a7d267f60052db77589901962', class: this.generateClass() }, h("div", { key: '1c3c52b5ac48e71a6ac26c60494657ac28d16457', slot: "title" }, this.vertical ? h("span", { innerHTML: GiftSharing }) : '', h("h3", { key: 'e3379fb3ed39d1bc63500346058b26b883c3be13' }, !!this.widgetTitle ? this.widgetTitle : this.sectionTitle)), h("div", { key: 'f6c2a522727546aa27cef725faa8be082da063da', slot: "subtitle" }, h("div", { key: '7b58ad967f39fa2cc660369b72e73f8dc49f90dc' }, !!this.widgetSubtitle ? this.widgetSubtitle : this.sectionSubtitle)), h("div", { key: '848396dcd6ce6009ebc4cf1a209a055ad1adbf15', slot: "action" }, h("salla-button", { key: '2ba69b670f1c958784c6f1dca6b2dd0b93f20859', color: "primary", fill: "outline", width: "wide", class: "s-gifting-widget-action", onClick: () => this.handleGiftButtonClick() }, h("slot", { key: '6ac9ac339e321fc9433465cfd75f299307ee7152', name: "widget-btn-content" }, h("div", { key: 'c61dd36375886c1ecf87f115e5248dca1af7efc9', class: "s-gifting-widget-action-content" }, h("span", { key: '0c8a3630ba6b15889fc4bf3d55a1279cdf713400', innerHTML: GiftSharing }), " \u00A0", h("span", { key: 'c9299ec752e5393f30a78e1e01d367be9e97ca50' }, this.sectionBtnText)))))), h("salla-modal", { key: '9ee17e79f97eee59d25d9627d5b1cd4ada7cadb3', id: this.hostId, isLoading: true, class: "s-gifting-modal", width: "sm", ref: modal => this.modal = modal }, h("div", { key: 'aba3b6a4d3e903934c9b5e629119c3a3b5bc90ab', slot: "loading" }, h("div", { key: 'e03613cc85bf4024f63d2e256a2744ec78f7eabf', class: "s-gifting-skeleton" }, h("div", { key: '01156691d540ce5ef5723902610a1da27fba3ddb', class: "s-gifting-modal-header" }, h("salla-skeleton", { key: 'e45b4868e4fa5633aeb22f758f75f5412290b179', type: 'circle', height: '5rem', width: '5rem' }), h("h2", { key: '2b427d38dd6e0569e16de84ef46eb2052d23b739', class: "s-gifting-modal-title" }, h("div", { key: 'c4f9cb6f513e3ebd2e6ad209648a1f70bcafbcb5', class: "s-gifting-modal-badge-wrapper" }, h("salla-skeleton", { key: 'e684b682a4cca89262128cca13604b7aa9a83cd7', height: '15px', width: '150px' })))), h("div", { key: '2941865d68cd216b4dd82bb8279f6bcbaa062bf3', class: "s-gifting-skeleton-content" }, h("salla-skeleton", { key: '7c4f4235a666930ceef3dc0b38809aea5ee5ce5c', height: '10px', width: '150px' }), h("salla-skeleton", { key: '0257f401762a11b0bf3da7db603b4e5f57bd1aae', height: '230px' }), h("salla-skeleton", { key: 'cced26b189549fcee4eff3a3fbd943a5735b4c6c', height: '10px', width: '150px' }), h("salla-skeleton", { key: 'f5893e5c631564c91bfe42c4102190d43f913947', height: '30px' }), h("salla-skeleton", { key: '64d3738017cf6732b429848c1de4ca16db1adc06', height: '40px' })))), h("slot", { key: '77d5bda8147f7f09d73b97fd7456121626b465a7', name: "header" }), !!this.hasError ?
572
- h("salla-placeholder", { alignment: "center" }, h("span", { slot: "title" }, this.errorMessage || salla.lang.get('common.errors.empty_results')), h("span", { slot: "description" }, " "))
573
- :
574
- [
575
- h("div", { class: "s-gifting-modal-header" }, h("span", { class: "s-gifting-modal-icon" }, h("span", { innerHTML: GiftSharing })), h("h2", { class: "s-gifting-modal-title" }, h("div", { class: "s-gifting-modal-badge-wrapper" }, h("div", { class: "s-gifting-modal-badge" }, h("span", null, h("span", null, this.currentStep), "/2")), h("span", null, this.giftDetails)))),
576
- h("div", { class: "s-gifting-steps-wrapper " + this.parentClass, ref: el => this.stepsWrapper = el }, h("div", { class: "s-gifting-step-one gift-step-1", ref: el => this.step1Elems = el }, h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), h("div", { class: "s-gifting-modal-uploader anime-item", ref: el => this.uploader = el }, h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && h("salla-file-upload", { "instant-upload": true, name: "image_url", url: salla.url.api(salla.product.api.getUrl('giftImage')), onUploaded: event => this.handleUploadImage(event.detail), labelIdle: this.getFilepondPlaceholder(), onRemoved: () => this.handleRemoveImage() })), h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && !!this.gift.gift_images && this.gift.gift_images.length > 0 ?
577
- h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, h("div", { slot: "items" }, this.gift && this.gift.gift_images ?
578
- this.gift?.gift_images.map((item) => h("a", { class: "s-gifting-clickable s-gifting-image", onClick: () => this.setPreview(item) }, h("img", { style: { "width": "120px" }, src: item.url, alt: `${item.id}` }))) : ''))
579
- : ""), h("div", { class: "anime-item" }, h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, h("option", { "data-id": null, selected: true }, this.selectGiftMessage), this.gift && this.gift.gift_texts ?
580
- this.gift?.gift_texts.map((txt) => h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)) : '', h("option", { "data-id": "custom" }, this.giftCustomText))), h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), h("div", { class: "mt-1" }, h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), h("div", { class: "anime-item" }, h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, h("span", null, this.nextStep)))), h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, h("div", { class: this.step2ItemClass(this.errors?.['sender_name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ?
581
- h("span", { class: "s-gifting-error" }, this.errors['sender_name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.name'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ?
582
- h("span", { class: "s-gifting-error" }, this.errors['receiver.name']) : ''), h("div", { class: this.step2ItemClass(this.errors?.['receiver.mobile'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ?
583
- h("span", { class: "s-gifting-error" }, this.errors['receiver.mobile']) : ''), this.physicalProducts &&
584
- h("div", { class: this.step2ItemClass(this.errors?.['receiver.country'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCountryFieldLabel), h("select", { name: "country", class: "s-form-control", onChange: (event) => this.handleCountryChange(event), required: true }, h("option", { value: "" }, this.selectCountry), this.gift?.countries?.map((country) => (h("option", { value: country.id }, country.name)))), this.errors && this.errors['receiver.country'] ?
585
- h("span", { class: "s-gifting-error" }, this.errors['receiver.country']) : ''), this.physicalProducts && this.isKSA &&
586
- h("div", { class: this.step2ItemClass(this.errors?.['receiver.region'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverRegionFieldLabel), h("select", { name: "region", class: "s-form-control", onChange: (event) => this.handleRegionChange(event), disabled: this.loadingRegions }, h("option", { value: "", selected: true }, this.loadingRegions ? salla.lang.get('common.elements.loading') : this.selectRegion), this.regions?.map((region) => (h("option", { value: region.id }, region.name)))), this.errors && this.errors['receiver.region'] ?
587
- h("span", { class: "s-gifting-error" }, this.errors['receiver.region']) : ''), this.physicalProducts &&
588
- h("div", { class: this.step2ItemClass(this.errors?.['receiver.city_id'] ? 's-form-group s-form-has-error' : 's-form-group') }, h("label", { class: "s-form-label" }, this.receiverCityFieldLabel), h("select", { name: "city", "aria-label": salla.lang.get('blocks.buy_as_gift.select_city'), class: "s-form-control", onChange: (event) => this.handleReceiverCity(event), disabled: this.loadingCities || (this.isKSA && !this.selectedRegionId) }, h("option", { value: "", selected: true }, this.loadingCities ? salla.lang.get('common.elements.loading') : this.selectCity), this.gift?.cities?.map((city) => (h("option", { value: city.id }, city.name)))), this.errors && this.errors['receiver.city_id'] ?
589
- h("span", { class: "s-gifting-error" }, this.errors['receiver.city_id']) : ''), this.physicalProducts &&
590
- h("div", { class: this.step2ItemClass('s-gifting-info') }, h("span", { innerHTML: Alert }), h("span", null, this.selectCityInfo)), !this.physicalProducts && h("div", { class: this.step2ItemClass() }, h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: `schedule-${this.hostId}` }, h("input", { type: "checkbox", name: 'schedule', id: `schedule-${this.hostId}`, onChange: () => this.toggleCalendar(), class: "s-checkbox" }), h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, h("label", { class: "s-form-label" }, this.selectSendDateAndTime), h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), h("div", { class: this.step2ItemClass('s-gifting-step-two-footer') }, h("a", { href: "#!", innerHTML: IconArrowLeft, onClick: (e) => this.goToStep1(e) }), h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, h("span", null, this.sendGift)))))
591
- ], h("slot", { key: '46da7ff69a3c10b75886a23936f2f9ad8ad0e7bf', name: "footer" })))
592
- ];
593
- }
594
- static get style() { return sallaGiftingCss; }
595
- }, [4, "salla-gifting", {
596
- "productId": [2, "product-id"],
597
- "widgetTitle": [1, "widget-title"],
598
- "widgetSubtitle": [1, "widget-subtitle"],
599
- "physicalProducts": [4, "physical-products"],
600
- "vertical": [4],
601
- "formSelector": [1025, "form-selector"],
602
- "sectionTitle": [32],
603
- "sectionSubtitle": [32],
604
- "sectionBtnText": [32],
605
- "giftDetails": [32],
606
- "selectImageForYourGift": [32],
607
- "selectImageOrUpload": [32],
608
- "selectGiftMessage": [32],
609
- "giftCustomText": [32],
610
- "textId": [32],
611
- "incorrectGiftText": [32],
612
- "nextStep": [32],
613
- "senderNameLabel": [32],
614
- "receiverNameFieldLabel": [32],
615
- "receiverMobileFieldLabel": [32],
616
- "receiverCountryFieldLabel": [32],
617
- "ksa": [32],
618
- "selectCountry": [32],
619
- "selectCity": [32],
620
- "selectCityInfo": [32],
621
- "receiverCityFieldLabel": [32],
622
- "receiverRegionFieldLabel": [32],
623
- "selectRegion": [32],
624
- "receiverEmailFieldLabel": [32],
625
- "emailPlaceholder": [32],
626
- "sendLater": [32],
627
- "selectSendDateAndTime": [32],
628
- "canNotEditOrderAfterSelectDate": [32],
629
- "sendGift": [32],
630
- "donationRequired": [32],
631
- "currentStep": [32],
632
- "showCalendar": [32],
633
- "showGiftText": [32],
634
- "currentLang": [32],
635
- "parentClass": [32],
636
- "errors": [32],
637
- "gift": [32],
638
- "selectedGiftTextOption": [32],
639
- "selectedCountryId": [32],
640
- "selectedCountryCode": [32],
641
- "loadingCities": [32],
642
- "loadingRegions": [32],
643
- "regions": [32],
644
- "selectedRegionId": [32],
645
- "isKSA": [32],
646
- "parsedFormData": [32],
647
- "showTextArea": [32],
648
- "selectedImage": [32],
649
- "uploadedImage": [32],
650
- "selectedText": [32],
651
- "senderName": [32],
652
- "errorMessage": [32],
653
- "hasError": [32],
654
- "quantity": [32],
655
- "deliveryDate": [32],
656
- "timeZone": [32],
657
- "receiverName": [32],
658
- "receiverMobile": [32],
659
- "receiverCountryCode": [32],
660
- "receiverEmail": [32],
661
- "hostId": [32],
662
- "receiverCity": [32],
663
- "open": [64],
664
- "close": [64],
665
- "goToStep2": [64]
666
- }]);
667
- function defineCustomElement$1() {
668
- if (typeof customElements === "undefined") {
669
- return;
670
- }
671
- const components = ["salla-gifting", "salla-button", "salla-datetime-picker", "salla-file-upload", "salla-list-tile", "salla-loading", "salla-modal", "salla-placeholder", "salla-skeleton", "salla-slider", "salla-tel-input"];
672
- components.forEach(tagName => { switch (tagName) {
673
- case "salla-gifting":
674
- if (!customElements.get(tagName)) {
675
- customElements.define(tagName, SallaGifting$1);
676
- }
677
- break;
678
- case "salla-button":
679
- if (!customElements.get(tagName)) {
680
- defineCustomElement$b();
681
- }
682
- break;
683
- case "salla-datetime-picker":
684
- if (!customElements.get(tagName)) {
685
- defineCustomElement$a();
686
- }
687
- break;
688
- case "salla-file-upload":
689
- if (!customElements.get(tagName)) {
690
- defineCustomElement$9();
691
- }
692
- break;
693
- case "salla-list-tile":
694
- if (!customElements.get(tagName)) {
695
- defineCustomElement$8();
696
- }
697
- break;
698
- case "salla-loading":
699
- if (!customElements.get(tagName)) {
700
- defineCustomElement$7();
701
- }
702
- break;
703
- case "salla-modal":
704
- if (!customElements.get(tagName)) {
705
- defineCustomElement$6();
706
- }
707
- break;
708
- case "salla-placeholder":
709
- if (!customElements.get(tagName)) {
710
- defineCustomElement$5();
711
- }
712
- break;
713
- case "salla-skeleton":
714
- if (!customElements.get(tagName)) {
715
- defineCustomElement$4();
716
- }
717
- break;
718
- case "salla-slider":
719
- if (!customElements.get(tagName)) {
720
- defineCustomElement$3();
721
- }
722
- break;
723
- case "salla-tel-input":
724
- if (!customElements.get(tagName)) {
725
- defineCustomElement$2();
726
- }
727
- break;
728
- } });
729
- }
730
- defineCustomElement$1();
731
-
732
- const SallaGifting = SallaGifting$1;
733
- const defineCustomElement = defineCustomElement$1;
734
-
735
- export { SallaGifting, defineCustomElement };
4
+ import{transformTag as s,proxyCustomElement as t,HTMLElement as e,h as i}from"@stencil/core/internal/client";import{a}from"./anime.es.js";import{I as l}from"./arrow-left.js";import{C as o}from"./cancel.js";import{d as r}from"./salla-button2.js";import{d as c}from"./salla-datetime-picker2.js";import{d as n}from"./salla-file-upload2.js";import{d as h}from"./salla-list-tile2.js";import{d}from"./salla-loading2.js";import{d as g}from"./salla-modal2.js";import{d as f}from"./salla-placeholder2.js";import{d as m}from"./salla-skeleton2.js";import{d as u}from"./salla-slider2.js";import{d as p}from"./salla-tel-input2.js";var b='\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>gift-sharing</title>\n<path d="M5 32h-4c-0.552 0-1-0.448-1-1v0-14c0-0.552 0.448-1 1-1v0h4c0.552 0 1 0.448 1 1v0 14c0 0.552-0.448 1-1 1v0zM2 30h2v-12h-2zM19.32 30h-14.32v-2h14.32c0.693-0.005 1.329-0.242 1.837-0.637l-0.007 0.005 8.45-6.568c0.216-0.16 0.365-0.402 0.399-0.679l0-0.005c0.005-0.036 0.007-0.077 0.007-0.119 0-0.226-0.078-0.434-0.209-0.599l0.002 0.002c-0.16-0.216-0.401-0.364-0.677-0.399l-0.005-0.001c-0.034-0.004-0.073-0.007-0.113-0.007-0.227 0-0.436 0.078-0.601 0.208l0.002-0.002-7.126 5.526c-1.003 0.793-2.285 1.273-3.68 1.274h-6.6v-2h6.6c0.926-0.001 1.777-0.32 2.45-0.852l-0.008 0.006 7.126-5.526c0.492-0.39 1.122-0.625 1.807-0.625 0.135 0 0.268 0.009 0.398 0.027l-0.015-0.002c0.824 0.102 1.534 0.524 2.011 1.137l0.005 0.007c0.39 0.494 0.625 1.127 0.625 1.814 0 0.136-0.009 0.27-0.027 0.402l0.002-0.015c-0.106 0.819-0.529 1.523-1.141 1.995l-0.007 0.005-8.458 6.578c-0.834 0.649-1.894 1.043-3.047 1.050h-0.002zM11 26c-0.552 0-1-0.448-1-1s0.448-1 1-1v0c2.406-0.004 4.415-1.703 4.894-3.967l0.006-0.033h-10.9c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h12c0.552 0 1 0.448 1 1v0c0 3.866-3.134 7-7 7v0zM24 12h-16c-1.105 0-2-0.895-2-2v0-2c0-1.105 0.895-2 2-2v0h16c1.105 0 2 0.895 2 2v0 2c0 1.105-0.895 2-2 2v0zM24 10v0zM8 8v2h16v-2zM23 18c-0.552 0-1-0.448-1-1v0-6c0-0.552 0.448-1 1-1s1 0.448 1 1v0 6c0 0.552-0.448 1-1 1v0zM9 16c-0.552 0-1-0.448-1-1v0-4c0-0.552 0.448-1 1-1s1 0.448 1 1v0 4c0 0.552-0.448 1-1 1v0zM16 16c-0.552 0-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1s1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0zM16 8c-0.552-0-1-0.448-1-1 0-0.077 0.009-0.151 0.025-0.223l-0.001 0.007c0.314-1.849 0.963-3.5 1.887-4.961l-0.033 0.055c0.539-0.521 1.274-0.842 2.084-0.842 1.657 0 3 1.343 3 3 0 0.81-0.321 1.545-0.843 2.085l0.001-0.001c-1.405 0.891-3.056 1.541-4.824 1.845l-0.080 0.011c-0.065 0.015-0.139 0.024-0.216 0.024h-0zM19 3c-0.001 0-0.001 0-0.002 0-0.276 0-0.525 0.112-0.706 0.292l0-0c-0.391 0.669-0.703 1.444-0.897 2.264l-0.011 0.058c0.878-0.205 1.653-0.517 2.363-0.93l-0.041 0.022c0.18-0.181 0.292-0.43 0.292-0.706 0-0.551-0.446-0.999-0.998-1h-0zM16 8c-0.077-0-0.151-0.009-0.223-0.025l0.007 0.001c-1.848-0.315-3.499-0.965-4.959-1.888l0.055 0.032c-0.521-0.539-0.842-1.274-0.842-2.084 0-1.657 1.343-3 3-3 0.81 0 1.545 0.321 2.085 0.843l-0.001-0.001c0.891 1.405 1.541 3.056 1.845 4.824l0.011 0.080c0.015 0.066 0.024 0.141 0.024 0.218 0 0.552-0.448 1-1 1-0.001 0-0.001 0-0.002 0h0zM13 3c-0.001 0-0.001 0-0.002 0-0.552 0-1 0.448-1 1 0 0.277 0.112 0.527 0.294 0.708l0 0c0.669 0.391 1.444 0.703 2.264 0.897l0.058 0.011c-0.205-0.878-0.517-1.653-0.93-2.363l0.022 0.041c-0.181-0.181-0.43-0.293-0.706-0.294h-0z"></path>\n</svg>\n';const v=t(class extends e{constructor(s){super(),!1!==s&&this.__registerHost(),this.defaultEvent="gifting:open",this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.currentStep=1,this.showCalendar=!1,this.showGiftText=!1,this.currentLang="",this.parentClass="is-current-step-1",this.errors={},this.gift=void 0,this.selectedGiftTextOption=void 0,this.selectedCountryId=void 0,this.selectedCountryCode=void 0,this.loadingCities=!1,this.loadingRegions=!1,this.regions=[],this.selectedRegionId=void 0,this.isKSA=!1,this.step2Animated=!1,this.showTextArea=!1,this.selectedImage=void 0,this.uploadedImage=void 0,this.selectedText=void 0,this.hasError=!1,this.timeZone=null,this.receiverCountryCode=salla.config.get("store.scope.countries")?.[0]||salla.config.get("store.store_country")||"SA",this.hostId="salla-gifting-"+Math.random().toString(36).slice(2,10),this.formSelector="form.product-form, form.form--product-options",salla.lang.onLoaded((()=>{this.selectImageOrUpload=salla.lang.get("blocks.buy_as_gift.select_image_or_upload"),this.selectImageForYourGift=salla.lang.get("blocks.buy_as_gift.select_image_for_your_gift"),this.sectionTitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love"),this.sectionSubtitle=salla.lang.get("blocks.buy_as_gift.gift_the_one_you_love_message"),this.sectionBtnText=salla.lang.get("blocks.buy_as_gift.send_as_a_gift"),this.giftDetails=salla.lang.get("blocks.buy_as_gift.gift_details"),this.selectGiftMessage=salla.lang.get("blocks.buy_as_gift.select_gift_message"),this.giftCustomText=salla.lang.get("blocks.buy_as_gift.gift_custom_text"),this.textId=salla.lang.get("blocks.buy_as_gift.text_id"),this.incorrectGiftText=salla.lang.get("blocks.buy_as_gift.incorrect_gift_text"),this.nextStep=salla.lang.get("blocks.buy_as_gift.next_step"),this.senderNameLabel=salla.lang.get("blocks.buy_as_gift.sender_name"),this.receiverNameFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_name"),this.receiverMobileFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_mobile"),this.receiverCountryFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_country"),this.ksa=salla.lang.get("pages.checkout.ksa"),this.selectCity=salla.lang.get("pages.checkout.select_city"),this.selectCountry=salla.lang.get("pages.checkout.select_country"),this.selectCityInfo=salla.lang.get("blocks.buy_as_gift.city_info"),this.receiverCityFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_city"),this.receiverRegionFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_region")||salla.lang.get("pages.checkout.region"),this.selectRegion=salla.lang.get("pages.checkout.select_region"),this.receiverEmailFieldLabel=salla.lang.get("blocks.buy_as_gift.receiver_email"),this.emailPlaceholder=salla.lang.get("common.elements.email_placeholder"),this.sendLater=salla.lang.get("blocks.buy_as_gift.send_later"),this.selectSendDateAndTime=salla.lang.get("blocks.buy_as_gift.select_send_date_and_time"),this.canNotEditOrderAfterSelectDate=salla.lang.get("blocks.buy_as_gift.can_not_edit_order_after_select_date"),this.sendGift=salla.lang.get("blocks.buy_as_gift.send_gift"),this.donationRequired=salla.lang.get("pages.products.donation_amount_required"),this.currentLang=salla.lang.locale})),salla.event.on(this.defaultEvent,(()=>{this.open()}))}componentDidLoad(){salla.event.product.onPriceUpdated((()=>{const s=document.querySelector(".s-quantity-input-input");this.quantity=s?.value}))}getFormDataFromForm(){if(!this.formSelector)return null;const s=document.querySelector(this.formSelector);return s?new FormData(s):null}mergeObjectToFormData(s,t,e){for(let i in s){if(!s.hasOwnProperty(i)||null==s[i])continue;const a=e?`${e}[${i}]`:i;"object"!=typeof s[i]||null===s[i]||s[i]instanceof File?t.set(a,s[i]):this.mergeObjectToFormData(s[i],t,a)}return t}async open(){if(salla.config.isGuest())return salla.api.auth.setAfterLoginEvent(this.defaultEvent),void salla.event.dispatch("login::open",{withoutReload:!0});await this.modal.open();const s=this.productId?()=>salla.product.getGiftProductDetails(this.productId):()=>salla.cart.getGiftCartDetails();return await salla.api.withoutNotifier(s).then((s=>{this.gift=s.data,this.senderName=this.gift.sender_name})).catch((s=>{this.hasError=!0,this.errorMessage=s.response?.data?.error?.message||s.response?.data})).finally((()=>this.modal.stopLoading()))}async close(){return this.modal.close()}async setWrapperHeight(s=1,t=250,e=0,i=0){let a=document.querySelector(`#${this.hostId} .gift-step-${s}`);const l=()=>{this.stepsWrapper.style.height=i?i+"px":a.offsetHeight+e+"px"};this.step2Animated&&2===s?requestAnimationFrame(l):setTimeout(l,t)}toggleCalendar(){this.showCalendar=!this.showCalendar,this.setWrapperHeight(2,150,0)}toggleGiftText(s){this.textSelect?.classList.remove("s-form-has-error");let t=s.target.children[s.target.selectedIndex].getAttribute("data-id"),e="custom"==t;this.showGiftText=e,t?(this.selectedGiftTextOption=t,this.selectedText=e?void 0:s.target.value,this.setWrapperHeight(1,150,5)):(this.textArea.value="",this.selectedText=void 0,this.selectedGiftTextOption=void 0,this.setWrapperHeight(1,150,-15))}async goToStep2(){return this.selectedGiftTextOption?"custom"!=this.selectedGiftTextOption||this.selectedText?(this.textSelect.classList.remove("s-form-has-error"),this.customTextArea.classList.remove("s-form-has-error"),this.setWrapperHeight(2,600,0),(new a.timeline).add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,50],delay:a.stagger(70),duration:1200}).add({targets:".gift-step-2",translateX:["-110%",0],opacity:[0,1]},"-=1800").add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[-50,0],delay:a.stagger(70),duration:1200,complete:()=>{this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((s=>{s.classList.remove("opacity-0"),s.removeAttribute("style")})),this.step2Animated=!0}},"-=1200"),this.currentStep=2,void(this.parentClass="is-current-step-"+this.currentStep)):(this.textSelect.classList.remove("s-form-has-error"),void this.customTextArea.classList.add("s-form-has-error")):(this.textSelect.classList.add("s-form-has-error"),void this.customTextArea.classList.remove("s-form-has-error"))}goToStep1(s){s.preventDefault();let t=new a.timeline({autoplay:!1});t.add({targets:this.step2Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[1,0],translateX:[0,-50],delay:a.stagger(70),duration:1200}).add({targets:".gift-step-1",translateX:["110%",0],opacity:[0,1]},"-=1800").add({targets:this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`),opacity:[0,1],translateX:[50,0],delay:a.stagger(70),duration:1200,complete:()=>{this.step1Elems.querySelectorAll(`#${this.hostId} .anime-item`).forEach((s=>{s.classList.remove("opacity-0"),s.removeAttribute("style")}))}},"-=1200"),t.play(),this.step2Animated=!1,this.setWrapperHeight(1,600,0),this.currentStep=1,this.parentClass="is-current-step-"+this.currentStep}getFilepondPlaceholder(){return`<div class="s-gifting-filepond-placeholder"><span class="s-gifting-filepond-placeholder-icon"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>images</title>\n<path d="M22.667 29.333h-13.333c-3.676 0-6.667-2.991-6.667-6.667v-13.333c0-0.737-0.597-1.333-1.333-1.333s-1.333 0.596-1.333 1.333v13.333c0 5.145 4.187 9.333 9.333 9.333h13.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333zM22.667 5.333c-2.205 0-4 1.795-4 4s1.795 4 4 4 4-1.795 4-4-1.795-4-4-4zM22.667 10.667c-0.735 0-1.333-0.597-1.333-1.333s0.599-1.333 1.333-1.333 1.333 0.597 1.333 1.333-0.599 1.333-1.333 1.333zM25.333 0h-13.333c-3.676 0-6.667 2.991-6.667 6.667v13.333c0 1.055 0.268 2.040 0.707 2.927 0.039 0.099 0.088 0.188 0.151 0.277 1.137 2.053 3.301 3.463 5.809 3.463h13.333c3.676 0 6.667-2.991 6.667-6.667v-13.333c0-3.676-2.991-6.667-6.667-6.667zM12 24c-1.244 0-2.344-0.583-3.077-1.476l5.721-7.047 6.629 8.523zM29.333 20c0 2.205-1.795 4-4 4h-0.68l-8.933-11.485c-0.251-0.32-0.633-0.511-1.039-0.515h-0.015c-0.401 0-0.781 0.181-1.035 0.492l-5.632 6.935v-12.76c0-2.205 1.795-4 4-4h13.333c2.205 0 4 1.795 4 4z"></path>\n</svg>\n</span><p class="s-gifting-filepond-placeholder-text">${this.selectImageOrUpload?this.selectImageOrUpload:""}</p></div>`}setPreview(s){this.uploader?.classList.add("has-bg");var t=document.querySelector(`#${this.hostId}.filepond-bg`)?document.querySelector(`#${this.hostId} .filepond-bg`):document.createElement("div");t.classList.add("filepond-bg"),t.classList.remove("s-hidden"),t.style.backgroundImage="url('"+s.url+"')",this.uploader?.querySelector(".filepond--root")?.appendChild(t),this.uploadedImage=s.url,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}removePreview(){this.uploader.classList.remove("has-bg");let s=document.querySelector(`#${this.hostId} .filepond-bg`);s.removeAttribute("style"),s.classList.add("s-hidden"),this.handleRemoveImage()}handleTextAreaChange(s){this.selectedText=s.target.value,this.customTextArea.classList.remove("s-form-has-error")}clearError(s){if(this.errors?.[s]){const{[s]:t,...e}=this.errors;this.errors=e}}handleSenderName(s){this.senderName=s.target.value,this.clearError("sender_name")}handleReceiverName(s){this.receiverName=s.target.value,this.clearError("receiver.name")}handleReceiverCity(s){this.receiverCity=s.target.value,this.clearError("receiver.city_id")}async handleCountryChange(s){const t=Number(s.target.value);this.selectedCountryId=t,this.clearError("receiver.country");const e=this.gift?.countries?.find((s=>s.id==t));if(this.selectedCountryCode=e?.country_code,this.isKSA="SA"===e?.country_code,this.regions=[],this.selectedRegionId=void 0,this.gift={...this.gift,cities:[]},this.receiverCity=void 0,!t||0===this.gift?.countries?.length)return this.selectedCountryCode=void 0,this.isKSA=!1,void this.setWrapperHeight(2,0,0);if(this.isKSA){this.loadingRegions=!0,this.setWrapperHeight(2,0,0);try{const s=await salla.api.request(`shipping/countries/${t}/regions`);s&&s.data&&(this.regions=s.data)}catch(s){console.error("Error fetching regions:",s)}finally{this.loadingRegions=!1,this.setWrapperHeight(2,0,0)}}else{this.loadingCities=!0,this.setWrapperHeight(2,0,0);try{const s=await salla.api.request("shipping/cities?for_branch=0&country_id="+t);s&&s.data&&(this.gift={...this.gift,cities:s.data})}catch(s){console.error("Error fetching cities:",s)}finally{this.loadingCities=!1}}}async handleRegionChange(s){const t=Number(s.target.value);if(this.selectedRegionId=t,this.clearError("receiver.region"),this.gift={...this.gift,cities:[]},this.receiverCity=void 0,t){this.loadingCities=!0;try{const s=await salla.api.request(`shipping/cities?for_branch=0&country_id=${this.selectedCountryId}&region_id=${t}`);s&&s.data&&(this.gift={...this.gift,cities:s.data})}catch(s){console.error("Error fetching cities:",s)}finally{this.loadingCities=!1,this.setWrapperHeight(2,0,0)}}}handleUploadImage(s){this.uploadedImage=s,this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handleRemoveImage(){this.uploadedImage="",this.gift&&this.gift.gift_images.length&&this.setWrapperHeight(1,150,0)}handlePhoneInputChange(s){let t=s.detail;this.receiverMobile=t.number,this.receiverCountryCode=t.country_code,this.clearError("receiver.mobile")}handleDateTimePicker(s){this.deliveryDate=s.detail}getCalendarClasses(){return{"s-form-group":!0,"anime-item":!0,"s-gifting-calendar":!0,shown:this.showCalendar,hide:!this.showCalendar,"s-form-has-error":!!this.errors&&this.errors.deliver_at}}async submitForm(){const s=document.querySelector("#donating-amount")?.value;if(this.calendarFormGroup.classList.remove("s-form-has-error"),this.errors&&(this.errors={},this.setWrapperHeight(2,150,0)),this.showCalendar&&!this.deliveryDate)return void this.calendarFormGroup.classList.add("s-form-has-error");const t=[{key:"sender_name",value:this.senderName,label:this.senderNameLabel},{key:"receiver.name",value:this.receiverName,label:this.receiverNameFieldLabel},{key:"receiver.mobile",value:this.receiverMobile,label:this.receiverMobileFieldLabel},...this.physicalProducts?[{key:"receiver.country",value:this.selectedCountryId,label:this.receiverCountryFieldLabel},...this.isKSA?[{key:"receiver.region",value:this.selectedRegionId,label:this.receiverRegionFieldLabel}]:[],{key:"receiver.city_id",value:this.receiverCity,label:this.receiverCityFieldLabel}]:[]],e={};if(t.forEach((({key:s,value:t,label:i})=>{t||(e[s]=salla.lang.get("common.errors.field_required",{attribute:i}))})),Object.keys(e).length)return this.errors=e,void this.setWrapperHeight(2,150,0);const i={text:this.selectedText,sender_name:this.senderName,quantity:this.quantity,deliver_at:this.showCalendar?this.deliveryDate:null,image_url:this.uploadedImage??this.selectedImage,donation_amount:s||null,receiver:{name:this.receiverName,mobile_country_code:this.receiverCountryCode,mobile:this.receiverMobile,...this.physicalProducts&&this.selectedCountryCode?{country_code:this.selectedCountryCode}:{},...this.physicalProducts&&this.selectedRegionId?{region_id:this.selectedRegionId}:{},...this.receiverCity&&this.physicalProducts?{city_id:this.receiverCity}:{}},has_apple_pay:salla.helpers.hasApplePay()};let a;this.productId&&this.formSelector&&(a=this.getFormDataFromForm()||new FormData,a=this.mergeObjectToFormData(i,a));const l=this.productId?()=>salla.product.addProductGiftToCart(this.productId,a,!0):()=>salla.cart.addCartGiftToCart(i,!0);return await l().then((()=>this.modal.close())).catch((s=>{s.response&&422==s.response.status?this.errors=s.response.data.error.fields:console.log(s),this.setWrapperHeight(2,150,0)}))}step2ItemClass(s=""){const t="anime-item"+(this.step2Animated?"":" opacity-0");return s?`${s} ${t}`:t}generateClass(){return{"s-gifting-widget":!0,"s-gifting-widget-vertical":!!this.vertical,"s-gifting-widget-horizontal":!this.vertical}}async handleGiftButtonClick(){if(this.productId&&this.formSelector){const s=document.querySelector(this.formSelector);if(!s)return void console.error("SallaGifting:: Form not found in the document!");if(!(s instanceof HTMLFormElement))return void console.error("SallaGifting:: The specified selector does not correspond to a form tag!");if(!s.reportValidity())return console.error("SallaGifting:: Form is not valid!"),void salla.error(salla.lang.get("common.messages.required_fields"))}const s=document.querySelector(`salla-product-options[product-id="${this.productId}"]`);!s||await s.reportValidity()?this.open():salla.error(salla.lang.get("common.messages.required_fields"))}render(){return[i("div",{key:"5d0eec8210f77d166c144704ec78bffcaf1f4ce0"},i("salla-list-tile",{key:"19cc20b4f70bbb8a7d267f60052db77589901962",class:this.generateClass()},i("div",{key:"1c3c52b5ac48e71a6ac26c60494657ac28d16457",slot:"title"},this.vertical?i("span",{innerHTML:b}):"",i("h3",{key:"e3379fb3ed39d1bc63500346058b26b883c3be13"},this.widgetTitle?this.widgetTitle:this.sectionTitle)),i("div",{key:"f6c2a522727546aa27cef725faa8be082da063da",slot:"subtitle"},i("div",{key:"7b58ad967f39fa2cc660369b72e73f8dc49f90dc"},this.widgetSubtitle?this.widgetSubtitle:this.sectionSubtitle)),i("div",{key:"848396dcd6ce6009ebc4cf1a209a055ad1adbf15",slot:"action"},i("salla-button",{key:"2ba69b670f1c958784c6f1dca6b2dd0b93f20859",color:"primary",fill:"outline",width:"wide",class:"s-gifting-widget-action",onClick:()=>this.handleGiftButtonClick()},i("slot",{key:"6ac9ac339e321fc9433465cfd75f299307ee7152",name:"widget-btn-content"},i("div",{key:"c61dd36375886c1ecf87f115e5248dca1af7efc9",class:"s-gifting-widget-action-content"},i("span",{key:"0c8a3630ba6b15889fc4bf3d55a1279cdf713400",innerHTML:b}),"  ",i("span",{key:"c9299ec752e5393f30a78e1e01d367be9e97ca50"},this.sectionBtnText)))))),i("salla-modal",{key:"9ee17e79f97eee59d25d9627d5b1cd4ada7cadb3",id:this.hostId,isLoading:!0,class:"s-gifting-modal",width:"sm",ref:s=>this.modal=s},i("div",{key:"aba3b6a4d3e903934c9b5e629119c3a3b5bc90ab",slot:"loading"},i("div",{key:"e03613cc85bf4024f63d2e256a2744ec78f7eabf",class:"s-gifting-skeleton"},i("div",{key:"01156691d540ce5ef5723902610a1da27fba3ddb",class:"s-gifting-modal-header"},i("salla-skeleton",{key:"e45b4868e4fa5633aeb22f758f75f5412290b179",type:"circle",height:"5rem",width:"5rem"}),i("h2",{key:"2b427d38dd6e0569e16de84ef46eb2052d23b739",class:"s-gifting-modal-title"},i("div",{key:"c4f9cb6f513e3ebd2e6ad209648a1f70bcafbcb5",class:"s-gifting-modal-badge-wrapper"},i("salla-skeleton",{key:"e684b682a4cca89262128cca13604b7aa9a83cd7",height:"15px",width:"150px"})))),i("div",{key:"2941865d68cd216b4dd82bb8279f6bcbaa062bf3",class:"s-gifting-skeleton-content"},i("salla-skeleton",{key:"7c4f4235a666930ceef3dc0b38809aea5ee5ce5c",height:"10px",width:"150px"}),i("salla-skeleton",{key:"0257f401762a11b0bf3da7db603b4e5f57bd1aae",height:"230px"}),i("salla-skeleton",{key:"cced26b189549fcee4eff3a3fbd943a5735b4c6c",height:"10px",width:"150px"}),i("salla-skeleton",{key:"f5893e5c631564c91bfe42c4102190d43f913947",height:"30px"}),i("salla-skeleton",{key:"64d3738017cf6732b429848c1de4ca16db1adc06",height:"40px"})))),i("slot",{key:"77d5bda8147f7f09d73b97fd7456121626b465a7",name:"header"}),this.hasError?i("salla-placeholder",{alignment:"center"},i("span",{slot:"title"},this.errorMessage||salla.lang.get("common.errors.empty_results")),i("span",{slot:"description"}," ")):[i("div",{class:"s-gifting-modal-header"},i("span",{class:"s-gifting-modal-icon"},i("span",{innerHTML:b})),i("h2",{class:"s-gifting-modal-title"},i("div",{class:"s-gifting-modal-badge-wrapper"},i("div",{class:"s-gifting-modal-badge"},i("span",null,i("span",null,this.currentStep),"/2")),i("span",null,this.giftDetails)))),i("div",{class:"s-gifting-steps-wrapper "+this.parentClass,ref:s=>this.stepsWrapper=s},i("div",{class:"s-gifting-step-one gift-step-1",ref:s=>this.step1Elems=s},i("div",{class:"s-gifting-modal-uploader-title anime-item"},this.selectImageForYourGift),i("div",{class:"s-gifting-modal-uploader anime-item",ref:s=>this.uploader=s},i("span",{class:"s-gifting-remove-preview",onClick:()=>this.removePreview(),innerHTML:o}),this.selectImageOrUpload&&i("salla-file-upload",{"instant-upload":!0,name:"image_url",url:salla.url.api(salla.product.api.getUrl("giftImage")),onUploaded:s=>this.handleUploadImage(s.detail),labelIdle:this.getFilepondPlaceholder(),onRemoved:()=>this.handleRemoveImage()})),i("div",{class:"anime-item"},!this.uploadedImage&&this.gift&&this.gift.gift_images&&this.gift.gift_images.length>0?i("salla-slider",{id:"gifting-slider",loop:!1,"controls-outer":!0,class:"s-gifting-slider",type:"carousel"},i("div",{slot:"items"},this.gift&&this.gift.gift_images?this.gift?.gift_images.map((s=>i("a",{class:"s-gifting-clickable s-gifting-image",onClick:()=>this.setPreview(s)},i("img",{style:{width:"120px"},src:s.url,alt:""+s.id})))):"")):""),i("div",{class:"anime-item"},i("div",{class:"s-form-group s-gifting-selectText",ref:s=>this.textSelect=s},i("select",{id:"gift-text-selection",name:"gift-text-selection",class:"s-form-control s-gifting-select",onChange:s=>this.toggleGiftText(s)},i("option",{"data-id":null,selected:!0},this.selectGiftMessage),this.gift&&this.gift.gift_texts?this.gift?.gift_texts.map((s=>i("option",{"data-id":s.id,value:s.text,key:s.id},s.text))):"",i("option",{"data-id":"custom"},this.giftCustomText))),i("div",{class:this.showGiftText?"s-form-group s-gifting-textarea shown":"s-form-group s-gifting-textarea hide",ref:s=>this.customTextArea=s},i("label",{htmlFor:"gift-custom-text",class:"s-form-label"},this.giftCustomText),i("div",{class:"mt-1"},i("textarea",{onInput:s=>this.handleTextAreaChange(s),rows:4,ref:s=>this.textArea=s,name:"gift-custom-text",id:"gift-custom-text",class:"s-form-control"})))),i("div",{class:"anime-item"},i("salla-button",{color:"primary",width:"wide",onClick:()=>this.goToStep2()},i("span",null,this.nextStep)))),i("div",{class:"s-gifting-step-two gift-step-2",ref:s=>this.step2Elems=s},i("div",{class:this.step2ItemClass(this.errors?.sender_name?"s-form-group s-form-has-error":"s-form-group")},i("label",{htmlFor:"sender_name",class:"s-form-label"},this.senderNameLabel),i("input",{type:"text",class:"s-form-control",name:"sender_name",id:"sender_name",value:this.senderName,onInput:s=>this.handleSenderName(s),placeholder:""}),this.errors&&this.errors.sender_name?i("span",{class:"s-gifting-error"},this.errors.sender_name):""),i("div",{class:this.step2ItemClass(this.errors?.["receiver.name"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{htmlFor:"receiver_name",class:"s-form-label"},this.receiverNameFieldLabel),i("input",{type:"text",class:"s-form-control",name:"receiver_name",id:"receiver_name",value:"",onInput:s=>this.handleReceiverName(s),placeholder:""}),this.errors&&this.errors["receiver.name"]?i("span",{class:"s-gifting-error"},this.errors["receiver.name"]):""),i("div",{class:this.step2ItemClass(this.errors?.["receiver.mobile"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverMobileFieldLabel),i("salla-tel-input",{class:"s-gifting-tel-input",phone:this.receiverMobile,countryCode:this.receiverCountryCode,onPhoneEntered:s=>this.handlePhoneInputChange(s)}),this.errors&&this.errors["receiver.mobile"]?i("span",{class:"s-gifting-error"},this.errors["receiver.mobile"]):""),this.physicalProducts&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.country"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverCountryFieldLabel),i("select",{name:"country",class:"s-form-control",onChange:s=>this.handleCountryChange(s),required:!0},i("option",{value:""},this.selectCountry),this.gift?.countries?.map((s=>i("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.country"]?i("span",{class:"s-gifting-error"},this.errors["receiver.country"]):""),this.physicalProducts&&this.isKSA&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.region"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverRegionFieldLabel),i("select",{name:"region",class:"s-form-control",onChange:s=>this.handleRegionChange(s),disabled:this.loadingRegions},i("option",{value:"",selected:!0},this.loadingRegions?salla.lang.get("common.elements.loading"):this.selectRegion),this.regions?.map((s=>i("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.region"]?i("span",{class:"s-gifting-error"},this.errors["receiver.region"]):""),this.physicalProducts&&i("div",{class:this.step2ItemClass(this.errors?.["receiver.city_id"]?"s-form-group s-form-has-error":"s-form-group")},i("label",{class:"s-form-label"},this.receiverCityFieldLabel),i("select",{name:"city","aria-label":salla.lang.get("blocks.buy_as_gift.select_city"),class:"s-form-control",onChange:s=>this.handleReceiverCity(s),disabled:this.loadingCities||this.isKSA&&!this.selectedRegionId},i("option",{value:"",selected:!0},this.loadingCities?salla.lang.get("common.elements.loading"):this.selectCity),this.gift?.cities?.map((s=>i("option",{value:s.id},s.name)))),this.errors&&this.errors["receiver.city_id"]?i("span",{class:"s-gifting-error"},this.errors["receiver.city_id"]):""),this.physicalProducts&&i("div",{class:this.step2ItemClass("s-gifting-info")},i("span",{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>alert</title>\n<path d="M16 13.333c-0.736 0-1.333 0.597-1.333 1.333v8c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-8c0-0.736-0.597-1.333-1.333-1.333zM16 9.327c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327zM27.313 4.687c-6.237-6.237-16.389-6.239-22.628 0-6.237 6.239-6.237 16.389 0 22.628 3.119 3.119 7.216 4.679 11.313 4.679s8.195-1.559 11.313-4.679c6.24-6.239 6.24-16.391 0.001-22.628zM25.428 25.428c-5.199 5.197-13.657 5.197-18.857 0-5.197-5.199-5.197-13.659 0-18.857 5.199-5.197 13.659-5.197 18.857 0 5.199 5.2 5.199 13.659 0 18.857z"></path>\n</svg>\n'}),i("span",null,this.selectCityInfo)),!this.physicalProducts&&i("div",{class:this.step2ItemClass()},i("label",{class:"s-gifting-schedule s-gifting-clickable",htmlFor:"schedule-"+this.hostId},i("input",{type:"checkbox",name:"schedule",id:"schedule-"+this.hostId,onChange:()=>this.toggleCalendar(),class:"s-checkbox"}),i("span",{class:"s-form-label"}," ",this.sendLater," "))),i("div",{class:this.getCalendarClasses(),ref:s=>this.calendarFormGroup=s},i("label",{class:"s-form-label"},this.selectSendDateAndTime),i("salla-datetime-picker",{value:this.deliveryDate,placeholder:this.selectSendDateAndTime,"enable-time":!0,"date-format":"Y-m-d h:i K",onPicked:s=>this.handleDateTimePicker(s)}),i("span",{class:"s-gifting-calendar-hint"},this.canNotEditOrderAfterSelectDate)),i("div",{class:this.step2ItemClass("s-gifting-step-two-footer")},i("a",{href:"#!",innerHTML:l,onClick:s=>this.goToStep1(s)}),i("salla-button",{onClick:()=>this.submitForm(),color:"primary",width:"wide"},i("span",null,this.sendGift)))))],i("slot",{key:"46da7ff69a3c10b75886a23936f2f9ad8ad0e7bf",name:"footer"})))]}static get style(){return".s-gifting-steps-wrapper{transition:0.2s cubic-bezier(0.55, 0, 0.1, 1) 0s}.s-gifting-select{background-image:url(\"data:image/svg+xml;utf8,<svg version='1.1' fill='gray' xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>\");background-size:24px;background-repeat:no-repeat;background-position:99%;appearance:none}[dir=rtl] .s-gifting-select{background-position:5px}.s-gifting-widget-vertical .s-list-tile-item [slot=title]{display:flex;align-items:center;gap:1.5rem}.s-gifting-widget-vertical .s-list-tile-item-content{width:100%}"}},[260,"salla-gifting",{productId:[2,"product-id"],widgetTitle:[1,"widget-title"],widgetSubtitle:[1,"widget-subtitle"],physicalProducts:[4,"physical-products"],vertical:[4],formSelector:[1025,"form-selector"],sectionTitle:[32],sectionSubtitle:[32],sectionBtnText:[32],giftDetails:[32],selectImageForYourGift:[32],selectImageOrUpload:[32],selectGiftMessage:[32],giftCustomText:[32],textId:[32],incorrectGiftText:[32],nextStep:[32],senderNameLabel:[32],receiverNameFieldLabel:[32],receiverMobileFieldLabel:[32],receiverCountryFieldLabel:[32],ksa:[32],selectCountry:[32],selectCity:[32],selectCityInfo:[32],receiverCityFieldLabel:[32],receiverRegionFieldLabel:[32],selectRegion:[32],receiverEmailFieldLabel:[32],emailPlaceholder:[32],sendLater:[32],selectSendDateAndTime:[32],canNotEditOrderAfterSelectDate:[32],sendGift:[32],donationRequired:[32],currentStep:[32],showCalendar:[32],showGiftText:[32],currentLang:[32],parentClass:[32],errors:[32],gift:[32],selectedGiftTextOption:[32],selectedCountryId:[32],selectedCountryCode:[32],loadingCities:[32],loadingRegions:[32],regions:[32],selectedRegionId:[32],isKSA:[32],parsedFormData:[32],showTextArea:[32],selectedImage:[32],uploadedImage:[32],selectedText:[32],senderName:[32],errorMessage:[32],hasError:[32],quantity:[32],deliveryDate:[32],timeZone:[32],receiverName:[32],receiverMobile:[32],receiverCountryCode:[32],receiverEmail:[32],hostId:[32],receiverCity:[32],open:[64],close:[64],goToStep2:[64]}]);function y(){"undefined"!=typeof customElements&&["salla-gifting","salla-button","salla-datetime-picker","salla-file-upload","salla-list-tile","salla-loading","salla-modal","salla-placeholder","salla-skeleton","salla-slider","salla-tel-input"].forEach((t=>{switch(t){case"salla-gifting":customElements.get(s(t))||customElements.define(s(t),v);break;case"salla-button":customElements.get(s(t))||r();break;case"salla-datetime-picker":customElements.get(s(t))||c();break;case"salla-file-upload":customElements.get(s(t))||n();break;case"salla-list-tile":customElements.get(s(t))||h();break;case"salla-loading":customElements.get(s(t))||d();break;case"salla-modal":customElements.get(s(t))||g();break;case"salla-placeholder":customElements.get(s(t))||f();break;case"salla-skeleton":customElements.get(s(t))||m();break;case"salla-slider":customElements.get(s(t))||u();break;case"salla-tel-input":customElements.get(s(t))||p()}}))}y();const _=v,k=y;export{_ as SallaGifting,k as defineCustomElement}