import{c as i,a as r,F as _,r as v,e as u,b as l,t as d,j as b,v as k,o as s,h as E,f as m,d as M,w as x,k as A,A as D,g as S,i as C}from"./vue.esm-bundler-DJBgRGno.js";import{c as F,m as P,a as R}from"./vuex.esm-bundler-DnN6erxi.js";import{a as g}from"./accounting-x6gTgMgu.js";import"./axios-DfDhhHc2.js";import{_ as f}from"./lodash-qUBZfgSu.js";import{a as N}from"./axios-DpTMJf8O.js";import{t as w}from"./tippy.esm-C-c050lq.js";import{T as V}from"./tooltips-C9HTwLqv.js";import{_ as y}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_commonjsHelpers-BosuxZz1.js";import"./popper-CvwSYPO-.js";const I=(t,e=20,c=0)=>{window.scrollTo(c,t.offsetTop-e)},U={items:[]},z={cartPaidProduct:t=>f.find(t.items,{isTeaser:!1}),cartTeaserProduct:t=>f.find(t.items,{isTeaser:!0}),cartHasProductWithTeachingAidAvailable:t=>!!f.find(t.items,{schoolTeachingAidAvailable:!0}),cartTotalPriceRaw:t=>t.items.reduce((e,c)=>e+c.price*c.quantity,0),cartTotalPrice:(t,e)=>e.cartTotalPriceRaw===0?"kostenlos":g.formatMoney(e.cartTotalPriceRaw),cartTotalShippingPriceRaw:t=>t.items.reduce((e,c)=>e+c.shippingPrice,0),cartTotalShippingPrice:(t,e)=>e.cartTotalShippingPriceRaw===0?"kostenlos":g.formatMoney(e.cartTotalShippingPriceRaw),cartTotalPriceAllRaw:(t,e)=>e.cartTotalPriceRaw+e.cartTotalShippingPriceRaw,cartTotalPriceAll:(t,e)=>g.formatMoney(e.cartTotalPriceAllRaw)},q={addProductToCart({state:t,commit:e,dispatch:c},p){if(p.quantity>=0){const n=f.find(t.items,{id:p.id});n&&(p.quantity===0||p.quantity==="")?e("REMOVE_PRODUCT_FROM_CART",p.id):!n&&p.quantity>0?(e("PUSH_PRODUCT_TO_CART",p),e("CLEAR_NO_PRODUCTS_ERROR")):n&&(e("SET_QUANTITY_OF_CART_ITEM",p),e("UPDATE_SHIPPING_PRICE_OF_CART_ITEM",p),e("CLEAR_NO_PRODUCTS_ERROR")),c("validateTeaserPackage")}}},$={REMOVE_PRODUCT_FROM_CART(t,e){const c=f.findIndex(t.items,{id:e});c>-1&&t.items.splice(c,1)},PUSH_PRODUCT_TO_CART(t,e){t.items.push(e)},SET_QUANTITY_OF_CART_ITEM(t,{id:e,quantity:c}){const p=f.find(t.items,{id:e});p&&(p.quantity=c)},UPDATE_SHIPPING_PRICE_OF_CART_ITEM(t,{id:e,shippingPrice:c}){const p=f.find(t.items,{id:e});p&&(p.shippingPrice=c)},REMOVE_TEASER_ITEM(t){const e=f.findIndex(t.items,{isTeaser:!0});e>-1&&t.items.splice(e,1)}},B={state:U,getters:z,actions:q,mutations:$},H={currentMessages:[],validationErrors:{}},G={setValidationErrors({commit:t},e){t("BACKEND_VALIDATION_ERRORS",e),t("VALIDATION_ERROR_MSG")},clearValidationErrors({commit:t}){t("CLEAR_BACKEND_VALIDATION_ERRORS"),t("CLEAR_VALIDATION_ERROR_MSG")}},Q={CLEAR_ALL_ERROR_MESSAGES(t){t.currentMessages=[]},VALIDATION_ERROR_MSG(t){f.find(t.currentMessages,{type:"validationError"})||t.currentMessages.push({type:"validationError",msg:"Es gab Fehler im Formular."})},CLEAR_VALIDATION_ERROR_MSG(t){const e=f.findIndex(t.currentMessages,{type:"validationError"});e>-1&&t.currentMessages.splice(e,1)},TEASER_PACKAGE_ERROR_MSG(t){f.find(t.currentMessages,{type:"teaserPackageError"})||t.currentMessages.push({type:"teaserPackageError",msg:"Das „Schnupper-Paket“ dürfen nur Schulen und Institutionen aus Österreich bestellen. Wählen Sie bitte ein anderes Paket."})},CLEAR_TEASER_PACKAGE_ERROR_MSG(t){const e=f.findIndex(t.currentMessages,{type:"teaserPackageError"});e>-1&&t.currentMessages.splice(e,1)},NO_PRODUCTS_ERROR(t,e){if(!f.find(t.currentMessages,{type:"noProductsError"})){const[c]=e["cart.items"];t.currentMessages.push({type:"noProductsError",msg:c})}},CLEAR_NO_PRODUCTS_ERROR(t){const e=f.findIndex(t.currentMessages,{type:"noProductsError"});e>-1&&t.currentMessages.splice(e,1)},BACKEND_VALIDATION_ERRORS(t,e){t.validationErrors=e},CLEAR_BACKEND_VALIDATION_ERRORS(t){t.validationErrors={}}},K={state:H,actions:G,mutations:Q},W=F({modules:{cart:B,errors:K},state:{isLoading:!1,generalInfo:{},products:[],maximumTeaserProductQuantity:1,currentStep:1,footerTipShown:!1,orderData:{orderFor:"school",skz:"",schoolType:"",name:"",street:"",zip:"",city:"",country:"13",schoolTeachingAidAvailable:!1,phone:"",contactFirstname:"",contactLastname:"",contactEmail:"",contactPhone:"",allowContacting:!1,additionalInfo:""},notice:""},mutations:{IS_LOADING(t,e){t.isLoading=e},GENERAL_INFO(t,e){t.generalInfo=e},PRODUCTS(t,e){t.products=e},SET_MAX_TEASER_QUANTITY(t,e){t.maximumTeaserProductQuantity=e},NEXT_STEP(t){t.currentStep<4&&(t.currentStep+=1)},PREV_STEP(t){t.currentStep>1&&(t.currentStep-=1)},FOOTER_TIP_SHOWN(t){t.footerTipShown=!0},ORDER_DATA(t,e){t.orderData[e.field]=e.value},NOTICE(t,e){t.notice=e},CLEAR_NOTICE(t){t.notice=""}},actions:{setOrderData({commit:t,dispatch:e},c){t("ORDER_DATA",c),e("validateTeaserPackage")},validateTeaserPackage({state:t,getters:e,commit:c}){e.cartTeaserProduct&&t.orderData.country!=13?c("TEASER_PACKAGE_ERROR_MSG"):c("CLEAR_TEASER_PACKAGE_ERROR_MSG")},clearUnusedSchoolFields({state:t,dispatch:e}){t.orderData.orderFor==="company"&&(e("setOrderData",{field:"schoolType",value:""}),e("setOrderData",{field:"skz",value:""}),e("setOrderData",{field:"schoolTeachingAidAvailable",value:!1}))},submitData({state:t,getters:e,commit:c,dispatch:p},n){if(n.url){const o={cart:{totalPrice:g.toFixed(e.cartTotalPriceRaw,2),totalShippingPrice:g.toFixed(e.cartTotalShippingPriceRaw,2),totalAll:g.toFixed(e.cartTotalPriceAllRaw,2),items:t.cart.items}};n.step>1&&(p("clearUnusedSchoolFields"),o.orderData=t.orderData),c("CLEAR_NOTICE"),c("IS_LOADING",!0),N.post(n.url,o).then(a=>{p("clearValidationErrors"),c("NEXT_STEP"),I(document.querySelector(".l-orders-textbook"))}).catch(a=>{a.response.status===422&&(n.step===1?c("NO_PRODUCTS_ERROR",a.response.data.errors):p("setValidationErrors",a.response.data.errors)),I(document.querySelector(".l-orders-textbook"))}).then(()=>{c("IS_LOADING",!1)})}}},getters:{}}),j={name:"Product",props:{product:{type:Object,required:!0}},data(){return{quantity:0}},computed:{maxTeaserQuantity(){return this.$store.state.maximumTeaserProductQuantity},inputMax(){return this.product.isTeaser?this.maxTeaserQuantity:null},price(){return this.product.price===0?"kostenlos":g.formatMoney(this.product.price)},shippingPrice(){return this.product.isTeaser&&this.$store.getters.cartPaidProduct?0:this.product.shippingPrice},shippingPriceFormatted(){return this.shippingPrice===0?"kostenlos":g.formatMoney(this.shippingPrice)},hasDiscount(){return this.product.discount&&this.product.discount>0},discountInPercent(){return this.product.discount*-1},discountSavingsRaw(){return parseFloat(g.toFixed(this.product.price*this.product.discount/100,2))},discountSavings(){return g.formatMoney(this.discountSavingsRaw)},finalPriceRaw(){return parseFloat(g.toFixed(this.product.price-this.discountSavingsRaw,2))},finalPrice(){return g.formatMoney(this.finalPriceRaw)},imageContainerClass(){switch(this.product.books.length){case 2:return"l-orders-textbook-product__image-container--double";case 3:return"l-orders-textbook-product__image-container--triple";case 4:return"l-orders-textbook-product__image-container--fourfold"}}},watch:{quantity(t,e){t!==e&&this.addProductToCart()},shippingPrice(t,e){t!==e&&this.addProductToCart()}},created(){this.checkQuantityOfProductInCart()},mounted(){this.$nextTick(()=>{this.setUpTooltip()})},beforeDestory(){this.destroyTooltip()},methods:{format(t){return g.formatMoney(t)},addProductToCart(){this.product.isTeaser&&this.quantity>this.maxTeaserQuantity?(this.$store.commit("NOTICE",this.getMaxTeaserProductMessage()),this.quantity=this.maxTeaserQuantity):this.quantity<0?this.quantity=0:this.$store.dispatch("addProductToCart",{id:this.product.id,name:this.product.name,description:this.product.description,quantity:this.quantity,price:this.finalPriceRaw,shippingPrice:this.shippingPrice,isTeaser:this.product.isTeaser,schoolTeachingAidAvailable:this.product.schoolTeachingAidAvailable})},checkQuantityOfProductInCart(){const t=f.find(this.$store.state.cart.items,{id:this.product.id});t&&(this.quantity=t.quantity)},getMaxTeaserProductMessage(){return this.maxTeaserQuantity<1?"Es kann kein „Schnupper-Paket“ bestellt werden.":this.maxTeaserQuantity===1?"Es kann nur ein „Schnupper-Paket“ bestellt werden.":`Es können nicht mehr als ${this.maxTeaserQuantity} „Schnupper-Pakete“ bestellt werden.`},setUpTooltip(){this.destroyTooltip();const t=this.$refs.priceBadge;if(t&&t.dataset.tooltip&&t.dataset.tooltip.length){const e=f.merge(V,{content:t.dataset.tooltip});this.tooltip=w(t,e)}},destroyTooltip(){this.tooltip!==void 0&&this.tooltip.length&&this.tooltip.destroy()}}},Z={class:"l-orders-textbook-product"},Y={key:0,class:"l-orders-textbook-product__image-section"},X=["src"],J={class:"l-orders-textbook-product__books-image-quantity"},ee={class:"l-orders-textbook-product__description-section"},te=["innerHTML"],re=["innerHTML"],oe=["innerHTML"],se={class:"l-orders-textbook-product__price-section"},ie={key:0,class:"l-orders-textbook-product__price l-orders-textbook-product__price--reduced"},ae={class:"l-orders-textbook-product__price"},ne=["data-tooltip"],le={class:"c-badge c-badge--white-gray-dark"},de={class:"l-orders-textbook-product__input-section"},ce=["max"];function ue(t,e,c,p,n,o){return s(),i("div",Z,[c.product.books.length?(s(),i("div",Y,[r("div",{class:u(["l-orders-textbook-product__image-container",o.imageContainerClass])},[(s(!0),i(_,null,v(c.product.books,(a,h)=>(s(),i("div",{key:h,class:"l-orders-textbook-product__image-holder"},[r("img",{src:`/images/orderProducts/${a.image}.jpg`,alt:"Digitale Grundbildung - Playmit Urkunde Digital 4.0"},null,8,X),r("span",J,d(a.quantity)+"x",1)]))),128))],2)])):l("",!0),r("div",ee,[r("h3",{class:"l-orders-textbook-product__name",innerHTML:c.product.name},null,8,te),c.product.subline?(s(),i("div",{key:0,class:"l-orders-textbook-product__subline",innerHTML:c.product.subline},null,8,re)):l("",!0),r("div",{class:"l-orders-textbook-product__description",innerHTML:c.product.description},null,8,oe)]),r("div",se,[o.hasDiscount?(s(),i("div",ie,[e[1]||(e[1]=r("span",null,"Preis:",-1)),r("span",null,[r("strong",null,d(o.finalPrice),1)])])):l("",!0),r("div",{class:u(["l-orders-textbook-product__price",{"l-orders-textbook-product__price--invalid":o.hasDiscount}])},[e[2]||(e[2]=r("span",null,"Preis:",-1)),r("span",null,[r("strong",null,d(o.price),1)])],2),r("div",ae,[e[3]||(e[3]=r("span",null,"Versandkosten:",-1)),r("span",null,[r("strong",null,d(o.shippingPriceFormatted),1)])]),o.hasDiscount?(s(),i("div",{key:1,class:"l-orders-textbook-product__price-badges",ref:"priceBadge","data-tooltip":c.product.discountTooltip},[e[4]||(e[4]=r("div",{class:"c-badge c-badge--gray-white"},"SONDERAKTION",-1)),r("div",le,"Sie sparen "+d(o.discountSavings),1)],8,ne)):l("",!0)]),r("div",de,[b(r("input",{class:"l-orders-textbook-product__input",type:"number",min:"0",max:o.inputMax,"onUpdate:modelValue":e[0]||(e[0]=a=>n.quantity=a)},null,8,ce),[[k,n.quantity,void 0,{number:!0}]])])])}const pe=y(j,[["render",ue]]),me={name:"ProductChooser",emits:["next-step"],components:{product:pe},computed:{buttonDisabled(){return!this.cartProducts.length||this.isLoading},...P({isLoading:t=>t.isLoading,currentStep:t=>t.currentStep,products:t=>t.products,cartProducts:t=>t.cart.items,notice:t=>t.notice,errorMessages:t=>t.errors.currentMessages,additionalInfo:t=>t.generalInfo.additionalInfo,footerTip:t=>t.generalInfo.footerTip,footerTipShown:t=>t.footerTipShown}),...R(["cartTotalPrice","cartTotalShippingPrice"])}},he={key:0,class:"l-orders-textbook__alerts"},_e={key:0,class:"l-orders-textbook__alert"},fe={key:1,class:"l-orders-textbook__products"},be={class:"l-orders-textbook__costs-container"},ge={class:"l-orders-textbook__prices-container"},ke={class:"l-orders-textbook__price"},ve={class:"l-orders-textbook__price"},ye={class:"l-orders-textbook__actions-container"},Te=["disabled"],Ee=["innerHTML"],xe={key:2},Se={class:"l-orders-textbook__tip"};function Pe(t,e,c,p,n,o){const a=E("product");return s(),i("div",null,[t.notice.length||t.errorMessages.length?(s(),i("div",he,[t.notice.length?(s(),i("div",_e,[e[1]||(e[1]=r("strong",null,"Hinweis: ",-1)),m(d(t.notice),1)])):l("",!0),(s(!0),i(_,null,v(t.errorMessages,(h,T)=>(s(),i("div",{key:T,class:"l-orders-textbook__alert l-orders-textbook__alert--error"},[e[2]||(e[2]=r("strong",null,"Fehler: ",-1)),m(d(h.msg),1)]))),128))])):l("",!0),t.products.length?(s(),i("ul",fe,[(s(!0),i(_,null,v(t.products,(h,T)=>(s(),i("li",{key:T},[M(a,{product:h},null,8,["product"])]))),128))])):l("",!0),r("div",be,[e[7]||(e[7]=r("div",{class:"l-orders-textbook__costs-total"},"Gesamtkosten",-1)),r("div",ge,[r("span",ke,[e[3]||(e[3]=r("span",null,"Preis:",-1)),e[4]||(e[4]=m()),r("strong",null,d(t.cartTotalPrice),1)]),r("span",ve,[e[5]||(e[5]=r("span",null,"Versandkosten:",-1)),e[6]||(e[6]=m()),r("strong",null,d(t.cartTotalShippingPrice),1)])])]),r("div",ye,[r("button",{class:u(["l-orders-textbook__button-primary",{"l-orders-textbook__button-primary--loading":t.isLoading}]),type:"button",disabled:o.buttonDisabled,onClick:e[0]||(e[0]=x(h=>t.$emit("next-step","/shop/setProducts",1),["prevent"]))},e[8]||(e[8]=[r("span",null,"Weiter →",-1)]),10,Te),r("div",{class:"l-orders-textbook__additional-info",innerHTML:t.additionalInfo},null,8,Ee)]),t.footerTip.length&&!t.footerTipShown?(s(),i("div",xe,[r("div",Se,[e[9]||(e[9]=r("strong",null,"Tipp: ",-1)),m(d(t.footerTip),1)]),e[10]||(e[10]=r("div",{class:"l-orders-textbook__tip-button-container"},[r("a",{class:"l-orders-textbook__tip-button",href:"#instructions","data-lightbox":"inline"},"So funktioniert's")],-1))])):l("",!0)])}const Ae=y(me,[["render",Pe]]),Re={name:"DataForm",emits:["prev-step","next-step"],data(){return{orderFor:"",skz:"",schoolType:"",name:"",street:"",zip:"",city:"",country:"",schoolTeachingAidAvailable:!1,phone:"",contactFirstname:"",contactLastname:"",contactEmail:"",contactPhone:"",allowContacting:!1}},computed:{isSchool(){return this.orderFor==="school"},isBookseller(){return this.orderFor==="bookseller"},schoolTeachingAidPossible(){return this.isSchool&&!!this.$store.getters.cartHasProductWithTeachingAidAvailable},buttonDisabled(){return this.teaserPackageError||this.isLoading||!this.allowContacting},teaserPackageError(){return f.find(this.$store.state.errors.currentMessages,{type:"teaserPackageError"})},...P({isLoading:t=>t.isLoading,currentStep:t=>t.currentStep,schoolTypes:t=>t.generalInfo.schoolTypes,countries:t=>t.generalInfo.countries,notice:t=>t.notice,errorMessages:t=>t.errors.currentMessages,validationErrors:t=>t.errors.validationErrors})},watch:{orderFor(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"orderFor",value:t})},skz(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"skz",value:t})},schoolType(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"schoolType",value:t})},name(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"name",value:t})},street(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"street",value:t})},zip(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"zip",value:t})},city(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"city",value:t})},country(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"country",value:t})},schoolTeachingAidAvailable(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"schoolTeachingAidAvailable",value:t})},phone(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"phone",value:t})},contactFirstname(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"contactFirstname",value:t})},contactLastname(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"contactLastname",value:t})},contactEmail(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"contactEmail",value:t})},contactPhone(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"contactPhone",value:t})},allowContacting(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"allowContacting",value:t})}},created(){this.prepopulate(),this.$store.commit("FOOTER_TIP_SHOWN")},methods:{prepopulate(){this.orderFor=this.$store.state.orderData.orderFor,this.skz=this.$store.state.orderData.skz,this.schoolType=this.$store.state.orderData.schoolType,this.name=this.$store.state.orderData.name,this.street=this.$store.state.orderData.street,this.zip=this.$store.state.orderData.zip,this.city=this.$store.state.orderData.city,this.country=this.$store.state.orderData.country,this.schoolTeachingAidAvailable=this.$store.state.orderData.schoolTeachingAidAvailable,this.phone=this.$store.state.orderData.phone,this.contactFirstname=this.$store.state.orderData.contactFirstname,this.contactLastname=this.$store.state.orderData.contactLastname,this.contactEmail=this.$store.state.orderData.contactEmail,this.contactPhone=this.$store.state.orderData.contactPhone,this.allowContacting=this.$store.state.orderData.allowContacting},validationError(t){const e=`orderData.${t}`;return f.has(this.validationErrors,e)?this.validationErrors[e][0]:!1}}},De={class:"l-orders-textbook-dataform"},Ie={class:"l-orders-textbook-dataform__wrapper"},Oe={key:0,class:"l-orders-textbook__alerts"},Le={key:0,class:"l-orders-textbook__alert"},Me={class:"c-form-group__field-container"},Ce={key:0,class:"c-help-block"},Fe={class:"c-form-section-title"},Ne={class:"c-form-group__field-container"},we={key:1,class:"c-help-block"},Ve={class:"c-form-group__field-container"},Ue=["value"],ze={key:0,class:"c-help-block"},qe={key:3,class:"c-form-section-title"},$e={class:"c-form-group__label-container"},Be={class:"c-form-label",for:"name"},He={class:"c-form-group__field-container"},Ge={key:0,class:"c-help-block"},Qe={class:"c-form-group__field-container"},Ke={key:0,class:"c-help-block"},We={class:"c-form-group__field-container"},je={key:0,class:"c-help-block"},Ze={class:"c-form-group__field-container"},Ye={key:0,class:"c-help-block"},Xe={class:"c-form-group__field-container"},Je=["value"],et={key:0,class:"c-help-block"},tt={class:"c-form-group__field-container"},rt={key:0,class:"c-help-block"},ot={key:5,class:"l-orders-textbook-dataform__checkbox-container"},st={class:"c-form-checkbox"},it={key:0,class:"c-help-block"},at={class:"c-form-group__field-container"},nt={key:0,class:"c-help-block"},lt={class:"c-form-group__field-container"},dt={key:0,class:"c-help-block"},ct={class:"c-form-group__field-container"},ut={key:0,class:"c-help-block"},pt={class:"c-form-group__field-container"},mt={key:0,class:"c-help-block"},ht={class:"l-orders-textbook-dataform__contacting-checkbox-container"},_t={class:"c-form-checkbox"},ft={key:0,class:"c-help-block"},bt={class:"l-orders-textbook__actions-container"},gt=["disabled"];function kt(t,e,c,p,n,o){return s(),i("div",null,[r("div",De,[r("div",Ie,[t.notice.length||t.errorMessages.length?(s(),i("div",Oe,[t.notice.length?(s(),i("div",Le,[e[17]||(e[17]=r("strong",null,"Hinweis: ",-1)),m(d(t.notice),1)])):l("",!0),(s(!0),i(_,null,v(t.errorMessages,(a,h)=>(s(),i("div",{key:h,class:"l-orders-textbook__alert l-orders-textbook__alert--error"},[e[18]||(e[18]=r("strong",null,"Fehler: ",-1)),m(d(a.msg),1)]))),128))])):l("",!0),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("orderFor")}])},[e[20]||(e[20]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"orderFor"},"Bestellung durch:")],-1)),r("div",Me,[b(r("select",{class:"c-form-field",id:"orderFor",name:"orderFor",tabindex:"100","onUpdate:modelValue":e[0]||(e[0]=a=>n.orderFor=a)},e[19]||(e[19]=[r("option",{value:"school"},"Schule",-1),r("option",{value:"company"},"Firma / Bildungseinrichtung",-1),r("option",{value:"bookseller"},"Buchhandel",-1)]),512),[[A,n.orderFor]]),o.validationError("orderFor")?(s(),i("span",Ce,d(o.validationError("orderFor")),1)):l("",!0)])],2),r("h3",Fe,[o.isSchool||o.isBookseller?(s(),i(_,{key:0},[m("Daten Schule")],64)):(s(),i(_,{key:1},[m("Daten Firma / Bildungseinrichtung")],64))]),o.isSchool||o.isBookseller?(s(),i("div",{key:1,class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("skz")}])},[e[21]||(e[21]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"skz"},"Schulkennzahl:")],-1)),r("div",Ne,[o.isSchool||o.isBookseller?b((s(),i("input",{key:0,class:"c-form-field",id:"skz",name:"skz",type:"text",placeholder:"Schulkennzahl",required:"",tabindex:"101","onUpdate:modelValue":e[1]||(e[1]=a=>n.skz=a)},null,512)),[[k,n.skz]]):l("",!0),o.validationError("skz")?(s(),i("span",we,d(o.validationError("skz")),1)):l("",!0)])],2)):l("",!0),o.isSchool?(s(),i("div",{key:2,class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("schoolType")}])},[e[23]||(e[23]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"schoolType"},"Schultyp:")],-1)),r("div",Ve,[b(r("select",{class:"c-form-field",id:"schoolType",name:"schoolType",tabindex:"102","onUpdate:modelValue":e[2]||(e[2]=a=>n.schoolType=a)},[e[22]||(e[22]=r("option",{value:"",disabled:""},"Schultyp wählen",-1)),(s(!0),i(_,null,v(t.schoolTypes,(a,h)=>(s(),i("option",{value:a.id,key:h},d(a.display_name),9,Ue))),128))],512),[[A,n.schoolType]]),o.validationError("schoolType")?(s(),i("span",ze,d(o.validationError("schoolType")),1)):l("",!0)])],2)):l("",!0),o.isBookseller?(s(),i("h3",qe,"Daten Buchhändler")):l("",!0),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("name")}])},[r("div",$e,[r("label",Be,[o.isSchool?(s(),i(_,{key:0},[m("Name der Schule:")],64)):o.isBookseller?(s(),i(_,{key:1},[m("Name des Buchhändlers:")],64)):(s(),i(_,{key:2},[m("Name der Firma:")],64))])]),r("div",He,[b(r("input",{class:"c-form-field",id:"name",name:"name",type:"text",placeholder:"Name",required:"",tabindex:"103","onUpdate:modelValue":e[3]||(e[3]=a=>n.name=a)},null,512),[[k,n.name]]),o.validationError("name")?(s(),i("span",Ge,d(o.validationError("name")),1)):l("",!0)])],2),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("street")}])},[e[24]||(e[24]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"street"},"Straße:")],-1)),r("div",Qe,[b(r("input",{class:"c-form-field",id:"street",name:"street",type:"text",placeholder:"Straße",required:"",tabindex:"104","onUpdate:modelValue":e[4]||(e[4]=a=>n.street=a)},null,512),[[k,n.street]]),o.validationError("street")?(s(),i("span",Ke,d(o.validationError("street")),1)):l("",!0)])],2),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("zip")}])},[e[25]||(e[25]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"zip"},"PLZ:")],-1)),r("div",We,[b(r("input",{class:"c-form-field",id:"zip",name:"zip",type:"text",placeholder:"PLZ",required:"",tabindex:"105","onUpdate:modelValue":e[5]||(e[5]=a=>n.zip=a)},null,512),[[k,n.zip]]),o.validationError("zip")?(s(),i("span",je,d(o.validationError("zip")),1)):l("",!0)])],2),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("city")}])},[e[26]||(e[26]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"city"},"Ort:")],-1)),r("div",Ze,[b(r("input",{class:"c-form-field",id:"city",name:"city",type:"text",placeholder:"Stadt",required:"",tabindex:"106","onUpdate:modelValue":e[6]||(e[6]=a=>n.city=a)},null,512),[[k,n.city]]),o.validationError("city")?(s(),i("span",Ye,d(o.validationError("city")),1)):l("",!0)])],2),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("country")}])},[e[28]||(e[28]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"country"},"Land:")],-1)),r("div",Xe,[b(r("select",{class:"c-form-field",id:"country",name:"country",tabindex:"107","onUpdate:modelValue":e[7]||(e[7]=a=>n.country=a)},[e[27]||(e[27]=r("option",{value:"",disabled:""},"Land wählen",-1)),(s(!0),i(_,null,v(t.countries,(a,h)=>(s(),i("option",{value:a.id,key:h},d(a.display_name),9,Je))),128))],512),[[A,n.country]]),o.validationError("country")?(s(),i("span",et,d(o.validationError("country")),1)):l("",!0)])],2),o.isSchool?l("",!0):(s(),i("div",{key:4,class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("phone")}])},[e[29]||(e[29]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"phone"},"Telefon:")],-1)),r("div",tt,[b(r("input",{class:"c-form-field",id:"phone",name:"phone",type:"text",placeholder:"Telefonnummer",required:"",tabindex:"108","onUpdate:modelValue":e[8]||(e[8]=a=>n.phone=a)},null,512),[[k,n.phone]]),o.validationError("phone")?(s(),i("span",rt,d(o.validationError("phone")),1)):l("",!0)])],2)),o.schoolTeachingAidPossible?(s(),i("div",ot,[r("div",{class:u(["c-form-group",{"has-error":o.validationError("schoolTeachingAidAvailable")}])},[r("label",st,[b(r("input",{class:"c-form-checkbox__input",type:"checkbox",name:"schoolTeachingAidAvailable",tabindex:"109","onUpdate:modelValue":e[9]||(e[9]=a=>n.schoolTeachingAidAvailable=a)},null,512),[[D,n.schoolTeachingAidAvailable]]),e[30]||(e[30]=r("div",{class:"c-form-checkbox__label"}," Unterrichtsmittel eigener Wahl, Budgetrahmen vorhanden ",-1))]),o.validationError("schoolTeachingAidAvailable")?(s(),i("span",it,d(o.validationError("schoolTeachingAidAvailable")),1)):l("",!0)],2)])):l("",!0),e[36]||(e[36]=r("h3",{class:"c-form-section-title"},"Daten Kontaktperson",-1)),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("contactFirstname")}])},[e[31]||(e[31]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"contactFirstname"},"Vorname:")],-1)),r("div",at,[b(r("input",{class:"c-form-field",id:"contactFirstname",name:"contactFirstname",type:"text",placeholder:"Vorname",required:"",tabindex:"110","onUpdate:modelValue":e[10]||(e[10]=a=>n.contactFirstname=a)},null,512),[[k,n.contactFirstname]]),o.validationError("contactFirstname")?(s(),i("span",nt,d(o.validationError("contactFirstname")),1)):l("",!0)])],2),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("contactLastname")}])},[e[32]||(e[32]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"contactLastname"},"Nachname:")],-1)),r("div",lt,[b(r("input",{class:"c-form-field",id:"contactLastname",name:"contactLastname",type:"text",placeholder:"Nachname",required:"",tabindex:"111","onUpdate:modelValue":e[11]||(e[11]=a=>n.contactLastname=a)},null,512),[[k,n.contactLastname]]),o.validationError("contactLastname")?(s(),i("span",dt,d(o.validationError("contactLastname")),1)):l("",!0)])],2),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("contactEmail")}])},[e[33]||(e[33]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"contactEmail"},"E-Mail:")],-1)),r("div",ct,[b(r("input",{class:"c-form-field",id:"contactEmail",name:"contactEmail",type:"text",placeholder:"E-Mail",required:"",tabindex:"112","onUpdate:modelValue":e[12]||(e[12]=a=>n.contactEmail=a)},null,512),[[k,n.contactEmail]]),o.validationError("contactEmail")?(s(),i("span",ut,d(o.validationError("contactEmail")),1)):l("",!0)])],2),r("div",{class:u(["c-form-group c-form-group--inline",{"has-error":o.validationError("contactPhone")}])},[e[34]||(e[34]=r("div",{class:"c-form-group__label-container"},[r("label",{class:"c-form-label",for:"contactPhone"},"Telefon/Handy:")],-1)),r("div",pt,[b(r("input",{class:"c-form-field",id:"contactPhone",name:"contactPhone",type:"text",placeholder:"Telefon/Handy",required:"",tabindex:"113","onUpdate:modelValue":e[13]||(e[13]=a=>n.contactPhone=a)},null,512),[[k,n.contactPhone]]),o.validationError("contactPhone")?(s(),i("span",mt,d(o.validationError("contactPhone")),1)):l("",!0)])],2),r("div",ht,[r("div",{class:u(["c-form-group",{"has-error":o.validationError("allowContacting")}])},[r("label",_t,[b(r("input",{class:"c-form-checkbox__input",type:"checkbox",name:"allowContacting",tabindex:"114","onUpdate:modelValue":e[14]||(e[14]=a=>n.allowContacting=a)},null,512),[[D,n.allowContacting]]),e[35]||(e[35]=r("div",{class:"c-form-checkbox__label"}," Ich stimme zu, dass ich von Playmit kontaktiert werden darf. Diese Zustimmung kann jederzeit widerrufen werden. ",-1))]),o.validationError("allowContacting")?(s(),i("span",ft,d(o.validationError("allowContacting")),1)):l("",!0)],2)])])]),r("div",bt,[r("button",{class:u(["l-orders-textbook__button-primary",{"l-orders-textbook__button-primary--loading":t.isLoading}]),type:"button",disabled:o.buttonDisabled,onClick:e[15]||(e[15]=x(a=>t.$emit("next-step","/shop/setContactData",2),["prevent"]))},e[37]||(e[37]=[r("span",null,"Weiter →",-1)]),10,gt),r("button",{class:"l-orders-textbook__button-secondary",type:"button",onClick:e[16]||(e[16]=x(a=>t.$emit("prev-step"),["prevent"]))},"← Zurück")])])}const vt=y(Re,[["render",kt]]),yt={name:"OrderSummary",emits:["prev-step","next-step"],data(){return{additionalInfo:""}},computed:{isBookseller(){return this.orderData.orderFor==="bookseller"},contactName(){let t="z.H.:";return this.orderData.contactFirstname&&(t=`${t} ${this.orderData.contactFirstname}`),this.orderData.contactLastname&&(t=`${t} ${this.orderData.contactLastname}`),t},buttonDisabled(){return this.isLoading},schoolTeachingAidAvailable(){return this.orderData.schoolTeachingAidAvailable},...P({isLoading:t=>t.isLoading,currentStep:t=>t.currentStep,orderData:t=>t.orderData,cartProducts:t=>t.cart.items,notice:t=>t.notice,errorMessages:t=>t.errors.currentMessages,additionalInfoAddress:t=>t.generalInfo.additionalInfoSummaryAddress,additionalInfoPayment:t=>t.generalInfo.additionalInfoSummaryPayment,additionalInfoSummarySchoolTeachingAid:t=>t.generalInfo.additionalInfoSummarySchoolTeachingAid}),...R(["cartTotalPrice","cartTotalShippingPrice"])},watch:{additionalInfo(t,e){t!==e&&this.$store.dispatch("setOrderData",{field:"additionalInfo",value:t})}}},Tt={key:0,class:"l-orders-textbook__alerts"},Et={key:0,class:"l-orders-textbook__alert"},xt={class:"l-orders-textbook-summary"},St={class:"l-orders-textbook-summary__wrapper"},Pt={class:"l-orders-textbook-summary__content"},At={class:"l-orders-textbook-summary__section"},Rt={class:"l-orders-textbook-summary__section-content"},Dt={class:"l-orders-textbook-summary__products"},It={class:"l-orders-textbook-summary__product-quantity-name"},Ot=["innerHTML"],Lt={class:"l-orders-textbook-summary__section"},Mt={class:"l-orders-textbook-summary__section-content"},Ct={class:"l-orders-textbook-summary__data-container"},Ft={key:0},Nt={key:1},wt={class:"l-orders-textbook-summary__data-container l-orders-textbook-summary__data-container--light"},Vt={key:0},Ut={key:1},zt={key:2},qt={key:0,class:"c-additional-info"},$t={class:"l-orders-textbook-summary__content"},Bt={class:"l-orders-textbook-summary__section"},Ht={class:"l-orders-textbook-summary__section-content"},Gt={class:"l-orders-textbook-summary__data-container"},Qt={class:"l-orders-textbook-summary__price"},Kt={key:0,class:"l-orders-textbook-summary__info u-margin-b-4xs"},Wt={class:"l-orders-textbook-summary__price"},jt=["innerHTML"],Zt=["innerHTML"],Yt={class:"l-orders-textbook-summary__section"},Xt={class:"l-orders-textbook-summary__section-content"},Jt={class:"l-orders-textbook__actions-container"},er=["disabled"];function tr(t,e,c,p,n,o){return s(),i("div",null,[t.notice.length||t.errorMessages.length?(s(),i("div",Tt,[t.notice.length?(s(),i("div",Et,[e[3]||(e[3]=r("strong",null,"Hinweis: ",-1)),m(d(t.notice),1)])):l("",!0),(s(!0),i(_,null,v(t.errorMessages,(a,h)=>(s(),i("div",{key:h,class:"l-orders-textbook__alert l-orders-textbook__alert--error"},[e[4]||(e[4]=r("strong",null,"Fehler: ",-1)),m(d(a.msg),1)]))),128))])):l("",!0),r("div",xt,[r("div",St,[r("div",Pt,[r("div",At,[e[5]||(e[5]=r("h3",{class:"l-orders-textbook-summary__section-title"},"Pakete",-1)),r("div",Rt,[r("ul",Dt,[(s(!0),i(_,null,v(t.cartProducts,(a,h)=>(s(),i("li",{key:h,class:"l-orders-textbook-summary__product"},[r("div",It,d(a.quantity)+" x "+d(a.name),1),r("div",{class:"l-orders-textbook-summary__product-description",innerHTML:a.description},null,8,Ot)]))),128))])])]),r("div",Lt,[e[6]||(e[6]=r("h3",{class:"l-orders-textbook-summary__section-title"},"Rechnung / Lieferadresse",-1)),r("div",Mt,[r("div",Ct,[t.orderData.name?(s(),i("div",Ft,d(t.orderData.name),1)):l("",!0),t.orderData.skz?(s(),i("div",Nt,"Schulkennzahl: "+d(t.orderData.skz),1)):l("",!0)]),r("div",wt,[t.orderData.contactFirstname||t.orderData.contactLastname?(s(),i("div",Vt,d(o.contactName),1)):l("",!0),t.orderData.street?(s(),i("div",Ut,d(t.orderData.street),1)):l("",!0),t.orderData.city?(s(),i("div",zt,d(t.orderData.zip)+" "+d(t.orderData.city),1)):l("",!0)]),t.additionalInfoAddress?(s(),i("div",qt,d(t.additionalInfoAddress),1)):l("",!0)])])]),e[14]||(e[14]=r("hr",{class:"c-divider c-divider--xl c-divider--white-2"},null,-1)),r("div",$t,[r("div",Bt,[e[12]||(e[12]=r("h3",{class:"l-orders-textbook-summary__section-title"},"Gesamtkosten",-1)),r("div",Ht,[r("div",Gt,[r("div",Qt,[e[7]||(e[7]=r("span",null,"Preis:",-1)),e[8]||(e[8]=m()),r("strong",null,d(t.cartTotalPrice),1)]),o.isBookseller?(s(),i("div",Kt,e[9]||(e[9]=[r("span",null,"Es werden noch 20% Händlerrabatt abgezogen.",-1)]))):l("",!0),r("div",Wt,[e[10]||(e[10]=r("span",null,"Versandkosten:",-1)),e[11]||(e[11]=m()),r("strong",null,d(t.cartTotalShippingPrice),1)])]),o.schoolTeachingAidAvailable?(s(),i(_,{key:0},[t.additionalInfoSummarySchoolTeachingAid?(s(),i("div",{key:0,class:"c-additional-info",innerHTML:t.additionalInfoSummarySchoolTeachingAid},null,8,jt)):l("",!0)],64)):(s(),i(_,{key:1},[t.additionalInfoPayment?(s(),i("div",{key:0,class:"c-additional-info",innerHTML:t.additionalInfoPayment},null,8,Zt)):l("",!0)],64))])]),r("div",Yt,[e[13]||(e[13]=r("h3",{class:"l-orders-textbook-summary__section-title"},"Anmerkung",-1)),r("div",Xt,[b(r("textarea",{class:"c-form-field",placeholder:"Ihre Anmerkung",rows:"6","onUpdate:modelValue":e[0]||(e[0]=a=>n.additionalInfo=a)},null,512),[[k,n.additionalInfo]])])])])])]),r("div",Jt,[r("button",{class:u(["l-orders-textbook__button-primary",{"l-orders-textbook__button-primary--loading":t.isLoading}]),type:"button",disabled:o.buttonDisabled,onClick:e[1]||(e[1]=x(a=>t.$emit("next-step","/shop/send",3),["prevent"]))},e[15]||(e[15]=[r("span",null,"Kostenpflichtig bestellen",-1)]),10,er),r("button",{class:"l-orders-textbook__button-secondary",type:"button",onClick:e[2]||(e[2]=x(a=>t.$emit("prev-step"),["prevent"]))},"← Zurück")])])}const rr=y(yt,[["render",tr]]),or={name:"Confirmation",props:{furtherLink:String},computed:{schoolTeachingAidAvailable(){return this.orderData.schoolTeachingAidAvailable},...P({orderData:t=>t.orderData}),...R(["cartTotalPriceAll"])}},sr={class:"l-orders-textbook-confirmation"},ir={class:"l-orders-textbook-confirmation__textblock"},ar={key:0,class:"l-orders-textbook-confirmation__textblock"};function nr(t,e,c,p,n,o){return s(),i("div",sr,[e[9]||(e[9]=r("h2",{class:"l-orders-textbook-confirmation__headline"},"Vielen Dank für Ihre Bestellung.",-1)),e[10]||(e[10]=r("p",{class:"l-orders-textbook-confirmation__textblock"},"Eine Bestellbestätigung wurde an Ihre E-Mail-Adresse geschickt.",-1)),r("p",ir,[o.schoolTeachingAidAvailable?(s(),i(_,{key:0},[e[0]||(e[0]=m(' Sie haben auf "Unterrichtsmittel eigener Wahl“ im Wert von ')),r("strong",null,d(t.cartTotalPriceAll),1),e[1]||(e[1]=m(" bestellt. In den nächsten Werktagen erhalten Sie eine Lieferung an die angegebene Adresse. Bitte füllen Sie den beigelegten Lieferschein mit Datum und Schulstempel aus und senden diesen umgehend an uns zurück. Sie brauchen keinen Betrag überweisen. "))],64)):(s(),i(_,{key:1},[e[2]||(e[2]=m(" Bitte Betrag über ")),r("strong",null,d(t.cartTotalPriceAll),1),e[3]||(e[3]=m(" überweisen an")),e[4]||(e[4]=r("br",null,null,-1)),e[5]||(e[5]=r("strong",null,"PLAYMIT GmbH, VKB Steyr",-1)),e[6]||(e[6]=r("br",null,null,-1)),e[7]||(e[7]=r("strong",null,"IBAN: AT63 1860 0000 1502 6065",-1))],64))]),o.schoolTeachingAidAvailable?l("",!0):(s(),i("p",ar,e[8]||(e[8]=[r("strong",null,"Wichtig:",-1),m(" Schulname oder SKZ bei Überweisung angeben."),r("br",null,null,-1),m(" Rechnung wird der Lieferung automatisch beigelegt. ")])))])}const lr=y(or,[["render",nr]]),dr={name:"OrderTextbook",components:{"product-chooser":Ae,"data-form":vt,"order-summary":rr,confirmation:lr},props:{products:{type:Object,required:!0},generalInfo:{type:Object,required:!0},furtherLink:String},computed:{currentStep(){return this.$store.state.currentStep}},created(){this.$store.commit("GENERAL_INFO",this.generalInfo),this.$store.commit("PRODUCTS",this.products.items),this.$store.commit("SET_MAX_TEASER_QUANTITY",this.products.maximumTeaserProductQuantity)},methods:{nextStep(t,e){this.$store.dispatch("submitData",{url:t,step:e})},prevStep(){this.$store.commit("PREV_STEP")}}},cr={class:"l-orders-textbook"},ur={class:"l-orders-textbook__breadcrumbs"},pr={class:"l-orders-textbook__steps-stage"};function mr(t,e,c,p,n,o){const a=E("product-chooser"),h=E("data-form"),T=E("order-summary"),L=E("confirmation");return s(),i("div",cr,[o.currentStep<4?(s(),i(_,{key:0},[e[0]||(e[0]=r("h2",{class:"l-orders-textbook__headline"},"Lehrbücher bestellen",-1)),e[1]||(e[1]=r("h2",{class:"l-orders-textbook__subline"},[m("Alle Informationen und Ansichten zu den Büchern finden Sie "),r("a",{target:"_blank",href:"/schulen"},"hier"),m(".")],-1)),r("div",ur,[r("div",{class:u(["l-orders-textbook__breadcrumb-step",{"l-orders-textbook__breadcrumb-step--active":o.currentStep>=1}])},[r("span",{class:u(["l-orders-textbook__breadcrumb-text",{"l-orders-textbook__breadcrumb-text--active":o.currentStep===1}])}," Paket wählen ",2)],2),r("div",{class:u(["l-orders-textbook__breadcrumb-step",{"l-orders-textbook__breadcrumb-step--active":o.currentStep>=2}])},[r("span",{class:u(["l-orders-textbook__breadcrumb-text",{"l-orders-textbook__breadcrumb-text--active":o.currentStep===2}])}," Daten ",2)],2),r("div",{class:u(["l-orders-textbook__breadcrumb-step",{"l-orders-textbook__breadcrumb-step--active":o.currentStep>=3}])},[r("span",{class:u(["l-orders-textbook__breadcrumb-text",{"l-orders-textbook__breadcrumb-text--active":o.currentStep===3}])}," Zusammenfassung ",2)],2)]),r("div",pr,[o.currentStep===1?(s(),S(a,{key:0,onNextStep:o.nextStep},null,8,["onNextStep"])):l("",!0),o.currentStep===2?(s(),S(h,{key:1,onPrevStep:o.prevStep,onNextStep:o.nextStep},null,8,["onPrevStep","onNextStep"])):l("",!0),o.currentStep===3?(s(),S(T,{key:2,onPrevStep:o.prevStep,onNextStep:o.nextStep},null,8,["onPrevStep","onNextStep"])):l("",!0)])],64)):(s(),S(L,{key:1,"further-link":c.furtherLink},null,8,["further-link"]))])}const hr=y(dr,[["render",mr]]),O=C({});O.use(W).component("TextbookOrder",hr);document.querySelector("#vue-order-textbook-form")&&O.mount("#vue-order-textbook-form");