jQuery(function($){let app_maxsote_inneprodukty_shop_id=66;let addfield_id=6;let other_selectors={"56":"as23","333":"23"};let current_lang=Shop.lang.name;window.customerPrivacy.onAnalyticsConsentGranted(function(){let current_ls_mxip_data=localStorage.getItem('mx_ls_mxip_data');if(!current_ls_mxip_data){current_ls_mxip_data='';} if(window.location.href.indexOf('?mxip')!==-1&&$('body').prop('id').indexOf('shop_product')!==-1){let current_slot_id=window.location.href.split('?mxip')[1].trim().replace(/\D/g,'');if(current_slot_id.length<1){current_slot_id='0';} let current_product_id=$('body').prop('id').replace('shop_product','');let ls_entry='|'+current_product_id+':'+current_slot_id+'|';if(current_ls_mxip_data.indexOf(ls_entry)===-1){current_ls_mxip_data=current_ls_mxip_data+ls_entry;} if(current_ls_mxip_data.length>230){current_ls_mxip_data=current_ls_mxip_data.split('||');current_ls_mxip_data.splice(0,1);current_ls_mxip_data='|'+current_ls_mxip_data.join('||');} localStorage.setItem('mx_ls_mxip_data',current_ls_mxip_data);} if($('#additional_'+addfield_id).length>0){if(current_ls_mxip_data.length>230){current_ls_mxip_data=current_ls_mxip_data.split('||');current_ls_mxip_data.splice(0,1);current_ls_mxip_data='|'+current_ls_mxip_data.join('||');} if(current_ls_mxip_data.length>230){current_ls_mxip_data=current_ls_mxip_data.substr(0,230);} $('#additional_'+addfield_id).val('Produkty z sugestii: '+current_ls_mxip_data);}});let mx_api_products={};let mx_api_products_loaded=false;let mxApiGetProducts=function(ids,page,max_page,func_on_complete){if(page==1){max_page=Math.ceil(ids.length / 50);} let current_ids=ids;if(ids.length>50){current_ids=ids.slice(0,50);} frontAPI.getProducts(function(products){for(let prod_k in products["list"]){mx_api_products[products["list"][prod_k].id]=products["list"][prod_k];} if(page+1>max_page){mx_api_products_loaded=true;func_on_complete();return true;} mxApiGetProducts(ids.slice(51),page+1,max_page,func_on_complete);},{urlParams:'?limit=50',ids:current_ids,});};let mxGetTranslation=function(translatable_field){if(current_lang in translatable_field){return translatable_field[current_lang];} else{return translatable_field["pl_PL"];}};let mxInitSlot=function(cfg,global_config){let slot_id=cfg.id;let current_naglowek=mxGetTranslation(cfg.header_text);let add_class_all_html='';if(global_config.new_slider!='1'){add_class_all_html=' slider loading';} let all_html=$('
');all_html.append('
'+current_naglowek+'
');let innerbox=$('
');for(let product_k in cfg.products_to_display){let product_id=parseInt(cfg.products_to_display[product_k]);if(!(product_id in mx_api_products)){continue;} let product=mx_api_products[product_id];let producer_name='';if(typeof product.producer!=='undefined'){producer_name=product.producer.name;} let product_div=$(`
`);let img_size='300_300';if(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){img_size='500_500';} let img_src='src';if(global_config.new_slider=='1'&&global_config.lazy_load=='1'){img_src='data-lazy';} let nazwa='';if(global_config.show_name=='1'){let height=parseInt(global_config.line_height)*parseInt(global_config.line_number)+3;nazwa='
';} let mxip_parameter='?mxip'+slot_id;if(app_maxsote_inneprodukty_shop_id==388||app_maxsote_inneprodukty_shop_id==343){mxip_parameter='';} product_div.append('
'+nazwa+'
');product_div.find('.productname').text(product.name);if(global_config.show_price=='1'){price_div=$('
');if(product.price.gross.promo){if(app_maxsote_inneprodukty_shop_id=='210'){product.price.gross.base=product.price.gross.base.replace(',00','');product.price.gross.final=product.price.gross.final.replace(',00','');} price_div.append(''+product.price.gross.base+''+product.price.gross.final+'');} else{if(app_maxsote_inneprodukty_shop_id=='210'){product.price.gross.final=product.price.gross.final.replace(',00','');} price_div.append(''+product.price.gross.final+'');} product_div.append(price_div);} if(product.can_buy&&global_config.show_addtobasket=='1'){product_div.append('
'+product.unit.name+'
');} innerbox.append(product_div);} all_html.append(innerbox);window.customerPrivacy.onAnalyticsConsentGranted(function(){all_html.find('.addtobasket').click(function(){let current_ls_mxip_data=localStorage.getItem('mx_ls_mxip_data');if(!current_ls_mxip_data){current_ls_mxip_data='';} let cur_product_id=$(this).data('pid');let ls_entry='|'+cur_product_id+':'+slot_id+'|';if(current_ls_mxip_data.indexOf(ls_entry)===-1){current_ls_mxip_data=current_ls_mxip_data+ls_entry;} localStorage.setItem('mx_ls_mxip_data',current_ls_mxip_data);});});if(cfg.lokalizacja=='custom_id'||cfg.type=='other'){$('#'+cfg.custom_id).append(all_html);} else if(cfg.lokalizacja=='karta_pod_opisem'){$('.centercol').append(all_html);} else if(cfg.lokalizacja=='karta_nad_opisem'){all_html.insertAfter($('#box_productfull'));} else if(cfg.lokalizacja=='koszyk_pod_lista'){all_html.insertAfter($('.productlist'));} else if(cfg.lokalizacja=='koszyk_pod_dostawa'){all_html.insertBefore($('#cart-options > div.buttons'));} else if(cfg.lokalizacja=='koszyk_pod_zamawiam'){$('.centercol').append(all_html);} else if(cfg.lokalizacja=='lista_pod_produktami'){$('.centercol').append(all_html);} else if(cfg.lokalizacja=='lista_nad_produktami'){$('.centercol').prepend(all_html);} if(mxGetTranslation(cfg.add_bottom_html)=='1'){$('
').html(mxGetTranslation(cfg.bottom_html)).insertAfter(all_html);} if(global_config.new_slider=='1'){let slick_config={infinite:true,slidesToShow:parseInt(global_config.slides_to_show),slidesToScroll:parseInt(global_config.slides_to_scroll),speed:parseInt(global_config.speed),arrows:global_config.show_arrows=='1',autoplay:global_config.autoplay=='1',autoplaySpeed:parseInt(global_config.autoplay_speed),responsive:[{breakpoint:900,settings:{slidesToShow:3,slidesToScroll:3,arrows:true}},{breakpoint:650,settings:{slidesToShow:parseInt(global_config.mobile_slides_to_show),slidesToScroll:parseInt(global_config.mobile_slides_to_scroll),arrows:true}},{breakpoint:350,settings:{slidesToShow:1,slidesToScroll:1,arrows:true}}]};if(global_config.lazy_load=='1'){slick_config.lazyLoad='ondemand';} innerbox.slick(slick_config);let dostosujWysokoscZdjec=function(){if($('.slick-active .mx_app_inneprodukty_product_image_container').first().height()<30){setTimeout(function(){dostosujWysokoscZdjec();},10);return true;} let img_max_height=0;$('.mx_app_inneprodukty_product_image_container').each(function(){let current_height=$(this).height();if(current_height>img_max_height){img_max_height=current_height;}});$('.mx_app_inneprodukty_product_image_container').css('height',img_max_height+'px');$('.mx_app_inneprodukty_product_image_container img').css('max-height',img_max_height+'px');};dostosujWysokoscZdjec();} else{shoper.selectorFunctions.boxslider.load($('#box_app_inneprodukty_'+slot_id),shoper);setTimeout(function(){max_height=0;$('#box_app_inneprodukty_'+slot_id+' .slider-wrap .product').each(function(){cur_height=$(this).height();if(cur_height>max_height){max_height=cur_height;}});$('#box_app_inneprodukty_'+slot_id+' .slider-wrap').css('height',max_height+'px');},100);} return true;};let mxApiLoader=function(){if(!window.frontAPI){setTimeout(mxApiLoader,0);return;} let mode='';let products_displayed=[];let current_product_id=0;if($('body').hasClass('shop_product')){mode='karta';current_product_id=$('body').prop('id').replace("shop_product","");products_displayed=[current_product_id];} else if($('body').hasClass('shop_basket')){mode='koszyk';products_displayed=[];$('.productlist tbody tr').each(function(){current_product_id=$(this).data('product-id');products_displayed.push(current_product_id);});} else if($('body').hasClass('shop_product_list')){mode='lista';products_displayed=[];$('#box_mainproducts .product').each(function(){current_product_id=$(this).data('product-id');products_displayed.push(current_product_id);});} else{mode='other';products_displayed=[];$('.product').each(function(){current_product_id=$(this).data('product-id');products_displayed.push(current_product_id);});} if(mode.length<1){return false;} let other_slots_ids=[];for(let cur_slot_id in other_selectors){let cur_selector=other_selectors[cur_slot_id];if($('#'+cur_selector).length){other_slots_ids.push(cur_slot_id);}} $.post('https://mxapp.maxserver.pl/appInneProdukty/getSugestie.php',{mx_shop_id:app_maxsote_inneprodukty_shop_id,mode:mode,products:products_displayed,other_slots_ids:other_slots_ids,},function(response){if(response.length<3){return true;} response=JSON.parse(response);let response_sloty=response.sloty;if(response.products_to_download.length<1||response.global_config.active!='1'){return true;} let slick_css='.mx_app_inneprodukty_product_image_container{display:flex;align-items:center;justify-content:center;background: url(\'https://mxapp.maxserver.pl/appInneProdukty/css/load.gif\') no-repeat center}.mx_app_inneprodukty_innerbox .slick-slider{position:relative;display:block;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;-khtml-user-select:none;-ms-touch-action:pan-y;touch-action:pan-y;-webkit-tap-highlight-color:transparent}.mx_app_inneprodukty_innerbox .slick-list{position:relative;display:block;overflow:hidden;margin:0;padding:0}.mx_app_inneprodukty_innerbox .slick-list:focus{outline:0}.mx_app_inneprodukty_innerbox .slick-list.dragging{cursor:pointer;cursor:hand}.mx_app_inneprodukty_innerbox .slick-slider .slick-list,.mx_app_inneprodukty_innerbox .slick-slider .slick-track{-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.mx_app_inneprodukty_innerbox .slick-track{position:relative;top:0;left:0;display:block;margin-left:auto;margin-right:auto}.mx_app_inneprodukty_innerbox .slick-track:after,.mx_app_inneprodukty_innerbox .slick-track:before{display:table;content:\'\'}.mx_app_inneprodukty_innerbox .slick-track:after{clear:both}.mx_app_inneprodukty_innerbox .slick-loading .slick-track{visibility:hidden}.mx_app_inneprodukty_innerbox .slick-slide{display:none;float:left;height:100%;min-height:1px;}.mx_app_inneprodukty_innerbox [dir=rtl] .slick-slide{float:right}.mx_app_inneprodukty_innerbox .slick-slide img{display:inline-block}.mx_app_inneprodukty_innerbox .slick-slide.slick-loading img{display:none}.mx_app_inneprodukty_innerbox .slick-slide.dragging img{pointer-events:none}.mx_app_inneprodukty_innerbox .slick-initialized .slick-slide{display:block}.mx_app_inneprodukty_innerbox .slick-loading .slick-slide{visibility:hidden}.mx_app_inneprodukty_innerbox .slick-vertical .slick-slide{display:block;height:auto;border:1px solid transparent}.mx_app_inneprodukty_innerbox .slick-arrow.slick-hidden{display:none}.mx_app_inneprodukty_innerbox .slick-next {padding: 5px;position: absolute;font-size: '+response.global_config.arrows_size+'px;right: -20px;top: calc(50% - '+response.global_config.arrows_size+'px); color: '+response.global_config.arrows_color+'}.slick-prev {padding: 5px;position: absolute;font-size: '+response.global_config.arrows_size+'px;left: -20px;top: calc(50% - '+response.global_config.arrows_size+'px); color: '+response.global_config.arrows_color+'}@media only screen and (max-width: 800px) { .mx_app_inneprodukty_innerbox .slick-next {right: 0px;z-index:2}.slick-prev {left: 0px;z-index:2} }@media only screen and (max-width: 650px) { .mx_app_inneprodukty_innerbox .slick-next {font-size: '+response.global_config.mobile_arrows_size+'px;top: calc(50% - '+response.global_config.mobile_arrows_size+'px); color: '+response.global_config.arrows_color+'}.slick-prev {font-size: '+response.global_config.mobile_arrows_size+'px;top: calc(50% - '+response.global_config.mobile_arrows_size+'px);} }';!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('