1(function($){'use strict';var connectorLink=(typeof tlr_js_config!=='undefined'&&tlr_js_config.connectorLink)?tlr_js_config.connectorLink:'https://wp-api-manager.tailoor.com';var sessionsPath=(typeof tlr_js_config!=='undefined'&&tlr_js_config.sessionsPath)?tlr_js_config.sessionsPath:'/api/tailoor/tailoor_sessions';function setCookie(cname,cvalue,exdays){exdays=exdays||90;var d=new Date();d.setTime(d.getTime()+(exdays*24*60*60*1000));document.cookie=cname+'='+cvalue+';expires='+d.toUTCString()+';path=/;SameSite=Lax';} 2function getCookie(cname){var name=cname+'=';var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i].trim();if(c.indexOf(name)===0){return c.substring(name.length,c.length);}} 3return'';} 4function getTlrCurrency(){if(typeof tlr_currency!=='undefined'){return tlr_currency;} 5var config_parsed=JSON.parse(tlr_config);return config_parsed.tlr_countrys_currency.split('-')[1];} 6function getTlrLanguage(){if(typeof tlr_lang!=='undefined'){return tlr_lang;} 7return JSON.parse(tlr_config).tlr_lang;} 8function getTlrCountry(){if(typeof tlr_country!=='undefined'){return tlr_country;} 9return JSON.parse(tlr_config).tlr_countrys_currency.split('-')[0];} 10function normalizeCustomizePath(href){return href.replace(/\/personalizza\//g,'/vai-a-personalizza/').replace(/\/personnaliser\//g,'/aller-a-personnaliser/').replace(/\/personalizar\//g,'/ir-a-personalizar/').replace(/\/customize\//g,'/go-to-customize/');} 11function buildSessionPayload(linkHref){return{action:'tail_prod_redirect',customer_origin:window.location.href,tailoor_destination:linkHref,lang:getTlrLanguage(),country:getTlrCountry(),tlr_cart_url:(typeof tlr_cart_url!=='undefined')?tlr_cart_url:'',session:getCookie('tlr_session'),currency:getTlrCurrency()};} 12function handleProductClick($link){$.ajax({method:'POST',url:connectorLink+sessionsPath,dataType:'json',data:buildSessionPayload($link.attr('href'))}).done(function(data){if(!getCookie('tlr_session')){setCookie('tlr_session',data.session);} 13window.location.href=data.url;});return false;} 14$(document).ready(function(){$('.tlr-products .item a:not(.product_page), .page-template-template-single-product .cta-section a').on('click',function(){return handleProductClick($(this));});var tlrSessionPending=false;var tlrLinkQueue=[];function applySessionToLink($link,session){var href=normalizeCustomizePath($link.attr('href')||'');var separator=href.indexOf('?')!==-1?'&':'?';$link.attr('href',href+separator+'sessionId='+encodeURIComponent(session)+'&countryId='+encodeURIComponent(getTlrCountry())+'¤cy='+encodeURIComponent(getTlrCurrency())+'&lang='+encodeURIComponent(getTlrLanguage())).css('pointer-events','').off('click.tlr_pending');} 15function processTlrHookLink(el){var $link=$(el);if($link.data('tlr-processed')){return;} 16$link.data('tlr-processed',true);var existingSession=getCookie('tlr_session');if(existingSession){applySessionToLink($link,existingSession);return;} 17$link.css('pointer-events','none').on('click.tlr_pending',function(e){e.preventDefault();});if(tlrSessionPending){tlrLinkQueue.push($link);return;} 18tlrSessionPending=true;$.ajax({method:'POST',url:connectorLink+sessionsPath,dataType:'json',data:buildSessionPayload(normalizeCustomizePath($link.attr('href')))}).done(function(data){setCookie('tlr_session',data.session);$link.attr('href',data.url).css('pointer-events','').off('click.tlr_pending');$.each(tlrLinkQueue,function(i,$queued){applySessionToLink($queued,data.session);});tlrLinkQueue=[];tlrSessionPending=false;});} 19$('.tlr_prod_hook a, a.tlr_prod_hook').each(function(){processTlrHookLink(this);});if(window.MutationObserver){var tlrObserver=new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){if(node.nodeType!==1){return;} 20if($(node).is('a.tlr_prod_hook')){processTlrHookLink(node);} 21$(node).find('.tlr_prod_hook a, a.tlr_prod_hook').each(function(){processTlrHookLink(this);});});});});tlrObserver.observe(document.body,{childList:true,subtree:true});} 22$('.btn-contry-confirm').on('click',function(){var selected_country=$('select.tlr_country').val();setCookie('tlr_country',selected_country);setCookie('tlr_rebuild_remote_cart',1);setCookie('tlr_new_currency',selected_country.split('-')[1]);location.reload();});});setInterval(function(){if(getCookie('tlr_refresh_page')==1&&window.location.href.indexOf('checkout')!==-1){setCookie('tlr_refresh_page',0);location.reload();}},5000);})(jQuery);
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.