@salla.sa/twilight-components 1.0.90 → 1.0.91
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.
- package/dist/cjs/{index-3771e52a.js → index-fdf99836.js} +87 -8
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/salla-add-product-button_6.cjs.entry.js +1 -1
- package/dist/cjs/salla-branches.cjs.entry.js +1 -1
- package/dist/cjs/salla-conditional-fields.cjs.entry.js +1 -1
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-offer-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-quantity-input.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-rating-stars.cjs.entry.js +1 -1
- package/dist/cjs/salla-sizes-table.cjs.entry.js +22 -0
- package/dist/cjs/salla-verify-modal.cjs.entry.js +1 -1
- package/dist/cjs/twilight-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-sizes-table/salla-sizes-table.css +6 -0
- package/dist/collection/components/salla-sizes-table/salla-sizes-table.js +18 -0
- package/dist/components/salla-sizes-table.d.ts +11 -0
- package/dist/components/salla-sizes-table.js +37 -0
- package/dist/esm/{index-ee729716.js → index-4ffd4317.js} +87 -8
- package/dist/esm/loader.js +2 -2
- package/dist/esm/salla-add-product-button_6.entry.js +1 -1
- package/dist/esm/salla-branches.entry.js +1 -1
- package/dist/esm/salla-conditional-fields.entry.js +1 -1
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-offer-modal.entry.js +1 -1
- package/dist/esm/salla-quantity-input.entry.js +1 -1
- package/dist/esm/salla-rating-modal.entry.js +1 -1
- package/dist/esm/salla-rating-stars.entry.js +1 -1
- package/dist/esm/salla-sizes-table.entry.js +18 -0
- package/dist/esm/salla-verify-modal.entry.js +1 -1
- package/dist/esm/twilight-components.js +2 -2
- package/dist/twilight-components/{p-bf40f6f1.entry.js → p-0fbee559.entry.js} +1 -1
- package/dist/twilight-components/p-1d0e664c.js +4 -0
- package/dist/twilight-components/{p-df4b151d.entry.js → p-210f5278.entry.js} +1 -1
- package/dist/twilight-components/{p-a3d34b2e.entry.js → p-2384537d.entry.js} +1 -1
- package/dist/twilight-components/{p-82c5917e.entry.js → p-37e0a91d.entry.js} +1 -1
- package/dist/twilight-components/{p-5c1d4ef9.entry.js → p-56065da6.entry.js} +1 -1
- package/dist/twilight-components/{p-d624d6f0.entry.js → p-74df54ad.entry.js} +1 -1
- package/dist/twilight-components/{p-49cfbb48.entry.js → p-baf8dbbd.entry.js} +1 -1
- package/dist/twilight-components/{p-65ad6994.entry.js → p-cc422c09.entry.js} +1 -1
- package/dist/twilight-components/{p-83949474.entry.js → p-cf78ba07.entry.js} +1 -1
- package/dist/twilight-components/p-d762e16f.entry.js +4 -0
- package/dist/twilight-components/{p-28622e78.entry.js → p-d77dd260.entry.js} +1 -1
- package/dist/twilight-components/{p-de046a3a.entry.js → p-ecaee6a4.entry.js} +1 -1
- package/dist/twilight-components/{p-d898a2f4.entry.js → p-edbb12b2.entry.js} +1 -1
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-sizes-table/salla-sizes-table.d.ts +3 -0
- package/dist/types/components.d.ts +13 -0
- package/package.json +1 -1
- package/dist/twilight-components/p-d566f357.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as i,h as t,g as p}from"./p-d566f357.js";import{H as _}from"./p-9d2ca9c8.js";const o=class{constructor(t){var p,o;i(this,t),this.languages=[],this.currencies=[],this.isLoading=!0,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),_.setHost(this.host),salla.event.on("localization::open",(()=>this.open())),salla.lang.onLoaded((()=>{var i;this.languagesTitle=salla.lang.get("common.titles.language"),this.currenciesTitle=salla.lang.get("common.titles.currency"),null===(i=this.btn)||void 0===i||i.setText(salla.lang.get("common.elements.ok"))})),this.languageSlot=(null===(p=_.getElement('[slot="language"]'))||void 0===p?void 0:p.innerHTML)||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span><div class="s-localization-modal-flag flag iti__flag iti__{country_code}"></div></label>',this.currencySlot=(null===(o=_.getElement('[slot="currency"]'))||void 0===o?void 0:o.innerHTML)||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{code}</small></label>'}async open(){return this.modal.open().then((()=>this.getLanguages())).then((()=>this.getCurrencies())).then((()=>this.isLoading=!1))}async close(){return this.modal.close()}async getLanguages(){return this.language=this.language||salla.config.get("user.language_code"),this.languages.length>1?null:await salla.config.languages().then((i=>this.languages=i))}async getCurrencies(){return this.currency=this.currency||salla.config.get("user.currency_code"),this.currencies.length>1?null:await salla.config.currencies().then((i=>this.currencies=i))}onChangeCurrency(i){this.currency=i.target.value}onChangeLanguage(i){this.language=i.target.value}async submit(){let i;this.btn.load().then((()=>{if(this.currency){if(this.currency!==salla.config.get("user.currency_code","SAR"))return i=window.location.href,salla.currency.api.change(this.currency)}else salla.log("There is no currency!")})).then((()=>this.language===salla.config.get("user.language_code","ar")||(i=salla.helpers.addParamToUrl("lang",this.language)))).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>i&&(window.location.href=i)))}render(){return t("salla-modal",{isLoading:this.isLoading,id:"salla-localization",class:"s-hidden",ref:i=>this.modal=i,width:"xs"},this.isLoading?"":t("div",{class:"s-localization-modal-inner"},this.languages.length>1?t("div",{class:"s-localization-modal-section"},t("label",{class:"s-localization-modal-title"},this.languagesTitle),t("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((i=>t("div",{class:"s-localization-modal-item"},t("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==i.iso_code,onChange:()=>this.language=i.iso_code,name:"language",id:"lang-"+i.code.toLowerCase(),value:i.code}),t("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,i.name).replace(/\{code\}/g,i.code).replace(/\{country_code\}/g,i.country_code)})))):t("select",{class:"s-localization-modal-select",name:"currency",onChange:i=>this.onChangeLanguage(i)},this.languages.map((i=>t("option",{value:i.code,selected:this.language==i.code},i.name)))))):"",this.currencies.length>1?t("div",{class:"s-localization-modal-section"},t("label",{class:"s-localization-modal-title"},this.currenciesTitle),t("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((i=>t("div",{class:"s-localization-modal-item"},t("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==i.code,onChange:()=>this.currency=i.code,id:"currency-"+i.code,value:i.code}),t("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,i.name).replace(/\{code\}/g,i.code).replace(/\{country_code\}/g,i.country_code)})))):t("select",{class:"s-localization-modal-select",name:"currency",onChange:i=>this.onChangeCurrency(i)},this.currencies.map((i=>t("option",{value:i.code,selected:this.currency==i.code},i.name)))))):"",t("salla-button",{wide:!0,ref:i=>this.btn=i,onClick:()=>this.submit()},salla.lang.get("common.elements.ok"))))}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((i=>i.replaceWith(i.firstChild))),this.host.querySelectorAll("#language-slot").forEach((i=>i.replaceWith(i.firstChild)))}get host(){return p(this)}};o.style='#salla-localization .s-localization-modal-label-slot{flex-grow:1}#salla-localization .s-localization-modal-select{appearance:none;-webkit-appearance:none}.iti__flag{width:20px}.iti__flag.iti__be{width:18px}.iti__flag.iti__ch{width:15px}.iti__flag.iti__mc{width:19px}.iti__flag.iti__ne{width:18px}.iti__flag.iti__np{width:13px}.iti__flag.iti__va{width:15px}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-size:5652px 15px}}.iti__flag.iti__ac{height:10px;background-position:0px 0px}.iti__flag.iti__ad{height:14px;background-position:-22px 0px}.iti__flag.iti__ae{height:10px;background-position:-44px 0px}.iti__flag.iti__af{height:14px;background-position:-66px 0px}.iti__flag.iti__ag{height:14px;background-position:-88px 0px}.iti__flag.iti__ai{height:10px;background-position:-110px 0px}.iti__flag.iti__al{height:15px;background-position:-132px 0px}.iti__flag.iti__am{height:10px;background-position:-154px 0px}.iti__flag.iti__ao{height:14px;background-position:-176px 0px}.iti__flag.iti__aq{height:14px;background-position:-198px 0px}.iti__flag.iti__ar{height:13px;background-position:-220px 0px}.iti__flag.iti__as{height:10px;background-position:-242px 0px}.iti__flag.iti__at{height:14px;background-position:-264px 0px}.iti__flag.iti__au{height:10px;background-position:-286px 0px}.iti__flag.iti__aw{height:14px;background-position:-308px 0px}.iti__flag.iti__ax{height:13px;background-position:-330px 0px}.iti__flag.iti__az{height:10px;background-position:-352px 0px}.iti__flag.iti__ba{height:10px;background-position:-374px 0px}.iti__flag.iti__bb{height:14px;background-position:-396px 0px}.iti__flag.iti__bd{height:12px;background-position:-418px 0px}.iti__flag.iti__be{height:15px;background-position:-440px 0px}.iti__flag.iti__bf{height:14px;background-position:-460px 0px}.iti__flag.iti__bg{height:12px;background-position:-482px 0px}.iti__flag.iti__bh{height:12px;background-position:-504px 0px}.iti__flag.iti__bi{height:12px;background-position:-526px 0px}.iti__flag.iti__bj{height:14px;background-position:-548px 0px}.iti__flag.iti__bl{height:14px;background-position:-570px 0px}.iti__flag.iti__bm{height:10px;background-position:-592px 0px}.iti__flag.iti__bn{height:10px;background-position:-614px 0px}.iti__flag.iti__bo{height:14px;background-position:-636px 0px}.iti__flag.iti__bq{height:14px;background-position:-658px 0px}.iti__flag.iti__br{height:14px;background-position:-680px 0px}.iti__flag.iti__bs{height:10px;background-position:-702px 0px}.iti__flag.iti__bt{height:14px;background-position:-724px 0px}.iti__flag.iti__bv{height:15px;background-position:-746px 0px}.iti__flag.iti__bw{height:14px;background-position:-768px 0px}.iti__flag.iti__by{height:10px;background-position:-790px 0px}.iti__flag.iti__bz{height:14px;background-position:-812px 0px}.iti__flag.iti__ca{height:10px;background-position:-834px 0px}.iti__flag.iti__cc{height:10px;background-position:-856px 0px}.iti__flag.iti__cd{height:15px;background-position:-878px 0px}.iti__flag.iti__cf{height:14px;background-position:-900px 0px}.iti__flag.iti__cg{height:14px;background-position:-922px 0px}.iti__flag.iti__ch{height:15px;background-position:-944px 0px}.iti__flag.iti__ci{height:14px;background-position:-961px 0px}.iti__flag.iti__ck{height:10px;background-position:-983px 0px}.iti__flag.iti__cl{height:14px;background-position:-1005px 0px}.iti__flag.iti__cm{height:14px;background-position:-1027px 0px}.iti__flag.iti__cn{height:14px;background-position:-1049px 0px}.iti__flag.iti__co{height:14px;background-position:-1071px 0px}.iti__flag.iti__cp{height:14px;background-position:-1093px 0px}.iti__flag.iti__cr{height:12px;background-position:-1115px 0px}.iti__flag.iti__cu{height:10px;background-position:-1137px 0px}.iti__flag.iti__cv{height:12px;background-position:-1159px 0px}.iti__flag.iti__cw{height:14px;background-position:-1181px 0px}.iti__flag.iti__cx{height:10px;background-position:-1203px 0px}.iti__flag.iti__cy{height:14px;background-position:-1225px 0px}.iti__flag.iti__cz{height:14px;background-position:-1247px 0px}.iti__flag.iti__de{height:12px;background-position:-1269px 0px}.iti__flag.iti__dg{height:10px;background-position:-1291px 0px}.iti__flag.iti__dj{height:14px;background-position:-1313px 0px}.iti__flag.iti__dk{height:15px;background-position:-1335px 0px}.iti__flag.iti__dm{height:10px;background-position:-1357px 0px}.iti__flag.iti__do{height:14px;background-position:-1379px 0px}.iti__flag.iti__dz{height:14px;background-position:-1401px 0px}.iti__flag.iti__ea{height:14px;background-position:-1423px 0px}.iti__flag.iti__ec{height:14px;background-position:-1445px 0px}.iti__flag.iti__ee{height:13px;background-position:-1467px 0px}.iti__flag.iti__eg{height:14px;background-position:-1489px 0px}.iti__flag.iti__eh{height:10px;background-position:-1511px 0px}.iti__flag.iti__er{height:10px;background-position:-1533px 0px}.iti__flag.iti__es{height:14px;background-position:-1555px 0px}.iti__flag.iti__et{height:10px;background-position:-1577px 0px}.iti__flag.iti__eu{height:14px;background-position:-1599px 0px}.iti__flag.iti__fi{height:12px;background-position:-1621px 0px}.iti__flag.iti__fj{height:10px;background-position:-1643px 0px}.iti__flag.iti__fk{height:10px;background-position:-1665px 0px}.iti__flag.iti__fm{height:11px;background-position:-1687px 0px}.iti__flag.iti__fo{height:15px;background-position:-1709px 0px}.iti__flag.iti__fr{height:14px;background-position:-1731px 0px}.iti__flag.iti__ga{height:15px;background-position:-1753px 0px}.iti__flag.iti__gb{height:10px;background-position:-1775px 0px}.iti__flag.iti__gd{height:12px;background-position:-1797px 0px}.iti__flag.iti__ge{height:14px;background-position:-1819px 0px}.iti__flag.iti__gf{height:14px;background-position:-1841px 0px}.iti__flag.iti__gg{height:14px;background-position:-1863px 0px}.iti__flag.iti__gh{height:14px;background-position:-1885px 0px}.iti__flag.iti__gi{height:10px;background-position:-1907px 0px}.iti__flag.iti__gl{height:14px;background-position:-1929px 0px}.iti__flag.iti__gm{height:14px;background-position:-1951px 0px}.iti__flag.iti__gn{height:14px;background-position:-1973px 0px}.iti__flag.iti__gp{height:14px;background-position:-1995px 0px}.iti__flag.iti__gq{height:14px;background-position:-2017px 0px}.iti__flag.iti__gr{height:14px;background-position:-2039px 0px}.iti__flag.iti__gs{height:10px;background-position:-2061px 0px}.iti__flag.iti__gt{height:13px;background-position:-2083px 0px}.iti__flag.iti__gu{height:11px;background-position:-2105px 0px}.iti__flag.iti__gw{height:10px;background-position:-2127px 0px}.iti__flag.iti__gy{height:12px;background-position:-2149px 0px}.iti__flag.iti__hk{height:14px;background-position:-2171px 0px}.iti__flag.iti__hm{height:10px;background-position:-2193px 0px}.iti__flag.iti__hn{height:10px;background-position:-2215px 0px}.iti__flag.iti__hr{height:10px;background-position:-2237px 0px}.iti__flag.iti__ht{height:12px;background-position:-2259px 0px}.iti__flag.iti__hu{height:10px;background-position:-2281px 0px}.iti__flag.iti__ic{height:14px;background-position:-2303px 0px}.iti__flag.iti__id{height:14px;background-position:-2325px 0px}.iti__flag.iti__ie{height:10px;background-position:-2347px 0px}.iti__flag.iti__il{height:15px;background-position:-2369px 0px}.iti__flag.iti__im{height:10px;background-position:-2391px 0px}.iti__flag.iti__in{height:14px;background-position:-2413px 0px}.iti__flag.iti__io{height:10px;background-position:-2435px 0px}.iti__flag.iti__iq{height:14px;background-position:-2457px 0px}.iti__flag.iti__ir{height:12px;background-position:-2479px 0px}.iti__flag.iti__is{height:15px;background-position:-2501px 0px}.iti__flag.iti__it{height:14px;background-position:-2523px 0px}.iti__flag.iti__je{height:12px;background-position:-2545px 0px}.iti__flag.iti__jm{height:10px;background-position:-2567px 0px}.iti__flag.iti__jo{height:10px;background-position:-2589px 0px}.iti__flag.iti__jp{height:14px;background-position:-2611px 0px}.iti__flag.iti__ke{height:14px;background-position:-2633px 0px}.iti__flag.iti__kg{height:12px;background-position:-2655px 0px}.iti__flag.iti__kh{height:13px;background-position:-2677px 0px}.iti__flag.iti__ki{height:10px;background-position:-2699px 0px}.iti__flag.iti__km{height:12px;background-position:-2721px 0px}.iti__flag.iti__kn{height:14px;background-position:-2743px 0px}.iti__flag.iti__kp{height:10px;background-position:-2765px 0px}.iti__flag.iti__kr{height:14px;background-position:-2787px 0px}.iti__flag.iti__kw{height:10px;background-position:-2809px 0px}.iti__flag.iti__ky{height:10px;background-position:-2831px 0px}.iti__flag.iti__kz{height:10px;background-position:-2853px 0px}.iti__flag.iti__la{height:14px;background-position:-2875px 0px}.iti__flag.iti__lb{height:14px;background-position:-2897px 0px}.iti__flag.iti__lc{height:10px;background-position:-2919px 0px}.iti__flag.iti__li{height:12px;background-position:-2941px 0px}.iti__flag.iti__lk{height:10px;background-position:-2963px 0px}.iti__flag.iti__lr{height:11px;background-position:-2985px 0px}.iti__flag.iti__ls{height:14px;background-position:-3007px 0px}.iti__flag.iti__lt{height:12px;background-position:-3029px 0px}.iti__flag.iti__lu{height:12px;background-position:-3051px 0px}.iti__flag.iti__lv{height:10px;background-position:-3073px 0px}.iti__flag.iti__ly{height:10px;background-position:-3095px 0px}.iti__flag.iti__ma{height:14px;background-position:-3117px 0px}.iti__flag.iti__mc{height:15px;background-position:-3139px 0px}.iti__flag.iti__md{height:10px;background-position:-3160px 0px}.iti__flag.iti__me{height:10px;background-position:-3182px 0px}.iti__flag.iti__mf{height:14px;background-position:-3204px 0px}.iti__flag.iti__mg{height:14px;background-position:-3226px 0px}.iti__flag.iti__mh{height:11px;background-position:-3248px 0px}.iti__flag.iti__mk{height:10px;background-position:-3270px 0px}.iti__flag.iti__ml{height:14px;background-position:-3292px 0px}.iti__flag.iti__mm{height:14px;background-position:-3314px 0px}.iti__flag.iti__mn{height:10px;background-position:-3336px 0px}.iti__flag.iti__mo{height:14px;background-position:-3358px 0px}.iti__flag.iti__mp{height:10px;background-position:-3380px 0px}.iti__flag.iti__mq{height:14px;background-position:-3402px 0px}.iti__flag.iti__mr{height:14px;background-position:-3424px 0px}.iti__flag.iti__ms{height:10px;background-position:-3446px 0px}.iti__flag.iti__mt{height:14px;background-position:-3468px 0px}.iti__flag.iti__mu{height:14px;background-position:-3490px 0px}.iti__flag.iti__mv{height:14px;background-position:-3512px 0px}.iti__flag.iti__mw{height:14px;background-position:-3534px 0px}.iti__flag.iti__mx{height:12px;background-position:-3556px 0px}.iti__flag.iti__my{height:10px;background-position:-3578px 0px}.iti__flag.iti__mz{height:14px;background-position:-3600px 0px}.iti__flag.iti__na{height:14px;background-position:-3622px 0px}.iti__flag.iti__nc{height:10px;background-position:-3644px 0px}.iti__flag.iti__ne{height:15px;background-position:-3666px 0px}.iti__flag.iti__nf{height:10px;background-position:-3686px 0px}.iti__flag.iti__ng{height:10px;background-position:-3708px 0px}.iti__flag.iti__ni{height:12px;background-position:-3730px 0px}.iti__flag.iti__nl{height:14px;background-position:-3752px 0px}.iti__flag.iti__no{height:15px;background-position:-3774px 0px}.iti__flag.iti__np{height:15px;background-position:-3796px 0px}.iti__flag.iti__nr{height:10px;background-position:-3811px 0px}.iti__flag.iti__nu{height:10px;background-position:-3833px 0px}.iti__flag.iti__nz{height:10px;background-position:-3855px 0px}.iti__flag.iti__om{height:10px;background-position:-3877px 0px}.iti__flag.iti__pa{height:14px;background-position:-3899px 0px}.iti__flag.iti__pe{height:14px;background-position:-3921px 0px}.iti__flag.iti__pf{height:14px;background-position:-3943px 0px}.iti__flag.iti__pg{height:15px;background-position:-3965px 0px}.iti__flag.iti__ph{height:10px;background-position:-3987px 0px}.iti__flag.iti__pk{height:14px;background-position:-4009px 0px}.iti__flag.iti__pl{height:13px;background-position:-4031px 0px}.iti__flag.iti__pm{height:14px;background-position:-4053px 0px}.iti__flag.iti__pn{height:10px;background-position:-4075px 0px}.iti__flag.iti__pr{height:14px;background-position:-4097px 0px}.iti__flag.iti__ps{height:10px;background-position:-4119px 0px}.iti__flag.iti__pt{height:14px;background-position:-4141px 0px}.iti__flag.iti__pw{height:13px;background-position:-4163px 0px}.iti__flag.iti__py{height:11px;background-position:-4185px 0px}.iti__flag.iti__qa{height:8px;background-position:-4207px 0px}.iti__flag.iti__re{height:14px;background-position:-4229px 0px}.iti__flag.iti__ro{height:14px;background-position:-4251px 0px}.iti__flag.iti__rs{height:14px;background-position:-4273px 0px}.iti__flag.iti__ru{height:14px;background-position:-4295px 0px}.iti__flag.iti__rw{height:14px;background-position:-4317px 0px}.iti__flag.iti__sa{height:14px;background-position:-4339px 0px}.iti__flag.iti__sb{height:10px;background-position:-4361px 0px}.iti__flag.iti__sc{height:10px;background-position:-4383px 0px}.iti__flag.iti__sd{height:10px;background-position:-4405px 0px}.iti__flag.iti__se{height:13px;background-position:-4427px 0px}.iti__flag.iti__sg{height:14px;background-position:-4449px 0px}.iti__flag.iti__sh{height:10px;background-position:-4471px 0px}.iti__flag.iti__si{height:10px;background-position:-4493px 0px}.iti__flag.iti__sj{height:15px;background-position:-4515px 0px}.iti__flag.iti__sk{height:14px;background-position:-4537px 0px}.iti__flag.iti__sl{height:14px;background-position:-4559px 0px}.iti__flag.iti__sm{height:15px;background-position:-4581px 0px}.iti__flag.iti__sn{height:14px;background-position:-4603px 0px}.iti__flag.iti__so{height:14px;background-position:-4625px 0px}.iti__flag.iti__sr{height:14px;background-position:-4647px 0px}.iti__flag.iti__ss{height:10px;background-position:-4669px 0px}.iti__flag.iti__st{height:10px;background-position:-4691px 0px}.iti__flag.iti__sv{height:12px;background-position:-4713px 0px}.iti__flag.iti__sx{height:14px;background-position:-4735px 0px}.iti__flag.iti__sy{height:14px;background-position:-4757px 0px}.iti__flag.iti__sz{height:14px;background-position:-4779px 0px}.iti__flag.iti__ta{height:10px;background-position:-4801px 0px}.iti__flag.iti__tc{height:10px;background-position:-4823px 0px}.iti__flag.iti__td{height:14px;background-position:-4845px 0px}.iti__flag.iti__tf{height:14px;background-position:-4867px 0px}.iti__flag.iti__tg{height:13px;background-position:-4889px 0px}.iti__flag.iti__th{height:14px;background-position:-4911px 0px}.iti__flag.iti__tj{height:10px;background-position:-4933px 0px}.iti__flag.iti__tk{height:10px;background-position:-4955px 0px}.iti__flag.iti__tl{height:10px;background-position:-4977px 0px}.iti__flag.iti__tm{height:14px;background-position:-4999px 0px}.iti__flag.iti__tn{height:14px;background-position:-5021px 0px}.iti__flag.iti__to{height:10px;background-position:-5043px 0px}.iti__flag.iti__tr{height:14px;background-position:-5065px 0px}.iti__flag.iti__tt{height:12px;background-position:-5087px 0px}.iti__flag.iti__tv{height:10px;background-position:-5109px 0px}.iti__flag.iti__tw{height:14px;background-position:-5131px 0px}.iti__flag.iti__tz{height:14px;background-position:-5153px 0px}.iti__flag.iti__ua{height:14px;background-position:-5175px 0px}.iti__flag.iti__ug{height:14px;background-position:-5197px 0px}.iti__flag.iti__um{height:11px;background-position:-5219px 0px}.iti__flag.iti__un{height:14px;background-position:-5241px 0px}.iti__flag.iti__us{height:11px;background-position:-5263px 0px}.iti__flag.iti__uy{height:14px;background-position:-5285px 0px}.iti__flag.iti__uz{height:10px;background-position:-5307px 0px}.iti__flag.iti__va{height:15px;background-position:-5329px 0px}.iti__flag.iti__vc{height:14px;background-position:-5346px 0px}.iti__flag.iti__ve{height:14px;background-position:-5368px 0px}.iti__flag.iti__vg{height:10px;background-position:-5390px 0px}.iti__flag.iti__vi{height:14px;background-position:-5412px 0px}.iti__flag.iti__vn{height:14px;background-position:-5434px 0px}.iti__flag.iti__vu{height:12px;background-position:-5456px 0px}.iti__flag.iti__wf{height:14px;background-position:-5478px 0px}.iti__flag.iti__ws{height:10px;background-position:-5500px 0px}.iti__flag.iti__xk{height:15px;background-position:-5522px 0px}.iti__flag.iti__ye{height:14px;background-position:-5544px 0px}.iti__flag.iti__yt{height:14px;background-position:-5566px 0px}.iti__flag.iti__za{height:14px;background-position:-5588px 0px}.iti__flag.iti__zm{height:14px;background-position:-5610px 0px}.iti__flag.iti__zw{height:10px;background-position:-5632px 0px}.iti__flag{height:15px;box-shadow:0px 0px 1px 0px #888;background-image:url("https://intl-tel-input.com/node_modules/intl-tel-input/build/img/flags.png");background-repeat:no-repeat;background-color:#f5f7f9;background-position:20px 0}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-image:url("https://intl-tel-input.com/node_modules/intl-tel-input/build/img/flags@2x.png")}}.iti__flag.iti__np{background-color:transparent}';export{o as salla_localization_modal}
|
|
4
|
+
import{r as i,h as t,g as p}from"./p-1d0e664c.js";import{H as _}from"./p-9d2ca9c8.js";const o=class{constructor(t){var p,o;i(this,t),this.languages=[],this.currencies=[],this.isLoading=!0,this.language=salla.config.get("user.language_code"),this.currency=salla.config.get("user.currency_code"),_.setHost(this.host),salla.event.on("localization::open",(()=>this.open())),salla.lang.onLoaded((()=>{var i;this.languagesTitle=salla.lang.get("common.titles.language"),this.currenciesTitle=salla.lang.get("common.titles.currency"),null===(i=this.btn)||void 0===i||i.setText(salla.lang.get("common.elements.ok"))})),this.languageSlot=(null===(p=_.getElement('[slot="language"]'))||void 0===p?void 0:p.innerHTML)||'<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span><div class="s-localization-modal-flag flag iti__flag iti__{country_code}"></div></label>',this.currencySlot=(null===(o=_.getElement('[slot="currency"]'))||void 0===o?void 0:o.innerHTML)||'<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{code}</small></label>'}async open(){return this.modal.open().then((()=>this.getLanguages())).then((()=>this.getCurrencies())).then((()=>this.isLoading=!1))}async close(){return this.modal.close()}async getLanguages(){return this.language=this.language||salla.config.get("user.language_code"),this.languages.length>1?null:await salla.config.languages().then((i=>this.languages=i))}async getCurrencies(){return this.currency=this.currency||salla.config.get("user.currency_code"),this.currencies.length>1?null:await salla.config.currencies().then((i=>this.currencies=i))}onChangeCurrency(i){this.currency=i.target.value}onChangeLanguage(i){this.language=i.target.value}async submit(){let i;this.btn.load().then((()=>{if(this.currency){if(this.currency!==salla.config.get("user.currency_code","SAR"))return i=window.location.href,salla.currency.api.change(this.currency)}else salla.log("There is no currency!")})).then((()=>this.language===salla.config.get("user.language_code","ar")||(i=salla.helpers.addParamToUrl("lang",this.language)))).then((()=>this.btn.stop())).then((()=>this.close())).then((()=>i&&(window.location.href=i)))}render(){return t("salla-modal",{isLoading:this.isLoading,id:"salla-localization",class:"s-hidden",ref:i=>this.modal=i,width:"xs"},this.isLoading?"":t("div",{class:"s-localization-modal-inner"},this.languages.length>1?t("div",{class:"s-localization-modal-section"},t("label",{class:"s-localization-modal-title"},this.languagesTitle),t("div",{class:"s-localization-modal-section-inner"},this.languages.length<6?this.languages.map((i=>t("div",{class:"s-localization-modal-item"},t("input",{class:"s-localization-modal-input",type:"radio",checked:this.language==i.iso_code,onChange:()=>this.language=i.iso_code,name:"language",id:"lang-"+i.code.toLowerCase(),value:i.code}),t("div",{class:"s-localization-modal-label-slot",id:"language-slot",innerHTML:this.languageSlot.replace(/\{name\}/g,i.name).replace(/\{code\}/g,i.code).replace(/\{country_code\}/g,i.country_code)})))):t("select",{class:"s-localization-modal-select",name:"currency",onChange:i=>this.onChangeLanguage(i)},this.languages.map((i=>t("option",{value:i.code,selected:this.language==i.code},i.name)))))):"",this.currencies.length>1?t("div",{class:"s-localization-modal-section"},t("label",{class:"s-localization-modal-title"},this.currenciesTitle),t("div",{class:"s-localization-modal-section-inner"},this.currencies.length<6?this.currencies.map((i=>t("div",{class:"s-localization-modal-item"},t("input",{class:"s-localization-modal-input",type:"radio",name:"currency",checked:this.currency==i.code,onChange:()=>this.currency=i.code,id:"currency-"+i.code,value:i.code}),t("div",{class:"s-localization-modal-label-slot",id:"currency-slot",innerHTML:this.currencySlot.replace(/\{name\}/g,i.name).replace(/\{code\}/g,i.code).replace(/\{country_code\}/g,i.country_code)})))):t("select",{class:"s-localization-modal-select",name:"currency",onChange:i=>this.onChangeCurrency(i)},this.currencies.map((i=>t("option",{value:i.code,selected:this.currency==i.code},i.name)))))):"",t("salla-button",{wide:!0,ref:i=>this.btn=i,onClick:()=>this.submit()},salla.lang.get("common.elements.ok"))))}componentDidRender(){this.host.querySelectorAll("#currency-slot").forEach((i=>i.replaceWith(i.firstChild))),this.host.querySelectorAll("#language-slot").forEach((i=>i.replaceWith(i.firstChild)))}get host(){return p(this)}};o.style='#salla-localization .s-localization-modal-label-slot{flex-grow:1}#salla-localization .s-localization-modal-select{appearance:none;-webkit-appearance:none}.iti__flag{width:20px}.iti__flag.iti__be{width:18px}.iti__flag.iti__ch{width:15px}.iti__flag.iti__mc{width:19px}.iti__flag.iti__ne{width:18px}.iti__flag.iti__np{width:13px}.iti__flag.iti__va{width:15px}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-size:5652px 15px}}.iti__flag.iti__ac{height:10px;background-position:0px 0px}.iti__flag.iti__ad{height:14px;background-position:-22px 0px}.iti__flag.iti__ae{height:10px;background-position:-44px 0px}.iti__flag.iti__af{height:14px;background-position:-66px 0px}.iti__flag.iti__ag{height:14px;background-position:-88px 0px}.iti__flag.iti__ai{height:10px;background-position:-110px 0px}.iti__flag.iti__al{height:15px;background-position:-132px 0px}.iti__flag.iti__am{height:10px;background-position:-154px 0px}.iti__flag.iti__ao{height:14px;background-position:-176px 0px}.iti__flag.iti__aq{height:14px;background-position:-198px 0px}.iti__flag.iti__ar{height:13px;background-position:-220px 0px}.iti__flag.iti__as{height:10px;background-position:-242px 0px}.iti__flag.iti__at{height:14px;background-position:-264px 0px}.iti__flag.iti__au{height:10px;background-position:-286px 0px}.iti__flag.iti__aw{height:14px;background-position:-308px 0px}.iti__flag.iti__ax{height:13px;background-position:-330px 0px}.iti__flag.iti__az{height:10px;background-position:-352px 0px}.iti__flag.iti__ba{height:10px;background-position:-374px 0px}.iti__flag.iti__bb{height:14px;background-position:-396px 0px}.iti__flag.iti__bd{height:12px;background-position:-418px 0px}.iti__flag.iti__be{height:15px;background-position:-440px 0px}.iti__flag.iti__bf{height:14px;background-position:-460px 0px}.iti__flag.iti__bg{height:12px;background-position:-482px 0px}.iti__flag.iti__bh{height:12px;background-position:-504px 0px}.iti__flag.iti__bi{height:12px;background-position:-526px 0px}.iti__flag.iti__bj{height:14px;background-position:-548px 0px}.iti__flag.iti__bl{height:14px;background-position:-570px 0px}.iti__flag.iti__bm{height:10px;background-position:-592px 0px}.iti__flag.iti__bn{height:10px;background-position:-614px 0px}.iti__flag.iti__bo{height:14px;background-position:-636px 0px}.iti__flag.iti__bq{height:14px;background-position:-658px 0px}.iti__flag.iti__br{height:14px;background-position:-680px 0px}.iti__flag.iti__bs{height:10px;background-position:-702px 0px}.iti__flag.iti__bt{height:14px;background-position:-724px 0px}.iti__flag.iti__bv{height:15px;background-position:-746px 0px}.iti__flag.iti__bw{height:14px;background-position:-768px 0px}.iti__flag.iti__by{height:10px;background-position:-790px 0px}.iti__flag.iti__bz{height:14px;background-position:-812px 0px}.iti__flag.iti__ca{height:10px;background-position:-834px 0px}.iti__flag.iti__cc{height:10px;background-position:-856px 0px}.iti__flag.iti__cd{height:15px;background-position:-878px 0px}.iti__flag.iti__cf{height:14px;background-position:-900px 0px}.iti__flag.iti__cg{height:14px;background-position:-922px 0px}.iti__flag.iti__ch{height:15px;background-position:-944px 0px}.iti__flag.iti__ci{height:14px;background-position:-961px 0px}.iti__flag.iti__ck{height:10px;background-position:-983px 0px}.iti__flag.iti__cl{height:14px;background-position:-1005px 0px}.iti__flag.iti__cm{height:14px;background-position:-1027px 0px}.iti__flag.iti__cn{height:14px;background-position:-1049px 0px}.iti__flag.iti__co{height:14px;background-position:-1071px 0px}.iti__flag.iti__cp{height:14px;background-position:-1093px 0px}.iti__flag.iti__cr{height:12px;background-position:-1115px 0px}.iti__flag.iti__cu{height:10px;background-position:-1137px 0px}.iti__flag.iti__cv{height:12px;background-position:-1159px 0px}.iti__flag.iti__cw{height:14px;background-position:-1181px 0px}.iti__flag.iti__cx{height:10px;background-position:-1203px 0px}.iti__flag.iti__cy{height:14px;background-position:-1225px 0px}.iti__flag.iti__cz{height:14px;background-position:-1247px 0px}.iti__flag.iti__de{height:12px;background-position:-1269px 0px}.iti__flag.iti__dg{height:10px;background-position:-1291px 0px}.iti__flag.iti__dj{height:14px;background-position:-1313px 0px}.iti__flag.iti__dk{height:15px;background-position:-1335px 0px}.iti__flag.iti__dm{height:10px;background-position:-1357px 0px}.iti__flag.iti__do{height:14px;background-position:-1379px 0px}.iti__flag.iti__dz{height:14px;background-position:-1401px 0px}.iti__flag.iti__ea{height:14px;background-position:-1423px 0px}.iti__flag.iti__ec{height:14px;background-position:-1445px 0px}.iti__flag.iti__ee{height:13px;background-position:-1467px 0px}.iti__flag.iti__eg{height:14px;background-position:-1489px 0px}.iti__flag.iti__eh{height:10px;background-position:-1511px 0px}.iti__flag.iti__er{height:10px;background-position:-1533px 0px}.iti__flag.iti__es{height:14px;background-position:-1555px 0px}.iti__flag.iti__et{height:10px;background-position:-1577px 0px}.iti__flag.iti__eu{height:14px;background-position:-1599px 0px}.iti__flag.iti__fi{height:12px;background-position:-1621px 0px}.iti__flag.iti__fj{height:10px;background-position:-1643px 0px}.iti__flag.iti__fk{height:10px;background-position:-1665px 0px}.iti__flag.iti__fm{height:11px;background-position:-1687px 0px}.iti__flag.iti__fo{height:15px;background-position:-1709px 0px}.iti__flag.iti__fr{height:14px;background-position:-1731px 0px}.iti__flag.iti__ga{height:15px;background-position:-1753px 0px}.iti__flag.iti__gb{height:10px;background-position:-1775px 0px}.iti__flag.iti__gd{height:12px;background-position:-1797px 0px}.iti__flag.iti__ge{height:14px;background-position:-1819px 0px}.iti__flag.iti__gf{height:14px;background-position:-1841px 0px}.iti__flag.iti__gg{height:14px;background-position:-1863px 0px}.iti__flag.iti__gh{height:14px;background-position:-1885px 0px}.iti__flag.iti__gi{height:10px;background-position:-1907px 0px}.iti__flag.iti__gl{height:14px;background-position:-1929px 0px}.iti__flag.iti__gm{height:14px;background-position:-1951px 0px}.iti__flag.iti__gn{height:14px;background-position:-1973px 0px}.iti__flag.iti__gp{height:14px;background-position:-1995px 0px}.iti__flag.iti__gq{height:14px;background-position:-2017px 0px}.iti__flag.iti__gr{height:14px;background-position:-2039px 0px}.iti__flag.iti__gs{height:10px;background-position:-2061px 0px}.iti__flag.iti__gt{height:13px;background-position:-2083px 0px}.iti__flag.iti__gu{height:11px;background-position:-2105px 0px}.iti__flag.iti__gw{height:10px;background-position:-2127px 0px}.iti__flag.iti__gy{height:12px;background-position:-2149px 0px}.iti__flag.iti__hk{height:14px;background-position:-2171px 0px}.iti__flag.iti__hm{height:10px;background-position:-2193px 0px}.iti__flag.iti__hn{height:10px;background-position:-2215px 0px}.iti__flag.iti__hr{height:10px;background-position:-2237px 0px}.iti__flag.iti__ht{height:12px;background-position:-2259px 0px}.iti__flag.iti__hu{height:10px;background-position:-2281px 0px}.iti__flag.iti__ic{height:14px;background-position:-2303px 0px}.iti__flag.iti__id{height:14px;background-position:-2325px 0px}.iti__flag.iti__ie{height:10px;background-position:-2347px 0px}.iti__flag.iti__il{height:15px;background-position:-2369px 0px}.iti__flag.iti__im{height:10px;background-position:-2391px 0px}.iti__flag.iti__in{height:14px;background-position:-2413px 0px}.iti__flag.iti__io{height:10px;background-position:-2435px 0px}.iti__flag.iti__iq{height:14px;background-position:-2457px 0px}.iti__flag.iti__ir{height:12px;background-position:-2479px 0px}.iti__flag.iti__is{height:15px;background-position:-2501px 0px}.iti__flag.iti__it{height:14px;background-position:-2523px 0px}.iti__flag.iti__je{height:12px;background-position:-2545px 0px}.iti__flag.iti__jm{height:10px;background-position:-2567px 0px}.iti__flag.iti__jo{height:10px;background-position:-2589px 0px}.iti__flag.iti__jp{height:14px;background-position:-2611px 0px}.iti__flag.iti__ke{height:14px;background-position:-2633px 0px}.iti__flag.iti__kg{height:12px;background-position:-2655px 0px}.iti__flag.iti__kh{height:13px;background-position:-2677px 0px}.iti__flag.iti__ki{height:10px;background-position:-2699px 0px}.iti__flag.iti__km{height:12px;background-position:-2721px 0px}.iti__flag.iti__kn{height:14px;background-position:-2743px 0px}.iti__flag.iti__kp{height:10px;background-position:-2765px 0px}.iti__flag.iti__kr{height:14px;background-position:-2787px 0px}.iti__flag.iti__kw{height:10px;background-position:-2809px 0px}.iti__flag.iti__ky{height:10px;background-position:-2831px 0px}.iti__flag.iti__kz{height:10px;background-position:-2853px 0px}.iti__flag.iti__la{height:14px;background-position:-2875px 0px}.iti__flag.iti__lb{height:14px;background-position:-2897px 0px}.iti__flag.iti__lc{height:10px;background-position:-2919px 0px}.iti__flag.iti__li{height:12px;background-position:-2941px 0px}.iti__flag.iti__lk{height:10px;background-position:-2963px 0px}.iti__flag.iti__lr{height:11px;background-position:-2985px 0px}.iti__flag.iti__ls{height:14px;background-position:-3007px 0px}.iti__flag.iti__lt{height:12px;background-position:-3029px 0px}.iti__flag.iti__lu{height:12px;background-position:-3051px 0px}.iti__flag.iti__lv{height:10px;background-position:-3073px 0px}.iti__flag.iti__ly{height:10px;background-position:-3095px 0px}.iti__flag.iti__ma{height:14px;background-position:-3117px 0px}.iti__flag.iti__mc{height:15px;background-position:-3139px 0px}.iti__flag.iti__md{height:10px;background-position:-3160px 0px}.iti__flag.iti__me{height:10px;background-position:-3182px 0px}.iti__flag.iti__mf{height:14px;background-position:-3204px 0px}.iti__flag.iti__mg{height:14px;background-position:-3226px 0px}.iti__flag.iti__mh{height:11px;background-position:-3248px 0px}.iti__flag.iti__mk{height:10px;background-position:-3270px 0px}.iti__flag.iti__ml{height:14px;background-position:-3292px 0px}.iti__flag.iti__mm{height:14px;background-position:-3314px 0px}.iti__flag.iti__mn{height:10px;background-position:-3336px 0px}.iti__flag.iti__mo{height:14px;background-position:-3358px 0px}.iti__flag.iti__mp{height:10px;background-position:-3380px 0px}.iti__flag.iti__mq{height:14px;background-position:-3402px 0px}.iti__flag.iti__mr{height:14px;background-position:-3424px 0px}.iti__flag.iti__ms{height:10px;background-position:-3446px 0px}.iti__flag.iti__mt{height:14px;background-position:-3468px 0px}.iti__flag.iti__mu{height:14px;background-position:-3490px 0px}.iti__flag.iti__mv{height:14px;background-position:-3512px 0px}.iti__flag.iti__mw{height:14px;background-position:-3534px 0px}.iti__flag.iti__mx{height:12px;background-position:-3556px 0px}.iti__flag.iti__my{height:10px;background-position:-3578px 0px}.iti__flag.iti__mz{height:14px;background-position:-3600px 0px}.iti__flag.iti__na{height:14px;background-position:-3622px 0px}.iti__flag.iti__nc{height:10px;background-position:-3644px 0px}.iti__flag.iti__ne{height:15px;background-position:-3666px 0px}.iti__flag.iti__nf{height:10px;background-position:-3686px 0px}.iti__flag.iti__ng{height:10px;background-position:-3708px 0px}.iti__flag.iti__ni{height:12px;background-position:-3730px 0px}.iti__flag.iti__nl{height:14px;background-position:-3752px 0px}.iti__flag.iti__no{height:15px;background-position:-3774px 0px}.iti__flag.iti__np{height:15px;background-position:-3796px 0px}.iti__flag.iti__nr{height:10px;background-position:-3811px 0px}.iti__flag.iti__nu{height:10px;background-position:-3833px 0px}.iti__flag.iti__nz{height:10px;background-position:-3855px 0px}.iti__flag.iti__om{height:10px;background-position:-3877px 0px}.iti__flag.iti__pa{height:14px;background-position:-3899px 0px}.iti__flag.iti__pe{height:14px;background-position:-3921px 0px}.iti__flag.iti__pf{height:14px;background-position:-3943px 0px}.iti__flag.iti__pg{height:15px;background-position:-3965px 0px}.iti__flag.iti__ph{height:10px;background-position:-3987px 0px}.iti__flag.iti__pk{height:14px;background-position:-4009px 0px}.iti__flag.iti__pl{height:13px;background-position:-4031px 0px}.iti__flag.iti__pm{height:14px;background-position:-4053px 0px}.iti__flag.iti__pn{height:10px;background-position:-4075px 0px}.iti__flag.iti__pr{height:14px;background-position:-4097px 0px}.iti__flag.iti__ps{height:10px;background-position:-4119px 0px}.iti__flag.iti__pt{height:14px;background-position:-4141px 0px}.iti__flag.iti__pw{height:13px;background-position:-4163px 0px}.iti__flag.iti__py{height:11px;background-position:-4185px 0px}.iti__flag.iti__qa{height:8px;background-position:-4207px 0px}.iti__flag.iti__re{height:14px;background-position:-4229px 0px}.iti__flag.iti__ro{height:14px;background-position:-4251px 0px}.iti__flag.iti__rs{height:14px;background-position:-4273px 0px}.iti__flag.iti__ru{height:14px;background-position:-4295px 0px}.iti__flag.iti__rw{height:14px;background-position:-4317px 0px}.iti__flag.iti__sa{height:14px;background-position:-4339px 0px}.iti__flag.iti__sb{height:10px;background-position:-4361px 0px}.iti__flag.iti__sc{height:10px;background-position:-4383px 0px}.iti__flag.iti__sd{height:10px;background-position:-4405px 0px}.iti__flag.iti__se{height:13px;background-position:-4427px 0px}.iti__flag.iti__sg{height:14px;background-position:-4449px 0px}.iti__flag.iti__sh{height:10px;background-position:-4471px 0px}.iti__flag.iti__si{height:10px;background-position:-4493px 0px}.iti__flag.iti__sj{height:15px;background-position:-4515px 0px}.iti__flag.iti__sk{height:14px;background-position:-4537px 0px}.iti__flag.iti__sl{height:14px;background-position:-4559px 0px}.iti__flag.iti__sm{height:15px;background-position:-4581px 0px}.iti__flag.iti__sn{height:14px;background-position:-4603px 0px}.iti__flag.iti__so{height:14px;background-position:-4625px 0px}.iti__flag.iti__sr{height:14px;background-position:-4647px 0px}.iti__flag.iti__ss{height:10px;background-position:-4669px 0px}.iti__flag.iti__st{height:10px;background-position:-4691px 0px}.iti__flag.iti__sv{height:12px;background-position:-4713px 0px}.iti__flag.iti__sx{height:14px;background-position:-4735px 0px}.iti__flag.iti__sy{height:14px;background-position:-4757px 0px}.iti__flag.iti__sz{height:14px;background-position:-4779px 0px}.iti__flag.iti__ta{height:10px;background-position:-4801px 0px}.iti__flag.iti__tc{height:10px;background-position:-4823px 0px}.iti__flag.iti__td{height:14px;background-position:-4845px 0px}.iti__flag.iti__tf{height:14px;background-position:-4867px 0px}.iti__flag.iti__tg{height:13px;background-position:-4889px 0px}.iti__flag.iti__th{height:14px;background-position:-4911px 0px}.iti__flag.iti__tj{height:10px;background-position:-4933px 0px}.iti__flag.iti__tk{height:10px;background-position:-4955px 0px}.iti__flag.iti__tl{height:10px;background-position:-4977px 0px}.iti__flag.iti__tm{height:14px;background-position:-4999px 0px}.iti__flag.iti__tn{height:14px;background-position:-5021px 0px}.iti__flag.iti__to{height:10px;background-position:-5043px 0px}.iti__flag.iti__tr{height:14px;background-position:-5065px 0px}.iti__flag.iti__tt{height:12px;background-position:-5087px 0px}.iti__flag.iti__tv{height:10px;background-position:-5109px 0px}.iti__flag.iti__tw{height:14px;background-position:-5131px 0px}.iti__flag.iti__tz{height:14px;background-position:-5153px 0px}.iti__flag.iti__ua{height:14px;background-position:-5175px 0px}.iti__flag.iti__ug{height:14px;background-position:-5197px 0px}.iti__flag.iti__um{height:11px;background-position:-5219px 0px}.iti__flag.iti__un{height:14px;background-position:-5241px 0px}.iti__flag.iti__us{height:11px;background-position:-5263px 0px}.iti__flag.iti__uy{height:14px;background-position:-5285px 0px}.iti__flag.iti__uz{height:10px;background-position:-5307px 0px}.iti__flag.iti__va{height:15px;background-position:-5329px 0px}.iti__flag.iti__vc{height:14px;background-position:-5346px 0px}.iti__flag.iti__ve{height:14px;background-position:-5368px 0px}.iti__flag.iti__vg{height:10px;background-position:-5390px 0px}.iti__flag.iti__vi{height:14px;background-position:-5412px 0px}.iti__flag.iti__vn{height:14px;background-position:-5434px 0px}.iti__flag.iti__vu{height:12px;background-position:-5456px 0px}.iti__flag.iti__wf{height:14px;background-position:-5478px 0px}.iti__flag.iti__ws{height:10px;background-position:-5500px 0px}.iti__flag.iti__xk{height:15px;background-position:-5522px 0px}.iti__flag.iti__ye{height:14px;background-position:-5544px 0px}.iti__flag.iti__yt{height:14px;background-position:-5566px 0px}.iti__flag.iti__za{height:14px;background-position:-5588px 0px}.iti__flag.iti__zm{height:14px;background-position:-5610px 0px}.iti__flag.iti__zw{height:10px;background-position:-5632px 0px}.iti__flag{height:15px;box-shadow:0px 0px 1px 0px #888;background-image:url("https://intl-tel-input.com/node_modules/intl-tel-input/build/img/flags.png");background-repeat:no-repeat;background-color:#f5f7f9;background-position:20px 0}@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi){.iti__flag{background-image:url("https://intl-tel-input.com/node_modules/intl-tel-input/build/img/flags@2x.png")}}.iti__flag.iti__np{background-color:transparent}';export{o as salla_localization_modal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as i,g as l}from"./p-d566f357.js";import{H as t}from"./p-9d2ca9c8.js";const a=class{constructor(i){s(this,i),this.isEmailAllowed=salla.config.get("store.settings.auth.email_allowed",!0),this.isMobileAllowed=salla.config.get("store.settings.auth.mobile_allowed",!0),this.isEmailRequired=salla.config.get("store.settings.auth.is_email_required",!1),this.regType="phone",this.title=salla.lang.get("blocks.header.login"),this.loginTypeTitle=salla.lang.get("blocks.header.select_login_way"),this.loginText=salla.lang.get("blocks.header.login"),this.smsLabel=salla.lang.get("blocks.header.sms"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.emailLabel=salla.lang.get("common.elements.email"),this.enterText=salla.lang.get("blocks.header.enter"),this.bySMSText=salla.lang.get("blocks.header.login_by_sms"),this.byEmailText=salla.lang.get("blocks.header.login_by_email"),this.emailErrorMsg=salla.lang.get("common.elements.email_is_valid"),this.firstNameLabel=salla.lang.get("blocks.header.your_name"),this.lastNameLabel=salla.lang.get("pages.profile.last_name"),this.firstNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.firstNameLabel}),this.lastNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.lastNameLabel}),this.typing=(s,i)=>{const l=s.target.nextElementSibling;s.target.classList.remove("s-has-error"),(null==l?void 0:l.classList.contains("s-login-modal-error-message"))&&(l.innerText=""),"Enter"==s.key&&i()},this.loginBySMS=async()=>{const{phone:s,countryCode:i}=await this.loginTelInput.getValues();await this.loginTelInput.isValid()&&this.login(this.smsBtn,{type:"mobile",phone:s,country_code:i})},this.loginByEmail=()=>{t.isValidEmail(this.loginEmail.value)?this.login(this.emailBtn,{type:"email",email:this.loginEmail.value}):this.validateField(this.loginEmail,this.emailErrorMsg)},this.newUser=async()=>{var s;const{phone:i,countryCode:l}="email"==this.regType?await this.regTelInput.getValues():await this.loginTelInput.getValues(),t=this.regEmail.value||(null===(s=this.loginEmail)||void 0===s?void 0:s.value);await this.newUserValidation(),await this.regBtn.load(),await this.regBtn.disable();let a={first_name:this.firstName.value,last_name:this.lastName.value,phone:i||this.loginTelInput.phone,country_code:l,verified_by:this.regType};t&&(a=Object.assign(Object.assign({},a),{email:t})),this.verifyTab.getCode().then((s=>salla.auth.api.register(Object.assign(Object.assign({},a),{code:s})))).then((()=>salla.auth.canRedirect&&window.location.reload())).catch((()=>this.regBtn.stop()&&this.regBtn.enable()))},this.title=this.host.title||salla.lang.get("blocks.header.login"),this.host.removeAttribute("title"),salla.lang.onLoaded((()=>{var s,i,l,t;this.title=salla.lang.get("blocks.header.login"),this.loginTypeTitle=salla.lang.get("blocks.header.select_login_way"),this.loginText=salla.lang.get("blocks.header.login"),this.smsLabel=salla.lang.get("blocks.header.sms"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.emailLabel=salla.lang.get("common.elements.email"),this.bySMSText=salla.lang.get("blocks.header.login_by_sms"),this.byEmailText=salla.lang.get("blocks.header.login_by_email"),this.emailErrorMsg=salla.lang.get("common.elements.email_is_valid"),this.firstNameLabel=salla.lang.get("blocks.header.your_name"),this.lastNameLabel=salla.lang.get("pages.profile.last_name"),this.firstNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.firstNameLabel}),this.lastNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.lastNameLabel}),null===(s=this.modal)||void 0===s||s.setTitle(this.title),null===(i=this.smsBtn)||void 0===i||i.setText(salla.lang.get("blocks.header.enter")),null===(l=this.emailBtn)||void 0===l||l.setText(salla.lang.get("blocks.header.enter")),null===(t=this.regBtn)||void 0===t||t.setText(salla.lang.get("blocks.header.register"))})),salla.auth.event.onVerificationFailed((()=>{})),salla.event.on("login::open",(()=>this.open())),salla.event.on("twilight::initiated",(()=>{this.isEmailAllowed=salla.config.get("store.settings.auth.email_allowed",!!this.isEmailAllowed),this.isMobileAllowed=salla.config.get("store.settings.auth.mobile_allowed",!!this.isMobileAllowed),this.isEmailRequired=salla.config.get("store.settings.auth.is_email_required",!!this.isEmailRequired)}))}onVerified(s){var i,l;salla.log("verified",s);let t=(null===(i=s.detail)||void 0===i?void 0:i.data.case)||(null===(l=s.detail)||void 0===l?void 0:l.error.case);if(t){if("new_customer"===t)return this.showTab(this.registrationTab);if(salla.auth.canRedirect())return s.detail.data.redirect_url?window.location.href=s.data.redirect_url:void window.location.reload();salla.log("Will not auto redirect or reload, due to `salla.auth.canRedirect()`")}else salla.log("verified but without case!")}async open(){return this.isEmailAllowed&&this.isMobileAllowed?this.showTab(this.homeTab):this.isEmailAllowed?this.showTab(this.emailTab):this.isMobileAllowed&&this.showTab(this.mobileTab),this.modal.open()}showTab(s,i){var l,a;null==i||i.preventDefault();let e=[this.homeTab,this.mobileTab,this.emailTab,this.verifyTab,this.registrationTab];e.map((i=>t.toggleElementClassIf(i,"visible","s-hidden",(()=>i==s)))),setTimeout((()=>e.map((i=>t.toggleElementClassIf(i,"s-login-modal-active","s-login-modal-unactive",(()=>i==s))))),200),setTimeout((()=>{var i;return null===(i=document.querySelector(".s-login-modal-wrapper"))||void 0===i?void 0:i.setAttribute("style","height:"+(null==s?void 0:s.scrollHeight)+"px")})),[this.mobileTab,this.emailTab].includes(s)&&(this.regType=s===this.mobileTab?"phone":"email");let o=s==this.registrationTab;return null===(l=s.querySelector("input"))||void 0===l||l.focus(),null===(a=this.modal)||void 0===a||a.setTitle(o?salla.lang.get("common.titles.registration"):this.title),o||t.toggleElementClassIf(this.regMobileBlock,"s-hidden","s-show",(()=>"phone"===this.regType)).toggleElementClassIf(this.regEmailBlock,"s-hidden","s-show",(()=>"email"===this.regType)),this}login(s,i){s.load().then((()=>s.disable())).then((()=>salla.auth.api.login(i))).then((()=>this.showTab(this.verifyTab))).then((()=>this.verifyTab.open(i))).finally((()=>s.stop()&&s.enable()))}async newUserValidation(){const s="phone"==this.regType,i=this.regEmail.value||"email"==this.regType&&this.loginEmail.value,l=t.isValidEmail(i),a=this.firstName.value.length>0,e=this.lastName.value.length>0,o=await this.regTelInput.isValid()||s&&await this.loginTelInput.isValid();if(!((i&&l||!i&&!this.isEmailRequired)&&o&&a&&e))throw!l&&this.validateField(this.regEmail,this.emailErrorMsg),!a&&this.validateField(this.firstName,this.firstNameErrorMsg),!e&&this.validateField(this.lastName,this.lastNameErrorMsg),"Please insert required fields"}validateField(s,i){s.classList.add("s-has-error"),s.nextElementSibling.innerText="* "+i}render(){return i("salla-modal",{id:"salla-login",icon:"sicon-user","modal-title":this.title,ref:s=>this.modal=s,width:"xs"},i("div",{class:"s-login-modal-wrapper"},this.isEmailAllowed&&this.isMobileAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.homeTab=s},i("p",{class:"s-login-modal-sub-title"},this.loginTypeTitle),i("slot",{name:"before-login-type"}),i("a",{href:"#",class:"s-login-modal-main-btn",onClick:s=>this.showTab(this.mobileTab,s)},i("i",{class:"s-login-modal-main-btn-icon sicon-phone"}),i("span",{class:"s-login-modal-main-btn-text"},this.smsLabel),i("i",{class:"sicon-keyboard_arrow_left arrow"})),i("a",{href:"#",class:"s-login-modal-main-btn",onClick:s=>this.showTab(this.emailTab,s)},i("i",{class:"s-login-modal-main-btn-icon sicon-mail"}),i("span",{class:"s-login-modal-main-btn-text"},this.emailLabel),i("i",{class:"sicon-keyboard_arrow_left arrow"})),i("slot",{name:"after-login-type"})):"",this.isMobileAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.mobileTab=s},i("slot",{name:"before-login-mobile"}),i("label",{class:"s-login-modal-label"},this.mobileLabel),i("salla-tel-input",{ref:s=>this.loginTelInput=s,onKeyDown:s=>this.typing(s,this.loginBySMS)}),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.loginBySMS(),ref:s=>this.smsBtn=s},salla.lang.get("blocks.header.enter")),this.isEmailAllowed?i("a",{href:"#",onClick:()=>this.showTab(this.emailTab),class:"s-login-modal-link"},this.byEmailText):"",i("slot",{name:"after-login-mobile"})):"",this.isEmailAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.emailTab=s},i("slot",{name:"before-login-email"}),i("label",{class:"s-login-modal-label"},this.emailLabel),i("input",{type:"email",ref:s=>this.loginEmail=s,onKeyDown:s=>this.typing(s,this.loginByEmail),placeholder:"your@email.com",class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"}),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.loginByEmail(),ref:s=>this.emailBtn=s},salla.lang.get("blocks.header.enter")),this.isMobileAllowed?i("a",{href:"#",onClick:()=>this.showTab(this.mobileTab),class:"s-login-modal-link"},this.bySMSText):"",i("slot",{name:"after-login-email"})):"",i("salla-verify-modal",{withoutModal:!0,ref:s=>this.verifyTab=s,autoReload:!1},i("a",{onClick:()=>this.showTab("phone"==this.regType?this.mobileTab:this.emailTab),class:"s-verify-modal-back sicon-arrow-right",slot:"after-footer",href:"#"})),i("div",{ref:s=>this.registrationTab=s},i("slot",{name:"before-registration"}),i("div",null,i("label",{class:"s-login-modal-label"},this.firstNameLabel),i("input",{type:"text",class:"s-login-modal-input",ref:s=>this.firstName=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:salla.lang.get("pages.profile.first_name")}),i("span",{class:"s-login-modal-error-message"})),i("div",null,i("label",{class:"s-login-modal-label"},this.lastNameLabel),i("input",{type:"text",class:"s-login-modal-input",ref:s=>this.lastName=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:salla.lang.get("pages.profile.last_name")}),i("span",{class:"s-login-modal-error-message"})),i("div",{ref:s=>this.regMobileBlock=s,class:"mb-1.5"},i("label",{class:"s-login-modal-label"},this.mobileLabel),i("salla-tel-input",{ref:s=>this.regTelInput=s,onKeyDown:s=>this.typing(s,this.newUser)})),i("div",{ref:s=>this.regEmailBlock=s,class:"mb-1.5"},i("label",{class:"s-login-modal-label"},this.emailLabel),i("input",{type:"email",ref:s=>this.regEmail=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:"your@email.com",class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"})),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.newUser(),ref:s=>this.regBtn=s},salla.lang.get("blocks.header.register")),i("slot",{name:"after-registration"}))))}get host(){return l(this)}};a.style="[dir=ltr] #salla-login .s-login-modal-main-btn .arrow{display:inline-block;transform:scale(-1)}";export{a as salla_login_modal}
|
|
4
|
+
import{r as s,h as i,g as l}from"./p-1d0e664c.js";import{H as t}from"./p-9d2ca9c8.js";const a=class{constructor(i){s(this,i),this.isEmailAllowed=salla.config.get("store.settings.auth.email_allowed",!0),this.isMobileAllowed=salla.config.get("store.settings.auth.mobile_allowed",!0),this.isEmailRequired=salla.config.get("store.settings.auth.is_email_required",!1),this.regType="phone",this.title=salla.lang.get("blocks.header.login"),this.loginTypeTitle=salla.lang.get("blocks.header.select_login_way"),this.loginText=salla.lang.get("blocks.header.login"),this.smsLabel=salla.lang.get("blocks.header.sms"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.emailLabel=salla.lang.get("common.elements.email"),this.enterText=salla.lang.get("blocks.header.enter"),this.bySMSText=salla.lang.get("blocks.header.login_by_sms"),this.byEmailText=salla.lang.get("blocks.header.login_by_email"),this.emailErrorMsg=salla.lang.get("common.elements.email_is_valid"),this.firstNameLabel=salla.lang.get("blocks.header.your_name"),this.lastNameLabel=salla.lang.get("pages.profile.last_name"),this.firstNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.firstNameLabel}),this.lastNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.lastNameLabel}),this.typing=(s,i)=>{const l=s.target.nextElementSibling;s.target.classList.remove("s-has-error"),(null==l?void 0:l.classList.contains("s-login-modal-error-message"))&&(l.innerText=""),"Enter"==s.key&&i()},this.loginBySMS=async()=>{const{phone:s,countryCode:i}=await this.loginTelInput.getValues();await this.loginTelInput.isValid()&&this.login(this.smsBtn,{type:"mobile",phone:s,country_code:i})},this.loginByEmail=()=>{t.isValidEmail(this.loginEmail.value)?this.login(this.emailBtn,{type:"email",email:this.loginEmail.value}):this.validateField(this.loginEmail,this.emailErrorMsg)},this.newUser=async()=>{var s;const{phone:i,countryCode:l}="email"==this.regType?await this.regTelInput.getValues():await this.loginTelInput.getValues(),t=this.regEmail.value||(null===(s=this.loginEmail)||void 0===s?void 0:s.value);await this.newUserValidation(),await this.regBtn.load(),await this.regBtn.disable();let a={first_name:this.firstName.value,last_name:this.lastName.value,phone:i||this.loginTelInput.phone,country_code:l,verified_by:this.regType};t&&(a=Object.assign(Object.assign({},a),{email:t})),this.verifyTab.getCode().then((s=>salla.auth.api.register(Object.assign(Object.assign({},a),{code:s})))).then((()=>salla.auth.canRedirect&&window.location.reload())).catch((()=>this.regBtn.stop()&&this.regBtn.enable()))},this.title=this.host.title||salla.lang.get("blocks.header.login"),this.host.removeAttribute("title"),salla.lang.onLoaded((()=>{var s,i,l,t;this.title=salla.lang.get("blocks.header.login"),this.loginTypeTitle=salla.lang.get("blocks.header.select_login_way"),this.loginText=salla.lang.get("blocks.header.login"),this.smsLabel=salla.lang.get("blocks.header.sms"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.emailLabel=salla.lang.get("common.elements.email"),this.bySMSText=salla.lang.get("blocks.header.login_by_sms"),this.byEmailText=salla.lang.get("blocks.header.login_by_email"),this.emailErrorMsg=salla.lang.get("common.elements.email_is_valid"),this.firstNameLabel=salla.lang.get("blocks.header.your_name"),this.lastNameLabel=salla.lang.get("pages.profile.last_name"),this.firstNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.firstNameLabel}),this.lastNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.lastNameLabel}),null===(s=this.modal)||void 0===s||s.setTitle(this.title),null===(i=this.smsBtn)||void 0===i||i.setText(salla.lang.get("blocks.header.enter")),null===(l=this.emailBtn)||void 0===l||l.setText(salla.lang.get("blocks.header.enter")),null===(t=this.regBtn)||void 0===t||t.setText(salla.lang.get("blocks.header.register"))})),salla.auth.event.onVerificationFailed((()=>{})),salla.event.on("login::open",(()=>this.open())),salla.event.on("twilight::initiated",(()=>{this.isEmailAllowed=salla.config.get("store.settings.auth.email_allowed",!!this.isEmailAllowed),this.isMobileAllowed=salla.config.get("store.settings.auth.mobile_allowed",!!this.isMobileAllowed),this.isEmailRequired=salla.config.get("store.settings.auth.is_email_required",!!this.isEmailRequired)}))}onVerified(s){var i,l;salla.log("verified",s);let t=(null===(i=s.detail)||void 0===i?void 0:i.data.case)||(null===(l=s.detail)||void 0===l?void 0:l.error.case);if(t){if("new_customer"===t)return this.showTab(this.registrationTab);if(salla.auth.canRedirect())return s.detail.data.redirect_url?window.location.href=s.data.redirect_url:void window.location.reload();salla.log("Will not auto redirect or reload, due to `salla.auth.canRedirect()`")}else salla.log("verified but without case!")}async open(){return this.isEmailAllowed&&this.isMobileAllowed?this.showTab(this.homeTab):this.isEmailAllowed?this.showTab(this.emailTab):this.isMobileAllowed&&this.showTab(this.mobileTab),this.modal.open()}showTab(s,i){var l,a;null==i||i.preventDefault();let e=[this.homeTab,this.mobileTab,this.emailTab,this.verifyTab,this.registrationTab];e.map((i=>t.toggleElementClassIf(i,"visible","s-hidden",(()=>i==s)))),setTimeout((()=>e.map((i=>t.toggleElementClassIf(i,"s-login-modal-active","s-login-modal-unactive",(()=>i==s))))),200),setTimeout((()=>{var i;return null===(i=document.querySelector(".s-login-modal-wrapper"))||void 0===i?void 0:i.setAttribute("style","height:"+(null==s?void 0:s.scrollHeight)+"px")})),[this.mobileTab,this.emailTab].includes(s)&&(this.regType=s===this.mobileTab?"phone":"email");let o=s==this.registrationTab;return null===(l=s.querySelector("input"))||void 0===l||l.focus(),null===(a=this.modal)||void 0===a||a.setTitle(o?salla.lang.get("common.titles.registration"):this.title),o||t.toggleElementClassIf(this.regMobileBlock,"s-hidden","s-show",(()=>"phone"===this.regType)).toggleElementClassIf(this.regEmailBlock,"s-hidden","s-show",(()=>"email"===this.regType)),this}login(s,i){s.load().then((()=>s.disable())).then((()=>salla.auth.api.login(i))).then((()=>this.showTab(this.verifyTab))).then((()=>this.verifyTab.open(i))).finally((()=>s.stop()&&s.enable()))}async newUserValidation(){const s="phone"==this.regType,i=this.regEmail.value||"email"==this.regType&&this.loginEmail.value,l=t.isValidEmail(i),a=this.firstName.value.length>0,e=this.lastName.value.length>0,o=await this.regTelInput.isValid()||s&&await this.loginTelInput.isValid();if(!((i&&l||!i&&!this.isEmailRequired)&&o&&a&&e))throw!l&&this.validateField(this.regEmail,this.emailErrorMsg),!a&&this.validateField(this.firstName,this.firstNameErrorMsg),!e&&this.validateField(this.lastName,this.lastNameErrorMsg),"Please insert required fields"}validateField(s,i){s.classList.add("s-has-error"),s.nextElementSibling.innerText="* "+i}render(){return i("salla-modal",{id:"salla-login",icon:"sicon-user","modal-title":this.title,ref:s=>this.modal=s,width:"xs"},i("div",{class:"s-login-modal-wrapper"},this.isEmailAllowed&&this.isMobileAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.homeTab=s},i("p",{class:"s-login-modal-sub-title"},this.loginTypeTitle),i("slot",{name:"before-login-type"}),i("a",{href:"#",class:"s-login-modal-main-btn",onClick:s=>this.showTab(this.mobileTab,s)},i("i",{class:"s-login-modal-main-btn-icon sicon-phone"}),i("span",{class:"s-login-modal-main-btn-text"},this.smsLabel),i("i",{class:"sicon-keyboard_arrow_left arrow"})),i("a",{href:"#",class:"s-login-modal-main-btn",onClick:s=>this.showTab(this.emailTab,s)},i("i",{class:"s-login-modal-main-btn-icon sicon-mail"}),i("span",{class:"s-login-modal-main-btn-text"},this.emailLabel),i("i",{class:"sicon-keyboard_arrow_left arrow"})),i("slot",{name:"after-login-type"})):"",this.isMobileAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.mobileTab=s},i("slot",{name:"before-login-mobile"}),i("label",{class:"s-login-modal-label"},this.mobileLabel),i("salla-tel-input",{ref:s=>this.loginTelInput=s,onKeyDown:s=>this.typing(s,this.loginBySMS)}),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.loginBySMS(),ref:s=>this.smsBtn=s},salla.lang.get("blocks.header.enter")),this.isEmailAllowed?i("a",{href:"#",onClick:()=>this.showTab(this.emailTab),class:"s-login-modal-link"},this.byEmailText):"",i("slot",{name:"after-login-mobile"})):"",this.isEmailAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.emailTab=s},i("slot",{name:"before-login-email"}),i("label",{class:"s-login-modal-label"},this.emailLabel),i("input",{type:"email",ref:s=>this.loginEmail=s,onKeyDown:s=>this.typing(s,this.loginByEmail),placeholder:"your@email.com",class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"}),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.loginByEmail(),ref:s=>this.emailBtn=s},salla.lang.get("blocks.header.enter")),this.isMobileAllowed?i("a",{href:"#",onClick:()=>this.showTab(this.mobileTab),class:"s-login-modal-link"},this.bySMSText):"",i("slot",{name:"after-login-email"})):"",i("salla-verify-modal",{withoutModal:!0,ref:s=>this.verifyTab=s,autoReload:!1},i("a",{onClick:()=>this.showTab("phone"==this.regType?this.mobileTab:this.emailTab),class:"s-verify-modal-back sicon-arrow-right",slot:"after-footer",href:"#"})),i("div",{ref:s=>this.registrationTab=s},i("slot",{name:"before-registration"}),i("div",null,i("label",{class:"s-login-modal-label"},this.firstNameLabel),i("input",{type:"text",class:"s-login-modal-input",ref:s=>this.firstName=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:salla.lang.get("pages.profile.first_name")}),i("span",{class:"s-login-modal-error-message"})),i("div",null,i("label",{class:"s-login-modal-label"},this.lastNameLabel),i("input",{type:"text",class:"s-login-modal-input",ref:s=>this.lastName=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:salla.lang.get("pages.profile.last_name")}),i("span",{class:"s-login-modal-error-message"})),i("div",{ref:s=>this.regMobileBlock=s,class:"mb-1.5"},i("label",{class:"s-login-modal-label"},this.mobileLabel),i("salla-tel-input",{ref:s=>this.regTelInput=s,onKeyDown:s=>this.typing(s,this.newUser)})),i("div",{ref:s=>this.regEmailBlock=s,class:"mb-1.5"},i("label",{class:"s-login-modal-label"},this.emailLabel),i("input",{type:"email",ref:s=>this.regEmail=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:"your@email.com",class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"})),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.newUser(),ref:s=>this.regBtn=s},salla.lang.get("blocks.header.register")),i("slot",{name:"after-registration"}))))}get host(){return l(this)}};a.style="[dir=ltr] #salla-login .s-login-modal-main-btn .arrow{display:inline-block;transform:scale(-1)}";export{a as salla_login_modal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,c as i,h as t,H as e,g as l}from"./p-
|
|
4
|
+
import{r as s,c as i,h as t,H as e,g as l}from"./p-1d0e664c.js";import{H as a}from"./p-9d2ca9c8.js";const r=class{constructor(t){s(this,t),this.verified=i(this,"verified",7),this.initiated=!1,this.type="mobile",this.autoReload=!0,this.isProfileVerify=!1,salla.lang.onLoaded((()=>{var s,i;this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+this.type),null===(s=this.modal)||void 0===s||s.setTitle(this.title),null===(i=this.btn)||void 0===i||i.setText(salla.lang.get("pages.profile.verify"))})),this.withoutModal?this.modal={open:()=>"",close:()=>"",setTitle:()=>""}:salla.event.on("profile::verification",(s=>{var i;this.isProfileVerify=!0,this.open(s),this.title=salla.lang.get("pages.profile.verify_title")+salla.lang.get("common.elements."+s.type),null===(i=this.modal)||void 0===i||i.setTitle(this.title)}))}async getCode(){return this.code.value}async open(s){var i;this.data=s,this.data.type=this.data.type||this.type,this.type=this.data.type,this.resendTimer(),this.otpInputs=this.host.querySelectorAll(".s-verify-modal-input"),this.initiated||(a.on("input",".s-verify-modal-input",(s=>salla.helpers.inputDigitsOnly(s.target))),a.onKeyUp(".s-verify-modal-input",(s=>{var i,t,e,l;let a=s.keyCode||s.charCode;s.target.value?(null===(i=s.target.nextElementSibling)||void 0===i||i.focus(),null===(t=s.target.nextElementSibling)||void 0===t||t.select()):[8,46].includes(a)&&(null===(e=s.target.previousElementSibling)||void 0===e||e.focus(),null===(l=s.target.previousElementSibling)||void 0===l||l.select()),this.toggleOTPSubmit()})),a.on("paste",".s-verify-modal-input",(s=>{let i=salla.helpers.number(s.clipboardData.getData("text")).replace(/[^0-9.]/g,"").replace("..",".");this.otpInputs.forEach(((s,t)=>s.value=i[t]||"")),this.toggleOTPSubmit(),setTimeout((()=>this.otpInputs[3].focus()),100)})),this.initiated=!0),this.reset(),!this.withoutModal&&(null===(i=this.modal)||void 0===i||i.setTitle(this.title)),this.modal.open()}toggleOTPSubmit(){let s=[];if(this.otpInputs.forEach((i=>i.value&&s.push(i.value))),this.code.value=s.join(""),4===s.length)return this.btn.removeAttribute("disabled"),void this.btn.click();this.btn.setAttribute("disabled","")}reset(){this.otpInputs.forEach((s=>s.value="")),this.code.value="",this.otpInputs[0].focus()}resendTimer(){a.showElement(this.resendMessage).hideElement(this.resend);let s=30,i=setInterval((()=>{-1===s?(clearTimeout(i),a.hideElement(this.resendMessage).showElement(this.resend)):(this.timer.innerHTML=`${s>=10?s:"0"+s} : 00`,s--)}),1e3)}resendCode(){return this.btn.stop().then((()=>this.btn.disable())).then((()=>{this.otpInputs.forEach((s=>s.value="")),this.otpInputs[0].focus()})).then((()=>salla.api.auth.resend(this.data))).then((()=>this.resendTimer())).catch((()=>this.resendTimer()))}submit(){let s=Object.assign({code:this.code.value},this.data);return this.btn.load().then((()=>this.btn.disable())).then((()=>this.isProfileVerify?salla.profile.verify(s):salla.auth.verify(s,!0))).then((s=>this.verified.emit(s))).then((()=>this.btn.stop()&&this.btn.disable())).then((()=>this.modal.close())).then((()=>this.autoReload&&window.location.reload())).catch((()=>this.btn.stop()&&this.btn.enable()&&this.reset()))}render(){return this.withoutModal?t(e,null,this.myBody()):t("salla-modal",{icon:"sicon-android-phone",width:"xs",id:"s-verify-modal",ref:s=>this.modal=s,"modal-title":this.title},this.myBody())}myBody(){return t("div",{id:"s-verify-modal"},t("div",{class:"s-verify-modal-message",innerHTML:salla.lang.get("pages.profile.verify_message")}),t("input",{type:"hidden",name:"code",maxlength:"4",required:!0,ref:s=>this.code=s}),t("div",{class:"s-verify-modal-codes",dir:"ltr"},[1,2,3,4].map((()=>t("input",{type:"text",maxlength:"1",class:"s-verify-modal-input",required:!0})))),t("div",{slot:"footer",class:"s-verify-modal-footer"},t("salla-button",{class:"s-verify-modal-submit","loader-position":"center",disabled:!0,onClick:()=>this.submit(),ref:s=>this.btn=s},salla.lang.get("pages.profile.verify")),t("p",{class:"s-verify-modal-resend-message",ref:s=>this.resendMessage=s},salla.lang.get("blocks.header.resend_after"),t("b",{class:"s-verify-modal-timer",ref:s=>this.timer=s})),t("a",{href:"#",class:"s-verify-modal-resend",onClick:()=>this.resendCode(),ref:s=>this.resend=s},salla.lang.get("blocks.comments.submit"))),t("slot",{name:"after-footer"}))}get host(){return l(this)}};r.style="salla-verify-modal{display:block}[dir=ltr] #s-verify-modal .s-verify-modal-back{transform:scale(-1)}";export{r as salla_verify_modal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as a,g as o}from"./p-
|
|
4
|
+
import{r as s,h as a,g as o}from"./p-1d0e664c.js";import{H as l}from"./p-9d2ca9c8.js";const e=class{constructor(a){var o,e;s(this,a),this.offer=null,this.offer_expires_in=salla.lang.get("pages.products.offer_expires_in"),this.remember_my_choice=salla.lang.get("commone.remember_my_choice"),this.add_to_cart=salla.lang.get("pages.cart.add_to_cart"),this.out_of_stock=salla.lang.get("pages.products.out_of_stock"),l.setHost(this.host),salla.lang.onLoaded((()=>{this.offer_expires_in=salla.lang.get("pages.products.offer_expires_in"),this.remember_my_choice=salla.lang.get("common.remember_my_choice"),this.add_to_cart=salla.lang.get("pages.cart.add_to_cart"),this.out_of_stock=salla.lang.get("pages.products.out_of_stock")})),this.categorySlot=(null===(o=l.getElement('[slot="category"]'))||void 0===o?void 0:o.innerHTML)||'<i class="s-offer-modal-badge-icon sicon-tag"></i><span class="s-offer-modal-badge-text">{name}</span>',this.productSlot=(null===(e=l.getElement('[slot="product"]'))||void 0===e?void 0:e.innerHTML)||this.defaultProductSlot(),salla.offer.event.onExisted((s=>{salla.storage.get("remember-offer-"+s.id)?salla.log("User selected to don't show this offer again."):this.open(s.product_id)}))}async open(s){return salla.api.offer.details(s).then((s=>this.showOffer(s.data[0])))}async showOffer(s){return this.offer=s,this.offer_name=s.name,this.offer_message=s.message,this.modal.setTitle(this.offer_name),this.modal.open()}rememberMe(s){salla.storage.set("remember-offer-"+this.offer.id,s.target.checked)}addItem(){return this.load(),salla.cart.api.quickAdd(this.dataset.id).finally((()=>this.stop()))}defaultProductSlot(){return'<a href={url} class="s-offer-modal-product-image-wrap"><img class="s-offer-modal-product-image" src="{image}" /></a><div class="s-offer-modal-product-info"> <a href={url} class="s-offer-modal-product-name">{name}</a> <div class="s-offer-modal-product-price">{price}</div></div>'}render(){var s,o;return a("salla-modal",{id:"salla-offer-modal","sub-title-first":!0,icon:"sicon-special-discount","sub-title":this.offer_message,ref:s=>this.modal=s,"is-loading":null===this.offer},null!==this.offer?[a("div",{class:"s-offer-modal-scrolled-slider-wrap"},a("div",{class:"s-offer-modal-body s-offer-modal-scrolled-slider"},(null===(s=this.offer.get.categories)||void 0===s?void 0:s.length)>0?this.offer.get.categories.map((s=>a("a",{href:s.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item",innerHTML:this.categorySlot.replace(/\{name\}/g,s.name).replace(/\{url\}/g,s.urls.customer)}))):null===(o=this.offer.get.products)||void 0===o?void 0:o.map((s=>a("div",{class:{"s-offer-modal-product":!0,"s-offer-modal-slider-item":!0,"s-offer-modal-not-available":!s.is_available},id:"product_"+s.id,innerHTML:this.productSlot.replace(/\{name\}/g,s.name).replace(/\{url\}/g,s.url).replace(/\{image\}/g,s.thumbnail).replace(/\{price\}/g,s.has_special_price?salla.money(s.price)+'<span class="s-offer-modal-product-old-price">'+salla.money(s.regular_price)+"</span>":salla.money(s.price))},a("div",{class:"s-offer-modal-btn-wrap"},a("salla-button",{width:"wide",fill:"outline","data-id":s.id,disabled:!s.is_available,"loader-position":"center",onClick:this.addItem},s.is_available?this.add_to_cart:this.out_of_stock)))))),a("div",{class:"s-offer-modal-slider-nav"},a("button",{class:"s-offer-modal-nav-btn s-offer-modal-prev-btn"},a("span",{class:"s-offer-modal-nav-btn-icon sicon-keyboard_arrow_left"})),a("button",{class:"s-offer-modal-nav-btn s-offer-modal-next-btn"},a("span",{class:"s-offer-modal-nav-btn-icon sicon-keyboard_arrow_right"})))),a("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.formatted_date?a("p",{class:"s-offer-modal-expiry"},this.offer_expires_in," ",this.offer.formatted_date):"",a("label",{class:"s-offer-modal-remember-label"},a("input",{type:"checkbox",onChange:s=>this.rememberMe(s),class:"s-offer-modal-remember-input"})," ",this.remember_my_choice))]:"")}componentDidRender(){if(this.offer&&window.screen.width>639){let s=this.host.querySelector(".s-offer-modal-scrolled-slider-wrap"),a=this.host.querySelector(".s-offer-modal-scrolled-slider"),o=this.host.querySelectorAll(".s-offer-modal-nav-btn"),l=this.host.querySelector(".s-offer-modal-next-btn"),e=this.host.querySelector(".s-offer-modal-prev-btn"),r=this.host.querySelectorAll(".s-offer-modal-slider-item"),t=20,i=0,f=3,d=r[0].offsetWidth,n=r.length*d,c=s.offsetWidth,m=n-c,h=!!document.body.classList.contains("rtl");m>t&&l.classList.add("s-offer-modal-btn-is-active"),window.onresize=function(){c=s.offsetWidth,m=n-c},a.addEventListener("scroll",(function(){let s=Math.abs(a.scrollLeft),o=m-t;s<=t?(l.classList.add("s-offer-modal-btn-is-active"),e.classList.remove("s-offer-modal-btn-is-active")):s<o?(l.classList.add("s-offer-modal-btn-is-active"),e.classList.add("s-offer-modal-btn-is-active")):s>=o&&(l.classList.remove("s-offer-modal-btn-is-active"),e.classList.add("s-offer-modal-btn-is-active"))})),o.forEach((s=>{s.addEventListener("click",(function(){s.classList.contains("s-offer-modal-next-btn")?i++:i--,a.scrollTo({top:0,left:d*f*i*(h?-1:1),behavior:"smooth"})}))}))}}get host(){return o(this)}};e.style="#salla-offer-modal .s-offer-modal-body{-webkit-overflow-scrolling:touch}#salla-offer-modal .s-offer-modal-body::-webkit-scrollbar{display:none}#salla-offer-modal .s-offer-modal-next-btn{background:linear-gradient(-90deg, #fff 25%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0) 100%)}#salla-offer-modal .s-offer-modal-prev-btn{background:linear-gradient(90deg, #fff 25%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0) 100%)}.rtl #salla-offer-modal .s-offer-modal-next-btn{transform:scale(-1) translateX(100%)}.rtl #salla-offer-modal .s-offer-modal-prev-btn{transform:scale(-1) translateX(-100%)}.rtl #salla-offer-modal .s-offer-modal-btn-is-active{transform:scale(-1) translateX(0)}";export{e as salla_offer_modal}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as e,h as l,H as t,g as n}from"./p-
|
|
4
|
+
import{r as e,h as l,H as t,g as n}from"./p-1d0e664c.js";const i=class{constructor(l){e(this,l)}changeHandler(e){var l;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===(l=null==e?void 0:e.target)||void 0===l?void 0:l.tagName)||"N/A"));let t=e.target.name.replace("[]",""),n="checkbox"===e.target.getAttribute("type");salla.log("Trying to find all the element with condation:",`[data-show-when^="${t}"]`),this.host.querySelectorAll(`[data-show-when^="${t}"]`).forEach((l=>{let t,i=!(null==l?void 0:l.dataset.showWhen.includes("!=")),a=null==l?void 0:l.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim();t=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:",t),i&&t||!i&&!t?(l.classList.remove("hidden"),l.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled"),!["checkbox"].includes(e.getAttribute("type"))&&l.getElementsByClassName("required").length&&e.setAttribute("required","")}))):(l.classList.add("hidden"),l.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 l;let t=null===(l=null==e?void 0:e.dataset)||void 0===l?void 0:l.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$1").trim();t&&this.changeHandler({target:this.host.querySelector('[name^="'+t+'"]')})}))}render(){return l(t,null,l("slot",null))}get host(){return n(this)}};i.style=":host{display:block}";export{i as salla_conditional_fields}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as s,h as t,H as a,g as r}from"./p-
|
|
4
|
+
import{r as s,h as t,H as a,g as r}from"./p-1d0e664c.js";import{H as e}from"./p-9d2ca9c8.js";const i=class{constructor(t){s(this,t),this.name="rating",this.size="medium"}initiateRating(){document.querySelectorAll(".s-rating-stars-element").forEach((s=>{s.addEventListener("submit",(function(s){s.preventDefault();let t=s.target.querySelectorAll(".s-rating-stars-btn-star.s-rating-stars-hovered"),a=t[t.length-1];if(!a)return;let r=a.getAttribute("data-star");s.target.querySelector(".rating_hidden_input").value=r,s.target.querySelectorAll(".s-rating-stars-btn-star").forEach(((s,t)=>e.toggleElementClassIf(s,"s-rating-stars-selected","s-rating-stars-unselected",(()=>t<parseInt(r))))),s.target.querySelectorAll('.s-rating-stars-btn-star[aria-pressed="true"]').forEach((s=>s.removeAttribute("aria-pressed"))),a.setAttribute("aria-pressed","")}))}))}highlightSelectedStars(){let s=["s-rating-stars-hovered"],t=this.host.querySelector(".s-rating-stars-element"),a=null==t?void 0:t.querySelectorAll(".s-rating-stars-btn-star");null==t||t.addEventListener("mouseout",(()=>a.forEach((t=>t.classList.remove(...s))))),null==a||a.forEach(((t,r)=>{t.addEventListener("mouseover",(()=>{if(t.classList.add(...s),r<=1)"BUTTON"===t.previousElementSibling.tagName&&t.previousElementSibling.classList.add(...s);else for(let t=0;t<r;t++)a[t].classList.add(...s)})),t.addEventListener("mouseout",(()=>t.classList.remove(...s)))}))}createStars(s){let a=[];for(let r=0;r<5;r++)a.push(t("span",{class:{"s-rating-stars-btn-star sicon-star2":!0,["s-rating-stars-"+this.size]:!0,"s-rating-stars-selected":r<s}}));return a}render(){return t(a,null,this.value?t("div",{class:"s-rating-stars-wrapper"}," ",this.createStars(this.value)," "):t("form",{class:"s-rating-stars-element"},t("input",{type:"hidden",class:"rating_hidden_input",name:this.name,value:""}),[1,2,3,4,5].map((s=>t("button",{type:"submit",class:"s-rating-stars-btn-star s-rating-stars-"+this.size,"data-star":s},t("i",{class:"sicon-star2"}))))))}componentDidLoad(){this.initiateRating(),this.highlightSelectedStars()}get host(){return r(this)}};i.style=":host{display:block}";export{i as salla_rating_stars}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,h as s,H as i,g as n}from"./p-
|
|
4
|
+
import{r as t,h as s,H as i,g as n}from"./p-1d0e664c.js";import{H as a}from"./p-9d2ca9c8.js";const e=class{constructor(s){t(this,s),this.hostAttributes={},this.hasIncrementSlot=!1,this.hasDecrementSlot=!1,this.didLoaded=!1,this.quantity=1}watchPropHandler(){this.didLoaded&&a.debounce((()=>salla.document.event.fireEvent(this.textInput,"change",{bubbles:!0})))}componentWillLoad(){this.quantity=parseInt(this.host.getAttribute("value"))||1,this.hasIncrementSlot=!!this.host.querySelector('[slot="increment-button"]'),this.hasDecrementSlot=!!this.host.querySelector('[slot="decrement-button"]')}componentDidLoad(){this.didLoaded=!0,this.textInput.addEventListener("input",(t=>salla.helpers.inputDigitsOnly(t.target)))}getInputAttributes(){for(let t=0;t<this.host.attributes.length;t++)["id","value","min","class"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes}async decrease(){return this.setValue(this.quantity-1)}async increase(){return this.setValue(this.quantity+1)}async setValue(t){let s=parseInt(this.host.getAttribute("max"));return s&&t>s&&(t=s),t<=1&&(t=1),this.quantity=t,this.host}render(){return s(i,{class:"s-quantity-input s-quantity-input-container"},s("button",{onClick:()=>this.increase(),class:"s-quantity-input-button",type:"button"},this.hasIncrementSlot?"":s("i",{class:"sicon-add"}),s("slot",{name:"increment-button"})),s("input",Object.assign({class:"s-quantity-input-input"},this.getInputAttributes(),{ref:t=>this.textInput=t,onInput:t=>this.setValue(t.target.value),min:"1",value:this.quantity})),s("button",{class:"s-quantity-input-button",onClick:()=>this.decrease(),type:"button"},this.hasDecrementSlot?"":s("i",{class:"sicon-minus"}),s("slot",{name:"decrement-button"})))}get host(){return n(this)}static get watchers(){return{quantity:["watchPropHandler"]}}};e.style=":host{display:block}";export{e as salla_quantity_input}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import{p as e,b as a}from"./p-
|
|
4
|
+
import{p as e,b as a}from"./p-1d0e664c.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((e=>a([["p-37e0a91d",[[4,"salla-add-product-button",{channels:[513],quantity:[514],donatingAmount:[514,"donating-amount"],productId:[520,"product-id"],productStatus:[513,"product-status"],productType:[513,"product-type"],disabled:[516]}],[0,"salla-search",{inline:[4],oval:[4],height:[2],results:[32],placeholder:[32],noResultsText:[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[0,"salla-product-availability",{channels:[1],productId:[2,"product-id"],isSubscribed:[1028,"is-subscribed"],subTitle:[32],mobileLabel:[32],emailLabel:[32],emailPlaceholder:[32],subscribedMessage:[32],title_:[32],emailErrorMsg:[32],isVisitorSubscribed:[32]}],[0,"salla-tel-input",{phone:[1025],name:[1],countryCode:[1025,"country-code"],mobileRequired:[32],countryCodeLabel:[32],mobileLabel:[32],tooShort:[32],tooLong:[32],invalidCountryCode:[32],invalidNumber:[32],errorMap:[32],getValues:[64],isValid:[64]}],[4,"salla-button",{shape:[513],color:[513],fill:[513],size:[513],width:[513],loading:[516],disabled:[516],loaderPosition:[1,"loader-position"],wide:[4],href:[1],load:[64],stop:[64],setText:[64],disable:[64],enable:[64]}],[4,"salla-modal",{isClosable:[1028,"is-closable"],width:[513],position:[513],visible:[516],isLoading:[1540,"is-loading"],subTitleFirst:[4,"sub-title-first"],noPadding:[4,"no-padding"],subTitle:[1,"sub-title"],icon:[1],iconStyle:[1,"icon-style"],imageIcon:[1,"image-icon"],modalTitle:[32],open:[64],close:[64],setTitle:[64],loading:[64],stopLoading:[64]}]]],["p-baf8dbbd",[[4,"salla-login-modal",{isEmailAllowed:[1028,"is-email-allowed"],isMobileAllowed:[1028,"is-mobile-allowed"],isEmailRequired:[1028,"is-email-required"],title:[32],loginTypeTitle:[32],loginText:[32],smsLabel:[32],mobileLabel:[32],emailLabel:[32],enterText:[32],bySMSText:[32],byEmailText:[32],emailErrorMsg:[32],firstNameLabel:[32],lastNameLabel:[32],firstNameErrorMsg:[32],lastNameErrorMsg:[32],open:[64]},[[8,"verified","onVerified"]]]]],["p-2384537d",[[0,"salla-rating-modal",{orderId:[2,"order-id"],order:[32],open:[64],close:[64]}]]],["p-210f5278",[[4,"salla-branches",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}]]],["p-74df54ad",[[0,"salla-localization-modal",{language:[1537],currency:[1537],languages:[32],currencies:[32],languagesTitle:[32],currenciesTitle:[32],isLoading:[32],open:[64],close:[64],submit:[64]}]]],["p-cf78ba07",[[0,"salla-offer-modal",{offer:[32],offer_name:[32],offer_message:[32],offer_expires_in:[32],remember_my_choice:[32],add_to_cart:[32],out_of_stock:[32],open:[64],showOffer:[64]}]]],["p-d77dd260",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-56065da6",[[4,"salla-infinite-scroll",{nextPage:[1,"next-page"],autoload:[1028],container:[1],item:[1],loadMore:[32],noMore:[32],failedToLoad:[32]}]]],["p-0fbee559",[[0,"salla-installment",{price:[1],language:[1],currency:[1],tamaraIsActive:[32],tabbyIsActive:[32],spotiiIsActive:[32]}]]],["p-edbb12b2",[[4,"salla-quantity-input",{quantity:[32],decrease:[64],increase:[64],setValue:[64]}]]],["p-d762e16f",[[1,"salla-sizes-table"]]],["p-cc422c09",[[4,"salla-verify-modal",{withoutModal:[4,"without-modal"],type:[1025],autoReload:[4,"auto-reload"],title:[32],isProfileVerify:[32],getCode:[64],open:[64]}]]],["p-ecaee6a4",[[0,"salla-rating-stars",{name:[1],size:[1],value:[2]}]]]],e)));
|
|
@@ -274,6 +274,8 @@ export namespace Components {
|
|
|
274
274
|
"inline": boolean;
|
|
275
275
|
"oval": boolean;
|
|
276
276
|
}
|
|
277
|
+
interface SallaSizesTable {
|
|
278
|
+
}
|
|
277
279
|
interface SallaTelInput {
|
|
278
280
|
/**
|
|
279
281
|
* Current country_code
|
|
@@ -414,6 +416,12 @@ declare global {
|
|
|
414
416
|
prototype: HTMLSallaSearchElement;
|
|
415
417
|
new (): HTMLSallaSearchElement;
|
|
416
418
|
};
|
|
419
|
+
interface HTMLSallaSizesTableElement extends Components.SallaSizesTable, HTMLStencilElement {
|
|
420
|
+
}
|
|
421
|
+
var HTMLSallaSizesTableElement: {
|
|
422
|
+
prototype: HTMLSallaSizesTableElement;
|
|
423
|
+
new (): HTMLSallaSizesTableElement;
|
|
424
|
+
};
|
|
417
425
|
interface HTMLSallaTelInputElement extends Components.SallaTelInput, HTMLStencilElement {
|
|
418
426
|
}
|
|
419
427
|
var HTMLSallaTelInputElement: {
|
|
@@ -442,6 +450,7 @@ declare global {
|
|
|
442
450
|
"salla-rating-modal": HTMLSallaRatingModalElement;
|
|
443
451
|
"salla-rating-stars": HTMLSallaRatingStarsElement;
|
|
444
452
|
"salla-search": HTMLSallaSearchElement;
|
|
453
|
+
"salla-sizes-table": HTMLSallaSizesTableElement;
|
|
445
454
|
"salla-tel-input": HTMLSallaTelInputElement;
|
|
446
455
|
"salla-verify-modal": HTMLSallaVerifyModalElement;
|
|
447
456
|
}
|
|
@@ -629,6 +638,8 @@ declare namespace LocalJSX {
|
|
|
629
638
|
"inline"?: boolean;
|
|
630
639
|
"oval"?: boolean;
|
|
631
640
|
}
|
|
641
|
+
interface SallaSizesTable {
|
|
642
|
+
}
|
|
632
643
|
interface SallaTelInput {
|
|
633
644
|
/**
|
|
634
645
|
* Current country_code
|
|
@@ -678,6 +689,7 @@ declare namespace LocalJSX {
|
|
|
678
689
|
"salla-rating-modal": SallaRatingModal;
|
|
679
690
|
"salla-rating-stars": SallaRatingStars;
|
|
680
691
|
"salla-search": SallaSearch;
|
|
692
|
+
"salla-sizes-table": SallaSizesTable;
|
|
681
693
|
"salla-tel-input": SallaTelInput;
|
|
682
694
|
"salla-verify-modal": SallaVerifyModal;
|
|
683
695
|
}
|
|
@@ -701,6 +713,7 @@ declare module "@stencil/core" {
|
|
|
701
713
|
"salla-rating-modal": LocalJSX.SallaRatingModal & JSXBase.HTMLAttributes<HTMLSallaRatingModalElement>;
|
|
702
714
|
"salla-rating-stars": LocalJSX.SallaRatingStars & JSXBase.HTMLAttributes<HTMLSallaRatingStarsElement>;
|
|
703
715
|
"salla-search": LocalJSX.SallaSearch & JSXBase.HTMLAttributes<HTMLSallaSearchElement>;
|
|
716
|
+
"salla-sizes-table": LocalJSX.SallaSizesTable & JSXBase.HTMLAttributes<HTMLSallaSizesTableElement>;
|
|
704
717
|
"salla-tel-input": LocalJSX.SallaTelInput & JSXBase.HTMLAttributes<HTMLSallaTelInputElement>;
|
|
705
718
|
"salla-verify-modal": LocalJSX.SallaVerifyModal & JSXBase.HTMLAttributes<HTMLSallaVerifyModalElement>;
|
|
706
719
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
let e,l,t=!1,n=!1,s=!1,o=!1;const i="undefined"!=typeof window?window:{},r=i.document||{head:{}},c={l:0,t:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,l,t,n)=>e.addEventListener(l,t,n),rel:(e,l,t,n)=>e.removeEventListener(l,t,n),ce:(e,l)=>new CustomEvent(e,l)},f=e=>Promise.resolve(e),u=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),a=(e,l,t)=>{t&&t.map((([t,n,s])=>{const o=d(e,t),i=$(l,s),r=h(t);c.ael(o,n,i,r),(l.o=l.o||[]).push((()=>c.rel(o,n,i,r)))}))},$=(e,l)=>t=>{try{256&e.l?e.i[l](t):(e.u=e.u||[]).push([l,t])}catch(e){ue(e)}},d=(e,l)=>8&l?i:e,h=e=>0!=(2&e),y="http://www.w3.org/1999/xlink",m=new WeakMap,p=e=>"sc-"+e.$,b={},w=e=>"object"==(e=typeof e)||"function"===e,g=(e,l,...t)=>{let n=null,s=null,o=null,i=!1,r=!1,c=[];const f=l=>{for(let t=0;t<l.length;t++)n=l[t],Array.isArray(n)?f(n):null!=n&&"boolean"!=typeof n&&((i="function"!=typeof e&&!w(n))&&(n+=""),i&&r?c[c.length-1].h+=n:c.push(i?k(null,n):n),r=i)};if(f(t),l){l.key&&(s=l.key),l.name&&(o=l.name);{const e=l.className||l.class;e&&(l.class="object"!=typeof e?e:Object.keys(e).filter((l=>e[l])).join(" "))}}const u=k(e,null);return u.m=l,c.length>0&&(u.p=c),u.g=s,u.k=o,u},k=(e,l)=>({l:0,S:e,h:l,v:null,p:null,m:null,g:null,k:null}),S={},v=(e,l,t,n,s,o)=>{if(t!==n){let r=fe(e,l),f=l.toLowerCase();if("class"===l){const l=e.classList,s=x(t),o=x(n);l.remove(...s.filter((e=>e&&!o.includes(e)))),l.add(...o.filter((e=>e&&!s.includes(e))))}else if("style"===l){for(const l in t)n&&null!=n[l]||(l.includes("-")?e.style.removeProperty(l):e.style[l]="");for(const l in n)t&&n[l]===t[l]||(l.includes("-")?e.style.setProperty(l,n[l]):e.style[l]=n[l])}else if("key"===l);else if("ref"===l)n&&n(e);else if(r||"o"!==l[0]||"n"!==l[1]){const i=w(n);if((r||i&&null!==n)&&!s)try{if(e.tagName.includes("-"))e[l]=n;else{let s=null==n?"":n;"list"===l?r=!1:null!=t&&e[l]==s||(e[l]=s)}}catch(e){}let c=!1;f!==(f=f.replace(/^xlink\:?/,""))&&(l=f,c=!0),null==n||!1===n?!1===n&&""!==e.getAttribute(l)||(c?e.removeAttributeNS(y,l):e.removeAttribute(l)):(!r||4&o||s)&&!i&&(n=!0===n?"":n,c?e.setAttributeNS(y,l,n):e.setAttribute(l,n))}else l="-"===l[2]?l.slice(3):fe(i,f)?f.slice(2):f[2]+l.slice(3),t&&c.rel(e,l,t,!1),n&&c.ael(e,l,n,!1)}},j=/\s/,x=e=>e?e.split(j):[],M=(e,l,t,n)=>{const s=11===l.v.nodeType&&l.v.host?l.v.host:l.v,o=e&&e.m||b,i=l.m||b;for(n in o)n in i||v(s,n,o[n],void 0,t,l.l);for(n in i)v(s,n,o[n],i[n],t,l.l)},O=(n,o,i)=>{let c,f,u,a=o.p[i],$=0;if(t||(s=!0,"slot"===a.S&&(a.l|=a.p?2:1)),null!==a.h)c=a.v=r.createTextNode(a.h);else if(1&a.l)c=a.v=r.createTextNode("");else if(c=a.v=r.createElement(2&a.l?"slot-fb":a.S),M(null,a,!1),a.p)for($=0;$<a.p.length;++$)f=O(n,a,$),f&&c.appendChild(f);return c["s-hn"]=l,3&a.l&&(c["s-sr"]=!0,c["s-cr"]=e,c["s-sn"]=a.k||"",u=n&&n.p&&n.p[i],u&&u.S===a.S&&n.v&&C(n.v,!1)),c},C=(e,t)=>{c.l|=1;const n=e.childNodes;for(let e=n.length-1;e>=0;e--){const o=n[e];o["s-hn"]!==l&&o["s-ol"]&&(L(o).insertBefore(o,I(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&C(o,t)}c.l&=-2},R=(e,l,t,n,s,o)=>{let i,r=e["s-cr"]&&e["s-cr"].parentNode||e;for(;s<=o;++s)n[s]&&(i=O(null,t,s),i&&(n[s].v=i,r.insertBefore(i,I(l))))},P=(e,l,t,s,o)=>{for(;l<=t;++l)(s=e[l])&&(o=s.v,F(s),n=!0,o["s-ol"]?o["s-ol"].remove():C(o,!0),o.remove())},T=(e,l)=>e.S===l.S&&("slot"===e.S?e.k===l.k:e.g===l.g),I=e=>e&&e["s-ol"]||e,L=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,N=(e,l)=>{const t=l.v=e.v,n=e.p,s=l.p,o=l.h;let i;null===o?("slot"===l.S||M(e,l,!1),null!==n&&null!==s?((e,l,t,n)=>{let s,o,i=0,r=0,c=0,f=0,u=l.length-1,a=l[0],$=l[u],d=n.length-1,h=n[0],y=n[d];for(;i<=u&&r<=d;)if(null==a)a=l[++i];else if(null==$)$=l[--u];else if(null==h)h=n[++r];else if(null==y)y=n[--d];else if(T(a,h))N(a,h),a=l[++i],h=n[++r];else if(T($,y))N($,y),$=l[--u],y=n[--d];else if(T(a,y))"slot"!==a.S&&"slot"!==y.S||C(a.v.parentNode,!1),N(a,y),e.insertBefore(a.v,$.v.nextSibling),a=l[++i],y=n[--d];else if(T($,h))"slot"!==a.S&&"slot"!==y.S||C($.v.parentNode,!1),N($,h),e.insertBefore($.v,a.v),$=l[--u],h=n[++r];else{for(c=-1,f=i;f<=u;++f)if(l[f]&&null!==l[f].g&&l[f].g===h.g){c=f;break}c>=0?(o=l[c],o.S!==h.S?s=O(l&&l[r],t,c):(N(o,h),l[c]=void 0,s=o.v),h=n[++r]):(s=O(l&&l[r],t,r),h=n[++r]),s&&L(a.v).insertBefore(s,I(a.v))}i>u?R(e,null==n[d+1]?null:n[d+1].v,t,n,r,d):r>d&&P(l,i,u)})(t,n,l,s):null!==s?(null!==e.h&&(t.textContent=""),R(t,null,l,s,0,s.length-1)):null!==n&&P(n,0,n.length-1)):(i=t["s-cr"])?i.parentNode.textContent=o:e.h!==o&&(t.data=o)},E=e=>{let l,t,n,s,o,i,r=e.childNodes;for(t=0,n=r.length;t<n;t++)if(l=r[t],1===l.nodeType){if(l["s-sr"])for(o=l["s-sn"],l.hidden=!1,s=0;s<n;s++)if(i=r[s].nodeType,r[s]["s-hn"]!==l["s-hn"]||""!==o){if(1===i&&o===r[s].getAttribute("slot")){l.hidden=!0;break}}else if(1===i||3===i&&""!==r[s].textContent.trim()){l.hidden=!0;break}E(l)}},W=[],A=e=>{let l,t,s,o,i,r,c=0,f=e.childNodes,u=f.length;for(;c<u;c++){if(l=f[c],l["s-sr"]&&(t=l["s-cr"])&&t.parentNode)for(s=t.parentNode.childNodes,o=l["s-sn"],r=s.length-1;r>=0;r--)t=s[r],t["s-cn"]||t["s-nr"]||t["s-hn"]===l["s-hn"]||(D(t,o)?(i=W.find((e=>e.j===t)),n=!0,t["s-sn"]=t["s-sn"]||o,i?i.M=l:W.push({M:l,j:t}),t["s-sr"]&&W.map((e=>{D(e.j,t["s-sn"])&&(i=W.find((e=>e.j===t)),i&&!e.M&&(e.M=i.M))}))):W.some((e=>e.j===t))||W.push({j:t}));1===l.nodeType&&A(l)}},D=(e,l)=>1===e.nodeType?null===e.getAttribute("slot")&&""===l||e.getAttribute("slot")===l:e["s-sn"]===l||""===l,F=e=>{e.m&&e.m.ref&&e.m.ref(null),e.p&&e.p.map(F)},H=e=>ie(e).O,U=(e,l,t)=>{const n=H(e);return{emit:e=>q(n,l,{bubbles:!!(4&t),composed:!!(2&t),cancelable:!!(1&t),detail:e})}},q=(e,l,t)=>{const n=c.ce(l,t);return e.dispatchEvent(n),n},V=(e,l)=>{l&&!e.C&&l["s-p"]&&l["s-p"].push(new Promise((l=>e.C=l)))},_=(e,l)=>{if(e.l|=16,!(4&e.l))return V(e,e.R),ge((()=>z(e,l)));e.l|=512},z=(e,l)=>{const t=e.i;let n;return l&&(e.l|=256,e.u&&(e.u.map((([e,l])=>Q(t,e,l))),e.u=null),n=Q(t,"componentWillLoad")),X(n,(()=>B(e,t,l)))},B=async(e,l,t)=>{const n=e.O,s=n["s-rc"];t&&(e=>{const l=e.P;((e,l)=>{let t=p(l),n=de.get(t);if(e=11===e.nodeType?e:r,n)if("string"==typeof n){let l,s=m.get(e=e.head||e);s||m.set(e,s=new Set),s.has(t)||(e.host&&(l=e.querySelector(`[sty-id="${t}"]`))?l.innerHTML=n:(l=r.createElement("style"),l.innerHTML=n,e.insertBefore(l,e.querySelector("link"))),s&&s.add(t))}else e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n])})(e.O.getRootNode(),l)})(e);G(e,l),s&&(s.map((e=>e())),n["s-rc"]=void 0);{const l=n["s-p"],t=()=>J(e);0===l.length?t():(Promise.all(l).then(t),e.l|=4,l.length=0)}},G=(o,i)=>{try{i=i.render(),o.l&=-17,o.l|=2,((o,i)=>{const f=o.O,u=o.P,a=o.T||k(null,null),$=(e=>e&&e.S===S)(i)?i:g(null,null,i);if(l=f.tagName,u.I&&($.m=$.m||{},u.I.map((([e,l])=>$.m[l]=f[e]))),$.S=null,$.l|=4,o.T=$,$.v=a.v=f,e=f["s-cr"],t=0!=(1&u.l),n=!1,N(a,$),c.l|=1,s){let e,l,t,n,s,o;A($.v);let i=0;for(;i<W.length;i++)e=W[i],l=e.j,l["s-ol"]||(t=r.createTextNode(""),t["s-nr"]=l,l.parentNode.insertBefore(l["s-ol"]=t,l));for(i=0;i<W.length;i++)if(e=W[i],l=e.j,e.M){for(n=e.M.parentNode,s=e.M.nextSibling,t=l["s-ol"];t=t.previousSibling;)if(o=t["s-nr"],o&&o["s-sn"]===l["s-sn"]&&n===o.parentNode&&(o=o.nextSibling,!o||!o["s-nr"])){s=o;break}(!s&&n!==l.parentNode||l.nextSibling!==s)&&l!==s&&(!l["s-hn"]&&l["s-ol"]&&(l["s-hn"]=l["s-ol"].parentNode.nodeName),n.insertBefore(l,s))}else 1===l.nodeType&&(l.hidden=!0)}n&&E($.v),c.l&=-2,W.length=0})(o,i)}catch(e){ue(e,o.O)}return null},J=e=>{const l=e.O,t=e.i,n=e.R;Q(t,"componentDidRender"),64&e.l||(e.l|=64,Y(l),Q(t,"componentDidLoad"),e.L(l),n||K()),e.N(l),e.C&&(e.C(),e.C=void 0),512&e.l&&we((()=>_(e,!1))),e.l&=-517},K=()=>{Y(r.documentElement),we((()=>q(i,"appload",{detail:{namespace:"twilight-components"}})))},Q=(e,l,t)=>{if(e&&e[l])try{return e[l](t)}catch(e){ue(e)}},X=(e,l)=>e&&e.then?e.then(l):l(),Y=e=>e.classList.add("hydrated"),Z=(e,l,t,n,s,o,i)=>{let r,c,f,u;if(1===o.nodeType){for(r=o.getAttribute("c-id"),r&&(c=r.split("."),c[0]!==i&&"0"!==c[0]||(f={l:0,W:c[0],A:c[1],D:c[2],F:c[3],S:o.tagName.toLowerCase(),v:o,m:null,p:null,g:null,k:null,h:null},l.push(f),o.removeAttribute("c-id"),e.p||(e.p=[]),e.p[f.F]=f,e=f,n&&"0"===f.D&&(n[f.F]=f.v))),u=o.childNodes.length-1;u>=0;u--)Z(e,l,t,n,s,o.childNodes[u],i);if(o.shadowRoot)for(u=o.shadowRoot.childNodes.length-1;u>=0;u--)Z(e,l,t,n,s,o.shadowRoot.childNodes[u],i)}else if(8===o.nodeType)c=o.nodeValue.split("."),c[1]!==i&&"0"!==c[1]||(r=c[0],f={l:0,W:c[1],A:c[2],D:c[3],F:c[4],v:o,m:null,p:null,g:null,k:null,S:null,h:null},"t"===r?(f.v=o.nextSibling,f.v&&3===f.v.nodeType&&(f.h=f.v.textContent,l.push(f),o.remove(),e.p||(e.p=[]),e.p[f.F]=f,n&&"0"===f.D&&(n[f.F]=f.v))):f.W===i&&("s"===r?(f.S="slot",o["s-sn"]=c[5]?f.k=c[5]:"",o["s-sr"]=!0,t.push(f),e.p||(e.p=[]),e.p[f.F]=f):"r"===r&&(s["s-cr"]=o,o["s-cn"]=!0)));else if(e&&"style"===e.S){const l=k(null,o.textContent);l.v=o,l.F="0",e.p=[l]}},ee=(e,l)=>{if(1===e.nodeType){let t=0;for(;t<e.childNodes.length;t++)ee(e.childNodes[t],l);if(e.shadowRoot)for(t=0;t<e.shadowRoot.childNodes.length;t++)ee(e.shadowRoot.childNodes[t],l)}else if(8===e.nodeType){const t=e.nodeValue.split(".");"o"===t[0]&&(l.set(t[1]+"."+t[2],e),e.nodeValue="",e["s-en"]=t[3])}},le=(e,l,t)=>{if(l.H){e.watchers&&(l.U=e.watchers);const n=Object.entries(l.H),s=e.prototype;if(n.map((([e,[n]])=>{31&n||2&t&&32&n?Object.defineProperty(s,e,{get(){return((e,l)=>ie(this).q.get(l))(0,e)},set(t){((e,l,t,n)=>{const s=ie(e),o=s.O,i=s.q.get(l),r=s.l,c=s.i;if(t=((e,l)=>null==e||w(e)?e:4&l?"false"!==e&&(""===e||!!e):2&l?parseFloat(e):1&l?e+"":e)(t,n.H[l][0]),(!(8&r)||void 0===i)&&t!==i&&(!Number.isNaN(i)||!Number.isNaN(t))&&(s.q.set(l,t),c)){if(n.U&&128&r){const e=n.U[l];e&&e.map((e=>{try{c[e](t,i,l)}catch(e){ue(e,o)}}))}2==(18&r)&&_(s,!1)}})(this,e,t,l)},configurable:!0,enumerable:!0}):1&t&&64&n&&Object.defineProperty(s,e,{value(...l){const t=ie(this);return t.V.then((()=>t.i[e](...l)))}})})),1&t){const t=new Map;s.attributeChangedCallback=function(e,l,n){c.jmp((()=>{const l=t.get(e);if(this.hasOwnProperty(l))n=this[l],delete this[l];else if(s.hasOwnProperty(l)&&"number"==typeof this[l]&&this[l]==n)return;this[l]=(null!==n||"boolean"!=typeof this[l])&&n}))},e.observedAttributes=n.filter((([e,l])=>15&l[0])).map((([e,n])=>{const s=n[1]||e;return t.set(s,e),512&n[0]&&l.I.push([e,s]),s}))}}return e},te=e=>{if(0==(1&c.l)){const l=ie(e),t=l.P,n=()=>{};if(1&l.l)a(e,l,t._);else{let n;l.l|=1,n=e.getAttribute("s-id"),n&&((e,l,t,n)=>{const s=e.shadowRoot,o=[],i=n.T=k(l,null);c.B||ee(r.body,c.B=new Map),e["s-id"]=t,e.removeAttribute("s-id"),Z(i,o,[],null,e,e,t),o.map((e=>{const t=e.W+"."+e.A,n=c.B.get(t),o=e.v;n&&""===n["s-en"]&&n.parentNode.insertBefore(o,n.nextSibling),s||(o["s-hn"]=l,n&&(o["s-ol"]=n,o["s-ol"]["s-nr"]=o)),c.B.delete(t)}))})(e,t.$,n,l),n||12&t.l&&ne(e);{let t=e;for(;t=t.parentNode||t.host;)if(1===t.nodeType&&t.hasAttribute("s-id")&&t["s-p"]||t["s-p"]){V(l,l.R=t);break}}t.H&&Object.entries(t.H).map((([l,[t]])=>{if(31&t&&e.hasOwnProperty(l)){const t=e[l];delete e[l],e[l]=t}})),(async(e,l,t,n,s)=>{if(0==(32&l.l)){{if(l.l|=32,(s=$e(t)).then){const e=()=>{};s=await s,e()}s.isProxied||(t.U=s.watchers,le(s,t,2),s.isProxied=!0);const e=()=>{};l.l|=8;try{new s(l)}catch(e){ue(e)}l.l&=-9,l.l|=128,e()}if(s.style){let e=s.style;const l=p(t);if(!de.has(l)){const n=()=>{};((e,l,t)=>{let n=de.get(e);u&&t?(n=n||new CSSStyleSheet,n.replace(l)):n=l,de.set(e,n)})(l,e,!!(1&t.l)),n()}}}const o=l.R,i=()=>_(l,!0);o&&o["s-rc"]?o["s-rc"].push(i):i()})(0,l,t)}n()}},ne=e=>{const l=e["s-cr"]=r.createComment("");l["s-cn"]=!0,e.insertBefore(l,e.firstChild)},se=(e,l={})=>{const t=[],n=l.exclude||[],s=i.customElements,o=r.head,f=o.querySelector("meta[charset]"),u=r.createElement("style"),a=[];let $,d=!0;Object.assign(c,l),c.t=new URL(l.resourcesUrl||"./",r.baseURI).href,c.l|=2,e.map((e=>{e[1].map((l=>{const o={l:l[0],$:l[1],H:l[2],_:l[3]};o.H=l[2],o._=l[3],o.I=[],o.U={};const i=o.$,r=class extends HTMLElement{constructor(e){super(e),ce(e=this,o)}connectedCallback(){$&&(clearTimeout($),$=null),d?a.push(this):c.jmp((()=>te(this)))}disconnectedCallback(){c.jmp((()=>(()=>{if(0==(1&c.l)){const e=ie(this);e.o&&(e.o.map((e=>e())),e.o=void 0)}})()))}componentOnReady(){return ie(this).G}};o.J=e[0],n.includes(i)||s.get(i)||(t.push(i),s.define(i,le(r,o,1)))}))})),u.innerHTML=t+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles",""),o.insertBefore(u,f?f.nextSibling:o.firstChild),d=!1,a.length?a.map((e=>e.connectedCallback())):c.jmp((()=>$=setTimeout(K,30)))},oe=new WeakMap,ie=e=>oe.get(e),re=(e,l)=>oe.set(l.i=e,l),ce=(e,l)=>{const t={l:0,O:e,P:l,q:new Map};return t.V=new Promise((e=>t.N=e)),t.G=new Promise((e=>t.L=e)),e["s-p"]=[],e["s-rc"]=[],a(e,t,l._),oe.set(e,t)},fe=(e,l)=>l in e,ue=(e,l)=>(0,console.error)(e,l),ae=new Map,$e=e=>{const l=e.$.replace(/-/g,"_"),t=e.J,n=ae.get(t);return n?n[l]:import(`./${t}.entry.js`).then((e=>(ae.set(t,e),e[l])),ue)},de=new Map,he=[],ye=[],me=(e,l)=>t=>{e.push(t),o||(o=!0,l&&4&c.l?we(be):c.raf(be))},pe=e=>{for(let l=0;l<e.length;l++)try{e[l](performance.now())}catch(e){ue(e)}e.length=0},be=()=>{pe(he),pe(ye),(o=he.length>0)&&c.raf(be)},we=e=>f().then(e),ge=me(ye,!0);export{S as H,se as b,U as c,H as g,g as h,f as p,re as r}
|