@salla.sa/twilight-components 2.14.290 → 2.14.292

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 (156) hide show
  1. package/dist/cjs/{filepond-CsSVZI6b.js → filepond-B9sLUCBe.js} +1 -1
  2. package/dist/cjs/{filepond-plugin-file-poster-DJjaIMfQ.js → filepond-plugin-file-poster-DkzerIBW.js} +1 -1
  3. package/dist/cjs/{filepond-plugin-file-validate-size-DGUa4QzB.js → filepond-plugin-file-validate-size-DF8uFSha.js} +1 -1
  4. package/dist/cjs/{filepond-plugin-file-validate-type-DJmeqtsg.js → filepond-plugin-file-validate-type-Dva6K_7l.js} +1 -1
  5. package/dist/cjs/{filepond-plugin-image-edit-5OewQYOY.js → filepond-plugin-image-edit-C-0ziNsz.js} +1 -1
  6. package/dist/cjs/{filepond-plugin-image-exif-orientation-CG2IXf0d.js → filepond-plugin-image-exif-orientation-DxXsE_ZP.js} +1 -1
  7. package/dist/cjs/{filepond-plugin-image-preview-CBLsOLDc.js → filepond-plugin-image-preview-2v59y8Fv.js} +1 -1
  8. package/dist/cjs/{index-DaoXQTQv.js → index-B7O1YF_p.js} +1 -1
  9. package/dist/cjs/{index-QiRNeWgQ.js → index-CCofAgHa.js} +2 -2
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/salla-accordion_62.cjs.entry.js +179 -89
  12. package/dist/cjs/salla-advertisement.cjs.entry.js +1 -1
  13. package/dist/cjs/salla-app-install-alert.cjs.entry.js +1 -1
  14. package/dist/cjs/salla-apps-icons.cjs.entry.js +1 -1
  15. package/dist/cjs/salla-cart-item-offers.cjs.entry.js +1 -1
  16. package/dist/cjs/salla-conditional-offer.cjs.entry.js +1 -1
  17. package/dist/cjs/salla-contacts.cjs.entry.js +1 -1
  18. package/dist/cjs/salla-filters-widget.cjs.entry.js +1 -1
  19. package/dist/cjs/salla-filters.cjs.entry.js +1 -1
  20. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  21. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +1 -1
  22. package/dist/cjs/salla-loyalty-program.cjs.entry.js +1 -1
  23. package/dist/cjs/salla-metadata.cjs.entry.js +1 -1
  24. package/dist/cjs/salla-notification-item.cjs.entry.js +1 -1
  25. package/dist/cjs/salla-notifications.cjs.entry.js +1 -1
  26. package/dist/cjs/salla-offer.cjs.entry.js +1 -1
  27. package/dist/cjs/salla-order-details-multiple-bundle-product.cjs.entry.js +1 -1
  28. package/dist/cjs/salla-order-details-options.cjs.entry.js +1 -1
  29. package/dist/cjs/salla-order-details.cjs.entry.js +1 -1
  30. package/dist/cjs/salla-order-summary.cjs.entry.js +1 -1
  31. package/dist/cjs/salla-order-totals-card.cjs.entry.js +13 -8
  32. package/dist/cjs/salla-orders.cjs.entry.js +1 -1
  33. package/dist/cjs/salla-payments.cjs.entry.js +1 -1
  34. package/dist/cjs/salla-price-range.cjs.entry.js +1 -1
  35. package/dist/cjs/salla-review-card.cjs.entry.js +1 -1
  36. package/dist/cjs/salla-reviews-page.cjs.entry.js +1 -1
  37. package/dist/cjs/salla-reviews.cjs.entry.js +1 -1
  38. package/dist/cjs/salla-social.cjs.entry.js +1 -1
  39. package/dist/cjs/salla-tiered-offer.cjs.entry.js +1 -1
  40. package/dist/cjs/salla-tooltip.cjs.entry.js +1 -1
  41. package/dist/cjs/salla-trust-badges.cjs.entry.js +1 -1
  42. package/dist/cjs/salla-verify.cjs.entry.js +1 -1
  43. package/dist/cjs/salla-wallet.cjs.entry.js +1 -1
  44. package/dist/cjs/twilight.cjs.js +2 -2
  45. package/dist/collection/components/salla-login-modal/salla-login-modal.js +3 -3
  46. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-details.js +20 -5
  47. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.js +84 -67
  48. package/dist/collection/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.js +75 -5
  49. package/dist/collection/components/salla-order-totals-card/salla-order-totals-card.js +12 -7
  50. package/dist/components/index.js +2 -2
  51. package/dist/components/keyboard_arrow_right.js +3 -3
  52. package/dist/components/salla-breadcrumb.js +2 -2
  53. package/dist/components/salla-login-modal.js +3 -3
  54. package/dist/components/salla-multiple-bundle-product-details2.js +20 -5
  55. package/dist/components/salla-multiple-bundle-product-options-modal2.js +82 -65
  56. package/dist/components/salla-multiple-bundle-product-slider2.js +62 -6
  57. package/dist/components/salla-order-totals-card.js +12 -7
  58. package/dist/components/salla-quick-buy2.js +8 -3
  59. package/dist/components/salla-slider2.js +3 -3
  60. package/dist/esm/{filepond-DG5ftHEu.js → filepond-BYDXj1kv.js} +1 -1
  61. package/dist/esm/{filepond-plugin-file-poster-DJnNcY8m.js → filepond-plugin-file-poster-CuFchfVe.js} +1 -1
  62. package/dist/esm/{filepond-plugin-file-validate-size-Ij_3QNnX.js → filepond-plugin-file-validate-size-DdbaDfww.js} +1 -1
  63. package/dist/esm/{filepond-plugin-file-validate-type-KfkcHm4r.js → filepond-plugin-file-validate-type-BpacmUuQ.js} +1 -1
  64. package/dist/esm/{filepond-plugin-image-edit-DGwQ9z-F.js → filepond-plugin-image-edit--2pWYR5x.js} +1 -1
  65. package/dist/esm/{filepond-plugin-image-exif-orientation-D3He5h3f.js → filepond-plugin-image-exif-orientation-BHXDSKOW.js} +1 -1
  66. package/dist/esm/{filepond-plugin-image-preview-CW-_uvrw.js → filepond-plugin-image-preview-DOiMBtjb.js} +1 -1
  67. package/dist/esm/{index-D4ggsvU3.js → index-6_auLzVW.js} +1 -1
  68. package/dist/esm/{index-BSnsSL0d.js → index-De5BFkJn.js} +2 -2
  69. package/dist/esm/loader.js +3 -3
  70. package/dist/esm/salla-accordion_62.entry.js +179 -89
  71. package/dist/esm/salla-advertisement.entry.js +1 -1
  72. package/dist/esm/salla-app-install-alert.entry.js +1 -1
  73. package/dist/esm/salla-apps-icons.entry.js +1 -1
  74. package/dist/esm/salla-cart-item-offers.entry.js +1 -1
  75. package/dist/esm/salla-conditional-offer.entry.js +1 -1
  76. package/dist/esm/salla-contacts.entry.js +1 -1
  77. package/dist/esm/salla-filters-widget.entry.js +1 -1
  78. package/dist/esm/salla-filters.entry.js +1 -1
  79. package/dist/esm/salla-installment.entry.js +1 -1
  80. package/dist/esm/salla-loyalty-prize-item.entry.js +1 -1
  81. package/dist/esm/salla-loyalty-program.entry.js +1 -1
  82. package/dist/esm/salla-metadata.entry.js +1 -1
  83. package/dist/esm/salla-notification-item.entry.js +1 -1
  84. package/dist/esm/salla-notifications.entry.js +1 -1
  85. package/dist/esm/salla-offer.entry.js +1 -1
  86. package/dist/esm/salla-order-details-multiple-bundle-product.entry.js +1 -1
  87. package/dist/esm/salla-order-details-options.entry.js +1 -1
  88. package/dist/esm/salla-order-details.entry.js +1 -1
  89. package/dist/esm/salla-order-summary.entry.js +1 -1
  90. package/dist/esm/salla-order-totals-card.entry.js +13 -8
  91. package/dist/esm/salla-orders.entry.js +1 -1
  92. package/dist/esm/salla-payments.entry.js +1 -1
  93. package/dist/esm/salla-price-range.entry.js +1 -1
  94. package/dist/esm/salla-review-card.entry.js +1 -1
  95. package/dist/esm/salla-reviews-page.entry.js +1 -1
  96. package/dist/esm/salla-reviews.entry.js +1 -1
  97. package/dist/esm/salla-social.entry.js +1 -1
  98. package/dist/esm/salla-tiered-offer.entry.js +1 -1
  99. package/dist/esm/salla-tooltip.entry.js +1 -1
  100. package/dist/esm/salla-trust-badges.entry.js +1 -1
  101. package/dist/esm/salla-verify.entry.js +1 -1
  102. package/dist/esm/salla-wallet.entry.js +1 -1
  103. package/dist/esm/twilight.js +3 -3
  104. package/dist/twilight/{p-0b3f063c.entry.js → p-1b88233c.entry.js} +1 -1
  105. package/dist/twilight/{p-0beb6f5d.entry.js → p-1c8efb3a.entry.js} +1 -1
  106. package/dist/twilight/{p-672f8206.entry.js → p-1f56038b.entry.js} +1 -1
  107. package/dist/twilight/{p-f9202fc1.entry.js → p-24b6e7b0.entry.js} +1 -1
  108. package/dist/twilight/{p-7434d2ef.entry.js → p-26a1a393.entry.js} +1 -1
  109. package/dist/twilight/{p-b3d1e538.entry.js → p-2933d113.entry.js} +1 -1
  110. package/dist/twilight/{p-6299bd02.entry.js → p-2c29cdf5.entry.js} +1 -1
  111. package/dist/twilight/{p-0619cc09.entry.js → p-2e8f7b03.entry.js} +1 -1
  112. package/dist/twilight/{p-36fb1519.entry.js → p-301f50d5.entry.js} +1 -1
  113. package/dist/twilight/{p-5c58eb9d.entry.js → p-3482aff4.entry.js} +1 -1
  114. package/dist/twilight/{p-075b3b52.entry.js → p-35c15064.entry.js} +1 -1
  115. package/dist/twilight/{p-06cc0ac3.entry.js → p-37b7805d.entry.js} +1 -1
  116. package/dist/twilight/{p-5aba0f7f.entry.js → p-38375e84.entry.js} +1 -1
  117. package/dist/twilight/p-4985e087.entry.js +4 -0
  118. package/dist/twilight/{p-06af203a.entry.js → p-4e3906ea.entry.js} +1 -1
  119. package/dist/twilight/p-5c3edfd3.entry.js +4 -0
  120. package/dist/twilight/{p-823e64aa.entry.js → p-628cedb8.entry.js} +1 -1
  121. package/dist/twilight/{p-ebe69ca5.entry.js → p-64d2b5bf.entry.js} +1 -1
  122. package/dist/twilight/p-719684b5.entry.js +4 -0
  123. package/dist/twilight/{p-736693a1.entry.js → p-7200623e.entry.js} +1 -1
  124. package/dist/twilight/{p-532376e1.entry.js → p-776eaeaa.entry.js} +1 -1
  125. package/dist/twilight/{p-34ed3d3f.entry.js → p-7b689856.entry.js} +1 -1
  126. package/dist/twilight/{p-6e6f80ef.entry.js → p-804c10d1.entry.js} +1 -1
  127. package/dist/twilight/{p-7684f980.entry.js → p-854d383d.entry.js} +1 -1
  128. package/dist/twilight/{p-e9340ae5.entry.js → p-88b55062.entry.js} +1 -1
  129. package/dist/twilight/{p-977818f1.entry.js → p-8c29955b.entry.js} +1 -1
  130. package/dist/twilight/{p-d3e3e3c0.entry.js → p-8f9c2b1a.entry.js} +1 -1
  131. package/dist/twilight/{p-00955919.entry.js → p-97410a23.entry.js} +1 -1
  132. package/dist/twilight/{p-5ae41031.entry.js → p-9b68655d.entry.js} +1 -1
  133. package/dist/twilight/{p-9Dp5S3a0.js → p-Bk0ag9wm.js} +1 -1
  134. package/dist/twilight/{p-DP8Fqw7G.js → p-Bmnj4Lo0.js} +1 -1
  135. package/dist/twilight/{p-CaOlYtot.js → p-CKvjL5Ck.js} +1 -1
  136. package/dist/twilight/{p-DdxZpDbY.js → p-CXmaZL5g.js} +1 -1
  137. package/dist/twilight/{p-DuneTSVd.js → p-D0KVO4LV.js} +1 -1
  138. package/dist/twilight/{p-B1hrg10h.js → p-DCz2wWih.js} +1 -1
  139. package/dist/twilight/{p-BSnsSL0d.js → p-De5BFkJn.js} +1 -1
  140. package/dist/twilight/{p-B2wjlPIP.js → p-_xsLTh9m.js} +1 -1
  141. package/dist/twilight/{p-33712517.entry.js → p-bd8e92c2.entry.js} +1 -1
  142. package/dist/twilight/{p-b8229259.entry.js → p-c0f9a43d.entry.js} +1 -1
  143. package/dist/twilight/p-da7856b7.entry.js +11 -0
  144. package/dist/twilight/{p-43dbbda5.entry.js → p-e185d4a4.entry.js} +1 -1
  145. package/dist/twilight/{p-Bgf4h7Oc.js → p-vN9q8rrM.js} +1 -1
  146. package/dist/twilight/twilight.esm.js +1 -1
  147. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-options-modal.d.ts +9 -0
  148. package/dist/types/components/salla-multiple-bundle-product/components/salla-multiple-bundle-product-slider.d.ts +11 -1
  149. package/dist/types/components/salla-order-totals-card/interfaces.d.ts +1 -0
  150. package/dist/types/components/salla-order-totals-card/salla-order-totals-card.d.ts +2 -1
  151. package/dist/types/components.d.ts +12 -2
  152. package/package.json +5 -5
  153. package/dist/twilight/p-06b5b3e4.entry.js +0 -4
  154. package/dist/twilight/p-51c65ed9.entry.js +0 -11
  155. package/dist/twilight/p-c00a7ae6.entry.js +0 -4
  156. package/dist/twilight/p-ceb2f617.entry.js +0 -4
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
  var anime_es = require('./anime.es-BqW8JHZi.js');
8
8
  var specialDiscount = require('./special-discount-OVG_9Kf9.js');
9
9
  var check = require('./check-CLRvuniI.js');
@@ -3543,13 +3543,13 @@ const SallaFileUpload = class {
3543
3543
  return;
3544
3544
  try {
3545
3545
  const [FilePondModule, FilePondPluginFileValidateSize, FilePondPluginImageExifOrientation, FilePondPluginImagePreview, FilePondPluginImageEdit, FilePondPluginFileValidateType, FilePondPluginFilePoster] = await Promise.all([
3546
- Promise.resolve().then(function () { return require('./filepond-CsSVZI6b.js'); }).then(function (n) { return n.filepond; }),
3547
- Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-size-DGUa4QzB.js'); }).then(function (n) { return n.filepondPluginFileValidateSize; }),
3548
- Promise.resolve().then(function () { return require('./filepond-plugin-image-exif-orientation-CG2IXf0d.js'); }).then(function (n) { return n.filepondPluginImageExifOrientation; }),
3549
- Promise.resolve().then(function () { return require('./filepond-plugin-image-preview-CBLsOLDc.js'); }).then(function (n) { return n.filepondPluginImagePreview; }),
3550
- Promise.resolve().then(function () { return require('./filepond-plugin-image-edit-5OewQYOY.js'); }).then(function (n) { return n.filepondPluginImageEdit; }),
3551
- Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-type-DJmeqtsg.js'); }).then(function (n) { return n.filepondPluginFileValidateType; }),
3552
- Promise.resolve().then(function () { return require('./filepond-plugin-file-poster-DJjaIMfQ.js'); }).then(function (n) { return n.filepondPluginFilePoster; })
3546
+ Promise.resolve().then(function () { return require('./filepond-B9sLUCBe.js'); }).then(function (n) { return n.filepond; }),
3547
+ Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-size-DF8uFSha.js'); }).then(function (n) { return n.filepondPluginFileValidateSize; }),
3548
+ Promise.resolve().then(function () { return require('./filepond-plugin-image-exif-orientation-DxXsE_ZP.js'); }).then(function (n) { return n.filepondPluginImageExifOrientation; }),
3549
+ Promise.resolve().then(function () { return require('./filepond-plugin-image-preview-2v59y8Fv.js'); }).then(function (n) { return n.filepondPluginImagePreview; }),
3550
+ Promise.resolve().then(function () { return require('./filepond-plugin-image-edit-C-0ziNsz.js'); }).then(function (n) { return n.filepondPluginImageEdit; }),
3551
+ Promise.resolve().then(function () { return require('./filepond-plugin-file-validate-type-Dva6K_7l.js'); }).then(function (n) { return n.filepondPluginFileValidateType; }),
3552
+ Promise.resolve().then(function () { return require('./filepond-plugin-file-poster-DkzerIBW.js'); }).then(function (n) { return n.filepondPluginFilePoster; })
3553
3553
  ]);
3554
3554
  this.FilePond = FilePondModule;
3555
3555
  // Register plugins
@@ -4978,10 +4978,10 @@ const SallaLoginModal = class {
4978
4978
  this.modal.close();
4979
4979
  Salla.auth.event.tokenFetched(token);
4980
4980
  try {
4981
- await Salla.cart.api.assign();
4981
+ await Salla.api.cart.assign();
4982
4982
  }
4983
- catch (error) {
4984
- Salla.log('Error on assign');
4983
+ catch (err) {
4984
+ Salla.log('Error on assign after handle iframe', err);
4985
4985
  }
4986
4986
  withCartReset && Salla.cart.reset();
4987
4987
  !Salla.auth.api.isSessionless() && await Salla.auth.api.request('auth/jwt');
@@ -6434,7 +6434,7 @@ const SallaMultipleBundleProductDetails = class {
6434
6434
  this.selectedProducts[sectionId].delete(productId);
6435
6435
  // Clear form data and modal options for this product in this specific section
6436
6436
  this.clearProductFormData(productId, sectionId);
6437
- this.clearProductModalOptions(productId);
6437
+ this.clearProductModalOptions(productId, sectionId);
6438
6438
  }
6439
6439
  else {
6440
6440
  // Product is being selected
@@ -6513,10 +6513,25 @@ const SallaMultipleBundleProductDetails = class {
6513
6513
  }
6514
6514
  }
6515
6515
  // Clear modal options state for a specific product
6516
- clearProductModalOptions(productId) {
6516
+ clearProductModalOptions(productId, sectionId) {
6517
+ let sectionIndex = null;
6518
+ let productIndex = null;
6519
+ if (sectionId != null) {
6520
+ sectionIndex = this.sections.findIndex(section => section.id == sectionId);
6521
+ if (sectionIndex > -1) {
6522
+ const section = this.sections[sectionIndex];
6523
+ if (section) {
6524
+ const foundIndex = section.products?.findIndex(product => product.id == productId);
6525
+ productIndex = typeof foundIndex === 'number' && foundIndex > -1 ? foundIndex : null;
6526
+ }
6527
+ }
6528
+ }
6517
6529
  // Emit event to notify modal to reset its state for this product
6518
6530
  salla.event.dispatch('multiple-bundle-product-modal::clear-options', {
6519
6531
  productId,
6532
+ sectionId,
6533
+ sectionIndex,
6534
+ productIndex,
6520
6535
  });
6521
6536
  }
6522
6537
  renderAccordionHeader(section, selectedCount) {
@@ -6553,10 +6568,10 @@ const SallaMultipleBundleProductDetails = class {
6553
6568
  }
6554
6569
  }
6555
6570
  render() {
6556
- return (index.h(index.Host, { key: '01b95de8e1add5136b0fbaa0ceff430acff73f63', class: "s-multiple-bundle-product-wrapper" }, index.h("div", { key: '7736f0ab829921931872dc817815344fff90efe6', class: "s-multiple-bundle-product-wrapper-sections" }, this.sections.map((section, index$1) => {
6571
+ return (index.h(index.Host, { key: '118e5c2badcec4329da881ba87ce6c6771175c14', class: "s-multiple-bundle-product-wrapper" }, index.h("div", { key: '6c2033af8d144c39cfa4f6b67ffd91d38fcd7bdf', class: "s-multiple-bundle-product-wrapper-sections" }, this.sections.map((section, index$1) => {
6557
6572
  const selectedCount = this.selectedProducts[section.id]?.size || 0;
6558
- return (index.h("salla-accordion", { key: section.id, collapsed: index$1 === 1 ? true : false }, index.h("salla-accordion-head", null, this.renderAccordionHeader(section, selectedCount)), index.h("salla-accordion-body", null, index.h("salla-multiple-bundle-product-slider", { section: section, sectionIndex: index$1, selectedProducts: this.selectedProducts, onProductSelected: this.handleBundleSliderProductSelected, onProductOptionsSelected: this.handleBundleSliderProductOptionsSelected }))));
6559
- })), index.h("salla-multiple-bundle-product-options-modal", { key: '1cf3eb8fdce83b3ebbdfa13f422490b20e370e8e' })));
6573
+ return (index.h("salla-accordion", { key: section.id, collapsed: index$1 === 0 ? false : true }, index.h("salla-accordion-head", null, this.renderAccordionHeader(section, selectedCount)), index.h("salla-accordion-body", null, index.h("salla-multiple-bundle-product-slider", { section: section, sectionIndex: index$1, selectedProducts: this.selectedProducts, onProductSelected: this.handleBundleSliderProductSelected, onProductOptionsSelected: this.handleBundleSliderProductOptionsSelected }))));
6574
+ })), index.h("salla-multiple-bundle-product-options-modal", { key: 'a5d0c1fb53d38015eebbcb3a203aefb6b9b540af' })));
6560
6575
  }
6561
6576
  get host() { return index.getElement(this); }
6562
6577
  };
@@ -6574,6 +6589,7 @@ const SallaMultipleBundleProductOptionsModal = class {
6574
6589
  this.sectionIndex = 0;
6575
6590
  this.productIndex = 0;
6576
6591
  this.selectedOptions = {};
6592
+ this.optionsResetTokens = {};
6577
6593
  this.isLoading = false;
6578
6594
  this.hasUnsavedChanges = false;
6579
6595
  this.validationErrors = [];
@@ -6630,17 +6646,21 @@ const SallaMultipleBundleProductOptionsModal = class {
6630
6646
  this.selectedOptions = { ...this.selectedOptions };
6631
6647
  }
6632
6648
  componentDidLoad() {
6633
- salla.event.on('multiple-bundle-product-modal::open', (data) => {
6649
+ this.modalOpenListener = (data) => {
6634
6650
  this.product = data.product;
6635
6651
  this.sectionId = data.sectionId || null;
6636
6652
  this.sectionIndex = data.sectionIndex || 0;
6637
6653
  this.productIndex = data.productIndex || 0;
6638
6654
  this.open();
6639
- });
6655
+ };
6656
+ salla.event.on('multiple-bundle-product-modal::open', this.modalOpenListener);
6640
6657
  // Listen for clear-options event when a product is deselected
6641
- salla.event.on('multiple-bundle-product-modal::clear-options', (data) => {
6642
- this.clearProductOptions(data.productId);
6643
- });
6658
+ this.clearOptionsListener = (data) => {
6659
+ if (!data || !data.productId)
6660
+ return;
6661
+ this.clearProductOptions(data.productId, data.sectionId, data.productIndex);
6662
+ };
6663
+ salla.event.on('multiple-bundle-product-modal::clear-options', this.clearOptionsListener);
6644
6664
  // Create and store the option change listener for proper cleanup
6645
6665
  this.optionChangeListener = (e) => {
6646
6666
  const { productId, option, detail } = e.detail;
@@ -6665,60 +6685,16 @@ const SallaMultipleBundleProductOptionsModal = class {
6665
6685
  // Extract section info from the checkbox name: bundle[sectionId][productIndex][id]
6666
6686
  const nameMatch = target.name.match(/^bundle\[([^\]]+)\]\[([^\]]+)\]\[id\]$/);
6667
6687
  if (nameMatch && !target.checked) {
6668
- // Product was deselected, clear its cached options
6669
6688
  const [, sectionId, productIndex] = nameMatch;
6670
6689
  const productId = target.value;
6671
- // Prevent the immediate event to ensure cleanup happens first
6672
- e.preventDefault();
6673
- e.stopPropagation();
6674
- // Ensure the checkbox is actually unchecked
6675
- target.checked = false;
6676
- // Generate the same cache key used by the modal
6677
- const cacheKey = this.generateCacheKey(sectionId, parseInt(productIndex), productId);
6678
- // Clear the cached options for this product
6679
- const updatedSelectedOptions = { ...this.selectedOptions };
6680
- delete updatedSelectedOptions[cacheKey];
6681
- this.selectedOptions = updatedSelectedOptions;
6682
- // Force re-render of the modal if it's currently open for this product
6683
- if (this.product && this.product.id == productId) {
6684
- this.selectedOptions = { ...this.selectedOptions };
6685
- }
6686
6690
  const form = this.host.closest('form');
6687
- if (form) {
6688
- const productInputPattern = `bundle[${sectionId}][${productIndex}]`;
6689
- // Get all form inputs and filter manually
6690
- const allInputs = Array.from(form.querySelectorAll('input'));
6691
- const matchingInputs = allInputs.filter(input => input.name && input.name.startsWith(productInputPattern));
6692
- // Process matching inputs for removal
6693
- matchingInputs.forEach(el => {
6694
- // Don't remove the visible checkbox that was just unchecked
6695
- if (el !== target && (el.type === 'hidden' || el.hasAttribute('data-product-id'))) {
6696
- el.remove();
6697
- }
6698
- });
6699
- // Method 2: Find inputs by data-product-id BUT only within the same section/productIndex
6700
- const dataProductInputs = allInputs.filter(input => {
6701
- // Must have data-product-id matching the productId
6702
- if (input.getAttribute('data-product-id') !== String(productId)) {
6703
- return false;
6704
- }
6705
- // Must also be within the same section/productIndex pattern
6706
- return input.name && input.name.startsWith(productInputPattern);
6707
- });
6708
- // Process inputs with matching section/productIndex and productId for removal
6709
- dataProductInputs.forEach(el => {
6710
- if (el !== target) {
6711
- el.remove();
6712
- }
6713
- });
6714
- // Method 3: Removed broader search to prevent removing inputs from other products
6715
- // The cleanup is now more precise and only removes inputs for the specific product
6716
- // Trigger form change event after cleanup is complete
6717
- setTimeout(() => {
6718
- const changeEvent = new window.Event('change', { bubbles: true });
6719
- form.dispatchEvent(changeEvent);
6720
- }, 50); // Small delay to ensure cleanup is complete
6721
- }
6691
+ this.cleanupProductDeselection({
6692
+ sectionId,
6693
+ productIndex: parseInt(productIndex, 10),
6694
+ productId,
6695
+ form,
6696
+ uncheckedInput: target,
6697
+ });
6722
6698
  }
6723
6699
  }
6724
6700
  };
@@ -6730,6 +6706,37 @@ const SallaMultipleBundleProductOptionsModal = class {
6730
6706
  if (this.checkboxChangeListener) {
6731
6707
  document.removeEventListener('change', this.checkboxChangeListener);
6732
6708
  }
6709
+ if (this.optionChangeListener) {
6710
+ salla.event.off('product-options::change', this.optionChangeListener);
6711
+ }
6712
+ if (this.modalOpenListener) {
6713
+ salla.event.off('multiple-bundle-product-modal::open', this.modalOpenListener);
6714
+ }
6715
+ if (this.clearOptionsListener) {
6716
+ salla.event.off('multiple-bundle-product-modal::clear-options', this.clearOptionsListener);
6717
+ }
6718
+ }
6719
+ cleanupProductDeselection(params) {
6720
+ const { sectionId, productIndex, productId, form, uncheckedInput } = params;
6721
+ this.clearProductOptions(productId, sectionId, productIndex);
6722
+ if (form) {
6723
+ const productInputPattern = `bundle[${sectionId}][${productIndex}]`;
6724
+ Array.from(form.querySelectorAll(`input[name^="${productInputPattern}"]`)).forEach(input => {
6725
+ if (input === uncheckedInput) {
6726
+ return;
6727
+ }
6728
+ const shouldRemoveHidden = input.type === 'hidden';
6729
+ const shouldRemoveByDataset = input.getAttribute('data-product-id') === String(productId) &&
6730
+ input.name?.startsWith(productInputPattern);
6731
+ if (shouldRemoveHidden || shouldRemoveByDataset) {
6732
+ input.remove();
6733
+ }
6734
+ });
6735
+ requestAnimationFrame(() => {
6736
+ const changeEvent = new window.Event('change', { bubbles: true });
6737
+ form.dispatchEvent(changeEvent);
6738
+ });
6739
+ }
6733
6740
  }
6734
6741
  generateFormInputName(sectionId, productIndex, optionParentId) {
6735
6742
  return `bundle[${sectionId}][${productIndex}][options][${optionParentId}]`;
@@ -6756,17 +6763,37 @@ const SallaMultipleBundleProductOptionsModal = class {
6756
6763
  }
6757
6764
  }
6758
6765
  // Clear options state for a specific product
6759
- clearProductOptions(productId) {
6760
- // Generate cache key for this specific product in current section context
6761
- const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
6762
- // Remove the product from selectedOptions using the cache key
6766
+ clearProductOptions(productId, sectionId, productIndex) {
6763
6767
  const updatedSelectedOptions = { ...this.selectedOptions };
6764
- delete updatedSelectedOptions[cacheKey];
6768
+ if (sectionId != null && productIndex != null && !Number.isNaN(productIndex)) {
6769
+ const cacheKey = this.generateCacheKey(sectionId, productIndex, productId);
6770
+ delete updatedSelectedOptions[cacheKey];
6771
+ this.bumpOptionsResetToken(cacheKey);
6772
+ }
6773
+ else {
6774
+ const productSuffix = `-${String(productId)}`;
6775
+ const affectedKeys = [];
6776
+ Object.keys(updatedSelectedOptions).forEach(key => {
6777
+ if (key.endsWith(productSuffix)) {
6778
+ delete updatedSelectedOptions[key];
6779
+ affectedKeys.push(key);
6780
+ }
6781
+ });
6782
+ affectedKeys.forEach(key => this.bumpOptionsResetToken(key));
6783
+ }
6765
6784
  this.selectedOptions = updatedSelectedOptions;
6766
6785
  // Reset validation errors and unsaved changes
6767
6786
  this.validationErrors = [];
6768
6787
  this.hasUnsavedChanges = false;
6769
6788
  }
6789
+ bumpOptionsResetToken(cacheKey) {
6790
+ if (!cacheKey)
6791
+ return;
6792
+ this.optionsResetTokens = {
6793
+ ...this.optionsResetTokens,
6794
+ [cacheKey]: (this.optionsResetTokens[cacheKey] || 0) + 1,
6795
+ };
6796
+ }
6770
6797
  async handleOptionChange(productId, option, detail) {
6771
6798
  const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
6772
6799
  // Get the current state from the component to ensure we have the latest selections
@@ -6961,6 +6988,8 @@ const SallaMultipleBundleProductOptionsModal = class {
6961
6988
  this.optionsSaved.emit({
6962
6989
  productId: Number(productId),
6963
6990
  selectedOptions,
6991
+ sectionId: this.sectionId,
6992
+ productIndex: this.productIndex,
6964
6993
  });
6965
6994
  // Emit product selected event to check the card
6966
6995
  if (this.sectionId) {
@@ -7007,7 +7036,9 @@ const SallaMultipleBundleProductOptionsModal = class {
7007
7036
  render() {
7008
7037
  const productId = this.product?.id;
7009
7038
  const optionsWithSelectedState = this.getOptionsWithSelectedState();
7010
- return (index.h(index.Host, { key: 'f48867c1730d142b1e55ddb4442c7e7d789a35bb' }, index.h("salla-modal", { key: '62196cd41c3979ca5e71327d9aad450a819a45ec', isLoading: this.isLoading, ref: el => (this.modal = el), width: "md", centered: false, id: `s-multiple-bundle-product-options-modal-options-${productId}`, class: "s-multiple-bundle-product-options-modal-wrapper" }, index.h("div", { key: 'feee0e09d5f1dbb19f02b8c109f43e7dc5d1dad8', slot: "loading" }, index.h("salla-skeleton", { key: '149debcb4852d4096613721a202f4079439abf0a', height: "100%", width: "100%" })), this.product?.images && this.product?.images.length > 0 && (index.h("salla-slider", { key: '591045fe1d3c9e30bb53a927d3e4d62b54623503', id: `details-slider-${this.product?.id}`, type: "thumbs", loop: false, "auto-height": true, "listen-to-thumbnails-option": true, showThumbsControls: false, controlsOuter: false, showControls: false, class: "s-multiple-bundle-product-options-modal-slider", verticalThumbs: true, thumbsConfig: {
7039
+ const cacheKey = this.generateCacheKey(this.sectionId, this.productIndex, productId);
7040
+ const resetToken = this.optionsResetTokens[cacheKey] || 0;
7041
+ return (index.h(index.Host, { key: 'ce4cec97975d0aef32b50a13237a2d64701d8e9f' }, index.h("salla-modal", { key: 'cda08db7768f0b987a9569ca1170b059a58a417e', isLoading: this.isLoading, ref: el => (this.modal = el), width: "md", centered: false, id: `s-multiple-bundle-product-options-modal-options-${productId}`, class: "s-multiple-bundle-product-options-modal-wrapper" }, index.h("div", { key: 'd093204f6d85e7a874e0a69a826869e179aeafa4', slot: "loading" }, index.h("salla-skeleton", { key: '140608027bb0237b62eeb24d1eb5e47c5279c7e3', height: "100%", width: "100%" })), this.product?.images && this.product?.images.length > 0 && (index.h("salla-slider", { key: '807f2428e8219d9ab6e46163a5d03ad0b2e1b9a3', id: `details-slider-${this.product?.id}`, type: "thumbs", loop: false, "auto-height": true, "listen-to-thumbnails-option": true, showThumbsControls: false, controlsOuter: false, showControls: false, class: "s-multiple-bundle-product-options-modal-slider", verticalThumbs: true, thumbsConfig: {
7011
7042
  centeredSlides: true,
7012
7043
  centeredSlidesBounds: true,
7013
7044
  slidesPerView: Math.min(5, Math.max(1, this.product?.images.length)),
@@ -7016,13 +7047,13 @@ const SallaMultipleBundleProductOptionsModal = class {
7016
7047
  watchSlidesProgress: true,
7017
7048
  direction: 'vertical',
7018
7049
  spaceBetween: 10,
7019
- } }, index.h("div", { key: '1c4163f6d60a89b12d681e3df2db87a523ab092b', slot: "items" }, this.product?.images &&
7050
+ } }, index.h("div", { key: 'f287bea52aa1e3c68debd0b68d011025ea3f9157', slot: "items" }, this.product?.images &&
7020
7051
  this.product?.images.map((image, index$1) => (index.h("div", { key: index$1, class: "swiper-slide" }, index.h("img", { src: image.url, alt: image.alt || `${this.product?.name} - Image ${index$1 + 1}`, loading: "lazy", onError: e => {
7021
7052
  e.target.style.display = 'none';
7022
- } }))))), this.product?.images && this.product?.images.length > 1 && (index.h("div", { key: '911fe5aad35ab3e733871bb185e7a89bb74b6da3', slot: "thumbs" }, this.product?.images &&
7053
+ } }))))), this.product?.images && this.product?.images.length > 1 && (index.h("div", { key: '5d8064ef63c91a660a3b3267afb29e498ac76f4c', slot: "thumbs" }, this.product?.images &&
7023
7054
  this.product?.images.map((image, index$1) => (index.h("div", { key: index$1, "data-caption": `${this.product?.name} - Image ${index$1 + 1}` }, index.h("img", { src: image.url, loading: "eager", class: "s-multiple-bundle-product-options-modal-slider-thumb", title: `${this.product?.name} - ${index$1 + 1}`, alt: image.alt || `${this.product?.name} - ${index$1 + 1}`, onError: e => {
7024
7055
  e.target.style.display = 'none';
7025
- } })))))))), index.h("salla-product-options", { options: JSON.stringify(optionsWithSelectedState), key: `${this.sectionId}-${this.sectionIndex}-${productId}-persistent`, "product-id": productId }), index.h("div", { key: 'd107ebd058a3f349a5f2f05f4e2b685942d485d6', slot: "footer" }, index.h("div", { key: '01c7d37a91bb95eb830fcc3290a7cfde9ef7324b', class: "s-multiple-bundle-product-options-modal-footer" }, index.h("salla-button", { key: '402b9d19c176ebaec8bd7396b9bafe74b81fa456', onClick: e => this.onSave(e), loading: this.isLoading, disabled: this.isLoading }, this.isLoading
7056
+ } })))))))), index.h("salla-product-options", { options: JSON.stringify(optionsWithSelectedState), key: `${cacheKey}-reset-${resetToken}`, "product-id": productId, "unique-key": `${cacheKey}-reset-${resetToken}` }), index.h("div", { key: '2f6c7f133ccabd75bbb9e8649c056619ce754296', slot: "footer" }, index.h("div", { key: '1c04908511a480af63fc4e358393514c74967508', class: "s-multiple-bundle-product-options-modal-footer" }, index.h("salla-button", { key: '49fbad4b1e71004dc8fd6df5d0f1a61b1ef25b8d', onClick: e => this.onSave(e), loading: this.isLoading, disabled: this.isLoading }, this.isLoading
7026
7057
  ? salla.lang.get('common.elements.saving')
7027
7058
  : salla.lang.get('common.elements.save')))))));
7028
7059
  }
@@ -7041,6 +7072,7 @@ const SallaMultipleBundleProductSlider = class {
7041
7072
  this.productSelected = index.createEvent(this, "productSelected");
7042
7073
  this.productOptionsSelected = index.createEvent(this, "productOptionsSelected");
7043
7074
  this.selectedProducts = {};
7075
+ this.savedOptionsByInstance = {};
7044
7076
  this.handleProductClick = (product, productIndex) => {
7045
7077
  // Find the checkbox input for this product
7046
7078
  const checkboxId = this.generateEventName(this.section.id, productIndex);
@@ -7053,6 +7085,10 @@ const SallaMultipleBundleProductSlider = class {
7053
7085
  // Dispatch a change event to trigger form validation/submission
7054
7086
  const changeEvent = new window.Event('change', { bubbles: true });
7055
7087
  checkbox.dispatchEvent(changeEvent);
7088
+ if (!checkbox.checked) {
7089
+ this.clearSavedOptionsState(this.section.id, productIndex);
7090
+ this.dispatchClearOptionsEvent(product, productIndex);
7091
+ }
7056
7092
  }
7057
7093
  this.productSelected.emit({
7058
7094
  product,
@@ -7066,17 +7102,66 @@ const SallaMultipleBundleProductSlider = class {
7066
7102
  });
7067
7103
  };
7068
7104
  }
7105
+ getProductInstanceKey(sectionId, productIndex) {
7106
+ return `${sectionId}::${productIndex}`;
7107
+ }
7108
+ dispatchClearOptionsEvent(product, productIndex) {
7109
+ salla.event.dispatch('multiple-bundle-product-modal::clear-options', {
7110
+ productId: product.id,
7111
+ sectionId: this.section.id,
7112
+ sectionIndex: this.sectionIndex,
7113
+ productIndex,
7114
+ });
7115
+ }
7116
+ handleOptionsSaved(event) {
7117
+ const detail = event.detail;
7118
+ if (!detail)
7119
+ return;
7120
+ const { sectionId, productIndex, selectedOptions } = detail;
7121
+ if (sectionId == null || sectionId !== this.section?.id)
7122
+ return;
7123
+ if (productIndex == null || Number.isNaN(productIndex))
7124
+ return;
7125
+ const key = this.getProductInstanceKey(sectionId, productIndex);
7126
+ const hasOptions = !!selectedOptions?.length;
7127
+ if (hasOptions) {
7128
+ this.savedOptionsByInstance = {
7129
+ ...this.savedOptionsByInstance,
7130
+ [key]: true,
7131
+ };
7132
+ }
7133
+ else if (this.savedOptionsByInstance[key]) {
7134
+ const updatedState = { ...this.savedOptionsByInstance };
7135
+ delete updatedState[key];
7136
+ this.savedOptionsByInstance = updatedState;
7137
+ }
7138
+ }
7139
+ clearSavedOptionsState(sectionId, productIndex) {
7140
+ const key = this.getProductInstanceKey(sectionId, productIndex);
7141
+ if (!this.savedOptionsByInstance[key])
7142
+ return;
7143
+ const updatedState = { ...this.savedOptionsByInstance };
7144
+ delete updatedState[key];
7145
+ this.savedOptionsByInstance = updatedState;
7146
+ }
7069
7147
  generateEventName(sectionId, productIndex) {
7070
7148
  return `bundle[${sectionId}][${productIndex}][id]`;
7071
7149
  }
7072
7150
  render() {
7073
- return (index.h(index.Host, { key: 'ec6fb04196690c5299da565d852ec77bbee6b1e3' }, index.h("salla-slider", { key: 'a7e79c2f27a53135e55e2708b5aa60d05f9ad21b', type: "carousel", controlsOuter: false, showControls: false, id: "accordion-multiple-bundle-product", pagination: true, class: "s-multiple-bundle-product-wrapper-slider", sliderConfig: {
7151
+ return (index.h(index.Host, { key: '234e93258c3d7ca5d7dc08efb68743d042646706' }, index.h("salla-slider", { key: '451184823378e4ad0c9034d3af1b87373bcb7d20', type: "carousel", controlsOuter: false, showControls: false, id: "accordion-multiple-bundle-product", pagination: true, class: "s-multiple-bundle-product-wrapper-slider", sliderConfig: {
7074
7152
  spaceBetween: 0,
7075
- } }, index.h("div", { key: 'c07aa5a0ee4fe106764b47dfa6d9f6509fb659cf', slot: "items" }, this?.section?.products?.map((product, productIndex) => {
7153
+ } }, index.h("div", { key: '28c1acfd37a77059d4c177b787dca9deea47d123', slot: "items" }, this?.section?.products?.map((product, productIndex) => {
7076
7154
  const isChecked = this.selectedProducts[this.section.id]?.has(product.id) || false;
7077
- return (index.h("div", { class: `swiper-slide s-multiple-bundle-product-slide-one-third ${product.quantity == 0
7155
+ const hasSavedOptions = this.savedOptionsByInstance[this.getProductInstanceKey(this.section.id, productIndex)];
7156
+ const optionsButtonLabel = hasSavedOptions
7157
+ ? salla.lang.getWithDefault('pages.products.edit_selected_options', 'تعديل الخيارات')
7158
+ : salla.lang.get('pages.products.choose_from_options');
7159
+ let optionsArrowIcon = salla.config.get('theme.is_rtl', true)
7160
+ ? ArrowLeftIcon
7161
+ : ArrowRightIcon;
7162
+ return (index.h("div", { class: `s-multiple-bundle-product-slide-one-third ${product.quantity == 0
7078
7163
  ? 's-multiple-bundle-product-slide-one-third-disabled'
7079
- : ''}`, key: product.id }, index.h("div", { class: "s-multiple-bundle-product-card" }, index.h("div", { class: "s-multiple-bundle-product-image-wrapper", onClick: () => this.handleProductClick(product, productIndex) }, index.h("input", { id: this.generateEventName(this.section.id, productIndex), type: "checkbox", class: "s-multiple-bundle-product-checkbox", checked: isChecked, name: this.generateEventName(this.section.id, productIndex), value: product.id }), index.h("img", { src: product.image.url || salla.url.cdn('images/s-empty.png'), loading: "lazy", alt: product.image.alt || product.name, class: "s-multiple-bundle-product-image" })), index.h("div", { class: "s-multiple-bundle-product-content-wrapper" }, index.h("div", { class: "s-multiple-bundle-product-content" }, index.h("div", { class: "s-multiple-bundle-product-details" }, index.h("div", { class: "s-multiple-bundle-product-title-wrapper" }, index.h("h2", { class: "s-multiple-bundle-product-title" }, product.name)), index.h("div", { class: "s-multiple-bundle-product-price-wrapper" }, index.h("span", { class: "s-multiple-bundle-product-price" }, index.h("span", { innerHTML: salla.money(product.price) })), product.sale_price > 0 && (index.h("span", { class: "s-multiple-bundle-product-price-discount" }, index.h("span", { innerHTML: salla.money(product.sale_price) }))))), product.quantity_in_group > 0 && product.quantity !== 0 && (index.h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.pieces'), index.h("span", null, product.quantity_in_group))), product.quantity === 0 && (index.h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.quantity_in_group_finished')))), product.options?.length > 0 && (index.h("button", { class: "s-multiple-bundle-product-button", onClick: () => this.handleOptionsClick(product), type: "button" }, salla.lang.get('pages.products.choose_from_options'), index.h("i", { class: "sicon-keyboard_arrow_left s-multiple-bundle-product-button-icon" })))))));
7164
+ : ''}`, key: product.id }, index.h("div", { class: "s-multiple-bundle-product-card" }, index.h("div", { class: "s-multiple-bundle-product-image-wrapper", onClick: () => this.handleProductClick(product, productIndex) }, index.h("input", { id: this.generateEventName(this.section.id, productIndex), type: "checkbox", class: "s-multiple-bundle-product-checkbox", checked: isChecked, name: this.generateEventName(this.section.id, productIndex), value: product.id }), index.h("img", { src: product.image.url || salla.url.cdn('images/s-empty.png'), loading: "lazy", alt: product.image.alt || product.name, class: "s-multiple-bundle-product-image" })), index.h("div", { class: "s-multiple-bundle-product-content-wrapper" }, index.h("div", { class: "s-multiple-bundle-product-content" }, index.h("div", { class: "s-multiple-bundle-product-details" }, index.h("div", { class: "s-multiple-bundle-product-title-wrapper" }, index.h("h2", { class: "s-multiple-bundle-product-title" }, product.name)), index.h("div", { class: "s-multiple-bundle-product-price-wrapper" }, index.h("span", { class: "s-multiple-bundle-product-price" }, index.h("span", { innerHTML: salla.money(product.price) })), product.sale_price > 0 && (index.h("span", { class: "s-multiple-bundle-product-price-discount" }, index.h("span", { innerHTML: salla.money(product.sale_price) }))))), product.quantity_in_group > 0 && product.quantity !== 0 && (index.h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.pieces'), index.h("span", null, product.quantity_in_group))), product.quantity === 0 && (index.h("span", { class: "s-multiple-bundle-product-badge" }, salla.lang.get('pages.products.quantity_in_group_finished')))), product.options?.length > 0 && (index.h("button", { class: "s-multiple-bundle-product-button", onClick: () => this.handleOptionsClick(product), type: "button" }, optionsButtonLabel, index.h("span", { class: "s-multiple-bundle-product-button-icon", innerHTML: optionsArrowIcon })))))));
7080
7165
  })))));
7081
7166
  }
7082
7167
  get host() { return index.getElement(this); }
@@ -10108,13 +10193,18 @@ window.SallaApplePay = {
10108
10193
 
10109
10194
  selectApplePayShippingMethod: (company_id, private_company_id) => {
10110
10195
  salla.logger.log('🍏 Pay: select shipping method ', 'company_id : ' + company_id, 'private_company_id: ' + private_company_id);
10111
-
10112
- return Http.requestWithSupportAjax(SallaApplePay.detail.shippingMethodSelected.url.replace('{id}', SallaApplePay.id), {
10196
+ const payload = {
10113
10197
  address_id: SallaApplePay.address_id,
10114
10198
  company_id: company_id,
10115
10199
  private_company_id: private_company_id,
10116
10200
  payment_method: 'apple_pay'
10117
- }, 'post').then(() => {
10201
+ };
10202
+ const selectedShippingMethod = SallaApplePay.shipping_methods?.find((item)=> item.company === company_id || item.ship_id === company_id);
10203
+ if (selectedShippingMethod?.route_id){
10204
+ payload.shipping_route_id = selectedShippingMethod.route_id;
10205
+ payload.type = selectedShippingMethod.type;
10206
+ }
10207
+ return Http.requestWithSupportAjax(SallaApplePay.detail.shippingMethodSelected.url.replace('{id}', SallaApplePay.id), payload, 'post').then(() => {
10118
10208
  if (typeof SallaApplePay.detail.shippingMethodSelected.onSuccess === 'function') {
10119
10209
  SallaApplePay.detail.shippingMethodSelected.onSuccess(data);
10120
10210
  }
@@ -12434,7 +12524,7 @@ const SallaTelInput = class {
12434
12524
  if (this.TelInput)
12435
12525
  return;
12436
12526
  try {
12437
- const telInputModule = await Promise.resolve().then(function () { return require('./index-DaoXQTQv.js'); }).then(function (n) { return n.index; });
12527
+ const telInputModule = await Promise.resolve().then(function () { return require('./index-B7O1YF_p.js'); }).then(function (n) { return n.index; });
12438
12528
  this.TelInput = telInputModule.default;
12439
12529
  }
12440
12530
  catch (error) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
  var anime_es = require('./anime.es-BqW8JHZi.js');
8
8
 
9
9
  const sallaAdvertisementCss = ":host{display:block}";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  const sallaAppInstallAlertCss = ":host{display:block}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  const sallaAppsIconsCss = ":host{display:block}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
  var specialDiscount = require('./special-discount-OVG_9Kf9.js');
8
8
  var gift = require('./gift-BPDUPIY_.js');
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  var DiscountType;
9
9
  (function (DiscountType) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
  var whatsapp2 = require('./whatsapp2-D7Sbg8Ey.js');
8
8
  var mail = require('./mail-CO8cFZH7.js');
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
  var Helper = require('./Helper-C9UmWIYn.js');
8
8
  var interfaces = require('./interfaces-DZDQwN6-.js');
9
9
  require('./anime.es-BqW8JHZi.js');
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
  var interfaces = require('./interfaces-DZDQwN6-.js');
8
8
  var Helper = require('./Helper-C9UmWIYn.js');
9
9
  require('./anime.es-BqW8JHZi.js');
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  const sallaInstallmentCss = "salla-installment:empty{display:none}#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px;border:unset !important;font-weight:500}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--main-text-color);font-size:var(--font-sm);line-height:1.25;padding:20px 20px 20px 115px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);border:unset !important;font-family:inherit !important;font-weight:500}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.tamara-product-widget .spotii-logo,.spotii-wrapper .spotii-logo{float:left;margin:0 0 0 -75px}.ltr .tamara-product-widget,.ltr .spotii-wrapper{text-align:left;padding:18px 100px 18px 20px !important}.ltr .tamara-product-widget .spotii-logo,.ltr .spotii-wrapper .spotii-logo{float:right;margin:0 -75px 0 0}.ltr .tamara-product-widget .spotii-product-widget,.ltr .spotii-wrapper .spotii-product-widget{text-align:left !important}.spotii-wrapper{margin-bottom:20px}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm) !important;margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px !important;top:35px !important;margin:0 !important;height:24px !important}.ltr .tamara-product-widget .tamara-logo{right:20px !important;left:auto !important}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}.s-installment-mispay-wrapper,.s-installment-madfu-wrapper,.s-installment-emkan-wrapper,.s-installment-rajehi-wrapper{font-size:14px;text-align:right;padding:20px;gap:42px;line-height:22px;color:rgb(0, 0, 0);min-width:100%;box-sizing:border-box;position:relative;background-color:white;border-radius:10px;margin:15px 0;display:flex;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.s-installment-mispay-wrapper:hover,.s-installment-madfu-wrapper:hover,.s-installment-emkan-wrapper:hover,.s-installment-rajehi-wrapper:hover{box-shadow:0 0 rgba(0, 0, 0, 0), 0 0 rgba(0, 0, 0, 0), 5px 10px 30px rgba(43, 45, 52, 0.0509803922)}.s-installment-mispay-content,.s-installment-madfu-content,.s-installment-emkan-content,.s-installment-rajehi-content{display:flex;flex-direction:row-reverse;width:100%;justify-content:space-between;align-items:center;gap:1rem}.s-installment-mispay-content-text,.s-installment-madfu-content-text,.s-installment-emkan-content-text,.s-installment-rajehi-content-text{color:var(--main-text-color);font-size:14px;font-weight:500;margin:0 16px 0 0;width:80%;left:14px;text-align:left}.s-installment-mispay-content img,.s-installment-madfu-content img,.s-installment-emkan-content img,.s-installment-rajehi-content img{height:28px;width:70px;display:inline-block;max-height:100%;vertical-align:middle;fill:none;stroke:unset;width:auto}.rtl .s-installment-mispay-content-text,.rtl .s-installment-madfu-content-text,.rtl .s-installment-emkan-content-text,.rtl .s-installment-rajehi-content-text{right:14px;text-align:right;margin:0 0 0 16px}.rtl .s-installment-mispay-content img,.rtl .s-installment-madfu-content img,.rtl .s-installment-emkan-content img,.rtl .s-installment-rajehi-content img{left:14px !important}.ltr .s-installment-mispay-content img,.ltr .s-installment-madfu-content img,.ltr .s-installment-emkan-content img,.ltr .s-installment-rajehi-content img{right:14px !important}.s-installment-rajehi-content img{width:70px !important;height:40px !important}.s-installment-emkan-content img{height:35px !important}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  const sallaLoyaltyPrizeItemCss = "salla-loyalty-prize-item:hover{box-shadow:0 5px 15px 1px rgba(0, 0, 0, 0.04) !important}";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
  var gift = require('./gift-BPDUPIY_.js');
8
8
 
9
9
  const sallaLoyaltyProgramCss = "";
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  const sallaMetadataCss = "";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  const sallaNotificationsCss = "";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
  var Helper = require('./Helper-C9UmWIYn.js');
8
8
  require('./anime.es-BqW8JHZi.js');
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  var PageType;
9
9
  (function (PageType) {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  const sallaOrderDetailsMultipleBundleProductCss = "";
9
9
 
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- var index = require('./index-QiRNeWgQ.js');
6
+ var index = require('./index-CCofAgHa.js');
7
7
 
8
8
  var copyIcon = `<!-- Generated by IcoMoon.io -->
9
9
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">