PageSourceSearch

https://www.weroad.es/_nuxt/LIad7d7e.js

js weroad.es collected 2026-10-02 06:24:35 UTC 13,336 bytes, 1 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];if(n!=null)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:weroad":!0});var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`afa7aa8d-a102-47c0-a884-6453ce5c3728`,e._sentryDebugIdIdentifier=`sentry-dbid-afa7aa8d-a102-47c0-a884-6453ce5c3728`)}catch{}})();import{J as e,W as t,Yt as n,f as r,lt as i,p as a,q as o,r as s,u as c,y as l}from"./BSXR3eMi.js";import{d as u,t as d}from"./C8VL6VwD.js";import{h as f}from"./B3KSCJh4.js";import{t as p}from"./Dmf5a-0n2.js";import{t as m}from"./CiwRqGqb.js";var h={name:`wr-agnostic-carousel`,props:{modelValue:{type:[Object,Number],default:()=>{}},innerGroupHover:{type:Boolean,default:!1},startSlide:{type:Number,default:0},component:{type:String,default:null},arrows:{type:Boolean,default:!1},dots:{type:Boolean,default:!1},dotsInside:{type:Boolean,default:!1},slidesToScroll:{type:[Number,null],default:null},items:{type:Array,default:()=>[]},useGap:{type:Boolean,default:!1},usePadding:{type:Boolean,default:!1},customGap:{type:String,default:`lg:gap-2.5`},scrollerClass:{type:[String,Array,Object],default:`justify-start`},trackingOnce:{type:Boolean,default:!1},threshold:{type:Number,default:10},useCustomAnimation:{type:Boolean,default:!1},animationDuration:{type:Number,default:400},disableSnapDuringAnimation:{type:Boolean,default:!0}},emits:[`update:modelValue`,`scroll`,`scroll-stop`,`changeActiveDot`,`scroll-start`,`scroll-end`],data(){return{carousel:null,carouselContainer:null,carouselContainerWidth:0,scrollValue:0,maxScroll:0,nodes:[],totalItemsDisplayed:0,debouncedUpdateGeometries:f(this.updateGeometries,100),debouncedOnScroll:f(this.onScroll,100),debouncedOnScrollWithDotsUpdate:f(this.onScrollWithDotsUpdate,16),mobileScrollInterval:null,mobileScrollTimeout:null,mobilePollingRate:16,scrollEndDelay:150,isAnimating:!1,suppressNextScrollEvent:!1,scrollAnimFrame:null,scrollAnimStartTime:null,scrollAnimStart:0,scrollAnimTarget:0,prevScrollSnapType:null,prevScrollBehavior:null}},computed:{showDots(){return this.dots&&this.dotsList.length>1},buttonPrevIsEnable(){return this.scrollValue>0},buttonNextIsEnable(){return this.scrollValue<this.maxScroll},dotsList(){if(!this.carousel||!this.nodes.length)return[];let e=this.nodes[0]||null,t=[],n=0;if(typeof window<`u`&&e)try{let t=window.getComputedStyle(e);n=parseInt(t.scrollMarginLeft,10)||0}catch(e){this.$sentry.captureException(Error(`Error getting computed style:`,e))}let r=this.nodes.length-this.getViewportVisibleItems();for(let e=0;e<=r;e++){let i=e<this.nodes.length?this.nodes[e]?.offsetLeft:this.maxScroll,a=Math.abs(this.scrollValue+n-this.nodes[e]?.offsetLeft)<=this.threshold;t.push({value:i,current:a,marginLeft:n,index:e,isFirst:e===0,isLast:e===r-1})}let i=this.carousel?.clientWidth,a=parseInt(i/e.clientWidth);if(this.nodes.length<=a)return[];if(!t.some(e=>e.current)&&t.length>0){let e=0,n=1/0;t.forEach((t,r)=>{let i=Math.abs(this.scrollValue-t.value);i<n&&(n=i,e=r)}),t[e].current=!0}return t},currentIndex(){let e=this.dotsList.findIndex(e=>e.current);if(e===-1&&this.dotsList.length>0&&this.nodes.length>0){let e=0,t=1/0;return this.dotsList.forEach((n,r)=>{let i=Math.abs(this.scrollValue-n.value);i<t&&(t=i,e=r)}),e+1}return e+1},numberOfSlides(){return this.dotsList.length}},mounted(){try{this.carousel=this.$refs.carousel;let e=this.findCarouselContainer();if(!e){this.$sentry.captureException(Error(`Carousel container not found`));return}this.carouselContainer=e,this.$screen.lg?this.carouselContainer?.addEventListener(`scroll`,this.debouncedOnScroll,{passive:!0}):this.startMobileScrollTracking(),window.addEventListener(`resize`,this.debouncedUpdateGeometries,{passive:!0}),this.nodes=Array.from(this.carouselContainer?.children),this.startSlide>0&&this.scrollToStartSlide(),this.debouncedUpdateGeometries()}catch(e){this.$sentry.captureException(Error(`Error in wr-agnostic-carousel mounted:`,e))}},beforeUnmount(){this.$screen.lg&&this.carouselContainer?.removeEventListener(`scroll`,this.debouncedOnScroll,{passive:!0}),window.removeEventListener(`resize`,this.debouncedUpdateGeometries),this.stopMobileScrollTracking()},methods:{findCarouselContainer(){if(this.$refs[`carousel-container`]instanceof HTMLElement)return this.$refs[`carousel-container`];let e=this.$refs[`carousel-container-host`];return e instanceof HTMLElement&&e.firstElementChild instanceof HTMLElement?e.firstElementChild:null},scrollToStartSlide(){let e=this.nodes?.[this.startSlide]?.offsetLeft;e&&this.scrollTo(e)},updateGeometries(){this.carouselContainer&&(this.carouselContainerWidth=this.carouselContainer.clientWidth,this.maxScroll=this.carouselContainer.scrollWidth-this.carouselContainer.clientWidth)},selection(e){let t=this.modelValue===e?null:e;this.$emit(`update:modelValue`,t)},onScroll(){if(this.isAnimating||this.suppressNextScrollEvent){this.suppressNextScrollEvent=!1;return}this.scrollValue=this.carouselContainer.scrollLeft,this.onStopScroll(),this.$emit(`scroll`,this.dotsList)},onScrollWithDotsUpdate(){this.scrollValue=this.carouselContainer.scrollLeft,this.$forceUpdate()},startMobileScrollTracking(){this.mobileScrollInterval&&clearInterval(this.mobileScrollInterval),this.mobileScrollInterval=m(()=>{if(this.carouselContainer){let e=this.carouselContainer.scrollLeft;Math.abs(e-this.scrollValue)>1&&(this.scrollValue=e,this.$forceUpdate(),this.mobileScrollTimeout&&clearTimeout(this.mobileScrollTimeout),this.mobileScrollTimeout=setTimeout(()=>{this.onStopScroll(),this.$emit(`scroll`,this.dotsList)},this.scrollEndDelay))}},this.mobilePollingRate)},stopMobileScrollTracking(){this.mobileScrollInterval&&=(clearInterval(this.mobileScrollInterval),null),this.mobileScrollTimeout&&=(clearTimeout(this.mobileScrollTimeout),null)},onStopScroll(){let e=this.scrollValue,t=this.nodes[0]?.clientWidth||0,n=this.getViewportVisibleItems(),r=this.nodes.length,i=Math.max(this.totalItemsDisplayed,n+Math.round(e/t));(!this.trackingOnce||this.trackingOnce&&this.totalItemsDisplayed<i)&&(this.totalItemsDisplayed=i,this.$emit(`scroll-stop`,{viewportVisibleItems:n,totalItems:r,totalItemsDisplayed:this.totalItemsDisplayed}),this.$emit(`changeActiveDot`,this.dotsList)),this.scrollValue===0&&this.$emit(`scroll-start`),this.scrollValue===this.maxScroll&&this.$emit(`scroll-end`)},cancelScrollAnimation(){this.scrollAnimFrame&&=(cancelAnimationFrame(this.scrollAnimFrame),null),this.restoreScrollSnapAndBehavior()},disableScrollSnapAndNativeSmooth(){this.carouselContainer&&(this.prevScrollSnapType=this.carouselContainer.style.scrollSnapType||null,this.prevScrollBehavior=this.carouselContainer.style.scrollBehavior||null,this.disableSnapDuringAnimation&&(this.carouselContainer.style.scrollSnapType=`none`),this.carouselContainer.style.scrollBehavior=`auto`)},restoreScrollSnapAndBehavior(){this.carouselContainer&&(this.disableSnapDuringAnimation&&(this.prevScrollSnapType===null?this.carouselContainer.style.removeProperty(`scroll-snap-type`):this.carouselContainer.style.scrollSnapType=this.prevScrollSnapType),this.prevScrollBehavior===null?this.carouselContainer.style.removeProperty(`scroll-behavior`):this.carouselContainer.style.scrollBehavior=this.prevScrollBehavior,this.prevScrollSnapType=null,this.prevScrollBehavior=null)},easeOutCubic(e){return 1-(1-e)**3},scrollTo(e){if(!this.carouselContainer)return;if(!this.useCustomAnimation){this.carouselContainer.scrollTo({top:0,left:e,behavior:`smooth`});return}let t=this.carouselContainer.scrollLeft,n=Math.max(0,Math.min(e,this.maxScroll));if(t===n)return;this.cancelScrollAnimation(),this.disableScrollSnapAndNativeSmooth();let r=this.animationDuration;this.scrollAnimStartTime=null,this.scrollAnimStart=t,this.scrollAnimTarget=n,this.isAnimating=!0;let i=e=>{this.scrollAnimStartTime||=e;let t=e-this.scrollAnimStartTime,n=Math.min(t/r,1),a=this.easeOutCubic(n),o=this.scrollAnimStart+(this.scrollAnimTarget-this.scrollAnimStart)*a;this.carouselContainer.scrollLeft=o,this.scrollValue=o,n<1?this.scrollAnimFrame=requestAnimationFrame(i):(this.carouselContainer.scrollLeft=this.scrollAnimTarget,this.scrollValue=this.scrollAnimTarget,this.onStopScroll(),this.$emit(`scroll`,this.dotsList),this.suppressNextScrollEvent=!0,this.isAnimating=!1,this.restoreScrollSnapAndBehavior(),this.scrollAnimFrame=null,this.scrollAnimStartTime=null)};this.scrollAnimFrame=requestAnimationFrame(i)},scrollPrev(){let e=this.dotsList;if(!e.length)return;let t=e.findIndex(e=>e.current);if(t<=0){this.useCustomAnimation&&(this.$emit(`scroll`,this.dotsList,this.currentIndex,this.scrollValue),this.skipEndScrollEmit=!0),this.scrollTo(0);return}this.scrollTo(e[t-1].value)},scrollNext(){let e=this.dotsList;if(!e.length)return;let t=e.findIndex(e=>e.current);if(t===-1||t===e.length-1){this.scrollTo(this.maxScroll);return}this.scrollTo(e[t+1].value)},getItemDimensions(e){return{width:e?.clientWidth,height:e?.clientHeight}},getViewportVisibleItems(){let e=this.carouselContainerWidth,t=this.nodes[0]?.clientWidth||0;return Math.round(e/t)}}},g={ref:`carousel-container-host`,style:{display:`contents`}},_=[`aria-label`],v=[`aria-label`],y=[`aria-label`,`onClick`];function b(f,p,m,h,b,x){return t(),a(`div`,{ref:`carousel`,"data-name":`wr-agnostic-carousel`,class:n([`relative block`,{group:!m.innerGroupHover}])},[e(f.$slots,`overlay`,{dots:x.dotsList,scrollTo:x.scrollTo}),e(f.$slots,`header`,{dots:x.dotsList,scrollTo:x.scrollTo,prev:x.scrollPrev,next:x.scrollNext,prevEnable:x.buttonPrevIsEnable,nextEnable:x.buttonNextIsEnable,scrollValue:b.scrollValue,currentIndex:x.currentIndex,numberOfSlides:x.numberOfSlides}),c(`div`,g,[e(f.$slots,`carousel-container`,{action:x.selection,dots:x.dotsList},()=>[c(`div`,{ref:`carousel-container`,"data-name":`wr-agnostic-carousel-scroller`,class:n([`hide-scrollbar relative flex w-full snap-x snap-mandatory items-start overflow-x-auto overflow-y-hidden`,[m.scrollerClass,{[m.customGap]:m.customGap,"gap-4":m.useGap,"pl-4 lg:pl-0":m.usePadding&&!m.useGap,group:m.innerGroupHover}]])},[e(f.$slots,`default`,{action:x.selection,dots:x.dotsList,scrollTo:x.scrollTo})],2)])],512),e(f.$slots,`marketing-label`),l(d,{name:`fade`,mode:`out-in`},{default:i(()=>[m.arrows&&x.buttonPrevIsEnable?e(f.$slots,`arrow-left`,{prev:x.scrollPrev,next:x.scrollNext,scrollToSlide:x.scrollTo,scrollValue:b.scrollValue},()=>[c(`div`,{role:`button`,"aria-label":f.$i18n.t(`accessibility.PREV`),class:`absolute left-4 top-1/2 z-10 hidden -translate-y-1/2 cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-100 md:flex`,onClick:p[
10]||=u((...e)=>x.scrollPrev&&x.scrollPrev(...e),[`stop`])},[...p[2]||=[c(`div`,{class:`ml-auto flex size-9 shrink-0 items-center justify-center rounded-full border border-gray-400 bg-white shadow-md`},[c(`span`,{class:`text-white`},[c(`svg`,{class:`size-8`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`},[c(`path`,{class:`currentColor`,d:`M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z`})])])],-1)]],8,_)],void 0,0):r(``,!0)]),_:3}),l(d,{name:`fade`,mode:`out-in`},{default:i(()=>[m.arrows&&x.buttonNextIsEnable?e(f.$slots,`arrow-right`,{prev:x.scrollPrev,next:x.scrollNext,scrollToSlide:x.scrollTo,scrollValue:b.scrollValue},()=>[c(`div`,{role:`button`,"aria-label":f.$i18n.t(`accessibility.NEXT`),class:`absolute right-4 top-1/2 z-10 hidden -translate-y-1/2 cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-100 md:flex`,onClick:p[1]||=u((...e)=>x.scrollNext&&x.scrollNext(...e),[`stop`])},[...p[3]||=[c(`div`,{class:`ml-auto flex size-9 shrink-0 items-center justify-center rounded-full border border-gray-400 bg-white shadow-md`},[c(`span`,{class:`text-white`},[c(`svg`,{class:`size-8`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`},[c(`path`,{class:`currentColor`,d:`M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z`})])])],-1)]],8,v)],void 0,0):r(``,!0)]),_:3}),e(f.$slots,`footer`,{dots:x.dotsList,scrollTo:x.scrollTo,prev:x.scrollPrev,next:x.scrollNext,prevEnable:x.buttonPrevIsEnable,nextEnable:x.buttonNextIsEnable,scrollValue:b.scrollValue,currentIndex:x.currentIndex,numberOfSlides:x.numberOfSlides},()=>[x.showDots?e(f.$slots,`dots`,{dots:x.dotsList,scrollTo:x.scrollTo,prev:x.scrollPrev,next:x.scrollNext,prevEnable:x.buttonPrevIsEnable,nextEnable:x.buttonNextIsEnable,scrollValue:b.scrollValue,currentIndex:x.currentIndex,numberOfSlides:x.numberOfSlides},()=>[c(`div`,{class:n([`relative left-1/2 z-10 flex h-3 -translate-x-1/2 items-center justify-center gap-2.5 overflow-hidden`,{"-mt-8 -translate-y-full":m.dotsInside,"my-4":!m.dotsInside}])},[(t(!0),a(s,null,o(x.dotsList,(e,r)=>(t(),a(`span`,{key:r,role:`button`,"aria-label":f.$i18n.t(`accessibility.DOTS`,{index:r+1}),class:n([`size-2.5 shrink-0 cursor-pointer rounded-full transition-all duration-300`,{"scale-100 bg-primary":e.current,"scale-75 bg-gray-400":!e.current}]),onClick:t=>x.scrollTo(e.value)},null,10,y))),128))],2)],void 0,0):r(``,!0)])],2)}var x=p(h,[[`render`,b]]);export{x as t};

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.