@ecomplus/storefront-components 1.0.0-beta.165 → 1.0.0-beta.167

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/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-beta.167](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-components@1.0.0-beta.166...@ecomplus/storefront-components@1.0.0-beta.167) (2023-11-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **components/picture:** ensure fallback webp srcset for \*.avif pictures ([fb85283](https://github.com/ecomplus/storefront/commit/fb852835fa519c10439b0b88c43f73121508d7c9))
11
+
12
+ # [1.0.0-beta.166](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-components@1.0.0-beta.165...@ecomplus/storefront-components@1.0.0-beta.166) (2023-11-07)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **components/discount-applier:** do not accumulate discount apps by default ([a638149](https://github.com/ecomplus/storefront/commit/a638149bc37f8f88bd6a693bc3745e67c450d5bd))
17
+
6
18
  # [1.0.0-beta.165](https://github.com/ecomplus/storefront/compare/@ecomplus/storefront-components@1.0.0-beta.164...@ecomplus/storefront-components@1.0.0-beta.165) (2023-11-06)
7
19
 
8
20
  ### Bug Fixes
@@ -9,7 +9,7 @@
9
9
  * (c) E-Com Club <ti@e-com.club>
10
10
  * Released under the MIT License.
11
11
  */
12
- const x=new w;e.a=x},function(t,e,i){"use strict";var r=i(52),n=Object.prototype.toString;function s(t){return"[object Array]"===n.call(t)}function o(t){return void 0===t}function a(t){return null!==t&&"object"==typeof t}function c(t){if("[object Object]"!==n.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function l(t){return"[object Function]"===n.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var i=0,r=t.length;i<r;i++)e.call(null,t[i],i,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===n.call(t)},isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isPlainObject:c,isUndefined:o,isDate:function(t){return"[object Date]"===n.call(t)},isFile:function(t){return"[object File]"===n.call(t)},isBlob:function(t){return"[object Blob]"===n.call(t)},isFunction:l,isStream:function(t){return a(t)&&l(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:u,merge:function t(){var e={};function i(i,r){c(e[r])&&c(i)?e[r]=t(e[r],i):c(i)?e[r]=t({},i):s(i)?e[r]=i.slice():e[r]=i}for(var r=0,n=arguments.length;r<n;r++)u(arguments[r],i);return e},extend:function(t,e,i){return u(e,(function(e,n){t[n]=i&&"function"==typeof e?r(e,i):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e,i){"use strict";(function(t){e.a="object"==typeof window&&window||"object"==typeof t&&t&&t.env||{}}).call(this,i(23))},function(t,e,i){"use strict";var r=i(150),n=i(46),s=i(19);var o={name:"APicture",props:{src:[String,Object],fallbackSrc:String,alt:String,canCalcHeight:{type:Boolean,default:!0},placeholder:{type:String,default:"/assets/img-placeholder.png"},containerBreakpoints:{type:Object,default:()=>({zoom:null,big:800,[r.a.get("default_img_size")||"normal"]:400})},lozadOptions:{type:Object,default:()=>({rootMargin:"350px 0px",threshold:0})}},data:()=>({sources:[],imgWidth:0,imgHeight:0,height:null,opacity:null}),computed:{defaultImgObj(){return"object"==typeof this.src&&this.src?Object(n.a)(this.src)||this.src:{}},localFallbackSrc(){const{src:t,defaultImgObj:e,fallbackSrc:i}=this;if(i)return i;const r="object"==typeof t?t.zoom?t.zoom.url:e.url:t;return r?r.replace(/\.webp$/,""):this.placeholder},localAlt(){const{alt:t,src:e,defaultImgObj:i}=this;return t||(e?i.alt||"Product":"No image")}},methods:{updateSources(){const t=[];let e;if("object"==typeof this.src){const{clientWidth:t,clientHeight:i}=this.$el,r=((t,e,i,r)=>{let n,s;for(const o in r){const a=r[o];if(void 0!==a&&t[o]){if(void 0!==s)if(null===a){if(s>=e)continue}else if(a<e||a-50<=i||null!==s&&a>s)continue;n=o,s=a}}return n})(this.src,t,i,this.containerBreakpoints),n=this.src[r],{url:s,size:o}=n||this.defaultImgObj;e=s,o&&([this.imgWidth,this.imgHeight]=o.split("x").map(t=>parseInt(t,10)),t&&this.imgHeight&&this.canCalcHeight&&(this.height=(t>=this.imgWidth?this.imgHeight:t*this.imgHeight/this.imgWidth)+"px"))}else e=this.src;e&&(e.endsWith(".webp")?t.push({srcset:e,type:"image/webp"},{srcset:/\/imgs\/[0-9]{3}px/.test(e)?e.replace(/\/imgs\/[0-9]{3}px/,""):e.replace(/\.webp$/,""),type:"image/"+(".png"===e.substr(-9,4)?"png":"jpeg")}):t.push({srcset:e})),this.sources=t}},mounted(){this.updateSources(),this.$nextTick(()=>{const t=this.$el;Object(s.a)(t,{...this.lozadOptions,loaded:t=>{const{localFallbackSrc:e}=this,i="IMG"===t.tagName?t:t.lastChild;i.style.opacity=0,this.imgHeight&&(i.height=this.imgHeight,i.width=this.imgWidth),i.onerror=function(){console.error(new Error("Image load error"),this),t.style.display="none";const i=document.createElement("IMG");i.src=e,t.parentNode.insertBefore(i,t.nextSibling)},i.onload=()=>{this.opacity=0,t.classList.add("loaded"),this.$nextTick(()=>{this.opacity=i.style.opacity=null,this.$emit("load")})}}}).observe()})}},a=(i(102),i(0)),c=Object(a.a)(o,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("picture",{staticClass:"picture",style:{height:t.height,opacity:t.opacity},attrs:{"data-iesrc":t.localFallbackSrc,"data-alt":t.localAlt}},[t.sources.length?t._l(t.sources,(function(t,e){var r=t.srcset,n=t.type;return i("source",{key:e,attrs:{srcset:r,type:n}})})):i("source",{attrs:{srcset:t.localFallbackSrc}})],2)}),[],!1,null,null,null);e.a=c.exports},function(t,e,i){"use strict";var r={name:"ALink",props:{href:String,to:[String,Object]},computed:{isRouter(){return!!this.$router&&(!this.href||Boolean(this.$router.options.routes.find(({path:t})=>t===this.href)))}}},n=i(0),s=Object(n.a)(r,(function(){var t=this.$createElement;return(this._self._c||t)(this.isRouter?"router-link":"a",{tag:"component",attrs:{href:this.isRouter?null:this.href,to:this.isRouter?this.to||this.href:null}},[this._t("default")],2)}),[],!1,null,null,null);e.a=s.exports},function(t,e,i){"use strict";i.d(e,"d",(function(){return r})),i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return o})),i.d(e,"e",(function(){return a})),i.d(e,"f",(function(){return c}));const r="en_us",n="USD",s="$",o="US",a=1011,c="5b1abe30a4d4531b8fe40725"},function(t,e,i){"use strict";var r={name:"ABackdrop",props:{isVisible:{type:Boolean,default:!0},zIndexOnShow:{type:Number,default:1080},transitionMs:{type:Number,default:150}},data:()=>({opacity:0,zIndex:null,top:null}),computed:{style(){const{top:t,zIndex:e,transitionMs:i,opacity:r}=this;return{top:t,transition:`opacity ${i}ms linear`,opacity:r,zIndex:e}}},methods:{hide(){this.$emit("update:is-visible",!1),this.$emit("hide")},lockBodyScroll(){document.body.style.maxWidth=document.body.offsetWidth+"px",document.body.style.overflow="hidden"}},watch:{isVisible(t){t?(this.opacity=null,this.lockBodyScroll()):(this.opacity=0,document.body.style.overflow=document.body.style.maxWidth=null)},opacity(t){0===t?setTimeout(()=>{this.top=this.zIndex=null},this.transitionMs):(this.zIndex=this.zIndexOnShow,this.top=0)}},mounted(){this.isVisible&&(setTimeout(()=>{this.opacity=null},this.transitionMs),this.lockBodyScroll())}},n=(i(100),i(0)),s=Object(n.a)(r,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"backdrop",style:this.style,on:{click:this.hide}})}),[],!1,null,null,null);e.a=s.exports},function(t,e,i){"use strict";var r=i(151),n=i(25),s=i(26),o=i(27),a=i(48),c=(t,e)=>new Promise(i=>{const r="object"==typeof window&&window.storefront;if(r){const n=()=>{let n=r.info&&r.info[t];return!!(n&&(e&&(n=n[e]),n&&Object.keys(n).length))&&(i(n),!0)};n()||r.on("info:"+t,n)}});const l=(t,e)=>{const{type:i,value:r}=e;let n;if(r)return n="percentage"===i?t*(100-r)/100:t-r,n>0?n:0};var u={name:"APrices",props:{product:{type:Object,required:!0},isLiteral:Boolean,isBig:Boolean,isAmountTotal:Boolean,installmentsOption:Object,discountOption:Object,discountText:{type:[String,Boolean],default:""},canShowPriceOptions:{type:Boolean,default:!0}},data(){return{installmentsNumber:0,monthlyInterest:0,discount:{type:null,value:0},extraDiscount:{type:null,value:0,min_amount:0},discountLabel:this.discountText,pointsProgramName:null,pointsMinPrice:0,earnPointsFactor:0}},computed:{i19asOf:()=>Object(n.a)(r.e),i19from:()=>Object(n.a)(r.D),i19interestFree:()=>Object(n.a)(r.G),i19of:()=>Object(n.a)(r.R),i19to:()=>Object(n.a)(r.Fb),i19upTo:()=>Object(n.a)(r.Kb),i19youEarn:()=>Object(n.a)(r.Nb),price(){const t=Object(s.a)(this.product);return this.extraDiscount.value&&(!this.extraDiscount.min_amount||t>this.extraDiscount.min_amount)?l(t,this.extraDiscount):t},comparePrice(){return Object(o.a)(this.product)?this.product.base_price:this.extraDiscount.value?Object(s.a)(this.product):void 0},hasVariedPrices(){const{variations:t}=this.product;if(t){const e=Object(s.a)(this.product);for(let i=0;i<t.length;i++){if(Object(s.a)({...this.product,...t[i]})>e)return!0}}return!1},priceWithDiscount(){return this.canShowPriceOptions&&l(this.price,this.discount)},installmentValue(){if(this.canShowPriceOptions&&this.installmentsNumber>=2){if(this.monthlyInterest){const t=this.monthlyInterest/100;return this.price*t/(1-Math.pow(1+t,-this.installmentsNumber))}return this.price/this.installmentsNumber}return 0}},methods:{formatMoney:a.a,updateInstallments(t){if(t){this.monthlyInterest=t.monthly_interest;const e=t.min_installment||5,i=parseInt(this.price/e,10);this.installmentsNumber=Math.min(i,t.max_number)}},updateDiscount(t){!t||t.min_amount&&!(t.min_amount<=this.price)||this.isAmountTotal&&"total"!==t.apply_at||(this.discount=t,!this.discountText&&!1!==this.discountText&&t.label&&(this.discountLabel="via "+t.label))}},watch:{price:{handler(t){this.$emit("fix-price",t)},immediate:!0}},created(){this.canShowPriceOptions&&(this.discountOption?this.updateDiscount(this.discountOption):c("apply_discount").then(t=>{t.available_extra_discount&&(this.extraDiscount=t.available_extra_discount)}),this.installmentsOption?this.updateInstallments(this.installmentsOption):c("list_payments").then(t=>{this.updateInstallments(t.installments_option),this.updateDiscount(t.discount_option);const e=t.loyalty_points_programs;this.isLiteral&&e&&this.$nextTick(()=>{for(const t in e){const i=e[t];if(i&&i.earn_percentage>0){this.pointsMinPrice=i.min_subtotal_to_earn,this.pointsProgramName=i.name,this.earnPointsFactor=i.earn_percentage/100;break}}})}))}},d=(i(104),i(0)),p=Object(d.a)(u,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"prices",class:{"prices--literal":t.isLiteral,"prices--big":t.isBig}},[t.comparePrice?i("span",{staticClass:"prices__compare"},[t.isLiteral?[i("small",[t._v(" "+t._s(t.i19from)+" ")]),i("s",[t._v(t._s(t.formatMoney(t.comparePrice)))]),i("small",[t._v(" "+t._s(t.i19to)+" ")])]:i("s",[t._v(t._s(t.formatMoney(t.comparePrice)))])],2):t._e(),i("strong",{staticClass:"prices__value"},[t.hasVariedPrices?i("small",[t._v(" "+t._s(t.i19asOf)+" ")]):t._e(),t._v(" "+t._s(t.formatMoney(t.price))+" ")]),i("transition-group",{attrs:{"enter-active-class":"animated slideInDown"}},[t.earnPointsFactor>0&&!(t.pointsMinPrice>t.price)?i("div",{key:"points",staticClass:"prices__points"},[i("i",{staticClass:"i-check-circle"}),t._v(" "+t._s(t.i19youEarn)+" "),i("span",[t._v(" +"+t._s((t.earnPointsFactor*t.price).toFixed(1))+" ")]),i("em",[t._v(t._s(t.pointsProgramName))])]):t._e(),t.installmentsNumber>1&&t.installmentValue?i("div",{key:"installments",staticClass:"prices__installments"},[t.isLiteral?i("small",[t._v(" "+t._s(t.i19upTo)+" ")]):t._e(),t._v(" "+t._s(t.installmentsNumber)+"x "),t.isLiteral?i("small",[t._v(" "+t._s(t.i19of)+" ")]):t._e(),i("span",[t._v(" "+t._s(t.formatMoney(t.installmentValue))+" ")]),!t.monthlyInterest&&t.isLiteral?i("small",[t._v(" "+t._s(t.i19interestFree)+" ")]):t._e()]):t._e(),"number"==typeof t.priceWithDiscount&&t.priceWithDiscount<t.price?i("div",{key:"discount",staticClass:"prices__discount"},["string"==typeof t.discountLabel&&t.discountLabel?[i("span",[t._v(" "+t._s(t.formatMoney(t.priceWithDiscount))+" ")]),i("small",{staticClass:"prices__discount-label"},[t._v(" "+t._s(t.discountLabel)+" ")])]:[i("small",[t._v(" "+t._s(t.i19asOf)+" ")]),i("span",[t._v(" "+t._s(t.formatMoney(t.priceWithDiscount))+" ")])]],2):t._e()])],1)}),[],!1,null,null,null);e.a=p.exports},function(t,e,i){"use strict";var r=i(150),n=i(37),s=(t,e,i,r)=>{const n=new Date;n.setTime(n.getTime()+24*r*60*60*1e3);const s=e+"="+i+"; "+("expires="+n.toUTCString())+"; path=/";t.documentMode?t.cookie=s:t.cookie=s+"; samesite=strict"},o=t=>{const{document:e,storageKey:i,localStorage:r,setSession:n}=t;if(i&&e){const o=((t,e)=>{const i=e+"=",r=decodeURIComponent(t.cookie).split(";");for(let t=0;t<r.length;t++){let e=r[t];for(;" "===e.charAt(0);)e=e.substring(1);if(0===e.indexOf(i))return e.substring(i.length,e.length)}return""})(e,i);if(o){let a;try{a=JSON.parse(o)}catch(r){return s(e,i,"",-1),t}if(r){const t=r.getItem(i);if(t)try{a.customer=JSON.parse(t)}catch(t){r.removeItem(i)}}a.customer||(a.customer={}),n(a,!1)}}return t},a=(t,e,[i,r=!0])=>{const{document:n,storageKey:o,setCustomer:a,checkLogin:c}=t;return"object"!=typeof i||null===i||Array.isArray(i)?i={}:i.customer&&(t.customer={},a(i.customer,r),delete i.customer),t.session=i,r&&s(n,o,JSON.stringify(i),6),c()&&e.emit("login"),t},c=(t,e,[i,r=!0])=>{if("object"!=typeof i||null===i||Array.isArray(i))throw new Error("Customer must be an object");{const{storageKey:e,localStorage:n}=t;Object.assign(t.customer,i),r&&e&&n&&n.setItem(e,JSON.stringify(t.customer))}return t},l=i(65),u=t=>Object(l.a)(t.getCustomer()),d=({customer:t})=>t||{},p=i(2),h=({storeId:t,sessionId:e,setSession:i})=>Object(p.b)({url:e+"/token.json",storeId:t}).then(({data:t})=>(i(t),t)),f=({storeId:t,sessionId:e},i,[r=!0])=>Object(p.b)({url:e+"/oauth-providers.json",storeId:t}).then(({data:t})=>{if(r){const{iframeUri:e}=t;(t=>{if("object"!=typeof window)throw new Error("Method available for browser only");const e=document.createElement("iframe");e.setAttribute("src",t),e.setAttribute("name","E-Com Plus Passport for login and register"),e.setAttribute("style","width:0;height:0;border:0;border:none;"),document.body.appendChild(e)})(e)}return t}),m=({storeId:t,setSession:e},i,[r,n=null,s=null])=>Object(p.b)({url:"/identify.json",storeId:t,method:"POST",data:{email:r,doc_number:n,email_code:s}}).then(({data:t})=>(e(t),t)),g=({storeId:t,getCustomer:e},i,[r=0,n=10])=>{const s=[],o=[],a=(t,e)=>t.number>e.number?-1:1;return(e().orders||[]).sort(a).slice(r,r+n).forEach(({_id:e})=>{s.push(Object(p.d)({url:`/orders/${e}.json`,storeId:t}).then(({data:t})=>o.push(t)))}),Promise.all(s).then(()=>o.sort(a))},_=({storeId:t,checkAuthorization:e,requestApi:i},r,[n])=>{const s=`/api/orders/${n}.json`;let o;return o=e()?i(s):Object(p.d)({url:s,storeId:t}),o.then(({data:t})=>t)},b=({session:t})=>Boolean(t.auth&&t.auth.id),v=({session:t,checkLogin:e})=>Boolean(e()&&t.auth.level>=2),y=({session:t,checkAuthorization:e})=>Boolean(e()&&t.auth.level>=3),w=(t,e,[i=!0])=>{const{document:r,storageKey:n,localStorage:o}=t;return t.session={},t.customer={},i&&n&&(r&&s(r,n,"",-1),o&&o.removeItem(n)),e.emit("logout"),t},x=({fetchOauthProfile:t},e,[i])=>{let r=null;const n=e=>{clearInterval(r),t()};window.passportCallback=function(){n()};const s=((t,e="Login")=>{if("object"!=typeof window)throw new Error("Method available for browser only");const{screen:i}=window;let r;return r=i?i.width>=640?640:i.width:380,window.open(t,e,"height=500,width="+r)})(i);return s&&("object"==typeof window&&window.focus&&s.focus(),r=setInterval(()=>{s.closed&&n()},400)),s},k=({storeId:t,lang:e,sessionId:i,popupOauthLink:r},n,[s,o="https://passport.e-com.plus/v1/"])=>{let a=`${o}${e}/${t}/${i}/login.html`;return s&&(a+="?enable_skip=true"),r(a)},S=({storeId:t,lang:e},i,[r])=>Object(p.b)({url:`/${e}/email-code`,storeId:t,method:"PUT",data:{email:r}}),C=i(80);const O=function(t,e,i="ecomPassportClient",s="object"==typeof window&&window.localStorage,l="object"==typeof window&&window.document){const p=this;p.Constructor=O,p.storeId=t||r.a.get("store_id"),p.lang=e||r.a.get("lang"),p.storageKey=i,p.localStorage=s,p.document=l,p.customer={},p.session={},p.sessionId="";const j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<32;t++)p.sessionId+=j.charAt(Math.floor(Math.random()*j.length));const I=new n;["on","off","once"].forEach(t=>{p[t]=(e,i)=>{I[t](e,i)}});const P=(t,e=[],i)=>{const r=t(p,I,e);if(r&&i){const{customer:t}=p;I.emit("change",{customer:t})}return r};this.loadStoredSession=()=>P(o,[],!0),this.logout=t=>P(w,[t],!0),this.setSession=(t,e)=>P(a,[t,e],!0),this.setCustomer=(t,e)=>P(c,[t,e],!0),this.getCustomerName=()=>P(u),this.getCustomer=()=>P(d),this.checkLogin=()=>P(b),this.checkAuthorization=()=>P(v),this.checkVerification=()=>P(y),this.fetchLogin=(t,e,i)=>P(m,[t,e,i]),this.fetchOauthProfile=()=>P(h),this.fetchOauthProviders=()=>P(f),this.fetchOrdersList=(t,e)=>P(g,[t,e]),this.fetchOrder=t=>P(_,[t]),this.requestApi=(t,e,i)=>P(C.a,[t,e,i]),this.popupOauthLink=t=>P(x,[t]),this.popupLogin=(t,e)=>P(k,[t,e]),this.sendEmailCode=t=>P(S,[t]),o(p)};
12
+ const x=new w;e.a=x},function(t,e,i){"use strict";var r=i(52),n=Object.prototype.toString;function s(t){return"[object Array]"===n.call(t)}function o(t){return void 0===t}function a(t){return null!==t&&"object"==typeof t}function c(t){if("[object Object]"!==n.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function l(t){return"[object Function]"===n.call(t)}function u(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var i=0,r=t.length;i<r;i++)e.call(null,t[i],i,t);else for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.call(null,t[n],n,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===n.call(t)},isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isPlainObject:c,isUndefined:o,isDate:function(t){return"[object Date]"===n.call(t)},isFile:function(t){return"[object File]"===n.call(t)},isBlob:function(t){return"[object Blob]"===n.call(t)},isFunction:l,isStream:function(t){return a(t)&&l(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:u,merge:function t(){var e={};function i(i,r){c(e[r])&&c(i)?e[r]=t(e[r],i):c(i)?e[r]=t({},i):s(i)?e[r]=i.slice():e[r]=i}for(var r=0,n=arguments.length;r<n;r++)u(arguments[r],i);return e},extend:function(t,e,i){return u(e,(function(e,n){t[n]=i&&"function"==typeof e?r(e,i):e})),t},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},stripBOM:function(t){return 65279===t.charCodeAt(0)&&(t=t.slice(1)),t}}},function(t,e,i){"use strict";(function(t){e.a="object"==typeof window&&window||"object"==typeof t&&t&&t.env||{}}).call(this,i(23))},function(t,e,i){"use strict";var r=i(150),n=i(46),s=i(19);var o={name:"APicture",props:{src:[String,Object],fallbackSrc:String,alt:String,canCalcHeight:{type:Boolean,default:!0},placeholder:{type:String,default:"/assets/img-placeholder.png"},containerBreakpoints:{type:Object,default:()=>({zoom:null,big:800,[r.a.get("default_img_size")||"normal"]:400})},lozadOptions:{type:Object,default:()=>({rootMargin:"350px 0px",threshold:0})}},data:()=>({sources:[],imgWidth:0,imgHeight:0,height:null,opacity:null}),computed:{defaultImgObj(){return"object"==typeof this.src&&this.src?Object(n.a)(this.src)||this.src:{}},localFallbackSrc(){const{src:t,defaultImgObj:e,fallbackSrc:i}=this;if(i)return i;const r="object"==typeof t?t.zoom?t.zoom.url:e.url:t;return r?r.replace(/\.webp$/,""):this.placeholder},localAlt(){const{alt:t,src:e,defaultImgObj:i}=this;return t||(e?i.alt||"Product":"No image")}},methods:{updateSources(){const t=[];let e;if("object"==typeof this.src){const{clientWidth:t,clientHeight:i}=this.$el,r=((t,e,i,r)=>{let n,s;for(const o in r){const a=r[o];if(void 0!==a&&t[o]){if(void 0!==s)if(null===a){if(s>=e)continue}else if(a<e||a-50<=i||null!==s&&a>s)continue;n=o,s=a}}return n})(this.src,t,i,this.containerBreakpoints),n=this.src[r],{url:s,size:o}=n||this.defaultImgObj;e=s,o&&([this.imgWidth,this.imgHeight]=o.split("x").map(t=>parseInt(t,10)),t&&this.imgHeight&&this.canCalcHeight&&(this.height=(t>=this.imgWidth?this.imgHeight:t*this.imgHeight/this.imgWidth)+"px"))}else e=this.src;e&&(e.endsWith(".webp")?t.push({srcset:e,type:"image/webp"},{srcset:/\/imgs\/[0-9]{3}px/.test(e)?e.replace(/\/imgs\/[0-9]{3}px/,""):e.replace(/\.webp$/,""),type:"image/"+(".png"===e.substr(-9,4)?"png":"jpeg")}):e.endsWith(".avif")?t.push({srcset:e,type:"image/avif"},{srcset:e.replace(".avif",".webp"),type:"image/webp"}):t.push({srcset:e})),this.sources=t}},mounted(){this.updateSources(),this.$nextTick(()=>{const t=this.$el;Object(s.a)(t,{...this.lozadOptions,loaded:t=>{const{localFallbackSrc:e}=this,i="IMG"===t.tagName?t:t.lastChild;i.style.opacity=0,this.imgHeight&&(i.height=this.imgHeight,i.width=this.imgWidth),i.onerror=function(){console.error(new Error("Image load error"),this),t.style.display="none";const i=document.createElement("IMG");i.src=e,t.parentNode.insertBefore(i,t.nextSibling)},i.onload=()=>{this.opacity=0,t.classList.add("loaded"),this.$nextTick(()=>{this.opacity=i.style.opacity=null,this.$emit("load")})}}}).observe()})}},a=(i(102),i(0)),c=Object(a.a)(o,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("picture",{staticClass:"picture",style:{height:t.height,opacity:t.opacity},attrs:{"data-iesrc":t.localFallbackSrc,"data-alt":t.localAlt}},[t.sources.length?t._l(t.sources,(function(t,e){var r=t.srcset,n=t.type;return i("source",{key:e,attrs:{srcset:r,type:n}})})):i("source",{attrs:{srcset:t.localFallbackSrc}})],2)}),[],!1,null,null,null);e.a=c.exports},function(t,e,i){"use strict";var r={name:"ALink",props:{href:String,to:[String,Object]},computed:{isRouter(){return!!this.$router&&(!this.href||Boolean(this.$router.options.routes.find(({path:t})=>t===this.href)))}}},n=i(0),s=Object(n.a)(r,(function(){var t=this.$createElement;return(this._self._c||t)(this.isRouter?"router-link":"a",{tag:"component",attrs:{href:this.isRouter?null:this.href,to:this.isRouter?this.to||this.href:null}},[this._t("default")],2)}),[],!1,null,null,null);e.a=s.exports},function(t,e,i){"use strict";i.d(e,"d",(function(){return r})),i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){return o})),i.d(e,"e",(function(){return a})),i.d(e,"f",(function(){return c}));const r="en_us",n="USD",s="$",o="US",a=1011,c="5b1abe30a4d4531b8fe40725"},function(t,e,i){"use strict";var r={name:"ABackdrop",props:{isVisible:{type:Boolean,default:!0},zIndexOnShow:{type:Number,default:1080},transitionMs:{type:Number,default:150}},data:()=>({opacity:0,zIndex:null,top:null}),computed:{style(){const{top:t,zIndex:e,transitionMs:i,opacity:r}=this;return{top:t,transition:`opacity ${i}ms linear`,opacity:r,zIndex:e}}},methods:{hide(){this.$emit("update:is-visible",!1),this.$emit("hide")},lockBodyScroll(){document.body.style.maxWidth=document.body.offsetWidth+"px",document.body.style.overflow="hidden"}},watch:{isVisible(t){t?(this.opacity=null,this.lockBodyScroll()):(this.opacity=0,document.body.style.overflow=document.body.style.maxWidth=null)},opacity(t){0===t?setTimeout(()=>{this.top=this.zIndex=null},this.transitionMs):(this.zIndex=this.zIndexOnShow,this.top=0)}},mounted(){this.isVisible&&(setTimeout(()=>{this.opacity=null},this.transitionMs),this.lockBodyScroll())}},n=(i(100),i(0)),s=Object(n.a)(r,(function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"backdrop",style:this.style,on:{click:this.hide}})}),[],!1,null,null,null);e.a=s.exports},function(t,e,i){"use strict";var r=i(151),n=i(25),s=i(26),o=i(27),a=i(48),c=(t,e)=>new Promise(i=>{const r="object"==typeof window&&window.storefront;if(r){const n=()=>{let n=r.info&&r.info[t];return!!(n&&(e&&(n=n[e]),n&&Object.keys(n).length))&&(i(n),!0)};n()||r.on("info:"+t,n)}});const l=(t,e)=>{const{type:i,value:r}=e;let n;if(r)return n="percentage"===i?t*(100-r)/100:t-r,n>0?n:0};var u={name:"APrices",props:{product:{type:Object,required:!0},isLiteral:Boolean,isBig:Boolean,isAmountTotal:Boolean,installmentsOption:Object,discountOption:Object,discountText:{type:[String,Boolean],default:""},canShowPriceOptions:{type:Boolean,default:!0}},data(){return{installmentsNumber:0,monthlyInterest:0,discount:{type:null,value:0},extraDiscount:{type:null,value:0,min_amount:0},discountLabel:this.discountText,pointsProgramName:null,pointsMinPrice:0,earnPointsFactor:0}},computed:{i19asOf:()=>Object(n.a)(r.e),i19from:()=>Object(n.a)(r.D),i19interestFree:()=>Object(n.a)(r.G),i19of:()=>Object(n.a)(r.R),i19to:()=>Object(n.a)(r.Fb),i19upTo:()=>Object(n.a)(r.Kb),i19youEarn:()=>Object(n.a)(r.Nb),price(){const t=Object(s.a)(this.product);return this.extraDiscount.value&&(!this.extraDiscount.min_amount||t>this.extraDiscount.min_amount)?l(t,this.extraDiscount):t},comparePrice(){return Object(o.a)(this.product)?this.product.base_price:this.extraDiscount.value?Object(s.a)(this.product):void 0},hasVariedPrices(){const{variations:t}=this.product;if(t){const e=Object(s.a)(this.product);for(let i=0;i<t.length;i++){if(Object(s.a)({...this.product,...t[i]})>e)return!0}}return!1},priceWithDiscount(){return this.canShowPriceOptions&&l(this.price,this.discount)},installmentValue(){if(this.canShowPriceOptions&&this.installmentsNumber>=2){if(this.monthlyInterest){const t=this.monthlyInterest/100;return this.price*t/(1-Math.pow(1+t,-this.installmentsNumber))}return this.price/this.installmentsNumber}return 0}},methods:{formatMoney:a.a,updateInstallments(t){if(t){this.monthlyInterest=t.monthly_interest;const e=t.min_installment||5,i=parseInt(this.price/e,10);this.installmentsNumber=Math.min(i,t.max_number)}},updateDiscount(t){!t||t.min_amount&&!(t.min_amount<=this.price)||this.isAmountTotal&&"total"!==t.apply_at||(this.discount=t,!this.discountText&&!1!==this.discountText&&t.label&&(this.discountLabel="via "+t.label))}},watch:{price:{handler(t){this.$emit("fix-price",t)},immediate:!0}},created(){this.canShowPriceOptions&&(this.discountOption?this.updateDiscount(this.discountOption):c("apply_discount").then(t=>{t.available_extra_discount&&(this.extraDiscount=t.available_extra_discount)}),this.installmentsOption?this.updateInstallments(this.installmentsOption):c("list_payments").then(t=>{this.updateInstallments(t.installments_option),this.updateDiscount(t.discount_option);const e=t.loyalty_points_programs;this.isLiteral&&e&&this.$nextTick(()=>{for(const t in e){const i=e[t];if(i&&i.earn_percentage>0){this.pointsMinPrice=i.min_subtotal_to_earn,this.pointsProgramName=i.name,this.earnPointsFactor=i.earn_percentage/100;break}}})}))}},d=(i(104),i(0)),p=Object(d.a)(u,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"prices",class:{"prices--literal":t.isLiteral,"prices--big":t.isBig}},[t.comparePrice?i("span",{staticClass:"prices__compare"},[t.isLiteral?[i("small",[t._v(" "+t._s(t.i19from)+" ")]),i("s",[t._v(t._s(t.formatMoney(t.comparePrice)))]),i("small",[t._v(" "+t._s(t.i19to)+" ")])]:i("s",[t._v(t._s(t.formatMoney(t.comparePrice)))])],2):t._e(),i("strong",{staticClass:"prices__value"},[t.hasVariedPrices?i("small",[t._v(" "+t._s(t.i19asOf)+" ")]):t._e(),t._v(" "+t._s(t.formatMoney(t.price))+" ")]),i("transition-group",{attrs:{"enter-active-class":"animated slideInDown"}},[t.earnPointsFactor>0&&!(t.pointsMinPrice>t.price)?i("div",{key:"points",staticClass:"prices__points"},[i("i",{staticClass:"i-check-circle"}),t._v(" "+t._s(t.i19youEarn)+" "),i("span",[t._v(" +"+t._s((t.earnPointsFactor*t.price).toFixed(1))+" ")]),i("em",[t._v(t._s(t.pointsProgramName))])]):t._e(),t.installmentsNumber>1&&t.installmentValue?i("div",{key:"installments",staticClass:"prices__installments"},[t.isLiteral?i("small",[t._v(" "+t._s(t.i19upTo)+" ")]):t._e(),t._v(" "+t._s(t.installmentsNumber)+"x "),t.isLiteral?i("small",[t._v(" "+t._s(t.i19of)+" ")]):t._e(),i("span",[t._v(" "+t._s(t.formatMoney(t.installmentValue))+" ")]),!t.monthlyInterest&&t.isLiteral?i("small",[t._v(" "+t._s(t.i19interestFree)+" ")]):t._e()]):t._e(),"number"==typeof t.priceWithDiscount&&t.priceWithDiscount<t.price?i("div",{key:"discount",staticClass:"prices__discount"},["string"==typeof t.discountLabel&&t.discountLabel?[i("span",[t._v(" "+t._s(t.formatMoney(t.priceWithDiscount))+" ")]),i("small",{staticClass:"prices__discount-label"},[t._v(" "+t._s(t.discountLabel)+" ")])]:[i("small",[t._v(" "+t._s(t.i19asOf)+" ")]),i("span",[t._v(" "+t._s(t.formatMoney(t.priceWithDiscount))+" ")])]],2):t._e()])],1)}),[],!1,null,null,null);e.a=p.exports},function(t,e,i){"use strict";var r=i(150),n=i(37),s=(t,e,i,r)=>{const n=new Date;n.setTime(n.getTime()+24*r*60*60*1e3);const s=e+"="+i+"; "+("expires="+n.toUTCString())+"; path=/";t.documentMode?t.cookie=s:t.cookie=s+"; samesite=strict"},o=t=>{const{document:e,storageKey:i,localStorage:r,setSession:n}=t;if(i&&e){const o=((t,e)=>{const i=e+"=",r=decodeURIComponent(t.cookie).split(";");for(let t=0;t<r.length;t++){let e=r[t];for(;" "===e.charAt(0);)e=e.substring(1);if(0===e.indexOf(i))return e.substring(i.length,e.length)}return""})(e,i);if(o){let a;try{a=JSON.parse(o)}catch(r){return s(e,i,"",-1),t}if(r){const t=r.getItem(i);if(t)try{a.customer=JSON.parse(t)}catch(t){r.removeItem(i)}}a.customer||(a.customer={}),n(a,!1)}}return t},a=(t,e,[i,r=!0])=>{const{document:n,storageKey:o,setCustomer:a,checkLogin:c}=t;return"object"!=typeof i||null===i||Array.isArray(i)?i={}:i.customer&&(t.customer={},a(i.customer,r),delete i.customer),t.session=i,r&&s(n,o,JSON.stringify(i),6),c()&&e.emit("login"),t},c=(t,e,[i,r=!0])=>{if("object"!=typeof i||null===i||Array.isArray(i))throw new Error("Customer must be an object");{const{storageKey:e,localStorage:n}=t;Object.assign(t.customer,i),r&&e&&n&&n.setItem(e,JSON.stringify(t.customer))}return t},l=i(65),u=t=>Object(l.a)(t.getCustomer()),d=({customer:t})=>t||{},p=i(2),h=({storeId:t,sessionId:e,setSession:i})=>Object(p.b)({url:e+"/token.json",storeId:t}).then(({data:t})=>(i(t),t)),f=({storeId:t,sessionId:e},i,[r=!0])=>Object(p.b)({url:e+"/oauth-providers.json",storeId:t}).then(({data:t})=>{if(r){const{iframeUri:e}=t;(t=>{if("object"!=typeof window)throw new Error("Method available for browser only");const e=document.createElement("iframe");e.setAttribute("src",t),e.setAttribute("name","E-Com Plus Passport for login and register"),e.setAttribute("style","width:0;height:0;border:0;border:none;"),document.body.appendChild(e)})(e)}return t}),m=({storeId:t,setSession:e},i,[r,n=null,s=null])=>Object(p.b)({url:"/identify.json",storeId:t,method:"POST",data:{email:r,doc_number:n,email_code:s}}).then(({data:t})=>(e(t),t)),g=({storeId:t,getCustomer:e},i,[r=0,n=10])=>{const s=[],o=[],a=(t,e)=>t.number>e.number?-1:1;return(e().orders||[]).sort(a).slice(r,r+n).forEach(({_id:e})=>{s.push(Object(p.d)({url:`/orders/${e}.json`,storeId:t}).then(({data:t})=>o.push(t)))}),Promise.all(s).then(()=>o.sort(a))},_=({storeId:t,checkAuthorization:e,requestApi:i},r,[n])=>{const s=`/api/orders/${n}.json`;let o;return o=e()?i(s):Object(p.d)({url:s,storeId:t}),o.then(({data:t})=>t)},b=({session:t})=>Boolean(t.auth&&t.auth.id),v=({session:t,checkLogin:e})=>Boolean(e()&&t.auth.level>=2),y=({session:t,checkAuthorization:e})=>Boolean(e()&&t.auth.level>=3),w=(t,e,[i=!0])=>{const{document:r,storageKey:n,localStorage:o}=t;return t.session={},t.customer={},i&&n&&(r&&s(r,n,"",-1),o&&o.removeItem(n)),e.emit("logout"),t},x=({fetchOauthProfile:t},e,[i])=>{let r=null;const n=e=>{clearInterval(r),t()};window.passportCallback=function(){n()};const s=((t,e="Login")=>{if("object"!=typeof window)throw new Error("Method available for browser only");const{screen:i}=window;let r;return r=i?i.width>=640?640:i.width:380,window.open(t,e,"height=500,width="+r)})(i);return s&&("object"==typeof window&&window.focus&&s.focus(),r=setInterval(()=>{s.closed&&n()},400)),s},k=({storeId:t,lang:e,sessionId:i,popupOauthLink:r},n,[s,o="https://passport.e-com.plus/v1/"])=>{let a=`${o}${e}/${t}/${i}/login.html`;return s&&(a+="?enable_skip=true"),r(a)},S=({storeId:t,lang:e},i,[r])=>Object(p.b)({url:`/${e}/email-code`,storeId:t,method:"PUT",data:{email:r}}),C=i(80);const O=function(t,e,i="ecomPassportClient",s="object"==typeof window&&window.localStorage,l="object"==typeof window&&window.document){const p=this;p.Constructor=O,p.storeId=t||r.a.get("store_id"),p.lang=e||r.a.get("lang"),p.storageKey=i,p.localStorage=s,p.document=l,p.customer={},p.session={},p.sessionId="";const j="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let t=0;t<32;t++)p.sessionId+=j.charAt(Math.floor(Math.random()*j.length));const I=new n;["on","off","once"].forEach(t=>{p[t]=(e,i)=>{I[t](e,i)}});const P=(t,e=[],i)=>{const r=t(p,I,e);if(r&&i){const{customer:t}=p;I.emit("change",{customer:t})}return r};this.loadStoredSession=()=>P(o,[],!0),this.logout=t=>P(w,[t],!0),this.setSession=(t,e)=>P(a,[t,e],!0),this.setCustomer=(t,e)=>P(c,[t,e],!0),this.getCustomerName=()=>P(u),this.getCustomer=()=>P(d),this.checkLogin=()=>P(b),this.checkAuthorization=()=>P(v),this.checkVerification=()=>P(y),this.fetchLogin=(t,e,i)=>P(m,[t,e,i]),this.fetchOauthProfile=()=>P(h),this.fetchOauthProviders=()=>P(f),this.fetchOrdersList=(t,e)=>P(g,[t,e]),this.fetchOrder=t=>P(_,[t]),this.requestApi=(t,e,i)=>P(C.a,[t,e,i]),this.popupOauthLink=t=>P(x,[t]),this.popupLogin=(t,e)=>P(k,[t,e]),this.sendEmailCode=t=>P(S,[t]),o(p)};
13
13
  /*!
14
14
  * @ecomplus/passport-client
15
15
  * (c) E-Com Club <ti@e-com.club>