PageSourceSearch

https://www.laval.ch/_assets/dd2ce5bfd9e5111f7a787dd76b0f8b88/Java…/vendor--animated-scroll-to.js?1773312418

js laval.ch collected 2026-09-26 05:27:00 UTC 4,978 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([["vendor--animated-scroll-to"],{5275:(e,t,o)=>{o.d(t,{A:()=>a});function n(e){let t=0,o=0,n=e;do{t+=n.offsetTop||0,o+=n.offsetLeft||0,n=n.offsetParent}while(n);return{top:t,left:o}}class l{constructor(e){this.element=e}getHorizontalScroll(){return this.element.scrollLeft}getVerticalScroll(){return this.element.scrollTop}getMaxHorizontalScroll(){return this.element.scrollWidth-this.element.clientWidth}getMaxVerticalScroll(){return this.element.scrollHeight-this.element.clientHeight}getHorizontalElementScrollOffset(e,t){return n(e).left-n(t).left}getVerticalElementScrollOffset(e,t){return n(e).top-n(t).top}scrollTo(e,t){this.element.scrollLeft=e,this.element.scrollTop=t}}class r{constructor(){this.element=window}getHorizontalScroll(){return window.scrollX||document.documentElement.scrollLeft}getVerticalScroll(){return window.scrollY||document.documentElement.scrollTop}getMaxHorizontalScroll(){return Math.max(document.body.scrollWidth,document.documentElement.scrollWidth,document.body.offsetWidth,document.documentElement.offsetWidth,document.body.clientWidth,document.documentElement.clientWidth)-window.innerWidth}getMaxVerticalScroll(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)-window.innerHeight}getHorizontalElementScrollOffset(e){return(window.scrollX||document.documentElement.scrollLeft)+e.getBoundingClientRect().left}getVerticalElementScrollOffset(e){return(window.scrollY||document.documentElement.scrollTop)+e.getBoundingClientRect().top}scrollTo(e,t){window.scrollTo(e,t)}}const c={elements:[],cancelMethods:[],add:(e,t)=>{c.elements.push(e),c.cancelMethods.push(t)},remove:(e,t)=>{const o=c.elements.indexOf(e);o>-1&&(t&&c.cancelMethods[o](),c.elements.splice(o,1),c.cancelMethods.splice(o,1))}},i="undefined"!=typeof window,s={cancelOnUserAction:!0,easing:e=>--e*e*e+1,elementToScroll:i?window:null,horizontalOffset:0,maxDuration:3e3,minDuration:250,speed:500,verticalOffset:0},a=function(e){return t=this,o=arguments,a=function*(e,t={}){if(!i)return new Promise(e=>{e(!1)});if(!window.Promise)throw"Browser doesn't support Promises, and animated-scroll-to depends on it, please provide a polyfill.";let o,n,a,m=Object.assign(Object.assign({},s),t);const d=m.elementToScroll===window,u=!!m.elementToScroll.nodeName;if(!d&&!u)throw"Element to scroll needs to be either window or DOM element.";const f=d?document.documentElement:m.elementToScroll,h=getComputedStyle(f);[{property:"scroll-behavior",value:"smooth"},{property:"scroll-snap-type",value:"mandatory"}].forEach(({property:e,value:t})=>{const o=h.getPropertyValue(e);o.includes(t)&&console.warn(`${f.tagName} has "${e}: ${o}" which can break animated-scroll-to's animations`)});const w=d?new r:new l(m.elementToScroll);if(e instanceof Element){if(a=e,u&&(!m.elementToScroll.contains(a)||m.elementToScroll.isSameNode(a)))throw"options.elementToScroll has to be a parent of scrollToElement";o=w.getHorizontalElementScrollOffset(a,m.elementToScroll),n=w.getVerticalElementScrollOffset(a,m.elementToScroll)}else if("number"==typeof e)o=w.getHorizontalScroll(),n=e;else{if(!Array.isArray(e)||2!==e.length)throw"Wrong function signature. Check documentation.\nAvailable method signatures are:\n  animateScrollTo(y:number, options)\n  animateScrollTo([x:number | null, y:number | null], options)\n  animateScrollTo(scrollToElement:Element, options)";o=null===e[0]?w.getHorizontalScroll():e[0],n=null===e[1]?w.getVerticalScroll():e[1]}o+=m.horizontalOffset,n+=m.verticalOffset;const p=w.getMaxHorizontalScroll(),g=w.getHorizontalScroll();o>p&&(o=p);const S=o-g,E=w.getMaxVerticalScroll(),T=w.getVerticalScroll();n>E&&(n=E);const v=n-T,y=Math.abs(Math.round(S/1e3*m.speed)),b=Math.abs(Math.round(v/1e3*m.speed));let H=y>b?y:b;return H<m.minDuration?H=m.minDuration:H>m.maxDuration&&(H=m.maxDuration),new Promise((e,t)=>{let l;0===S&&0===v&&e(!0),c.remove(w.element,!0);const r=()=>{d(),cancelAnimationFrame(l),e(!1)};c.add(w.element,r);const i=m.cancelOnUserAction?r:e=>e.preventDefault(),s=m.cancelOnUserAction?{passive:!0}:{passive:!1},a=["wheel","touchstart","keydown","mousedown"],d=()=>
1{a.forEach(e=>{w.element.removeEventListener(e,i,s)})};a.forEach(e=>{w.element.addEventListener(e,i,s)});const u=Date.now(),f=()=>{var t=Date.now()-u,r=t/H;const i=Math.round(g+S*m.easing(r)),s=Math.round(T+v*m.easing(r));t<H&&(i!==o||s!==n)?(w.scrollTo(i,s),l=requestAnimationFrame(f)):(w.scrollTo(o,n),cancelAnimationFrame(l),d(),c.remove(w.element,!1),e(!0))};l=requestAnimationFrame(f)})},new((n=void 0)||(n=Promise))(function(e,l){function r(e){try{i(a.next(e))}catch(e){l(e)}}function c(e){try{i(a.throw(e))}catch(e){l(e)}}function i(t){var o;t.done?e(t.value):(o=t.value,o instanceof n?o:new n(function(e){e(o)})).then(r,c)}i((a=a.apply(t,o||[])).next())});var t,o,n,a}}}]);

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.