(function appFotoformaWarranty($){let App=function App(){this.optionsLinkUrl='https://fotoforma.pl/tu-europa-dodatkowa-ochrona-urzadzen-dla-klientow-fotoforma';this.shopId=2;this.translations_array={"add_text":{"__default":"Dodaj do koszyka"}};this.promoCodes=[{"code":"qwerty","value":0.25},{"code":"test_tueuropa","value":0.5}];this.warrantyId=22890;this.optionNameId=313;this.optionDataId=319;this.warrantyQuestion1FieldId=23;this.warrantyQuestion2FieldId=24;this.warrantyQuestion3FieldId=25;this.taxIdentificationFieldId=12;this.birthDateFieldId=13;this.marketingConsent1FieldId=14;this.marketingConsent2FieldId=15;this.marketingConsent3FieldId=16;this.marketingConsent4FieldId=17;this.marketingConsent5FieldId=18;this.marketingConsent6FieldId=19;this.marketingConsent7FieldId=20;this.marketingConsent8FieldId=21;this.marketingConsent9FieldId=22;this.lang=Shop.lang.name;this.currency=Shop.values.currency?Shop.values.currency:"PLN";this.$style=$('').appendTo('head');this.warrantyData=[];if(localStorage.appFotoformaWarrantyData){this.warrantyData=JSON.parse(localStorage.appFotoformaWarrantyData);} this.currentCode=null;if(localStorage.appFotoformaPromoCode){this.currentCode=JSON.parse(localStorage.appFotoformaPromoCode);const codeExists=this.promoCodes.find(item=>item.code===this.currentCode.code);if(codeExists===undefined){delete localStorage.appFotoformaPromoCode;this.currentCode=null;}} this.warrantyOptions=[{name:'Ochrona Basic, awaria po zakończeniu okresu gwarancji producenta',nameShort:'Ochrona Basic',icon:'https://sklep164610.shoparena.pl/upload/shield_blue.png',options:[{name:'12 miesięcy',value:1.68,code:'W1_A_24',pakiet:1,wariant:1},{name:'24 miesięcy',value:3.08,code:'W2_A_24',pakiet:1,wariant:2},{name:'36 miesięcy',value:4.48,code:'W3_A_24',pakiet:1,wariant:3},],features:[{name:'Awaria urządzenia',avaliable:true,tooltip:'Ochrona urządzenia w przypadku awarii po zakończeniu gwarancji producenta'},{name:'Przypadkowe uszkodzenie',avaliable:false,tooltip:'Ochrona urządzenia wskutek przypadkowego uszkodzenia urządzenia'},{name:'Kradzież urządzenia',avaliable:false,tooltip:'Ochrona urządzenia wskutek kradzieży z włamaniem lub rabunku'},{name:'Bezpłatny serwis',avaliable:true,tooltip:'Nie ponosisz kosztów naprawy uszkodzonego urządzenia nawet do 5 lat od chwili zakupu'},{name:'Prosta i szybka realizacja świadczenia',avaliable:true,tooltip:'Organizujemy transport urządzenia do i z punktu serwisowego oraz zapewniamy organizację i pokrycie kosztów naprawy'},{name:'Naprawa sprzętu przez profesjonalny serwis',avaliable:true,tooltip:'Gwarancja, że Twój sprzęt trafi w ręce trafi w ręce profesjonalnego serwisu'},{name:'Karta podarunkowa',avaliable:true,tooltip:'W przypadku szkody całkowitej lub szkody wskutek kradzieży z włamaniem lub rabunku urządzenia, otrzymasz kartę podarunkową, którą można dokonywać bezgotówkowych zakupów w sieci Fotoforma'},],},{name:'Ochrona Best, awaria po zakończeniu okresu gwarancji producenta, przypadkowe uszkodzenie, kradzież z włamaniem lub rabunek',nameShort:'Ochrona Best',icon:'https://sklep164610.shoparena.pl/upload/shield_gold.png',options:[{name:'36 miesięcy',value:14.05,code:'W4_APUK_24',pakiet:2,wariant:4},{name:'48 miesięcy',value:19.63,code:'W5_APUK_24',pakiet:2,wariant:5},{name:'60 miesięcy',value:25.25,code:'W6_APUK_24',pakiet:2,wariant:6},],features:[{name:'Awaria urządzenia',avaliable:true,tooltip:'Ochrona urządzenia w przypadku awarii po zakończeniu gwarancji producenta'},{name:'Przypadkowe uszkodzenie',avaliable:true,tooltip:'Ochrona urządzenia wskutek przypadkowego uszkodzenia urządzenia'},{name:'Kradzież urządzenia',avaliable:true,tooltip:'Ochrona urządzenia wskutek kradzieży z włamaniem lub rabunku'},{name:'Bezpłatny serwis',avaliable:true,tooltip:'Nie ponosisz kosztów naprawy uszkodzonego urządzenia nawet do 5 lat od chwili zakupu'},{name:'Prosta i szybka realizacja świadczenia',avaliable:true,tooltip:'Organizujemy transport urządzenia do i z punktu serwisowego oraz zapewniamy organizację i pokrycie kosztów naprawy'},{name:'Naprawa sprzętu przez profesjonalny serwis',avaliable:true,tooltip:'Gwarancja, że Twój sprzęt trafi w ręce trafi w ręce profesjonalnego serwisu'},{name:'Karta podarunkowa',avaliable:true,tooltip:'W przypadku szkody całkowitej lub szkody wskutek kradzieży z włamaniem lub rabunku urządzenia, otrzymasz kartę podarunkową, którą można dokonywać bezgotówkowych zakupów w sieci Fotoforma'},],}];this.insertStyle();if($('body').hasClass('shop_basket')){this.basketIndex();} if($('body').hasClass('shop_basket_address')){this.basketAddress();} if($('body').hasClass('shop_basket_step3')){this.basketStep3();} if($('body').hasClass('shop_basket_done')){delete localStorage.appFotoformaPromoCode;} if($('body').hasClass('shop_product')){this.productIndex();}};App.prototype.basketIndex=function basketIndex(){this.waitFor(function(){return(typeof window.frontAPI==='object'&&typeof window.frontAPI.getProduct==='function'&&typeof window.frontAPI.getBasketInfo==='function');},function(){frontAPI.getProduct(function(warranty){if('error_description'in warranty)return false;this.warranty=warranty;frontAPI.getBasketInfo(function(basket){this.basketInfo=basket;if(this.checkWarranty()===false){return false;} if(this.warrantyData.length!=0){$('#shipping_12').parent().parent().parent().addClass('none');} let productsWithWarranty=$(`#box_basketlist .productlist > tbody > tr[data-product-id]`);productsWithWarranty.each(function(index,item){item=$(item);if(item.find('.prodremove').length==0||item.find('.prodremove').attr('href')=='')return true;let productBasketId=item.find('.prodremove').attr('href').split("/").pop();item.attr('data-product-basket-id',productBasketId);if(item.data('product-id')!=this.warrantyId){let dataIndex=this.warrantyData.findIndex(function(a){return a.productBasketId==productBasketId;}.bind(this));if(item.find('.warrantyTUEurope').val()=='1'){if(dataIndex==-1){this.insertForm(item);}} else{if(dataIndex!=-1){frontAPI.removeFromBasket(function(response){if(response._flash_messenger.error.length==0){this.warrantyData.splice(dataIndex,1);localStorage.appFotoformaWarrantyData=JSON.stringify(this.warrantyData);} location.replace(location.href);}.bind(this),{id:this.warrantyData[dataIndex].warrantyBasketId});return false;}}} else{let dataIndex=this.warrantyData.findIndex(function(a){return a.warrantyBasketId==productBasketId;}.bind(this));let productBasket=this.basketInfo.products.find(function(a){return a.id==this.warrantyData[dataIndex].productBasketId;}.bind(this));let productItem=$(`#box_basketlist .productlist > tbody > tr[data-product-basket-id="${productBasket.id}"]`);item.insertAfter(productItem);item.find('.name a').attr('href',this.optionsLinkUrl).attr('target','_blank').attr('rel','noopener');item.find('.quantity .shaded_inputwrap').hide();let key=this.warrantyData[dataIndex].optionGroup;let key2=this.warrantyData[dataIndex].option;item.find('.price').html(`${this.warrantyOptions[key].name}: ${this.warrantyOptions[key].options[key2].name}`);productItem.find('.quantity input').on('change',function(e){const priceChange=(this.currentCode===null)?1:1-this.currentCode.value;let quantity=Math.round((productBasket.price_float*this.warrantyOptions[key].options[key2].value*priceChange)*e.target.value);item.find('.quantity input').val(quantity);item.find('.sum .color').html(this.priceFormat(quantity / 100));}.bind(this)).trigger('change');}}.bind(this));$('.promocode button').on('click',function(e){const promocode=$('.promocode input').val().trim();const code=this.promoCodes.find(item=>item.code===promocode);if(code===undefined||code==null)return true;e.preventDefault();$('.promocode input').val('');const priceChange=(this.currentCode===null)?code.value:code.value-this.currentCode.value;this.currentCode=code;localStorage.appFotoformaPromoCode=JSON.stringify(code);this.insertAddedCodeMessage(code.code);if(priceChange===0)return true;$(`#box_basketlist .productlist > tbody > tr[data-product-id] .quantity input`).trigger('change');}.bind(this))}.bind(this),{lang:this.lang,currency:this.currency});}.bind(this),{id:this.warrantyId,lang:this.lang,currency:this.currency});}.bind(this));};App.prototype.basketAddress=function basketAddress(){if(this.warrantyData.length>0){let appFotoformaWarrantyQuestions=JSON.parse(localStorage.appFotoformaWarrantyQuestions);$(`#additional_${this.warrantyQuestion1FieldId}`).val(appFotoformaWarrantyQuestions.warrantyQuestion1?"Tak":"Nie");$(`#additional_${this.warrantyQuestion2FieldId}`).val(appFotoformaWarrantyQuestions.warrantyQuestion2?"Tak":"Nie");$(`#additional_${this.warrantyQuestion3FieldId}`).val(appFotoformaWarrantyQuestions.warrantyQuestion3?"Tak":"Nie");let mailInfo=$(``).insertAfter($('.mail, .error_mail').last());mailInfo.append(``);mailInfo.append(`Na podany przez Ciebie adres e-mail wyślemy dokumenty dotyczące ubezpieczenia oraz przetwarzania Twoich danych osobowych.`);$('#box_basketaddress .summary').on('click.validate',function(e){let preventDefault=false;let scrollTop=1e9;let fields=$('.maindata tr, .client-address tr');if($('#address_different').is('checked'))fields.add('.client-address-different tr');fields.each(function(index,item){item=$(item);if(item.is('[class*="error_"]'))return true;if(item.is('.phone, .phone2')){$(`.error_${item.attr('class')}`).remove();let input=item.find('input');let number=input.val();number=number.replaceAll(/\s+/g,'');if(number.length==0){preventDefault=true;let offset=item.offset().top-window.innerHeight / 4;if(offset`).insertAfter(item);error.append(``);error=error.find('.input_error');error.append(`
  • Pole wymagane
  • `);return true;} if(number.length!=9||!/^\d+$/.test(number)){preventDefault=true;let offset=item.offset().top-window.innerHeight / 4;if(offset`).insertAfter(item);error.append(``);error=error.find('.input_error');error.append(`
  • Nieprawidłowy numer telefonu
  • `);return true;} return true;} if(item.is('.taxIdentification')){$(`.error_${item.attr('class')}`).remove();if($('#checkbox_taxIdentification').is(':checked'))return true;let input=item.find('input');let number=input.val();number=number.replaceAll(/\s+/g,'');if(number.length==0){preventDefault=true;let offset=item.offset().top-window.innerHeight / 4;if(offset`).insertAfter(item);error.append(`
      `);error=error.find('.input_error');error.append(`
    • Pole wymagane
    • `);return true;} if(number.length!=11||!/^\d+$/.test(number)){preventDefault=true;let offset=item.offset().top-window.innerHeight / 4;if(offset`).insertAfter(item);error.append(`
        `);error=error.find('.input_error');error.append(`
      • Nieprawidłowy numer pesel
      • `);return true;} return true;} if(item.is('.birthDate')){$(`.error_${item.attr('class')}`).remove();if(!$('#checkbox_taxIdentification').is(':checked'))return true;let input=item.find('input');if(input.val().length==0){preventDefault=true;let offset=item.offset().top-window.innerHeight / 4;if(offset`).insertAfter(item);error.append(`
          `);error=error.find('.input_error');error.append(`
        • Pole wymagane
        • `);return true;} let dateNow=new Date();let date=new Date(input.val());date.setFullYear(date.getFullYear()+18);if(date>dateNow){preventDefault=true;let offset=item.offset().top-window.innerHeight / 4;if(offset`).insertAfter(item);error.append(`
            `);error=error.find('.input_error');error.append(`
          • Musisz mieć przynajmniej 18 lat
          • `);return true;} return true;} if(item.find('.label em.color').length>0){$(`.error_${item.attr('class')}`).remove();let input=item.find('input');if(input.val()==''&&item.css('display')!='none'){preventDefault=true;let offset=item.offset().top-window.innerHeight / 4;if(offset`).insertAfter(item);error.append(`
              `);error=error.find('.input_error');error.append(`
            • Pole wymagane
            • `);input.off('input.mxError').on('input.mxError',function(){error.remove();input.off('input.mxError');});return true;}}});$('.client-add-info > table > tbody > tr').each(function(index,item){item=$(item);if(item.is('.errorline'))return true;if(item.find('.label em.color').length>0){item.removeClass('witherror witherror_checkbox').next('.errorline').remove();let input=item.find('input');if(!input.is(':checked')){preventDefault=true;let offset=item.offset().top-window.innerHeight / 4;if(offset`).insertAfter(item);error.css('display',item.css('display'));error.append(`
                `);error=error.find('.input_error');error.append(`
              • Pole wymagane
              • `);input.off('change.mxError').on('change.mxError',function(){item.removeClass('witherror witherror_checkbox');error.remove();input.off('input.mxError');});return true;}}});if(preventDefault){e.preventDefault();$('html, body').animate({scrollTop:scrollTop});}});$('#input_mail').on('input',function(){$('.error_mail').remove();});$('#input_phone').on('input',function(){$('.error_phone').remove();}).on('change.validate',function(){$('.error_phone').remove();let item=$(this);let number=item.val();number=number.replaceAll(/\s+/g,'');if(number=='')return false;if(number.length!=9||!/^\d+$/.test(number)){let error=$(``).insertAfter(item.parent().parent().parent());error.append(`
                  `);error=error.find('.input_error');error.append(`
                • Nieprawidłowy numer telefonu
                • `);}}).change();$('#input_phone2').on('input',function(){$('.error_phone2').remove();}).on('change.validate',function(){$('.error_phone2').remove();let item=$(this);let number=item.val();number=number.replaceAll(/\s+/g,'');if(number=='')return false;if(number.length!=9||!/^\d+$/.test(number)){let error=$(``).insertAfter(item.parent().parent().parent());error.append(`
                    `);error=error.find('.input_error');error.append(`
                  • Nieprawidłowy numer telefonu
                  • `);}}).change();let taxIdentification=$(``).insertAfter($('.phone, .error_phone').last());taxIdentification.append(``);taxIdentification.append(`
                    `);let taxIdentificationInput=$(``).appendTo(taxIdentification.find('.shaded_inputwrap'));taxIdentificationInput.attr('name','input_taxIdentification');taxIdentificationInput.attr('id','input_taxIdentification');taxIdentificationInput.val($(`#additional_${this.taxIdentificationFieldId}`).val());taxIdentificationInput.on('input',function(){$('.error_taxIdentification').remove();});taxIdentificationInput.on('change',function(e){$('.error_taxIdentification').remove();let item=$(e.target);$(`#additional_${this.taxIdentificationFieldId}`).val(item.val());let number=item.val();number=number.replaceAll(/\s+/g,'');if(number=='')return false;if(number.length!=11||!/^\d+$/.test(number)){let error=$(``).insertAfter(item.parent().parent().parent());error.append(`
                      `);error=error.find('.input_error');error.append(`
                    • Nieprawidłowy numer pesel
                    • `);}}.bind(this));let taxIdentificationCheckboxWrap=$(``).insertAfter(taxIdentification);taxIdentificationCheckboxWrap.append(``);taxIdentificationCheckboxWrap.append(``);let taxIdentificationCheckbox=$(``).appendTo(taxIdentificationCheckboxWrap.find('.input'));taxIdentificationCheckbox.attr('id','checkbox_taxIdentification');taxIdentificationCheckbox.prop('checked',$(`#additional_${this.birthDateFieldId}`).val()!='');taxIdentificationCheckbox.wrap(``);$(``).insertAfter(taxIdentificationCheckbox);$(``).insertAfter(taxIdentificationCheckbox.parent());let birthDate=$(``).hide().insertAfter(taxIdentificationCheckboxWrap);birthDate.append(``);birthDate.append(`
                      `);let birthDateInput=$(``).appendTo(birthDate.find('.shaded_inputwrap'));birthDateInput.attr('name','input_birthDate');birthDateInput.attr('id','input_birthDate');birthDateInput.val($(`#additional_${this.birthDateFieldId}`).val());birthDateInput.on('change',function(e){$('.error_birthDate').remove();let item=$(e.target);$(`#additional_${this.birthDateFieldId}`).val(item.val());if(item.val()=='')return false;let dateNow=new Date();let date=new Date(item.val());date.setFullYear(date.getFullYear()+18);if(date>dateNow){let error=$(``).insertAfter(item.parent().parent().parent());error.append(`
                        `);error=error.find('.input_error');error.append(`
                      • Musisz mieć przynajmniej 18 lat
                      • `);}}.bind(this));taxIdentificationCheckbox.on('change',function(){if($(this).is(':checked')){birthDate.show();taxIdentificationInput.css('opacity',0.3);taxIdentificationInput.prop('readonly',true);$(`#additional_${this.taxIdentificationFieldId}`).val('');$(`#additional_${this.birthDateFieldId}`).val(birthDateInput.val());$('.error_taxIdentification').hide();$('.error_birthDate').show();} else{birthDate.hide();taxIdentificationInput.css('opacity',1);taxIdentificationInput.prop('readonly',false);$(`#additional_${this.taxIdentificationFieldId}`).val(taxIdentificationInput.val());$(`#additional_${this.birthDateFieldId}`).val('');$('.error_taxIdentification').show();$('.error_birthDate').hide();}}).change();let marketingConsentHeader=$(``).appendTo('.client-add-info > table tbody');marketingConsentHeader.append(`Poniższe oświadczenia dotyczą Ogólnych Warunków Ubezpieczenia „Dodatkowa ochrona urządzeń dla Klientów Fotoforma”`);let marketingConsentRequiredHeader=$(``).insertAfter(marketingConsentHeader);marketingConsentRequiredHeader.append(`Niniejszym składam poniższe oświadczenia:`);let marketingConsentCheckAll=$(``).insertAfter(marketingConsentRequiredHeader);marketingConsentCheckAll.append(``);let marketingConsentCheckAllInput=$(``).appendTo(marketingConsentCheckAll.find('.input'));marketingConsentCheckAllInput.attr('id','marketingConsentCheckAll');marketingConsentCheckAllInput.wrap(``);$(``).insertAfter(marketingConsentCheckAllInput);$(``).insertAfter(marketingConsentCheckAllInput.parent());let marketingConsent1=$(``).insertAfter(marketingConsentCheckAll);marketingConsent1.append(`*`);marketingConsent1.append(``);let marketingConsent1Input=$(``).appendTo(marketingConsent1.find('.input'));marketingConsent1Input.attr('id','marketingConsent1');marketingConsent1Input.prop('checked',$(`#additional_${this.marketingConsent1FieldId}`).val()=="Tak");marketingConsent1Input.wrap(``);$(``).insertAfter(marketingConsent1Input);$(``).insertAfter(marketingConsent1Input.parent());marketingConsent1Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent1FieldId}`).val(item.is(':checked')?'Tak':'Nie');if(item.is(':checked')){item.parent().parent().parent().removeClass('witherror witherror_checkbox').next('.errorline').remove();}}.bind(this)).change();let marketingConsent2=$(``).insertAfter(marketingConsent1);marketingConsent2.append(`*`);marketingConsent2.append(``);let marketingConsent2Input=$(``).appendTo(marketingConsent2.find('.input'));marketingConsent2Input.attr('id','marketingConsent2');marketingConsent2Input.prop('checked',$(`#additional_${this.marketingConsent2FieldId}`).val()=="Tak");marketingConsent2Input.wrap(``);$(``).insertAfter(marketingConsent2Input);$(``).insertAfter(marketingConsent2Input.parent());marketingConsent2Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent2FieldId}`).val(item.is(':checked')?'Tak':'Nie');if(item.is(':checked')){item.parent().parent().parent().removeClass('witherror witherror_checkbox').next('.errorline').remove();}}.bind(this)).change();let marketingConsent3=$(``).insertAfter(marketingConsent2);marketingConsent3.append(`*`);marketingConsent3.append(``);let marketingConsent3Input=$(``).appendTo(marketingConsent3.find('.input'));marketingConsent3Input.attr('id','marketingConsent3');marketingConsent3Input.prop('checked',$(`#additional_${this.marketingConsent3FieldId}`).val()=="Tak");marketingConsent3Input.wrap(``);$(``).insertAfter(marketingConsent3Input);$(``).insertAfter(marketingConsent3Input.parent());marketingConsent3Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent3FieldId}`).val(item.is(':checked')?'Tak':'Nie');if(item.is(':checked')){item.parent().parent().parent().removeClass('witherror witherror_checkbox').next('.errorline').remove();}}.bind(this)).change();let marketingConsent4=$(``).insertAfter(marketingConsent3);marketingConsent4.append(`*`);marketingConsent4.append(``);let marketingConsent4Input=$(``).appendTo(marketingConsent4.find('.input'));marketingConsent4Input.attr('id','marketingConsent4');marketingConsent4Input.prop('checked',$(`#additional_${this.marketingConsent4FieldId}`).val()=="Tak");marketingConsent4Input.wrap(``);$(``).insertAfter(marketingConsent4Input);$(``).insertAfter(marketingConsent4Input.parent());marketingConsent4Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent4FieldId}`).val(item.is(':checked')?'Tak':'Nie');if(item.is(':checked')){item.parent().parent().parent().removeClass('witherror witherror_checkbox').next('.errorline').remove();}}.bind(this)).change();let marketingConsent5=$(``).insertAfter(marketingConsent4);marketingConsent5.append(`*`);marketingConsent5.append(``);let marketingConsent5Input=$(``).appendTo(marketingConsent5.find('.input'));marketingConsent5Input.attr('id','marketingConsent5');marketingConsent5Input.prop('checked',$(`#additional_${this.marketingConsent5FieldId}`).val()=="Tak");marketingConsent5Input.wrap(``);$(``).insertAfter(marketingConsent5Input);$(``).insertAfter(marketingConsent5Input.parent());marketingConsent5Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent5FieldId}`).val(item.is(':checked')?'Tak':'Nie');if(item.is(':checked')){item.parent().parent().parent().removeClass('witherror witherror_checkbox').next('.errorline').remove();}}.bind(this)).change();let marketingConsent6=$(``).insertAfter(marketingConsent5);marketingConsent6.append(`*`);marketingConsent6.append(``);let marketingConsent6Input=$(``).appendTo(marketingConsent6.find('.input'));marketingConsent6Input.attr('id','marketingConsent6');marketingConsent6Input.prop('checked',$(`#additional_${this.marketingConsent6FieldId}`).val()=="Tak");marketingConsent6Input.wrap(``);$(``).insertAfter(marketingConsent6Input);$(``).insertAfter(marketingConsent6Input.parent());marketingConsent6Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent6FieldId}`).val(item.is(':checked')?'Tak':'Nie');if(item.is(':checked')){item.parent().parent().parent().removeClass('witherror witherror_checkbox').next('.errorline').remove();}}.bind(this)).change();$('#address_type1').on('change',function(e){let item=$(e.target);if(item.is(':checked')){marketingConsent6.find('.changingValue').html('30');}}.bind(this)).change();$('#address_type2').on('change',function(e){let item=$(e.target);if(item.is(':checked')){marketingConsent6.find('.changingValue').html('7');}}.bind(this)).change();let marketingConsentNoRequiredHeader=$(``).insertAfter(marketingConsent6);marketingConsentNoRequiredHeader.append(`Dodatkowo wyrażam zgodę na poniższe:`);let marketingConsent7=$(``).insertAfter(marketingConsentNoRequiredHeader);marketingConsent7.append(``);marketingConsent7.append(``);let marketingConsent7Input=$(``).appendTo(marketingConsent7.find('.input'));marketingConsent7Input.attr('id','marketingConsent7');marketingConsent7Input.prop('checked',$(`#additional_${this.marketingConsent7FieldId}`).val()=="Tak");marketingConsent7Input.wrap(``);$(``).insertAfter(marketingConsent7Input);$(``).insertAfter(marketingConsent7Input.parent());marketingConsent7Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent7FieldId}`).val(item.is(':checked')?'Tak':'Nie');}.bind(this)).change();let marketingConsent8=$(``).insertAfter(marketingConsent7);marketingConsent8.append(``);marketingConsent8.append(``);let marketingConsent8Input=$(``).appendTo(marketingConsent8.find('.input'));marketingConsent8Input.attr('id','marketingConsent8');marketingConsent8Input.prop('checked',$(`#additional_${this.marketingConsent8FieldId}`).val()=="Tak");marketingConsent8Input.wrap(``);$(``).insertAfter(marketingConsent8Input);$(``).insertAfter(marketingConsent8Input.parent());marketingConsent8Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent8FieldId}`).val(item.is(':checked')?'Tak':'Nie');}.bind(this)).change();let marketingConsent9=$(``).insertAfter(marketingConsent8);marketingConsent9.append(``);marketingConsent9.append(``);let marketingConsent9Input=$(``).appendTo(marketingConsent9.find('.input'));marketingConsent9Input.attr('id','marketingConsent9');marketingConsent9Input.prop('checked',$(`#additional_${this.marketingConsent9FieldId}`).val()=="Tak");marketingConsent9Input.wrap(``);$(``).insertAfter(marketingConsent9Input);$(``).insertAfter(marketingConsent9Input.parent());marketingConsent9Input.on('change',function(e){let item=$(e.target);$(`#additional_${this.marketingConsent9FieldId}`).val(item.is(':checked')?'Tak':'Nie');}.bind(this)).change();let checkAllMarketingConsents=$().add(marketingConsent1Input).add(marketingConsent2Input).add(marketingConsent3Input).add(marketingConsent4Input).add(marketingConsent5Input).add(marketingConsent6Input);if(checkAllMarketingConsents.not(':checked').length==0){marketingConsentCheckAllInput.prop('checked',true);} marketingConsentCheckAllInput.on('change',function(e){let item=$(e.target);if(item.is(':checked')){checkAllMarketingConsents.prop('checked',true).change();} else{checkAllMarketingConsents.prop('checked',false).change();}}.bind(this));let disableMarketingConsents=$().add(marketingConsentCheckAll).add(marketingConsent1).add(marketingConsent2).add(marketingConsent3).add(marketingConsent4).add(marketingConsent5).add(marketingConsent6).addClass('mxFieldDisabled');disableMarketingConsents.attr('title','Najpierw wyślij dokumenty na swój adres email');let mailButton=$(`

                        Kupon rabatowy ${code} został aktywowany

                        `);message.insertBefore('body > .wrap > .top');message.get(0).scrollIntoView({behavior:"smooth"});} App.prototype.getTranslation=function getTranslation(var_name,lang=this.lang){let translation='';if(!(lang in this.translations_array[var_name])){translation=this.translations_array[var_name]['__default'];}else{translation=this.translations_array[var_name][lang];} return this.escapeHtml(translation);};App.prototype.escapeHtml=function escapeHtml(unsafe){return unsafe.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");};App.prototype.priceFormat=function priceFormat(price,currency=this.currency,lang=this.lang){if(typeof this._priceFormater==='undefined'||this._priceFormaterLang!=lang||this._priceFormaterCurrency!=currency){this._priceFormaterLang=lang;this._priceFormaterCurrency=currency;this._priceFormater=new Intl.NumberFormat(lang.split('_').join('-'),{style:'currency',currency:currency});} return this._priceFormater.format(price);};App.prototype.waitFor=function waitFor(expr,callback,interval=0){if(!expr()){setTimeout(function(){this.waitFor(expr,callback,interval);}.bind(this),interval);} else{callback();}};new App();})(jQuery);