PageSourceSearch

https://www.jetbrains.com/_assets/rr/use-snap-carousel-2LZxKA8z.js

js jetbrains.com collected 2026-09-24 07:34:07 UTC 3,845 bytes, 4 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8bc08f0d-5e0c-5c4f-8a24-1b59ae0e3b13")}catch(e){}}();
3(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`master@90da63a`}}catch{}})();import{a as e}from"./rolldown-runtime-DYYcS1FN.js";import{t}from"./react-CAeKiPy9.js";var n=e(t(),1),r=typeof document<`u`?n.useLayoutEffect:n.useEffect,i=({axis:e=`x`,initialPages:t=[]}={})=>{let i=e===`x`?`width`:`height`,o=e===`x`?`scrollWidth`:`scrollHeight`,s=e===`x`?`clientWidth`:`clientHeight`,c=e===`x`?`left`:`top`,d=e===`x`?`right`:`bottom`,f=e===`x`?`scrollLeft`:`scrollTop`,[p,m]=(0,n.useState)(null),[{pages:h,activePageIndex:g},_]=(0,n.useState)({pages:t,activePageIndex:0}),v=(0,n.useCallback)(e=>{if(!p)return;if(Math.floor(p[o]-p[f])<=p[s]){_({pages:e,activePageIndex:e.length-1});return}let t=Array.from(p.children),n=p.getBoundingClientRect(),r=e.map(e=>{let r=e[0],i=t[r];u(i instanceof HTMLElement,`Expected HTMLElement`);let a=l(p,i,c),o=i.getBoundingClientRect()[c]-n[c]-a;return Math.abs(o)}),i=Math.min(...r),a=r.indexOf(i);_({pages:e,activePageIndex:a})},[p,s,c,o,f]),y=(0,n.useCallback)(()=>{if(!p)return;let e=Array.from(p.children),t=p.getBoundingClientRect(),n,r=e.reduce((e,r,o)=>{u(r instanceof HTMLElement,`Expected HTMLElement`);let s=e[e.length-1],f=a(r,r.parentElement);if(!s||r.dataset.shouldSnap===`true`||f[d]-n>Math.ceil(t[i])){e.push([o]);let t=l(p,r,c);n=f[c]-t}else s.push(o);return e},[]);v(r)},[v,p,i,d,c]);r(()=>{y()},[y]),(0,n.useEffect)(()=>{let e=()=>{y()};return window.addEventListener(`resize`,e),window.addEventListener(`orientationchange`,e),()=>{window.removeEventListener(`resize`,e),window.removeEventListener(`orientationchange`,e)}},[y]),(0,n.useEffect)(()=>{if(!p)return;let e=()=>{v(h)};return p.addEventListener(`scroll`,e),()=>{p.removeEventListener(`scroll`,e)}},[v,h,p]);let b=(e,t)=>{if(!p)return;let n=h[e];if(!n)return;let r=Array.from(p.children)[n[0]];if(!(r instanceof HTMLElement))return;let i=l(p,r,c),o=t?.behavior||`smooth`;p.scrollTo({behavior:o,[c]:a(r,r.parentElement)[c]-i})},x=e=>{b(g-1,e)},S=e=>{b(g+1,e)},C=(0,n.useMemo)(()=>new Set(h.map(e=>e[0])),[h]);return{hasPrevPage:g>0,hasNextPage:g<h.length-1,prev:x,next:S,goTo:b,refresh:y,pages:h,activePageIndex:g,snapPointIndexes:C,scrollRef:m}},a=(e,t)=>{let n=o(e);if(!t)return n;let r=o(t);return{left:n.left-r.left,top:n.top-r.top,right:n.right-r.left,bottom:n.bottom-r.top,width:n.width,height:n.height}},o=e=>{let t=e.getBoundingClientRect(),n=0,r=0,i=e.parentElement;for(;i;)n+=i.scrollLeft,r+=i.scrollTop,i=i.parentElement;let a=t.left+n,o=t.top+r;return{left:a,top:o,right:a+t.width,bottom:o+t.height,width:t.width,height:t.height}},s=(e,t)=>{let n=window.getComputedStyle(e).getPropertyValue(`scroll-padding-${t}`)||`0px`;if(n===`auto`)return 0;let r=`Unsupported scroll padding value, expected <length> or <percentage> value, received ${n}`;if(n.endsWith(`px`)){let e=parseInt(n);return u(!Number.isNaN(e),r),e}if(n.endsWith(`%`)){let t=parseInt(n);return u(!Number.isNaN(t),r),e.clientWidth/100*t}throw new d(r)},c=(e,t)=>{let n=window.getComputedStyle(e).getPropertyValue(`scroll-margin-${t}`)||`0px`,r=`Unsupported scroll margin value, expected <length> value, received ${n}`;u(n.endsWith(`px`),r);let i=parseInt(n);return u(!Number.isNaN(i),r),i},l=(e,t,n)=>{let r=s(e,n),i=c(t,n),o=a(t,t.parentElement);return Math.min(r+i,o[n])};function u(e,t){if(!e)throw new d(t)}var d=class extends Error{constructor(e){super(`[react-snap-carousel]: ${e}`)}};export{i as t};
4//# debugId=8bc08f0d-5e0c-5c4f-8a24-1b59ae0e3b13

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.