@salla.sa/twilight-components 3.0.11 → 3.0.12

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 (347) hide show
  1. package/dist/cjs/{Helper-Bta9bFWz.js → Helper-BrrJMIu-.js} +1 -1
  2. package/dist/cjs/{filepond-Dv48GITM.js → filepond-BKRafQ1x.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-poster-Bn-5Zy-w.js → filepond-plugin-file-poster-C25z7WOd.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-size-DGwsFpCE.js → filepond-plugin-file-validate-size-2MQdgdwP.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-file-validate-type--A7HwCGC.js → filepond-plugin-file-validate-type-DD-c_iSB.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-edit-CZOu0C_e.js → filepond-plugin-image-edit-Dq6FjmNP.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-exif-orientation-DlkmyCu1.js → filepond-plugin-image-exif-orientation-BRAMyVJB.js} +1 -1
  8. package/dist/cjs/{filepond-plugin-image-preview-DtpRyOkv.js → filepond-plugin-image-preview-CH8YOizI.js} +1 -1
  9. package/dist/cjs/{index-Dbot13Bj.js → index-C51JXzxx.js} +2 -2
  10. package/dist/cjs/{intlTelInput-7PzX73Yx.js → intlTelInput-B8pv5SRI.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-accordion_6.cjs.entry.js +2 -2
  14. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +2 -2
  15. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-applied-filters.cjs.entry.js +2 -2
  19. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +11 -11
  21. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-bullet-delivery_3.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-comment-form_9.cjs.entry.js +2 -2
  30. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters-widget.cjs.entry.js +2 -2
  38. package/dist/cjs/salla-filters.cjs.entry.js +2 -2
  39. package/dist/cjs/salla-free-shipping-banner.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-free-shipping-tag.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-gift-card-redeem_2.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +2 -2
  46. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-map_3.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-notification-item_2.cjs.entry.js +2 -2
  65. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-order-items.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-order-options-modal.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-order-payment.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-order-rewards.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-orders.cjs.entry.js +2 -2
  83. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-product-card.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-products-list.cjs.entry.js +2 -2
  90. package/dist/cjs/salla-products-slider.cjs.entry.js +2 -2
  91. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +2 -2
  93. package/dist/cjs/salla-rating-modal.cjs.entry.js +2 -2
  94. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-search-product-card.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-search.cjs.entry.js +2 -2
  99. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-thank-you-header.cjs.entry.js +1 -1
  104. package/dist/cjs/salla-thank-you-page.cjs.entry.js +1 -1
  105. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  106. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  107. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  108. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  109. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  110. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  111. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  112. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  113. package/dist/cjs/salla-wishlist-summary.cjs.entry.js +2 -2
  114. package/dist/cjs/twilight.cjs.js +1 -1
  115. package/dist/cjs/{vanilla-picker-duouCWHz.js → vanilla-picker-DZOpTkJY.js} +1 -1
  116. package/dist/components/index.js +2 -2
  117. package/dist/docs.json +1 -1
  118. package/dist/esm/{Helper-DWvWnPTT.js → Helper-HKFR9hkU.js} +1 -1
  119. package/dist/esm/{filepond-a9y0myDt.js → filepond-BWuSCgOP.js} +1 -1
  120. package/dist/esm/{filepond-plugin-file-poster-CdtFPjqC.js → filepond-plugin-file-poster-Jmeh5F_E.js} +1 -1
  121. package/dist/esm/{filepond-plugin-file-validate-size-BVe60caz.js → filepond-plugin-file-validate-size-DyAHTsNy.js} +1 -1
  122. package/dist/esm/{filepond-plugin-file-validate-type-DoNTCSSY.js → filepond-plugin-file-validate-type-DRlCCAEY.js} +1 -1
  123. package/dist/esm/{filepond-plugin-image-edit-DxQBYiWr.js → filepond-plugin-image-edit-Bk6ZqXoD.js} +1 -1
  124. package/dist/esm/{filepond-plugin-image-exif-orientation-BbbBG1df.js → filepond-plugin-image-exif-orientation-CNF8NRE-.js} +1 -1
  125. package/dist/esm/{filepond-plugin-image-preview-Dp9lSvoH.js → filepond-plugin-image-preview-yiP7Y36X.js} +1 -1
  126. package/dist/esm/{index-Ca7ApeqJ.js → index-D-liptKs.js} +2 -2
  127. package/dist/esm/{intlTelInput-DHxBJckf.js → intlTelInput-C8kHZShn.js} +1 -1
  128. package/dist/esm/loader.js +2 -2
  129. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  130. package/dist/esm/salla-accordion_6.entry.js +2 -2
  131. package/dist/esm/salla-add-product-button_5.entry.js +2 -2
  132. package/dist/esm/salla-advertisement.entry.js +1 -1
  133. package/dist/esm/salla-alert_2.entry.js +1 -1
  134. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  135. package/dist/esm/salla-applied-filters.entry.js +2 -2
  136. package/dist/esm/salla-apps-icons.entry.js +1 -1
  137. package/dist/esm/salla-attachment-view_9.entry.js +11 -11
  138. package/dist/esm/salla-badge.entry.js +1 -1
  139. package/dist/esm/salla-basket-gap.entry.js +1 -1
  140. package/dist/esm/salla-bullet-delivery_3.entry.js +1 -1
  141. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  142. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  143. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  144. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  145. package/dist/esm/salla-comment-factors.entry.js +1 -1
  146. package/dist/esm/salla-comment-form_9.entry.js +2 -2
  147. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  148. package/dist/esm/salla-contacts.entry.js +1 -1
  149. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  150. package/dist/esm/salla-count-down.entry.js +1 -1
  151. package/dist/esm/salla-custom-fields.entry.js +1 -1
  152. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  153. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  154. package/dist/esm/salla-filters-widget.entry.js +2 -2
  155. package/dist/esm/salla-filters.entry.js +2 -2
  156. package/dist/esm/salla-free-shipping-banner.entry.js +1 -1
  157. package/dist/esm/salla-free-shipping-tag.entry.js +1 -1
  158. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  159. package/dist/esm/salla-gift-card-redeem_2.entry.js +1 -1
  160. package/dist/esm/salla-gifting.entry.js +1 -1
  161. package/dist/esm/salla-hook.entry.js +1 -1
  162. package/dist/esm/salla-infinite-scroll.entry.js +2 -2
  163. package/dist/esm/salla-installment.entry.js +1 -1
  164. package/dist/esm/salla-list-tile.entry.js +1 -1
  165. package/dist/esm/salla-localization-modal.entry.js +1 -1
  166. package/dist/esm/salla-login-modal.entry.js +1 -1
  167. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  168. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  169. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  170. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  171. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  172. package/dist/esm/salla-loyalty.entry.js +1 -1
  173. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  174. package/dist/esm/salla-map_3.entry.js +1 -1
  175. package/dist/esm/salla-menu.entry.js +1 -1
  176. package/dist/esm/salla-metadata.entry.js +1 -1
  177. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  178. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  179. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  180. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  181. package/dist/esm/salla-notification-item_2.entry.js +2 -2
  182. package/dist/esm/salla-offer-modal.entry.js +1 -1
  183. package/dist/esm/salla-offer.entry.js +1 -1
  184. package/dist/esm/salla-order-branch.entry.js +1 -1
  185. package/dist/esm/salla-order-cancel.entry.js +1 -1
  186. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  187. package/dist/esm/salla-order-details-options.entry.js +1 -1
  188. package/dist/esm/salla-order-details.entry.js +1 -1
  189. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  190. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  191. package/dist/esm/salla-order-edit.entry.js +1 -1
  192. package/dist/esm/salla-order-items.entry.js +1 -1
  193. package/dist/esm/salla-order-options-modal.entry.js +1 -1
  194. package/dist/esm/salla-order-payment.entry.js +1 -1
  195. package/dist/esm/salla-order-rewards.entry.js +1 -1
  196. package/dist/esm/salla-order-shipments.entry.js +1 -1
  197. package/dist/esm/salla-order-summary.entry.js +1 -1
  198. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  199. package/dist/esm/salla-orders.entry.js +2 -2
  200. package/dist/esm/salla-payments.entry.js +1 -1
  201. package/dist/esm/salla-placeholder.entry.js +1 -1
  202. package/dist/esm/salla-price-range.entry.js +1 -1
  203. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  204. package/dist/esm/salla-product-card.entry.js +1 -1
  205. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  206. package/dist/esm/salla-products-list.entry.js +2 -2
  207. package/dist/esm/salla-products-slider.entry.js +2 -2
  208. package/dist/esm/salla-quick-order.entry.js +1 -1
  209. package/dist/esm/salla-rating-modal-v2.entry.js +2 -2
  210. package/dist/esm/salla-rating-modal.entry.js +2 -2
  211. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  212. package/dist/esm/salla-review-order-item.entry.js +1 -1
  213. package/dist/esm/salla-scopes.entry.js +1 -1
  214. package/dist/esm/salla-search-product-card.entry.js +1 -1
  215. package/dist/esm/salla-search.entry.js +2 -2
  216. package/dist/esm/salla-skeleton.entry.js +1 -1
  217. package/dist/esm/salla-social-share.entry.js +1 -1
  218. package/dist/esm/salla-social.entry.js +1 -1
  219. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  220. package/dist/esm/salla-thank-you-header.entry.js +1 -1
  221. package/dist/esm/salla-thank-you-page.entry.js +1 -1
  222. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  223. package/dist/esm/salla-trust-badges.entry.js +1 -1
  224. package/dist/esm/salla-user-menu.entry.js +1 -1
  225. package/dist/esm/salla-user-profile.entry.js +1 -1
  226. package/dist/esm/salla-user-settings.entry.js +1 -1
  227. package/dist/esm/salla-verify.entry.js +1 -1
  228. package/dist/esm/salla-wallet.entry.js +1 -1
  229. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  230. package/dist/esm/salla-wishlist-summary.entry.js +2 -2
  231. package/dist/esm/twilight.js +2 -2
  232. package/dist/esm/{vanilla-picker-DanARkRw.js → vanilla-picker-Bha2vjiQ.js} +1 -1
  233. package/dist/twilight/{p-9c12e6f5.entry.js → p-002390c1.entry.js} +1 -1
  234. package/dist/twilight/{p-54bf725a.entry.js → p-00b3677a.entry.js} +1 -1
  235. package/dist/twilight/{p-2b2fe494.entry.js → p-05f73b01.entry.js} +1 -1
  236. package/dist/twilight/{p-ae509d7e.entry.js → p-066a1f35.entry.js} +1 -1
  237. package/dist/twilight/{p-497a25c3.entry.js → p-07cbb834.entry.js} +1 -1
  238. package/dist/twilight/{p-522ebdcd.entry.js → p-08b96a03.entry.js} +1 -1
  239. package/dist/twilight/{p-3a7ead6f.entry.js → p-08db53a3.entry.js} +1 -1
  240. package/dist/twilight/{p-afe24b99.entry.js → p-091626df.entry.js} +1 -1
  241. package/dist/twilight/{p-88466a9b.entry.js → p-0bd10136.entry.js} +1 -1
  242. package/dist/twilight/{p-7e7513cc.entry.js → p-0d8a7766.entry.js} +1 -1
  243. package/dist/twilight/{p-cdf293e6.entry.js → p-1273e69e.entry.js} +1 -1
  244. package/dist/twilight/{p-ff557e53.entry.js → p-145268f5.entry.js} +1 -1
  245. package/dist/twilight/{p-b53ff1bd.entry.js → p-14c29941.entry.js} +1 -1
  246. package/dist/twilight/{p-267002f3.entry.js → p-14dbaceb.entry.js} +1 -1
  247. package/dist/twilight/{p-c2fb7675.entry.js → p-155ea894.entry.js} +1 -1
  248. package/dist/twilight/{p-22886a79.entry.js → p-164017ef.entry.js} +1 -1
  249. package/dist/twilight/{p-a8f64f77.entry.js → p-19104c8f.entry.js} +1 -1
  250. package/dist/twilight/{p-4c907708.entry.js → p-1c73b015.entry.js} +1 -1
  251. package/dist/twilight/{p-604ec527.entry.js → p-1ebfa091.entry.js} +1 -1
  252. package/dist/twilight/{p-13122f5c.entry.js → p-1f2be974.entry.js} +1 -1
  253. package/dist/twilight/{p-d1a86615.entry.js → p-24c1bf3c.entry.js} +1 -1
  254. package/dist/twilight/{p-d827080e.entry.js → p-24d9e3ae.entry.js} +1 -1
  255. package/dist/twilight/{p-295e2f67.entry.js → p-2bfca6bb.entry.js} +1 -1
  256. package/dist/twilight/{p-84e65c7c.entry.js → p-2f54090e.entry.js} +1 -1
  257. package/dist/twilight/{p-aad33c09.entry.js → p-3054378d.entry.js} +1 -1
  258. package/dist/twilight/{p-53495b02.entry.js → p-34cdfecc.entry.js} +1 -1
  259. package/dist/twilight/{p-e83adc0e.entry.js → p-36be16d5.entry.js} +1 -1
  260. package/dist/twilight/{p-238d619e.entry.js → p-38b47bdd.entry.js} +1 -1
  261. package/dist/twilight/{p-31a7ed46.entry.js → p-3d242cc1.entry.js} +1 -1
  262. package/dist/twilight/{p-ba44ab6e.entry.js → p-3d247b63.entry.js} +1 -1
  263. package/dist/twilight/{p-637ae00c.entry.js → p-3ecf5876.entry.js} +1 -1
  264. package/dist/twilight/{p-315334ee.entry.js → p-4053f320.entry.js} +1 -1
  265. package/dist/twilight/{p-08178cc2.entry.js → p-41576ab1.entry.js} +1 -1
  266. package/dist/twilight/{p-49fd0d88.entry.js → p-4484244a.entry.js} +1 -1
  267. package/dist/twilight/{p-8d6f3f2e.entry.js → p-4992eb62.entry.js} +1 -1
  268. package/dist/twilight/{p-2fd1408b.entry.js → p-49fbb20a.entry.js} +1 -1
  269. package/dist/twilight/{p-94b1af8e.entry.js → p-4dfe2b5a.entry.js} +1 -1
  270. package/dist/twilight/{p-21b0f3e1.entry.js → p-4ea47864.entry.js} +1 -1
  271. package/dist/twilight/{p-a4248834.entry.js → p-55044cf9.entry.js} +1 -1
  272. package/dist/twilight/{p-8c192a4d.entry.js → p-59f6c234.entry.js} +1 -1
  273. package/dist/twilight/{p-3ba56dd6.entry.js → p-5ac272d9.entry.js} +1 -1
  274. package/dist/twilight/{p-1dfcc1ea.entry.js → p-61e369cc.entry.js} +1 -1
  275. package/dist/twilight/{p-f2a3c288.entry.js → p-627fcdf8.entry.js} +1 -1
  276. package/dist/twilight/{p-27d1835a.entry.js → p-64c32fc4.entry.js} +1 -1
  277. package/dist/twilight/{p-c2023ba6.entry.js → p-66c556be.entry.js} +1 -1
  278. package/dist/twilight/{p-8856f8ad.entry.js → p-66eb497a.entry.js} +1 -1
  279. package/dist/twilight/{p-ab021327.entry.js → p-68f19a87.entry.js} +1 -1
  280. package/dist/twilight/{p-22e54ab9.entry.js → p-6ab094ec.entry.js} +1 -1
  281. package/dist/twilight/{p-78aa0530.entry.js → p-6c52df83.entry.js} +1 -1
  282. package/dist/twilight/{p-bc949882.entry.js → p-6c98a821.entry.js} +1 -1
  283. package/dist/twilight/{p-5eb216ae.entry.js → p-72d5bb83.entry.js} +1 -1
  284. package/dist/twilight/{p-52224432.entry.js → p-74950745.entry.js} +1 -1
  285. package/dist/twilight/{p-ae7e71c8.entry.js → p-76880d2d.entry.js} +1 -1
  286. package/dist/twilight/{p-47d6128e.entry.js → p-7946367e.entry.js} +1 -1
  287. package/dist/twilight/{p-8f4b3753.entry.js → p-7cfbbb15.entry.js} +1 -1
  288. package/dist/twilight/{p-35eb3258.entry.js → p-7da71e61.entry.js} +1 -1
  289. package/dist/twilight/{p-874c4b47.entry.js → p-88cb1bf8.entry.js} +1 -1
  290. package/dist/twilight/{p-8d951684.entry.js → p-88f84be5.entry.js} +1 -1
  291. package/dist/twilight/{p-f6602ece.entry.js → p-895b0823.entry.js} +1 -1
  292. package/dist/twilight/{p-bb1adb13.entry.js → p-8d1a85f2.entry.js} +1 -1
  293. package/dist/twilight/{p-8d765c05.entry.js → p-8fdbb8b0.entry.js} +1 -1
  294. package/dist/twilight/{p-09e7abf3.entry.js → p-908865d8.entry.js} +1 -1
  295. package/dist/twilight/{p-933701cf.entry.js → p-92c7020c.entry.js} +1 -1
  296. package/dist/twilight/{p-7b74bfc8.entry.js → p-96a13f39.entry.js} +1 -1
  297. package/dist/twilight/{p-647ec80c.entry.js → p-96b1321c.entry.js} +1 -1
  298. package/dist/twilight/{p-a01df707.entry.js → p-9a849197.entry.js} +1 -1
  299. package/dist/twilight/{p-a62d89f4.entry.js → p-9d60e39e.entry.js} +1 -1
  300. package/dist/twilight/{p-CIwiAeLZ.js → p-BEXYbhiv.js} +1 -1
  301. package/dist/twilight/{p-CzQfsXbf.js → p-BaSXnr76.js} +1 -1
  302. package/dist/twilight/{p-BupSmf9j.js → p-Bw3Uhhqz.js} +1 -1
  303. package/dist/twilight/{p-CK8yh00L.js → p-CEg8igsL.js} +1 -1
  304. package/dist/twilight/{p-_8a0n6YQ.js → p-CSoBlLkO.js} +1 -1
  305. package/dist/twilight/{p-DxTmjl_3.js → p-Cr7B1EBq.js} +1 -1
  306. package/dist/twilight/{p-Ca7ApeqJ.js → p-D-liptKs.js} +1 -1
  307. package/dist/twilight/{p-CS-AMfl0.js → p-DJNlIURb.js} +1 -1
  308. package/dist/twilight/{p-CWOoBoFJ.js → p-DX4uCvPd.js} +1 -1
  309. package/dist/twilight/{p-pDbyUZfb.js → p-X4SZKWK_.js} +1 -1
  310. package/dist/twilight/{p-f9ec9870.entry.js → p-a0bc4046.entry.js} +1 -1
  311. package/dist/twilight/{p-bec78c3b.entry.js → p-a0c03e80.entry.js} +1 -1
  312. package/dist/twilight/{p-26a52f1f.entry.js → p-a3b51809.entry.js} +1 -1
  313. package/dist/twilight/{p-c01dd1e9.entry.js → p-a477338e.entry.js} +1 -1
  314. package/dist/twilight/{p-725246f7.entry.js → p-a6fac0ed.entry.js} +1 -1
  315. package/dist/twilight/{p-6a75f33a.entry.js → p-a746d125.entry.js} +1 -1
  316. package/dist/twilight/{p-633fc7da.entry.js → p-a75fb562.entry.js} +1 -1
  317. package/dist/twilight/{p-def729de.entry.js → p-a7d38b65.entry.js} +1 -1
  318. package/dist/twilight/{p-d3a3e2ff.entry.js → p-a9e22858.entry.js} +1 -1
  319. package/dist/twilight/{p-df79624c.entry.js → p-aa8cf04d.entry.js} +1 -1
  320. package/dist/twilight/{p-555c22e5.entry.js → p-ade305e5.entry.js} +1 -1
  321. package/dist/twilight/{p-83e2da9e.entry.js → p-b1fe81b2.entry.js} +1 -1
  322. package/dist/twilight/{p-205aa210.entry.js → p-b66c6151.entry.js} +1 -1
  323. package/dist/twilight/{p-4c9af3b2.entry.js → p-c1c87179.entry.js} +1 -1
  324. package/dist/twilight/{p-7bfa9c00.entry.js → p-c28c5459.entry.js} +1 -1
  325. package/dist/twilight/{p-4dd1d56d.entry.js → p-c2dda915.entry.js} +1 -1
  326. package/dist/twilight/{p-657820ec.entry.js → p-c34d28e8.entry.js} +1 -1
  327. package/dist/twilight/{p-96d44802.entry.js → p-c60fa4f3.entry.js} +1 -1
  328. package/dist/twilight/{p-80bbc9a9.entry.js → p-c8ee99c4.entry.js} +1 -1
  329. package/dist/twilight/{p-79535c09.entry.js → p-c999fa43.entry.js} +1 -1
  330. package/dist/twilight/{p-86771eed.entry.js → p-d432b93e.entry.js} +1 -1
  331. package/dist/twilight/{p-9528dcf1.entry.js → p-da43f413.entry.js} +1 -1
  332. package/dist/twilight/{p-b0809748.entry.js → p-e246382d.entry.js} +1 -1
  333. package/dist/twilight/{p-9827fca6.entry.js → p-e2d4b469.entry.js} +1 -1
  334. package/dist/twilight/{p-1c70702b.entry.js → p-e47587e7.entry.js} +1 -1
  335. package/dist/twilight/{p-59670a22.entry.js → p-eaf4c0d6.entry.js} +1 -1
  336. package/dist/twilight/{p-932ce23f.entry.js → p-ebae6a64.entry.js} +1 -1
  337. package/dist/twilight/{p-f6d21473.entry.js → p-ec091524.entry.js} +1 -1
  338. package/dist/twilight/{p-6b5b0332.entry.js → p-ed1aef14.entry.js} +1 -1
  339. package/dist/twilight/{p-032c0248.entry.js → p-ee16b8d6.entry.js} +1 -1
  340. package/dist/twilight/{p-ebacd6a0.entry.js → p-f17443c6.entry.js} +1 -1
  341. package/dist/twilight/{p-1a2d5015.entry.js → p-f55b3dbb.entry.js} +1 -1
  342. package/dist/twilight/{p-e4ac39df.entry.js → p-f58b72e3.entry.js} +1 -1
  343. package/dist/twilight/{p-134ed665.entry.js → p-f699b552.entry.js} +1 -1
  344. package/dist/twilight/{p-942548d8.entry.js → p-feac9436.entry.js} +1 -1
  345. package/dist/twilight/{p-BdcDWlJR.js → p-jW-Il9be.js} +1 -1
  346. package/dist/twilight/twilight.esm.js +1 -1
  347. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,c as s,h as i,H as e,a as n}from"./p-Ca7ApeqJ.js";import{A as o}from"./p-BuGRUUN_.js";import{A as l}from"./p-CcEEx00d.js";const d=class{constructor(i){t(this,i),this.optionsSaved=s(this,"optionsSaved"),this.productSelected=s(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[],this.isProductAlreadySelected=!1}generateCacheKey(t,s,i){return`${t||"unknown"}-${s||0}-${i||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.isProductAlreadySelected=!!t.isProductAlreadySelected,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const s=t.detail||t,{option:i,detail:e}=s,n=i||s.option_id&&this.product?.options?.find((t=>t.id===s.option_id||String(t.id)===String(s.option_id))),o=e||(s.id?s:null);this.product?.id&&n&&this.handleOptionChange(Number(this.product.id),n,o)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const s=t.target;if(s&&"checkbox"===s.type&&s.name&&s.name.includes("bundle[")&&s.name.includes("][id]")){const t=s.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!s.checked){if("true"===s.getAttribute("data-selection-locked"))return void(s.checked=!0);const[,i,e]=t,n=s.value,o=this.host.closest("form");this.cleanupProductDeselection({sectionId:i,productIndex:parseInt(e,10),productId:n,form:o,uncheckedInput:s})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:s,productIndex:i,productId:e,form:n,uncheckedInput:o}=t;if(this.clearProductOptions(e,s,i),n){const t=`bundle[${s}][${i}]`;Array.from(n.querySelectorAll(`input[name^="${t}"]`)).forEach((s=>{if(s===o)return;const i="hidden"===s.type,n=s.getAttribute("data-product-id")===String(e)&&s.name?.startsWith(t);(i||n)&&s.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});n.dispatchEvent(t)}))}}generateFormInputName(t,s,i){return`bundle[${t}][${s}][options][${i}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,s=this.generateCacheKey(this.sectionId,this.productIndex,t),i=document.querySelector(`salla-product-options[product-id="${t}"]`);if(i)try{const t=await i.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[s]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,s,i){const e={...this.selectedOptions};if(null==s||null==i||Number.isNaN(i)){const s=`-${String(t)}`,i=[];Object.keys(e).forEach((t=>{t.endsWith(s)&&(delete e[t],i.push(t))})),i.forEach((t=>this.bumpOptionsResetToken(t)))}else{const n=this.generateCacheKey(s,i,t);delete e[n],this.bumpOptionsResetToken(n)}this.selectedOptions=e,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,s,i){const e=this.generateCacheKey(this.sectionId,this.productIndex,t),n=document.querySelector(`salla-product-options[product-id="${t}"]`);let o=[];if(n)try{o=await n.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(o.length>0)this.selectedOptions={...this.selectedOptions,[e]:o};else if(this.selectedOptions[e]&&this.selectedOptions[e].length>0){const t=[...this.selectedOptions[e]||[]],n=t.findIndex((t=>t.option_id===s.id));n>-1?i&&null!=i.id?t[n]={...i,option_id:s.id}:t.splice(n,1):i&&null!=i.id&&t.push({...i,option_id:s.id}),this.selectedOptions={...this.selectedOptions,[e]:t}}else i&&null!=i.id&&(this.selectedOptions={...this.selectedOptions,[e]:[{...i,option_id:s.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],s=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,s),e=document.querySelector(`salla-product-options[product-id="${s}"]`);let n=[];if(e)try{n=await e.getSelectedOptions()||[];const t=this.selectedOptions[i]||[];(t.length>n.length||0===n.length&&t.length>0)&&(n=t)}catch(t){n=this.selectedOptions[i]||[]}else n=this.selectedOptions[i]||[];return 0===n.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((s=>{s.required&&(n.some((t=>t.option_id==s.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:s.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const s=this.product?.id;if(!s)return;const i=this.generateCacheKey(this.sectionId,this.productIndex,s);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){if(!this.isProductAlreadySelected&&null!=this.sectionId){const t=this.host.closest("salla-multiple-bundle-product-details");if(!await(t?.canSelectBundleProduct(this.sectionId,s)))return void salla.notify.error(salla.lang.getWithDefault("pages.products.bundle_selection_limit_reached","لا يمكنك اختيار المزيد من المنتجات في هذا القسم"))}this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${s}"]`);let e=await(t?.getSelectedOptions());if((!e||0===e.length)&&this.selectedOptions[i]?.length>0&&(e=this.selectedOptions[i]),!e||0===e.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[i]:e};const n=this.host.closest("form");if(!n)return void(this.isLoading=!1);const o=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(n.querySelectorAll(`input[name^="${o}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(n.querySelectorAll(`[data-product-id="${s}"][name^="${o}"]`)).forEach((t=>t.remove()));const l=`bundle[${this.sectionId}][${this.productIndex}][id]`,d=document.getElementById(l);if(d)d.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(s),t.dataset.productId=String(s),n.appendChild(t)}e.forEach((t=>{const i=t.option_id,e=document.createElement("input");e.type="hidden",e.name=this.generateFormInputName(this.sectionId,this.productIndex??0,i),e.value=String(t.id),e.dataset.productId=String(s),n.appendChild(e)}));const a=new window.Event("change",{bubbles:!0});n.dispatchEvent(a),this.optionsSaved.emit({productId:Number(s),selectedOptions:e,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(s),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),s=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const i=s.some((s=>s.id===t.id));return{...t,is_selected:i}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),n=this.generateCacheKey(this.sectionId,this.productIndex,t),o=this.optionsResetTokens[n]||0,l=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return i(e,{key:"8c2d6cbc15d173ceeb3a5b498e8684e0c61a5adf"},i("salla-modal",{key:"7cb8274a9304257c19a5fb8bbbfb44c98b818c83",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"9f16fe0b3fb26e4fee7f1273f875399ed0f401a7",slot:"loading"},i("salla-skeleton",{key:"0fdf6a86da8432f8f5c883466ea2fab00ae4e2d3",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"940ca77513e6aee8062b7cc8b2d04334973f6b02",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"cd14ebae116356906bb1f9dda3545e5555295b33",slot:"items"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${s+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"e40da3829870abc60dba4827c8d331152e45272c",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,"data-caption":`${this.product?.name} - Image ${s+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${s+1}`,alt:t.alt||`${this.product?.name} - ${s+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${n}-reset-${o}`,"product-id":t,"unique-key":`${n}-reset-${o}`}),i("div",{key:"6caf87769ef6ffda12dee54df32e87728e62c484",slot:"footer"},i("div",{key:"bf2ed94efbe7e2ca4dd76441783d5a8423a4454d",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"9468df838e0b677714abb4951c958f37bac2a1c2",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:l},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return n(this)}static get watchers(){return{product:["handleProductChange"]}}};d.style=":host{display:block}";const a=class{constructor(i){t(this,i),this.productSelected=s(this,"productSelected"),this.productOptionsSelected=s(this,"productOptionsSelected"),this.selectedProducts={},this.isSelectionLocked=!1,this.selectionLimit=0,this.savedOptionsByInstance={},this.handleProductClick=(t,s)=>{const i=this.selectedProducts[this.section.id]?.has(t.id)||!1,e=this.getCheckbox(this.section.id,s);if(i&&this.isSelectionLocked)return void(e&&(e.checked=!0));if(!i&&this.isMaxSelectionReached()&&1!==this.selectionLimit)return;if(1===this.selectionLimit&&!i)return void this.productSelected.emit({product:t,sectionId:this.section.id});if(!e)return;const n=!e.checked;n||(this.dispatchClearOptionsEvent(t,s),this.clearSavedOptionsState(this.section.id,s)),e.checked=n,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});e.dispatchEvent(t)})),this.productSelected.emit({product:t,sectionId:this.section.id})},this.handleOptionsClick=t=>{!this.selectedProducts[this.section.id]?.has(t.id)&&this.isMaxSelectionReached()&&1!==this.selectionLimit||this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getSelectedCount(){return this.selectedProducts[this.section?.id]?.size??0}isMaxSelectionReached(){return this.selectionLimit>1&&this.getSelectedCount()>=this.selectionLimit}isProductSelectionDisabled(t,s){return 0===t.quantity||!s&&this.isMaxSelectionReached()}getProductInstanceKey(t,s){return`${t}::${s}`}dispatchClearOptionsEvent(t,s){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:s})}handleOptionsSaved(t){const s=t.detail;if(!s)return;const{sectionId:i,productIndex:e,selectedOptions:n}=s;if(null==i||i!==this.section?.id)return;if(null==e||Number.isNaN(e))return;const o=this.getProductInstanceKey(i,e);if(n?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[o]:!0};else if(this.savedOptionsByInstance[o]){const t={...this.savedOptionsByInstance};delete t[o],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,s){const i=this.getProductInstanceKey(t,s);if(!this.savedOptionsByInstance[i])return;const e={...this.savedOptionsByInstance};delete e[i],this.savedOptionsByInstance=e}generateEventName(t,s){return`bundle[${t}][${s}][id]`}getCheckbox(t,s){const i=this.generateEventName(t,s);return this.host.querySelector(`input.s-multiple-bundle-product-checkbox[name="${i}"]`)}preventLockedDeselect(t,s){if(!this.isSelectionLocked||!s)return;t.preventDefault(),t.stopPropagation();const i=t.target;"checkbox"===i?.type&&(i.checked=!0)}render(){return i(e,{key:"2ca2abba3b76523115bc14c2f9f5a260d6aac773"},i("salla-slider",{key:"a874eb56bd85e4405783e94e0dae1eb5c4077e93",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"2b452eb0da6e0d005255daaf73223515dafc2e16",slot:"items"},this?.section?.products?.map(((t,s)=>{const e=this.selectedProducts[this.section.id]?.has(t.id)||!1,n=e&&this.isSelectionLocked,d=this.isProductSelectionDisabled(t,e),a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,s)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let c=salla.config.get("theme.is_rtl",!0)?o:l;return i("div",{class:"s-multiple-bundle-product-slide-one-third"+(d?" s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,s)},i("input",{id:this.generateEventName(this.section.id,s),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:e,"data-selection-locked":n?"true":void 0,name:this.generateEventName(this.section.id,s),value:t.id,onClick:t=>this.preventLockedDeselect(t,e),onChange:t=>this.preventLockedDeselect(t,e)}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},i("a",{href:t?.url||"#",target:"_blank",rel:"noopener noreferrer"},t.name))),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.regular_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:c})))))})))))}get host(){return n(this)}};a.style="";export{d as salla_multiple_bundle_product_options_modal,a as salla_multiple_bundle_product_slider}
4
+ import{r as t,c as s,h as i,H as e,a as n}from"./p-D-liptKs.js";import{A as o}from"./p-BuGRUUN_.js";import{A as l}from"./p-CcEEx00d.js";const d=class{constructor(i){t(this,i),this.optionsSaved=s(this,"optionsSaved"),this.productSelected=s(this,"productSelected"),this.product=null,this.sectionId=null,this.sectionIndex=0,this.productIndex=0,this.selectedOptions={},this.optionsResetTokens={},this.isLoading=!1,this.hasUnsavedChanges=!1,this.validationErrors=[],this.isProductAlreadySelected=!1}generateCacheKey(t,s,i){return`${t||"unknown"}-${s||0}-${i||"unknown"}`}handleProductChange(t){setTimeout((()=>{this.modal&&t&&this.modal.setTitle(t.name||"")}),100),this.validationErrors=[],this.hasUnsavedChanges=!1}async open(){this.modal?(this.isLoading=!0,this.product?.name&&this.modal.setTitle(this.product.name),this.modal.open(),setTimeout((async()=>{this.product?.id&&await this.initializeSelectedOptions(),this.product?.name&&this.modal.setTitle(this.product.name),this.modal.stopLoading(),this.isLoading=!1}),300)):requestAnimationFrame((()=>this.open()))}async close(){this.modal&&this.modal.close()}async refreshOptionsState(){this.selectedOptions={...this.selectedOptions}}componentDidLoad(){this.modalOpenListener=t=>{this.product=t.product,this.sectionId=t.sectionId||null,this.sectionIndex=t.sectionIndex||0,this.productIndex=t.productIndex||0,this.isProductAlreadySelected=!!t.isProductAlreadySelected,this.open()},salla.event.on("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener=t=>{t&&t.productId&&this.clearProductOptions(t.productId,t.sectionId,t.productIndex)},salla.event.on("multiple-bundle-product-modal::clear-options",this.clearOptionsListener),this.optionChangeListener=t=>{const s=t.detail||t,{option:i,detail:e}=s,n=i||s.option_id&&this.product?.options?.find((t=>t.id===s.option_id||String(t.id)===String(s.option_id))),o=e||(s.id?s:null);this.product?.id&&n&&this.handleOptionChange(Number(this.product.id),n,o)},salla.event.on("product-options::change",this.optionChangeListener),this.checkboxChangeListener=t=>{const s=t.target;if(s&&"checkbox"===s.type&&s.name&&s.name.includes("bundle[")&&s.name.includes("][id]")){const t=s.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);if(t&&!s.checked){if("true"===s.getAttribute("data-selection-locked"))return void(s.checked=!0);const[,i,e]=t,n=s.value,o=this.host.closest("form");this.cleanupProductDeselection({sectionId:i,productIndex:parseInt(e,10),productId:n,form:o,uncheckedInput:s})}}},document.addEventListener("change",this.checkboxChangeListener)}disconnectedCallback(){this.checkboxChangeListener&&document.removeEventListener("change",this.checkboxChangeListener),this.optionChangeListener&&salla.event.off("product-options::change",this.optionChangeListener),this.modalOpenListener&&salla.event.off("multiple-bundle-product-modal::open",this.modalOpenListener),this.clearOptionsListener&&salla.event.off("multiple-bundle-product-modal::clear-options",this.clearOptionsListener)}cleanupProductDeselection(t){const{sectionId:s,productIndex:i,productId:e,form:n,uncheckedInput:o}=t;if(this.clearProductOptions(e,s,i),n){const t=`bundle[${s}][${i}]`;Array.from(n.querySelectorAll(`input[name^="${t}"]`)).forEach((s=>{if(s===o)return;const i="hidden"===s.type,n=s.getAttribute("data-product-id")===String(e)&&s.name?.startsWith(t);(i||n)&&s.remove()})),requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});n.dispatchEvent(t)}))}}generateFormInputName(t,s,i){return`bundle[${t}][${s}][options][${i}]`}async initializeSelectedOptions(){if(!this.product?.id)return;const t=this.product.id,s=this.generateCacheKey(this.sectionId,this.productIndex,t),i=document.querySelector(`salla-product-options[product-id="${t}"]`);if(i)try{const t=await i.getSelectedOptions();t&&t.length>0&&(this.selectedOptions={...this.selectedOptions,[s]:t})}catch(t){console.warn("Could not initialize selected options:",t)}}clearProductOptions(t,s,i){const e={...this.selectedOptions};if(null==s||null==i||Number.isNaN(i)){const s=`-${String(t)}`,i=[];Object.keys(e).forEach((t=>{t.endsWith(s)&&(delete e[t],i.push(t))})),i.forEach((t=>this.bumpOptionsResetToken(t)))}else{const n=this.generateCacheKey(s,i,t);delete e[n],this.bumpOptionsResetToken(n)}this.selectedOptions=e,this.validationErrors=[],this.hasUnsavedChanges=!1}bumpOptionsResetToken(t){t&&(this.optionsResetTokens={...this.optionsResetTokens,[t]:(this.optionsResetTokens[t]||0)+1})}async handleOptionChange(t,s,i){const e=this.generateCacheKey(this.sectionId,this.productIndex,t),n=document.querySelector(`salla-product-options[product-id="${t}"]`);let o=[];if(n)try{o=await n.getSelectedOptions()||[]}catch(t){console.warn("Could not get current selections from component:",t)}if(o.length>0)this.selectedOptions={...this.selectedOptions,[e]:o};else if(this.selectedOptions[e]&&this.selectedOptions[e].length>0){const t=[...this.selectedOptions[e]||[]],n=t.findIndex((t=>t.option_id===s.id));n>-1?i&&null!=i.id?t[n]={...i,option_id:s.id}:t.splice(n,1):i&&null!=i.id&&t.push({...i,option_id:s.id}),this.selectedOptions={...this.selectedOptions,[e]:t}}else i&&null!=i.id&&(this.selectedOptions={...this.selectedOptions,[e]:[{...i,option_id:s.id}]});this.hasUnsavedChanges=!0,this.validationErrors=[]}async validateOptions(){if(!this.product?.options)return!0;const t=[],s=this.product.id,i=this.generateCacheKey(this.sectionId,this.productIndex,s),e=document.querySelector(`salla-product-options[product-id="${s}"]`);let n=[];if(e)try{n=await e.getSelectedOptions()||[];const t=this.selectedOptions[i]||[];(t.length>n.length||0===n.length&&t.length>0)&&(n=t)}catch(t){n=this.selectedOptions[i]||[]}else n=this.selectedOptions[i]||[];return 0===n.length&&t.push(salla.lang.get("pages.products.no_options_selected")),this.product.options.forEach((s=>{s.required&&(n.some((t=>t.option_id==s.id))||t.push(salla.lang.get("pages.products.required_option_missing",{option:s.name})))})),this.validationErrors=t,0===t.length}async onSave(t){t.preventDefault();const s=this.product?.id;if(!s)return;const i=this.generateCacheKey(this.sectionId,this.productIndex,s);if(await new Promise((t=>setTimeout(t,100))),await this.validateOptions()){if(!this.isProductAlreadySelected&&null!=this.sectionId){const t=this.host.closest("salla-multiple-bundle-product-details");if(!await(t?.canSelectBundleProduct(this.sectionId,s)))return void salla.notify.error(salla.lang.getWithDefault("pages.products.bundle_selection_limit_reached","لا يمكنك اختيار المزيد من المنتجات في هذا القسم"))}this.isLoading=!0;try{const t=document.querySelector(`salla-product-options[product-id="${s}"]`);let e=await(t?.getSelectedOptions());if((!e||0===e.length)&&this.selectedOptions[i]?.length>0&&(e=this.selectedOptions[i]),!e||0===e.length)return void(this.isLoading=!1);this.selectedOptions={...this.selectedOptions,[i]:e};const n=this.host.closest("form");if(!n)return void(this.isLoading=!1);const o=`bundle[${this.sectionId}][${this.productIndex}]`;Array.from(n.querySelectorAll(`input[name^="${o}"][type="hidden"]`)).forEach((t=>t.remove())),Array.from(n.querySelectorAll(`[data-product-id="${s}"][name^="${o}"]`)).forEach((t=>t.remove()));const l=`bundle[${this.sectionId}][${this.productIndex}][id]`,d=document.getElementById(l);if(d)d.checked=!0;else{const t=document.createElement("input");t.type="hidden",t.name=`bundle[${this.sectionId}][${this.productIndex}][id]`,t.value=String(s),t.dataset.productId=String(s),n.appendChild(t)}e.forEach((t=>{const i=t.option_id,e=document.createElement("input");e.type="hidden",e.name=this.generateFormInputName(this.sectionId,this.productIndex??0,i),e.value=String(t.id),e.dataset.productId=String(s),n.appendChild(e)}));const a=new window.Event("change",{bubbles:!0});n.dispatchEvent(a),this.optionsSaved.emit({productId:Number(s),selectedOptions:e,sectionId:this.sectionId,productIndex:this.productIndex}),this.sectionId&&this.productSelected.emit({productId:Number(s),sectionId:this.sectionId,product:this.product,fromModal:!0}),salla.notify.success(salla.lang.get("pages.products.options_saved")),this.hasUnsavedChanges=!1,this.validationErrors=[],this.modal.close()}catch(t){salla.notify.error(salla.lang.get("pages.products.options_save_error"))}finally{this.isLoading=!1}}else salla.notify.error(this.validationErrors.join(", "))}getOptionsWithSelectedState(){if(!this.product?.options)return[];const t=this.generateCacheKey(this.sectionId,this.productIndex,this.product.id),s=this.selectedOptions[t]||[];return this.product.options.map((t=>({...t,details:t.details.map((t=>{const i=s.some((s=>s.id===t.id));return{...t,is_selected:i}}))})))}render(){const t=this.product?.id,s=this.getOptionsWithSelectedState(),n=this.generateCacheKey(this.sectionId,this.productIndex,t),o=this.optionsResetTokens[n]||0,l=this.isLoading||s.some((t=>t.details.some((t=>t.is_selected&&!0===t.is_out))));return i(e,{key:"8c2d6cbc15d173ceeb3a5b498e8684e0c61a5adf"},i("salla-modal",{key:"7cb8274a9304257c19a5fb8bbbfb44c98b818c83",isLoading:this.isLoading,ref:t=>this.modal=t,width:"md",centered:!1,id:`s-multiple-bundle-product-options-modal-options-${t}`,class:"s-multiple-bundle-product-options-modal-wrapper"},i("div",{key:"9f16fe0b3fb26e4fee7f1273f875399ed0f401a7",slot:"loading"},i("salla-skeleton",{key:"0fdf6a86da8432f8f5c883466ea2fab00ae4e2d3",height:"100%",width:"100%"})),this.product?.images&&this.product?.images.length>0&&i("salla-slider",{key:"940ca77513e6aee8062b7cc8b2d04334973f6b02",id:`details-slider-${this.product?.id}`,type:"thumbs",loop:!1,"auto-height":!0,"listen-to-thumbnails-option":!0,showThumbsControls:!1,controlsOuter:!1,showControls:!1,class:"s-multiple-bundle-product-options-modal-slider",verticalThumbs:!0,thumbsConfig:{centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:Math.min(5,Math.max(1,this.product?.images.length)),watchOverflow:!0,watchSlidesProgress:!0,direction:"vertical",spaceBetween:10}},i("div",{key:"cd14ebae116356906bb1f9dda3545e5555295b33",slot:"items"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,class:"swiper-slide"},i("img",{src:t.url,alt:t.alt||`${this.product?.name} - Image ${s+1}`,loading:"lazy",onError:t=>{t.target.style.display="none"}}))))),this.product?.images&&this.product?.images.length>1&&i("div",{key:"e40da3829870abc60dba4827c8d331152e45272c",slot:"thumbs"},this.product?.images&&this.product?.images.map(((t,s)=>i("div",{key:s,"data-caption":`${this.product?.name} - Image ${s+1}`},i("img",{src:t.url,loading:"eager",class:"s-multiple-bundle-product-options-modal-slider-thumb",title:`${this.product?.name} - ${s+1}`,alt:t.alt||`${this.product?.name} - ${s+1}`,onError:t=>{t.target.style.display="none"}})))))),i("salla-product-options",{options:JSON.stringify(s),key:`${n}-reset-${o}`,"product-id":t,"unique-key":`${n}-reset-${o}`}),i("div",{key:"6caf87769ef6ffda12dee54df32e87728e62c484",slot:"footer"},i("div",{key:"bf2ed94efbe7e2ca4dd76441783d5a8423a4454d",class:"s-multiple-bundle-product-options-modal-footer"},i("salla-button",{key:"9468df838e0b677714abb4951c958f37bac2a1c2",onClick:t=>this.onSave(t),loading:this.isLoading,disabled:l},this.isLoading?salla.lang.get("common.elements.saving"):salla.lang.get("common.elements.save"))))))}get host(){return n(this)}static get watchers(){return{product:["handleProductChange"]}}};d.style=":host{display:block}";const a=class{constructor(i){t(this,i),this.productSelected=s(this,"productSelected"),this.productOptionsSelected=s(this,"productOptionsSelected"),this.selectedProducts={},this.isSelectionLocked=!1,this.selectionLimit=0,this.savedOptionsByInstance={},this.handleProductClick=(t,s)=>{const i=this.selectedProducts[this.section.id]?.has(t.id)||!1,e=this.getCheckbox(this.section.id,s);if(i&&this.isSelectionLocked)return void(e&&(e.checked=!0));if(!i&&this.isMaxSelectionReached()&&1!==this.selectionLimit)return;if(1===this.selectionLimit&&!i)return void this.productSelected.emit({product:t,sectionId:this.section.id});if(!e)return;const n=!e.checked;n||(this.dispatchClearOptionsEvent(t,s),this.clearSavedOptionsState(this.section.id,s)),e.checked=n,requestAnimationFrame((()=>{const t=new window.Event("change",{bubbles:!0});e.dispatchEvent(t)})),this.productSelected.emit({product:t,sectionId:this.section.id})},this.handleOptionsClick=t=>{!this.selectedProducts[this.section.id]?.has(t.id)&&this.isMaxSelectionReached()&&1!==this.selectionLimit||this.productOptionsSelected.emit({product:t,sectionId:this.section.id})}}getSelectedCount(){return this.selectedProducts[this.section?.id]?.size??0}isMaxSelectionReached(){return this.selectionLimit>1&&this.getSelectedCount()>=this.selectionLimit}isProductSelectionDisabled(t,s){return 0===t.quantity||!s&&this.isMaxSelectionReached()}getProductInstanceKey(t,s){return`${t}::${s}`}dispatchClearOptionsEvent(t,s){salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t.id,sectionId:this.section.id,sectionIndex:this.sectionIndex,productIndex:s})}handleOptionsSaved(t){const s=t.detail;if(!s)return;const{sectionId:i,productIndex:e,selectedOptions:n}=s;if(null==i||i!==this.section?.id)return;if(null==e||Number.isNaN(e))return;const o=this.getProductInstanceKey(i,e);if(n?.length)this.savedOptionsByInstance={...this.savedOptionsByInstance,[o]:!0};else if(this.savedOptionsByInstance[o]){const t={...this.savedOptionsByInstance};delete t[o],this.savedOptionsByInstance=t}}clearSavedOptionsState(t,s){const i=this.getProductInstanceKey(t,s);if(!this.savedOptionsByInstance[i])return;const e={...this.savedOptionsByInstance};delete e[i],this.savedOptionsByInstance=e}generateEventName(t,s){return`bundle[${t}][${s}][id]`}getCheckbox(t,s){const i=this.generateEventName(t,s);return this.host.querySelector(`input.s-multiple-bundle-product-checkbox[name="${i}"]`)}preventLockedDeselect(t,s){if(!this.isSelectionLocked||!s)return;t.preventDefault(),t.stopPropagation();const i=t.target;"checkbox"===i?.type&&(i.checked=!0)}render(){return i(e,{key:"2ca2abba3b76523115bc14c2f9f5a260d6aac773"},i("salla-slider",{key:"a874eb56bd85e4405783e94e0dae1eb5c4077e93",type:"carousel",controlsOuter:!1,showControls:!1,id:`accordion-multiple-bundle-product-${this.section.id}`,pagination:!0,class:"s-multiple-bundle-product-wrapper-slider",sliderConfig:{spaceBetween:0}},i("div",{key:"2b452eb0da6e0d005255daaf73223515dafc2e16",slot:"items"},this?.section?.products?.map(((t,s)=>{const e=this.selectedProducts[this.section.id]?.has(t.id)||!1,n=e&&this.isSelectionLocked,d=this.isProductSelectionDisabled(t,e),a=this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id,s)]?salla.lang.getWithDefault("pages.products.edit_selected_options","تعديل الخيارات"):salla.lang.get("pages.products.choose_from_options");let c=salla.config.get("theme.is_rtl",!0)?o:l;return i("div",{class:"s-multiple-bundle-product-slide-one-third"+(d?" s-multiple-bundle-product-slide-one-third-disabled":""),key:t.id},i("div",{class:"s-multiple-bundle-product-card"},i("div",{class:"s-multiple-bundle-product-image-wrapper",onClick:()=>this.handleProductClick(t,s)},i("input",{id:this.generateEventName(this.section.id,s),type:"checkbox",class:"s-multiple-bundle-product-checkbox",checked:e,"data-selection-locked":n?"true":void 0,name:this.generateEventName(this.section.id,s),value:t.id,onClick:t=>this.preventLockedDeselect(t,e),onChange:t=>this.preventLockedDeselect(t,e)}),i("img",{src:t.image.url||salla.url.cdn("images/s-empty.png"),loading:"lazy",alt:t.image.alt||t.name,class:"s-multiple-bundle-product-image"})),i("div",{class:"s-multiple-bundle-product-content-wrapper"},i("div",{class:"s-multiple-bundle-product-content"},i("div",{class:"s-multiple-bundle-product-details"},i("div",{class:"s-multiple-bundle-product-title-wrapper"},i("h2",{class:"s-multiple-bundle-product-title"},i("a",{href:t?.url||"#",target:"_blank",rel:"noopener noreferrer"},t.name))),i("div",{class:"s-multiple-bundle-product-price-wrapper"},i("span",{class:"s-multiple-bundle-product-price"},i("span",{innerHTML:salla.money(t.price)})),t.sale_price>0&&i("span",{class:"s-multiple-bundle-product-price-discount"},i("span",{innerHTML:salla.money(t.regular_price)})))),t.quantity_in_group>0&&0!==t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.pieces"),i("span",null,t.quantity_in_group)),0===t.quantity&&i("span",{class:"s-multiple-bundle-product-badge"},salla.lang.get("pages.products.quantity_in_group_finished"))),t.options?.length>0&&i("button",{class:"s-multiple-bundle-product-button",onClick:()=>this.handleOptionsClick(t),type:"button"},a,i("span",{class:"s-multiple-bundle-product-button-icon",innerHTML:c})))))})))))}get host(){return n(this)}};a.style="";export{d as salla_multiple_bundle_product_options_modal,a as salla_multiple_bundle_product_slider}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as s,a as i}from"./p-Ca7ApeqJ.js";const a=class{constructor(e){t(this,e),this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{if("string"==typeof this.exclude)try{this.exclude=JSON.parse(this.exclude)}catch(t){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude),this.exclude=[]}this.paymentSlot=this.host.querySelector('[slot="payment"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="{payment}" /></li>',this.sbcSlot=this.host.querySelector('[slot="sbc"]')?.innerHTML||'<li class="s-payments-list-item"><a target="_blank" href="{link}"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" class="s-payments-sbc-image" alt="SBC" /></a></li>',this.codSlot=this.host.querySelector('[slot="cod"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="COD" /></li>',this.payments=salla.config.get("store.settings.payments")}))}paymentLogo(t){const e=`images/payment/${t}_mini.png`;return a.NEW_CDN_LOGOS.includes(t)?salla.url.assetsCdn(e,58,58):salla.url.cdn(e,58,58)}render(){const t=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa"),i=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return e(s,{key:"4e3c1662f11fc2a78fbff8e3276e739647efddd3",class:"s-payments-list-wrap"},e("ul",{key:"849cc37ee955dbc4b04b8b68c468b363b7ffbaf8",class:"s-payments-list"},t&&e("li",{key:"24e228025591dbb6e86c1c37760c220860cf4d7e",class:"s-payments-list-item"},e("img",{key:"7e7a7fb31a53187d883aaa01a5bc5f75d3ab00c0",width:58,height:58,decoding:"async",loading:"lazy",src:salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.filter((t=>!this.exclude.includes(t))).map((t=>e("div","cod"==t?{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,this.paymentLogo("cod"))}:{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,this.paymentLogo(t)).replace(/\{payment\}/g,t)}))),i&&e("div",{key:"82fe0f6f2e0f7515c77f9db040cb84aa8bb19761",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${i}`)})))}componentDidLoad(){this.auditTrustBadge()}auditTrustBadge(){if(a.audited||"undefined"==typeof IntersectionObserver)return;if(!this.host.closest("footer"))return;if("SA"!==salla.config.get("store.store_country"))return;if("index"!==salla.config.get("page.slug"))return;if("live"!==salla.config.get("theme.mode")||window.self!==window.top)return;if(!salla.config.get("store.settings.commercial_number")&&!salla.config.get("store.settings.freelance_number"))return;let t=!1;const e=()=>{"visible"!==document.visibilityState&&(t=!0)},s=t=>{const e=t.checkVisibility;if("function"!=typeof e)return!0;const s={contentVisibilityAuto:!0,visibilityProperty:!0};if(!e.call(t,s))return!1;if(e.call(t,{...s,opacityProperty:!0}))return!0;const i=t.getBoundingClientRect();return!(i.bottom>0&&i.right>0&&i.top<window.innerHeight&&i.left<window.innerWidth)},i=()=>{if(e(),t)return null;if(salla.config.isMobileApp())return null;const i=Array.from(document.querySelectorAll("salla-trust-badges"));return i.length?i.some((t=>!t.classList.contains("hydrated")))||i.some(s)?null:"hidden":"absent"},n=new IntersectionObserver((t=>{if(a.audited||!t.some((t=>t.isIntersecting)))return;a.audited=!0,n.disconnect(),e(),document.addEventListener("visibilitychange",e);const s=()=>document.removeEventListener("visibilitychange",e);setTimeout((()=>{i()?setTimeout((async()=>{const t=i();if(s(),t&&!salla.storage.getWithTTL("salla::tb-audit"))try{await(salla.analytics?.log("salla::trust-badges.hidden",{store_id:salla.config.get("store.id"),store_username:salla.config.get("store.username"),theme_id:salla.config.get("theme.name"),page_slug:salla.config.get("page.slug"),cause:t})),salla.storage.setWithTTL("salla::tb-audit",!0,1440)}catch(t){salla.logger.error("salla-payments:: failed to report a hidden trust badge",t)}}),2e3):s()}),4e3)}),{threshold:.5});n.observe(this.host)}componentDidRender(){this.host.querySelectorAll("#payment-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#sbc-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#cod-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelector('[slot="payment"]')?.remove(),this.host.querySelector('[slot="sbc"]')?.remove(),this.host.querySelector('[slot="cod"]')?.remove()}get host(){return i(this)}};a.NEW_CDN_LOGOS=["tabby_installment","emkan_installment","benefit","qpay","omannet","deema_installment"],a.audited=!1,a.style='/*!twlt*/:host{display:block}.visible{visibility:visible}.static{position:static}.hidden{display:none}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-payments-list{display:flex;flex-wrap:wrap;align-items:stretch;justify-content:center;gap:0.5rem}.s-payments-list:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-payments-list-item{display:flex;height:2rem;width:3rem;align-items:center;justify-content:center;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.25rem}.s-payments-list-item img{max-height:100%;object-fit:contain}.s-payments-sbc-image{height:1.5rem;border-radius:0.125rem;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-payments-sbc-image:hover{opacity:0.8}';export{a as salla_payments}
4
+ import{r as t,h as s,H as e,a as i}from"./p-D-liptKs.js";const a=class{constructor(s){t(this,s),this.exclude=[]}componentWillLoad(){return salla.onReady().then((()=>{if("string"==typeof this.exclude)try{this.exclude=JSON.parse(this.exclude)}catch(t){salla.logger.error("salla-payments:: failed to parse the exclude props!",this.exclude),this.exclude=[]}this.paymentSlot=this.host.querySelector('[slot="payment"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="{payment}" /></li>',this.sbcSlot=this.host.querySelector('[slot="sbc"]')?.innerHTML||'<li class="s-payments-list-item"><a target="_blank" href="{link}"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" class="s-payments-sbc-image" alt="SBC" /></a></li>',this.codSlot=this.host.querySelector('[slot="cod"]')?.innerHTML||'<li class="s-payments-list-item"><img width="100%" height="100%" decoding="async" loading="lazy" src="{image}" alt="COD" /></li>',this.payments=salla.config.get("store.settings.payments")}))}paymentLogo(t){const s=`images/payment/${t}_mini.png`;return a.NEW_CDN_LOGOS.includes(t)?salla.url.assetsCdn(s,58,58):salla.url.cdn(s,58,58)}render(){const t=!this.exclude.includes("made-in-ksa")&&salla.config.get("store.settings.made_in_ksa"),i=this.exclude.includes("sbc")?null:salla.config.get("store.settings.certificate.id");return s(e,{key:"4e3c1662f11fc2a78fbff8e3276e739647efddd3",class:"s-payments-list-wrap"},s("ul",{key:"849cc37ee955dbc4b04b8b68c468b363b7ffbaf8",class:"s-payments-list"},t&&s("li",{key:"24e228025591dbb6e86c1c37760c220860cf4d7e",class:"s-payments-list-item"},s("img",{key:"7e7a7fb31a53187d883aaa01a5bc5f75d3ab00c0",width:58,height:58,decoding:"async",loading:"lazy",src:salla.url.cdn("images/made-in-ksa.svg",58,58),alt:"made in KSA certified"})),this.payments.filter((t=>!this.exclude.includes(t))).map((t=>s("div","cod"==t?{id:"cod-slot",innerHTML:this.codSlot.replace(/\{image\}/g,this.paymentLogo("cod"))}:{id:"payment-slot",innerHTML:this.paymentSlot.replace(/\{image\}/g,this.paymentLogo(t)).replace(/\{payment\}/g,t)}))),i&&s("div",{key:"82fe0f6f2e0f7515c77f9db040cb84aa8bb19761",id:"sbc-slot",innerHTML:this.sbcSlot.replace(/\{image\}/g,salla.url.cdn("images/sbc.png",58,58)).replace(/\{link\}/g,`https://eauthenticate.saudibusiness.gov.sa/certificate-details/${i}`)})))}componentDidLoad(){this.auditTrustBadge()}auditTrustBadge(){if(a.audited||"undefined"==typeof IntersectionObserver)return;if(!this.host.closest("footer"))return;if("SA"!==salla.config.get("store.store_country"))return;if("index"!==salla.config.get("page.slug"))return;if("live"!==salla.config.get("theme.mode")||window.self!==window.top)return;if(!salla.config.get("store.settings.commercial_number")&&!salla.config.get("store.settings.freelance_number"))return;let t=!1;const s=()=>{"visible"!==document.visibilityState&&(t=!0)},e=t=>{const s=t.checkVisibility;if("function"!=typeof s)return!0;const e={contentVisibilityAuto:!0,visibilityProperty:!0};if(!s.call(t,e))return!1;if(s.call(t,{...e,opacityProperty:!0}))return!0;const i=t.getBoundingClientRect();return!(i.bottom>0&&i.right>0&&i.top<window.innerHeight&&i.left<window.innerWidth)},i=()=>{if(s(),t)return null;if(salla.config.isMobileApp())return null;const i=Array.from(document.querySelectorAll("salla-trust-badges"));return i.length?i.some((t=>!t.classList.contains("hydrated")))||i.some(e)?null:"hidden":"absent"},n=new IntersectionObserver((t=>{if(a.audited||!t.some((t=>t.isIntersecting)))return;a.audited=!0,n.disconnect(),s(),document.addEventListener("visibilitychange",s);const e=()=>document.removeEventListener("visibilitychange",s);setTimeout((()=>{i()?setTimeout((async()=>{const t=i();if(e(),t&&!salla.storage.getWithTTL("salla::tb-audit"))try{await(salla.analytics?.log("salla::trust-badges.hidden",{store_id:salla.config.get("store.id"),store_username:salla.config.get("store.username"),theme_id:salla.config.get("theme.name"),page_slug:salla.config.get("page.slug"),cause:t})),salla.storage.setWithTTL("salla::tb-audit",!0,1440)}catch(t){salla.logger.error("salla-payments:: failed to report a hidden trust badge",t)}}),2e3):e()}),4e3)}),{threshold:.5});n.observe(this.host)}componentDidRender(){this.host.querySelectorAll("#payment-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#sbc-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelectorAll("#cod-slot").forEach((t=>t.replaceWith(t.firstChild))),this.host.querySelector('[slot="payment"]')?.remove(),this.host.querySelector('[slot="sbc"]')?.remove(),this.host.querySelector('[slot="cod"]')?.remove()}get host(){return i(this)}};a.NEW_CDN_LOGOS=["tabby_installment","emkan_installment","benefit","qpay","omannet","deema_installment"],a.audited=!1,a.style='/*!twlt*/:host{display:block}.visible{visibility:visible}.static{position:static}.hidden{display:none}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.s-payments-list{display:flex;flex-wrap:wrap;align-items:stretch;justify-content:center;gap:0.5rem}.s-payments-list:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-payments-list-item{display:flex;height:2rem;width:3rem;align-items:center;justify-content:center;border-radius:var(--s-radius, 0.25rem);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:0.25rem}.s-payments-list-item img{max-height:100%;object-fit:contain}.s-payments-sbc-image{height:1.5rem;border-radius:0.125rem;transition-property:opacity;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.s-payments-sbc-image:hover{opacity:0.8}';export{a as salla_payments}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,f as t,h as l,H as i}from"./p-Ca7ApeqJ.js";import{i as o,g as c}from"./p-DgheRYLY.js";const a=class{constructor(t){e(this,t),this.translationLoaded=!1,this.icon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md"}connectedCallback(){o()&&(this.langUnsubscribe=salla.lang.subscribe((()=>{this.translationLoaded=!0,t(this)})))}disconnectedCallback(){this.langUnsubscribe?.()}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return l(i,{key:"6721d56632a696a5cced960705e3e673ed903612",class:this.alignmentClass()},l("div",{key:"e208636c2356a343a61ecffb4667aefded2a89e4",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),l("div",{key:"5062d6e686f22e9022cfcf20d0e765eb043eedea",class:"s-placeholder-title"},l("slot",{key:"7f823cd4f4e5440413ec70f1153721e6bcee1847",name:"title"},l("span",{key:"6845e1aa3ac7b5390bde2d61f38fcc96131bbcaf"},c(void 0,(()=>salla.lang.get("common.elements.no_options")),"No options available")))),l("div",{key:"e4ccf03b42df98d60a16dc03c4e8ce4449965a87",class:"s-placeholder-description"},l("slot",{key:"c0328e609cdfd19747aaeb001fffc327237b6560",name:"description"},l("span",{key:"c10a8aa9067dcf517b72c8656a6b41f3c49ee556"},c(void 0,(()=>salla.lang.get("common.errors.empty_results")),"No results found")))))}};a.style='/*!twlt*/.inline{display:inline}.contents{display:contents}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-loyalty-confirmation-modal-content .s-placeholder-title{margin-bottom:0.75rem}.s-loyalty-confirmation-modal-content .s-placeholder-icon svg b{--tw-text-opacity:1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.s-loyalty-confirmation-modal-content .s-placeholder-description{padding-left:1.25rem;padding-right:1.25rem}.s-placeholder-title{margin-bottom:0.25rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-placeholder-description{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-placeholder-icon{margin-bottom:1rem;fill:#e5e7eb}.s-placeholder-align-left{text-align:left}.s-placeholder-align-center{text-align:center}.s-placeholder-align-right{text-align:right}.s-placeholder-align-right>.s-placeholder-icon{display:flex;align-items:center;justify-content:flex-end}.s-placeholder-align-right>.s-placeholder-icon:where([dir="rtl"],[dir="rtl"] *){justify-content:flex-start}.s-placeholder-align-center>.s-placeholder-icon{display:flex;align-items:center;justify-content:center}.s-placeholder-icon-xs>svg{height:1.5rem;width:1.5rem}.s-placeholder-icon-sm>svg{height:2.5rem;width:2.5rem}.s-placeholder-icon-md>svg{height:3.5rem;width:3.5rem}.s-placeholder-icon-lg>svg{height:4rem;width:4rem}.s-placeholder-icon-xl>svg{height:5rem;width:5rem}.s-placeholder-icon-xxl>svg{height:6rem;width:6rem}.s-placeholder-icon-xxxl>svg{height:7rem;width:7rem}.s-placeholder-icon-xs>i{font-size:20px}.s-placeholder-icon-sm>i{font-size:35px}.s-placeholder-icon-md>i{font-size:45px}.s-placeholder-icon-lg>i{font-size:58px}.s-placeholder-icon-xl>i{font-size:75px}.s-placeholder-icon-xxl>i{font-size:85px}.s-placeholder-icon-xxxl>i{font-size:100px}.s-placeholder-wrapper{margin-top:3rem;margin-bottom:3rem;display:block}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}';export{a as salla_placeholder}
4
+ import{r as e,f as t,h as l,H as i}from"./p-D-liptKs.js";import{i as o,g as c}from"./p-DgheRYLY.js";const a=class{constructor(t){e(this,t),this.translationLoaded=!1,this.icon='\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>inbox</title>\n<path d="M31.984 19.797l-2.667-17.333c-0.1-0.651-0.659-1.131-1.317-1.131h-24c-0.659 0-1.217 0.48-1.317 1.131l-2.667 17.333c-0.011 0.067-0.016 0.135-0.016 0.203v6.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-6.667c0-0.068-0.005-0.136-0.016-0.203zM5.144 4h21.712l2.256 14.667h-9.112c-0.736 0-1.333 0.596-1.333 1.333 0 1.471-1.196 2.667-2.667 2.667s-2.667-1.196-2.667-2.667c0-0.737-0.597-1.333-1.333-1.333h-9.112zM29.333 26.667c0 0.736-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.597-1.333-1.333v-5.333h8.168c0.593 2.299 2.684 4 5.165 4s4.571-1.701 5.165-4h8.168z"></path>\n</svg>\n',this.alignment="left",this.iconSize="md"}connectedCallback(){o()&&(this.langUnsubscribe=salla.lang.subscribe((()=>{this.translationLoaded=!0,t(this)})))}disconnectedCallback(){this.langUnsubscribe?.()}alignmentClass(){return{"s-placeholder-wrapper":!0,"s-placeholder-align-left":"left"==this.alignment,"s-placeholder-align-center":"center"==this.alignment,"s-placeholder-align-right":"right"==this.alignment}}render(){return l(i,{key:"6721d56632a696a5cced960705e3e673ed903612",class:this.alignmentClass()},l("div",{key:"e208636c2356a343a61ecffb4667aefded2a89e4",class:`s-placeholder-icon s-placeholder-icon-${this.iconSize}`,innerHTML:this.icon}),l("div",{key:"5062d6e686f22e9022cfcf20d0e765eb043eedea",class:"s-placeholder-title"},l("slot",{key:"7f823cd4f4e5440413ec70f1153721e6bcee1847",name:"title"},l("span",{key:"6845e1aa3ac7b5390bde2d61f38fcc96131bbcaf"},c(void 0,(()=>salla.lang.get("common.elements.no_options")),"No options available")))),l("div",{key:"e4ccf03b42df98d60a16dc03c4e8ce4449965a87",class:"s-placeholder-description"},l("slot",{key:"c0328e609cdfd19747aaeb001fffc327237b6560",name:"description"},l("span",{key:"c10a8aa9067dcf517b72c8656a6b41f3c49ee556"},c(void 0,(()=>salla.lang.get("common.errors.empty_results")),"No results found")))))}};a.style='/*!twlt*/.inline{display:inline}.contents{display:contents}.s-bullet-delivery-placeholder.s-placeholder-wrapper{margin-top:1rem !important;margin-bottom:1rem !important}.s-loyalty-confirmation-modal-content .s-placeholder-title{margin-bottom:0.75rem}.s-loyalty-confirmation-modal-content .s-placeholder-icon svg b{--tw-text-opacity:1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.s-loyalty-confirmation-modal-content .s-placeholder-description{padding-left:1.25rem;padding-right:1.25rem}.s-placeholder-title{margin-bottom:0.25rem;font-size:1rem;line-height:1.5rem;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-placeholder-description{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-placeholder-icon{margin-bottom:1rem;fill:#e5e7eb}.s-placeholder-align-left{text-align:left}.s-placeholder-align-center{text-align:center}.s-placeholder-align-right{text-align:right}.s-placeholder-align-right>.s-placeholder-icon{display:flex;align-items:center;justify-content:flex-end}.s-placeholder-align-right>.s-placeholder-icon:where([dir="rtl"],[dir="rtl"] *){justify-content:flex-start}.s-placeholder-align-center>.s-placeholder-icon{display:flex;align-items:center;justify-content:center}.s-placeholder-icon-xs>svg{height:1.5rem;width:1.5rem}.s-placeholder-icon-sm>svg{height:2.5rem;width:2.5rem}.s-placeholder-icon-md>svg{height:3.5rem;width:3.5rem}.s-placeholder-icon-lg>svg{height:4rem;width:4rem}.s-placeholder-icon-xl>svg{height:5rem;width:5rem}.s-placeholder-icon-xxl>svg{height:6rem;width:6rem}.s-placeholder-icon-xxxl>svg{height:7rem;width:7rem}.s-placeholder-icon-xs>i{font-size:20px}.s-placeholder-icon-sm>i{font-size:35px}.s-placeholder-icon-md>i{font-size:45px}.s-placeholder-icon-lg>i{font-size:58px}.s-placeholder-icon-xl>i{font-size:75px}.s-placeholder-icon-xxl>i{font-size:85px}.s-placeholder-icon-xxxl>i{font-size:100px}.s-placeholder-wrapper{margin-top:3rem;margin-bottom:3rem;display:block}.s-scopes-wrap .s-placeholder-wrapper{display:flex;height:12rem;flex-direction:column;align-items:center;justify-content:center}';export{a as salla_placeholder}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as c,c as t,h as e,H as d}from"./p-Ca7ApeqJ.js";const r=class{constructor(e){c(this,e),this.orderEditProductSelected=t(this,"orderEditProductSelected")}get productData(){if(!this.product)return{};if("object"==typeof this.product)return this.product;try{return JSON.parse(this.product)}catch(c){return{}}}handleSelectProduct(){this.orderEditProductSelected.emit({product:this.productData})}render(){const c=this.productData,t=c?.name||salla.lang.getWithDefault("common.elements.product","منتج"),r=c?.price;return e(d,{key:"0dcf3a6106db0d03e2b4746a821295e200820f03"},e("button",{key:"11ffc873c2f2750d006a0cbe7a7552b7f763221a",type:"button",class:"s-order-edit-product-card",onClick:()=>this.handleSelectProduct()},e("div",{key:"58cef6bf3c6cbc0c07d4d6414da4692479165904",class:"s-order-edit-product-card-media"},c?.image?.url?e("img",{src:c.image.url,alt:c.image.alt||t,class:"s-order-edit-product-card-image"}):e("div",{class:"s-order-edit-product-card-placeholder"},e("i",{class:"sicon-shopping-bag"}))),e("div",{key:"77819d6bb5a63ae94c950c38e23d96b04c87b87c",class:"s-order-edit-product-card-content"},e("h3",{key:"714d714413577586a321d298ace38a8acac2e739",class:"s-order-edit-product-card-title"},t),null!=r&&e("p",{key:"96fe89acd8a62cc2014207d3466c85e625b83af9",class:"s-order-edit-product-card-price",innerHTML:salla.money(r)}))))}};r.style=":host{display:block;min-width:0}";export{r as salla_order_edit_product_card}
4
+ import{r as c,c as t,h as d,H as e}from"./p-D-liptKs.js";const r=class{constructor(d){c(this,d),this.orderEditProductSelected=t(this,"orderEditProductSelected")}get productData(){if(!this.product)return{};if("object"==typeof this.product)return this.product;try{return JSON.parse(this.product)}catch(c){return{}}}handleSelectProduct(){this.orderEditProductSelected.emit({product:this.productData})}render(){const c=this.productData,t=c?.name||salla.lang.getWithDefault("common.elements.product","منتج"),r=c?.price;return d(e,{key:"0dcf3a6106db0d03e2b4746a821295e200820f03"},d("button",{key:"11ffc873c2f2750d006a0cbe7a7552b7f763221a",type:"button",class:"s-order-edit-product-card",onClick:()=>this.handleSelectProduct()},d("div",{key:"58cef6bf3c6cbc0c07d4d6414da4692479165904",class:"s-order-edit-product-card-media"},c?.image?.url?d("img",{src:c.image.url,alt:c.image.alt||t,class:"s-order-edit-product-card-image"}):d("div",{class:"s-order-edit-product-card-placeholder"},d("i",{class:"sicon-shopping-bag"}))),d("div",{key:"77819d6bb5a63ae94c950c38e23d96b04c87b87c",class:"s-order-edit-product-card-content"},d("h3",{key:"714d714413577586a321d298ace38a8acac2e739",class:"s-order-edit-product-card-title"},t),null!=r&&d("p",{key:"96fe89acd8a62cc2014207d3466c85e625b83af9",class:"s-order-edit-product-card-price",innerHTML:salla.money(r)}))))}};r.style=":host{display:block;min-width:0}";export{r as salla_order_edit_product_card}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as r,F as t,H as o}from"./p-Ca7ApeqJ.js";const i=class{constructor(r){e(this,r)}parseOrderDetailsData(e){this.parsedOrderDetailsData=e,this.parsedOrderDetailsData="string"==typeof this.orderDetails?JSON.parse(e):e}componentWillLoad(){void 0!==this.orderDetails&&this.parseOrderDetailsData(this.orderDetails)}renderOrderDetailsContent(){return this.parsedOrderDetailsData?[this.parsedOrderDetailsData.options&&this.parsedOrderDetailsData.options.length>0&&r("salla-order-details-options",{options:this.parsedOrderDetailsData.options}),this.parsedOrderDetailsData.sub_products&&this.parsedOrderDetailsData.sub_products.length>0&&r(t,null,r("h2",{class:"s-order-details-bundle-title"},salla.lang.get("pages.orders.sub_products")),r("div",{class:"s-order-details-bundle-content"},this.parsedOrderDetailsData.sub_products.map((e=>r("salla-order-details-multiple-bundle-product",{key:e?.id,productDetails:e})))))]:null}render(){return r(o,{key:"da14fceaeeace760150ec91d58978b7e3b883356",class:"s-order-details-wrapper"},this.renderOrderDetailsContent())}static get watchers(){return{orderDetails:["parseOrderDetailsData"]}}};i.style='/*!twlt*/.s-order-details-multiple-bundle-product{display:flex;height:auto;width:100%;flex-direction:column;align-items:flex-start;justify-content:flex-start;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));outline:2px solid transparent;outline-offset:0px}.s-order-details-wrapper{display:block}.s-order-details-bundle-content{display:flex;flex-direction:column;gap:1rem;padding-top:1rem;padding-bottom:1rem}.s-order-details-bundle-title{margin-bottom:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-order-details-product{display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.s-order-details-product-content{min-width:0px}.s-order-details-product-info{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-product-image{display:flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-order-details-product-image img{height:100%;width:100%;object-fit:cover}.s-order-details-product-details{display:flex;min-width:0px;flex-grow:1;flex-direction:column;gap:0.25rem}.s-order-details-product-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));text-decoration-line:none}.s-order-details-product-name:hover{color:var(--color-primary)}.s-order-details-product-price{font-size:0.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-order-details-product-price-sale{--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-order-details-product-regular-price{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-order-details-product-quantity{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-order-details-options{margin-top:1rem}.s-order-details-option{display:flex;align-items:center;justify-content:space-between;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem}.s-order-details-option:last-child{border-bottom-width:0px}.s-order-details-option-name{font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-order-details-option-value{text-align:right;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-option-value:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-order-details-options-title{margin-top:1.25rem;margin-bottom:0.875rem;font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-order-details-options-container{margin-bottom:0.5rem;display:flow-root;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem}.s-order-details-options-container-borderless{margin-bottom:0.5rem;display:flow-root}.s-order-details-options-list>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse));--tw-divide-opacity:1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.s-order-details-options-list{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-order-details-options-item{display:flex;align-items:center;justify-content:space-between;padding-top:0.625rem;padding-bottom:0.625rem}.s-order-details-options-item-name{margin-bottom:0.5rem}@media (min-width: 768px){.s-order-details-options-item-name{margin-bottom:0px}}.s-order-details-options-item-value{font-weight:500}.s-order-details-options-item-value-image{font-weight:500;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-order-details-options-item-value-text{font-size:0.75rem;line-height:1rem;font-weight:500}.s-order-details-option-image-container{display:flex}.s-order-details-option-image-container>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.625rem * var(--tw-space-x-reverse));margin-left:calc(0.625rem * calc(1 - var(--tw-space-x-reverse)))}.s-order-details-option-image-container:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-order-details-option-image{height:1.5rem;width:1.5rem;border-radius:0.375rem;object-fit:cover}.s-order-details-option-color-swatch{display:inline-block;height:1.5rem;width:1.5rem;border-radius:9999px;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-order-details-option-color-swatch:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-order-details-option-color-swatch:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}.s-order-details-option-file-link{font-size:0.875rem;line-height:1.25rem;color:var(--color-primary);text-decoration-line:underline}.s-order-details-option-color-picker{display:flex;width:fit-content;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.s-order-details-option-color-picker-content{display:flex;align-items:center;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.s-order-details-option-color-picker-content:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px;padding-right:0.25rem}.s-order-details-option-color-picker-content:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px;padding-left:0.25rem}.s-order-details-option-color-picker-text{padding-left:0.25rem;padding-right:0.25rem;font-size:0.75rem;line-height:1rem}.s-order-details-option-color-picker-swatch{display:inline-block;height:1rem;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.25rem;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-order-details-option-color-picker-swatch:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-order-details-option-color-picker-swatch:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}.s-order-details-option-color-picker-button{padding-left:0.25rem;padding-right:0.25rem;padding-top:0.25rem}.s-order-details-option-color-picker-icon{pointer-events:none;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-option-map-button{font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-order-details-option-default-text{font-size:0.75rem;line-height:1rem}.s-order-details-option-color-copy-icon svg{height:1rem;width:1rem;fill:#6b7280}';export{i as salla_order_details}
4
+ import{r as e,h as r,F as t,H as o}from"./p-D-liptKs.js";const i=class{constructor(r){e(this,r)}parseOrderDetailsData(e){this.parsedOrderDetailsData=e,this.parsedOrderDetailsData="string"==typeof this.orderDetails?JSON.parse(e):e}componentWillLoad(){void 0!==this.orderDetails&&this.parseOrderDetailsData(this.orderDetails)}renderOrderDetailsContent(){return this.parsedOrderDetailsData?[this.parsedOrderDetailsData.options&&this.parsedOrderDetailsData.options.length>0&&r("salla-order-details-options",{options:this.parsedOrderDetailsData.options}),this.parsedOrderDetailsData.sub_products&&this.parsedOrderDetailsData.sub_products.length>0&&r(t,null,r("h2",{class:"s-order-details-bundle-title"},salla.lang.get("pages.orders.sub_products")),r("div",{class:"s-order-details-bundle-content"},this.parsedOrderDetailsData.sub_products.map((e=>r("salla-order-details-multiple-bundle-product",{key:e?.id,productDetails:e})))))]:null}render(){return r(o,{key:"da14fceaeeace760150ec91d58978b7e3b883356",class:"s-order-details-wrapper"},this.renderOrderDetailsContent())}static get watchers(){return{orderDetails:["parseOrderDetailsData"]}}};i.style='/*!twlt*/.s-order-details-multiple-bundle-product{display:flex;height:auto;width:100%;flex-direction:column;align-items:flex-start;justify-content:flex-start;border-radius:0.5rem;--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));outline:2px solid transparent;outline-offset:0px}.s-order-details-wrapper{display:block}.s-order-details-bundle-content{display:flex;flex-direction:column;gap:1rem;padding-top:1rem;padding-bottom:1rem}.s-order-details-bundle-title{margin-bottom:0.75rem;font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-order-details-product{display:flex;align-items:center;justify-content:space-between;gap:0.75rem}.s-order-details-product-content{min-width:0px}.s-order-details-product-info{display:flex;flex-wrap:wrap;align-items:center;gap:0.5rem;font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-product-image{display:flex;height:3.5rem;width:3.5rem;flex-shrink:0;align-items:center;justify-content:center;overflow:hidden;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.s-order-details-product-image img{height:100%;width:100%;object-fit:cover}.s-order-details-product-details{display:flex;min-width:0px;flex-grow:1;flex-direction:column;gap:0.25rem}.s-order-details-product-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1));text-decoration-line:none}.s-order-details-product-name:hover{color:var(--color-primary)}.s-order-details-product-price{font-size:0.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-order-details-product-price-sale{--tw-text-opacity:1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.s-order-details-product-regular-price{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1));text-decoration-line:line-through}.s-order-details-product-quantity{font-size:0.75rem;line-height:1rem;--tw-text-opacity:1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.s-order-details-options{margin-top:1rem}.s-order-details-option{display:flex;align-items:center;justify-content:space-between;border-bottom-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding-top:0.5rem;padding-bottom:0.5rem}.s-order-details-option:last-child{border-bottom-width:0px}.s-order-details-option-name{font-size:0.875rem;line-height:1.25rem;font-weight:500;--tw-text-opacity:1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.s-order-details-option-value{text-align:right;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-option-value:where([dir="rtl"],[dir="rtl"] *){text-align:left}.s-order-details-options-title{margin-top:1.25rem;margin-bottom:0.875rem;font-size:0.875rem;line-height:1.25rem;font-weight:700}.s-order-details-options-container{margin-bottom:0.5rem;display:flow-root;border-radius:0.375rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding-left:1rem;padding-right:1rem}.s-order-details-options-container-borderless{margin-bottom:0.5rem;display:flow-root}.s-order-details-options-list>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse));--tw-divide-opacity:1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.s-order-details-options-list{font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.s-order-details-options-item{display:flex;align-items:center;justify-content:space-between;padding-top:0.625rem;padding-bottom:0.625rem}.s-order-details-options-item-name{margin-bottom:0.5rem}@media (min-width: 768px){.s-order-details-options-item-name{margin-bottom:0px}}.s-order-details-options-item-value{font-weight:500}.s-order-details-options-item-value-image{font-weight:500;--tw-text-opacity:1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.s-order-details-options-item-value-text{font-size:0.75rem;line-height:1rem;font-weight:500}.s-order-details-option-image-container{display:flex}.s-order-details-option-image-container>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0.625rem * var(--tw-space-x-reverse));margin-left:calc(0.625rem * calc(1 - var(--tw-space-x-reverse)))}.s-order-details-option-image-container:where([dir="rtl"],[dir="rtl"] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.s-order-details-option-image{height:1.5rem;width:1.5rem;border-radius:0.375rem;object-fit:cover}.s-order-details-option-color-swatch{display:inline-block;height:1.5rem;width:1.5rem;border-radius:9999px;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-order-details-option-color-swatch:where([dir="ltr"],[dir="ltr"] *){margin-left:0.5rem}.s-order-details-option-color-swatch:where([dir="rtl"],[dir="rtl"] *){margin-right:0.5rem}.s-order-details-option-file-link{font-size:0.875rem;line-height:1.25rem;color:var(--color-primary);text-decoration-line:underline}.s-order-details-option-color-picker{display:flex;width:fit-content;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.s-order-details-option-color-picker-content{display:flex;align-items:center;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.s-order-details-option-color-picker-content:where([dir="ltr"],[dir="ltr"] *){border-right-width:1px;padding-right:0.25rem}.s-order-details-option-color-picker-content:where([dir="rtl"],[dir="rtl"] *){border-left-width:1px;padding-left:0.25rem}.s-order-details-option-color-picker-text{padding-left:0.25rem;padding-right:0.25rem;font-size:0.75rem;line-height:1rem}.s-order-details-option-color-picker-swatch{display:inline-block;height:1rem;border-radius:var(--s-radius, 0.25rem);border-width:1px;--tw-border-opacity:1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1));padding:0.25rem;--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-order-details-option-color-picker-swatch:where([dir="ltr"],[dir="ltr"] *){margin-left:0.25rem}.s-order-details-option-color-picker-swatch:where([dir="rtl"],[dir="rtl"] *){margin-right:0.25rem}.s-order-details-option-color-picker-button{padding-left:0.25rem;padding-right:0.25rem;padding-top:0.25rem}.s-order-details-option-color-picker-icon{pointer-events:none;font-size:0.875rem;line-height:1.25rem;--tw-text-opacity:1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.s-order-details-option-map-button{font-size:0.875rem;line-height:1.25rem;color:var(--color-primary)}.s-order-details-option-default-text{font-size:0.75rem;line-height:1rem}.s-order-details-option-color-copy-icon svg{height:1rem;width:1rem;fill:#6b7280}';export{i as salla_order_details}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as e,H as l,a as i}from"./p-Ca7ApeqJ.js";const s=class{constructor(e){t(this,e),this.methods=[],this.shouldRender=!1,this.productId=null}async componentWillLoad(){try{if(this.productId=this.host.dataset.productId||Salla.config.get("page.id"),await Salla.onReady(),await Salla.lang.onLoaded(),!this.productId)return;const t=await Salla.product.getDetails(this.productId,[]).catch((()=>null));this.setLabels(t?.data??{})}catch(t){Salla?.logger?.warn?.("salla-fulfillment-methods: init failed",t)}}setLabels(t){console.log("flags",t);const e=[];t?.supports_delivery&&e.push({id:"delivery",title:Salla.lang.getWithDefault("pages.products.promise_delivery_title","متاح للتوصيل"),subtitle:Salla.lang.getWithDefault("pages.products.promise_delivery_subtitle","طلبك يوصلك لباب البيت بسهولة."),iconClass:"sicon-location"}),t?.supports_pickup&&e.push({id:"pickup",title:Salla.lang.getWithDefault("pages.products.promise_pickup_title","متاح للاستلام"),subtitle:Salla.lang.getWithDefault("pages.products.promise_pickup_subtitle","استلام فوري من أقرب فرع."),iconClass:"sicon-store"}),this.methods=e,this.shouldRender=e.length>0}render(){return this.shouldRender?e(l,{class:"s-fulfillment-methods"},e("div",{class:"s-fulfillment-methods-list"},this.methods.map((t=>e("div",{key:t.id,class:"s-fulfillment-methods-card"},e("div",{class:"s-fulfillment-methods-content"},e("div",{class:"s-fulfillment-methods-icon-wrap"},e("i",{class:`${t.iconClass} s-fulfillment-methods-icon`})),e("div",{class:"s-fulfillment-methods-text"},e("span",{class:"s-fulfillment-methods-title"},t.title),e("span",{class:"s-fulfillment-methods-subtitle"},t.subtitle)))))))):null}get host(){return i(this)}};s.style='/*!twlt*/:host{display:block}.s-fulfillment-methods{font-family:inherit}.s-fulfillment-methods-list{display:flex;gap:16px;flex-wrap:wrap;margin-bottom:12px;margin-top:12px}:host-context([dir=rtl]) .s-fulfillment-methods-content{flex-direction:row-reverse}:host-context([dir=ltr]) .s-fulfillment-methods-content{flex-direction:row}.s-fulfillment-methods-card{flex:1;min-width:0;border:1px solid var(--color-border, #e5e7eb);border-radius:12px;padding:16px}.s-fulfillment-methods-content{display:flex;align-items:center;gap:12px}.s-fulfillment-methods-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.s-fulfillment-methods-title{font-weight:700;font-size:14px;line-height:1.3;color:var(--color-text-primary, #2b2d34)}.s-fulfillment-methods-subtitle{font-size:12px;line-height:1.4;color:var(--color-text-secondary, #6b7280)}.s-fulfillment-methods-icon-wrap{flex-shrink:0;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:var(--color-surface-secondary, #f3f4f6);border-radius:10px}.s-fulfillment-methods-icon{font-size:22px;color:var(--color-text-secondary, #6b7280);line-height:1}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-fulfillment-methods-list{margin-bottom:0.75rem;margin-top:0.75rem;display:flex;flex-wrap:wrap;gap:1rem}.s-fulfillment-methods-card{min-width:0px;flex:1 1 0%;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1rem}.s-fulfillment-methods-content{display:flex;flex-direction:row;align-items:center;gap:0.75rem}.s-fulfillment-methods-content:where([dir="rtl"],[dir="rtl"] *){flex-direction:row-reverse}.s-fulfillment-methods-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.25rem}.s-fulfillment-methods-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;line-height:1.375;color:var(--color-text-primary,#2b2d34)}.s-fulfillment-methods-subtitle{font-size:0.75rem;line-height:1rem;line-height:1.4;color:var(--color-text-secondary,#6b7280)}.s-fulfillment-methods-icon-wrap{display:flex;height:2.75rem;width:2.75rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:10px;background-color:var(--color-surface-secondary,#f3f4f6)}.s-fulfillment-methods-icon{font-size:22px;line-height:1;color:var(--color-text-secondary,#6b7280)}';export{s as salla_fulfillment_methods}
4
+ import{r as t,h as e,H as l,a as i}from"./p-D-liptKs.js";const s=class{constructor(e){t(this,e),this.methods=[],this.shouldRender=!1,this.productId=null}async componentWillLoad(){try{if(this.productId=this.host.dataset.productId||Salla.config.get("page.id"),await Salla.onReady(),await Salla.lang.onLoaded(),!this.productId)return;const t=await Salla.product.getDetails(this.productId,[]).catch((()=>null));this.setLabels(t?.data??{})}catch(t){Salla?.logger?.warn?.("salla-fulfillment-methods: init failed",t)}}setLabels(t){console.log("flags",t);const e=[];t?.supports_delivery&&e.push({id:"delivery",title:Salla.lang.getWithDefault("pages.products.promise_delivery_title","متاح للتوصيل"),subtitle:Salla.lang.getWithDefault("pages.products.promise_delivery_subtitle","طلبك يوصلك لباب البيت بسهولة."),iconClass:"sicon-location"}),t?.supports_pickup&&e.push({id:"pickup",title:Salla.lang.getWithDefault("pages.products.promise_pickup_title","متاح للاستلام"),subtitle:Salla.lang.getWithDefault("pages.products.promise_pickup_subtitle","استلام فوري من أقرب فرع."),iconClass:"sicon-store"}),this.methods=e,this.shouldRender=e.length>0}render(){return this.shouldRender?e(l,{class:"s-fulfillment-methods"},e("div",{class:"s-fulfillment-methods-list"},this.methods.map((t=>e("div",{key:t.id,class:"s-fulfillment-methods-card"},e("div",{class:"s-fulfillment-methods-content"},e("div",{class:"s-fulfillment-methods-icon-wrap"},e("i",{class:`${t.iconClass} s-fulfillment-methods-icon`})),e("div",{class:"s-fulfillment-methods-text"},e("span",{class:"s-fulfillment-methods-title"},t.title),e("span",{class:"s-fulfillment-methods-subtitle"},t.subtitle)))))))):null}get host(){return i(this)}};s.style='/*!twlt*/:host{display:block}.s-fulfillment-methods{font-family:inherit}.s-fulfillment-methods-list{display:flex;gap:16px;flex-wrap:wrap;margin-bottom:12px;margin-top:12px}:host-context([dir=rtl]) .s-fulfillment-methods-content{flex-direction:row-reverse}:host-context([dir=ltr]) .s-fulfillment-methods-content{flex-direction:row}.s-fulfillment-methods-card{flex:1;min-width:0;border:1px solid var(--color-border, #e5e7eb);border-radius:12px;padding:16px}.s-fulfillment-methods-content{display:flex;align-items:center;gap:12px}.s-fulfillment-methods-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.s-fulfillment-methods-title{font-weight:700;font-size:14px;line-height:1.3;color:var(--color-text-primary, #2b2d34)}.s-fulfillment-methods-subtitle{font-size:12px;line-height:1.4;color:var(--color-text-secondary, #6b7280)}.s-fulfillment-methods-icon-wrap{flex-shrink:0;width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:var(--color-surface-secondary, #f3f4f6);border-radius:10px}.s-fulfillment-methods-icon{font-size:22px;color:var(--color-text-secondary, #6b7280);line-height:1}.hidden{display:none}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.s-fulfillment-methods-list{margin-bottom:0.75rem;margin-top:0.75rem;display:flex;flex-wrap:wrap;gap:1rem}.s-fulfillment-methods-card{min-width:0px;flex:1 1 0%;border-radius:0.75rem;border-width:1px;--tw-border-opacity:1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1));padding:1rem}.s-fulfillment-methods-content{display:flex;flex-direction:row;align-items:center;gap:0.75rem}.s-fulfillment-methods-content:where([dir="rtl"],[dir="rtl"] *){flex-direction:row-reverse}.s-fulfillment-methods-text{display:flex;min-width:0px;flex:1 1 0%;flex-direction:column;gap:0.25rem}.s-fulfillment-methods-title{font-size:0.875rem;line-height:1.25rem;font-weight:700;line-height:1.375;color:var(--color-text-primary,#2b2d34)}.s-fulfillment-methods-subtitle{font-size:0.75rem;line-height:1rem;line-height:1.4;color:var(--color-text-secondary,#6b7280)}.s-fulfillment-methods-icon-wrap{display:flex;height:2.75rem;width:2.75rem;flex-shrink:0;align-items:center;justify-content:center;border-radius:10px;background-color:var(--color-surface-secondary,#f3f4f6)}.s-fulfillment-methods-icon{font-size:22px;line-height:1;color:var(--color-text-secondary,#6b7280)}';export{s as salla_fulfillment_methods}