{"version":3,"sources":["before.js","single.js","after.js"],"names":["$","nextArrow","OpalWoocommerceSingleProduct","_classCallCheck","this","self","initSlideProduct","on","hasClass","productVerticalSlider","productHorizontalSlider","one","$image","setTimeout","css","height","$slider_height","overflow","_createClass","key","value","lightbox","length","attr","rtl","$slider","child_height","has_slider","each","i","e","slidesToShow","not","slick","infinite","verticalSwiping","child_width","$slider_width","jQuery"],"mappings":"8XAAA,SAAAA,GC8GAC,ID9GA,WCCA,QAAAC,KAAAC,gBAAAC,KAAAF,EACA,IAAAG,GAAAD,IAEAA,MAAAE,mBDJAN,EAAA,gCAAAO,GAAA,gCAAA,WAAAP,EAAA,QAAAQ,SAAA,+BCCAH,EAAAI,wBASAT,EAAA,QAAAQ,SAAA,+BARAH,EAAAK,4BAIAV,EAAAA,QAAAA,SAAAA,+BACAA,EAAA,kGAAAW,IAAA,OAAA,WACAN,GAAAA,GAAAA,EAAAA,KACAO,IACAC,WAAA,WACAR,GAAAA,GAAAA,EAAAA,QAAAA,uCAAAA,QACAL,GAAA,iFACAc,KAUAC,OAAAC,EARAC,SAAA,WAGAjB,EAAA,gCAAAO,GAAA,gCAAA,WACAM,EAAAA,2BAEA,ODrBA,MAAAK,cAAAhB,IAAAiB,IAAA,mBAAAC,MAAA,WC4BAf,GAAAA,GAAAA,EAAAA,0DACAgB,GAAAC,QACAD,EAAAE,KAAA,+BAAA,SD9BAJ,IAAA,wBAAAC,MAAA,WC4CA,GAAAI,GAAAxB,EAAA,QAAAQ,SAAA,OD5CAiB,EAAAzB,EAAA,iFAAAgB,EAAAhB,EAAA,6EAAAe,SCsCAW,EAAA,EACAL,EAAAA,EACAM,GAAA,CDxCA3B,GAAA,wDAAA4B,KAAA,SAAAC,EAAAC,GAAA,IAAAJ,GAAA,IAAAV,EC8CA,MAFAe,GAAAF,EAaAF,GAAA,GAXA,IAGAF,EAAAO,IAAA,sBAAAC,OAEAT,IAAAA,EAaAU,UAAA,EAXAlC,aAAAA,EACA0B,UAAAA,EACAS,iBAAA,EACAJ,UAAAA,wIACAJ,UAAAA,wIAGAA,EAaAF,EAAAQ,MAAA,iBAAA,eAAAF,GAVAP,EAAAA,MAAAA,cD/DAL,IAAA,0BAAAC,MAAA,WCqEAnB,QAAAA,IAAAA,QAPA,IAAAuB,GAAAxB,EAAA,QAAAQ,SAAA,OAUAiB,EAAAzB,EAAA,iFACAyB,EAAAA,EAAAA,2EAAAA,OACAA,GAAAX,KACAW,MAAAA,EACAR,SAAA,UD5EA,IAAAmB,GAAA,EAAAL,EAAA,EAAAJ,GAAA,CCkFA3B,GAAA,wDAAA4B,KAAA,SAAAC,EAAAC,GAEA,IAWAM,GAAA,IAXAC,EAGA,MAFAN,GAAAF,EACAJ,GAAAA,GACA,IAGAA,EAAAO,IAAA,sBAAAC,OAEAT,IAAAA,EAaAU,UAAA,EAXAlC,aAAAA,EACAoC,UAAAA,EACAD,iBAAA,EACAJ,UAAAA,0IACAJ,UAAAA,yIAGAA,EAaAF,EAAAQ,MAAA,iBAAA,eAAAF,GAVAP,EAAAA,MAAAA,eDxGAtB,OEAAoC","file":"single.js","sourcesContent":["(function ($) {","class OpalWoocommerceSingleProduct {\n constructor() {\n var self = this;\n \n this.initSlideProduct();\n\n $('.woocommerce-product-gallery').on('wc-product-gallery-after-init', function () {\n if ($('body').hasClass('woocommerce-single-style-4')) {\n self.productVerticalSlider();\n }\n if ($('body').hasClass('woocommerce-single-style-1')) {\n self.productHorizontalSlider();\n }\n });\n\n if ($('body').hasClass('woocommerce-single-style-4')) {\n $( '.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image' ).one( 'load', function() {\n var $image = $( this );\n if ( $image ) {\n setTimeout( function() {\n var $slider_height = $image.closest( '.woocommerce-product-gallery__image' ).height();\n var $slider = $('.woocommerce-single-style-4 .woocommerce-product-gallery .flex-control-thumbs');\n $slider.css({\n 'height': $slider_height,\n 'overflow': 'hidden'\n });\n\n $('.woocommerce-product-gallery').on('wc-product-gallery-after-init', function () {\n self.productVerticalSlider();\n });\n }, 100 );\n }\n } )\n }\n }\n\n initSlideProduct() {\n let lightbox = $('.single-product .woocommerce-product-gallery__image > a');\n if (lightbox.length) {\n lightbox.attr(\"data-elementor-open-lightbox\", \"no\");\n }\n }\n\n productVerticalSlider() {\n var rtl = $('body').hasClass('rtl');\n \n var $slider = $('.woocommerce-single-style-4 .woocommerce-product-gallery .flex-control-thumbs');\n let $slider_height = $('.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image').height();\n \n let child_height = 0,\n slidesToShow = 5;\n let has_slider = false;\n\n $('.woocommerce-product-gallery .flex-control-thumbs li').each(function (i, e) {\n child_height += 90;\n if (child_height > $slider_height) {\n slidesToShow = i;\n has_slider = true;\n return false;\n }\n });\n\n $slider.not('.slick-initialized').slick({\n rtl: rtl,\n infinite: false,\n slidesToShow: slidesToShow,\n vertical: true,\n verticalSwiping: true,\n prevArrow:\"\",\n nextArrow:\"\"\n });\n\n if (has_slider) {\n $slider.slick('slickSetOption', 'slidesToShow', slidesToShow);\n }else {\n $slider.slick('unslick');\n }\n\n }\n \n productHorizontalSlider() {\n console.log('tesst');\n var rtl = $('body').hasClass('rtl');\n \n var $slider = $('.woocommerce-single-style-1 .woocommerce-product-gallery .flex-control-thumbs');\n let $slider_width = $('.woocommerce-single-style-1 .woocommerce-product-gallery .flex-viewport').width();\n $slider.css({\n 'width': $slider_width,\n 'overflow': 'hidden'\n });\n let child_width = 0,\n slidesToShow = 5;\n let has_slider = false;\n\n $('.woocommerce-product-gallery .flex-control-thumbs li').each(function (i, e) {\n child_width += 90;\n if (child_width > $slider_width) {\n slidesToShow = i;\n has_slider = true;\n return false;\n }\n });\n\n $slider.not('.slick-initialized').slick({\n rtl: rtl,\n infinite: false,\n slidesToShow: slidesToShow,\n vertical: false,\n verticalSwiping: false,\n prevArrow:\"\",\n nextArrow:\"\"\n });\n\n if (has_slider) {\n $slider.slick('slickSetOption', 'slidesToShow', slidesToShow);\n }else {\n $slider.slick('unslick');\n }\n\n }\n}\n\nnew OpalWoocommerceSingleProduct();","})(jQuery);"]}