{"version":3,"sources":["webpack:///./app/frontend/src/pages/common_photo_swipe.js","webpack:///./app/frontend/src/pages/common_item_like.js","webpack:///./app/frontend/src/pages/product.js"],"names":["commonPhotoSwipe","mounted","this","lightbox","PhotoSwipeLightbox","gallery","children","pswpModule","init","unmounted","destroy","commonItemLike","methods","like","item_id","axios","post","then","items","error","console","log","unlike","reload","location","attributes","max_amount_to_choose","el","data","mainSliderOptions","slidesToShow","slidesToScroll","fade","asNavFor","navSliderOptions","dots","focusOnSelect","amount","computed","validAmount","validInput","mixins"],"mappings":"gGAAA,qEAEaA,EAAmB,CAC9BC,QAD8B,WAEvBC,KAAKC,WACRD,KAAKC,SAAW,IAAIC,IAAmB,CACrCC,QAAS,cACTC,SAAU,IACVC,WAAY,kBAAM,kCAEpBL,KAAKC,SAASK,SAGlBC,UAX8B,WAYxBP,KAAKC,WACPD,KAAKC,SAASO,UACdR,KAAKC,SAAW,S,gCChBtB,4EAEaQ,EAAiB,CAC5BC,QAAS,CACPC,KADO,SACFC,GAAU,IAAD,OACZC,IAAMC,KAAN,uBAA2BF,IAC1BG,MAAK,WACJ,EAAKC,MAAMJ,IAAW,KAFxB,OAGS,SAAAK,GACPC,QAAQC,IAAIF,OAGhBG,OATO,SASAR,GAA0B,IAAD,OAAhBS,EAAgB,wDAC9BR,IAAK,OAAL,uBAA6BD,IAC5BG,MAAK,WACDM,GAAQC,SAASD,SAEpB,EAAKL,MAAMJ,IAAW,KAJxB,OAKS,SAAAK,GACPC,QAAQC,IAAIF,U,gCCnBpB,2BAGe,mBAASM,GACtB,IAAQC,EAAgCD,EAAhCC,qBAAsBR,EAAUO,EAAVP,MAC9B,MAAO,CACLS,GAAI,OACJC,KAFK,WAGH,MAAO,CACLC,kBAAmB,CACjBC,aAAc,EACdC,eAAgB,EAChBC,MAAM,EACNC,SAAU,eAEZC,iBAAkB,CAChBJ,aAAc,EACdC,eAAgB,EAChBE,SAAU,eACVE,MAAM,EACNC,eAAe,GAEjBC,OAAiC,IAAzBX,EAA6B,GAAK,EAC1CR,UAGJoB,SAAU,CACRC,YADQ,WAEN,OAAOrC,KAAKmC,OAAS,GAEvBG,WAJQ,WAKN,OAAQtC,KAAKqC,cAGjBE,OAAQ,CAACzC,mBAAkBW","file":"js/12-75994b3c3a21f705a93c.chunk.js","sourcesContent":["import PhotoSwipeLightbox from 'photoswipe/dist/photoswipe-lightbox.esm.js'\n \nexport const commonPhotoSwipe = {\n mounted() {\n if (!this.lightbox) {\n this.lightbox = new PhotoSwipeLightbox({\n gallery: '.photoswipe',\n children: 'a',\n pswpModule: () => import('photoswipe/dist/photoswipe.esm.js'),\n });\n this.lightbox.init();\n }\n },\n unmounted() {\n if (this.lightbox) {\n this.lightbox.destroy();\n this.lightbox = null;\n }\n },\n}","import axios from 'axios'\n\nexport const commonItemLike = {\n methods: {\n like(item_id) {\n axios.post(`/likes/items/${item_id}`)\n .then(() => {\n this.items[item_id] = true\n }).catch(error => {\n console.log(error)\n })\n },\n unlike(item_id, reload = false) {\n axios.delete(`/likes/items/${item_id}`)\n .then(() => {\n if(reload) location.reload()\n\n this.items[item_id] = false\n }).catch(error => {\n console.log(error)\n })\n }\n }\n}","import { commonPhotoSwipe } from './common_photo_swipe'\nimport { commonItemLike } from './common_item_like'\n\nexport default function(attributes) {\n const { max_amount_to_choose, items } = attributes;\n return {\n el: '#app',\n data() {\n return {\n mainSliderOptions: {\n slidesToShow: 1,\n slidesToScroll: 1,\n fade: true,\n asNavFor: '.nav-slider',\n },\n navSliderOptions: {\n slidesToShow: 5,\n slidesToScroll: 1,\n asNavFor: '.main-slider',\n dots: true,\n focusOnSelect: true\n },\n amount: max_amount_to_choose === 0 ? '' : 1,\n items,\n }\n },\n computed: {\n validAmount() {\n return this.amount > 0\n },\n validInput() {\n return (this.validAmount)\n },\n },\n mixins: [commonPhotoSwipe, commonItemLike]\n }\n}\n"],"sourceRoot":""}