@salla.sa/twilight-components 1.5.9 → 1.5.10

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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const index = require('./index-d43334bf.js');
8
+ const index = require('./index-0d0167d5.js');
9
9
 
10
10
  /*
11
11
  Stencil Client Patch Esm v2.17.4 | MIT Licensed | https://stenciljs.com
@@ -5,7 +5,7 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const index = require('./index-d43334bf.js');
8
+ const index = require('./index-0d0167d5.js');
9
9
 
10
10
  const sallaAddProductButtonCss = ":host{display:block}salla-add-product-button[width=wide]{width:100%}";
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const index$1 = require('./index-d43334bf.js');
8
+ const index$1 = require('./index-0d0167d5.js');
9
9
  const search = require('./search-b487cc49.js');
10
10
 
11
11
  const sallaButtonCss = "";
@@ -5,7 +5,7 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const index = require('./index-d43334bf.js');
8
+ const index = require('./index-0d0167d5.js');
9
9
 
10
10
  const SallaConditionalFields = class {
11
11
  constructor(hostRef) {
@@ -5,7 +5,7 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const index = require('./index-d43334bf.js');
8
+ const index = require('./index-0d0167d5.js');
9
9
 
10
10
  const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#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(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.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 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.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 .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;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.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}";
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
- const index = require('./index-d43334bf.js');
8
+ const index = require('./index-0d0167d5.js');
9
9
  const search = require('./search-b487cc49.js');
10
10
 
11
11
  const StoreAlt = `<!-- Generated by IcoMoon.io -->
@@ -3,7 +3,7 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const index = require('./index-d43334bf.js');
6
+ const index = require('./index-0d0167d5.js');
7
7
 
8
8
  /*
9
9
  Stencil Client Patch Browser v2.17.4 | MIT Licensed | https://stenciljs.com
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { p as promiseResolve, b as bootstrapLazy } from './index-c78562f8.js';
4
+ import { p as promiseResolve, b as bootstrapLazy } from './index-4e30ffd0.js';
5
5
 
6
6
  /*
7
7
  Stencil Client Patch Esm v2.17.4 | MIT Licensed | https://stenciljs.com
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c78562f8.js';
4
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-4e30ffd0.js';
5
5
 
6
6
  const sallaAddProductButtonCss = ":host{display:block}salla-add-product-button[width=wide]{width:100%}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-c78562f8.js';
4
+ import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-4e30ffd0.js';
5
5
  import { S as Search } from './search-19ea3313.js';
6
6
 
7
7
  const sallaButtonCss = "";
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host, g as getElement } from './index-c78562f8.js';
4
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-4e30ffd0.js';
5
5
 
6
6
  const SallaConditionalFields = class {
7
7
  constructor(hostRef) {
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-c78562f8.js';
4
+ import { r as registerInstance, h, H as Host } from './index-4e30ffd0.js';
5
5
 
6
6
  const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#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(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.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 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.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 .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;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.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}";
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { r as registerInstance, h, H as Host } from './index-c78562f8.js';
4
+ import { r as registerInstance, h, H as Host } from './index-4e30ffd0.js';
5
5
  import { S as Search } from './search-19ea3313.js';
6
6
 
7
7
  const StoreAlt = `<!-- Generated by IcoMoon.io -->
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import { p as promiseResolve, b as bootstrapLazy } from './index-c78562f8.js';
4
+ import { p as promiseResolve, b as bootstrapLazy } from './index-4e30ffd0.js';
5
5
 
6
6
  /*
7
7
  Stencil Client Patch Browser v2.17.4 | MIT Licensed | https://stenciljs.com
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as e,h as t,H as l,g as n}from"./p-336eda99.js";const i=class{constructor(t){e(this,t)}changeHandler(e){var t;if(salla.log("Received the change event: ",e),!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type")))return void salla.log("Ignore the change because is not support input: "+((null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.tagName)||"N/A"));let l=e.target.name.replace("[]",""),n="checkbox"===e.target.getAttribute("type");salla.log("Trying to find all the element with condition:",`[data-show-when^="${l}"]`),this.host.querySelectorAll(`[data-show-when^="${l}"]`).forEach((t=>{let l,i=!(null==t?void 0:t.dataset.showWhen.includes("!=")),a=null==t?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();l=n?Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>null==e?void 0:e.value)).includes(a.toString()):a===e.target.value,salla.log("The input is ",n?"Multiple":"Single"," value:",l),i&&l||!i&&!l?(t.classList.remove("hidden"),t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled"),!["checkbox"].includes(e.getAttribute("type"))&&t.getElementsByClassName("required").length&&e.setAttribute("required","")}))):(t.classList.add("hidden"),t.querySelectorAll("[name]").forEach((e=>{e.setAttribute("disabled",""),e.removeAttribute("required"),["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")&&(e.checked=!1)})))}))}componentDidRender(){this.host.querySelectorAll("[data-show-when]").forEach((e=>{var t;let l=null===(t=null==e?void 0:e.dataset)||void 0===t?void 0:t.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();l&&this.changeHandler({target:this.host.querySelector('[name^="'+l+'"]')})}))}render(){return t(l,null,t("slot",null))}get host(){return n(this)}};export{i as salla_conditional_fields}
4
+ import{r as e,h as t,H as l,g as n}from"./p-1503d976.js";const i=class{constructor(t){e(this,t)}changeHandler(e){var t;if(salla.log("Received the change event: ",e),!e.target||!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type")))return void salla.log("Ignore the change because is not support input: "+((null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.tagName)||"N/A"));let l=e.target.name.replace("[]",""),n="checkbox"===e.target.getAttribute("type");salla.log("Trying to find all the element with condition:",`[data-show-when^="${l}"]`),this.host.querySelectorAll(`[data-show-when^="${l}"]`).forEach((t=>{let l,i=!(null==t?void 0:t.dataset.showWhen.includes("!=")),a=null==t?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();l=n?Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>null==e?void 0:e.value)).includes(a.toString()):a===e.target.value,salla.log("The input is ",n?"Multiple":"Single"," value:",l),i&&l||!i&&!l?(t.classList.remove("hidden"),t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled"),!["checkbox"].includes(e.getAttribute("type"))&&t.getElementsByClassName("required").length&&e.setAttribute("required","")}))):(t.classList.add("hidden"),t.querySelectorAll("[name]").forEach((e=>{e.setAttribute("disabled",""),e.removeAttribute("required"),["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")&&(e.checked=!1)})))}))}componentDidRender(){this.host.querySelectorAll("[data-show-when]").forEach((e=>{var t;let l=null===(t=null==e?void 0:e.dataset)||void 0===t?void 0:t.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();l&&this.changeHandler({target:this.host.querySelector('[name^="'+l+'"]')})}))}render(){return t(l,null,t("slot",null))}get host(){return n(this)}};export{i as salla_conditional_fields}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as t,h as o,H as r}from"./p-336eda99.js";const a=class{constructor(o){t(this,o),this.tabbyBorderRemoved=!1,this.tabbyRemoveBorderTries=0,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),salla.onReady((()=>{const t=salla.config.get("store.settings.installments");t&&(this.tamaraIsActive=-1!=t.indexOf("tamara_installment"),this.tabbyIsActive=-1!=t.indexOf("tabby_installment"),this.spotiiIsActive=-1!=t.indexOf("spotii_pay"))}))}render(){return o(r,null,this.tamaraIsActive?o("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"}):"",this.tabbyIsActive?o("div",{id:"tabbyPromoWrapper"},o("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?o("div",{class:"spotii-wrapper"},o("div",{class:"spotii-promo"})):"")}componentDidLoad(){if(this.tamaraIsActive&&((t=document.createElement("script")).setAttribute("src","https://cdn.tamara.co/widget/product-widget.min.js"),document.head.appendChild(t),t.onload=()=>{window.TamaraProductWidget.init({lang:this.language}),setTimeout((()=>{window.TamaraProductWidget.render()}),300)}),this.tabbyIsActive&&((t=document.createElement("script")).setAttribute("src","https://checkout.tabby.ai/tabby-promo.js"),document.head.appendChild(t),t.onload=()=>{new(0,window.TabbyPromo)({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language}),document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))},this.removeTabbyBorder()),this.spotiiIsActive){let o=salla.money((Number(this.price)/4).toFixed(2)),r=salla.config.get("theme.is_rtl",!0);var t;window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:4,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+o+"${logo} ${info}",textOne:r?"جزء الدفع على":"Split it into",textTwo:r?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price},(t=document.createElement("script")).setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js")),document.head.appendChild(t)}}removeTabbyBorder(){this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5||(this.tabbyRemoveBorderTries++,setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null,t?(t.style="border: none; margin: 15px 0!important;",this.tabbyBorderRemoved=!0):this.removeTabbyBorder()}),500*this.tabbyRemoveBorderTries))}};a.style="#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#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(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.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 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.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 .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;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.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}";export{a as salla_installment}
4
+ import{r as t,h as o,H as r}from"./p-1503d976.js";const a=class{constructor(o){t(this,o),this.tabbyBorderRemoved=!1,this.tabbyRemoveBorderTries=0,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),salla.onReady((()=>{const t=salla.config.get("store.settings.installments");t&&(this.tamaraIsActive=-1!=t.indexOf("tamara_installment"),this.tabbyIsActive=-1!=t.indexOf("tabby_installment"),this.spotiiIsActive=-1!=t.indexOf("spotii_pay"))}))}render(){return o(r,null,this.tamaraIsActive?o("div",{class:"tamara-product-widget","data-price":this.price,"data-currency":this.currency,"data-lang":this.language,"data-payment-type":"installment"}):"",this.tabbyIsActive?o("div",{id:"tabbyPromoWrapper"},o("div",{id:"tabbyPromo"})):"",this.spotiiIsActive?o("div",{class:"spotii-wrapper"},o("div",{class:"spotii-promo"})):"")}componentDidLoad(){if(this.tamaraIsActive&&((t=document.createElement("script")).setAttribute("src","https://cdn.tamara.co/widget/product-widget.min.js"),document.head.appendChild(t),t.onload=()=>{window.TamaraProductWidget.init({lang:this.language}),setTimeout((()=>{window.TamaraProductWidget.render()}),300)}),this.tabbyIsActive&&((t=document.createElement("script")).setAttribute("src","https://checkout.tabby.ai/tabby-promo.js"),document.head.appendChild(t),t.onload=()=>{new(0,window.TabbyPromo)({selector:"#tabbyPromo",currency:this.currency,price:this.price,lang:this.language}),document.querySelectorAll(".tabby-promo-snippet__logo").forEach((function(t){t.setAttribute("aria-label","Tabby Logo")}))},this.removeTabbyBorder()),this.spotiiIsActive){let o=salla.money((Number(this.price)/4).toFixed(2)),r=salla.config.get("theme.is_rtl",!0);var t;window.spotiiConfig={targetXPath:[".spotii-wrapper"],renderToPath:[".spotii-promo"],numberOfPayment:4,currency:this.currency,templateLine:"${textOne} ${number} ${textTwo} "+o+"${logo} ${info}",textOne:r?"جزء الدفع على":"Split it into",textTwo:r?"أقساط متساوية بدون تكاليف اضافية بقيمة":"payments of",textThree:"مع",price:this.price},(t=document.createElement("script")).setAttribute("src",salla.url.cdn("js/price-widget-ar-salla.js")),document.head.appendChild(t)}}removeTabbyBorder(){this.tabbyBorderRemoved||this.tabbyRemoveBorderTries>5||(this.tabbyRemoveBorderTries++,setTimeout((()=>{let t=document.querySelector("#tabbyPromo>div>div");t=t?t.shadowRoot.querySelector('div[class^="styles__tabby-promo-snippet--"]'):null,t?(t.style="border: none; margin: 15px 0!important;",this.tabbyBorderRemoved=!0):this.removeTabbyBorder()}),500*this.tabbyRemoveBorderTries))}};a.style="#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#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(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.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 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.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 .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;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.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}";export{a as salla_installment}
@@ -1,4 +1,4 @@
1
1
  /*!
2
2
  * Crafted with ❤ by Salla
3
3
  */
4
- import{r as s,h as t,H as e}from"./p-336eda99.js";import{S as l}from"./p-475ef754.js";var i;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(i||(i={}));const a=class{constructor(t){s(this,t),this.mode=i.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{var s;return(null===(s=this.originalScopesList)||void 0===s?void 0:s.length)<2?"":this.mode===i.DEFAULT?this.shoppingFromAnotherBranch:this.searchForAvailabilityInOtherBranch},salla.event.on("scopes::open",(({mode:s=null,product_id:t=null})=>{this.open(s,t)})),salla.lang.onLoaded((()=>{this.branchNotFound=salla.lang.get("blocks.scope.branch_looking_for_not_found"),this.ourServiceIsNotFound=salla.lang.get("blocks.scope.our_services_not_available_in_this_branch"),this.searchForAvailabilityInOtherBranch=salla.lang.get("blocks.scope.search_for_availability_in_other_branches"),this.shoppingFromAnotherBranch=salla.lang.get("blocks.scope.shopping_from_another_branch"),this.nowBrowsingFrom=salla.lang.get("blocks.scope.you_are_browse_store_from"),this.confirmButton=salla.lang.get("common.elements.confirm"),this.scopeSearchPlaceholder=salla.lang.get("blocks.scope.searching_for_a_branch")}))}async close(){var s;return await(null===(s=this.modal)||void 0===s?void 0:s.close())}async open(s=i.DEFAULT,t=null){return this.setScopeValues([]),this.mode=void 0!==s&&[i.AVAILABILITY,i.DEFAULT].includes(s)?s:i.DEFAULT,this.modal.loading(),this.modal.open(),await(s==i.AVAILABILITY?salla.scope.getProductAvailability(t):salla.scope.get()).then((t=>{this.setScopeValues(s==i.AVAILABILITY?t.data:t.data.scopes)})).catch((s=>console.log(s))).finally((()=>{this.modal.stopLoading()}))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),window.location.search.includes("?")&&(window.location.search+="&"),window.location.search+="scope="+this.current_scope.id})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s.length?(this.current_scope=s[0],this.selected_scope=s[0]):(this.current_scope=s.find((s=>s.selected)),this.selected_scope=s.find((s=>s.selected)))}handleSearchFieldTyping(s){let t=s.target.value.toLocaleLowerCase();this.scopes=t?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(t))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes.find((t=>t.id==s.target.value))}placeholderContent(){return t("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},t("span",{slot:"title"},this.branchNotFound),t("span",{slot:"description"},this.ourServiceIsNotFound))}defaultContent(){return[t("div",{class:"s-scopes-container s-scrollbar"},this.scopes.map((s=>t("div",{class:"s-scopes-input-wrap","data-selection":this.selection},t("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),t("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},t("span",null,s.name)))))),this.footerContent()]}availabilityContent(){return t("div",{class:"s-scopes-container"},this.scopes.map((s=>{var e,l,a,o,h,c;return t("div",{class:"s-scopes-input-wrap","data-selection":this.selection},t("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===i.DEFAULT}},t("span",null,s.name)),t("h2",{style:{color:null===(l=null===(e=s)||void 0===e?void 0:e.availability)||void 0===l?void 0:l.color},class:`s-scopes-${null===(o=null===(a=s)||void 0===a?void 0:a.availability)||void 0===o?void 0:o.key}`},null===(c=null===(h=s)||void 0===h?void 0:h.availability)||void 0===c?void 0:c.label))})))}footerContent(){return t("div",{class:"s-scopes-footer"},t("slot",{name:"footer"},t("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},this.confirmButton)))}render(){return t(e,null,t("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:!0,"has-skeleton":!0},t("div",{slot:"loading"},t("div",{class:"s-scopes-skeleton"},t("salla-list-tile",{class:"s-scopes-header"},t("div",{slot:"icon",class:"s-scopes-header-icon"},t("salla-skeleton",{type:"circle"})),t("div",{slot:"title",class:"s-scopes-header-title mb-5"},t("salla-skeleton",{height:"15px",width:"50%"})),t("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},t("salla-skeleton",{height:"10px"}),t("salla-skeleton",{height:"10px",width:"75%"}))),t("div",{class:"s-scopes-skeleton-search"},t("salla-skeleton",{height:"10px",width:"50%"}),t("salla-skeleton",{height:"30px",width:"100%"})),t("div",{class:"s-scopes-skeleton-scopes"},t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"})),t("div",{class:"s-scopes-skeleton-btn"},t("salla-skeleton",{height:"40px",width:"100%"})))),t("salla-list-tile",{class:this.originalScopesList.length?"s-scopes-header block":"s-hidden"},t("div",{slot:"icon",class:"s-scopes-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),t("div",{slot:"title",class:"s-scopes-header-title"},this.nowBrowsingFrom),t("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),t("div",{class:"s-scopes-wrap"},!!this.originalScopesList.length&&t("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList.length>this.searchDisplayLimit?t("div",{class:"s-scopes-search-wrapper"},t("div",{class:"s-scopes-search-icon",innerHTML:l}),t("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),placeholder:this.scopeSearchPlaceholder})):"",this.scopes.length<2?this.placeholderContent():this.mode===i.DEFAULT?this.defaultContent():this.availabilityContent())))}componentDidLoad(){this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};a.style=".s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}";export{a as salla_scopes}
4
+ import{r as s,h as t,H as e}from"./p-1503d976.js";import{S as l}from"./p-475ef754.js";var i;!function(s){s.DEFAULT="default",s.AVAILABILITY="availability"}(i||(i={}));const a=class{constructor(t){s(this,t),this.mode=i.DEFAULT,this.scopes=[],this.originalScopesList=[],this.isOpenedBefore=salla.storage.get("branch-choosed-before"),this.selection="optional",this.searchDisplayLimit=6,this.getFormTitle=()=>{var s;return(null===(s=this.originalScopesList)||void 0===s?void 0:s.length)<2?"":this.mode===i.DEFAULT?this.shoppingFromAnotherBranch:this.searchForAvailabilityInOtherBranch},salla.event.on("scopes::open",(({mode:s=null,product_id:t=null})=>{this.open(s,t)})),salla.lang.onLoaded((()=>{this.branchNotFound=salla.lang.get("blocks.scope.branch_looking_for_not_found"),this.ourServiceIsNotFound=salla.lang.get("blocks.scope.our_services_not_available_in_this_branch"),this.searchForAvailabilityInOtherBranch=salla.lang.get("blocks.scope.search_for_availability_in_other_branches"),this.shoppingFromAnotherBranch=salla.lang.get("blocks.scope.shopping_from_another_branch"),this.nowBrowsingFrom=salla.lang.get("blocks.scope.you_are_browse_store_from"),this.confirmButton=salla.lang.get("common.elements.confirm"),this.scopeSearchPlaceholder=salla.lang.get("blocks.scope.searching_for_a_branch")}))}async close(){var s;return await(null===(s=this.modal)||void 0===s?void 0:s.close())}async open(s=i.DEFAULT,t=null){return this.setScopeValues([]),this.mode=void 0!==s&&[i.AVAILABILITY,i.DEFAULT].includes(s)?s:i.DEFAULT,this.modal.loading(),this.modal.open(),await(s==i.AVAILABILITY?salla.scope.getProductAvailability(t):salla.scope.get()).then((t=>{this.setScopeValues(s==i.AVAILABILITY?t.data:t.data.scopes)})).catch((s=>console.log(s))).finally((()=>{this.modal.stopLoading()}))}async handleSubmit(){let s={id:this.current_scope.id};return this.changeBtn.load(),await salla.scope.change(s).then((()=>{salla.storage.set("branch-choosed-before",!0),salla.storage.set("scope",{type:this.current_scope.type,id:this.current_scope.id}),window.location.search.includes("?")&&(window.location.search+="&"),window.location.search+="scope="+this.current_scope.id})).catch((s=>console.log(s))).finally((()=>{this.changeBtn.stop()}))}setScopeValues(s){this.scopes=s,this.originalScopesList=s,1==s.length?(this.current_scope=s[0],this.selected_scope=s[0]):(this.current_scope=s.find((s=>s.selected)),this.selected_scope=s.find((s=>s.selected)))}handleSearchFieldTyping(s){let t=s.target.value.toLocaleLowerCase();this.scopes=t?this.originalScopesList.filter((s=>s.name.toLowerCase().includes(t))):this.originalScopesList}handleScopeSelection(s){this.current_scope=this.scopes.find((t=>t.id==s.target.value))}placeholderContent(){return t("salla-placeholder",{alignment:"center",class:"s-scopes-placeholder"},t("span",{slot:"title"},this.branchNotFound),t("span",{slot:"description"},this.ourServiceIsNotFound))}defaultContent(){return[t("div",{class:"s-scopes-container s-scrollbar"},this.scopes.map((s=>t("div",{class:"s-scopes-input-wrap","data-selection":this.selection},t("input",{id:`${this.selection} + '_scope_' + ${s.id}`,name:"lang",type:"radio",value:s.id,onChange:s=>this.handleScopeSelection(s),class:"s-scopes-input",checked:!!this.current_scope&&this.current_scope.id==s.id}),t("label",{htmlFor:`${this.selection} + '_scope_' + ${s.id}`,class:"s-scopes-label s-scopes-clickable"},t("span",null,s.name)))))),this.footerContent()]}availabilityContent(){return t("div",{class:"s-scopes-container"},this.scopes.map((s=>{var e,l,a,o,h,c;return t("div",{class:"s-scopes-input-wrap","data-selection":this.selection},t("h2",{class:{"s-scopes-label":!0,"s-scopes-clickable":this.mode===i.DEFAULT}},t("span",null,s.name)),t("h2",{style:{color:null===(l=null===(e=s)||void 0===e?void 0:e.availability)||void 0===l?void 0:l.color},class:`s-scopes-${null===(o=null===(a=s)||void 0===a?void 0:a.availability)||void 0===o?void 0:o.key}`},null===(c=null===(h=s)||void 0===h?void 0:h.availability)||void 0===c?void 0:c.label))})))}footerContent(){return t("div",{class:"s-scopes-footer"},t("slot",{name:"footer"},t("salla-button",{ref:s=>this.changeBtn=s,disabled:!this.current_scope,onClick:()=>this.handleSubmit(),class:"s-scopes-submit","loader-position":"center",width:"wide"},this.confirmButton)))}render(){return t(e,null,t("salla-modal",{ref:s=>this.modal=s,isClosable:!(!this.isOpenedBefore&&"optional"!=this.selection),class:"s-scopes-modal",isLoading:!0,"has-skeleton":!0},t("div",{slot:"loading"},t("div",{class:"s-scopes-skeleton"},t("salla-list-tile",{class:"s-scopes-header"},t("div",{slot:"icon",class:"s-scopes-header-icon"},t("salla-skeleton",{type:"circle"})),t("div",{slot:"title",class:"s-scopes-header-title mb-5"},t("salla-skeleton",{height:"15px",width:"50%"})),t("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},t("salla-skeleton",{height:"10px"}),t("salla-skeleton",{height:"10px",width:"75%"}))),t("div",{class:"s-scopes-skeleton-search"},t("salla-skeleton",{height:"10px",width:"50%"}),t("salla-skeleton",{height:"30px",width:"100%"})),t("div",{class:"s-scopes-skeleton-scopes"},t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"}),t("salla-skeleton",{height:"10px",width:"30%"}),t("salla-skeleton",{height:"10px",width:"25%"})),t("div",{class:"s-scopes-skeleton-btn"},t("salla-skeleton",{height:"40px",width:"100%"})))),t("salla-list-tile",{class:this.originalScopesList.length?"s-scopes-header block":"s-hidden"},t("div",{slot:"icon",class:"s-scopes-header-icon",innerHTML:'\x3c!-- Generated by IcoMoon.io --\x3e\n<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">\n<title>store-alt</title>\n<path d="M6.667 24h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333zM31.86 10.071l-4-8c-0.227-0.452-0.688-0.737-1.193-0.737h-21.333c-0.505 0-0.967 0.285-1.193 0.737l-4 8c-0.092 0.184-0.14 0.389-0.14 0.596v18.667c0 0.737 0.597 1.333 1.333 1.333h29.333c0.736 0 1.333-0.596 1.333-1.333v-18.667c0-0.207-0.048-0.412-0.14-0.596zM6.157 4h19.685l3.333 6.667h-26.352zM24 28h-5.333v-9.333h5.333zM29.333 28h-2.667v-10.667c0-0.737-0.597-1.333-1.333-1.333h-8c-0.736 0-1.333 0.596-1.333 1.333v10.667h-13.333v-14.667h26.667zM6.667 18.667h5.333c0.736 0 1.333-0.596 1.333-1.333s-0.597-1.333-1.333-1.333h-5.333c-0.736 0-1.333 0.596-1.333 1.333s0.597 1.333 1.333 1.333z"></path>\n</svg>\n'}),t("div",{slot:"title",class:"s-scopes-header-title"},this.nowBrowsingFrom),t("div",{slot:"subtitle",class:"s-scopes-header-subtitle"},this.selected_scope?this.selected_scope.name:"")),t("div",{class:"s-scopes-wrap"},!!this.originalScopesList.length&&t("h4",{class:"s-scopes-title"},this.getFormTitle()),this.originalScopesList.length>this.searchDisplayLimit?t("div",{class:"s-scopes-search-wrapper"},t("div",{class:"s-scopes-search-icon",innerHTML:l}),t("input",{type:"text",class:"s-scopes-search-input",onInput:s=>this.handleSearchFieldTyping(s),placeholder:this.scopeSearchPlaceholder})):"",this.scopes.length<2?this.placeholderContent():this.mode===i.DEFAULT?this.defaultContent():this.availabilityContent())))}componentDidLoad(){this.isOpenedBefore||"mandatory"!=this.selection||this.open()}};a.style=".s-scopes-availability-content{display:flex;justify-content:center;align-items:center}.s-scopes-placeholder{flex:0 0 85%}";export{a as salla_scopes}