PageSourceSearch

https://devsloom.ca/build/assets/ScrollArea-zzl6abZe.js

js devsloom.ca collected 2026-10-05 06:57:37 UTC 14,080 bytes, 1 lines download raw bytes

1import{r as c,b0 as ie,j as m,a4 as F,ao as W,a6 as H,a3 as G,a5 as ue,a7 as de,al as fe}from"./app-B2VYTbHN.js";import{c as J}from"./create-safe-context-Bs2ORtLf.js";import{u as he}from"./use-floating-auto-update-DVu5Qdjt.js";import{t as M}from"./to-int-PQE0s6ay.js";function j(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...o)=>{var s;return(s=t.current)==null?void 0:s.call(t,...o)},[])}const be=()=>{};function X(e,t){const o=typeof t=="number"?t:t.delay,s=typeof t=="number"?!1:t.flushOnUnmount,n=j(e),l=c.useRef(0),r=Object.assign(c.useCallback((...a)=>{window.clearTimeout(l.current);const d=()=>{l.current!==0&&(l.current=0,n(...a))};r.flush=d,l.current=window.setTimeout(d,o)},[n,o]),{flush:be});return c.useEffect(()=>()=>{window.clearTimeout(l.current),s&&r.flush()},[r,s]),r}const[me,x]=J("ScrollArea.Root component was not found in tree");function L(e,t){const o=j(t);ie(()=>{let s=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(s),s=window.requestAnimationFrame(o)});return n.observe(e),()=>{window.cancelAnimationFrame(s),n.unobserve(e)}}},[e,o])}const Se=c.forwardRef((e,t)=>{const{style:o,...s}=e,n=x(),[l,r]=c.useState(0),[a,d]=c.useState(0),u=!!(l&&a);return L(n.scrollbarX,()=>{var h;const i=((h=n.scrollbarX)==null?void 0:h.offsetHeight)||0;n.onCornerHeightChange(i),d(i)}),L(n.scrollbarY,()=>{var h;const i=((h=n.scrollbarY)==null?void 0:h.offsetWidth)||0;n.onCornerWidthChange(i),r(i)}),u?m.jsx("div",{...s,ref:t,style:{...o,width:l,height:a}}):null}),pe=c.forwardRef((e,t)=>{const o=x(),s=!!(o.scrollbarX&&o.scrollbarY);return o.type!=="scroll"&&s?m.jsx(Se,{...e,ref:t}):null}),we={scrollHideDelay:1e3,type:"hover"},K=c.forwardRef((e,t)=>{const o=F("ScrollAreaRoot",we,e),{type:s,scrollHideDelay:n,scrollbars:l,...r}=o,[a,d]=c.useState(null),[u,i]=c.useState(null),[h,b]=c.useState(null),[f,p]=c.useState(null),[E,g]=c.useState(null),[w,C]=c.useState(0),[P,R]=c.useState(0),[D,T]=c.useState(!1),[y,S]=c.useState(!1),v=W(t,A=>d(A));return m.jsx(me,{value:{type:s,scrollHideDelay:n,scrollArea:a,viewport:u,onViewportChange:i,content:h,onContentChange:b,scrollbarX:f,onScrollbarXChange:p,scrollbarXEnabled:D,onScrollbarXEnabledChange:T,scrollbarY:E,onScrollbarYChange:g,scrollbarYEnabled:y,onScrollbarYEnabledChange:S,onCornerWidthChange:C,onCornerHeightChange:R},children:m.jsx(H,{...r,ref:v,__vars:{"--sa-corner-width":l!=="xy"?"0px":`${w}px`,"--sa-corner-height":l!=="xy"?"0px":`${P}px`}})})});K.displayName="@mantine/core/ScrollAreaRoot";function Q(e,t){const o=e/t;return Number.isNaN(o)?0:o}function Y(e){const t=Q(e.viewport,e.content),o=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,s=(e.scrollbar.size-o)*t;return Math.max(s,18)}function Z(e,t){return o=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const s=(t[1]-t[0])/(e[1]-e[0]);return t[0]+s*(o-e[0])}}function ve(e,[t,o]){return Math.min(o,Math.max(t,e))}function q(e,t,o="ltr"){const s=Y(t),n=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-n,r=t.content-t.viewport,a=l-s,d=o==="ltr"?[0,r]:[r*-1,0],u=ve(e,d);return Z([0,r],[0,a])(u)}function ge(e,t,o,s="ltr"){const n=Y(o),l=n/2,r=t||l,a=n-r,d=o.scrollbar.paddingStart+r,u=o.scrollbar.size-o.scrollbar.paddingEnd-a,i=o.content-o.viewport,h=s==="ltr"?[0,i]:[i*-1,0];return Z([d,u],h)(e)}function ee(e,t){return e>0&&e<t}function z(e,t,{checkForDefaultPrevented:o=!0}={}){return s=>{e==null||e(s),(o===!1||!s.defaultPrevented)&&(t==null||t(s))}}const[ye,te]=J("ScrollAreaScrollbar was not found in tree"),oe=c.forwardRef((e,t)=>{const{sizes:o,hasThumb:s,onThumbChange:n,onThumbPointerUp:l,onThumbPointerDown:r,onThumbPositionChange:a,onDragScroll:d,onWheelScroll:u,onResize:i,...h}=e,b=x(),[f,p]=c.useState(null),E=W(t,S=>p(S)),g=c.useRef(null),w=c.useRef(""),{viewport:C}=b,P=o.content-o.viewport,R=j(u),D=j(a),T=X(i,10),y=S=>{if(g.current){const v=S.clientX-g.current.left,A=S.clientY-g.current.top;d({x:v,y:A})}};return c.useEffect(()=>{const S=v=>{const A=v.target;(f==null?void 0:f.contains(A))&&R(v,P)};return document.addEventListener("wheel",S,{passive:!1}),()=>document.removeEventListener("wheel",S,{passive:!1})},[C,f,P,R]),c.useEffect(D,[o,D]),L(f,T),L(b.content,T),m.jsx(ye,{value:{scrollbar:f,hasThumb:s,onThumbChange:j(n),onThumbPointerUp:j(l),onThumbPositionChange:D,onThumbPointerDown:j(r)},children:m.jsx("div",{...h,ref:E,"data-mantine-scrollbar":!0,style:{position:"absolute",...h.style},onPointerDown:z(e.onPointerDown,S=>{S.preventDefault(),S.button===0&&(S.target.setPointerCapture(S.pointerId),g.current=f.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y(S))}),onPointerMove:z(e.onPointerMove,y),onPointerUp:z(e.onPointerUp,S=>{S.preventDefault();const v=S.target;v.hasPointerCapture(S.pointerId)&&v.releasePointerCapture(S.pointerId),document.body.style.webkitUserSelect=w.current,g.current=null})})})}),re=c.forwardRef((e,t)=>
1{const{sizes:o,onSizesChange:s,style:n,...l}=e,r=x(),[a,d]=c.useState(),u=c.useRef(null),i=W(t,u,r.onScrollbarXChange);return c.useEffect(()=>{u.current&&d(getComputedStyle(u.current))},[u]),m.jsx(oe,{"data-orientation":"horizontal",...l,ref:i,sizes:o,style:{...n,"--sa-thumb-width":`${Y(o)}px`},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,b)=>{if(r.viewport){const f=r.viewport.scrollLeft+h.deltaX;e.onWheelScroll(f),ee(f,b)&&h.preventDefault()}},onResize:()=>{u.current&&r.viewport&&a&&s({content:r.viewport.scrollWidth,viewport:r.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:M(a.paddingLeft),paddingEnd:M(a.paddingRight)}})}})});re.displayName="@mantine/core/ScrollAreaScrollbarX";const ne=c.forwardRef((e,t)=>{const{sizes:o,onSizesChange:s,style:n,...l}=e,r=x(),[a,d]=c.useState(),u=c.useRef(null),i=W(t,u,r.onScrollbarYChange);return c.useEffect(()=>{u.current&&d(window.getComputedStyle(u.current))},[]),m.jsx(oe,{...l,"data-orientation":"vertical",ref:i,sizes:o,style:{"--sa-thumb-height":`${Y(o)}px`,...n},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,b)=>{if(r.viewport){const f=r.viewport.scrollTop+h.deltaY;e.onWheelScroll(f),ee(f,b)&&h.preventDefault()}},onResize:()=>{u.current&&r.viewport&&a&&s({content:r.viewport.scrollHeight,viewport:r.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:M(a.paddingTop),paddingEnd:M(a.paddingBottom)}})}})});ne.displayName="@mantine/core/ScrollAreaScrollbarY";const N=c.forwardRef((e,t)=>{const{orientation:o="vertical",...s}=e,{dir:n}=he(),l=x(),r=c.useRef(null),a=c.useRef(0),[d,u]=c.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),i=Q(d.viewport,d.content),h={...s,sizes:d,onSizesChange:u,hasThumb:i>0&&i<1,onThumbChange:f=>{r.current=f},onThumbPointerUp:()=>{a.current=0},onThumbPointerDown:f=>{a.current=f}},b=(f,p)=>ge(f,a.current,d,p);return o==="horizontal"?m.jsx(re,{...h,ref:t,onThumbPositionChange:()=>{if(l.viewport&&r.current){const f=l.viewport.scrollLeft,p=q(f,d,n);r.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{l.viewport&&(l.viewport.scrollLeft=f)},onDragScroll:f=>{l.viewport&&(l.viewport.scrollLeft=b(f,n))}}):o==="vertical"?m.jsx(ne,{...h,ref:t,onThumbPositionChange:()=>{if(l.viewport&&r.current){const f=l.viewport.scrollTop,p=q(f,d);d.scrollbar.size===0?r.current.style.setProperty("--thumb-opacity","0"):r.current.style.setProperty("--thumb-opacity","1"),r.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{l.viewport&&(l.viewport.scrollTop=f)},onDragScroll:f=>{l.viewport&&(l.viewport.scrollTop=b(f))}}):null});N.displayName="@mantine/core/ScrollAreaScrollbarVisible";const k=c.forwardRef((e,t)=>{const o=x(),{forceMount:s,...n}=e,[l,r]=c.useState(!1),a=e.orientation==="horizontal",d=X(()=>{if(o.viewport){const u=o.viewport.offsetWidth<o.viewport.scrollWidth,i=o.viewport.offsetHeight<o.viewport.scrollHeight;r(a?u:i)}},10);return L(o.viewport,d),L(o.content,d),s||l?m.jsx(N,{"data-state":l?"visible":"hidden",...n,ref:t}):null});k.displayName="@mantine/core/ScrollAreaScrollbarAuto";const le=c.forwardRef((e,t)=>{const{forceMount:o,...s}=e,n=x(),[l,r]=c.useState(!1);return c.useEffect(()=>{const{scrollArea:a}=n;let d=0;if(a){const u=()=>{window.clearTimeout(d),r(!0)},i=()=>{d=window.setTimeout(()=>r(!1),n.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",i),()=>{window.clearTimeout(d),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",i)}}},[n.scrollArea,n.scrollHideDelay]),o||l?m.jsx(k,{"data-state":l?"visible":"hidden",...s,ref:t}):null});le.displayName="@mantine/core/ScrollAreaScrollbarHover";const xe=c.forwardRef((e,t)=>{const{forceMount:o,...s}=e,n=x(),l=e.orientation==="horizontal",[r,a]=c.useState("hidden"),d=X(()=>a("idle"),100);return c.useEffect(()=>{if(r==="idle"){const u=window.setTimeout(()=>a("hidden"),n.scrollHideDelay);return()=>window.clearTimeout(u)}},[r,n.scrollHideDelay]),c.useEffect(()=>{const{viewport:u}=n,i=l?"scrollLeft":"scrollTop";if(u){let h=u[i];const b=()=>{const f=u[i];h!==f&&(a("scrolling"),d()),h=f};return u.addEventListener("scroll",b),()=>u.removeEventListener("scroll",b)}},[n.viewport,l,d]),o||r!=="hidden"?m.jsx(N,{"data-state":r==="hidden"?"hidden":"visible",...s,ref:t,onPointerEnter:z(e.onPointerEnter,()=>a("interacting")),onPointerLeave:z(e.onPointerLeave,()=>a("idle"))}):null}),V=c.forwardRef((e,t)=>
1{const{forceMount:o,...s}=e,n=x(),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:r}=n,a=e.orientation==="horizontal";return c.useEffect(()=>(a?l(!0):r(!0),()=>{a?l(!1):r(!1)}),[a,l,r]),n.type==="hover"?m.jsx(le,{...s,ref:t,forceMount:o}):n.type==="scroll"?m.jsx(xe,{...s,ref:t,forceMount:o}):n.type==="auto"?m.jsx(k,{...s,ref:t,forceMount:o}):n.type==="always"?m.jsx(N,{...s,ref:t}):null});V.displayName="@mantine/core/ScrollAreaScrollbar";function Pe(e,t=()=>{}){let o={left:e.scrollLeft,top:e.scrollTop},s=0;return function n(){const l={left:e.scrollLeft,top:e.scrollTop},r=o.left!==l.left,a=o.top!==l.top;(r||a)&&t(),o=l,s=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(s)}const se=c.forwardRef((e,t)=>{const{style:o,...s}=e,n=x(),l=te(),{onThumbPositionChange:r}=l,a=W(t,i=>l.onThumbChange(i)),d=c.useRef(void 0),u=X(()=>{d.current&&(d.current(),d.current=void 0)},100);return c.useEffect(()=>{const{viewport:i}=n;if(i){const h=()=>{if(u(),!d.current){const b=Pe(i,r);d.current=b,r()}};return r(),i.addEventListener("scroll",h),()=>i.removeEventListener("scroll",h)}},[n.viewport,u,r]),m.jsx("div",{"data-state":l.hasThumb?"visible":"hidden",...s,ref:a,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...o},onPointerDownCapture:z(e.onPointerDownCapture,i=>{const b=i.target.getBoundingClientRect(),f=i.clientX-b.left,p=i.clientY-b.top;l.onThumbPointerDown({x:f,y:p})}),onPointerUp:z(e.onPointerUp,l.onThumbPointerUp)})});se.displayName="@mantine/core/ScrollAreaThumb";const O=c.forwardRef((e,t)=>{const{forceMount:o,...s}=e,n=te();return o||n.hasThumb?m.jsx(se,{ref:t,...s}):null});O.displayName="@mantine/core/ScrollAreaThumb";const ce=c.forwardRef(({children:e,style:t,...o},s)=>{const n=x(),l=W(s,n.onViewportChange);return m.jsx(H,{...o,ref:l,style:{overflowX:n.scrollbarXEnabled?"scroll":"hidden",overflowY:n.scrollbarYEnabled?"scroll":"hidden",...t},children:m.jsx("div",{style:{minWidth:"100%",display:"table"},ref:n.onContentChange,children:e})})});ce.displayName="@mantine/core/ScrollAreaViewport";var B={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const ae={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},Ce=de((e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":fe(t)}})),U=G((e,t)=>{const o=F("ScrollArea",ae,e),{classNames:s,className:n,style:l,styles:r,unstyled:a,scrollbarSize:d,vars:u,type:i,scrollHideDelay:h,viewportProps:b,viewportRef:f,onScrollPositionChange:p,children:E,offsetScrollbars:g,scrollbars:w,onBottomReached:C,onTopReached:P,...R}=o,[D,T]=c.useState(!1),y=ue({name:"ScrollArea",props:o,classes:B,className:n,style:l,classNames:s,styles:r,unstyled:a,vars:u,varsResolver:Ce});return m.jsxs(K,{type:i==="never"?"always":i,scrollHideDelay:h,ref:t,scrollbars:w,...y("root"),...R,children:[m.jsx(ce,{...b,...y("viewport",{style:b==null?void 0:b.style}),ref:f,"data-offset-scrollbars":g===!0?"xy":g||void 0,"data-scrollbars":w||void 0,onScroll:S=>{var $;($=b==null?void 0:b.onScroll)==null||$.call(b,S),p==null||p({x:S.currentTarget.scrollLeft,y:S.currentTarget.scrollTop});const{scrollTop:v,scrollHeight:A,clientHeight:I}=S.currentTarget;v-(A-I)>=0&&(C==null||C()),v===0&&(P==null||P())},children:E}),(w==="xy"||w==="x")&&m.jsx(V,{...y("scrollbar"),orientation:"horizontal","data-hidden":i==="never"||void 0,forceMount:!0,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:m.jsx(O,{...y("thumb")})}),(w==="xy"||w==="y")&&m.jsx(V,{...y("scrollbar"),orientation:"vertical","data-hidden":i==="never"||void 0,forceMount:!0,onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:m.jsx(O,{...y("thumb")})}),m.jsx(pe,{...y("corner"),"data-hovered":D||void 0,"data-hidden":i==="never"||void 0})]})});U.displayName="@mantine/core/ScrollArea";const _=G((e,t)=>{const{children:o,classNames:s,styles:n,scrollbarSize:l,scrollHideDelay:r,type:a,dir:d,offsetScrollbars:u,viewportRef:i,onScrollPositionChange:h,unstyled:b,variant:f,viewportProps:p,scrollbars:E,style:g,vars:w,onBottomReached:C,onTopReached:P,...R}=F("ScrollAreaAutosize",ae,e);return m.jsx(H,{...R,ref:t,style:[{display:"flex",overflow:"auto"}
1,g],children:m.jsx(H,{style:{display:"flex",flexDirection:"column",flex:1},children:m.jsx(U,{classNames:s,styles:n,scrollHideDelay:r,scrollbarSize:l,type:a,dir:d,offsetScrollbars:u,viewportRef:i,onScrollPositionChange:h,unstyled:b,variant:f,viewportProps:p,vars:w,scrollbars:E,onBottomReached:C,onTopReached:P,children:o})})})});U.classes=B;_.displayName="@mantine/core/ScrollAreaAutosize";_.classes=B;U.Autosize=_;export{U as S};

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.