{"version":3,"sources":["vueCurrency.js"],"names":["vueCurrency","Vue","name","el","data","mixins","currency","mounted","vm","generalMixin","getCookie","setCookie","incVAT","document","querySelector","currencySelect","getItem","changeCurrency","localStorage","methods","changeVat","value","event","getElementById","checked","vueProduct","setItem","this","textContent"],"mappings":"aAAA,MAAMA,YAAc,IAAIC,IAAI,CAC3BC,KAAM,cADPC,GAAA,gBAGCC,KAFI,CACJD,OAAI,EACJC,SAAM,OAINC,OAFCC,CAAAA,cAGDC,QAFC,WACDF,MAAMG,EAAGC,KAWR,GAVoB,MAArBF,EAAOG,UAAE,WAGPF,EAFDG,UAAW,SAAI,GAGdH,EAFDI,OAAOF,GAINF,EAFAA,OAASA,EAAGE,UAAC,UAKI,MAFlBG,SAAAC,cAAA,uBAEqBD,CAIR,MAHTE,aAAwBC,QAAA,aAI1BR,EAAGS,iBAGJT,EACDF,SAAAY,aAAAF,QAAA,cAGDG,QAEE,CADDC,UAEOC,SAAQC,GADd,MAGAd,EAAIa,KACHR,EAASU,EAAAA,OAAAA,MAED,GAHLF,EACHR,SAGDU,eAAA,WAAAC,SAAA,EADCX,SAKEF,eAAkB,WAAQa,SAAA,EAF7BhB,EAAGI,OAMFa,EAJDjB,EAMAG,UAAA,SAAAU,GAEe,oBAAPI,aALPA,WAMDP,QAAaQ,OAAQlB,EAAAI,OALpBa,WAOGZ,aAJLI,eAOA,WAEAC,aAAAQ,QAAA,WAAAC,KAAArB,UALKO,SAASC,cAAc,yBAC1BD,SAASC,cAAc,uBAAuBc,YAAcD,KAAKrB","file":"../vueCurrency.js","sourcesContent":["const vueCurrency = new Vue({\r\n\tname: 'vueCurrency',\r\n\tel: '.vue-currency',\r\n\tdata: {\r\n\t\tincVAT: 1,\r\n\t\tcurrency: 'GBP',\r\n\t},\r\n\tmixins: [generalMixin],\r\n\tmounted: function () {\r\n\t\tconst vm = this;\r\n\t\tif (vm.getCookie('incVAT') == null) {\r\n\t\t\tvm.setCookie('incVAT', 1);\r\n\t\t\tvm.incVAT = 1;\r\n\t\t} else {\r\n\t\t\tvm.incVAT = vm.getCookie('incVAT');\r\n\t\t}\r\n\r\n\t\tvar currencySelect = document.querySelector('.js-currency-select');\r\n\t\tif (currencySelect != null) {\r\n\t\t\tconst currency = localStorage.getItem('currency');\r\n\r\n\t\t\tif (currency == null) {\r\n\t\t\t\tvm.changeCurrency();\r\n\t\t\t}\r\n\r\n\t\t\tvm.currency = localStorage.getItem('currency');\r\n\t\t}\r\n\t\t\r\n\t},\r\n\tmethods: {\r\n\t\tchangeVat: function (event) {\r\n\t\t\tconst vm = this;\r\n\t\t\tconst value = event.target.value;\r\n\r\n\t\t\tif (value == 1) {\r\n\t\t\t\tdocument.getElementById('inc-vat').checked = true;\r\n\t\t\t} else {\r\n\t\t\t\tdocument.getElementById('exc-vat').checked = true;\r\n\t\t\t}\r\n\r\n\t\t\tvm.incVAT = value;\r\n\r\n\t\t\tvm.setCookie('incVAT', value);\r\n\r\n\t\t\tif (typeof vueProduct !== 'undefined') {\r\n\t\t\t\tvueProduct.product.incVAT = vm.incVAT;\r\n\t\t\t\tvueProduct.setPrice();\r\n\t\t\t}\r\n\t\t},\r\n\t\tchangeCurrency: function () {\r\n\t\t\tconst vm = this;\r\n\t\t\tlocalStorage.setItem('currency', this.currency);\r\n\r\n\t\t\tif (document.querySelector('.js-mobile-currency')) {\r\n\t\t\t\tdocument.querySelector('.js-mobile-currency').textContent = this.currency;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n});\r\n"]}