@salla.sa/twilight-components 2.14.550 → 2.14.551

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 (316) hide show
  1. package/dist/cjs/{filepond-B-8syvXC.js → filepond-C99K1KEB.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DxfU_d7d.js → filepond-plugin-file-poster-CggRjTNg.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-C0XIW0bl.js → filepond-plugin-file-validate-size-B009kdAV.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-BHyBHLOg.js → filepond-plugin-file-validate-type-DZs9-bai.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-Dnni9gl-.js → filepond-plugin-image-edit-DNNheErX.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-C7pHXy9M.js → filepond-plugin-image-exif-orientation-ChN0IpOy.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CFttWV9E.js → filepond-plugin-image-preview-BZo2ftGo.js} +1 -1
  8. package/dist/cjs/{index-CHvvKGJc.js → index-0JUvtl0d.js} +2 -2
  9. package/dist/cjs/{intlTelInput--yv-lZaU.js → intlTelInput-D84-rI5D.js} +1 -1
  10. package/dist/cjs/loader.cjs.js +1 -1
  11. package/dist/cjs/salla-accordion-body_2.cjs.entry.js +1 -1
  12. package/dist/cjs/salla-accordion_6.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-add-product-button_5.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-alert_2.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-applied-filters.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-attachment-view_9.cjs.entry.js +10 -10
  20. package/dist/cjs/salla-badge.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-basket-gap.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-bullet-delivery_2.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-cart-coupons.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-cart-item-offers_2.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-cart-summary-card.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-cashback-banner.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-comment-factors.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-comment-form_9.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-cookies-bar.cjs.entry.js +1 -1
  32. package/dist/cjs/salla-count-down.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-custom-fields.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-delivery-promise.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-edit-order-button.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-fulfillment-methods.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-gifting.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-hook.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-list-tile.cjs.entry.js +1 -1
  44. package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
  45. package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
  46. package/dist/cjs/salla-loyalty-banner_10.cjs.entry.js +1 -1
  47. package/dist/cjs/salla-loyalty-exchange-product-card.cjs.entry.js +1 -1
  48. package/dist/cjs/salla-loyalty-points-banner.cjs.entry.js +1 -1
  49. package/dist/cjs/salla-loyalty-points-history.cjs.entry.js +1 -1
  50. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  51. package/dist/cjs/salla-loyalty.cjs.entry.js +1 -1
  52. package/dist/cjs/salla-maintenance-alert.cjs.entry.js +1 -1
  53. package/dist/cjs/salla-map_2.cjs.entry.js +1 -1
  54. package/dist/cjs/salla-menu.cjs.entry.js +1 -1
  55. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  56. package/dist/cjs/salla-multiple-bundle-product-cart_2.cjs.entry.js +1 -1
  57. package/dist/cjs/salla-multiple-bundle-product-options-modal_2.cjs.entry.js +1 -1
  58. package/dist/cjs/salla-multiple-bundle-product.cjs.entry.js +1 -1
  59. package/dist/cjs/salla-next-order-coupon.cjs.entry.js +1 -1
  60. package/dist/cjs/salla-notification-item_2.cjs.entry.js +1 -1
  61. package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
  62. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  63. package/dist/cjs/salla-order-branch.cjs.entry.js +1 -1
  64. package/dist/cjs/salla-order-cancel.cjs.entry.js +1 -1
  65. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  66. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  67. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  68. package/dist/cjs/salla-order-edit-item.cjs.entry.js +1 -1
  69. package/dist/cjs/salla-order-edit-product-card.cjs.entry.js +1 -1
  70. package/dist/cjs/salla-order-edit.cjs.entry.js +1 -1
  71. package/dist/cjs/salla-order-options-modal_2.cjs.entry.js +1 -1
  72. package/dist/cjs/salla-order-shipments.cjs.entry.js +1 -1
  73. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  74. package/dist/cjs/salla-order-totals-card.cjs.entry.js +1 -1
  75. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  76. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  77. package/dist/cjs/salla-placeholder.cjs.entry.js +1 -1
  78. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  79. package/dist/cjs/salla-product-card-embed.cjs.entry.js +1 -1
  80. package/dist/cjs/salla-product-size-guide.cjs.entry.js +1 -1
  81. package/dist/cjs/salla-products-list.cjs.entry.js +1 -1
  82. package/dist/cjs/salla-products-slider.cjs.entry.js +1 -1
  83. package/dist/cjs/salla-quick-order.cjs.entry.js +1 -1
  84. package/dist/cjs/salla-rating-modal-v2.cjs.entry.js +1 -1
  85. package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
  86. package/dist/cjs/salla-review-factors-tags.cjs.entry.js +1 -1
  87. package/dist/cjs/salla-review-order-item.cjs.entry.js +1 -1
  88. package/dist/cjs/salla-scopes.cjs.entry.js +1 -1
  89. package/dist/cjs/salla-search.cjs.entry.js +1 -1
  90. package/dist/cjs/salla-skeleton.cjs.entry.js +1 -1
  91. package/dist/cjs/salla-slider.cjs.entry.js +1 -1
  92. package/dist/cjs/salla-social-share.cjs.entry.js +1 -1
  93. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  94. package/dist/cjs/salla-tab-content_3.cjs.entry.js +1 -1
  95. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  96. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  97. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  98. package/dist/cjs/salla-user-menu.cjs.entry.js +1 -1
  99. package/dist/cjs/salla-user-profile.cjs.entry.js +1 -1
  100. package/dist/cjs/salla-user-settings.cjs.entry.js +1 -1
  101. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  102. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  103. package/dist/cjs/salla-wishlist-actions.cjs.entry.js +1 -1
  104. package/dist/cjs/twilight.cjs.js +1 -1
  105. package/dist/cjs/{vanilla-picker-D-X0hQ7w.js → vanilla-picker-D8r5xyK7.js} +1 -1
  106. package/dist/components/index.js +2 -2
  107. package/dist/esm/{filepond-rGVsy4ep.js → filepond-DuMUHI7t.js} +1 -1
  108. package/dist/esm/{filepond-plugin-file-poster-bfSOezL4.js → filepond-plugin-file-poster-Dv25V2UU.js} +1 -1
  109. package/dist/esm/{filepond-plugin-file-validate-size-DagZiT3e.js → filepond-plugin-file-validate-size-Dxl4yPm6.js} +1 -1
  110. package/dist/esm/{filepond-plugin-file-validate-type-Cf4JwDq-.js → filepond-plugin-file-validate-type-C602myuq.js} +1 -1
  111. package/dist/esm/{filepond-plugin-image-edit-DWZ8nbdr.js → filepond-plugin-image-edit-DLd3ht_R.js} +1 -1
  112. package/dist/esm/{filepond-plugin-image-exif-orientation-NHp2unXf.js → filepond-plugin-image-exif-orientation-BaQ5DNLu.js} +1 -1
  113. package/dist/esm/{filepond-plugin-image-preview-BSi_AIFs.js → filepond-plugin-image-preview-C-RFNs7l.js} +1 -1
  114. package/dist/esm/{index-Bf2Z6A1M.js → index-BsIeN-bg.js} +2 -2
  115. package/dist/esm/{intlTelInput-DLtsxnoY.js → intlTelInput-Cf6zBu5Y.js} +1 -1
  116. package/dist/esm/loader.js +2 -2
  117. package/dist/esm/salla-accordion-body_2.entry.js +1 -1
  118. package/dist/esm/salla-accordion_6.entry.js +1 -1
  119. package/dist/esm/salla-add-product-button_5.entry.js +1 -1
  120. package/dist/esm/salla-advertisement.entry.js +1 -1
  121. package/dist/esm/salla-alert_2.entry.js +1 -1
  122. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  123. package/dist/esm/salla-applied-filters.entry.js +1 -1
  124. package/dist/esm/salla-apps-icons.entry.js +1 -1
  125. package/dist/esm/salla-attachment-view_9.entry.js +10 -10
  126. package/dist/esm/salla-badge.entry.js +1 -1
  127. package/dist/esm/salla-basket-gap.entry.js +1 -1
  128. package/dist/esm/salla-bullet-delivery_2.entry.js +1 -1
  129. package/dist/esm/salla-cart-coupons.entry.js +1 -1
  130. package/dist/esm/salla-cart-item-offers_2.entry.js +1 -1
  131. package/dist/esm/salla-cart-summary-card.entry.js +1 -1
  132. package/dist/esm/salla-cashback-banner.entry.js +1 -1
  133. package/dist/esm/salla-comment-factors.entry.js +1 -1
  134. package/dist/esm/salla-comment-form_9.entry.js +1 -1
  135. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  136. package/dist/esm/salla-contacts.entry.js +1 -1
  137. package/dist/esm/salla-cookies-bar.entry.js +1 -1
  138. package/dist/esm/salla-count-down.entry.js +1 -1
  139. package/dist/esm/salla-custom-fields.entry.js +1 -1
  140. package/dist/esm/salla-delivery-promise.entry.js +1 -1
  141. package/dist/esm/salla-edit-order-button.entry.js +1 -1
  142. package/dist/esm/salla-filters-widget.entry.js +1 -1
  143. package/dist/esm/salla-filters.entry.js +1 -1
  144. package/dist/esm/salla-fulfillment-methods.entry.js +1 -1
  145. package/dist/esm/salla-gifting.entry.js +1 -1
  146. package/dist/esm/salla-hook.entry.js +1 -1
  147. package/dist/esm/salla-infinite-scroll.entry.js +1 -1
  148. package/dist/esm/salla-installment.entry.js +1 -1
  149. package/dist/esm/salla-list-tile.entry.js +1 -1
  150. package/dist/esm/salla-localization-modal.entry.js +1 -1
  151. package/dist/esm/salla-login-modal.entry.js +1 -1
  152. package/dist/esm/salla-loyalty-banner_10.entry.js +1 -1
  153. package/dist/esm/salla-loyalty-exchange-product-card.entry.js +1 -1
  154. package/dist/esm/salla-loyalty-points-banner.entry.js +1 -1
  155. package/dist/esm/salla-loyalty-points-history.entry.js +1 -1
  156. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  157. package/dist/esm/salla-loyalty.entry.js +1 -1
  158. package/dist/esm/salla-maintenance-alert.entry.js +1 -1
  159. package/dist/esm/salla-map_2.entry.js +1 -1
  160. package/dist/esm/salla-menu.entry.js +1 -1
  161. package/dist/esm/salla-metadata.entry.js +1 -1
  162. package/dist/esm/salla-multiple-bundle-product-cart_2.entry.js +1 -1
  163. package/dist/esm/salla-multiple-bundle-product-options-modal_2.entry.js +1 -1
  164. package/dist/esm/salla-multiple-bundle-product.entry.js +1 -1
  165. package/dist/esm/salla-next-order-coupon.entry.js +1 -1
  166. package/dist/esm/salla-notification-item_2.entry.js +1 -1
  167. package/dist/esm/salla-offer-modal.entry.js +1 -1
  168. package/dist/esm/salla-offer.entry.js +1 -1
  169. package/dist/esm/salla-order-branch.entry.js +1 -1
  170. package/dist/esm/salla-order-cancel.entry.js +1 -1
  171. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  172. package/dist/esm/salla-order-details-options.entry.js +1 -1
  173. package/dist/esm/salla-order-details.entry.js +1 -1
  174. package/dist/esm/salla-order-edit-item.entry.js +1 -1
  175. package/dist/esm/salla-order-edit-product-card.entry.js +1 -1
  176. package/dist/esm/salla-order-edit.entry.js +1 -1
  177. package/dist/esm/salla-order-options-modal_2.entry.js +1 -1
  178. package/dist/esm/salla-order-shipments.entry.js +1 -1
  179. package/dist/esm/salla-order-summary.entry.js +1 -1
  180. package/dist/esm/salla-order-totals-card.entry.js +1 -1
  181. package/dist/esm/salla-orders.entry.js +1 -1
  182. package/dist/esm/salla-payments.entry.js +1 -1
  183. package/dist/esm/salla-placeholder.entry.js +1 -1
  184. package/dist/esm/salla-price-range.entry.js +1 -1
  185. package/dist/esm/salla-product-card-embed.entry.js +1 -1
  186. package/dist/esm/salla-product-size-guide.entry.js +1 -1
  187. package/dist/esm/salla-products-list.entry.js +1 -1
  188. package/dist/esm/salla-products-slider.entry.js +1 -1
  189. package/dist/esm/salla-quick-order.entry.js +1 -1
  190. package/dist/esm/salla-rating-modal-v2.entry.js +1 -1
  191. package/dist/esm/salla-rating-modal.entry.js +1 -1
  192. package/dist/esm/salla-review-factors-tags.entry.js +1 -1
  193. package/dist/esm/salla-review-order-item.entry.js +1 -1
  194. package/dist/esm/salla-scopes.entry.js +1 -1
  195. package/dist/esm/salla-search.entry.js +1 -1
  196. package/dist/esm/salla-skeleton.entry.js +1 -1
  197. package/dist/esm/salla-slider.entry.js +1 -1
  198. package/dist/esm/salla-social-share.entry.js +1 -1
  199. package/dist/esm/salla-social.entry.js +1 -1
  200. package/dist/esm/salla-tab-content_3.entry.js +1 -1
  201. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  202. package/dist/esm/salla-tooltip.entry.js +1 -1
  203. package/dist/esm/salla-trust-badges.entry.js +1 -1
  204. package/dist/esm/salla-user-menu.entry.js +1 -1
  205. package/dist/esm/salla-user-profile.entry.js +1 -1
  206. package/dist/esm/salla-user-settings.entry.js +1 -1
  207. package/dist/esm/salla-verify.entry.js +1 -1
  208. package/dist/esm/salla-wallet.entry.js +1 -1
  209. package/dist/esm/salla-wishlist-actions.entry.js +1 -1
  210. package/dist/esm/twilight.js +2 -2
  211. package/dist/esm/{vanilla-picker-AjTapsL5.js → vanilla-picker-S7qZ7YZm.js} +1 -1
  212. package/dist/twilight/{p-4d3e018b.entry.js → p-01406425.entry.js} +1 -1
  213. package/dist/twilight/{p-B59qdBmY.js → p-035DwuUC.js} +1 -1
  214. package/dist/twilight/{p-2607ac8e.entry.js → p-07adeb89.entry.js} +1 -1
  215. package/dist/twilight/{p-d2c204f4.entry.js → p-0944d367.entry.js} +1 -1
  216. package/dist/twilight/{p-277f3a46.entry.js → p-0a332226.entry.js} +1 -1
  217. package/dist/twilight/{p-be95b40b.entry.js → p-0e3d72ab.entry.js} +1 -1
  218. package/dist/twilight/{p-9cbc4733.entry.js → p-1118bee2.entry.js} +1 -1
  219. package/dist/twilight/{p-ebb73bcc.entry.js → p-13c4b450.entry.js} +1 -1
  220. package/dist/twilight/{p-b19102f6.entry.js → p-18639885.entry.js} +1 -1
  221. package/dist/twilight/{p-6e78cc02.entry.js → p-18a604c5.entry.js} +1 -1
  222. package/dist/twilight/{p-95a3b9b9.entry.js → p-1abe8321.entry.js} +1 -1
  223. package/dist/twilight/{p-a3eb15e4.entry.js → p-1bf18c56.entry.js} +1 -1
  224. package/dist/twilight/{p-fc587040.entry.js → p-211324e6.entry.js} +1 -1
  225. package/dist/twilight/{p-9ee1e01c.entry.js → p-22cb8a9c.entry.js} +1 -1
  226. package/dist/twilight/{p-1c662f1d.entry.js → p-2331e63a.entry.js} +1 -1
  227. package/dist/twilight/{p-f2e5f1fd.entry.js → p-27456209.entry.js} +1 -1
  228. package/dist/twilight/{p-9e702ebb.entry.js → p-2a3d30d1.entry.js} +1 -1
  229. package/dist/twilight/{p-c56725b9.entry.js → p-2a683382.entry.js} +1 -1
  230. package/dist/twilight/{p-cf21323d.entry.js → p-2bef08e8.entry.js} +1 -1
  231. package/dist/twilight/{p-0ccba871.entry.js → p-2c48bb97.entry.js} +1 -1
  232. package/dist/twilight/{p-0739e769.entry.js → p-2df31e90.entry.js} +1 -1
  233. package/dist/twilight/{p-03db1fe6.entry.js → p-2ff7bb22.entry.js} +1 -1
  234. package/dist/twilight/{p-4f1102f8.entry.js → p-357b5593.entry.js} +1 -1
  235. package/dist/twilight/{p-27396f6f.entry.js → p-3aa6fa7d.entry.js} +1 -1
  236. package/dist/twilight/{p-57b7cd9f.entry.js → p-3c2cc4fe.entry.js} +1 -1
  237. package/dist/twilight/{p-434f3557.entry.js → p-3fb485a6.entry.js} +1 -1
  238. package/dist/twilight/{p-581eeaf8.entry.js → p-43f8f33b.entry.js} +1 -1
  239. package/dist/twilight/{p-5383a324.entry.js → p-47713dd1.entry.js} +1 -1
  240. package/dist/twilight/{p-b452c8a0.entry.js → p-49738042.entry.js} +1 -1
  241. package/dist/twilight/{p-b603a180.entry.js → p-49f9e536.entry.js} +1 -1
  242. package/dist/twilight/{p-b2380c6b.entry.js → p-4ef06a6f.entry.js} +1 -1
  243. package/dist/twilight/{p-e8a1c501.entry.js → p-501c0798.entry.js} +1 -1
  244. package/dist/twilight/{p-12d74e96.entry.js → p-523572e9.entry.js} +1 -1
  245. package/dist/twilight/{p-649ced48.entry.js → p-54974d98.entry.js} +1 -1
  246. package/dist/twilight/{p-0dc61077.entry.js → p-56845467.entry.js} +1 -1
  247. package/dist/twilight/{p-bc595ee3.entry.js → p-569c6d6c.entry.js} +1 -1
  248. package/dist/twilight/{p-cfbf287b.entry.js → p-56f164bb.entry.js} +1 -1
  249. package/dist/twilight/{p-8e0bdbbc.entry.js → p-5918dd8d.entry.js} +1 -1
  250. package/dist/twilight/{p-13fb9b74.entry.js → p-5ba2eb55.entry.js} +1 -1
  251. package/dist/twilight/{p-7b6fa77f.entry.js → p-5cd4b67f.entry.js} +1 -1
  252. package/dist/twilight/{p-a8d6804c.entry.js → p-5dfd449d.entry.js} +1 -1
  253. package/dist/twilight/{p-c31b966f.entry.js → p-683db553.entry.js} +1 -1
  254. package/dist/twilight/{p-97136699.entry.js → p-68d754be.entry.js} +1 -1
  255. package/dist/twilight/{p-44ee3af8.entry.js → p-6a746b8a.entry.js} +1 -1
  256. package/dist/twilight/{p-4df5f9a0.entry.js → p-6c5a1ded.entry.js} +1 -1
  257. package/dist/twilight/{p-2c212d54.entry.js → p-6d787fa0.entry.js} +1 -1
  258. package/dist/twilight/{p-33842645.entry.js → p-6edd1008.entry.js} +1 -1
  259. package/dist/twilight/{p-17c30aa6.entry.js → p-6f3516a1.entry.js} +1 -1
  260. package/dist/twilight/{p-7e9d98c3.entry.js → p-6f58ac6a.entry.js} +1 -1
  261. package/dist/twilight/{p-b017b72e.entry.js → p-704553fb.entry.js} +1 -1
  262. package/dist/twilight/{p-efa79191.entry.js → p-709c2184.entry.js} +1 -1
  263. package/dist/twilight/{p-7e101885.entry.js → p-83a5b8a4.entry.js} +1 -1
  264. package/dist/twilight/{p-f1322c8e.entry.js → p-847cdd79.entry.js} +1 -1
  265. package/dist/twilight/{p-2f2771de.entry.js → p-84cffb13.entry.js} +1 -1
  266. package/dist/twilight/{p-3a4160c2.entry.js → p-869fe4c0.entry.js} +1 -1
  267. package/dist/twilight/{p-69d75b45.entry.js → p-8711224a.entry.js} +1 -1
  268. package/dist/twilight/{p-9f1d1b76.entry.js → p-8ebb86ce.entry.js} +1 -1
  269. package/dist/twilight/{p-d2556680.entry.js → p-9025e5d9.entry.js} +1 -1
  270. package/dist/twilight/{p-bded58cb.entry.js → p-906b36e3.entry.js} +1 -1
  271. package/dist/twilight/{p-c818e0eb.entry.js → p-90f29c99.entry.js} +1 -1
  272. package/dist/twilight/{p-8838ad5c.entry.js → p-9dd126e2.entry.js} +1 -1
  273. package/dist/twilight/{p-e54cc4f8.entry.js → p-9f431f78.entry.js} +1 -1
  274. package/dist/twilight/{p-34240222.entry.js → p-9fdbe8a0.entry.js} +1 -1
  275. package/dist/twilight/{p-CMQ7Gxqu.js → p-B3oo4tIx.js} +1 -1
  276. package/dist/twilight/{p-DfIHi_xi.js → p-BRZVMxhy.js} +1 -1
  277. package/dist/twilight/{p-Bf2Z6A1M.js → p-BsIeN-bg.js} +1 -1
  278. package/dist/twilight/{p-uOF6Cufg.js → p-CPiqlSTo.js} +1 -1
  279. package/dist/twilight/{p-B-Q5WD6p.js → p-CaCiueRc.js} +1 -1
  280. package/dist/twilight/{p-BdsgfewR.js → p-DNS31w5e.js} +1 -1
  281. package/dist/twilight/{p-BlDax_46.js → p-DeX830vG.js} +1 -1
  282. package/dist/twilight/{p-c0c561b9.entry.js → p-a01f64e7.entry.js} +1 -1
  283. package/dist/twilight/{p-785cee9b.entry.js → p-a037e47d.entry.js} +1 -1
  284. package/dist/twilight/{p-d65a6462.entry.js → p-a0ed97f5.entry.js} +1 -1
  285. package/dist/twilight/{p-c24f6325.entry.js → p-a30390a7.entry.js} +1 -1
  286. package/dist/twilight/{p-aa71f393.entry.js → p-a344db00.entry.js} +1 -1
  287. package/dist/twilight/{p-d63ca8bb.entry.js → p-a3579980.entry.js} +1 -1
  288. package/dist/twilight/{p-a818352a.entry.js → p-a46a9d28.entry.js} +1 -1
  289. package/dist/twilight/{p-dfaf0617.entry.js → p-a64771f7.entry.js} +1 -1
  290. package/dist/twilight/{p-e284728d.entry.js → p-a8316527.entry.js} +1 -1
  291. package/dist/twilight/{p-5256180e.entry.js → p-a9ef3c52.entry.js} +1 -1
  292. package/dist/twilight/{p-5a4f7313.entry.js → p-aa8962f8.entry.js} +1 -1
  293. package/dist/twilight/{p-b7b4231f.entry.js → p-aa91a230.entry.js} +1 -1
  294. package/dist/twilight/{p-cd51e722.entry.js → p-af348a67.entry.js} +1 -1
  295. package/dist/twilight/{p-38b4dfa9.entry.js → p-b1e0bc90.entry.js} +1 -1
  296. package/dist/twilight/{p-bd3fef37.entry.js → p-b238c74b.entry.js} +1 -1
  297. package/dist/twilight/{p-8cf65dbf.entry.js → p-b5a2342c.entry.js} +1 -1
  298. package/dist/twilight/{p-0fb44a3c.entry.js → p-be0ac755.entry.js} +1 -1
  299. package/dist/twilight/{p-9fdb6380.entry.js → p-cdba9d35.entry.js} +1 -1
  300. package/dist/twilight/{p-1653256e.entry.js → p-d5215891.entry.js} +1 -1
  301. package/dist/twilight/{p-f586c239.entry.js → p-e3e2baa2.entry.js} +1 -1
  302. package/dist/twilight/{p-3615a99b.entry.js → p-e875f53e.entry.js} +1 -1
  303. package/dist/twilight/{p-018456c8.entry.js → p-ea968ba3.entry.js} +1 -1
  304. package/dist/twilight/{p-0e12c9ca.entry.js → p-eb3a095b.entry.js} +1 -1
  305. package/dist/twilight/{p-9ae3a15c.entry.js → p-ebc6ba28.entry.js} +1 -1
  306. package/dist/twilight/{p-09c1d9c8.entry.js → p-ecdbd18f.entry.js} +1 -1
  307. package/dist/twilight/{p-3627d945.entry.js → p-ef145c1e.entry.js} +1 -1
  308. package/dist/twilight/{p-0d199866.entry.js → p-efe6493f.entry.js} +1 -1
  309. package/dist/twilight/{p-e8b220e1.entry.js → p-f037e508.entry.js} +1 -1
  310. package/dist/twilight/{p-0da8a64f.entry.js → p-f4f355e5.entry.js} +1 -1
  311. package/dist/twilight/{p-cfac0aa1.entry.js → p-fed3efba.entry.js} +1 -1
  312. package/dist/twilight/{p-0c4c4419.entry.js → p-ff37c2af.entry.js} +1 -1
  313. package/dist/twilight/{p-CG1Rwy3q.js → p-mgSPapOV.js} +1 -1
  314. package/dist/twilight/{p-CPqpCDCi.js → p-wqmCmzsY.js} +1 -1
  315. package/dist/twilight/twilight.esm.js +1 -1
  316. package/package.json +5 -5
@@ -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 l,F as i}from"./p-Bf2Z6A1M.js";const n=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const i=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>i?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"78be7c4a3be811adb01cb1437473fcd9f1c17b41",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"9b0439dffc9a2dd8d31f56dacb5d835cde903e71",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const i={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(i)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};n.style="";const c=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{const s=e.id,l=this.selectedProducts[t]?.has(s)??!1,i=this.sections.find((e=>e.id==t));if(!(l&&i&&this.isProductSelectionLocked(i))){if(!l){if(!i)return;if(1!==this.getEffectiveMax(i)&&this.isAtSelectionLimit(i))return}this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])},l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):1===this.getEffectiveMax(i)?this.syncSectionSelection(t,s):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})}},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;if(this.selectedProducts[t].has(s))return;const l=this.sections.find((e=>e.id==t));if(!l)return;const i=this.getEffectiveMax(l);if(1===i)this.syncSectionSelection(t,s);else{if(i>1&&this.isAtSelectionLimit(l))return;this.selectedProducts[t].add(s)}this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options})},this.onSelectProductOptions=(t,e)=>{const s=this.sections.find((t=>t.id==e));if(!s||!this.canSelectProductInSection(s,t.id))return;const l=this.sections.findIndex((t=>t.id==e)),i=s.products?.findIndex((e=>e.id==t.id))??0,n=this.selectedProducts[e]?.has(t.id)??!1;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:l,productIndex:i,isProductAlreadySelected:n})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}isSingleProductSection(t){return 1===(t.products?.length??0)}getObligatoryMin(t){const e=t.obligatory_products;if(null==e)return 0;const s=Number(e);return Number.isNaN(s)?0:s}isProductSelectionLocked(t){return this.isSingleProductSection(t)&&1===this.getObligatoryMin(t)}getEffectiveMax(t){const e=t.products?.length??0,s=t.max_obligatory_products;return null!=s&&s>0?Math.min(s,e):e}getSelectedCount(t){return this.selectedProducts[t]?.size??0}isAtSelectionLimit(t){return this.getSelectedCount(t.id)>=this.getEffectiveMax(t)}canSelectProductInSection(t,e){return!!this.selectedProducts[t.id]?.has(e)||1===this.getEffectiveMax(t)||!this.isAtSelectionLimit(t)}async canSelectBundleProduct(t,e){const s=this.sections.find((e=>e.id==t));return!!s&&this.canSelectProductInSection(s,e)}queryProductCheckbox(t,e){const s=`input.s-multiple-bundle-product-checkbox[name="bundle[${t}][${e}][id]"]`,l=this.host.closest("form"),i=l?.querySelector(s);if(i)return i;for(const t of this.host.querySelectorAll("salla-multiple-bundle-product-slider")){const e=(t.shadowRoot??t).querySelector(s);if(e)return e}return null}dispatchBubblingChange(t){requestAnimationFrame((()=>{t.dispatchEvent(new window.Event("change",{bubbles:!0}))}))}clearSectionProductSlot(t,e,s){const l=this.queryProductCheckbox(t,s);l&&(l.checked=!1);const i=this.host.closest("form");if(i){const e=`bundle[${t}][${s}]`;Array.from(i.querySelectorAll("input")).forEach((t=>{t.name?.startsWith(e)&&("checkbox"===t.type&&t.name?.endsWith("][id]")?t.checked=!1:t.remove())}))}this.clearProductModalOptions(e,t)}syncSectionSelection(t,e){const s=this.sections.find((e=>e.id==t));s?.products?.forEach(((s,l)=>{s.id!=e&&this.clearSectionProductSlot(t,s.id,l)})),this.selectedProducts[t]=new Set([e]);const l=s?.products?.findIndex((t=>t.id==e))??-1,i=l>=0?this.queryProductCheckbox(t,l):null;i&&(i.checked=!0,this.dispatchBubblingChange(i))}autoSelectSingleProductSections(){if(!this.sections?.length)return;const t={...this.selectedProducts};let e=!1;const s=[];for(const l of this.sections){if(!this.isProductSelectionLocked(l))continue;const i=l.products?.[0];if(!i||!i.unlimited_quantity&&(i.quantity??0)<=0)continue;const n=l.id,c=new Set(t[n]||[]);c.has(i.id)||(c.add(i.id),t[n]=c,e=!0,s.push({product:i}))}e&&(this.selectedProducts=t,s.forEach((({product:t})=>{salla.event.dispatch("on-bundle-product-selected",{id:t.id,name:t.name,options:t.options})})))}clearProductFormData(t,e){if(null!=e){const s=this.sections.find((t=>t.id==e)),l=s?.products?.findIndex((e=>e.id==t))??-1;if(l>=0)return void this.clearSectionProductSlot(e,t,l)}const s=this.host.closest("form");s&&s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}getProgressStatus(t){const e=this.getSelectedCount(t.id),s=this.getEffectiveMax(t);return s>0?`${e}/${s}`:"0"}getSectionSelectionNote(t){const e=this.getObligatoryMin(t),s=Number(t.max_obligatory_products)||0,l=e>0,i=s>0;return l||i?l&&i?e===s?salla.lang.getWithDefault("pages.products.bundle_select_exact",`اختر ${e} منتجات`,{count:e}):salla.lang.getWithDefault("pages.products.bundle_select_range",`اختر من ${e} إلى ${s} منتجات`,{min:e,max:s}):l?salla.lang.getWithDefault("pages.products.bundle_select_min",`اختر على الأقل ${e} منتجات`,{min:e}):salla.lang.getWithDefault("pages.products.bundle_select_max",`اختر حتى ${s} منتجات`,{max:s}):null}handleSectionsChange(){this.autoSelectSingleProductSections()}componentWillLoad(){this.autoSelectSingleProductSections()}renderAccordionHeader(t){const s=this.getSectionSelectionNote(t);return e(i,null,e("h2",{slot:"title"},t?.name),s?e("span",{slot:"note"},s):null,e("span",{slot:"progress"},this.getProgressStatus(t)))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:i}=t.detail;i?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"1ba2cde8fad73b16cfc2ccdd5e68331a9e3fdb7a",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"a72d9fc9f3df30616d3d0696c755db4e76c9a153",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,selectionLimit:this.getEffectiveMax(t),isSelectionLocked:this.isProductSelectionLocked(t),onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"1e2f996c2d995c62ae29dedc90826a1f1d0a1320"}))}get host(){return l(this)}static get watchers(){return{sections:["handleSectionsChange"]}}};c.style="";export{n as salla_multiple_bundle_product_cart,c as salla_multiple_bundle_product_details}
4
+ import{r as t,h as e,H as s,a as l,F as i}from"./p-BsIeN-bg.js";const n=class{constructor(e){t(this,e),this.sections=[],this.itemNumber=""}deleteItem(t,e){const s=this.host.closest("form");if(s){const l=s.getAttribute("id");if(l&&"string"==typeof l){const s=l.match(/item-(\d+)/)?.[1];this.itemNumber=s||"";const i=this.host.querySelector(`#accordion-${e.id}`);salla.cart.deleteItem(`${this.itemNumber}?product_id=${e.id}&section_id=${t}`).then((()=>i?.remove()))}}}renderRemoveButton(t,s,l=!1){return e("salla-button",{type:"button",shape:l?"btn":"icon",fill:l?"outline":"solid",size:"small",color:"danger","aria-label":"Remove from the cart",onClick:()=>this.deleteItem(t,s)},l?salla.lang.get("common.elements.delete"):e("i",{class:"sicon-cancel"}))}renderAccordionHeader(t,s){const l=s?.options&&s?.options?.length>0;return e("div",{slot:"html",class:"s-multiple-bundle-product-cart-header-wrapper"},e("div",{class:"s-multiple-bundle-product-cart-header "+(l?"":"s-multiple-bundle-product-cart-header-no-options")},e("div",{class:"s-multiple-bundle-product-cart-header-content"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-image-wrapper"},e("img",{src:s?.image?.url,alt:s?.image?.alt||s?.name,class:"s-multiple-bundle-product-cart-header-image"})),e("div",{class:"s-multiple-bundle-product-cart-header-content-details"},e("h2",{class:"s-multiple-bundle-product-cart-header-content-details-title"},e("a",{href:s?.url,class:"s-multiple-bundle-product-cart-header-content-details-title-link"},s?.name)),e("div",{class:"s-multiple-bundle-product-cart-header-content-details-price"},e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-regular"},e("span",{innerHTML:s?.price?salla.money(s?.price):""})),s?.sale_price>0&&e("span",{class:"s-multiple-bundle-product-cart-header-content-details-price-sale"},e("span",{innerHTML:salla.money(s?.sale_price)}))),s?.quantity_in_group>0&&0!==s?.quantity&&e("p",{class:"s-multiple-bundle-product-cart-header-content-details-quantity"},e("span",null,salla.lang.get("pages.products.number_of_pieces")),e("span",null,s?.quantity_in_group)))),!l&&e("div",{class:"s-multiple-bundle-product-cart-header-remove-button"},this.renderRemoveButton(t,s,!1))))}render(){return e(s,{key:"78be7c4a3be811adb01cb1437473fcd9f1c17b41",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"9b0439dffc9a2dd8d31f56dacb5d835cde903e71",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>t.products.map((l=>{const i={sectionId:t.id,sectionIndex:s,productId:l.id};return e("salla-accordion",{key:l.id,collapsed:!1,bordered:!0,collapsible:!!(l.options&&l.options.length>0),size:"sm",id:`accordion-${l.id}`},e("salla-accordion-head",null,this.renderAccordionHeader(String(t.id),l)),l.options&&l.options.length>0&&e("salla-accordion-body",null,e("salla-product-options",{options:JSON.stringify(l.options),key:`${l.id}-persistent`,"product-id":l.id,"bundle-context":JSON.stringify(i)}),e("div",{class:"s-multiple-bundle-product-cart-body-remove-button"},this.renderRemoveButton(String(t.id),l,!0))))}))))))}get host(){return l(this)}};n.style="";const c=class{constructor(e){t(this,e),this.sections=[],this.selectedProducts={},this.productSelectedHandler=null,this.onSelectProduct=(t,e)=>{const s=e.id,l=this.selectedProducts[t]?.has(s)??!1,i=this.sections.find((e=>e.id==t));if(!(l&&i&&this.isProductSelectionLocked(i))){if(!l){if(!i)return;if(1!==this.getEffectiveMax(i)&&this.isAtSelectionLimit(i))return}this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])},l?(this.selectedProducts[t].delete(s),this.clearProductFormData(s,t),this.clearProductModalOptions(s,t)):1===this.getEffectiveMax(i)?this.syncSectionSelection(t,s):this.selectedProducts[t].add(s),this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options,wasSelected:l,isSelected:!l})}},this.ensureProductSelected=(t,e)=>{this.selectedProducts={...this.selectedProducts,[t]:new Set(this.selectedProducts[t]||[])};const s=e.id;if(this.selectedProducts[t].has(s))return;const l=this.sections.find((e=>e.id==t));if(!l)return;const i=this.getEffectiveMax(l);if(1===i)this.syncSectionSelection(t,s);else{if(i>1&&this.isAtSelectionLimit(l))return;this.selectedProducts[t].add(s)}this.selectedProducts={...this.selectedProducts},salla.event.dispatch("on-bundle-product-selected",{id:e.id,name:e.name,options:e.options})},this.onSelectProductOptions=(t,e)=>{const s=this.sections.find((t=>t.id==e));if(!s||!this.canSelectProductInSection(s,t.id))return;const l=this.sections.findIndex((t=>t.id==e)),i=s.products?.findIndex((e=>e.id==t.id))??0,n=this.selectedProducts[e]?.has(t.id)??!1;salla.event.dispatch("multiple-bundle-product-modal::open",{product:t,sectionId:e,sectionIndex:l,productIndex:i,isProductAlreadySelected:n})},this.handleBundleSliderProductSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProduct(s,e)},this.handleBundleSliderProductOptionsSelected=t=>{const{product:e,sectionId:s}=t.detail;this.onSelectProductOptions(e,s)}}isSingleProductSection(t){return 1===(t.products?.length??0)}getObligatoryMin(t){const e=t.obligatory_products;if(null==e)return 0;const s=Number(e);return Number.isNaN(s)?0:s}isProductSelectionLocked(t){return this.isSingleProductSection(t)&&1===this.getObligatoryMin(t)}getEffectiveMax(t){const e=t.products?.length??0,s=t.max_obligatory_products;return null!=s&&s>0?Math.min(s,e):e}getSelectedCount(t){return this.selectedProducts[t]?.size??0}isAtSelectionLimit(t){return this.getSelectedCount(t.id)>=this.getEffectiveMax(t)}canSelectProductInSection(t,e){return!!this.selectedProducts[t.id]?.has(e)||1===this.getEffectiveMax(t)||!this.isAtSelectionLimit(t)}async canSelectBundleProduct(t,e){const s=this.sections.find((e=>e.id==t));return!!s&&this.canSelectProductInSection(s,e)}queryProductCheckbox(t,e){const s=`input.s-multiple-bundle-product-checkbox[name="bundle[${t}][${e}][id]"]`,l=this.host.closest("form"),i=l?.querySelector(s);if(i)return i;for(const t of this.host.querySelectorAll("salla-multiple-bundle-product-slider")){const e=(t.shadowRoot??t).querySelector(s);if(e)return e}return null}dispatchBubblingChange(t){requestAnimationFrame((()=>{t.dispatchEvent(new window.Event("change",{bubbles:!0}))}))}clearSectionProductSlot(t,e,s){const l=this.queryProductCheckbox(t,s);l&&(l.checked=!1);const i=this.host.closest("form");if(i){const e=`bundle[${t}][${s}]`;Array.from(i.querySelectorAll("input")).forEach((t=>{t.name?.startsWith(e)&&("checkbox"===t.type&&t.name?.endsWith("][id]")?t.checked=!1:t.remove())}))}this.clearProductModalOptions(e,t)}syncSectionSelection(t,e){const s=this.sections.find((e=>e.id==t));s?.products?.forEach(((s,l)=>{s.id!=e&&this.clearSectionProductSlot(t,s.id,l)})),this.selectedProducts[t]=new Set([e]);const l=s?.products?.findIndex((t=>t.id==e))??-1,i=l>=0?this.queryProductCheckbox(t,l):null;i&&(i.checked=!0,this.dispatchBubblingChange(i))}autoSelectSingleProductSections(){if(!this.sections?.length)return;const t={...this.selectedProducts};let e=!1;const s=[];for(const l of this.sections){if(!this.isProductSelectionLocked(l))continue;const i=l.products?.[0];if(!i||!i.unlimited_quantity&&(i.quantity??0)<=0)continue;const n=l.id,c=new Set(t[n]||[]);c.has(i.id)||(c.add(i.id),t[n]=c,e=!0,s.push({product:i}))}e&&(this.selectedProducts=t,s.forEach((({product:t})=>{salla.event.dispatch("on-bundle-product-selected",{id:t.id,name:t.name,options:t.options})})))}clearProductFormData(t,e){if(null!=e){const s=this.sections.find((t=>t.id==e)),l=s?.products?.findIndex((e=>e.id==t))??-1;if(l>=0)return void this.clearSectionProductSlot(e,t,l)}const s=this.host.closest("form");s&&s.querySelectorAll(`[data-product-id="${t}"]`).forEach((t=>t.remove()))}clearProductModalOptions(t,e){let s=null,l=null;if(null!=e&&(s=this.sections.findIndex((t=>t.id==e)),s>-1)){const e=this.sections[s];if(e){const s=e.products?.findIndex((e=>e.id==t));l="number"==typeof s&&s>-1?s:null}}salla.event.dispatch("multiple-bundle-product-modal::clear-options",{productId:t,sectionId:e,sectionIndex:s,productIndex:l})}getProgressStatus(t){const e=this.getSelectedCount(t.id),s=this.getEffectiveMax(t);return s>0?`${e}/${s}`:"0"}getSectionSelectionNote(t){const e=this.getObligatoryMin(t),s=Number(t.max_obligatory_products)||0,l=e>0,i=s>0;return l||i?l&&i?e===s?salla.lang.getWithDefault("pages.products.bundle_select_exact",`اختر ${e} منتجات`,{count:e}):salla.lang.getWithDefault("pages.products.bundle_select_range",`اختر من ${e} إلى ${s} منتجات`,{min:e,max:s}):l?salla.lang.getWithDefault("pages.products.bundle_select_min",`اختر على الأقل ${e} منتجات`,{min:e}):salla.lang.getWithDefault("pages.products.bundle_select_max",`اختر حتى ${s} منتجات`,{max:s}):null}handleSectionsChange(){this.autoSelectSingleProductSections()}componentWillLoad(){this.autoSelectSingleProductSections()}renderAccordionHeader(t){const s=this.getSectionSelectionNote(t);return e(i,null,e("h2",{slot:"title"},t?.name),s?e("span",{slot:"note"},s):null,e("span",{slot:"progress"},this.getProgressStatus(t)))}componentDidLoad(){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&(this.productSelectedHandler=t=>{const{productId:e,sectionId:s,product:l,fromModal:i}=t.detail;i?this.ensureProductSelected(s,l||{id:e}):this.onSelectProduct(s,l||{id:e})},t.addEventListener("productSelected",this.productSelectedHandler))}disconnectedCallback(){if(this.productSelectedHandler){const t=this.host.querySelector("salla-multiple-bundle-product-options-modal");t&&t.removeEventListener("productSelected",this.productSelectedHandler),this.productSelectedHandler=null}}render(){return e(s,{key:"1ba2cde8fad73b16cfc2ccdd5e68331a9e3fdb7a",class:"s-multiple-bundle-product-wrapper"},e("div",{key:"a72d9fc9f3df30616d3d0696c755db4e76c9a153",class:"s-multiple-bundle-product-wrapper-sections"},this.sections.map(((t,s)=>e("salla-accordion",{key:t.id,collapsed:0!==s},e("salla-accordion-head",null,this.renderAccordionHeader(t)),e("salla-accordion-body",null,e("salla-multiple-bundle-product-slider",{section:t,sectionIndex:s,selectedProducts:this.selectedProducts,selectionLimit:this.getEffectiveMax(t),isSelectionLocked:this.isProductSelectionLocked(t),onProductSelected:this.handleBundleSliderProductSelected,onProductOptionsSelected:this.handleBundleSliderProductOptionsSelected})))))),e("salla-multiple-bundle-product-options-modal",{key:"1e2f996c2d995c62ae29dedc90826a1f1d0a1320"}))}get host(){return l(this)}static get watchers(){return{sections:["handleSectionsChange"]}}};c.style="";export{n as salla_multiple_bundle_product_cart,c as salla_multiple_bundle_product_details}