<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">;(function($) {
	var pagetype = window.pagetype || "";

	mindbox("async", {
		operation: "CustomerZoneDefinition",
		data: {
			customer: {
				area: {
					ids: {
						externalId: region_id
					}
				}
			}
		}
	});

	switch(pagetype){
		case 'home':            
			break;

		case 'category':
			if (pageid != ''){
				directCrm('performOperation', {
					operation: 'ViewCategory',
					data: {
						action: {
							productCategoryId: pageid
						}
					}
				});
			}
			break;

		case 'product':
			directCrm('performOperation', {
				operation: 'ViewProduct',
				data: {
					action: {
						productId: pageid
					}
				}
			});
			break;

		/*case 'purchase':
			
			console.log("Mindbox purchase");
			break;*/
	}

	$(".subscribe__btn").on('click', function(e){
		var parentwrapp = $(this).closest(".subscribe"),
			email = $('input[type=email]', parentwrapp).val();

		if (email != ""){
			directCrm('identify', {
				operation: "SubscribeField",
				identificator: {
					provider: 'email',
					identity: email
				},
				data: {
					firstName: '',
					settlement: settlement_var
				}
			});

			$(".subscribe__title", parentwrapp).html("РЎРїР°СЃРёР±Рѕ,&lt;br&gt;Р’С‹ РїРѕРґРїРёСЃР°РЅС‹!");
			$(".subscribe__input-wrapper", parentwrapp).hide();
		}

		return;
	});

	let mbx_SetCartYRItemList = function(){
		let data = yrCart.getData(),
		    products = typeof data.products === 'object' ? data.products : {...data.products},
			productList = [],
			opData = {};

		if(products.length !== 0){
			products.forEach(function(p, key){
				productList.push({
					product: {
						ids: {
							yourRoom1C: p.product_id,
						}
					},
					count: p.quantity,
					pricePerItem: Math.round(p.price)
				});
			});

			opData.productList = productList;
		}

		console.log(opData);
	  
		mindbox("async", {
			operation: "SetCartYRItemList",
			data: opData,
			onSuccess: function () {
				console.log('Mindbox SetCartYRItemList operation sent');
			},
			onError: function (error) {
				console.log('Mindbox SetCartYRItemList operation Error: ' + error);
			}
		});
	}

	// update РєРѕСЂР·РёРЅС‹ (РїРѕРєСѓРїРєР°, СѓРґР°Р»РµРЅРёРµ, РєРѕР»-РІРѕ, РґРёСЃРєРѕРЅС‚)
	yrCart.$on('update', mbx_SetCartYRItemList);

	// РѕС‚Р·С‹РІ
	$('#modalAddComment input[type="submit"]').on('click', function(event) {
		var email = $('#modalAddComment input[name="user_email"]').val();
		
		if (email!=""){
			directCrm('identify', {
				operation: 'Review',
				identificator: {
					provider: 'email',
					identity: email
				},
				data: {
					firstName: $('#modalAddComment input[name="user_name"]').val(),
					settlement: settlement_var
				}
			});
		}

		return;
	});

	// feedback, send question
	$(document).on("click", "#feedbackModal .sendfeedback", function(){
		var email = $("#feedbackModal input[name=email]").val();
		if (email=="") return false;

		mindbox('async', {
			operation: 'SubFormVopros',
			data: {
				customer:{
					email: email,
					customFields: {
						clientCity: settlement_var,
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox #feedbackModal .sendfeedback operation SubFormVopros ' + email);

		return;
	});

	// eraser in card
	$(document).on("click", "#eraser-email-button", function(e){
		var email = $(".eraser-email").val().trim(),
			timer = 0;

		if (email == "") return false;
		
		directCrm('identify', {
			operation: 'subsEraser',
			identificator: {
				provider: 'email',
				identity: email
			},
			data: {
				firstName: '',
				settlement: settlement_var
			}
		});
	});

	// product subscribe send
	$(".prodListSubs").on('click', function(e){
		$('#prodsubscribe-send').attr('data-productid', $(this).data('productid'));
	});
	$("#prodsubscribe-send").on('click', function(e){
		var email = $("#subscribe_user_email").val(),
		    productid = productid || $(this).data('productid');

		if (email == ""){
			$("#subscribe_user_email").addClass("field__input_invalid");
			return;
		}

		mindbox("async", {
			operation: "subList",
			data: {
				customer: {
					email: email,
				},
				addProductToList: {
					product: {
						ids: {
							yourRoom1C: productid,
						}
					}
				}
			},
		});

		$("#modalProdSubscribe .modal-body").html('РЎРїР°СЃРёР±Рѕ Р·Р° РїСЂРѕСЏРІР»РµРЅРЅС‹Р№ РёРЅС‚РµСЂРµСЃ, РјС‹ СЃРѕРѕР±С‰РёРј Р’Р°Рј РЅР° СѓРєР°Р·Р°РЅРЅС‹Р№ email Рѕ РїРѕСЃС‚СѓРїР»РµРЅРёРё С‚РѕРІР°СЂР° РёР»Рё РµРіРѕ Р°РЅР°Р»РѕРіР°!');

	});

	// РїРѕРґРїРёСЃРєР° РЅР° Р±Р»РѕРі
	$('.blogSubscribe button[type="submit"]').on('click', function(event) {
		var articleId = $(this).data('articleid'),
		    op;

		op = articleId == 1508 ? "SubForm" : "subBlog"; // С…Р°СЂРґ РЅР° СЃС‚Р°С‚СЊСЋ Р°РєС†РёСЏ

		mindbox('sync', {
			operation: op,
			data: {
				customer:{
					email:$('#blogEmail').val(),
					mobilePhone:"",
					fullName:$('#blogName').val(),
					customFields: {
						clientCity: settlement_var
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});
		console.log('mindbox operation ' + op + ' articleId=' + articleId);
	});

	// Р±РµСЂРµРј РєСЂРµРґРёС‚ РЅР° СЃС‚СЂР°РЅРёС†Рµ СЂР°СЃСЃСЂРѕС‡РєРё
	$('[id^="kform"] button[name="submit"]').on('click', function(){
		var parentForm = $(this).closest("form"),
		    mail = $('input[name=click_email]', parentForm).val();

		if(mail != '' &amp;&amp; checkMail(mail)){
			console.log('Send mindbox rassrochka');
			directCrm('identify', {
				operation: 'SubscribeDiscounts',
				identificator: {
					provider: 'email',
					identity: mail
				},
				data: {
					settlement: settlement_var,
					firstName:  '',
				}  

			});
		}
	});

	// СЃС‚Р°РЅРёС†Р° РѕРїС‚РѕРІРёРєР°Рј /optovikam
	$('#optovikam [type=submit]').on('click', function(){
		var parentForm = $(this).closest("form"),
		    mail = $('[name=mail]', parentForm).val();

		if(mail){
			directCrm('identify', {
              operation: 'Wholesale',
              identificator: {
                provider: 'email',
                identity: jQuery("input[name='mail']", parentForm).val()
              },
              data: {
                firstName: jQuery("input[name='name']", parentForm).val(),
                mobilePhone: jQuery("input[name='tel']", parentForm).val()
              }
            });
		}

	});

	// РћС‚РїСЂР°РІРёС‚СЊ РїРѕРґР°СЂРѕРє РґСЂСѓРіСѓ
	$('.discountFriend button[type="submit"]').on('click', function(event) {
		mindbox('sync', {
			operation: 'giftSender',
			data: {
				customer:{
					email:$('#blogEmail').val(),
					fullName:$('#blogName').val(),
					customFields: {
						clientCity: settlement_var,
						friendName: $('#blogNameTo').val(),
						friendEmail: $('#blogEmailTo').val(),
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox operation giftSender');

		mindbox('sync', {
			operation: 'giftRecipient',
			data: {
				customer:{
					email:$('#blogEmailTo').val(),
					fullName:$('#blogNameTo').val(),
					customFields: {
						clientCity: settlement_var,
						friendName: $('#blogName').val(),
						friendEmail: $('#blogEmail').val(),
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox operation giftRecipient');
	});

	// С„СЂР°РЅС‡Р°Р№Р·Рё
	$('.contact-form-0 .btn-send').on('click', function(event) {
		var email = $('.contact-form-0 [name=email]').val();

		if(email == ''){
			return;
		}

		mindbox('async', {
			operation: 'ZapolnenieFormySendMessage',
			data: {
				customer:{
					email: email,
					fullName: $('.contact-form-0 [name=name]').val(),
					customFields: {
						clientCity: settlement_var,
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox .contact-form-0 operation ZapolnenieFormySendMessage');
	});

	$('.contact-form-1 .btn-send').on('click', function(event) {
		var email = $('.contact-form-1 [name=email]').val();
		
		if(email == ''){
			return;
		}

		mindbox('async', {
			operation: 'SubForm',
			data: {
				customer:{
					email: email,
					customFields: {
						clientCity: settlement_var,
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox .contact-form-1 operation SubForm');
	});

	/** 
	 * task #4068
	 * "РџРѕР»СѓС‡РёС‚Рµ РєРѕРЅСЃСѓР»СЊС‚Р°С†РёСЋ" РџРѕРґРїРёСЃРєР° С„РѕСЂРјР° РЅР° СЃР°Р№С‚Рµ
	 */
	$('[data-mindbox="SubFormconsulting"] .sendnotify, [data-mindbox="SubFormFreeConsultation"] .sendnotify').on('click', function(event) {
		var form = $(this).closest('form'),
		    phone = $('[name=phone]', form).val(),
		    operation = $(this).closest('[data-mindbox]').data('mindbox');
		
		if(phone == ''){
			return;
		}

		mindbox('async', {
			operation: operation,
			data: {
				customer:{
					mobilePhone: phone,
					customFields: {
						clientCity: settlement_var,
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox operation ' + operation);
	});

	// "РџРѕРґРѕР±СЂР°С‚СЊ РєСѓС…РЅСЋ" РџРѕРґРїРёСЃРєР° С„РѕСЂРјР° РЅР° СЃР°Р№С‚Рµ
	// "Р—Р°РєР°Р·Р°С‚СЊ Р±РµСЃРїР»Р°С‚РЅС‹Р№ РїСЂРѕРµРєС‚" РџРѕРґРїРёСЃРєР° С„РѕСЂРјР° РЅР° СЃР°Р№С‚Рµ
	$('[data-mindbox="SubFormChoosekitchen"] .sendnotify, [data-mindbox="SubFormFreeProject"] .sendnotify').on('click', function(event) {
		var form = $(this).closest('form'),
		    phone = $('[name=phone]', form).val(),
		    email = $('[name=email]', form).val(),
			operation = $(this).closest('[data-mindbox]').data('mindbox');
		
		if(email == ''){
			return;
		}

		mindbox('async', {
			operation: operation,
			data: {
				customer:{
					email: email,
					mobilePhone: phone,
					customFields: {
						clientCity: settlement_var,
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox operation ' + operation);
	});

	// Р—Р°РєР°Р·Р°С‚СЊ РїСЂРѕРµРєС‚ РєСѓС…РЅРё РѕРЅ-Р»Р°Р№РЅ, С„РѕСЂРјР°
	$(document).on('click', '#orderProjectOnline .sendnotify', function(event) {
		var ktype = $('#orderProjectOnline [name=type]:checked').val(),
		    ktype_name = '',
			email = $('#orderProjectOnline [name=email]').val();
		
		if(email == ''){
			return;
		}

		switch (ktype) {
			case 2:
				ktype_name = 'РЈРіР»РѕРІР°СЏ (Р»РµРІР°СЏ)';
				break;
			case 3:
				ktype_name = 'РЈРіР»РѕРІР°СЏ (РїСЂР°РІР°СЏ)';
				break;
			case 4:
				ktype_name = 'Рџ-РѕР±СЂР°Р·РЅР°СЏ';
				break;
		
			default:
				ktype_name = 'РџСЂСЏРјР°СЏ';
				break;
		}

		mindbox('async', {
			operation: 'SubFormPrice',
			data: {
				customer:{
					email: email,
					fullName:$('#orderProjectOnline [name=name]').val(),
					customFields: {
						clientCity: settlement_var,
						kitchenconfiguration: ktype_name,
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox #orderProjectOnline .sendnotify operation SubFormPrice');

		return;
	});

	$(document).on('click', '#subs-footer-btn', function(event) {
		var email = $('[name=email_footer]').val();

		if(email == ''){
			return;
		}

		mindbox('async', {
			operation: 'SubFormPodpishites',
			data: {
				customer:{
					email: email,
					customFields: {
						clientCity: settlement_var,
					},
					subscriptions:[
						{brand:"Yourroom",pointOfContact:"Email"}
					]
				}
			}
		});

		console.log('mindbox #subs-footer-btn operation SubFormPodpishites ' + email);

		$("#subs-footer").html("&lt;div class='h2 m-2'&gt;РЎРїР°СЃРёР±Рѕ!&lt;/div&gt;");
		return;
	});

	$(document).on('click', '.favorites img.not-fav, .favorites img.fav', function(event) {
		/*let price = ('pricenum' in window) ? pricenum : $(this).closest('.product-card').find('.btn-buy').data('price');*/
		let product_id = $(this).closest('.favorites').data('product'),
		    list_arr = [],
			fav_arr = [],
		    fav = $.cookie('favorites');

		if (fav){
			fav = JSON.parse(fav);
			fav_arr = Object.keys(fav);
		}

		if(fav_arr.length){
			for (let f of fav_arr) {
				list_arr.push({
					product: {
						ids: {
							yourRoom1C: f
						}
					},
					count: 1,
					pricePerItem: 1
				});
			}

			mindbox("async", {
				operation: "SetIzbrannoeItemList",
				data: {
					productList: list_arr
				},
				onSuccess: function() { },
				onError: function(error) { }
			});
	
			console.log('mindbox operation SetIzbrannoeItemList products: ' + fav_arr.length);

		}else{
			// delete all
			mindbox("async", {
				operation: "ResetIzbrannoeItemList",
				data: {},
				onSuccess: function() { },
				onError: function(error) { }
			});

			console.log('mindbox operation ResetIzbrannoeItemList');
		}
	});

}(jQuery));</pre></body></html>