1 line
37 KiB
JavaScript
1 line
37 KiB
JavaScript
"use strict";(self.webpackChunkkms=self.webpackChunkkms||[]).push([[870],{5870:(e,t,n)=>{function r(e,t,n){return void 0===t&&void 0===n?e:void 0!==t&&void 0===n?Math.max(e,t):void 0===t&&void 0!==n?Math.min(e,n):Math.min(Math.max(e,t),n)}function u(e){return"string"!=typeof e?"":e.charAt(0).toLowerCase()+e.slice(1)}function o(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function c(e,t){const n=Math.abs(t-e)+1;return e>t?Array.from({length:n},(t,n)=>e-n):Array.from({length:n},(t,n)=>n+e)}function s(e,t){if(e===t)return!0;if(Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object&&t instanceof Object))return!1;const n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let u=0;u<r;u+=1){const r=n[u];if(!(r in t))return!1;if(!(e[r]===t[r]||Number.isNaN(e[r])&&Number.isNaN(t[r])))return!1}return!0}function i(e){return"string"!=typeof e?"":e.charAt(0).toUpperCase()+e.slice(1)}n.r(t),n.d(t,{assignRef:()=>G,clamp:()=>r,clampUseMovePosition:()=>te,getHotkeyHandler:()=>Ie,lowerFirst:()=>u,mergeRefs:()=>Z,normalizeRadialValue:()=>Et,randomId:()=>o,range:()=>c,readLocalStorageValue:()=>Y,readSessionStorageValue:()=>J,shallowEqual:()=>s,upperFirst:()=>i,useCallbackRef:()=>l,useClickOutside:()=>m,useClipboard:()=>h,useColorScheme:()=>w,useCounter:()=>g,useDebouncedCallback:()=>f,useDebouncedState:()=>E,useDebouncedValue:()=>y,useDidUpdate:()=>L,useDisclosure:()=>Ue,useDocumentTitle:()=>S,useDocumentVisibility:()=>k,useElementSize:()=>ve,useEventListener:()=>je,useEyeDropper:()=>ot,useFavicon:()=>et,useFetch:()=>gt,useFileDialog:()=>Ct,useFocusReturn:()=>R,useFocusTrap:()=>N,useFocusWithin:()=>Xe,useForceUpdate:()=>D,useFullscreen:()=>De,useHash:()=>Ce,useHeadroom:()=>ut,useHotkeys:()=>Fe,useHover:()=>ze,useId:()=>z,useIdle:()=>q,useInViewport:()=>ct,useInputState:()=>We,useIntersection:()=>Re,useInterval:()=>H,useIsFirstRender:()=>wt,useIsomorphicEffect:()=>b,useListState:()=>$,useLocalStorage:()=>X,useLogger:()=>Ve,useMap:()=>lt,useMediaQuery:()=>p,useMergedRef:()=>_,useMounted:()=>it,useMouse:()=>ee,useMove:()=>ne,useMutationObserver:()=>st,useNetwork:()=>Qe,useOrientation:()=>vt,useOs:()=>$e,usePageLeave:()=>ie,usePagination:()=>ce,usePrevious:()=>Ze,useQueue:()=>se,useRadialMove:()=>yt,useReducedMotion:()=>ae,useResizeObserver:()=>we,useScrollIntoView:()=>he,useScrollSpy:()=>Lt,useSessionStorage:()=>Q,useSet:()=>ft,useSetState:()=>Be,useShallowEffect:()=>ge,useStateHistory:()=>at,useTextSelection:()=>Ge,useThrottledCallback:()=>mt,useThrottledState:()=>ht,useThrottledValue:()=>pt,useTimeout:()=>Je,useToggle:()=>Ee,useUncontrolled:()=>re,useValidatedState:()=>Pe,useViewportSize:()=>be,useWindowEvent:()=>B,useWindowScroll:()=>Le});var a=n(4914);function l(e){const t=(0,a.useRef)(e);return(0,a.useEffect)(()=>{t.current=e}),(0,a.useMemo)(()=>(...e)=>t.current?.(...e),[])}function f(e,t){const n="number"==typeof t?t:t.delay,r="number"!=typeof t&&t.flushOnUnmount,u=l(e),o=(0,a.useRef)(0),c=(0,a.useRef)(()=>{}),s=Object.assign((0,a.useCallback)((...e)=>{window.clearTimeout(o.current);const t=()=>{0!==o.current&&(o.current=0,u(...e))};c.current=t,s.flush=t,o.current=window.setTimeout(t,n)},[u,n]),{flush:c.current});return(0,a.useEffect)(()=>()=>{window.clearTimeout(o.current),r&&s.flush()},[s,r]),s}const d=["mousedown","touchstart"];function m(e,t,n){const r=(0,a.useRef)(null);return(0,a.useEffect)(()=>{const u=t=>{const{target:u}=t??{};if(Array.isArray(n)){const r=u?.hasAttribute("data-ignore-outside-clicks")||!document.body.contains(u)&&"HTML"!==u.tagName;n.every(e=>!!e&&!t.composedPath().includes(e))&&!r&&e()}else r.current&&!r.current.contains(u)&&e()};return(t||d).forEach(e=>document.addEventListener(e,u)),()=>{(t||d).forEach(e=>document.removeEventListener(e,u))}},[r,e,n]),r}function h({timeout:e=2e3}={}){const[t,n]=(0,a.useState)(null),[r,u]=(0,a.useState)(!1),[o,c]=(0,a.useState)(null);return{copy:t=>{"clipboard"in navigator?navigator.clipboard.writeText(t).then(()=>(window.clearTimeout(o),c(window.setTimeout(()=>u(!1),e)),void u(true))).catch(e=>n(e)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{u(!1),n(null),window.clearTimeout(o)},error:t,copied:r}}function p(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,u]=(0,a.useState)(n?t:function(e){return"undefined"!=typeof window&&"matchMedia"in window&&window.matchMedia(e).matches}(e)),o=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),u(o.current.matches),function(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch(n){return e.addListener(t),()=>e.removeListener(t)}}(o.current,e=>u(e.matches))},[e]),r}function w(e,t){return p("(prefers-color-scheme: dark)","dark"===e,t)?"dark":"light"}const v={min:-1/0,max:1/0};function g(e=0,t){const{min:n,max:u}={...v,...t},[o,c]=(0,a.useState)(r(e,n,u));return[o,{increment:()=>c(e=>r(e+1,n,u)),decrement:()=>c(e=>r(e-1,n,u)),set:e=>c(r(e,n,u)),reset:()=>c(r(e,n,u))}]}function E(e,t,n={leading:!1}){const[r,u]=(0,a.useState)(e),o=(0,a.useRef)(null),c=(0,a.useRef)(!0),s=()=>window.clearTimeout(o.current);return(0,a.useEffect)(()=>s,[]),[r,(0,a.useCallback)(e=>{s(),c.current&&n.leading?u(e):o.current=window.setTimeout(()=>{c.current=!0,u(e)},t),c.current=!1},[n.leading])]}function y(e,t,n={leading:!1}){const[r,u]=(0,a.useState)(e),o=(0,a.useRef)(!1),c=(0,a.useRef)(null),s=(0,a.useRef)(!1),i=()=>window.clearTimeout(c.current);return(0,a.useEffect)(()=>{o.current&&(!s.current&&n.leading?(s.current=!0,u(e)):(i(),c.current=window.setTimeout(()=>{s.current=!1,u(e)},t)))},[e,n.leading,t]),(0,a.useEffect)(()=>(o.current=!0,i),[]),[r,i]}const b="undefined"!=typeof document?a.useLayoutEffect:a.useEffect;function S(e){b(()=>{"string"==typeof e&&e.trim().length>0&&(document.title=e.trim())},[e])}function k(){const[e,t]=(0,a.useState)("visible");return(0,a.useEffect)(()=>{const e=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),e}function L(e,t){const n=(0,a.useRef)(!1);(0,a.useEffect)(()=>()=>{n.current=!1},[]),(0,a.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}function R({opened:e,shouldReturnFocus:t=!0}){const n=(0,a.useRef)(null),r=()=>{n.current&&"focus"in n.current&&"function"==typeof n.current.focus&&n.current?.focus({preventScroll:!0})};return L(()=>{let u=-1;const o=e=>{"Tab"===e.key&&window.clearTimeout(u)};return document.addEventListener("keydown",o),e?n.current=document.activeElement:t&&(u=window.setTimeout(r,10)),()=>{window.clearTimeout(u),document.removeEventListener("keydown",o)}},[e,t]),r}const C=/input|select|textarea|button|object/,T="a, input, select, textarea, button, object, [tabindex]";function x(e){return"none"===e.style.display}function M(e){let t=e.getAttribute("tabindex");return null===t&&(t=void 0),parseInt(t,10)}function I(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(M(e));return(C.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&function(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||"hidden"===e.getAttribute("type"))return!1;let t=e;for(;t&&t!==document.body&&11!==t.nodeType;){if(x(t))return!1;t=t.parentNode}return!0}(e)}function F(e){const t=M(e);return(Number.isNaN(t)||t>=0)&&I(e)}function A(e){return Array.from(e.querySelectorAll(T)).filter(F)}function N(e=!0){const t=(0,a.useRef)(null),n=e=>{let t=e.querySelector("[data-autofocus]");if(!t){const n=Array.from(e.querySelectorAll(T));t=n.find(F)||n.find(I)||null,!t&&I(e)&&(t=e)}t&&t.focus({preventScroll:!0})},r=(0,a.useCallback)(r=>{e&&null!==r&&t.current!==r&&(r?(setTimeout(()=>{r.getRootNode()&&n(r)}),t.current=r):t.current=null)},[e]);return(0,a.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const r=e=>{"Tab"===e.key&&t.current&&function(e,t){const n=A(e);if(!n.length)return void t.preventDefault();const r=n[t.shiftKey?0:n.length-1],u=e.getRootNode();let o=r===u.activeElement||e===u.activeElement;const c=u.activeElement;if("INPUT"===c.tagName&&"radio"===c.getAttribute("type")&&(o=n.filter(e=>"radio"===e.getAttribute("type")&&e.getAttribute("name")===c.getAttribute("name")).includes(r)),!o)return;t.preventDefault();const s=n[t.shiftKey?n.length-1:0];s&&s.focus()}(t.current,e)};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e]),r}const O=e=>(e+1)%1e6;function D(){const[,e]=(0,a.useReducer)(O,0);return e}const V=a["useId".toString()]||(()=>{});function z(e){const t=function(){const e=V();return e?`mantine-${e.replace(/:/g,"")}`:""}(),[n,r]=(0,a.useState)(t);return b(()=>{r(o())},[]),"string"==typeof e?e:"undefined"==typeof window?t:n}const P={events:["keydown","mousemove","touchmove","click","scroll","wheel"],initialState:!0};function q(e,t){const{events:n,initialState:r}={...P,...t},[u,o]=(0,a.useState)(r),c=(0,a.useRef)(-1);return(0,a.useEffect)(()=>{const t=()=>{o(!1),c.current&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{o(!0)},e)};return n.forEach(e=>document.addEventListener(e,t)),c.current=window.setTimeout(()=>{o(!0)},e),()=>{n.forEach(e=>document.removeEventListener(e,t)),window.clearTimeout(c.current),c.current=-1}},[e]),u}function H(e,t,{autoInvoke:n=!1}={}){const[r,u]=(0,a.useState)(!1),o=(0,a.useRef)(null),c=(0,a.useRef)(null),s=()=>{u(e=>(e||o.current&&-1!==o.current||(o.current=window.setInterval(c.current,t)),!0))},i=()=>{u(!1),window.clearInterval(o.current||-1),o.current=-1};return(0,a.useEffect)(()=>(c.current=e,r&&s(),i),[e,r,t]),(0,a.useEffect)(()=>{n&&s()},[]),{start:s,stop:i,toggle:()=>{r?i():s()},active:r}}function $(e=[]){const[t,n]=(0,a.useState)(e);return[t,{setState:n,append:(...e)=>n(t=>[...t,...e]),prepend:(...e)=>n(t=>[...e,...t]),insert:(e,...t)=>n(n=>[...n.slice(0,e),...t,...n.slice(e)]),pop:()=>n(e=>{const t=[...e];return t.pop(),t}),shift:()=>n(e=>{const t=[...e];return t.shift(),t}),apply:e=>n(t=>t.map((t,n)=>e(t,n))),applyWhere:(e,t)=>n(n=>n.map((n,r)=>e(n,r)?t(n,r):n)),remove:(...e)=>n(t=>t.filter((t,n)=>!e.includes(n))),reorder:({from:e,to:t})=>n(n=>{const r=[...n],u=n[e];return r.splice(e,1),r.splice(t,0,u),r}),swap:({from:e,to:t})=>n(n=>{const r=[...n],u=r[e],o=r[t];return r.splice(t,1,u),r.splice(e,1,o),r}),setItem:(e,t)=>n(n=>{const r=[...n];return r[e]=t,r}),setItemProp:(e,t,r)=>n(n=>{const u=[...n];return u[e]={...u[e],[t]:r},u}),filter:e=>{n(t=>t.filter(e))}}]}function B(e,t,n){(0,a.useEffect)(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function K(e){try{return e&&JSON.parse(e)}catch{return e}}function W(e){return{getItem:t=>{try{return window[e].getItem(t)}catch(e){return console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked"),null}},setItem:(t,n)=>{try{window[e].setItem(t,n)}catch(e){console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}},removeItem:t=>{try{window[e].removeItem(t)}catch(e){console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}}}}function j(e,t){const n="localStorage"===e?"mantine-local-storage":"mantine-session-storage",{getItem:r,setItem:u,removeItem:o}=W(e);return function({key:c,defaultValue:s,getInitialValueInEffect:i=!0,sync:l=!0,deserialize:f=K,serialize:d=e=>function(e,t="use-local-storage"){try{return JSON.stringify(e)}catch(e){throw new Error(`@mantine/hooks ${t}: Failed to serialize the value`)}}(e,t)}){const m=(0,a.useCallback)(t=>{let n;try{n="undefined"==typeof window||!(e in window)||null===window[e]||!!t}catch(e){n=!0}if(n)return s;const u=r(c);return null!==u?f(u):s},[c,s]),[h,p]=(0,a.useState)(m(i)),w=(0,a.useCallback)(e=>{e instanceof Function?p(t=>{const r=e(t);return u(c,d(r)),window.dispatchEvent(new CustomEvent(n,{detail:{key:c,value:e(t)}})),r}):(u(c,d(e)),window.dispatchEvent(new CustomEvent(n,{detail:{key:c,value:e}})),p(e))},[c]),v=(0,a.useCallback)(()=>{o(c),window.dispatchEvent(new CustomEvent(n,{detail:{key:c,value:s}}))},[]);return B("storage",t=>{l&&t.storageArea===window[e]&&t.key===c&&p(f(t.newValue??void 0))}),B(n,e=>{l&&e.detail.key===c&&p(e.detail.value)}),(0,a.useEffect)(()=>{void 0!==s&&void 0===h&&w(s)},[s,h,w]),(0,a.useEffect)(()=>{const e=m();void 0!==e&&w(e)},[c]),[void 0===h?s:h,w,v]}}function U(e){const{getItem:t}=W(e);return function({key:n,defaultValue:r,deserialize:u=K}){let o;try{o="undefined"==typeof window||!(e in window)||null===window[e]}catch(e){o=!0}if(o)return r;const c=t(n);return null!==c?u(c):r}}function X(e){return j("localStorage","use-local-storage")(e)}const Y=U("localStorage");function Q(e){return j("sessionStorage","use-session-storage")(e)}const J=U("sessionStorage");function G(e,t){if("function"==typeof e)return e(t);"object"==typeof e&&null!==e&&"current"in e&&(e.current=t)}function Z(...e){const t=new Map;return n=>{if(e.forEach(e=>{const r=G(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{const n=t.get(e);n?n():G(e,null)}),t.clear()}}}function _(...e){return(0,a.useCallback)(Z(...e),e)}function ee(e={resetOnExit:!1}){const[t,n]=(0,a.useState)({x:0,y:0}),r=(0,a.useRef)(null),u=e=>{if(r.current){const t=e.currentTarget.getBoundingClientRect(),r=Math.max(0,Math.round(e.pageX-t.left-(window.pageXOffset||window.scrollX))),u=Math.max(0,Math.round(e.pageY-t.top-(window.pageYOffset||window.scrollY)));n({x:r,y:u})}else n({x:e.clientX,y:e.clientY})},o=()=>n({x:0,y:0});return(0,a.useEffect)(()=>{const t=r?.current?r.current:document;return t.addEventListener("mousemove",u),e.resetOnExit&&t.addEventListener("mouseleave",o),()=>{t.removeEventListener("mousemove",u),e.resetOnExit&&t.removeEventListener("mouseleave",o)}},[r.current]),{ref:r,...t}}function te(e){return{x:r(e.x,0,1),y:r(e.y,0,1)}}function ne(e,t,n="ltr"){const u=(0,a.useRef)(null),o=(0,a.useRef)(!1),c=(0,a.useRef)(!1),s=(0,a.useRef)(0),[i,l]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{o.current=!0},[]),(0,a.useEffect)(()=>{const i=u.current,a=({x:t,y:u})=>{cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{if(o.current&&i){i.style.userSelect="none";const o=i.getBoundingClientRect();if(o.width&&o.height){const c=r((t-o.left)/o.width,0,1);e({x:"ltr"===n?c:1-c,y:r((u-o.top)/o.height,0,1)})}}})},f=()=>{!c.current&&o.current&&(c.current=!0,"function"==typeof t?.onScrubStart&&t.onScrubStart(),l(!0),document.addEventListener("mousemove",h),document.addEventListener("mouseup",d),document.addEventListener("touchmove",w),document.addEventListener("touchend",d))},d=()=>{c.current&&o.current&&(c.current=!1,l(!1),document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",d),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",d),setTimeout(()=>{"function"==typeof t?.onScrubEnd&&t.onScrubEnd()},0))},m=e=>{f(),e.preventDefault(),h(e)},h=e=>a({x:e.clientX,y:e.clientY}),p=e=>{e.cancelable&&e.preventDefault(),f(),w(e)},w=e=>{e.cancelable&&e.preventDefault(),a({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})};return i?.addEventListener("mousedown",m),i?.addEventListener("touchstart",p,{passive:!1}),()=>{i&&(i.removeEventListener("mousedown",m),i.removeEventListener("touchstart",p))}},[n,e]),{ref:u,active:i}}function re({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[u,o]=(0,a.useState)(void 0!==t?t:n);return void 0!==e?[e,r,!0]:[u,(e,...t)=>{o(e),r?.(e,...t)},!1]}function ue(e,t){const n=t-e+1;return Array.from({length:n},(t,n)=>n+e)}const oe="dots";function ce({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:u=1,onChange:o}){const c=Math.max(Math.trunc(e),0),[s,i]=re({value:r,onChange:o,defaultValue:u,finalValue:u}),l=e=>{i(e<=0?1:e>c?c:e)};return{range:(0,a.useMemo)(()=>{if(2*t+3+2*n>=c)return ue(1,c);const e=Math.max(s-t,n),r=Math.min(s+t,c-n),u=e>n+2,o=r<c-(n+1);if(!u&&o)return[...ue(1,2*t+n+2),oe,...ue(c-(n-1),c)];if(u&&!o){const e=n+1+2*t;return[...ue(1,n),oe,...ue(c-e,c)]}return[...ue(1,n),oe,...ue(e,r),oe,...ue(c-n+1,c)]},[c,t,s]),active:s,setPage:l,next:()=>l(s+1),previous:()=>l(s-1),first:()=>l(1),last:()=>l(c)}}function se({initialValues:e=[],limit:t}){const[n,r]=(0,a.useState)({state:e.slice(0,t),queue:e.slice(t)});return{state:n.state,queue:n.queue,add:(...e)=>r(n=>{const r=[...n.state,...n.queue,...e];return{state:r.slice(0,t),queue:r.slice(t)}}),update:e=>r(n=>{const r=e([...n.state,...n.queue]);return{state:r.slice(0,t),queue:r.slice(t)}}),cleanQueue:()=>r(e=>({state:e.state,queue:[]}))}}function ie(e){(0,a.useEffect)(()=>(document.documentElement.addEventListener("mouseleave",e),()=>document.documentElement.removeEventListener("mouseleave",e)),[])}function ae(e,t){return p("(prefers-reduced-motion: reduce)",e,t)}const le=e=>e<.5?2*e*e:(4-2*e)*e-1,fe=({axis:e,target:t,parent:n,alignment:r,offset:u,isList:o})=>{if(!t||!n&&"undefined"==typeof document)return 0;const c=!!n,s=(n||document.body).getBoundingClientRect(),i=t.getBoundingClientRect(),a=e=>i[e]-s[e];if("y"===e){const e=a("top");if(0===e)return 0;if("start"===r){const t=e-u;return t<=i.height*(o?0:1)||!o?t:0}const t=c?s.height:window.innerHeight;if("end"===r){const n=e+u-t+i.height;return n>=-i.height*(o?0:1)||!o?n:0}return"center"===r?e-t/2+i.height/2:0}if("x"===e){const e=a("left");if(0===e)return 0;if("start"===r){const t=e-u;return t<=i.width||!o?t:0}const t=c?s.width:window.innerWidth;if("end"===r){const n=e+u-t+i.width;return n>=-i.width||!o?n:0}return"center"===r?e-t/2+i.width/2:0}return 0},de=({axis:e,parent:t})=>{if(!t&&"undefined"==typeof document)return 0;const n="y"===e?"scrollTop":"scrollLeft";if(t)return t[n];const{body:r,documentElement:u}=document;return r[n]+u[n]},me=({axis:e,parent:t,distance:n})=>{if(!t&&"undefined"==typeof document)return;const r="y"===e?"scrollTop":"scrollLeft";if(t)t[r]=n;else{const{body:e,documentElement:t}=document;e[r]=n,t[r]=n}};function he({duration:e=1250,axis:t="y",onScrollFinish:n,easing:r=le,offset:u=0,cancelable:o=!0,isList:c=!1}={}){const s=(0,a.useRef)(0),i=(0,a.useRef)(0),l=(0,a.useRef)(!1),f=(0,a.useRef)(null),d=(0,a.useRef)(null),m=ae(),h=()=>{s.current&&cancelAnimationFrame(s.current)},p=(0,a.useCallback)(({alignment:o="start"}={})=>{l.current=!1,s.current&&h();const a=de({parent:f.current,axis:t})??0,p=fe({parent:f.current,target:d.current,axis:t,alignment:o,offset:u,isList:c})-(f.current?0:a);!function u(){0===i.current&&(i.current=performance.now());const o=performance.now()-i.current,c=m||0===e?1:o/e,d=a+p*r(c);me({parent:f.current,axis:t,distance:d}),!l.current&&c<1?s.current=requestAnimationFrame(u):("function"==typeof n&&n(),i.current=0,s.current=0,h())}()},[t,e,r,c,u,n,m]),w=()=>{o&&(l.current=!0)};return B("wheel",w,{passive:!0}),B("touchmove",w,{passive:!0}),(0,a.useEffect)(()=>h,[]),{scrollableRef:f,targetRef:d,scrollIntoView:p,cancel:h}}const pe={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function we(e){const t=(0,a.useRef)(0),n=(0,a.useRef)(null),[r,u]=(0,a.useState)(pe),o=(0,a.useMemo)(()=>"undefined"!=typeof window?new ResizeObserver(e=>{const r=e[0];r&&(cancelAnimationFrame(t.current),t.current=requestAnimationFrame(()=>{if(n.current){const e=r.borderBoxSize?.[0]||r.contentBoxSize?.[0];if(e){const t=e.inlineSize,n=e.blockSize;u({width:t,height:n,x:r.contentRect.x,y:r.contentRect.y,top:r.contentRect.top,left:r.contentRect.left,bottom:r.contentRect.bottom,right:r.contentRect.right})}else u(r.contentRect)}}))}):null,[]);return(0,a.useEffect)(()=>(n.current&&o?.observe(n.current,e),()=>{o?.disconnect(),t.current&&cancelAnimationFrame(t.current)}),[n.current]),[n,r]}function ve(e){const[t,{width:n,height:r}]=we(e);return{ref:t,width:n,height:r}}function ge(e,t){(0,a.useEffect)(e,function(e){const t=(0,a.useRef)([]),n=(0,a.useRef)(0);return function(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!s(e[n],t[n]))return!1;return!0}(t.current,e)||(t.current=e,n.current+=1),[n.current]}(t))}function Ee(e=[!1,!0]){const[[t],n]=(0,a.useReducer)((e,t)=>{const n=t instanceof Function?t(e[0]):t,r=Math.abs(e.indexOf(n));return e.slice(r).concat(e.slice(0,r))},e);return[t,n]}const ye={passive:!0};function be(){const[e,t]=(0,a.useState)({width:0,height:0}),n=(0,a.useCallback)(()=>{t({width:window.innerWidth||0,height:window.innerHeight||0})},[]);return B("resize",n,ye),B("orientationchange",n,ye),(0,a.useEffect)(n,[]),e}function Se(){return"undefined"!=typeof window?{x:window.pageXOffset,y:window.pageYOffset}:{x:0,y:0}}function ke({x:e,y:t}){if("undefined"!=typeof window){const n={behavior:"smooth"};"number"==typeof e&&(n.left=e),"number"==typeof t&&(n.top=t),window.scrollTo(n)}}function Le(){const[e,t]=(0,a.useState)({x:0,y:0});return B("scroll",()=>t(Se())),B("resize",()=>t(Se())),(0,a.useEffect)(()=>{t(Se())},[]),[e,ke]}function Re(e){const[t,n]=(0,a.useState)(null),r=(0,a.useRef)(null);return{ref:(0,a.useCallback)(t=>{r.current&&(r.current.disconnect(),r.current=null),null!==t?(r.current=new IntersectionObserver(([e])=>{n(e)},e),r.current.observe(t)):n(null)},[e?.rootMargin,e?.root,e?.threshold]),entry:t}}function Ce({getInitialValueInEffect:e=!0}={}){const[t,n]=(0,a.useState)(e?"":window.location.hash||"");return B("hashchange",()=>{const e=window.location.hash;t!==e&&n(e)}),(0,a.useEffect)(()=>{e&&n(window.location.hash)},[]),[t,e=>{const t=e.startsWith("#")?e:`#${e}`;window.location.hash=t,n(t)}]}const Te={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"esc",Esc:"esc",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function xe(e){const t=e.replace("Key","").toLowerCase();return Te[e]||t}function Me(e,t){return n=>function(e,t,n){const{alt:r,ctrl:u,meta:o,mod:c,shift:s,key:i}=e,{altKey:a,ctrlKey:l,metaKey:f,shiftKey:d,key:m,code:h}=t;if(r!==a)return!1;if(c){if(!l&&!f)return!1}else{if(u!==l)return!1;if(o!==f)return!1}return s===d&&!(!i||(n?xe(h)!==xe(i):xe(m??h)!==xe(i)))}(function(e){const t=e.toLowerCase().split("+").map(e=>e.trim()),n={alt:t.includes("alt"),ctrl:t.includes("ctrl"),meta:t.includes("meta"),mod:t.includes("mod"),shift:t.includes("shift"),plus:t.includes("[plus]")},r=["alt","ctrl","meta","shift","mod"],u=t.find(e=>!r.includes(e));return{...n,key:"[plus]"===u?"+":u}}(e),n,t)}function Ie(e){return t=>{const n="nativeEvent"in t?t.nativeEvent:t;e.forEach(([e,r,u={preventDefault:!0,usePhysicalKeys:!1}])=>{Me(e,u.usePhysicalKeys)(n)&&(u.preventDefault&&t.preventDefault(),r(n))})}}function Fe(e,t=["INPUT","TEXTAREA","SELECT"],n=!1){(0,a.useEffect)(()=>{const r=r=>{e.forEach(([e,u,o={preventDefault:!0,usePhysicalKeys:!1}])=>{Me(e,o.usePhysicalKeys)(r)&&function(e,t,n=!1){return!(e.target instanceof HTMLElement)||(n||!e.target.isContentEditable)&&!t.includes(e.target.tagName)}(r,t,n)&&(o.preventDefault&&r.preventDefault(),u(r))})};return document.documentElement.addEventListener("keydown",r),()=>document.documentElement.removeEventListener("keydown",r)},[e])}function Ae(){const e=window.document;return e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement}const Ne=["","webkit","moz","ms"];function Oe(e,{onFullScreen:t,onError:n}){return Ne.forEach(r=>{e.addEventListener(`${r}fullscreenchange`,t),e.addEventListener(`${r}fullscreenerror`,n)}),()=>{Ne.forEach(r=>{e.removeEventListener(`${r}fullscreenchange`,t),e.removeEventListener(`${r}fullscreenerror`,n)})}}function De(){const[e,t]=(0,a.useState)(!1),n=(0,a.useRef)(null),r=(0,a.useCallback)(e=>{t(e.target===Ae())},[t]),u=(0,a.useCallback)(e=>{t(!1),console.error(`[@mantine/hooks] use-fullscreen: Error attempting full-screen mode method: ${e} (${e.target})`)},[t]),o=(0,a.useCallback)(async()=>{Ae()?await function(){const e=window.document;return"function"==typeof e.exitFullscreen?e.exitFullscreen():"function"==typeof e.msExitFullscreen?e.msExitFullscreen():"function"==typeof e.webkitExitFullscreen?e.webkitExitFullscreen():"function"==typeof e.mozCancelFullScreen?e.mozCancelFullScreen():null}():await function(e){const t=e;return t.requestFullscreen?.()||t.msRequestFullscreen?.()||t.webkitEnterFullscreen?.()||t.webkitRequestFullscreen?.()||t.mozRequestFullscreen?.()}(n.current)},[]),c=(0,a.useCallback)(e=>{n.current=null===e?window.document.documentElement:e},[]);return(0,a.useEffect)(()=>!n.current&&window.document?(n.current=window.document.documentElement,Oe(n.current,{onFullScreen:r,onError:u})):n.current?Oe(n.current,{onFullScreen:r,onError:u}):void 0,[n.current]),{ref:c,toggle:o,fullscreen:e}}function Ve(e,t){return(0,a.useEffect)(()=>(console.log(`${e} mounted`,...t),()=>console.log(`${e} unmounted`)),[]),L(()=>{console.log(`${e} updated`,...t)},t),null}function ze(){const[e,t]=(0,a.useState)(!1),n=(0,a.useRef)(null),r=(0,a.useCallback)(()=>t(!0),[]),u=(0,a.useCallback)(()=>t(!1),[]);return(0,a.useEffect)(()=>{const e=n.current;if(e)return e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",u),()=>{e?.removeEventListener("mouseenter",r),e?.removeEventListener("mouseleave",u)}},[n.current]),{ref:n,hovered:e}}function Pe(e,t,n){const[r,u]=(0,a.useState)(e),[o,c]=(0,a.useState)(t(e)?e:void 0),[s,i]=(0,a.useState)("boolean"==typeof n?n:t(e));return[{value:r,lastValidValue:o,valid:s},e=>{t(e)?(c(e),i(!0)):i(!1),u(e)}]}function qe(e){return/(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i.test(e)}function He(){if("undefined"==typeof window)return"undetermined";const{userAgent:e}=window.navigator;return function(e){return/(iPhone)|(iPad)|(iPod)/i.test(e)}(e)||qe(e)&&"ontouchend"in document?"ios":qe(e)?"macos":function(e){return/(Win32)|(Win64)|(Windows)|(WinCE)/i.test(e)}(e)?"windows":function(e){return/Android/i.test(e)}(e)?"android":function(e){return/Linux/i.test(e)}(e)?"linux":"undetermined"}function $e(e={getValueInEffect:!0}){const[t,n]=(0,a.useState)(e.getValueInEffect?"undetermined":He());return b(()=>{e.getValueInEffect&&n(He)},[]),t}function Be(e){const[t,n]=(0,a.useState)(e);return[t,(0,a.useCallback)(e=>n(t=>({...t,..."function"==typeof e?e(t):e})),[])]}function Ke(e){return t=>{if(t)if("function"==typeof t)e(t);else if("object"==typeof t&&"nativeEvent"in t){const{currentTarget:n}=t;"checkbox"===n.type?e(n.checked):e(n.value)}else e(t);else e(t)}}function We(e){const[t,n]=(0,a.useState)(e);return[t,Ke(n)]}function je(e,t,n){const r=(0,a.useRef)(null);return(0,a.useEffect)(()=>{const u=r.current;if(u)return u.addEventListener(e,t,n),()=>u?.removeEventListener(e,t,n)},[t,n]),r}function Ue(e=!1,t){const{onOpen:n,onClose:r}=t||{},[u,o]=(0,a.useState)(e),c=(0,a.useCallback)(()=>{o(e=>e||(n?.(),!0))},[n]),s=(0,a.useCallback)(()=>{o(e=>e?(r?.(),!1):e)},[r]),i=(0,a.useCallback)(()=>{u?s():c()},[s,c,u]);return[u,{open:c,close:s,toggle:i}]}function Xe({onBlur:e,onFocus:t}={}){const n=(0,a.useRef)(null),[r,u]=(0,a.useState)(!1),o=(0,a.useRef)(!1),c=e=>{u(e),o.current=e},s=e=>{o.current||(c(!0),t?.(e))},i=t=>{o.current&&!function(e){return e.currentTarget instanceof HTMLElement&&e.relatedTarget instanceof HTMLElement&&e.currentTarget.contains(e.relatedTarget)}(t)&&(c(!1),e?.(t))};return(0,a.useEffect)(()=>{const e=n.current;if(e)return e.addEventListener("focusin",s),e.addEventListener("focusout",i),()=>{e?.removeEventListener("focusin",s),e?.removeEventListener("focusout",i)}},[s,i]),{ref:n,focused:r}}function Ye(){if("undefined"==typeof navigator)return{};const e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;return t?{downlink:t?.downlink,downlinkMax:t?.downlinkMax,effectiveType:t?.effectiveType,rtt:t?.rtt,saveData:t?.saveData,type:t?.type}:{}}function Qe(){const[e,t]=(0,a.useState)({online:!0}),n=(0,a.useCallback)(()=>t(e=>({...e,...Ye()})),[]);return B("online",()=>t({online:!0,...Ye()})),B("offline",()=>t({online:!1,...Ye()})),(0,a.useEffect)(()=>{const e=navigator;if(e.connection)return t({online:e.onLine,...Ye()}),e.connection.addEventListener("change",n),()=>e.connection.removeEventListener("change",n);"boolean"==typeof e.onLine&&t(t=>({...t,online:e.onLine}))},[]),e}function Je(e,t,n={autoInvoke:!1}){const r=(0,a.useRef)(null),u=(0,a.useCallback)((...n)=>{r.current||(r.current=window.setTimeout(()=>{e(n),r.current=null},t))},[t]),o=(0,a.useCallback)(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return(0,a.useEffect)(()=>(n.autoInvoke&&u(),o),[o,u]),{start:u,clear:o}}function Ge(){const e=D(),[t,n]=(0,a.useState)(null),r=()=>{n(document.getSelection()),e()};return(0,a.useEffect)(()=>(n(document.getSelection()),document.addEventListener("selectionchange",r),()=>document.removeEventListener("selectionchange",r)),[]),t}function Ze(e){const t=(0,a.useRef)(void 0);return(0,a.useEffect)(()=>{t.current=e},[e]),t.current}const _e={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function et(e){const t=(0,a.useRef)(null);b(()=>{if(!e)return;if(!t.current){document.querySelectorAll('link[rel*="icon"]').forEach(e=>document.head.removeChild(e));const e=document.createElement("link");e.rel="shortcut icon",t.current=e,document.querySelector("head").appendChild(e)}const n=e.split(".");t.current.setAttribute("type",_e[n[n.length-1].toLowerCase()]),t.current.setAttribute("href",e)},[e])}const tt=(e,t)=>e<=t,nt=(e,t,n,r,u,o)=>{const c=tt(e,t);c&&!n.current?(n.current=!0,u?.()):c||!r||n.current?!c&&n.current&&(n.current=!1,o?.()):(n.current=!0,u?.())},rt=()=>{const[e,t]=(0,a.useState)(0),[n,r]=(0,a.useState)(!1),[u,o]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let n;const c=()=>{o(!0),clearTimeout(n),n=setTimeout(()=>{o(!1)},300)},s=()=>{if(u)return;const n=window.pageYOffset||document.documentElement.scrollTop;r(n<e),t(n)};return window.addEventListener("scroll",s),window.addEventListener("resize",c),()=>{window.removeEventListener("scroll",s),window.removeEventListener("resize",c)}},[e,u]),n};function ut({fixedAt:e=0,onPin:t,onFix:n,onRelease:r}={}){const u=(0,a.useRef)(!1),o=rt(),[{y:c}]=Le();return b(()=>{nt(c,e,u,o,t,r)},[c]),b(()=>{tt(c,e)&&n?.()},[c,e,n]),!(!tt(c,e)&&!o)}function ot(){const[e,t]=(0,a.useState)(!1);b(()=>{t("undefined"!=typeof window&&!navigator.userAgent.includes("OPR")&&"EyeDropper"in window)},[]);const n=(0,a.useCallback)((t={})=>e?(new window.EyeDropper).open(t):Promise.resolve(void 0),[e]);return{supported:e,open:n}}function ct(){const e=(0,a.useRef)(null),[t,n]=(0,a.useState)(!1);return{ref:(0,a.useCallback)(t=>{"undefined"!=typeof IntersectionObserver&&(t&&!e.current?e.current=new IntersectionObserver(e=>n(e.some(e=>e.isIntersecting))):e.current?.disconnect(),t?e.current?.observe(t):n(!1))},[]),inViewport:t}}function st(e,t,n){const r=(0,a.useRef)(null),u=(0,a.useRef)(null);return(0,a.useEffect)(()=>{const o="function"==typeof n?n():n;return(o||u.current)&&(r.current=new MutationObserver(e),r.current.observe(o||u.current,t)),()=>{r.current?.disconnect()}},[e,t]),u}function it(){const[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>t(!0),[]),e}function at(e){const[t,n]=(0,a.useState)({history:[e],current:0}),r=(0,a.useCallback)(e=>n(t=>{const n=[...t.history.slice(0,t.current+1),e];return{history:n,current:n.length-1}}),[]),u=(0,a.useCallback)((e=1)=>n(t=>({history:t.history,current:Math.max(0,t.current-e)})),[]),o=(0,a.useCallback)((e=1)=>n(t=>({history:t.history,current:Math.min(t.history.length-1,t.current+e)})),[]),c=(0,a.useCallback)(()=>{n({history:[e],current:0})},[e]),s=(0,a.useMemo)(()=>({back:u,forward:o,reset:c,set:r}),[u,o,c,r]);return[t.history[t.current],s,t]}function lt(e){const t=(0,a.useRef)(new Map(e)),n=D();return t.current.set=(...e)=>(Map.prototype.set.apply(t.current,e),n(),t.current),t.current.clear=(...e)=>{Map.prototype.clear.apply(t.current,e),n()},t.current.delete=(...e)=>{const r=Map.prototype.delete.apply(t.current,e);return n(),r},t.current}function ft(e){const t=(0,a.useRef)(new Set(e)),n=D();return t.current.add=(...e)=>{const r=Set.prototype.add.apply(t.current,e);return n(),r},t.current.clear=(...e)=>{Set.prototype.clear.apply(t.current,e),n()},t.current.delete=(...e)=>{const r=Set.prototype.delete.apply(t.current,e);return n(),r},t.current}function dt(e,t){const n=l(e),r=(0,a.useRef)(null),u=(0,a.useRef)(null),o=(0,a.useRef)(!0),c=(0,a.useRef)(t),s=(0,a.useRef)(-1),i=(0,a.useCallback)((...e)=>{n(...e),r.current=e,u.current=e,o.current=!1},[n]),f=(0,a.useCallback)(()=>{r.current&&r.current!==u.current?(i(...r.current),s.current=window.setTimeout(f,c.current)):o.current=!0},[i]),d=(0,a.useCallback)((...e)=>{o.current?(i(...e),s.current=window.setTimeout(f,c.current)):r.current=e},[i,f]);return(0,a.useEffect)(()=>{c.current=t},[t]),[d,()=>window.clearTimeout(s.current)]}function mt(e,t){return dt(e,t)[0]}function ht(e,t){const[n,r]=(0,a.useState)(e),[u,o]=dt(r,t);return(0,a.useEffect)(()=>o,[]),[n,u]}function pt(e,t){const[n,r]=(0,a.useState)(e),u=(0,a.useRef)(e),[o,c]=dt(r,t);return(0,a.useEffect)(()=>{e!==u.current&&(u.current=e,o(e))},[o,e]),(0,a.useEffect)(()=>c,[]),n}function wt(){const e=(0,a.useRef)(!0);return!0===e.current?(e.current=!1,!0):e.current}function vt({defaultAngle:e=0,defaultType:t="landscape-primary",getInitialValueInEffect:n=!0}={}){const[r,u]=(0,a.useState)(function(e,t){return t?e:"undefined"!=typeof window&&"screen"in window?{angle:window.screen.orientation?.angle??e.angle,type:window.screen.orientation?.type??e.type}:e}({angle:e,type:t},n)),o=e=>{const t=e.currentTarget;u({angle:t?.angle||0,type:t?.type||"landscape-primary"})};return b(()=>(window.screen.orientation?.addEventListener("change",o),()=>window.screen.orientation?.removeEventListener("change",o)),[]),r}function gt(e,{autoInvoke:t=!0,...n}={}){const[r,u]=(0,a.useState)(null),[o,c]=(0,a.useState)(!1),[s,i]=(0,a.useState)(null),l=(0,a.useRef)(null),f=(0,a.useCallback)(()=>{if(e)return l.current&&l.current.abort(),l.current=new AbortController,c(!0),fetch(e,{signal:l.current.signal,...n}).then(e=>e.json()).then(e=>(u(e),c(!1),e)).catch(e=>(c(!1),"AbortError"!==e.name&&i(e),e))},[e]),d=(0,a.useCallback)(()=>{l.current&&l.current?.abort("")},[]);return(0,a.useEffect)(()=>(t&&f(),()=>{l.current&&l.current.abort("")}),[f,t]),{data:r,loading:o,error:s,refetch:f,abort:d}}function Et(e,t){const n=r(e,0,360),u=Math.ceil(n/t),o=Math.round(n/t);return function(e,t){return parseFloat(e.toFixed(t))}(u>=n/t?u*t===360?0:u*t:o*t,(c=t,c.toString().split(".")[1]?.length||0));var c}function yt(e,{step:t=.01,onChangeEnd:n,onScrubStart:r,onScrubEnd:u}={}){const o=(0,a.useRef)(null),c=(0,a.useRef)(!1),[s,i]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{c.current=!0},[]),(0,a.useEffect)(()=>{const c=o.current,s=(r,u=!1)=>{if(c){c.style.userSelect="none";const o=Et(function(e,t){const n=function(e){const t=e.getBoundingClientRect();return[t.left+t.width/2,t.top+t.height/2]}(t),r=e[0]-n[0],u=e[1]-n[1];return 360-(Math.atan2(r,u)*(180/Math.PI)+180)}([r.clientX,r.clientY],c),t||1);e(o),u&&n?.(o)}},a=()=>{r?.(),i(!0),document.addEventListener("mousemove",d,!1),document.addEventListener("mouseup",m,!1),document.addEventListener("touchmove",h,{passive:!1}),document.addEventListener("touchend",p,!1)},l=()=>{u?.(),i(!1),document.removeEventListener("mousemove",d,!1),document.removeEventListener("mouseup",m,!1),document.removeEventListener("touchmove",h,!1),document.removeEventListener("touchend",p,!1)},f=e=>{a(),s(e)},d=e=>{s(e)},m=e=>{s(e,!0),l()},h=e=>{e.preventDefault(),s(e.touches[0])},p=e=>{s(e.changedTouches[0],!0),l()},w=e=>{e.preventDefault(),a(),s(e.touches[0])};return c?.addEventListener("mousedown",f),c?.addEventListener("touchstart",w,{passive:!1}),()=>{c&&(c.removeEventListener("mousedown",f),c.removeEventListener("touchstart",w))}},[e]),{ref:o,active:s}}function bt(e){return 0===e.length?-1:e.reduce((e,t,n)=>Math.abs(e.position)<Math.abs(t.y)?e:{index:n,position:t.y},{index:0,position:e[0].y}).index}function St(e){return Number(e.tagName[1])}function kt(e){return e.textContent||""}function Lt({selector:e="h1, h2, h3, h4, h5, h6",getDepth:t=St,getValue:n=kt}={}){const[r,u]=(0,a.useState)(-1),[c,s]=(0,a.useState)(!1),[i,l]=(0,a.useState)([]),f=(0,a.useRef)([]),d=()=>{u(bt(f.current.map(e=>e.getNode().getBoundingClientRect())))},m=()=>{const r=function(e,t,n){const r=[];for(let u=0;u<e.length;u+=1){const c=e[u];r.push({depth:t(c),value:n(c),id:c.id||o(),getNode:()=>c.id?document.getElementById(c.id):c})}return r}(Array.from(document.querySelectorAll(e)),t,n);f.current=r,s(!0),l(r),u(bt(r.map(e=>e.getNode().getBoundingClientRect())))};return(0,a.useEffect)(()=>(m(),window.addEventListener("scroll",d),()=>window.removeEventListener("scroll",d)),[]),{reinitialize:m,active:r,initialized:c,data:i}}const Rt={multiple:!0,accept:"*"};function Ct(e={}){const t={...Rt,...e},[n,r]=(0,a.useState)(function(e){if(!e)return null;if(e instanceof FileList)return e;const t=new DataTransfer;for(const n of e)t.items.add(n);return t.files}(t.initialFiles)),u=(0,a.useRef)(null),o=(0,a.useCallback)(e=>{const n=e.target;n?.files&&(r(n.files),t.onChange?.(n.files))},[t.onChange]),c=(0,a.useCallback)(()=>{u.current?.remove(),u.current=function(e){if("undefined"==typeof document)return null;const t=document.createElement("input");return t.type="file",e.accept&&(t.accept=e.accept),e.multiple&&(t.multiple=e.multiple),e.capture&&(t.capture=e.capture),e.directory&&(t.webkitdirectory=e.directory),t.style.display="none",t}(t),u.current&&(u.current.addEventListener("change",o,{once:!0}),document.body.appendChild(u.current))},[t,o]);b(()=>(c(),()=>u.current?.remove()),[]);const s=(0,a.useCallback)(()=>{r(null),t.onChange?.(null)},[t.onChange]);return{files:n,open:(0,a.useCallback)(()=>{t.resetOnOpen&&s(),c(),u.current?.click()},[t.resetOnOpen,s,c]),reset:s}}}}]); |