Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@radix-ui/react-scroll-area

Package Overview
Dependencies
Maintainers
5
Versions
214
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-scroll-area - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

78

dist/index.d.ts

@@ -0,4 +1,7 @@

import { Primitive } from "@radix-ui/react-primitive";
import * as React from "react";
import * as Polymorphic from "@radix-ui/react-polymorphic";
import { Merge } from "@radix-ui/utils";
export const SCROLL_AREA_CSS_PROPS: Record<"positionWidth" | "positionHeight" | "scrollbarXOffset" | "scrollbarYOffset" | "scrollbarXSize" | "scrollbarYSize" | "scrollbarThumbWillChange" | "scrollbarThumbHeight" | "scrollbarThumbWidth" | "cornerLeft" | "cornerRight" | "cornerWidth" | "cornerHeight", string>;
type ScrollAreaOwnProps = {
type ScrollAreaOwnProps = Merge<Polymorphic.OwnProps<typeof Primitive>, {
children: React.ReactNode;

@@ -51,23 +54,54 @@ /**

dir?: TextDirection;
};
export const ScrollArea: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", ScrollAreaOwnProps>;
export const ScrollAreaViewport: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ScrollAreaScrollbarX: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ScrollAreaScrollbarY: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ScrollAreaTrack: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ScrollAreaThumb: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ScrollAreaButtonStart: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ScrollAreaButtonEnd: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
type ScrollAreaCornerProps = {};
export const ScrollAreaCorner: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", ScrollAreaCornerProps>;
export const Root: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", ScrollAreaOwnProps>;
export const Viewport: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ScrollbarX: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ScrollbarY: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ButtonStart: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const ButtonEnd: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const Track: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const Thumb: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", {}>;
export const Corner: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", ScrollAreaCornerProps>;
export const unstable_ScrollAreaNoNativeFallback: import("@radix-ui/react-polymorphic").ForwardRefExoticComponentWithAs<"div", Pick<ScrollAreaOwnProps, "children" | "dir" | "overflowX" | "overflowY" | "scrollbarVisibility" | "scrollbarVisibilityRestTimeout" | "trackClickBehavior" | "unstable_prefersReducedMotion">>;
}>;
type ScrollAreaPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaOwnProps>;
export const ScrollArea: ScrollAreaPrimitive;
type ScrollAreaNoNativeFallbackOwnProps = Merge<Polymorphic.OwnProps<typeof Primitive>, Omit<ScrollAreaOwnProps, 'unstable_forceNative'>>;
type ScrollAreaNoNativeFallbackPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaNoNativeFallbackOwnProps>;
type ScrollAreaViewportImplOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type ScrollAreaViewportImplPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaViewportImplOwnProps>;
declare const ScrollAreaViewportImpl: ScrollAreaViewportImplPrimitive;
type ScrollAreaViewportOwnProps = Polymorphic.OwnProps<typeof ScrollAreaViewportImpl>;
type ScrollAreaViewportPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof ScrollAreaViewportImpl>, ScrollAreaViewportOwnProps>;
export const ScrollAreaViewport: ScrollAreaViewportPrimitive;
type ScrollAreaScrollbarXOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type ScrollAreaScrollbarXPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaScrollbarXOwnProps>;
export const ScrollAreaScrollbarX: ScrollAreaScrollbarXPrimitive;
type ScrollAreaScrollbarYOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type ScrollAreaScrollbarYPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaScrollbarYOwnProps>;
export const ScrollAreaScrollbarY: ScrollAreaScrollbarYPrimitive;
type ScrollAreaTrackOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type ScrollAreaTrackPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaTrackOwnProps>;
export const ScrollAreaTrack: ScrollAreaTrackPrimitive;
type ScrollAreaThumbOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type ScrollAreaThumbPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaThumbOwnProps>;
export const ScrollAreaThumb: ScrollAreaThumbPrimitive;
type ScrollAreaButtonProps = Merge<Polymorphic.OwnProps<typeof Primitive>, {
direction: LogicalDirection;
name: string;
}>;
type ScrollAreaButtonPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaButtonProps>;
declare const ScrollAreaButton: ScrollAreaButtonPrimitive;
type ScrollAreaButtonStartOwnProps = Omit<Polymorphic.OwnProps<typeof ScrollAreaButton>, 'direction' | 'name'>;
type ScrollAreaButtonStartPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof ScrollAreaButton>, ScrollAreaButtonStartOwnProps>;
export const ScrollAreaButtonStart: ScrollAreaButtonStartPrimitive;
type ScrollAreaButtonEndOwnProps = Omit<Polymorphic.OwnProps<typeof ScrollAreaButton>, 'direction' | 'name'>;
type ScrollAreaButtonEndPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof ScrollAreaButton>, ScrollAreaButtonEndOwnProps>;
export const ScrollAreaButtonEnd: ScrollAreaButtonEndPrimitive;
type ScrollAreaCornerImplOwnProps = Polymorphic.OwnProps<typeof Primitive>;
type ScrollAreaCornerImplPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof Primitive>, ScrollAreaCornerImplOwnProps>;
declare const ScrollAreaCornerImpl: ScrollAreaCornerImplPrimitive;
type ScrollAreaCornerOwnProps = Polymorphic.OwnProps<typeof ScrollAreaCornerImpl>;
type ScrollAreaCornerPrimitive = Polymorphic.ForwardRefComponent<Polymorphic.IntrinsicElement<typeof ScrollAreaCornerImpl>, ScrollAreaCornerOwnProps>;
export const ScrollAreaCorner: ScrollAreaCornerPrimitive;
export const Root: ScrollAreaPrimitive;
export const Viewport: ScrollAreaViewportPrimitive;
export const ScrollbarX: ScrollAreaScrollbarXPrimitive;
export const ScrollbarY: ScrollAreaScrollbarYPrimitive;
export const ButtonStart: ScrollAreaButtonStartPrimitive;
export const ButtonEnd: ScrollAreaButtonEndPrimitive;
export const Track: ScrollAreaTrackPrimitive;
export const Thumb: ScrollAreaThumbPrimitive;
export const Corner: ScrollAreaCornerPrimitive;
export const unstable_ScrollAreaNoNativeFallback: ScrollAreaNoNativeFallbackPrimitive;
type LogicalDirection = 'start' | 'end';
type OverflowBehavior = 'auto' | 'hidden' | 'scroll' | 'visible';

@@ -74,0 +108,0 @@ type ScrollbarVisibility = 'always' | 'scroll' | 'hover';

@@ -1,2 +0,2 @@

var e,t,r=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e),n=require("@radix-ui/utils"),o=n.canUseDOM,i=n.clamp,a=n.getSelector,l=n.getSelectorObj,c=n.getResizeObserverEntryBorderBoxSize,s=n.isMainClick,u=n.namespaced,f=require("@radix-ui/react-primitive").Primitive,d=require("@radix-ui/react-utils"),p=d.composeEventHandlers,v=d.createContext,h=d.getOwnerGlobals,m=d.useCallbackRef,b=d.useComposedRefs,y=d.useConstant,S=d.useLayoutEffect,w=d.usePrefersReducedMotion;var g,x,R="function"==typeof Float32Array;function E(e,t){return 1-3*t+3*e}function A(e,t){return 3*t-6*e}function T(e){return 3*e}function I(e,t,r){return((E(t,r)*e+A(t,r))*e+T(t))*e}function k(e,t,r){return 3*E(t,r)*e*e+2*A(t,r)*e+T(t)}function P(e){return e}function O(e,t,r,n){if(!(0<=e&&e<=1&&0<=r&&r<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&r===n)return P;for(var o=R?new Float32Array(11):new Array(11),i=0;i<11;++i)o[i]=I(.1*i,e,r);function a(t){for(var n=0,i=1;10!==i&&o[i]<=t;++i)n+=.1;--i;var a=n+.1*((t-o[i])/(o[i+1]-o[i])),l=k(a,e,r);return l>=.001?function(e,t,r,n){for(var o=0;o<4;++o){var i=k(t,r,n);if(0===i)return t;t-=(I(t,r,n)-e)/i}return t}(t,a,e,r):0===l?a:function(e,t,r,n,o){var i,a,l=0;do{(i=I(a=t+(r-t)/2,n,o)-e)>0?r=a:t=a}while(Math.abs(i)>1e-7&&++l<10);return a}(t,n,n+.1,e,r)}return function(e){return 0===e||1===e?e:I(a(e),t,n)}}function z(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function C(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}(x=g||(g={}))[x.Idle=0]="Idle",x[x.Stopped=1]="Stopped",x[x.Queuing=2]="Queuing",x[x.Pending=3]="Pending",x[x.Resolved=4]="Resolved",x[x.Error=5]="Error";var X=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),C(this,"queue",[]),C(this,"_state",g.Idle)}var t,r,n;return t=e,(r=[{key:"restart",value:function(){this.state===g.Stopped&&(this._state=g.Idle)}},{key:"rejectItem",value:function(e,t){this.stateIs(g.Pending,g.Queuing)&&(this._state=this.isEmpty()?g.Error:g.Queuing,e(t),this.dequeue())}},{key:"resolveItem",value:function(e,t){this.stateIs(g.Pending,g.Queuing)&&(this._state=this.isEmpty()?g.Resolved:g.Queuing,e(t),this.dequeue())}},{key:"enqueue",value:function(e){var t=this;return this.restart(),new Promise((function(r,n){t.queue.push({promise:e,resolve:r,reject:n}),t.dequeue()}))}},{key:"dequeue",value:function(){var e=this;if(this.stateIs(g.Error,g.Resolved,g.Idle,g.Queuing)){if(this.isEmpty())return;var t=this.queue.shift();try{this._state=g.Pending,t.promise().then((function(r){e.resolveItem(t.resolve,r)})).catch((function(r){e.rejectItem(t.reject,r)}))}catch(e){this.rejectItem(t.reject,e)}}}},{key:"stateIs",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.includes(this.state)}},{key:"isEmpty",value:function(){return this.queue.length<=0}},{key:"stop",value:function(){this.stateIs(g.Pending,g.Queuing)&&(this._state=g.Stopped,this.queue=[])}},{key:"isBusy",get:function(){return this.state===g.Queuing||this.state===g.Pending}},{key:"state",get:function(){return this._state}}])&&z(t.prototype,r),n&&z(t,n),e}();function Y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return V(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var L=!1,H=0;function B(e){"touch"===e.pointerType&&(L=!0,setTimeout((function(){L=!1}),50))}function j(){if("undefined"!=typeof document)return document.addEventListener("pointerup",B),H++,function(){--H>0||document.removeEventListener("pointerup",B)}}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.onHoverStart,n=e.onHoverChange,o=e.onHoverEnd,i=e.isDisabled,a=r.useState(!1),l=Y(a,2),c=l[0],s=l[1],u=r.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1}).current;r.useEffect(j,[]);var f=r.useMemo((function(){return{onPointerEnter:function(e){L&&"mouse"===e.pointerType||function(e,r){if(!i&&"touch"!==r&&!u.isHovered){u.isHovered=!0;var o=e.target;t&&t({type:"hoverstart",target:o,pointerType:r}),n&&n(!0),s(!0)}}(e,e.pointerType)},onPointerLeave:function(e){!function(e,t){if(!i&&"touch"!==t&&u.isHovered){u.isHovered=!1;var r=e.target;o&&o({type:"hoverend",target:r,pointerType:t}),n&&n(!1),s(!1)}}(e,e.pointerType)}}}),[i,u,t,n,o]);return{hoverProps:f,isHovered:c}}function W(e){return function(e){if(Array.isArray(e))return $(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||U(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(){return(D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach((function(t){N(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Q(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function F(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(n=(a=l.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw i}}return r}(e,t)||U(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){if(e){if("string"==typeof e)return $(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?$(e,t):void 0}}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var G,J,K,Z,ee=["positionWidth","positionHeight","scrollbarXOffset","scrollbarYOffset","scrollbarXSize","scrollbarYSize","scrollbarThumbWillChange","scrollbarThumbHeight","scrollbarThumbWidth","cornerLeft","cornerRight","cornerWidth","cornerHeight"].reduce((function(e,t){return _(_({},e),{},N({},t,(r=t,"--".concat(u("ScrollArea".concat((n=r,n.charAt(0).toUpperCase()+n.slice(1))))))));var r,n}),{});exports.SCROLL_AREA_CSS_PROPS=ee,(J=G||(G={})).Idle="Idle",J.Thumbing="Thumbing",J.Tracking="Tracking",J.ButtonScrolling="ButtonScrolling",(Z=K||(K={}))[Z.DeriveStateFromProps=0]="DeriveStateFromProps",Z[Z.HandleScrollAreaResize=1]="HandleScrollAreaResize",Z[Z.HandleViewportResize=2]="HandleViewportResize",Z[Z.HandleScrollbarResize=3]="HandleScrollbarResize",Z[Z.HandleTrackResize=4]="HandleTrackResize",Z[Z.SetContentOverflowing=5]="SetContentOverflowing",Z[Z.SetExplicitResize=6]="SetExplicitResize",Z[Z.StartTracking=7]="StartTracking",Z[Z.StopTracking=8]="StopTracking",Z[Z.StartThumbing=9]="StartThumbing",Z[Z.StopThumbing=10]="StopThumbing",Z[Z.StartButtonPress=11]="StartButtonPress",Z[Z.StopButtonPress=12]="StopButtonPress",Z[Z.SetScrollbarIsVisible=13]="SetScrollbarIsVisible";var te={overflowX:"auto",overflowY:"auto",scrollbarVisibility:"hover",scrollbarVisibilityRestTimeout:600,dir:"ltr",trackClickBehavior:"relative",unstable_prefersReducedMotion:!1},re=F(v("ScrollAreaRefsContext","ScrollArea"),2),ne=re[0],oe=re[1],ie=F(v("ScrollAreaContext","ScrollArea"),2),ae=ie[0],le=ie[1],ce=r.createContext({});function se(){return r.useContext(ce)}ce.displayName="ScrollAreaStateContext";var ue=r.createContext(!0),fe=function(){return r.useContext(ue)},de=F(v("DispatchContext","ScrollArea"),2),pe=de[0],ve=de[1],he=r.forwardRef((function(e,t){var n=_(_({},te),e),i=n.unstable_forceNative,a=void 0!==i&&i,l=n.children,c=Q(n,["unstable_forceNative","children"]),s=F(r.useState(!0),2),u=s[0],f=s[1];S((function(){f(a||!("ResizeObserver"in window&&function(){var e,t;if(!o())return!1;var r=!1;try{document.querySelector("::-webkit-scrollbar"),r=!0}catch(e){}return!(!(null===(e=window.CSS)||void 0===e||null===(t=e.supports)||void 0===t?void 0:t.call(e,"scrollbar-width: none"))&&!r)}()))}),[a]);var d=u?be:we,p=r.useRef(null),v=r.useRef(null);return function(e,t,n){r.useImperativeHandle(e,(function(){var e=t.current,r=n.current||e,o={scrollIntent:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=r.scroll).call.apply(e,[r].concat(n))},scrollByIntent:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=r.scrollBy).call.apply(e,[r].concat(n))},scrollIntoViewIntent:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=r.scrollIntoView).call.apply(e,[r].concat(n))},scrollToIntent:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=r.scrollTo).call.apply(e,[r].concat(n))},get scrollTopIntent(){return r.scrollTop},set scrollTopIntent(e){r.scrollTop=e},get scrollLeftIntent(){return r.scrollLeft},set scrollLeftIntent(e){r.scrollLeft=e},get scrollHeightIntent(){return r.scrollHeight},get scrollWidthIntent(){return r.scrollWidth},addScrollListener:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.addEventListener.apply(r,["scroll"].concat(t))},removeScrollListener:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.removeEventListener.apply(r,["scroll"].concat(t))}};return Object.assign(e,o)}))}(t,v,p),r.createElement(d,D({positionRef:p,scrollAreaRef:v},c,{ref:t}),r.createElement(ue.Provider,{value:u},l))}));exports.ScrollArea=he;var me=r.forwardRef((function(e,t){var n=_(_({},te),e),o=n.children,i=Q(n,["children"]),a=r.useRef(null),l=r.useRef(null);return r.createElement(we,D({positionRef:a,scrollAreaRef:l},i,{ref:t}),r.createElement(ue.Provider,{value:!1},o))})),be=r.forwardRef((function(e,t){var n=_(_({},te),e),o=n.overflowX,i=n.overflowY,l=(n.scrollbarVisibility,n.scrollbarVisibilityRestTimeout,n.trackClickBehavior,n.unstable_prefersReducedMotion,n.scrollAreaRef),c=(n.positionRef,Q(n,["overflowX","overflowY","scrollbarVisibility","scrollbarVisibilityRestTimeout","trackClickBehavior","unstable_prefersReducedMotion","scrollAreaRef","positionRef"])),s=b(l,t);return r.createElement(f,D({selector:a("ScrollArea")},c,{ref:s,style:_(_({},c.style),{},{overflowX:o,overflowY:i,resize:"none"})}))})),ye={width:0,height:0},Se={state:G.Idle,explicitResize:"initial",contentIsOverflowingX:!1,contentIsOverflowingY:!1,scrollbarIsVisibleX:!1,scrollbarIsVisibleY:!1,domSizes:{scrollArea:ye,viewport:ye,position:ye,scrollbarY:ye,scrollbarX:ye,trackY:ye,trackX:ye}},we=r.forwardRef((function(e,t){var n,o=_(_({},te),e),i=o.children,l=o.onScroll,c=o.overflowX,s=o.overflowY,u=o.scrollbarVisibility,d=o.scrollbarVisibilityRestTimeout,v=o.trackClickBehavior,y=o.unstable_prefersReducedMotion,S=o.positionRef,g=o.scrollAreaRef,x=Q(o,["children","onScroll","overflowX","overflowY","scrollbarVisibility","scrollbarVisibilityRestTimeout","trackClickBehavior","unstable_prefersReducedMotion","positionRef","scrollAreaRef"]),R=m(l),E=r.useRef(null),A=r.useRef(null),T=r.useRef(null),I=r.useRef(null),k=r.useRef(null),P=r.useRef(null),O=r.useRef(null),z=r.useRef(null),C=r.useRef(null),X=r.useRef(null),Y=r.useRef(null),V=r.useMemo((function(){return{buttonDownRef:E,buttonLeftRef:A,buttonRightRef:T,buttonUpRef:I,viewportRef:k,positionRef:S,scrollAreaRef:g,scrollbarXRef:P,scrollbarYRef:O,thumbXRef:z,thumbYRef:C,trackXRef:X,trackYRef:Y}}),[]),L=w(g),H=null!=y?y:L,B=F(r.useReducer(Qe,_(_({},Se),{},{scrollbarIsVisibleX:"always"===u,scrollbarIsVisibleY:"always"===u})),2),j=B[0],W=B[1],q=M(),U=q.hoverProps,$=U.onPointerEnter,G=U.onPointerLeave,J=q.isHovered,Z=r.useMemo((function(){return{dir:e.dir,isHovered:J,onScroll:R,overflowX:c,overflowY:s,prefersReducedMotion:H,scrollbarVisibility:u,scrollbarVisibilityRestTimeout:d,trackClickBehavior:v}}),[e.dir,R,J,c,s,H,u,d,v]),re=b(t,g);Fe(g,(function(e,t){var r=h(g).ownerWindow.getComputedStyle(t);W({type:K.HandleScrollAreaResize,scrollAreaComputedStyle:r,width:e.inlineSize,height:e.blockSize})}));var oe="always"===u&&("scroll"===c||"auto"===c&&j.contentIsOverflowingX),ie="always"===u&&("scroll"===s||"auto"===s&&j.contentIsOverflowingY),le=j.domSizes,se=(N(n={},ee.scrollbarXOffset,oe&&le.scrollbarX.height?le.scrollbarX.height+"px":0),N(n,ee.scrollbarYOffset,ie&&le.scrollbarY.width?le.scrollbarY.width+"px":0),N(n,ee.positionWidth,le.position.width?le.position.width+"px":"auto"),N(n,ee.positionHeight,le.position.height?le.position.height+"px":"auto"),n);return r.createElement(pe.Provider,{value:W},r.createElement(ne.Provider,{value:V},r.createElement(ae.Provider,{value:Z},r.createElement(ce.Provider,{value:j},r.createElement(f,D({selector:a("ScrollArea")},x,{ref:re,style:_(_({},x.style),se),onPointerEnter:p(e.onPointerEnter,$),onPointerLeave:p(e.onPointerLeave,G)}),i)))))})),ge=r.forwardRef((function(e,t){var n=e.selector,o=void 0===n?a("ScrollAreaViewport"):n,i=Q(e,["selector"]),c=oe("ScrollAreaViewport"),s=c.positionRef,u=c.thumbXRef,d=c.thumbYRef,v=c.trackXRef,h=c.trackYRef,m=c.viewportRef,y=le("ScrollAreaViewport"),w=y.onScroll,g=y.overflowX,x=y.overflowY,R=y.scrollbarVisibility,E=se(),A=ve("ScrollAreaViewport"),T=b(t,m);Fe(m,(function(e){A({type:K.HandleViewportResize,width:e.inlineSize,height:e.blockSize})}));var I=r.useCallback((function(){var e=s.current,t=u.current,r=d.current,n=v.current,o=h.current;t&&n&&e&&Et({thumbElement:t,trackElement:n,axis:"x",positionElement:e}),r&&o&&e&&Et({thumbElement:r,trackElement:o,axis:"y",positionElement:e})}),[s,u,d,v,h]),k=r.useRef(0),P=r.useRef(0);var O=p(w,(function(){s.current&&(I(),function(){if(s.current){var e=s.current.scrollTop,t=s.current.scrollLeft,r=e!==k.current,n=t!==P.current;r===E.scrollbarIsVisibleY&&n===E.scrollbarIsVisibleX||A({type:K.SetScrollbarIsVisible,scrollbarVisibility:R,x:n,y:r}),k.current=e<=0?0:e,P.current=t<=0?0:t}}())}));return S((function(){I()}),[I]),S((function(){var e=s.current;if(e){var t=xt(e,{axis:"x"}),r=xt(e,{axis:"y"});t===E.contentIsOverflowingX&&r===E.contentIsOverflowingY||A({type:K.SetContentOverflowing,x:t,y:r})}}),[E.contentIsOverflowingX,E.contentIsOverflowingY,A,s,E.domSizes.position.height,E.domSizes.position.width,E.domSizes.viewport.height,E.domSizes.viewport.width]),r.createElement("div",D({},o?l(o+"-position"):void 0,{ref:s,onScroll:O,style:{zIndex:1,width:"var(".concat(ee.positionWidth,")"),height:"var(".concat(ee.positionHeight,")"),scrollbarWidth:"none",overflowScrolling:"touch",resize:"none",overflowX:g,overflowY:x}}),r.createElement("div",D({},o?l(o+"-position-inner"):void 0,{style:{display:"table",width:"100%",paddingBottom:"var(".concat(ee.scrollbarXOffset,")"),paddingRight:"var(".concat(ee.scrollbarYOffset,")")}}),r.createElement(f,D({selector:o},i,{ref:T}))))})),xe=r.forwardRef((function(e,t){return fe()?r.createElement(f,D({selector:a("ScrollAreaViewport")},e,{ref:t})):r.createElement(ge,D({},e,{ref:t}))}));exports.ScrollAreaViewport=xe,xe.displayName="ScrollAreaViewport";var Re=F(v("ScrollbarContext","ScrollAreaScrollbar"),2),Ee=Re[0],Ae=Re[1],Te=r.forwardRef((function(e,t){var n,o=e.axis,i=e.name,a=e.onWheel,l=e.onPointerDown,c=e.onPointerUp,s=e.onPointerMove,u=Q(e,["axis","name","onWheel","onPointerDown","onPointerUp","onPointerMove"]),d=ve(i),v=le(i),h=v.scrollbarVisibility,m=v.scrollbarVisibilityRestTimeout,S=v.isHovered,w=se(),g=w["x"===o?"contentIsOverflowingX":"contentIsOverflowingY"],x=w["x"===o?"scrollbarIsVisibleX":"scrollbarIsVisibleY"],R=oe(i),E=R.positionRef,A=function(e,t){return"x"===e?t.scrollbarXRef:t.scrollbarYRef}(o,R),T=b(A,t),I=y((function(){return new X}));Fe(A,(function(e){d({type:K.HandleScrollbarResize,width:e.inlineSize,height:e.blockSize,axis:o})}));var k=p(a,(function(e){var t=Math.abs(e.deltaX),r=Math.abs(e.deltaY);E.current&&(t>0&&t>r&&(E.current.scrollLeft+=e.deltaX),r>0&&r>t&&(E.current.scrollTop+=e.deltaY))})),P=r.useRef();function O(){clearTimeout(P.current),P.current=setTimeout((function(){d(N({type:K.SetScrollbarIsVisible,scrollbarVisibility:h},o,!1))}),m)}r.useEffect((function(){if(x)return P.current=setTimeout((function(){d(N({type:K.SetScrollbarIsVisible,scrollbarVisibility:h},o,!1))}),m),function(){clearTimeout(P.current)}}),[o,d,x,h,m]);var z=r.useRef(!1),C=p(l,(function(e){z.current=!0,clearTimeout(P.current)})),Y=p(c,(function(e){z.current=!1,O()})),V=p(s,(function(e){z.current||O()})),L=function(){var e,t,r=(null===(e=u.style)||void 0===e?void 0:e.opacity)||1;switch(h){case"always":return null===(t=u.style)||void 0===t?void 0:t.opacity;case"scroll":return x?r:0;case"hover":return S||x?r:0}}(),H=function(){var e,t,r=(null===(e=u.style)||void 0===e?void 0:e.pointerEvents)||"auto";switch(h){case"always":return null===(t=u.style)||void 0===t?void 0:t.pointerEvents;case"scroll":return x?r:"none";case"hover":return S||x?r:"none"}}(),B=r.useMemo((function(){return{axis:o,scrollAnimationQueue:I}}),[o,I]);return r.createElement(Ee.Provider,{value:B},r.createElement(f,D({},u,{ref:T,style:_(_({},u.style),{},{display:g?null===(n=u.style)||void 0===n?void 0:n.display:"none",opacity:L,pointerEvents:H}),onPointerDown:C,onPointerUp:Y,onPointerMove:V,onWheel:k})))})),Ie=r.forwardRef((function(e,t){var n=se().domSizes;return fe()?null:r.createElement(Te,D({selector:a("ScrollAreaScrollbarX")},e,{ref:t,axis:"x",name:"ScrollAreaScrollbarX",style:_(_({},e.style),{},N({},ee.scrollbarXSize,n.scrollbarX.height?n.scrollbarX.height+"px":0))}))}));exports.ScrollAreaScrollbarX=Ie,Ie.displayName="ScrollAreaScrollbarX";var ke=r.forwardRef((function(e,t){var n=se().domSizes;return fe()?null:r.createElement(Te,D({selector:a("ScrollAreaScrollbarY")},e,{ref:t,axis:"y",name:"ScrollAreaScrollbarY",style:_(_({},e.style),{},N({},ee.scrollbarYSize,n.scrollbarY.width?n.scrollbarY.width+"px":0))}))}));exports.ScrollAreaScrollbarY=ke,ke.displayName="ScrollAreaScrollbarY";var Pe=r.forwardRef((function(e,t){var n=e.onPointerDown,o=Q(e,["onPointerDown"]),l=Ae("ScrollAreaTrack"),c=l.axis,u=l.scrollAnimationQueue,d=ve("ScrollAreaTrack"),v=oe("ScrollAreaTrack"),y=le("ScrollAreaTrack"),S=y.trackClickBehavior,w=y.prefersReducedMotion,g=v.positionRef,x=Ke(c,v),R=Je(c,v),E=b(x,t),A=m(n);Fe(x,(function(e){d({type:K.HandleTrackResize,width:e.inlineSize,height:e.blockSize,axis:c})}));var T=r.useRef();return r.useEffect((function(){var e=null,t=null,r=et(x),n=tt(R),o=rt(g),a=h(g).ownerDocument,l=p(A,(function(l){if(s(l)&&l.target!==n&&!n.contains(l.target)){var p=function(e){var t=e.event,r=e.axis,n=e.thumbElement;return ft(t)[r]<n.getBoundingClientRect()["y"===r?"top":"left"]?"start":"end"}({event:l,axis:c,thumbElement:n});if(clearTimeout(t),"page"===S){if(d({type:K.StartTracking}),a.addEventListener("pointermove",f),a.addEventListener("pointerup",v),r.setPointerCapture(l.pointerId),w){var h=ot({direction:p,positionElement:o,axis:c}),m=St(o,{direction:p,distance:h,axis:c});lt(o,{axis:c,value:m})}else u.enqueue((function(){return Ue({duration:200,timing:O(.16,0,.73,1),draw:$e({positionElement:o,direction:p,axis:c}),rafIdRef:T})}));return e=setTimeout((function(){var t=ft(l),n=nt({axis:c,direction:p,pointerPosition:t,positionElement:o,trackElement:r});if(!("start"===p&&n>0||"end"===p&&n<0)){if(w){var a=St(o,{direction:p,distance:n,axis:c});lt(o,{axis:c,value:a})}else{var s=Math.round(Math.abs(n)),f=i(s,[100,500]);u.enqueue((function(){return Ue({duration:f,timing:function(e){return e},draw:Ge({axis:c,direction:p,pointerPosition:t,positionElement:o,trackElement:r}),rafIdRef:T})}))}clearTimeout(e)}}),400),function(){clearTimeout(e)}}var b=ft(l),y=nt({axis:c,direction:p,pointerPosition:b,positionElement:o,trackElement:r}),g=St(o,{direction:p,distance:y,axis:c});lt(o,{axis:c,value:g});var x=new PointerEvent("pointerdown",l);requestAnimationFrame((function(){n.dispatchEvent(x)}))}}));return r.addEventListener("pointerdown",l),function(){cancelAnimationFrame(T.current),clearTimeout(e),clearTimeout(t),r.removeEventListener("pointerdown",l),a.removeEventListener("pointermove",f),a.removeEventListener("pointerup",v),d({type:K.StopTracking}),u.stop()};function f(t){"mouse"===t.pointerType&&gt(t,r)&&(clearTimeout(e),a.removeEventListener("pointermove",f),u.stop())}function v(n){r.releasePointerCapture(n.pointerId),clearTimeout(e),a.removeEventListener("pointermove",f),a.removeEventListener("pointerup",v),u.stop(),d({type:K.StopTracking}),t=setTimeout((function(){u.stop()}),200)}}),[c,w,S,d,A,g,u,R,x]),r.createElement(f,D({selector:a("ScrollAreaTrack")},o,{ref:E,"data-axis":c}))}));exports.ScrollAreaTrack=Pe,Pe.displayName="ScrollAreaTrack";var Oe=r.forwardRef((function(e,t){var n,o,i=e.onPointerDown,l=Q(e,["onPointerDown"]),c=Ae("ScrollAreaThumb").axis,u=oe("ScrollAreaThumb"),d=ve("ScrollAreaThumb"),v=u.positionRef,y=Je(c,u),w=Ke(c,u),g=b(y,t),x=se(),R=m(i),E=r.useRef(0),A=r.useRef(0),T=r.useRef({size:0,positionStart:0}),I=r.useRef({size:0,positionStart:0}),k=r.useRef(!1);S((function(){k.current?Et({thumbElement:tt(y),trackElement:et(w),positionElement:rt(v),axis:c}):k.current=!0}),[y,w,v,c].concat(W(wt(x.domSizes))));var P="x"===c?x.domSizes.trackX.width:x.domSizes.trackY.height,O=r.useRef(P);S((function(){O.current=P})),r.useEffect((function(){var e=tt(y),t=et(w),r=rt(v),n=h(v).ownerDocument,o=p(R,(function(r){if(s(r)){var o=ft(r)[c];T.current=ut(e,{axis:c}),I.current=ut(t,{axis:c}),A.current=o,E.current=o,e.setPointerCapture(r.pointerId),n.addEventListener("pointerup",l),n.addEventListener("pointermove",a),d({type:K.StartThumbing})}}));return e.addEventListener("pointerdown",o),function(){e.removeEventListener("pointerdown",o),i()};function i(){n.removeEventListener("pointermove",a),n.removeEventListener("pointerup",l),d({type:K.StopThumbing})}function a(e){var t=ft(e)[c],n=t-A.current,o=O.current;if(Rt(r,{axis:c,delta:n})){var i=I.current.positionStart,a=T.current.positionStart,l=E.current-a,s=Math.round(t-i),u=Math.round((s-l)/o*100)/100,f=st(r,{axis:c});lt(r,{axis:c,value:u*f}),A.current=t,d({type:K.StartThumbing})}}function l(t){e.releasePointerCapture(t.pointerId),i()}}),[c,R,d,v,u,y,w]);var z=F(r.useState({}),2),C=z[0],X=z[1];return S((function(){var e=v.current,t=w.current;X(function(e){var t=e.trackElement,r=e.positionElement,n=e.axis;if(!t||!r)return{};var o=it(r,{axis:n}),i=ct(t,{axis:n}),a=o*i;if(!xt(r,{axis:n}))return{display:"none",width:0,height:0};return N({},"x"===n?"width":"height",a)}({positionElement:e,trackElement:t,axis:c}))}),[c,v,w].concat(W(wt(x.domSizes)))),r.createElement(f,D({selector:a("ScrollAreaThumb")},l,{ref:g,"data-axis":c,style:_(_(_({},l.style),C),"x"===c?(n={},N(n,ee.scrollbarThumbWillChange,"left"),N(n,ee.scrollbarThumbHeight,"100%"),N(n,ee.scrollbarThumbWidth,"auto"),n):(o={},N(o,ee.scrollbarThumbWillChange,"top"),N(o,ee.scrollbarThumbHeight,"auto"),N(o,ee.scrollbarThumbWidth,"100%"),o))}))}));exports.ScrollAreaThumb=Oe,Oe.displayName="ScrollAreaThumb";var ze=r.forwardRef((function(e,t){var n=e.direction,o=e.name,i=e.onPointerDown,a=Q(e,["direction","name","onPointerDown"]),l=Ae(o),c=l.axis,u=l.scrollAnimationQueue,d=ve(o),v=oe(o),y=le(o).prefersReducedMotion,S=v.positionRef,w=function(e,t,r){switch(function(e,t){if("start"===e)return"x"===t?"left":"up";return"x"===t?"right":"down"}(e,t)){case"down":return r.buttonDownRef;case"up":return r.buttonUpRef;case"left":return r.buttonLeftRef;case"right":return r.buttonRightRef}}(n,c,v),g=b(w,t),x=r.useRef(),R=m(i);return r.useEffect((function(){var e,t=function(e,t){var r="end"===t?"ScrollAreaButtonEnd":"ScrollAreaButtonStart";return Ze(e,"A ref for ".concat(r," was not placed as expected. ").concat(r," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}(w,n),r=rt(S),o=h(S).ownerDocument,i=null,a=p(R,(function(a){if(s(a)){t.setPointerCapture(a.pointerId),o.addEventListener("pointerup",f),o.addEventListener("pointermove",l),d({type:K.StartButtonPress});var p="start"===n?-1:1;y?dt(r,{axis:c,value:51*p}):Rt(r,{axis:c,delta:p})&&u.enqueue((function(){return Ue({duration:135,timing:O(.16,0,.73,1),draw:function(e){dt(r,{axis:c,value:15*e*p})},rafIdRef:x})})),e=setTimeout((function(){if(y)i=setInterval((function(){Rt(r,{axis:c,delta:p})?dt(r,{axis:c,value:60*p}):clearInterval(i)}),135);else{var n=a.pointerId;!function e(){Rt(r,{axis:c,delta:p})&&u.enqueue((function(){return Ue({duration:135,timing:function(e){return e},draw:function(e){dt(r,{axis:c,value:e*(15*p)})},done:t.hasPointerCapture(n)?e:void 0,rafIdRef:x})}))}()}clearTimeout(e)}),400)}}));return t.addEventListener("pointerdown",a),function(){t.removeEventListener("pointerdown",a),o.removeEventListener("pointerup",f),o.removeEventListener("pointermove",l),clearTimeout(e),clearInterval(i),cancelAnimationFrame(x.current),d({type:K.StopButtonPress})};function l(r){"mouse"===r.pointerType&&gt(r,t)&&(clearTimeout(e),o.removeEventListener("pointermove",l))}function f(r){clearTimeout(e),clearInterval(i),t.releasePointerCapture(r.pointerId),t.removeEventListener("pointerup",f),d({type:K.StopButtonPress})}}),[c,n,y,w,d,R,u,S]),r.createElement(f,D({},a,{ref:g,"data-axis":c}))})),Ce=r.forwardRef((function(e,t){return r.createElement(ze,D({selector:a("ScrollAreaButtonStart")},e,{ref:t,name:"ScrollAreaButtonStart",direction:"start"}))}));exports.ScrollAreaButtonStart=Ce,Ce.displayName="ScrollAreaButtonStart";var Xe=r.forwardRef((function(e,t){return r.createElement(ze,D({selector:a("ScrollAreaButtonEnd")},e,{ref:t,name:"ScrollAreaButtonEnd",direction:"end"}))}));exports.ScrollAreaButtonEnd=Xe,Xe.displayName="ScrollAreaButtonEnd";var Ye=r.forwardRef((function(e,t){var n,o=oe("ScrollAreaCorner").positionRef,i=ve("ScrollAreaCorner"),l=le("ScrollAreaCorner").dir,c=se().domSizes,s="rtl"===l,u=(N(n={},ee.cornerLeft,s?0:"unset"),N(n,ee.cornerRight,s?"unset":0),N(n,ee.cornerHeight,c.scrollbarX.height?c.scrollbarX.height+"px":c.scrollbarY.width?c.scrollbarY.width+"px":"16px"),N(n,ee.cornerWidth,c.scrollbarY.width?c.scrollbarY.width+"px":c.scrollbarX.height?c.scrollbarX.height+"px":"16px"),N(n,"position","absolute"),n);return S((function(){if(o.current){var e=h(o).ownerWindow.getComputedStyle(o.current);i({type:K.SetExplicitResize,value:e.resize})}}),[i,o]),r.createElement(f,D({selector:a("ScrollAreaCorner")},e,{ref:t,style:_(_({},e.style),u)}))})),Ve=r.forwardRef((function(e,t){return fe()?null:r.createElement(Ye,D({},e,{ref:t}))}));exports.ScrollAreaCorner=Ve,Ve.displayName="ScrollAreaCorner";var Le=he;exports.Root=Le;var He=xe;exports.Viewport=He;var Be=Ie;exports.ScrollbarX=Be;var je=ke;exports.ScrollbarY=je;var Me=Ce;exports.ButtonStart=Me;var We=Xe;exports.ButtonEnd=We;var De=Pe;exports.Track=De;var qe=Oe;exports.Thumb=qe;var _e=Ve;exports.Corner=_e;var Ne=me;function Qe(e,t){switch(t.type){case K.SetExplicitResize:return _(_({},e),{},{explicitResize:t.value});case K.HandleScrollAreaResize:var r=t.scrollAreaComputedStyle,n=parseInt(r.borderTopWidth),o=parseInt(r.borderRightWidth),i=parseInt(r.borderBottomWidth),a=parseInt(r.borderLeftWidth),l=parseInt(r.paddingTop),c=parseInt(r.paddingRight),s=parseInt(r.paddingBottom),u=parseInt(r.paddingLeft);return _(_({},e),{},{domSizes:_(_({},e.domSizes),{},{scrollArea:{width:t.width,height:t.height},position:{width:t.width-a-o-u-c,height:t.height-n-i-l-s}})});case K.SetContentOverflowing:return _(_({},e),{},{contentIsOverflowingX:t.x,contentIsOverflowingY:t.y});case K.SetScrollbarIsVisible:var f,d;return"always"===t.scrollbarVisibility?_(_({},e),{},{scrollbarIsVisibleX:!0,scrollbarIsVisibleY:!0}):_(_({},e),{},{scrollbarIsVisibleX:null!==(f=t.x)&&void 0!==f?f:e.scrollbarIsVisibleX,scrollbarIsVisibleY:null!==(d=t.y)&&void 0!==d?d:e.scrollbarIsVisibleY});case K.HandleViewportResize:return _(_({},e),{},{domSizes:_(_({},e.domSizes),{},{viewport:{width:t.width,height:t.height}})});case K.HandleScrollbarResize:return _(_({},e),{},{domSizes:_(_({},e.domSizes),{},N({},"x"===t.axis?"scrollbarX":"scrollbarY",{height:t.height,width:t.width}))});case K.HandleTrackResize:return _(_({},e),{},{domSizes:_(_({},e.domSizes),{},N({},"x"===t.axis?"trackX":"trackY",{height:t.height,width:t.width}))});case K.StartTracking:return _(_({},e),{},{state:G.Tracking});case K.StopTracking:return _(_({},e),{},{state:G.Idle});case K.StartThumbing:return _(_({},e),{},{state:G.Thumbing});case K.StopThumbing:return _(_({},e),{},{state:G.Idle});case K.StartButtonPress:return _(_({},e),{},{state:G.ButtonScrolling});case K.StopButtonPress:return _(_({},e),{},{state:G.Idle})}return e}function Fe(e,t){var r=m(t);S((function(){var t,n=e.current;if(n){var o=new ResizeObserver((function(e){var t=F(e,1)[0],n=c(t);r(n,t.target)})),i=n.getBoundingClientRect();return r({inlineSize:i.width,blockSize:i.height},n),null===(t=o.observe)||void 0===t||t.call(o,n),function(){o.disconnect()}}}),[r,e])}function Ue(e){var t=e.duration,r=e.draw,n=e.timing,o=e.done,a=e.rafIdRef;return new Promise((function(e){var l=performance.now(),c=!1;a.current=requestAnimationFrame((function s(u){var f=i((u-(l=u<l?u:l))/t,[0,1]);r(n(f)),f<1?!c&&(a.current=requestAnimationFrame(s)):(c=!0,cancelAnimationFrame(a.current),e("done"),o&&o())}))}))}function $e(e){var t=e.axis,r=e.direction,n=e.positionElement,o=ot({axis:t,direction:r,positionElement:n});return function(e){var i=o*Math.min(e,1),a=St(n,{direction:r,distance:i,axis:t});o-=i,lt(n,{axis:t,value:a})}}function Ge(e){var t=e.axis,r=e.direction,n=e.pointerPosition,o=e.positionElement,i=e.trackElement,a=nt({axis:t,direction:r,pointerPosition:n,positionElement:o,trackElement:i});return function(e){var n=Math.pow(10,3),i=Math.round(a*Math.min(e,1)*n)/n,l=St(o,{direction:r,distance:i,axis:t});a-=i,lt(o,{axis:t,value:l})}}function Je(e,t){return"x"===e?t.thumbXRef:t.thumbYRef}function Ke(e,t){return"x"===e?t.trackXRef:t.trackYRef}function Ze(e,t){var r=e.current;return function(e,t){if(null==e)throw new Error(t)}(r,t),r}function et(e){return Ze(e,"A ref for ".concat("ScrollAreaTrack"," was not placed as expected. ").concat("ScrollAreaTrack"," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function tt(e){return Ze(e,"A ref for ".concat("ScrollAreaThumb"," was not placed as expected. ").concat("ScrollAreaThumb"," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function rt(e){return Ze(e,"A ref for an internal component in ".concat("ScrollAreaViewport"," was not placed as expected. ").concat("ScrollAreaViewport"," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function nt(e){var t=e.axis,r=e.direction,n=e.pointerPosition,o=e.positionElement,i=e.trackElement,a=at(o,{axis:t}),l=st(o,{axis:t}),c=ct(o,{axis:t}),s=ut(i,{axis:t}),u=s.positionStart,f=s.size,d=Math.round(n[t]-u),p=Math.round(d/f*100)/100,v="start"===r?p*l:p*l-c;return v<a?v-a-c/2:v-a+c/2}function ot(e){var t=e.axis,r=e.direction;return(ct(e.positionElement,{axis:t})-40)*("end"===r?1:-1)}function it(e,t){var r=t.axis,n=st(e,{axis:r});return ct(e,{axis:r})/n}function at(e,t){return e["x"===t.axis?"scrollLeft":"scrollTop"]}function lt(e,t){var r=t.axis,n=t.value;e["x"===r?"scrollLeft":"scrollTop"]=n}function ct(e,t){return e["x"===t.axis?"clientWidth":"clientHeight"]}function st(e,t){return e["x"===t.axis?"scrollWidth":"scrollHeight"]}function ut(e,t){var r=t.axis,n=e.getBoundingClientRect();return{coord:n[r],positionStart:n["y"===r?"top":"left"],positionEnd:n["y"===r?"bottom":"right"],size:n["y"===r?"height":"width"]}}function ft(e){return{x:e.clientX,y:e.clientY}}function dt(e,t){var r=t.axis,n=t.value;e["x"===r?"scrollLeft":"scrollTop"]+=n}function pt(e){return!(!e||0!==e.scrollTop)}function vt(e){return!(!e||e.scrollLeft!==yt(e))}function ht(e){return!(!e||e.scrollTop!==bt(e))}function mt(e){return!(!e||0!==e.scrollLeft)}function bt(e){return e.scrollHeight-e.clientHeight}function yt(e){return e.scrollWidth-e.clientWidth}function St(e,t){var r=t.direction,n=t.distance,o=t.axis,i=e["x"===o?"scrollLeft":"scrollTop"]+n,a="end"===r?function(e,t){return"x"===t?yt(e):bt(e)}(e,o):0;return"end"===r?Math.min(a,i):Math.max(a,i)}function wt(e){for(var t=[],r=0,n=Object.keys(e);r<n.length;r++){var o=e[n[r]];t.push(o.height,o.width)}return t}function gt(e,t,r){r=r||t.getBoundingClientRect();var n=ft(e);return n.x<r.left||n.x>r.right||n.y<r.top||n.y>r.bottom}function xt(e,t){return it(e,{axis:t.axis})<1}function Rt(e,t){var r=t.axis,n=t.delta;return!(0===n||n<0&&("x"===r?mt:pt)(e)||n>0&&("x"===r?vt:ht)(e))}function Et(e){var t=e.thumbElement,r=e.positionElement,n=e.axis,o=st(r,{axis:n}),i=ct(r,{axis:n}),a=at(r,{axis:n})/o;i/o>=1||("x"===n?t.style.left="".concat(100*a,"%"):"y"===n&&(t.style.top="".concat(100*a,"%")))}exports.unstable_ScrollAreaNoNativeFallback=Ne;
var e,r,t=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e),n=require("@radix-ui/utils"),o=n.canUseDOM,i=n.clamp,l=n.getSelector,a=n.getSelectorObj,c=n.getResizeObserverEntryBorderBoxSize,s=n.isMainClick,u=n.namespaced,f=require("@radix-ui/react-primitive").Primitive,d=require("@radix-ui/react-utils"),p=d.composeEventHandlers,v=d.createContext,h=d.getOwnerGlobals,m=d.useCallbackRef,b=d.useComposedRefs,y=d.useConstant,S=d.useLayoutEffect,w=d.usePrefersReducedMotion;var g,x,R="function"==typeof Float32Array;function E(e,r){return 1-3*r+3*e}function A(e,r){return 3*r-6*e}function T(e){return 3*e}function I(e,r,t){return((E(r,t)*e+A(r,t))*e+T(r))*e}function k(e,r,t){return 3*E(r,t)*e*e+2*A(r,t)*e+T(r)}function P(e){return e}function O(e,r,t,n){if(!(0<=e&&e<=1&&0<=t&&t<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===r&&t===n)return P;for(var o=R?new Float32Array(11):new Array(11),i=0;i<11;++i)o[i]=I(.1*i,e,t);function l(r){for(var n=0,i=1;10!==i&&o[i]<=r;++i)n+=.1;--i;var l=n+.1*((r-o[i])/(o[i+1]-o[i])),a=k(l,e,t);return a>=.001?function(e,r,t,n){for(var o=0;o<4;++o){var i=k(r,t,n);if(0===i)return r;r-=(I(r,t,n)-e)/i}return r}(r,l,e,t):0===a?l:function(e,r,t,n,o){var i,l,a=0;do{(i=I(l=r+(t-r)/2,n,o)-e)>0?t=l:r=l}while(Math.abs(i)>1e-7&&++a<10);return l}(r,n,n+.1,e,t)}return function(e){return 0===e||1===e?e:I(l(e),r,n)}}function z(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function C(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}(x=g||(g={}))[x.Idle=0]="Idle",x[x.Stopped=1]="Stopped",x[x.Queuing=2]="Queuing",x[x.Pending=3]="Pending",x[x.Resolved=4]="Resolved",x[x.Error=5]="Error";var X=function(){function e(){!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),C(this,"queue",[]),C(this,"_state",g.Idle)}var r,t,n;return r=e,(t=[{key:"restart",value:function(){this.state===g.Stopped&&(this._state=g.Idle)}},{key:"rejectItem",value:function(e,r){this.stateIs(g.Pending,g.Queuing)&&(this._state=this.isEmpty()?g.Error:g.Queuing,e(r),this.dequeue())}},{key:"resolveItem",value:function(e,r){this.stateIs(g.Pending,g.Queuing)&&(this._state=this.isEmpty()?g.Resolved:g.Queuing,e(r),this.dequeue())}},{key:"enqueue",value:function(e){var r=this;return this.restart(),new Promise((function(t,n){r.queue.push({promise:e,resolve:t,reject:n}),r.dequeue()}))}},{key:"dequeue",value:function(){var e=this;if(this.stateIs(g.Error,g.Resolved,g.Idle,g.Queuing)){if(this.isEmpty())return;var r=this.queue.shift();try{this._state=g.Pending,r.promise().then((function(t){e.resolveItem(r.resolve,t)})).catch((function(t){e.rejectItem(r.reject,t)}))}catch(e){this.rejectItem(r.reject,e)}}}},{key:"stateIs",value:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.includes(this.state)}},{key:"isEmpty",value:function(){return this.queue.length<=0}},{key:"stop",value:function(){this.stateIs(g.Pending,g.Queuing)&&(this._state=g.Stopped,this.queue=[])}},{key:"isBusy",get:function(){return this.state===g.Queuing||this.state===g.Pending}},{key:"state",get:function(){return this._state}}])&&z(r.prototype,t),n&&z(r,n),e}();function Y(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var l,a=e[Symbol.iterator]();!(n=(l=a.next()).done)&&(t.push(l.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return t}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return V(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return V(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var L=!1,H=0;function B(e){"touch"===e.pointerType&&(L=!0,setTimeout((function(){L=!1}),50))}function j(){if("undefined"!=typeof document)return document.addEventListener("pointerup",B),H++,function(){--H>0||document.removeEventListener("pointerup",B)}}function M(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.onHoverStart,n=e.onHoverChange,o=e.onHoverEnd,i=e.isDisabled,l=t.useState(!1),a=Y(l,2),c=a[0],s=a[1],u=t.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1}).current;t.useEffect(j,[]);var f=t.useMemo((function(){return{onPointerEnter:function(e){L&&"mouse"===e.pointerType||function(e,t){if(!i&&"touch"!==t&&!u.isHovered){u.isHovered=!0;var o=e.target;r&&r({type:"hoverstart",target:o,pointerType:t}),n&&n(!0),s(!0)}}(e,e.pointerType)},onPointerLeave:function(e){!function(e,r){if(!i&&"touch"!==r&&u.isHovered){u.isHovered=!1;var t=e.target;o&&o({type:"hoverend",target:t,pointerType:r}),n&&n(!1),s(!1)}}(e,e.pointerType)}}}),[i,u,r,n,o]);return{hoverProps:f,isHovered:c}}function W(e){return function(e){if(Array.isArray(e))return $(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||U(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(){return(D=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function q(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function _(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?q(Object(t),!0).forEach((function(r){N(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):q(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function N(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Q(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}function F(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var l,a=e[Symbol.iterator]();!(n=(l=a.next()).done)&&(t.push(l.value),!r||t.length!==r);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return t}(e,r)||U(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,r){if(e){if("string"==typeof e)return $(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?$(e,r):void 0}}function $(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}var G,J,K,Z,ee=["positionWidth","positionHeight","scrollbarXOffset","scrollbarYOffset","scrollbarXSize","scrollbarYSize","scrollbarThumbWillChange","scrollbarThumbHeight","scrollbarThumbWidth","cornerLeft","cornerRight","cornerWidth","cornerHeight"].reduce((function(e,r){return _(_({},e),{},N({},r,(t=r,"--".concat(u("ScrollArea".concat((n=t,n.charAt(0).toUpperCase()+n.slice(1))))))));var t,n}),{});exports.SCROLL_AREA_CSS_PROPS=ee,(J=G||(G={})).Idle="Idle",J.Thumbing="Thumbing",J.Tracking="Tracking",J.ButtonScrolling="ButtonScrolling",(Z=K||(K={}))[Z.DeriveStateFromProps=0]="DeriveStateFromProps",Z[Z.HandleScrollAreaResize=1]="HandleScrollAreaResize",Z[Z.HandleViewportResize=2]="HandleViewportResize",Z[Z.HandleScrollbarResize=3]="HandleScrollbarResize",Z[Z.HandleTrackResize=4]="HandleTrackResize",Z[Z.SetContentOverflowing=5]="SetContentOverflowing",Z[Z.SetExplicitResize=6]="SetExplicitResize",Z[Z.StartTracking=7]="StartTracking",Z[Z.StopTracking=8]="StopTracking",Z[Z.StartThumbing=9]="StartThumbing",Z[Z.StopThumbing=10]="StopThumbing",Z[Z.StartButtonPress=11]="StartButtonPress",Z[Z.StopButtonPress=12]="StopButtonPress",Z[Z.SetScrollbarIsVisible=13]="SetScrollbarIsVisible";var re={overflowX:"auto",overflowY:"auto",scrollbarVisibility:"hover",scrollbarVisibilityRestTimeout:600,dir:"ltr",trackClickBehavior:"relative",unstable_prefersReducedMotion:!1},te=F(v("ScrollAreaRefsContext","ScrollArea"),2),ne=te[0],oe=te[1],ie=F(v("ScrollAreaContext","ScrollArea"),2),le=ie[0],ae=ie[1],ce=t.createContext({});function se(){return t.useContext(ce)}ce.displayName="ScrollAreaStateContext";var ue=t.createContext(!0),fe=function(){return t.useContext(ue)},de=F(v("DispatchContext","ScrollArea"),2),pe=de[0],ve=de[1],he=t.forwardRef((function(e,r){var n=_(_({},re),e),i=n.unstable_forceNative,l=void 0!==i&&i,a=n.children,c=Q(n,["unstable_forceNative","children"]),s=F(t.useState(!0),2),u=s[0],f=s[1];S((function(){f(l||!("ResizeObserver"in window&&function(){var e,r;if(!o())return!1;var t=!1;try{document.querySelector("::-webkit-scrollbar"),t=!0}catch(e){}return!(!(null===(e=window.CSS)||void 0===e||null===(r=e.supports)||void 0===r?void 0:r.call(e,"scrollbar-width: none"))&&!t)}()))}),[l]);var d=u?be:we,p=t.useRef(null),v=t.useRef(null);return function(e,r,n){t.useImperativeHandle(e,(function(){var e=r.current,t=n.current||e,o={scrollIntent:function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=t.scroll).call.apply(e,[t].concat(n))},scrollByIntent:function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=t.scrollBy).call.apply(e,[t].concat(n))},scrollIntoViewIntent:function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=t.scrollIntoView).call.apply(e,[t].concat(n))},scrollToIntent:function(){for(var e,r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];(e=t.scrollTo).call.apply(e,[t].concat(n))},get scrollTopIntent(){return t.scrollTop},set scrollTopIntent(e){t.scrollTop=e},get scrollLeftIntent(){return t.scrollLeft},set scrollLeftIntent(e){t.scrollLeft=e},get scrollHeightIntent(){return t.scrollHeight},get scrollWidthIntent(){return t.scrollWidth},addScrollListener:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.addEventListener.apply(t,["scroll"].concat(r))},removeScrollListener:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];t.removeEventListener.apply(t,["scroll"].concat(r))}};return Object.assign(e,o)}))}(r,v,p),t.createElement(d,D({positionRef:p,scrollAreaRef:v},c,{ref:r}),t.createElement(ue.Provider,{value:u},a))}));exports.ScrollArea=he;var me=t.forwardRef((function(e,r){var n=_(_({},re),e),o=n.children,i=Q(n,["children"]),l=t.useRef(null),a=t.useRef(null);return t.createElement(we,D({positionRef:l,scrollAreaRef:a},i,{ref:r}),t.createElement(ue.Provider,{value:!1},o))})),be=t.forwardRef((function(e,r){var n=_(_({},re),e),o=n.selector,i=void 0===o?l("ScrollArea"):o,a=n.overflowX,c=n.overflowY,s=(n.scrollbarVisibility,n.scrollbarVisibilityRestTimeout,n.trackClickBehavior,n.unstable_prefersReducedMotion,n.scrollAreaRef),u=(n.positionRef,Q(n,["selector","overflowX","overflowY","scrollbarVisibility","scrollbarVisibilityRestTimeout","trackClickBehavior","unstable_prefersReducedMotion","scrollAreaRef","positionRef"])),d=b(s,r);return t.createElement(f,D({},u,{selector:i,ref:d,style:_(_({},u.style),{},{overflowX:a,overflowY:c,resize:"none"})}))})),ye={width:0,height:0},Se={state:G.Idle,explicitResize:"initial",contentIsOverflowingX:!1,contentIsOverflowingY:!1,scrollbarIsVisibleX:!1,scrollbarIsVisibleY:!1,domSizes:{scrollArea:ye,viewport:ye,position:ye,scrollbarY:ye,scrollbarX:ye,trackY:ye,trackX:ye}},we=t.forwardRef((function(e,r){var n,o=_(_({},re),e),i=o.selector,a=void 0===i?l("ScrollArea"):i,c=o.children,s=o.onScroll,u=o.overflowX,d=o.overflowY,v=o.scrollbarVisibility,y=o.scrollbarVisibilityRestTimeout,S=o.trackClickBehavior,g=o.unstable_prefersReducedMotion,x=o.positionRef,R=o.scrollAreaRef,E=Q(o,["selector","children","onScroll","overflowX","overflowY","scrollbarVisibility","scrollbarVisibilityRestTimeout","trackClickBehavior","unstable_prefersReducedMotion","positionRef","scrollAreaRef"]),A=m(s),T=t.useRef(null),I=t.useRef(null),k=t.useRef(null),P=t.useRef(null),O=t.useRef(null),z=t.useRef(null),C=t.useRef(null),X=t.useRef(null),Y=t.useRef(null),V=t.useRef(null),L=t.useRef(null),H=t.useMemo((function(){return{buttonDownRef:T,buttonLeftRef:I,buttonRightRef:k,buttonUpRef:P,viewportRef:O,positionRef:x,scrollAreaRef:R,scrollbarXRef:z,scrollbarYRef:C,thumbXRef:X,thumbYRef:Y,trackXRef:V,trackYRef:L}}),[]),B=w(R),j=null!=g?g:B,W=F(t.useReducer(Qe,_(_({},Se),{},{scrollbarIsVisibleX:"always"===v,scrollbarIsVisibleY:"always"===v})),2),q=W[0],U=W[1],$=M(),G=$.hoverProps,J=G.onPointerEnter,Z=G.onPointerLeave,te=$.isHovered,oe=t.useMemo((function(){return{dir:e.dir,isHovered:te,onScroll:A,overflowX:u,overflowY:d,prefersReducedMotion:j,scrollbarVisibility:v,scrollbarVisibilityRestTimeout:y,trackClickBehavior:S}}),[e.dir,A,te,u,d,j,v,y,S]),ie=b(r,R);Fe(R,(function(e,r){var t=h(R).ownerWindow.getComputedStyle(r);U({type:K.HandleScrollAreaResize,scrollAreaComputedStyle:t,width:e.inlineSize,height:e.blockSize})}));var ae="always"===v&&("scroll"===u||"auto"===u&&q.contentIsOverflowingX),se="always"===v&&("scroll"===d||"auto"===d&&q.contentIsOverflowingY),ue=q.domSizes,fe=(N(n={},ee.scrollbarXOffset,ae&&ue.scrollbarX.height?ue.scrollbarX.height+"px":0),N(n,ee.scrollbarYOffset,se&&ue.scrollbarY.width?ue.scrollbarY.width+"px":0),N(n,ee.positionWidth,ue.position.width?ue.position.width+"px":"auto"),N(n,ee.positionHeight,ue.position.height?ue.position.height+"px":"auto"),n);return t.createElement(pe.Provider,{value:U},t.createElement(ne.Provider,{value:H},t.createElement(le.Provider,{value:oe},t.createElement(ce.Provider,{value:q},t.createElement(f,D({},E,{selector:a,ref:ie,style:_(_({},E.style),fe),onPointerEnter:p(e.onPointerEnter,J),onPointerLeave:p(e.onPointerLeave,Z)}),c)))))})),ge=t.forwardRef((function(e,r){var n=e.selector,o=void 0===n?l("ScrollAreaViewport"):n,i=Q(e,["selector"]),c=oe("ScrollAreaViewport"),s=c.positionRef,u=c.thumbXRef,d=c.thumbYRef,v=c.trackXRef,h=c.trackYRef,m=c.viewportRef,y=ae("ScrollAreaViewport"),w=y.onScroll,g=y.overflowX,x=y.overflowY,R=y.scrollbarVisibility,E=se(),A=ve("ScrollAreaViewport"),T=b(r,m);Fe(m,(function(e){A({type:K.HandleViewportResize,width:e.inlineSize,height:e.blockSize})}));var I=t.useCallback((function(){var e=s.current,r=u.current,t=d.current,n=v.current,o=h.current;r&&n&&e&&Er({thumbElement:r,trackElement:n,axis:"x",positionElement:e}),t&&o&&e&&Er({thumbElement:t,trackElement:o,axis:"y",positionElement:e})}),[s,u,d,v,h]),k=t.useRef(0),P=t.useRef(0);var O=p(w,(function(){s.current&&(I(),function(){if(s.current){var e=s.current.scrollTop,r=s.current.scrollLeft,t=e!==k.current,n=r!==P.current;t===E.scrollbarIsVisibleY&&n===E.scrollbarIsVisibleX||A({type:K.SetScrollbarIsVisible,scrollbarVisibility:R,x:n,y:t}),k.current=e<=0?0:e,P.current=r<=0?0:r}}())}));return S((function(){I()}),[I]),S((function(){var e=s.current;if(e){var r=xr(e,{axis:"x"}),t=xr(e,{axis:"y"});r===E.contentIsOverflowingX&&t===E.contentIsOverflowingY||A({type:K.SetContentOverflowing,x:r,y:t})}}),[E.contentIsOverflowingX,E.contentIsOverflowingY,A,s,E.domSizes.position.height,E.domSizes.position.width,E.domSizes.viewport.height,E.domSizes.viewport.width]),t.createElement("div",D({},o?a(o+"-position"):void 0,{ref:s,onScroll:O,style:{zIndex:1,width:"var(".concat(ee.positionWidth,")"),height:"var(".concat(ee.positionHeight,")"),scrollbarWidth:"none",overflowScrolling:"touch",resize:"none",overflowX:g,overflowY:x}}),t.createElement("div",D({},o?a(o+"-position-inner"):void 0,{style:{display:"table",width:"100%",paddingBottom:"var(".concat(ee.scrollbarXOffset,")"),paddingRight:"var(".concat(ee.scrollbarYOffset,")")}}),t.createElement(f,D({selector:o},i,{ref:T}))))})),xe=t.forwardRef((function(e,r){return fe()?t.createElement(f,D({},e,{selector:e.selector||l("ScrollAreaViewport"),ref:r})):t.createElement(ge,D({},e,{ref:r}))}));exports.ScrollAreaViewport=xe,xe.displayName="ScrollAreaViewport";var Re=F(v("ScrollbarContext","ScrollAreaScrollbar"),2),Ee=Re[0],Ae=Re[1],Te=t.forwardRef((function(e,r){var n,o=e.axis,i=e.name,l=e.onWheel,a=e.onPointerDown,c=e.onPointerUp,s=e.onPointerMove,u=Q(e,["axis","name","onWheel","onPointerDown","onPointerUp","onPointerMove"]),d=ve(i),v=ae(i),h=v.scrollbarVisibility,m=v.scrollbarVisibilityRestTimeout,S=v.isHovered,w=se(),g=w["x"===o?"contentIsOverflowingX":"contentIsOverflowingY"],x=w["x"===o?"scrollbarIsVisibleX":"scrollbarIsVisibleY"],R=oe(i),E=R.positionRef,A=function(e,r){return"x"===e?r.scrollbarXRef:r.scrollbarYRef}(o,R),T=b(A,r),I=y((function(){return new X}));Fe(A,(function(e){d({type:K.HandleScrollbarResize,width:e.inlineSize,height:e.blockSize,axis:o})}));var k=p(l,(function(e){var r=Math.abs(e.deltaX),t=Math.abs(e.deltaY);E.current&&(r>0&&r>t&&(E.current.scrollLeft+=e.deltaX),t>0&&t>r&&(E.current.scrollTop+=e.deltaY))})),P=t.useRef();function O(){clearTimeout(P.current),P.current=setTimeout((function(){d(N({type:K.SetScrollbarIsVisible,scrollbarVisibility:h},o,!1))}),m)}t.useEffect((function(){if(x)return P.current=setTimeout((function(){d(N({type:K.SetScrollbarIsVisible,scrollbarVisibility:h},o,!1))}),m),function(){clearTimeout(P.current)}}),[o,d,x,h,m]);var z=t.useRef(!1),C=p(a,(function(e){z.current=!0,clearTimeout(P.current)})),Y=p(c,(function(e){z.current=!1,O()})),V=p(s,(function(e){z.current||O()})),L=function(){var e,r,t=(null===(e=u.style)||void 0===e?void 0:e.opacity)||1;switch(h){case"always":return null===(r=u.style)||void 0===r?void 0:r.opacity;case"scroll":return x?t:0;case"hover":return S||x?t:0}}(),H=function(){var e,r,t=(null===(e=u.style)||void 0===e?void 0:e.pointerEvents)||"auto";switch(h){case"always":return null===(r=u.style)||void 0===r?void 0:r.pointerEvents;case"scroll":return x?t:"none";case"hover":return S||x?t:"none"}}(),B=t.useMemo((function(){return{axis:o,scrollAnimationQueue:I}}),[o,I]);return t.createElement(Ee.Provider,{value:B},t.createElement(f,D({},u,{ref:T,style:_(_({},u.style),{},{display:g?null===(n=u.style)||void 0===n?void 0:n.display:"none",opacity:L,pointerEvents:H}),onPointerDown:C,onPointerUp:Y,onPointerMove:V,onWheel:k})))})),Ie=t.forwardRef((function(e,r){var n=e.selector,o=void 0===n?l("ScrollAreaScrollbarX"):n,i=Q(e,["selector"]),a=se().domSizes;return fe()?null:t.createElement(Te,D({},i,{selector:o,ref:r,axis:"x",name:"ScrollAreaScrollbarX",style:_(_({},e.style),{},N({},ee.scrollbarXSize,a.scrollbarX.height?a.scrollbarX.height+"px":0))}))}));exports.ScrollAreaScrollbarX=Ie,Ie.displayName="ScrollAreaScrollbarX";var ke=t.forwardRef((function(e,r){var n=e.selector,o=void 0===n?l("ScrollAreaScrollbarY"):n,i=Q(e,["selector"]),a=se().domSizes;return fe()?null:t.createElement(Te,D({},i,{selector:o,ref:r,axis:"y",name:"ScrollAreaScrollbarY",style:_(_({},e.style),{},N({},ee.scrollbarYSize,a.scrollbarY.width?a.scrollbarY.width+"px":0))}))}));exports.ScrollAreaScrollbarY=ke,ke.displayName="ScrollAreaScrollbarY";var Pe=t.forwardRef((function(e,r){var n=e.selector,o=void 0===n?l("ScrollAreaTrack"):n,a=e.onPointerDown,c=Q(e,["selector","onPointerDown"]),u=Ae("ScrollAreaTrack"),d=u.axis,v=u.scrollAnimationQueue,y=ve("ScrollAreaTrack"),S=oe("ScrollAreaTrack"),w=ae("ScrollAreaTrack"),g=w.trackClickBehavior,x=w.prefersReducedMotion,R=S.positionRef,E=Ke(d,S),A=Je(d,S),T=b(E,r),I=m(a);Fe(E,(function(e){y({type:K.HandleTrackResize,width:e.inlineSize,height:e.blockSize,axis:d})}));var k=t.useRef();return t.useEffect((function(){var e=null,r=null,t=er(E),n=rr(A),o=tr(R),l=h(R).ownerDocument,a=p(I,(function(a){if(s(a)&&a.target!==n&&!n.contains(a.target)){var f=function(e){var r=e.event,t=e.axis,n=e.thumbElement;return fr(r)[t]<n.getBoundingClientRect()["y"===t?"top":"left"]?"start":"end"}({event:a,axis:d,thumbElement:n});if(clearTimeout(r),"page"===g){if(y({type:K.StartTracking}),l.addEventListener("pointermove",c),l.addEventListener("pointerup",u),t.setPointerCapture(a.pointerId),x){var p=or({direction:f,positionElement:o,axis:d}),h=Sr(o,{direction:f,distance:p,axis:d});ar(o,{axis:d,value:h})}else v.enqueue((function(){return Ue({duration:200,timing:O(.16,0,.73,1),draw:$e({positionElement:o,direction:f,axis:d}),rafIdRef:k})}));return e=setTimeout((function(){var r=fr(a),n=nr({axis:d,direction:f,pointerPosition:r,positionElement:o,trackElement:t});if(!("start"===f&&n>0||"end"===f&&n<0)){if(x){var l=Sr(o,{direction:f,distance:n,axis:d});ar(o,{axis:d,value:l})}else{var c=Math.round(Math.abs(n)),s=i(c,[100,500]);v.enqueue((function(){return Ue({duration:s,timing:function(e){return e},draw:Ge({axis:d,direction:f,pointerPosition:r,positionElement:o,trackElement:t}),rafIdRef:k})}))}clearTimeout(e)}}),400),function(){clearTimeout(e)}}var m=fr(a),b=nr({axis:d,direction:f,pointerPosition:m,positionElement:o,trackElement:t}),S=Sr(o,{direction:f,distance:b,axis:d});ar(o,{axis:d,value:S});var w=new PointerEvent("pointerdown",a);requestAnimationFrame((function(){n.dispatchEvent(w)}))}}));return t.addEventListener("pointerdown",a),function(){cancelAnimationFrame(k.current),clearTimeout(e),clearTimeout(r),t.removeEventListener("pointerdown",a),l.removeEventListener("pointermove",c),l.removeEventListener("pointerup",u),y({type:K.StopTracking}),v.stop()};function c(r){"mouse"===r.pointerType&&gr(r,t)&&(clearTimeout(e),l.removeEventListener("pointermove",c),v.stop())}function u(n){t.releasePointerCapture(n.pointerId),clearTimeout(e),l.removeEventListener("pointermove",c),l.removeEventListener("pointerup",u),v.stop(),y({type:K.StopTracking}),r=setTimeout((function(){v.stop()}),200)}}),[d,x,g,y,I,R,v,A,E]),t.createElement(f,D({},c,{selector:o,ref:T,"data-axis":d}))}));exports.ScrollAreaTrack=Pe,Pe.displayName="ScrollAreaTrack";var Oe=t.forwardRef((function(e,r){var n,o,i=e.selector,a=void 0===i?l("ScrollAreaThumb"):i,c=e.onPointerDown,u=Q(e,["selector","onPointerDown"]),d=Ae("ScrollAreaThumb").axis,v=oe("ScrollAreaThumb"),y=ve("ScrollAreaThumb"),w=v.positionRef,g=Je(d,v),x=Ke(d,v),R=b(g,r),E=se(),A=m(c),T=t.useRef(0),I=t.useRef(0),k=t.useRef({size:0,positionStart:0}),P=t.useRef({size:0,positionStart:0}),O=t.useRef(!1);S((function(){O.current?Er({thumbElement:rr(g),trackElement:er(x),positionElement:tr(w),axis:d}):O.current=!0}),[g,x,w,d].concat(W(wr(E.domSizes))));var z="x"===d?E.domSizes.trackX.width:E.domSizes.trackY.height,C=t.useRef(z);S((function(){C.current=z})),t.useEffect((function(){var e=rr(g),r=er(x),t=tr(w),n=h(w).ownerDocument,o=p(A,(function(t){if(s(t)){var o=fr(t)[d];k.current=ur(e,{axis:d}),P.current=ur(r,{axis:d}),I.current=o,T.current=o,e.setPointerCapture(t.pointerId),n.addEventListener("pointerup",a),n.addEventListener("pointermove",l),y({type:K.StartThumbing})}}));return e.addEventListener("pointerdown",o),function(){e.removeEventListener("pointerdown",o),i()};function i(){n.removeEventListener("pointermove",l),n.removeEventListener("pointerup",a),y({type:K.StopThumbing})}function l(e){var r=fr(e)[d],n=r-I.current,o=C.current;if(Rr(t,{axis:d,delta:n})){var i=P.current.positionStart,l=k.current.positionStart,a=T.current-l,c=Math.round(r-i),s=Math.round((c-a)/o*100)/100,u=sr(t,{axis:d});ar(t,{axis:d,value:s*u}),I.current=r,y({type:K.StartThumbing})}}function a(r){e.releasePointerCapture(r.pointerId),i()}}),[d,A,y,w,v,g,x]);var X=F(t.useState({}),2),Y=X[0],V=X[1];return S((function(){var e=w.current,r=x.current;V(function(e){var r=e.trackElement,t=e.positionElement,n=e.axis;if(!r||!t)return{};var o=ir(t,{axis:n}),i=cr(r,{axis:n}),l=o*i;if(!xr(t,{axis:n}))return{display:"none",width:0,height:0};return N({},"x"===n?"width":"height",l)}({positionElement:e,trackElement:r,axis:d}))}),[d,w,x].concat(W(wr(E.domSizes)))),t.createElement(f,D({},u,{selector:a,ref:R,"data-axis":d,style:_(_(_({},u.style),Y),"x"===d?(n={},N(n,ee.scrollbarThumbWillChange,"left"),N(n,ee.scrollbarThumbHeight,"100%"),N(n,ee.scrollbarThumbWidth,"auto"),n):(o={},N(o,ee.scrollbarThumbWillChange,"top"),N(o,ee.scrollbarThumbHeight,"auto"),N(o,ee.scrollbarThumbWidth,"100%"),o))}))}));exports.ScrollAreaThumb=Oe,Oe.displayName="ScrollAreaThumb";var ze=t.forwardRef((function(e,r){var n=e.direction,o=e.name,i=e.onPointerDown,l=Q(e,["direction","name","onPointerDown"]),a=Ae(o),c=a.axis,u=a.scrollAnimationQueue,d=ve(o),v=oe(o),y=ae(o).prefersReducedMotion,S=v.positionRef,w=function(e,r,t){switch(function(e,r){if("start"===e)return"x"===r?"left":"up";return"x"===r?"right":"down"}(e,r)){case"down":return t.buttonDownRef;case"up":return t.buttonUpRef;case"left":return t.buttonLeftRef;case"right":return t.buttonRightRef}}(n,c,v),g=b(w,r),x=t.useRef(),R=m(i);return t.useEffect((function(){var e,r=function(e,r){var t="end"===r?"ScrollAreaButtonEnd":"ScrollAreaButtonStart";return Ze(e,"A ref for ".concat(t," was not placed as expected. ").concat(t," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}(w,n),t=tr(S),o=h(S).ownerDocument,i=null,l=p(R,(function(l){if(s(l)){r.setPointerCapture(l.pointerId),o.addEventListener("pointerup",f),o.addEventListener("pointermove",a),d({type:K.StartButtonPress});var p="start"===n?-1:1;y?dr(t,{axis:c,value:51*p}):Rr(t,{axis:c,delta:p})&&u.enqueue((function(){return Ue({duration:135,timing:O(.16,0,.73,1),draw:function(e){dr(t,{axis:c,value:15*e*p})},rafIdRef:x})})),e=setTimeout((function(){if(y)i=setInterval((function(){Rr(t,{axis:c,delta:p})?dr(t,{axis:c,value:60*p}):clearInterval(i)}),135);else{var n=l.pointerId;!function e(){Rr(t,{axis:c,delta:p})&&u.enqueue((function(){return Ue({duration:135,timing:function(e){return e},draw:function(e){dr(t,{axis:c,value:e*(15*p)})},done:r.hasPointerCapture(n)?e:void 0,rafIdRef:x})}))}()}clearTimeout(e)}),400)}}));return r.addEventListener("pointerdown",l),function(){r.removeEventListener("pointerdown",l),o.removeEventListener("pointerup",f),o.removeEventListener("pointermove",a),clearTimeout(e),clearInterval(i),cancelAnimationFrame(x.current),d({type:K.StopButtonPress})};function a(t){"mouse"===t.pointerType&&gr(t,r)&&(clearTimeout(e),o.removeEventListener("pointermove",a))}function f(t){clearTimeout(e),clearInterval(i),r.releasePointerCapture(t.pointerId),r.removeEventListener("pointerup",f),d({type:K.StopButtonPress})}}),[c,n,y,w,d,R,u,S]),t.createElement(f,D({},l,{ref:g,"data-axis":c}))})),Ce=t.forwardRef((function(e,r){var n=e.selector,o=void 0===n?l("ScrollAreaButtonStart"):n,i=Q(e,["selector"]);return t.createElement(ze,D({},i,{selector:o,ref:r,name:"ScrollAreaButtonStart",direction:"start"}))}));exports.ScrollAreaButtonStart=Ce,Ce.displayName="ScrollAreaButtonStart";var Xe=t.forwardRef((function(e,r){var n=e.selector,o=void 0===n?l("ScrollAreaButtonEnd"):n,i=Q(e,["selector"]);return t.createElement(ze,D({},i,{selector:o,ref:r,name:"ScrollAreaButtonEnd",direction:"end"}))}));exports.ScrollAreaButtonEnd=Xe,Xe.displayName="ScrollAreaButtonEnd";var Ye=t.forwardRef((function(e,r){var n,o=e.selector,i=void 0===o?l("ScrollAreaCorner"):o,a=Q(e,["selector"]),c=oe("ScrollAreaCorner").positionRef,s=ve("ScrollAreaCorner"),u=ae("ScrollAreaCorner").dir,d=se().domSizes,p="rtl"===u,v=(N(n={},ee.cornerLeft,p?0:"unset"),N(n,ee.cornerRight,p?"unset":0),N(n,ee.cornerHeight,d.scrollbarX.height?d.scrollbarX.height+"px":d.scrollbarY.width?d.scrollbarY.width+"px":"16px"),N(n,ee.cornerWidth,d.scrollbarY.width?d.scrollbarY.width+"px":d.scrollbarX.height?d.scrollbarX.height+"px":"16px"),N(n,"position","absolute"),n);return S((function(){if(c.current){var e=h(c).ownerWindow.getComputedStyle(c.current);s({type:K.SetExplicitResize,value:e.resize})}}),[s,c]),t.createElement(f,D({},a,{selector:i,ref:r,style:_(_({},e.style),v)}))})),Ve=t.forwardRef((function(e,r){return fe()?null:t.createElement(Ye,D({},e,{ref:r}))}));exports.ScrollAreaCorner=Ve,Ve.displayName="ScrollAreaCorner";var Le=he;exports.Root=Le;var He=xe;exports.Viewport=He;var Be=Ie;exports.ScrollbarX=Be;var je=ke;exports.ScrollbarY=je;var Me=Ce;exports.ButtonStart=Me;var We=Xe;exports.ButtonEnd=We;var De=Pe;exports.Track=De;var qe=Oe;exports.Thumb=qe;var _e=Ve;exports.Corner=_e;var Ne=me;function Qe(e,r){switch(r.type){case K.SetExplicitResize:return _(_({},e),{},{explicitResize:r.value});case K.HandleScrollAreaResize:var t=r.scrollAreaComputedStyle,n=parseInt(t.borderTopWidth),o=parseInt(t.borderRightWidth),i=parseInt(t.borderBottomWidth),l=parseInt(t.borderLeftWidth),a=parseInt(t.paddingTop),c=parseInt(t.paddingRight),s=parseInt(t.paddingBottom),u=parseInt(t.paddingLeft);return _(_({},e),{},{domSizes:_(_({},e.domSizes),{},{scrollArea:{width:r.width,height:r.height},position:{width:r.width-l-o-u-c,height:r.height-n-i-a-s}})});case K.SetContentOverflowing:return _(_({},e),{},{contentIsOverflowingX:r.x,contentIsOverflowingY:r.y});case K.SetScrollbarIsVisible:var f,d;return"always"===r.scrollbarVisibility?_(_({},e),{},{scrollbarIsVisibleX:!0,scrollbarIsVisibleY:!0}):_(_({},e),{},{scrollbarIsVisibleX:null!==(f=r.x)&&void 0!==f?f:e.scrollbarIsVisibleX,scrollbarIsVisibleY:null!==(d=r.y)&&void 0!==d?d:e.scrollbarIsVisibleY});case K.HandleViewportResize:return _(_({},e),{},{domSizes:_(_({},e.domSizes),{},{viewport:{width:r.width,height:r.height}})});case K.HandleScrollbarResize:return _(_({},e),{},{domSizes:_(_({},e.domSizes),{},N({},"x"===r.axis?"scrollbarX":"scrollbarY",{height:r.height,width:r.width}))});case K.HandleTrackResize:return _(_({},e),{},{domSizes:_(_({},e.domSizes),{},N({},"x"===r.axis?"trackX":"trackY",{height:r.height,width:r.width}))});case K.StartTracking:return _(_({},e),{},{state:G.Tracking});case K.StopTracking:return _(_({},e),{},{state:G.Idle});case K.StartThumbing:return _(_({},e),{},{state:G.Thumbing});case K.StopThumbing:return _(_({},e),{},{state:G.Idle});case K.StartButtonPress:return _(_({},e),{},{state:G.ButtonScrolling});case K.StopButtonPress:return _(_({},e),{},{state:G.Idle})}return e}function Fe(e,r){var t=m(r);S((function(){var r,n=e.current;if(n){var o=new ResizeObserver((function(e){var r=F(e,1)[0],n=c(r);t(n,r.target)})),i=n.getBoundingClientRect();return t({inlineSize:i.width,blockSize:i.height},n),null===(r=o.observe)||void 0===r||r.call(o,n),function(){o.disconnect()}}}),[t,e])}function Ue(e){var r=e.duration,t=e.draw,n=e.timing,o=e.done,l=e.rafIdRef;return new Promise((function(e){var a=performance.now(),c=!1;l.current=requestAnimationFrame((function s(u){var f=i((u-(a=u<a?u:a))/r,[0,1]);t(n(f)),f<1?!c&&(l.current=requestAnimationFrame(s)):(c=!0,cancelAnimationFrame(l.current),e("done"),o&&o())}))}))}function $e(e){var r=e.axis,t=e.direction,n=e.positionElement,o=or({axis:r,direction:t,positionElement:n});return function(e){var i=o*Math.min(e,1),l=Sr(n,{direction:t,distance:i,axis:r});o-=i,ar(n,{axis:r,value:l})}}function Ge(e){var r=e.axis,t=e.direction,n=e.pointerPosition,o=e.positionElement,i=e.trackElement,l=nr({axis:r,direction:t,pointerPosition:n,positionElement:o,trackElement:i});return function(e){var n=Math.pow(10,3),i=Math.round(l*Math.min(e,1)*n)/n,a=Sr(o,{direction:t,distance:i,axis:r});l-=i,ar(o,{axis:r,value:a})}}function Je(e,r){return"x"===e?r.thumbXRef:r.thumbYRef}function Ke(e,r){return"x"===e?r.trackXRef:r.trackYRef}function Ze(e,r){var t=e.current;return function(e,r){if(null==e)throw new Error(r)}(t,r),t}function er(e){return Ze(e,"A ref for ".concat("ScrollAreaTrack"," was not placed as expected. ").concat("ScrollAreaTrack"," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function rr(e){return Ze(e,"A ref for ".concat("ScrollAreaThumb"," was not placed as expected. ").concat("ScrollAreaThumb"," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function tr(e){return Ze(e,"A ref for an internal component in ".concat("ScrollAreaViewport"," was not placed as expected. ").concat("ScrollAreaViewport"," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function nr(e){var r=e.axis,t=e.direction,n=e.pointerPosition,o=e.positionElement,i=e.trackElement,l=lr(o,{axis:r}),a=sr(o,{axis:r}),c=cr(o,{axis:r}),s=ur(i,{axis:r}),u=s.positionStart,f=s.size,d=Math.round(n[r]-u),p=Math.round(d/f*100)/100,v="start"===t?p*a:p*a-c;return v<l?v-l-c/2:v-l+c/2}function or(e){var r=e.axis,t=e.direction;return(cr(e.positionElement,{axis:r})-40)*("end"===t?1:-1)}function ir(e,r){var t=r.axis,n=sr(e,{axis:t});return cr(e,{axis:t})/n}function lr(e,r){return e["x"===r.axis?"scrollLeft":"scrollTop"]}function ar(e,r){var t=r.axis,n=r.value;e["x"===t?"scrollLeft":"scrollTop"]=n}function cr(e,r){return e["x"===r.axis?"clientWidth":"clientHeight"]}function sr(e,r){return e["x"===r.axis?"scrollWidth":"scrollHeight"]}function ur(e,r){var t=r.axis,n=e.getBoundingClientRect();return{coord:n[t],positionStart:n["y"===t?"top":"left"],positionEnd:n["y"===t?"bottom":"right"],size:n["y"===t?"height":"width"]}}function fr(e){return{x:e.clientX,y:e.clientY}}function dr(e,r){var t=r.axis,n=r.value;e["x"===t?"scrollLeft":"scrollTop"]+=n}function pr(e){return!(!e||0!==e.scrollTop)}function vr(e){return!(!e||e.scrollLeft!==yr(e))}function hr(e){return!(!e||e.scrollTop!==br(e))}function mr(e){return!(!e||0!==e.scrollLeft)}function br(e){return e.scrollHeight-e.clientHeight}function yr(e){return e.scrollWidth-e.clientWidth}function Sr(e,r){var t=r.direction,n=r.distance,o=r.axis,i=e["x"===o?"scrollLeft":"scrollTop"]+n,l="end"===t?function(e,r){return"x"===r?yr(e):br(e)}(e,o):0;return"end"===t?Math.min(l,i):Math.max(l,i)}function wr(e){for(var r=[],t=0,n=Object.keys(e);t<n.length;t++){var o=e[n[t]];r.push(o.height,o.width)}return r}function gr(e,r,t){t=t||r.getBoundingClientRect();var n=fr(e);return n.x<t.left||n.x>t.right||n.y<t.top||n.y>t.bottom}function xr(e,r){return ir(e,{axis:r.axis})<1}function Rr(e,r){var t=r.axis,n=r.delta;return!(0===n||n<0&&("x"===t?mr:pr)(e)||n>0&&("x"===t?vr:hr)(e))}function Er(e){var r=e.thumbElement,t=e.positionElement,n=e.axis,o=sr(t,{axis:n}),i=cr(t,{axis:n}),l=lr(t,{axis:n})/o;i/o>=1||("x"===n?r.style.left="".concat(100*l,"%"):"y"===n&&(r.style.top="".concat(100*l,"%")))}exports.unstable_ScrollAreaNoNativeFallback=Ne;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import*as e from"react";import{canUseDOM as t,clamp as r,getSelector as n,getSelectorObj as o,getResizeObserverEntryBorderBoxSize as i,isMainClick as l,namespaced as s}from"@radix-ui/utils";import{Primitive as c}from"@radix-ui/react-primitive";import{composeEventHandlers as a,createContext as u,getOwnerGlobals as d,useCallbackRef as f,useComposedRefs as p,useConstant as S,useLayoutEffect as h,usePrefersReducedMotion as m}from"@radix-ui/react-utils";const b="function"==typeof Float32Array;function v(e,t){return 1-3*t+3*e}function R(e,t){return 3*t-6*e}function w(e){return 3*e}function g(e,t,r){return((v(t,r)*e+R(t,r))*e+w(t))*e}function x(e,t,r){return 3*v(t,r)*e*e+2*R(t,r)*e+w(t)}function y(e){return e}function E(e,t,r,n){if(!(0<=e&&e<=1&&0<=r&&r<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&r===n)return y;const o=b?new Float32Array(11):new Array(11);for(let t=0;t<11;++t)o[t]=g(.1*t,e,r);function i(t){let n=0,i=1;for(;10!==i&&o[i]<=t;++i)n+=.1;--i;const l=n+.1*((t-o[i])/(o[i+1]-o[i])),s=x(l,e,r);return s>=.001?function(e,t,r,n){for(let o=0;o<4;++o){const o=x(t,r,n);if(0===o)return t;t-=(g(t,r,n)-e)/o}return t}(t,l,e,r):0===s?l:function(e,t,r,n,o){let i,l,s=0;do{l=t+(r-t)/2,i=g(l,n,o)-e,i>0?r=l:t=l}while(Math.abs(i)>1e-7&&++s<10);return l}(t,n,n+.1,e,r)}return function(e){return 0===e||1===e?e:g(i(e),t,n)}}function A(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P,T;(T=P||(P={}))[T.Idle=0]="Idle",T[T.Stopped=1]="Stopped",T[T.Queuing=2]="Queuing",T[T.Pending=3]="Pending",T[T.Resolved=4]="Resolved",T[T.Error=5]="Error";class O{constructor(){A(this,"queue",[]),A(this,"_state",P.Idle)}restart(){this.state===P.Stopped&&(this._state=P.Idle)}rejectItem(e,t){this.stateIs(P.Pending,P.Queuing)&&(this._state=this.isEmpty()?P.Error:P.Queuing,e(t),this.dequeue())}resolveItem(e,t){this.stateIs(P.Pending,P.Queuing)&&(this._state=this.isEmpty()?P.Resolved:P.Queuing,e(t),this.dequeue())}get isBusy(){return this.state===P.Queuing||this.state===P.Pending}enqueue(e){return this.restart(),new Promise(((t,r)=>{this.queue.push({promise:e,resolve:t,reject:r}),this.dequeue()}))}dequeue(){if(this.stateIs(P.Error,P.Resolved,P.Idle,P.Queuing)){if(this.isEmpty())return;const e=this.queue.shift();try{this._state=P.Pending,e.promise().then((t=>{this.resolveItem(e.resolve,t)})).catch((t=>{this.rejectItem(e.reject,t)}))}catch(t){this.rejectItem(e.reject,t)}}}get state(){return this._state}stateIs(...e){return e.includes(this.state)}isEmpty(){return this.queue.length<=0}stop(){this.stateIs(P.Pending,P.Queuing)&&(this._state=P.Stopped,this.queue=[])}}let C=!1,L=0;function I(e){"touch"===e.pointerType&&(C=!0,setTimeout((function(){C=!1}),50))}function _(){if("undefined"!=typeof document)return document.addEventListener("pointerup",I),L++,function(){L--,L>0||document.removeEventListener("pointerup",I)}}function k(t={}){const{onHoverStart:r,onHoverChange:n,onHoverEnd:o,isDisabled:i}=t,[l,s]=e.useState(!1),c=e.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1}).current;e.useEffect(_,[]);return{hoverProps:e.useMemo((function(){return{onPointerEnter(e){C&&"mouse"===e.pointerType||function(e,t){if(i||"touch"===t||c.isHovered)return;c.isHovered=!0;const o=e.target;r&&r({type:"hoverstart",target:o,pointerType:t}),n&&n(!0),s(!0)}(e,e.pointerType)},onPointerLeave(e){!function(e,t){if(i||"touch"===t||!c.isHovered)return;c.isHovered=!1;const r=e.target;o&&o({type:"hoverend",target:r,pointerType:t}),n&&n(!1),s(!1)}(e,e.pointerType)}}}),[i,c,r,n,o]),isHovered:l}}function z(){return(z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}export const SCROLL_AREA_CSS_PROPS=["positionWidth","positionHeight","scrollbarXOffset","scrollbarYOffset","scrollbarXSize","scrollbarYSize","scrollbarThumbWillChange","scrollbarThumbHeight","scrollbarThumbWidth","cornerLeft","cornerRight","cornerWidth","cornerHeight"].reduce((function(e,t){return Y(Y({},e),{},{[t]:(n=t,"--".concat(s("ScrollArea".concat((r=n,r.charAt(0).toUpperCase()+r.slice(1))))))});var r;var n}),{});var H,M,j,W;(M=H||(H={})).Idle="Idle",M.Thumbing="Thumbing",M.Tracking="Tracking",M.ButtonScrolling="ButtonScrolling",(W=j||(j={}))[W.DeriveStateFromProps=0]="DeriveStateFromProps",W[W.HandleScrollAreaResize=1]="HandleScrollAreaResize",W[W.HandleViewportResize=2]="HandleViewportResize",W[W.HandleScrollbarResize=3]="HandleScrollbarResize",W[W.HandleTrackResize=4]="HandleTrackResize",W[W.SetContentOverflowing=5]="SetContentOverflowing",W[W.SetExplicitResize=6]="SetExplicitResize",W[W.StartTracking=7]="StartTracking",W[W.StopTracking=8]="StopTracking",W[W.StartThumbing=9]="StartThumbing",W[W.StopThumbing=10]="StopThumbing",W[W.StartButtonPress=11]="StartButtonPress",W[W.StopButtonPress=12]="StopButtonPress",W[W.SetScrollbarIsVisible=13]="SetScrollbarIsVisible";const D={overflowX:"auto",overflowY:"auto",scrollbarVisibility:"hover",scrollbarVisibilityRestTimeout:600,dir:"ltr",trackClickBehavior:"relative",unstable_prefersReducedMotion:!1},[q,N]=u("ScrollAreaRefsContext","ScrollArea"),[Q,F]=u("ScrollAreaContext","ScrollArea"),U=e.createContext({});function G(){return e.useContext(U)}U.displayName="ScrollAreaStateContext";const J=e.createContext(!0),K=()=>e.useContext(J),[Z,$]=u("DispatchContext","ScrollArea");export const ScrollArea=e.forwardRef((function(r,n){const o=Y(Y({},D),r),{unstable_forceNative:i=!1,children:l}=o,s=B(o,["unstable_forceNative","children"]),[c,a]=e.useState(!0);h((()=>{a(i||!("ResizeObserver"in window&&function(){var e,r;if(!t())return!1;let n=!1;try{document.querySelector("::-webkit-scrollbar"),n=!0}catch(e){}return!(!(null===(e=window.CSS)||void 0===e||null===(r=e.supports)||void 0===r?void 0:r.call(e,"scrollbar-width: none"))&&!n)}()))}),[i]);const u=c?te:oe,d=e.useRef(null),f=e.useRef(null);return function(t,r,n){e.useImperativeHandle(t,(()=>{const e=r.current,t=n.current||e,o={scrollIntent(...e){t.scroll.call(t,...e)},scrollByIntent(...e){t.scrollBy.call(t,...e)},scrollIntoViewIntent(...e){t.scrollIntoView.call(t,...e)},scrollToIntent(...e){t.scrollTo.call(t,...e)},get scrollTopIntent(){return t.scrollTop},set scrollTopIntent(e){t.scrollTop=e},get scrollLeftIntent(){return t.scrollLeft},set scrollLeftIntent(e){t.scrollLeft=e},get scrollHeightIntent(){return t.scrollHeight},get scrollWidthIntent(){return t.scrollWidth},addScrollListener(...e){t.addEventListener("scroll",...e)},removeScrollListener(...e){t.removeEventListener("scroll",...e)}};return Object.assign(e,o)}))}(n,f,d),e.createElement(u,z({positionRef:d,scrollAreaRef:f},s,{ref:n}),e.createElement(J.Provider,{value:c},l))}));const ee=e.forwardRef((function(t,r){const n=Y(Y({},D),t),{children:o}=n,i=B(n,["children"]),l=e.useRef(null),s=e.useRef(null);return e.createElement(oe,z({positionRef:l,scrollAreaRef:s},i,{ref:r}),e.createElement(J.Provider,{value:!1},o))})),te=e.forwardRef((function(t,r){const o=Y(Y({},D),t),{overflowX:i,overflowY:l,scrollbarVisibility:s,scrollbarVisibilityRestTimeout:a,trackClickBehavior:u,unstable_prefersReducedMotion:d,scrollAreaRef:f,positionRef:S}=o,h=B(o,["overflowX","overflowY","scrollbarVisibility","scrollbarVisibilityRestTimeout","trackClickBehavior","unstable_prefersReducedMotion","scrollAreaRef","positionRef"]),m=p(f,r);return e.createElement(c,z({selector:n("ScrollArea")},h,{ref:m,style:Y(Y({},h.style),{},{overflowX:i,overflowY:l,resize:"none"})}))})),re={width:0,height:0},ne={state:H.Idle,explicitResize:"initial",contentIsOverflowingX:!1,contentIsOverflowingY:!1,scrollbarIsVisibleX:!1,scrollbarIsVisibleY:!1,domSizes:{scrollArea:re,viewport:re,position:re,scrollbarY:re,scrollbarX:re,trackY:re,trackX:re}},oe=e.forwardRef((function(t,r){const o=Y(Y({},D),t),{children:i,onScroll:l,overflowX:s,overflowY:u,scrollbarVisibility:S,scrollbarVisibilityRestTimeout:h,trackClickBehavior:b,unstable_prefersReducedMotion:v,positionRef:R,scrollAreaRef:w}=o,g=B(o,["children","onScroll","overflowX","overflowY","scrollbarVisibility","scrollbarVisibilityRestTimeout","trackClickBehavior","unstable_prefersReducedMotion","positionRef","scrollAreaRef"]),x=f(l),y=e.useRef(null),E=e.useRef(null),A=e.useRef(null),P=e.useRef(null),T=e.useRef(null),O=e.useRef(null),C=e.useRef(null),L=e.useRef(null),I=e.useRef(null),_=e.useRef(null),X=e.useRef(null),V=e.useMemo((()=>({buttonDownRef:y,buttonLeftRef:E,buttonRightRef:A,buttonUpRef:P,viewportRef:T,positionRef:R,scrollAreaRef:w,scrollbarXRef:O,scrollbarYRef:C,thumbXRef:L,thumbYRef:I,trackXRef:_,trackYRef:X})),[]),H=m(w),M=null!=v?v:H,[W,N]=e.useReducer(fe,Y(Y({},ne),{},{scrollbarIsVisibleX:"always"===S,scrollbarIsVisibleY:"always"===S})),{hoverProps:{onPointerEnter:F,onPointerLeave:G},isHovered:J}=k(),K=e.useMemo((()=>({dir:t.dir,isHovered:J,onScroll:x,overflowX:s,overflowY:u,prefersReducedMotion:M,scrollbarVisibility:S,scrollbarVisibilityRestTimeout:h,trackClickBehavior:b})),[t.dir,x,J,s,u,M,S,h,b]),$=p(r,w);pe(w,((e,t)=>{const{ownerWindow:r}=d(w),n=r.getComputedStyle(t);N({type:j.HandleScrollAreaResize,scrollAreaComputedStyle:n,width:e.inlineSize,height:e.blockSize})}));const ee="always"===S&&("scroll"===s||"auto"===s&&W.contentIsOverflowingX),te="always"===S&&("scroll"===u||"auto"===u&&W.contentIsOverflowingY),{domSizes:re}=W,oe={[SCROLL_AREA_CSS_PROPS.scrollbarXOffset]:ee&&re.scrollbarX.height?re.scrollbarX.height+"px":0,[SCROLL_AREA_CSS_PROPS.scrollbarYOffset]:te&&re.scrollbarY.width?re.scrollbarY.width+"px":0,[SCROLL_AREA_CSS_PROPS.positionWidth]:re.position.width?re.position.width+"px":"auto",[SCROLL_AREA_CSS_PROPS.positionHeight]:re.position.height?re.position.height+"px":"auto"};return e.createElement(Z.Provider,{value:N},e.createElement(q.Provider,{value:V},e.createElement(Q.Provider,{value:K},e.createElement(U.Provider,{value:W},e.createElement(c,z({selector:n("ScrollArea")},g,{ref:$,style:Y(Y({},g.style),oe),onPointerEnter:a(t.onPointerEnter,F),onPointerLeave:a(t.onPointerLeave,G)}),i)))))})),ie="ScrollAreaViewport",le=e.forwardRef((function(t,r){const{selector:i=n(ie)}=t,l=B(t,["selector"]),{positionRef:s,thumbXRef:u,thumbYRef:d,trackXRef:f,trackYRef:S,viewportRef:m}=N(ie),{onScroll:b,overflowX:v,overflowY:R,scrollbarVisibility:w}=F(ie),g=G(),x=$(ie),y=p(r,m);pe(m,(e=>{x({type:j.HandleViewportResize,width:e.inlineSize,height:e.blockSize})}));const E=e.useCallback((function(){const e=s.current,t=u.current,r=d.current,n=f.current,o=S.current;t&&n&&e&&qe({thumbElement:t,trackElement:n,axis:"x",positionElement:e}),r&&o&&e&&qe({thumbElement:r,trackElement:o,axis:"y",positionElement:e})}),[s,u,d,f,S]),A=e.useRef(0),P=e.useRef(0);const T=a(b,(function(){s.current&&(E(),function(){if(!s.current)return;const e=s.current.scrollTop,t=s.current.scrollLeft,r=e!==A.current,n=t!==P.current;r===g.scrollbarIsVisibleY&&n===g.scrollbarIsVisibleX||x({type:j.SetScrollbarIsVisible,scrollbarVisibility:w,x:n,y:r}),A.current=e<=0?0:e,P.current=t<=0?0:t}())}));return h((()=>{E()}),[E]),h((function(){const e=s.current;if(!e)return;const t=We(e,{axis:"x"}),r=We(e,{axis:"y"});t===g.contentIsOverflowingX&&r===g.contentIsOverflowingY||x({type:j.SetContentOverflowing,x:t,y:r})}),[g.contentIsOverflowingX,g.contentIsOverflowingY,x,s,g.domSizes.position.height,g.domSizes.position.width,g.domSizes.viewport.height,g.domSizes.viewport.width]),e.createElement("div",z({},i?o(i+"-position"):void 0,{ref:s,onScroll:T,style:{zIndex:1,width:"var(".concat(SCROLL_AREA_CSS_PROPS.positionWidth,")"),height:"var(".concat(SCROLL_AREA_CSS_PROPS.positionHeight,")"),scrollbarWidth:"none",overflowScrolling:"touch",resize:"none",overflowX:v,overflowY:R}}),e.createElement("div",z({},i?o(i+"-position-inner"):void 0,{style:{display:"table",width:"100%",paddingBottom:"var(".concat(SCROLL_AREA_CSS_PROPS.scrollbarXOffset,")"),paddingRight:"var(".concat(SCROLL_AREA_CSS_PROPS.scrollbarYOffset,")")}}),e.createElement(c,z({selector:i},l,{ref:y}))))}));export const ScrollAreaViewport=e.forwardRef((function(t,r){return K()?e.createElement(c,z({selector:n(ie)},t,{ref:r})):e.createElement(le,z({},t,{ref:r}))}));ScrollAreaViewport.displayName=ie;const[se,ce]=u("ScrollbarContext","ScrollAreaScrollbar"),ae=e.forwardRef((function(t,r){var n;const{axis:o,name:i,onWheel:l,onPointerDown:s,onPointerUp:u,onPointerMove:d}=t,f=B(t,["axis","name","onWheel","onPointerDown","onPointerUp","onPointerMove"]),h=$(i),{scrollbarVisibility:m,scrollbarVisibilityRestTimeout:b,isHovered:v}=F(i),{["x"===o?"contentIsOverflowingX":"contentIsOverflowingY"]:R,["x"===o?"scrollbarIsVisibleX":"scrollbarIsVisibleY"]:w}=G(),g=N(i),{positionRef:x}=g,y=function(e,t){return"x"===e?t.scrollbarXRef:t.scrollbarYRef}(o,g),E=p(y,r),A=S((()=>new O));pe(y,(e=>{h({type:j.HandleScrollbarResize,width:e.inlineSize,height:e.blockSize,axis:o})}));const P=a(l,(function(e){const t=Math.abs(e.deltaX),r=Math.abs(e.deltaY);x.current&&(t>0&&t>r&&(x.current.scrollLeft+=e.deltaX),r>0&&r>t&&(x.current.scrollTop+=e.deltaY))})),T=e.useRef();function C(){clearTimeout(T.current),T.current=setTimeout((()=>{h({type:j.SetScrollbarIsVisible,scrollbarVisibility:m,[o]:!1})}),b)}e.useEffect((()=>{if(w)return T.current=setTimeout((()=>{h({type:j.SetScrollbarIsVisible,scrollbarVisibility:m,[o]:!1})}),b),function(){clearTimeout(T.current)}}),[o,h,w,m,b]);const L=e.useRef(!1),I=a(s,(e=>{L.current=!0,clearTimeout(T.current)})),_=a(u,(e=>{L.current=!1,C()})),k=a(d,(e=>{L.current||C()})),X=function(){var e,t;const r=(null===(e=f.style)||void 0===e?void 0:e.opacity)||1;switch(m){case"always":return null===(t=f.style)||void 0===t?void 0:t.opacity;case"scroll":return w?r:0;case"hover":return v||w?r:0}}(),V=function(){var e,t;const r=(null===(e=f.style)||void 0===e?void 0:e.pointerEvents)||"auto";switch(m){case"always":return null===(t=f.style)||void 0===t?void 0:t.pointerEvents;case"scroll":return w?r:"none";case"hover":return v||w?r:"none"}}(),H=e.useMemo((()=>({axis:o,scrollAnimationQueue:A})),[o,A]);return e.createElement(se.Provider,{value:H},e.createElement(c,z({},f,{ref:E,style:Y(Y({},f.style),{},{display:R?null===(n=f.style)||void 0===n?void 0:n.display:"none",opacity:X,pointerEvents:V}),onPointerDown:I,onPointerUp:_,onPointerMove:k,onWheel:P})))}));export const ScrollAreaScrollbarX=e.forwardRef((function(t,r){const{domSizes:o}=G();return K()?null:e.createElement(ae,z({selector:n("ScrollAreaScrollbarX")},t,{ref:r,axis:"x",name:"ScrollAreaScrollbarX",style:Y(Y({},t.style),{},{[SCROLL_AREA_CSS_PROPS.scrollbarXSize]:o.scrollbarX.height?o.scrollbarX.height+"px":0})}))}));ScrollAreaScrollbarX.displayName="ScrollAreaScrollbarX";export const ScrollAreaScrollbarY=e.forwardRef((function(t,r){const{domSizes:o}=G();return K()?null:e.createElement(ae,z({selector:n("ScrollAreaScrollbarY")},t,{ref:r,axis:"y",name:"ScrollAreaScrollbarY",style:Y(Y({},t.style),{},{[SCROLL_AREA_CSS_PROPS.scrollbarYSize]:o.scrollbarY.width?o.scrollbarY.width+"px":0})}))}));ScrollAreaScrollbarY.displayName="ScrollAreaScrollbarY";export const ScrollAreaTrack=e.forwardRef((function(t,o){const{onPointerDown:i}=t,s=B(t,["onPointerDown"]),{axis:u,scrollAnimationQueue:S}=ce("ScrollAreaTrack"),h=$("ScrollAreaTrack"),m=N("ScrollAreaTrack"),{trackClickBehavior:b,prefersReducedMotion:v}=F("ScrollAreaTrack"),{positionRef:R}=m,w=ve(u,m),g=be(u,m),x=p(w,o),y=f(i);pe(w,(e=>{h({type:j.HandleTrackResize,width:e.inlineSize,height:e.blockSize,axis:u})}));const A=e.useRef();return e.useEffect((()=>{let e=null,t=null;const n=we(w),o=ge(g),i=xe(R),{ownerDocument:s}=d(R),c=a(y,(function(c){if(!l(c)||c.target===o||o.contains(c.target))return;const a=function({event:e,axis:t,thumbElement:r}){const{[t]:n}=Ie(e);return n<r.getBoundingClientRect()["y"===t?"top":"left"]?"start":"end"}({event:c,axis:u,thumbElement:o});if(clearTimeout(t),"page"===b){if(h({type:j.StartTracking}),s.addEventListener("pointermove",f),s.addEventListener("pointerup",p),n.setPointerCapture(c.pointerId),v){const e=Ee({direction:a,positionElement:i,axis:u}),t=He(i,{direction:a,distance:e,axis:u});Te(i,{axis:u,value:t})}else S.enqueue((()=>Se({duration:200,timing:E(.16,0,.73,1),draw:he({positionElement:i,direction:a,axis:u}),rafIdRef:A})));return e=setTimeout((()=>{const t=Ie(c),o=ye({axis:u,direction:a,pointerPosition:t,positionElement:i,trackElement:n});if(!("start"===a&&o>0||"end"===a&&o<0)){if(v){const e=He(i,{direction:a,distance:o,axis:u});Te(i,{axis:u,value:e})}else{const e=Math.round(Math.abs(o)),l=r(e,[100,500]);S.enqueue((()=>Se({duration:l,timing:e=>e,draw:me({axis:u,direction:a,pointerPosition:t,positionElement:i,trackElement:n}),rafIdRef:A})))}clearTimeout(e)}}),400),function(){clearTimeout(e)}}{const e=Ie(c),t=ye({axis:u,direction:a,pointerPosition:e,positionElement:i,trackElement:n}),r=He(i,{direction:a,distance:t,axis:u});Te(i,{axis:u,value:r});const l=new PointerEvent("pointerdown",c);requestAnimationFrame((()=>{o.dispatchEvent(l)}))}}));return n.addEventListener("pointerdown",c),function(){cancelAnimationFrame(A.current),clearTimeout(e),clearTimeout(t),n.removeEventListener("pointerdown",c),s.removeEventListener("pointermove",f),s.removeEventListener("pointerup",p),h({type:j.StopTracking}),S.stop()};function f(t){"mouse"===t.pointerType&&je(t,n)&&(clearTimeout(e),s.removeEventListener("pointermove",f),S.stop())}function p(r){n.releasePointerCapture(r.pointerId),clearTimeout(e),s.removeEventListener("pointermove",f),s.removeEventListener("pointerup",p),S.stop(),h({type:j.StopTracking}),t=setTimeout((()=>{S.stop()}),200)}}),[u,v,b,h,y,R,S,g,w]),e.createElement(c,z({selector:n("ScrollAreaTrack")},s,{ref:x,"data-axis":u}))}));ScrollAreaTrack.displayName="ScrollAreaTrack";export const ScrollAreaThumb=e.forwardRef((function(t,r){const{onPointerDown:o}=t,i=B(t,["onPointerDown"]),{axis:s}=ce("ScrollAreaThumb"),u=N("ScrollAreaThumb"),S=$("ScrollAreaThumb"),{positionRef:m}=u,b=be(s,u),v=ve(s,u),R=p(b,r),w=G(),g=f(o),x=e.useRef(0),y=e.useRef(0),E=e.useRef({size:0,positionStart:0}),A=e.useRef({size:0,positionStart:0}),P=e.useRef(!1);h((()=>{if(!P.current)return void(P.current=!0);qe({thumbElement:ge(b),trackElement:we(v),positionElement:xe(m),axis:s})}),[b,v,m,s,...Me(w.domSizes)]);const T="x"===s?w.domSizes.trackX.width:w.domSizes.trackY.height,O=e.useRef(T);h((()=>{O.current=T})),e.useEffect((()=>{const e=ge(b),t=we(v),r=xe(m),{ownerDocument:n}=d(m),o=a(g,(function(r){if(!l(r))return;const o=Ie(r)[s];E.current=Le(e,{axis:s}),A.current=Le(t,{axis:s}),y.current=o,x.current=o,e.setPointerCapture(r.pointerId),n.addEventListener("pointerup",u),n.addEventListener("pointermove",c),S({type:j.StartThumbing})}));return e.addEventListener("pointerdown",o),function(){e.removeEventListener("pointerdown",o),i()};function i(){n.removeEventListener("pointermove",c),n.removeEventListener("pointerup",u),S({type:j.StopThumbing})}function c(e){const t=Ie(e)[s],n=t-y.current,o=O.current;if(De(r,{axis:s,delta:n})){const{positionStart:e}=A.current,{positionStart:n}=E.current,i=x.current-n,l=Math.round(t-e),c=Math.round((l-i)/o*100)/100,a=Ce(r,{axis:s});Te(r,{axis:s,value:c*a}),y.current=t,S({type:j.StartThumbing})}}function u(t){e.releasePointerCapture(t.pointerId),i()}}),[s,g,S,m,u,b,v]);const[C,L]=e.useState({});return h((()=>{const e=m.current,t=v.current;L(function(e){const{trackElement:t,positionElement:r,axis:n}=e;if(!t||!r)return{};const o=Ae(r,{axis:n}),i=Oe(t,{axis:n}),l=o*i;if(!We(r,{axis:n}))return{display:"none",width:0,height:0};return{["x"===n?"width":"height"]:l}}({positionElement:e,trackElement:t,axis:s}))}),[s,m,v,...Me(w.domSizes)]),e.createElement(c,z({selector:n("ScrollAreaThumb")},i,{ref:R,"data-axis":s,style:Y(Y(Y({},i.style),C),"x"===s?{[SCROLL_AREA_CSS_PROPS.scrollbarThumbWillChange]:"left",[SCROLL_AREA_CSS_PROPS.scrollbarThumbHeight]:"100%",[SCROLL_AREA_CSS_PROPS.scrollbarThumbWidth]:"auto"}:{[SCROLL_AREA_CSS_PROPS.scrollbarThumbWillChange]:"top",[SCROLL_AREA_CSS_PROPS.scrollbarThumbHeight]:"auto",[SCROLL_AREA_CSS_PROPS.scrollbarThumbWidth]:"100%"})}))}));ScrollAreaThumb.displayName="ScrollAreaThumb";const ue=e.forwardRef((function(t,r){const{direction:n,name:o,onPointerDown:i}=t,s=B(t,["direction","name","onPointerDown"]),{axis:u,scrollAnimationQueue:S}=ce(o),h=$(o),m=N(o),{prefersReducedMotion:b}=F(o),{positionRef:v}=m,R=function(e,t,r){switch(function(e,t){if("start"===e)return"x"===t?"left":"up";return"x"===t?"right":"down"}(e,t)){case"down":return r.buttonDownRef;case"up":return r.buttonUpRef;case"left":return r.buttonLeftRef;case"right":return r.buttonRightRef}}(n,u,m),w=p(R,r),g=e.useRef(),x=f(i);return e.useEffect((()=>{const e=function(e,t){const r="end"===t?"ScrollAreaButtonEnd":"ScrollAreaButtonStart";return Re(e,"A ref for ".concat(r," was not placed as expected. ").concat(r," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}(R,n),t=xe(v),{ownerDocument:r}=d(v);let o,i=null;const s=a(x,(function(s){if(!l(s))return;e.setPointerCapture(s.pointerId),r.addEventListener("pointerup",f),r.addEventListener("pointermove",c),h({type:j.StartButtonPress});const a="start"===n?-1:1;b?_e(t,{axis:u,value:51*a}):De(t,{axis:u,delta:a})&&S.enqueue((()=>Se({duration:135,timing:E(.16,0,.73,1),draw(e){_e(t,{axis:u,value:15*e*a})},rafIdRef:g}))),o=setTimeout((()=>{if(b)i=setInterval((()=>{De(t,{axis:u,delta:a})?_e(t,{axis:u,value:60*a}):clearInterval(i)}),135);else{const r=s.pointerId;!function n(){De(t,{axis:u,delta:a})&&S.enqueue((()=>Se({duration:135,timing:e=>e,draw(e){_e(t,{axis:u,value:e*(15*a)})},done:e.hasPointerCapture(r)?n:void 0,rafIdRef:g})))}()}clearTimeout(o)}),400)}));return e.addEventListener("pointerdown",s),function(){e.removeEventListener("pointerdown",s),r.removeEventListener("pointerup",f),r.removeEventListener("pointermove",c),clearTimeout(o),clearInterval(i),cancelAnimationFrame(g.current),h({type:j.StopButtonPress})};function c(t){"mouse"===t.pointerType&&je(t,e)&&(clearTimeout(o),r.removeEventListener("pointermove",c))}function f(t){clearTimeout(o),clearInterval(i),e.releasePointerCapture(t.pointerId),e.removeEventListener("pointerup",f),h({type:j.StopButtonPress})}}),[u,n,b,R,h,x,S,v]),e.createElement(c,z({},s,{ref:w,"data-axis":u}))}));export const ScrollAreaButtonStart=e.forwardRef((function(t,r){return e.createElement(ue,z({selector:n("ScrollAreaButtonStart")},t,{ref:r,name:"ScrollAreaButtonStart",direction:"start"}))}));ScrollAreaButtonStart.displayName="ScrollAreaButtonStart";export const ScrollAreaButtonEnd=e.forwardRef((function(t,r){return e.createElement(ue,z({selector:n("ScrollAreaButtonEnd")},t,{ref:r,name:"ScrollAreaButtonEnd",direction:"end"}))}));ScrollAreaButtonEnd.displayName="ScrollAreaButtonEnd";const de=e.forwardRef((function(t,r){const{positionRef:o}=N("ScrollAreaCorner"),i=$("ScrollAreaCorner"),{dir:l}=F("ScrollAreaCorner"),{domSizes:s}=G(),a="rtl"===l,u={[SCROLL_AREA_CSS_PROPS.cornerLeft]:a?0:"unset",[SCROLL_AREA_CSS_PROPS.cornerRight]:a?"unset":0,[SCROLL_AREA_CSS_PROPS.cornerHeight]:s.scrollbarX.height?s.scrollbarX.height+"px":s.scrollbarY.width?s.scrollbarY.width+"px":"16px",[SCROLL_AREA_CSS_PROPS.cornerWidth]:s.scrollbarY.width?s.scrollbarY.width+"px":s.scrollbarX.height?s.scrollbarX.height+"px":"16px",position:"absolute"};return h((()=>{if(o.current){const{ownerWindow:e}=d(o),t=e.getComputedStyle(o.current);i({type:j.SetExplicitResize,value:t.resize})}}),[i,o]),e.createElement(c,z({selector:n("ScrollAreaCorner")},t,{ref:r,style:Y(Y({},t.style),u)}))}));export const ScrollAreaCorner=e.forwardRef((function(t,r){return K()?null:e.createElement(de,z({},t,{ref:r}))}));ScrollAreaCorner.displayName="ScrollAreaCorner";export const Root=ScrollArea;export const Viewport=ScrollAreaViewport;export const ScrollbarX=ScrollAreaScrollbarX;export const ScrollbarY=ScrollAreaScrollbarY;export const ButtonStart=ScrollAreaButtonStart;export const ButtonEnd=ScrollAreaButtonEnd;export const Track=ScrollAreaTrack;export const Thumb=ScrollAreaThumb;export const Corner=ScrollAreaCorner;export const unstable_ScrollAreaNoNativeFallback=ee;function fe(e,t){switch(t.type){case j.SetExplicitResize:return Y(Y({},e),{},{explicitResize:t.value});case j.HandleScrollAreaResize:{const r=t.scrollAreaComputedStyle,n=parseInt(r.borderTopWidth),o=parseInt(r.borderRightWidth),i=parseInt(r.borderBottomWidth),l=parseInt(r.borderLeftWidth),s=parseInt(r.paddingTop),c=parseInt(r.paddingRight),a=parseInt(r.paddingBottom),u=parseInt(r.paddingLeft);return Y(Y({},e),{},{domSizes:Y(Y({},e.domSizes),{},{scrollArea:{width:t.width,height:t.height},position:{width:t.width-l-o-u-c,height:t.height-n-i-s-a}})})}case j.SetContentOverflowing:return Y(Y({},e),{},{contentIsOverflowingX:t.x,contentIsOverflowingY:t.y});case j.SetScrollbarIsVisible:var r,n;return"always"===t.scrollbarVisibility?Y(Y({},e),{},{scrollbarIsVisibleX:!0,scrollbarIsVisibleY:!0}):Y(Y({},e),{},{scrollbarIsVisibleX:null!==(r=t.x)&&void 0!==r?r:e.scrollbarIsVisibleX,scrollbarIsVisibleY:null!==(n=t.y)&&void 0!==n?n:e.scrollbarIsVisibleY});case j.HandleViewportResize:return Y(Y({},e),{},{domSizes:Y(Y({},e.domSizes),{},{viewport:{width:t.width,height:t.height}})});case j.HandleScrollbarResize:return Y(Y({},e),{},{domSizes:Y(Y({},e.domSizes),{},{["x"===t.axis?"scrollbarX":"scrollbarY"]:{height:t.height,width:t.width}})});case j.HandleTrackResize:return Y(Y({},e),{},{domSizes:Y(Y({},e.domSizes),{},{["x"===t.axis?"trackX":"trackY"]:{height:t.height,width:t.width}})});case j.StartTracking:return Y(Y({},e),{},{state:H.Tracking});case j.StopTracking:return Y(Y({},e),{},{state:H.Idle});case j.StartThumbing:return Y(Y({},e),{},{state:H.Thumbing});case j.StopThumbing:return Y(Y({},e),{},{state:H.Idle});case j.StartButtonPress:return Y(Y({},e),{},{state:H.ButtonScrolling});case j.StopButtonPress:return Y(Y({},e),{},{state:H.Idle})}return e}function pe(e,t){const r=f(t);h((()=>{var t;const n=e.current;if(!n)return;const o=new ResizeObserver((([e])=>{const t=i(e);r(t,e.target)})),l=n.getBoundingClientRect();return r({inlineSize:l.width,blockSize:l.height},n),null===(t=o.observe)||void 0===t||t.call(o,n),function(){o.disconnect()}}),[r,e])}function Se({duration:e,draw:t,timing:n,done:o,rafIdRef:i}){return new Promise((l=>{let s=performance.now(),c=!1;i.current=requestAnimationFrame((function a(u){s=u<s?u:s;const d=r((u-s)/e,[0,1]);t(n(d)),d<1?!c&&(i.current=requestAnimationFrame(a)):(c=!0,cancelAnimationFrame(i.current),l("done"),o&&o())}))}))}function he({axis:e,direction:t,positionElement:r}){let n=Ee({axis:e,direction:t,positionElement:r});return function(o){const i=n*Math.min(o,1),l=He(r,{direction:t,distance:i,axis:e});n-=i,Te(r,{axis:e,value:l})}}function me({axis:e,direction:t,pointerPosition:r,positionElement:n,trackElement:o}){let i=ye({axis:e,direction:t,pointerPosition:r,positionElement:n,trackElement:o});return function(r){const o=Math.pow(10,3),l=Math.round(i*Math.min(r,1)*o)/o,s=He(n,{direction:t,distance:l,axis:e});i-=l,Te(n,{axis:e,value:s})}}function be(e,t){return"x"===e?t.thumbXRef:t.thumbYRef}function ve(e,t){return"x"===e?t.trackXRef:t.trackYRef}function Re(e,t){const{current:r}=e;return function(e,t){if(null==e)throw new Error(t)}(r,t),r}function we(e){return Re(e,"A ref for ".concat("ScrollAreaTrack"," was not placed as expected. ").concat("ScrollAreaTrack"," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function ge(e){return Re(e,"A ref for ".concat("ScrollAreaThumb"," was not placed as expected. ").concat("ScrollAreaThumb"," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function xe(e){return Re(e,"A ref for an internal component in ".concat(ie," was not placed as expected. ").concat(ie," should always be used within a ").concat("ScrollArea"," component, and it should not be rendered conditionally."))}function ye({axis:e,direction:t,pointerPosition:r,positionElement:n,trackElement:o}){const i=Pe(n,{axis:e}),l=Ce(n,{axis:e}),s=Oe(n,{axis:e}),{positionStart:c,size:a}=Le(o,{axis:e}),u=Math.round(r[e]-c),d=Math.round(u/a*100)/100,f="start"===t?d*l:d*l-s;return f<i?f-i-s/2:f-i+s/2}function Ee({axis:e,direction:t,positionElement:r}){return(Oe(r,{axis:e})-40)*("end"===t?1:-1)}function Ae(e,{axis:t}){const r=Ce(e,{axis:t});return Oe(e,{axis:t})/r}function Pe(e,{axis:t}){return e["x"===t?"scrollLeft":"scrollTop"]}function Te(e,{axis:t,value:r}){e["x"===t?"scrollLeft":"scrollTop"]=r}function Oe(e,{axis:t}){return e["x"===t?"clientWidth":"clientHeight"]}function Ce(e,{axis:t}){return e["x"===t?"scrollWidth":"scrollHeight"]}function Le(e,{axis:t}){const{[t]:r,["y"===t?"top":"left"]:n,["y"===t?"bottom":"right"]:o,["y"===t?"height":"width"]:i}=e.getBoundingClientRect();return{coord:r,positionStart:n,positionEnd:o,size:i}}function Ie(e){return{x:e.clientX,y:e.clientY}}function _e(e,{axis:t,value:r}){e["x"===t?"scrollLeft":"scrollTop"]+=r}function ke(e){return!(!e||0!==e.scrollTop)}function ze(e){return!(!e||e.scrollLeft!==Be(e))}function Xe(e){return!(!e||e.scrollTop!==Ve(e))}function Ye(e){return!(!e||0!==e.scrollLeft)}function Ve(e){return e.scrollHeight-e.clientHeight}function Be(e){return e.scrollWidth-e.clientWidth}function He(e,{direction:t,distance:r,axis:n}){const{["x"===n?"scrollLeft":"scrollTop"]:o}=e,i=o+r,l="end"===t?function(e,t){return"x"===t?Be(e):Ve(e)}(e,n):0;return"end"===t?Math.min(l,i):Math.max(l,i)}function Me(e){const t=[];for(const r of Object.keys(e)){const n=e[r];t.push(n.height,n.width)}return t}function je(e,t,r){r=r||t.getBoundingClientRect();const n=Ie(e);return n.x<r.left||n.x>r.right||n.y<r.top||n.y>r.bottom}function We(e,{axis:t}){return Ae(e,{axis:t})<1}function De(e,{axis:t,delta:r}){return!(0===r||r<0&&("x"===t?Ye:ke)(e)||r>0&&("x"===t?ze:Xe)(e))}function qe(e){const{thumbElement:t,positionElement:r,axis:n}=e,o=Ce(r,{axis:n}),i=Oe(r,{axis:n}),l=Pe(r,{axis:n})/o;i/o>=1||("x"===n?t.style.left="".concat(100*l,"%"):"y"===n&&(t.style.top="".concat(100*l,"%")))}
import*as e from"react";import{canUseDOM as t,clamp as r,getSelector as n,getSelectorObj as o,getResizeObserverEntryBorderBoxSize as i,isMainClick as l,namespaced as s}from"@radix-ui/utils";import{Primitive as c}from"@radix-ui/react-primitive";import{composeEventHandlers as a,createContext as u,getOwnerGlobals as d,useCallbackRef as f,useComposedRefs as p,useConstant as h,useLayoutEffect as m,usePrefersReducedMotion as S}from"@radix-ui/react-utils";const b="function"==typeof Float32Array;function v(e,t){return 1-3*t+3*e}function R(e,t){return 3*t-6*e}function w(e){return 3*e}function g(e,t,r){return((v(t,r)*e+R(t,r))*e+w(t))*e}function x(e,t,r){return 3*v(t,r)*e*e+2*R(t,r)*e+w(t)}function y(e){return e}function E(e,t,r,n){if(!(0<=e&&e<=1&&0<=r&&r<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&r===n)return y;const o=b?new Float32Array(11):new Array(11);for(let t=0;t<11;++t)o[t]=g(.1*t,e,r);function i(t){let n=0,i=1;for(;10!==i&&o[i]<=t;++i)n+=.1;--i;const l=n+.1*((t-o[i])/(o[i+1]-o[i])),s=x(l,e,r);return s>=.001?function(e,t,r,n){for(let o=0;o<4;++o){const o=x(t,r,n);if(0===o)return t;t-=(g(t,r,n)-e)/o}return t}(t,l,e,r):0===s?l:function(e,t,r,n,o){let i,l,s=0;do{l=t+(r-t)/2,i=g(l,n,o)-e,i>0?r=l:t=l}while(Math.abs(i)>1e-7&&++s<10);return l}(t,n,n+.1,e,r)}return function(e){return 0===e||1===e?e:g(i(e),t,n)}}function P(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var A,O;(O=A||(A={}))[O.Idle=0]="Idle",O[O.Stopped=1]="Stopped",O[O.Queuing=2]="Queuing",O[O.Pending=3]="Pending",O[O.Resolved=4]="Resolved",O[O.Error=5]="Error";class T{constructor(){P(this,"queue",[]),P(this,"_state",A.Idle)}restart(){this.state===A.Stopped&&(this._state=A.Idle)}rejectItem(e,t){this.stateIs(A.Pending,A.Queuing)&&(this._state=this.isEmpty()?A.Error:A.Queuing,e(t),this.dequeue())}resolveItem(e,t){this.stateIs(A.Pending,A.Queuing)&&(this._state=this.isEmpty()?A.Resolved:A.Queuing,e(t),this.dequeue())}get isBusy(){return this.state===A.Queuing||this.state===A.Pending}enqueue(e){return this.restart(),new Promise(((t,r)=>{this.queue.push({promise:e,resolve:t,reject:r}),this.dequeue()}))}dequeue(){if(this.stateIs(A.Error,A.Resolved,A.Idle,A.Queuing)){if(this.isEmpty())return;const e=this.queue.shift();try{this._state=A.Pending,e.promise().then((t=>{this.resolveItem(e.resolve,t)})).catch((t=>{this.rejectItem(e.reject,t)}))}catch(t){this.rejectItem(e.reject,t)}}}get state(){return this._state}stateIs(...e){return e.includes(this.state)}isEmpty(){return this.queue.length<=0}stop(){this.stateIs(A.Pending,A.Queuing)&&(this._state=A.Stopped,this.queue=[])}}let L=!1,I=0;function C(e){"touch"===e.pointerType&&(L=!0,setTimeout((function(){L=!1}),50))}function _(){if("undefined"!=typeof document)return document.addEventListener("pointerup",C),I++,function(){I--,I>0||document.removeEventListener("pointerup",C)}}function k(t={}){const{onHoverStart:r,onHoverChange:n,onHoverEnd:o,isDisabled:i}=t,[l,s]=e.useState(!1),c=e.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1}).current;e.useEffect(_,[]);return{hoverProps:e.useMemo((function(){return{onPointerEnter(e){L&&"mouse"===e.pointerType||function(e,t){if(i||"touch"===t||c.isHovered)return;c.isHovered=!0;const o=e.target;r&&r({type:"hoverstart",target:o,pointerType:t}),n&&n(!0),s(!0)}(e,e.pointerType)},onPointerLeave(e){!function(e,t){if(i||"touch"===t||!c.isHovered)return;c.isHovered=!1;const r=e.target;o&&o({type:"hoverend",target:r,pointerType:t}),n&&n(!1),s(!1)}(e,e.pointerType)}}}),[i,c,r,n,o]),isHovered:l}}function z(){return(z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(Object(r),!0).forEach((function(t){V(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function V(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function H(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}export const SCROLL_AREA_CSS_PROPS=["positionWidth","positionHeight","scrollbarXOffset","scrollbarYOffset","scrollbarXSize","scrollbarYSize","scrollbarThumbWillChange","scrollbarThumbHeight","scrollbarThumbWidth","cornerLeft","cornerRight","cornerWidth","cornerHeight"].reduce((function(e,t){return Y(Y({},e),{},{[t]:(n=t,"--".concat(s("ScrollArea".concat((r=n,r.charAt(0).toUpperCase()+r.slice(1))))))});var r;var n}),{});var B,M,j,W;(M=B||(B={})).Idle="Idle",M.Thumbing="Thumbing",M.Tracking="Tracking",M.ButtonScrolling="ButtonScrolling",(W=j||(j={}))[W.DeriveStateFromProps=0]="DeriveStateFromProps",W[W.HandleScrollAreaResize=1]="HandleScrollAreaResize",W[W.HandleViewportResize=2]="HandleViewportResize",W[W.HandleScrollbarResize=3]="HandleScrollbarResize",W[W.HandleTrackResize=4]="HandleTrackResize",W[W.SetContentOverflowing=5]="SetContentOverflowing",W[W.SetExplicitResize=6]="SetExplicitResize",W[W.StartTracking=7]="StartTracking",W[W.StopTracking=8]="StopTracking",W[W.StartThumbing=9]="StartThumbing",W[W.StopThumbing=10]="StopThumbing",W[W.StartButtonPress=11]="StartButtonPress",W[W.StopButtonPress=12]="StopButtonPress",W[W.SetScrollbarIsVisible=13]="SetScrollbarIsVisible";const D="ScrollArea",q={overflowX:"auto",overflowY:"auto",scrollbarVisibility:"hover",scrollbarVisibilityRestTimeout:600,dir:"ltr",trackClickBehavior:"relative",unstable_prefersReducedMotion:!1},[N,Q]=u("ScrollAreaRefsContext",D),[F,U]=u("ScrollAreaContext",D),G=e.createContext({});function J(){return e.useContext(G)}G.displayName="ScrollAreaStateContext";const K=e.createContext(!0),Z=()=>e.useContext(K),[$,ee]=u("DispatchContext",D);export const ScrollArea=e.forwardRef((function(r,n){const o=Y(Y({},q),r),{unstable_forceNative:i=!1,children:l}=o,s=H(o,["unstable_forceNative","children"]),[c,a]=e.useState(!0);m((()=>{a(i||!("ResizeObserver"in window&&function(){var e,r;if(!t())return!1;let n=!1;try{document.querySelector("::-webkit-scrollbar"),n=!0}catch(e){}return!(!(null===(e=window.CSS)||void 0===e||null===(r=e.supports)||void 0===r?void 0:r.call(e,"scrollbar-width: none"))&&!n)}()))}),[i]);const u=c?re:ie,d=e.useRef(null),f=e.useRef(null);return function(t,r,n){e.useImperativeHandle(t,(()=>{const e=r.current,t=n.current||e,o={scrollIntent(...e){t.scroll.call(t,...e)},scrollByIntent(...e){t.scrollBy.call(t,...e)},scrollIntoViewIntent(...e){t.scrollIntoView.call(t,...e)},scrollToIntent(...e){t.scrollTo.call(t,...e)},get scrollTopIntent(){return t.scrollTop},set scrollTopIntent(e){t.scrollTop=e},get scrollLeftIntent(){return t.scrollLeft},set scrollLeftIntent(e){t.scrollLeft=e},get scrollHeightIntent(){return t.scrollHeight},get scrollWidthIntent(){return t.scrollWidth},addScrollListener(...e){t.addEventListener("scroll",...e)},removeScrollListener(...e){t.removeEventListener("scroll",...e)}};return Object.assign(e,o)}))}(n,f,d),e.createElement(u,z({positionRef:d,scrollAreaRef:f},s,{ref:n}),e.createElement(K.Provider,{value:c},l))}));const te=e.forwardRef((function(t,r){const n=Y(Y({},q),t),{children:o}=n,i=H(n,["children"]),l=e.useRef(null),s=e.useRef(null);return e.createElement(ie,z({positionRef:l,scrollAreaRef:s},i,{ref:r}),e.createElement(K.Provider,{value:!1},o))})),re=e.forwardRef((function(t,r){const o=Y(Y({},q),t),{selector:i=n(D),overflowX:l,overflowY:s,scrollbarVisibility:a,scrollbarVisibilityRestTimeout:u,trackClickBehavior:d,unstable_prefersReducedMotion:f,scrollAreaRef:h,positionRef:m}=o,S=H(o,["selector","overflowX","overflowY","scrollbarVisibility","scrollbarVisibilityRestTimeout","trackClickBehavior","unstable_prefersReducedMotion","scrollAreaRef","positionRef"]),b=p(h,r);return e.createElement(c,z({},S,{selector:i,ref:b,style:Y(Y({},S.style),{},{overflowX:l,overflowY:s,resize:"none"})}))})),ne={width:0,height:0},oe={state:B.Idle,explicitResize:"initial",contentIsOverflowingX:!1,contentIsOverflowingY:!1,scrollbarIsVisibleX:!1,scrollbarIsVisibleY:!1,domSizes:{scrollArea:ne,viewport:ne,position:ne,scrollbarY:ne,scrollbarX:ne,trackY:ne,trackX:ne}},ie=e.forwardRef((function(t,r){const o=Y(Y({},q),t),{selector:i=n(D),children:l,onScroll:s,overflowX:u,overflowY:h,scrollbarVisibility:m,scrollbarVisibilityRestTimeout:b,trackClickBehavior:v,unstable_prefersReducedMotion:R,positionRef:w,scrollAreaRef:g}=o,x=H(o,["selector","children","onScroll","overflowX","overflowY","scrollbarVisibility","scrollbarVisibilityRestTimeout","trackClickBehavior","unstable_prefersReducedMotion","positionRef","scrollAreaRef"]),y=f(s),E=e.useRef(null),P=e.useRef(null),A=e.useRef(null),O=e.useRef(null),T=e.useRef(null),L=e.useRef(null),I=e.useRef(null),C=e.useRef(null),_=e.useRef(null),X=e.useRef(null),V=e.useRef(null),B=e.useMemo((()=>({buttonDownRef:E,buttonLeftRef:P,buttonRightRef:A,buttonUpRef:O,viewportRef:T,positionRef:w,scrollAreaRef:g,scrollbarXRef:L,scrollbarYRef:I,thumbXRef:C,thumbYRef:_,trackXRef:X,trackYRef:V})),[]),M=S(g),W=null!=R?R:M,[Q,U]=e.useReducer(we,Y(Y({},oe),{},{scrollbarIsVisibleX:"always"===m,scrollbarIsVisibleY:"always"===m})),{hoverProps:{onPointerEnter:J,onPointerLeave:K},isHovered:Z}=k(),ee=e.useMemo((()=>({dir:t.dir,isHovered:Z,onScroll:y,overflowX:u,overflowY:h,prefersReducedMotion:W,scrollbarVisibility:m,scrollbarVisibilityRestTimeout:b,trackClickBehavior:v})),[t.dir,y,Z,u,h,W,m,b,v]),te=p(r,g);ge(g,((e,t)=>{const{ownerWindow:r}=d(g),n=r.getComputedStyle(t);U({type:j.HandleScrollAreaResize,scrollAreaComputedStyle:n,width:e.inlineSize,height:e.blockSize})}));const re="always"===m&&("scroll"===u||"auto"===u&&Q.contentIsOverflowingX),ne="always"===m&&("scroll"===h||"auto"===h&&Q.contentIsOverflowingY),{domSizes:ie}=Q,le={[SCROLL_AREA_CSS_PROPS.scrollbarXOffset]:re&&ie.scrollbarX.height?ie.scrollbarX.height+"px":0,[SCROLL_AREA_CSS_PROPS.scrollbarYOffset]:ne&&ie.scrollbarY.width?ie.scrollbarY.width+"px":0,[SCROLL_AREA_CSS_PROPS.positionWidth]:ie.position.width?ie.position.width+"px":"auto",[SCROLL_AREA_CSS_PROPS.positionHeight]:ie.position.height?ie.position.height+"px":"auto"};return e.createElement($.Provider,{value:U},e.createElement(N.Provider,{value:B},e.createElement(F.Provider,{value:ee},e.createElement(G.Provider,{value:Q},e.createElement(c,z({},x,{selector:i,ref:te,style:Y(Y({},x.style),le),onPointerEnter:a(t.onPointerEnter,J),onPointerLeave:a(t.onPointerLeave,K)}),l)))))})),le="ScrollAreaViewport",se=e.forwardRef((function(t,r){const{selector:i=n(le)}=t,l=H(t,["selector"]),{positionRef:s,thumbXRef:u,thumbYRef:d,trackXRef:f,trackYRef:h,viewportRef:S}=Q(le),{onScroll:b,overflowX:v,overflowY:R,scrollbarVisibility:w}=U(le),g=J(),x=ee(le),y=p(r,S);ge(S,(e=>{x({type:j.HandleViewportResize,width:e.inlineSize,height:e.blockSize})}));const E=e.useCallback((function(){const e=s.current,t=u.current,r=d.current,n=f.current,o=h.current;t&&n&&e&&Ze({thumbElement:t,trackElement:n,axis:"x",positionElement:e}),r&&o&&e&&Ze({thumbElement:r,trackElement:o,axis:"y",positionElement:e})}),[s,u,d,f,h]),P=e.useRef(0),A=e.useRef(0);const O=a(b,(function(){s.current&&(E(),function(){if(!s.current)return;const e=s.current.scrollTop,t=s.current.scrollLeft,r=e!==P.current,n=t!==A.current;r===g.scrollbarIsVisibleY&&n===g.scrollbarIsVisibleX||x({type:j.SetScrollbarIsVisible,scrollbarVisibility:w,x:n,y:r}),P.current=e<=0?0:e,A.current=t<=0?0:t}())}));return m((()=>{E()}),[E]),m((function(){const e=s.current;if(!e)return;const t=Je(e,{axis:"x"}),r=Je(e,{axis:"y"});t===g.contentIsOverflowingX&&r===g.contentIsOverflowingY||x({type:j.SetContentOverflowing,x:t,y:r})}),[g.contentIsOverflowingX,g.contentIsOverflowingY,x,s,g.domSizes.position.height,g.domSizes.position.width,g.domSizes.viewport.height,g.domSizes.viewport.width]),e.createElement("div",z({},i?o(i+"-position"):void 0,{ref:s,onScroll:O,style:{zIndex:1,width:"var(".concat(SCROLL_AREA_CSS_PROPS.positionWidth,")"),height:"var(".concat(SCROLL_AREA_CSS_PROPS.positionHeight,")"),scrollbarWidth:"none",overflowScrolling:"touch",resize:"none",overflowX:v,overflowY:R}}),e.createElement("div",z({},i?o(i+"-position-inner"):void 0,{style:{display:"table",width:"100%",paddingBottom:"var(".concat(SCROLL_AREA_CSS_PROPS.scrollbarXOffset,")"),paddingRight:"var(".concat(SCROLL_AREA_CSS_PROPS.scrollbarYOffset,")")}}),e.createElement(c,z({selector:i},l,{ref:y}))))}));export const ScrollAreaViewport=e.forwardRef((function(t,r){return Z()?e.createElement(c,z({},t,{selector:t.selector||n(le),ref:r})):e.createElement(se,z({},t,{ref:r}))}));ScrollAreaViewport.displayName=le;const ce="ScrollAreaScrollbarX",ae="ScrollAreaScrollbarY",[ue,de]=u("ScrollbarContext","ScrollAreaScrollbar"),fe=e.forwardRef((function(t,r){var n;const{axis:o,name:i,onWheel:l,onPointerDown:s,onPointerUp:u,onPointerMove:d}=t,f=H(t,["axis","name","onWheel","onPointerDown","onPointerUp","onPointerMove"]),m=ee(i),{scrollbarVisibility:S,scrollbarVisibilityRestTimeout:b,isHovered:v}=U(i),{["x"===o?"contentIsOverflowingX":"contentIsOverflowingY"]:R,["x"===o?"scrollbarIsVisibleX":"scrollbarIsVisibleY"]:w}=J(),g=Q(i),{positionRef:x}=g,y=function(e,t){return"x"===e?t.scrollbarXRef:t.scrollbarYRef}(o,g),E=p(y,r),P=h((()=>new T));ge(y,(e=>{m({type:j.HandleScrollbarResize,width:e.inlineSize,height:e.blockSize,axis:o})}));const A=a(l,(function(e){const t=Math.abs(e.deltaX),r=Math.abs(e.deltaY);x.current&&(t>0&&t>r&&(x.current.scrollLeft+=e.deltaX),r>0&&r>t&&(x.current.scrollTop+=e.deltaY))})),O=e.useRef();function L(){clearTimeout(O.current),O.current=setTimeout((()=>{m({type:j.SetScrollbarIsVisible,scrollbarVisibility:S,[o]:!1})}),b)}e.useEffect((()=>{if(w)return O.current=setTimeout((()=>{m({type:j.SetScrollbarIsVisible,scrollbarVisibility:S,[o]:!1})}),b),function(){clearTimeout(O.current)}}),[o,m,w,S,b]);const I=e.useRef(!1),C=a(s,(e=>{I.current=!0,clearTimeout(O.current)})),_=a(u,(e=>{I.current=!1,L()})),k=a(d,(e=>{I.current||L()})),X=function(){var e,t;const r=(null===(e=f.style)||void 0===e?void 0:e.opacity)||1;switch(S){case"always":return null===(t=f.style)||void 0===t?void 0:t.opacity;case"scroll":return w?r:0;case"hover":return v||w?r:0}}(),V=function(){var e,t;const r=(null===(e=f.style)||void 0===e?void 0:e.pointerEvents)||"auto";switch(S){case"always":return null===(t=f.style)||void 0===t?void 0:t.pointerEvents;case"scroll":return w?r:"none";case"hover":return v||w?r:"none"}}(),B=e.useMemo((()=>({axis:o,scrollAnimationQueue:P})),[o,P]);return e.createElement(ue.Provider,{value:B},e.createElement(c,z({},f,{ref:E,style:Y(Y({},f.style),{},{display:R?null===(n=f.style)||void 0===n?void 0:n.display:"none",opacity:X,pointerEvents:V}),onPointerDown:C,onPointerUp:_,onPointerMove:k,onWheel:A})))}));export const ScrollAreaScrollbarX=e.forwardRef((function(t,r){const{selector:o=n(ce)}=t,i=H(t,["selector"]),{domSizes:l}=J();return Z()?null:e.createElement(fe,z({},i,{selector:o,ref:r,axis:"x",name:ce,style:Y(Y({},t.style),{},{[SCROLL_AREA_CSS_PROPS.scrollbarXSize]:l.scrollbarX.height?l.scrollbarX.height+"px":0})}))}));ScrollAreaScrollbarX.displayName=ce;export const ScrollAreaScrollbarY=e.forwardRef((function(t,r){const{selector:o=n(ae)}=t,i=H(t,["selector"]),{domSizes:l}=J();return Z()?null:e.createElement(fe,z({},i,{selector:o,ref:r,axis:"y",name:ae,style:Y(Y({},t.style),{},{[SCROLL_AREA_CSS_PROPS.scrollbarYSize]:l.scrollbarY.width?l.scrollbarY.width+"px":0})}))}));ScrollAreaScrollbarY.displayName=ae;const pe="ScrollAreaTrack";export const ScrollAreaTrack=e.forwardRef((function(t,o){const{selector:i=n(pe),onPointerDown:s}=t,u=H(t,["selector","onPointerDown"]),{axis:h,scrollAnimationQueue:m}=de(pe),S=ee(pe),b=Q(pe),{trackClickBehavior:v,prefersReducedMotion:R}=U(pe),{positionRef:w}=b,g=Ae(h,b),x=Pe(h,b),y=p(g,o),P=f(s);ge(g,(e=>{S({type:j.HandleTrackResize,width:e.inlineSize,height:e.blockSize,axis:h})}));const A=e.useRef();return e.useEffect((()=>{let e=null,t=null;const n=Te(g),o=Le(x),i=Ie(w),{ownerDocument:s}=d(w),c=a(P,(function(c){if(!l(c)||c.target===o||o.contains(c.target))return;const a=function({event:e,axis:t,thumbElement:r}){const{[t]:n}=Be(e);return n<r.getBoundingClientRect()["y"===t?"top":"left"]?"start":"end"}({event:c,axis:h,thumbElement:o});if(clearTimeout(t),"page"===v){if(S({type:j.StartTracking}),s.addEventListener("pointermove",u),s.addEventListener("pointerup",f),n.setPointerCapture(c.pointerId),R){const e=_e({direction:a,positionElement:i,axis:h}),t=Fe(i,{direction:a,distance:e,axis:h});Xe(i,{axis:h,value:t})}else m.enqueue((()=>xe({duration:200,timing:E(.16,0,.73,1),draw:ye({positionElement:i,direction:a,axis:h}),rafIdRef:A})));return e=setTimeout((()=>{const t=Be(c),o=Ce({axis:h,direction:a,pointerPosition:t,positionElement:i,trackElement:n});if(!("start"===a&&o>0||"end"===a&&o<0)){if(R){const e=Fe(i,{direction:a,distance:o,axis:h});Xe(i,{axis:h,value:e})}else{const e=Math.round(Math.abs(o)),l=r(e,[100,500]);m.enqueue((()=>xe({duration:l,timing:e=>e,draw:Ee({axis:h,direction:a,pointerPosition:t,positionElement:i,trackElement:n}),rafIdRef:A})))}clearTimeout(e)}}),400),function(){clearTimeout(e)}}{const e=Be(c),t=Ce({axis:h,direction:a,pointerPosition:e,positionElement:i,trackElement:n}),r=Fe(i,{direction:a,distance:t,axis:h});Xe(i,{axis:h,value:r});const l=new PointerEvent("pointerdown",c);requestAnimationFrame((()=>{o.dispatchEvent(l)}))}}));return n.addEventListener("pointerdown",c),function(){cancelAnimationFrame(A.current),clearTimeout(e),clearTimeout(t),n.removeEventListener("pointerdown",c),s.removeEventListener("pointermove",u),s.removeEventListener("pointerup",f),S({type:j.StopTracking}),m.stop()};function u(t){"mouse"===t.pointerType&&Ge(t,n)&&(clearTimeout(e),s.removeEventListener("pointermove",u),m.stop())}function f(r){n.releasePointerCapture(r.pointerId),clearTimeout(e),s.removeEventListener("pointermove",u),s.removeEventListener("pointerup",f),m.stop(),S({type:j.StopTracking}),t=setTimeout((()=>{m.stop()}),200)}}),[h,R,v,S,P,w,m,x,g]),e.createElement(c,z({},u,{selector:i,ref:y,"data-axis":h}))}));ScrollAreaTrack.displayName=pe;const he="ScrollAreaThumb";export const ScrollAreaThumb=e.forwardRef((function(t,r){const{selector:o=n(he),onPointerDown:i}=t,s=H(t,["selector","onPointerDown"]),{axis:u}=de(he),h=Q(he),S=ee(he),{positionRef:b}=h,v=Pe(u,h),R=Ae(u,h),w=p(v,r),g=J(),x=f(i),y=e.useRef(0),E=e.useRef(0),P=e.useRef({size:0,positionStart:0}),A=e.useRef({size:0,positionStart:0}),O=e.useRef(!1);m((()=>{if(!O.current)return void(O.current=!0);Ze({thumbElement:Le(v),trackElement:Te(R),positionElement:Ie(b),axis:u})}),[v,R,b,u,...Ue(g.domSizes)]);const T="x"===u?g.domSizes.trackX.width:g.domSizes.trackY.height,L=e.useRef(T);m((()=>{L.current=T})),e.useEffect((()=>{const e=Le(v),t=Te(R),r=Ie(b),{ownerDocument:n}=d(b),o=a(x,(function(r){if(!l(r))return;const o=Be(r)[u];P.current=He(e,{axis:u}),A.current=He(t,{axis:u}),E.current=o,y.current=o,e.setPointerCapture(r.pointerId),n.addEventListener("pointerup",c),n.addEventListener("pointermove",s),S({type:j.StartThumbing})}));return e.addEventListener("pointerdown",o),function(){e.removeEventListener("pointerdown",o),i()};function i(){n.removeEventListener("pointermove",s),n.removeEventListener("pointerup",c),S({type:j.StopThumbing})}function s(e){const t=Be(e)[u],n=t-E.current,o=L.current;if(Ke(r,{axis:u,delta:n})){const{positionStart:e}=A.current,{positionStart:n}=P.current,i=y.current-n,l=Math.round(t-e),s=Math.round((l-i)/o*100)/100,c=Ve(r,{axis:u});Xe(r,{axis:u,value:s*c}),E.current=t,S({type:j.StartThumbing})}}function c(t){e.releasePointerCapture(t.pointerId),i()}}),[u,x,S,b,h,v,R]);const[I,C]=e.useState({});return m((()=>{const e=b.current,t=R.current;C(function(e){const{trackElement:t,positionElement:r,axis:n}=e;if(!t||!r)return{};const o=ke(r,{axis:n}),i=Ye(t,{axis:n}),l=o*i;if(!Je(r,{axis:n}))return{display:"none",width:0,height:0};return{["x"===n?"width":"height"]:l}}({positionElement:e,trackElement:t,axis:u}))}),[u,b,R,...Ue(g.domSizes)]),e.createElement(c,z({},s,{selector:o,ref:w,"data-axis":u,style:Y(Y(Y({},s.style),I),"x"===u?{[SCROLL_AREA_CSS_PROPS.scrollbarThumbWillChange]:"left",[SCROLL_AREA_CSS_PROPS.scrollbarThumbHeight]:"100%",[SCROLL_AREA_CSS_PROPS.scrollbarThumbWidth]:"auto"}:{[SCROLL_AREA_CSS_PROPS.scrollbarThumbWillChange]:"top",[SCROLL_AREA_CSS_PROPS.scrollbarThumbHeight]:"auto",[SCROLL_AREA_CSS_PROPS.scrollbarThumbWidth]:"100%"})}))}));ScrollAreaThumb.displayName=he;const me="ScrollAreaButtonStart",Se="ScrollAreaButtonEnd",be=e.forwardRef((function(t,r){const{direction:n,name:o,onPointerDown:i}=t,s=H(t,["direction","name","onPointerDown"]),{axis:u,scrollAnimationQueue:h}=de(o),m=ee(o),S=Q(o),{prefersReducedMotion:b}=U(o),{positionRef:v}=S,R=function(e,t,r){switch(function(e,t){if("start"===e)return"x"===t?"left":"up";return"x"===t?"right":"down"}(e,t)){case"down":return r.buttonDownRef;case"up":return r.buttonUpRef;case"left":return r.buttonLeftRef;case"right":return r.buttonRightRef}}(n,u,S),w=p(R,r),g=e.useRef(),x=f(i);return e.useEffect((()=>{const e=function(e,t){const r="end"===t?Se:me;return Oe(e,"A ref for ".concat(r," was not placed as expected. ").concat(r," should always be used within a ").concat(D," component, and it should not be rendered conditionally."))}(R,n),t=Ie(v),{ownerDocument:r}=d(v);let o,i=null;const s=a(x,(function(s){if(!l(s))return;e.setPointerCapture(s.pointerId),r.addEventListener("pointerup",f),r.addEventListener("pointermove",c),m({type:j.StartButtonPress});const a="start"===n?-1:1;b?Me(t,{axis:u,value:51*a}):Ke(t,{axis:u,delta:a})&&h.enqueue((()=>xe({duration:135,timing:E(.16,0,.73,1),draw(e){Me(t,{axis:u,value:15*e*a})},rafIdRef:g}))),o=setTimeout((()=>{if(b)i=setInterval((()=>{Ke(t,{axis:u,delta:a})?Me(t,{axis:u,value:60*a}):clearInterval(i)}),135);else{const r=s.pointerId;!function n(){Ke(t,{axis:u,delta:a})&&h.enqueue((()=>xe({duration:135,timing:e=>e,draw(e){Me(t,{axis:u,value:e*(15*a)})},done:e.hasPointerCapture(r)?n:void 0,rafIdRef:g})))}()}clearTimeout(o)}),400)}));return e.addEventListener("pointerdown",s),function(){e.removeEventListener("pointerdown",s),r.removeEventListener("pointerup",f),r.removeEventListener("pointermove",c),clearTimeout(o),clearInterval(i),cancelAnimationFrame(g.current),m({type:j.StopButtonPress})};function c(t){"mouse"===t.pointerType&&Ge(t,e)&&(clearTimeout(o),r.removeEventListener("pointermove",c))}function f(t){clearTimeout(o),clearInterval(i),e.releasePointerCapture(t.pointerId),e.removeEventListener("pointerup",f),m({type:j.StopButtonPress})}}),[u,n,b,R,m,x,h,v]),e.createElement(c,z({},s,{ref:w,"data-axis":u}))}));export const ScrollAreaButtonStart=e.forwardRef((function(t,r){const{selector:o=n(me)}=t,i=H(t,["selector"]);return e.createElement(be,z({},i,{selector:o,ref:r,name:me,direction:"start"}))}));ScrollAreaButtonStart.displayName=me;export const ScrollAreaButtonEnd=e.forwardRef((function(t,r){const{selector:o=n(Se)}=t,i=H(t,["selector"]);return e.createElement(be,z({},i,{selector:o,ref:r,name:Se,direction:"end"}))}));ScrollAreaButtonEnd.displayName=Se;const ve="ScrollAreaCorner",Re=e.forwardRef((function(t,r){const{selector:o=n(ve)}=t,i=H(t,["selector"]),{positionRef:l}=Q(ve),s=ee(ve),{dir:a}=U(ve),{domSizes:u}=J(),f="rtl"===a,p={[SCROLL_AREA_CSS_PROPS.cornerLeft]:f?0:"unset",[SCROLL_AREA_CSS_PROPS.cornerRight]:f?"unset":0,[SCROLL_AREA_CSS_PROPS.cornerHeight]:u.scrollbarX.height?u.scrollbarX.height+"px":u.scrollbarY.width?u.scrollbarY.width+"px":"16px",[SCROLL_AREA_CSS_PROPS.cornerWidth]:u.scrollbarY.width?u.scrollbarY.width+"px":u.scrollbarX.height?u.scrollbarX.height+"px":"16px",position:"absolute"};return m((()=>{if(l.current){const{ownerWindow:e}=d(l),t=e.getComputedStyle(l.current);s({type:j.SetExplicitResize,value:t.resize})}}),[s,l]),e.createElement(c,z({},i,{selector:o,ref:r,style:Y(Y({},t.style),p)}))}));export const ScrollAreaCorner=e.forwardRef((function(t,r){return Z()?null:e.createElement(Re,z({},t,{ref:r}))}));ScrollAreaCorner.displayName=ve;export const Root=ScrollArea;export const Viewport=ScrollAreaViewport;export const ScrollbarX=ScrollAreaScrollbarX;export const ScrollbarY=ScrollAreaScrollbarY;export const ButtonStart=ScrollAreaButtonStart;export const ButtonEnd=ScrollAreaButtonEnd;export const Track=ScrollAreaTrack;export const Thumb=ScrollAreaThumb;export const Corner=ScrollAreaCorner;export const unstable_ScrollAreaNoNativeFallback=te;function we(e,t){switch(t.type){case j.SetExplicitResize:return Y(Y({},e),{},{explicitResize:t.value});case j.HandleScrollAreaResize:{const r=t.scrollAreaComputedStyle,n=parseInt(r.borderTopWidth),o=parseInt(r.borderRightWidth),i=parseInt(r.borderBottomWidth),l=parseInt(r.borderLeftWidth),s=parseInt(r.paddingTop),c=parseInt(r.paddingRight),a=parseInt(r.paddingBottom),u=parseInt(r.paddingLeft);return Y(Y({},e),{},{domSizes:Y(Y({},e.domSizes),{},{scrollArea:{width:t.width,height:t.height},position:{width:t.width-l-o-u-c,height:t.height-n-i-s-a}})})}case j.SetContentOverflowing:return Y(Y({},e),{},{contentIsOverflowingX:t.x,contentIsOverflowingY:t.y});case j.SetScrollbarIsVisible:var r,n;return"always"===t.scrollbarVisibility?Y(Y({},e),{},{scrollbarIsVisibleX:!0,scrollbarIsVisibleY:!0}):Y(Y({},e),{},{scrollbarIsVisibleX:null!==(r=t.x)&&void 0!==r?r:e.scrollbarIsVisibleX,scrollbarIsVisibleY:null!==(n=t.y)&&void 0!==n?n:e.scrollbarIsVisibleY});case j.HandleViewportResize:return Y(Y({},e),{},{domSizes:Y(Y({},e.domSizes),{},{viewport:{width:t.width,height:t.height}})});case j.HandleScrollbarResize:return Y(Y({},e),{},{domSizes:Y(Y({},e.domSizes),{},{["x"===t.axis?"scrollbarX":"scrollbarY"]:{height:t.height,width:t.width}})});case j.HandleTrackResize:return Y(Y({},e),{},{domSizes:Y(Y({},e.domSizes),{},{["x"===t.axis?"trackX":"trackY"]:{height:t.height,width:t.width}})});case j.StartTracking:return Y(Y({},e),{},{state:B.Tracking});case j.StopTracking:return Y(Y({},e),{},{state:B.Idle});case j.StartThumbing:return Y(Y({},e),{},{state:B.Thumbing});case j.StopThumbing:return Y(Y({},e),{},{state:B.Idle});case j.StartButtonPress:return Y(Y({},e),{},{state:B.ButtonScrolling});case j.StopButtonPress:return Y(Y({},e),{},{state:B.Idle})}return e}function ge(e,t){const r=f(t);m((()=>{var t;const n=e.current;if(!n)return;const o=new ResizeObserver((([e])=>{const t=i(e);r(t,e.target)})),l=n.getBoundingClientRect();return r({inlineSize:l.width,blockSize:l.height},n),null===(t=o.observe)||void 0===t||t.call(o,n),function(){o.disconnect()}}),[r,e])}function xe({duration:e,draw:t,timing:n,done:o,rafIdRef:i}){return new Promise((l=>{let s=performance.now(),c=!1;i.current=requestAnimationFrame((function a(u){s=u<s?u:s;const d=r((u-s)/e,[0,1]);t(n(d)),d<1?!c&&(i.current=requestAnimationFrame(a)):(c=!0,cancelAnimationFrame(i.current),l("done"),o&&o())}))}))}function ye({axis:e,direction:t,positionElement:r}){let n=_e({axis:e,direction:t,positionElement:r});return function(o){const i=n*Math.min(o,1),l=Fe(r,{direction:t,distance:i,axis:e});n-=i,Xe(r,{axis:e,value:l})}}function Ee({axis:e,direction:t,pointerPosition:r,positionElement:n,trackElement:o}){let i=Ce({axis:e,direction:t,pointerPosition:r,positionElement:n,trackElement:o});return function(r){const o=Math.pow(10,3),l=Math.round(i*Math.min(r,1)*o)/o,s=Fe(n,{direction:t,distance:l,axis:e});i-=l,Xe(n,{axis:e,value:s})}}function Pe(e,t){return"x"===e?t.thumbXRef:t.thumbYRef}function Ae(e,t){return"x"===e?t.trackXRef:t.trackYRef}function Oe(e,t){const{current:r}=e;return function(e,t){if(null==e)throw new Error(t)}(r,t),r}function Te(e){return Oe(e,"A ref for ".concat(pe," was not placed as expected. ").concat(pe," should always be used within a ").concat(D," component, and it should not be rendered conditionally."))}function Le(e){return Oe(e,"A ref for ".concat(he," was not placed as expected. ").concat(he," should always be used within a ").concat(D," component, and it should not be rendered conditionally."))}function Ie(e){return Oe(e,"A ref for an internal component in ".concat(le," was not placed as expected. ").concat(le," should always be used within a ").concat(D," component, and it should not be rendered conditionally."))}function Ce({axis:e,direction:t,pointerPosition:r,positionElement:n,trackElement:o}){const i=ze(n,{axis:e}),l=Ve(n,{axis:e}),s=Ye(n,{axis:e}),{positionStart:c,size:a}=He(o,{axis:e}),u=Math.round(r[e]-c),d=Math.round(u/a*100)/100,f="start"===t?d*l:d*l-s;return f<i?f-i-s/2:f-i+s/2}function _e({axis:e,direction:t,positionElement:r}){return(Ye(r,{axis:e})-40)*("end"===t?1:-1)}function ke(e,{axis:t}){const r=Ve(e,{axis:t});return Ye(e,{axis:t})/r}function ze(e,{axis:t}){return e["x"===t?"scrollLeft":"scrollTop"]}function Xe(e,{axis:t,value:r}){e["x"===t?"scrollLeft":"scrollTop"]=r}function Ye(e,{axis:t}){return e["x"===t?"clientWidth":"clientHeight"]}function Ve(e,{axis:t}){return e["x"===t?"scrollWidth":"scrollHeight"]}function He(e,{axis:t}){const{[t]:r,["y"===t?"top":"left"]:n,["y"===t?"bottom":"right"]:o,["y"===t?"height":"width"]:i}=e.getBoundingClientRect();return{coord:r,positionStart:n,positionEnd:o,size:i}}function Be(e){return{x:e.clientX,y:e.clientY}}function Me(e,{axis:t,value:r}){e["x"===t?"scrollLeft":"scrollTop"]+=r}function je(e){return!(!e||0!==e.scrollTop)}function We(e){return!(!e||e.scrollLeft!==Qe(e))}function De(e){return!(!e||e.scrollTop!==Ne(e))}function qe(e){return!(!e||0!==e.scrollLeft)}function Ne(e){return e.scrollHeight-e.clientHeight}function Qe(e){return e.scrollWidth-e.clientWidth}function Fe(e,{direction:t,distance:r,axis:n}){const{["x"===n?"scrollLeft":"scrollTop"]:o}=e,i=o+r,l="end"===t?function(e,t){return"x"===t?Qe(e):Ne(e)}(e,n):0;return"end"===t?Math.min(l,i):Math.max(l,i)}function Ue(e){const t=[];for(const r of Object.keys(e)){const n=e[r];t.push(n.height,n.width)}return t}function Ge(e,t,r){r=r||t.getBoundingClientRect();const n=Be(e);return n.x<r.left||n.x>r.right||n.y<r.top||n.y>r.bottom}function Je(e,{axis:t}){return ke(e,{axis:t})<1}function Ke(e,{axis:t,delta:r}){return!(0===r||r<0&&("x"===t?qe:je)(e)||r>0&&("x"===t?We:De)(e))}function Ze(e){const{thumbElement:t,positionElement:r,axis:n}=e,o=Ve(r,{axis:n}),i=Ye(r,{axis:n}),l=ze(r,{axis:n})/o;i/o>=1||("x"===n?t.style.left="".concat(100*l,"%"):"y"===n&&(t.style.top="".concat(100*l,"%")))}
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-scroll-area",
"version": "0.0.2",
"version": "0.0.3",
"license": "MIT",

@@ -15,12 +15,10 @@ "source": "src/index.ts",

"scripts": {
"build": "parcel build src/index.ts --no-cache",
"clean": "rm -rf dist",
"version": "yarn version",
"prepublish": "yarn clean && yarn build"
"prepublish": "yarn clean"
},
"dependencies": {
"@radix-ui/react-polymorphic": "0.0.2",
"@radix-ui/react-primitive": "0.0.1",
"@radix-ui/react-utils": "0.0.2",
"@radix-ui/utils": "0.0.2"
"@radix-ui/react-polymorphic": "0.0.3",
"@radix-ui/react-primitive": "0.0.2",
"@radix-ui/react-utils": "0.0.3",
"@radix-ui/utils": "0.0.3"
},

@@ -27,0 +25,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc