PageSourceSearch

https://www.tiendanimal.es/on/demandware.static/Sites-TiendanimalE…/js/recommendationsTiendanimal.js

js tiendanimal.es collected 2026-09-24 08:51:25 UTC 5,850 bytes, 1 lines download raw bytes

1!function(){"use strict";var e={16:function(e){class n extends Error{constructor(e,n={}){super(e),this.params=n}redirectNavigation(){const e=this.params.error;e&&e.responseJSON&&e.responseJSON.redirectUrl&&null!=e.responseJSON.redirectUrl&&(window.location.href=e.responseJSON.redirectUrl)}}class t extends n{}class r extends n{}class o extends n{}class i extends n{}class c extends n{}class s extends n{}class a extends n{}class u extends n{}class d extends n{}class l extends n{}class f extends n{}e.exports={iskLogger:function(e,n){if("string"==typeof e){try{const t=JSON.stringify(n);console.error(`${e}:`,t)}catch(t){console.error(`${e}: ${n}`)}return}const m=e;return function(...e){try{m.apply(this,e)}catch(e){if(e instanceof o)return;if(e instanceof t||e instanceof r||e instanceof o||e instanceof i||e instanceof c||e instanceof l)return void e.redirectNavigation();(e instanceof s||e instanceof a||e instanceof u||e instanceof d||e instanceof f)&&console.error(e)}}},PaymentError:o,InvalidPaymentInstrumentAction:t,InvalidshippingFormData:r,DeliveryPromiseError:s,CheckoutStoresListError:a,CheckoutAddressError:u,CheckoutSelectShippingTypeError:d,CheckoutCartError:l,UnifiedCartError:f}},131:function(e,n,t){t.r(n),t.d(n,{VIEWPORT_TYPES:function(){return p},createWindowIntersectionObserver:function(){return f},getCurrentViewport:function(){return E},getViewportHeight:function(){return a},getViewportWidth:function(){return u},isDesktopViewport:function(){return o},isEqualOrGreatherViewport:function(){return c},isInViewport:function(){return d},isMobileViewport:function(){return i},isTabletOrLowerViewport:function(){return s},mediaQueryHandler:function(){return l}});const r=t(389);function o(){return window.innerWidth>=r.SINCE_DESKTOP_VIEWPORT_WIDTH}function i(){return window.matchMedia("(max-width: "+r.MOBILE_VIEWPORT_WIDTH+"px)").matches}function c(e){return window.matchMedia("(min-width: "+e+"px)").matches}function s(){return window.matchMedia("(max-width: "+r.SINCE_DESKTOP_VIEWPORT_WIDTH+"px)").matches}function a(){return window.innerHeight||document.documentElement.clientHeight}function u(){return window.innerWidth||document.documentElement.clientWidth}function d(e){const n=e.getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=a()&&n.right<=u()}function l(e){const n=window;function t(){const t=n.innerWidth;t<=r.MOBILE_VIEWPORT_WIDTH&&e.mobile?.(),t<=r.DESKTOP_VIEWPORT_WIDTH&&e.tablet?.(),t>r.DESKTOP_VIEWPORT_WIDTH&&e.desktop?.()}n.addEventListener("resize",t),t()}function f(e,n,t,r={root:null,rootMargin:"0px",threshold:.01,delay:0}){if("string"==typeof e&&(e=document.querySelector(e)),!(e instanceof Element)||!n&&!t)return;const o=new IntersectionObserver(((e,r)=>m(e,r,n,t)),r);return o?(o.observe(e),o):null}const m=(e,n,t,r)=>{e&&e.forEach((e=>{e.isIntersecting?"function"==typeof t&&t(n):"function"==typeof r&&r(n)}))},p={MOBILE:"mobile",TABLET:"tablet",DESKTOP:"desktop"};function E(){return i()?p.MOBILE:s()?p.TABLET:p.DESKTOP}},389:function(e){e.exports={DESKTOP_VIEWPORT_WIDTH:1199,SINCE_DESKTOP_VIEWPORT_WIDTH:1024,MOBILE_VIEWPORT_WIDTH:768,LARGE_VIEWPORT_WIDTH:992}},142:function(e,n,t){const r=t(131),{iskLogger:o}=t(16),i=".js-observable-recommendations",c=".js-isk-product-card",s="recommender-info",a="recommendations-events-action-url",u=(e,n)=>{if(!(n instanceof Element&&e instanceof IntersectionObserver))return;const t=$(n),{recommenderInfo:r,recommendedProducts:i,actionUrl:c}=d(t);if(c){if(t.is(":visible")){try{$.ajax({url:c,type:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify({...r||{},products:i,event_type:"viewRecommendation"})}).fail((function(e){o(`Error sending viewRecommendations event request.\n ${e.responseJSON?.error?.errorText||"Unexpected error"}`)}))}catch(e){o(`Error sending viewRecommendations event request: ${e}`)}e.disconnect()}}else o("Error sending viewRecommendations event request: No actionUrl available to send it")},d=e=>{if(!(e instanceof jQuery&&e.length))return{};const n=e.data(s)||null,t=e.data(a)||null,r=e.find(c);let o=null;if(r.length){const e=r.map((function(){return{id:$(this).data("pid")||null}})).get();o=e?.length?e:null}return{actionUrl:t,recommenderInfo:n,recommendedProducts:o}};function l(){const{clickRecommendationEventData:e,actionUrl:n}=f($(this));if(n)try{$.ajax({url:n,type:"POST",headers:{"Content-Type":"application/json"},data:JSON.stringify(e)}).fail((function(e){o(`Error sending clickRecommendation event request: ${e.responseJSON?.error?.errorText||"Unexpected error"}`)}))}
1catch(e){o(`Error sending clickRecommendation event request: ${e}`)}else o("Error sending clickRecommendation event request: No actionUrl available to send it")}const f=e=>{if(!(e instanceof jQuery&&e.length))return{};const n=e.closest(i);if(!n?.length)return{};const t=n.data(s)||null,r=n.data(a)||null,o=e.closest(c);if(!o?.length)return{};const u=o.data("pid"),d=o.data("variant-id");return{actionUrl:r,clickRecommendationEventData:{...t||{},event_type:"clickRecommendation",products:[{id:u,sku:d?.toString()||""}]}}};e.exports={initializeRecommendationsEvents:()=>{(()=>{const e=document.querySelectorAll(i);e.length&&e.forEach((function(e){r.createWindowIntersectionObserver(e,(n=>u(n,e)))}))})(),$(i).on("click",".js-isk-product-card-anchor",l)}}}},n={};function t(r){var o=n[r];if(void 0!==o)return o.exports;var i=n[r]={exports:{}};return e[r](i,i.exports,t),i.exports}t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){const e=t(142);jQuery((function(){e.initializeRecommendationsEvents()}))}()}();

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.