File: D:/HostingSpaces/SBogers95/rentman.io/wwwroot/js/site/createPlan.js
!function(t){var r={};function e(s){if(r[s])return r[s].exports;var o=r[s]={i:s,l:!1,exports:{}};return t[s].call(o.exports,o,o.exports,e),o.l=!0,o.exports}e.m=t,e.c=r,e.d=function(t,r,s){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:s})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(e.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var o in t)e.d(s,o,function(r){return t[r]}.bind(null,o));return s},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,r){return Object.prototype.hasOwnProperty.call(t,r)},e.p="/",e(e.s=1)}({1:function(t,r,e){t.exports=e("CpCg")},CpCg:function(t,r,e){"use strict";e.r(r);var s=e("x3uD"),o=e.n(s);function n(t,r,e,s,o,n,a,i){var c,u="function"==typeof t?t.options:t;if(r&&(u.render=r,u.staticRenderFns=e,u._compiled=!0),s&&(u.functional=!0),n&&(u._scopeId="data-v-"+n),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):o&&(c=i?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,r){return c.call(r),l(t,r)}}else{var p=u.beforeCreate;u.beforeCreate=p?[].concat(p,c):[c]}return{exports:t,options:u}}var a=n({name:"productPopUp",props:{active:{type:Boolean,required:!0},product:{type:Object,required:!0}},mounted:function(){var t=this.$refs,r=t.modalHeader,e=t.modalThead;e&&(e.style.top="".concat(r.clientHeight,"px"))},computed:{features:function(){if(""==this.product.translation.features)return null;var t=JSON.parse(this.product.translation.features);if(!t)return null;var r=[];return t.forEach((function(t){t.forEach((function(t,e){void 0===r[e]&&(r[e]=[]),r[e].push(t)}))})),this.product.levels.length<=1?r.splice(-2,2):2===this.product.levels.length&&r.splice(-1,1),r}}},(function(){var t=this,r=t._self._c;return r("div",{staticClass:"o-modal",class:{"is-active":t.active}},[r("div",{staticClass:"o-modal__shader",on:{click:function(r){return t.$emit("close")}}}),t._v(" "),r("div",{staticClass:"o-modal__content js-modal-scroller"},[r("div",{ref:"modalHeader",staticClass:"o-modal__header"},[r("h2",{staticClass:"o-modal__heading"},[t._v(t._s(t.product.translation.name))]),t._v(" "),r("button",{staticClass:"o-modal__close",on:{click:function(r){return t.$emit("close")}}})]),t._v(" "),r("table",{staticClass:"o-modal__table"},[t.product.levels.length>0?r("thead",{ref:"modalThead",staticClass:"o-modal__thead"},[r("tr",[r("th",{staticClass:"o-modal__thead-cell"}),t._v(" "),t._l(t.product.levels,(function(e){return r("th",{staticClass:"o-modal__thead-cell"},[r("div",{staticClass:"c-package-price"},[r("h3",{staticClass:"c-package-price__title"},[t._v(t._s(e[0]))]),t._v(" "),r("div",{staticClass:"c-package-price__amount c-package-price__symbol",attrs:{"data-currency-symbol":t.getCurrencyIcon()}},[r("div",{staticClass:"c-package-price__number"},[t._v(t._s(t.getPrice(e[1],e[2])))])]),t._v(" "),r("div",{staticClass:"c-package-price__info"},[r("p",[r("span",[t._v(t._s(t.trans("per")))]),t._v(" "),r("span",{staticClass:"c-tooltip c-tooltip--text c-tooltip--dark-pop-up",attrs:{"data-tooltip":t.trans("power_user_tooltip")}},[t._v(t._s(t.trans("power_user")))]),t._v(" "),r("span",[t._v("/")]),t._v(" "),r("span",[t._v(t._s(t.trans("month")))])])])])])}))],2)]):t._e(),t._v(" "),t.features?r("tbody",{staticClass:"o-modal__tbody"},t._l(t.features[0].length,(function(e){return r("tr",{key:e},[1==t.features[2][e-1]?r("td",{attrs:{colspan:t.features.length}},[r("div",{staticClass:"o-modal__table-subheader"},[r("span",[t._v(t._s(t.features[0][e-1]))])])]):[r("td",{staticClass:"o-modal__tbody-cell"},[r("div",{staticClass:"o-modal__label-column"},[t._v("\n "+t._s(t.features[0][e-1])+"\n "),""!=t.features[1][e-1]&&2!=e?r("span",{staticClass:"c-tooltip c-tooltip--dark-pop-up c-tooltip--modal",attrs:{"data-tooltip":t.features[1][e-1]}}):t._e(),t._v(" "),""!=t.features[1][e-1]&&2==e?r("span",{staticClass:"c-tooltip c-tooltip--dark-pop-up c-tooltip--modal c-tooltip--modal--bottom",attrs:{"data-tooltip":t.features[1][e-1]}}):t._e()])]),t._v(" "),t._l(t.features.length-3,(function(s){return r("td",{key:s,staticClass:"o-modal__tbody-cell"},[r("div",{staticClass:"o-modal__feature-icon",class:{"is-excluded":0==t.features[s+2][e-1]}})])}))]],2)})),0):t._e()])])])}),[],!1,null,null,null).exports,i=n({name:"singleProduct",components:{ProductPopUp:a},mixins:[o.a],props:{product:{type:Object,required:!0}},data:function(){return{amount:1,popupOpened:!1,cartState:null}},created:function(){window.location.hash==="#"+this.slugify(this.product.translation.name)&&(this.popupOpened=!0)},methods:{updateCartState:function(){var t=this;this.cartState=this.$root.productsInCart.find((function(r){return r.id==t.product.id})),void 0===this.cartState&&(this.cartState=null)},toggleProduct:function(){this.isInShoppingCart?this.removeProduct():this.addProduct()},addProduct:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.product.levels.length>0&&null===t&&(t=0),this.$root.productsInCart.push({id:this.product.id,level:t,amount:1}),this.updateCartState()},removeProduct:function(){var t=this;this.$root.productsInCart=this.$root.productsInCart.filter((function(r){return r.id!=t.product.id})),this.product.hinted_products.length>0&&this.product.hinted_products.forEach((function(r){t.$root.productsInCart=t.$root.productsInCart.filter((function(t){return t.id!==r.id}))})),this.updateCartState()},setLevel:function(t){var r=this;this.isInShoppingCart?(this.$root.productsInCart.find((function(t){return t.id==r.product.id})).level=t,this.updateCartState()):this.addProduct(t)},setAmount:function(t){var r=this;this.$root.productsInCart.find((function(t){return t.id==r.product.id})).amount=t,this.updateCartState()},changeAmount:function(t){var r=parseInt(t.target.value);0===r?this.removeProduct():this.setAmount(r)},incrementAmount:function(){var t=this.cartState.amount+1;0===t?this.removeProduct():this.setAmount(t)},decrementAmount:function(){var t=this.cartState.amount-1;0===t?this.removeProduct():this.setAmount(t)},openPopup:function(){history.replaceState("",document.title,window.location.pathname+"#"+this.slugify(this.product.translation.name)),this.popupOpened=!0},closePopup:function(){history.replaceState("",document.title,window.location.pathname),this.popupOpened=!1}},computed:{productCart:function(){var t=this;this.$root.productsInCart.find((function(r){return r.id==t.product.id}))},isAddon:function(){return"addon"===this.product.pricing_product_type},isLevels:function(){return"levels"===this.product.pricing_product_type},showCta:function(){return 1===this.product.show_cta},isInShoppingCart:function(){return null!==this.cartState},price:function(){return this.displayCorrectCurrency(this.product.euro_price,this.product.dollar_price)},parentProductIsSelected:function(){var t=this;return void 0!==this.product.parentProduct&&!this.$root.productsInCart.find((function(r){return r.id===t.product.parentProduct}))}}},(function(){var t=this,r=t._self._c;return r("div",{staticClass:"create-plan-product",class:[t.isInShoppingCart?"create-plan-product__in-cart":"",!this.$root.primaryProductSelected&&t.product.requiresPrimary?"is-disabled":""],attrs:{"data-icon":t.product.pricing_product_icon}},[!this.$root.primaryProductSelected&&t.product.requiresPrimary?r("div",{staticClass:"c-announcements__item"},[r("div",{staticClass:"c-announcements__message c-announcements__message--pricing"},[t._v("\n "+t._s(t.trans("available_with_equipment_scheduling_or_crew_scheduling"))+"\n ")])]):!this.$root.equipmentSchedulingSelected&&t.product.requiresEquipmentScheduling?r("div",{staticClass:"c-announcements__item"},[r("div",{staticClass:"c-announcements__message c-announcements__message--pricing"},[t._v("\n "+t._s(t.trans("available_with_equipment_scheduling"))+"\n ")])]):!this.$root.equipmentSchedulingSelected&&t.product.requiresEquipmentSchedulingPro?r("div",{staticClass:"c-announcements__item"},[r("div",{staticClass:"c-announcements__message c-announcements__message--pricing"},[t._v("\n "+t._s(t.trans("available_with_equipment_scheduling_pro"))+"\n ")])]):t._e(),t._v(" "),r("div",{staticClass:"create-plan-product__inner"},[r("div",{staticClass:"create-plan-product__icon"}),t._v(" "),r("div",{staticClass:"create-plan-product__meta"},[t.isAddon||t.isLevels?r("span",{staticClass:"create-plan-product__label"},[t._v(t._s(t.trans("additional_product")))]):r("span",{staticClass:"create-plan-product__label"},[t._v(t._s(t.trans("product")))]),t._v(" "),r("strong",[t._v(t._s(t.product.translation.name))]),t._v(" "),0===t.product.levels.length?[null!==t.price?r("p",[t._v(t._s(t.price)+"\n "),0===t.product.price_per_warehouse?r("span",[t._v(t._s(t.trans("per_month")))]):t._e(),t._v(" "),1===t.product.price_per_warehouse?r("span",[t._v(t._s(t.trans("power_user_warehouse_month")))]):t._e()]):t._e()]:t._e(),t._v(" "),""!==t.product.translation.description?r("p",[t._v(t._s(t.product.translation.description))]):t._e(),t._v(" "),t.product.specs&&t.product.specs.length>0?r("ul",{staticClass:"create-plan__checks"},t._l(t.product.specs,(function(e){return e.length>0?r("li",[t._v(t._s(e[0]))]):t._e()})),0):t._e(),t._v(" "),t.showCta&&t.product.translation.features&&0===t.product.levels.length?r("div",{staticClass:"create-plan__read-more",on:{click:t.openPopup}},[t._v(t._s(t.trans("read_more"))+" "),r("span")]):t._e()],2),t._v(" "),t.product.requiresEquipmentSchedulingPro?r("div",{staticClass:"create-plan-product__button create-plan-product__button--suite",class:{disabled:!this.$root.equipmentSchedulingProSelected}},[[8].includes(t.product.id)?r("div",{staticClass:"create-plan-product__tooltip"},[t._v("\n "+t._s(t.trans("available_with_equipment_scheduling_pro"))+"\n ")]):t._e(),t._v(" "),t.isAddon?[r("button",{class:{hidden:t.isInShoppingCart},attrs:{type:"button",value:"add product"},on:{click:t.toggleProduct}},[r("div"),t._v("\n "+t._s(t.isInShoppingCart?t.trans("added"):t.trans("add"))+"\n ")]),t._v(" "),t.isInShoppingCart?r("div",{staticClass:"create-plan-product__numbers"},[r("button",{on:{click:t.incrementAmount}},[t._v("+")]),t._v(" "),r("input",{attrs:{type:"number",min:"0"},domProps:{value:t.cartState.amount},on:{change:t.changeAmount}}),t._v(" "),r("button",{on:{click:t.decrementAmount}},[t._v("-")])]):t._e()]:[r("button",{class:{active:t.isInShoppingCart},attrs:{type:"button",value:"add product"},on:{click:t.toggleProduct}},[r("div"),t._v("\n "+t._s(t.isInShoppingCart?t.trans("added"):t.trans("add"))+"\n ")])]],2):r("div",{staticClass:"create-plan-product__button create-plan-product__button--suite",class:{disabled:!this.$root.primaryProductSelected&&t.product.requiresPrimary||t.parentProductIsSelected}},[[3].includes(t.product.id)?r("div",{staticClass:"create-plan-product__tooltip"},[t._v("\n "+t._s(t.trans("available_with_equipment_scheduling"))+"\n ")]):t._e(),t._v(" "),[5,9].includes(t.product.id)?r("div",{staticClass:"create-plan-product__tooltip"},[t._v("\n "+t._s(t.trans("available_with_equipment_scheduling_or_crew_scheduling"))+"\n ")]):t._e(),t._v(" "),t.isAddon?[r("button",{class:{hidden:t.isInShoppingCart},attrs:{type:"button",value:"add product"},on:{click:t.toggleProduct}},[r("div"),t._v("\n "+t._s(t.isInShoppingCart?t.trans("added"):t.trans("add"))+"\n ")]),t._v(" "),t.isInShoppingCart?r("div",{staticClass:"create-plan-product__numbers"},[r("button",{on:{click:t.incrementAmount}},[t._v("+")]),t._v(" "),r("input",{attrs:{type:"number",min:"0"},domProps:{value:t.cartState.amount},on:{change:t.changeAmount}}),t._v(" "),r("button",{on:{click:t.decrementAmount}},[t._v("-")])]):t._e()]:[r("button",{class:{active:t.isInShoppingCart},attrs:{type:"button",value:"add product"},on:{click:t.toggleProduct}},[r("div"),t._v("\n "+t._s(t.isInShoppingCart?t.trans("added"):t.trans("add"))+"\n ")])]],2)]),t._v(" "),t.product.levels.length>0?[r("div",{staticClass:"create-plan-product__levels"},t._l(t.product.levels,(function(e,s){return r("div",{staticClass:"create-plan-product__level",class:{selected:t.isInShoppingCart&&t.cartState.level==s},on:{click:function(r){return t.setLevel(s)}}},[r("strong",[t._v(t._s(e[0]))]),t._v(" "),r("span",[t._v(t._s(t.displayCorrectCurrency(e[1],e[2]))+" "+t._s(t.trans("power_user"))+" "),r("br"),t._v("\n / "+t._s(t.trans("month"))+"\n ")])])})),0),t._v(" "),t.showCta?r("div",{staticClass:"create-plan__read-more",on:{click:t.openPopup}},[t._v(t._s(t.trans("compare"))+" "),r("span")]):t._e()]:t._e(),t._v(" "),r("product-pop-up",{attrs:{active:t.popupOpened,product:t.product},on:{close:t.closePopup}})],2)}),[],!1,null,null,null).exports,c=n({name:"cartProduct",props:{product:{type:Object,required:!0},cartState:{type:Object,required:!0},pricePerWarehouse:{required:!1}},methods:{removeProduct:function(){var t=this;this.$root.productsInCart=this.$root.productsInCart.filter((function(r){return r.id!=t.product.id}))}},computed:{pricing:function(){if(this.product.levels.length>0){var t=this.product.levels[this.cartState.level];return[parseFloat(t[1]),parseFloat(t[2])]}return[parseFloat(this.product.euro_price),parseFloat(this.product.dollar_price)]}}},(function(){var t=this,r=t._self._c;return r("div",{staticClass:"create-plan__cart-product"},[r("div",{staticClass:"create-plan__cart-close",on:{click:t.removeProduct}}),t._v(" "),r("strong",[t._v(t._s(t.product.translation.name))]),t._v(" "),r("div",{staticClass:"create-plan__cart-label"},[t.product.levels.length>0?[r("span",{staticClass:"cart-level"},[t._v(t._s(t.product.levels[t.cartState.level][0])+" - ")]),t._v(" "),r("span",[t._v(t._s(t.displayCorrectCurrency(t.pricing[0],t.pricing[1])))]),t._v(" "+t._s(t.trans("power_user_month"))+"\n ")]:t.pricePerWarehouse?[r("span",{staticClass:"cart-level"},[t._v(t._s(t.cartState.amount)+"x - ")]),t._v(" "),r("span",[t._v(t._s(t.displayCorrectCurrency(t.pricing[0],t.pricing[1])))]),t._v("\n "+t._s(t.trans("power_user_warehouse_month"))+"\n ")]:"addon"===t.product.pricing_product_type?[r("span",{staticClass:"cart-level"},[t._v(t._s(t.cartState.amount)+"x - ")]),t._v(" "),r("span",[t._v(t._s(t.displayCorrectCurrency(t.pricing[0],t.pricing[1])))])]:[r("span",[t._v(t._s(t.displayCorrectCurrency(t.pricing[0],t.pricing[1])))]),t._v(" "+t._s(t.trans("power_user_month"))+"\n ")]],2)])}),[],!1,null,"80473022",null).exports,u=n({name:"openCloseProducts",props:{name:{type:String,required:!0}},data:function(){return{containerOpen:!0}},methods:{toggleContainer:function(){this.containerOpen=!this.containerOpen}}},(function(){var t=this,r=t._self._c;return r("div",{staticClass:"create-plan-additional-products",class:{"container-open":t.containerOpen}},[r("div",{staticClass:"create-plan-additional-products__heading",on:{click:t.toggleContainer}},[t._v("\n "+t._s(t.trans("additional_products"))+" "),r("strong",[t._v(t._s(t.name))])]),t._v(" "),r("div",{staticClass:"create-plan-additional-products__inner"},[t._t("default")],2)])}),[],!1,null,null,null).exports,l=n({name:"createPlan",mixins:[o.a],components:{ProductPopUp:a,OpenCloseProducts:u,CartProduct:c,SingleProduct:i},data:function(){return{popupOpened:!1}},watch:{productsInCart:function(t,r){this.updateProducts()},powerUsers:function(t,r){}},computed:{productsInCart:function(){return this.$root.productsInCart}},methods:{updateProducts:function(){var t=this;this.$refs.product.forEach((function(r,e){t.productsInCart.find((function(t){return t.id===r.product.id}))||(t.$refs.product[e].cartState=null)}))},changeCurrency:function(t){this.$root.currencyEuro=!t.target.checked},getPriceEachPowerUser:function(){var t=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=0,s=0;return this.$root.productsInCart.forEach((function(r){var o=t.$root.products.find((function(t){return t.id==r.id}));if(1==o.price_per_warehouse)e+=r.amount*parseFloat(o.euro_price),s+=r.amount*parseFloat(o.dollar_price);else if(o.levels.length>0){var n=o.levels[r.level];e+=parseFloat(n[1]),s+=parseFloat(n[2])}else("normal"==o.pricing_product_type||"levels"==o.pricing_product_type)&&(e+=parseFloat(o.euro_price)*r.amount,s+=parseFloat(o.dollar_price)*r.amount)})),r?this.displayCorrectCurrency(e*this.$root.powerUsers,s*this.$root.powerUsers):this.displayCorrectCurrency(e,s)},getTotalPrice:function(){var t=this,r=parseFloat(this.$root.coreProduct.euro_price),e=parseFloat(this.$root.coreProduct.dollar_price),s=0,o=0;this.$root.productsInCart.forEach((function(r){var e=t.$root.products.find((function(t){return t.id==r.id}));if(1==e.price_per_warehouse)s+=r.amount*parseFloat(e.euro_price),o+=r.amount*parseFloat(e.dollar_price);else if(e.levels.length>0){var n=e.levels[r.level];s+=parseFloat(n[1]),o+=parseFloat(n[2])}else("normal"==e.pricing_product_type||"addon"==e.pricing_product_type||"levels"==e.pricing_product_type)&&(s+=parseFloat(e.euro_price)*r.amount,o+=parseFloat(e.dollar_price)*r.amount)}));var n=s*this.$root.powerUsers+r,a=o*this.$root.powerUsers+e;return this.displayCorrectCurrency(n,a)},changePowerUsersAmount:function(t){var r=parseInt(t.target.value);r>=0&&(this.$root.powerUsers=r)},getProductById:function(t){return this.$root.products.find((function(r){return r.id==t}))},scrollToSummary:function(){this.$refs.sidebar.scrollIntoView({behavior:"smooth"})},openPopup:function(){history.replaceState("",document.title,window.location.pathname+"#"+this.slugify(this.$root.coreProduct.translation.name)),this.popupOpened=!0},closePopup:function(){history.replaceState("",document.title,window.location.pathname),this.popupOpened=!1}}},(function(){var t=this,r=t._self._c;return r("div",{staticClass:"create-plan"},[r("div",{staticClass:"create-plan__main"},[r("div",{staticClass:"c-switch"},[r("input",{staticClass:"c-switch__input",attrs:{id:"switch-create-plan-1",type:"checkbox"},on:{change:t.changeCurrency}}),t._v(" "),r("label",{staticClass:"c-switch__label",attrs:{for:"switch-create-plan-1","data-checked":"EUR","data-unchecked":"USD"}})]),t._v(" "),r("div",{staticClass:"u-margin-top-32 create-plan__core-product"},[r("h3",{staticClass:"create-plan__subtitle"},[t._v(t._s(this.$root.coreProduct.translation.name))]),t._v(" "),r("small",[t._v(t._s(t.displayCorrectCurrency(this.$root.coreProduct.euro_price,this.$root.coreProduct.dollar_price))+" / "+t._s(t.trans("month")))]),t._v(" "),r("p",{staticClass:"create-plan__description u-margin-top-16"},[t._v(t._s(this.$root.coreProduct.translation.description))]),t._v(" "),r("ul",{staticClass:"create-plan__checks"},t._l(this.$root.coreProduct.translation.specs,(function(e){return r("li",[t._v(t._s(e))])})),0),t._v(" "),r("div",{staticClass:"create-plan__read-more create-plan__read-more--nm",on:{click:t.openPopup}},[t._v(t._s(t.trans("see_features"))+" "),r("span")])]),t._v(" "),r("product-pop-up",{attrs:{active:t.popupOpened,product:this.$root.coreProduct},on:{close:t.closePopup}}),t._v(" "),r("hr"),t._v(" "),r("h5",{staticClass:"create-plan__title"},[t._v(t._s(t.trans("products")))]),t._v(" "),r("h3",{staticClass:"u-margin-top-32 create-plan__subtitle"},[t._v(t._s(t.trans("products_subtitle_text")))]),t._v(" "),r("div",{staticClass:"create-plan__product-container"},[t._l(this.$root.selectableProducts,(function(e){return[r("single-product",{ref:"product",refInFor:!0,attrs:{product:e}}),t._v(" "),e.hinted_products.length>0?r("open-close-products",{attrs:{name:e.translation.name}},[t._l(e.hinted_products,(function(t){return[r("single-product",{ref:"product",refInFor:!0,attrs:{product:t}})]}))],2):t._e()]}))],2)],1),t._v(" "),r("div",{ref:"sidebar",staticClass:"create-plan__sidebar"},[r("div",{staticClass:"create-plan__heading"},[t._v("\n "+t._s(t.trans("summary"))+"\n ")]),t._v(" "),r("div",{staticClass:"create-plan__cart-overview"},[r("div",{staticClass:"create-plan__cart-product"},[r("strong",[t._v(t._s(t.trans("rentman_title")))]),t._v(" "),r("div",{staticClass:"create-plan__cart-label"},[r("span",[t._v(t._s(t.displayCorrectCurrency(t.$root.coreProduct.euro_price,t.$root.coreProduct.dollar_price)))]),t._v(" / "+t._s(t.trans("month"))+"\n ")])]),t._v(" "),t._l(t.$root.productsInCart,(function(e){return[r("cart-product",{attrs:{"price-per-warehouse":1==t.getProductById(e.id).price_per_warehouse,product:t.getProductById(e.id),"cart-state":e}})]})),t._v(" "),!t.productsInCart.length>0?r("p",{staticClass:"create-plan__cart-label"},[t._v(t._s(t.trans("add_products")))]):t._e()],2),t._v(" "),r("div",{staticClass:"create-plan__footer footer-row"},[r("div",[r("strong",[t._v(t._s(t.trans("power_users"))+"\n "),r("span",{staticClass:"c-tooltip c-tooltip--dark-pop-up js-pricing-prevent-click",attrs:{"data-tooltip":t.trans("power_user_tooltip")}})]),t._v(" "),r("div",{staticClass:"create-plan--small-label"},[t._v(" "+t._s(t.getPriceEachPowerUser())+" "+t._s(t.trans("power_user"))+" / "+t._s(t.trans("month")))])]),t._v(" "),r("div",{staticClass:"create-plan-product__numbers",class:{"c-tooltip c-tooltip--element c-tooltip--dark-pop-up c-tooltip--small":!t.productsInCart.length>0},attrs:{"data-tooltip":t.trans("add_product_first")}},[r("button",{attrs:{disabled:!t.productsInCart.length>0},on:{click:function(r){t.$root.powerUsers++}}},[t._v("+")]),t._v(" "),r("input",{attrs:{type:"number",min:"1",disabled:!t.productsInCart.length>0},domProps:{value:t.$root.powerUsers},on:{change:t.changePowerUsersAmount}}),t._v(" "),r("button",{attrs:{disabled:1===t.$root.powerUsers||!t.productsInCart.length>0},on:{click:function(r){t.$root.powerUsers--}}},[t._v("-")])])]),t._v(" "),r("div",{staticClass:"create-plan__footer footer-row create-plan__footer--no-bt"},[r("div",[r("strong",[t._v(t._s(t.trans("basic_users"))+"\n "),r("span",{staticClass:"c-tooltip c-tooltip--dark-pop-up js-pricing-prevent-click",attrs:{"data-tooltip":t.trans("basic_user_tooltip")}})]),t._v(" "),r("div",{staticClass:"create-plan--small-label"},[t._v(t._s(t.trans("always_free")))])])]),t._v(" "),r("div",{staticClass:"create-plan__footer"},[r("div",{staticClass:"footer-subtotal"},[r("span",[t._v(t._s(t.trans("platform_fee")))]),t._v(" "),this.$root.powerUsers<this.$root.powerUserLimit?r("span",[t._v(t._s(t.displayCorrectCurrency(this.$root.coreProduct.euro_price,this.$root.coreProduct.dollar_price)))]):r("span",[t._v("--")])]),t._v(" "),r("div",{staticClass:"footer-subtotal"},[r("span",[t._v(t._s(t.$root.powerUsers)+" "+t._s(1===t.$root.powerUsers?t.trans("power_user"):t.trans("power_users")))]),t._v(" "),this.$root.powerUsers<this.$root.powerUserLimit?r("span",[t._v(t._s(t.getPriceEachPowerUser(!0)))]):r("span",[t._v("--")])]),t._v(" "),r("div",{staticClass:"footer-total"},[r("strong",[t._v(t._s(t.trans("total")))]),t._v(" "),this.$root.powerUsers<this.$root.powerUserLimit?r("span",[t._v(t._s(t.getTotalPrice()))]):r("span",[t._v(t._s(t.trans("lets_talk")))])]),t._v(" "),this.$root.powerUsers>=this.$root.powerUserLimit?r("div",{staticClass:"custom-plan-notice"},[r("h4",[t._v(t._s(t.trans("custom_plan")))]),t._v(" "),r("p",[t._v(t._s(t.trans("custom_plan_sub")))])]):t._e(),t._v(" "),this.$root.powerUsers<this.$root.powerUserLimit?r("a",{staticClass:"c-button c-button--filled",attrs:{href:t.trans("try_free_link")}},[r("span",{staticClass:"c-button__text"},[t._v(t._s(t.trans("try_free")))])]):t._e(),t._v(" "),r("a",{staticClass:"c-button",class:{"c-button--filled":this.$root.powerUsers>=this.$root.powerUserLimit},attrs:{href:t.trans("speak_expert_link")}},[r("span",{staticClass:"c-button__text"},[t._v(t._s(t.trans("speak_expert")))])])])]),t._v(" "),r("div",{staticClass:"create-plan__sidebar--mobile"},[r("strong",[t._v(t._s(t.trans("total"))+": "+t._s(t.getTotalPrice(!1)))]),t._v(" "),r("span",{staticClass:"c-button c-button--filled",on:{click:t.scrollToSummary}},[r("span",{staticClass:"c-button__text"},[t._v(t._s(t.trans("see_summary")))])])]),t._v(" "),r("div",{staticClass:"create-plan__scroll-up"},[r("span",{on:{click:t.scrollToSummary}},[t._v(t._s(t.trans("price_breakdown")))])])])}),[],!1,null,null,null).exports,p=document.querySelector("#create-plan-vue"),d=p.getAttribute("data-product-data");if(!d)throw new Error("productData is missing");p.removeAttribute("data-product-data");var _=[2,4],v=[5,9],h=[3],f=[8],m=new Set([6]),C=Object.values(JSON.parse(d));C.forEach((function(t){t.requiresEquipmentScheduling=h.includes(t.id),t.requiresEquipmentSchedulingPro=f.includes(t.id),t.requiresPrimary=v.includes(t.id),t.levels=""!=t.levels&&"[]"!=t.levels?JSON.parse(t.levels):[],t.specs=t.translation&&""!=t.translation.specs&&"[]"!=t.translation.specs?JSON.parse(t.translation.specs):[],t.hinted_products=t.hinted_products.split(",");var r=[];t.hinted_products.forEach((function(e,s){var o=C.find((function(t){return t.id==e}));void 0===o?t.hinted_products.splice(s,1):(o.hasParentProduct=!0,o.parentProduct=t.id,r.push(o),m.add(parseInt(e)))})),t.hinted_products=r}));var g=C.find((function(t){return 6==t.id}));if(!g)throw new Error("Core product (Rentman Platform) / Product with id 6 is missing");if(!g.translation)throw new Error("Core product (Rentman Platform) / Product is missing its translation");g.translation.specs=""!==g.translation.specs?Object.values(JSON.parse(g.translation.specs)).map((function(t){return t[0]})):[];var y=C.filter((function(t){return!m.has(t.id)}));Vue.mixin(e("x3uD"));new Vue({el:"#create-plan-vue",components:{CreatePlan:l},data:function(){return{products:C,selectableProducts:y,coreProduct:g,translations:window.rentman.translations,currencyEuro:!0,powerUsers:1,powerUserLimit:15,productsInCart:[]}},computed:{hasAddons:function(){var t=this,r=!1;return this.productsInCart.forEach((function(e){"addon"==t.products.find((function(t){return t.id==e.id})).pricing_product_type&&(r=!0)})),r},primaryProductSelected:function(){var t=!1;return this.productsInCart.map((function(t){return t.id})).forEach((function(r){_.includes(r)&&(t=!0)})),t},equipmentSchedulingSelected:function(){var t=!1;return this.productsInCart.map((function(t){return t.id})).forEach((function(r){2===r&&(t=!0)})),t},equipmentSchedulingProSelected:function(){var t=!1;return this.productsInCart.forEach((function(r){2===r.id&&1===r.level&&(t=!0)})),t}},watch:{productsInCart:{deep:!0,handler:function(){this.equipmentSchedulingProSelected||this.productsInCart.find((function(t){return 8===t.id}))&&(this.productsInCart.find((function(t){return 8===t.id})).amount=0)}}}})},x3uD:function(t,r){t.exports={methods:{isset:function(t){return null!=t},displayCorrectCurrency:function(t,r){return this.getCurrencyIcon()+this.getPrice(t,r)},getPrice:function(t,r){var e=this.$root.currencyEuro?t:r;return"string"==typeof e&&".00"===e.substr(e.length-3)&&(e=e.substr(0,e.length-3)),e},getCurrencyIcon:function(){return this.$root.currencyEuro?"€":"$"},slugify:function(t){t=(t=t.replace(/^\s+|\s+$/g,"")).toLowerCase();for(var r="àáãäâèéëêìíïîòóöôùúüûñç·/_,:;",e=0,s=r.length;e<s;e++)t=t.replace(new RegExp(r.charAt(e),"g"),"aaaaaeeeeiiiioooouuuunc------".charAt(e));return t=t.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")},trans:function(t,r){var e,s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!this.isset(this.$root.translations))return console.warn("Create the translation on the window"),s?t:"";for(var o=t.split("."),n=0;n<o.length&&(0===n||null!==e);)e=0===n?this.$root.translations[o[n]]||null:e[o[n]]||null,n++;if(null===e)return s?(console.warn("No translation for "+t+". Try clearing your session storage."),t):"";if(void 0===r)return e;var a=Object.keys(r);return a.forEach((function(t){e=e.replace("%"+t,r[t])})),e},log:function(t){console.log(t)}}}}});
//# sourceMappingURL=createPlan.js.map