exports.ids = [36];
exports.modules = {

/***/ 121:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony import */ var _src_components_VOverlay_VOverlay_sass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(137);
/* harmony import */ var _src_components_VOverlay_VOverlay_sass__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_src_components_VOverlay_VOverlay_sass__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _mixins_colorable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
/* harmony import */ var _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
/* harmony import */ var _mixins_toggleable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(45);
/* harmony import */ var _util_mixins__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6);
// Styles
 // Mixins



 // Utilities


/* @vue/component */

/* harmony default export */ __webpack_exports__["a"] = (Object(_util_mixins__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(_mixins_colorable__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"], _mixins_themeable__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"], _mixins_toggleable__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"]).extend({
  name: 'v-overlay',
  props: {
    absolute: Boolean,
    color: {
      type: String,
      default: '#212121'
    },
    dark: {
      type: Boolean,
      default: true
    },
    opacity: {
      type: [Number, String],
      default: 0.46
    },
    value: {
      default: true
    },
    zIndex: {
      type: [Number, String],
      default: 5
    }
  },
  computed: {
    __scrim() {
      const data = this.setBackgroundColor(this.color, {
        staticClass: 'v-overlay__scrim',
        style: {
          opacity: this.computedOpacity
        }
      });
      return this.$createElement('div', data);
    },
    classes() {
      return {
        'v-overlay--absolute': this.absolute,
        'v-overlay--active': this.isActive,
        ...this.themeClasses
      };
    },
    computedOpacity() {
      return Number(this.isActive ? this.opacity : 0);
    },
    styles() {
      return {
        zIndex: this.zIndex
      };
    }
  },
  methods: {
    genContent() {
      return this.$createElement('div', {
        staticClass: 'v-overlay__content'
      }, this.$slots.default);
    }
  },
  render(h) {
    const children = [this.__scrim];
    if (this.isActive) children.push(this.genContent());
    return h('div', {
      staticClass: 'v-overlay',
      on: this.$listeners,
      class: this.classes,
      style: this.styles
    }, children);
  }
}));

/***/ }),

/***/ 137:
/***/ (function(module, exports) {

// Exports
module.exports = {

};


/***/ }),

/***/ 201:
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__.p + "img/DeliveryIcon.b12283b.svg";

/***/ }),

/***/ 236:
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__.p + "img/shippingIcon.26a9001.svg";

/***/ }),

/***/ 380:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VBtn/VBtn.js
var VBtn = __webpack_require__(101);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VCard/VCard.js
var VCard = __webpack_require__(97);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VCol.js
var VCol = __webpack_require__(110);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VOverlay/VOverlay.js
var VOverlay = __webpack_require__(121);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VProgressCircular/VProgressCircular.js
var VProgressCircular = __webpack_require__(30);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VRow.js
var VRow = __webpack_require__(109);

// CONCATENATED MODULE: ./node_modules/vuetify-loader/lib/loader.js??ref--4!./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Pricing2.vue?vue&type=template&id=0ad17a63







var Pricing2vue_type_template_id_0ad17a63_render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c(VCard["a" /* default */], {
    staticClass: "pr-2 elevation-0",
    attrs: {
      "color": "transparent",
      "width": "100%"
    }
  }, [_vm.totalPrice > 0 ? _c(VRow["a" /* default */], [_c(VCol["a" /* default */], {
    staticClass: "pb-0",
    attrs: {
      "cols": "12",
      "lg": "6",
      "md": "12",
      "sm": "12"
    }
  }, [_c(VOverlay["a" /* default */], {
    attrs: {
      "value": _vm.loading,
      "color": "rgba(255, 255, 255, 0.6)"
    }
  }, [_vm.loading ? _c(VProgressCircular["a" /* default */], {
    attrs: {
      "size": 60,
      "color": "black",
      "indeterminate": ""
    }
  }) : _vm._e()], 1), _vm._v(" "), _c('div', {
    staticClass: "d-flex"
  }, [_c('h1', {
    staticClass: "text-20 FF_Manrope font-weight-bold ml-n3"
  }, [_vm._v("\n          Total Price:\n        ")]), _vm._v(" "), !_vm.versionIsSelected ? _c('div', [_vm.product.originalPrice < _vm.totalPrice ? _c('p', {
    staticClass: "text-16 red--text FF_Manrope font-weight-bold text-decoration-line-through mr-3 mb-0 mt-1 ml-2"
  }, [_vm._v("\n            $" + _vm._s((_vm.totalPrice / 100 - _vm.calculateDifference).toFixed(2)))]) : _vm._e(), _vm._v(" "), _vm.product.originalPrice > _vm.totalPrice ? _c('p', {
    staticClass: "text-16 red--text FF_Manrope font-weight-bold text-decoration-line-through mr-3 mb-0 mt-1 ml-2"
  }, [_vm._v("\n            $" + _vm._s((_vm.product.originalPrice / 100).toFixed(2)))]) : _vm._e(), _vm._v(" "), _c('p', {
    staticClass: "text-16 FF_Manrope font-weight-bold mb-0 mt-1 ml-2"
  }, [_vm._v("$" + _vm._s((_vm.totalPrice / 100).toFixed(2)))])]) : _vm._e()])], 1)], 1) : _vm._e(), _vm._v(" "), _c(VRow["a" /* default */], [_c(VCol["a" /* default */], {
    staticClass: "py-0 pl-0",
    attrs: {
      "cols": "12",
      "lg": "6",
      "md": "12",
      "sm": "12"
    }
  }, [!_vm.versionIsSelected ? _c('p', {
    staticClass: "text-16 font-weight-regular FF_Manrope mb-2"
  }, [_vm._v("\n        select a version for pricing\n      ")]) : _vm._e(), _vm._v(" "), _c('div', [_c('div', {
    staticClass: "mt-1 d-flex"
  }, [_c('img', {
    attrs: {
      "src": __webpack_require__(201),
      "alt": "Delivery Time",
      "width": "14"
    }
  }), _vm._v(" "), _c('p', {
    staticClass: "text-10 FF_Manrope mb-0 ml-2 font-weight-light black1--text"
  }, [_vm._v("\n            Delivery time:\n            " + _vm._s(_vm.product.deliveryTime) + "\n          ")])]), _vm._v(" "), _c('div', {
    staticClass: "d-flex mt-1"
  }, [_vm.product.threshold ? _c('img', {
    staticClass: "mb-2",
    attrs: {
      "src": __webpack_require__(236),
      "alt": "Free Shipping",
      "width": "14"
    }
  }) : _vm._e(), _vm._v(" "), _c('p', {
    staticClass: "text-10 FF_Manrope font-weight-light ml-2 black1--text"
  }, [_vm._v("\n            " + _vm._s(_vm.product.threshold) + "\n          ")])])])]), _vm._v(" "), _c(VCol["a" /* default */], {
    staticClass: "px-0 py-0",
    attrs: {
      "cols": "12",
      "lg": "5",
      "md": "12",
      "sm": "12"
    }
  }, [!_vm.versionIsSelected ? _c('p', {
    staticClass: "text-10 FF_Manrope font-weight-light text-center mb-2"
  }, [_vm._v("\n        Depending on the prod version price may change\n      ")]) : _vm._e(), _vm._v(" "), _c('div', {
    staticClass: "text-right"
  }, [_vm.versionIsSelected ? _c(VBtn["a" /* default */], {
    staticClass: "white--text text-capitalize py-7 px-15 elevation-0",
    staticStyle: {
      "border-radius": "10px !important"
    },
    attrs: {
      "block": "",
      "color": "#1CA3C2"
    },
    on: {
      "click": _vm.addToCart
    }
  }, [_vm._v("\n          Add to cart\n        ")]) : _c(VBtn["a" /* default */], {
    staticClass: "white--text text-capitalize py-7 px-15 elevation-0",
    staticStyle: {
      "border-radius": "10px !important"
    },
    attrs: {
      "block": "",
      "color": "#1CA3C2"
    },
    on: {
      "click": _vm.addToCart
    }
  }, [_vm._v("\n          Check for your car\n        ")])], 1)])], 1)], 1);
};
var staticRenderFns = [];

// CONCATENATED MODULE: ./components/Pricing2.vue?vue&type=template&id=0ad17a63

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(9);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Pricing2.vue?vue&type=script&lang=js

/* harmony default export */ var Pricing2vue_type_script_lang_js = ({
  props: ["addonsData", "product", "cartData", "data", "dropDown", "pricing", "AccessoriesPrice", "reuiredAddonsPrice", "showTotalPrice", "versionIsSelected"],
  data() {
    return {
      addToCartBtn: false,
      loading: false,
      category: false,
      cartPrice: 0
    };
  },
  methods: {
    ...Object(external_vuex_["mapActions"])(["add_to_cart", "show_cart_items"]),
    addToCart() {
      if (!this.versionIsSelected) {
        this.$emit('openVersionDialog', true);
        return;
      }
      if (!this.data.termsAndCondition && this.product.compatibility != 'Yes' && !this.isCategoryRoute) {
        this.data.error = true;
      } else {
        var _this$product, _this$product$dropDow;
        this.addToCartBtn = true;
        this.loading = true;
        this.cartData.productId = this.product.id;
        this.cartData.productName = this.product.name, this.cartData.variantId = this.product.variant_id;
        for (const key in this.dropDown) {
          if (this.dropDown.hasOwnProperty(key) && this.dropDown[key] !== "") {
            this.cartData.dropDown.push(this.dropDown[key]);
          }
        }
        (_this$product = this.product) === null || _this$product === void 0 ? void 0 : (_this$product$dropDow = _this$product.dropDown) === null || _this$product$dropDow === void 0 ? void 0 : _this$product$dropDow.forEach(item => {
          item.options.forEach(option => {
            if (option.id == item.selectedDropDownOption) this.cartData.dropDown.push(option.id);
          });
        });
        if (false) { var id; }
        const firstObject = this.cartData;
        console.log("waqar,", firstObject);
        const secondObject = this.product;
        const price = this.cartPrice;
        this.add_to_cart({
          firstObject,
          secondObject,
          price
        }).then(response => {
          var _this$product2;
          this.loading = false;
          //console.log('length',this.product?.addons)
          if (!((_this$product2 = this.product) !== null && _this$product2 !== void 0 && _this$product2.addons)) {
            this.$router.push({
              path: 'cart'
            });
          }
          if (false) {}
          this.$nuxt.$emit("loadCartData", response.data);

          //this.showCartItems();
        }).catch(error => {
          console.log("error");
        });
      }
    },
    showCartItems() {
      let cartId = this.getCartId;
      if (false) {}
      this.show_cart_items(cartId).then(response => {}).catch(error => {
        console.log("error");
      });
    }
  },
  computed: {
    ...Object(external_vuex_["mapGetters"])(["getCartId"]),
    isCategoryRoute() {
      return this.$route.path.startsWith('/category-');
    },
    calculateDifference() {
      let difference = (this.product.originalPrice - this.product.price) / 100;
      return difference;
    },
    totalPrice() {
      var _this$product7, _this$product7$dropDo;
      var productPrice = this.product.price;
      if (this.cartData.addons.length > 0) this.cartData.addons.forEach((addonCart, index) => {
        var _this$product3, _this$product3$addons, _this$product4, _this$product4$access, _this$product5, _this$product5$cheape, _this$product6, _this$product6$instal;
        (_this$product3 = this.product) === null || _this$product3 === void 0 ? void 0 : (_this$product3$addons = _this$product3.addons) === null || _this$product3$addons === void 0 ? void 0 : _this$product3$addons.forEach((addon, index) => {
          if (addonCart == addon.variant_id) {
            productPrice += addon.price;
          }
        });
        (_this$product4 = this.product) === null || _this$product4 === void 0 ? void 0 : (_this$product4$access = _this$product4.accessories) === null || _this$product4$access === void 0 ? void 0 : _this$product4$access.forEach((addon, index) => {
          if (addonCart == addon.id) {
            productPrice += addon.price;
          }
        });
        (_this$product5 = this.product) === null || _this$product5 === void 0 ? void 0 : (_this$product5$cheape = _this$product5.cheaperSets) === null || _this$product5$cheape === void 0 ? void 0 : _this$product5$cheape.forEach((addon, index) => {
          if (addonCart == addon.id) {
            productPrice += addon.price;
          }
        });
        (_this$product6 = this.product) === null || _this$product6 === void 0 ? void 0 : (_this$product6$instal = _this$product6.installationAccessories) === null || _this$product6$instal === void 0 ? void 0 : _this$product6$instal.forEach((addon, index) => {
          if (addonCart == addon.id) {
            productPrice += addon.price;
          }
        });
      });
      if (this.cartData.includedAddons && Array.isArray(this.cartData.includedAddons) && this.cartData.includedAddons.length > 0) {
        this.cartData.includedAddons.forEach(addonCart => {
          if (this.product.requiredAddons && Array.isArray(this.product.requiredAddons)) {
            this.product.requiredAddons.forEach(addon => {
              if (addonCart === addon.id) {
                productPrice += addon.price;
              }
            });
          }
        });
      }
      (_this$product7 = this.product) === null || _this$product7 === void 0 ? void 0 : (_this$product7$dropDo = _this$product7.dropDown) === null || _this$product7$dropDo === void 0 ? void 0 : _this$product7$dropDo.forEach(item => {
        item.options.forEach(option => {
          if (option.id == item.selectedDropDownOption) productPrice += option.price;
        });
      });

      //console.log('here on warranty side');
      //console.log(this.cartData.warranty,this.product.warranty,this.product.warranty_type);

      if (this.product.warranty && Array.isArray(this.product.warranty) && this.product.warranty.length > 0) {
        if (!this.cartData.warranty) this.cartData.warranty = this.product.warranty[0].variant_id;
        this.product.warranty.forEach((warranty, index) => {
          //console.log(warranty.id);
          //console.log(JSON.stringify(warranty));
          if (warranty.variant_id === this.cartData.warranty) {
            if (this.product.warranty_type === 'old_warranty') {
              productPrice += productPrice * (warranty.price / 10000);
            }
          }
        });
      }
      /*
        const usbType = Number(this.dropDown.selectedUsbType);
        const testOptions = Number(this.dropDown.selectedTestOptions);
        const warranty = Number(this.dropDown.waranty);
        const combinedArray = [
          ...this.pricing,
          ...this.AccessoriesPrice,
          ...this.reuiredAddonsPrice,
        ];
        const total =
          combinedArray.reduce((acc, val) => acc + val, 0) +
          this.product.price +
          usbType +
          testOptions +
          warranty;
             */
      this.cartPrice = productPrice;
      return productPrice;
    }
  },
  mounted() {
    if (this.$route.fullPath.includes("category")) {
      this.category = true;
    }
  }
});
// CONCATENATED MODULE: ./components/Pricing2.vue?vue&type=script&lang=js
 /* harmony default export */ var components_Pricing2vue_type_script_lang_js = (Pricing2vue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(21);

// CONCATENATED MODULE: ./components/Pricing2.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_Pricing2vue_type_script_lang_js,
  Pricing2vue_type_template_id_0ad17a63_render,
  staticRenderFns,
  false,
  null,
  null,
  "248d79ec"
  
)

/* harmony default export */ var Pricing2 = __webpack_exports__["default"] = (component.exports);

/***/ })

};;
//# sourceMappingURL=pricing2.js.map