{"version":3,"sources":["webpack:///./resources/js/src/app/components/item/AddToWishList.vue","webpack:///resources/js/src/app/components/item/AddToWishList.vue","webpack:///./resources/js/src/app/components/item/AddToWishList.vue?7904","webpack:///./resources/js/src/app/components/item/AddToWishList.vue?8891"],"names":["render","_vm","this","_c","_self","directives","name","rawName","ref","staticClass","attrs","title","tooltipText","on","click","$event","preventDefault","switchState","class","isVariationInWishList","icon","loading","isLoading","_v","_s","$translate","_withStripped","NotificationService","require","props","variationId","Number","inject","itemId","default","data","computed","_objectSpread","wishListIds","includes","currentVariationId","isNullOrUndefined","currentVariationVariationId","currentVariation","$store","getters","concat","variation","id","mapState","state","wishList","methods","removeFromWishList","addToWishList","_this","dispatch","parseInt","then","response","success","closeAfter","error","_this2","component"],"mappings":"kGAAA,IAAIA,EAAS,WACX,IAAIC,EAAMC,KACRC,EAAKF,EAAIG,MAAMD,GACjB,OAAOA,EACL,SACA,CACEE,WAAY,CAAC,CAAEC,KAAM,UAAWC,QAAS,cACzCC,IAAK,gBACLC,YAAa,iCACbC,MAAO,CACL,cAAe,UACf,iBAAkB,MAClBC,MAAOV,EAAIW,aAEbC,GAAI,CACFC,MAAO,SAAUC,GAEf,OADAA,EAAOC,iBACAf,EAAIgB,iBAIjB,CACEd,EAAG,OAAQ,CACTM,YAAa,gBACbS,MAAO,CAAE,8BAA+BjB,EAAIkB,uBAC5CT,MAAO,CAAEU,KAAM,QAASC,QAASpB,EAAIqB,aAEvCrB,EAAIsB,GACF,SACEtB,EAAIuB,GAAGvB,EAAIwB,WAAW,uCACtB,OAGN,IAIJzB,EAAO0B,eAAgB,E,0+BCpBvB,IAAAC,EAAAC,EAAA,ICjBoN,EDmBrM,CAEftB,KAAA,mBAEAuB,MAAA,CACAC,YAAAC,QAGAC,OAAA,CACAC,OAAA,CACAC,QAAA,OAIAC,KAAA,WAEA,OACAb,WAAA,IAIAc,S,+VAAAC,CAAA,CAEAlB,sBAAA,WAEA,YAAAmB,YAAAC,SAAA,KAAAC,qBAGAA,mBAAA,WAEA,OAAAC,YAAA,KAAAX,aAAA,KAAAY,4BAAA,KAAAZ,aAGAY,4BAAA,WAEA,IAAAC,EAAA,KAAAC,OAAAC,QAAA,GAAAC,OAAA,KAAAb,OAAA,0BAEA,OAAAQ,YAAAE,GAEA,KAGAA,KAAAI,WAAAJ,EAAAI,UAAAC,IAGApC,YAAA,WAEA,IAAAA,EAAA,KAAAa,WACA,yBAAAN,sBAAA,qDAIA,OAAAP,IAGAqC,YAAA,CACAX,YAAA,SAAAY,GAAA,OAAAA,EAAAC,SAAAb,gBAIAc,QACA,CACAnC,YAAA,WAEA,KAAAE,sBAEA,KAAAkC,qBAIA,KAAAC,iBAIAA,cAAA,WACA,IAAAC,EAAA,KACA,KAAAjC,YAEA,KAAAA,WAAA,EACA,KAAAsB,OAAAY,SAAA,gBAAAC,SAAA,KAAAjB,qBAAAkB,MACA,SAAAC,GAEAJ,EAAAjC,WAAA,EAEAK,EAAAiC,QACAL,EAAA9B,WAAA,4CACAoC,WAAA,QAEA,SAAAC,GAEAP,EAAAjC,WAAA,OAKA+B,mBAAA,WACA,IAAAU,EAAA,KACA,KAAAzC,YAEA,KAAAA,WAAA,EACA,KAAAsB,OAAAY,SAAA,sBAAAR,GAAAS,SAAA,KAAAjB,sBAAAkB,MAAA,SAAAC,GAEAI,EAAAzC,WAAA,EAEAK,EAAAiC,QACAG,EAAAtC,WAAA,8CACAoC,WAAA,QAEA,SAAAC,GAEAC,EAAAzC,WAAA,S,OE1HI0C,EAAY,YACd,EACAhE,EH2BoB,IGzBpB,EACA,KACA,KACA,MAIa,UAAAgE,E","file":"chunks/ceres-31.min.js","sourcesContent":["var render = function render() {\n var _vm = this,\n _c = _vm._self._c\n return _c(\n \"button\",\n {\n directives: [{ name: \"tooltip\", rawName: \"v-tooltip\" }],\n ref: \"addToWishList\",\n staticClass: \"btn btn-link btn-sm text-muted\",\n attrs: {\n \"data-toggle\": \"tooltip\",\n \"data-placement\": \"top\",\n title: _vm.tooltipText,\n },\n on: {\n click: function ($event) {\n $event.preventDefault()\n return _vm.switchState()\n },\n },\n },\n [\n _c(\"icon\", {\n staticClass: \"default-float\",\n class: { \"text-appearance text-danger\": _vm.isVariationInWishList },\n attrs: { icon: \"heart\", loading: _vm.isLoading },\n }),\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.$translate(\"Ceres::Template.singleItemWishList\")) +\n \"\\n\"\n ),\n ],\n 1\n )\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","<template>\n <button class=\"btn btn-link btn-sm text-muted\"\n @click.prevent=\"switchState()\"\n data-toggle=\"tooltip\"\n data-placement=\"top\"\n ref=\"addToWishList\"\n v-tooltip\n :title=\"tooltipText\">\n <icon icon=\"heart\" class=\"default-float\" :class=\"{'text-appearance text-danger': isVariationInWishList}\" :loading=\"isLoading\"></icon>\n {{ $translate(\"Ceres::Template.singleItemWishList\") }}\n </button>\n</template>\n\n<script>\nimport { isNullOrUndefined } from \"../../helper/utils\";\nimport { mapState } from \"vuex\";\n\nconst NotificationService = require(\"../../services/NotificationService\");\n\nexport default {\n\n name: \"add-to-wish-list\",\n\n props: {\n variationId: Number\n },\n\n inject: {\n itemId: {\n default: null\n }\n },\n\n data()\n {\n return {\n isLoading: false\n };\n },\n\n computed:\n {\n isVariationInWishList()\n {\n return this.wishListIds.includes(this.currentVariationId);\n },\n\n currentVariationId()\n {\n return !isNullOrUndefined(this.variationId) ? this.variationId : this.currentVariationVariationId;\n },\n\n currentVariationVariationId()\n {\n const currentVariation = this.$store.getters[`${this.itemId}/currentItemVariation`];\n\n if (isNullOrUndefined(currentVariation))\n {\n return null;\n }\n\n return currentVariation && currentVariation.variation && currentVariation.variation.id;\n },\n\n tooltipText()\n {\n const tooltipText = this.$translate(\n \"Ceres::Template.\" + (this.isVariationInWishList ? \"singleItemWishListRemove\" : \"singleItemWishListAdd\")\n );\n\n\n return tooltipText;\n },\n\n ...mapState({\n wishListIds: state => state.wishList.wishListIds\n })\n },\n\n methods:\n {\n switchState()\n {\n if (this.isVariationInWishList)\n {\n this.removeFromWishList();\n }\n else\n {\n this.addToWishList();\n }\n },\n\n addToWishList()\n {\n if (!this.isLoading)\n {\n this.isLoading = true;\n this.$store.dispatch(\"addToWishList\", parseInt(this.currentVariationId)).then(\n response =>\n {\n this.isLoading = false;\n\n NotificationService.success(\n this.$translate(\"Ceres::Template.singleItemWishListAdded\")\n ).closeAfter(3000);\n },\n error =>\n {\n this.isLoading = false;\n });\n }\n },\n\n removeFromWishList()\n {\n if (!this.isLoading)\n {\n this.isLoading = true;\n this.$store.dispatch(\"removeWishListItem\", { id: parseInt(this.currentVariationId) }).then(response =>\n {\n this.isLoading = false;\n\n NotificationService.success(\n this.$translate(\"Ceres::Template.singleItemWishListRemoved\")\n ).closeAfter(3000);\n },\n error =>\n {\n this.isLoading = false;\n });\n }\n }\n }\n}\n\n</script>\n","import mod from \"-!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AddToWishList.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AddToWishList.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./AddToWishList.vue?vue&type=template&id=55f74268\"\nimport script from \"./AddToWishList.vue?vue&type=script&lang=js\"\nexport * from \"./AddToWishList.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}