1$(document).ajaxError(function(event,xhr,settings){if((xhr.status===401||xhr.status===403)&&settings.url&&settings.url.indexOf('/wishlist/')===0&&typeof showAuthRequiredModal==='function'){showAuthRequiredModal();}});$('body').on('click','.addwish',function(e){e.preventDefault();var $this=$(this);var productId=$this.data('id');var image='https://imagedelivery.net/nmdL8GYRvCm2wKaYqp-7sg/'+$this.data('img')+'/original';var isProductPage=$this.hasClass('like-in-product');if(isProductPage){if(!isUserLoggedIn&&!getEncryptedPhoneNumber()){submitPhoneIfUserLogin($this);return;} 2var sizeModId,sizeTitle,isAvailable;if(window._productSelectedModId){sizeModId=window._productSelectedModId;sizeTitle=window._productSelectedModTitle;isAvailable=window._productSelectedAvail;}else{var $input=$('input[name="size"]:checked');if(!$input.length||!parseInt($input.attr('id'),10)){showInfoModal('ÐÑÐ´Ñ Ð»Ð°Ñка, обеÑÑÑÑ ÑозмÑÑ');return;} 3sizeModId=parseInt($input.attr('id'),10);sizeTitle=$input.val();isAvailable=$input.attr('data-available')!=='0';} 4if(!sizeModId){showInfoModal('ÐÑÐ´Ñ Ð»Ð°Ñка, обеÑÑÑÑ ÑозмÑÑ');return;} 5var inWishlist=typeof userWishlistModMap!=='undefined'&&userWishlistModMap.hasOwnProperty(sizeModId);var inWaitlist=Array.isArray(userWaitlistModIds)&&userWaitlistModIds.indexOf(sizeModId)!==-1;if(isAvailable){if(inWishlist){showWishlistRemoveConfirm(sizeModId,sizeTitle,productId);}else{clickOnSizeInProduct(productId,sizeModId,image,sizeTitle,$this);}}else{if(inWaitlist){showWaitlistAlreadyConfirm({size:sizeTitle},productId,sizeModId);}else{clickOnSizeInProduct(productId,sizeModId,image,sizeTitle,$this);}} 6return;} 7var modification_wish=$('.modification input:checked').attr('id');var modifcation_wish_title=$('.modification input:checked').val();var associatedProductId=$('.modification input:checked').data('product-id');if(associatedProductId!=productId){modification_wish=null;modifcation_wish_title=null;} 8if(!isUserLoggedIn&&!getEncryptedPhoneNumber()){submitPhoneIfUserLogin($this);return;} 9if(modification_wish){var phone=isUserLoggedIn?userPhone:(decryptPhoneNumber(getEncryptedPhoneNumber())||null);if(phone){clickOnSizeInProduct(productId,modification_wish,image,modifcation_wish_title,$this);}}else{sizeRequestToServer(productId,$this,image);}});function profileHeartDelete(e,el){if(e){e.preventDefault();if(e.stopPropagation)e.stopPropagation();} 10var $link=$(el);var type=$link.data('type');var sessionKey=String($link.data('key'));var productId=parseInt($link.data('product-id'),10);var parts=sessionKey.split('-');var sizeTitle=parts.slice(1,-1).join('-');var isRu=_isRuLang();var confirmTitle,confirmText;if(type==='delayed'){confirmTitle=isRu?'Ð Ð°Ð·Ð¼ÐµÑ '+sizeTitle+' в «ÐжидаемÑÑ ÑоваÑÐ°Ñ Â»':'РозмÑÑ '+sizeTitle+' в «ÐÑÑкÑÐ²Ð°Ð½Ð¸Ñ ÑоваÑÐ°Ñ Â»';confirmText=isRu?'ÐелаеÑе ÑбÑаÑÑ Ð¿Ð¾Ð´Ð¿Ð¸ÑÐºÑ Ð½Ð° ÑÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð´Ð»Ñ ÑÑого ÑазмеÑа?':'ÐажаÑÑе пÑибÑаÑи пÑдпиÑÐºÑ Ð½Ð° ÑповÑÑÐµÐ½Ð½Ñ Ð´Ð»Ñ ÑÑого ÑозмÑÑÑ?';}else{confirmTitle=isRu?'Ð Ð°Ð·Ð¼ÐµÑ '+sizeTitle+' Ñже в «ÐзбÑанном»':'РозмÑÑ '+sizeTitle+' вже в «ÐбÑÐ°Ð½Ð¸Ñ Â»';confirmText=isRu?'ÐелаеÑе ÑбÑаÑÑ ÑÑÐ¾Ñ ÑÐ°Ð·Ð¼ÐµÑ Ð¸Ð· избÑанного?':'ÐажаÑÑе пÑибÑаÑи Ñей ÑозмÑÑ Ð· обÑÐ°Ð½Ð¸Ñ ?';} 11$('#wl-confirm-title').text(confirmTitle);$('#wl-confirm-text').text(confirmText);$('#waitlist-confirm-modal').addClass('modalopen');$('body').css('overflow','hidden');$('#wl-keep-btn').off('click').on('click',function(){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');});$('#wl-remove-btn').off('click').on('click',function(){var ajaxUrl=type==='delayed'?'/wishlist/remove-waitlist':'/wishlist/remove-favorite';var ajaxData=type==='delayed'?{product_id:productId,size:sizeTitle}:{key:sessionKey};$.ajax({url:ajaxUrl,type:'POST',data:ajaxData,success:function(){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');$link.closest('[data-index]').fadeOut(300,function(){$(this).remove();});showProfileRemovedModal(type,sizeTitle);},error:function(xhr){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');if(xhr.status===401||xhr.status===403){showAuthRequiredModal();}else{alert('Ðомилка пÑи видаленнÑ. СпÑобÑйÑе Ñе Ñаз.');}}});});} 12$(document).on('click','.profile-heart-delete',function(e){profileHeartDelete(e,this);});$('body').on('click','.btn-notify-floating',function(e){e.preventDefault();$('#notifyBtn').trigger('click');});$('body').on('click','#notifyBtn',function(e){e.preventDefault();var $btn=$(this);var productId=$btn.data('id');var image='https://imagedelivery.net/nmdL8GYRvCm2wKaYqp-7sg/'+$btn.data('img')+'/original';if(!isUserLoggedIn&&!getEncryptedPhoneNumber()){submitPhoneIfUserLogin($btn);return;} 13var sizeModId,sizeTitle;if(window._productSelectedModId){sizeModId=window._productSelectedModId;sizeTitle=window._productSelectedModTitle;}else{var $input=$('input[name="size"]:checked');if(!$input.length||!parseInt($input.attr('id'),10)){showInfoModal('ÐÑÐ´Ñ Ð»Ð°Ñка, обеÑÑÑÑ ÑозмÑÑ');return;} 14sizeModId=parseInt($input.attr('id'),10);sizeTitle=$input.val();} 15if(!sizeModId){showInfoModal('ÐÑÐ´Ñ Ð»Ð°Ñка, обеÑÑÑÑ ÑозмÑÑ');return;} 16var inWaitlist=Array.isArray(userWaitlistModIds)&&userWaitlistModIds.indexOf(sizeModId)!==-1;if(inWaitlist){showWaitlistAlreadyConfirm({size:sizeTitle},productId,sizeModId);}else{clickOnSizeInProduct(productId,sizeModId,image,sizeTitle,$btn);}});function submitPhoneIfUserLogin($this){showAuthRequiredModal();} 17var _wishlistRequestInFlight=false;function clickOnSizeInProduct(productId,modification_wish,image,modifcation_wish_title,$this){if(_wishlistRequestInFlight){return;} 18_wishlistRequestInFlight=true;$.ajax({url:'/wishlist/addwish',type:'GET',data:{id:productId,size:modification_wish},success:function(res){_wishlistRequestInFlight=false;$('body').css('overflow','hidden');var result=JSON.parse(res);handleAddwishResponse(result,productId,image,modifcation_wish_title,$this,parseInt(modification_wish,10));},error:function(xhr){_wishlistRequestInFlight=false;if(xhr.status===401||xhr.status===403){showAuthRequiredModal();}else{alert('Ðомилка! СпÑобÑйÑе Ñе Ñаз.');}}});} 19function handleAddwishResponse(result,productId,image,sizeTitle,$this,sizeModId){var data=result.data||{};if(data.success==='already_in_wishlist'){showWishlistAlreadyInFavoritesConfirm(data.key,data.size||sizeTitle,productId);return;} 20if(data.success==='already_in_waitlist'){showWaitlistAlreadyConfirm(data,productId,sizeModId);return;} 21if(data.success==='waitlist_limit'){showWaitlistLimitModal();return;} 22if(data.success==='addToDelayed'){$('.imageadd').attr('src',image);updateDelayedModal(data.size||sizeTitle,data.user_phone,true);$('#addtodelayed').addClass('modalopen');$('body').css('overflow','hidden');if(sizeModId&&typeof userWaitlistModIds!=='undefined'){if(userWaitlistModIds.indexOf(sizeModId)===-1){userWaitlistModIds.push(sizeModId);} 23updateProductHeartState();persistWishlistState();} 24performLikesRequest(productId,sizeTitle,result,$this);return;} 25if(data.success==='addToWish'){$('.imageadd').attr('src',image);updateWishlistModal(data.size||sizeTitle);$('#addtowish').addClass('modalopen');$('body').css('overflow','hidden');if(sizeModId&&typeof userWishlistModMap!=='undefined'){userWishlistModMap[sizeModId]=data.key;updateProductHeartState();persistWishlistState();} 26performLikesRequest(productId,sizeTitle,result,$this);return;}} 27function updateWishlistModal(size){var $title=$('#addtowish .wl-modal-title');var $info=$('#addtowish .wl-modal-sms-info');var sizeText=size?' в ÑозмÑÑÑ '+size:'';if($title.length)$title.text('ТоваÑ'+sizeText+' ÑÑпÑÑно додано до «ÐбÑÐ°Ð½Ð¸Ñ Â»!');if($info.length)$info.hide();updateModalActionBtn('#addtowish');} 28function updateDelayedModal(size,userPhone,isWaitlist){var $title=$('#addtodelayed .wl-modal-title');var $info=$('#addtodelayed .wl-modal-sms-info');var $phone=$('#addtodelayed .wl-modal-phone');var sizeText=size?' в ÑозмÑÑÑ '+size:'';var category=isWaitlist?'«ÐÑÑкÑÐ²Ð°Ð½Ð¸Ñ ÑоваÑÑв»':'«ÐÑÐ´ÐºÐ»Ð°Ð´ÐµÐ½Ð¸Ñ ÑоваÑÑв»';if($title.length)$title.text('ТоваÑ'+sizeText+' ÑÑпÑÑно додано до '+category+'!');if(isWaitlist&&userPhone&&$info.length){if($phone.length)$phone.text(userPhone);$info.show();}else if($info.length){$info.hide();} 29updateModalActionBtn('#addtodelayed');} 30function updateModalActionBtn(modalSelector){var $btn=$(modalSelector+' .wl-modal-action-btn');if(!$btn.length)return;if(isUserLoggedIn){$btn.attr('href',$btn.data('logged-href'));$btn.text($btn.data('logged-text'));}else{$btn.attr('href',$btn.data('guest-href'));$btn.text($btn.data('guest-text'));}} 31function updateProductHeartState(){var $heart=$('.like-in-product');if(!$heart.length)return;$heart.removeClass('heart-state-wishlist heart-state-waitlist');var $checked=$('input[name="size"]:checked');if($checked.length){var sizeModId=parseInt($checked.attr('id'),10);var isAvailable=$checked.attr('data-available')!=='0';var inWishlist=typeof userWishlistModMap!=='undefined'&&userWishlistModMap.hasOwnProperty(sizeModId);var inWaitlist=Array.isArray(userWaitlistModIds)&&userWaitlistModIds.indexOf(sizeModId)!==-1;if(isAvailable&&inWishlist){$heart.addClass('heart-state-wishlist');}else if(!isAvailable&&inWaitlist){$heart.addClass('heart-state-waitlist');}}else{var anyInWishlist=false;var anyInWaitlist=false;$('input[name="size"]').each(function(){var modId=parseInt($(this).attr('id'),10);var avail=$(this).attr('data-available')!=='0';if(avail&&typeof userWishlistModMap!=='undefined'&&userWishlistModMap.hasOwnProperty(modId)){anyInWishlist=true;} 32if(!avail&&Array.isArray(userWaitlistModIds)&&userWaitlistModIds.indexOf(modId)!==-1){anyInWaitlist=true;}});if(anyInWishlist){$heart.addClass('heart-state-wishlist');}else if(anyInWaitlist){$heart.addClass('heart-state-waitlist');}} 33updateNotifyButtonState();} 34function updateNotifyButtonState(){var $notifyBtn=$('#notifyBtn');if(!$notifyBtn.length)return;var $cartBtns=$('[id="productAdd"]');
34var hasCartBtn=$cartBtns.length>0;var $oneClickWrap=$('#form-data-buyoneclick');var $input=$('input[name="size"]:checked');var $floatingBar=$('.product-info-card');var $floatingOneClick=$floatingBar.find('.buy-now');var $floatingCartLink=$floatingBar.find('.add-to-cart-link');var $floatingNotify=$floatingBar.find('.btn-notify-floating');var $heartBtn=$notifyBtn.closest('.inc-dec, .items-product-main').find('.like-in-product').closest('div:not(.like)');if(!$floatingNotify.length){$floatingCartLink.after('<button class="btn-theme add-card-in-widget btn-notify-floating" style="display:none;"></button>');$floatingNotify=$floatingBar.find('.btn-notify-floating');} 35var allUnavailable=true;$('input[name="size"]').each(function(){if($(this).attr('data-available')!=='0'){allUnavailable=false;return false;}});if($input.length){var sizeModId=parseInt($input.attr('id'),10);var isAvailable=$input.attr('data-available')!=='0';var inWaitlist=Array.isArray(userWaitlistModIds)&&userWaitlistModIds.indexOf(sizeModId)!==-1;if(isAvailable){if(hasCartBtn)$cartBtns.show();$notifyBtn.hide().removeClass('btn-notify-waitlist--subscribed btn-notify-fullwidth');if($oneClickWrap.length)$oneClickWrap.show();if($heartBtn.length)$heartBtn.show();$floatingCartLink.css('display','flex');$floatingNotify.hide().removeClass('btn-notify-waitlist--subscribed');if($floatingOneClick.length)$floatingOneClick.show();}else{if(hasCartBtn)$cartBtns.hide();$notifyBtn.show();var notifyText=inWaitlist?'Ðи пÑдпиÑÐ°Ð½Ñ (кеÑÑваÑи)':'ÐовÑдомиÑи пÑо наÑвнÑÑÑÑ';if(inWaitlist){$notifyBtn.text(notifyText).addClass('btn-notify-waitlist--subscribed');}else{$notifyBtn.text(notifyText).removeClass('btn-notify-waitlist--subscribed');} 36if($heartBtn.length)$heartBtn.show();$notifyBtn.removeClass('btn-notify-fullwidth');if($oneClickWrap.length)$oneClickWrap.hide();$floatingCartLink.hide();$floatingNotify.text(notifyText).css('display','flex');if(inWaitlist)$floatingNotify.addClass('btn-notify-waitlist--subscribed');else $floatingNotify.removeClass('btn-notify-waitlist--subscribed');if($floatingOneClick.length)$floatingOneClick.hide();}}else{if(allUnavailable){if(hasCartBtn)$cartBtns.hide();var neutralText='ТоваÑÑ Ð½ÐµÐ¼Ð°Ñ Ð² наÑвноÑÑÑ';$notifyBtn.show().text(neutralText);$notifyBtn.removeClass('btn-notify-waitlist--subscribed btn-notify-fullwidth');if($oneClickWrap.length)$oneClickWrap.hide();if($heartBtn.length)$heartBtn.show();$floatingCartLink.hide();$floatingNotify.text(neutralText).css('display','flex');$floatingNotify.removeClass('btn-notify-waitlist--subscribed');if($floatingOneClick.length)$floatingOneClick.hide();}else{if(hasCartBtn)$cartBtns.show();$notifyBtn.hide().removeClass('btn-notify-waitlist--subscribed');if($oneClickWrap.length)$oneClickWrap.show();if($heartBtn.length)$heartBtn.show();$floatingCartLink.css('display','flex');$floatingNotify.hide().removeClass('btn-notify-waitlist--subscribed');if($floatingOneClick.length)$floatingOneClick.show();}}} 37$(function(){updateProductHeartState();$(document).on('change click','input[name="size"]',function(){setTimeout(function(){updateProductHeartState();},10);});});function persistWishlistState(){if(typeof product==='undefined')return;var pid=product.id;if(typeof userWaitlistModIds!=='undefined'){sessionStorage.setItem('wlMods_'+pid,JSON.stringify(userWaitlistModIds));} 38if(typeof userWishlistModMap!=='undefined'){sessionStorage.setItem('wsMods_'+pid,JSON.stringify(userWishlistModMap));}} 39window.addEventListener('pageshow',function(event){if(typeof product==='undefined')return;var pid=product.id;var navType='navigate';try{var entries=performance.getEntriesByType('navigation');if(entries.length)navType=entries[0].type;}catch(e){} 40var isBackForward=event.persisted||navType==='back_forward';if(isBackForward){var storedWl=sessionStorage.getItem('wlMods_'+pid);if(storedWl&&typeof userWaitlistModIds!=='undefined'){try{userWaitlistModIds=JSON.parse(storedWl);}catch(e){}} 41var storedWs=sessionStorage.getItem('wsMods_'+pid);if(storedWs&&typeof userWishlistModMap!=='undefined'){try{userWishlistModMap=JSON.parse(storedWs);}catch(e){}} 42updateProductHeartState();}else{persistWishlistState();}});function showWaitlistAlreadyConfirm(data,productId,sizeModId){var size=data.size||'';
42$('#wl-confirm-title').text('РозмÑÑ '+size+' вже в «ÐÑÑкÑÐ²Ð°Ð½Ð¸Ñ ÑоваÑÐ°Ñ Â»');$('#wl-confirm-text').text('ÐажаÑÑе пÑибÑаÑи пÑдпиÑÐºÑ Ð½Ð° ÑповÑÑÐµÐ½Ð½Ñ Ð´Ð»Ñ ÑÑого ÑозмÑÑÑ?');$('#waitlist-confirm-modal').addClass('modalopen');$('body').css('overflow','hidden');$('#wl-keep-btn').off('click').on('click',function(){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');});$('#wl-remove-btn').off('click').on('click',function(){$.ajax({url:'/wishlist/remove-waitlist',type:'POST',data:{product_id:productId,size:size},success:function(rawRes){$('#waitlist-confirm-modal').removeClass('modalopen');if(sizeModId&&typeof userWaitlistModIds!=='undefined'){var idx=userWaitlistModIds.indexOf(sizeModId);if(idx!==-1)userWaitlistModIds.splice(idx,1);updateProductHeartState();persistWishlistState();} 43try{var res=typeof rawRes==='string'?JSON.parse(rawRes):rawRes;if(res&&res.data&&!res.data.still_in_list){updateCatalogCardHeart(productId,false);}}catch(e){} 44showUnsubscribedModal(size);},error:function(xhr){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');if(xhr.status===401||xhr.status===403){showAuthRequiredModal();}else{alert('Ðомилка пÑи видаленнÑ. СпÑобÑйÑе Ñе Ñаз.');}}});});} 45function showWishlistRemoveConfirm(sizeModId,sizeTitle,productId){$('#wl-confirm-title').text('РозмÑÑ '+sizeTitle+' вже в «ÐбÑÐ°Ð½Ð¸Ñ Â»');$('#wl-confirm-text').text('ÐажаÑÑе пÑибÑаÑи Ñей ÑозмÑÑ Ð· обÑÐ°Ð½Ð¸Ñ ?');$('#waitlist-confirm-modal').addClass('modalopen');$('body').css('overflow','hidden');$('#wl-keep-btn').off('click').on('click',function(){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');});$('#wl-remove-btn').off('click').on('click',function(){var deleteKey=typeof userWishlistModMap!=='undefined'?userWishlistModMap[sizeModId]:null;if(!deleteKey){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');return;} 46$.ajax({url:'/wishlist/remove-favorite',type:'POST',data:{key:deleteKey},success:function(rawRes){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');delete userWishlistModMap[sizeModId];updateProductHeartState();persistWishlistState();try{var res=typeof rawRes==='string'?JSON.parse(rawRes):rawRes;if(res&&res.data&&!res.data.still_in_list){updateCatalogCardHeart(productId,false);}}catch(e){} 47showProfileRemovedModal('favorites',sizeTitle);},error:function(xhr){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');if(xhr.status===401||xhr.status===403){showAuthRequiredModal();}else{alert('Ðомилка пÑи видаленнÑ. СпÑобÑйÑе Ñе Ñаз.');}}});});} 48function showWishlistAlreadyInFavoritesConfirm(deleteKey,sizeTitle,productId){$('#wl-confirm-title').text('РозмÑÑ '+sizeTitle+' вже в «ÐбÑÐ°Ð½Ð¸Ñ Â»');$('#wl-confirm-text').text('ÐажаÑÑе пÑибÑаÑи Ñей ÑозмÑÑ Ð· обÑÐ°Ð½Ð¸Ñ ?');$('#waitlist-confirm-modal').addClass('modalopen');$('body').css('overflow','hidden');$('#wl-keep-btn').off('click').on('click',function(){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');});$('#wl-remove-btn').off('click').on('click',function(){$.ajax({url:'/wishlist/remove-favorite',type:'POST',data:{key:deleteKey},success:function(rawRes){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');try{var res=typeof rawRes==='string'?JSON.parse(rawRes):rawRes;if(res&&res.data&&!res.data.still_in_list){updateCatalogCardHeart(productId,false);}}catch(e){} 49showProfileRemovedModal('favorites',sizeTitle);},error:function(xhr){$('#waitlist-confirm-modal').removeClass('modalopen');$('body').css('overflow','auto');if(xhr.status===401||xhr.status===403){showAuthRequiredModal();}else{alert('Ðомилка пÑи видаленнÑ. СпÑобÑйÑе Ñе Ñаз.');}}});});} 50function updateCatalogCardHeart(productId,isInList){var $cards=$('.like.addwish[data-id="'+productId+'"]').not('.like-in-product');if(!$cards.length)return;$cards.each(function(){var $card=$(this);if(!isInList){$card.removeClass('heart-catalog-liked');$card.find('svg.myLike, i.myLike').replaceWith('<i class="far fa-regular fa-heart myLike"></i>');}});} 51function sizeRequestToServer(productId,$this,image){$.ajax({url:'/wishlist/getsize',type:'GET',data:{id:productId},success:function(data){$('#modalSizes').html(data);var $modal=$('#wishlist-sizes-modal');$modal.addClass('modalopen');$('body').css('overflow','hidden');$modal.off('click.sizes').on('click.sizes',function(e){if($(e.target).is('#wishlist-sizes-modal')){$modal.removeClass('modalopen');$('body').css('overflow','auto');}});$modal.find('.size-button').off('click').on('click',function(){var sizeModId=parseInt($(this).attr('id'),10);var sizeTitle=$(this).data('size-title')||$(this).text().trim();$modal.removeClass('modalopen');$('body').css('overflow','auto');clickOnSizeInProduct(productId,sizeModId,image,sizeTitle,$this);});},error:function(){showInfoModal('Ðомилка заванÑаженнÑ. СпÑобÑйÑе Ñе Ñаз.');}});} 52$('body').on('click','#addtowish, #addtodelayed, #waitlist-confirm-modal',function(e){if($(e.target).is('#addtowish, #addtodelayed, #waitlist-confirm-modal')){$(this).removeClass('modalopen');$('body').css('overflow-y','auto');}});function showInfoModal(message){$('#wl-info-modal').remove();var $modal=$('<div>',{id:'wl-info-modal',class:'modal fade addtowish'});$modal.html('<div class="modal-dialog modal-dialog-centered modal
52-lg" role="document">'+'<div class="modal-content">'+'<button type="button" class="close" aria-label="Close">'+'<span aria-hidden="true">×</span>'+'</button>'+'<div class="modal-body wl-info-modal-body">'+'<span class="wl-info-modal-message">'+message+'</span>'+'</div>'+'</div>'+'</div>');$('body').append($modal);$modal.addClass('modalopen');$('body').css('overflow','hidden');$modal.find('.close').on('click',function(){$modal.remove();$('body').css('overflow','auto');});$modal.on('click',function(e){if($(e.target).is('#wl-info-modal')){$modal.remove();$('body').css('overflow','auto');}});} 53function showWaitlistLimitModal(){$('#wl-info-modal').remove();var $modal=$('<div>',{id:'wl-info-modal',class:'modal fade addtowish'});$modal.html('<div class="modal-dialog modal-dialog-centered modal-lg" role="document">'+'<div class="modal-content">'+'<div class="modal-body">'+'<button type="button" class="close" aria-label="Close">'+'<span aria-hidden="true">×</span>'+'</button>'+'<div class="row justify-content-center modal-wishlist-actions">'+'<div class="col-11 titles-wishlist">'+'<span class="h4">ÐÑмÑÑ Ð´Ð¾ÑÑгнÑÑо</span>'+'<p class="wl-modal-desc">'+'Ðи вже пÑдпиÑÐ°Ð½Ñ Ð½Ð° 2 ÑозмÑÑи ÑÑого ÑоваÑÑ. ÐидалÑÑÑ Ð¾Ð´Ð½Ñ Ð¿ÑдпиÑкÑ, Ñоб додаÑи новÑ.'+'</p>'+'<div class="row items-end wishlist-actions">'+'<a class="btn-theme wl-limit-close-btn">ÐÑозÑмÑло</a>'+'</div>'+'</div>'+'</div>'+'</div>'+'</div>'+'</div>');$('body').append($modal);$modal.addClass('modalopen');$('body').css('overflow','hidden');$modal.find('.close, .wl-limit-close-btn').on('click',function(){$modal.remove();$('body').css('overflow','auto');});$modal.on('click',function(e){if($(e.target).is('#wl-info-modal')){$modal.remove();$('body').css('overflow','auto');}});} 54function showUnsubscribedModal(size){showProfileRemovedModal('delayed',size);} 55function showAuthRequiredModal(){$('#wl-info-modal').remove();var isRu=_isRuLang();var currentPath=window.location.pathname;var lang=(typeof currentLang!=='undefined'&¤tLang)?currentLang:'';var loginUrl=lang+'/user/login?return='+encodeURIComponent(currentPath);var title=isRu?'ÐÐµÐ¾Ð±Ñ Ð¾Ð´Ð¸Ð¼ Ð²Ñ Ð¾Ð´ в аккаÑнÑ':'ÐоÑÑÑбен Ð²Ñ Ñд в акаÑнÑ';var text=isRu?'ЧÑÐ¾Ð±Ñ Ð´Ð¾Ð±Ð°Ð²Ð¸ÑÑ ÑÐ¾Ð²Ð°Ñ Ð² «ÐзбÑаннÑе» или «ÐжидаемÑе», войдиÑе или заÑегиÑÑÑиÑÑйÑеÑÑ.':'Щоб додаÑи ÑÐ¾Ð²Ð°Ñ Ð² «ÐбÑанÑ» або «ÐÑÑкÑванÑ», ÑвÑйдÑÑÑ Ð°Ð±Ð¾ заÑеÑÑÑÑÑйÑеÑÑ.';var btnLogin=isRu?'ÐойÑи в аккаÑнÑ':'УвÑйÑи в акаÑнÑ';var btnContinue=isRu?'ÐÑодолжиÑÑ Ð¿Ð¾ÐºÑпки':'ÐÑодовжиÑи покÑпки';var $modal=$('<div>',{id:'wl-info-modal',class:'modal fade addtowish'});$modal.html('<div class="modal-dialog modal-dialog-centered modal-lg" role="document">'+'<div class="modal-content">'+'<div class="modal-body">'+'<button type="button" class="close" aria-label="Close">'+'<span aria-hidden="true">×</span>'+'</button>'+'<div class="row justify-content-center modal-wishlist-actions">'+'<div class="col-11 titles-wishlist">'+'<span class="h4">'+title+'</span>'+'<p class="wl-modal-desc">'+text+'</p>'+'<div class="row items-end wishlist-actions">'+'<a class="btn-theme" href="'+loginUrl+'">'+btnLogin+'</a>'+'<a class="btn-theme-default wl-auth-close-btn">'+btnContinue+'</a>
55'+'</div>'+'</div>'+'</div>'+'</div>'+'</div>'+'</div>');$('body').append($modal);$modal.addClass('modalopen');$('body').css('overflow','hidden');$modal.find('.close, .wl-auth-close-btn').on('click',function(){$modal.remove();$('body').css('overflow','auto');});$modal.on('click',function(e){if($(e.target).is('#wl-info-modal')){$modal.remove();$('body').css('overflow','auto');}});} 56function _isRuLang(){return window.location.pathname.indexOf('/ru')===0;} 57function showProfileRemovedModal(type,size){$('#wl-info-modal').remove();var isRu=_isRuLang();var title,text,btnText;if(type==='delayed'){title=isRu?'ÐодпиÑка оÑменена':'ÐÑдпиÑÐºÑ ÑкаÑовано';text=isRu?'ÐÑ Ð±Ð¾Ð»ÑÑе не бÑдем оÑпÑавлÑÑÑ ÑÐ²ÐµÐ´Ð¾Ð¼Ð»ÐµÐ½Ð¸Ñ Ð¾ налиÑии ÑазмеÑа '+size+'.':'Ðи бÑлÑÑе не надÑилаÑимемо ÑповÑÑÐµÐ½Ð½Ñ Ð¿Ñо наÑвнÑÑÑÑ ÑозмÑÑÑ '+size+'.';}else{title=isRu?'Удалено из избÑанного':'Ðидалено з обÑÐ°Ð½Ð¸Ñ ';text=isRu?'Ð Ð°Ð·Ð¼ÐµÑ '+size+' ÑбÑан из избÑанного.':'РозмÑÑ '+size
57+' пÑибÑано з обÑÐ°Ð½Ð¸Ñ .';} 58btnText=isRu?'ÐÑодолжиÑÑ Ð¿Ð¾ÐºÑпки':'ÐÑодовжиÑи покÑпки';var $modal=$('<div>',{id:'wl-info-modal',class:'modal fade addtowish'});$modal.html('<div class="modal-dialog modal-dialog-centered modal-lg" role="document">'+'<div class="modal-content">'+'<div class="modal-body">'+'<button type="button" class="close" aria-label="Close">'+'<span aria-hidden="true">×</span>'+'</button>'+'<div class="row justify-content-center modal-wishlist-actions">'+'<div class="col-11 titles-wishlist">'+'<span class="h4">'+title+'</span>'+'<p class="wl-modal-desc">'+text+'</p>'+'<div class="row items-end wishlist-actions">'+'<a class="btn-theme wl-removed-close-btn">'+btnText+'</a>'+'</div>'+'</div>'+'</div>'+'</div>'+'</div>'+'</div>');$('body').append($modal);$modal.addClass('modalopen');$('body').css('overflow','hidden');$modal.find('.close, .wl-removed-close-btn').on('click',function(){$modal.remove();$('body').css('overflow','auto');});$modal.on('click',function(e){if($(e.target).is('#wl-info-modal')){$modal.remove();$('body').css('overflow','auto');}});} 59function showWaitlistToast(message){var existing=document.getElementById('wl-toast');if(existing)existing.remove();var toast=document.createElement('div');toast.id='wl-toast';toast.style.cssText=['position:fixed;bottom:24px;left:50%;transform:translateX(-50%);','background:#2c3e50;color:#fff;padding:14px 24px;border-radius:8px;','font-size:14px;z-index:99999;box-shadow:0 4px 16px rgba(0,0,0,.25);','max-width:90%;text-align:center;'].join('');toast.textContent=message;document.body.appendChild(toast);setTimeout(function(){toast.style.transition='opacity .4s';toast.style.opacity='0';setTimeout(function(){toast.remove();},400);},4000);} 60function performLikesRequest(productId,choose_size_title,resultnext,$this){if(isUserLoggedIn||getEncryptedPhoneNumber()){$.ajax({url:'/wishlist/liked',method:'POST',data:{productId:productId,phone:isUserLoggedIn?userPhone:decryptPhoneNumber(getEncryptedPhoneNumber())},success:function(data){var likeButtons=$('.like[data-id="'+productId+'"]');callBackAfterLikeRequest(data,likeButtons,resultnext,productId);},error:function(xhr){if(xhr.status===401||xhr.status===403){showAuthRequiredModal();}}});}else{localStorage.setItem('likedProduct',productId);$('#phoneModal').show();}} 61function callBackAfterLikeRequest(data,likeButtons,resultnext,liked){likeButtons.each(function(){var $btn=$(this);if($btn.hasClass('like-in-product')){return;} 62var $icon=$btn.find('svg, i');var $count=$btn.find('.count');if(data==='liked'){like($btn,$icon,resultnext,$count,liked);}else{unlike($icon,$btn,$count,liked);} 63animatedLikes($count);});} 64function like(likeButton,likeIcon,resultnext,likeCount,liked){var successType=resultnext&&resultnext.data?resultnext.data.success:null;var isProductPageHeart=likeButton.hasClass('like-in-product');likeIcon.removeClass('fa-heart').addClass('fa-sharp fa-solid fa-heart').removeClass('far').addClass('fa');if(isProductPageHeart){}else{} 65likeCount.text(parseInt(likeCount.text(),10)+1);saveLikeIconState(liked,'fa-sharp');} 66function unlike(likeIcon,likeButton,likeCount,liked){likeIcon.removeClass('fa-sharp fa-solid fa-heart').addClass('fa-heart');likeButton.removeAttr('href');saveLikeIconState(liked,'fa-heart-o');likeCount.text(parseInt(likeCount.text(),10)-1);} 67function deleteFromDelayed(resultnext,likeIcon,likeButton){likeIcon.closest('.like').addClass('delete-btn');likeButton.wrap('<a href="/profile/delayed/delete?id='+resultnext.data.key+'"></a>');} 68function deleteFromFavorites(resultnext,likeIcon,likeButton){likeIcon.closest('.like').addClass('delete-btn');if(resultnext.data&&resultnext.data.success==='addToWish'){likeButton.wrap('<a href="/profile/favorites/delete?id='+resultnext.data.key+'"></a>');}} 69function animatedLikes(like){like.animate({fontSize:'1.5em'},200,function(){like.animate({fontSize:'1em'},200);});} 70$('#submitPhone').click(function(){var phone=$('#phoneLikes').val();if(phone){saveEncryptedPhoneNumber(encryptPhoneNumber(phone));$('#phoneModal').hide();var likedProduct=localStorage.getItem('likedProduct');if(likedProduct){localStorage.removeItem('likedProduct');$('.like[data-id="'+likedProduct+'"]').click();}}else{alert('ÐожалÑйÑÑа, введиÑе Ð²Ð°Ñ Ð½Ð¾Ð¼ÐµÑ ÑелеÑона.');}});function saveLikeIconState(productId,state){localStorage.setItem('likeIconState_'+productId,state);} 71function getLikeIconState(productId){return localStorage.getItem('likeIconState_'+productId);} 72function saveEncryptedPhoneNumber(e){localStorage.setItem('encryptedUserPhoneNumber',e);} 73function getEncryptedPhoneNumber(){return localStorage.getItem('encryptedUserPhoneNumber')||null;} 74function decryptPhoneNumber(encryptedPhone){if(!encryptedPhone)return null;try{return CryptoJS.AES.decrypt(encryptedPhone,'secret-key').toString(CryptoJS.enc.Utf8)||null;} 75catch(e){return null;}}
76function encryptPhoneNumber(phone){return CryptoJS.AES.encrypt(phone,'secret-key').toString();} 77var phoneModal=document.getElementById('phoneModal');if(phoneModal){phoneModal.addEventListener('click',function(event){if(event.target===this){this.style.display='none';$('body').css('overflow','auto');}});} 78$('.delete-btn .fa-sharp').click(function(){if($(this).closest('.profile-heart-delete').length){return;} 79$('.preloader').show();});if($('.btn-purchase').length){$('.btn-purchase').click(function(){$('body').css('overflow','auto');});}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.