@perevorot/shop 2.0.154 → 2.0.156

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),l=require("@perevorot/shop/dist/forms/FormRadio"),i=require("yup"),c=require("vue-toastification");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var u=s(r),m=s(a),p=s(l),v=d(i),h=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var o=e.computed((function(){return t.item.attributes.options&&t.item.attributes.options.length?t.item.attributes.options:[]}));return{itemOptions:e.computed((function(){return t.item.options&&t.item.options.length?t.item.options.filter((function(e){return-1!==o.value.indexOf(e.id)})):[]}))}}}),f={key:0,class:"column is-12"},y={class:"bundle-title"},g={class:"column name"},k={class:"column is-narrow"},_=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],b={class:"column"},B={class:"columns is-gapless mb-0"},C={class:"column"},w={key:0,class:"code"},S={class:"title"},D=["href"],T={class:"column is-2 has-text-centered is-relative"},x={class:"quantity"},L={key:0,class:"quantity-price"},M=["innerHTML"],P={class:"column is-2 has-text-right"},F=["innerHTML"],O=["innerHTML"],H=["innerHTML"],q={key:0,class:"options is-toggled"},$={class:"toggler"},U={class:"wrapper"},z={class:"column"},R={class:"option-title"},A={class:"column is-2 has-text-right"},j=["innerHTML"],W={key:0,class:"bundle columns"},J={class:"column is-narrow"},I=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),G=["href"],K=["src"],Q={key:1},X=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Y={class:"column"},Z={key:0,class:"code"},ee={class:"title"},te=["href"],oe={key:1,class:"bundle columns"},ne={class:"column is-narrow"},re=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ae=["href"],le=["src"],ie={key:1},ce=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],se={class:"column"},de={key:0,class:"code"},ue={class:"title"},me=["href"];function pe(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ve(){}function he(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,a,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",y,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",g,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",k,[e.createElementVNode("a",{href:t.item.attributes.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.image}])},[t.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.image},null,8,E)):(e.openBlock(),e.createElementBlock("svg",V,N))],2)],8,_)]),e.createElementVNode("div",b,[e.createElementVNode("div",B,[e.createElementVNode("div",C,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",S,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,D)])]),e.createElementVNode("div",T,[e.createElementVNode("div",x,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,M),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",P,[e.createElementVNode("div",{class:e.normalizeClass(["price",{"bundle-price":t.item.attributes.bundle}])},[t.item.attributes.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(t.item.attributes.priceOld*t.item.quantity)},null,8,F)):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,O)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,H)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",$,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(o,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",z,[e.createElementVNode("div",R,e.toDisplayString(o.name),1)]),e.createElementVNode("div",A,[e.createTextVNode("+"),e.createElementVNode("span",{innerHTML:t.$filters.price(o.price)},null,8,j)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",J,[I,e.createElementVNode("a",{href:t.item.attributes.second.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.second.image}])},[t.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.second.image},null,8,K)):(e.openBlock(),e.createElementBlock("svg",Q,X))],2)],8,G)]),e.createElementVNode("div",Y,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",Z,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ee,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,te)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("div",ne,[re,e.createElementVNode("a",{href:t.item.attributes.third.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.third.image}])},[t.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.third.image},null,8,le)):(e.openBlock(),e.createElementBlock("svg",ie,ce))],2)],8,ae)]),e.createElementVNode("div",se,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",de,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ue,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,me)])])])):e.createCommentVNode("v-if",!0)])],2)},v.addMethod(v.string,"numberFilled",(function(e,t){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:e},test:function(e){return!(""==e||isNaN(e))}})})),e.markRaw(m.default),e.markRaw(p.default);var fe=n.SchemaFormFactory([u.default({})]),ye={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ge=e.defineComponent({components:{CheckoutItem:h,SchemaForm:fe},props:{isLogin:{type:Boolean,default:!0},isPhoneMasked:{type:Boolean,default:!0},isPromoCode:{type:Boolean,default:!0},isConsent:{type:Boolean,default:!1},isPaymentMethodOverSummary:{type:Boolean,default:!1},userFields:{type:Array,default:["last_name","name","email","phone"]},redirectOnEmpty:{type:String,default:!1},showPlaceholders:{type:Boolean,default:!1},isTrackAfterSuccessOnlinePurchase:{type:Boolean,default:!1}},name:"order-checkout",setup:function(r){var a=e.useSlots(),l=c.useToast(),i=o.useStore(),s=e.ref(!1),d=e.computed((function(){return i.getters["cart/quantity"]})),u=e.computed((function(){return i.getters["cart/items"]})),h=e.computed((function(){return i.getters["cart/total"]})),f=e.computed((function(){return i.getters["auth/is"]})),y=e.computed((function(){return i.getters["checkout/user"]})),g=e.ref(!0),k=e.ref(null),_=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref(null),b=e.ref({}),B=e.ref([]),C=e.ref([]),w=e.ref("new"),S=e.ref(null),D=e.computed((function(){return i.getters["checkout/shippingData"]})),T=e.ref(!1),x=e.ref(!1),L=e.ref(""),M=e.ref(null),P=e.ref(!1),F=e.getCurrentInstance(),O=e.computed((function(){var e=u.value.reduce((function(e,t){return e+(t.attributes.loyalty?t.attributes.loyalty.points*t.quantity:0)}),0);return{points:e,name:t.pluralize(e,__("shop.pluralize.points"))}})),H=e.ref(""),q=e.ref(!1),$=e.computed((function(){return t.numberFormat(y.value.loyalty_points-(q.value?H.value:0))})),U=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),z=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),R=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(T.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch(R,(function(e){e.length>1e3&&(R.value=R.value.substring(0,1e3))}));var A=function(t,o){return e.computed({get:function(){return y.value[t]?y.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(y.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",A);var j=e.ref({last_name:A("last_name"),middle_name:A("middle_name"),name:A("name"),email:A("email"),phone:A("phone"),registration_number:A("registration_number"),company_name:A("company_name"),user_type:A("user_type","individual")});e.provide("user",j),i.dispatch("auth/me",{finally:function(){}});var W=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),J=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),I=e.computed((function(){return W.value?B.value.find((function(e){return e.id==W.value})):{}})),G=e.computed((function(){return J.value?C.value.find((function(e){return e.id==J.value})):{}})),K=e.computed((function(){return ee(B.value,W.value)})),Q=e.computed((function(){return ee(C.value,J.value)})),X=e.computed((function(){return te(B.value)})),Y=e.computed((function(){return te(C.value)})),Z=e.computed((function(){var e=[];return u.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),ee=function(e,t){var o=0;if(t){var n=e.find((function(e){return e.id==t}));n&&(o="sum"==n.type?n.amount:Math.round(h.value*n.amount/100))}return o},te=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var o=!0,n=e.restrictions;n.price_min&&n.price_max?(o=h.value>=n.price_min&&h.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=h.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=h.value<=n.price_max,e.restrictedForce=!o),o&&W.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(W.value)),o&&J.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(J.value)),o&&n.categories&&n.categories.length&&(o=!Z.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===j.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},oe=e.computed((function(){var e=0;return u.value.forEach((function(t){var o=0;t.attributes.priceOld&&(o=t.attributes.priceOld-t.attributes.price),e+=o*t.quantity})),e}));$http.post(window.location.href).then((function(e){B.value=e.data.shipping,C.value=e.data.payment})),e.watch(w,(function(e){"login"==e&&i.commit("auth/modal","login")}));var ne={user_type:{component:p.default,model:"user_type",label:"",list:[{code:"individual",value:__("auth.registration.form.user_type_individual")},{code:"legal",value:__("auth.registration.form.user_type_legal")}]},name:{component:m.default,label:__("auth.registration.form.name"),model:"first_name",placeholder:r.showPlaceholders?__("auth.registration.form.name"):""},last_name:{component:m.default,label:__("auth.registration.form.last_name"),model:"last_name",placeholder:r.showPlaceholders?__("auth.registration.form.last_name"):""},middle_name:{component:m.default,label:__("auth.registration.form.middle_name"),model:"middle_name",placeholder:r.showPlaceholders?__("auth.registration.form.middle_name"):""},phone:{component:m.default,label:__("auth.registration.form.phone"),model:"phone",type:"phone"},registration_number:{component:m.default,label:__("auth.registration.form.registration_number"),model:"registration_number",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.registration_number"):""},company_name:{component:m.default,label:__("auth.registration.form.company_name"),model:"company_name",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.company_name"):""},email:{component:m.default,label:__("auth.login.form.email"),model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""}};r.isPhoneMasked&&(ne.phone.mask="(###) ###-##-##");var re=Object.keys(ne).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=ne[t]),e}),{});re=r.userFields.reduce((function(e,t){return e[t]=re[t],e}),{});var ae=e.ref(re);n.useSchemaForm(j);var le={last_name:v.string().trim().required(__("auth.validation.required")),middle_name:v.string().trim().required(__("auth.validation.required")),name:v.string().trim().required(__("auth.validation.required")),phone:r.isPhoneMasked?v.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")):v.string().required(__("auth.validation.phone")),email:v.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")),registration_number:v.string().when("user_type",(function(e){if("legal"==e)return v.string().numberFilled()})),company_name:v.string().when("user_type",(function(e){if("legal"==e)return v.string().required(__("auth.validation.required"))}))},ie=Object.keys(le).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=le[t]),e}),{}),ce=v.object().shape(ie);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var se=he((function(){return function(e){var t=e();if(t&&t.then)return t.then(ve)}((function(){if("function"==typeof de.value)return pe(de.value(),(function(e){S.value&&S.value.click(),ce.isValid(j.value).then((function(t){g.value=t&&J.value&&U.value&&W.value&&(!I.value.component||I.value.component&&D.value[I.value.code]&&D.value[I.value.code].isValid)&&e}))}))}))})),de=e.ref(null);e.provide("shippingComponentValid",de);var ue=e.ref({});e.provide("shippingComponentUserData",ue);var me=e.ref(!1),fe=function(e){_.value=!0,E.value=e,document.querySelector("html").classList.add("is-checkout-thanks"),ke()},ge=he((function(){var t="function"==typeof de.value?de.value():null;return I.value&&!I.value.component&&(t=!0),ce.isValid(j.value).then((function(o){if(o)if(W.value)if(!I.value.component||D.value[I.value.code]&&D.value[I.value.code].isValid)if(t)if(J.value)if(U.value){var n,a=D.value[I.value.code]?JSON.parse(JSON.stringify(D.value[I.value.code])):{};delete a.isValid;var c=JSON.parse(JSON.stringify(ue.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var d={checkout:!0,user:{last_name:j.value.last_name,middle_name:j.value.middle_name,name:j.value.name,phone:j.value.phone,email:j.value.email,user_type:j.value.user_type,registration_number:j.value.registration_number,company_name:j.value.company_name},shipping:{id:W.value,data:a,user:c},payment:{id:J.value},comment:R.value,dontcall:z.value,promoCode:L.value,loyalty:H.value,clientId:n};s.value=!0,$http.post(window.location.href,d).then((function(t){if(t.data&&t.data.error&&t.data.message)l(t.data.message,{type:"error"});else{var o=[];u.value.forEach((function(e){var t={item_name:e.name,item_id:e.attributes.code,price:e.price,quantity:e.quantity};e.attributes.brand&&(t.item_brand=e.attributes.brand),e.attributes.property&&(t.item_variant=e.attributes.property),e.attributes.categoryFull&&(-1!==e.attributes.categoryFull.indexOf("/")?e.attributes.categoryFull.split("/").forEach((function(e,o){t["item_category"+(o?o+1:"")]=e.trim()})):t.item_category=e.attributes.categoryFull),e.attributes.index&&(t.index=e.attributes.index),e.attributes.itemListName&&(t.item_list_name=e.attributes.itemListName),o.push(t)}));var n={payment_type:G.value.name,shipping_tier:I.value.name,ecommerce:{transaction_id:t.data.order.id,affiliation:"main",value:parseFloat(h.value),shipping:0,currency:"UAH",items:o},event:"purchase"};j.value.user_type&&(n.user_type=__("auth.registration.form.user_type_"+j.value.user_type)),L.value&&(n.ecommerce.coupon=L.value),r.isTrackAfterSuccessOnlinePurchase&&(t.data.redirect||t.data.payment_widget_data&&window.Wayforpay)?localStorage.setItem("ecommerce",JSON.stringify(n)):($env.debug.ecommerce&&console.log(n),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n))),t.data.redirect&&(b.value={url:t.data.redirect.url,data:t.data.redirect.data},e.nextTick((function(){setTimeout((function(){k.value.submit()}),400)}))),t.data.payment_widget_data&&window.Wayforpay?function(e,t){var o=new Wayforpay;window.addEventListener("message",(function(e){"WfpWidgetEventClose"==e.data||"WfpWidgetEventDeclined"==e.data||e.data,"WfpWidgetEventApproved"==e.data&&(fe(t),me.value=!0,i.dispatch("cart/clear",{finally:function(){}}))})),o.run(e)}(JSON.parse(t.data.payment_widget_data),t.data.order):fe(t.data.order)}})).catch((function(e){l(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){s.value=!1}))}else l(__("shop.order.validate_consent"),{type:"error"});else l(__("shop.order.validate_payment"),{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+I.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+I.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping"),{type:"error"});else w.value="new",S.value.click(),l(__("shop.order.validate_user"),{type:"error"})})),pe()})),ke=function(){i.commit("checkout/reset"),i.commit("cart/clear")};return e.onMounted((function(){!d.value&&r.redirectOnEmpty&&(window.location.href=r.redirectOnEmpty);var e=[];if(u.value.forEach((function(t){var o={item_name:t.name,item_id:t.attributes.code,price:parseFloat(t.attributes.price),quantity:t.quantity};t.attributes.brand&&(o.item_brand=t.attributes.brand),t.attributes.property&&(o.item_variant=t.attributes.property),t.attributes.categoryFull&&(-1!==t.attributes.categoryFull.indexOf("/")?t.attributes.categoryFull.split("/").forEach((function(e,t){o["item_category"+(t?t+1:"")]=e.trim()})):o.item_category=t.attributes.categoryFull),t.attributes.index&&(o.index=t.attributes.index),t.attributes.itemListName&&(o.item_list_name=t.attributes.itemListName),e.push(o)})),e.length){var t={ecommerce:{currency:"UAH",items:e,value:parseFloat(h.value)},event:"begin_checkout"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}})),{auth:f,userType:w,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){w.value="new"},quantity:d,items:u,loading:s,pluralize:t.pluralize,discount:oe,total:h,shipping:W,shippingPrice:K,payment:J,fee:Q,userValidation:ce,userSchema:ae,userSubmitButton:S,checkout:ge,ifCheckoutReady:g,validate:se,shippingTypesRestricted:X,paymentMethodsRestricted:Y,toggleShippingRadio:function(e){W.value===e&&(W.value=null)},togglePaymentRadio:function(e){J.value===e&&(J.value=null)},shippingSelected:I,paymentSelected:G,shippingComponentData:D,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(D.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:ke,user:j,dontcall:z,comment:R,isCommentToggled:T,commentMaxLength:1e3,userCheckout:y,thanks:_,order:E,redirect:b,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:x,applyPromoCode:function(){L.value&&(P.value=!0,$http.post(window.location.href,{promoCodeApply:L.value,email:j.value.email,total:h.value}).then((function(e){M.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ye,props:{message:__("shop.order.promo.error_"+e.error,{number:F.appContext.config.globalProperties.$filters.price(e.number)})}};l(t,{type:"error"}),"not_found"==e.error&&(L.value="")})),M.value=null)})).finally((function(){P.value=!1})))},promoCode:L,isPromoLoading:P,promoCodeApplied:M,resetPromoCode:function(){L.value="",M.value=null},calculateWithPromoCodeDiscount:function(){var e=h.value+Q.value+K.value;return M.value&&"percent"==M.value.type?Math.round(e-e*M.value.amount/100):M.value&&"discount"==M.value.type?Math.max(0,e-M.value.amount):e},consent:V,shippingComponent:N,slots:a,isPayed:me,loyalty:O,loyaltyUse:H,loyaltyUseApplied:q,resetLoyaltyUse:function(){H.value=0,q.value=!1},applyLoyaltyUse:function(){H.value&&(q.value=!0)},readableUserLoyaltyPoints:$}}}),ke={class:"cart checkout"},_e=["action"],Ee=["name","value"],Ve={key:1,class:"items-wrapper"},Ne={class:"checkout-title"},be={class:"columns"},Be={class:"column checkout-blocks-wrapper"},Ce={class:"checkout-block is-cart"},we={class:"wrapper"},Se={class:"title-row"},De={class:"items-title"},Te=["textContent"],xe=["innerHTML"],Le=["onClick"],Me=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Pe={class:"checkout-block is-user auth-user"},Fe={class:"wrapper"},Oe={class:"items-title"},He={key:0,class:"user-tabs"},qe={class:"columns"},$e={class:"column user-form"},Ue={type:"submit",ref:"userSubmitButton",class:"is-hidden"},ze={key:0,class:"column user-login user-form"},Re={key:1,class:"column"},Ae={key:0,class:"social-auth"},je={class:"socials"},We={class:"description"},Je={class:"buttons"},Ie=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ge=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ke={class:"checkout-block is-shipping"},Qe={class:"wrapper shipping-type-block"},Xe={class:"rows"},Ye={class:"item"},Ze={class:"row"},et={class:"info"},tt={class:"items-title mb-1"},ot={key:0,class:"value"},nt={class:"next-dates"},rt={class:"row"},at={class:"info"},lt=["value","onClick"],it=["src"],ct={key:1,class:"icon"},st=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],dt={key:0,class:"description"},ut={class:"value"},mt={key:0,class:"green"},pt=["innerHTML"],vt={key:0},ht={key:0,class:"checkout-block is-payment"},ft={class:"wrapper payment-method-block"},yt={class:"rows"},gt={class:"item"},kt={class:"row"},_t={class:"info"},Et={class:"items-title mb-1"},Vt={class:"info"},Nt=["value","onClick"],bt={key:0,class:"description"},Bt={key:0,class:"value"},Ct=["innerHTML"],wt={class:"column is-4"},St={class:"checkout-block summary"},Dt={key:0,class:"inner payment-method-block"},Tt={class:"rows"},xt={class:"item"},Lt={class:"row"},Mt={class:"info"},Pt={class:"items-title mb-1"},Ft={class:"info"},Ot=["value","onClick"],Ht={key:0,class:"description"},qt={key:0,class:"value"},$t=["innerHTML"],Ut=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),zt={class:"inner"},Rt={class:"items-title"},At={class:"rows"},jt={class:"row products"},Wt={class:"info"},Jt=["textContent"],It={class:"value"},Gt=["innerHTML"],Kt={key:0,class:"row discount"},Qt={class:"info"},Xt={class:"value"},Yt=["innerHTML"],Zt={key:1,class:"row fee"},eo={class:"info"},to={class:"value"},oo=["innerHTML"],no={key:2,class:"row shipping"},ro={class:"info"},ao={class:"value"},lo=["innerHTML"],io={key:1,class:"green"},co={key:3,class:"row promo"},so={class:"info"},uo=e.createElementVNode("br",null,null,-1),mo={class:"green"},po={class:"value"},vo=["innerHTML"],ho={class:"row price"},fo={class:"info"},yo={class:"value orange"},go=["innerHTML"],ko={key:0,class:"user-loyalty"},_o={class:"notice"},Eo={class:"user-form is-loyalty-use"},Vo={class:"control"},No=["disabled"],bo=["disabled"],Bo={class:"checkbox-wrapper nocall"},Co={key:1,class:"consent"},wo={class:"checkbox-wrapper"},So=["innerHTML"],Do=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),To={class:"user-form is-promo-code"},xo={class:"control"},Lo=["disabled"],Mo={class:"label",for:"promo-code-applied"},Po=["disabled"],Fo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Oo={class:"user-form"},Ho={key:0,class:"chars-count"},qo={key:2,class:"checkout-block thanks"},$o={class:"title"},Uo={class:"columns"},zo={key:0,class:"column is-6"},Ro={class:"subtitle"},Ao={key:1,class:"column is-6"},jo={class:"column is-6"},Wo={key:0,class:"info-wrapper"},Jo={class:"title"},Io={class:"columns"},Go=["innerHTML"],Ko=["innerHTML"],Qo={key:1,class:"info-wrapper"},Xo={class:"title"},Yo={class:"columns"},Zo=["innerHTML"],en=["innerHTML"],tn={key:2,class:"info-wrapper"},on={class:"title"},nn={class:"columns"},rn={class:"column is-6"},an=["innerHTML"],ln={key:3,class:"checkout-block empty"},cn={class:"title"},sn={class:"message"},dn=["href"],un=e.createElementVNode("br",null,null,-1),mn=["href"];ge.render=function(t,o,n,r,a,l){var i=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",ke,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,style:{position:"absolute",left:"-1000px",top:"-1000px"},method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:o,value:t,key:n},null,8,Ee)})),128))],8,_e)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Ne,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",be,[e.createElementVNode("div",Be,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Ce,[e.createCommentVNode("items"),e.createElementVNode("div",we,[e.createElementVNode("div",Se,[e.createElementVNode("div",De,[e.createTextVNode(e.toDisplayString(t.__("shop.order.your_order"))+" ",1),e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Te),e.createTextVNode(" "),e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,xe)])]),e.renderSlot(t.$slots,"cart",{items:t.items},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(i,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(o){return[e.createElementVNode("button",{class:"button",onClick:o.open},[Me,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,Le)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Pe,[e.createElementVNode("div",Fe,[e.createElementVNode("div",Oe,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",qe,[e.withDirectives(e.createElementVNode("div",$e,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Ue,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(d,{"login-callback":t.loginCallback},null,8,["login-callback"])],512)),[[e.vShow,"login"==t.userType]]):e.createCommentVNode("v-if",!0),t.isLogin?(e.openBlock(),e.createElementBlock("div",Re,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",je,[e.createElementVNode("div",We,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Je,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ie),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Ge)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",nt,"на "+e.toDisplayString(t.shippingSelected.nextDates),1)])):e.createCommentVNode("v-if",!0),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",rt,[e.createElementVNode("div",at,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,lt),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,it)):(e.openBlock(),e.createElementBlock("svg",ct,st)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",dt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",ut,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",mt,e.toDisplayString(n.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,pt))])]),t.slots.shippingFooter?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",vt,[n.component&&n.id==t.shipping?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:0,commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])):e.createCommentVNode("v-if",!0)]))],2)})),128))]),e.renderSlot(t.$slots,"shipping-footer",{shippingTypesRestricted:t.shippingTypesRestricted,shipping:t.shipping,shippingStoreData:t.shippingStoreData,shippingComponentData:t.shippingComponentData})])]),t.isPaymentMethodOverSummary?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",ft,[e.createElementVNode("div",yt,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Et,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Vt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[7]||(o[7]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Nt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",bt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ct)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",wt,[e.createElementVNode("div",St,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",xt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Pt,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Ft,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[9]||(o[9]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Ot),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ht,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",qt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,$t)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),Ut,e.createElementVNode("div",zt,[e.createElementVNode("div",Rt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",At,[e.createElementVNode("div",jt,[e.createElementVNode("div",Wt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Jt),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",It,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Gt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("div",Qt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Xt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Yt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("div",eo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",to,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,oo)])])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("div",ro,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",ao,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,lo)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",io,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",so,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),uo,e.createElementVNode("span",mo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",po,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,vo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ho,[e.createElementVNode("div",fo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",yo,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,go)])])]),e.renderSlot(t.$slots,"loyalty",{loyalty:t.loyalty}),t.userCheckout.loyalty_points>0?(e.openBlock(),e.createElementBlock("div",ko,[e.createElementVNode("div",_o,e.toDisplayString(t.pluralize(t.readableUserLoyaltyPoints,t.__("shop.pluralize.points")))+" в наявності",1),e.createElementVNode("div",Eo,[e.createElementVNode("div",Vo,[e.withDirectives(e.createElementVNode("input",{type:"number",class:"input",placeholder:"Сума бонусів","onUpdate:modelValue":o[10]||(o[10]=function(e){return t.loyaltyUse=e}),disabled:t.loyaltyUseApplied},null,8,No),[[e.vModelText,t.loyaltyUse]])]),t.loyaltyUseApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button is-reset",onClick:o[12]||(o[12]=function(){return t.resetLoyaltyUse&&t.resetLoyaltyUse.apply(t,arguments)})},"Відмінити")):(e.openBlock(),e.createElementBlock("button",{key:0,class:"button",onClick:o[11]||(o[11]=function(){return t.applyLoyaltyUse&&t.applyLoyaltyUse.apply(t,arguments)}),disabled:!t.loyaltyUse||t.loyaltyUse>t.userCheckout.loyalty_points},"Використати",8,bo))])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Bo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[13]||(o[13]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.nocall")),1)])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:o[14]||(o[14]=function(){return t.checkout&&t.checkout.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.action")),3),e.renderSlot(t.$slots,"submit",{total:t.total}),t.isConsent?(e.openBlock(),e.createElementBlock("div",Co,[e.createElementVNode("div",wo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[15]||(o[15]=function(e){return t.consent=e})},null,512),[[e.vModelCheckbox,t.consent]]),e.createElementVNode("div",{class:"label",innerHTML:t.__("shop.order.consent")},null,8,So)])])])):e.createCommentVNode("v-if",!0),t.isPromoCode?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["comment-wrapper is-promo-code",{"is-open":t.isPromoCodeToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[16]||(o[16]=function(e){return t.isPromoCodeToggled=!t.isPromoCodeToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.promo_code")),1),Do]),e.createElementVNode("div",To,[e.createElementVNode("div",xo,[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",placeholder:" ","onUpdate:modelValue":o[17]||(o[17]=function(e){return t.promoCode=e}),disabled:t.promoCodeApplied,id:"promo-code-applied"},null,8,Lo),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Mo,e.toDisplayString(t.__("shop.order.promo.placeholder")),1)]),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button",onClick:o[19]||(o[19]=function(){return t.resetPromoCode&&t.resetPromoCode.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.promo.reset")),1)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["button",{"is-loading":t.isPromoLoading}]),onClick:o[18]||(o[18]=function(){return t.applyPromoCode&&t.applyPromoCode.apply(t,arguments)}),disabled:!t.promoCode},e.toDisplayString(t.__("shop.order.promo.apply")),11,Po))])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[20]||(o[20]=function(e){return t.isCommentToggled=!t.isCommentToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.comment")),1),Fo]),e.createElementVNode("div",Oo,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":o[21]||(o[21]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Ho,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",qo,[e.renderSlot(t.$slots,"thanks",{order:t.order,redirect:t.redirect,redirectForm:t.redirectForm,home:t.home,auth:t.auth,filters:t.$filters},(function(){return[e.createElementVNode("div",$o,[e.createTextVNode(e.toDisplayString(t.__("shop.order.order"))+" ",1),e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),e.createTextVNode(" "+e.toDisplayString(t.isPayed?t.__("shop.order.payed"):t.__("shop.order.success")),1)]),e.createElementVNode("div",Uo,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",zo,[e.createElementVNode("div",Ro,e.toDisplayString(t.__("shop.order.pay_online")),1),e.createElementVNode("button",{class:"button is-payment",onClick:o[22]||(o[22]=function(e){return t.redirectForm.submit()})},e.toDisplayString(t.__("shop.order.pay_online_go")),1)])):(e.openBlock(),e.createElementBlock("div",Ao,[e.createElementVNode("button",{class:"button is-orange",onClick:o[23]||(o[23]=function(){return t.home&&t.home.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)])),e.createElementVNode("div",jo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Jo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Io,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,Go)):e.createCommentVNode("v-if",!0),t.order.shipping[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.shipping[1]},null,8,Ko)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Qo,[e.createElementVNode("div",Xo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Yo,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Zo)):e.createCommentVNode("v-if",!0),t.order.payment[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.payment[1]},null,8,en)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",tn,[e.createElementVNode("div",on,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",nn,[e.createElementVNode("div",rn,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,an)])])])):e.createCommentVNode("v-if",!0)])])]}))])):t.redirectOnEmpty?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ln,[e.createElementVNode("div",cn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",sn,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,dn),e.createTextVNode(", "),un,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.continue")),9,mn)]))])},module.exports=ge;
1
+ "use strict";var e=require("vue"),t=require("@perevorot/shop/dist/helpers"),o=require("vuex"),n=require("formvuelate"),r=require("@formvuelate/plugin-vee-validate"),a=require("@perevorot/shop/dist/forms/FormText"),l=require("@perevorot/shop/dist/forms/FormRadio"),i=require("yup"),c=require("vue-toastification");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var u=s(r),m=s(a),p=s(l),v=d(i),h=e.defineComponent({name:"CheckoutItem",props:{item:Object},setup:function(t){var o=e.computed((function(){return t.item.attributes.options&&t.item.attributes.options.length?t.item.attributes.options:[]}));return{itemOptions:e.computed((function(){return t.item.options&&t.item.options.length?t.item.options.filter((function(e){return-1!==o.value.indexOf(e.id)})):[]}))}}}),f={key:0,class:"column is-12"},y={class:"bundle-title"},g={class:"column name"},k={class:"column is-narrow"},_=["href"],E=["src"],V={key:1},N=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],b={class:"column"},B={class:"columns is-gapless mb-0"},C={class:"column"},S={key:0,class:"code"},w={class:"title"},D=["href"],T={class:"column is-2 has-text-centered is-relative"},x={class:"quantity"},L={key:0,class:"quantity-price"},M=["innerHTML"],P={class:"column is-2 has-text-right"},F=["innerHTML"],O=["innerHTML"],H=["innerHTML"],q={key:0,class:"options is-toggled"},$={class:"toggler"},U={class:"wrapper"},z={class:"column"},R={class:"option-title"},A={class:"column is-2 has-text-right"},j=["innerHTML"],W={key:0,class:"bundle columns"},J={class:"column is-narrow"},I=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),G=["href"],K=["src"],Q={key:1},X=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],Y={class:"column"},Z={key:0,class:"code"},ee={class:"title"},te=["href"],oe={key:1,class:"bundle columns"},ne={class:"column is-narrow"},re=e.createElementVNode("svg",{class:"bundle-icon"},[e.createElementVNode("use",{"xlink:href":"#bundle-plus"})],-1),ae=["href"],le=["src"],ie={key:1},ce=[e.createElementVNode("use",{"xlink:href":"#logo"},null,-1)],se={class:"column"},de={key:0,class:"code"},ue={class:"title"},me=["href"];function pe(e,t,o){return o?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function ve(){}function he(e){return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}h.render=function(t,o,n,r,a,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["columns is-multiline shop-cart-item",{"is-bundle":t.item.attributes.bundle}])},[t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",f,[e.createElementVNode("div",y,e.toDisplayString(t.__("shop.cart.bundle")),1)])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",g,[e.createElementVNode("div",{class:e.normalizeClass(["columns",{"mb-0":t.item.attributes.bundle}])},[e.createElementVNode("div",k,[e.createElementVNode("a",{href:t.item.attributes.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.image}])},[t.item.attributes.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.image},null,8,E)):(e.openBlock(),e.createElementBlock("svg",V,N))],2)],8,_)]),e.createElementVNode("div",b,[e.createElementVNode("div",B,[e.createElementVNode("div",C,[t.item.attributes.code?(e.openBlock(),e.createElementBlock("div",S,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",w,[e.createElementVNode("a",{href:t.item.attributes.href},e.toDisplayString(t.item.name),9,D)])]),e.createElementVNode("div",T,[e.createElementVNode("div",x,"⨉ "+e.toDisplayString(t.item.quantity),1),parseInt(t.item.quantity)>1?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.item.attributes.price)},null,8,M),e.createTextVNode(" / "+e.toDisplayString(t.__("shop.cart.q")),1)])):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",P,[e.createElementVNode("div",{class:e.normalizeClass(["price",{"bundle-price":t.item.attributes.bundle}])},[t.item.attributes.priceOld?(e.openBlock(),e.createElementBlock("div",{key:0,class:"price-old",innerHTML:t.$filters.price(t.item.attributes.priceOld*t.item.quantity)},null,8,F)):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.amount?(e.openBlock(),e.createElementBlock("div",{key:1,class:"bundle-amount",innerHTML:t.__("shop.cart.bundle_amount")+(t.item.attributes.amount.percent?t.item.attributes.amount.percent+"%":t.$filters.price(t.item.attributes.amount.sum*t.item.quantity))},null,8,O)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{innerHTML:t.$filters.price(t.item.attributes.price*t.item.quantity)},null,8,H)],2)])]),t.itemOptions&&t.itemOptions.length?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("div",$,[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.cart.additional"))+" "+e.toDisplayString(t.itemOptions.length),1)]),e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.itemOptions,(function(o,n){return e.openBlock(),e.createElementBlock("div",{key:n,class:"columns is-checked"},[e.createElementVNode("div",z,[e.createElementVNode("div",R,e.toDisplayString(o.name),1)]),e.createElementVNode("div",A,[e.createTextVNode("+"),e.createElementVNode("span",{innerHTML:t.$filters.price(o.price)},null,8,j)])])})),128))])])):e.createCommentVNode("v-if",!0)])],2),t.item.attributes.bundle?(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("div",J,[I,e.createElementVNode("a",{href:t.item.attributes.second.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.second.image}])},[t.item.attributes.second.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.second.image},null,8,K)):(e.openBlock(),e.createElementBlock("svg",Q,X))],2)],8,G)]),e.createElementVNode("div",Y,[t.item.attributes.second.code?(e.openBlock(),e.createElementBlock("div",Z,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.second.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ee,[e.createElementVNode("a",{href:t.item.attributes.second.href},e.toDisplayString(t.item.attributes.second.name),9,te)])])])):e.createCommentVNode("v-if",!0),t.item.attributes.bundle&&t.item.attributes.third?(e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("div",ne,[re,e.createElementVNode("a",{href:t.item.attributes.third.href},[e.createElementVNode("figure",{class:e.normalizeClass(["image is-square",{"no-thumb":!t.item.attributes.third.image}])},[t.item.attributes.third.image?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.item.attributes.third.image},null,8,le)):(e.openBlock(),e.createElementBlock("svg",ie,ce))],2)],8,ae)]),e.createElementVNode("div",se,[t.item.attributes.third.code?(e.openBlock(),e.createElementBlock("div",de,e.toDisplayString(t.__("shop.cart.code"))+" "+e.toDisplayString(t.item.attributes.third.code),1)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ue,[e.createElementVNode("a",{href:t.item.attributes.third.href},e.toDisplayString(t.item.attributes.third.name),9,me)])])])):e.createCommentVNode("v-if",!0)])],2)},v.addMethod(v.string,"numberFilled",(function(e,t){return this.test({name:"numberFilled",exclusive:!0,message:__("auth.validation.number"),params:{min:e},test:function(e){return!(""==e||isNaN(e))}})})),e.markRaw(m.default),e.markRaw(p.default);var fe=n.SchemaFormFactory([u.default({})]),ye={props:{message:""},template:'<div v-html="message"></div>'};window.viewedSwiperOptions={slidesPerView:"auto",freeMode:!0,slideClass:"product",mousewheel:{forceToAxis:!0},navigation:{nextEl:".next",prevEl:".prev"},observer:!0,observeParents:!0};var ge=e.defineComponent({components:{CheckoutItem:h,SchemaForm:fe},props:{isLogin:{type:Boolean,default:!0},isPhoneMasked:{type:Boolean,default:!0},isPromoCode:{type:Boolean,default:!0},isConsent:{type:Boolean,default:!1},isPaymentMethodOverSummary:{type:Boolean,default:!1},userFields:{type:Array,default:["last_name","name","email","phone"]},redirectOnEmpty:{type:String,default:!1},showPlaceholders:{type:Boolean,default:!1},isTrackAfterSuccessOnlinePurchase:{type:Boolean,default:!1}},name:"order-checkout",setup:function(r){var a=e.useSlots(),l=c.useToast(),i=o.useStore(),s=e.ref(!1),d=e.computed((function(){return i.getters["cart/quantity"]})),u=e.computed((function(){return i.getters["cart/items"]})),h=e.computed((function(){return i.getters["cart/total"]})),f=e.computed((function(){return i.getters["auth/is"]})),y=e.computed((function(){return i.getters["checkout/user"]})),g=e.ref(!0),k=e.ref(null),_=e.ref(!1),E=e.ref(null),V=e.ref(!1),N=e.ref(null),b=e.ref({}),B=e.ref([]),C=e.ref([]),S=e.ref("new"),w=e.ref(null),D=e.computed((function(){return i.getters["checkout/shippingData"]})),T=e.ref(!1),x=e.ref(!1),L=e.ref(""),M=e.ref(null),P=e.ref(!1),F=e.getCurrentInstance(),O=e.computed((function(){var e=u.value.reduce((function(e,t){return e+(t.attributes.loyalty?t.attributes.loyalty.points*t.quantity:0)}),0);return{points:e,name:t.pluralize(e,__("shop.pluralize.points"))}})),H=e.ref(""),q=e.ref(!1),$=e.computed((function(){return t.numberFormat(y.value.loyalty_points-(q.value?H.value:0))})),U=e.computed((function(){return r.isConsent&&V.value||!r.isConsent})),z=e.computed({get:function(){return i.getters["checkout/dontcall"]},set:function(e){i.commit("checkout/dontcall",e)}}),R=e.computed({get:function(){var e=i.getters["checkout/comment"];return e&&(T.value=!0),e},set:function(e){i.commit("checkout/comment",e)}});e.watch(R,(function(e){e.length>1e3&&(R.value=R.value.substring(0,1e3))}));var A=function(t,o){return e.computed({get:function(){return y.value[t]?y.value[t]:o},set:function(e){var o=JSON.parse(JSON.stringify(y.value));o[t]=e,i.commit("checkout/user",o)}})};e.provide("field",A);var j=e.ref({last_name:A("last_name"),middle_name:A("middle_name"),name:A("name"),email:A("email"),phone:A("phone"),registration_number:A("registration_number"),company_name:A("company_name"),user_type:A("user_type","individual")});e.provide("user",j),i.dispatch("auth/me",{finally:function(){}});var W=e.computed({get:function(){return i.getters["checkout/shipping"]},set:function(e){i.commit("checkout/shipping",e)}}),J=e.computed({get:function(){return i.getters["checkout/payment"]},set:function(e){i.commit("checkout/payment",e)}}),I=e.computed((function(){return W.value?B.value.find((function(e){return e.id==W.value})):{}})),G=e.computed((function(){return J.value?C.value.find((function(e){return e.id==J.value})):{}})),K=e.computed((function(){return ee(B.value,W.value)})),Q=e.computed((function(){return ee(C.value,J.value)})),X=e.computed((function(){return te(B.value)})),Y=e.computed((function(){return te(C.value)})),Z=e.computed((function(){var e=[];return u.value.forEach((function(t){-1===e.indexOf(t.category_id)&&e.push(t.category_id)})),e})),ee=function(e,t){var o=0;if(t){var n=e.find((function(e){return e.id==t}));n&&(o="sum"==n.type?n.amount:Math.round(h.value*n.amount/100))}return o},te=function(e){var t=[];return e.forEach((function(e){if(e.restrictions&&Object.keys(e.restrictions).length){var o=!0,n=e.restrictions;n.price_min&&n.price_max?(o=h.value>=n.price_min&&h.value<=n.price_max,e.restrictedForce=!o):n.price_min?(o=h.value>=n.price_min,e.restrictedForce=!o):n.price_max&&(o=h.value<=n.price_max,e.restrictedForce=!o),o&&W.value&&n.shipping_type&&n.shipping_type.length&&(o=-1!==n.shipping_type.indexOf(W.value)),o&&J.value&&n.payment_method&&n.payment_method.length&&(o=-1!==n.payment_method.indexOf(J.value)),o&&n.categories&&n.categories.length&&(o=!Z.value.filter((function(e){return!n.categories.includes(e)})).length,e.restrictedForce=!o),o&&"user_type"===n.code&&(o=n.value===j.value.user_type,e.restrictedForce=!o),e.restricted=!o}else e.restricted=!1;e.restrictedForce||t.push(e)})),t},oe=e.computed((function(){var e=0;return u.value.forEach((function(t){var o=0;t.attributes.priceOld&&(o=t.attributes.priceOld-t.attributes.price),e+=o*t.quantity})),e}));$http.post(window.location.href).then((function(e){B.value=e.data.shipping,C.value=e.data.payment})),e.watch(S,(function(e){"login"==e&&i.commit("auth/modal","login")}));var ne={user_type:{component:p.default,model:"user_type",label:"",list:[{code:"individual",value:__("auth.registration.form.user_type_individual")},{code:"legal",value:__("auth.registration.form.user_type_legal")}]},name:{component:m.default,label:__("auth.registration.form.name"),model:"first_name",placeholder:r.showPlaceholders?__("auth.registration.form.name"):""},last_name:{component:m.default,label:__("auth.registration.form.last_name"),model:"last_name",placeholder:r.showPlaceholders?__("auth.registration.form.last_name"):""},middle_name:{component:m.default,label:__("auth.registration.form.middle_name"),model:"middle_name",placeholder:r.showPlaceholders?__("auth.registration.form.middle_name"):""},phone:{component:m.default,label:__("auth.registration.form.phone"),model:"phone",type:"phone"},registration_number:{component:m.default,label:__("auth.registration.form.registration_number"),model:"registration_number",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.registration_number"):""},company_name:{component:m.default,label:__("auth.registration.form.company_name"),model:"company_name",condition:function(e){return"legal"===e.user_type},placeholder:r.showPlaceholders?__("auth.registration.form.company_name"):""},email:{component:m.default,label:__("auth.login.form.email"),model:"email",placeholder:r.showPlaceholders?__("auth.login.form.email"):""}};r.isPhoneMasked&&(ne.phone.mask="(###) ###-##-##");var re=Object.keys(ne).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=ne[t]),e}),{});re=r.userFields.reduce((function(e,t){return e[t]=re[t],e}),{});var ae=e.ref(re);n.useSchemaForm(j);var le={last_name:v.string().trim().required(__("auth.validation.required")),middle_name:v.string().trim().required(__("auth.validation.required")),name:v.string().trim().required(__("auth.validation.required")),phone:r.isPhoneMasked?v.string().required(__("auth.validation.phone")).matches(/^\(\d{3}\) \d{3}\-\d{2}\-\d{2}$/,__("auth.validation.phone")):v.string().required(__("auth.validation.phone")),email:v.string().trim().email(__("auth.validation.email")).required(__("auth.validation.required")),registration_number:v.string().when("user_type",(function(e){if("legal"==e)return v.string().numberFilled()})),company_name:v.string().when("user_type",(function(e){if("legal"==e)return v.string().required(__("auth.validation.required"))}))},ie=Object.keys(le).reduce((function(e,t){return r.userFields.includes(t)&&(e[t]=le[t]),e}),{}),ce=v.object().shape(ie);window.addEventListener("beforeunload",(function(){i.commit("auth/modal",null)})),window.addEventListener("pagehide",(function(){i.commit("auth/modal",null)}));var se=he((function(){return function(e){var t=e();if(t&&t.then)return t.then(ve)}((function(){if("function"==typeof de.value)return pe(de.value(),(function(e){w.value&&w.value.click(),ce.isValid(j.value).then((function(t){g.value=t&&J.value&&U.value&&W.value&&(!I.value.component||I.value.component&&D.value[I.value.code]&&D.value[I.value.code].isValid)&&e}))}))}))})),de=e.ref(null);e.provide("shippingComponentValid",de);var ue=e.ref({});e.provide("shippingComponentUserData",ue);var me=e.ref(!1),fe=function(e){_.value=!0,E.value=e,document.querySelector("html").classList.add("is-checkout-thanks"),ke()},ge=he((function(){var t="function"==typeof de.value?de.value():null;return I.value&&!I.value.component&&(t=!0),ce.isValid(j.value).then((function(o){if(o)if(W.value)if(!I.value.component||D.value[I.value.code]&&D.value[I.value.code].isValid)if(t)if(J.value)if(U.value){var n,a=D.value[I.value.code]?JSON.parse(JSON.stringify(D.value[I.value.code])):{};delete a.isValid;var c=JSON.parse(JSON.stringify(ue.value));if(document.cookie)document.cookie.split(";").forEach((function(e){var t=e.split("=");"_ga"===t[0].trim()&&(n=t[1].split(".")[2]+"."+t[1].split(".")[3])}));var d={checkout:!0,user:{last_name:j.value.last_name,middle_name:j.value.middle_name,name:j.value.name,phone:j.value.phone,email:j.value.email,user_type:j.value.user_type,registration_number:j.value.registration_number,company_name:j.value.company_name},shipping:{id:W.value,data:a,user:c},payment:{id:J.value},comment:R.value,dontcall:z.value,promoCode:L.value,loyalty:H.value,clientId:n};s.value=!0,$http.post(window.location.href,d).then((function(t){if(t.data&&t.data.error&&t.data.message)l(t.data.message,{type:"error"});else{var o=[];u.value.forEach((function(e){var t={item_name:e.name,item_id:e.attributes.code,price:e.price,quantity:e.quantity};e.attributes.brand&&(t.item_brand=e.attributes.brand),e.attributes.property&&(t.item_variant=e.attributes.property),e.attributes.categoryFull&&(-1!==e.attributes.categoryFull.indexOf("/")?e.attributes.categoryFull.split("/").forEach((function(e,o){t["item_category"+(o?o+1:"")]=e.trim()})):t.item_category=e.attributes.categoryFull),e.attributes.index&&(t.index=e.attributes.index),e.attributes.itemListName&&(t.item_list_name=e.attributes.itemListName),o.push(t)}));var n={payment_type:G.value.name,shipping_tier:I.value.name,ecommerce:{transaction_id:t.data.order.id,affiliation:"main",value:parseFloat(h.value),shipping:0,currency:"UAH",items:o},event:"purchase"};j.value.user_type&&(n.user_type=__("auth.registration.form.user_type_"+j.value.user_type)),L.value&&(n.ecommerce.coupon=L.value),r.isTrackAfterSuccessOnlinePurchase&&(t.data.redirect||t.data.payment_widget_data&&window.Wayforpay)?localStorage.setItem("ecommerce",JSON.stringify(n)):($env.debug.ecommerce&&console.log(n),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(n))),t.data.redirect&&(b.value={url:t.data.redirect.url,data:t.data.redirect.data},e.nextTick((function(){setTimeout((function(){k.value.submit()}),400)}))),t.data.payment_widget_data&&window.Wayforpay?function(e,t){var o=new Wayforpay;window.addEventListener("message",(function(e){"WfpWidgetEventClose"==e.data||"WfpWidgetEventDeclined"==e.data||e.data,"WfpWidgetEventApproved"==e.data&&(fe(t),me.value=!0,i.dispatch("cart/clear",{finally:function(){}}))})),o.run(e)}(JSON.parse(t.data.payment_widget_data),t.data.order):fe(t.data.order)}})).catch((function(e){l(__("shop.order.error"),{type:"error"}),console.error(e)})).finally((function(){s.value=!1}))}else l(__("shop.order.validate_consent"),{type:"error"});else l(__("shop.order.validate_payment"),{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+I.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping1")+": «"+I.value.name+"»",{type:"error"});else l(__("shop.order.validate_shipping"),{type:"error"});else S.value="new",w.value.click(),l(__("shop.order.validate_user"),{type:"error"})})),pe()})),ke=function(){i.commit("checkout/reset"),i.commit("cart/clear")};return e.onMounted((function(){!d.value&&r.redirectOnEmpty&&(window.location.href=r.redirectOnEmpty);var e=[];if(u.value.forEach((function(t){var o={item_name:t.name,item_id:t.attributes.code,price:parseFloat(t.attributes.price),quantity:t.quantity};t.attributes.brand&&(o.item_brand=t.attributes.brand),t.attributes.property&&(o.item_variant=t.attributes.property),t.attributes.categoryFull&&(-1!==t.attributes.categoryFull.indexOf("/")?t.attributes.categoryFull.split("/").forEach((function(e,t){o["item_category"+(t?t+1:"")]=e.trim()})):o.item_category=t.attributes.categoryFull),t.attributes.index&&(o.index=t.attributes.index),t.attributes.itemListName&&(o.item_list_name=t.attributes.itemListName),e.push(o)})),e.length){var t={ecommerce:{currency:"UAH",items:e,value:parseFloat(h.value)},event:"begin_checkout"};$env.debug.ecommerce&&console.log(t),!$env.debug.ecommerce&&window.dataLayer&&(window.dataLayer.push({ecommerce:null}),window.dataLayer.push(t))}})),{auth:f,userType:S,facebook:function(){window.location.href=$ziggy("auth.login.social",{provider:"facebook"})},google:function(){window.location.href=$ziggy("auth.login.social",{provider:"google"})},loginCallback:function(){S.value="new"},quantity:d,items:u,loading:s,pluralize:t.pluralize,discount:oe,total:h,shipping:W,shippingPrice:K,payment:J,fee:Q,userValidation:ce,userSchema:ae,userSubmitButton:w,checkout:ge,ifCheckoutReady:g,validate:se,shippingTypesRestricted:X,paymentMethodsRestricted:Y,toggleShippingRadio:function(e){W.value===e&&(W.value=null)},togglePaymentRadio:function(e){J.value===e&&(J.value=null)},shippingSelected:I,paymentSelected:G,shippingComponentData:D,shippingStoreData:function(e,t,o){var n=JSON.parse(JSON.stringify(D.value));t.isValid=o,n[e]=t,i.commit("checkout/shippingData",n)},resertStore:ke,user:j,dontcall:z,comment:R,isCommentToggled:T,commentMaxLength:1e3,userCheckout:y,thanks:_,order:E,redirect:b,redirectForm:k,home:function(){window.location.href=$env.locale.url?$env.locale.url:"/"},isPromoCodeToggled:x,applyPromoCode:function(){L.value&&(P.value=!0,$http.post(window.location.href,{promoCodeApply:L.value,email:j.value.email,total:h.value}).then((function(e){M.value=e.data})).catch((function(e){e.response&&e.response.data.length&&(e.response.data.forEach((function(e){var t={component:ye,props:{message:__("shop.order.promo.error_"+e.error,{number:F.appContext.config.globalProperties.$filters.price(e.number)})}};l(t,{type:"error"}),"not_found"==e.error&&(L.value="")})),M.value=null)})).finally((function(){P.value=!1})))},promoCode:L,isPromoLoading:P,promoCodeApplied:M,resetPromoCode:function(){L.value="",M.value=null},calculateWithPromoCodeDiscount:function(){var e=h.value+Q.value+K.value;return M.value&&"percent"==M.value.type?Math.round(e-e*M.value.amount/100):M.value&&"discount"==M.value.type?Math.max(0,e-M.value.amount):e},consent:V,shippingComponent:N,slots:a,isPayed:me,loyalty:O,loyaltyUse:H,loyaltyUseApplied:q,resetLoyaltyUse:function(){H.value=0,q.value=!1},applyLoyaltyUse:function(){H.value&&(q.value=!0)},readableUserLoyaltyPoints:$}}}),ke={class:"cart checkout"},_e=["action"],Ee=["name","value"],Ve={key:1,class:"items-wrapper"},Ne={class:"checkout-title"},be={class:"columns"},Be={class:"column checkout-blocks-wrapper"},Ce={class:"checkout-block is-cart"},Se={class:"wrapper"},we={class:"title-row"},De={class:"items-title"},Te=["textContent"],xe=["innerHTML"],Le=["onClick"],Me=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#cart-edit"})],-1),Pe={class:"checkout-block is-user auth-user"},Fe={class:"wrapper"},Oe={class:"items-title"},He={key:0,class:"user-tabs"},qe={class:"columns"},$e={class:"column user-form"},Ue={type:"submit",ref:"userSubmitButton",class:"is-hidden"},ze={key:0,class:"column user-login user-form"},Re={key:1,class:"column"},Ae={key:0,class:"social-auth"},je={class:"socials"},We={class:"description"},Je={class:"buttons"},Ie=[e.createElementVNode("svg",{class:"icon fb-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-facebook-icon"})],-1),e.createElementVNode("span",null,"Facebook",-1)],Ge=[e.createElementVNode("svg",{class:"icon google-btn"},[e.createElementVNode("use",{"xlink:href":"#logo-google-icon"})],-1),e.createElementVNode("span",null,"Google",-1)],Ke={class:"checkout-block is-shipping"},Qe={class:"wrapper shipping-type-block"},Xe={class:"rows"},Ye={class:"item"},Ze={class:"row"},et={class:"info"},tt={class:"items-title mb-1"},ot={key:0,class:"value"},nt={class:"next-dates"},rt={class:"row"},at={class:"info"},lt=["value","onClick"],it=["src"],ct={key:1,class:"icon"},st=[e.createElementVNode("use",{"xlink:href":"#shipping"},null,-1)],dt={key:0,class:"description"},ut={class:"value"},mt={key:0,class:"green"},pt=["innerHTML"],vt={key:0},ht={key:0,class:"checkout-block is-payment"},ft={class:"wrapper payment-method-block"},yt={class:"rows"},gt={class:"item"},kt={class:"row"},_t={class:"info"},Et={class:"items-title mb-1"},Vt={class:"info"},Nt=["value","onClick"],bt={key:0,class:"description"},Bt={key:0,class:"value"},Ct=["innerHTML"],St={class:"column is-4"},wt={class:"checkout-block summary"},Dt={key:0,class:"inner payment-method-block"},Tt={class:"rows"},xt={class:"item"},Lt={class:"row"},Mt={class:"info"},Pt={class:"items-title mb-1"},Ft={class:"info"},Ot=["value","onClick"],Ht={key:0,class:"description"},qt={key:0,class:"value"},$t=["innerHTML"],Ut=e.createElementVNode("div",{class:"divider is-hidden"},null,-1),zt={class:"inner"},Rt={class:"items-title"},At={class:"rows"},jt={class:"row products"},Wt={class:"info"},Jt=["textContent"],It={class:"value"},Gt=["innerHTML"],Kt={key:0,class:"row discount"},Qt={class:"info"},Xt={class:"value"},Yt=["innerHTML"],Zt={key:1,class:"row fee"},eo={class:"info"},to={class:"value"},oo=["innerHTML"],no={key:2,class:"row shipping"},ro={class:"info"},ao={class:"value"},lo=["innerHTML"],io={key:1,class:"green"},co={key:3,class:"row promo"},so={class:"info"},uo=e.createElementVNode("br",null,null,-1),mo={class:"green"},po={class:"value"},vo=["innerHTML"],ho={class:"row price"},fo={class:"info"},yo={class:"value orange"},go=["innerHTML"],ko={key:0,class:"user-loyalty"},_o={class:"notice"},Eo={class:"user-form is-loyalty-use"},Vo={class:"control"},No=["disabled"],bo=["disabled"],Bo={class:"checkbox-wrapper nocall"},Co={key:1,class:"consent"},So={class:"checkbox-wrapper"},wo=["innerHTML"],Do=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),To={class:"user-form is-promo-code"},xo={class:"control"},Lo=["disabled"],Mo={class:"label",for:"promo-code-applied"},Po=["disabled"],Fo=e.createElementVNode("svg",null,[e.createElementVNode("use",{"xlink:href":"#arrow-down"})],-1),Oo={class:"user-form"},Ho={key:0,class:"chars-count"},qo={key:2,class:"checkout-block thanks"},$o={class:"title"},Uo={class:"columns"},zo={key:0,class:"column is-6"},Ro={class:"subtitle"},Ao={key:1,class:"column is-6"},jo={class:"column is-6"},Wo={key:0,class:"info-wrapper"},Jo={class:"title"},Io={class:"columns"},Go=["innerHTML"],Ko=["innerHTML"],Qo={key:1,class:"info-wrapper"},Xo={class:"title"},Yo={class:"columns"},Zo=["innerHTML"],en=["innerHTML"],tn={key:2,class:"info-wrapper"},on={class:"title"},nn={class:"columns"},rn={class:"column is-6"},an=["innerHTML"],ln={key:3,class:"checkout-block empty"},cn={class:"title"},sn={class:"message"},dn=["href"],un=e.createElementVNode("br",null,null,-1),mn=["href"];ge.render=function(t,o,n,r,a,l){var i=e.resolveComponent("checkout-item"),c=e.resolveComponent("cart-trigger"),s=e.resolveComponent("SchemaForm"),d=e.resolveComponent("login");return e.openBlock(),e.createElementBlock("div",ke,[t.redirect.url?(e.openBlock(),e.createElementBlock("form",{key:0,ref:"redirectForm",action:t.redirect.url,style:{position:"absolute",left:"-1000px",top:"-1000px"},method:"post"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.redirect.data,(function(t,o,n){return e.openBlock(),e.createElementBlock("input",{type:"hidden",name:o,value:t,key:n},null,8,Ee)})),128))],8,_e)):e.createCommentVNode("v-if",!0),t.items.length&&!t.thanks?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Ne,e.toDisplayString(t.__("shop.order.checkout_title")),1),e.createElementVNode("div",be,[e.createElementVNode("div",Be,[e.renderSlot(t.$slots,"header"),e.createElementVNode("div",Ce,[e.createCommentVNode("items"),e.createElementVNode("div",Se,[e.createElementVNode("div",we,[e.createElementVNode("div",De,[e.createTextVNode(e.toDisplayString(t.__("shop.order.your_order"))+" ",1),e.createElementVNode("span",{class:"ml-3",textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Te),e.createTextVNode(" "),e.createElementVNode("span",{innerHTML:t.__("shop.cart.bysum")+" "+t.$filters.price(t.total)},null,8,xe)])]),e.renderSlot(t.$slots,"cart",{items:t.items},(function(){return[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(function(t){return e.openBlock(),e.createBlock(i,{key:t.id,item:t},null,8,["item"])})),128)),e.createVNode(c,{class:"trigger"},{default:e.withCtx((function(o){return[e.createElementVNode("button",{class:"button",onClick:o.open},[Me,e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.edit")),1)],8,Le)]})),_:1})]})),e.renderSlot(t.$slots,"cart-footer",{total:t.total})])]),e.createElementVNode("div",Pe,[e.createElementVNode("div",Fe,[e.createElementVNode("div",Oe,e.toDisplayString(t.__("shop.order.contact_title")),1),!t.auth&&t.isLogin?(e.openBlock(),e.createElementBlock("div",He,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[0]||(o[0]=function(e){return t.userType=e}),value:"new"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_new")),1)]),e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[1]||(o[1]=function(e){return t.userType=e}),value:"login"},null,512),[[e.vModelRadio,t.userType]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.auth_old")),1)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",qe,[e.withDirectives(e.createElementVNode("div",$e,[e.createVNode(s,{schemaRowClasses:"field",schema:t.userSchema,"validation-schema":t.userValidation,preventModelCleanupOnSchemaChange:!0},{afterForm:e.withCtx((function(){return[e.createElementVNode("button",Ue,null,512)]})),_:1},8,["schema","validation-schema"])],512),[[e.vShow,"new"==t.userType]]),t.isLogin?e.withDirectives((e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(d,{"login-callback":t.loginCallback},null,8,["login-callback"])],512)),[[e.vShow,"login"==t.userType]]):e.createCommentVNode("v-if",!0),t.isLogin?(e.openBlock(),e.createElementBlock("div",Re,[t.auth?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",Ae,[e.createElementVNode("div",je,[e.createElementVNode("div",We,e.toDisplayString(t.__("shop.order.auth_social")),1),e.createElementVNode("div",Je,[e.createElementVNode("a",{class:"button",onClick:o[2]||(o[2]=function(){return t.facebook&&t.facebook.apply(t,arguments)})},Ie),e.createElementVNode("a",{class:"button",onClick:o[3]||(o[3]=function(){return t.google&&t.google.apply(t,arguments)})},Ge)])])]))])):e.createCommentVNode("v-if",!0)])])]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("div",Xe,[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("div",et,[e.createElementVNode("div",tt,e.toDisplayString(t.__("shop.order.shipping")),1)]),t.shippingSelected&&t.shippingSelected.nextDates?(e.openBlock(),e.createElementBlock("div",ot,[e.createElementVNode("div",nt,"на "+e.toDisplayString(t.shippingSelected.nextDates),1)])):e.createCommentVNode("v-if",!0),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.shippingTypesRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",rt,[e.createElementVNode("div",at,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[5]||(o[5]=function(e){return t.shipping=e}),value:n.id,onClick:function(e){return t.toggleShippingRadio(n.id)}},null,8,lt),[[e.vModelRadio,t.shipping]]),n.icon?(e.openBlock(),e.createElementBlock("img",{key:0,class:"icon",src:n.icon},null,8,it)):(e.openBlock(),e.createElementBlock("svg",ct,st)),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",dt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),e.createElementVNode("div",ut,[!n.amount&&n.price_label?(e.openBlock(),e.createElementBlock("span",mt,e.toDisplayString(n.price_label),1)):(e.openBlock(),e.createElementBlock("span",{key:1,innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,pt))])]),t.slots.shippingFooter?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",vt,[n.component&&n.id==t.shipping?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component),{key:0,commit:t.shippingStoreData,data:t.shippingComponentData,item:n},null,8,["commit","data","item"])):e.createCommentVNode("v-if",!0)]))],2)})),128))]),e.renderSlot(t.$slots,"shipping-footer",{shippingTypesRestricted:t.shippingTypesRestricted,shipping:t.shipping,shippingStoreData:t.shippingStoreData,shippingComponentData:t.shippingComponentData})])]),t.isPaymentMethodOverSummary?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",ft,[e.createElementVNode("div",yt,[e.createElementVNode("div",gt,[e.createElementVNode("div",kt,[e.createElementVNode("div",_t,[e.createElementVNode("div",Et,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Vt,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[7]||(o[7]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Nt),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",bt,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",Bt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,Ct)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])]))]),e.createElementVNode("div",St,[e.createElementVNode("div",wt,[t.isPaymentMethodOverSummary?(e.openBlock(),e.createElementBlock("div",Dt,[e.createElementVNode("div",Tt,[e.createElementVNode("div",xt,[e.createElementVNode("div",Lt,[e.createElementVNode("div",Mt,[e.createElementVNode("div",Pt,e.toDisplayString(t.__("shop.order.payment")),1)]),e.createCommentVNode("v-if",!0)])]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.paymentMethodsRestricted,(function(n){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["item",{"is-disabled":n.restricted}]),key:n.id},[e.createElementVNode("div",{class:e.normalizeClass(["row no-icon","is-"+n.code])},[e.createElementVNode("div",Ft,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"radio",class:"radio","onUpdate:modelValue":o[9]||(o[9]=function(e){return t.payment=e}),value:n.id,onClick:function(e){return t.togglePaymentRadio(n.id)}},null,8,Ot),[[e.vModelRadio,t.payment]]),e.createElementVNode("span",null,e.toDisplayString(n.name),1)]),n.description?(e.openBlock(),e.createElementBlock("div",Ht,e.toDisplayString(n.description),1)):e.createCommentVNode("v-if",!0)]),n.amount?(e.openBlock(),e.createElementBlock("div",qt,[e.createElementVNode("span",{innerHTML:"percent"==n.type?n.amount+"%":t.$filters.price(n.amount)},null,8,$t)])):e.createCommentVNode("v-if",!0)],2)],2)})),128))])])):e.createCommentVNode("v-if",!0),Ut,e.createElementVNode("div",zt,[e.createElementVNode("div",Rt,e.toDisplayString(t.__("shop.order.total")),1),e.createElementVNode("div",At,[e.createElementVNode("div",jt,[e.createElementVNode("div",Wt,[e.createElementVNode("span",{textContent:e.toDisplayString(t.pluralize(t.quantity,t.__("shop.pluralize.products")))},null,8,Jt),e.createTextVNode(" "+e.toDisplayString(t.__("shop.cart.bysum")),1)]),e.createElementVNode("div",It,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.total)},null,8,Gt)])]),t.discount?(e.openBlock(),e.createElementBlock("div",Kt,[e.createElementVNode("div",Qt,e.toDisplayString(t.__("shop.order.discount")),1),e.createElementVNode("div",Xt,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.discount)},null,8,Yt)])])):e.createCommentVNode("v-if",!0),t.fee>0?(e.openBlock(),e.createElementBlock("div",Zt,[e.createElementVNode("div",eo,e.toDisplayString(t.__("shop.order.fee")),1),e.createElementVNode("div",to,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.fee)},null,8,oo)]),e.renderSlot(t.$slots,"fee")])):e.createCommentVNode("v-if",!0),t.shipping?(e.openBlock(),e.createElementBlock("div",no,[e.createElementVNode("div",ro,e.toDisplayString(t.__("shop.order.shipping_price")),1),e.createElementVNode("div",ao,[t.shippingPrice>0?(e.openBlock(),e.createElementBlock("span",{key:0,innerHTML:t.$filters.price(t.shippingPrice)},null,8,lo)):t.shippingSelected&&t.shippingSelected.price_label?(e.openBlock(),e.createElementBlock("span",io,e.toDisplayString(t.shippingSelected.price_label),1)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("div",co,[e.createElementVNode("div",so,[e.createTextVNode(e.toDisplayString(t.__("shop.order.promo_code")),1),uo,e.createElementVNode("span",mo,e.toDisplayString(t.promoCode),1)]),e.createElementVNode("div",po,[e.createElementVNode("span",{innerHTML:"percent"==t.promoCodeApplied.type?t.promoCodeApplied.amount+"%":t.$filters.price(t.promoCodeApplied.amount)},null,8,vo)])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",ho,[e.createElementVNode("div",fo,e.toDisplayString(t.__("shop.order.price")),1),e.createElementVNode("div",yo,[e.createElementVNode("span",{innerHTML:t.$filters.price(t.calculateWithPromoCodeDiscount())},null,8,go)])])]),e.renderSlot(t.$slots,"loyalty",{loyalty:t.loyalty}),t.userCheckout.loyalty_points>0?(e.openBlock(),e.createElementBlock("div",ko,[e.createElementVNode("div",_o,e.toDisplayString(t.pluralize(t.readableUserLoyaltyPoints,t.__("shop.pluralize.points")))+" в наявності",1),e.createElementVNode("div",Eo,[e.createElementVNode("div",Vo,[e.withDirectives(e.createElementVNode("input",{type:"number",class:"input",placeholder:"Сума бонусів","onUpdate:modelValue":o[10]||(o[10]=function(e){return t.loyaltyUse=e}),disabled:t.loyaltyUseApplied},null,8,No),[[e.vModelText,t.loyaltyUse]])]),t.loyaltyUseApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button is-reset",onClick:o[12]||(o[12]=function(){return t.resetLoyaltyUse&&t.resetLoyaltyUse.apply(t,arguments)})},"Відмінити")):(e.openBlock(),e.createElementBlock("button",{key:0,class:"button",onClick:o[11]||(o[11]=function(){return t.applyLoyaltyUse&&t.applyLoyaltyUse.apply(t,arguments)}),disabled:!t.loyaltyUse||t.loyaltyUse>t.userCheckout.loyalty_points},"Використати",8,bo))])])):e.createCommentVNode("v-if",!0),e.createElementVNode("div",Bo,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[13]||(o[13]=function(e){return t.dontcall=e})},null,512),[[e.vModelCheckbox,t.dontcall]]),e.createTextVNode(e.toDisplayString(t.__("shop.order.nocall")),1)])]),e.createElementVNode("button",{class:e.normalizeClass(["button submit",{red:!t.ifCheckoutReady,"is-loading":t.loading}]),onClick:o[14]||(o[14]=function(){return t.checkout&&t.checkout.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.action")),3),e.renderSlot(t.$slots,"submit",{total:t.total}),t.isConsent?(e.openBlock(),e.createElementBlock("div",Co,[e.createElementVNode("div",So,[e.createElementVNode("label",null,[e.withDirectives(e.createElementVNode("input",{type:"checkbox",class:"checkbox","onUpdate:modelValue":o[15]||(o[15]=function(e){return t.consent=e})},null,512),[[e.vModelCheckbox,t.consent]]),e.createElementVNode("div",{class:"label",innerHTML:t.__("shop.order.consent")},null,8,wo)])])])):e.createCommentVNode("v-if",!0),t.isPromoCode?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["comment-wrapper is-promo-code",{"is-open":t.isPromoCodeToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[16]||(o[16]=function(e){return t.isPromoCodeToggled=!t.isPromoCodeToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.promo_code")),1),Do]),e.createElementVNode("div",To,[e.createElementVNode("div",xo,[e.withDirectives(e.createElementVNode("input",{type:"text",class:"input",placeholder:" ","onUpdate:modelValue":o[17]||(o[17]=function(e){return t.promoCode=e}),disabled:t.promoCodeApplied,id:"promo-code-applied"},null,8,Lo),[[e.vModelText,t.promoCode]]),e.createElementVNode("label",Mo,e.toDisplayString(t.__("shop.order.promo.placeholder")),1)]),t.promoCodeApplied?(e.openBlock(),e.createElementBlock("button",{key:1,class:"button",onClick:o[19]||(o[19]=function(){return t.resetPromoCode&&t.resetPromoCode.apply(t,arguments)})},e.toDisplayString(t.__("shop.order.promo.reset")),1)):(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["button",{"is-loading":t.isPromoLoading}]),onClick:o[18]||(o[18]=function(){return t.applyPromoCode&&t.applyPromoCode.apply(t,arguments)}),disabled:!t.promoCode},e.toDisplayString(t.__("shop.order.promo.apply")),11,Po))])],2)):e.createCommentVNode("v-if",!0),e.createElementVNode("div",{class:e.normalizeClass(["comment-wrapper",{"is-open":t.isCommentToggled}])},[e.createElementVNode("div",{class:"toggler",onClick:o[20]||(o[20]=function(e){return t.isCommentToggled=!t.isCommentToggled})},[e.createElementVNode("span",null,e.toDisplayString(t.__("shop.order.comment")),1),Fo]),e.createElementVNode("div",Oo,[e.withDirectives(e.createElementVNode("textarea",{class:"textarea","onUpdate:modelValue":o[21]||(o[21]=function(e){return t.comment=e})},null,512),[[e.vModelText,t.comment]]),t.comment.length?(e.openBlock(),e.createElementBlock("div",Ho,e.toDisplayString(t.commentMaxLength-t.comment.length),1)):e.createCommentVNode("v-if",!0)])],2)])])])])])):t.thanks&&t.order?(e.openBlock(),e.createElementBlock("div",qo,[e.renderSlot(t.$slots,"thanks",{order:t.order,redirect:t.redirect,redirectForm:t.redirectForm,home:t.home,auth:t.auth,filters:t.$filters},(function(){return[e.createElementVNode("div",$o,[e.createTextVNode(e.toDisplayString(t.__("shop.order.order"))+" ",1),e.createElementVNode("span",null,"№"+e.toDisplayString(t.order.id),1),e.createTextVNode(" "+e.toDisplayString(t.isPayed?t.__("shop.order.payed"):t.__("shop.order.success")),1)]),e.createElementVNode("div",Uo,[t.redirect.url?(e.openBlock(),e.createElementBlock("div",zo,[e.createElementVNode("div",Ro,e.toDisplayString(t.__("shop.order.pay_online")),1),e.createElementVNode("button",{class:"button is-payment",onClick:o[22]||(o[22]=function(e){return t.redirectForm.submit()})},e.toDisplayString(t.__("shop.order.pay_online_go")),1)])):(e.openBlock(),e.createElementBlock("div",Ao,[e.createElementVNode("button",{class:"button is-orange",onClick:o[23]||(o[23]=function(){return t.home&&t.home.apply(t,arguments)})},e.toDisplayString(t.__("shop.cart.continue")),1)])),e.createElementVNode("div",jo,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Jo,e.toDisplayString(t.__("shop.order.shipping")),1),e.createElementVNode("div",Io,[t.order.shipping[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.shipping[0]},null,8,Go)):e.createCommentVNode("v-if",!0),t.order.shipping[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.shipping[1]},null,8,Ko)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",Qo,[e.createElementVNode("div",Xo,e.toDisplayString(t.__("shop.order.payment")),1),e.createElementVNode("div",Yo,[t.order.payment[0]?(e.openBlock(),e.createElementBlock("div",{key:0,class:"column is-6",innerHTML:t.order.payment[0]},null,8,Zo)):e.createCommentVNode("v-if",!0),t.order.payment[1]?(e.openBlock(),e.createElementBlock("div",{key:1,class:"column is-6",innerHTML:t.order.payment[1]},null,8,en)):e.createCommentVNode("v-if",!0)])])):e.createCommentVNode("v-if",!0),t.order.promoCode?(e.openBlock(),e.createElementBlock("div",tn,[e.createElementVNode("div",on,e.toDisplayString(t.__("shop.order.promo_code")),1),e.createElementVNode("div",nn,[e.createElementVNode("div",rn,[e.createElementVNode("span",{innerHTML:t.order.promoCode,class:"green"},null,8,an)])])])):e.createCommentVNode("v-if",!0)])])]}))])):t.redirectOnEmpty?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",ln,[e.createElementVNode("div",cn,e.toDisplayString(t.__("shop.cart.no_no")),1),e.createElementVNode("div",sn,[e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_prop"))+" ",1),e.createElementVNode("a",{href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.no_home")),9,dn),e.createTextVNode(", "),un,e.createTextVNode(e.toDisplayString(t.__("shop.cart.no_search")),1)]),e.createElementVNode("a",{class:"button continue",href:t.$env.locale.url?t.$env.locale.url:"/"},e.toDisplayString(t.__("shop.cart.continue")),9,mn)]))])},module.exports=ge;
2
2
  //# sourceMappingURL=Checkout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkout.js","sources":["../../../../src/components/shop/order/CheckoutItem.vue","../../../../src/components/shop/order/CheckoutItem.vue?vue&type=template&id=4d5a1fac&lang.js","../../../../src/components/shop/order/Checkout.vue","../../../../src/components/shop/order/Checkout.vue?vue&type=template&id=17c01fc4&lang.js"],"sourcesContent":["<template>\n <div class=\"columns is-multiline shop-cart-item\" v-bind:class=\"{ 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">{{ __('shop.cart.bundle') }}</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <a :href=\"item.attributes.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.href\">{{ item.name }}</a>\n </div>\n </div>\n <div class=\"column is-2 has-text-centered is-relative\">\n <div class=\"quantity\">⨉ {{ item.quantity }}</div>\n <div class=\"quantity-price\" v-if=\"parseInt(item.quantity) > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"__('shop.cart.bundle_amount') + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </div>\n </div>\n <div class=\"options is-toggled\" v-if=\"itemOptions && itemOptions.length\">\n <div class=\"toggler\">\n <span>{{ __('shop.cart.additional') }} {{ itemOptions.length }}</span>\n </div>\n <div class=\"wrapper\">\n <div v-for=\"(option, index) in itemOptions\" v-bind:key=\"index\" class=\"columns is-checked\">\n <div class=\"column\">\n <div class=\"option-title\">{{ option.name }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.second.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">{{ __('shop.cart.code') }} {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.second.href\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.third.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">{{ __('shop.cart.code') }} {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.third.href\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { defineComponent, computed } from 'vue';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'CheckoutItem',\n props: {\n item: Object\n },\n setup(props) {\n const options = computed(() => (props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []));\n const itemOptions = computed(() => (props.item.options && props.item.options.length ? props.item.options.filter((option) => options.value.indexOf(option.id) !== -1) : []));\n\n return {\n itemOptions\n };\n }\n});\n</script>","<template>\n <div class=\"columns is-multiline shop-cart-item\" v-bind:class=\"{ 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">{{ __('shop.cart.bundle') }}</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <a :href=\"item.attributes.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.href\">{{ item.name }}</a>\n </div>\n </div>\n <div class=\"column is-2 has-text-centered is-relative\">\n <div class=\"quantity\">⨉ {{ item.quantity }}</div>\n <div class=\"quantity-price\" v-if=\"parseInt(item.quantity) > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"__('shop.cart.bundle_amount') + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </div>\n </div>\n <div class=\"options is-toggled\" v-if=\"itemOptions && itemOptions.length\">\n <div class=\"toggler\">\n <span>{{ __('shop.cart.additional') }} {{ itemOptions.length }}</span>\n </div>\n <div class=\"wrapper\">\n <div v-for=\"(option, index) in itemOptions\" v-bind:key=\"index\" class=\"columns is-checked\">\n <div class=\"column\">\n <div class=\"option-title\">{{ option.name }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.second.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">{{ __('shop.cart.code') }} {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.second.href\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.third.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">{{ __('shop.cart.code') }} {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.third.href\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { defineComponent, computed } from 'vue';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'CheckoutItem',\n props: {\n item: Object\n },\n setup(props) {\n const options = computed(() => (props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []));\n const itemOptions = computed(() => (props.item.options && props.item.options.length ? props.item.options.filter((option) => options.value.indexOf(option.id) !== -1) : []));\n\n return {\n itemOptions\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" style=\"position: absolute; left: -1000px; top:-1000px;\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">{{ __('shop.order.checkout_title') }}</div>\n <div class=\"columns\">\n <div class=\"column checkout-blocks-wrapper\">\n <slot name=\"header\"></slot>\n <div class=\"checkout-block is-cart\"><!--items-->\n <div class=\"wrapper\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n {{ __('shop.order.your_order') }}\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>&nbsp;<span v-html=\"__('shop.cart.bysum') + ' ' + $filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"cart\" :items=\"items\">\n <checkout-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\"></checkout-item>\n <cart-trigger class=\"trigger\">\n <template #default=\"props\">\n <button class=\"button\" @click=\"props.open\">\n <svg>\n <use xlink:href=\"#cart-edit\" />\n </svg>\n <span>{{ __('shop.order.edit') }}</span>\n </button>\n </template>\n </cart-trigger>\n </slot>\n <slot name=\"cart-footer\" :total=\"total\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-user auth-user\">\n <div class=\"wrapper\">\n <div class=\"items-title\">{{ __('shop.order.contact_title') }}</div>\n <div class=\"user-tabs\" v-if=\"!auth && isLogin\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" />{{ __('shop.order.auth_new') }}</label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" />{{ __('shop.order.auth_old') }}</label>\n </div>\n <div class=\"columns\">\n <div class=\"column user-form\" v-show=\"userType == 'new'\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"userSchema\" :validation-schema=\"userValidation\" :preventModelCleanupOnSchemaChange=\"true\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n <div class=\"column user-login user-form\" v-show=\"userType == 'login'\" v-if=\"isLogin\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\" v-if=\"isLogin\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">{{ __('shop.order.auth_social') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block is-shipping\">\n <div class=\"wrapper shipping-type-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.shipping') }}</div>\n </div>\n <div class=\"value\" v-if=\"shippingSelected && shippingSelected.nextDates\">\n <div class=\"next-dates\">на {{ shippingSelected.nextDates }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in shippingTypesRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"shipping\" :value=\"item.id\" @click=\"toggleShippingRadio(item.id)\" />\n <img class=\"icon\" :src=\"item.icon\" v-if=\"item.icon\" />\n <svg v-else class=\"icon\">\n <use xlink:href=\"#shipping\" />\n </svg>\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\">\n <span class=\"green\" v-if=\"!item.amount && item.price_label\">{{ item.price_label }}</span>\n <span v-else v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n <div v-if=\"!slots.shippingFooter\">\n <component :is=\"item.component\" v-if=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <slot name=\"shipping-footer\" :shippingTypesRestricted=\"shippingTypesRestricted\" :shipping=\"shipping\" :shippingStoreData=\"shippingStoreData\" :shippingComponentData=\"shippingComponentData\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-payment\" v-if=\"!isPaymentMethodOverSummary\">\n <div class=\"wrapper payment-method-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\" v-bind:class=\"'is-' + item.code\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-4\">\n <div class=\"checkout-block summary\">\n <div class=\"inner payment-method-block\" v-if=\"isPaymentMethodOverSummary\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\" v-bind:class=\"'is-' + item.code\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"divider is-hidden\"></div>\n <div class=\"inner\">\n <div class=\"items-title\">{{ __('shop.order.total') }}</div>\n <div class=\"rows\">\n <div class=\"row products\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> {{ __('shop.cart.bysum') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row discount\" v-if=\"discount\">\n <div class=\"info\">{{ __('shop.order.discount') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row fee\" v-if=\"fee > 0\">\n <div class=\"info\">{{ __('shop.order.fee') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row shipping\" v-if=\"shipping\">\n <div class=\"info\">{{ __('shop.order.shipping_price') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(shippingPrice)\" v-if=\"shippingPrice > 0\"></span>\n <span class=\"green\" v-else-if=\"shippingSelected && shippingSelected.price_label\">{{ shippingSelected.price_label }}</span>\n </div>\n </div>\n <div class=\"row promo\" v-if=\"promoCodeApplied\">\n <div class=\"info\">{{ __('shop.order.promo_code') }}<br><span class=\"green\">{{ promoCode }}</span></div>\n <div class=\"value\">\n <span v-html=\"(promoCodeApplied.type == 'percent' ? promoCodeApplied.amount + '%' : $filters.price(promoCodeApplied.amount))\"></span>\n </div>\n </div>\n <div class=\"row price\">\n <div class=\"info\">{{ __('shop.order.price') }}</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(calculateWithPromoCodeDiscount())\"></span>\n </div>\n </div>\n </div>\n <slot name=\"loyalty\" :loyalty=\"loyalty\"></slot>\n <div class=\"user-loyalty\" v-if=\"userCheckout.loyalty_points > 0\">\n <div class=\"notice\">{{ pluralize(readableUserLoyaltyPoints, __('shop.pluralize.points')) }} в наявності</div>\n <div class=\"user-form is-loyalty-use\">\n <div class=\"control\">\n <input type=\"number\" class=\"input\" placeholder=\"Сума бонусів\" v-model=\"loyaltyUse\" :disabled=\"loyaltyUseApplied\">\n </div>\n <button v-if=\"!loyaltyUseApplied\" class=\"button\" @click=\"applyLoyaltyUse\" :disabled=\"!loyaltyUse || loyaltyUse > userCheckout.loyalty_points\">Використати</button>\n <button v-else class=\"button is-reset\" @click=\"resetLoyaltyUse\">Відмінити</button>\n </div>\n </div>\n <div class=\"checkbox-wrapper nocall\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" />{{ __('shop.order.nocall') }}</label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">{{ __('shop.order.action') }}</button>\n <slot name=\"submit\" :total=\"total\"></slot>\n <div class=\"consent\" v-if=\"isConsent\">\n <div class=\"checkbox-wrapper\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"consent\" />\n <div class=\"label\" v-html=\"__('shop.order.consent')\"></div>\n </label>\n </div>\n </div>\n <div class=\"comment-wrapper is-promo-code\" v-bind:class=\"{ 'is-open': isPromoCodeToggled }\" v-if=\"isPromoCode\">\n <div class=\"toggler\" @click=\"isPromoCodeToggled = !isPromoCodeToggled\">\n <span>{{ __('shop.order.promo_code') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form is-promo-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" placeholder=\" \" v-model=\"promoCode\" :disabled=\"promoCodeApplied\" id=\"promo-code-applied\">\n <label class=\"label\" for=\"promo-code-applied\">{{ __('shop.order.promo.placeholder') }}</label>\n </div>\n <button v-if=\"!promoCodeApplied\" class=\"button\" @click=\"applyPromoCode\" :disabled=\"!promoCode\" v-bind:class=\"{ 'is-loading': isPromoLoading }\">{{ __('shop.order.promo.apply') }}</button>\n <button v-else class=\"button\" @click=\"resetPromoCode\">{{ __('shop.order.promo.reset') }}</button>\n </div>\n </div>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>{{ __('shop.order.comment') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form\">\n <textarea class=\"textarea\" v-model=\"comment\"></textarea>\n <div class=\"chars-count\" v-if=\"comment.length\">{{ commentMaxLength - comment.length }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <slot name=\"thanks\" :order=\"order\" :redirect=\"redirect\" :redirectForm=\"redirectForm\" :home=\"home\" :auth=\"auth\" :filters=\"$filters\">\n <div class=\"title\">\n {{ __('shop.order.order') }}\n <span>№{{ order.id }}</span> {{ isPayed ? __('shop.order.payed') : __('shop.order.success') }}\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">{{ __('shop.order.pay_online') }}</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">{{ __('shop.order.pay_online_go') }}</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">{{ __('shop.order.shipping') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.shipping[0]\" v-html=\"order.shipping[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.shipping[1]\" v-html=\"order.shipping[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.payment[0]\">\n <div class=\"title\">{{ __('shop.order.payment') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.payment[0]\" v-html=\"order.payment[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.payment[1]\" v-html=\"order.payment[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.promoCode\">\n <div class=\"title\">{{ __('shop.order.promo_code') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\">\n <span v-html=\"order.promoCode\" class=\"green\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </slot>\n </div>\n <div v-else-if=\"!redirectOnEmpty\" class=\"checkout-block empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.continue') }}</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch, getCurrentInstance, nextTick, provide, useSlots, onMounted } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize, numberFormat } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPhoneMasked: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n redirectOnEmpty: {\n type: String,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n isTrackAfterSuccessOnlinePurchase: {\n type: Boolean,\n default: false\n }\n },\n name: 'order-checkout',\n setup(props) {\n const slots = useSlots();\n const toast = useToast();\n const store = useStore();\n const loading = ref(false);\n const quantity = computed(() => store.getters['cart/quantity']);\n const items = computed(() => store.getters['cart/items']);\n const total = computed(() => store.getters['cart/total']);\n const auth = computed(() => store.getters['auth/is']);\n const userCheckout = computed(() => store.getters['checkout/user']);\n const ifCheckoutReady = ref(true);\n const redirectForm = ref(null);\n const thanks = ref(false);\n const order = ref(null);\n const consent = ref(false);\n const shippingComponent = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const loyalty = computed(() => {\n const points = items.value.reduce((acc, array) => acc + (array.attributes.loyalty ? array.attributes.loyalty.points * array.quantity : 0), 0);\n\n return {\n points: points,\n name: pluralize(points, __('shop.pluralize.points'))\n };\n });\n\n const loyaltyUse = ref('');\n const loyaltyUseApplied = ref(false);\n const resetLoyaltyUse = () => {\n loyaltyUse.value = 0;\n loyaltyUseApplied.value = false;\n };\n const applyLoyaltyUse = () => {\n if (loyaltyUse.value) {\n loyaltyUseApplied.value = true;\n }\n };\n\n const readableUserLoyaltyPoints = computed(() => {\n return numberFormat(userCheckout.value.loyalty_points - (loyaltyUseApplied.value ? loyaltyUse.value : 0));\n });\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n middle_name: field('middle_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n company_name: field('company_name'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\n };\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n let userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.name') : '',\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.last_name') : '',\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.middle_name') : '',\n },\n phone: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone',\n type: 'phone',\n //placeholder: '(050) 123-45-67'\n },\n registration_number: {\n component: FormText,\n label: __('auth.registration.form.registration_number'),\n model: 'registration_number',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.registration_number') : '',\n },\n company_name: {\n component: FormText,\n label: __('auth.registration.form.company_name'),\n model: 'company_name',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.company_name') : '',\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n };\n\n if (props.isPhoneMasked) {\n userSchemaFields.phone.mask = '(###) ###-##-##';\n }\n\n let userSchemaFieldsFiltered = Object.keys(userSchemaFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userSchemaFields[key];\n }\n\n return obj;\n }, {});\n\n userSchemaFieldsFiltered = props.userFields.reduce((obj, key) => {\n obj[key] = userSchemaFieldsFiltered[key];\n return obj;\n }, {});\n\n const userSchema = ref(userSchemaFieldsFiltered);\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n const userValidationFields = {\n last_name: yup.string().trim().required(__('auth.validation.required')),\n middle_name: yup.string().trim().required(__('auth.validation.required')),\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: props.isPhoneMasked ? yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone')) : yup.string().required(__('auth.validation.phone')),\n email: yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required')),\n registration_number: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().numberFilled();\n }\n }),\n company_name: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().required(__('auth.validation.required'));\n }\n }),\n };\n\n const userValidationFieldsFiltered = Object.keys(userValidationFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userValidationFields[key];\n }\n\n return obj;\n }, {});\n\n const userValidation = yup.object().shape(userValidationFieldsFiltered);\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = async () => {\n if (typeof shippingComponentValid.value == 'function') {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n if (userSubmitButton.value) {\n userSubmitButton.value.click();\n }\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n }\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const initPaymentWidget = (payment, order) => {\n const wayforpay = new Wayforpay();\n\n window.addEventListener('message', (event) => {\n if (event.data == 'WfpWidgetEventClose' || event.data == 'WfpWidgetEventDeclined' || event.data == 'WfpWidgetEventPending') {\n\n }\n\n if (event.data == 'WfpWidgetEventApproved') {\n resetCheckoutForm(order);\n\n isPayed.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => { }\n });\n }\n });\n\n wayforpay.run(payment);\n }\n\n const isPayed = ref(false);\n\n const resetCheckoutForm = (_order) => {\n thanks.value = true;\n order.value = _order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n resertStore();\n }\n\n const checkout = async () => {\n let isShippingComponentFormsValid = typeof shippingComponentValid.value == 'function' ? shippingComponentValid.value() : null;\n\n if (shippingSelected.value && !shippingSelected.value.component) {\n isShippingComponentFormsValid = true;\n }\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n middle_name: user.value.middle_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email,\n user_type: user.value.user_type,\n registration_number: user.value.registration_number,\n company_name: user.value.company_name,\n },\n shipping: {\n id: shipping.value,\n data: data,\n user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n loyalty: loyaltyUse.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n\n return;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n let product = {\n item_name: item.name,\n item_id: item.attributes.code,\n price: item.price,\n quantity: item.quantity\n };\n\n if (item.attributes.brand) {\n product.item_brand = item.attributes.brand;\n }\n\n if (item.attributes.property) {\n product.item_variant = item.attributes.property;\n }\n\n if (item.attributes.categoryFull) {\n if (item.attributes.categoryFull.indexOf('/') !== -1) {\n item.attributes.categoryFull.split('/').forEach((segment, index) => {\n product['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n product.item_category = item.attributes.categoryFull;\n }\n }\n\n if (item.attributes.index) {\n product.index = item.attributes.index;\n }\n\n if (item.attributes.itemListName) {\n product.item_list_name = item.attributes.itemListName;\n }\n\n products.push(product);\n });\n\n\n let object = {\n payment_type: paymentSelected.value.name,\n shipping_tier: shippingSelected.value.name,\n ecommerce: {\n transaction_id: response.data.order.id,\n affiliation: 'main',\n value: parseFloat(total.value),\n shipping: 0,\n currency: 'UAH',\n items: products\n },\n event: 'purchase',\n };\n\n if (user.value.user_type) {\n object.user_type = __('auth.registration.form.user_type_' + user.value.user_type);\n }\n\n if (promoCode.value) {\n object.ecommerce.coupon = promoCode.value;\n }\n\n if (props.isTrackAfterSuccessOnlinePurchase && (response.data.redirect || (response.data.payment_widget_data && window.Wayforpay))) {\n localStorage.setItem('ecommerce', JSON.stringify(object));\n } else {\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n\n nextTick(() => {\n setTimeout(() => {\n redirectForm.value.submit();\n }, 400);\n });\n }\n\n if (response.data.payment_widget_data && window.Wayforpay) {\n initPaymentWidget(JSON.parse(response.data.payment_widget_data), response.data.order);\n } else {\n resetCheckoutForm(response.data.order);\n }\n })\n .catch((e) => {\n toast(__('shop.order.error'), {\n type: 'error'\n });\n\n console.error(e);\n })\n .finally(() => {\n loading.value = false;\n });\n }\n });\n };\n\n const toggleShippingRadio = (id) => {\n if (shipping.value === id) {\n shipping.value = null;\n }\n };\n\n const togglePaymentRadio = (id) => {\n if (payment.value === id) {\n payment.value = null;\n }\n };\n\n const resertStore = () => {\n store.commit('checkout/reset');\n store.commit('cart/clear');\n };\n\n const shippingStoreData = (code, data, isValid) => {\n let d = JSON.parse(JSON.stringify(shippingComponentData.value));\n\n data.isValid = isValid;\n d[code] = data;\n\n store.commit('checkout/shippingData', d);\n };\n\n const home = () => {\n window.location.href = $env.locale.url ? $env.locale.url : '/';\n };\n\n onMounted(() => {\n if (!quantity.value && props.redirectOnEmpty) {\n window.location.href = props.redirectOnEmpty;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n let product = {\n item_name: item.name,\n item_id: item.attributes.code,\n price: parseFloat(item.attributes.price),\n quantity: item.quantity\n };\n\n if (item.attributes.brand) {\n product.item_brand = item.attributes.brand;\n }\n\n if (item.attributes.property) {\n product.item_variant = item.attributes.property;\n }\n\n if (item.attributes.categoryFull) {\n if (item.attributes.categoryFull.indexOf('/') !== -1) {\n item.attributes.categoryFull.split('/').forEach((segment, index) => {\n product['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n product.item_category = item.attributes.categoryFull;\n }\n }\n\n if (item.attributes.index) {\n product.index = item.attributes.index;\n }\n\n if (item.attributes.itemListName) {\n product.item_list_name = item.attributes.itemListName;\n }\n\n products.push(product);\n });\n\n if (products.length) {\n const object = {\n ecommerce: {\n currency: 'UAH',\n items: products,\n value: parseFloat(total.value),\n },\n event: 'begin_checkout'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n });\n\n return {\n auth,\n userType,\n facebook,\n google,\n loginCallback,\n quantity,\n items,\n loading,\n pluralize,\n discount,\n total,\n shipping,\n shippingPrice,\n payment,\n fee,\n userValidation,\n userSchema,\n userSubmitButton,\n checkout,\n ifCheckoutReady,\n validate,\n shippingTypesRestricted,\n paymentMethodsRestricted,\n toggleShippingRadio,\n togglePaymentRadio,\n shippingSelected,\n paymentSelected,\n shippingComponentData,\n shippingStoreData,\n resertStore,\n user,\n dontcall,\n comment,\n isCommentToggled,\n commentMaxLength,\n userCheckout,\n thanks,\n order,\n redirect,\n redirectForm,\n home,\n isPromoCodeToggled,\n applyPromoCode,\n promoCode,\n isPromoLoading,\n promoCodeApplied,\n resetPromoCode,\n calculateWithPromoCodeDiscount,\n consent,\n shippingComponent,\n slots,\n isPayed,\n loyalty,\n loyaltyUse,\n loyaltyUseApplied,\n resetLoyaltyUse,\n applyLoyaltyUse,\n readableUserLoyaltyPoints,\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" style=\"position: absolute; left: -1000px; top:-1000px;\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">{{ __('shop.order.checkout_title') }}</div>\n <div class=\"columns\">\n <div class=\"column checkout-blocks-wrapper\">\n <slot name=\"header\"></slot>\n <div class=\"checkout-block is-cart\"><!--items-->\n <div class=\"wrapper\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n {{ __('shop.order.your_order') }}\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>&nbsp;<span v-html=\"__('shop.cart.bysum') + ' ' + $filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"cart\" :items=\"items\">\n <checkout-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\"></checkout-item>\n <cart-trigger class=\"trigger\">\n <template #default=\"props\">\n <button class=\"button\" @click=\"props.open\">\n <svg>\n <use xlink:href=\"#cart-edit\" />\n </svg>\n <span>{{ __('shop.order.edit') }}</span>\n </button>\n </template>\n </cart-trigger>\n </slot>\n <slot name=\"cart-footer\" :total=\"total\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-user auth-user\">\n <div class=\"wrapper\">\n <div class=\"items-title\">{{ __('shop.order.contact_title') }}</div>\n <div class=\"user-tabs\" v-if=\"!auth && isLogin\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" />{{ __('shop.order.auth_new') }}</label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" />{{ __('shop.order.auth_old') }}</label>\n </div>\n <div class=\"columns\">\n <div class=\"column user-form\" v-show=\"userType == 'new'\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"userSchema\" :validation-schema=\"userValidation\" :preventModelCleanupOnSchemaChange=\"true\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n <div class=\"column user-login user-form\" v-show=\"userType == 'login'\" v-if=\"isLogin\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\" v-if=\"isLogin\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">{{ __('shop.order.auth_social') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block is-shipping\">\n <div class=\"wrapper shipping-type-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.shipping') }}</div>\n </div>\n <div class=\"value\" v-if=\"shippingSelected && shippingSelected.nextDates\">\n <div class=\"next-dates\">на {{ shippingSelected.nextDates }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in shippingTypesRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"shipping\" :value=\"item.id\" @click=\"toggleShippingRadio(item.id)\" />\n <img class=\"icon\" :src=\"item.icon\" v-if=\"item.icon\" />\n <svg v-else class=\"icon\">\n <use xlink:href=\"#shipping\" />\n </svg>\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\">\n <span class=\"green\" v-if=\"!item.amount && item.price_label\">{{ item.price_label }}</span>\n <span v-else v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n <div v-if=\"!slots.shippingFooter\">\n <component :is=\"item.component\" v-if=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <slot name=\"shipping-footer\" :shippingTypesRestricted=\"shippingTypesRestricted\" :shipping=\"shipping\" :shippingStoreData=\"shippingStoreData\" :shippingComponentData=\"shippingComponentData\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-payment\" v-if=\"!isPaymentMethodOverSummary\">\n <div class=\"wrapper payment-method-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\" v-bind:class=\"'is-' + item.code\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-4\">\n <div class=\"checkout-block summary\">\n <div class=\"inner payment-method-block\" v-if=\"isPaymentMethodOverSummary\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\" v-bind:class=\"'is-' + item.code\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"divider is-hidden\"></div>\n <div class=\"inner\">\n <div class=\"items-title\">{{ __('shop.order.total') }}</div>\n <div class=\"rows\">\n <div class=\"row products\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> {{ __('shop.cart.bysum') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row discount\" v-if=\"discount\">\n <div class=\"info\">{{ __('shop.order.discount') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row fee\" v-if=\"fee > 0\">\n <div class=\"info\">{{ __('shop.order.fee') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n </div>\n <div class=\"row shipping\" v-if=\"shipping\">\n <div class=\"info\">{{ __('shop.order.shipping_price') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(shippingPrice)\" v-if=\"shippingPrice > 0\"></span>\n <span class=\"green\" v-else-if=\"shippingSelected && shippingSelected.price_label\">{{ shippingSelected.price_label }}</span>\n </div>\n </div>\n <div class=\"row promo\" v-if=\"promoCodeApplied\">\n <div class=\"info\">{{ __('shop.order.promo_code') }}<br><span class=\"green\">{{ promoCode }}</span></div>\n <div class=\"value\">\n <span v-html=\"(promoCodeApplied.type == 'percent' ? promoCodeApplied.amount + '%' : $filters.price(promoCodeApplied.amount))\"></span>\n </div>\n </div>\n <div class=\"row price\">\n <div class=\"info\">{{ __('shop.order.price') }}</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(calculateWithPromoCodeDiscount())\"></span>\n </div>\n </div>\n </div>\n <slot name=\"loyalty\" :loyalty=\"loyalty\"></slot>\n <div class=\"user-loyalty\" v-if=\"userCheckout.loyalty_points > 0\">\n <div class=\"notice\">{{ pluralize(readableUserLoyaltyPoints, __('shop.pluralize.points')) }} в наявності</div>\n <div class=\"user-form is-loyalty-use\">\n <div class=\"control\">\n <input type=\"number\" class=\"input\" placeholder=\"Сума бонусів\" v-model=\"loyaltyUse\" :disabled=\"loyaltyUseApplied\">\n </div>\n <button v-if=\"!loyaltyUseApplied\" class=\"button\" @click=\"applyLoyaltyUse\" :disabled=\"!loyaltyUse || loyaltyUse > userCheckout.loyalty_points\">Використати</button>\n <button v-else class=\"button is-reset\" @click=\"resetLoyaltyUse\">Відмінити</button>\n </div>\n </div>\n <div class=\"checkbox-wrapper nocall\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" />{{ __('shop.order.nocall') }}</label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">{{ __('shop.order.action') }}</button>\n <slot name=\"submit\" :total=\"total\"></slot>\n <div class=\"consent\" v-if=\"isConsent\">\n <div class=\"checkbox-wrapper\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"consent\" />\n <div class=\"label\" v-html=\"__('shop.order.consent')\"></div>\n </label>\n </div>\n </div>\n <div class=\"comment-wrapper is-promo-code\" v-bind:class=\"{ 'is-open': isPromoCodeToggled }\" v-if=\"isPromoCode\">\n <div class=\"toggler\" @click=\"isPromoCodeToggled = !isPromoCodeToggled\">\n <span>{{ __('shop.order.promo_code') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form is-promo-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" placeholder=\" \" v-model=\"promoCode\" :disabled=\"promoCodeApplied\" id=\"promo-code-applied\">\n <label class=\"label\" for=\"promo-code-applied\">{{ __('shop.order.promo.placeholder') }}</label>\n </div>\n <button v-if=\"!promoCodeApplied\" class=\"button\" @click=\"applyPromoCode\" :disabled=\"!promoCode\" v-bind:class=\"{ 'is-loading': isPromoLoading }\">{{ __('shop.order.promo.apply') }}</button>\n <button v-else class=\"button\" @click=\"resetPromoCode\">{{ __('shop.order.promo.reset') }}</button>\n </div>\n </div>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>{{ __('shop.order.comment') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form\">\n <textarea class=\"textarea\" v-model=\"comment\"></textarea>\n <div class=\"chars-count\" v-if=\"comment.length\">{{ commentMaxLength - comment.length }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <slot name=\"thanks\" :order=\"order\" :redirect=\"redirect\" :redirectForm=\"redirectForm\" :home=\"home\" :auth=\"auth\" :filters=\"$filters\">\n <div class=\"title\">\n {{ __('shop.order.order') }}\n <span>№{{ order.id }}</span> {{ isPayed ? __('shop.order.payed') : __('shop.order.success') }}\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">{{ __('shop.order.pay_online') }}</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">{{ __('shop.order.pay_online_go') }}</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">{{ __('shop.order.shipping') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.shipping[0]\" v-html=\"order.shipping[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.shipping[1]\" v-html=\"order.shipping[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.payment[0]\">\n <div class=\"title\">{{ __('shop.order.payment') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.payment[0]\" v-html=\"order.payment[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.payment[1]\" v-html=\"order.payment[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.promoCode\">\n <div class=\"title\">{{ __('shop.order.promo_code') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\">\n <span v-html=\"order.promoCode\" class=\"green\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </slot>\n </div>\n <div v-else-if=\"!redirectOnEmpty\" class=\"checkout-block empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.continue') }}</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch, getCurrentInstance, nextTick, provide, useSlots, onMounted } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize, numberFormat } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPhoneMasked: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n redirectOnEmpty: {\n type: String,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n isTrackAfterSuccessOnlinePurchase: {\n type: Boolean,\n default: false\n }\n },\n name: 'order-checkout',\n setup(props) {\n const slots = useSlots();\n const toast = useToast();\n const store = useStore();\n const loading = ref(false);\n const quantity = computed(() => store.getters['cart/quantity']);\n const items = computed(() => store.getters['cart/items']);\n const total = computed(() => store.getters['cart/total']);\n const auth = computed(() => store.getters['auth/is']);\n const userCheckout = computed(() => store.getters['checkout/user']);\n const ifCheckoutReady = ref(true);\n const redirectForm = ref(null);\n const thanks = ref(false);\n const order = ref(null);\n const consent = ref(false);\n const shippingComponent = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const loyalty = computed(() => {\n const points = items.value.reduce((acc, array) => acc + (array.attributes.loyalty ? array.attributes.loyalty.points * array.quantity : 0), 0);\n\n return {\n points: points,\n name: pluralize(points, __('shop.pluralize.points'))\n };\n });\n\n const loyaltyUse = ref('');\n const loyaltyUseApplied = ref(false);\n const resetLoyaltyUse = () => {\n loyaltyUse.value = 0;\n loyaltyUseApplied.value = false;\n };\n const applyLoyaltyUse = () => {\n if (loyaltyUse.value) {\n loyaltyUseApplied.value = true;\n }\n };\n\n const readableUserLoyaltyPoints = computed(() => {\n return numberFormat(userCheckout.value.loyalty_points - (loyaltyUseApplied.value ? loyaltyUse.value : 0));\n });\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n middle_name: field('middle_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n company_name: field('company_name'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\n };\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n let userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.name') : '',\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.last_name') : '',\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.middle_name') : '',\n },\n phone: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone',\n type: 'phone',\n //placeholder: '(050) 123-45-67'\n },\n registration_number: {\n component: FormText,\n label: __('auth.registration.form.registration_number'),\n model: 'registration_number',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.registration_number') : '',\n },\n company_name: {\n component: FormText,\n label: __('auth.registration.form.company_name'),\n model: 'company_name',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.company_name') : '',\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n };\n\n if (props.isPhoneMasked) {\n userSchemaFields.phone.mask = '(###) ###-##-##';\n }\n\n let userSchemaFieldsFiltered = Object.keys(userSchemaFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userSchemaFields[key];\n }\n\n return obj;\n }, {});\n\n userSchemaFieldsFiltered = props.userFields.reduce((obj, key) => {\n obj[key] = userSchemaFieldsFiltered[key];\n return obj;\n }, {});\n\n const userSchema = ref(userSchemaFieldsFiltered);\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n const userValidationFields = {\n last_name: yup.string().trim().required(__('auth.validation.required')),\n middle_name: yup.string().trim().required(__('auth.validation.required')),\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: props.isPhoneMasked ? yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone')) : yup.string().required(__('auth.validation.phone')),\n email: yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required')),\n registration_number: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().numberFilled();\n }\n }),\n company_name: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().required(__('auth.validation.required'));\n }\n }),\n };\n\n const userValidationFieldsFiltered = Object.keys(userValidationFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userValidationFields[key];\n }\n\n return obj;\n }, {});\n\n const userValidation = yup.object().shape(userValidationFieldsFiltered);\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = async () => {\n if (typeof shippingComponentValid.value == 'function') {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n if (userSubmitButton.value) {\n userSubmitButton.value.click();\n }\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n }\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const initPaymentWidget = (payment, order) => {\n const wayforpay = new Wayforpay();\n\n window.addEventListener('message', (event) => {\n if (event.data == 'WfpWidgetEventClose' || event.data == 'WfpWidgetEventDeclined' || event.data == 'WfpWidgetEventPending') {\n\n }\n\n if (event.data == 'WfpWidgetEventApproved') {\n resetCheckoutForm(order);\n\n isPayed.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => { }\n });\n }\n });\n\n wayforpay.run(payment);\n }\n\n const isPayed = ref(false);\n\n const resetCheckoutForm = (_order) => {\n thanks.value = true;\n order.value = _order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n resertStore();\n }\n\n const checkout = async () => {\n let isShippingComponentFormsValid = typeof shippingComponentValid.value == 'function' ? shippingComponentValid.value() : null;\n\n if (shippingSelected.value && !shippingSelected.value.component) {\n isShippingComponentFormsValid = true;\n }\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n middle_name: user.value.middle_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email,\n user_type: user.value.user_type,\n registration_number: user.value.registration_number,\n company_name: user.value.company_name,\n },\n shipping: {\n id: shipping.value,\n data: data,\n user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n loyalty: loyaltyUse.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n\n return;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n let product = {\n item_name: item.name,\n item_id: item.attributes.code,\n price: item.price,\n quantity: item.quantity\n };\n\n if (item.attributes.brand) {\n product.item_brand = item.attributes.brand;\n }\n\n if (item.attributes.property) {\n product.item_variant = item.attributes.property;\n }\n\n if (item.attributes.categoryFull) {\n if (item.attributes.categoryFull.indexOf('/') !== -1) {\n item.attributes.categoryFull.split('/').forEach((segment, index) => {\n product['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n product.item_category = item.attributes.categoryFull;\n }\n }\n\n if (item.attributes.index) {\n product.index = item.attributes.index;\n }\n\n if (item.attributes.itemListName) {\n product.item_list_name = item.attributes.itemListName;\n }\n\n products.push(product);\n });\n\n\n let object = {\n payment_type: paymentSelected.value.name,\n shipping_tier: shippingSelected.value.name,\n ecommerce: {\n transaction_id: response.data.order.id,\n affiliation: 'main',\n value: parseFloat(total.value),\n shipping: 0,\n currency: 'UAH',\n items: products\n },\n event: 'purchase',\n };\n\n if (user.value.user_type) {\n object.user_type = __('auth.registration.form.user_type_' + user.value.user_type);\n }\n\n if (promoCode.value) {\n object.ecommerce.coupon = promoCode.value;\n }\n\n if (props.isTrackAfterSuccessOnlinePurchase && (response.data.redirect || (response.data.payment_widget_data && window.Wayforpay))) {\n localStorage.setItem('ecommerce', JSON.stringify(object));\n } else {\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n\n nextTick(() => {\n setTimeout(() => {\n redirectForm.value.submit();\n }, 400);\n });\n }\n\n if (response.data.payment_widget_data && window.Wayforpay) {\n initPaymentWidget(JSON.parse(response.data.payment_widget_data), response.data.order);\n } else {\n resetCheckoutForm(response.data.order);\n }\n })\n .catch((e) => {\n toast(__('shop.order.error'), {\n type: 'error'\n });\n\n console.error(e);\n })\n .finally(() => {\n loading.value = false;\n });\n }\n });\n };\n\n const toggleShippingRadio = (id) => {\n if (shipping.value === id) {\n shipping.value = null;\n }\n };\n\n const togglePaymentRadio = (id) => {\n if (payment.value === id) {\n payment.value = null;\n }\n };\n\n const resertStore = () => {\n store.commit('checkout/reset');\n store.commit('cart/clear');\n };\n\n const shippingStoreData = (code, data, isValid) => {\n let d = JSON.parse(JSON.stringify(shippingComponentData.value));\n\n data.isValid = isValid;\n d[code] = data;\n\n store.commit('checkout/shippingData', d);\n };\n\n const home = () => {\n window.location.href = $env.locale.url ? $env.locale.url : '/';\n };\n\n onMounted(() => {\n if (!quantity.value && props.redirectOnEmpty) {\n window.location.href = props.redirectOnEmpty;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n let product = {\n item_name: item.name,\n item_id: item.attributes.code,\n price: parseFloat(item.attributes.price),\n quantity: item.quantity\n };\n\n if (item.attributes.brand) {\n product.item_brand = item.attributes.brand;\n }\n\n if (item.attributes.property) {\n product.item_variant = item.attributes.property;\n }\n\n if (item.attributes.categoryFull) {\n if (item.attributes.categoryFull.indexOf('/') !== -1) {\n item.attributes.categoryFull.split('/').forEach((segment, index) => {\n product['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n product.item_category = item.attributes.categoryFull;\n }\n }\n\n if (item.attributes.index) {\n product.index = item.attributes.index;\n }\n\n if (item.attributes.itemListName) {\n product.item_list_name = item.attributes.itemListName;\n }\n\n products.push(product);\n });\n\n if (products.length) {\n const object = {\n ecommerce: {\n currency: 'UAH',\n items: products,\n value: parseFloat(total.value),\n },\n event: 'begin_checkout'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n });\n\n return {\n auth,\n userType,\n facebook,\n google,\n loginCallback,\n quantity,\n items,\n loading,\n pluralize,\n discount,\n total,\n shipping,\n shippingPrice,\n payment,\n fee,\n userValidation,\n userSchema,\n userSubmitButton,\n checkout,\n ifCheckoutReady,\n validate,\n shippingTypesRestricted,\n paymentMethodsRestricted,\n toggleShippingRadio,\n togglePaymentRadio,\n shippingSelected,\n paymentSelected,\n shippingComponentData,\n shippingStoreData,\n resertStore,\n user,\n dontcall,\n comment,\n isCommentToggled,\n commentMaxLength,\n userCheckout,\n thanks,\n order,\n redirect,\n redirectForm,\n home,\n isPromoCodeToggled,\n applyPromoCode,\n promoCode,\n isPromoLoading,\n promoCodeApplied,\n resetPromoCode,\n calculateWithPromoCodeDiscount,\n consent,\n shippingComponent,\n slots,\n isPayed,\n loyalty,\n loyaltyUse,\n loyaltyUseApplied,\n resetLoyaltyUse,\n applyLoyaltyUse,\n readableUserLoyaltyPoints,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","then","Promise","resolve","f","i","arguments","e","reject","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","href","image","src","_hoisted_10","_hoisted_11","_hoisted_12","code","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","quantity","parseInt","_hoisted_18","innerHTML","price","_hoisted_20","priceOld","amount","percent","sum","_hoisted_24","_hoisted_25","_hoisted_26","index","key","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_31","_hoisted_32","_hoisted_33","second","_hoisted_39","_hoisted_40","_hoisted_41","third","_hoisted_43","_hoisted_44","_hoisted_45","_hoisted_51","_hoisted_52","_hoisted_53","yup","addMethod","string","min","msg","this","test","exclusive","message","__","params","isNaN","markRaw","FormText","FormRadio","SchemaForm","SchemaFormFactory","VeeValidatePlugin","HtmlMessage","template","window","viewedSwiperOptions","slidesPerView","freeMode","slideClass","mousewheel","forceToAxis","navigation","nextEl","prevEl","observer","observeParents","components","CheckoutItem","isLogin","type","Boolean","isPhoneMasked","isPromoCode","isConsent","isPaymentMethodOverSummary","userFields","Array","redirectOnEmpty","String","showPlaceholders","isTrackAfterSuccessOnlinePurchase","slots","useSlots","toast","useToast","store","useStore","loading","ref","getters","items","total","auth","userCheckout","ifCheckoutReady","redirectForm","thanks","order","consent","shippingComponent","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","isPromoCodeToggled","promoCode","promoCodeApplied","isPromoLoading","app","getCurrentInstance","loyalty","points","reduce","acc","array","pluralize","loyaltyUse","loyaltyUseApplied","readableUserLoyaltyPoints","numberFormat","loyalty_points","isUserConsent","dontcall","get","set","commit","comment","watch","substring","field","defaultValue","data","JSON","parse","stringify","provide","user","last_name","middle_name","email","phone","registration_number","company_name","user_type","dispatch","shipping","payment","shippingSelected","find","paymentSelected","shippingPrice","calculatePrice","fee","shippingTypesRestricted","restrictCheck","paymentMethodsRestricted","categoriesInCart","categories","forEach","category_id","push","Math","round","elements","restrictions","keys","ok","r","price_min","price_max","restrictedForce","shipping_type","payment_method","includes","restricted","discount","s","$http","post","location","response","userSchemaFields","component","model","label","list","placeholder","condition","mask","userSchemaFieldsFiltered","obj","userSchema","useSchemaForm","userValidationFields","trim","required","matches","when","numberFilled","userValidationFieldsFiltered","userValidation","object","shape","addEventListener","validate","body","result","shippingComponentValid","isShippingComponentFormsValid","click","isValid","isUserValid","shippingComponentUserData","isPayed","resetCheckoutForm","_order","document","querySelector","classList","add","resertStore","checkout","valid","clientId","shippingUserData","cookie","split","parts","error","products","product","item_name","item_id","brand","item_brand","property","item_variant","categoryFull","segment","item_category","itemListName","item_list_name","payment_type","shipping_tier","ecommerce","transaction_id","affiliation","parseFloat","currency","event","coupon","payment_widget_data","Wayforpay","localStorage","setItem","$env","debug","console","log","dataLayer","url","nextTick","setTimeout","submit","wayforpay","run","initPaymentWidget","onMounted","facebook","$ziggy","provider","google","loginCallback","toggleShippingRadio","togglePaymentRadio","shippingStoreData","d","commentMaxLength","home","locale","applyPromoCode","promoCodeApply","number","appContext","config","globalProperties","$filters","resetPromoCode","calculateWithPromoCodeDiscount","max","resetLoyaltyUse","applyLoyaltyUse","action","style","method","_hoisted_5","_hoisted_6","_hoisted_7","_renderSlot","_hoisted_8","_createCommentVNode","_hoisted_9","_toDisplayString","_createBlock","_createVNode","onClick","open","_hoisted_15","_hoisted_19","_hoisted_21","schemaRowClasses","schema","preventModelCleanupOnSchemaChange","afterForm","_hoisted_22","_hoisted_23","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","nextDates","_hoisted_42","_hoisted_46","icon","_hoisted_49","description","price_label","_hoisted_54","shippingFooter","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_63","_hoisted_65","_hoisted_67","_hoisted_68","_hoisted_70","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_75","_hoisted_76","_hoisted_77","_hoisted_79","_hoisted_81","_hoisted_82","_hoisted_84","_hoisted_85","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_89","_hoisted_91","_hoisted_93","_hoisted_94","_hoisted_95","_hoisted_97","_hoisted_98","_hoisted_99","_hoisted_101","_hoisted_102","_hoisted_103","_hoisted_105","_hoisted_106","_hoisted_107","_hoisted_108","_hoisted_109","_hoisted_110","_hoisted_112","_hoisted_113","_hoisted_114","_hoisted_116","_hoisted_117","_hoisted_118","_hoisted_119","disabled","_hoisted_122","_hoisted_123","_hoisted_124","_hoisted_126","_hoisted_127","_hoisted_128","_hoisted_130","_hoisted_132","_hoisted_133","_hoisted_134","_hoisted_135","filters","_hoisted_136","_hoisted_137","_hoisted_138","_hoisted_139","_hoisted_140","_hoisted_141","_hoisted_142","_hoisted_143","_hoisted_144","_hoisted_147","_hoisted_148","_hoisted_149","_hoisted_152","_hoisted_153","_hoisted_154","_hoisted_155","_hoisted_157","_hoisted_158","_hoisted_159","_hoisted_161"],"mappings":"ksBA0F6BA,kBAAgB,CACzCC,KAAM,eACNC,MAAO,CACHC,KAAMC,QAEVC,eAAMH,OACII,EAAUC,YAAS,kBAAOL,EAAMC,KAAKK,WAAWF,SAAWJ,EAAMC,KAAKK,WAAWF,QAAQG,OAASP,EAAMC,KAAKK,WAAWF,QAAU,YAGjI,CACHI,YAHgBH,YAAS,kBAAOL,EAAMC,KAAKG,SAAWJ,EAAMC,KAAKG,QAAQG,OAASP,EAAMC,KAAKG,QAAQK,QAAO,SAACC,UAAiD,IAAtCN,EAAQO,MAAMC,QAAQF,EAAOG,OAAc,yBC/F5J,yBACI,yBAEJ,wBAEQ,sDAIaC,qBAA0B,oBAAV,4BAI7B,mBACI,oCACI,yBACI,iBACA,6BAIJ,sDACI,2BACA,2CAEJ,6FAQJ,+BACI,oBAGA,oBAEQ,mBACI,yBAEJ,6DAMpB,2BACI,sBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,wDAIrBA,qBAA0B,oBAAV,4BAI7B,yBACI,kBACA,qCAKR,4BACI,uBACPA,kCAAW,gBAAcA,qBAAiC,oBAAjB,4DAIrBA,qBAA0B,oBAAV,6BAI7B,0BACI,kBACA,mDCkVfC,EAAKJ,oBAGXK,QAAQC,QAAQN,MAEXA,EAAMI,sCArBEG,+DAGfC,GAAKC,UAAUD,qDAIbE,kBACQC,gEDxZdC,oDAAW,mDAAmEC,OAAKlB,WAAWmB,YAC1DD,OAAKlB,WAAWmB,sBAAhDF,2BAAAG,GACIZ,2BAAAa,oBAA6BH,gEAEjCV,2BAAAc,GACId,oDAAW,k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,sBAAIU,QAAMX,+CAAgBW,UAAUA,yBAAyBA,iCAEvEV,2BAAAqa,IACmC3Z,WAASsR,mBAAxCvR,2BAAA6Z,IACIta,2BAAAua,qBAAyB7Z,kCACzBV,qCAAc,oBAAqB6U,yCAAOnU,eAAayR,8BAAazR,uDAExED,2BAAA+Z,IACIxa,qCAAc,mBAAoB6U,wCAAOnU,uDAASA,kCAEtDV,2BAAAya,IACoC/Z,QAAMmK,2BAAtCpK,2BAAAia,IACI1a,2BAAA2a,qBAAsBja,gCACtBV,2BAAA4a,IACmCla,QAAMmK,2BAArCpK,wCAAW,cAAuCqB,UAAQpB,QAAMmK,yDACjCnK,QAAMmK,2BAArCpK,wCAAW,cAAuCqB,UAAQpB,QAAMmK,8FAGxCnK,QAAMoK,0BAAtCrK,2BAAAoa,IACI7a,2BAAA8a,qBAAsBpa,+BACtBV,2BAAA+a,IACmCra,QAAMoK,0BAArCrK,wCAAW,cAAsCqB,UAAQpB,QAAMoK,wDAChCpK,QAAMoK,0BAArCrK,wCAAW,cAAsCqB,UAAQpB,QAAMoK,6FAGvCpK,QAAM2H,yBAAtC5H,2BAAAua,IACIhb,2BAAAib,qBAAsBva,kCACtBV,2BAAAkb,IACIlb,2BAAAmb,IACInb,6BAAM8B,UAAQpB,QAAM2H,gBAAiB,sEAQhD3H,iEAAjBD,2BAAA2a,IACIpb,2BAAAqb,qBAAsB3a,4BACtBV,2BAAAsb,wCACO5a,kCACHV,qBAAoF,KAAhFgB,KAAMN,OAAKyS,OAAOnB,IAAMtR,OAAKyS,OAAOnB,2BAActR,mDAA8B,MAAE6a,uCAAS7a,kCAEnGV,gCAAS,kBAAmBgB,KAAMN,OAAKyS,OAAOnB,IAAMtR,OAAKyS,OAAOnB,2BAActR"}
1
+ {"version":3,"file":"Checkout.js","sources":["../../../../src/components/shop/order/CheckoutItem.vue","../../../../src/components/shop/order/CheckoutItem.vue?vue&type=template&id=4d5a1fac&lang.js","../../../../src/components/shop/order/Checkout.vue","../../../../src/components/shop/order/Checkout.vue?vue&type=template&id=7b056e07&lang.js"],"sourcesContent":["<template>\n <div class=\"columns is-multiline shop-cart-item\" v-bind:class=\"{ 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">{{ __('shop.cart.bundle') }}</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <a :href=\"item.attributes.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.href\">{{ item.name }}</a>\n </div>\n </div>\n <div class=\"column is-2 has-text-centered is-relative\">\n <div class=\"quantity\">⨉ {{ item.quantity }}</div>\n <div class=\"quantity-price\" v-if=\"parseInt(item.quantity) > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"__('shop.cart.bundle_amount') + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </div>\n </div>\n <div class=\"options is-toggled\" v-if=\"itemOptions && itemOptions.length\">\n <div class=\"toggler\">\n <span>{{ __('shop.cart.additional') }} {{ itemOptions.length }}</span>\n </div>\n <div class=\"wrapper\">\n <div v-for=\"(option, index) in itemOptions\" v-bind:key=\"index\" class=\"columns is-checked\">\n <div class=\"column\">\n <div class=\"option-title\">{{ option.name }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.second.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">{{ __('shop.cart.code') }} {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.second.href\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.third.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">{{ __('shop.cart.code') }} {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.third.href\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { defineComponent, computed } from 'vue';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'CheckoutItem',\n props: {\n item: Object\n },\n setup(props) {\n const options = computed(() => (props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []));\n const itemOptions = computed(() => (props.item.options && props.item.options.length ? props.item.options.filter((option) => options.value.indexOf(option.id) !== -1) : []));\n\n return {\n itemOptions\n };\n }\n});\n</script>","<template>\n <div class=\"columns is-multiline shop-cart-item\" v-bind:class=\"{ 'is-bundle': item.attributes.bundle }\">\n <div class=\"column is-12\" v-if=\"item.attributes.bundle\">\n <div class=\"bundle-title\">{{ __('shop.cart.bundle') }}</div>\n </div>\n <div class=\"column name\">\n <div class=\"columns\" v-bind:class=\"{ 'mb-0': item.attributes.bundle }\">\n <div class=\"column is-narrow\">\n <a :href=\"item.attributes.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.image }\">\n <img :src=\"item.attributes.image\" v-if=\"item.attributes.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"columns is-gapless mb-0\">\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.code\">{{ __('shop.cart.code') }} {{ item.attributes.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.href\">{{ item.name }}</a>\n </div>\n </div>\n <div class=\"column is-2 has-text-centered is-relative\">\n <div class=\"quantity\">⨉ {{ item.quantity }}</div>\n <div class=\"quantity-price\" v-if=\"parseInt(item.quantity) > 1\"><span v-html=\"$filters.price(item.attributes.price)\"></span> / {{ __('shop.cart.q') }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">\n <div class=\"price\" v-bind:class=\"{ 'bundle-price': item.attributes.bundle }\">\n <div v-if=\"item.attributes.priceOld\" class=\"price-old\" v-html=\"$filters.price(item.attributes.priceOld * item.quantity)\"></div>\n <div class=\"bundle-amount\" v-if=\"item.attributes.bundle && item.attributes.amount\" v-html=\"__('shop.cart.bundle_amount') + (item.attributes.amount.percent ? item.attributes.amount.percent + '%' : $filters.price(item.attributes.amount.sum * item.quantity))\"></div>\n <div v-html=\"$filters.price(item.attributes.price * item.quantity)\"></div>\n </div>\n </div>\n </div>\n <div class=\"options is-toggled\" v-if=\"itemOptions && itemOptions.length\">\n <div class=\"toggler\">\n <span>{{ __('shop.cart.additional') }} {{ itemOptions.length }}</span>\n </div>\n <div class=\"wrapper\">\n <div v-for=\"(option, index) in itemOptions\" v-bind:key=\"index\" class=\"columns is-checked\">\n <div class=\"column\">\n <div class=\"option-title\">{{ option.name }}</div>\n </div>\n <div class=\"column is-2 has-text-right\">+<span v-html=\"$filters.price(option.price)\"></span></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.second.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.second.image }\">\n <img :src=\"item.attributes.second.image\" v-if=\"item.attributes.second.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.second.code\">{{ __('shop.cart.code') }} {{ item.attributes.second.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.second.href\">{{ item.attributes.second.name }}</a>\n </div>\n </div>\n </div>\n <div class=\"bundle columns\" v-if=\"item.attributes.bundle && item.attributes.third\">\n <div class=\"column is-narrow\">\n <svg class=\"bundle-icon\"><use xlink:href=\"#bundle-plus\" /></svg>\n <a :href=\"item.attributes.third.href\">\n <figure class=\"image is-square\" v-bind:class=\"{ 'no-thumb': !item.attributes.third.image }\">\n <img :src=\"item.attributes.third.image\" v-if=\"item.attributes.third.image\" />\n <svg v-else><use xlink:href=\"#logo\" /></svg>\n </figure>\n </a>\n </div>\n <div class=\"column\">\n <div class=\"code\" v-if=\"item.attributes.third.code\">{{ __('shop.cart.code') }} {{ item.attributes.third.code }}</div>\n <div class=\"title\">\n <a :href=\"item.attributes.third.href\">{{ item.attributes.third.name }}</a>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script>\nimport { defineComponent, computed } from 'vue';\n\nexport default /*#__PURE__*/ defineComponent({\n name: 'CheckoutItem',\n props: {\n item: Object\n },\n setup(props) {\n const options = computed(() => (props.item.attributes.options && props.item.attributes.options.length ? props.item.attributes.options : []));\n const itemOptions = computed(() => (props.item.options && props.item.options.length ? props.item.options.filter((option) => options.value.indexOf(option.id) !== -1) : []));\n\n return {\n itemOptions\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" style=\"position: absolute; left: -1000px; top:-1000px;\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">{{ __('shop.order.checkout_title') }}</div>\n <div class=\"columns\">\n <div class=\"column checkout-blocks-wrapper\">\n <slot name=\"header\"></slot>\n <div class=\"checkout-block is-cart\"><!--items-->\n <div class=\"wrapper\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n {{ __('shop.order.your_order') }}\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>&nbsp;<span v-html=\"__('shop.cart.bysum') + ' ' + $filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"cart\" :items=\"items\">\n <checkout-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\"></checkout-item>\n <cart-trigger class=\"trigger\">\n <template #default=\"props\">\n <button class=\"button\" @click=\"props.open\">\n <svg>\n <use xlink:href=\"#cart-edit\" />\n </svg>\n <span>{{ __('shop.order.edit') }}</span>\n </button>\n </template>\n </cart-trigger>\n </slot>\n <slot name=\"cart-footer\" :total=\"total\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-user auth-user\">\n <div class=\"wrapper\">\n <div class=\"items-title\">{{ __('shop.order.contact_title') }}</div>\n <div class=\"user-tabs\" v-if=\"!auth && isLogin\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" />{{ __('shop.order.auth_new') }}</label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" />{{ __('shop.order.auth_old') }}</label>\n </div>\n <div class=\"columns\">\n <div class=\"column user-form\" v-show=\"userType == 'new'\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"userSchema\" :validation-schema=\"userValidation\" :preventModelCleanupOnSchemaChange=\"true\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n <div class=\"column user-login user-form\" v-show=\"userType == 'login'\" v-if=\"isLogin\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\" v-if=\"isLogin\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">{{ __('shop.order.auth_social') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block is-shipping\">\n <div class=\"wrapper shipping-type-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.shipping') }}</div>\n </div>\n <div class=\"value\" v-if=\"shippingSelected && shippingSelected.nextDates\">\n <div class=\"next-dates\">на {{ shippingSelected.nextDates }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in shippingTypesRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"shipping\" :value=\"item.id\" @click=\"toggleShippingRadio(item.id)\" />\n <img class=\"icon\" :src=\"item.icon\" v-if=\"item.icon\" />\n <svg v-else class=\"icon\">\n <use xlink:href=\"#shipping\" />\n </svg>\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\">\n <span class=\"green\" v-if=\"!item.amount && item.price_label\">{{ item.price_label }}</span>\n <span v-else v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n <div v-if=\"!slots.shippingFooter\">\n <component :is=\"item.component\" v-if=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <slot name=\"shipping-footer\" :shippingTypesRestricted=\"shippingTypesRestricted\" :shipping=\"shipping\" :shippingStoreData=\"shippingStoreData\" :shippingComponentData=\"shippingComponentData\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-payment\" v-if=\"!isPaymentMethodOverSummary\">\n <div class=\"wrapper payment-method-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\" v-bind:class=\"'is-' + item.code\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-4\">\n <div class=\"checkout-block summary\">\n <div class=\"inner payment-method-block\" v-if=\"isPaymentMethodOverSummary\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\" v-bind:class=\"'is-' + item.code\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"divider is-hidden\"></div>\n <div class=\"inner\">\n <div class=\"items-title\">{{ __('shop.order.total') }}</div>\n <div class=\"rows\">\n <div class=\"row products\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> {{ __('shop.cart.bysum') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row discount\" v-if=\"discount\">\n <div class=\"info\">{{ __('shop.order.discount') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row fee\" v-if=\"fee > 0\">\n <div class=\"info\">{{ __('shop.order.fee') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n <slot name=\"fee\"></slot>\n </div>\n <div class=\"row shipping\" v-if=\"shipping\">\n <div class=\"info\">{{ __('shop.order.shipping_price') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(shippingPrice)\" v-if=\"shippingPrice > 0\"></span>\n <span class=\"green\" v-else-if=\"shippingSelected && shippingSelected.price_label\">{{ shippingSelected.price_label }}</span>\n </div>\n </div>\n <div class=\"row promo\" v-if=\"promoCodeApplied\">\n <div class=\"info\">{{ __('shop.order.promo_code') }}<br><span class=\"green\">{{ promoCode }}</span></div>\n <div class=\"value\">\n <span v-html=\"(promoCodeApplied.type == 'percent' ? promoCodeApplied.amount + '%' : $filters.price(promoCodeApplied.amount))\"></span>\n </div>\n </div>\n <div class=\"row price\">\n <div class=\"info\">{{ __('shop.order.price') }}</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(calculateWithPromoCodeDiscount())\"></span>\n </div>\n </div>\n </div>\n <slot name=\"loyalty\" :loyalty=\"loyalty\"></slot>\n <div class=\"user-loyalty\" v-if=\"userCheckout.loyalty_points > 0\">\n <div class=\"notice\">{{ pluralize(readableUserLoyaltyPoints, __('shop.pluralize.points')) }} в наявності</div>\n <div class=\"user-form is-loyalty-use\">\n <div class=\"control\">\n <input type=\"number\" class=\"input\" placeholder=\"Сума бонусів\" v-model=\"loyaltyUse\" :disabled=\"loyaltyUseApplied\">\n </div>\n <button v-if=\"!loyaltyUseApplied\" class=\"button\" @click=\"applyLoyaltyUse\" :disabled=\"!loyaltyUse || loyaltyUse > userCheckout.loyalty_points\">Використати</button>\n <button v-else class=\"button is-reset\" @click=\"resetLoyaltyUse\">Відмінити</button>\n </div>\n </div>\n <div class=\"checkbox-wrapper nocall\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" />{{ __('shop.order.nocall') }}</label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">{{ __('shop.order.action') }}</button>\n <slot name=\"submit\" :total=\"total\"></slot>\n <div class=\"consent\" v-if=\"isConsent\">\n <div class=\"checkbox-wrapper\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"consent\" />\n <div class=\"label\" v-html=\"__('shop.order.consent')\"></div>\n </label>\n </div>\n </div>\n <div class=\"comment-wrapper is-promo-code\" v-bind:class=\"{ 'is-open': isPromoCodeToggled }\" v-if=\"isPromoCode\">\n <div class=\"toggler\" @click=\"isPromoCodeToggled = !isPromoCodeToggled\">\n <span>{{ __('shop.order.promo_code') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form is-promo-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" placeholder=\" \" v-model=\"promoCode\" :disabled=\"promoCodeApplied\" id=\"promo-code-applied\">\n <label class=\"label\" for=\"promo-code-applied\">{{ __('shop.order.promo.placeholder') }}</label>\n </div>\n <button v-if=\"!promoCodeApplied\" class=\"button\" @click=\"applyPromoCode\" :disabled=\"!promoCode\" v-bind:class=\"{ 'is-loading': isPromoLoading }\">{{ __('shop.order.promo.apply') }}</button>\n <button v-else class=\"button\" @click=\"resetPromoCode\">{{ __('shop.order.promo.reset') }}</button>\n </div>\n </div>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>{{ __('shop.order.comment') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form\">\n <textarea class=\"textarea\" v-model=\"comment\"></textarea>\n <div class=\"chars-count\" v-if=\"comment.length\">{{ commentMaxLength - comment.length }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <slot name=\"thanks\" :order=\"order\" :redirect=\"redirect\" :redirectForm=\"redirectForm\" :home=\"home\" :auth=\"auth\" :filters=\"$filters\">\n <div class=\"title\">\n {{ __('shop.order.order') }}\n <span>№{{ order.id }}</span> {{ isPayed ? __('shop.order.payed') : __('shop.order.success') }}\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">{{ __('shop.order.pay_online') }}</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">{{ __('shop.order.pay_online_go') }}</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">{{ __('shop.order.shipping') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.shipping[0]\" v-html=\"order.shipping[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.shipping[1]\" v-html=\"order.shipping[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.payment[0]\">\n <div class=\"title\">{{ __('shop.order.payment') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.payment[0]\" v-html=\"order.payment[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.payment[1]\" v-html=\"order.payment[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.promoCode\">\n <div class=\"title\">{{ __('shop.order.promo_code') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\">\n <span v-html=\"order.promoCode\" class=\"green\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </slot>\n </div>\n <div v-else-if=\"!redirectOnEmpty\" class=\"checkout-block empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.continue') }}</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch, getCurrentInstance, nextTick, provide, useSlots, onMounted } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize, numberFormat } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPhoneMasked: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n redirectOnEmpty: {\n type: String,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n isTrackAfterSuccessOnlinePurchase: {\n type: Boolean,\n default: false\n }\n },\n name: 'order-checkout',\n setup(props) {\n const slots = useSlots();\n const toast = useToast();\n const store = useStore();\n const loading = ref(false);\n const quantity = computed(() => store.getters['cart/quantity']);\n const items = computed(() => store.getters['cart/items']);\n const total = computed(() => store.getters['cart/total']);\n const auth = computed(() => store.getters['auth/is']);\n const userCheckout = computed(() => store.getters['checkout/user']);\n const ifCheckoutReady = ref(true);\n const redirectForm = ref(null);\n const thanks = ref(false);\n const order = ref(null);\n const consent = ref(false);\n const shippingComponent = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const loyalty = computed(() => {\n const points = items.value.reduce((acc, array) => acc + (array.attributes.loyalty ? array.attributes.loyalty.points * array.quantity : 0), 0);\n\n return {\n points: points,\n name: pluralize(points, __('shop.pluralize.points'))\n };\n });\n\n const loyaltyUse = ref('');\n const loyaltyUseApplied = ref(false);\n const resetLoyaltyUse = () => {\n loyaltyUse.value = 0;\n loyaltyUseApplied.value = false;\n };\n const applyLoyaltyUse = () => {\n if (loyaltyUse.value) {\n loyaltyUseApplied.value = true;\n }\n };\n\n const readableUserLoyaltyPoints = computed(() => {\n return numberFormat(userCheckout.value.loyalty_points - (loyaltyUseApplied.value ? loyaltyUse.value : 0));\n });\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n middle_name: field('middle_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n company_name: field('company_name'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\n };\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n let userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.name') : '',\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.last_name') : '',\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.middle_name') : '',\n },\n phone: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone',\n type: 'phone',\n //placeholder: '(050) 123-45-67'\n },\n registration_number: {\n component: FormText,\n label: __('auth.registration.form.registration_number'),\n model: 'registration_number',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.registration_number') : '',\n },\n company_name: {\n component: FormText,\n label: __('auth.registration.form.company_name'),\n model: 'company_name',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.company_name') : '',\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n };\n\n if (props.isPhoneMasked) {\n userSchemaFields.phone.mask = '(###) ###-##-##';\n }\n\n let userSchemaFieldsFiltered = Object.keys(userSchemaFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userSchemaFields[key];\n }\n\n return obj;\n }, {});\n\n userSchemaFieldsFiltered = props.userFields.reduce((obj, key) => {\n obj[key] = userSchemaFieldsFiltered[key];\n return obj;\n }, {});\n\n const userSchema = ref(userSchemaFieldsFiltered);\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n const userValidationFields = {\n last_name: yup.string().trim().required(__('auth.validation.required')),\n middle_name: yup.string().trim().required(__('auth.validation.required')),\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: props.isPhoneMasked ? yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone')) : yup.string().required(__('auth.validation.phone')),\n email: yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required')),\n registration_number: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().numberFilled();\n }\n }),\n company_name: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().required(__('auth.validation.required'));\n }\n }),\n };\n\n const userValidationFieldsFiltered = Object.keys(userValidationFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userValidationFields[key];\n }\n\n return obj;\n }, {});\n\n const userValidation = yup.object().shape(userValidationFieldsFiltered);\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = async () => {\n if (typeof shippingComponentValid.value == 'function') {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n if (userSubmitButton.value) {\n userSubmitButton.value.click();\n }\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n }\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const initPaymentWidget = (payment, order) => {\n const wayforpay = new Wayforpay();\n\n window.addEventListener('message', (event) => {\n if (event.data == 'WfpWidgetEventClose' || event.data == 'WfpWidgetEventDeclined' || event.data == 'WfpWidgetEventPending') {\n\n }\n\n if (event.data == 'WfpWidgetEventApproved') {\n resetCheckoutForm(order);\n\n isPayed.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => { }\n });\n }\n });\n\n wayforpay.run(payment);\n }\n\n const isPayed = ref(false);\n\n const resetCheckoutForm = (_order) => {\n thanks.value = true;\n order.value = _order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n resertStore();\n }\n\n const checkout = async () => {\n let isShippingComponentFormsValid = typeof shippingComponentValid.value == 'function' ? shippingComponentValid.value() : null;\n\n if (shippingSelected.value && !shippingSelected.value.component) {\n isShippingComponentFormsValid = true;\n }\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n middle_name: user.value.middle_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email,\n user_type: user.value.user_type,\n registration_number: user.value.registration_number,\n company_name: user.value.company_name,\n },\n shipping: {\n id: shipping.value,\n data: data,\n user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n loyalty: loyaltyUse.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n\n return;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n let product = {\n item_name: item.name,\n item_id: item.attributes.code,\n price: item.price,\n quantity: item.quantity\n };\n\n if (item.attributes.brand) {\n product.item_brand = item.attributes.brand;\n }\n\n if (item.attributes.property) {\n product.item_variant = item.attributes.property;\n }\n\n if (item.attributes.categoryFull) {\n if (item.attributes.categoryFull.indexOf('/') !== -1) {\n item.attributes.categoryFull.split('/').forEach((segment, index) => {\n product['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n product.item_category = item.attributes.categoryFull;\n }\n }\n\n if (item.attributes.index) {\n product.index = item.attributes.index;\n }\n\n if (item.attributes.itemListName) {\n product.item_list_name = item.attributes.itemListName;\n }\n\n products.push(product);\n });\n\n\n let object = {\n payment_type: paymentSelected.value.name,\n shipping_tier: shippingSelected.value.name,\n ecommerce: {\n transaction_id: response.data.order.id,\n affiliation: 'main',\n value: parseFloat(total.value),\n shipping: 0,\n currency: 'UAH',\n items: products\n },\n event: 'purchase',\n };\n\n if (user.value.user_type) {\n object.user_type = __('auth.registration.form.user_type_' + user.value.user_type);\n }\n\n if (promoCode.value) {\n object.ecommerce.coupon = promoCode.value;\n }\n\n if (props.isTrackAfterSuccessOnlinePurchase && (response.data.redirect || (response.data.payment_widget_data && window.Wayforpay))) {\n localStorage.setItem('ecommerce', JSON.stringify(object));\n } else {\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n\n nextTick(() => {\n setTimeout(() => {\n redirectForm.value.submit();\n }, 400);\n });\n }\n\n if (response.data.payment_widget_data && window.Wayforpay) {\n initPaymentWidget(JSON.parse(response.data.payment_widget_data), response.data.order);\n } else {\n resetCheckoutForm(response.data.order);\n }\n })\n .catch((e) => {\n toast(__('shop.order.error'), {\n type: 'error'\n });\n\n console.error(e);\n })\n .finally(() => {\n loading.value = false;\n });\n }\n });\n };\n\n const toggleShippingRadio = (id) => {\n if (shipping.value === id) {\n shipping.value = null;\n }\n };\n\n const togglePaymentRadio = (id) => {\n if (payment.value === id) {\n payment.value = null;\n }\n };\n\n const resertStore = () => {\n store.commit('checkout/reset');\n store.commit('cart/clear');\n };\n\n const shippingStoreData = (code, data, isValid) => {\n let d = JSON.parse(JSON.stringify(shippingComponentData.value));\n\n data.isValid = isValid;\n d[code] = data;\n\n store.commit('checkout/shippingData', d);\n };\n\n const home = () => {\n window.location.href = $env.locale.url ? $env.locale.url : '/';\n };\n\n onMounted(() => {\n if (!quantity.value && props.redirectOnEmpty) {\n window.location.href = props.redirectOnEmpty;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n let product = {\n item_name: item.name,\n item_id: item.attributes.code,\n price: parseFloat(item.attributes.price),\n quantity: item.quantity\n };\n\n if (item.attributes.brand) {\n product.item_brand = item.attributes.brand;\n }\n\n if (item.attributes.property) {\n product.item_variant = item.attributes.property;\n }\n\n if (item.attributes.categoryFull) {\n if (item.attributes.categoryFull.indexOf('/') !== -1) {\n item.attributes.categoryFull.split('/').forEach((segment, index) => {\n product['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n product.item_category = item.attributes.categoryFull;\n }\n }\n\n if (item.attributes.index) {\n product.index = item.attributes.index;\n }\n\n if (item.attributes.itemListName) {\n product.item_list_name = item.attributes.itemListName;\n }\n\n products.push(product);\n });\n\n if (products.length) {\n const object = {\n ecommerce: {\n currency: 'UAH',\n items: products,\n value: parseFloat(total.value),\n },\n event: 'begin_checkout'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n });\n\n return {\n auth,\n userType,\n facebook,\n google,\n loginCallback,\n quantity,\n items,\n loading,\n pluralize,\n discount,\n total,\n shipping,\n shippingPrice,\n payment,\n fee,\n userValidation,\n userSchema,\n userSubmitButton,\n checkout,\n ifCheckoutReady,\n validate,\n shippingTypesRestricted,\n paymentMethodsRestricted,\n toggleShippingRadio,\n togglePaymentRadio,\n shippingSelected,\n paymentSelected,\n shippingComponentData,\n shippingStoreData,\n resertStore,\n user,\n dontcall,\n comment,\n isCommentToggled,\n commentMaxLength,\n userCheckout,\n thanks,\n order,\n redirect,\n redirectForm,\n home,\n isPromoCodeToggled,\n applyPromoCode,\n promoCode,\n isPromoLoading,\n promoCodeApplied,\n resetPromoCode,\n calculateWithPromoCodeDiscount,\n consent,\n shippingComponent,\n slots,\n isPayed,\n loyalty,\n loyaltyUse,\n loyaltyUseApplied,\n resetLoyaltyUse,\n applyLoyaltyUse,\n readableUserLoyaltyPoints,\n };\n }\n});\n</script>","<template>\n <div class=\"cart checkout\">\n <form ref=\"redirectForm\" v-if=\"redirect.url\" :action=\"redirect.url\" style=\"position: absolute; left: -1000px; top:-1000px;\" method=\"post\">\n <input type=\"hidden\" :name=\"name\" :value=\"value\" v-for=\"(value, name, index) in redirect.data\" v-bind:key=\"index\" />\n </form>\n\n <div class=\"items-wrapper\" v-if=\"items.length && !thanks\">\n <div class=\"checkout-title\">{{ __('shop.order.checkout_title') }}</div>\n <div class=\"columns\">\n <div class=\"column checkout-blocks-wrapper\">\n <slot name=\"header\"></slot>\n <div class=\"checkout-block is-cart\"><!--items-->\n <div class=\"wrapper\">\n <div class=\"title-row\">\n <div class=\"items-title\">\n {{ __('shop.order.your_order') }}\n <span class=\"ml-3\" v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span>&nbsp;<span v-html=\"__('shop.cart.bysum') + ' ' + $filters.price(total)\"></span>\n </div>\n </div>\n <slot name=\"cart\" :items=\"items\">\n <checkout-item v-for=\"item in items\" v-bind:key=\"item.id\" :item=\"item\"></checkout-item>\n <cart-trigger class=\"trigger\">\n <template #default=\"props\">\n <button class=\"button\" @click=\"props.open\">\n <svg>\n <use xlink:href=\"#cart-edit\" />\n </svg>\n <span>{{ __('shop.order.edit') }}</span>\n </button>\n </template>\n </cart-trigger>\n </slot>\n <slot name=\"cart-footer\" :total=\"total\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-user auth-user\">\n <div class=\"wrapper\">\n <div class=\"items-title\">{{ __('shop.order.contact_title') }}</div>\n <div class=\"user-tabs\" v-if=\"!auth && isLogin\">\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"new\" />{{ __('shop.order.auth_new') }}</label>\n <label> <input type=\"radio\" class=\"radio\" v-model=\"userType\" value=\"login\" />{{ __('shop.order.auth_old') }}</label>\n </div>\n <div class=\"columns\">\n <div class=\"column user-form\" v-show=\"userType == 'new'\">\n <SchemaForm schemaRowClasses=\"field\" :schema=\"userSchema\" :validation-schema=\"userValidation\" :preventModelCleanupOnSchemaChange=\"true\">\n <template #afterForm>\n <button type=\"submit\" ref=\"userSubmitButton\" class=\"is-hidden\"></button>\n </template>\n </SchemaForm>\n </div>\n <div class=\"column user-login user-form\" v-show=\"userType == 'login'\" v-if=\"isLogin\">\n <login :login-callback=\"loginCallback\"></login>\n </div>\n <div class=\"column\" v-if=\"isLogin\">\n <div class=\"social-auth\" v-if=\"!auth\">\n <div class=\"socials\">\n <div class=\"description\">{{ __('shop.order.auth_social') }}</div>\n <div class=\"buttons\">\n <a class=\"button\" @click=\"facebook\">\n <svg class=\"icon fb-btn\">\n <use xlink:href=\"#logo-facebook-icon\" />\n </svg>\n <span>Facebook</span>\n </a>\n <a class=\"button\" @click=\"google\">\n <svg class=\"icon google-btn\">\n <use xlink:href=\"#logo-google-icon\" />\n </svg>\n <span>Google</span>\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block is-shipping\">\n <div class=\"wrapper shipping-type-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.shipping') }}</div>\n </div>\n <div class=\"value\" v-if=\"shippingSelected && shippingSelected.nextDates\">\n <div class=\"next-dates\">на {{ shippingSelected.nextDates }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"shipping = null\" class=\"reset\" v-bind:class=\"{ 'is-active': shipping }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in shippingTypesRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"shipping\" :value=\"item.id\" @click=\"toggleShippingRadio(item.id)\" />\n <img class=\"icon\" :src=\"item.icon\" v-if=\"item.icon\" />\n <svg v-else class=\"icon\">\n <use xlink:href=\"#shipping\" />\n </svg>\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\">\n <span class=\"green\" v-if=\"!item.amount && item.price_label\">{{ item.price_label }}</span>\n <span v-else v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n <div v-if=\"!slots.shippingFooter\">\n <component :is=\"item.component\" v-if=\"item.component && item.id == shipping\" :commit=\"shippingStoreData\" :data=\"shippingComponentData\" :item=\"item\"></component>\n </div>\n </div>\n </div>\n <slot name=\"shipping-footer\" :shippingTypesRestricted=\"shippingTypesRestricted\" :shipping=\"shipping\" :shippingStoreData=\"shippingStoreData\" :shippingComponentData=\"shippingComponentData\"></slot>\n </div>\n </div>\n <div class=\"checkout-block is-payment\" v-if=\"!isPaymentMethodOverSummary\">\n <div class=\"wrapper payment-method-block\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\" v-bind:class=\"'is-' + item.code\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"column is-4\">\n <div class=\"checkout-block summary\">\n <div class=\"inner payment-method-block\" v-if=\"isPaymentMethodOverSummary\">\n <div class=\"rows\">\n <div class=\"item\">\n <div class=\"row\">\n <div class=\"info\">\n <div class=\"items-title mb-1\">{{ __('shop.order.payment') }}</div>\n </div>\n <div class=\"value\" v-if=\"1 != 1\">\n <a @click=\"payment = null\" class=\"reset\" v-bind:class=\"{ 'is-active': payment }\">{{ __('shop.order.reset') }}</a>\n </div>\n </div>\n </div>\n <div class=\"item\" v-for=\"item in paymentMethodsRestricted\" v-bind:key=\"item.id\" v-bind:class=\"{ 'is-disabled': item.restricted }\">\n <div class=\"row no-icon\" v-bind:class=\"'is-' + item.code\">\n <div class=\"info\">\n <label>\n <input type=\"radio\" class=\"radio\" v-model=\"payment\" :value=\"item.id\" @click=\"togglePaymentRadio(item.id)\" />\n <span>{{ item.name }}</span>\n </label>\n <div class=\"description\" v-if=\"item.description\">{{ item.description }}</div>\n </div>\n <div class=\"value\" v-if=\"item.amount\">\n <span v-html=\"item.type == 'percent' ? item.amount + '%' : $filters.price(item.amount)\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"divider is-hidden\"></div>\n <div class=\"inner\">\n <div class=\"items-title\">{{ __('shop.order.total') }}</div>\n <div class=\"rows\">\n <div class=\"row products\">\n <div class=\"info\"><span v-text=\"pluralize(quantity, __('shop.pluralize.products'))\"></span> {{ __('shop.cart.bysum') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(total)\"></span>\n </div>\n </div>\n <div class=\"row discount\" v-if=\"discount\">\n <div class=\"info\">{{ __('shop.order.discount') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(discount)\"></span>\n </div>\n </div>\n <div class=\"row fee\" v-if=\"fee > 0\">\n <div class=\"info\">{{ __('shop.order.fee') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(fee)\"></span>\n </div>\n <slot name=\"fee\"></slot>\n </div>\n <div class=\"row shipping\" v-if=\"shipping\">\n <div class=\"info\">{{ __('shop.order.shipping_price') }}</div>\n <div class=\"value\">\n <span v-html=\"$filters.price(shippingPrice)\" v-if=\"shippingPrice > 0\"></span>\n <span class=\"green\" v-else-if=\"shippingSelected && shippingSelected.price_label\">{{ shippingSelected.price_label }}</span>\n </div>\n </div>\n <div class=\"row promo\" v-if=\"promoCodeApplied\">\n <div class=\"info\">{{ __('shop.order.promo_code') }}<br><span class=\"green\">{{ promoCode }}</span></div>\n <div class=\"value\">\n <span v-html=\"(promoCodeApplied.type == 'percent' ? promoCodeApplied.amount + '%' : $filters.price(promoCodeApplied.amount))\"></span>\n </div>\n </div>\n <div class=\"row price\">\n <div class=\"info\">{{ __('shop.order.price') }}</div>\n <div class=\"value orange\">\n <span v-html=\"$filters.price(calculateWithPromoCodeDiscount())\"></span>\n </div>\n </div>\n </div>\n <slot name=\"loyalty\" :loyalty=\"loyalty\"></slot>\n <div class=\"user-loyalty\" v-if=\"userCheckout.loyalty_points > 0\">\n <div class=\"notice\">{{ pluralize(readableUserLoyaltyPoints, __('shop.pluralize.points')) }} в наявності</div>\n <div class=\"user-form is-loyalty-use\">\n <div class=\"control\">\n <input type=\"number\" class=\"input\" placeholder=\"Сума бонусів\" v-model=\"loyaltyUse\" :disabled=\"loyaltyUseApplied\">\n </div>\n <button v-if=\"!loyaltyUseApplied\" class=\"button\" @click=\"applyLoyaltyUse\" :disabled=\"!loyaltyUse || loyaltyUse > userCheckout.loyalty_points\">Використати</button>\n <button v-else class=\"button is-reset\" @click=\"resetLoyaltyUse\">Відмінити</button>\n </div>\n </div>\n <div class=\"checkbox-wrapper nocall\">\n <label> <input type=\"checkbox\" class=\"checkbox\" v-model=\"dontcall\" />{{ __('shop.order.nocall') }}</label>\n </div>\n <button class=\"button submit\" @click=\"checkout\" v-bind:class=\"{ red: !ifCheckoutReady, 'is-loading': loading }\">{{ __('shop.order.action') }}</button>\n <slot name=\"submit\" :total=\"total\"></slot>\n <div class=\"consent\" v-if=\"isConsent\">\n <div class=\"checkbox-wrapper\">\n <label>\n <input type=\"checkbox\" class=\"checkbox\" v-model=\"consent\" />\n <div class=\"label\" v-html=\"__('shop.order.consent')\"></div>\n </label>\n </div>\n </div>\n <div class=\"comment-wrapper is-promo-code\" v-bind:class=\"{ 'is-open': isPromoCodeToggled }\" v-if=\"isPromoCode\">\n <div class=\"toggler\" @click=\"isPromoCodeToggled = !isPromoCodeToggled\">\n <span>{{ __('shop.order.promo_code') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form is-promo-code\">\n <div class=\"control\">\n <input type=\"text\" class=\"input\" placeholder=\" \" v-model=\"promoCode\" :disabled=\"promoCodeApplied\" id=\"promo-code-applied\">\n <label class=\"label\" for=\"promo-code-applied\">{{ __('shop.order.promo.placeholder') }}</label>\n </div>\n <button v-if=\"!promoCodeApplied\" class=\"button\" @click=\"applyPromoCode\" :disabled=\"!promoCode\" v-bind:class=\"{ 'is-loading': isPromoLoading }\">{{ __('shop.order.promo.apply') }}</button>\n <button v-else class=\"button\" @click=\"resetPromoCode\">{{ __('shop.order.promo.reset') }}</button>\n </div>\n </div>\n <div class=\"comment-wrapper\" v-bind:class=\"{ 'is-open': isCommentToggled }\">\n <div class=\"toggler\" @click=\"isCommentToggled = !isCommentToggled\">\n <span>{{ __('shop.order.comment') }}</span>\n <svg>\n <use xlink:href=\"#arrow-down\" />\n </svg>\n </div>\n <div class=\"user-form\">\n <textarea class=\"textarea\" v-model=\"comment\"></textarea>\n <div class=\"chars-count\" v-if=\"comment.length\">{{ commentMaxLength - comment.length }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div class=\"checkout-block thanks\" v-else-if=\"thanks && order\">\n <slot name=\"thanks\" :order=\"order\" :redirect=\"redirect\" :redirectForm=\"redirectForm\" :home=\"home\" :auth=\"auth\" :filters=\"$filters\">\n <div class=\"title\">\n {{ __('shop.order.order') }}\n <span>№{{ order.id }}</span> {{ isPayed ? __('shop.order.payed') : __('shop.order.success') }}\n </div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"redirect.url\">\n <div class=\"subtitle\">{{ __('shop.order.pay_online') }}</div>\n <button class=\"button is-payment\" @click=\"redirectForm.submit()\">{{ __('shop.order.pay_online_go') }}</button>\n </div>\n <div class=\"column is-6\" v-else>\n <button class=\"button is-orange\" @click=\"home\">{{ __('shop.cart.continue') }}</button>\n </div>\n <div class=\"column is-6\">\n <div class=\"info-wrapper\" v-if=\"order.shipping[0]\">\n <div class=\"title\">{{ __('shop.order.shipping') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.shipping[0]\" v-html=\"order.shipping[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.shipping[1]\" v-html=\"order.shipping[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.payment[0]\">\n <div class=\"title\">{{ __('shop.order.payment') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\" v-if=\"order.payment[0]\" v-html=\"order.payment[0]\"></div>\n <div class=\"column is-6\" v-if=\"order.payment[1]\" v-html=\"order.payment[1]\"></div>\n </div>\n </div>\n <div class=\"info-wrapper\" v-if=\"order.promoCode\">\n <div class=\"title\">{{ __('shop.order.promo_code') }}</div>\n <div class=\"columns\">\n <div class=\"column is-6\">\n <span v-html=\"order.promoCode\" class=\"green\"></span>\n </div>\n </div>\n </div>\n </div>\n </div>\n </slot>\n </div>\n <div v-else-if=\"!redirectOnEmpty\" class=\"checkout-block empty\">\n <div class=\"title\">{{ __('shop.cart.no_no') }}</div>\n <div class=\"message\">\n {{ __('shop.cart.no_prop') }}\n <a :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.no_home') }}</a>, <br />{{ __('shop.cart.no_search') }}\n </div>\n <a class=\"button continue\" :href=\"$env.locale.url ? $env.locale.url : '/'\">{{ __('shop.cart.continue') }}</a>\n </div>\n </div>\n</template>\n\n<script>\nimport { ref, computed, markRaw, defineComponent, watch, getCurrentInstance, nextTick, provide, useSlots, onMounted } from 'vue';\nimport CheckoutItem from './CheckoutItem.vue';\nimport { pluralize, numberFormat } from '@perevorot/shop/dist/helpers';\nimport { useStore } from 'vuex';\nimport { SchemaFormFactory, useSchemaForm } from 'formvuelate';\nimport VeeValidatePlugin from '@formvuelate/plugin-vee-validate';\nimport FormText from '@perevorot/shop/dist/forms/FormText';\nimport FormRadio from '@perevorot/shop/dist/forms/FormRadio';\nimport * as yup from 'yup';\nimport { useToast } from 'vue-toastification';\n\nyup.addMethod(yup.string, 'numberFilled', function (min, msg) {\n return this.test({\n name: 'numberFilled',\n exclusive: true,\n message: __('auth.validation.number'),\n params: {\n min: min,\n },\n test: (value) => !(value == '' || isNaN(value)),\n });\n});\n\nmarkRaw(FormText);\nmarkRaw(FormRadio);\n\nconst SchemaForm = SchemaFormFactory([VeeValidatePlugin({})]);\n\nconst HtmlMessage = {\n props: {\n message: '',\n },\n template: '<div v-html=\"message\"></div>',\n};\n\nwindow.viewedSwiperOptions = {\n slidesPerView: 'auto',\n freeMode: true,\n slideClass: 'product',\n mousewheel: {\n forceToAxis: true\n },\n navigation: {\n nextEl: '.next',\n prevEl: '.prev'\n },\n observer: true,\n observeParents: true\n};\n\nexport default /*#__PURE__*/ defineComponent({\n components: {\n CheckoutItem,\n SchemaForm\n },\n props: {\n isLogin: {\n type: Boolean,\n default: true\n },\n isPhoneMasked: {\n type: Boolean,\n default: true\n },\n isPromoCode: {\n type: Boolean,\n default: true\n },\n isConsent: {\n type: Boolean,\n default: false\n },\n isPaymentMethodOverSummary: {\n type: Boolean,\n default: false\n },\n userFields: {\n type: Array,\n default: ['last_name', 'name', 'email', 'phone'],\n },\n redirectOnEmpty: {\n type: String,\n default: false\n },\n showPlaceholders: {\n type: Boolean,\n default: false\n },\n isTrackAfterSuccessOnlinePurchase: {\n type: Boolean,\n default: false\n }\n },\n name: 'order-checkout',\n setup(props) {\n const slots = useSlots();\n const toast = useToast();\n const store = useStore();\n const loading = ref(false);\n const quantity = computed(() => store.getters['cart/quantity']);\n const items = computed(() => store.getters['cart/items']);\n const total = computed(() => store.getters['cart/total']);\n const auth = computed(() => store.getters['auth/is']);\n const userCheckout = computed(() => store.getters['checkout/user']);\n const ifCheckoutReady = ref(true);\n const redirectForm = ref(null);\n const thanks = ref(false);\n const order = ref(null);\n const consent = ref(false);\n const shippingComponent = ref(null);\n\n const redirect = ref({});\n\n const shippingTypes = ref([]);\n const paymentMethods = ref([]);\n\n const userType = ref('new');\n const userSubmitButton = ref(null);\n\n const shippingComponentData = computed(() => store.getters['checkout/shippingData']);\n const isCommentToggled = ref(false);\n const commentMaxLength = 1000;\n\n const isPromoCodeToggled = ref(false);\n const promoCode = ref('');\n const promoCodeApplied = ref(null);\n const isPromoLoading = ref(false);\n const app = getCurrentInstance();\n\n const loyalty = computed(() => {\n const points = items.value.reduce((acc, array) => acc + (array.attributes.loyalty ? array.attributes.loyalty.points * array.quantity : 0), 0);\n\n return {\n points: points,\n name: pluralize(points, __('shop.pluralize.points'))\n };\n });\n\n const loyaltyUse = ref('');\n const loyaltyUseApplied = ref(false);\n const resetLoyaltyUse = () => {\n loyaltyUse.value = 0;\n loyaltyUseApplied.value = false;\n };\n const applyLoyaltyUse = () => {\n if (loyaltyUse.value) {\n loyaltyUseApplied.value = true;\n }\n };\n\n const readableUserLoyaltyPoints = computed(() => {\n return numberFormat(userCheckout.value.loyalty_points - (loyaltyUseApplied.value ? loyaltyUse.value : 0));\n });\n\n const resetPromoCode = () => {\n promoCode.value = '';\n promoCodeApplied.value = null;\n };\n\n const isUserConsent = computed(() => {\n return (props.isConsent && consent.value) || !props.isConsent;\n });\n\n const applyPromoCode = () => {\n if (promoCode.value) {\n isPromoLoading.value = true;\n\n $http\n .post(window.location.href, {\n promoCodeApply: promoCode.value,\n email: user.value.email,\n total: total.value\n })\n .then(response => {\n promoCodeApplied.value = response.data;\n }).catch(error => {\n if (error.response && error.response.data.length) {\n error.response.data.forEach(error => {\n const component = {\n component: HtmlMessage,\n props: {\n message: __('shop.order.promo.error_' + error.error, { number: app.appContext.config.globalProperties.$filters.price(error.number) }),\n },\n };\n\n toast(component, {\n type: 'error'\n });\n\n if (error.error == 'not_found') {\n promoCode.value = '';\n }\n });\n\n promoCodeApplied.value = null;\n }\n }).finally(() => {\n isPromoLoading.value = false;\n });\n }\n };\n\n const dontcall = computed({\n get() {\n return store.getters['checkout/dontcall'];\n },\n set(value) {\n store.commit('checkout/dontcall', value);\n }\n });\n\n const comment = computed({\n get() {\n const comment = store.getters['checkout/comment'];\n\n if (!!comment) {\n isCommentToggled.value = true;\n }\n\n return comment;\n },\n set(value) {\n store.commit('checkout/comment', value);\n }\n });\n\n watch(comment, (value) => {\n if (value.length > commentMaxLength) {\n comment.value = comment.value.substring(0, commentMaxLength);\n }\n });\n\n const field = (name, defaultValue) => {\n return computed({\n get() {\n return userCheckout.value[name] ? userCheckout.value[name] : defaultValue;\n },\n set(value) {\n let data = JSON.parse(JSON.stringify(userCheckout.value));\n data[name] = value;\n\n store.commit('checkout/user', data);\n }\n });\n };\n\n provide('field', field);\n\n const user = ref({\n last_name: field('last_name'),\n middle_name: field('middle_name'),\n name: field('name'),\n email: field('email'),\n phone: field('phone'),\n registration_number: field('registration_number'),\n company_name: field('company_name'),\n user_type: field('user_type', 'individual'),\n });\n\n provide('user', user);\n\n store.dispatch('auth/me', {\n finally: () => { }\n });\n\n const calculateWithPromoCodeDiscount = () => {\n const sum = total.value + fee.value + shippingPrice.value;\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'percent') {\n return Math.round(sum - sum * promoCodeApplied.value.amount / 100);\n }\n\n if (promoCodeApplied.value && promoCodeApplied.value.type == 'discount') {\n return Math.max(0, sum - promoCodeApplied.value.amount);\n }\n\n return sum;\n };\n\n const shipping = computed({\n get() {\n return store.getters['checkout/shipping'];\n },\n set(id) {\n store.commit('checkout/shipping', id);\n }\n });\n\n const payment = computed({\n get() {\n return store.getters['checkout/payment'];\n },\n set(id) {\n store.commit('checkout/payment', id);\n }\n });\n\n const shippingSelected = computed(() => {\n return shipping.value ? shippingTypes.value.find((item) => item.id == shipping.value) : {};\n });\n\n const paymentSelected = computed(() => {\n return payment.value ? paymentMethods.value.find((item) => item.id == payment.value) : {};\n });\n\n const shippingPrice = computed(() => {\n return calculatePrice(shippingTypes.value, shipping.value);\n });\n\n const fee = computed(() => {\n return calculatePrice(paymentMethods.value, payment.value);\n });\n\n const shippingTypesRestricted = computed(() => {\n return restrictCheck(shippingTypes.value);\n });\n\n const paymentMethodsRestricted = computed(() => {\n return restrictCheck(paymentMethods.value);\n });\n\n const categoriesInCart = computed(() => {\n let categories = [];\n\n items.value.forEach((item) => {\n if (categories.indexOf(item.category_id) === -1) {\n categories.push(item.category_id);\n }\n });\n\n return categories;\n });\n\n const calculatePrice = (items, value) => {\n let price = 0;\n\n if (value) {\n const item = items.find((item) => item.id == value);\n\n if (item) {\n if (item.type == 'sum') {\n price = item.amount;\n } else {\n price = Math.round((total.value * item.amount) / 100);\n }\n }\n }\n\n return price;\n };\n\n const restrictCheck = (elements) => {\n let items = [];\n\n elements.forEach((item) => {\n if (item.restrictions && Object.keys(item.restrictions).length) {\n let ok = true;\n\n const r = item.restrictions;\n\n if (r.price_min && r.price_max) {\n ok = total.value >= r.price_min && total.value <= r.price_max;\n item.restrictedForce = !ok;\n } else if (r.price_min) {\n ok = total.value >= r.price_min;\n item.restrictedForce = !ok;\n } else if (r.price_max) {\n ok = total.value <= r.price_max;\n item.restrictedForce = !ok;\n }\n\n if (ok && shipping.value) {\n if (r.shipping_type && r.shipping_type.length) {\n ok = r.shipping_type.indexOf(shipping.value) !== -1;\n }\n }\n\n if (ok && payment.value) {\n if (r.payment_method && r.payment_method.length) {\n ok = r.payment_method.indexOf(payment.value) !== -1;\n }\n }\n\n if (ok && r.categories && r.categories.length) {\n ok = !categoriesInCart.value.filter((value) => !r.categories.includes(value)).length;\n item.restrictedForce = !ok;\n }\n\n if (ok && r.code === 'user_type') {\n ok = r.value === user.value.user_type;\n item.restrictedForce = !ok;\n }\n\n item.restricted = !ok;\n } else {\n item.restricted = false;\n }\n\n if (!item.restrictedForce) {\n items.push(item);\n }\n });\n\n return items;\n };\n\n const discount = computed(() => {\n let sum = 0;\n\n items.value.forEach((item) => {\n let s = 0;\n\n if (item.attributes.priceOld) {\n s = item.attributes.priceOld - item.attributes.price;\n }\n\n sum += s * item.quantity;\n });\n\n return sum;\n });\n\n const facebook = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'facebook'\n });\n };\n\n const google = () => {\n window.location.href = $ziggy('auth.login.social', {\n provider: 'google'\n });\n };\n\n const loginCallback = () => {\n userType.value = 'new';\n };\n\n $http.post(window.location.href).then((response) => {\n shippingTypes.value = response.data.shipping;\n paymentMethods.value = response.data.payment;\n });\n\n watch(userType, (value) => {\n if (value == 'login') {\n store.commit('auth/modal', 'login');\n }\n });\n\n let userSchemaFields = {\n user_type: {\n component: FormRadio,\n model: 'user_type',\n label: '',\n list: [\n { code: 'individual', value: __('auth.registration.form.user_type_individual') },\n { code: 'legal', value: __('auth.registration.form.user_type_legal') }\n ],\n },\n name: {\n component: FormText,\n label: __('auth.registration.form.name'),\n model: 'first_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.name') : '',\n },\n last_name: {\n component: FormText,\n label: __('auth.registration.form.last_name'),\n model: 'last_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.last_name') : '',\n },\n middle_name: {\n component: FormText,\n label: __('auth.registration.form.middle_name'),\n model: 'middle_name',\n placeholder: props.showPlaceholders ? __('auth.registration.form.middle_name') : '',\n },\n phone: {\n component: FormText,\n label: __('auth.registration.form.phone'),\n model: 'phone',\n type: 'phone',\n //placeholder: '(050) 123-45-67'\n },\n registration_number: {\n component: FormText,\n label: __('auth.registration.form.registration_number'),\n model: 'registration_number',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.registration_number') : '',\n },\n company_name: {\n component: FormText,\n label: __('auth.registration.form.company_name'),\n model: 'company_name',\n condition: (model) => model.user_type === 'legal',\n placeholder: props.showPlaceholders ? __('auth.registration.form.company_name') : '',\n },\n email: {\n component: FormText,\n label: __('auth.login.form.email'),\n model: 'email',\n placeholder: props.showPlaceholders ? __('auth.login.form.email') : '',\n },\n };\n\n if (props.isPhoneMasked) {\n userSchemaFields.phone.mask = '(###) ###-##-##';\n }\n\n let userSchemaFieldsFiltered = Object.keys(userSchemaFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userSchemaFields[key];\n }\n\n return obj;\n }, {});\n\n userSchemaFieldsFiltered = props.userFields.reduce((obj, key) => {\n obj[key] = userSchemaFieldsFiltered[key];\n return obj;\n }, {});\n\n const userSchema = ref(userSchemaFieldsFiltered);\n\n useSchemaForm(user);\n\n const phoneRegExp = /^\\(\\d{3}\\) \\d{3}\\-\\d{2}\\-\\d{2}$/;\n const userValidationFields = {\n last_name: yup.string().trim().required(__('auth.validation.required')),\n middle_name: yup.string().trim().required(__('auth.validation.required')),\n name: yup.string().trim().required(__('auth.validation.required')),\n phone: props.isPhoneMasked ? yup.string().required(__('auth.validation.phone')).matches(phoneRegExp, __('auth.validation.phone')) : yup.string().required(__('auth.validation.phone')),\n email: yup.string().trim().email(__('auth.validation.email')).required(__('auth.validation.required')),\n registration_number: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().numberFilled();\n }\n }),\n company_name: yup.string().when('user_type', (user_type) => {\n if (user_type == 'legal') {\n return yup.string().required(__('auth.validation.required'));\n }\n }),\n };\n\n const userValidationFieldsFiltered = Object.keys(userValidationFields).reduce((obj, key) => {\n if (props.userFields.includes(key)) {\n obj[key] = userValidationFields[key];\n }\n\n return obj;\n }, {});\n\n const userValidation = yup.object().shape(userValidationFieldsFiltered);\n\n window.addEventListener('beforeunload', () => {\n store.commit('auth/modal', null);\n });\n\n window.addEventListener('pagehide', () => {\n store.commit('auth/modal', null);\n });\n\n const validate = async () => {\n if (typeof shippingComponentValid.value == 'function') {\n const isShippingComponentFormsValid = await shippingComponentValid.value();\n\n if (userSubmitButton.value) {\n userSubmitButton.value.click();\n }\n\n userValidation.isValid(user.value).then(function (isUserValid) {\n ifCheckoutReady.value = isUserValid && payment.value && isUserConsent.value && shipping.value && (!shippingSelected.value.component || (shippingSelected.value.component && shippingComponentData.value[shippingSelected.value.code] && shippingComponentData.value[shippingSelected.value.code].isValid)) && isShippingComponentFormsValid;\n });\n }\n };\n\n const shippingComponentValid = ref(null);\n provide('shippingComponentValid', shippingComponentValid);\n\n const shippingComponentUserData = ref({});\n provide('shippingComponentUserData', shippingComponentUserData);\n\n const initPaymentWidget = (payment, order) => {\n const wayforpay = new Wayforpay();\n\n window.addEventListener('message', (event) => {\n if (event.data == 'WfpWidgetEventClose' || event.data == 'WfpWidgetEventDeclined' || event.data == 'WfpWidgetEventPending') {\n\n }\n\n if (event.data == 'WfpWidgetEventApproved') {\n resetCheckoutForm(order);\n\n isPayed.value = true;\n\n store.dispatch('cart/clear', {\n finally: () => { }\n });\n }\n });\n\n wayforpay.run(payment);\n }\n\n const isPayed = ref(false);\n\n const resetCheckoutForm = (_order) => {\n thanks.value = true;\n order.value = _order;\n\n document.querySelector('html').classList.add('is-checkout-thanks');\n\n resertStore();\n }\n\n const checkout = async () => {\n let isShippingComponentFormsValid = typeof shippingComponentValid.value == 'function' ? shippingComponentValid.value() : null;\n\n if (shippingSelected.value && !shippingSelected.value.component) {\n isShippingComponentFormsValid = true;\n }\n\n userValidation.isValid(user.value).then(function (valid) {\n if (!valid) {\n userType.value = 'new';\n userSubmitButton.value.click();\n\n toast(__('shop.order.validate_user'), {\n type: 'error'\n });\n } else if (!shipping.value) {\n toast(__('shop.order.validate_shipping'), {\n type: 'error'\n });\n } else if (shippingSelected.value.component && (!shippingComponentData.value[shippingSelected.value.code] || !shippingComponentData.value[shippingSelected.value.code].isValid)) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!isShippingComponentFormsValid) {\n toast(__('shop.order.validate_shipping1') + ': «' + shippingSelected.value.name + '»', {\n type: 'error'\n });\n } else if (!payment.value) {\n toast(__('shop.order.validate_payment'), {\n type: 'error'\n });\n } else if (!isUserConsent.value) {\n toast(__('shop.order.validate_consent'), {\n type: 'error'\n });\n } else {\n let clientId;\n let data = shippingComponentData.value[shippingSelected.value.code] ? JSON.parse(JSON.stringify(shippingComponentData.value[shippingSelected.value.code])) : {};\n\n delete data.isValid;\n\n const shippingUserData = JSON.parse(JSON.stringify(shippingComponentUserData.value));\n\n if (document.cookie) {\n const cookies = document.cookie.split(';');\n\n cookies.forEach((cookie) => {\n const parts = cookie.split('=');\n\n if (parts[0].trim() === '_ga') {\n clientId = parts[1].split('.')[2] + '.' + parts[1].split('.')[3];\n }\n });\n }\n\n const model = {\n checkout: true,\n user: {\n last_name: user.value.last_name,\n middle_name: user.value.middle_name,\n name: user.value.name,\n phone: user.value.phone,\n email: user.value.email,\n user_type: user.value.user_type,\n registration_number: user.value.registration_number,\n company_name: user.value.company_name,\n },\n shipping: {\n id: shipping.value,\n data: data,\n user: shippingUserData,\n },\n payment: {\n id: payment.value\n },\n comment: comment.value,\n dontcall: dontcall.value,\n promoCode: promoCode.value,\n loyalty: loyaltyUse.value,\n clientId: clientId\n };\n\n loading.value = true;\n\n $http\n .post(window.location.href, model)\n .then((response) => {\n if (response.data && response.data.error && response.data.message) {\n toast(response.data.message, {\n type: 'error',\n });\n\n return;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n let product = {\n item_name: item.name,\n item_id: item.attributes.code,\n price: item.price,\n quantity: item.quantity\n };\n\n if (item.attributes.brand) {\n product.item_brand = item.attributes.brand;\n }\n\n if (item.attributes.property) {\n product.item_variant = item.attributes.property;\n }\n\n if (item.attributes.categoryFull) {\n if (item.attributes.categoryFull.indexOf('/') !== -1) {\n item.attributes.categoryFull.split('/').forEach((segment, index) => {\n product['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n product.item_category = item.attributes.categoryFull;\n }\n }\n\n if (item.attributes.index) {\n product.index = item.attributes.index;\n }\n\n if (item.attributes.itemListName) {\n product.item_list_name = item.attributes.itemListName;\n }\n\n products.push(product);\n });\n\n\n let object = {\n payment_type: paymentSelected.value.name,\n shipping_tier: shippingSelected.value.name,\n ecommerce: {\n transaction_id: response.data.order.id,\n affiliation: 'main',\n value: parseFloat(total.value),\n shipping: 0,\n currency: 'UAH',\n items: products\n },\n event: 'purchase',\n };\n\n if (user.value.user_type) {\n object.user_type = __('auth.registration.form.user_type_' + user.value.user_type);\n }\n\n if (promoCode.value) {\n object.ecommerce.coupon = promoCode.value;\n }\n\n if (props.isTrackAfterSuccessOnlinePurchase && (response.data.redirect || (response.data.payment_widget_data && window.Wayforpay))) {\n localStorage.setItem('ecommerce', JSON.stringify(object));\n } else {\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n\n if (response.data.redirect) {\n redirect.value = {\n url: response.data.redirect.url,\n data: response.data.redirect.data\n };\n\n nextTick(() => {\n setTimeout(() => {\n redirectForm.value.submit();\n }, 400);\n });\n }\n\n if (response.data.payment_widget_data && window.Wayforpay) {\n initPaymentWidget(JSON.parse(response.data.payment_widget_data), response.data.order);\n } else {\n resetCheckoutForm(response.data.order);\n }\n })\n .catch((e) => {\n toast(__('shop.order.error'), {\n type: 'error'\n });\n\n console.error(e);\n })\n .finally(() => {\n loading.value = false;\n });\n }\n });\n };\n\n const toggleShippingRadio = (id) => {\n if (shipping.value === id) {\n shipping.value = null;\n }\n };\n\n const togglePaymentRadio = (id) => {\n if (payment.value === id) {\n payment.value = null;\n }\n };\n\n const resertStore = () => {\n store.commit('checkout/reset');\n store.commit('cart/clear');\n };\n\n const shippingStoreData = (code, data, isValid) => {\n let d = JSON.parse(JSON.stringify(shippingComponentData.value));\n\n data.isValid = isValid;\n d[code] = data;\n\n store.commit('checkout/shippingData', d);\n };\n\n const home = () => {\n window.location.href = $env.locale.url ? $env.locale.url : '/';\n };\n\n onMounted(() => {\n if (!quantity.value && props.redirectOnEmpty) {\n window.location.href = props.redirectOnEmpty;\n }\n\n let products = [];\n\n items.value.forEach((item) => {\n let product = {\n item_name: item.name,\n item_id: item.attributes.code,\n price: parseFloat(item.attributes.price),\n quantity: item.quantity\n };\n\n if (item.attributes.brand) {\n product.item_brand = item.attributes.brand;\n }\n\n if (item.attributes.property) {\n product.item_variant = item.attributes.property;\n }\n\n if (item.attributes.categoryFull) {\n if (item.attributes.categoryFull.indexOf('/') !== -1) {\n item.attributes.categoryFull.split('/').forEach((segment, index) => {\n product['item_category' + (index ? index + 1 : '')] = segment.trim();\n });\n } else {\n product.item_category = item.attributes.categoryFull;\n }\n }\n\n if (item.attributes.index) {\n product.index = item.attributes.index;\n }\n\n if (item.attributes.itemListName) {\n product.item_list_name = item.attributes.itemListName;\n }\n\n products.push(product);\n });\n\n if (products.length) {\n const object = {\n ecommerce: {\n currency: 'UAH',\n items: products,\n value: parseFloat(total.value),\n },\n event: 'begin_checkout'\n };\n\n if ($env.debug.ecommerce) {\n console.log(object);\n }\n\n if (!$env.debug.ecommerce && window.dataLayer) {\n window.dataLayer.push({\n ecommerce: null\n });\n\n window.dataLayer.push(object);\n }\n }\n });\n\n return {\n auth,\n userType,\n facebook,\n google,\n loginCallback,\n quantity,\n items,\n loading,\n pluralize,\n discount,\n total,\n shipping,\n shippingPrice,\n payment,\n fee,\n userValidation,\n userSchema,\n userSubmitButton,\n checkout,\n ifCheckoutReady,\n validate,\n shippingTypesRestricted,\n paymentMethodsRestricted,\n toggleShippingRadio,\n togglePaymentRadio,\n shippingSelected,\n paymentSelected,\n shippingComponentData,\n shippingStoreData,\n resertStore,\n user,\n dontcall,\n comment,\n isCommentToggled,\n commentMaxLength,\n userCheckout,\n thanks,\n order,\n redirect,\n redirectForm,\n home,\n isPromoCodeToggled,\n applyPromoCode,\n promoCode,\n isPromoLoading,\n promoCodeApplied,\n resetPromoCode,\n calculateWithPromoCodeDiscount,\n consent,\n shippingComponent,\n slots,\n isPayed,\n loyalty,\n loyaltyUse,\n loyaltyUseApplied,\n resetLoyaltyUse,\n applyLoyaltyUse,\n readableUserLoyaltyPoints,\n };\n }\n});\n</script>"],"names":["defineComponent","name","props","item","Object","setup","options","computed","attributes","length","itemOptions","filter","option","value","indexOf","id","_createElementVNode","then","Promise","resolve","f","i","arguments","e","reject","_createElementBlock","_ctx","bundle","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","href","image","src","_hoisted_10","_hoisted_11","_hoisted_12","code","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","quantity","parseInt","_hoisted_18","innerHTML","price","_hoisted_20","priceOld","amount","percent","sum","_hoisted_24","_hoisted_25","_hoisted_26","index","key","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_31","_hoisted_32","_hoisted_33","second","_hoisted_39","_hoisted_40","_hoisted_41","third","_hoisted_43","_hoisted_44","_hoisted_45","_hoisted_51","_hoisted_52","_hoisted_53","yup","addMethod","string","min","msg","this","test","exclusive","message","__","params","isNaN","markRaw","FormText","FormRadio","SchemaForm","SchemaFormFactory","VeeValidatePlugin","HtmlMessage","template","window","viewedSwiperOptions","slidesPerView","freeMode","slideClass","mousewheel","forceToAxis","navigation","nextEl","prevEl","observer","observeParents","components","CheckoutItem","isLogin","type","Boolean","isPhoneMasked","isPromoCode","isConsent","isPaymentMethodOverSummary","userFields","Array","redirectOnEmpty","String","showPlaceholders","isTrackAfterSuccessOnlinePurchase","slots","useSlots","toast","useToast","store","useStore","loading","ref","getters","items","total","auth","userCheckout","ifCheckoutReady","redirectForm","thanks","order","consent","shippingComponent","redirect","shippingTypes","paymentMethods","userType","userSubmitButton","shippingComponentData","isCommentToggled","isPromoCodeToggled","promoCode","promoCodeApplied","isPromoLoading","app","getCurrentInstance","loyalty","points","reduce","acc","array","pluralize","loyaltyUse","loyaltyUseApplied","readableUserLoyaltyPoints","numberFormat","loyalty_points","isUserConsent","dontcall","get","set","commit","comment","watch","substring","field","defaultValue","data","JSON","parse","stringify","provide","user","last_name","middle_name","email","phone","registration_number","company_name","user_type","dispatch","shipping","payment","shippingSelected","find","paymentSelected","shippingPrice","calculatePrice","fee","shippingTypesRestricted","restrictCheck","paymentMethodsRestricted","categoriesInCart","categories","forEach","category_id","push","Math","round","elements","restrictions","keys","ok","r","price_min","price_max","restrictedForce","shipping_type","payment_method","includes","restricted","discount","s","$http","post","location","response","userSchemaFields","component","model","label","list","placeholder","condition","mask","userSchemaFieldsFiltered","obj","userSchema","useSchemaForm","userValidationFields","trim","required","matches","when","numberFilled","userValidationFieldsFiltered","userValidation","object","shape","addEventListener","validate","body","result","shippingComponentValid","isShippingComponentFormsValid","click","isValid","isUserValid","shippingComponentUserData","isPayed","resetCheckoutForm","_order","document","querySelector","classList","add","resertStore","checkout","valid","clientId","shippingUserData","cookie","split","parts","error","products","product","item_name","item_id","brand","item_brand","property","item_variant","categoryFull","segment","item_category","itemListName","item_list_name","payment_type","shipping_tier","ecommerce","transaction_id","affiliation","parseFloat","currency","event","coupon","payment_widget_data","Wayforpay","localStorage","setItem","$env","debug","console","log","dataLayer","url","nextTick","setTimeout","submit","wayforpay","run","initPaymentWidget","onMounted","facebook","$ziggy","provider","google","loginCallback","toggleShippingRadio","togglePaymentRadio","shippingStoreData","d","commentMaxLength","home","locale","applyPromoCode","promoCodeApply","number","appContext","config","globalProperties","$filters","resetPromoCode","calculateWithPromoCodeDiscount","max","resetLoyaltyUse","applyLoyaltyUse","action","style","method","_hoisted_5","_hoisted_6","_hoisted_7","_renderSlot","_hoisted_8","_createCommentVNode","_hoisted_9","_toDisplayString","_createBlock","_createVNode","onClick","open","_hoisted_15","_hoisted_19","_hoisted_21","schemaRowClasses","schema","preventModelCleanupOnSchemaChange","afterForm","_hoisted_22","_hoisted_23","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","nextDates","_hoisted_42","_hoisted_46","icon","_hoisted_49","description","price_label","_hoisted_54","shippingFooter","_hoisted_57","_hoisted_58","_hoisted_59","_hoisted_60","_hoisted_61","_hoisted_62","_hoisted_63","_hoisted_65","_hoisted_67","_hoisted_68","_hoisted_70","_hoisted_71","_hoisted_72","_hoisted_73","_hoisted_74","_hoisted_75","_hoisted_76","_hoisted_77","_hoisted_79","_hoisted_81","_hoisted_82","_hoisted_84","_hoisted_85","_hoisted_86","_hoisted_87","_hoisted_88","_hoisted_89","_hoisted_91","_hoisted_93","_hoisted_94","_hoisted_95","_hoisted_97","_hoisted_98","_hoisted_99","_hoisted_101","_hoisted_102","_hoisted_103","_hoisted_105","_hoisted_106","_hoisted_107","_hoisted_108","_hoisted_109","_hoisted_110","_hoisted_112","_hoisted_113","_hoisted_114","_hoisted_116","_hoisted_117","_hoisted_118","_hoisted_119","disabled","_hoisted_122","_hoisted_123","_hoisted_124","_hoisted_126","_hoisted_127","_hoisted_128","_hoisted_130","_hoisted_132","_hoisted_133","_hoisted_134","_hoisted_135","filters","_hoisted_136","_hoisted_137","_hoisted_138","_hoisted_139","_hoisted_140","_hoisted_141","_hoisted_142","_hoisted_143","_hoisted_144","_hoisted_147","_hoisted_148","_hoisted_149","_ho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R,8BAAazR,uDAExED,2BAAA+Z,IACIxa,qCAAc,mBAAoB6U,wCAAOnU,uDAASA,kCAEtDV,2BAAAya,IACoC/Z,QAAMmK,2BAAtCpK,2BAAAia,IACI1a,2BAAA2a,qBAAsBja,gCACtBV,2BAAA4a,IACmCla,QAAMmK,2BAArCpK,wCAAW,cAAuCqB,UAAQpB,QAAMmK,yDACjCnK,QAAMmK,2BAArCpK,wCAAW,cAAuCqB,UAAQpB,QAAMmK,8FAGxCnK,QAAMoK,0BAAtCrK,2BAAAoa,IACI7a,2BAAA8a,qBAAsBpa,+BACtBV,2BAAA+a,IACmCra,QAAMoK,0BAArCrK,wCAAW,cAAsCqB,UAAQpB,QAAMoK,wDAChCpK,QAAMoK,0BAArCrK,wCAAW,cAAsCqB,UAAQpB,QAAMoK,6FAGvCpK,QAAM2H,yBAAtC5H,2BAAAua,IACIhb,2BAAAib,qBAAsBva,kCACtBV,2BAAAkb,IACIlb,2BAAAmb,IACInb,6BAAM8B,UAAQpB,QAAM2H,gBAAiB,sEAQhD3H,iEAAjBD,2BAAA2a,IACIpb,2BAAAqb,qBAAsB3a,4BACtBV,2BAAAsb,wCACO5a,kCACHV,qBAAoF,KAAhFgB,KAAMN,OAAKyS,OAAOnB,IAAMtR,OAAKyS,OAAOnB,2BAActR,mDAA8B,MAAE6a,uCAAS7a,kCAEnGV,gCAAS,kBAAmBgB,KAAMN,OAAKyS,OAAOnB,IAAMtR,OAAKyS,OAAOnB,2BAActR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perevorot/shop",
3
- "version": "2.0.154",
3
+ "version": "2.0.156",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist/*"