Module 802019

1,372 characters · in f08fed5b39d8e5b5.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{A:()=>d});var l=n(627968),i=n(64700),s=n(503698),r=n.n(s),a=n(962125),o=n(151271),c=n(652215),u=n(654360);let d=function(e){let{categoryListRef:t,expressionsListRef:n,categories:s,store:d,children:h,className:m,listPadding:p,rowCount:f,getScrollOffsetForIndex:g,categoryHeight:x,onScroll:A,renderCategoryListItem:C,rowCountBySection:E,renderSection:I}=e,y=d.useStore(e=>e.activeCategoryIndex);(e=>{let{activeIndex:t,categoryListRef:n,getScrollOffsetForIndex:l}=e,s=i.useRef(c.An1),r=i.useRef(t);return i.useEffect(()=>{null!=t&&t!==r.current&&(s.current!==c.An1&&window.cancelAnimationFrame(s.current),s.current=window.requestAnimationFrame(()=>{if(null==n.current)return;let e=t>(r.current??-1),i=null!=l?l(t,e):0;n.current.scrollRowIntoView(t,{animate:!0,offset:i}),s.current=c.An1,r.current=t}))},[t,n,l])})({activeIndex:y,categoryListRef:t,getScrollOffsetForIndex:g});let S=i.useCallback(e=>{let{searchQuery:t}=o.RQ.getState();d.setActiveCategoryIndex(e),""!==t?(0,o.Ri)(""):n.current?.scrollToSectionTop(e)},[n,d]),v=i.useCallback(e=>C(s[e],e,()=>S(e),y===e),[y,s,S,C]),N=i.useMemo(()=>"function"==typeof x?e=>x(s[e],e):x,[s,x]);return(0,l.jsxs)("div",{className:r()(u.i,m),children:[(0,l.jsx)(a.A,{listPadding:p,onScroll:A,ref:t,renderRow:v,rowCount:f,rowHeight:N,hideScrollbar:!0,rowCountBySection:E,renderSection:I}),h?.(S)]})}}