@salla.sa/twilight-components 2.10.7 → 2.11.0

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 (50) hide show
  1. package/dist/cjs/{app-globals-da038c01.js → app-globals-ffcb56c9.js} +1 -1
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/salla-button_37.cjs.entry.js +226 -107
  4. package/dist/cjs/twilight.cjs.js +2 -2
  5. package/dist/collection/components/salla-file-upload/salla-file-upload.js +69 -6
  6. package/dist/collection/components/salla-gifting/salla-gifting.js +25 -41
  7. package/dist/collection/components/salla-login-modal/intefaces.js +9 -0
  8. package/dist/collection/components/salla-login-modal/salla-login-modal.js +61 -3
  9. package/dist/collection/components/salla-map/salla-map.js +10 -8
  10. package/dist/collection/components/salla-product-options/salla-product-options.js +72 -58
  11. package/dist/collection/components/salla-slider/salla-slider.js +63 -23
  12. package/dist/collection/components/salla-user-menu/salla-user-menu.js +1 -3
  13. package/dist/components/camera.js +11 -0
  14. package/dist/components/index.js +1 -1
  15. package/dist/components/salla-file-upload2.js +35 -3
  16. package/dist/components/salla-gifting.js +20 -36
  17. package/dist/components/salla-login-modal.js +81 -6
  18. package/dist/components/salla-map.js +7 -5
  19. package/dist/components/salla-product-options.js +61 -53
  20. package/dist/components/salla-slider2.js +28 -5
  21. package/dist/components/salla-user-menu.js +1 -3
  22. package/dist/esm/{app-globals-41701201.js → app-globals-3afeeb74.js} +1 -1
  23. package/dist/esm/loader.js +2 -2
  24. package/dist/esm/salla-button_37.entry.js +226 -107
  25. package/dist/esm/twilight.js +2 -2
  26. package/dist/esm-es5/{app-globals-41701201.js → app-globals-3afeeb74.js} +1 -1
  27. package/dist/esm-es5/loader.js +1 -1
  28. package/dist/esm-es5/salla-button_37.entry.js +4 -4
  29. package/dist/esm-es5/twilight.js +1 -1
  30. package/dist/twilight/p-9bbacabc.entry.js +30 -0
  31. package/dist/twilight/{p-88643516.js → p-d4a11dd1.js} +2 -2
  32. package/dist/twilight/p-d859d898.system.js +4 -0
  33. package/dist/twilight/{p-25d2fe80.system.js → p-db94f281.system.js} +2 -2
  34. package/dist/twilight/{p-dcd65bb2.system.entry.js → p-e69f3e88.system.entry.js} +1 -1
  35. package/dist/twilight/twilight.esm.js +1 -1
  36. package/dist/twilight/twilight.js +1 -1
  37. package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +11 -1
  38. package/dist/types/components/salla-gifting/salla-gifting.d.ts +9 -9
  39. package/dist/types/components/salla-login-modal/intefaces.d.ts +12 -0
  40. package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +9 -1
  41. package/dist/types/components/salla-map/salla-map.d.ts +5 -2
  42. package/dist/types/components/salla-product-options/interfaces.d.ts +6 -1
  43. package/dist/types/components/salla-product-options/salla-product-options.d.ts +19 -11
  44. package/dist/types/components/salla-slider/salla-slider.d.ts +52 -1
  45. package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +0 -1
  46. package/dist/types/components.d.ts +85 -14
  47. package/package.json +4 -4
  48. package/dist/components/arrow-right.js +0 -11
  49. package/dist/twilight/p-0110489b.system.js +0 -4
  50. package/dist/twilight/p-c142b898.entry.js +0 -30
@@ -20027,7 +20027,12 @@ const sallaFileUploadCss = "/*!\n * FilePond 4.30.4\n * Licensed under MIT, http
20027
20027
  const SallaFileUpload = class {
20028
20028
  constructor(hostRef) {
20029
20029
  index.registerInstance(this, hostRef);
20030
+ this.uploaded = index.createEvent(this, "uploaded", 7);
20030
20031
  this.remove = index.createEvent(this, "remove", 7);
20032
+ /**
20033
+ * The uploaded image link or URL
20034
+ */
20035
+ this.uploadedImage = undefined;
20031
20036
  /**
20032
20037
  * Sets the required attribute to the output field
20033
20038
  */
@@ -20133,7 +20138,28 @@ const SallaFileUpload = class {
20133
20138
  /**
20134
20139
  * A server configuration object describing how FilePond should interact with the server.
20135
20140
  */
20136
- this.serverConfig = null;
20141
+ this.serverConfig = {
20142
+ process: async (_fieldName, file, _metadata, load, error, _progress, abort, _transfer, _options) => {
20143
+ const formData = new FormData();
20144
+ formData.append("image_url", file, file.name);
20145
+ return await salla.product.uploadGiftImage(formData)
20146
+ .then((resp) => {
20147
+ this.uploadedImage = resp.data.url;
20148
+ this.uploaded.emit(resp.data.url);
20149
+ load('success');
20150
+ }).catch(e => {
20151
+ console.log(e);
20152
+ error('error');
20153
+ })
20154
+ .finally(() => {
20155
+ return {
20156
+ abort: () => {
20157
+ abort();
20158
+ },
20159
+ };
20160
+ });
20161
+ }
20162
+ };
20137
20163
  /**
20138
20164
  * Immediately upload new files to the server
20139
20165
  */
@@ -20285,7 +20311,7 @@ const SallaFileUpload = class {
20285
20311
  }
20286
20312
  intiFilePond() {
20287
20313
  filepond.registerPlugin(FilePondPluginImagePreview, filepondPluginImageExifOrientation, filepondPluginFileValidateSize, filepondPluginImageEdit, filepondPluginFileValidateType);
20288
- return filepond.create(document.querySelector('.s-file-upload-input'), {
20314
+ return filepond.create(this.fileUploader, {
20289
20315
  files: this.files,
20290
20316
  required: this.required,
20291
20317
  disabled: this.disabled,
@@ -20323,13 +20349,18 @@ const SallaFileUpload = class {
20323
20349
  labelFileWaitingForSize: this.labelFileWaitingForSize,
20324
20350
  beforeRemoveFile: (file_deleted) => new Promise((resolve) => {
20325
20351
  this.remove.emit(file_deleted);
20352
+ setTimeout(() => {
20353
+ // TODO: needs a better way
20354
+ this.host.style.height = '120px !important';
20355
+ }, 1000);
20326
20356
  resolve(true);
20327
20357
  }),
20328
20358
  });
20329
20359
  }
20330
20360
  render() {
20331
- return (index.h(index.Host, { class: "s-file-upload" }, index.h("input", { type: "file", class: "s-file-upload-wrapper s-file-upload-input", name: "filepond", accept: "image/png, image/jpeg, image/jpg, image/gif" })));
20361
+ return (index.h(index.Host, { class: "s-file-upload" }, index.h("input", { type: "file", class: "s-file-upload-wrapper s-file-upload-input", ref: ele => this.fileUploader = ele, name: "filepond", accept: "image/png, image/jpeg, image/jpg, image/gif" })));
20332
20362
  }
20363
+ get host() { return index.getElement(this); }
20333
20364
  };
20334
20365
  SallaFileUpload.style = sallaFileUploadCss;
20335
20366
 
@@ -20339,13 +20370,6 @@ const Images = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32"
20339
20370
  </svg>
20340
20371
  `;
20341
20372
 
20342
- const ArrowRightIcon$1 = `<!-- Generated by IcoMoon.io -->
20343
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20344
- <title>arrow-right</title>
20345
- <path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>
20346
- </svg>
20347
- `;
20348
-
20349
20373
  const LeftArrow = `<!-- Generated by IcoMoon.io -->
20350
20374
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20351
20375
  <title>arrow-left</title>
@@ -20391,13 +20415,6 @@ const SallaGifting = class {
20391
20415
  salla.lang.onLoaded(() => {
20392
20416
  this.selectImageOrUpload = salla.lang.get('blocks.buy_as_gift.select_image_or_upload');
20393
20417
  this.selectImageForYourGift = salla.lang.get('blocks.buy_as_gift.select_image_for_your_gift');
20394
- this.step1Elems = document.querySelectorAll('.gift-step-1 .anime-item');
20395
- this.step2Elems = document.querySelectorAll('.gift-step-2 .anime-item');
20396
- this.imageCover = document.querySelector('.s-gifting-modal-uploader');
20397
- this.stepsWrapper = document.querySelector('.steps-wrapper');
20398
- this.textSelect = document.querySelector('.s-gifting-selectText');
20399
- this.customTextArea = document.querySelector('.s-gifting-textarea');
20400
- this.calendarFormGroup = document.querySelector('.s-gifting-calendar');
20401
20418
  this.sectionTitle = salla.lang.get('blocks.buy_as_gift.gift_the_one_you_love');
20402
20419
  this.sectionSubtitle = salla.lang.get('blocks.buy_as_gift.gift_the_one_you_love_message');
20403
20420
  this.sectionBtnText = salla.lang.get('blocks.buy_as_gift.send_as_a_gift');
@@ -20491,25 +20508,24 @@ const SallaGifting = class {
20491
20508
  * Go to the step 2
20492
20509
  */
20493
20510
  async goToStep2() {
20494
- var _a, _b, _c, _d, _e, _f;
20495
20511
  if (!this.selectedGiftTextOption) {
20496
- (_a = this.textSelect) === null || _a === void 0 ? void 0 : _a.classList.add('s-form-has-error');
20497
- (_b = this.customTextArea) === null || _b === void 0 ? void 0 : _b.classList.remove('s-form-has-error');
20512
+ this.textSelect.classList.add('s-form-has-error');
20513
+ this.customTextArea.classList.remove('s-form-has-error');
20498
20514
  return;
20499
20515
  }
20500
20516
  else if (this.selectedGiftTextOption == 'custom' && !this.selectedText) {
20501
- (_c = this.textSelect) === null || _c === void 0 ? void 0 : _c.classList.remove('s-form-has-error');
20502
- (_d = this.customTextArea) === null || _d === void 0 ? void 0 : _d.classList.add('s-form-has-error');
20517
+ this.textSelect.classList.remove('s-form-has-error');
20518
+ this.customTextArea.classList.add('s-form-has-error');
20503
20519
  return;
20504
20520
  }
20505
20521
  else {
20506
- (_e = this.textSelect) === null || _e === void 0 ? void 0 : _e.classList.remove('s-form-has-error');
20507
- (_f = this.customTextArea) === null || _f === void 0 ? void 0 : _f.classList.remove('s-form-has-error');
20522
+ this.textSelect.classList.remove('s-form-has-error');
20523
+ this.customTextArea.classList.remove('s-form-has-error');
20508
20524
  }
20509
20525
  this.setWrapperHeight(2, 600, 0);
20510
20526
  let stepNextAnime = new anime.timeline();
20511
20527
  stepNextAnime.add({
20512
- targets: this.step1Elems,
20528
+ targets: this.step1Elems.querySelectorAll('.anime-item'),
20513
20529
  opacity: [1, 0],
20514
20530
  translateX: [0, 50],
20515
20531
  delay: anime.stagger(70),
@@ -20522,13 +20538,13 @@ const SallaGifting = class {
20522
20538
  opacity: [0, 1],
20523
20539
  }, '-=1800')
20524
20540
  .add({
20525
- targets: this.step2Elems,
20541
+ targets: this.step2Elems.querySelectorAll('.anime-item'),
20526
20542
  opacity: [0, 1],
20527
20543
  translateX: [-50, 0],
20528
20544
  delay: anime.stagger(70),
20529
20545
  duration: 1200,
20530
20546
  complete: () => {
20531
- this.step2Elems.forEach(item => {
20547
+ this.step2Elems.querySelectorAll('.anime-item').forEach(item => {
20532
20548
  item.classList.remove('opacity-0');
20533
20549
  item.removeAttribute('style');
20534
20550
  });
@@ -20541,12 +20557,13 @@ const SallaGifting = class {
20541
20557
  *
20542
20558
  * Go to the step 1
20543
20559
  */
20544
- goToStep1() {
20560
+ goToStep1(e) {
20561
+ e.preventDefault();
20545
20562
  let stepBackAnime = new anime.timeline({
20546
20563
  autoplay: false,
20547
20564
  });
20548
20565
  stepBackAnime.add({
20549
- targets: this.step2Elems,
20566
+ targets: this.step2Elems.querySelectorAll('.anime-item'),
20550
20567
  opacity: [1, 0],
20551
20568
  translateX: [0, -50],
20552
20569
  delay: anime.stagger(70),
@@ -20559,13 +20576,13 @@ const SallaGifting = class {
20559
20576
  opacity: [0, 1],
20560
20577
  }, '-=1800')
20561
20578
  .add({
20562
- targets: this.step1Elems,
20579
+ targets: this.step1Elems.querySelectorAll('.anime-item'),
20563
20580
  opacity: [0, 1],
20564
20581
  translateX: [50, 0],
20565
20582
  delay: anime.stagger(70),
20566
20583
  duration: 1200,
20567
20584
  complete: () => {
20568
- this.step1Elems.forEach(item => {
20585
+ this.step1Elems.querySelectorAll('.anime-item').forEach(item => {
20569
20586
  item.classList.remove('opacity-0');
20570
20587
  item.removeAttribute('style');
20571
20588
  });
@@ -20581,19 +20598,19 @@ const SallaGifting = class {
20581
20598
  }
20582
20599
  setPreview(image) {
20583
20600
  var _a, _b;
20584
- (_a = this.imageCover) === null || _a === void 0 ? void 0 : _a.classList.add('has-bg');
20601
+ (_a = this.uploader) === null || _a === void 0 ? void 0 : _a.classList.add('has-bg');
20585
20602
  var bg = document.querySelector('.filepond-bg') ? document.querySelector('.filepond-bg') : document.createElement('div');
20586
20603
  bg.classList.add('filepond-bg');
20587
20604
  bg.classList.remove('s-hidden');
20588
20605
  bg.style.backgroundImage = "url('" + image.url + "')";
20589
- (_b = this.imageCover) === null || _b === void 0 ? void 0 : _b.querySelector('.filepond--root').appendChild(bg);
20606
+ (_b = this.uploader) === null || _b === void 0 ? void 0 : _b.querySelector('.filepond--root').appendChild(bg);
20590
20607
  this.uploadedImage = image.url;
20591
20608
  if (!!this.gift && this.gift.gift_images.length) {
20592
20609
  this.setWrapperHeight(1, 150, 0);
20593
20610
  }
20594
20611
  }
20595
20612
  removePreview() {
20596
- this.imageCover.classList.remove('has-bg');
20613
+ this.uploader.classList.remove('has-bg');
20597
20614
  let bg = document.querySelector('.filepond-bg');
20598
20615
  bg.removeAttribute('style');
20599
20616
  bg.classList.add('s-hidden');
@@ -20708,10 +20725,10 @@ const SallaGifting = class {
20708
20725
  :
20709
20726
  [
20710
20727
  index.h("div", { class: "s-gifting-modal-header" }, index.h("span", { class: "s-gifting-modal-icon" }, index.h("span", { innerHTML: GiftSharing })), index.h("h2", { class: "s-gifting-modal-title" }, index.h("div", { class: "s-gifting-modal-badge-wrapper" }, index.h("div", { class: "s-gifting-modal-badge" }, index.h("span", null, index.h("span", null, this.currentStep), "/2")), index.h("span", null, this.giftDetails)))),
20711
- index.h("div", { class: "s-gifting-steps-wrapper steps-wrapper " + this.parentClass }, index.h("div", { class: "s-gifting-step-one gift-step-1" }, index.h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), index.h("div", { class: "s-gifting-modal-uploader anime-item" }, index.h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && index.h("salla-file-upload", { "instant-upload": true, labelIdle: this.getFilepondPlaceholder(), serverConfig: this.getServerConfig(), onRemove: () => this.handleRemoveImage() }, " ")), index.h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && this.gift.gift_images.length > 0 ?
20728
+ index.h("div", { class: "s-gifting-steps-wrapper " + this.parentClass, ref: el => this.stepsWrapper = el }, index.h("div", { class: "s-gifting-step-one gift-step-1", ref: el => this.step1Elems = el }, index.h("div", { class: "s-gifting-modal-uploader-title anime-item" }, this.selectImageForYourGift), index.h("div", { class: "s-gifting-modal-uploader anime-item", ref: el => this.uploader = el }, index.h("span", { class: "s-gifting-remove-preview", onClick: () => this.removePreview(), innerHTML: Cancel }), this.selectImageOrUpload && index.h("salla-file-upload", { "instant-upload": true, labelIdle: this.getFilepondPlaceholder(), serverConfig: this.getServerConfig(), onRemove: () => this.handleRemoveImage() }, " ")), index.h("div", { class: "anime-item" }, !this.uploadedImage && !!this.gift && this.gift.gift_images.length > 0 ?
20712
20729
  index.h("salla-slider", { id: "gifting-slider", loop: false, "controls-outer": true, class: "s-gifting-slider", type: "carousel" }, index.h("div", { slot: "items" }, (_a = this.gift) === null || _a === void 0 ? void 0 : _a.gift_images.map((item) => index.h("img", { class: "s-gifting-image s-gifting-clickable", src: item.url, onClick: () => this.setPreview(item), alt: `${item.id}` }))))
20713
- : ""), index.h("div", { class: "anime-item" }, index.h("div", { class: "s-form-group s-gifting-selectText" }, index.h("label", { htmlFor: "gift-text-selection", class: "s-form-label" }, this.selectGiftMessage), index.h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, index.h("option", { "data-id": null, selected: true }, this.selectGiftMessage), (_b = this.gift) === null || _b === void 0 ? void 0 :
20714
- _b.gift_texts.map((txt) => index.h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)), index.h("option", { "data-id": "custom" }, this.giftCustomText))), index.h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide" }, index.h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), index.h("div", { class: "mt-1" }, index.h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), index.h("div", { class: "anime-item" }, index.h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, index.h("span", null, this.nextStep)))), index.h("div", { class: "s-gifting-step-two gift-step-2" }, index.h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), index.h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['sender_name']) : ''), index.h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), index.h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['receiver.name']) : ''), index.h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), index.h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['receiver.mobile']) : ''), index.h("div", { class: "anime-item opacity-0" }, index.h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: "schedule" }, index.h("input", { type: "checkbox", name: 'schedule', id: 'schedule', onChange: () => this.toggleCalendar(), class: "s-checkbox" }), index.h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), index.h("div", { class: this.getCalendarClasses() }, index.h("label", { class: "s-form-label" }, this.selectSendDateAndTime), index.h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), index.h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), index.h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, index.h("a", { href: "#!", innerHTML: this.currentLang == 'ar' ? ArrowRightIcon$1 : LeftArrow, onClick: () => this.goToStep1() }), index.h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, index.h("span", null, this.sendGift)))))
20730
+ : ""), index.h("div", { class: "anime-item" }, index.h("div", { class: "s-form-group s-gifting-selectText", ref: el => this.textSelect = el }, index.h("label", { htmlFor: "gift-text-selection", class: "s-form-label" }, this.selectGiftMessage), index.h("select", { id: "gift-text-selection", name: "gift-text-selection", class: "s-form-control s-gifting-select", onChange: e => this.toggleGiftText(e) }, index.h("option", { "data-id": null, selected: true }, this.selectGiftMessage), (_b = this.gift) === null || _b === void 0 ? void 0 :
20731
+ _b.gift_texts.map((txt) => index.h("option", { "data-id": txt.id, value: txt.text, key: txt.id }, txt.text)), index.h("option", { "data-id": "custom" }, this.giftCustomText))), index.h("div", { class: this.showGiftText ? "s-form-group s-gifting-textarea shown" : "s-form-group s-gifting-textarea hide", ref: (el) => this.customTextArea = el }, index.h("label", { htmlFor: "gift-custom-text", class: "s-form-label" }, this.giftCustomText), index.h("div", { class: "mt-1" }, index.h("textarea", { onInput: (event) => this.handleTextAreaChange(event), rows: 4, ref: (el) => this.textArea = el, name: "gift-custom-text", id: "gift-custom-text", class: "s-form-control" })))), index.h("div", { class: "anime-item" }, index.h("salla-button", { color: "primary", width: "wide", onClick: () => this.goToStep2() }, index.h("span", null, this.nextStep)))), index.h("div", { class: "s-gifting-step-two gift-step-2", ref: el => this.step2Elems = el }, index.h("div", { class: this.errors && this.errors['sender_name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { htmlFor: "sender_name", class: "s-form-label" }, this.senderNameLabel), index.h("input", { type: "text", class: "s-form-control", name: "sender_name", id: "sender_name", value: this.senderName, onInput: (event) => this.handleSenderName(event), placeholder: "" }), this.errors && this.errors['sender_name'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['sender_name']) : ''), index.h("div", { class: this.errors && this.errors['receiver.name'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { htmlFor: "receiver_name", class: "s-form-label" }, this.receiverNameFieldLabel), index.h("input", { type: "text", class: "s-form-control", name: "receiver_name", id: "receiver_name", value: "", onInput: (event) => this.handleReceiverName(event), placeholder: "" }), this.errors && this.errors['receiver.name'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['receiver.name']) : ''), index.h("div", { class: this.errors && this.errors['receiver.mobile'] ? "s-form-group s-form-has-error anime-item opacity-0" : "s-form-group anime-item opacity-0" }, index.h("label", { class: "s-form-label" }, this.receiverMobileFieldLabel), index.h("salla-tel-input", { class: "s-gifting-tel-input", phone: this.receiverMobile, countryCode: this.receiverCountryCode, onPhoneEntered: (e) => this.handlePhoneInputChange(e) }), this.errors && this.errors['receiver.mobile'] ? index.h("span", { class: "text-danger text-xs" }, this.errors['receiver.mobile']) : ''), index.h("div", { class: "anime-item opacity-0" }, index.h("label", { class: "s-gifting-schedule s-gifting-clickable", htmlFor: "schedule" }, index.h("input", { type: "checkbox", name: 'schedule', id: 'schedule', onChange: () => this.toggleCalendar(), class: "s-checkbox" }), index.h("span", { class: "s-form-label" }, " ", this.sendLater, " "))), index.h("div", { class: this.getCalendarClasses(), ref: (el) => this.calendarFormGroup = el }, index.h("label", { class: "s-form-label" }, this.selectSendDateAndTime), index.h("salla-datetime-picker", { value: this.deliveryDate, placeholder: this.selectSendDateAndTime, "enable-time": true, "date-format": "Y-m-d h:i K", onPicked: (event) => this.handleDateTimePicker(event) }), index.h("span", { class: "s-gifting-calendar-hint" }, this.canNotEditOrderAfterSelectDate)), index.h("div", { class: "s-gifting-step-two-footer anime-item opacity-0" }, index.h("a", { href: "#!", innerHTML: LeftArrow, onClick: (e) => this.goToStep1(e) }), index.h("salla-button", { onClick: () => this.submitForm(), color: "primary", width: 'wide' }, index.h("span", null, this.sendGift)))))
20715
20732
  ], index.h("slot", { name: "footer" })))
20716
20733
  ];
20717
20734
  }
@@ -21028,13 +21045,34 @@ const MailIcon = `<!-- Generated by IcoMoon.io -->
21028
21045
  </svg>
21029
21046
  `;
21030
21047
 
21031
- const ArrowRightIcon = `<!-- Generated by IcoMoon.io -->
21048
+ const CameraIcon = `<!-- Generated by IcoMoon.io -->
21049
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
21050
+ <title>camera</title>
21051
+ <path d="M16 10.667c-4.044 0-7.333 3.289-7.333 7.333s3.289 7.333 7.333 7.333 7.333-3.289 7.333-7.333-3.289-7.333-7.333-7.333zM16 22.667c-2.573 0-4.667-2.093-4.667-4.667s2.093-4.667 4.667-4.667 4.667 2.093 4.667 4.667-2.093 4.667-4.667 4.667zM28 5.333h-3.287l-2.271-3.407c-0.248-0.371-0.664-0.593-1.109-0.593h-10.667c-0.445 0-0.861 0.223-1.109 0.593l-2.271 3.407h-3.287c-2.205 0-4 1.795-4 4v17.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-17.333c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.735-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.599-1.333-1.333v-17.333c0-0.735 0.599-1.333 1.333-1.333h4c0.445 0 0.861-0.223 1.109-0.593l2.272-3.407h9.239l2.271 3.407c0.248 0.371 0.664 0.593 1.109 0.593h4c0.735 0 1.333 0.599 1.333 1.333zM25.333 10.66c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327z"></path>
21052
+ </svg>
21053
+ `;
21054
+
21055
+ const ArrowRightIcon$1 = `<!-- Generated by IcoMoon.io -->
21032
21056
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
21033
21057
  <title>keyboard_arrow_right</title>
21034
21058
  <path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>
21035
21059
  </svg>
21036
21060
  `;
21037
21061
 
21062
+ const ArrowRightIcon = `<!-- Generated by IcoMoon.io -->
21063
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
21064
+ <title>arrow-right</title>
21065
+ <path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>
21066
+ </svg>
21067
+ `;
21068
+
21069
+ var CustomFieldType;
21070
+ (function (CustomFieldType) {
21071
+ CustomFieldType["TEXT"] = "text";
21072
+ CustomFieldType["NUMBER"] = "number";
21073
+ CustomFieldType["PHOTO"] = "photo";
21074
+ })(CustomFieldType || (CustomFieldType = {}));
21075
+
21038
21076
  const sallaLoginModalCss = "";
21039
21077
 
21040
21078
  const SallaLoginModal = class {
@@ -21059,6 +21097,11 @@ const SallaLoginModal = class {
21059
21097
  this.currentTabName = 'home';
21060
21098
  this.regType = 'phone';
21061
21099
  this.translationLoaded = false;
21100
+ this.dragAndDrop = salla.lang.get('common.uploader.drag_and_drop');
21101
+ this.browseFromFiles = salla.lang.get('common.uploader.browse');
21102
+ this.customFields = [];
21103
+ this.customFieldsValues = {};
21104
+ this.uploadedImage = undefined;
21062
21105
  this.typing = (e, submitMethod = null) => {
21063
21106
  const error = e.target.nextElementSibling;
21064
21107
  e.target.classList.remove('s-has-error');
@@ -21096,6 +21139,7 @@ const SallaLoginModal = class {
21096
21139
  phone: regPhone || this.loginTelInput.phone,
21097
21140
  country_code: countryCode,
21098
21141
  verified_by: this.regType,
21142
+ custom_fields: this.customFieldsValues,
21099
21143
  };
21100
21144
  emailValue && (data = Object.assign(Object.assign({}, data), { email: emailValue }));
21101
21145
  this.verifyTab.getCode()
@@ -21114,6 +21158,8 @@ const SallaLoginModal = class {
21114
21158
  salla.lang.onLoaded(() => {
21115
21159
  this.translationLoaded = true;
21116
21160
  this.title = salla.lang.get('blocks.header.login');
21161
+ this.dragAndDrop = salla.lang.get('common.uploader.drag_and_drop');
21162
+ this.browseFromFiles = salla.lang.get('common.uploader.browse');
21117
21163
  this.updateTranslations();
21118
21164
  });
21119
21165
  salla.event.on('login::open', (event) => this.open(event));
@@ -21127,7 +21173,7 @@ const SallaLoginModal = class {
21127
21173
  * @param {CustomEvent|{details:{case:'new_customer'|'authenticated', redirect_url:string|null}}} event
21128
21174
  */
21129
21175
  onVerified(event) {
21130
- var _a, _b;
21176
+ var _a, _b, _c, _d;
21131
21177
  salla.log('verified', event);
21132
21178
  //there is a case when force login is activated & is new user, it will return case inside error key., so cover it.
21133
21179
  let verifyCase = ((_a = event.detail) === null || _a === void 0 ? void 0 : _a.data.case) || ((_b = event.detail) === null || _b === void 0 ? void 0 : _b.error.case);
@@ -21136,6 +21182,7 @@ const SallaLoginModal = class {
21136
21182
  return;
21137
21183
  }
21138
21184
  if (verifyCase === "new_customer") {
21185
+ this.customFields = ((_d = (_c = event.detail) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.custom_fields) || [];
21139
21186
  return this.showTab(this.registrationTab);
21140
21187
  }
21141
21188
  if (!salla.auth.canRedirect()) {
@@ -21213,13 +21260,42 @@ const SallaLoginModal = class {
21213
21260
  }
21214
21261
  async newUserValidation() {
21215
21262
  const isLogByPhone = this.regType == "phone", isLogByEmail = this.regType == "email", emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value), isEmailValid = Helper$1.isValidEmail(emailValue), isFirstNameValid = this.firstName.value.length > 0, isLastNameValid = this.lastName.value.length > 0, isPhoneValid = await this.regTelInput.isValid() || isLogByPhone && await this.loginTelInput.isValid(), emailValidation = (emailValue && isEmailValid) || (!emailValue && !this.isEmailRequired);
21216
- if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid)
21263
+ // Custom Fields Validation
21264
+ var isCustomFieldValid = true;
21265
+ for (const item of this.customFieldsWrapper.children) {
21266
+ if (item.tagName == "SALLA-FILE-UPLOAD") {
21267
+ const fileUploader = item;
21268
+ this.customFieldsValues[fileUploader.id] = fileUploader.uploadedImage;
21269
+ if (fileUploader.required) {
21270
+ if (!fileUploader.uploadedImage) {
21271
+ isCustomFieldValid = false;
21272
+ const errorMsg = salla.lang.get('common.errors.field_required', { attribute: fileUploader.title });
21273
+ this.validateField(fileUploader, errorMsg);
21274
+ }
21275
+ }
21276
+ }
21277
+ if (item.tagName == "INPUT") {
21278
+ const inputItem = item;
21279
+ this.customFieldsValues[inputItem.id] = inputItem.value;
21280
+ if (inputItem.required) {
21281
+ if (inputItem.value.length == 0) {
21282
+ isCustomFieldValid = false;
21283
+ const errorMsg = salla.lang.get('common.errors.field_required', { attribute: inputItem.title });
21284
+ this.validateField(inputItem, errorMsg);
21285
+ }
21286
+ }
21287
+ }
21288
+ }
21289
+ if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid && isCustomFieldValid)
21217
21290
  return;
21218
21291
  !isEmailValid && this.validateField(this.regEmail, this.emailErrorMsg);
21219
21292
  !isFirstNameValid && this.validateField(this.firstName, this.firstNameErrorMsg);
21220
21293
  !isLastNameValid && this.validateField(this.lastName, this.lastNameErrorMsg);
21221
21294
  throw ('Please insert required fields');
21222
21295
  }
21296
+ getFilepondPlaceholder() {
21297
+ return `<div class="s-login-modal-filepond-placeholder"><span class="s-login-modal-filepond-placeholder-icon">${CameraIcon}</span><p class="s-login-modal-filepond-placeholder-text">${this.dragAndDrop}</p> <span class="filepond--label-action">${this.browseFromFiles}</span></div>`;
21298
+ }
21223
21299
  // eslint-disable-next-line @stencil/own-methods-must-be-private
21224
21300
  validateField(field, errorMsg) {
21225
21301
  field.classList.add('s-has-error');
@@ -21244,13 +21320,26 @@ const SallaLoginModal = class {
21244
21320
  // @ts-ignore
21245
21321
  // @ts-ignore
21246
21322
  return (index.h("salla-modal", { class: "s-login-modal", "modal-title": this.title, ref: modal => this.modal = modal, width: "xs" }, index.h("span", { slot: 'icon', class: "s-login-modal-header-icon", innerHTML: UserIcon }), index.h("div", { class: "s-login-modal-wrapper" }, this.isEmailAllowed && this.isMobileAllowed ?
21247
- index.h("div", { class: this.generateTabClasses('home'), "data-name": "home", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-modal-sub-title" }, salla.lang.get('blocks.header.select_login_way')), index.h("slot", { name: "before-login-type" }), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("span", { class: "s-login-modal-main-btn-icon", innerHTML: PhoneIcon }), index.h("span", { class: "s-login-modal-main-btn-text" }, salla.lang.get('blocks.header.sms')), index.h("span", { class: "s-login-modal-main-btn-arrow", innerHTML: ArrowRightIcon })), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) }, index.h("span", { class: "s-login-modal-main-btn-icon", innerHTML: MailIcon }), index.h("span", { class: "s-login-modal-main-btn-text" }, salla.lang.get('common.elements.email')), index.h("span", { class: "s-login-modal-main-btn-arrow", innerHTML: ArrowRightIcon })), index.h("slot", { name: "after-login-type" }))
21323
+ index.h("div", { class: this.generateTabClasses('home'), "data-name": "home", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-modal-sub-title" }, salla.lang.get('blocks.header.select_login_way')), index.h("slot", { name: "before-login-type" }), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("span", { class: "s-login-modal-main-btn-icon", innerHTML: PhoneIcon }), index.h("span", { class: "s-login-modal-main-btn-text" }, salla.lang.get('blocks.header.sms')), index.h("span", { class: "s-login-modal-main-btn-arrow", innerHTML: ArrowRightIcon$1 })), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) }, index.h("span", { class: "s-login-modal-main-btn-icon", innerHTML: MailIcon }), index.h("span", { class: "s-login-modal-main-btn-text" }, salla.lang.get('common.elements.email')), index.h("span", { class: "s-login-modal-main-btn-arrow", innerHTML: ArrowRightIcon$1 })), index.h("slot", { name: "after-login-type" }))
21248
21324
  : '', this.isMobileAllowed ?
21249
21325
  index.h("div", { class: this.generateTabClasses('login-phone'), "data-name": "login-phone", ref: tab => this.mobileTab = tab }, index.h("slot", { name: "before-login-mobile" }), index.h("form", { onSubmit: () => this.loginBySMS(event), method: "POST" }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), index.h("salla-tel-input", { tabindex: "0", ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e) }), index.h("salla-button", { type: "submit", "loader-position": 'center', width: "wide", ref: b => this.smsBtn = b }, salla.lang.get('blocks.header.enter'))), this.isEmailAllowed ?
21250
21326
  index.h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_email')) : '', index.h("slot", { name: "after-login-mobile" })) : '', this.isEmailAllowed ?
21251
21327
  index.h("div", { class: this.generateTabClasses('login-email'), "data-name": "login-email", ref: tab => this.emailTab = tab }, index.h("slot", { name: "before-login-email" }), index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("form", { onSubmit: () => this.loginByEmail(event), method: "POST" }, index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e), placeholder: "your@email.com", enterkeyhint: "next", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" }), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, salla.lang.get('blocks.header.enter'))), this.isMobileAllowed ?
21252
21328
  index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_sms'))
21253
- : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { display: "inline", "support-web-auth": this.supportWebAuth ? 'true' : 'false', class: this.generateTabClasses('otp'), "data-name": "otp", ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back", innerHTML: ArrowRightIcon$1, slot: "after-footer", href: "#" })), index.h("div", { "data-name": "registration", class: this.generateTabClasses('registration'), ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: this.generateRegClasses('phone') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { class: this.generateRegClasses('email') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')), index.h("slot", { name: "after-registration" })))));
21329
+ : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { display: "inline", "support-web-auth": this.supportWebAuth ? 'true' : 'false', class: this.generateTabClasses('otp'), "data-name": "otp", ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back", innerHTML: ArrowRightIcon, slot: "after-footer", href: "#" })), index.h("div", { "data-name": "registration", class: this.generateTabClasses('registration'), ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: this.generateRegClasses('phone') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { class: this.generateRegClasses('email') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: "s-login-modal-custom-fields", ref: el => this.customFieldsWrapper = el }, this.customFields.map((field) => {
21330
+ if (field.type === CustomFieldType.PHOTO) {
21331
+ return [
21332
+ index.h("label", { class: "s-login-modal-label" }, field.label),
21333
+ index.h("salla-file-upload", { "instant-upload": true, labelIdle: this.getFilepondPlaceholder(), id: `${field.id}`, title: field.label, required: field.required }),
21334
+ index.h("span", { class: "s-login-modal-error-message" })
21335
+ ];
21336
+ }
21337
+ return [
21338
+ index.h("label", { class: "s-login-modal-label" }, field.label),
21339
+ index.h("input", { type: "text", onKeyDown: e => this.typing(e, this.newUser), onInput: el => field.type == CustomFieldType.NUMBER ? salla.helpers.inputDigitsOnly(el.target) : {}, placeholder: field.description, required: field.required, title: field.label, id: `${field.id}`, class: "s-login-modal-input s-ltr" }),
21340
+ index.h("span", { class: "s-login-modal-error-message" })
21341
+ ];
21342
+ })), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')), index.h("slot", { name: "after-registration" })))));
21254
21343
  }
21255
21344
  get host() { return index.getElement(this); }
21256
21345
  };
@@ -21945,10 +22034,12 @@ const SallaMap = class {
21945
22034
  */
21946
22035
  this.searchable = false;
21947
22036
  /**
21948
- * Sets the start location.
22037
+ * Latitude coordinate, defaults to Mecca 🕋 ❤️
21949
22038
  */
21950
- // start in mecca 🕋 ❤️
21951
22039
  this.lat = 21.419421;
22040
+ /**
22041
+ * Longitude coordinate, defaults to Mecca 🕋 ❤️
22042
+ */
21952
22043
  this.lng = 39.82553;
21953
22044
  /**
21954
22045
  * Sets google api key value
@@ -21957,7 +22048,7 @@ const SallaMap = class {
21957
22048
  /**
21958
22049
  * Modal Title
21959
22050
  */
21960
- this.title = this.modalActivityTitle;
22051
+ this.modalTitle = this.modalActivityTitle;
21961
22052
  /**
21962
22053
  * Sets start map zoom.
21963
22054
  */
@@ -22121,7 +22212,7 @@ const SallaMap = class {
22121
22212
  }
22122
22213
  // rendering functions
22123
22214
  getLocationModal() {
22124
- return (index.h("div", null, index.h("div", { class: "s-map-modal-title" }, this.title), index.h("div", { class: "s-map-modal-body" }, index.h("div", { class: "s-map-element", ref: el => (this.mapElement = el) }), this.readonly ? "" :
22215
+ return (index.h("div", null, index.h("div", { class: "s-map-modal-title" }, this.modalTitle), index.h("div", { class: "s-map-modal-body" }, index.h("div", { class: "s-map-element", ref: el => (this.mapElement = el) }), this.readonly ? "" :
22125
22216
  [
22126
22217
  this.searchable && (index.h("div", { class: "s-map-search-wrapper" }, index.h("input", { class: "s-map-search-input", ref: el => (this.searchInput = el) }))),
22127
22218
  index.h("salla-button", { class: "s-map-my-location-button", onClick: () => {
@@ -22645,13 +22736,6 @@ const CheckCircleIcon = `<!-- Generated by IcoMoon.io -->
22645
22736
  </svg>
22646
22737
  `;
22647
22738
 
22648
- const CameraIcon = `<!-- Generated by IcoMoon.io -->
22649
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
22650
- <title>camera</title>
22651
- <path d="M16 10.667c-4.044 0-7.333 3.289-7.333 7.333s3.289 7.333 7.333 7.333 7.333-3.289 7.333-7.333-3.289-7.333-7.333-7.333zM16 22.667c-2.573 0-4.667-2.093-4.667-4.667s2.093-4.667 4.667-4.667 4.667 2.093 4.667 4.667-2.093 4.667-4.667 4.667zM28 5.333h-3.287l-2.271-3.407c-0.248-0.371-0.664-0.593-1.109-0.593h-10.667c-0.445 0-0.861 0.223-1.109 0.593l-2.271 3.407h-3.287c-2.205 0-4 1.795-4 4v17.333c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-17.333c0-2.205-1.795-4-4-4zM29.333 26.667c0 0.735-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.599-1.333-1.333v-17.333c0-0.735 0.599-1.333 1.333-1.333h4c0.445 0 0.861-0.223 1.109-0.593l2.272-3.407h9.239l2.271 3.407c0.248 0.371 0.664 0.593 1.109 0.593h4c0.735 0 1.333 0.599 1.333 1.333zM25.333 10.66c-0.736 0-1.333 0.604-1.333 1.34s0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333v-0.013c0-0.736-0.597-1.327-1.333-1.327z"></path>
22652
- </svg>
22653
- `;
22654
-
22655
22739
  const sallaProductOptionsCss = "";
22656
22740
 
22657
22741
  const SallaProductOptions = class {
@@ -22668,7 +22752,6 @@ const SallaProductOptions = class {
22668
22752
  this.dateTimeSelected = index.createEvent(this, "dateTimeSelected", 7);
22669
22753
  this.dateSelected = index.createEvent(this, "dateSelected", 7);
22670
22754
  this.timeSelected = index.createEvent(this, "timeSelected", 7);
22671
- this.optionsData = [];
22672
22755
  this.uploadedImage = undefined;
22673
22756
  this.outOfStockText = salla.lang.get("pages.products.out_of_stock");
22674
22757
  this.donationAmount = salla.lang.get('pages.products.donation_amount');
@@ -22676,16 +22759,22 @@ const SallaProductOptions = class {
22676
22759
  * The id of the product to which the options are going to be fetched for.
22677
22760
  */
22678
22761
  this.productId = salla.config.get('page.id');
22679
- if (this.options) {
22680
- this.optionsData = JSON.parse(this.options);
22681
- }
22682
- else if (this.productId) {
22683
- this.fetchProductOptions();
22684
- }
22685
22762
  salla.lang.onLoaded(() => {
22686
22763
  this.outOfStockText = salla.lang.get("pages.products.out_of_stock");
22687
22764
  this.donationAmount = salla.lang.get('pages.products.donation_amount');
22688
22765
  });
22766
+ if (this.options) {
22767
+ try {
22768
+ this.optionsData = JSON.parse(this.options);
22769
+ return;
22770
+ }
22771
+ catch (e) {
22772
+ salla.log('Bad json passed via options prop');
22773
+ }
22774
+ }
22775
+ if (this.productId && !salla.url.is_page('cart')) {
22776
+ salla.api.product.getDetails(this.productId, ['options']).then(resp => this.optionsData = resp.data.options);
22777
+ }
22689
22778
  }
22690
22779
  //todo:: typo here, but I think we will drop it anyway😌
22691
22780
  handleMultiSelectFieldInput() {
@@ -22696,14 +22785,6 @@ const SallaProductOptions = class {
22696
22785
  }
22697
22786
  this.itemsSelected.emit(multiSelectedItems);
22698
22787
  }
22699
- /**
22700
- * Image Selection
22701
- */
22702
- fetchProductOptions() {
22703
- return salla.api.product.getDetails(this.productId, ['options']).then(resp => {
22704
- this.optionsData = resp.data.options;
22705
- });
22706
- }
22707
22788
  getDisplayForType(option) {
22708
22789
  if (this[`${option.type}Option`]) {
22709
22790
  return this[`${option.type}Option`](option);
@@ -22717,29 +22798,20 @@ const SallaProductOptions = class {
22717
22798
  salla.log(`Couldn't find options type(${option.type})😢`);
22718
22799
  return '';
22719
22800
  }
22801
+ getOptionShownWhen(option) {
22802
+ return option.visibility_condition
22803
+ ? { "data-show-when": `options[${option.visibility_condition.option}] ${option.visibility_condition.operator} ${option.visibility_condition.value}` }
22804
+ : {};
22805
+ }
22720
22806
  render() {
22721
22807
  if (this.optionsData.length == 0) {
22722
22808
  return;
22723
22809
  }
22724
- return (index.h(index.Host, { class: "s-product-options-wrapper" }, index.h("salla-conditional-fields", null, this.optionsData.map((option) => index.h("div", { class: "s-product-options-option-container" }, option.name == 'splitter' ?
22810
+ return (index.h(index.Host, { class: "s-product-options-wrapper" }, index.h("salla-conditional-fields", null, this.optionsData.map((option) => index.h("div", Object.assign({ class: `s-product-options-option-container${option.visibility_condition ? ' hidden' : ''}` }, this.getOptionShownWhen(option)), option.name == 'splitter' ?
22725
22811
  this.splitterOption()
22726
22812
  : index.h("div", { class: "s-product-options-option" }, index.h("label", { htmlFor: 'options[' + option.id + ']', class: "s-product-options-option-label" }, index.h("b", null, option.name, option.required && index.h("span", null, " * "), " "), index.h("small", null, option.placeholder)), index.h("div", { class: "s-product-options-option-content" }, this.getDisplayForType(option))))))));
22727
22813
  }
22728
22814
  //@ts-ignore
22729
- colorOption(option) {
22730
- return index.h("fieldset", { class: "s-product-options-colors-wrapper" }, option === null || option === void 0 ? void 0 : option.details.map((value) => index.h("div", null, index.h("input", { onChange: e => this.colorSelected.emit(e), name: `color-choice-${option.id}`, id: `color-choice-${option.id}-${value.id}`, required: true, type: "radio" }), index.h("label", { htmlFor: `color-choice-${option.id}-${value.id}` }, index.h("span", { style: { "background-color": value.color } }), index.h("p", null, value.name)))));
22731
- }
22732
- //@ts-ignore
22733
- dateOption(option) {
22734
- //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23
22735
- return index.h("div", { class: "s-product-options-date-element" }, index.h("salla-datetime-picker", { onPicked: e => this.dateSelected.emit(e), placeholder: option.name }));
22736
- }
22737
- //@ts-ignore
22738
- datetimeOption(option) {
22739
- //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23
22740
- return index.h("div", { class: "s-product-options-datetime-element" }, index.h("salla-datetime-picker", { mode: "range", dateFormat: "Y-m-d G:i:K", enableTime: true, minDate: option.from_date_time, maxDate: option.to_date_time, placeholder: option.name, onPicked: e => this.dateTimeSelected.emit(e) }));
22741
- }
22742
- //@ts-ignore
22743
22815
  donationOption(option) {
22744
22816
  return index.h("div", { class: "s-product-options-donation-wrapper" }, index.h("input", { type: "text", id: "donating-amount", name: "donating_amount", class: "s-form-control", placeholder: option.placeholder, onInput: e => salla.helpers.inputDigitsOnly(e.target), onBlur: e => this.donationMoneyEntered.emit(e) }), index.h("span", { class: "s-product-options-donation-amount-currency" }, salla.config.currency(salla.config.get('user.currency_code')).symbol));
22745
22817
  }
@@ -22751,6 +22823,7 @@ const SallaProductOptions = class {
22751
22823
  this.uploader.querySelector('.filepond--root').style.height = '120px';
22752
22824
  }, 1000);
22753
22825
  }
22826
+ //todo:: why we need this way, use the native way!!
22754
22827
  //@ts-ignore
22755
22828
  selectThumbnail(e, value) {
22756
22829
  this.thumbnailSelected.emit(e);
@@ -22785,21 +22858,10 @@ const SallaProductOptions = class {
22785
22858
  imageOption(option) {
22786
22859
  return index.h("salla-file-upload", { "instant-upload": true, ref: element => this.uploader = element, "data-item-id": salla.url.is_page('cart') ? option.id : '', class: { "s-product-options-image-input": true, required: option.required }, labelIdle: this.getFilepondPlaceholder(), onRemove: () => this.setUploaderHeight(), serverConfig: this.getServerConfig(salla.cart.api.getUrl('cart/option-image'), salla.url.is_page('cart') ? option.id : null) });
22787
22860
  }
22788
- multipleOptions(option) {
22789
- return index.h("div", { ref: element => this.multipleOptionDom = element, class: { "s-product-options-multiple-options-wrapper": true, 'required': option.required } }, option === null || option === void 0 ? void 0 : option.details.map((value) => {
22790
- return index.h("div", null, index.h("input", { id: `field-${option.id}-${value.id}`, "aria-describedby": `options[${option.id}]-description`, name: `options[${option.id}]`, value: value.id, type: "checkbox", onChange: () => this.handleMultiSelectFieldInput() }), index.h("label", { htmlFor: `field-${option.id}-${value.id}` }, value.name));
22791
- }));
22792
- }
22793
22861
  //@ts-ignore
22794
22862
  numberOption(option) {
22795
22863
  return index.h("input", { placeholder: option.placeholder, name: `options[${option.id}]`, type: "text", onInput: e => salla.helpers.inputDigitsOnly(e.target), onBlur: e => this.numberOptionEntered.emit(e), class: "s-form-control" });
22796
22864
  }
22797
- singleOption(option) {
22798
- return index.h("div", null, index.h("select", { name: `options[${option.id}]`, required: option.required, class: "s-form-control" }, index.h("option", { value: "" }, option.placeholder), option === null || option === void 0 ? void 0 :
22799
- option.details.map((op) => {
22800
- return index.h("option", { onChange: e => this.singleSelectOptionSelected.emit(e), value: op.id }, op.name);
22801
- })));
22802
- }
22803
22865
  //@ts-ignore
22804
22866
  splitterOption() {
22805
22867
  return index.h("div", { class: "s-product-options-splitter" });
@@ -22812,18 +22874,54 @@ const SallaProductOptions = class {
22812
22874
  textareaOption(option) {
22813
22875
  return index.h("div", { class: "s-product-options-textarea" }, index.h("div", { class: "mt-1" }, index.h("textarea", { rows: 4, name: `options[${option.id}]`, required: option.required, id: `options[${option.id}]`, placeholder: option.placeholder, onInput: (e) => this.textareaOptionEntered.emit(e), class: "s-form-control" })));
22814
22876
  }
22877
+ /**
22878
+ * ============= Date Time options =============
22879
+ */
22880
+ //@ts-ignore
22881
+ timeOption(option) {
22882
+ return index.h("salla-datetime-picker", { class: "s-product-options-time-element", enableTime: true, placeholder: option.name, noCalendar: true, dateFormat: "h:i K", onPicked: e => this.timeSelected.emit(e) });
22883
+ }
22884
+ //@ts-ignore
22885
+ dateOption(option) {
22886
+ //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23
22887
+ return index.h("div", { class: "s-product-options-date-element" }, index.h("salla-datetime-picker", { onPicked: e => this.dateSelected.emit(e), placeholder: option.name }));
22888
+ }
22889
+ //@ts-ignore
22890
+ datetimeOption(option) {
22891
+ //todo:: consider date-range @see https://github.com/SallaApp/theme-raed/blob/master/src/assets/js/partials/product-options.js#L8-L23
22892
+ return index.h("div", { class: "s-product-options-datetime-element" }, index.h("salla-datetime-picker", { mode: "range", dateFormat: "Y-m-d G:i:K", enableTime: true, minDate: option.from_date_time, maxDate: option.to_date_time, placeholder: option.name, onPicked: e => this.dateTimeSelected.emit(e) }));
22893
+ }
22894
+ /**
22895
+ * ============= Advanced options =============
22896
+ */
22897
+ getOptionDetailName(detail, outOfStock = true) {
22898
+ return detail.name
22899
+ + ((outOfStock && detail.is_out) ? ` - ${this.outOfStockText}` : '')
22900
+ + (detail.additional_price ? ` (${salla.money(detail.additional_price)})` : '');
22901
+ }
22902
+ singleOption(option) {
22903
+ return index.h("div", null, index.h("select", { name: `options[${option.id}]`, required: option.required, class: "s-form-control" }, index.h("option", { value: "" }, option.placeholder), option === null || option === void 0 ? void 0 :
22904
+ option.details.map((detail) => {
22905
+ return index.h("option", { value: detail.id, disabled: detail.is_out, selected: detail.is_selected, onChange: e => this.singleSelectOptionSelected.emit(e) }, this.getOptionDetailName(detail));
22906
+ })));
22907
+ }
22908
+ multipleOptions(option) {
22909
+ return index.h("div", { ref: element => this.multipleOptionDom = element, class: { "s-product-options-multiple-options-wrapper": true, 'required': option.required } }, option === null || option === void 0 ? void 0 : option.details.map((detail) => {
22910
+ return index.h("div", null, index.h("input", { type: "checkbox", value: detail.id, disabled: detail.is_out, checked: detail.is_selected, name: `options[${option.id}]`, id: `field-${option.id}-${detail.id}`, onChange: () => this.handleMultiSelectFieldInput(), "aria-describedby": `options[${option.id}]-description` }), index.h("label", { htmlFor: `field-${option.id}-${detail.id}` }, this.getOptionDetailName(detail)));
22911
+ }));
22912
+ }
22913
+ //@ts-ignore
22914
+ colorOption(option) {
22915
+ return index.h("fieldset", { class: "s-product-options-colors-wrapper" }, option === null || option === void 0 ? void 0 : option.details.map((detail) => index.h("div", null, index.h("input", { type: "radio", value: detail.id, disabled: detail.is_out, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, id: `color-${this.productId}-${option.id}-${detail.id}`, onChange: e => this.colorSelected.emit(e) }), index.h("label", { htmlFor: `color-${this.productId}-${option.id}-${detail.id}` }, index.h("span", { style: { "background-color": detail.color } }), index.h("p", null, this.getOptionDetailName(detail))))));
22916
+ }
22815
22917
  //@ts-ignore
22816
22918
  thumbnailOption(option) {
22817
22919
  return index.h("div", { class: "s-product-options-thumbnails-wrapper" }, option.details.map((detail) => {
22818
- return index.h("div", null, index.h("input", { required: option.required, type: "radio", id: `option_${option.id}_${detail.id}`, disabled: detail.is_out, "data-itemid": detail.id, name: `options[${option.id}]`, "data-img-id": detail.option_value, value: detail.option_value, onChange: (e) => this.selectThumbnail(e, detail.option_value) }), index.h("label", { htmlFor: `option_${option.id}_${detail.id}`, "data-img-id": detail.option_value, class: "go-to-slide" }, index.h("img", { "data-src": detail.image, src: detail.image, title: detail.name, alt: detail.name }), index.h("span", { innerHTML: CheckCircleIcon, class: "s-product-options-thumbnails-icon" })), index.h("p", null, detail.name, " "), detail.is_out ?
22920
+ return index.h("div", null, index.h("input", { type: "radio", value: detail.id, "data-itemid": detail.id, disabled: detail.is_out, required: option.required, checked: detail.is_selected, name: `options[${option.id}]`, "data-img-id": detail.option_value, id: `option_${this.productId}-${option.id}_${detail.id}`, onChange: (e) => this.selectThumbnail(e, detail.option_value) }), index.h("label", { htmlFor: `option_${this.productId}-${option.id}_${detail.id}`, "data-img-id": detail.option_value, class: "go-to-slide" }, index.h("img", { "data-src": detail.image, src: detail.image, title: detail.name, alt: detail.name }), index.h("span", { innerHTML: CheckCircleIcon, class: "s-product-options-thumbnails-icon" })), index.h("p", null, this.getOptionDetailName(detail, false), " "), detail.is_out ?
22819
22921
  [index.h("small", { class: "s-product-options-thumbnails-stock-badge" }, this.outOfStockText), index.h("div", { class: "s-product-options-thumbnails-badge-overlay" })]
22820
22922
  : '');
22821
22923
  }));
22822
22924
  }
22823
- //@ts-ignore
22824
- timeOption(option) {
22825
- return index.h("salla-datetime-picker", { class: "s-product-options-time-element", enableTime: true, placeholder: option.name, noCalendar: true, dateFormat: "h:i K", onPicked: e => this.timeSelected.emit(e) });
22826
- }
22827
22925
  };
22828
22926
  SallaProductOptions.style = sallaProductOptionsCss;
22829
22927
 
@@ -23773,6 +23871,10 @@ const SallaSwiper = class {
23773
23871
  * Vertical or Horizontal thumbs slider
23774
23872
  */
23775
23873
  this.verticalThumbs = false;
23874
+ /**
23875
+ * Vertical or Horizontal main slider
23876
+ */
23877
+ this.vertical = false;
23776
23878
  /**
23777
23879
  * Auto Height slider
23778
23880
  */
@@ -23849,13 +23951,22 @@ const SallaSwiper = class {
23849
23951
  slidesPerView: 'auto',
23850
23952
  spaceBetween: 0,
23851
23953
  },
23852
- fullscreen: {
23954
+ fullwidth: {
23853
23955
  speed: 750,
23854
23956
  parallax: true,
23855
23957
  autoplay: {
23856
23958
  delay: 5000,
23857
23959
  },
23858
23960
  },
23961
+ fullscreen: {
23962
+ speed: 1000,
23963
+ parallax: true,
23964
+ direction: "vertical",
23965
+ followFinger: false,
23966
+ touchReleaseOnEdges: true,
23967
+ lazy: true,
23968
+ mousewheel: {}
23969
+ },
23859
23970
  testimonials: {
23860
23971
  draggable: true,
23861
23972
  slidesPerView: 1,
@@ -24064,11 +24175,14 @@ const SallaSwiper = class {
24064
24175
  } : false,
24065
24176
  breakpoints: {
24066
24177
  768: {
24067
- direction: this.verticalThumbs ? "vertical" : "horizontal",
24178
+ direction: this.vertical ? "vertical" : "horizontal",
24068
24179
  },
24069
24180
  },
24070
24181
  };
24071
- pre_defined_config = Object.assign(Object.assign({}, pre_defined_config), (this.pre_defined_config[this.type] || {}));
24182
+ this.pre_defined_config.fullscreen.mousewheel = {
24183
+ releaseOnEdges: this.host.querySelectorAll('.swiper-slide').length > 1 ? false : true
24184
+ },
24185
+ pre_defined_config = Object.assign(Object.assign({}, pre_defined_config), (this.pre_defined_config[this.type] || {}));
24072
24186
  if (this.type == 'thumbs') {
24073
24187
  for (const slide of this.thumbsSliderWrapper.children) {
24074
24188
  //todo:: use `s-slider-slide`
@@ -24113,7 +24227,13 @@ const SallaSwiper = class {
24113
24227
  });
24114
24228
  this.slider.on('reachBeginning', (slider) => this.reachBeginning.emit(slider));
24115
24229
  this.slider.on('reachEnd', (slider) => this.reachEnd.emit(slider));
24116
- this.slider.on('slideChangeTransitionEnd', (slider) => this.slideChangeTransitionEnd.emit(slider));
24230
+ this.slider.on('slideChangeTransitionEnd', (slider) => {
24231
+ if (this.type == "fullscreen") {
24232
+ const activeIndex = slider.activeIndex;
24233
+ slider.params.mousewheel.releaseOnEdges = activeIndex === 0 || (activeIndex === slider.slides.length - 1);
24234
+ }
24235
+ this.slideChangeTransitionEnd.emit(slider);
24236
+ });
24117
24237
  this.slider.on('slideChangeTransitionStart', (slider) => this.slideChangeTransitionStart.emit(slider));
24118
24238
  this.slider.on('slideNextTransitionEnd', (slider) => this.slideNextTransitionEnd.emit(slider));
24119
24239
  this.slider.on('slideNextTransitionStart', (slider) => this.slideNextTransitionStart.emit(slider));
@@ -24138,9 +24258,9 @@ const SallaSwiper = class {
24138
24258
  : '', index.h("div", { class: "s-slider-block__title-left" }, this.displayAllUrl ?
24139
24259
  index.h("a", { href: this.displayAllUrl, class: "s-slider-block__display-all" }, this.displayAllTitle)
24140
24260
  : '', this.showControls ?
24141
- index.h("div", { class: "s-slider-block__title-nav", dir: "rtl" }, index.h("button", { "aria-label": "Previous Slide", class: "s-slider-prev s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.isRTL ? ArrowRightIcon : ArrowLeftIcon })), index.h("button", { "aria-label": "Next Slide", class: "s-slider-next s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.isRTL ? ArrowLeftIcon : ArrowRightIcon })))
24261
+ index.h("div", { class: "s-slider-block__title-nav", dir: "rtl" }, index.h("button", { "aria-label": "Previous Slide", class: "s-slider-prev s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.isRTL ? ArrowRightIcon$1 : ArrowLeftIcon })), index.h("button", { "aria-label": "Next Slide", class: "s-slider-next s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.isRTL ? ArrowLeftIcon : ArrowRightIcon$1 })))
24142
24262
  : ''))
24143
- : '', index.h("div", { class: "swiper s-slider-container", ref: el => this.sliderContainer = el }, index.h("slot", null), index.h("div", { class: "swiper-wrapper s-slider-swiper-wrapper", ref: el => this.sliderWrapper = el }, index.h("slot", { name: 'items' })), this.pagination ? index.h("div", { class: "swiper-pagination" }) : ''), this.type == 'thumbs' ? index.h("div", { class: "s-slider-thumbs" }, index.h("div", { class: "swiper s-slider-thumbs-container", ref: el => this.thumbsSliderContainer = el }, index.h("div", { class: "s-slider-swiper-wrapper swiper-wrapper", ref: el => this.thumbsSliderWrapper = el }, index.h("slot", { name: "thumbs" })), this.showThumbsControls ? [index.h("div", { class: "s-slider-button s-slider-button-prev" }, index.h("salla-button", { disabled: this.isRTL ? (_a = this.thumbsSlider) === null || _a === void 0 ? void 0 : _a.isEnd : (_b = this.thumbsSlider) === null || _b === void 0 ? void 0 : _b.isBeginning, shape: "icon", color: "light", onClick: () => this.isRTL ? this.thumbsSlider.slideNext() : this.thumbsSlider.slidePrev() }, index.h("span", { class: "s-slider-button-icon", innerHTML: salla.config.get('theme.is_rtl') ? ArrowLeftIcon : ArrowRightIcon }))), index.h("div", { class: "s-slider-button s-slider-button-next" }, index.h("salla-button", { disabled: this.isRTL ? (_c = this.thumbsSlider) === null || _c === void 0 ? void 0 : _c.isBeginning : (_d = this.thumbsSlider) === null || _d === void 0 ? void 0 : _d.isEnd, shape: "icon", color: "light", onClick: () => this.isRTL ? this.thumbsSlider.slidePrev() : this.thumbsSlider.slideNext() }, index.h("span", { class: "s-slider-button-icon", innerHTML: salla.config.get('theme.is_rtl') ? ArrowRightIcon : ArrowLeftIcon })))] : '')) : ''));
24263
+ : '', index.h("div", { class: "swiper s-slider-container", ref: el => this.sliderContainer = el }, index.h("slot", null), index.h("div", { class: "swiper-wrapper s-slider-swiper-wrapper", ref: el => this.sliderWrapper = el }, index.h("slot", { name: 'items' })), this.pagination ? index.h("div", { class: "swiper-pagination" }) : ''), this.type == 'thumbs' ? index.h("div", { class: "s-slider-thumbs" }, index.h("div", { class: "swiper s-slider-thumbs-container", ref: el => this.thumbsSliderContainer = el }, index.h("div", { class: "s-slider-swiper-wrapper swiper-wrapper", ref: el => this.thumbsSliderWrapper = el }, index.h("slot", { name: "thumbs" })), this.showThumbsControls ? [index.h("div", { class: "s-slider-button s-slider-button-prev" }, index.h("salla-button", { disabled: this.isRTL && !this.verticalThumbs ? (_a = this.thumbsSlider) === null || _a === void 0 ? void 0 : _a.isEnd : (_b = this.thumbsSlider) === null || _b === void 0 ? void 0 : _b.isBeginning, shape: "icon", color: "light", onClick: () => this.isRTL && !this.verticalThumbs ? this.thumbsSlider.slideNext() : this.thumbsSlider.slidePrev() }, index.h("span", { class: "s-slider-button-icon", innerHTML: salla.config.get('theme.is_rtl') ? ArrowLeftIcon : ArrowRightIcon$1 }))), index.h("div", { class: "s-slider-button s-slider-button-next" }, index.h("salla-button", { disabled: this.isRTL && !this.verticalThumbs ? (_c = this.thumbsSlider) === null || _c === void 0 ? void 0 : _c.isBeginning : (_d = this.thumbsSlider) === null || _d === void 0 ? void 0 : _d.isEnd, shape: "icon", color: "light", onClick: () => this.isRTL && !this.verticalThumbs ? this.thumbsSlider.slidePrev() : this.thumbsSlider.slideNext() }, index.h("span", { class: "s-slider-button-icon", innerHTML: salla.config.get('theme.is_rtl') ? ArrowRightIcon$1 : ArrowLeftIcon })))] : '')) : ''));
24144
24264
  }
24145
24265
  componentDidLoad() {
24146
24266
  let itemsSlot = this.sliderWrapper.querySelector('div[slot="items"]');
@@ -25947,7 +26067,6 @@ const SallaUserMenu = class {
25947
26067
  this.hello = salla.lang.get("pages.checkout.hello");
25948
26068
  this.first_name = salla.storage.get('user.first_name') || '';
25949
26069
  this.last_name = salla.storage.get('user.last_name') || '';
25950
- this.has_red_dot = salla.storage.get('user.notifications') || salla.storage.get('user.pending_orders');
25951
26070
  this.avatar = salla.storage.get('user.avatar') || salla.url.cdn('images/avatar.png');
25952
26071
  this.badges = {
25953
26072
  notifications: salla.helpers.number(salla.storage.get('user.notifications') || 0),
@@ -26032,7 +26151,7 @@ const SallaUserMenu = class {
26032
26151
  salla.auth.logout();
26033
26152
  }
26034
26153
  getTheHeader() {
26035
- return index.h("div", { class: { 's-user-menu-trigger-slot': true, 's-user-menu-red-dot': this.has_red_dot, 's-user-menu-trigger-avatar-only': this.avatarOnly }, id: 'trigger-slot', onClick: (e) => this.open(e), innerHTML: this.triggerSlot
26154
+ return index.h("div", { class: { 's-user-menu-trigger-slot': true, 's-user-menu-red-dot': this.badges.pending_orders || this.badges.notifications, 's-user-menu-trigger-avatar-only': this.avatarOnly }, id: 'trigger-slot', onClick: (e) => this.open(e), innerHTML: this.triggerSlot
26036
26155
  .replace(/\{hello\}/g, this.hello)
26037
26156
  .replace(/\{first_name\}/g, this.first_name)
26038
26157
  .replace(/\{last_name\}/g, this.last_name)