@ehfuse/overlay-scrollbar 1.6.12 → 1.6.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var De=Object.defineProperty;var gt=Object.getOwnPropertyDescriptor;var vt=Object.getOwnPropertyNames;var yt=Object.prototype.hasOwnProperty;var xt=(v,y)=>{for(var E in y)De(v,E,{get:y[E],enumerable:!0})},wt=(v,y,E,C)=>{if(y&&typeof y=="object"||typeof y=="function")for(let T of vt(y))!yt.call(v,T)&&T!==E&&De(v,T,{get:()=>y[T],enumerable:!(C=gt(y,T))||C.enumerable});return v};var Tt=v=>wt(De({},"__esModule",{value:!0}),v);var Rt={};xt(Rt,{OverlayScrollbar:()=>ke,default:()=>ke});module.exports=Tt(Rt);var t=require("react");var Mt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],Le=(v,y)=>{let E=v.tagName.toLowerCase(),C=["text","password","email","number","search","tel","url","checkbox","radio"];if(E==="input"){let T=v.type;return C.includes(T)}if(["textarea","select","button"].includes(E)||["svg","path","circle","rect","line","polygon","polyline"].includes(E)||v.getAttribute("contenteditable")==="true")return!0;if(y?.excludeSelectors){for(let T of y.excludeSelectors)if(v.matches(T))return!0}return St(v,y)},St=(v,y)=>{let E=[...Mt,...y?.excludeClasses||[]],C=v,T=0,z=5;for(;C&&T<=z;){if(E.some(H=>C.classList.contains(H)))return!0;if(C.classList.contains("MuiDialogContent-root"))break;C=C.parentElement,T++}return!1};var S=require("react/jsx-runtime"),Et={},Ct={},Ht={},Dt={},Lt={},kt=(0,t.forwardRef)(({className:v="",style:y={},containerStyle:E={},contentStyle:C={},children:T,onScroll:z,thumb:H=Et,track:k=Ct,arrows:N=Ht,dragScroll:J=Dt,autoHide:_=Lt,showScrollbar:K=!0,detectInnerScroll:qe=!1},Xe)=>{let Ye=(0,t.useRef)({});(0,t.useEffect)(()=>{Ye.current={children:T,onScroll:z,showScrollbar:K,thumb:H,track:k,arrows:N,dragScroll:J,autoHide:_}});let se=(0,t.useRef)(null),c=(0,t.useRef)(null),B=(0,t.useRef)(null),X=(0,t.useRef)(null),Ge=(0,t.useRef)(null),I=(0,t.useRef)(null),[ee,x]=(0,t.useState)(!1),[A,Re]=(0,t.useState)(!1),[Ie,Ae]=(0,t.useState)(!1),[ue,Je]=(0,t.useState)({y:0,scrollTop:0}),[Z,Ke]=(0,t.useState)(0),[Ze,Oe]=(0,t.useState)(0),[Y,We]=(0,t.useState)(!1),[$e,ze]=(0,t.useState)(!1),[O,Ne]=(0,t.useState)(!1),[de,je]=(0,t.useState)({x:0,scrollLeft:0}),[pe,Ve]=(0,t.useState)(0),[me,Qe]=(0,t.useState)(0),[et,he]=(0,t.useState)(!1),[P,fe]=(0,t.useState)(!1),[W,Pe]=(0,t.useState)(!1),[j,tt]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[It,At]=(0,t.useState)(null),[te,oe]=(0,t.useState)(null),[Ot,ot]=(0,t.useState)(!1),[rt,nt]=(0,t.useState)(0),V=(0,t.useRef)(null),[Fe,_e]=(0,t.useState)(!1),Q=(0,t.useRef)(null),U=(0,t.useRef)(null),q=(0,t.useRef)(null),b=(0,t.useMemo)(()=>{let e=H.color??"#606060";return{width:H.width??8,minHeight:H.minHeight??50,radius:H.radius??(H.width??8)/2,color:e,opacity:H.opacity??.6,hoverColor:H.hoverColor??e,hoverOpacity:H.hoverOpacity??1}},[H]),n=(0,t.useMemo)(()=>({width:k.width??16,color:k.color??"rgba(128, 128, 128, 0.1)",visible:k.visible??!0,alignment:k.alignment??"default",radius:k.radius??b.radius??4,margin:k.margin??4,overflowX:k.overflowX??!0,overflowY:k.overflowY??!0}),[k,b.radius]),R=(0,t.useMemo)(()=>{let e=N.color??"#808080";return{visible:N.visible??!1,step:N.step??50,color:e,opacity:N.opacity??.6,hoverColor:N.hoverColor??e,hoverOpacity:N.hoverOpacity??1}},[N]),be=(0,t.useMemo)(()=>({enabled:J.enabled??!0,excludeClasses:J.excludeClasses??[],excludeSelectors:J.excludeSelectors??[]}),[J]),i=(0,t.useMemo)(()=>({enabled:_.enabled??!0,delay:_.delay??1500,delayOnWheel:_.delayOnWheel??700,initialDelay:_.initialDelay??200}),[_]),[G,lt]=(0,t.useState)(()=>(_.initialDelay??200)>0),h=b.width,it=n.width,ge=b.minHeight,$=R.visible,re=R.step,D=(0,t.useCallback)(()=>{if(!c.current)return;let e=document.activeElement;e&&c.current.contains(e)&&e!==c.current||c.current.focus()},[]);(0,t.useImperativeHandle)(Xe,()=>({getScrollContainer:()=>c.current,scrollTo:e=>{c.current&&c.current.scrollTo(e)},get scrollTop(){return c.current?.scrollTop||0},get scrollHeight(){return c.current?.scrollHeight||0},get clientHeight(){return c.current?.clientHeight||0}}),[]);let d=(0,t.useCallback)(()=>{if(I.current){let o=I.current;if(document.contains(o)&&o.scrollHeight>o.clientHeight+2)return o;I.current=null}if(!c.current)return null;if(B.current&&B.current.scrollHeight>c.current.clientHeight+2)return I.current=c.current,c.current;if(!qe)return null;let e=c.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let r=o;if(r!==c.current&&r.classList.contains("overlay-scrollbar-container"))continue;let s=r.parentElement,l=!1;for(;s&&s!==c.current;){if(s.classList.contains("overlay-scrollbar-container")&&s!==c.current){l=!0;break}s=s.parentElement}if(!l&&r.scrollHeight>r.clientHeight+2)return I.current=r,r}return null},[]),F=(0,t.useCallback)(()=>d()!==null,[d]),f=(0,t.useCallback)(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),ne=(0,t.useCallback)(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),Be=(0,t.useCallback)(()=>{q.current&&(clearTimeout(q.current),q.current=null)},[]),at=(0,t.useCallback)(()=>{ne(),!(A||O||W||P)&&(f(),x(!1))},[f,ne,A,O,W,P]),m=(0,t.useCallback)(e=>{i.enabled&&(f(),Q.current=setTimeout(()=>{x(!1),Q.current=null},e))},[f,i.enabled]),u=(0,t.useCallback)(()=>{let e=d();if(!e){x(!1),We(!1),he(!1),f();return}if(We(!0),!X.current)return;!i.enabled&&!G&&(x(!0),f());let o=e.clientHeight,r=e.scrollHeight,s=e.scrollTop,l=e.clientWidth,a=e.scrollWidth,w=e.scrollLeft,g=0,p=0;if(se.current){let ae=window.getComputedStyle(se.current),ce=parseFloat(ae.paddingTop)||0;p=parseFloat(ae.paddingBottom)||0,g=ce+p,nt(p)}let le=$?h*2+n.margin*4:n.margin*2,L=o-le+g,Se=o/r,ie=Math.max(L*Se,ge),Ee=r-o,Ue=L-ie,Ce=Ee>0?s/Ee*Ue:0;Ke(ie),Oe(Ce);let He=a-l;if(He>0){he(!0);let ae=l/a,ce=Math.max(l*ae,50),ft=l-ce,bt=He>0?w/He*ft:0;Ve(ce),Qe(bt)}else he(!1)},[d,f,$,h,ge,i.enabled,G]),ct=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(Re(!0),Je({y:e.clientY,scrollTop:o.scrollTop}),f(),x(!0),D())},[d,f,D]),ve=(0,t.useCallback)(e=>{if(!A)return;let o=d();if(!o)return;let r=o.clientHeight,l=o.scrollHeight-r,a=e.clientY-ue.y,w=r-Z,g=a/w*l,p=Math.max(0,Math.min(l,ue.scrollTop+g));o.scrollTop=p,u()},[A,ue,Z,u,d]),ye=(0,t.useCallback)(()=>{Re(!1),F()&&m(i.delay)},[F,m,i.delay]),st=(0,t.useCallback)(e=>{if(!X.current)return;let r=X.current.getBoundingClientRect(),s=e.clientY-r.top,l=d();if(!l)return;let a=l.clientHeight,w=l.scrollHeight,p=s/a*(w-a);l.scrollTop=Math.max(0,Math.min(w-a,p)),u(),x(!0),m(i.delay),D()},[u,m,i.delay,d,D]),ut=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!c.current)return;let o=Math.max(0,c.current.scrollTop-re);c.current.scrollTop=o,u(),x(!0),m(i.delay),D()},[u,m,re,i.delay,D]),dt=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!c.current||!B.current)return;let o=c.current,s=B.current.scrollHeight-o.clientHeight,l=Math.min(s,o.scrollTop+re);o.scrollTop=l,u(),x(!0),m(i.delay),D()},[u,m,re,i.delay,D]),pt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(Ne(!0),je({x:e.clientX,scrollLeft:o.scrollLeft}),f(),x(!0),D())},[d,f,D]),xe=(0,t.useCallback)(e=>{if(!O)return;let o=d();if(!o)return;let r=o.clientWidth,l=o.scrollWidth-r,a=e.clientX-de.x,w=r-pe,g=a/w*l,p=Math.max(0,Math.min(l,de.scrollLeft+g));o.scrollLeft=p,u()},[O,de,pe,u,d]),we=(0,t.useCallback)(()=>{Ne(!1),F()&&m(i.delay)},[F,m,i.delay]),mt=(0,t.useCallback)(e=>{if(!X.current)return;let r=X.current.getBoundingClientRect(),s=e.clientX-r.left,l=d();if(!l)return;let a=l.clientWidth,w=l.scrollWidth,p=s/a*(w-a);l.scrollLeft=Math.max(0,Math.min(w-a,p)),u(),x(!0),m(i.delay),D()},[u,m,i.delay,d,D]),ht=(0,t.useCallback)(e=>{if(!be.enabled)return;let o=e.target;if(Le(o,be)||e.button!==0)return;let r=d();r&&(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth||(e.preventDefault(),fe(!0),tt({x:e.clientX,y:e.clientY,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft||0}),f()))},[be,Le,d,f]),Te=(0,t.useCallback)(e=>{if(!P&&!W)return;let o=d();if(!o)return;let r=j.x-e.clientX,s=j.y-e.clientY;if(Math.abs(s)<5&&Math.abs(r)<5)return;P&&(fe(!1),Pe(!0)),x(!0);let l=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,j.scrollTop+s)),a=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,j.scrollLeft+r));o.scrollTop=l,o.scrollLeft=a,u()},[P,W,j,d,u]),Me=(0,t.useCallback)(()=>{let e=W;fe(!1),Pe(!1),e&&F()&&m(i.delay)},[W,F,m,i.delay]);(0,t.useEffect)(()=>{let e=a=>{if(u(),G){z&&z(a);return}f(),x(!0),Be();let w=Fe?i.delayOnWheel:i.delay;m(w),z&&z(a)},o=()=>{_e(!0),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{_e(!1)},300),Be(),q.current=setTimeout(()=>{x(!0),q.current=null,m(i.delayOnWheel)},50)},r=[],s=d();s&&r.push(s);let l=c.current;return l&&!s&&(r.push(l),l.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(w=>{let g=w;if(g!==l&&g.classList.contains("overlay-scrollbar-container"))return;let p=g.parentElement;for(;p&&p!==l;){if(p.classList.contains("overlay-scrollbar-container")&&p!==l)return;p=p.parentElement}r.push(g)})),r.forEach(a=>{a.addEventListener("scroll",e,{passive:!0}),a.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(a=>{a.removeEventListener("scroll",e),a.removeEventListener("wheel",o)}),V.current&&clearTimeout(V.current),q.current&&clearTimeout(q.current)}},[d,u,z,f,m,i,Fe,G]),(0,t.useEffect)(()=>{let e=r=>{let s=d();if(!s)return;let{key:l}=r,{scrollTop:a,scrollHeight:w,clientHeight:g}=s,p=w-g,le=50,L=null;switch(l){case"ArrowUp":r.preventDefault(),L=Math.max(0,a-le);break;case"ArrowDown":r.preventDefault(),L=Math.min(p,a+le);break;case"PageUp":r.preventDefault(),L=Math.max(0,a-g);break;case"PageDown":r.preventDefault(),L=Math.min(p,a+g);break;case"Home":r.preventDefault(),L=0;break;case"End":r.preventDefault(),L=p;break;default:return}if(L!==null){let Se=L/p,ie=$?h*2+n.margin*4:n.margin*2,Ce=(g-ie-Z)*Se;Oe(Ce),s.scrollTop=L,f(),x(!0),m(i.delay)}},o=c.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[d,$,h,n.margin,Z,f,m,i.delay]),(0,t.useEffect)(()=>{if(P||W)return document.addEventListener("mousemove",Te),document.addEventListener("mouseup",Me),()=>{document.removeEventListener("mousemove",Te),document.removeEventListener("mouseup",Me)}},[P,W,Te,Me]),(0,t.useEffect)(()=>{if(A)return document.addEventListener("mousemove",ve),document.addEventListener("mouseup",ye),()=>{document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",ye)}},[A,ve,ye]),(0,t.useEffect)(()=>{if(O)return document.addEventListener("mousemove",xe),document.addEventListener("mouseup",we),()=>{document.removeEventListener("mousemove",xe),document.removeEventListener("mouseup",we)}},[O,xe,we]),(0,t.useEffect)(()=>{u();let e=setTimeout(()=>{u()},100);return()=>clearTimeout(e)},[u]),(0,t.useLayoutEffect)(()=>{ot(!0),u(),!i.enabled&&!G&&F()&&x(!0)},[F,u,i.enabled,G]),(0,t.useEffect)(()=>{if(i.initialDelay>0){let e=setTimeout(()=>{lt(!1)},i.initialDelay);return()=>clearTimeout(e)}},[i.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{u()}),o=[];return c.current&&o.push(c.current),B.current&&o.push(B.current),I.current&&document.contains(I.current)&&o.push(I.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[u]),(0,t.useEffect)(()=>{if(!c.current)return;let e=new MutationObserver(()=>{I.current=null,u()});return e.observe(c.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[u]);let M=Math.max(it,h);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");return r.id=e,r.textContent=`
1
+ "use strict";var He=Object.defineProperty;var bt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var vt=Object.prototype.hasOwnProperty;var yt=(v,y)=>{for(var E in y)He(v,E,{get:y[E],enumerable:!0})},xt=(v,y,E,C)=>{if(y&&typeof y=="object"||typeof y=="function")for(let T of gt(y))!vt.call(v,T)&&T!==E&&He(v,T,{get:()=>y[T],enumerable:!(C=bt(y,T))||C.enumerable});return v};var wt=v=>xt(He({},"__esModule",{value:!0}),v);var kt={};yt(kt,{OverlayScrollbar:()=>Le,default:()=>Le});module.exports=wt(kt);var t=require("react");var Tt=["editor","textarea","input","select","textfield","form-control","contenteditable","MuiInputBase-input","MuiSelect-select","MuiOutlinedInput-input","MuiFilledInput-input","MuiInput-input","MuiFormControl-root","MuiTextField-root","MuiSelect-root","MuiOutlinedInput-root","MuiFilledInput-root","MuiInput-root","MuiAutocomplete-input","MuiDatePicker-input","MuiSlider-thumb","MuiSlider-rail","MuiSlider-track","MuiSlider-mark","MuiSlider-markLabel","MuiSlider-root","MuiSlider-colorPrimary","MuiSlider-sizeMedium","MuiIconButton-root","MuiButton-root","MuiButtonBase-root","MuiTouchRipple-root","MuiCheckbox-root","MuiRadio-root","MuiSwitch-root","PrivateSwitchBase-root","ant-input","ant-input-affix-wrapper","ant-input-group-addon","ant-input-number","ant-input-number-handler","ant-select","ant-select-selector","ant-select-selection-search","ant-select-dropdown","ant-cascader","ant-cascader-input","ant-picker","ant-picker-input","ant-time-picker","ant-calendar-picker","ant-slider","ant-slider-track","ant-slider-handle","ant-switch","ant-checkbox","ant-checkbox-wrapper","ant-radio","ant-radio-wrapper","ant-rate","ant-upload","ant-upload-drag","ant-form-item","ant-form-item-control","ant-btn","ant-dropdown","ant-dropdown-trigger","ant-menu","ant-menu-item","ant-tooltip","ant-popover","ant-modal","ant-drawer","ant-tree-select","ant-auto-complete","ant-mentions","ant-transfer","ui-input","ui-textarea","ui-select","ui-select-trigger","ui-select-content","ui-select-item","ui-button","ui-checkbox","ui-radio-group","ui-switch","ui-slider","ui-range-slider","ui-calendar","ui-date-picker","ui-combobox","ui-command","ui-command-input","ui-popover","ui-dialog","ui-sheet","ui-dropdown-menu","ui-context-menu","ui-menubar","ui-navigation-menu","ui-form","ui-form-control","ui-form-item","ui-form-field","ui-label","radix-ui","radix-select","radix-dropdown","radix-dialog","radix-popover","radix-accordion","radix-tabs","radix-slider","radix-switch","radix-checkbox","radix-radio","ql-editor","ql-container","ql-toolbar","ql-picker","ql-picker-label","ql-picker-options","ql-formats","ql-snow","ql-bubble","quill","quilleditor","monaco-editor","monaco-editor-background","view-lines","decorationsOverviewRuler","monaco-scrollable-element","CodeMirror","CodeMirror-code","CodeMirror-lines","CodeMirror-scroll","CodeMirror-sizer","cm-editor","cm-focused","cm-content","tox-editor-container","tox-editor-header","tox-edit-area","tox-tinymce","mce-content-body","ck-editor","ck-content","ck-toolbar","ck-editor__editable","ck-widget","slate-editor","slate-content","DraftEditor-root","DraftEditor-editorContainer","public-DraftEditor-content","ehfuse-editor","ehfuse-editor-wrapper","ehfuse-editor-content","ehfuse-toolbar","ehfuse-toolbar-group","ehfuse-cursor","text-editor","rich-text-editor","wysiwyg","ace_editor","ace_content"],De=(v,y)=>{let E=v.tagName.toLowerCase(),C=["text","password","email","number","search","tel","url","checkbox","radio"];if(E==="input"){let T=v.type;return C.includes(T)}if(["textarea","select","button"].includes(E)||["svg","path","circle","rect","line","polygon","polyline"].includes(E)||v.getAttribute("contenteditable")==="true")return!0;if(y?.excludeSelectors){for(let T of y.excludeSelectors)if(v.matches(T))return!0}return Mt(v,y)},Mt=(v,y)=>{let E=[...Tt,...y?.excludeClasses||[]],C=v,T=0,$=5;for(;C&&T<=$;){if(E.some(H=>C.classList.contains(H)))return!0;if(C.classList.contains("MuiDialogContent-root"))break;C=C.parentElement,T++}return!1};var S=require("react/jsx-runtime"),St={},Et={},Ct={},Ht={},Dt={},Lt=(0,t.forwardRef)(({className:v="",style:y={},containerStyle:E={},contentStyle:C={},children:T,onScroll:$,thumb:H=St,track:k=Et,arrows:z=Ct,dragScroll:K=Ht,autoHide:F=Dt,showScrollbar:Z=!0,detectInnerScroll:Ue=!1},qe)=>{let Xe=(0,t.useRef)({});(0,t.useEffect)(()=>{Xe.current={children:T,onScroll:$,showScrollbar:Z,thumb:H,track:k,arrows:z,dragScroll:K,autoHide:F}});let se=(0,t.useRef)(null),c=(0,t.useRef)(null),_=(0,t.useRef)(null),q=(0,t.useRef)(null),Ye=(0,t.useRef)(null),I=(0,t.useRef)(null),[ee,x]=(0,t.useState)(!1),[A,ke]=(0,t.useState)(!1),[Re,Ie]=(0,t.useState)(!1),[ue,Ge]=(0,t.useState)({y:0,scrollTop:0}),[j,Ke]=(0,t.useState)(0),[Ze,Ae]=(0,t.useState)(0),[X,Oe]=(0,t.useState)(!1),[We,$e]=(0,t.useState)(!1),[O,ze]=(0,t.useState)(!1),[de,je]=(0,t.useState)({x:0,scrollLeft:0}),[pe,Ve]=(0,t.useState)(0),[me,Je]=(0,t.useState)(0),[Qe,he]=(0,t.useState)(!1),Y=(0,t.useRef)(!1),[P,Pe]=(0,t.useState)(!1),[V,et]=(0,t.useState)({x:0,y:0,scrollTop:0,scrollLeft:0}),[Rt,It]=(0,t.useState)(null),[te,oe]=(0,t.useState)(null),[At,tt]=(0,t.useState)(!1),[ot,rt]=(0,t.useState)(0),J=(0,t.useRef)(null),[Ne,Fe]=(0,t.useState)(!1),Q=(0,t.useRef)(null),B=(0,t.useRef)(null),U=(0,t.useRef)(null),b=(0,t.useMemo)(()=>{let e=H.color??"#606060";return{width:H.width??8,minHeight:H.minHeight??50,radius:H.radius??(H.width??8)/2,color:e,opacity:H.opacity??.6,hoverColor:H.hoverColor??e,hoverOpacity:H.hoverOpacity??1}},[H]),n=(0,t.useMemo)(()=>({width:k.width??16,color:k.color??"rgba(128, 128, 128, 0.1)",visible:k.visible??!0,alignment:k.alignment??"default",radius:k.radius??b.radius??4,margin:k.margin??4,overflowX:k.overflowX??!0,overflowY:k.overflowY??!0}),[k,b.radius]),R=(0,t.useMemo)(()=>{let e=z.color??"#808080";return{visible:z.visible??!1,step:z.step??50,color:e,opacity:z.opacity??.6,hoverColor:z.hoverColor??e,hoverOpacity:z.hoverOpacity??1}},[z]),fe=(0,t.useMemo)(()=>({enabled:K.enabled??!0,excludeClasses:K.excludeClasses??[],excludeSelectors:K.excludeSelectors??[]}),[K]),i=(0,t.useMemo)(()=>({enabled:F.enabled??!0,delay:F.delay??1500,delayOnWheel:F.delayOnWheel??700,initialDelay:F.initialDelay??200}),[F]),[G,nt]=(0,t.useState)(()=>(F.initialDelay??200)>0),h=b.width,lt=n.width,be=b.minHeight,W=R.visible,re=R.step,D=(0,t.useCallback)(()=>{if(!c.current)return;let e=document.activeElement;e&&c.current.contains(e)&&e!==c.current||c.current.focus()},[]);(0,t.useImperativeHandle)(qe,()=>({getScrollContainer:()=>c.current,scrollTo:e=>{c.current&&c.current.scrollTo(e)},get scrollTop(){return c.current?.scrollTop||0},get scrollHeight(){return c.current?.scrollHeight||0},get clientHeight(){return c.current?.clientHeight||0}}),[]);let d=(0,t.useCallback)(()=>{if(I.current){let o=I.current;if(document.contains(o)&&o.scrollHeight>o.clientHeight+2)return o;I.current=null}if(!c.current)return null;if(_.current&&_.current.scrollHeight>c.current.clientHeight+2)return I.current=c.current,c.current;if(!Ue)return null;let e=c.current.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]');for(let o of e){let r=o;if(r!==c.current&&r.classList.contains("overlay-scrollbar-container"))continue;let s=r.parentElement,l=!1;for(;s&&s!==c.current;){if(s.classList.contains("overlay-scrollbar-container")&&s!==c.current){l=!0;break}s=s.parentElement}if(!l&&r.scrollHeight>r.clientHeight+2)return I.current=r,r}return null},[]),N=(0,t.useCallback)(()=>d()!==null,[d]),f=(0,t.useCallback)(()=>{Q.current&&(clearTimeout(Q.current),Q.current=null)},[]),ne=(0,t.useCallback)(()=>{B.current&&(clearTimeout(B.current),B.current=null)},[]),_e=(0,t.useCallback)(()=>{U.current&&(clearTimeout(U.current),U.current=null)},[]),it=(0,t.useCallback)(()=>{ne(),!(A||O||P||Y.current)&&(f(),x(!1))},[f,ne,A,O,P]),m=(0,t.useCallback)(e=>{i.enabled&&(f(),Q.current=setTimeout(()=>{x(!1),Q.current=null},e))},[f,i.enabled]),u=(0,t.useCallback)(()=>{let e=d();if(!e){x(!1),Oe(!1),he(!1),f();return}if(Oe(!0),!q.current)return;!i.enabled&&!G&&(x(!0),f());let o=e.clientHeight,r=e.scrollHeight,s=e.scrollTop,l=e.clientWidth,a=e.scrollWidth,w=e.scrollLeft,g=0,p=0;if(se.current){let ae=window.getComputedStyle(se.current),ce=parseFloat(ae.paddingTop)||0;p=parseFloat(ae.paddingBottom)||0,g=ce+p,rt(p)}let le=W?h*2+n.margin*4:n.margin*2,L=o-le+g,Me=o/r,ie=Math.max(L*Me,be),Se=r-o,Be=L-ie,Ee=Se>0?s/Se*Be:0;Ke(ie),Ae(Ee);let Ce=a-l;if(Ce>0){he(!0);let ae=l/a,ce=Math.max(l*ae,50),ht=l-ce,ft=Ce>0?w/Ce*ht:0;Ve(ce),Je(ft)}else he(!1)},[d,f,W,h,be,i.enabled,G]),at=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(ke(!0),Ge({y:e.clientY,scrollTop:o.scrollTop}),f(),x(!0),D())},[d,f,D]),ge=(0,t.useCallback)(e=>{if(!A)return;let o=d();if(!o)return;let r=o.clientHeight,l=o.scrollHeight-r,a=e.clientY-ue.y,w=r-j,g=a/w*l,p=Math.max(0,Math.min(l,ue.scrollTop+g));o.scrollTop=p,u()},[A,ue,j,u,d]),ve=(0,t.useCallback)(()=>{ke(!1),N()&&m(i.delay)},[N,m,i.delay]),ct=(0,t.useCallback)(e=>{if(!q.current)return;let r=q.current.getBoundingClientRect(),s=e.clientY-r.top,l=d();if(!l)return;let a=l.clientHeight,w=l.scrollHeight,p=s/a*(w-a);l.scrollTop=Math.max(0,Math.min(w-a,p)),u(),x(!0),m(i.delay),D()},[u,m,i.delay,d,D]),st=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!c.current)return;let o=Math.max(0,c.current.scrollTop-re);c.current.scrollTop=o,u(),x(!0),m(i.delay),D()},[u,m,re,i.delay,D]),ut=(0,t.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),!c.current||!_.current)return;let o=c.current,s=_.current.scrollHeight-o.clientHeight,l=Math.min(s,o.scrollTop+re);o.scrollTop=l,u(),x(!0),m(i.delay),D()},[u,m,re,i.delay,D]),dt=(0,t.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let o=d();o&&(ze(!0),je({x:e.clientX,scrollLeft:o.scrollLeft}),f(),x(!0),D())},[d,f,D]),ye=(0,t.useCallback)(e=>{if(!O)return;let o=d();if(!o)return;let r=o.clientWidth,l=o.scrollWidth-r,a=e.clientX-de.x,w=r-pe,g=a/w*l,p=Math.max(0,Math.min(l,de.scrollLeft+g));o.scrollLeft=p,u()},[O,de,pe,u,d]),xe=(0,t.useCallback)(()=>{ze(!1),N()&&m(i.delay)},[N,m,i.delay]),pt=(0,t.useCallback)(e=>{if(!q.current)return;let r=q.current.getBoundingClientRect(),s=e.clientX-r.left,l=d();if(!l)return;let a=l.clientWidth,w=l.scrollWidth,p=s/a*(w-a);l.scrollLeft=Math.max(0,Math.min(w-a,p)),u(),x(!0),m(i.delay),D()},[u,m,i.delay,d,D]),mt=(0,t.useCallback)(e=>{if(!fe.enabled)return;let o=e.target;if(De(o,fe)||e.button!==0)return;let r=d();r&&(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth||(e.preventDefault(),Y.current=!0,et({x:e.clientX,y:e.clientY,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft||0}),f()))},[fe,De,d,f]),we=(0,t.useCallback)(e=>{if(!Y.current&&!P)return;let o=d();if(!o)return;let r=V.x-e.clientX,s=V.y-e.clientY;if(Math.abs(s)<5&&Math.abs(r)<5)return;Y.current&&(Y.current=!1,Pe(!0)),x(!0);let l=Math.max(0,Math.min(o.scrollHeight-o.clientHeight,V.scrollTop+s)),a=Math.max(0,Math.min(o.scrollWidth-o.clientWidth,V.scrollLeft+r));o.scrollTop=l,o.scrollLeft=a,u()},[P,V,d,u]),Te=(0,t.useCallback)(()=>{let e=P;Y.current=!1,Pe(!1),e&&N()&&m(i.delay)},[P,N,m,i.delay]);(0,t.useEffect)(()=>{let e=a=>{if(u(),G){$&&$(a);return}f(),x(!0),_e();let w=Ne?i.delayOnWheel:i.delay;m(w),$&&$(a)},o=()=>{Fe(!0),J.current&&clearTimeout(J.current),J.current=setTimeout(()=>{Fe(!1)},300),_e(),U.current=setTimeout(()=>{x(!0),U.current=null,m(i.delayOnWheel)},50)},r=[],s=d();s&&r.push(s);let l=c.current;return l&&!s&&(r.push(l),l.querySelectorAll('[data-virtuoso-scroller], [style*="overflow"], .virtuoso-scroller, [style*="overflow: auto"], [style*="overflow:auto"]').forEach(w=>{let g=w;if(g!==l&&g.classList.contains("overlay-scrollbar-container"))return;let p=g.parentElement;for(;p&&p!==l;){if(p.classList.contains("overlay-scrollbar-container")&&p!==l)return;p=p.parentElement}r.push(g)})),r.forEach(a=>{a.addEventListener("scroll",e,{passive:!0}),a.addEventListener("wheel",o,{passive:!0})}),()=>{r.forEach(a=>{a.removeEventListener("scroll",e),a.removeEventListener("wheel",o)}),J.current&&clearTimeout(J.current),U.current&&clearTimeout(U.current)}},[d,u,$,f,m,i,Ne,G]),(0,t.useEffect)(()=>{let e=r=>{let s=d();if(!s)return;let{key:l}=r,{scrollTop:a,scrollHeight:w,clientHeight:g}=s,p=w-g,le=50,L=null;switch(l){case"ArrowUp":r.preventDefault(),L=Math.max(0,a-le);break;case"ArrowDown":r.preventDefault(),L=Math.min(p,a+le);break;case"PageUp":r.preventDefault(),L=Math.max(0,a-g);break;case"PageDown":r.preventDefault(),L=Math.min(p,a+g);break;case"Home":r.preventDefault(),L=0;break;case"End":r.preventDefault(),L=p;break;default:return}if(L!==null){let Me=L/p,ie=W?h*2+n.margin*4:n.margin*2,Ee=(g-ie-j)*Me;Ae(Ee),s.scrollTop=L,f(),x(!0),m(i.delay)}},o=c.current;if(o)return o.addEventListener("keydown",e),()=>{o.removeEventListener("keydown",e)}},[d,W,h,n.margin,j,f,m,i.delay]),(0,t.useEffect)(()=>(document.addEventListener("mousemove",we),document.addEventListener("mouseup",Te),()=>{document.removeEventListener("mousemove",we),document.removeEventListener("mouseup",Te)}),[P,we,Te]),(0,t.useEffect)(()=>{if(A)return document.addEventListener("mousemove",ge),document.addEventListener("mouseup",ve),()=>{document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",ve)}},[A,ge,ve]),(0,t.useEffect)(()=>{if(O)return document.addEventListener("mousemove",ye),document.addEventListener("mouseup",xe),()=>{document.removeEventListener("mousemove",ye),document.removeEventListener("mouseup",xe)}},[O,ye,xe]),(0,t.useEffect)(()=>{u();let e=setTimeout(()=>{u()},100);return()=>clearTimeout(e)},[u]),(0,t.useLayoutEffect)(()=>{tt(!0),u(),!i.enabled&&!G&&N()&&x(!0)},[N,u,i.enabled,G]),(0,t.useEffect)(()=>{if(i.initialDelay>0){let e=setTimeout(()=>{nt(!1)},i.initialDelay);return()=>clearTimeout(e)}},[i.initialDelay]),(0,t.useEffect)(()=>{let e=new ResizeObserver(()=>{u()}),o=[];return c.current&&o.push(c.current),_.current&&o.push(_.current),I.current&&document.contains(I.current)&&o.push(I.current),o.forEach(r=>{e.observe(r)}),()=>e.disconnect()},[u]),(0,t.useEffect)(()=>{if(!c.current)return;let e=new MutationObserver(()=>{I.current=null,u()});return e.observe(c.current,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style"]}),()=>e.disconnect()},[u]);let M=Math.max(lt,h);return(0,t.useEffect)(()=>{let e="overlay-scrollbar-webkit-hide",o=document.getElementById(e);o&&o.remove();let r=document.createElement("style");return r.id=e,r.textContent=`
2
2
  /* \uBAA8\uB4E0 \uC2A4\uD06C\uB864\uBC14 \uC228\uAE30\uAE30 */
3
3
  .overlay-scrollbar-container {
4
4
  scrollbar-width: none !important;
@@ -38,5 +38,5 @@
38
38
  .overlay-scrollbar-container .ehfuse-editor-content::-webkit-scrollbar-thumb:hover {
39
39
  background: #a1a1a1 !important;
40
40
  }
41
- `,document.head.appendChild(r),()=>{let s=document.getElementById(e);s&&s.remove()}},[]),(0,S.jsxs)("div",{ref:se,className:`overlay-scrollbar-wrapper ${v}`,onMouseLeave:at,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"hidden",...y},children:[(0,S.jsx)("div",{ref:c,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:ht,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:P||W?"none":"auto",...E},children:(0,S.jsx)("div",{ref:B,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...C},children:T})}),K&&Y&&(n.overflowY??!0)&&(0,S.jsxs)("div",{ref:X,className:"overlay-scrollbar-track",onMouseEnter:()=>{f(),U.current=setTimeout(()=>{x(!0),U.current=null},100)},onMouseLeave:()=>{ne(),A||m(i.delay)},style:{position:"absolute",top:0,right:0,width:`${M}px`,height:"100%",opacity:ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,S.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),st(e)},style:{position:"absolute",top:$?`${b.width+n.margin*2}px`:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-b.width)/2}px`,width:`${b.width}px`,height:$?`calc(100% - ${b.width*2+n.margin*4}px)`:`calc(100% - ${n.margin*2}px)`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,S.jsx)("div",{ref:Ge,className:"overlay-scrollbar-thumb",onMouseDown:ct,onMouseEnter:()=>Ae(!0),onMouseLeave:()=>Ae(!1),style:{position:"absolute",top:`${($?h+n.margin*2:n.margin)+Ze}px`,right:n.alignment==="outside"?"0px":`${(M-h)/2}px`,width:`${h}px`,height:`${Math.max(Z,ge)}px`,backgroundColor:Ie||A?b.hoverColor:b.color,opacity:Ie||A?b.hoverOpacity:b.opacity,borderRadius:`${b.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),K&&Y&&$&&(0,S.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:ut,onMouseEnter:()=>oe("up"),onMouseLeave:()=>oe(null),style:{position:"absolute",top:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-h)/2}px`,width:`${h}px`,height:`${h}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(h*.75,8)}px`,color:te==="up"?R.hoverColor:R.color,userSelect:"none",zIndex:1001,opacity:ee?te==="up"?R.hoverOpacity:R.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),K&&Y&&$&&(0,S.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:dt,onMouseEnter:()=>oe("down"),onMouseLeave:()=>oe(null),style:{position:"absolute",bottom:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-h)/2}px`,width:`${h}px`,height:`${h}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(h*.75,8)}px`,color:te==="down"?R.hoverColor:R.color,userSelect:"none",zIndex:1001,opacity:ee?te==="down"?R.hoverOpacity:R.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),K&&et&&(n.overflowX??!0)&&(0,S.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{f(),U.current=setTimeout(()=>{x(!0),U.current=null},100)},onMouseLeave:()=>{ne(),O||m(i.delay)},style:{position:"absolute",bottom:`${rt}px`,left:0,width:"100%",height:`${M}px`,opacity:ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,S.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),mt(e)},style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(M-h)/2}px`,left:`${n.margin}px`,right:Y?n.alignment==="outside"?`${M-n.margin}px`:`${M}px`:`${n.margin}px`,height:`${h}px`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,S.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:pt,onMouseEnter:()=>ze(!0),onMouseLeave:()=>ze(!1),style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(M-h)/2}px`,left:`${n.margin+me}px`,right:Y?n.alignment==="outside"?`${M-n.margin}px`:`${M}px`:"auto",maxWidth:Y?n.alignment==="outside"?`calc(100% - ${n.margin+me+M-n.margin}px)`:`calc(100% - ${n.margin+me+M}px)`:"none",width:`${Math.max(pe,50)}px`,height:`${h}px`,backgroundColor:$e||O?b.hoverColor:b.color,opacity:$e||O?b.hoverOpacity:b.opacity,borderRadius:`${b.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),ke=kt;
41
+ `,document.head.appendChild(r),()=>{let s=document.getElementById(e);s&&s.remove()}},[]),(0,S.jsxs)("div",{ref:se,className:`overlay-scrollbar-wrapper ${v}`,onMouseLeave:it,style:{display:"flex",flexDirection:"column",position:"relative",minHeight:0,height:"100%",flex:"1 1 0%",overflow:"hidden",...y},children:[(0,S.jsx)("div",{ref:c,className:"overlay-scrollbar-container",tabIndex:-1,onMouseDown:mt,style:{display:"flex",width:"100%",flex:"1 1 auto",minHeight:0,overflow:"auto",scrollbarWidth:"none",msOverflowStyle:"none",outline:"none",userSelect:P?"none":"auto",...E},children:(0,S.jsx)("div",{ref:_,className:"overlay-scrollbar-content",style:{flex:"1 1 0%",minHeight:0,display:"flex",flexDirection:"column",...C},children:T})}),Z&&X&&(n.overflowY??!0)&&(0,S.jsxs)("div",{ref:q,className:"overlay-scrollbar-track",onMouseEnter:()=>{f(),B.current=setTimeout(()=>{x(!0),B.current=null},100)},onMouseLeave:()=>{ne(),A||m(i.delay)},style:{position:"absolute",top:0,right:0,width:`${M}px`,height:"100%",opacity:ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,S.jsx)("div",{className:"overlay-scrollbar-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),ct(e)},style:{position:"absolute",top:W?`${b.width+n.margin*2}px`:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-b.width)/2}px`,width:`${b.width}px`,height:W?`calc(100% - ${b.width*2+n.margin*4}px)`:`calc(100% - ${n.margin*2}px)`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,S.jsx)("div",{ref:Ye,className:"overlay-scrollbar-thumb",onMouseDown:at,onMouseEnter:()=>Ie(!0),onMouseLeave:()=>Ie(!1),style:{position:"absolute",top:`${(W?h+n.margin*2:n.margin)+Ze}px`,right:n.alignment==="outside"?"0px":`${(M-h)/2}px`,width:`${h}px`,height:`${Math.max(j,be)}px`,backgroundColor:Re||A?b.hoverColor:b.color,opacity:Re||A?b.hoverOpacity:b.opacity,borderRadius:`${b.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]}),Z&&X&&W&&(0,S.jsx)("div",{className:"overlay-scrollbar-up-arrow",onClick:st,onMouseEnter:()=>oe("up"),onMouseLeave:()=>oe(null),style:{position:"absolute",top:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-h)/2}px`,width:`${h}px`,height:`${h}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(h*.75,8)}px`,color:te==="up"?R.hoverColor:R.color,userSelect:"none",zIndex:1001,opacity:ee?te==="up"?R.hoverOpacity:R.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25B2"}),Z&&X&&W&&(0,S.jsx)("div",{className:"overlay-scrollbar-down-arrow",onClick:ut,onMouseEnter:()=>oe("down"),onMouseLeave:()=>oe(null),style:{position:"absolute",bottom:`${n.margin}px`,right:n.alignment==="outside"?"0px":`${(M-h)/2}px`,width:`${h}px`,height:`${h}px`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${Math.max(h*.75,8)}px`,color:te==="down"?R.hoverColor:R.color,userSelect:"none",zIndex:1001,opacity:ee?te==="down"?R.hoverOpacity:R.opacity:0,transition:"opacity 0.2s ease-in-out, color 0.15s ease-in-out"},children:"\u25BC"}),Z&&Qe&&(n.overflowX??!0)&&(0,S.jsxs)("div",{className:"overlay-scrollbar-horizontal-track",onMouseEnter:()=>{f(),B.current=setTimeout(()=>{x(!0),B.current=null},100)},onMouseLeave:()=>{ne(),O||m(i.delay)},style:{position:"absolute",bottom:`${ot}px`,left:0,width:"100%",height:`${M}px`,opacity:ee?1:0,transition:"opacity 0.2s ease-in-out",cursor:"pointer",zIndex:1e3,pointerEvents:"auto"},children:[n.visible&&(0,S.jsx)("div",{className:"overlay-scrollbar-horizontal-track-background",onClick:e=>{e.preventDefault(),e.stopPropagation(),pt(e)},style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(M-h)/2}px`,left:`${n.margin}px`,right:X?n.alignment==="outside"?`${M-n.margin}px`:`${M}px`:`${n.margin}px`,height:`${h}px`,backgroundColor:n.color,borderRadius:`${n.radius}px`,cursor:"pointer"}}),(0,S.jsx)("div",{className:"overlay-scrollbar-horizontal-thumb",onMouseDown:dt,onMouseEnter:()=>$e(!0),onMouseLeave:()=>$e(!1),style:{position:"absolute",bottom:n.alignment==="outside"?"0px":`${(M-h)/2}px`,left:`${n.margin+me}px`,right:X?n.alignment==="outside"?`${M-n.margin}px`:`${M}px`:"auto",maxWidth:X?n.alignment==="outside"?`calc(100% - ${n.margin+me+M-n.margin}px)`:`calc(100% - ${n.margin+me+M}px)`:"none",width:`${Math.max(pe,50)}px`,height:`${h}px`,backgroundColor:We||O?b.hoverColor:b.color,opacity:We||O?b.hoverOpacity:b.opacity,borderRadius:`${b.radius}px`,cursor:"pointer",transition:"background-color 0.2s ease-in-out, opacity 0.2s ease-in-out"}})]})]})}),Le=Lt;
42
42
  //# sourceMappingURL=index.js.map