mirror of
https://github.com/owncast/owncast.git
synced 2025-01-03 23:27:37 +03:00
1 line
No EOL
44 KiB
JavaScript
Vendored
1 line
No EOL
44 KiB
JavaScript
Vendored
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7752],{88708:function(e,n,t){t.d(n,{ZP:function(){return l}});var o=t(97685),r=t(67294),u=t(98924),a=0,i=(0,u.Z)();function l(e){var n=r.useState(),t=(0,o.Z)(n,2),u=t[0],l=t[1];return r.useEffect(function(){var e;l("rc_select_".concat((i?(e=a,a+=1):e="TEST_OR_SSR",e)))},[]),e||u}},7752:function(e,n,t){t.r(n),t.d(n,{BaseSelect:function(){return j},OptGroup:function(){return en},Option:function(){return eo},default:function(){return ev},useBaseProps:function(){return w}});var o=t(87462),r=t(74902),u=t(4942),a=t(1413),i=t(97685),l=t(45987),c=t(71002),s=t(21770),f=t(80334),d=t(67294),p=t(94184),v=t.n(p),m=t(8410),h=t(31131),g=t(15105),b=t(42550),Z=d.createContext(null);function w(){return d.useContext(Z)}function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,n=d.useRef(null),t=d.useRef(null);return d.useEffect(function(){return function(){window.clearTimeout(t.current)}},[]),[function(){return n.current},function(o){(o||null===n.current)&&(n.current=o),window.clearTimeout(t.current),t.current=window.setTimeout(function(){n.current=null},e)}]}var y=t(64217),S=t(39983),C=function(e){var n,t=e.className,o=e.customizeIcon,r=e.customizeIconProps,u=e.onMouseDown,a=e.onClick,i=e.children;return n="function"==typeof o?o(r):o,d.createElement("span",{className:t,onMouseDown:function(e){e.preventDefault(),u&&u(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},void 0!==n?n:d.createElement("span",{className:v()(t.split(/\s+/).map(function(e){return"".concat(e,"-icon")}))},i))},M=d.forwardRef(function(e,n){var t,o,r=e.prefixCls,u=e.id,i=e.inputElement,l=e.disabled,c=e.tabIndex,s=e.autoFocus,p=e.autoComplete,m=e.editable,h=e.activeDescendantId,g=e.value,Z=e.maxLength,w=e.onKeyDown,E=e.onMouseDown,y=e.onChange,S=e.onPaste,C=e.onCompositionStart,M=e.onCompositionEnd,R=e.open,x=e.attrs,D=i||d.createElement("input",null),I=D,N=I.ref,T=I.props,P=T.onKeyDown,k=T.onChange,O=T.onMouseDown,V=T.onCompositionStart,L=T.onCompositionEnd,A=T.style;return(0,f.Kp)(!("maxLength"in D.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),D=d.cloneElement(D,(0,a.Z)((0,a.Z)((0,a.Z)({type:"search"},T),{},{id:u,ref:(0,b.sQ)(n,N),disabled:l,tabIndex:c,autoComplete:p||"off",autoFocus:s,className:v()("".concat(r,"-selection-search-input"),null===(t=D)||void 0===t?void 0:null===(o=t.props)||void 0===o?void 0:o.className),role:"combobox","aria-expanded":R,"aria-haspopup":"listbox","aria-owns":"".concat(u,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(u,"_list"),"aria-activedescendant":h},x),{},{value:m?g:"",maxLength:Z,readOnly:!m,unselectable:m?null:"on",style:(0,a.Z)((0,a.Z)({},A),{},{opacity:m?null:0}),onKeyDown:function(e){w(e),P&&P(e)},onMouseDown:function(e){E(e),O&&O(e)},onChange:function(e){y(e),k&&k(e)},onCompositionStart:function(e){C(e),V&&V(e)},onCompositionEnd:function(e){M(e),L&&L(e)},onPaste:S}))});function R(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}M.displayName="Input";var x="undefined"!=typeof window&&window.document&&window.document.documentElement;function D(e){return["string","number"].includes((0,c.Z)(e))}function I(e){var n=void 0;return e&&(D(e.title)?n=e.title.toString():D(e.label)&&(n=e.label.toString())),n}function N(e){var n;return null!==(n=e.key)&&void 0!==n?n:e.value}var T=function(e){e.preventDefault(),e.stopPropagation()},P=function(e){var n,t,o=e.id,r=e.prefixCls,a=e.values,l=e.open,c=e.searchValue,s=e.autoClearSearchValue,f=e.inputRef,p=e.placeholder,m=e.disabled,h=e.mode,g=e.showSearch,b=e.autoFocus,Z=e.autoComplete,w=e.activeDescendantId,E=e.tabIndex,R=e.removeIcon,D=e.maxTagCount,P=e.maxTagTextLength,k=e.maxTagPlaceholder,O=void 0===k?function(e){return"+ ".concat(e.length," ...")}:k,V=e.tagRender,L=e.onToggleOpen,A=e.onRemove,H=e.onInputChange,F=e.onInputPaste,_=e.onInputKeyDown,K=e.onInputMouseDown,W=e.onInputCompositionStart,U=e.onInputCompositionEnd,Y=d.useRef(null),z=(0,d.useState)(0),j=(0,i.Z)(z,2),B=j[0],G=j[1],X=(0,d.useState)(!1),Q=(0,i.Z)(X,2),J=Q[0],$=Q[1],q="".concat(r,"-selection"),ee=l||"multiple"===h&&!1===s||"tags"===h?c:"",en="tags"===h||"multiple"===h&&!1===s||g&&(l||J);function et(e,n,t,o,r){return d.createElement("span",{className:v()("".concat(q,"-item"),(0,u.Z)({},"".concat(q,"-item-disabled"),t)),title:I(e)},d.createElement("span",{className:"".concat(q,"-item-content")},n),o&&d.createElement(C,{className:"".concat(q,"-item-remove"),onMouseDown:T,onClick:r,customizeIcon:R},"\xd7"))}n=function(){G(Y.current.scrollWidth)},t=[ee],x?d.useLayoutEffect(n,t):d.useEffect(n,t);var eo=d.createElement("div",{className:"".concat(q,"-search"),style:{width:B},onFocus:function(){$(!0)},onBlur:function(){$(!1)}},d.createElement(M,{ref:f,open:l,prefixCls:r,id:o,inputElement:null,disabled:m,autoFocus:b,autoComplete:Z,editable:en,activeDescendantId:w,value:ee,onKeyDown:_,onMouseDown:K,onChange:H,onPaste:F,onCompositionStart:W,onCompositionEnd:U,tabIndex:E,attrs:(0,y.Z)(e,!0)}),d.createElement("span",{ref:Y,className:"".concat(q,"-search-mirror"),"aria-hidden":!0},ee,"\xa0")),er=d.createElement(S.Z,{prefixCls:"".concat(q,"-overflow"),data:a,renderItem:function(e){var n,t=e.disabled,o=e.label,r=e.value,u=!m&&!t,a=o;if("number"==typeof P&&("string"==typeof o||"number"==typeof o)){var i=String(a);i.length>P&&(a="".concat(i.slice(0,P),"..."))}var c=function(n){n&&n.stopPropagation(),A(e)};return"function"==typeof V?(n=a,d.createElement("span",{onMouseDown:function(e){T(e),L(!l)}},V({label:n,value:r,disabled:t,closable:u,onClose:c}))):et(e,a,t,u,c)},renderRest:function(e){var n="function"==typeof O?O(e):O;return et({title:n},n,!1)},suffix:eo,itemKey:N,maxCount:D});return d.createElement(d.Fragment,null,er,!a.length&&!ee&&d.createElement("span",{className:"".concat(q,"-placeholder")},p))},k=function(e){var n=e.inputElement,t=e.prefixCls,o=e.id,r=e.inputRef,u=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,s=e.mode,f=e.open,p=e.placeholder,v=e.tabIndex,m=e.showSearch,h=e.searchValue,g=e.activeValue,b=e.maxLength,Z=e.onInputKeyDown,w=e.onInputMouseDown,E=e.onInputChange,S=e.onInputPaste,C=e.onInputCompositionStart,R=e.onInputCompositionEnd,x=d.useState(!1),D=(0,i.Z)(x,2),N=D[0],T=D[1],P="combobox"===s,k=P||m,O=e.values[0],V=h||"";P&&g&&!N&&(V=g),d.useEffect(function(){P&&T(!1)},[P,g]);var L=("combobox"===s||!!f||!!m)&&!!V,A=I(O);return d.createElement(d.Fragment,null,d.createElement("span",{className:"".concat(t,"-selection-search")},d.createElement(M,{ref:r,prefixCls:t,id:o,open:f,inputElement:n,disabled:u,autoFocus:a,autoComplete:l,editable:k,activeDescendantId:c,value:V,onKeyDown:Z,onMouseDown:w,onChange:function(e){T(!0),E(e)},onPaste:S,onCompositionStart:C,onCompositionEnd:R,tabIndex:v,attrs:(0,y.Z)(e,!0),maxLength:P?b:void 0})),!P&&O?d.createElement("span",{className:"".concat(t,"-selection-item"),title:A,style:L?{visibility:"hidden"}:void 0},O.label):null,O?null:d.createElement("span",{className:"".concat(t,"-selection-placeholder"),style:L?{visibility:"hidden"}:void 0},p))},O=d.forwardRef(function(e,n){var t=(0,d.useRef)(null),r=(0,d.useRef)(!1),u=e.prefixCls,a=e.open,l=e.mode,c=e.showSearch,s=e.tokenWithEnter,f=e.autoClearSearchValue,p=e.onSearch,v=e.onSearchSubmit,m=e.onToggleOpen,h=e.onInputKeyDown,b=e.domRef;d.useImperativeHandle(n,function(){return{focus:function(){t.current.focus()},blur:function(){t.current.blur()}}});var Z=E(0),w=(0,i.Z)(Z,2),y=w[0],S=w[1],C=(0,d.useRef)(null),M=function(e){!1!==p(e,!0,r.current)&&m(!0)},R={inputRef:t,onInputKeyDown:function(e){var n=e.which;(n===g.Z.UP||n===g.Z.DOWN)&&e.preventDefault(),h&&h(e),n!==g.Z.ENTER||"tags"!==l||r.current||a||null==v||v(e.target.value),[g.Z.ESC,g.Z.SHIFT,g.Z.BACKSPACE,g.Z.TAB,g.Z.WIN_KEY,g.Z.ALT,g.Z.META,g.Z.WIN_KEY_RIGHT,g.Z.CTRL,g.Z.SEMICOLON,g.Z.EQUALS,g.Z.CAPS_LOCK,g.Z.CONTEXT_MENU,g.Z.F1,g.Z.F2,g.Z.F3,g.Z.F4,g.Z.F5,g.Z.F6,g.Z.F7,g.Z.F8,g.Z.F9,g.Z.F10,g.Z.F11,g.Z.F12].includes(n)||m(!0)},onInputMouseDown:function(){S(!0)},onInputChange:function(e){var n=e.target.value;if(s&&C.current&&/[\r\n]/.test(C.current)){var t=C.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");n=n.replace(t,C.current)}C.current=null,M(n)},onInputPaste:function(e){var n=e.clipboardData.getData("text");C.current=n},onInputCompositionStart:function(){r.current=!0},onInputCompositionEnd:function(e){r.current=!1,"combobox"!==l&&M(e.target.value)}},x="multiple"===l||"tags"===l?d.createElement(P,(0,o.Z)({},e,R)):d.createElement(k,(0,o.Z)({},e,R));return d.createElement("div",{ref:b,className:"".concat(u,"-selector"),onClick:function(e){e.target!==t.current&&(void 0!==document.body.style.msTouchAction?setTimeout(function(){t.current.focus()}):t.current.focus())},onMouseDown:function(e){var n=y();e.target===t.current||n||"combobox"===l||e.preventDefault(),("combobox"===l||c&&n)&&a||(a&&!1!==f&&p("",!0,!1),m())}},x)});O.displayName="Selector";var V=t(81263),L=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],A=function(e){var n=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1}}}},H=d.forwardRef(function(e,n){var t=e.prefixCls,r=(e.disabled,e.visible),i=e.children,c=e.popupElement,s=e.containerWidth,f=e.animation,p=e.transitionName,m=e.dropdownStyle,h=e.dropdownClassName,g=e.direction,b=e.placement,Z=e.dropdownMatchSelectWidth,w=e.dropdownRender,E=e.dropdownAlign,y=e.getPopupContainer,S=e.empty,C=e.getTriggerDOMNode,M=e.onPopupVisibleChange,R=e.onPopupMouseEnter,x=(0,l.Z)(e,L),D="".concat(t,"-dropdown"),I=c;w&&(I=w(c));var N=d.useMemo(function(){return A(Z)},[Z]),T=f?"".concat(D,"-").concat(f):p,P=d.useRef(null);d.useImperativeHandle(n,function(){return{getPopupElement:function(){return P.current}}});var k=(0,a.Z)({minWidth:s},m);return"number"==typeof Z?k.width=Z:Z&&(k.width=s),d.createElement(V.Z,(0,o.Z)({},x,{showAction:M?["click"]:[],hideAction:M?["click"]:[],popupPlacement:b||("rtl"===(void 0===g?"ltr":g)?"bottomRight":"bottomLeft"),builtinPlacements:N,prefixCls:D,popupTransitionName:T,popup:d.createElement("div",{ref:P,onMouseEnter:R},I),popupAlign:E,popupVisible:r,getPopupContainer:y,popupClassName:v()(h,(0,u.Z)({},"".concat(D,"-empty"),S)),popupStyle:k,getTriggerDOMNode:C,onPopupVisibleChange:M}),i)});H.displayName="SelectTrigger";var F=t(84506);function _(e,n){var t,o=e.key;return("value"in e&&(t=e.value),null!=o)?o:void 0!==t?t:"rc-index-key-".concat(n)}function K(e,n){var t=e||{};return{label:t.label||(n?"children":"label"),value:t.value||"value",options:t.options||"options"}}function W(e){var n=(0,a.Z)({},e);return"props"in n||Object.defineProperty(n,"props",{get:function(){return(0,f.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),n}}),n}var U=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Y=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function z(e){return"tags"===e||"multiple"===e}var j=d.forwardRef(function(e,n){var t,f,p,w,y,S,M,R,x,D=e.id,I=e.prefixCls,N=e.className,T=e.showSearch,P=e.tagRender,k=e.direction,V=e.omitDomProps,L=e.displayValues,A=e.onDisplayValuesChange,_=e.emptyOptions,K=e.notFoundContent,W=void 0===K?"Not Found":K,j=e.onClear,B=e.mode,G=e.disabled,X=e.loading,Q=e.getInputElement,J=e.getRawInputElement,$=e.open,q=e.defaultOpen,ee=e.onDropdownVisibleChange,en=e.activeValue,et=e.onActiveValueChange,eo=e.activeDescendantId,er=e.searchValue,eu=e.autoClearSearchValue,ea=e.onSearch,ei=e.onSearchSplit,el=e.tokenSeparators,ec=e.allowClear,es=e.showArrow,ef=e.inputIcon,ed=e.clearIcon,ep=e.OptionList,ev=e.animation,em=e.transitionName,eh=e.dropdownStyle,eg=e.dropdownClassName,eb=e.dropdownMatchSelectWidth,eZ=e.dropdownRender,ew=e.dropdownAlign,eE=e.placement,ey=e.getPopupContainer,eS=e.showAction,eC=void 0===eS?[]:eS,eM=e.onFocus,eR=e.onBlur,ex=e.onKeyUp,eD=e.onKeyDown,eI=e.onMouseDown,eN=(0,l.Z)(e,U),eT=z(B),eP=(void 0!==T?T:eT)||"combobox"===B,ek=(0,a.Z)({},eN);Y.forEach(function(e){delete ek[e]}),null==V||V.forEach(function(e){delete ek[e]});var eO=d.useState(!1),eV=(0,i.Z)(eO,2),eL=eV[0],eA=eV[1];d.useEffect(function(){eA((0,h.Z)())},[]);var eH=d.useRef(null),eF=d.useRef(null),e_=d.useRef(null),eK=d.useRef(null),eW=d.useRef(null),eU=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,n=d.useState(!1),t=(0,i.Z)(n,2),o=t[0],r=t[1],u=d.useRef(null),a=function(){window.clearTimeout(u.current)};return d.useEffect(function(){return a},[]),[o,function(n,t){a(),u.current=window.setTimeout(function(){r(n),t&&t()},e)},a]}(),eY=(0,i.Z)(eU,3),ez=eY[0],ej=eY[1],eB=eY[2];d.useImperativeHandle(n,function(){var e,n;return{focus:null===(e=eK.current)||void 0===e?void 0:e.focus,blur:null===(n=eK.current)||void 0===n?void 0:n.blur,scrollTo:function(e){var n;return null===(n=eW.current)||void 0===n?void 0:n.scrollTo(e)}}});var eG=d.useMemo(function(){if("combobox"!==B)return er;var e,n=null===(e=L[0])||void 0===e?void 0:e.value;return"string"==typeof n||"number"==typeof n?String(n):""},[er,B,L]),eX="combobox"===B&&"function"==typeof Q&&Q()||null,eQ="function"==typeof J&&J(),eJ=(0,b.x1)(eF,null==eQ?void 0:null===(w=eQ.props)||void 0===w?void 0:w.ref),e$=(0,s.Z)(void 0,{defaultValue:q,value:$}),eq=(0,i.Z)(e$,2),e0=eq[0],e1=eq[1],e2=e0,e4=!W&&_;(G||e4&&e2&&"combobox"===B)&&(e2=!1);var e7=!e4&&e2,e5=d.useCallback(function(e){var n=void 0!==e?e:!e2;G||(e1(n),e2!==n&&(null==ee||ee(n)))},[G,e2,e1,ee]),e8=d.useMemo(function(){return(el||[]).some(function(e){return["\n","\r\n"].includes(e)})},[el]),e3=function(e,n,t){var o=!0,u=e;null==et||et(null);var a=t?null:function(e,n){if(!n||!n.length)return null;var t=!1,o=function e(n,o){var u=(0,F.Z)(o),a=u[0],i=u.slice(1);if(!a)return[n];var l=n.split(a);return t=t||l.length>1,l.reduce(function(n,t){return[].concat((0,r.Z)(n),(0,r.Z)(e(t,i)))},[]).filter(function(e){return e})}(e,n);return t?o:null}(e,el);return"combobox"!==B&&a&&(u="",null==ei||ei(a),e5(!1),o=!1),ea&&eG!==u&&ea(u,{source:n?"typing":"effect"}),o};d.useEffect(function(){e2||eT||"combobox"===B||e3("",!1,!1)},[e2]),d.useEffect(function(){e0&&G&&e1(!1),G&&ej(!1)},[G]);var e9=E(),e6=(0,i.Z)(e9,2),ne=e6[0],nn=e6[1],nt=d.useRef(!1),no=[];d.useEffect(function(){return function(){no.forEach(function(e){return clearTimeout(e)}),no.splice(0,no.length)}},[]);var nr=d.useState(null),nu=(0,i.Z)(nr,2),na=nu[0],ni=nu[1],nl=d.useState({}),nc=(0,i.Z)(nl,2)[1];(0,m.Z)(function(){if(e7){var e,n=Math.ceil(null===(e=eH.current)||void 0===e?void 0:e.offsetWidth);na===n||Number.isNaN(n)||ni(n)}},[e7]),eQ&&(S=function(e){e5(e)}),t=function(){var e;return[eH.current,null===(e=e_.current)||void 0===e?void 0:e.getPopupElement()]},f=!!eQ,(p=d.useRef(null)).current={open:e7,triggerOpen:e5,customizedTrigger:f},d.useEffect(function(){function e(e){if(null===(n=p.current)||void 0===n||!n.customizedTrigger){var n,o=e.target;o.shadowRoot&&e.composed&&(o=e.composedPath()[0]||o),p.current.open&&t().filter(function(e){return e}).every(function(e){return!e.contains(o)&&e!==o})&&p.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}},[]);var ns=d.useMemo(function(){return(0,a.Z)((0,a.Z)({},e),{},{notFoundContent:W,open:e2,triggerOpen:e7,id:D,showSearch:eP,multiple:eT,toggleOpen:e5})},[e,W,e7,e2,D,eP,eT,e5]),nf=void 0!==es?es:X||!eT&&"combobox"!==B;nf&&(M=d.createElement(C,{className:v()("".concat(I,"-arrow"),(0,u.Z)({},"".concat(I,"-arrow-loading"),X)),customizeIcon:ef,customizeIconProps:{loading:X,searchValue:eG,open:e2,focused:ez,showSearch:eP}})),!G&&ec&&(L.length||eG)&&!("combobox"===B&&""===eG)&&(R=d.createElement(C,{className:"".concat(I,"-clear"),onMouseDown:function(){var e;null==j||j(),null===(e=eK.current)||void 0===e||e.focus(),A([],{type:"clear",values:L}),e3("",!1,!1)},customizeIcon:ed},"\xd7"));var nd=d.createElement(ep,{ref:eW}),np=v()(I,N,(y={},(0,u.Z)(y,"".concat(I,"-focused"),ez),(0,u.Z)(y,"".concat(I,"-multiple"),eT),(0,u.Z)(y,"".concat(I,"-single"),!eT),(0,u.Z)(y,"".concat(I,"-allow-clear"),ec),(0,u.Z)(y,"".concat(I,"-show-arrow"),nf),(0,u.Z)(y,"".concat(I,"-disabled"),G),(0,u.Z)(y,"".concat(I,"-loading"),X),(0,u.Z)(y,"".concat(I,"-open"),e2),(0,u.Z)(y,"".concat(I,"-customize-input"),eX),(0,u.Z)(y,"".concat(I,"-show-search"),eP),y)),nv=d.createElement(H,{ref:e_,disabled:G,prefixCls:I,visible:e7,popupElement:nd,containerWidth:na,animation:ev,transitionName:em,dropdownStyle:eh,dropdownClassName:eg,direction:k,dropdownMatchSelectWidth:eb,dropdownRender:eZ,dropdownAlign:ew,placement:eE,getPopupContainer:ey,empty:_,getTriggerDOMNode:function(){return eF.current},onPopupVisibleChange:S,onPopupMouseEnter:function(){nc({})}},eQ?d.cloneElement(eQ,{ref:eJ}):d.createElement(O,(0,o.Z)({},e,{domRef:eF,prefixCls:I,inputElement:eX,ref:eK,id:D,showSearch:eP,autoClearSearchValue:eu,mode:B,activeDescendantId:eo,tagRender:P,values:L,open:e2,onToggleOpen:e5,activeValue:en,searchValue:eG,onSearch:e3,onSearchSubmit:function(e){e&&e.trim()&&ea(e,{source:"submit"})},onRemove:function(e){A(L.filter(function(n){return n!==e}),{type:"remove",values:[e]})},tokenWithEnter:e8})));return x=eQ?nv:d.createElement("div",(0,o.Z)({className:np},ek,{ref:eH,onMouseDown:function(e){var n,t=e.target,o=null===(n=e_.current)||void 0===n?void 0:n.getPopupElement();if(o&&o.contains(t)){var r=setTimeout(function(){var e,n=no.indexOf(r);-1!==n&&no.splice(n,1),eB(),eL||o.contains(document.activeElement)||null===(e=eK.current)||void 0===e||e.focus()});no.push(r)}for(var u=arguments.length,a=Array(u>1?u-1:0),i=1;i<u;i++)a[i-1]=arguments[i];null==eI||eI.apply(void 0,[e].concat(a))},onKeyDown:function(e){var n,t=ne(),o=e.which;if(o!==g.Z.ENTER||("combobox"!==B&&e.preventDefault(),e2||e5(!0)),nn(!!eG),o===g.Z.BACKSPACE&&!t&&eT&&!eG&&L.length){for(var u=(0,r.Z)(L),a=null,i=u.length-1;i>=0;i-=1){var l=u[i];if(!l.disabled){u.splice(i,1),a=l;break}}a&&A(u,{type:"remove",values:[a]})}for(var c=arguments.length,s=Array(c>1?c-1:0),f=1;f<c;f++)s[f-1]=arguments[f];e2&&eW.current&&(n=eW.current).onKeyDown.apply(n,[e].concat(s)),null==eD||eD.apply(void 0,[e].concat(s))},onKeyUp:function(e){for(var n,t=arguments.length,o=Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];e2&&eW.current&&(n=eW.current).onKeyUp.apply(n,[e].concat(o)),null==ex||ex.apply(void 0,[e].concat(o))},onFocus:function(){ej(!0),!G&&(eM&&!nt.current&&eM.apply(void 0,arguments),eC.includes("focus")&&e5(!0)),nt.current=!0},onBlur:function(){ej(!1,function(){nt.current=!1,e5(!1)}),!G&&(eG&&("tags"===B?ea(eG,{source:"submit"}):"multiple"===B&&ea("",{source:"blur"})),eR&&eR.apply(void 0,arguments))}}),ez&&!e2&&d.createElement("span",{style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0},"aria-live":"polite"},"".concat(L.map(function(e){var n=e.label,t=e.value;return["number","string"].includes((0,c.Z)(n))?n:t}).join(", "))),nv,M,R),d.createElement(Z.Provider,{value:ns},x)}),B=function(e,n){var t=d.useRef({values:new Map,options:new Map});return[d.useMemo(function(){var o=t.current,r=o.values,u=o.options,i=e.map(function(e){if(void 0===e.label){var n;return(0,a.Z)((0,a.Z)({},e),{},{label:null===(n=r.get(e.value))||void 0===n?void 0:n.label})}return e}),l=new Map,c=new Map;return i.forEach(function(e){l.set(e.value,e),c.set(e.value,n.get(e.value)||u.get(e.value))}),t.current.values=l,t.current.options=c,i},[e,n]),d.useCallback(function(e){return n.get(e)||t.current.options.get(e)},[n])]};function G(e,n){return R(e).join("").toUpperCase().includes(n)}var X=t(88708),Q=t(50344),J=["children","value"],$=["children"];function q(e){var n=d.useRef();return n.current=e,d.useCallback(function(){return n.current.apply(n,arguments)},[])}var ee=function(){return null};ee.isSelectOptGroup=!0;var en=ee,et=function(){return null};et.isSelectOption=!0;var eo=et,er=t(98423),eu=t(56982),ea=t(73453),ei=d.createContext(null),el=["disabled","title","children","style","className"];function ec(e){return"string"==typeof e||"number"==typeof e}var es=d.forwardRef(function(e,n){var t=w(),a=t.prefixCls,c=t.id,s=t.open,f=t.multiple,p=t.mode,m=t.searchValue,h=t.toggleOpen,b=t.notFoundContent,Z=t.onPopupScroll,E=d.useContext(ei),S=E.flattenOptions,M=E.onActiveValue,R=E.defaultActiveFirstOption,x=E.onSelect,D=E.menuItemSelectedIcon,I=E.rawValues,N=E.fieldNames,T=E.virtual,P=E.listHeight,k=E.listItemHeight,O="".concat(a,"-item"),V=(0,eu.Z)(function(){return S},[s,S],function(e,n){return n[0]&&e[1]!==n[1]}),L=d.useRef(null),A=function(e){e.preventDefault()},H=function(e){L.current&&L.current.scrollTo("number"==typeof e?{index:e}:e)},F=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=V.length,o=0;o<t;o+=1){var r=(e+o*n+t)%t,u=V[r],a=u.group,i=u.data;if(!a&&!i.disabled)return r}return -1},_=d.useState(function(){return F(0)}),K=(0,i.Z)(_,2),W=K[0],U=K[1],Y=function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];U(e);var t={source:n?"keyboard":"mouse"},o=V[e];if(!o){M(null,-1,t);return}M(o.value,e,t)};(0,d.useEffect)(function(){Y(!1!==R?F(0):-1)},[V.length,m]);var z=d.useCallback(function(e){return I.has(e)&&"combobox"!==p},[p,(0,r.Z)(I).toString(),I.size]);(0,d.useEffect)(function(){var e,n=setTimeout(function(){if(!f&&s&&1===I.size){var e=Array.from(I)[0],n=V.findIndex(function(n){return n.data.value===e});-1!==n&&(Y(n),H(n))}});return s&&(null===(e=L.current)||void 0===e||e.scrollTo(void 0)),function(){return clearTimeout(n)}},[s,m]);var j=function(e){void 0!==e&&x(e,{selected:!I.has(e)}),f||h(!1)};if(d.useImperativeHandle(n,function(){return{onKeyDown:function(e){var n=e.which,t=e.ctrlKey;switch(n){case g.Z.N:case g.Z.P:case g.Z.UP:case g.Z.DOWN:var o=0;if(n===g.Z.UP?o=-1:n===g.Z.DOWN?o=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&t&&(n===g.Z.N?o=1:n===g.Z.P&&(o=-1)),0!==o){var r=F(W+o,o);H(r),Y(r,!0)}break;case g.Z.ENTER:var u=V[W];u&&!u.data.disabled?j(u.value):j(void 0),s&&e.preventDefault();break;case g.Z.ESC:h(!1),s&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){H(e)}}}),0===V.length)return d.createElement("div",{role:"listbox",id:"".concat(c,"_list"),className:"".concat(O,"-empty"),onMouseDown:A},b);var B=Object.keys(N).map(function(e){return N[e]}),G=function(e){return e.label},X=function(e){var n=V[e];if(!n)return null;var t=n.data||{},r=t.value,u=n.group,a=(0,y.Z)(t,!0),i=G(n);return n?d.createElement("div",(0,o.Z)({"aria-label":"string"!=typeof i||u?null:i},a,{key:e,role:u?"presentation":"option",id:"".concat(c,"_list_").concat(e),"aria-selected":z(r)}),r):null};return d.createElement(d.Fragment,null,d.createElement("div",{role:"listbox",id:"".concat(c,"_list"),style:{height:0,width:0,overflow:"hidden"}},X(W-1),X(W),X(W+1)),d.createElement(ea.Z,{itemKey:"key",ref:L,data:V,height:P,itemHeight:k,fullHeight:!1,onMouseDown:A,onScroll:Z,virtual:T},function(e,n){var t=e.group,r=e.groupOption,a=e.data,i=e.label,c=e.value,s=a.key;if(t){var f,p,m=null!==(p=a.title)&&void 0!==p?p:ec(i)?i.toString():void 0;return d.createElement("div",{className:v()(O,"".concat(O,"-group")),title:m},void 0!==i?i:s)}var h=a.disabled,g=a.title,b=(a.children,a.style),Z=a.className,w=(0,l.Z)(a,el),E=(0,er.Z)(w,B),S=z(c),M="".concat(O,"-option"),R=v()(O,M,Z,(f={},(0,u.Z)(f,"".concat(M,"-grouped"),r),(0,u.Z)(f,"".concat(M,"-active"),W===n&&!h),(0,u.Z)(f,"".concat(M,"-disabled"),h),(0,u.Z)(f,"".concat(M,"-selected"),S),f)),x=G(e),I=!D||"function"==typeof D||S,N="number"==typeof x?x:x||c,T=ec(N)?N.toString():void 0;return void 0!==g&&(T=g),d.createElement("div",(0,o.Z)({},(0,y.Z)(E),{"aria-selected":S,className:R,title:T,onMouseMove:function(){W===n||h||Y(n)},onClick:function(){h||j(c)},style:b}),d.createElement("div",{className:"".concat(M,"-content")},N),d.isValidElement(D)||S,I&&d.createElement(C,{className:"".concat(O,"-option-state"),customizeIcon:D,customizeIconProps:{isSelected:S}},S?"✓":null))}))});es.displayName="OptionList";var ef=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],ed=["inputValue"],ep=d.forwardRef(function(e,n){var t,f=e.id,p=e.mode,v=e.prefixCls,m=e.backfill,h=e.fieldNames,g=e.inputValue,b=e.searchValue,Z=e.onSearch,w=e.autoClearSearchValue,E=void 0===w||w,y=e.onSelect,S=e.onDeselect,C=e.dropdownMatchSelectWidth,M=void 0===C||C,x=e.filterOption,D=e.filterSort,I=e.optionFilterProp,N=e.optionLabelProp,T=e.options,P=e.children,k=e.defaultActiveFirstOption,O=e.menuItemSelectedIcon,V=e.virtual,L=e.listHeight,A=void 0===L?200:L,H=e.listItemHeight,F=void 0===H?20:H,U=e.value,Y=e.defaultValue,ee=e.labelInValue,en=e.onChange,et=(0,l.Z)(e,ef),eo=(0,X.ZP)(f),er=z(p),eu=!!(!T&&P),ea=d.useMemo(function(){return(void 0!==x||"combobox"!==p)&&x},[x,p]),el=d.useMemo(function(){return K(h,eu)},[JSON.stringify(h),eu]),ec=(0,s.Z)("",{value:void 0!==b?b:g,postState:function(e){return e||""}}),ep=(0,i.Z)(ec,2),ev=ep[0],em=ep[1],eh=d.useMemo(function(){var e=T;T||(e=function e(n){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,Q.Z)(n).map(function(n,o){if(!d.isValidElement(n)||!n.type)return null;var r,u,i,c,s,f=n.type.isSelectOptGroup,p=n.key,v=n.props,m=v.children,h=(0,l.Z)(v,$);return t||!f?(r=n.key,i=(u=n.props).children,c=u.value,s=(0,l.Z)(u,J),(0,a.Z)({key:r,value:void 0!==c?c:r,children:i},s)):(0,a.Z)((0,a.Z)({key:"__RC_SELECT_GRP__".concat(null===p?o:p,"__"),label:p},h),{},{options:e(m)})}).filter(function(e){return e})}(P));var n=new Map,t=new Map,o=function(e,n,t){t&&"string"==typeof t&&e.set(n[t],n)};return function e(r){for(var u=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=0;a<r.length;a+=1){var i=r[a];!i[el.options]||u?(n.set(i[el.value],i),o(t,i,el.label),o(t,i,I),o(t,i,N)):e(i[el.options],!0)}}(e),{options:e,valueOptions:n,labelOptions:t}},[T,P,el,I,N]),eg=eh.valueOptions,eb=eh.labelOptions,eZ=eh.options,ew=d.useCallback(function(e){return R(e).map(function(e){e&&"object"===(0,c.Z)(e)?(o=e.key,t=e.label,n=null!==(a=e.value)&&void 0!==a?a:o):n=e;var n,t,o,r,u,a,i,l=eg.get(n);return l&&(void 0===t&&(t=null==l?void 0:l[N||el.label]),void 0===o&&(o=null!==(i=null==l?void 0:l.key)&&void 0!==i?i:n),r=null==l?void 0:l.disabled,u=null==l?void 0:l.title),{label:t,value:n,key:o,disabled:r,title:u}})},[el,N,eg]),eE=(0,s.Z)(Y,{value:U}),ey=(0,i.Z)(eE,2),eS=ey[0],eC=ey[1],eM=B(d.useMemo(function(){var e,n=ew(eS);return"combobox"!==p||null!==(e=n[0])&&void 0!==e&&e.value?n:[]},[eS,ew,p]),eg),eR=(0,i.Z)(eM,2),ex=eR[0],eD=eR[1],eI=d.useMemo(function(){if(!p&&1===ex.length){var e=ex[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return ex.map(function(e){var n;return(0,a.Z)((0,a.Z)({},e),{},{label:null!==(n=e.label)&&void 0!==n?n:e.value})})},[p,ex]),eN=d.useMemo(function(){return new Set(ex.map(function(e){return e.value}))},[ex]);d.useEffect(function(){if("combobox"===p){var e,n=null===(e=ex[0])||void 0===e?void 0:e.value;em(null!=n?String(n):"")}},[ex]);var eT=q(function(e,n){var t,o=null!=n?n:e;return t={},(0,u.Z)(t,el.value,e),(0,u.Z)(t,el.label,o),t}),eP=(t=d.useMemo(function(){if("tags"!==p)return eZ;var e=(0,r.Z)(eZ);return(0,r.Z)(ex).sort(function(e,n){return e.value<n.value?-1:1}).forEach(function(n){var t=n.value;eg.has(t)||e.push(eT(t,n.label))}),e},[eT,eZ,eg,ex,p]),d.useMemo(function(){if(!ev||!1===ea)return t;var e=el.options,n=el.label,o=el.value,r=[],i="function"==typeof ea,l=ev.toUpperCase(),c=i?ea:function(t,r){return I?G(r[I],l):r[e]?G(r["children"!==n?n:"label"],l):G(r[o],l)},s=i?function(e){return W(e)}:function(e){return e};return t.forEach(function(n){if(n[e]){if(c(ev,s(n)))r.push(n);else{var t=n[e].filter(function(e){return c(ev,s(e))});t.length&&r.push((0,a.Z)((0,a.Z)({},n),{},(0,u.Z)({},e,t)))}return}c(ev,s(n))&&r.push(n)}),r},[t,ea,I,ev,el])),ek=d.useMemo(function(){return"tags"!==p||!ev||eP.some(function(e){return e[I||"value"]===ev})?eP:[eT(ev)].concat((0,r.Z)(eP))},[eT,I,p,eP,ev]),eO=d.useMemo(function(){return D?(0,r.Z)(ek).sort(function(e,n){return D(e,n)}):ek},[ek,D]),eV=d.useMemo(function(){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=n.fieldNames,o=n.childrenAsData,r=[],u=K(t,!1),a=u.label,i=u.value,l=u.options;return!function e(n,t){n.forEach(function(n){var u=n[a];if(!t&&l in n){var c=u;void 0===c&&o&&(c=n.label),r.push({key:_(n,r.length),group:!0,data:n,label:c}),e(n[l],!0)}else{var s=n[i];r.push({key:_(n,r.length),groupOption:t,data:n,label:u,value:s})}})}(e,!1),r}(eO,{fieldNames:el,childrenAsData:eu})},[eO,el,eu]),eL=function(e){var n=ew(e);if(eC(n),en&&(n.length!==ex.length||n.some(function(e,n){var t;return(null===(t=ex[n])||void 0===t?void 0:t.value)!==(null==e?void 0:e.value)}))){var t=ee?n:n.map(function(e){return e.value}),o=n.map(function(e){return W(eD(e.value))});en(er?t:t[0],er?o:o[0])}},eA=d.useState(null),eH=(0,i.Z)(eA,2),eF=eH[0],e_=eH[1],eK=d.useState(0),eW=(0,i.Z)(eK,2),eU=eW[0],eY=eW[1],ez=void 0!==k?k:"combobox"!==p,ej=d.useCallback(function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=t.source;eY(n),m&&"combobox"===p&&null!==e&&"keyboard"===(void 0===o?"keyboard":o)&&e_(String(e))},[m,p]),eB=function(e,n,t){var o=function(){var n,t=eD(e);return[ee?{label:null==t?void 0:t[el.label],value:e,key:null!==(n=null==t?void 0:t.key)&&void 0!==n?n:e}:e,W(t)]};if(n&&y){var r=o(),u=(0,i.Z)(r,2);y(u[0],u[1])}else if(!n&&S&&"clear"!==t){var a=o(),l=(0,i.Z)(a,2);S(l[0],l[1])}},eG=q(function(e,n){var t=!er||n.selected;eL(t?er?[].concat((0,r.Z)(ex),[e]):[e]:ex.filter(function(n){return n.value!==e})),eB(e,t),"combobox"===p?e_(""):(!z||E)&&(em(""),e_(""))}),eX=d.useMemo(function(){var e=!1!==V&&!1!==M;return(0,a.Z)((0,a.Z)({},eh),{},{flattenOptions:eV,onActiveValue:ej,defaultActiveFirstOption:ez,onSelect:eG,menuItemSelectedIcon:O,rawValues:eN,fieldNames:el,virtual:e,listHeight:A,listItemHeight:F,childrenAsData:eu})},[eh,eV,ej,ez,eG,O,eN,el,V,M,A,F,eu]);return d.createElement(ei.Provider,{value:eX},d.createElement(j,(0,o.Z)({},et,{id:eo,prefixCls:void 0===v?"rc-select":v,ref:n,omitDomProps:ed,mode:p,displayValues:eI,onDisplayValuesChange:function(e,n){eL(e);var t=n.type,o=n.values;("remove"===t||"clear"===t)&&o.forEach(function(e){eB(e.value,!1,t)})},searchValue:ev,onSearch:function(e,n){if(em(e),e_(null),"submit"===n.source){var t=(e||"").trim();t&&(eL(Array.from(new Set([].concat((0,r.Z)(eN),[t])))),eB(t,!0),em(""));return}"blur"!==n.source&&("combobox"===p&&eL(e),null==Z||Z(e))},autoClearSearchValue:E,onSearchSplit:function(e){var n=e;"tags"!==p&&(n=e.map(function(e){var n=eb.get(e);return null==n?void 0:n.value}).filter(function(e){return void 0!==e}));var t=Array.from(new Set([].concat((0,r.Z)(eN),(0,r.Z)(n))));eL(t),t.forEach(function(e){eB(e,!0)})},dropdownMatchSelectWidth:M,OptionList:es,emptyOptions:!eV.length,activeValue:eF,activeDescendantId:"".concat(eo,"_list_").concat(eU)})))});ep.Option=eo,ep.OptGroup=en;var ev=ep},73453:function(e,n,t){t.d(n,{Z:function(){return P}});var o=t(87462),r=t(1413),u=t(4942),a=t(97685),i=t(45987),l=t(67294),c=t(94184),s=t.n(c),f=t(48555),d=l.forwardRef(function(e,n){var t=e.height,a=e.offset,i=e.children,c=e.prefixCls,d=e.onInnerResize,p=e.innerProps,v={},m={display:"flex",flexDirection:"column"};return void 0!==a&&(v={height:t,position:"relative",overflow:"hidden"},m=(0,r.Z)((0,r.Z)({},m),{},{transform:"translateY(".concat(a,"px)"),position:"absolute",left:0,right:0,top:0})),l.createElement("div",{style:v},l.createElement(f.default,{onResize:function(e){e.offsetHeight&&d&&d()}},l.createElement("div",(0,o.Z)({style:m,className:s()((0,u.Z)({},"".concat(c,"-holder-inner"),c)),ref:n},p),i)))});d.displayName="Filler";var p=t(15671),v=t(43144),m=t(32531),h=t(73568),g=t(75164);function b(e){return"touches"in e?e.touches[0].pageY:e.pageY}var Z=function(e){(0,m.Z)(t,e);var n=(0,h.Z)(t);function t(){var e;(0,p.Z)(this,t);for(var o=arguments.length,r=Array(o),u=0;u<o;u++)r[u]=arguments[u];return(e=n.call.apply(n,[this].concat(r))).moveRaf=null,e.scrollbarRef=l.createRef(),e.thumbRef=l.createRef(),e.visibleTimeout=null,e.state={dragging:!1,pageY:null,startTop:null,visible:!1},e.delayHidden=function(){clearTimeout(e.visibleTimeout),e.setState({visible:!0}),e.visibleTimeout=setTimeout(function(){e.setState({visible:!1})},2e3)},e.onScrollbarTouchStart=function(e){e.preventDefault()},e.onContainerMouseDown=function(e){e.stopPropagation(),e.preventDefault()},e.patchEvents=function(){window.addEventListener("mousemove",e.onMouseMove),window.addEventListener("mouseup",e.onMouseUp),e.thumbRef.current.addEventListener("touchmove",e.onMouseMove),e.thumbRef.current.addEventListener("touchend",e.onMouseUp)},e.removeEvents=function(){window.removeEventListener("mousemove",e.onMouseMove),window.removeEventListener("mouseup",e.onMouseUp),e.thumbRef.current&&(e.thumbRef.current.removeEventListener("touchmove",e.onMouseMove),e.thumbRef.current.removeEventListener("touchend",e.onMouseUp)),g.Z.cancel(e.moveRaf)},e.onMouseDown=function(n){var t=e.props.onStartMove;e.setState({dragging:!0,pageY:b(n),startTop:e.getTop()}),t(),e.patchEvents(),n.stopPropagation(),n.preventDefault()},e.onMouseMove=function(n){var t=e.state,o=t.dragging,r=t.pageY,u=t.startTop,a=e.props.onScroll;if(g.Z.cancel(e.moveRaf),o){var i=b(n)-r,l=e.getEnableScrollRange(),c=e.getEnableHeightRange(),s=Math.ceil((c?(u+i)/c:0)*l);e.moveRaf=(0,g.Z)(function(){a(s)})}},e.onMouseUp=function(){var n=e.props.onStopMove;e.setState({dragging:!1}),n(),e.removeEvents()},e.getSpinHeight=function(){var n=e.props,t=n.height,o=t/n.count*10;return Math.floor(o=Math.min(o=Math.max(o,20),t/2))},e.getEnableScrollRange=function(){var n=e.props;return n.scrollHeight-n.height||0},e.getEnableHeightRange=function(){return e.props.height-e.getSpinHeight()||0},e.getTop=function(){var n=e.props.scrollTop,t=e.getEnableScrollRange(),o=e.getEnableHeightRange();return 0===n||0===t?0:n/t*o},e.showScroll=function(){var n=e.props,t=n.height;return n.scrollHeight>t},e}return(0,v.Z)(t,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(e){e.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){var e,n;this.removeEvents(),null===(e=this.scrollbarRef.current)||void 0===e||e.removeEventListener("touchstart",this.onScrollbarTouchStart),null===(n=this.thumbRef.current)||void 0===n||n.removeEventListener("touchstart",this.onMouseDown),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var e=this.state,n=e.dragging,t=e.visible,o=this.props,a=o.prefixCls,i=o.direction,c=this.getSpinHeight(),f=this.getTop(),d=this.showScroll(),p=d&&t;return l.createElement("div",{ref:this.scrollbarRef,className:s()("".concat(a,"-scrollbar"),(0,u.Z)({},"".concat(a,"-scrollbar-show"),d)),style:(0,r.Z)((0,r.Z)({width:8,top:0,bottom:0},"rtl"===i?{left:0}:{right:0}),{},{position:"absolute",display:p?null:"none"}),onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},l.createElement("div",{ref:this.thumbRef,className:s()("".concat(a,"-scrollbar-thumb"),(0,u.Z)({},"".concat(a,"-scrollbar-thumb-moving"),n)),style:{width:"100%",height:c,top:f,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}]),t}(l.Component);function w(e){var n=e.children,t=e.setRef,o=l.useCallback(function(e){t(e)},[]);return l.cloneElement(n,{ref:o})}var E=t(34203),y=function(){function e(){(0,p.Z)(this,e),this.maps=void 0,this.maps=Object.create(null)}return(0,v.Z)(e,[{key:"set",value:function(e,n){this.maps[e]=n}},{key:"get",value:function(e){return this.maps[e]}}]),e}(),S=t(71002),C=("undefined"==typeof navigator?"undefined":(0,S.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),M=function(e,n){var t=(0,l.useRef)(!1),o=(0,l.useRef)(null),r=(0,l.useRef)({top:e,bottom:n});return r.current.top=e,r.current.bottom=n,function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],u=e<0&&r.current.top||e>0&&r.current.bottom;return n&&u?(clearTimeout(o.current),t.current=!1):(!u||t.current)&&(clearTimeout(o.current),t.current=!0,o.current=setTimeout(function(){t.current=!1},50)),!t.current&&u}},R=t(8410),x=14/15,D=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","component","onScroll","onVisibleChange","innerProps"],I=[],N={overflowY:"auto",overflowAnchor:"none"},T=l.forwardRef(function(e,n){var t,c,f,p,v,m,h,b,T,P,k,O,V,L,A,H,F,_,K,W,U,Y,z,j,B,G,X=e.prefixCls,Q=void 0===X?"rc-virtual-list":X,J=e.className,$=e.height,q=e.itemHeight,ee=e.fullHeight,en=e.style,et=e.data,eo=e.children,er=e.itemKey,eu=e.virtual,ea=e.direction,ei=e.component,el=void 0===ei?"div":ei,ec=e.onScroll,es=e.onVisibleChange,ef=e.innerProps,ed=(0,i.Z)(e,D),ep=!!(!1!==eu&&$&&q),ev=ep&&et&&q*et.length>$,em=(0,l.useState)(0),eh=(0,a.Z)(em,2),eg=eh[0],eb=eh[1],eZ=(0,l.useState)(!1),ew=(0,a.Z)(eZ,2),eE=ew[0],ey=ew[1],eS=s()(Q,(0,u.Z)({},"".concat(Q,"-rtl"),"rtl"===ea),J),eC=et||I,eM=(0,l.useRef)(),eR=(0,l.useRef)(),ex=(0,l.useRef)(),eD=l.useCallback(function(e){return"function"==typeof er?er(e):null==e?void 0:e[er]},[er]);function eI(e){eb(function(n){var t,o=(t="function"==typeof e?e(n):e,Number.isNaN(ej.current)||(t=Math.min(t,ej.current)),t=Math.max(t,0));return eM.current.scrollTop=o,o})}var eN=(0,l.useRef)({start:0,end:eC.length}),eT=(0,l.useRef)(),eP=(c=l.useState(eC),p=(f=(0,a.Z)(c,2))[0],v=f[1],m=l.useState(null),b=(h=(0,a.Z)(m,2))[0],T=h[1],l.useEffect(function(){var e=function(e,n,t){var o,r,u=e.length,a=n.length;if(0===u&&0===a)return null;u<a?(o=e,r=n):(o=n,r=e);var i={__EMPTY_ITEM__:!0};function l(e){return void 0!==e?t(e):i}for(var c=null,s=1!==Math.abs(u-a),f=0;f<r.length;f+=1){var d=l(o[f]);if(d!==l(r[f])){c=f,s=s||d!==l(r[f+1]);break}}return null===c?null:{index:c,multiple:s}}(p||[],eC||[],eD);(null==e?void 0:e.index)!==void 0&&(null==t||t(e.index),T(eC[e.index])),v(eC)},[eC]),[b]),ek=(0,a.Z)(eP,1)[0];eT.current=ek;var eO=function(e,n,t){var o=l.useState(0),r=(0,a.Z)(o,2),u=r[0],i=r[1],c=(0,l.useRef)(new Map),s=(0,l.useRef)(new y),f=(0,l.useRef)();function d(){g.Z.cancel(f.current)}function p(){d(),f.current=(0,g.Z)(function(){c.current.forEach(function(e,n){if(e&&e.offsetParent){var t=(0,E.Z)(e),o=t.offsetHeight;s.current.get(n)!==o&&s.current.set(n,t.offsetHeight)}}),i(function(e){return e+1})})}return(0,l.useEffect)(function(){return d},[]),[function(o,r){var u=e(o),a=c.current.get(u);r?(c.current.set(u,r),p()):c.current.delete(u),!a!=!r&&(r?null==n||n(o):null==t||t(o))},p,s.current,u]}(eD,null,null),eV=(0,a.Z)(eO,4),eL=eV[0],eA=eV[1],eH=eV[2],eF=eV[3],e_=l.useMemo(function(){if(!ep)return{scrollHeight:void 0,start:0,end:eC.length-1,offset:void 0};if(!ev)return{scrollHeight:(null===(e=eR.current)||void 0===e?void 0:e.offsetHeight)||0,start:0,end:eC.length-1,offset:void 0};for(var e,n,t,o,r=0,u=eC.length,a=0;a<u;a+=1){var i=eD(eC[a]),l=eH.get(i),c=r+(void 0===l?q:l);c>=eg&&void 0===n&&(n=a,t=r),c>eg+$&&void 0===o&&(o=a),r=c}return void 0===n&&(n=0,t=0,o=Math.ceil($/q)),void 0===o&&(o=eC.length-1),{scrollHeight:r,start:n,end:o=Math.min(o+1,eC.length),offset:t}},[ev,ep,eg,eC,eF,$]),eK=e_.scrollHeight,eW=e_.start,eU=e_.end,eY=e_.offset;eN.current.start=eW,eN.current.end=eU;var ez=eK-$,ej=(0,l.useRef)(ez);ej.current=ez;var eB=eg<=0,eG=eg>=ez,eX=M(eB,eG),eQ=(P=function(e){eI(function(n){return n+e})},k=(0,l.useRef)(0),O=(0,l.useRef)(null),V=(0,l.useRef)(null),L=(0,l.useRef)(!1),A=M(eB,eG),[function(e){if(ep){g.Z.cancel(O.current);var n=e.deltaY;k.current+=n,V.current=n,A(n)||(C||e.preventDefault(),O.current=(0,g.Z)(function(){var e=L.current?10:1;P(k.current*e),k.current=0}))}},function(e){ep&&(L.current=e.detail===V.current)}]),eJ=(0,a.Z)(eQ,2),e$=eJ[0],eq=eJ[1];H=function(e,n){return!eX(e,n)&&(e$({preventDefault:function(){},deltaY:e}),!0)},_=(0,l.useRef)(!1),K=(0,l.useRef)(0),W=(0,l.useRef)(null),U=(0,l.useRef)(null),Y=function(e){if(_.current){var n=Math.ceil(e.touches[0].pageY),t=K.current-n;K.current=n,H(t)&&e.preventDefault(),clearInterval(U.current),U.current=setInterval(function(){(!H(t*=x,!0)||.1>=Math.abs(t))&&clearInterval(U.current)},16)}},z=function(){_.current=!1,F()},j=function(e){F(),1!==e.touches.length||_.current||(_.current=!0,K.current=Math.ceil(e.touches[0].pageY),W.current=e.target,W.current.addEventListener("touchmove",Y),W.current.addEventListener("touchend",z))},F=function(){W.current&&(W.current.removeEventListener("touchmove",Y),W.current.removeEventListener("touchend",z))},(0,R.Z)(function(){return ep&&eM.current.addEventListener("touchstart",j),function(){var e;null===(e=eM.current)||void 0===e||e.removeEventListener("touchstart",j),F(),clearInterval(U.current)}},[ep]),(0,R.Z)(function(){function e(e){ep&&e.preventDefault()}return eM.current.addEventListener("wheel",e$),eM.current.addEventListener("DOMMouseScroll",eq),eM.current.addEventListener("MozMousePixelScroll",e),function(){eM.current&&(eM.current.removeEventListener("wheel",e$),eM.current.removeEventListener("DOMMouseScroll",eq),eM.current.removeEventListener("MozMousePixelScroll",e))}},[ep]);var e0=(B=function(){var e;null===(e=ex.current)||void 0===e||e.delayHidden()},G=l.useRef(),function(e){if(null==e){B();return}if(g.Z.cancel(G.current),"number"==typeof e)eI(e);else if(e&&"object"===(0,S.Z)(e)){var n,t=e.align;n="index"in e?e.index:eC.findIndex(function(n){return eD(n)===e.key});var o=e.offset,r=void 0===o?0:o;!function e(o,u){if(!(o<0)&&eM.current){var a=eM.current.clientHeight,i=!1,l=u;if(a){for(var c=0,s=0,f=0,d=Math.min(eC.length,n),p=0;p<=d;p+=1){var v=eD(eC[p]);s=c;var m=eH.get(v);c=f=s+(void 0===m?q:m),p===n&&void 0===m&&(i=!0)}var h=null;switch(u||t){case"top":h=s-r;break;case"bottom":h=f-a+r;break;default:var b=eM.current.scrollTop;s<b?l="top":f>b+a&&(l="bottom")}null!==h&&h!==eM.current.scrollTop&&eI(h)}G.current=(0,g.Z)(function(){i&&eA(),e(o-1,l)},2)}}(3)}});l.useImperativeHandle(n,function(){return{scrollTo:e0}}),(0,R.Z)(function(){es&&es(eC.slice(eW,eU+1),eC)},[eW,eU,eC]);var e1=eC.slice(eW,eU+1).map(function(e,n){var t=eo(e,eW+n,{}),o=eD(e);return l.createElement(w,{key:o,setRef:function(n){return eL(e,n)}},t)}),e2=null;return $&&(e2=(0,r.Z)((0,u.Z)({},void 0===ee||ee?"height":"maxHeight",$),N),ep&&(e2.overflowY="hidden",eE&&(e2.pointerEvents="none"))),l.createElement("div",(0,o.Z)({style:(0,r.Z)((0,r.Z)({},en),{},{position:"relative"}),className:eS},ed),l.createElement(el,{className:"".concat(Q,"-holder"),style:e2,ref:eM,onScroll:function(e){var n=e.currentTarget.scrollTop;n!==eg&&eI(n),null==ec||ec(e)}},l.createElement(d,{prefixCls:Q,height:eK,offset:eY,onInnerResize:eA,ref:eR,innerProps:ef},e1)),ep&&l.createElement(Z,{ref:ex,prefixCls:Q,scrollTop:eg,height:$,scrollHeight:eK,count:eC.length,direction:ea,onScroll:function(e){eI(e)},onStartMove:function(){ey(!0)},onStopMove:function(){ey(!1)}}))});T.displayName="List";var P=T}}]); |