@murabei-data-science/pumpwood-ui 1.4.2 → 1.4.4

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.
@@ -37,4 +37,4 @@ var Pl={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
37
37
  *
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
- */!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n');var ic=e=>"number"==typeof e&&!isNaN(e),sc=e=>"string"==typeof e,lc=e=>"function"==typeof e,cc=1,dc=()=>""+cc++,uc=new Map,pc=[],fc=new Set,mc=()=>uc.size>0;function hc(e){if(mc()){if(null==e||(e=>sc(e)||ic(e))(e))uc.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=uc.get(e.containerId);t?t.removeToast(e.id):uc.forEach(t=>{t.removeToast(e.id)})}}else pc=pc.filter(t=>null!=e&&t.options.toastId!==e)}function vc(t,n){(t=>e.isValidElement(t)||sc(t)||lc(t)||ic(t))(t)&&(mc()||pc.push({content:t,options:n}),uc.forEach(e=>{e.buildToast(t,n)}))}function gc(e,t){uc.forEach(n=>{(null==t||null==t||!t.containerId||(null==t?void 0:t.containerId)===n.id)&&n.toggle(e,null==t?void 0:t.id)})}function xc(e){return e&&(sc(e.toastId)||ic(e.toastId))?e.toastId:dc()}function yc(e,t){return vc(e,t),t.toastId}function bc(e,t){return{...t,type:t&&t.type||e,toastId:xc(t)}}function wc(e){return(t,n)=>yc(t,bc(e,n))}function kc(e,t){return yc(e,bc("default",t))}kc.loading=(e,t)=>yc(e,bc("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),kc.promise=function(e,{pending:t,error:n,success:o},r){let a;t&&(a=sc(t)?kc.loading(t,r):kc.loading(t.render,{...r,...t}));let i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},s=(e,t,n)=>{if(null==t)return void kc.dismiss(a);let o={type:e,...i,...r,data:n},s=sc(t)?{render:t}:t;return a?kc.update(a,{...o,...s}):kc(s.render,{...o,...s}),n},l=lc(e)?e():e;return l.then(e=>s("success",o,e)).catch(e=>s("error",n,e)),l},kc.success=wc("success"),kc.info=wc("info"),kc.error=wc("error"),kc.warning=wc("warning"),kc.warn=kc.warning,kc.dark=(e,t)=>yc(e,bc("default",{theme:"dark",...t})),kc.dismiss=function(e){hc(e)},kc.clearWaitingQueue=(e={})=>{uc.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},kc.isActive=function(e,t){var n;if(t)return!(null==(n=uc.get(t))||!n.isToastActive(e));let o=!1;return uc.forEach(t=>{t.isToastActive(e)&&(o=!0)}),o},kc.update=(e,t={})=>{let n=((e,{containerId:t})=>{var n;return null==(n=uc.get(t||1))?void 0:n.toasts.get(e)})(e,t);if(n){let{props:o,content:r}=n,a={delay:100,...o,...t,toastId:t.toastId||e,updateId:dc()};a.toastId!==e&&(a.staleId=e);let i=a.render||r;delete a.render,yc(i,a)}},kc.done=e=>{kc.update(e,{progress:1})},kc.onChange=function(e){return fc.add(e),()=>{fc.delete(e)}},kc.play=e=>gc(!0,e),kc.pause=e=>gc(!1,e);const jc={"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.ms-excel":[".xls"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"],"application/vnd.ms-powerpoint":[".ppt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"],"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"],"video/mp4":[".mp4"]};const Nc=e=>e.map(e=>e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`),Cc=e=>({"application/octet-stream":Nc(e)});const _c=e.createContext(void 0);function Dc(){const t=e.useContext(_c);if(!t)throw new Error("Sidebar components must be used within a Sidebar.Root");return t}const Sc={Root:function({children:e,isCollapsed:n,isCollapsing:o=!1,onToggleCollapse:r,onTransitionEnd:a,className:i}){const s=n?"smaller:w-20 w-20":"smaller:w-[232px] w-[232px]";return t.jsx(_c.Provider,{value:{isCollapsed:n,isCollapsing:o,onToggleCollapse:r},children:t.jsx("nav",{className:Ie(s,"smaller:p-3 px-2 py-6 flex flex-col items-stretch bg-primary mb-2 rounded-lg transition-all duration-300 ease-in-out h-full min-h-0",i),onTransitionEnd:a,children:e})})},Header:function({children:e,className:n}){return t.jsx("div",{className:Ie("w-full flex justify-between items-center mb-8 gap-4",n),children:e})},Content:function({children:e,className:n}){return t.jsx(Ge,{className:Ie("w-full flex-1 min-h-0 items-stretch gap-1 overflow-y-auto",n),children:e})},Footer:function({children:e,className:n}){return t.jsx("div",{className:Ie("mt-auto w-full",n),children:e})},Toggle:function({className:e}){const{isCollapsed:n,isCollapsing:o,onToggleCollapse:r}=Dc(),a=n&&!o;return t.jsx("div",{className:Ie("w-full flex transition-all duration-300 ease-in-out",a?"justify-center":"justify-end",e),children:t.jsx(Le,{title:a?"Expandir Barra Lateral":"Recolher Barra Lateral",height:48,className:Ie("min-w-[48px] bg-transparent rounded-full hover:bg-white/5 transition-all duration-300 ease-in-out",a?"justify-center":"justify-end"),onClick:r,children:a?t.jsx(ec,{className:"size-[28px] text-white"}):t.jsx(tc,{className:"size-[28px] text-white"})})})},Logo:function({src:e,alt:n,width:o=200,height:r=40,collapsedWidth:a=48,collapsedHeight:i,className:s,ImageComponent:l=({src:e,alt:n,...o})=>t.jsx("img",{src:e,alt:n,...o})}){const{isCollapsed:c,isCollapsing:d}=Dc(),u=c&&!d,p=u?a:o,f=u?i??Math.max(16,Math.round(r/o*a)):r;return t.jsx(Ge,{className:Ie("w-full items-center justify-center py-2",s),children:t.jsx(l,{className:"object-contain transition-all duration-300 ease-in-out",src:e,width:p,height:f,alt:n})})},Link:function({icon:e,children:n,href:o,active:r,className:a,LinkComponent:i=({children:e,...n})=>t.jsx("a",{...n,children:e})}){const{isCollapsed:s,isCollapsing:l}=Dc();return t.jsx(i,{href:o,title:"string"==typeof n?n:void 0,className:Ie("flex w-full h-12 smaller:p-3 p-4 font-bold text-white rounded-md overflow-hidden transition-all duration-300 ease-in-out hover:bg-white/5",r?"bg-white/5":"",a),children:t.jsxs(Ge,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{className:"size-6 shrink-0"}),!s&&!l&&t.jsx("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:n})]})})},NavGroup:function({icon:e,title:n,isExpanded:o,isActive:r=!1,onToggle:a,children:i,className:s}){const{isCollapsed:l,isCollapsing:c}=Dc();return t.jsxs(Ge,{className:Ie("w-full gap-0",s),children:[t.jsx(Le,{type:"button",title:n,onClick:a,variant:"ghost",height:48,className:Ie("w-full smaller:p-3 p-4 font-bold text-white hover:bg-white/5 hover:text-white justify-start rounded-md transition-all duration-300 ease-in-out",r?"bg-white/5":""),children:t.jsxs(Ge,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{className:"size-6 shrink-0"}),!l&&!c&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex-1 text-left transition-opacity duration-300 ease-in-out opacity-100 text-base",children:n}),t.jsx($l,{width:20,height:20,className:Ie("shrink-0 transition-transform duration-300 ease-in-out",o?"rotate-180":"")})]})]})}),!l&&!c&&t.jsx("div",{className:Ie("overflow-hidden transition-all duration-300 ease-in-out",o?"max-h-96 opacity-100 mt-1":"max-h-0 opacity-0"),children:t.jsx(Ge,{className:"w-full gap-1 pl-9 pr-1",children:i})})]})},NavSubLink:function({title:e,href:n,active:o=!1,className:r,LinkComponent:a=({children:e,...n})=>t.jsx("a",{...n,children:e})}){return t.jsx(a,{href:n,title:e,className:Ie("flex w-full h-10 items-center px-3 text-sm text-white rounded-md transition-all duration-200 ease-in-out hover:bg-white/5",o?"bg-white/10 font-semibold":"",r),children:e})},Action:function({icon:e,label:n,onClick:o,className:r}){const{isCollapsed:a,isCollapsing:i}=Dc();return t.jsx(Le,{title:n,onClick:o,variant:"ghost",height:48,className:Ie("w-full smaller:p-3 p-4 font-bold text-white hover:bg-transparent hover:text-white/80 transition-all duration-300 ease-in-out justify-start",r),children:t.jsxs(Ge,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{width:24,height:24,className:"shrink-0"}),!a&&!i&&t.jsx("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:n})]})})}};var Ec=r.createContext(void 0);function Mc(e){const t=r.useContext(Ec);return e||t||"ltr"}var Oc="rovingFocusGroup.onEntryFocus",Tc={bubbles:!1,cancelable:!0},Rc="RovingFocusGroup",[Pc,Ac,Ic]=function(n){const o=n+"CollectionProvider",[r,a]=Mn(o),[i,s]=r(o,{collectionRef:{current:null},itemMap:new Map}),c=n=>{const{scope:o,children:r}=n,a=e.useRef(null),s=e.useRef(new Map).current;return t.jsx(i,{scope:o,itemMap:s,collectionRef:a,children:r})};c.displayName=o;const d=n+"CollectionSlot",u=Ln(d),p=e.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=l(n,s(d,o).collectionRef);return t.jsx(u,{ref:a,children:r})});p.displayName=d;const f=n+"CollectionItemSlot",m="data-radix-collection-item",h=Ln(f),v=e.forwardRef((n,o)=>{const{scope:r,children:a,...i}=n,c=e.useRef(null),d=l(o,c),u=s(f,r);return e.useEffect(()=>(u.itemMap.set(c,{ref:c,...i}),()=>{u.itemMap.delete(c)})),t.jsx(h,{[m]:"",ref:d,children:a})});return v.displayName=f,[{Provider:c,Slot:p,ItemSlot:v},function(t){const o=s(n+"CollectionConsumer",t);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},a]}(Rc),[Fc,zc]=Mn(Rc,[Ic]),[Lc,Wc]=Fc(Rc),Bc=r.forwardRef((e,n)=>t.jsx(Pc.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Pc.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx($c,{...e,ref:n})})}));Bc.displayName=Rc;var $c=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:i=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:f=!1,...m}=e,h=r.useRef(null),v=l(n,h),g=Mc(s),[x,y]=zn({prop:c,defaultProp:d??null,onChange:u,caller:Rc}),[b,w]=r.useState(!1),k=qn(p),j=Ac(o),N=r.useRef(!1),[C,_]=r.useState(0);return r.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(Oc,k),()=>e.removeEventListener(Oc,k)},[k]),t.jsx(Lc,{scope:o,orientation:a,dir:g,loop:i,currentTabStopId:x,onItemFocus:r.useCallback(e=>y(e),[y]),onItemShiftTab:r.useCallback(()=>w(!0),[]),onFocusableItemAdd:r.useCallback(()=>_(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>_(e=>e-1),[]),children:t.jsx(Yn.div,{tabIndex:b||0===C?-1:0,"data-orientation":a,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:Tn(e.onMouseDown,()=>{N.current=!0}),onFocus:Tn(e.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(Oc,Tc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=j().filter(e=>e.focusable);Vc([e.find(e=>e.active),e.find(e=>e.id===x),...e].filter(Boolean).map(e=>e.ref.current),f)}}N.current=!1}),onBlur:Tn(e.onBlur,()=>w(!1))})})}),Yc="RovingFocusGroupItem",qc=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=In(),u=s||d,p=Wc(Yc,o),f=p.currentTabStopId===u,m=Ac(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=p;return r.useEffect(()=>{if(a)return h(),()=>v()},[a,h,v]),t.jsx(Pc.ItemSlot,{scope:o,id:u,focusable:a,active:i,children:t.jsx(Yn.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:Tn(e.onMouseDown,e=>{a?p.onItemFocus(u):e.preventDefault()}),onFocus:Tn(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:Tn(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:Hc[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const a=r.indexOf(e.currentTarget);r=p.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>Vc(r))}var n,o}),children:"function"==typeof l?l({isCurrentTabStop:f,hasTabStop:null!=g}):l})})});qc.displayName=Yc;var Hc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Vc(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var Kc=Bc,Uc=qc,Gc="Tabs",[Zc]=Mn(Gc,[zc]),Xc=zc(),[Qc,Jc]=Zc(Gc),ed=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Mc(l),[p,f]=zn({prop:r,onChange:a,defaultProp:i??"",caller:Gc});return t.jsx(Qc,{scope:o,baseId:In(),value:p,onValueChange:f,orientation:s,dir:u,activationMode:c,children:t.jsx(Yn.div,{dir:u,"data-orientation":s,...d,ref:n})})});ed.displayName=Gc;var td="TabsList",nd=r.forwardRef((e,n)=>{const{__scopeTabs:o,loop:r=!0,...a}=e,i=Jc(td,o),s=Xc(o);return t.jsx(Kc,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:t.jsx(Yn.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:n})})});nd.displayName=td;var od="TabsTrigger",rd=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:r,disabled:a=!1,...i}=e,s=Jc(od,o),l=Xc(o),c=sd(s.baseId,r),d=ld(s.baseId,r),u=r===s.value;return t.jsx(Uc,{asChild:!0,...l,focusable:!a,active:u,children:t.jsx(Yn.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:n,onMouseDown:Tn(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(r)}),onKeyDown:Tn(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(r)}),onFocus:Tn(e.onFocus,()=>{const e="manual"!==s.activationMode;u||a||!e||s.onValueChange(r)})})})});rd.displayName=od;var ad="TabsContent",id=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:a,forceMount:i,children:s,...l}=e,c=Jc(ad,o),d=sd(c.baseId,a),u=ld(c.baseId,a),p=a===c.value,f=r.useRef(p);return r.useEffect(()=>{const e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),t.jsx(uo,{present:i||p,children:({present:o})=>t.jsx(Yn.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!o,id:u,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:o&&s})})});function sd(e,t){return`${e}-trigger-${t}`}function ld(e,t){return`${e}-content-${t}`}id.displayName=ad;var cd=nd,dd=rd,ud=id;const pd=ed,fd=r.forwardRef(({className:e,...n},o)=>t.jsx(cd,{ref:o,className:Ie("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...n}));fd.displayName=cd.displayName;const md=r.forwardRef(({className:e,...n},o)=>t.jsx(dd,{ref:o,className:Ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-[#0E2B63] data-[state=active]:text-[#FFFFFF] data-[state=active]:shadow",e),...n}));md.displayName=dd.displayName;const hd=r.forwardRef(({className:e,...n},o)=>t.jsx(ud,{ref:o,className:Ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));function vd(e,n=[]){let o=[];const a=()=>{const t=o.map(e=>r.createContext(e));return function(n){const o=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return a.scopeName=e,[function(n,a){const i=r.createContext(a);i.displayName=n+"Context";const s=o.length;o=[...o,a];const l=n=>{const{scope:o,children:a,...l}=n,c=o?.[e]?.[s]||i,d=r.useMemo(()=>l,Object.values(l));return t.jsx(c.Provider,{value:d,children:a})};return l.displayName=n+"Provider",[l,function(t,o){const l=o?.[e]?.[s]||i,c=r.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},gd(a,...n)]}function gd(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function xd(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function yd(...e){return t=>{let n=!1;const o=e.map(e=>{const o=xd(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():xd(e[t],null)}}}}function bd(...e){return r.useCallback(yd(...e),e)}function wd(e){const t=r.forwardRef((t,n)=>{let{children:o,...a}=t,i=null,s=!1;const l=[];Cd(o)&&"function"==typeof Sd&&(o=Sd(o._payload)),r.Children.forEach(o,e=>{if(t=e,r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===kd){s=!0;const t=e;let n="child"in t.props?t.props.child:t.props.children;Cd(n)&&"function"==typeof Sd&&(n=Sd(n._payload)),i=jd(t,n),l.push(i?.props?.children)}else l.push(e);var t}),i?i=r.cloneElement(i,void 0,l):!s&&1===r.Children.count(o)&&r.isValidElement(o)&&(i=o);const c=i?function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i):void 0,d=bd(n,c);if(!i){if(o||0===o)throw new Error(s?Dd(e):_d(e));return o}const u=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(a,i.props??{});return i.type!==r.Fragment&&(u.ref=n?d:c),r.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}hd.displayName=ud.displayName;var kd=Symbol.for("radix.slottable");var jd=(e,t)=>{if("child"in e.props){const t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null};var Nd=Symbol.for("react.lazy");function Cd(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===Nd&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}var _d=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Dd=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Sd=r[" use ".trim().toString()];function Ed(e){const n=e+"CollectionProvider",[o,a]=vd(n),[i,s]=o(n,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:o}=e,a=r.useRef(null),s=r.useRef(new Map).current;return t.jsx(i,{scope:n,itemMap:s,collectionRef:a,children:o})};l.displayName=n;const c=e+"CollectionSlot",d=wd(c),u=r.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=bd(n,s(c,o).collectionRef);return t.jsx(d,{ref:a,children:r})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=wd(p),h=r.forwardRef((e,n)=>{const{scope:o,children:a,...i}=e,l=r.useRef(null),c=bd(n,l),d=s(p,o);return r.useEffect(()=>(d.itemMap.set(l,{ref:l,...i}),()=>{d.itemMap.delete(l)})),t.jsx(m,{[f]:"",ref:c,children:a})});return h.displayName=p,[{Provider:l,Slot:u,ItemSlot:h},function(t){const n=s(e+"CollectionConsumer",t);return r.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},a]}function Md(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}var Od=globalThis?.document?r.useLayoutEffect:()=>{},Td=r[" useInsertionEffect ".trim().toString()]||Od;function Rd({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),a=r.useRef(n),i=r.useRef(t);return Td(()=>{i.current=t},[t]),r.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:a;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,o])}const d=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,d]}var Pd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const o=wd(`Primitive.${n}`),a=r.forwardRef((e,r)=>{const{asChild:a,...i}=e,s=a?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function Ad(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}var Id=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),a=r.useRef(e),i=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=zd(o.current);i.current="mounted"===l?e:"none"},[l]),Od(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=zd(t);if(e)c("MOUNT");else if("none"===r||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),Od(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=zd(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!a.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},s=e=>{e.target===t&&(i.current=zd(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),i=function(...e){const t=r.useRef(e);return t.current=e,r.useCallback(e=>{const n=t.current;let o=!1;const r=n.map(t=>{const n=Fd(t,e);return o||"function"!=typeof n||(o=!0),n});if(o)return()=>{for(let e=0;e<r.length;e++){const t=r[e];"function"==typeof t?t():Fd(n[e],null)}}},[])}(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:i}):null};function Fd(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function zd(e){return e?.animationName||"none"}Id.displayName="Presence";var Ld=r[" useId ".trim().toString()]||(()=>{}),Wd=0;function Bd(e){const[t,n]=r.useState(Ld());return Od(()=>{n(e=>e??String(Wd++))},[e]),t?`radix-${t}`:""}var $d="Collapsible",[Yd,qd]=vd($d),[Hd,Vd]=Yd($d),Kd=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,open:a,defaultOpen:i,disabled:s,onOpenChange:l,...c}=e,[d,u]=Rd({prop:a,defaultProp:i??!1,onChange:l,caller:$d});return t.jsx(Hd,{scope:o,disabled:s,contentId:Bd(),open:d,onOpenToggle:r.useCallback(()=>u(e=>!e),[u]),children:t.jsx(Pd.div,{"data-state":Jd(d),"data-disabled":s?"":void 0,...c,ref:n})})});Kd.displayName=$d;var Ud="CollapsibleTrigger",Gd=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,...r}=e,a=Vd(Ud,o);return t.jsx(Pd.button,{type:"button","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":Jd(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:n,onClick:Md(e.onClick,a.onOpenToggle)})});Gd.displayName=Ud;var Zd="CollapsibleContent",Xd=r.forwardRef((e,n)=>{const{forceMount:o,...r}=e,a=Vd(Zd,e.__scopeCollapsible);return t.jsx(Id,{present:o||a.open,children:({present:e})=>t.jsx(Qd,{...r,ref:n,present:e})})});Xd.displayName=Zd;var Qd=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,present:a,children:i,...s}=e,l=Vd(Zd,o),[c,d]=r.useState(a),u=r.useRef(null),p=bd(n,u),f=r.useRef(0),m=f.current,h=r.useRef(0),v=h.current,g=l.open||c,x=r.useRef(g),y=r.useRef(void 0);return r.useEffect(()=>{const e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),Od(()=>{const e=u.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();f.current=t.height,h.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),d(a)}},[l.open,a]),t.jsx(Pd.div,{"data-state":Jd(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!g,...s,ref:p,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&i})});function Jd(e){return e?"open":"closed"}var eu=Kd,tu=Gd,nu=Xd,ou=r.createContext(void 0);function ru(e){const t=r.useContext(ou);return e||t||"ltr"}var au="Accordion",iu=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[su,lu,cu]=Ed(au),[du]=vd(au,[cu,qd]),uu=qd(),pu=r.forwardRef((e,n)=>{const{type:o,...r}=e,a=r,i=r;return t.jsx(su.Provider,{scope:e.__scopeAccordion,children:"multiple"===o?t.jsx(xu,{...i,ref:n}):t.jsx(gu,{...a,ref:n})})});pu.displayName=au;var[fu,mu]=du(au),[hu,vu]=du(au,{collapsible:!1}),gu=r.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:i=()=>{},collapsible:s=!1,...l}=e,[c,d]=Rd({prop:o,defaultProp:a??"",onChange:i,caller:au});return t.jsx(fu,{scope:e.__scopeAccordion,value:r.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:r.useCallback(()=>s&&d(""),[s,d]),children:t.jsx(hu,{scope:e.__scopeAccordion,collapsible:s,children:t.jsx(wu,{...l,ref:n})})})}),xu=r.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:i=()=>{},...s}=e,[l,c]=Rd({prop:o,defaultProp:a??[],onChange:i,caller:au}),d=r.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=r.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return t.jsx(fu,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:u,children:t.jsx(hu,{scope:e.__scopeAccordion,collapsible:!0,children:t.jsx(wu,{...s,ref:n})})})}),[yu,bu]=du(au),wu=r.forwardRef((e,n)=>{const{__scopeAccordion:o,disabled:a,dir:i,orientation:s="vertical",...l}=e,c=bd(r.useRef(null),n),d=lu(o),u="ltr"===ru(i),p=Md(e.onKeyDown,e=>{if(!iu.includes(e.key))return;const t=e.target,n=d().filter(e=>!e.ref.current?.disabled),o=n.findIndex(e=>e.ref.current===t),r=n.length;if(-1===o)return;e.preventDefault();let a=o;const i=r-1,l=()=>{a=o+1,a>i&&(a=0)},c=()=>{a=o-1,a<0&&(a=i)};switch(e.key){case"Home":a=0;break;case"End":a=i;break;case"ArrowRight":"horizontal"===s&&(u?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(u?c():l());break;case"ArrowUp":"vertical"===s&&c()}const p=a%r;n[p].ref.current?.focus()});return t.jsx(yu,{scope:o,disabled:a,direction:i,orientation:s,children:t.jsx(su.Slot,{scope:o,children:t.jsx(Pd.div,{...l,"data-orientation":s,ref:c,onKeyDown:a?void 0:p})})})}),ku="AccordionItem",[ju,Nu]=du(ku),Cu=r.forwardRef((e,n)=>{const{__scopeAccordion:o,value:r,...a}=e,i=bu(ku,o),s=mu(ku,o),l=uu(o),c=Bd(),d=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return t.jsx(ju,{scope:o,open:d,disabled:u,triggerId:c,children:t.jsx(eu,{"data-orientation":i.orientation,"data-state":Tu(d),...l,...a,ref:n,disabled:u,open:d,onOpenChange:e=>{e?s.onItemOpen(r):s.onItemClose(r)}})})});Cu.displayName=ku;var _u="AccordionHeader",Du=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=bu(au,o),i=Nu(_u,o);return t.jsx(Pd.h3,{"data-orientation":a.orientation,"data-state":Tu(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:n})});Du.displayName=_u;var Su="AccordionTrigger",Eu=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=bu(au,o),i=Nu(Su,o),s=vu(Su,o),l=uu(o);return t.jsx(su.ItemSlot,{scope:o,children:t.jsx(tu,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...r,ref:n})})});Eu.displayName=Su;var Mu="AccordionContent",Ou=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=bu(au,o),i=Nu(Mu,o),s=uu(o);return t.jsx(nu,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...s,...r,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function Tu(e){return e?"open":"closed"}Ou.displayName=Mu;var Ru=Cu,Pu=Du,Au=Eu,Iu=Ou;const Fu=pu,zu=r.forwardRef(({className:e,...n},o)=>t.jsx(Ru,{ref:o,className:Ie("border-b",e),...n}));zu.displayName="AccordionItem";const Lu=r.forwardRef(({className:e,children:n,...o},r)=>t.jsx(Pu,{className:"flex",children:t.jsxs(Au,{ref:r,className:Ie("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...o,children:[n,t.jsx($l,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));Lu.displayName=Au.displayName;const Wu=r.forwardRef(({className:e,children:n,...o},r)=>t.jsx(Iu,{ref:r,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:t.jsx("div",{className:Ie("pb-4 pt-0",e),children:n})}));function Bu({className:e,...n}){return t.jsx("div",{"data-slot":"empty",className:Ie("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",e),...n})}function $u({className:e,...n}){return t.jsx("div",{"data-slot":"empty-header",className:Ie("flex max-w-sm flex-col items-center gap-2 text-center",e),...n})}Wu.displayName=Iu.displayName;const Yu=w("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function qu({className:e,variant:n="default",...o}){return t.jsx("div",{"data-slot":"empty-icon","data-variant":n,className:Ie(Yu({variant:n,className:e})),...o})}function Hu({className:e,...n}){return t.jsx("div",{"data-slot":"empty-title",className:Ie("text-lg font-medium tracking-tight",e),...n})}function Vu({className:e,...n}){return t.jsx("div",{"data-slot":"empty-description",className:Ie("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...n})}function Ku({title:e,description:n}){return t.jsx(Bu,{children:t.jsxs($u,{className:"w-[250px]",children:[t.jsx(qu,{children:t.jsx(Ll,{})}),t.jsx(Hu,{children:e}),t.jsx(Vu,{children:n})]})})}var Uu=.999,Gu=/[\\\/_+.#"@\[\(\{&]/,Zu=/[\\\/_+.#"@\[\(\{&]/g,Xu=/[\s-]/,Qu=/[\s-]/g;function Ju(e,t,n,o,r,a,i){if(a===t.length)return r===e.length?1:.99;var s=`${r},${a}`;if(void 0!==i[s])return i[s];for(var l,c,d,u,p=o.charAt(a),f=n.indexOf(p,r),m=0;f>=0;)(l=Ju(e,t,n,o,f+1,a+1,i))>m&&(f===r?l*=1:Gu.test(e.charAt(f-1))?(l*=.8,(d=e.slice(r,f-1).match(Zu))&&r>0&&(l*=Math.pow(Uu,d.length))):Xu.test(e.charAt(f-1))?(l*=.9,(u=e.slice(r,f-1).match(Qu))&&r>0&&(l*=Math.pow(Uu,u.length))):(l*=.17,r>0&&(l*=Math.pow(Uu,f-r))),e.charAt(f)!==t.charAt(a)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&n.charAt(f-1)!==o.charAt(a))&&(.1*(c=Ju(e,t,n,o,f+1,a+2,i))>l&&(l=.1*c)),l>m&&(m=l),f=n.indexOf(p,f+1);return i[s]=m,m}function ep(e){return e.toLowerCase().replace(Qu," ")}function tp(e,t,n){return Ju(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,ep(e),ep(t),0,0,{})}var np='[cmdk-group=""]',op='[cmdk-group-items=""]',rp='[cmdk-item=""]',ap=`${rp}:not([aria-disabled="true"])`,ip="cmdk-item-select",sp="data-value",lp=(e,t,n)=>tp(e,t,n),cp=r.createContext(void 0),dp=()=>r.useContext(cp),up=r.createContext(void 0),pp=()=>r.useContext(up),fp=r.createContext(void 0),mp=r.forwardRef((e,t)=>{let n=Sp(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Sp(()=>new Set),a=Sp(()=>new Map),i=Sp(()=>new Map),s=Sp(()=>new Set),l=_p(e),{label:c,children:d,value:u,onValueChange:p,filter:f,shouldFilter:m,loop:h,disablePointerSelection:v=!1,vimBindings:g=!0,...x}=e,y=In(),b=In(),w=In(),k=r.useRef(null),j=Op();Dp(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,N.emit()}},[u]),Dp(()=>{j(6,M)},[]);let N=r.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,o)=>{var r,a,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)E(),D(),j(1,S);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(r=document.getElementById(y))||r.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=O())?void 0:e.id,N.emit()}),o||j(5,M),void 0!==(null==(a=l.current)?void 0:a.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}N.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),C=r.useMemo(()=>({value:(e,t,o)=>{var r;t!==(null==(r=i.current.get(e))?void 0:r.value)&&(i.current.set(e,{value:t,keywords:o}),n.current.filtered.items.set(e,_(t,o)),j(2,()=>{D(),N.emit()}))},item:(e,t)=>(o.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),j(3,()=>{E(),D(),n.current.value||S(),N.emit()}),()=>{i.current.delete(e),o.current.delete(e),n.current.filtered.items.delete(e);let t=O();j(4,()=>{E(),(null==t?void 0:t.getAttribute("id"))===e&&S(),N.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{i.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:w,labelId:b,listInnerRef:k}),[]);function _(e,t){var o,r;let a=null!=(r=null==(o=l.current)?void 0:o.filter)?r:lp;return e?a(e,n.current.search,t):0}function D(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let o=a.current.get(n),r=0;o.forEach(t=>{let n=e.get(t);r=Math.max(n,r)}),t.push([n,r])});let o=k.current;T().sort((t,n)=>{var o,r;let a=t.getAttribute("id"),i=n.getAttribute("id");return(null!=(o=e.get(i))?o:0)-(null!=(r=e.get(a))?r:0)}).forEach(e=>{let t=e.closest(op);t?t.appendChild(e.parentElement===t?e:e.closest(`${op} > *`)):o.appendChild(e.parentElement===o?e:e.closest(`${op} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${np}[${sp}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function S(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(sp);N.setState("value",t||void 0)}function E(){var e,t,r,s;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=o.current.size);n.current.filtered.groups=new Set;let c=0;for(let a of o.current){let o=_(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(r=i.current.get(a))?void 0:r.keywords)?s:[]);n.current.filtered.items.set(a,o),o>0&&c++}for(let[e,t]of a.current)for(let o of t)if(n.current.filtered.items.get(o)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function M(){var e,t,n;let o=O();o&&((null==(e=o.parentElement)?void 0:e.firstChild)===o&&(null==(n=null==(t=o.closest(np))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=k.current)?void 0:e.querySelector(`${rp}[aria-selected="true"]`)}function T(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(ap))||[])}function R(e){let t=T()[e];t&&N.setState("value",t.getAttribute(sp))}function P(e){var t;let n=O(),o=T(),r=o.findIndex(e=>e===n),a=o[r+e];null!=(t=l.current)&&t.loop&&(a=r+e<0?o[o.length-1]:r+e===o.length?o[0]:o[r+e]),a&&N.setState("value",a.getAttribute(sp))}function A(e){let t,n=O(),o=null==n?void 0:n.closest(np);for(;o&&!t;)o=e>0?Np(o,np):Cp(o,np),t=null==o?void 0:o.querySelector(ap);t?N.setState("value",t.getAttribute(sp)):P(e)}let I=()=>R(T().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?A(1):P(1)},z=e=>{e.preventDefault(),e.metaKey?R(0):e.altKey?A(-1):P(-1)};return r.createElement(Yn.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=x.onKeyDown)||t.call(x,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":g&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":g&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),R(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let t=O();if(t){let e=new Event(ip);t.dispatchEvent(e)}}}}},r.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:Rp},c),Tp(e,e=>r.createElement(up.Provider,{value:N},r.createElement(cp.Provider,{value:C},e))))}),hp=r.forwardRef((e,t)=>{var n,o;let a=In(),i=r.useRef(null),l=r.useContext(fp),c=dp(),d=_p(e),u=null!=(o=null==(n=d.current)?void 0:n.forceMount)?o:null==l?void 0:l.forceMount;Dp(()=>{if(!u)return c.item(a,null==l?void 0:l.id)},[u]);let p=Mp(a,i,[e.value,e.children,i],e.keywords),f=pp(),m=Ep(e=>e.value&&e.value===p.current),h=Ep(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(a)>0));function v(){var e,t;g(),null==(t=(e=d.current).onSelect)||t.call(e,p.current)}function g(){f.setState("value",p.current,!0)}if(r.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(ip,v),()=>t.removeEventListener(ip,v)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:x,value:y,onSelect:b,forceMount:w,keywords:k,...j}=e;return r.createElement(Yn.div,{ref:s(i,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||c.getDisablePointerSelection()?void 0:g,onClick:x?void 0:v},e.children)}),vp=r.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:a,...i}=e,l=In(),c=r.useRef(null),d=r.useRef(null),u=In(),p=dp(),f=Ep(e=>!(!a&&!1!==p.filter())||(!e.search||e.filtered.groups.has(l)));Dp(()=>p.group(l),[]),Mp(l,c,[e.value,e.heading,d]);let m=r.useMemo(()=>({id:l,forceMount:a}),[a]);return r.createElement(Yn.div,{ref:s(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},n&&r.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Tp(e,e=>r.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},r.createElement(fp.Provider,{value:m},e))))}),gp=r.forwardRef((e,t)=>{let{alwaysRender:n,...o}=e,a=r.useRef(null),i=Ep(e=>!e.search);return n||i?r.createElement(Yn.div,{ref:s(a,t),...o,"cmdk-separator":"",role:"separator"}):null}),xp=r.forwardRef((e,t)=>{let{onValueChange:n,...o}=e,a=null!=e.value,i=pp(),s=Ep(e=>e.search),l=Ep(e=>e.selectedItemId),c=dp();return r.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),r.createElement(Yn.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),yp=r.forwardRef((e,t)=>{let{children:n,label:o="Suggestions",...a}=e,i=r.useRef(null),l=r.useRef(null),c=Ep(e=>e.selectedItemId),d=dp();return r.useEffect(()=>{if(l.current&&i.current){let e,t=l.current,n=i.current,o=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return o.observe(t),()=>{cancelAnimationFrame(e),o.unobserve(t)}}},[]),r.createElement(Yn.div,{ref:s(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":o,id:d.listId},Tp(e,e=>r.createElement("div",{ref:s(l,d.listInnerRef),"cmdk-list-sizer":""},e)))}),bp=r.forwardRef((e,t)=>{let{open:n,onOpenChange:o,overlayClassName:a,contentClassName:i,container:s,...l}=e;return r.createElement(Br,{open:n,onOpenChange:o},r.createElement(Yr,{container:s},r.createElement(qr,{"cmdk-overlay":"",className:a}),r.createElement(Hr,{"aria-label":e.label,"cmdk-dialog":"",className:i},r.createElement(mp,{ref:t,...l}))))}),wp=r.forwardRef((e,t)=>Ep(e=>0===e.filtered.count)?r.createElement(Yn.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),kp=r.forwardRef((e,t)=>{let{progress:n,children:o,label:a="Loading...",...i}=e;return r.createElement(Yn.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Tp(e,e=>r.createElement("div",{"aria-hidden":!0},e)))}),jp=Object.assign(mp,{List:yp,Item:hp,Input:xp,Group:vp,Separator:gp,Dialog:bp,Empty:wp,Loading:kp});function Np(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Cp(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function _p(e){let t=r.useRef(e);return Dp(()=>{t.current=e}),t}var Dp="undefined"==typeof window?r.useEffect:r.useLayoutEffect;function Sp(e){let t=r.useRef();return void 0===t.current&&(t.current=e()),t}function Ep(e){let t=pp(),n=()=>e(t.snapshot());return r.useSyncExternalStore(t.subscribe,n,n)}function Mp(e,t,n,o=[]){let a=r.useRef(),i=dp();return Dp(()=>{var r;let s=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=o.map(e=>e.trim());i.value(e,s,l),null==(r=t.current)||r.setAttribute(sp,s),a.current=s}),a}var Op=()=>{let[e,t]=r.useState(),n=Sp(()=>new Map);return Dp(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,o)=>{n.current.set(e,o),t({})}};function Tp({asChild:e,children:t},n){return e&&r.isValidElement(t)?r.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var Rp={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Pp=Br,Ap=$r,Ip=({className:e,...n})=>t.jsx(Yr,{...n});Ip.displayName=Yr.displayName;const Fp=r.forwardRef(({className:e,...n},o)=>t.jsx(qr,{ref:o,className:Ie("fixed inset-0 z-50 overlay-dialog data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));Fp.displayName=qr.displayName;const zp=r.forwardRef(({className:e,children:n,showCloseButton:o=!0,...r},a)=>t.jsxs(Ip,{children:[t.jsx(Fp,{}),t.jsxs(Hr,{ref:a,className:Ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl md:w-full",e),...r,children:[n,o&&t.jsxs(Ur,{type:"button",className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(ac,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zp.displayName=Hr.displayName;const Lp=({className:e,...n})=>t.jsx("div",{className:Ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});Lp.displayName="DialogHeader";const Wp=({className:e,...n})=>t.jsx("div",{className:Ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});Wp.displayName="DialogFooter";const Bp=r.forwardRef(({className:e,...n},o)=>t.jsx(Vr,{ref:o,className:Ie("text-lg font-semibold leading-none tracking-tight",e),...n}));Bp.displayName=Vr.displayName;const $p=r.forwardRef(({className:e,...n},o)=>t.jsx(Kr,{ref:o,className:Ie("text-sm text-muted-foreground",e),...n}));function Yp({className:e,...n}){return t.jsx(jp,{"data-slot":"command",className:Ie("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...n})}function qp({className:e,...n}){return t.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[t.jsx(oc,{className:"size-4 shrink-0 opacity-50"}),t.jsx(jp.Input,{"data-slot":"command-input",className:Ie("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function Hp({className:e,...n}){return t.jsx(jp.List,{"data-slot":"command-list",className:Ie("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function Vp({...e}){return t.jsx(jp.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Kp({className:e,...n}){return t.jsx(jp.Group,{"data-slot":"command-group",className:Ie("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...n})}function Up({className:e,...n}){return t.jsx(jp.Item,{"data-slot":"command-item",className:Ie("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function Gp({items:e,value:n,onChange:o,placeholder:a="Select an option...",emptyMessage:i="No items found.",className:s,searchPlaceholder:l="Search...",onSearchChange:c,filterLocally:d=!0,loading:u=!1,displayLabel:p,disabled:f=!1}){const[m,h]=r.useState(!1),[v,g]=r.useState(""),[x,y]=r.useState(null);r.useEffect(()=>{if(!n||""===n)return void y(null);const t=e?.find(e=>String(e.value)===String(n));t&&y(t)},[n,e]);const b=d&&v?e?.filter(e=>e.label.toLowerCase().includes(v.toLowerCase())):e,w=p??x?.label??a,k=!p&&!x;return t.jsxs(xl,{open:m,onOpenChange:h,children:[t.jsx(yl,{asChild:!0,children:t.jsxs("button",{type:"button","data-cy":"combobox-trigger",disabled:f,"aria-expanded":m,className:Ie(We,"justify-between overflow-hidden",k&&Be,s),children:[t.jsx("span",{className:"truncate min-w-0 flex-1 text-left",children:w}),t.jsx(Vl,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),t.jsx(bl,{className:"max-w-[700px] p-0 w-full min-w-(--radix-popover-trigger-width)",children:t.jsxs(Yp,{shouldFilter:!1,children:[t.jsx(qp,{"data-cy":"combobox-input",placeholder:l,value:v,onValueChange:e=>{g(e),c?.(e)},className:"h-9 focus:ring-0 focus:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"}),t.jsxs(Hp,{"data-cy":"combobox-list",children:[t.jsx(Vp,{children:u?"Loading...":i}),t.jsx(Kp,{children:b?.map(e=>t.jsxs(Up,{value:String(e?.value??""),onSelect:t=>((e,t)=>{const r=e===n?null:t;o(r?.value??"",r),h(!1),g(""),y(r)})(t,e),className:Ie("cursor-pointer",Ye),children:[e.label,t.jsx(Bl,{className:Ie("ml-auto size-4",String(n)===String(e.value)?"opacity-100":"opacity-0")})]},e?.value))})]})]})})]})}$p.displayName=Kr.displayName;const Zp={},Xp=({id:n,fetcher:o,resolveValue:r,modelClass:a,labelName:i,valueField:s="pk",placeholder:l="Select item...",emptyMessage:c="No items found",value:d,onChange:u,additionalFilters:p=Zp,fields:f,className:m,debounceWait:h=300})=>{const v=e.useMemo(()=>p??Zp,[p]),[g,x]=e.useState([]),[y,b]=e.useState(""),[w,k]=e.useState(""),[j,N]=e.useState(!1),[C,_]=e.useState();e.useEffect(()=>{const e=setTimeout(()=>{k(y)},h);return()=>clearTimeout(e)},[y,h]);const D=e.useCallback(async()=>{N(!0);try{const e=await o({search:w,modelClass:a,labelName:i,additionalFilters:v,fields:f});x(((e,t,n)=>Array.isArray(e)?e.map(e=>({value:e[n]??e.id??e.pk,label:String(e[t]??e.name??e.pk??""),...e})):[])(e,i,s))}catch(e){console.error("FKSelect fetch error:",e),x([])}finally{N(!1)}},[o,w,a,i,v,f,s]);e.useEffect(()=>{D()},[D]);const S=g.find(e=>String(e.value)===String(d))?.label;e.useEffect(()=>{if(!d)return void _(void 0);if(S)return void _(S);if(!r)return void _(void 0);let e=!0;return r({modelClass:a,value:d}).then(t=>{if(!e||!t)return;const n=String(t[i]??t.name??d);_(n)}).catch(e=>{console.error("FKSelect resolve error:",e)}),()=>{e=!1}},[d,S,r,a,i]);return t.jsx("div",{"data-testid":n,className:Ie("flex w-full min-w-0",m),children:t.jsx(Gp,{items:g,placeholder:l,emptyMessage:c,value:d?String(d):null,onChange:(e,t)=>{t&&u(e,t)},onSearchChange:b,filterLocally:!1,loading:j,displayLabel:C,className:"w-full"})})};function Qp(e,[t,n]){return Math.min(n,Math.max(t,e))}function Jp(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var ef,tf="dismissableLayer.update",nf="dismissableLayer.pointerDownOutside",of="dismissableLayer.focusOutside",rf=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),af=r.forwardRef((e,n)=>{const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...u}=e,p=r.useContext(rf),[f,m]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,v]=r.useState({}),g=bd(n,e=>m(e)),x=Array.from(p.layers),[y]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),b=x.indexOf(y),w=f?x.indexOf(f):-1,k=p.layersWithOutsidePointerEventsDisabled.size>0,j=w>=b,N=r.useRef(!1),C=function(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i}=t,s=Jp(e),l=r.useRef(!1),c=r.useRef(!1),d=r.useRef(new Map),u=r.useRef(()=>{});return r.useEffect(()=>{function e(){c.current=!1,a.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function r(e){if(!c.current)return;const t=e.target;t instanceof Node&&[...i].some(e=>e.contains(t))||d.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&u.current()},0)}function p(e){c.current&&d.current.set(e.type,!1)}const f=r=>{if(r.target&&!l.current){let i=function(){n.removeEventListener("click",u.current);const o=t();e(),o||lf(nf,s,l,{discrete:!0})};const l={originalEvent:r};c.current=!0,a.current=o&&0===r.button,d.current.clear(),o&&0===r.button?(n.removeEventListener("click",u.current),u.current=i,n.addEventListener("click",u.current,{once:!0})):i()}else n.removeEventListener("click",u.current),e();l.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const e of m)n.addEventListener(e,r,!0),n.addEventListener(e,p);const h=window.setTimeout(()=>{n.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(h),n.removeEventListener("pointerdown",f),n.removeEventListener("click",u.current);for(const e of m)n.removeEventListener(e,r,!0),n.removeEventListener(e,p)}},[n,s,o,a,i]),{onPointerDownCapture:()=>l.current=!0}}(e=>{const t=e.target;if(!(t instanceof Node))return;const n=[...p.branches].some(e=>e.contains(t));j&&!n&&(s?.(e),c?.(e),e.defaultPrevented||d?.())},{ownerDocument:h,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:p.dismissableSurfaces}),_=function(e,t=globalThis?.document){const n=Jp(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){lf(of,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{if(a&&N.current)return;const t=e.target;[...p.branches].some(e=>e.contains(t))||(l?.(e),c?.(e),e.defaultPrevented||d?.())},h);return function(e,t=globalThis?.document){const n=Jp(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===p.layers.size-1&&(i?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},h),r.useEffect(()=>{if(f)return o&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(ef=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(f)),p.layers.add(f),sf(),()=>{o&&(p.layersWithOutsidePointerEventsDisabled.delete(f),0===p.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=ef))}},[f,h,o,p]),r.useEffect(()=>()=>{f&&(p.layers.delete(f),p.layersWithOutsidePointerEventsDisabled.delete(f),sf())},[f,p]),r.useEffect(()=>{const e=()=>v({});return document.addEventListener(tf,e),()=>document.removeEventListener(tf,e)},[]),t.jsx(Pd.div,{...u,ref:g,style:{pointerEvents:k?j?"auto":"none":void 0,...e.style},onFocusCapture:Md(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Md(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Md(e.onPointerDownCapture,C.onPointerDownCapture)})});af.displayName="DismissableLayer";function sf(){const e=new CustomEvent(tf);document.dispatchEvent(e)}function lf(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Ad(r,a):r.dispatchEvent(a)}r.forwardRef((e,n)=>{const o=r.useContext(rf),a=r.useRef(null),i=bd(n,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t.jsx(Pd.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var cf=0,df=null;function uf(){r.useEffect(()=>{df||(df={start:pf(),end:pf()});const{start:e,end:t}=df;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),cf++,()=>{1===cf&&(df?.start.remove(),df?.end.remove(),df=null),cf=Math.max(0,cf-1)}},[])}function pf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ff="focusScope.autoFocusOnMount",mf="focusScope.autoFocusOnUnmount",hf={bubbles:!1,cancelable:!0},vf=r.forwardRef((e,n)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,d]=r.useState(null),u=Jp(i),p=Jp(s),f=r.useRef(null),m=bd(n,e=>d(e)),h=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(a){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:bf(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||bf(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&bf(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[a,c,h.paused]),r.useEffect(()=>{if(c){wf.add(h);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(ff,hf);c.addEventListener(ff,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(bf(o,{select:t}),document.activeElement!==n)return}((e=gf(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&bf(c))}return()=>{c.removeEventListener(ff,u),setTimeout(()=>{const e=new CustomEvent(mf,hf);c.addEventListener(mf,p),c.dispatchEvent(e),e.defaultPrevented||bf(t??document.body,{select:!0}),c.removeEventListener(mf,p),wf.remove(h)},0)}}var e},[c,u,p,h]);const v=r.useCallback(e=>{if(!o&&!a)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=gf(e),n=xf(t,e),o=xf(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&bf(a,{select:!0})):(e.preventDefault(),o&&bf(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return t.jsx(Pd.div,{tabIndex:-1,...l,ref:m,onKeyDown:v})});function gf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xf(e,t){for(const n of e)if(!yf(n,{upTo:t}))return n}function yf(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function bf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}vf.displayName="FocusScope";var wf=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kf(e,t),e.unshift(t)},remove(t){e=kf(e,t),e[0]?.resume()}}}();function kf(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var jf=r.forwardRef((e,n)=>{const{children:o,width:r=10,height:a=5,...i}=e;return t.jsx(Pd.svg,{...i,ref:n,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});jf.displayName="Arrow";var Nf=jf;function Cf(e){const[t,n]=r.useState(void 0);return Od(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var _f="Popper",[Df,Sf]=vd(_f),[Ef,Mf]=Df(_f),Of=e=>{const{__scopePopper:n,children:o}=e,[a,i]=r.useState(null),[s,l]=r.useState(void 0);return t.jsx(Ef,{scope:n,anchor:a,onAnchorChange:i,placementState:s,setPlacementState:l,children:o})};Of.displayName=_f;var Tf="PopperAnchor",Rf=r.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=Mf(Tf,o),l=r.useRef(null),c=s.onAnchorChange,d=bd(n,r.useCallback(e=>{l.current=e,e&&c(e)},[c])),u=r.useRef(null);r.useEffect(()=>{if(!a)return;const e=u.current;u.current=a.current,e!==u.current&&c(u.current)});const p=s.placementState&&Yf(s.placementState),f=p?.[0],m=p?.[1];return a?null:t.jsx(Pd.div,{"data-radix-popper-side":f,"data-radix-popper-align":m,...i,ref:d})});Rf.displayName=Tf;var Pf="PopperContent",[Af,If]=Df(Pf),Ff=r.forwardRef((e,n)=>{const{__scopePopper:o,side:a="bottom",sideOffset:i=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=e,x=Mf(Pf,o),[y,b]=r.useState(null),w=bd(n,e=>b(e)),[k,j]=r.useState(null),N=Cf(k),C=N?.width??0,_=N?.height??0,D=a+("center"!==s?"-"+s:""),S="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},E=Array.isArray(u)?u:[u],M=E.length>0,O={padding:S,boundary:E.filter(Bf),altBoundary:M},{refs:T,floatingStyles:R,placement:P,isPositioned:A,middlewareData:I}=vs({strategy:"fixed",placement:D,whileElementsMounted:(...e)=>ns(...e,{animationFrame:"always"===h}),elements:{reference:x.anchor},middleware:[xs({mainAxis:i+_,alignmentAxis:l}),d&&ys({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?bs():void 0,...O}),d&&ws({...O}),ks({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),k&&Ns({element:k,padding:c}),$f({arrowWidth:C,arrowHeight:_}),m&&js({strategy:"referenceHidden",...O,boundary:M?O.boundary:void 0})]}),F=x.setPlacementState;Od(()=>(F(P),()=>{F(void 0)}),[P,F]);const[z,L]=Yf(P),W=Jp(v);Od(()=>{A&&W?.()},[A,W]);const B=I.arrow?.x,$=I.arrow?.y,Y=0!==I.arrow?.centerOffset,[q,H]=r.useState();return Od(()=>{y&&H(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:A?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Af,{scope:o,placedSide:z,placedAlign:L,onArrowChange:j,arrowX:B,arrowY:$,shouldHideArrow:Y,children:t.jsx(Pd.div,{"data-side":z,"data-align":L,...g,ref:w,style:{...g.style,animation:A?void 0:"none"}})})})});Ff.displayName=Pf;var zf="PopperArrow",Lf={top:"bottom",right:"left",bottom:"top",left:"right"},Wf=r.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,a=If(zf,o),i=Lf[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(Nf,{...r,ref:n,style:{...r.style,display:"block"}})})});function Bf(e){return null!==e}Wf.displayName=zf;var $f=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=Yf(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+s/2;let f="",m="";return"bottom"===l?(f=a?d:`${u}px`,m=-s+"px"):"top"===l?(f=a?d:`${u}px`,m=`${o.floating.height+s}px`):"right"===l?(f=-s+"px",m=a?d:`${p}px`):"left"===l&&(f=`${o.floating.width+s}px`,m=a?d:`${p}px`),{data:{x:f,y:m}}}});function Yf(e){const[t,n="center"]=e.split("-");return[t,n]}var qf=Of,Hf=Rf,Vf=Ff,Kf=Wf,Uf=r.forwardRef((e,n)=>{const{container:o,...i}=e,[s,l]=r.useState(!1);Od(()=>l(!0),[]);const c=o||s&&globalThis?.document?.body;return c?a.createPortal(t.jsx(Pd.div,{...i,ref:n}),c):null});function Gf(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Uf.displayName="Portal";var Zf=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Xf=r.forwardRef((e,n)=>t.jsx(Pd.span,{...e,ref:n,style:{...Zf,...e.style}}));Xf.displayName="VisuallyHidden";var Qf=Xf,Jf=[" ","Enter","ArrowUp","ArrowDown"],em=[" ","Enter"],tm="Select",[nm,om,rm]=Ed(tm),[am]=vd(tm,[rm,Sf]),im=Sf(),[sm,lm]=am(tm),[cm,dm]=am(tm);function um(e){const{__scopeSelect:n,children:o,open:a,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:f,disabled:m,required:h,form:v,internal_do_not_use_render:g}=e,x=im(n),[y,b]=r.useState(null),[w,k]=r.useState(null),[j,N]=r.useState(!1),C=ru(u),[_,D]=Rd({prop:a,defaultProp:i??!1,onChange:s,caller:tm}),[S,E]=Rd({prop:l,defaultProp:c,onChange:d,caller:tm}),M=r.useRef(null),O=!y||(!!v||!!y.closest("form")),[T,R]=r.useState(new Set),P=Bd(),A=Array.from(T).map(e=>e.props.value).join(";"),I=r.useCallback(e=>{R(t=>new Set(t).add(e))},[]),F=r.useCallback(e=>{R(t=>{const n=new Set(t);return n.delete(e),n})},[]),z={required:h,trigger:y,onTriggerChange:b,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:P,value:S,onValueChange:E,open:_,onOpenChange:D,dir:C,triggerPointerDownPosRef:M,disabled:m,name:p,autoComplete:f,form:v,nativeOptions:T,nativeSelectKey:A,isFormControl:O};return t.jsx(qf,{...x,children:t.jsx(sm,{scope:n,...z,children:t.jsx(nm.Provider,{scope:n,children:t.jsx(cm,{scope:n,onNativeOptionAdd:I,onNativeOptionRemove:F,children:ah(g)?g(z):o})})})})}um.displayName="SelectProvider";var pm=e=>{const{__scopeSelect:n,children:o,...r}=e;return t.jsx(um,{__scopeSelect:n,...r,internal_do_not_use_render:({isFormControl:e})=>t.jsxs(t.Fragment,{children:[o,e?t.jsx(rh,{__scopeSelect:n}):null]})})};pm.displayName=tm;var fm="SelectTrigger",mm=r.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,s=im(o),l=lm(fm,o),c=l.disabled||a,d=bd(n,l.onTriggerChange),u=om(o),p=r.useRef("touch"),[f,m,h]=sh(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=lh(t,e,n);void 0!==o&&l.onValueChange(o.value)}),v=e=>{c||(l.onOpenChange(!0),h()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Hf,{asChild:!0,...s,children:t.jsx(Pd.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ih(l.value)?"":void 0,...i,ref:d,onClick:Md(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:Md(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:Md(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),t&&" "===e.key||Jf.includes(e.key)&&(v(),e.preventDefault())})})})});mm.displayName=fm;var hm="SelectValue",vm=r.forwardRef((e,n)=>{const{__scopeSelect:o,className:a,style:i,children:s,placeholder:l="",...c}=e,d=lm(hm,o),{onValueNodeHasChildrenChange:u}=d,p=void 0!==s,f=bd(n,d.onValueNodeChange);Od(()=>{u(p)},[u,p]);const m=ih(d.value);return t.jsx(Pd.span,{...c,asChild:!m&&c.asChild,ref:f,style:{pointerEvents:"none"},children:t.jsx(r.Fragment,{children:m?l:s},m?"placeholder":"value")})});vm.displayName=hm;var gm=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...a}=e;return t.jsx(Pd.span,{"aria-hidden":!0,...a,ref:n,children:r||"▼"})});gm.displayName="SelectIcon";var xm="SelectPortal",[ym,bm]=am(xm,{forceMount:void 0}),wm=e=>{const{__scopeSelect:n,forceMount:o,...r}=e;return t.jsx(ym,{scope:e.__scopeSelect,forceMount:o,children:t.jsx(Uf,{asChild:!0,...r})})};wm.displayName=xm;var km="SelectContent",jm=r.forwardRef((e,n)=>{const o=bm(km,e.__scopeSelect),{forceMount:a=o.forceMount,...i}=e,s=lm(km,e.__scopeSelect),[l,c]=r.useState();return Od(()=>{c(new DocumentFragment)},[]),t.jsx(Id,{present:a||s.open,children:({present:e})=>e?t.jsx(Em,{...i,ref:n}):t.jsx(Nm,{...i,fragment:l})})});jm.displayName=km;var Nm=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,fragment:i}=e;return i?a.createPortal(t.jsx(_m,{scope:o,children:t.jsx(nm.Slot,{scope:o,children:t.jsx("div",{ref:n,children:r})})}),i):null});Nm.displayName="SelectContentFragment";var Cm=10,[_m,Dm]=am(km),Sm=wd("SelectContent.RemoveScroll"),Em=r.forwardRef((e,n)=>{const{__scopeSelect:o}=e,{position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:x,...y}=e,b=lm(km,o),[w,k]=r.useState(null),[j,N]=r.useState(null),C=bd(n,e=>k(e)),[_,D]=r.useState(null),[S,E]=r.useState(null),M=om(o),[O,T]=r.useState(!1),R=r.useRef(!1);r.useEffect(()=>{if(w)return sr(w)},[w]),uf();const P=r.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===o&&j&&(j.scrollTop=j.scrollHeight),n?.focus(),document.activeElement!==r)return}},[M,j]),A=r.useCallback(()=>P([_,w]),[P,_,w]);r.useEffect(()=>{O&&A()},[O,A]);const{onOpenChange:I,triggerPointerDownPosRef:F}=b;r.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||I(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,I,F]),r.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[z,L]=sh(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=lh(t,e,n);o&&setTimeout(()=>o.ref.current?.focus())}),W=r.useCallback((e,t,n)=>{const o=!R.current&&!n;(void 0!==b.value&&b.value===t||o)&&(D(e),o&&(R.current=!0))},[b.value]),B=r.useCallback(()=>w?.focus(),[w]),$=r.useCallback((e,t,n)=>{const o=!R.current&&!n;(void 0!==b.value&&b.value===t||o)&&E(e)},[b.value]),Y="popper"===a?Om:Mm,q=Y===Om?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:x}:{};return t.jsx(_m,{scope:o,content:w,viewport:j,onViewportChange:N,itemRefCallback:W,selectedItem:_,onItemLeave:B,itemTextRefCallback:$,focusSelectedItem:A,selectedItemText:S,position:a,isPositioned:O,searchRef:z,children:t.jsx(er,{as:Sm,allowPinchZoom:!0,children:t.jsx(vf,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Md(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(af,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx(Y,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...q,onPlaced:()=>T(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Md(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})});Em.displayName="SelectContentImpl";var Mm=r.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,s=lm(km,o),l=Dm(km,o),[c,d]=r.useState(null),[u,p]=r.useState(null),f=bd(n,e=>p(e)),m=om(o),h=r.useRef(!1),v=r.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=l,w=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&g&&x&&y){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),o=y.getBoundingClientRect();if("rtl"!==s.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-Cm,u=Qp(a,[Cm,Math.max(Cm,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-Cm,u=Qp(a,[Cm,Math.max(Cm,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const r=m(),i=window.innerHeight-2*Cm,l=g.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),f=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),b=p+f+l+parseInt(d.paddingBottom,10)+v,w=Math.min(5*x.offsetHeight,b),k=window.getComputedStyle(g),j=parseInt(k.paddingTop,10),N=parseInt(k.paddingBottom,10),C=e.top+e.height/2-Cm,_=i-C,D=x.offsetHeight/2,S=p+f+(x.offsetTop+D),E=b-S;if(S<=C){const e=r.length>0&&x===r[r.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=S+Math.max(_,D+(e?N:0)+t+v);c.style.height=n+"px"}else{const e=r.length>0&&x===r[0].ref.current;c.style.top="0px";const t=Math.max(C,p+g.offsetTop+(e?j:0)+D)+E;c.style.height=t+"px",g.scrollTop=S-C+g.offsetTop}c.style.margin=`${Cm}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,c,u,g,x,y,s.dir,a]);Od(()=>w(),[w]);const[k,j]=r.useState();Od(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const N=r.useCallback(e=>{e&&!0===v.current&&(w(),b?.(),v.current=!1)},[w,b]);return t.jsx(Tm,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:t.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:t.jsx(Pd.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Mm.displayName="SelectItemAlignedPosition";var Om=r.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=Cm,...i}=e,s=im(o);return t.jsx(Vf,{...s,...i,ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Om.displayName="SelectPopperPosition";var[Tm,Rm]=am(km,{}),Pm="SelectViewport",Am=r.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:a,...i}=e,s=Dm(Pm,o),l=Rm(Pm,o),c=bd(n,s.onViewportChange),d=r.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),t.jsx(nm.Slot,{scope:o,children:t.jsx(Pd.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Md(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=l;if(o?.current&&n){const e=Math.abs(d.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*Cm,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});Am.displayName=Pm;var Im="SelectGroup",[Fm,zm]=am(Im),Lm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=Bd();return t.jsx(Fm,{scope:o,id:a,children:t.jsx(Pd.div,{role:"group","aria-labelledby":a,...r,ref:n})})});Lm.displayName=Im;var Wm="SelectLabel",Bm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=zm(Wm,o);return t.jsx(Pd.div,{id:a.id,...r,ref:n})});Bm.displayName=Wm;var $m="SelectItem",[Ym,qm]=am($m),Hm=r.forwardRef((e,n)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:s,...l}=e,c=lm($m,o),d=Dm($m,o),u=c.value===a,[p,f]=r.useState(s??""),[m,h]=r.useState(!1),v=bd(n,e=>d.itemRefCallback?.(e,a,i)),g=Bd(),x=r.useRef("touch"),y=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};return t.jsx(Ym,{scope:o,value:a,disabled:i,textId:g,isSelected:u,onItemTextChange:r.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:t.jsx(nm.ItemSlot,{scope:o,value:a,disabled:i,textValue:p,children:t.jsx(Pd.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:v,onFocus:Md(l.onFocus,()=>h(!0)),onBlur:Md(l.onBlur,()=>h(!1)),onClick:Md(l.onClick,()=>{"mouse"!==x.current&&y()}),onPointerUp:Md(l.onPointerUp,()=>{"mouse"===x.current&&y()}),onPointerDown:Md(l.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:Md(l.onPointerMove,e=>{x.current=e.pointerType,i?d.onItemLeave?.():"mouse"===x.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Md(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Md(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(em.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});Hm.displayName=$m;var Vm="SelectItemText",Km=r.forwardRef((e,n)=>{const{__scopeSelect:o,className:i,style:s,...l}=e,c=lm(Vm,o),d=Dm(Vm,o),u=qm(Vm,o),p=dm(Vm,o),[f,m]=r.useState(null),h=bd(n,e=>m(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),v=f?.textContent,g=r.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:x,onNativeOptionRemove:y}=p;return Od(()=>(x(g),()=>y(g)),[x,y,g]),t.jsxs(t.Fragment,{children:[t.jsx(Pd.span,{id:u.textId,...l,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!ih(c.value)?a.createPortal(l.children,c.valueNode):null]})});Km.displayName=Vm;var Um="SelectItemIndicator",Gm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return qm(Um,o).isSelected?t.jsx(Pd.span,{"aria-hidden":!0,...r,ref:n}):null});Gm.displayName=Um;var Zm="SelectScrollUpButton",Xm=r.forwardRef((e,n)=>{const o=Dm(Zm,e.__scopeSelect),a=Rm(Zm,e.__scopeSelect),[i,s]=r.useState(!1),l=bd(n,a.onScrollButtonChange);return Od(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t.jsx(eh,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Xm.displayName=Zm;var Qm="SelectScrollDownButton",Jm=r.forwardRef((e,n)=>{const o=Dm(Qm,e.__scopeSelect),a=Rm(Qm,e.__scopeSelect),[i,s]=r.useState(!1),l=bd(n,a.onScrollButtonChange);return Od(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t.jsx(eh,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Jm.displayName=Qm;var eh=r.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,s=Dm("SelectScrollButton",o),l=r.useRef(null),c=om(o),d=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),Od(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t.jsx(Pd.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:Md(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:Md(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:Md(i.onPointerLeave,()=>{d()})})}),th=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t.jsx(Pd.div,{"aria-hidden":!0,...r,ref:n})});th.displayName="SelectSeparator";var nh="SelectArrow";r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=im(o);return"popper"===Dm(nh,o).position?t.jsx(Kf,{...a,...r,ref:n}):null}).displayName=nh;var oh="SelectBubbleInput",rh=r.forwardRef(({__scopeSelect:e,...n},o)=>{const a=lm(oh,e),{value:i,onValueChange:s,required:l,disabled:c,name:d,autoComplete:u,form:p}=a,{nativeOptions:f,nativeSelectKey:m}=a,h=r.useRef(null),v=bd(o,h),g=i??"",x=Gf(g),y=Array.from(f).some(e=>""===(e.props.value??""));return r.useEffect(()=>{const e=h.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(x!==g&&n){const t=new Event("change",{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[x,g]),t.jsxs(Pd.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:d,autoComplete:u,disabled:c,form:p,onChange:e=>s(e.target.value),...n,style:{...Zf,...n.style},ref:v,defaultValue:g,children:[ih(i)&&!y?t.jsx("option",{value:""}):null,Array.from(f)]},m)});function ah(e){return"function"==typeof e}function ih(e){return""===e||void 0===e}function sh(e){const t=Jp(e),n=r.useRef(""),o=r.useRef(0),a=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function lh(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=(i=e,s=Math.max(r,0),i.map((e,t)=>i[(s+t)%i.length]));var i,s;1===o.length&&(a=a.filter(e=>e!==n));const l=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}rh.displayName=oh;const ch=pm,dh=Lm,uh=vm,ph=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(mm,{ref:r,"data-slot":"select-trigger",className:Ie(We,"justify-between whitespace-nowrap data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",e),...o,children:[n,t.jsx(gm,{asChild:!0,children:t.jsx($l,{className:"h-4 w-4 opacity-50"})})]}));ph.displayName=mm.displayName;const fh=r.forwardRef(({className:e,...n},o)=>t.jsx(Xm,{ref:o,"data-slot":"select-scroll-up-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(Hl,{className:"h-4 w-4"})}));fh.displayName=Xm.displayName;const mh=r.forwardRef(({className:e,...n},o)=>t.jsx(Jm,{ref:o,"data-slot":"select-scroll-down-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx($l,{className:"h-4 w-4"})}));mh.displayName=Jm.displayName;const hh=r.forwardRef(({className:e,children:n,position:o="popper",...r},a)=>t.jsx(wm,{children:t.jsxs(jm,{ref:a,"data-slot":"select-content",className:Ie("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:[t.jsx(fh,{}),t.jsx(Am,{className:Ie("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(mh,{})]})}));hh.displayName=jm.displayName;const vh=r.forwardRef(({className:e,...n},o)=>t.jsx(Bm,{ref:o,"data-slot":"select-label",className:Ie("px-2 py-1.5 text-sm font-semibold",e),...n}));vh.displayName=Bm.displayName;const gh=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(Hm,{ref:r,"data-slot":"select-item",className:Ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Gm,{children:t.jsx(Bl,{className:"h-4 w-4"})})}),t.jsx(Km,{children:n})]}));gh.displayName=Hm.displayName;const xh=r.forwardRef(({className:e,...n},o)=>t.jsx(th,{ref:o,"data-slot":"select-separator",className:Ie("-mx-1 my-1 h-px bg-muted",e),...n}));xh.displayName=th.displayName;const yh=({id:n,placeholder:o,options:r,className:a,value:i,onValueChange:s,required:l,name:c})=>{const[d,u]=e.useState(i||"");e.useEffect(()=>{u(i||"")},[i]);const p=i??d;return t.jsxs(t.Fragment,{children:[c?t.jsx("input",{type:"hidden",name:c,value:p,required:l}):null,t.jsx("div",{className:Ie("flex w-full min-w-0",a),children:t.jsxs(ch,{value:p||void 0,onValueChange:e=>{u(e),s?.(e)},children:[t.jsx(ph,{"data-testid":n,className:"w-full",children:t.jsx(uh,{placeholder:o})}),t.jsx(hh,{children:(r??[]).map(e=>t.jsx(gh,{"data-testid":e.value,value:e.value,className:Ie("cursor-pointer",Ye,d===e.value?"bg-accent text-accent-foreground":""),children:e.label},e.value))})]})})]})},bh=6048e5,wh=Symbol.for("constructDateFrom");function kh(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&wh in e?e[wh](t):e instanceof Date?new e.constructor(t):new Date(t)}function jh(e,t){return kh(t||e,e)}function Nh(e,t,n){const o=jh(e,n?.in);return isNaN(t)?kh(e,NaN):t?(o.setDate(o.getDate()+t),o):o}function Ch(e,t,n){const o=jh(e,n?.in);if(isNaN(t))return kh(e,NaN);if(!t)return o;const r=o.getDate(),a=kh(e,o.getTime());a.setMonth(o.getMonth()+t+1,0);return r>=a.getDate()?a:(o.setFullYear(a.getFullYear(),a.getMonth(),r),o)}let _h={};function Dh(){return _h}function Sh(e,t){const n=Dh(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=jh(e,t?.in),a=r.getDay(),i=(a<o?7:0)+a-o;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Eh(e,t){return Sh(e,{...t,weekStartsOn:1})}function Mh(e,t){const n=jh(e,t?.in),o=n.getFullYear(),r=kh(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const a=Eh(r),i=kh(n,0);i.setFullYear(o,0,4),i.setHours(0,0,0,0);const s=Eh(i);return n.getTime()>=a.getTime()?o+1:n.getTime()>=s.getTime()?o:o-1}function Oh(e){const t=jh(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Th(e,...t){const n=kh.bind(null,t.find(e=>"object"==typeof e));return t.map(n)}function Rh(e,t){const n=jh(e,t?.in);return n.setHours(0,0,0,0),n}function Ph(e,t,n){const[o,r]=Th(0,e,t),a=Rh(o),i=Rh(r),s=+a-Oh(a),l=+i-Oh(i);return Math.round((s-l)/864e5)}function Ah(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Ih(e,t,n){const[o,r]=Th(0,e,t);return 12*(o.getFullYear()-r.getFullYear())+(o.getMonth()-r.getMonth())}function Fh(e,t){const n=jh(e,t?.in);return n.setHours(23,59,59,999),n}function zh(e,t){const[n,o]=Th(0,t.start,t.end);return{start:n,end:o}}function Lh(e,t){const n=jh(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Wh(e,t){const n=Dh(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=jh(e,t?.in),a=r.getDay(),i=6+(a<o?-7:0)-(a-o);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}const Bh={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function $h(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yh={date:$h({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$h({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$h({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},qh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Hh(e){return(t,n)=>{let o;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;o=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;o=e.values[r]||e.values[t]}return o[e.argumentCallback?e.argumentCallback(t):t]}}const Vh={ordinalNumber:(e,t)=>{const n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Hh({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Hh({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hh({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Hh({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Hh({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function Kh(e){return(t,n={})=>{const o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const i=a[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,e=>e.test(i)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,e=>e.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const Uh={ordinalNumber:(Gh={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(Gh.matchPattern);if(!n)return null;const o=n[0],r=e.match(Gh.parsePattern);if(!r)return null;let a=Gh.valueCallback?Gh.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(o.length)}}),era:Kh({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Kh({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Kh({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Kh({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Kh({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var Gh;const Zh={code:"en-US",formatDistance:(e,t,n)=>{let o;const r=Bh[e];return o="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o},formatLong:Yh,formatRelative:(e,t,n,o)=>qh[e],localize:Vh,match:Uh,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Xh(e,t){const n=jh(e,t?.in),o=+Eh(n)-+function(e,t){const n=Mh(e,t),o=kh(e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),Eh(o)}(n);return Math.round(o/bh)+1}function Qh(e,t){const n=jh(e,t?.in),o=n.getFullYear(),r=Dh(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=kh(t?.in||e,0);i.setFullYear(o+1,0,a),i.setHours(0,0,0,0);const s=Sh(i,t),l=kh(t?.in||e,0);l.setFullYear(o,0,a),l.setHours(0,0,0,0);const c=Sh(l,t);return+n>=+s?o+1:+n>=+c?o:o-1}function Jh(e,t){const n=jh(e,t?.in),o=+Sh(n,t)-+function(e,t){const n=Dh(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Qh(e,t),a=kh(t?.in||e,0);return a.setFullYear(r,0,o),a.setHours(0,0,0,0),Sh(a,t)}(n,t);return Math.round(o/bh)+1}function ev(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const tv={y(e,t){const n=e.getFullYear(),o=n>0?n:1-n;return ev("yy"===t?o%100:o,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):ev(n+1,2)},d:(e,t)=>ev(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>ev(e.getHours()%12||12,t.length),H:(e,t)=>ev(e.getHours(),t.length),m:(e,t)=>ev(e.getMinutes(),t.length),s:(e,t)=>ev(e.getSeconds(),t.length),S(e,t){const n=t.length,o=e.getMilliseconds();return ev(Math.trunc(o*Math.pow(10,n-3)),t.length)}},nv="midnight",ov="noon",rv="morning",av="afternoon",iv="evening",sv="night",lv={G:function(e,t,n){const o=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),o=t>0?t:1-t;return n.ordinalNumber(o,{unit:"year"})}return tv.y(e,t)},Y:function(e,t,n,o){const r=Qh(e,o),a=r>0?r:1-r;if("YY"===t){return ev(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):ev(a,t.length)},R:function(e,t){return ev(Mh(e),t.length)},u:function(e,t){return ev(e.getFullYear(),t.length)},Q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return ev(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return ev(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,n){const o=e.getMonth();switch(t){case"M":case"MM":return tv.M(e,t);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,n){const o=e.getMonth();switch(t){case"L":return String(o+1);case"LL":return ev(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,n,o){const r=Jh(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):ev(r,t.length)},I:function(e,t,n){const o=Xh(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):ev(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):tv.d(e,t)},D:function(e,t,n){const o=function(e,t){const n=jh(e,t?.in);return Ph(n,Lh(n))+1}(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):ev(o,t.length)},E:function(e,t,n){const o=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,n,o){const r=e.getDay(),a=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return ev(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,o){const r=e.getDay(),a=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return ev(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const o=e.getDay(),r=0===o?7:o;switch(t){case"i":return String(r);case"ii":return ev(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const o=e.getHours();let r;switch(r=12===o?ov:0===o?nv:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const o=e.getHours();let r;switch(r=o>=17?iv:o>=12?av:o>=4?rv:sv,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return tv.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):tv.H(e,t)},K:function(e,t,n){const o=e.getHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):ev(o,t.length)},k:function(e,t,n){let o=e.getHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):ev(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):tv.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):tv.s(e,t)},S:function(e,t){return tv.S(e,t)},X:function(e,t,n){const o=e.getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return dv(o);case"XXXX":case"XX":return uv(o);default:return uv(o,":")}},x:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"x":return dv(o);case"xxxx":case"xx":return uv(o);default:return uv(o,":")}},O:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cv(o,":");default:return"GMT"+uv(o,":")}},z:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cv(o,":");default:return"GMT"+uv(o,":")}},t:function(e,t,n){return ev(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return ev(+e,t.length)}};function cv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e),r=Math.trunc(o/60),a=o%60;return 0===a?n+String(r):n+String(r)+t+ev(a,2)}function dv(e,t){if(e%60==0){return(e>0?"-":"+")+ev(Math.abs(e)/60,2)}return uv(e,t)}function uv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e);return n+ev(Math.trunc(o/60),2)+t+ev(o%60,2)}const pv=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},fv=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},mv={p:fv,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return pv(e,t);let a;switch(o){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",pv(o,t)).replace("{{time}}",fv(r,t))}},hv=/^D+$/,vv=/^Y+$/,gv=["D","DD","YY","YYYY"];const xv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bv=/^'([^]*?)'?$/,wv=/''/g,kv=/[a-zA-Z]/;function jv(e,t,n){const o=Dh(),r=n?.locale??o.locale??Zh,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,s=jh(e,n?.in);if(!function(e){return!(!Ah(e)&&"number"!=typeof e||isNaN(+jh(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(yv).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,mv[t])(e,r.formatLong)}return e}).join("").match(xv).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Nv(e)};if(lv[t])return{isToken:!0,value:e};if(t.match(kv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(l=r.localize.preprocessor(s,l));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:r};return l.map(o=>{if(!o.isToken)return o.value;const a=o.value;(!n?.useAdditionalWeekYearTokens&&function(e){return vv.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return hv.test(e)}(a))&&function(e,t,n){const o=function(e,t,n){const o="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(o),gv.includes(e))throw new RangeError(o)}(a,t,String(e));return(0,lv[a[0]])(s,a,r.localize,c)}).join("")}function Nv(e){const t=e.match(bv);return t?t[1].replace(wv,"'"):e}function Cv(e,t,n){const o=jh(e,n?.in),r=o.getFullYear(),a=o.getDate(),i=kh(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=jh(e,t?.in),o=n.getFullYear(),r=n.getMonth(),a=kh(n,0);return a.setFullYear(o,r+1,0),a.setHours(0,0,0,0),a.getDate()}(i);return o.setMonth(t,Math.min(a,s)),o}const _v={},Dv={};function Sv(e,t){try{const n=(_v[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in Dv?Dv[n]:Mv(n,n.split(":"))}catch{if(e in Dv)return Dv[e];const t=e?.match(Ev);return t?Mv(e,t.slice(1)):NaN}}const Ev=/([+-]\d\d):?(\d\d)?/;function Mv(e,t){const n=+(t[0]||0),o=+(t[1]||0),r=+(t[2]||0)/60;return Dv[e]=60*n+o>0?60*n+o+r:60*n-o-r}class Ov extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Sv(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Pv(this),Rv(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ov(...t,e):new Ov(Date.now(),e)}withTimeZone(e){return new Ov(+this,e)}getTimezoneOffset(){const e=-Sv(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Rv(this),+this}[Symbol.for("constructDateFrom")](e){return new Ov(+new Date(e),this.timeZone)}}const Tv=/^(get|set)(?!UTC)/;function Rv(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-Sv(e.timeZone,e)))}function Pv(e){const t=Sv(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),o=new Date(+e);o.setUTCHours(o.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),a=r- -new Date(+o).getTimezoneOffset(),i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const s=r-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const l=new Date(+e);l.setUTCSeconds(0);const c=r>0?l.getSeconds():(l.getSeconds()-60)%60,d=Math.round(-60*Sv(e.timeZone,e))%60;(d||c)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+c));const u=Sv(e.timeZone,e),p=u>0?Math.floor(u):Math.ceil(u),f=-new Date(+e).getTimezoneOffset()-p-s;if(p!==n&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);const t=Sv(e.timeZone,e),n=p-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Tv.test(e))return;const t=e.replace(Tv,"$1UTC");Ov.prototype[t]&&(e.startsWith("get")?Ov.prototype[e]=function(){return this.internal[t]()}:(Ov.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Pv(e),+this},Ov.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Rv(this),+this}))});class Av extends Ov{static tz(e,...t){return t.length?new Av(...t,e):new Av(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),o=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,o]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${o}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,o]=this.tzComponents();return`${e} GMT${t}${n}${o} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new Av(+this,e)}[Symbol.for("constructDateFrom")](e){return new Av(+new Date(e),this.timeZone)}}function Iv(e,t){const n=t.startOfMonth(e),o=n.getDay();return 1===o?n:0===o?t.addDays(n,-6):t.addDays(n,-1*(o-1))}const Fv={...Zh,labels:{labelDayButton:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>jv(e,t,{locale:Zh,...n});let a=r(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let o;return o=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>jv(e,n,{locale:Zh,...t}),o(e,"LLLL yyyy")},labelGridcell:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>jv(e,t,{locale:Zh,...n});let a=r(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let o;return o=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>jv(e,n,{locale:Zh,...t}),o(e,"cccc")}}};class zv{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Av.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new Av(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):Nh(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Ch(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return Nh(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return Ch(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):Ph(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):Ih(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e){const{start:t,end:n}=zh(0,e);let o=+t>+n;const r=o?+t:+n,a=o?n:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=r;)i.push(kh(t,a)),a.setMonth(a.getMonth()+1);return o?i.reverse():i}(e),this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):function(e){const{start:t,end:n}=zh(0,e);let o=+t>+n;const r=o?+t:+n,a=o?n:t;a.setHours(0,0,0,0),a.setMonth(0,1);const i=[];for(;+a<=r;)i.push(kh(t,a)),a.setFullYear(a.getFullYear()+1);return o?i.reverse():i}(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;const o=[];return n.forEach(e=>{o.push(new Date(e,0,1))}),o},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):function(e,t){const n=Iv(e,t),o=function(e,t){const n=t.startOfMonth(e),o=n.getDay()>0?n.getDay():7,r=t.addDays(e,1-o),a=t.addDays(r,34);return t.getMonth(e)===t.getMonth(a)?5:4}(e,t);return t.addDays(n,7*o-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return Wh(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):function(e,t){const n=jh(e,t?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):Wh(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=jh(e,t?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t,n)=>{const o=this.overrides?.format?this.overrides.format(e,t,this.options):jv(e,t,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(o):o},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):Xh(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return jh(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return jh(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):Jh(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):function(e,t){return+jh(e)>+jh(t)}(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):function(e,t){return+jh(e)<+jh(t)}(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):Ah(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t){const[n,o]=Th(0,e,t);return+Rh(n)===+Rh(o)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t){const[n,o]=Th(0,e,t);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t){const[n,o]=Th(0,e,t);return n.getFullYear()===o.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,o=t?.in;return e.forEach(e=>{o||"object"!=typeof e||(o=kh.bind(null,e));const t=jh(e,o);(!n||n<t||isNaN(+t))&&(n=t)}),kh(o,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,o=t?.in;return e.forEach(e=>{o||"object"!=typeof e||(o=kh.bind(null,e));const t=jh(e,o);(!n||n>t||isNaN(+t))&&(n=t)}),kh(o,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):Cv(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const o=jh(e,n?.in);return isNaN(+o)?kh(e,NaN):(o.setFullYear(t),o)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):Iv(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Rh(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):Eh(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):function(e,t){const n=jh(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):Sh(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):Lh(e),this.options={locale:Fv,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&zv.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:o}=this.options,r=t?.code;if(r&&zv.yearFirstLocales.has(r))try{const t=new Intl.DateTimeFormat(r,{month:"long",year:"numeric",timeZone:n,numberingSystem:o});return t.format(e)}catch{}const a="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(e,a)}}zv.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Lv=new zv;class Wv{constructor(e,t,n=Lv){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,"yyyy-MM-dd"),this.displayMonthId=n.format(t,"yyyy-MM"),this.dateMonthId=n.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class Bv{constructor(e,t){this.date=e,this.weeks=t}}class $v{constructor(e,t){this.days=t,this.weekNumber=e}}var Yv,qv,Hv,Vv;!function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(Yv||(Yv={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(qv||(qv={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(Hv||(Hv={})),function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"}(Vv||(Vv={}));const Kv=e.createContext(void 0);function Uv(){const t=e.useContext(Kv);if(void 0===t)throw new Error("useDayPicker() must be used within a custom component.");return t}var Gv=Object.freeze({__proto__:null,Button:function(t){return e.createElement("button",{...t})},CaptionLabel:function(t){return e.createElement("span",{...t})},Chevron:function(t){const{size:n=24,orientation:o="left",className:r}=t;return e.createElement("svg",{className:r,width:n,height:n,viewBox:"0 0 24 24"},"up"===o&&e.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===o&&e.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===o&&e.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===o&&e.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))},Day:function(t){const{day:n,modifiers:o,...r}=t;return e.createElement("td",{...r})},DayButton:function(t){const{day:n,modifiers:o,...r}=t,a=e.useRef(null);return e.useEffect(()=>{o.focused&&a.current?.focus()},[o.focused]),e.createElement("button",{ref:a,...r})},Dropdown:function(t){const{options:n,className:o,components:r,classNames:a,...i}=t,s=[a[Yv.Dropdown],o].join(" "),l=n?.find(({value:e})=>e===i.value);return e.createElement("span",{"data-disabled":i.disabled,className:a[Yv.DropdownRoot]},e.createElement(r.Select,{className:s,...i},n?.map(({value:t,label:n,disabled:o})=>e.createElement(r.Option,{key:t,value:t,disabled:o},n))),e.createElement("span",{className:a[Yv.CaptionLabel],"aria-hidden":!0},l?.label,e.createElement(r.Chevron,{orientation:"down",size:18,className:a[Yv.Chevron]})))},DropdownNav:function(t){return e.createElement("div",{...t})},Footer:function(t){return e.createElement("div",{...t})},Month:function(t){const{calendarMonth:n,displayIndex:o,...r}=t;return e.createElement("div",{...r},t.children)},MonthCaption:function(t){const{calendarMonth:n,displayIndex:o,...r}=t;return e.createElement("div",{...r})},MonthGrid:function(t){return e.createElement("table",{...t})},Months:function(t){return e.createElement("div",{...t})},MonthsDropdown:function(t){const{components:n}=Uv();return e.createElement(n.Dropdown,{...t})},Nav:function(t){const{onPreviousClick:n,onNextClick:o,previousMonth:r,nextMonth:a,...i}=t,{components:s,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Uv(),u=e.useCallback(e=>{a&&o?.(e)},[a,o]),p=e.useCallback(e=>{r&&n?.(e)},[r,n]);return e.createElement("nav",{...i},e.createElement(s.PreviousMonthButton,{type:"button",className:l[Yv.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":c(r),onClick:p},e.createElement(s.Chevron,{disabled:!r||void 0,className:l[Yv.Chevron],orientation:"left"})),e.createElement(s.NextMonthButton,{type:"button",className:l[Yv.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":!a||void 0,"aria-label":d(a),onClick:u},e.createElement(s.Chevron,{disabled:!a||void 0,orientation:"right",className:l[Yv.Chevron]})))},NextMonthButton:function(t){const{components:n}=Uv();return e.createElement(n.Button,{...t})},Option:function(t){return e.createElement("option",{...t})},PreviousMonthButton:function(t){const{components:n}=Uv();return e.createElement(n.Button,{...t})},Root:function(t){const{rootRef:n,...o}=t;return e.createElement("div",{...o,ref:n})},Select:function(t){return e.createElement("select",{...t})},Week:function(t){const{week:n,...o}=t;return e.createElement("tr",{...o})},WeekNumber:function(t){const{week:n,...o}=t;return e.createElement("th",{...o})},WeekNumberHeader:function(t){return e.createElement("th",{...t})},Weekday:function(t){return e.createElement("th",{...t})},Weekdays:function(t){return e.createElement("thead",{"aria-hidden":!0},e.createElement("tr",{...t}))},Weeks:function(t){return e.createElement("tbody",{...t})},YearsDropdown:function(t){const{components:n}=Uv();return e.createElement(n.Dropdown,{...t})}});function Zv(e,t,n=!1,o=Lv){let{from:r,to:a}=e;const{differenceInCalendarDays:i,isSameDay:s}=o;if(r&&a){i(a,r)<0&&([r,a]=[a,r]);return i(t,r)>=(n?1:0)&&i(a,t)>=(n?1:0)}return!n&&a?s(a,t):!(n||!r)&&s(r,t)}function Xv(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function Qv(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function Jv(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function eg(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function tg(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function ng(e,t){return Array.isArray(e)&&e.every(t.isDate)}function og(e,t,n=Lv){const o=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:a,isAfter:i}=n;return o.some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return r(e,t);if(ng(t,n))return t.some(t=>r(e,t));if(Qv(t))return Zv(t,e,!1,n);if(tg(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(Xv(t)){const n=a(t.before,e)>0,o=a(t.after,e)<0;return i(t.before,t.after)?o&&n:n||o}return Jv(t)?a(e,t.after)>0:eg(t)?a(t.before,e)>0:"function"==typeof t&&t(e)})}function rg(e){return{...Gv,...e}}function ag(){const e={};for(const t in Yv)e[Yv[t]]=`rdp-${Yv[t]}`;for(const t in qv)e[qv[t]]=`rdp-${qv[t]}`;for(const t in Hv)e[Hv[t]]=`rdp-${Hv[t]}`;for(const t in Vv)e[Vv[t]]=`rdp-${Vv[t]}`;return e}function ig(e,t,n){return(n??new zv(t)).formatMonthYear(e)}const sg=ig;function lg(e,t=Lv){return t.format(e,"yyyy")}const cg=lg;var dg=Object.freeze({__proto__:null,formatCaption:ig,formatDay:function(e,t,n){return(n??new zv(t)).format(e,"d")},formatMonthCaption:sg,formatMonthDropdown:function(e,t=Lv){return t.format(e,"LLLL")},formatWeekNumber:function(e,t=Lv){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)},formatWeekNumberHeader:function(){return""},formatWeekdayName:function(e,t,n){return(n??new zv(t)).format(e,"cccccc")},formatYearCaption:cg,formatYearDropdown:lg});function ug(e,t,n,o){let r=(o??new zv(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const pg=ug;function fg(e,t,n){return(n??new zv(t)).formatMonthYear(e)}const mg=fg;function hg(e,t,n,o){let r=(o??new zv(n)).format(e,"PPPP");return t?.today&&(r=`Today, ${r}`),r}function vg(e){return"Choose the Month"}function gg(){return""}function xg(e,t){return"Go to the Next Month"}function yg(e){return"Go to the Previous Month"}function bg(e,t,n){return(n??new zv(t)).format(e,"cccc")}function wg(e,t){return`Week ${e}`}function kg(e){return"Week Number"}function jg(e){return"Choose the Year"}var Ng=Object.freeze({__proto__:null,labelCaption:mg,labelDay:pg,labelDayButton:ug,labelGrid:fg,labelGridcell:hg,labelMonthDropdown:vg,labelNav:gg,labelNext:xg,labelPrevious:yg,labelWeekNumber:wg,labelWeekNumberHeader:kg,labelWeekday:bg,labelYearDropdown:jg});const Cg=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function _g(e,t){const n=t.locale?.labels??{};return{...Ng,...e??{},labelDayButton:Cg(ug,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:Cg(vg,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Cg(xg,e?.labelNext,n.labelNext),labelPrevious:Cg(yg,e?.labelPrevious,n.labelPrevious),labelWeekNumber:Cg(wg,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Cg(jg,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:Cg(fg,e?.labelGrid,n.labelGrid),labelGridcell:Cg(hg,e?.labelGridcell,n.labelGridcell),labelNav:Cg(gg,e?.labelNav,n.labelNav),labelWeekNumberHeader:Cg(kg,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Cg(bg,e?.labelWeekday,n.labelWeekday)}}function Dg(e,t,n,o,r){const{startOfMonth:a,startOfYear:i,endOfYear:s,eachMonthOfInterval:l,getMonth:c}=r;return l({start:i(e),end:s(e)}).map(e=>{const i=o.formatMonthDropdown(e,r);return{value:c(e),label:i,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function Sg(e,t,n,o,r=!1){if(!e)return;if(!t)return;const{startOfYear:a,endOfYear:i,eachYearOfInterval:s,getYear:l}=o,c=s({start:a(e),end:i(t)});return r&&c.reverse(),c.map(e=>{const t=n.formatYearDropdown(e,o);return{value:l(e),label:t,disabled:!1}})}const Eg=e=>e instanceof HTMLElement?e:null,Mg=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Og=e=>Eg(e.querySelector("[data-animated-caption]")),Tg=e=>Eg(e.querySelector("[data-animated-weeks]"));function Rg(t,n,{classNames:o,months:r,focused:a,dateLib:i}){const s=e.useRef(null),l=e.useRef(r),c=e.useRef(!1);e.useLayoutEffect(()=>{const e=l.current;if(l.current=r,!(n&&t.current&&t.current instanceof HTMLElement&&0!==r.length&&0!==e.length&&r.length===e.length))return;const d=i.isSameMonth(r[0].date,e[0].date),u=i.isAfter(r[0].date,e[0].date),p=u?o[Vv.caption_after_enter]:o[Vv.caption_before_enter],f=u?o[Vv.weeks_after_enter]:o[Vv.weeks_before_enter],m=s.current,h=t.current.cloneNode(!0);if(h instanceof HTMLElement){Mg(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=Eg(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=Og(e);n&&n.classList.remove(p);const o=Tg(e);o&&o.classList.remove(f)}),s.current=h}else s.current=null;if(c.current||d||a)return;const v=m instanceof HTMLElement?Mg(m):[],g=Mg(t.current);if(g?.every(e=>e instanceof HTMLElement)&&v&&v.every(e=>e instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const e=(x=t.current,Eg(x.querySelector("[data-animated-nav]")));e&&(e.style.zIndex="1"),g.forEach((n,r)=>{const a=v[r];if(!a)return;n.style.position="relative",n.style.overflow="hidden";const i=Og(n);i&&i.classList.add(p);const s=Tg(n);s&&s.classList.add(f);const l=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),e&&(e.style.zIndex=""),i&&i.classList.remove(p),s&&s.classList.remove(f),n.style.position="",n.style.overflow="",n.contains(a)&&n.removeChild(a)};a.style.pointerEvents="none",a.style.position="absolute",a.style.overflow="hidden",a.setAttribute("aria-hidden","true");const d=(e=>Eg(e.querySelector("[data-animated-weekdays]")))(a);d&&(d.style.opacity="0");const m=Og(a);m&&(m.classList.add(u?o[Vv.caption_before_exit]:o[Vv.caption_after_exit]),m.addEventListener("animationend",l));const h=Tg(a);h&&h.classList.add(u?o[Vv.weeks_before_exit]:o[Vv.weeks_after_exit]),n.insertBefore(a,n.firstChild)})}var x})}function Pg(e,t,n,o){const{month:r,defaultMonth:a,today:i=o.today(),numberOfMonths:s=1}=e;let l=r||a||i;const{differenceInCalendarMonths:c,addMonths:d,startOfMonth:u}=o;if(n&&c(n,l)<s-1){l=d(n,-1*(s-1))}return t&&c(l,t)<0&&(l=t),u(l)}function Ag(t,n){const[o,r]=e.useState(t);return[void 0===n?o:n,r]}function Ig(t,n){const[o,r]=function(e,t){let{startMonth:n,endMonth:o}=e;const{startOfYear:r,startOfDay:a,startOfMonth:i,endOfMonth:s,addYears:l,endOfYear:c,newDate:d,today:u}=t,{fromYear:p,toYear:f,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&p&&(n=t.newDate(p,0,1)),!o&&h&&(o=h),!o&&f&&(o=d(f,11,31));const v="dropdown"===e.captionLayout||"dropdown-years"===e.captionLayout;return n?n=i(n):p?n=d(p,0,1):!n&&v&&(n=r(l(e.today??u(),-100))),o?o=s(o):f?o=d(f,11,31):!o&&v&&(o=c(e.today??u())),[n?a(n):n,o?a(o):o]}(t,n),{startOfMonth:a,endOfMonth:i}=n,s=Pg(t,o,r,n),[l,c]=Ag(s,t.month?s:void 0);e.useEffect(()=>{const e=Pg(t,o,r,n);c(e)},[t.timeZone]);const{months:d,weeks:u,days:p,previousMonth:f,nextMonth:m}=e.useMemo(()=>{const e=function(e,t,n,o){const{numberOfMonths:r=1}=n,a=[];for(let n=0;n<r;n++){const r=o.addMonths(e,n);if(t&&r>t)break;a.push(r)}return a}(l,r,{numberOfMonths:t.numberOfMonths},n),a=function(e,t,n,o){const r=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:d,differenceInCalendarMonths:u,endOfBroadcastWeek:p,endOfISOWeek:f,endOfMonth:m,endOfWeek:h,isAfter:v,startOfBroadcastWeek:g,startOfISOWeek:x,startOfWeek:y}=o,b=l?g(r,o):i?x(r):y(r),w=l?p(a):i?f(m(a)):h(m(a)),k=t&&(l?p(t):i?f(t):h(t)),j=d(k&&v(w,k)?k:w,b),N=u(a,r)+1,C=[];for(let e=0;e<=j;e++){const t=c(b,e);C.push(t)}const _=(l?35:42)*N;if(s&&C.length<_){const e=_-C.length;for(let t=0;t<e;t++){const e=c(C[C.length-1],1);C.push(e)}}return C}(e,t.endMonth?i(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},n),s=function(e,t,n,o){const{addDays:r,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:s,endOfWeek:l,getISOWeek:c,getWeek:d,startOfBroadcastWeek:u,startOfISOWeek:p,startOfWeek:f}=o,m=e.reduce((e,m)=>{const h=n.broadcastCalendar?u(m,o):n.ISOWeek?p(m):f(m),v=n.broadcastCalendar?a(m):n.ISOWeek?i(s(m)):l(s(m)),g=t.filter(e=>e>=h&&e<=v),x=n.broadcastCalendar?35:42;if(n.fixedWeeks&&g.length<x){const e=t.filter(e=>{const t=x-g.length;return e>v&&e<=r(v,t)});g.push(...e)}const y=g.reduce((e,t)=>{const r=n.ISOWeek?c(t):d(t),a=e.find(e=>e.weekNumber===r),i=new Wv(t,m,o);return a?a.days.push(i):e.push(new $v(r,[i])),e},[]),b=new Bv(m,y);return e.push(b),e},[]);return n.reverseMonths?m.reverse():m}(e,a,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},n),c=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(s),d=function(e){const t=[];return e.reduce((e,n)=>{const o=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(o.slice())},t.slice())}(s),u=function(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=o,c=r?a??1:1,d=i(e);return t&&l(d,t)<=0?void 0:s(d,-c)}(l,o,t,n),p=function(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=o,c=r?a:1,d=i(e);return t&&l(t,e)<a?void 0:s(d,c)}(l,r,t,n);return{months:s,weeks:c,days:d,previousMonth:u,nextMonth:p}},[n,l.getTime(),r?.getTime(),o?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:h,onMonthChange:v}=t,g=e=>{if(h)return;let t=a(e);o&&t<a(o)&&(t=a(o)),r&&t>a(r)&&(t=a(r)),c(t),v?.(t)};return{months:d,weeks:u,days:p,navStart:o,navEnd:r,previousMonth:f,nextMonth:m,goToMonth:g,goToDay:e=>{(e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||g(e.date)}}}var Fg;function zg(e){return!e[qv.disabled]&&!e[qv.hidden]&&!e[qv.outside]}function Lg(e,t,n,o,r,a,i,s=0){if(s>365)return;const l=function(e,t,n,o,r,a,i){const{ISOWeek:s,broadcastCalendar:l}=a,{addDays:c,addMonths:d,addWeeks:u,addYears:p,endOfBroadcastWeek:f,endOfISOWeek:m,endOfWeek:h,max:v,min:g,startOfBroadcastWeek:x,startOfISOWeek:y,startOfWeek:b}=i;let w={day:c,week:u,month:d,year:p,startOfWeek:e=>l?x(e,i):s?y(e):b(e),endOfWeek:e=>l?f(e):s?m(e):h(e)}[e](n,"after"===t?1:-1);return"before"===t&&o?w=v([o,w]):"after"===t&&r&&(w=g([r,w])),w}(e,t,n.date,o,r,a,i),c=Boolean(a.disabled&&og(l,a.disabled,i)),d=Boolean(a.hidden&&og(l,a.hidden,i)),u=new Wv(l,l,i);return c||d?Lg(e,t,u,o,r,a,i,s+1):u}function Wg(t,n,o,r,a){const{autoFocus:i}=t,[s,l]=e.useState(),c=function(e,t,n,o){let r,a=-1;for(const i of e){const e=t(i);zg(e)&&(e[qv.focused]&&a<Fg.FocusedModifier?(r=i,a=Fg.FocusedModifier):o?.isEqualTo(i)&&a<Fg.LastFocused?(r=i,a=Fg.LastFocused):n(i.date)&&a<Fg.Selected?(r=i,a=Fg.Selected):e[qv.today]&&a<Fg.Today&&(r=i,a=Fg.Today))}return r||(r=e.find(e=>zg(t(e)))),r}(n.days,o,r||(()=>!1),s),[d,u]=e.useState(i?c:void 0);return{isFocusTarget:e=>Boolean(c?.isEqualTo(e)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(e,o)=>{if(!d)return;const r=Lg(e,o,d,n.navStart,n.navEnd,t,a);if(r){if(t.disableNavigation){if(!n.days.some(e=>e.isEqualTo(r)))return}n.goToDay(r),u(r)}}}}function Bg(e,t,n=Lv){return Zv(e,t.from,!1,n)||Zv(e,t.to,!1,n)||Zv(t,e.from,!1,n)||Zv(t,e.to,!1,n)}function $g(e,t,n=Lv){const o=Array.isArray(t)?t:[t];if(o.filter(e=>"function"!=typeof e).some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return Zv(e,t,!1,n);if(ng(t,n))return t.some(t=>Zv(e,t,!1,n));if(Qv(t))return!(!t.from||!t.to)&&Bg(e,{from:t.from,to:t.to},n);if(tg(t))return function(e,t,n=Lv){const o=Array.isArray(t)?t:[t];let r=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let e=0;e<=i;e++){if(o.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}(e,t.dayOfWeek,n);if(Xv(t)){return n.isAfter(t.before,t.after)?Bg(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):og(e.from,t,n)||og(e.to,t,n)}return!(!Jv(t)&&!eg(t))&&(og(e.from,t,n)||og(e.to,t,n))}))return!0;const r=o.filter(e=>"function"==typeof e);if(r.length){let t=e.from;const o=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=o;e++){if(r.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function Yg(e,t){const{disabled:n,excludeDisabled:o,selected:r,required:a,onSelect:i}=e,[s,l]=Ag(r,i?r:void 0),c=i?r:s;return{selected:c,select:(r,s,d)=>{const{min:u,max:p}=e,f=r?function(e,t,n=0,o=0,r=!1,a=Lv){const{from:i,to:s}=t||{},{isSameDay:l,isAfter:c,isBefore:d}=a;let u;if(i||s){if(i&&!s)u=l(i,e)?0===n?{from:i,to:e}:r?{from:i,to:void 0}:void 0:d(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&s)if(l(i,e)&&l(s,e))u=r?{from:i,to:s}:void 0;else if(l(i,e))u={from:i,to:n>0?void 0:e};else if(l(s,e))u={from:e,to:n>0?void 0:e};else if(d(e,i))u={from:e,to:s};else if(c(e,i))u={from:i,to:e};else{if(!c(e,s))throw new Error("Invalid range");u={from:i,to:e}}}else u={from:e,to:n>0?void 0:e};if(u?.from&&u?.to){const t=a.differenceInCalendarDays(u.to,u.from);(o>0&&t>o||n>1&&t<n)&&(u={from:e,to:void 0})}return u}(r,c,u,p,a,t):void 0;return o&&n&&f?.from&&f.to&&$g({from:f.from,to:f.to},n,t)&&(f.from=r,f.to=void 0),i||l(f),i?.(f,r,s,d),f},isSelected:e=>c&&Zv(c,e,!1,t)}}function qg(e,t){const n=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=Ag(n,r?n:void 0),s=r?n:a,{isSameDay:l}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!o&&s&&s&&l(e,s)&&(a=void 0),r||i(a),r?.(a,e,t,n),a},isSelected:e=>!!s&&l(s,e)}}(e,t),o=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=Ag(n,r?n:void 0),s=r?n:a,{isSameDay:l}=t,c=e=>s?.some(t=>l(t,e))??!1,{min:d,max:u}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(c(e)){if(s?.length===d)return;if(o&&1===s?.length)return;a=s?.filter(t=>!l(t,e))}else a=s?.length===u?[e]:[...a,e];return r||i(a),r?.(a,e,t,n),a},isSelected:c}}(e,t),r=Yg(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return r;default:return}}function Hg(e,t){return e instanceof Av&&e.timeZone===t?e:new Av(e,t)}function Vg(e,t,n){return Hg(e,t)}function Kg(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?Vg(e,t):Array.isArray(e)?e.map(e=>e instanceof Date?Vg(e,t):e):Qv(e)?{...e,from:e.from?Hg(e.from,t):e.from,to:e.to?Hg(e.to,t):e.to}:Xv(e)?{before:Vg(e.before,t),after:Vg(e.after,t)}:Jv(e)?{after:Vg(e.after,t)}:eg(e)?{before:Vg(e.before,t)}:e}function Ug(e,t,n){return e?Array.isArray(e)?e.map(e=>Kg(e,t)):Kg(e,t):e}function Gg(t){let n=t;const o=n.timeZone;if(o&&(n={...t,timeZone:o},n.today&&(n.today=Hg(n.today,o)),n.month&&(n.month=Hg(n.month,o)),n.defaultMonth&&(n.defaultMonth=Hg(n.defaultMonth,o)),n.startMonth&&(n.startMonth=Hg(n.startMonth,o)),n.endMonth&&(n.endMonth=Hg(n.endMonth,o)),"single"===n.mode&&n.selected?n.selected=Hg(n.selected,o):"multiple"===n.mode&&n.selected?n.selected=n.selected?.map(e=>Hg(e,o)):"range"===n.mode&&n.selected&&(n.selected={from:n.selected.from?Hg(n.selected.from,o):n.selected.from,to:n.selected.to?Hg(n.selected.to,o):n.selected.to}),void 0!==n.disabled&&(n.disabled=Ug(n.disabled,o)),void 0!==n.hidden&&(n.hidden=Ug(n.hidden,o)),n.modifiers)){const e={};Object.keys(n.modifiers).forEach(t=>{e[t]=Ug(n.modifiers?.[t],o)}),n.modifiers=e}const{components:r,formatters:a,labels:i,dateLib:s,locale:l,classNames:c}=e.useMemo(()=>{const e={...Fv,...n.locale},t=n.broadcastCalendar?1:n.weekStartsOn,o=n.noonSafe&&n.timeZone?function(e,t={}){const{weekStartsOn:n,locale:o}=t,r=n??o?.options?.weekStartsOn??0,a=t=>{const n="number"==typeof t||"string"==typeof t?new Date(t):t;return new Av(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},i=e=>{const t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(Av.tz(e)),newDate:(t,n,o)=>new Av(t,n,o,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{const n=a(e),o=t?.weekStartsOn??r,i=(n.getDay()-o+7)%7;return n.setDate(n.getDate()-i),n},startOfISOWeek:e=>{const t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{const t=a(e);return t.setDate(1),t},startOfYear:e=>{const t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{const n=a(e),o=(((t?.weekStartsOn??r)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+o),n},endOfISOWeek:e=>{const t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{const t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{const t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{const n=a(t.start),o=a(t.end),r=[],i=new Av(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=12*o.getFullYear()+o.getMonth();for(;12*i.getFullYear()+i.getMonth()<=s;)r.push(new Av(i,e)),i.setMonth(i.getMonth()+1,1);return r},addDays:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+7*t),n},addMonths:(e,t)=>{const n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{const n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{const n=a(t.start),o=a(t.end),r=[],i=new Av(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=o.getFullYear();)r.push(new Av(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return r},getWeek:(e,t)=>Jh(i(e),{weekStartsOn:t?.weekStartsOn??r,firstWeekContainsDate:t?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1}),getISOWeek:e=>Xh(i(e)),differenceInCalendarDays:(e,t)=>Ph(i(e),i(t)),differenceInCalendarMonths:(e,t)=>Ih(i(e),i(t))}}(n.timeZone,{weekStartsOn:t,locale:e}):void 0,r=n.dateLib&&o?{...o,...n.dateLib}:n.dateLib??o,a=new zv({locale:e,weekStartsOn:t,firstWeekContainsDate:n.firstWeekContainsDate,useAdditionalWeekYearTokens:n.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:n.useAdditionalDayOfYearTokens,timeZone:n.timeZone,numerals:n.numerals},r);return{dateLib:a,components:rg(n.components),formatters:(i=n.formatters,i?.formatMonthCaption&&!i.formatCaption&&(i.formatCaption=i.formatMonthCaption),i?.formatYearCaption&&!i.formatYearDropdown&&(i.formatYearDropdown=i.formatYearCaption),{...dg,...i}),labels:_g(n.labels,a.options),locale:e,classNames:{...ag(),...n.classNames}};var i},[n.locale,n.broadcastCalendar,n.weekStartsOn,n.firstWeekContainsDate,n.useAdditionalWeekYearTokens,n.useAdditionalDayOfYearTokens,n.timeZone,n.numerals,n.dateLib,n.noonSafe,n.components,n.formatters,n.labels,n.classNames]);n.today||(n={...n,today:s.today()});const{captionLayout:d,mode:u,navLayout:p,numberOfMonths:f=1,onDayBlur:m,onDayClick:h,onDayFocus:v,onDayKeyDown:g,onDayMouseEnter:x,onDayMouseLeave:y,onNextClick:b,onPrevClick:w,showWeekNumber:k,styles:j}=n,{formatCaption:N,formatDay:C,formatMonthDropdown:_,formatWeekNumber:D,formatWeekNumberHeader:S,formatWeekdayName:E,formatYearDropdown:M}=a,O=Ig(n,s),{days:T,months:R,navStart:P,navEnd:A,previousMonth:I,nextMonth:F,goToMonth:z}=O,L=function(e,t,n,o,r){const{disabled:a,hidden:i,modifiers:s,showOutsideDays:l,broadcastCalendar:c,today:d=r.today()}=t,{isSameDay:u,isSameMonth:p,startOfMonth:f,isBefore:m,endOfMonth:h,isAfter:v}=r,g=n&&f(n),x=o&&h(o),y={[qv.focused]:[],[qv.outside]:[],[qv.disabled]:[],[qv.hidden]:[],[qv.today]:[]},b={};for(const t of e){const{date:e,displayMonth:n}=t,o=Boolean(n&&!p(e,n)),f=Boolean(g&&m(e,g)),h=Boolean(x&&v(e,x)),w=Boolean(a&&og(e,a,r)),k=Boolean(i&&og(e,i,r))||f||h||!c&&!l&&o||c&&!1===l&&o,j=u(e,d);o&&y.outside.push(t),w&&y.disabled.push(t),k&&y.hidden.push(t),j&&y.today.push(t),s&&Object.keys(s).forEach(n=>{const o=s?.[n];o&&og(e,o,r)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{const t={[qv.focused]:!1,[qv.disabled]:!1,[qv.hidden]:!1,[qv.outside]:!1,[qv.today]:!1},n={};for(const n in y){const o=y[n];t[n]=o.some(t=>t===e)}for(const t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}(T,n,P,A,s),{isSelected:W,select:B,selected:$}=qg(n,s)??{},{blur:Y,focused:q,isFocusTarget:H,moveFocus:V,setFocused:K}=Wg(n,O,L,W??(()=>!1),s),{labelDayButton:U,labelGridcell:G,labelGrid:Z,labelMonthDropdown:X,labelNav:Q,labelPrevious:J,labelNext:ee,labelWeekday:te,labelWeekNumber:ne,labelWeekNumberHeader:oe,labelYearDropdown:re}=i,ae=e.useMemo(()=>function(e,t,n,o){const r=o??e.today(),a=n?e.startOfBroadcastWeek(r,e):t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let t=0;t<7;t++){const n=e.addDays(a,t);i.push(n)}return i}(s,n.ISOWeek,n.broadcastCalendar,n.today),[s,n.ISOWeek,n.broadcastCalendar,n.today]),ie=void 0!==u||void 0!==h,se=e.useCallback(()=>{I&&(z(I),w?.(I))},[I,z,w]),le=e.useCallback(()=>{F&&(z(F),b?.(F))},[z,F,b]),ce=e.useCallback((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),K(e),t.disabled||(B?.(e.date,t,n),h?.(e.date,t,n))},[B,h,K]),de=e.useCallback((e,t)=>n=>{K(e),v?.(e.date,t,n)},[v,K]),ue=e.useCallback((e,t)=>n=>{Y(),m?.(e.date,t,n)},[Y,m]),pe=e.useCallback((e,t)=>o=>{const r={ArrowLeft:[o.shiftKey?"month":"day","rtl"===n.dir?"after":"before"],ArrowRight:[o.shiftKey?"month":"day","rtl"===n.dir?"before":"after"],ArrowDown:[o.shiftKey?"year":"week","after"],ArrowUp:[o.shiftKey?"year":"week","before"],PageUp:[o.shiftKey?"year":"month","before"],PageDown:[o.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(r[o.key]){o.preventDefault(),o.stopPropagation();const[e,t]=r[o.key];V(e,t)}g?.(e.date,t,o)},[V,g,n.dir]),fe=e.useCallback((e,t)=>n=>{x?.(e.date,t,n)},[x]),me=e.useCallback((e,t)=>n=>{y?.(e.date,t,n)},[y]),he=e.useCallback(e=>t=>{const n=Number(t.target.value),o=s.setMonth(s.startOfMonth(e),n);z(o)},[s,z]),ve=e.useCallback(e=>t=>{const n=Number(t.target.value),o=s.setYear(s.startOfMonth(e),n);z(o)},[s,z]),{className:ge,style:xe}=e.useMemo(()=>({className:[c[Yv.Root],n.className].filter(Boolean).join(" "),style:{...j?.[Yv.Root],...n.style}}),[c,n.className,n.style,j]),ye=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith("data-")&&(t[e]=n)}),t}(n),be=e.useRef(null);Rg(be,Boolean(n.animate),{classNames:c,months:R,focused:q,dateLib:s});const we={dayPickerProps:n,selected:$,select:B,isSelected:W,months:R,nextMonth:F,previousMonth:I,goToMonth:z,getModifiers:L,components:r,classNames:c,styles:j,labels:i,formatters:a};return e.createElement(Kv.Provider,{value:we},e.createElement(r.Root,{rootRef:n.animate?be:void 0,className:ge,style:xe,dir:n.dir,id:n.id,lang:n.lang,nonce:n.nonce,title:n.title,role:n.role,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],...ye},e.createElement(r.Months,{className:c[Yv.Months],style:j?.[Yv.Months]},!n.hideNavigation&&!p&&e.createElement(r.Nav,{"data-animated-nav":n.animate?"true":void 0,className:c[Yv.Nav],style:j?.[Yv.Nav],"aria-label":Q(),onPreviousClick:se,onNextClick:le,previousMonth:I,nextMonth:F}),R.map((t,o)=>e.createElement(r.Month,{"data-animated-month":n.animate?"true":void 0,className:c[Yv.Month],style:j?.[Yv.Month],key:o,displayIndex:o,calendarMonth:t},"around"===p&&!n.hideNavigation&&0===o&&e.createElement(r.PreviousMonthButton,{type:"button",className:c[Yv.PreviousMonthButton],tabIndex:I?void 0:-1,"aria-disabled":!I||void 0,"aria-label":J(I),onClick:se,"data-animated-button":n.animate?"true":void 0},e.createElement(r.Chevron,{disabled:!I||void 0,className:c[Yv.Chevron],orientation:"rtl"===n.dir?"right":"left"})),e.createElement(r.MonthCaption,{"data-animated-caption":n.animate?"true":void 0,className:c[Yv.MonthCaption],style:j?.[Yv.MonthCaption],calendarMonth:t,displayIndex:o},d?.startsWith("dropdown")?e.createElement(r.DropdownNav,{className:c[Yv.Dropdowns],style:j?.[Yv.Dropdowns]},(()=>{const o="dropdown"===d||"dropdown-months"===d?e.createElement(r.MonthsDropdown,{key:"month",className:c[Yv.MonthsDropdown],"aria-label":X(),classNames:c,components:r,disabled:Boolean(n.disableNavigation),onChange:he(t.date),options:Dg(t.date,P,A,a,s),style:j?.[Yv.Dropdown],value:s.getMonth(t.date)}):e.createElement("span",{key:"month"},_(t.date,s)),i="dropdown"===d||"dropdown-years"===d?e.createElement(r.YearsDropdown,{key:"year",className:c[Yv.YearsDropdown],"aria-label":re(s.options),classNames:c,components:r,disabled:Boolean(n.disableNavigation),onChange:ve(t.date),options:Sg(P,A,a,s,Boolean(n.reverseYears)),style:j?.[Yv.Dropdown],value:s.getYear(t.date)}):e.createElement("span",{key:"year"},M(t.date,s));return"year-first"===s.getMonthYearOrder()?[i,o]:[o,i]})(),e.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},N(t.date,s.options,s))):e.createElement(r.CaptionLabel,{className:c[Yv.CaptionLabel],role:"status","aria-live":"polite"},N(t.date,s.options,s))),"around"===p&&!n.hideNavigation&&o===f-1&&e.createElement(r.NextMonthButton,{type:"button",className:c[Yv.NextMonthButton],tabIndex:F?void 0:-1,"aria-disabled":!F||void 0,"aria-label":ee(F),onClick:le,"data-animated-button":n.animate?"true":void 0},e.createElement(r.Chevron,{disabled:!F||void 0,className:c[Yv.Chevron],orientation:"rtl"===n.dir?"left":"right"})),o===f-1&&"after"===p&&!n.hideNavigation&&e.createElement(r.Nav,{"data-animated-nav":n.animate?"true":void 0,className:c[Yv.Nav],style:j?.[Yv.Nav],"aria-label":Q(),onPreviousClick:se,onNextClick:le,previousMonth:I,nextMonth:F}),e.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===u||"range"===u,"aria-label":Z(t.date,s.options,s)||void 0,className:c[Yv.MonthGrid],style:j?.[Yv.MonthGrid]},!n.hideWeekdays&&e.createElement(r.Weekdays,{"data-animated-weekdays":n.animate?"true":void 0,className:c[Yv.Weekdays],style:j?.[Yv.Weekdays]},k&&e.createElement(r.WeekNumberHeader,{"aria-label":oe(s.options),className:c[Yv.WeekNumberHeader],style:j?.[Yv.WeekNumberHeader],scope:"col"},S()),ae.map(t=>e.createElement(r.Weekday,{"aria-label":te(t,s.options,s),className:c[Yv.Weekday],key:String(t),style:j?.[Yv.Weekday],scope:"col"},E(t,s.options,s)))),e.createElement(r.Weeks,{"data-animated-weeks":n.animate?"true":void 0,className:c[Yv.Weeks],style:j?.[Yv.Weeks]},t.weeks.map(t=>e.createElement(r.Week,{className:c[Yv.Week],key:t.weekNumber,style:j?.[Yv.Week],week:t},k&&e.createElement(r.WeekNumber,{week:t,style:j?.[Yv.WeekNumber],"aria-label":ne(t.weekNumber,{locale:l}),className:c[Yv.WeekNumber],scope:"row",role:"rowheader"},D(t.weekNumber,s)),t.days.map(t=>{const{date:o}=t,a=L(t);if(a[qv.focused]=!a.hidden&&Boolean(q?.isEqualTo(t)),a[Hv.selected]=W?.(o)||a.selected,Qv($)){const{from:e,to:t}=$;a[Hv.range_start]=Boolean(e&&t&&s.isSameDay(o,e)),a[Hv.range_end]=Boolean(e&&t&&s.isSameDay(o,t)),a[Hv.range_middle]=Zv($,o,!0,s)}const i=function(e,t={},n={}){let o={...t?.[Yv.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{o={...o,...n?.[e]}}),o}(a,j,n.modifiersStyles),l=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[o])=>(n[o]?e.push(n[o]):t[qv[o]]?e.push(t[qv[o]]):t[Hv[o]]&&e.push(t[Hv[o]]),e),[t[Yv.Day]])}(a,c,n.modifiersClassNames),d=ie||a.hidden?void 0:G(o,a,s.options,s);return e.createElement(r.Day,{key:`${t.isoDate}_${t.displayMonthId}`,day:t,modifiers:a,className:l.join(" "),style:i,role:"gridcell","aria-selected":a.selected||void 0,"aria-label":d,"data-day":t.isoDate,"data-month":t.outside?t.dateMonthId:void 0,"data-selected":a.selected||void 0,"data-disabled":a.disabled||void 0,"data-hidden":a.hidden||void 0,"data-outside":t.outside||void 0,"data-focused":a.focused||void 0,"data-today":a.today||void 0},!a.hidden&&ie?e.createElement(r.DayButton,{className:c[Yv.DayButton],style:j?.[Yv.DayButton],type:"button",day:t,modifiers:a,disabled:!a.focused&&a.disabled||void 0,"aria-disabled":a.focused&&a.disabled||void 0,tabIndex:H(t)?0:-1,"aria-label":U(o,a,s.options,s),onClick:ce(t,a),onBlur:ue(t,a),onFocus:de(t,a),onKeyDown:pe(t,a),onMouseEnter:fe(t,a),onMouseLeave:me(t,a)},C(o,s.options,s)):!a.hidden&&C(t.date,s.options,s))})))))))),n.footer&&e.createElement(r.Footer,{className:c[Yv.Footer],style:j?.[Yv.Footer],role:"status","aria-live":"polite"},n.footer)))}function Zg({className:e,classNames:n,showOutsideDays:o=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:s,...l}){const c=ag();return t.jsx(Gg,{showOutsideDays:o,className:Ie("bg-background group/calendar p-3 [--cell-size:2rem]",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...i},classNames:{root:Ie("w-fit",c.root),months:Ie("relative flex flex-col gap-4 md:flex-row",c.months),month:Ie("flex w-full flex-col gap-4",c.month),nav:Ie("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:Ie(Fe({variant:a}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:Ie(Fe({variant:a}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:Ie("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:Ie("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:Ie("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:Ie("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:Ie("select-none font-medium","label"===r?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:Ie("flex",c.weekdays),weekday:Ie("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:Ie("mt-2 flex w-full",c.week),week_number_header:Ie("w-[--cell-size] select-none",c.week_number_header),week_number:Ie("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:Ie("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:Ie("bg-accent rounded-l-md",c.range_start),range_middle:Ie("rounded-none",c.range_middle),range_end:Ie("bg-accent rounded-r-md",c.range_end),today:Ie("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:Ie("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:Ie("text-muted-foreground opacity-50",c.disabled),hidden:Ie("invisible",c.hidden),...n},components:{Root:({className:e,rootRef:n,...o})=>t.jsx("div",{"data-slot":"calendar",ref:n,className:Ie(e),...o}),Chevron:({className:e,orientation:n,...o})=>"left"===n?t.jsx(Yl,{className:Ie("size-4",e),...o}):"right"===n?t.jsx(ql,{className:Ie("size-4",e),...o}):t.jsx($l,{className:Ie("size-4",e),...o}),DayButton:Xg,WeekNumber:({children:e,...n})=>t.jsx("td",{...n,children:t.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:e})}),...s},...l})}function Xg({className:e,day:n,modifiers:o,...a}){const i=ag(),s=r.useRef(null);return r.useEffect(()=>{o.focused&&s.current?.focus()},[o.focused]),t.jsx(Le,{ref:s,variant:"ghost",size:"icon","data-day":n.date.toLocaleDateString(),"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:Ie("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",i.day,e),...a})}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(Fg||(Fg={}));const Qg=e=>{if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t},Jg=e=>{if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t},ex=(e,t)=>{const n=Jg(e);return n?jv(n,t):null};function tx({title:e="Nenhum resultado",description:n="Nenhum dado encontrado."}){return t.jsx(Ku,{title:e,description:n})}const nx=r.forwardRef(({className:e,wrap:n=!0,...o},r)=>{const a=t.jsx("table",{ref:r,className:Ie("w-full caption-bottom border-collapse text-sm",e),...o});return n?t.jsx("div",{className:"w-full overflow-auto",children:a}):a});nx.displayName="Table";const ox=r.forwardRef(({className:e,...n},o)=>t.jsx("thead",{ref:o,className:Ie("rounded-md bg-primary h-[36px]",e),...n}));ox.displayName="TableHeader";const rx=r.forwardRef(({className:e,...n},o)=>t.jsx("tbody",{ref:o,className:Ie(e),...n}));rx.displayName="TableBody";const ax=r.forwardRef(({className:e,...n},o)=>t.jsx("tfoot",{ref:o,className:Ie("bg-primary font-medium text-primary-foreground",e),...n}));ax.displayName="TableFooter";const ix=r.forwardRef(({className:e,...n},o)=>t.jsx("tr",{ref:o,className:Ie("text-sm text-foreground transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n}));ix.displayName="TableRow";const sx=r.forwardRef(({className:e,...n},o)=>t.jsx("th",{ref:o,className:Ie("border-b border-r border-primary-foreground/20 px-4 align-middle text-left text-[12px] font-medium text-primary-foreground last:border-r-0 [&:has([role=checkbox])]:pr-0 first:rounded-l-lg last:rounded-r-lg",e),...n}));sx.displayName="TableHead";const lx=r.forwardRef(({className:e,...n},o)=>t.jsx("td",{ref:o,className:Ie("border-b border-r border-border px-4 py-2 align-middle text-[12px] text-foreground last:border-r-0 [&:has([role=checkbox])]:pr-0",e),...n}));lx.displayName="TableCell";const cx=r.forwardRef(({className:e,...n},o)=>t.jsx("caption",{ref:o,className:Ie("mt-4 text-sm text-muted-foreground",e),...n}));function dx({className:e,...n}){return t.jsx("div",{className:Ie("animate-pulse rounded-md bg-muted",e),...n})}function ux({columns:e,rows:n=5}){const o=function(e){return"number"==typeof e?Array.from({length:e},()=>({})):e}(e),r=Array.from({length:n},(e,t)=>"row-".concat(String(t)));return t.jsx(t.Fragment,{children:r.map(e=>t.jsx(ix,{children:o.map((n,o)=>t.jsx(lx,{className:Ie(n.width,n.cellClassName,"px-2 py-2"),children:t.jsx(dx,{className:"block h-4 w-full"})},e.concat("-col-",String(o))))},e))})}cx.displayName="TableCaption";const px={Root:nx,Body:rx,Cell:lx,Head:sx,Header:ox,Row:ix};function fx({columns:e,ordering:n,onSort:o}){const r=e??[];return t.jsx(ix,{children:r.map(e=>{const r=Boolean(e.sortable),a=n===e.key,i=n==="-".concat(e.key),s=a||i;return t.jsx(sx,{className:Ie(e.width,e.className,r?"cursor-pointer":""),onClick:r&&o?()=>o(e.key):void 0,children:t.jsxs(Ge,{direction:"row",gap:1,children:[e.label,r&&s&&(a?t.jsx(zl,{size:16}):t.jsx(Fl,{size:16}))]})},e.key)})})}function mx({item:e,columns:n,onClick:o}){const r=n??[];return t.jsx(ix,{className:Ie(o?"hover:bg-secondary cursor-pointer":""),onClick:o,children:r.map(n=>{const o=e[n.key];return t.jsx(lx,{className:Ie(n.width,n.cellClassName),children:n.render?n.render(o,e):String(o??"N/D")},n.key)})})}var hx="Checkbox",[vx]=vd(hx),[gx,xx]=vx(hx);function yx(e){const{__scopeCheckbox:n,checked:o,children:a,defaultChecked:i,disabled:s,form:l,name:c,onCheckedChange:d,required:u,value:p="on",internal_do_not_use_render:f}=e,[m,h]=Rd({prop:o,defaultProp:i??!1,onChange:d,caller:hx}),[v,g]=r.useState(null),[x,y]=r.useState(null),b=r.useRef(!1),w=!v||(!!l||!!v.closest("form")),k={checked:m,disabled:s,setChecked:h,control:v,setControl:g,name:c,form:l,value:p,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:!Sx(i)&&i,isFormControl:w,bubbleInput:x,setBubbleInput:y};return t.jsx(gx,{scope:n,...k,children:Dx(f)?f(k):a})}var bx="CheckboxTrigger",wx=r.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:o,...a},i)=>{const{control:s,value:l,disabled:c,checked:d,required:u,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:v}=xx(bx,e),g=bd(i,p),x=r.useRef(d);return r.useEffect(()=>{const e=s?.form;if(e){const t=()=>f(x.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[s,f]),t.jsx(Pd.button,{type:"button",role:"checkbox","aria-checked":Sx(d)?"mixed":d,"aria-required":u,"data-state":Ex(d),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:g,onKeyDown:Md(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:Md(o,e=>{f(e=>!!Sx(e)||!e),v&&h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})});wx.displayName=bx;var kx=r.forwardRef((e,n)=>{const{__scopeCheckbox:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=e;return t.jsx(yx,{__scopeCheckbox:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>t.jsxs(t.Fragment,{children:[t.jsx(wx,{...p,ref:n,__scopeCheckbox:o}),e&&t.jsx(_x,{__scopeCheckbox:o})]})})});kx.displayName=hx;var jx="CheckboxIndicator",Nx=r.forwardRef((e,n)=>{const{__scopeCheckbox:o,forceMount:r,...a}=e,i=xx(jx,o);return t.jsx(Id,{present:r||Sx(i.checked)||!0===i.checked,children:t.jsx(Pd.span,{"data-state":Ex(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...e.style}})})});Nx.displayName=jx;var Cx="CheckboxBubbleInput",_x=r.forwardRef(({__scopeCheckbox:e,...n},o)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:l,required:c,disabled:d,name:u,value:p,form:f,bubbleInput:m,setBubbleInput:h}=xx(Cx,e),v=bd(o,h),g=Gf(s),x=Cf(a);r.useEffect(()=>{const e=m;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!i.current;if(g!==s&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Sx(s),n.call(e,!Sx(s)&&s),e.dispatchEvent(t)}},[m,g,s,i]);const y=r.useRef(!Sx(s)&&s);return t.jsx(Pd.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??y.current,required:c,disabled:d,name:u,value:p,form:f,...n,tabIndex:-1,ref:v,style:{...n.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function Dx(e){return"function"==typeof e}function Sx(e){return"indeterminate"===e}function Ex(e){return Sx(e)?"indeterminate":e?"checked":"unchecked"}_x.displayName=Cx;const Mx=r.forwardRef(({className:e,...n},o)=>t.jsx(kx,{ref:o,className:Ie("bg-white peer w-[18px] h-[18px] shrink-0 rounded-md border-gray-300 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:input-data-checked data-[state=checked]:border-none data-[state=checked]:text-primary-foreground",e),...n,children:t.jsx(Nx,{className:Ie("flex items-center justify-center text-current"),children:t.jsx(Bl,{className:"h-4 w-4"})})}));Mx.displayName=kx.displayName;var Ox=r.forwardRef((e,n)=>t.jsx(Pd.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Ox.displayName="Label";var Tx=Ox;const Rx=w("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Px=r.forwardRef(({className:e,...n},o)=>t.jsx(Tx,{ref:o,className:Ie(Rx(),e),...n}));Px.displayName=Tx.displayName;var[Ax]=vd("Tooltip",[Sf]),Ix=Sf(),Fx="TooltipProvider",zx=700,Lx="tooltip.open",[Wx,Bx]=Ax(Fx),$x=e=>{const{__scopeTooltip:n,delayDuration:o=zx,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:s}=e,l=r.useRef(!0),c=r.useRef(!1),d=r.useRef(0);return r.useEffect(()=>{const e=d.current;return()=>window.clearTimeout(e)},[]),t.jsx(Wx,{scope:n,isOpenDelayedRef:l,delayDuration:o,onOpen:r.useCallback(()=>{a<=0||(window.clearTimeout(d.current),l.current=!1)},[a]),onClose:r.useCallback(()=>{a<=0||(window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,a))},[a]),isPointerInTransitRef:c,onPointerInTransitChange:r.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:s})};$x.displayName=Fx;var Yx="Tooltip",[qx,Hx]=Ax(Yx),Vx=e=>{const{__scopeTooltip:n,children:o,open:a,defaultOpen:i,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,d=Bx(Yx,e.__scopeTooltip),u=Ix(n),[p,f]=r.useState(null),m=Bd(),h=r.useRef(0),v=l??d.disableHoverableContent,g=c??d.delayDuration,x=r.useRef(!1),[y,b]=Rd({prop:a,defaultProp:i??!1,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(Lx))):d.onClose(),s?.(e)},caller:Yx}),w=r.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),k=r.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x.current=!1,b(!0)},[b]),j=r.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),N=r.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{x.current=!0,b(!0),h.current=0},g)},[g,b]);return r.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),t.jsx(qf,{...u,children:t.jsx(qx,{scope:n,contentId:m,open:y,stateAttribute:w,trigger:p,onTriggerChange:f,onTriggerEnter:r.useCallback(()=>{d.isOpenDelayedRef.current?N():k()},[d.isOpenDelayedRef,N,k]),onTriggerLeave:r.useCallback(()=>{v?j():(window.clearTimeout(h.current),h.current=0)},[j,v]),onOpen:k,onClose:j,disableHoverableContent:v,children:o})})};Vx.displayName=Yx;var Kx="TooltipTrigger",Ux=r.forwardRef((e,n)=>{const{__scopeTooltip:o,...a}=e,i=Hx(Kx,o),s=Bx(Kx,o),l=Ix(o),c=bd(n,r.useRef(null),i.onTriggerChange),d=r.useRef(!1),u=r.useRef(!1),p=r.useCallback(()=>d.current=!1,[]);return r.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(Hf,{asChild:!0,...l,children:t.jsx(Pd.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:c,onPointerMove:Md(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||s.isPointerInTransitRef.current||(i.onTriggerEnter(),u.current=!0))}),onPointerLeave:Md(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Md(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Md(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:Md(e.onBlur,i.onClose),onClick:Md(e.onClick,i.onClose)})})});Ux.displayName=Kx;var[Gx,Zx]=Ax("TooltipPortal",{forceMount:void 0}),Xx="TooltipContent",Qx=r.forwardRef((e,n)=>{const o=Zx(Xx,e.__scopeTooltip),{forceMount:r=o.forceMount,side:a="top",...i}=e,s=Hx(Xx,e.__scopeTooltip);return t.jsx(Id,{present:r||s.open,children:s.disableHoverableContent?t.jsx(oy,{side:a,...i,ref:n}):t.jsx(Jx,{side:a,...i,ref:n})})}),Jx=r.forwardRef((e,n)=>{const o=Hx(Xx,e.__scopeTooltip),a=Bx(Xx,e.__scopeTooltip),i=r.useRef(null),s=bd(n,i),[l,c]=r.useState(null),{trigger:d,onClose:u}=o,p=i.current,{onPointerInTransitChange:f}=a,m=r.useCallback(()=>{c(null),f(!1)},[f]),h=r.useCallback((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,o,r,a)){case a:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),a=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);c(a),f(!0)},[f]);return r.useEffect(()=>()=>m(),[m]),r.useEffect(()=>{if(d&&p){const e=e=>h(e,p),t=e=>h(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,h,m]),r.useEffect(()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=d?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>o!=u>o&&n<(d-l)*(o-c)/(u-c)+l&&(r=!r)}return r}(n,l);o?m():r&&(m(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,l,u,m]),t.jsx(oy,{...e,ref:s})}),[ey,ty]=Ax(Yx,{isInside:!1}),ny=function(e){const t=e=>"child"in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=kd,t}("TooltipContent"),oy=r.forwardRef((e,n)=>{const{__scopeTooltip:o,children:a,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=e,d=Hx(Xx,o),u=Ix(o),{onClose:p}=d;return r.useEffect(()=>(document.addEventListener(Lx,p),()=>document.removeEventListener(Lx,p)),[p]),r.useEffect(()=>{if(d.trigger){const e=e=>{e.target instanceof Node&&e.target.contains(d.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[d.trigger,p]),t.jsx(af,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(Vf,{"data-state":d.stateAttribute,...u,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(ny,{children:a}),t.jsx(ey,{scope:o,isInside:!0,children:t.jsx(Qf,{id:d.contentId,role:"tooltip",children:i||a})})]})})});Qx.displayName=Xx;var ry="TooltipArrow";r.forwardRef((e,n)=>{const{__scopeTooltip:o,...r}=e,a=Ix(o);return ty(ry,o).isInside?null:t.jsx(Kf,{...a,...r,ref:n})}).displayName=ry;var ay=Qx;const iy=$x,sy=Vx,ly=Ux,cy=r.forwardRef(({className:e,sideOffset:n=4,...o},r)=>t.jsx(ay,{ref:r,sideOffset:n,className:Ie("border border-body rounded-md z-50 overflow-hidden bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));cy.displayName=ay.displayName;const dy=w("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),uy=r.forwardRef(({className:e,variant:n,...o},r)=>t.jsx("div",{ref:r,role:"alert",className:Ie(dy({variant:n}),e),...o}));uy.displayName="Alert";const py=r.forwardRef(({className:e,...n},o)=>t.jsx("h5",{ref:o,className:Ie("mb-1 font-medium leading-none tracking-tight",e),...n}));py.displayName="AlertTitle";const fy=r.forwardRef(({className:e,...n},o)=>t.jsx("div",{ref:o,className:Ie("text-sm [&_p]:leading-relaxed",e),...n}));fy.displayName="AlertDescription";var my="rovingFocusGroup.onEntryFocus",hy={bubbles:!1,cancelable:!0},vy="RovingFocusGroup",[gy,xy,yy]=Ed(vy),[by,wy]=vd(vy,[yy]),[ky,jy]=by(vy),Ny=r.forwardRef((e,n)=>t.jsx(gy.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(gy.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Cy,{...e,ref:n})})}));Ny.displayName=vy;var Cy=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...f}=e,m=r.useRef(null),h=bd(n,m),v=ru(s),[g,x]=Rd({prop:l,defaultProp:c??null,onChange:d,caller:vy}),[y,b]=r.useState(!1),w=Jp(u),k=xy(o),j=r.useRef(!1),[N,C]=r.useState(0);return r.useEffect(()=>{const e=m.current;if(e)return e.addEventListener(my,w),()=>e.removeEventListener(my,w)},[w]),t.jsx(ky,{scope:o,orientation:a,dir:v,loop:i,currentTabStopId:g,onItemFocus:r.useCallback(e=>x(e),[x]),onItemShiftTab:r.useCallback(()=>b(!0),[]),onFocusableItemAdd:r.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>C(e=>e-1),[]),children:t.jsx(Pd.div,{tabIndex:y||0===N?-1:0,"data-orientation":a,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:Md(e.onMouseDown,()=>{j.current=!0}),onFocus:Md(e.onFocus,e=>{const t=!j.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(my,hy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Ey([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),p)}}j.current=!1}),onBlur:Md(e.onBlur,()=>b(!1))})})}),_y="RovingFocusGroupItem",Dy=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=Bd(),u=s||d,p=jy(_y,o),f=p.currentTabStopId===u,m=xy(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=p;return r.useEffect(()=>{if(a)return h(),()=>v()},[a,h,v]),t.jsx(gy.ItemSlot,{scope:o,id:u,focusable:a,active:i,children:t.jsx(Pd.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:Md(e.onMouseDown,e=>{a?p.onItemFocus(u):e.preventDefault()}),onFocus:Md(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:Md(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:Sy[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const a=r.indexOf(e.currentTarget);r=p.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>Ey(r))}var n,o}),children:"function"==typeof l?l({isCurrentTabStop:f,hasTabStop:null!=g}):l})})});Dy.displayName=_y;var Sy={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ey(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var My=Ny,Oy=Dy,Ty=["Enter"," "],Ry=["ArrowUp","PageDown","End"],Py=["ArrowDown","PageUp","Home",...Ry],Ay={ltr:[...Ty,"ArrowRight"],rtl:[...Ty,"ArrowLeft"]},Iy={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fy="Menu",[zy,Ly,Wy]=Ed(Fy),[By,$y]=vd(Fy,[Wy,Sf,wy]),Yy=Sf(),qy=wy(),[Hy,Vy]=By(Fy),[Ky,Uy]=By(Fy),Gy=e=>{const{__scopeMenu:n,open:o=!1,children:a,dir:i,onOpenChange:s,modal:l=!0}=e,c=Yy(n),[d,u]=r.useState(null),p=r.useRef(!1),f=Jp(s),m=ru(i);return r.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),r.useEffect(()=>{if(!o)return;const e=()=>f(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[o,f]),t.jsx(qf,{...c,children:t.jsx(Hy,{scope:n,open:o,onOpenChange:f,content:d,onContentChange:u,children:t.jsx(Ky,{scope:n,onClose:r.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:m,modal:l,children:a})})})};Gy.displayName=Fy;var Zy=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e,a=Yy(o);return t.jsx(Hf,{...a,...r,ref:n})});Zy.displayName="MenuAnchor";var Xy="MenuPortal",[Qy,Jy]=By(Xy,{forceMount:void 0}),eb=e=>{const{__scopeMenu:n,forceMount:o,children:r,container:a}=e,i=Vy(Xy,n);return t.jsx(Qy,{scope:n,forceMount:o,children:t.jsx(Id,{present:o||i.open,children:t.jsx(Uf,{asChild:!0,container:a,children:r})})})};eb.displayName=Xy;var tb="MenuContent",[nb,ob]=By(tb),rb=r.forwardRef((e,n)=>{const o=Jy(tb,e.__scopeMenu),{forceMount:r=o.forceMount,...a}=e,i=Vy(tb,e.__scopeMenu),s=Uy(tb,e.__scopeMenu);return t.jsx(zy.Provider,{scope:e.__scopeMenu,children:t.jsx(Id,{present:r||i.open,children:t.jsx(zy.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(ab,{...a,ref:n}):t.jsx(ib,{...a,ref:n})})})})}),ab=r.forwardRef((e,n)=>{const o=Vy(tb,e.__scopeMenu),a=r.useRef(null),i=bd(n,a);return r.useEffect(()=>{const e=a.current;if(e)return sr(e)},[]),t.jsx(lb,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Md(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),ib=r.forwardRef((e,n)=>{const o=Vy(tb,e.__scopeMenu);return t.jsx(lb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),sb=wd("MenuContent.ScrollLock"),lb=r.forwardRef((e,n)=>{const{__scopeMenu:o,loop:a=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:h,disableOutsideScroll:v,...g}=e,x=Vy(tb,o),y=Uy(tb,o),b=Yy(o),w=qy(o),k=Ly(o),[j,N]=r.useState(null),C=r.useRef(null),_=bd(n,C,x.onContentChange),D=r.useRef(0),S=r.useRef(""),E=r.useRef(0),M=r.useRef(null),O=r.useRef("right"),T=r.useRef(0),R=v?er:r.Fragment,P=v?{as:sb,allowPinchZoom:!0}:void 0,A=e=>{const t=S.current+e,n=k().filter(e=>!e.disabled),o=document.activeElement,r=n.find(e=>e.ref.current===o)?.textValue,a=function(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,a=n?e.indexOf(n):-1;let i=(s=e,l=Math.max(a,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===r.length&&(i=i.filter(e=>e!==n));const c=i.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}(n.map(e=>e.textValue),t,r),i=n.find(e=>e.textValue===a)?.ref.current;!function e(t){S.current=t,window.clearTimeout(D.current),""!==t&&(D.current=window.setTimeout(()=>e(""),1e3))}(t),i&&setTimeout(()=>i.focus())};r.useEffect(()=>()=>window.clearTimeout(D.current),[]),uf();const I=r.useCallback(e=>O.current===M.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>o!=u>o&&n<(d-l)*(o-c)/(u-c)+l&&(r=!r)}return r}(n,t)}(e,M.current?.area),[]);return t.jsx(nb,{scope:o,searchRef:S,onItemEnter:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:r.useCallback(e=>{I(e)||(C.current?.focus(),N(null))},[I]),onTriggerLeave:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:E,onPointerGraceIntentChange:r.useCallback(e=>{M.current=e},[]),children:t.jsx(R,{...P,children:t.jsx(vf,{asChild:!0,trapped:i,onMountAutoFocus:Md(s,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(af,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:h,children:t.jsx(My,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:a,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:Md(d,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Vf,{role:"menu","aria-orientation":"vertical","data-state":Ib(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:Md(g.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,o=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&o&&A(e.key));const r=C.current;if(e.target!==r)return;if(!Py.includes(e.key))return;e.preventDefault();const a=k().filter(e=>!e.disabled).map(e=>e.ref.current);Ry.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(a)}),onBlur:Md(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),S.current="")}),onPointerMove:Md(e.onPointerMove,Lb(e=>{const t=e.target,n=T.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>T.current?"right":"left";O.current=t,T.current=e.clientX}}))})})})})})})});rb.displayName=tb;var cb=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Pd.div,{role:"group",...r,ref:n})});cb.displayName="MenuGroup";var db=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Pd.div,{...r,ref:n})});db.displayName="MenuLabel";var ub="MenuItem",pb="menu.itemSelect",fb=r.forwardRef((e,n)=>{const{disabled:o=!1,onSelect:a,...i}=e,s=r.useRef(null),l=Uy(ub,e.__scopeMenu),c=ob(ub,e.__scopeMenu),d=bd(n,s),u=r.useRef(!1);return t.jsx(mb,{...i,ref:d,disabled:o,onClick:Md(e.onClick,()=>{const e=s.current;if(!o&&e){const t=new CustomEvent(pb,{bubbles:!0,cancelable:!0});e.addEventListener(pb,e=>a?.(e),{once:!0}),Ad(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:Md(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:Md(e.onKeyDown,e=>{const t=""!==c.searchRef.current;o||t&&" "===e.key||Ty.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});fb.displayName=ub;var mb=r.forwardRef((e,n)=>{const{__scopeMenu:o,disabled:a=!1,textValue:i,...s}=e,l=ob(ub,o),c=qy(o),d=r.useRef(null),u=bd(n,d),[p,f]=r.useState(!1),[m,h]=r.useState("");return r.useEffect(()=>{const e=d.current;e&&h((e.textContent??"").trim())},[s.children]),t.jsx(zy.ItemSlot,{scope:o,disabled:a,textValue:i??m,children:t.jsx(Oy,{asChild:!0,...c,focusable:!a,children:t.jsx(Pd.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:u,onPointerMove:Md(e.onPointerMove,Lb(e=>{if(a)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:Md(e.onPointerLeave,Lb(e=>l.onItemLeave(e))),onFocus:Md(e.onFocus,()=>f(!0)),onBlur:Md(e.onBlur,()=>f(!1))})})})}),hb=r.forwardRef((e,n)=>{const{checked:o=!1,onCheckedChange:r,...a}=e;return t.jsx(jb,{scope:e.__scopeMenu,checked:o,children:t.jsx(fb,{role:"menuitemcheckbox","aria-checked":Fb(o)?"mixed":o,...a,ref:n,"data-state":zb(o),onSelect:Md(a.onSelect,()=>r?.(!!Fb(o)||!o),{checkForDefaultPrevented:!1})})})});hb.displayName="MenuCheckboxItem";var vb="MenuRadioGroup",[gb,xb]=By(vb,{value:void 0,onValueChange:()=>{}}),yb=r.forwardRef((e,n)=>{const{value:o,onValueChange:r,...a}=e,i=Jp(r);return t.jsx(gb,{scope:e.__scopeMenu,value:o,onValueChange:i,children:t.jsx(cb,{...a,ref:n})})});yb.displayName=vb;var bb="MenuRadioItem",wb=r.forwardRef((e,n)=>{const{value:o,...r}=e,a=xb(bb,e.__scopeMenu),i=o===a.value;return t.jsx(jb,{scope:e.__scopeMenu,checked:i,children:t.jsx(fb,{role:"menuitemradio","aria-checked":i,...r,ref:n,"data-state":zb(i),onSelect:Md(r.onSelect,()=>a.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});wb.displayName=bb;var kb="MenuItemIndicator",[jb,Nb]=By(kb,{checked:!1}),Cb=r.forwardRef((e,n)=>{const{__scopeMenu:o,forceMount:r,...a}=e,i=Nb(kb,o);return t.jsx(Id,{present:r||Fb(i.checked)||!0===i.checked,children:t.jsx(Pd.span,{...a,ref:n,"data-state":zb(i.checked)})})});Cb.displayName=kb;var _b=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Pd.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});_b.displayName="MenuSeparator";var Db=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e,a=Yy(o);return t.jsx(Kf,{...a,...r,ref:n})});Db.displayName="MenuArrow";var Sb="MenuSub",[Eb,Mb]=By(Sb),Ob=e=>{const{__scopeMenu:n,children:o,open:a=!1,onOpenChange:i}=e,s=Vy(Sb,n),l=Yy(n),[c,d]=r.useState(null),[u,p]=r.useState(null),f=Jp(i);return r.useEffect(()=>(!1===s.open&&f(!1),()=>f(!1)),[s.open,f]),t.jsx(qf,{...l,children:t.jsx(Hy,{scope:n,open:a,onOpenChange:f,content:u,onContentChange:p,children:t.jsx(Eb,{scope:n,contentId:Bd(),triggerId:Bd(),trigger:c,onTriggerChange:d,children:o})})})};Ob.displayName=Sb;var Tb="MenuSubTrigger",Rb=r.forwardRef((e,n)=>{const o=Vy(Tb,e.__scopeMenu),a=Uy(Tb,e.__scopeMenu),i=Mb(Tb,e.__scopeMenu),s=ob(Tb,e.__scopeMenu),l=r.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:e.__scopeMenu},p=r.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return r.useEffect(()=>p,[p]),r.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),t.jsx(Zy,{asChild:!0,...u,children:t.jsx(mb,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?i.contentId:void 0,"data-state":Ib(o.open),...e,ref:yd(n,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:Md(e.onPointerMove,Lb(t=>{s.onItemEnter(t),t.defaultPrevented||e.disabled||o.open||l.current||(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{o.onOpenChange(!0),p()},100))})),onPointerLeave:Md(e.onPointerLeave,Lb(e=>{p();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,a=r?-5:5,i=t[r?"left":"right"],l=t[r?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:i,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Md(e.onKeyDown,t=>{const n=""!==s.searchRef.current;e.disabled||n&&" "===t.key||Ay[a.dir].includes(t.key)&&(o.onOpenChange(!0),o.content?.focus(),t.preventDefault())})})})});Rb.displayName=Tb;var Pb="MenuSubContent",Ab=r.forwardRef((e,n)=>{const o=Jy(tb,e.__scopeMenu),{forceMount:a=o.forceMount,align:i="start",...s}=e,l=Vy(tb,e.__scopeMenu),c=Uy(tb,e.__scopeMenu),d=Mb(Pb,e.__scopeMenu),u=r.useRef(null),p=bd(n,u);return t.jsx(zy.Provider,{scope:e.__scopeMenu,children:t.jsx(Id,{present:a||l.open,children:t.jsx(zy.Slot,{scope:e.__scopeMenu,children:t.jsx(lb,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:p,align:i,side:"rtl"===c.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Md(e.onFocusOutside,e=>{e.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Md(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:Md(e.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=Iy[c.dir].includes(e.key);t&&n&&(l.onOpenChange(!1),d.trigger?.focus(),e.preventDefault())})})})})})});function Ib(e){return e?"open":"closed"}function Fb(e){return"indeterminate"===e}function zb(e){return Fb(e)?"indeterminate":e?"checked":"unchecked"}function Lb(e){return t=>"mouse"===t.pointerType?e(t):void 0}Ab.displayName=Pb;var Wb=Gy,Bb=Zy,$b=eb,Yb=rb,qb=cb,Hb=db,Vb=fb,Kb=hb,Ub=yb,Gb=wb,Zb=Cb,Xb=_b,Qb=Db,Jb=Ob,ew=Rb,tw=Ab,nw="DropdownMenu",[ow]=vd(nw,[$y]),rw=$y(),[aw,iw]=ow(nw),sw=e=>{const{__scopeDropdownMenu:n,children:o,dir:a,open:i,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=rw(n),u=r.useRef(null),[p,f]=Rd({prop:i,defaultProp:s??!1,onChange:l,caller:nw});return t.jsx(aw,{scope:n,triggerId:Bd(),triggerRef:u,contentId:Bd(),open:p,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:c,children:t.jsx(Wb,{...d,open:p,onOpenChange:f,dir:a,modal:c,children:o})})};sw.displayName=nw;var lw="DropdownMenuTrigger",cw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,disabled:r=!1,...a}=e,i=iw(lw,o),s=rw(o);return t.jsx(Bb,{asChild:!0,...s,children:t.jsx(Pd.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:yd(n,i.triggerRef),onPointerDown:Md(e.onPointerDown,e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:Md(e.onKeyDown,e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});cw.displayName=lw;var dw=e=>{const{__scopeDropdownMenu:n,...o}=e,r=rw(n);return t.jsx($b,{...r,...o})};dw.displayName="DropdownMenuPortal";var uw="DropdownMenuContent",pw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...a}=e,i=iw(uw,o),s=rw(o),l=r.useRef(!1);return t.jsx(Yb,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...a,ref:n,onCloseAutoFocus:Md(e.onCloseAutoFocus,e=>{l.current||i.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:Md(e.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;i.modal&&!o||(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pw.displayName=uw;var fw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(qb,{...a,...r,ref:n})});fw.displayName="DropdownMenuGroup";var mw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Hb,{...a,...r,ref:n})});mw.displayName="DropdownMenuLabel";var hw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Vb,{...a,...r,ref:n})});hw.displayName="DropdownMenuItem";var vw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Kb,{...a,...r,ref:n})});vw.displayName="DropdownMenuCheckboxItem";var gw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Ub,{...a,...r,ref:n})});gw.displayName="DropdownMenuRadioGroup";var xw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Gb,{...a,...r,ref:n})});xw.displayName="DropdownMenuRadioItem";var yw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Zb,{...a,...r,ref:n})});yw.displayName="DropdownMenuItemIndicator";var bw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Xb,{...a,...r,ref:n})});bw.displayName="DropdownMenuSeparator";r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Qb,{...a,...r,ref:n})}).displayName="DropdownMenuArrow";var ww=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(ew,{...a,...r,ref:n})});ww.displayName="DropdownMenuSubTrigger";var kw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(tw,{...a,...r,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kw.displayName="DropdownMenuSubContent";var jw=dw,Nw=pw,Cw=mw,_w=hw,Dw=vw,Sw=xw,Ew=yw,Mw=bw,Ow=ww,Tw=kw;const Rw=sw,Pw=cw,Aw=fw,Iw=jw,Fw=e=>{const{__scopeDropdownMenu:n,children:o,open:r,onOpenChange:a,defaultOpen:i}=e,s=rw(n),[l,c]=Rd({prop:r,defaultProp:i??!1,onChange:a,caller:"DropdownMenuSub"});return t.jsx(Jb,{...s,open:l,onOpenChange:c,children:o})},zw=gw,Lw=r.forwardRef(({className:e,inset:n,children:o,...r},a)=>t.jsxs(Ow,{ref:a,className:Ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",e),...r,children:[o,t.jsx(ql,{className:"ml-auto h-4 w-4"})]}));Lw.displayName=Ow.displayName;const Ww=r.forwardRef(({className:e,...n},o)=>t.jsx(Tw,{ref:o,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Ww.displayName=Tw.displayName;const Bw=r.forwardRef(({className:e,sideOffset:n=4,...o},r)=>t.jsx(jw,{children:t.jsx(Nw,{ref:r,sideOffset:n,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Bw.displayName=Nw.displayName;const $w=r.forwardRef(({className:e,inset:n,...o},r)=>t.jsx(_w,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",e),...o}));$w.displayName=_w.displayName;const Yw=r.forwardRef(({className:e,children:n,checked:o,...r},a)=>t.jsxs(Dw,{ref:a,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ew,{children:t.jsx(Bl,{className:"h-4 w-4"})})}),n]}));Yw.displayName=Dw.displayName;const qw=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(Sw,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ew,{children:t.jsx(Kl,{className:"h-2 w-2 fill-current"})})}),n]}));qw.displayName=Sw.displayName;const Hw=r.forwardRef(({className:e,inset:n,...o},r)=>t.jsx(Cw,{ref:r,className:Ie("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...o}));Hw.displayName=Cw.displayName;const Vw=r.forwardRef(({className:e,...n},o)=>t.jsx(Mw,{ref:o,className:Ie("-mx-1 my-1 h-px bg-muted",e),...n}));Vw.displayName=Mw.displayName;const Kw=({className:e,...n})=>t.jsx("span",{className:Ie("ml-auto text-xs tracking-widest opacity-60",e),...n});Kw.displayName="DropdownMenuShortcut";const Uw=r.forwardRef(({className:e,...n},o)=>t.jsx("input",{type:"radio",className:Ie("h-4 w-4 cursor-pointer accent-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...n}));Uw.displayName="Radio";const Gw=({size:e=8})=>t.jsxs("output",{children:[t.jsxs("svg",{width:4*e,height:4*e,viewBox:"0 0 78 78",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin",role:"img","aria-labelledby":"spinnerTitle",children:[t.jsx("title",{id:"spinnerTitle",children:"Loading..."}),t.jsx("path",{d:"M13.2131 9.74186C7.6162 14.6748 3.55158 21.1095 1.50144 28.2828L9.89497 30.6817C11.4862 25.114 14.641 20.1196 18.9852 16.2909L13.2131 9.74186Z",fill:"#0d406e"}),t.jsx("path",{d:"M55.2865 74.4365C62.0653 71.321 67.8083 66.3265 71.8342 60.0455L64.4847 55.3347C61.36 60.2099 56.9025 64.0864 51.641 66.5046L55.2865 74.4365Z",fill:"#0d406e"}),t.jsx("path",{d:"M71.8342 60.0455C75.8601 53.7645 78 46.4605 78 39H69.2704C69.2704 44.7906 67.6095 50.4596 64.4847 55.3347L71.8342 60.0455Z",fill:"#0d406e"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.2131 9.74186C20.1094 4.11892 24.5245 2.24347 33.0785 0.452148C25.7044 1.58491 18.8101 4.80896 13.2131 9.74186Z",fill:"#0d406e"}),t.jsx("path",{d:"M33.5891 77.6228C40.9774 78.6579 48.5077 77.5521 55.2865 74.4365L51.641 66.5046C46.3795 68.9227 40.5348 69.781 34.8002 68.9776L33.5891 77.6228Z",fill:"#0d406e"}),t.jsx("path",{d:"M13.6026 68.5968C19.2643 73.4552 26.2007 76.5877 33.5891 77.6228L34.8002 68.9776C29.0657 68.1742 23.6818 65.7429 19.2874 61.9719L13.6026 68.5968Z",fill:"#0d406e"}),t.jsx("path",{d:"M1.50144 28.2828C-0.548705 35.4561 -0.498346 43.0669 1.64654 50.2124L10.0076 47.7027C8.34281 42.1566 8.30373 36.2493 9.89497 30.6817L1.50144 28.2828Z",fill:"#0d406e"}),t.jsx("path",{d:"M1.64654 50.2124C3.79143 57.358 7.94084 63.7384 13.6026 68.5968L19.2874 61.9719C14.893 58.201 11.6724 53.2488 10.0076 47.7027L1.64654 50.2124Z",fill:"#0d406e"}),t.jsx("path",{d:"M34.4039 9.08055L33.0785 0.452148C24.5245 2.24347 20.1094 4.11892 13.2131 9.74186L18.9852 16.2909C23.3293 12.4621 28.6805 9.95976 34.4039 9.08055Z",fill:"#0d406e"})]}),t.jsx("span",{className:"sr-only",children:"Loading..."})]});const Zw=async(e,{search:t,modelClass:n,labelName:o,additionalFilters:r={},fields:a})=>{const i={...t?{[`${o}__icontains`]:t}:{},...r},s=a?.length?[o,...a]:[],[l,c]=await e(n,i,s);if(c)throw new Error(c.message);return l??[]},Xw=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Qw=new Set(["Write","Preview","Markdown","WYSIWYG"]);function Jw(e,t=[]){return function(e){return e?e.replace(Xw,"$1"):e}(function(e,t=[]){if(!e)return e;const n=e=>Qw.has(e)||t.some(t=>t===e),o=e.split("\n");for(;o.length>0;){const e=o[0].trim();if(e&&!n(e))break;o.shift()}return o.join("\n")}(e,t))}function ek(e){return e?[e]:[]}function tk(e,t){const n=Jw(e,ek(t));return n.trim()?n:" "}const nk=({triggerClassName:n,className:o,trigger:r,children:a})=>{const i=e.useId();return t.jsx(iy,{children:t.jsxs(sy,{children:[t.jsx(ly,{asChild:!0,children:t.jsx("div",{className:n,children:r})}),t.jsx(cy,{className:o,children:a})]})},i)};exports.Accordion=Fu,exports.AccordionContent=Wu,exports.AccordionItem=zu,exports.AccordionTrigger=Lu,exports.Alert=uy,exports.AlertDescription=fy,exports.AlertDialog=Na,exports.AlertDialogAction=Ta,exports.AlertDialogCancel=Ra,exports.AlertDialogContent=Da,exports.AlertDialogDescription=Oa,exports.AlertDialogFooter=Ea,exports.AlertDialogHeader=Sa,exports.AlertDialogOverlay=_a,exports.AlertDialogPortal=Ca,exports.AlertDialogTitle=Ma,exports.AlertDialogTrigger=function({...e}){return t.jsx(va,{"data-slot":"alert-dialog-trigger",...e})},exports.AlertTitle=py,exports.AlertWithIcon=function({icon:e,title:n,description:o,variant:r="default",className:a}){return t.jsxs(uy,{variant:r,className:a??"w-auto h-auto m-4",children:[e,t.jsx(py,{children:n}),t.jsx(fy,{children:o})]})},exports.Badge=function({className:e,variant:n,...o}){return t.jsx("div",{"data-slot":"badge",className:Ie(El({variant:n}),e),...o})},exports.Breadcrumb=function({...e}){return t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})},exports.BreadcrumbEllipsis=function({className:e,...n}){return t.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:Ie("flex size-9 items-center justify-center",e),...n,children:[t.jsx(Xl,{className:"size-4"}),t.jsx("span",{className:"sr-only",children:"More"})]})},exports.BreadcrumbItem=function({className:e,...n}){return t.jsx("li",{"data-slot":"breadcrumb-item",className:Ie("inline-flex items-center gap-1.5",e),...n})},exports.BreadcrumbLink=function({asChild:e,className:n,...o}){const r=e?f:"a";return t.jsx(r,{"data-slot":"breadcrumb-link",className:Ie("hover:text-foreground transition-colors",n),...o})},exports.BreadcrumbList=function({className:e,...n}){return t.jsx("ol",{"data-slot":"breadcrumb-list",className:Ie("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...n})},exports.BreadcrumbPage=function({className:e,...n}){return t.jsx("span",{"data-slot":"breadcrumb-page","aria-disabled":"true","aria-current":"page",className:Ie("text-foreground font-normal",e),...n})},exports.BreadcrumbSeparator=function({children:e,className:n,...o}){return t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Ie("[&>svg]:size-3.5",n),...o,children:e??t.jsx(ql,{})})},exports.Button=Le,exports.Calendar=Zg,exports.Card=kl,exports.CardContent=_l,exports.CardDescription=Cl,exports.CardFooter=Dl,exports.CardHeader=jl,exports.CardTitle=Nl,exports.Checkbox=Mx,exports.ClearButton=({handleClear:e})=>t.jsx("button",{type:"button",className:"h-10 p-2 mt-1 text-xs bg-white",onClick:e,children:t.jsxs(Ge,{direction:"row",gap:2,className:"items-center",children:["Limpar filtros ",t.jsx(ac,{size:16})]})}),exports.Combobox=Gp,exports.Command=Yp,exports.CommandDialog=function({title:e="Command Palette",description:n="Search for a command to run...",children:o,className:r,showCloseButton:a=!0,...i}){return t.jsxs(Pp,{...i,children:[t.jsxs(Lp,{className:"sr-only",children:[t.jsx(Bp,{children:e}),t.jsx($p,{children:n})]}),t.jsx(zp,{className:Ie("overflow-hidden p-0",r),children:t.jsx(Yp,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:o})})]})},exports.CommandEmpty=Vp,exports.CommandGroup=Kp,exports.CommandInput=qp,exports.CommandItem=Up,exports.CommandList=Hp,exports.CommandSeparator=function({className:e,...n}){return t.jsx(jp.Separator,{"data-slot":"command-separator",className:Ie("bg-border -mx-1 h-px",e),...n})},exports.CommandShortcut=function({className:e,...n}){return t.jsx("span",{"data-slot":"command-shortcut",className:Ie("text-muted-foreground ml-auto text-xs tracking-widest",e),...n})},exports.ConfirmationDialog=Pa,exports.DatePicker=({id:e,placeholder:n,value:o,onValueChange:r,className:a,boundary:i="start",dateFormat:s="dd/MM/yyyy"})=>{const l=Qg(o),c=((e,t)=>{const n=Qg(e);return n?jv(n,t):null})(o,s);return t.jsx("div",{className:Ie("flex w-full min-w-0",a),children:t.jsxs(xl,{children:[t.jsx(yl,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":e,className:Ie(We,"justify-start text-left",!c&&Be),children:[t.jsx(Wl,{className:Ie("mr-2",$e)}),c??n]})}),t.jsx(bl,{className:"w-fit p-0",align:"start",children:t.jsx(Zg,{mode:"single",selected:l,onSelect:e=>{if(!e)return void r?.("");const t="end"===i?Fh(e):Rh(e);r?.(t.toISOString())},initialFocus:!0})})]})})},exports.DeleteDialog=({openDialog:e,setOpenDialog:n,handleDelete:o,count:r})=>{const a=void 0!==r&&r>1;return t.jsx(Ge,{direction:"row",children:t.jsx(Pp,{open:e,onOpenChange:n,children:t.jsxs(zp,{className:"max-w-[513px] rounded-xl px-8 py-6 gap-4",children:[t.jsxs(Lp,{children:[t.jsx(Bp,{className:"pb-0 border-none",children:a?`Deseja apagar ${r} registros selecionados?`:"Deseja apagar registro atual?"}),t.jsx($p,{})]}),t.jsx("form",{onSubmit:e=>{e.preventDefault(),o()},children:t.jsxs(Ge,{gap:2,children:[t.jsx("p",{className:"text-fontcolor-secondary font-medium text-sm",children:a?`Essa ação não poderá ser desfeita e os ${r} registros serão removidos permanentemente. Tem certeza de que deseja continuar?`:"Essa ação não poderá ser desfeita e o registro será removido permanentemente. Tem certeza de que deseja continuar?"}),t.jsxs(Wp,{className:"mt-4",children:[t.jsx(Pr,{asChild:!0,children:t.jsx(Le,{variant:"ghost",type:"button",children:"Cancelar"})}),t.jsx(Le,{type:"submit",variant:"default",children:a?`Deletar ${r}`:"Deletar"})]})]})})]})})})},exports.Dialog=Pp,exports.DialogContent=zp,exports.DialogDescription=$p,exports.DialogFooter=Wp,exports.DialogHeader=Lp,exports.DialogTitle=Bp,exports.DialogTrigger=Ap,exports.DownloadButton=({item:n,modelClass:o,propertyName:r,retrieveFile:a})=>{const[i,s]=e.useState(!1);return t.jsx(Le,{variant:"outline",size:"icon",disabled:i||!a,onClick:async()=>{if(a){s(!0);try{const[e,t]=await a(o,Number(n[r]));if(t)return void kc.error(`Houve algum problema: ${t.message}`);if(!e)return void kc.error("Nenhum arquivo encontrado");const i=new Blob([new Uint8Array(e.data)],{type:e.contentType}),s=URL.createObjectURL(i),l=document.createElement("a");l.href=s,l.download=n.file.split(/[\\/]/).pop()??n.file,document.body.appendChild(l);try{l.click()}finally{document.body.removeChild(l),URL.revokeObjectURL(s)}kc.success("Arquivo baixado com sucesso!")}finally{s(!1)}}else kc.error("Função de download não configurada")},children:i?t.jsx(Jl,{className:"animate-spin"}):t.jsx(Zl,{})})},exports.DropdownMenu=Rw,exports.DropdownMenuCheckboxItem=Yw,exports.DropdownMenuContent=Bw,exports.DropdownMenuGroup=Aw,exports.DropdownMenuItem=$w,exports.DropdownMenuLabel=Hw,exports.DropdownMenuPortal=Iw,exports.DropdownMenuRadioGroup=zw,exports.DropdownMenuRadioItem=qw,exports.DropdownMenuSeparator=Vw,exports.DropdownMenuShortcut=Kw,exports.DropdownMenuSub=Fw,exports.DropdownMenuSubContent=Ww,exports.DropdownMenuSubTrigger=Lw,exports.DropdownMenuTrigger=Pw,exports.Dropzone=function({children:n,maxFiles:o=1,maxSize:r=5242880,accept:a={"text/csv":[".csv"]},onFilesAccepted:i}){const[s,l]=e.useState([]),[c,d]=e.useState([]),u=e.useCallback((e,t)=>{const n=t.map(({file:e})=>e);l(n),e.length>0&&(d(e),i(e))},[i]),{getRootProps:p,getInputProps:f,isDragActive:m}=Dn({onDrop:u,maxFiles:o,maxSize:r,accept:a,multiple:o>1});return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{...p(),className:"border-2 border-dashed rounded-lg text-center cursor-pointer transition-colors "+(m?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[t.jsx("input",{...f()}),t.jsxs("div",{className:Ie(c.length>0?"p-6 bg-green-100":"p-6","flex flex-col items-center justify-center gap-2"),children:[m&&t.jsx("p",{className:"font-medium text-blue-500",children:"Clique para selecionar os arquivos ou arraste-os aqui"}),!m&&c.length>0&&c.map(e=>t.jsx(Ge,{children:t.jsxs("p",{className:"font-medium",children:[t.jsx("b",{children:"Nome do arquivo:"})," ",e.name]})},e.name)),!m&&0===c.length&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"font-medium",children:"Clique para selecionar os arquivos ou arraste-os aqui"}),t.jsxs("p",{className:"text-sm text-gray-500",children:[r/1024/1024,"MB"]})]})]})]}),c.length>0&&t.jsx("div",{className:"w-full",children:n}),s.length>0&&t.jsxs("div",{className:"text-sm text-red-600",children:[t.jsx("h4",{className:"font-medium mb-2",children:"Rejected files:"}),t.jsx("ul",{className:"space-y-1",children:s.map(e=>t.jsxs("li",{className:"flex items-center justify-between",children:[t.jsxs("span",{children:[e.name," (",(e.size/1024).toFixed(2)," KB)"]}),t.jsx("button",{type:"button",onClick:()=>{return t=e.name,void l(e=>e.filter(e=>e.name!==t));var t},className:"text-red-800 hover:text-red-900",children:"×"})]},e.name))}),t.jsxs("p",{className:"mt-1",children:["File must be ",r/1024/1024,"MB or smaller."]})]})]})},exports.Empty=Bu,exports.EmptyContainer=Ku,exports.EmptyContent=function({className:e,...n}){return t.jsx("div",{"data-slot":"empty-content",className:Ie("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",e),...n})},exports.EmptyDescription=Vu,exports.EmptyHeader=$u,exports.EmptyMedia=qu,exports.EmptyTitle=Hu,exports.ErrorBoundary=({children:e,hasError:n,message:o="Um erro inesperado ocorreu."})=>n?t.jsx(uy,{variant:"destructive",className:"my-2",children:o}):t.jsx(t.Fragment,{children:e}),exports.ErrorMessage=({error:e})=>t.jsx(t.Fragment,{children:e&&t.jsx("span",{className:"text-red-500 text-xs",children:e?.message})}),exports.ErrorToastContent=({message:n,error:o})=>{const[r,a]=e.useState(!1),i=JSON.stringify(o,null,2);return t.jsxs(Ge,{children:[t.jsx("p",{children:n}),t.jsx(Fu,{type:"single",collapsible:!0,className:"max-w-60",children:t.jsxs(zu,{value:"error-details",className:"border-none",children:[t.jsx(Lu,{className:"text-sm py-2 hover:no-underline text-red-100",children:"View Error Details"}),t.jsx(Wu,{children:t.jsx("pre",{className:"text-xs bg-red-950 p-3 rounded overflow-x-auto max-h-40 overflow-y-auto",children:t.jsx("code",{className:"text-red-100",children:i})})})]})}),t.jsx("button",{type:"button",onClick:()=>{const e=JSON.stringify(o,null,2);navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)},className:"flex items-center justify-center gap-2 px-3 py-2 bg-red-600 hover:bg-red-700 text-white text-xs font-medium rounded transition-colors",children:r?t.jsxs(t.Fragment,{children:[t.jsx(Bl,{size:14}),t.jsx("span",{children:"Copied!"})]}):t.jsxs(t.Fragment,{children:[t.jsx(Gl,{size:14}),t.jsx("span",{children:"Copy Error JSON"})]})})]})},exports.FKSelect=Xp,exports.FileDropzone=function({onFileSelected:n,onFileDeleted:o,acceptExtensions:r,accept:a,maxSizeMB:i=25}){const[s,l]=e.useState(null),c=1024*i*1024,d=e.useMemo(()=>a||(r?.length?Cc(r):jc),[a,r]),u=e.useMemo(()=>Object.values(d).reduce((e,t)=>e.concat(t),[]).join(","),[d]),p=e.useCallback((e,t)=>{if(t.length>0){const{errors:e}=t[0],n=e[0];return void("file-too-large"===n.code?kc.error(`File size must be under ${i} MB`):"file-invalid-type"===n.code?kc.error(`Invalid file type. Allowed: ${r}`):kc.error(n.message))}const o=e[0];o&&(l(o),n(new File([o],o.name,{type:o.type,lastModified:o.lastModified})),kc.success(`File "${o.name}" selected successfully!`))},[n,i,r]),{getRootProps:f,getInputProps:m,isDragActive:h}=Dn({onDrop:p,maxFiles:1,maxSize:c,accept:d,multiple:!1});return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("p",{className:"font-bold",children:["Envie um arquivo com até ",i," MB."]}),s?t.jsxs("div",{className:"flex items-center justify-between border rounded-md px-3 py-2 bg-white",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ql,{className:"h-4 w-4 text-gray-600"}),t.jsx("span",{className:"text-sm",children:s.name})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("button",{onClick:()=>{const e=document.createElement("input");e.type="file",e.accept=u,e.onchange=e=>{const t=e.target.files?.[0];if(!t)return;const o=Object.values(d).reduce((e,t)=>e.concat(t),[]);o.some(e=>t.name.toLowerCase().endsWith(e.toLowerCase()))?t.size>c?kc.error(`File size must be under ${i} MB`):(l(t),n(t),kc.success(`File "${t.name}" selected successfully!`)):kc.error(`Invalid file type. Allowed: ${o.join(", ")}`)},e.click()},className:"p-1 hover:bg-gray-100 rounded",children:t.jsx(nc,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>{l(null),o?.(),kc.success("File removed")},className:"p-1 hover:bg-red-50 rounded",children:t.jsx(rc,{className:"h-4 w-4 text-red-600"})})]})]}):t.jsxs("div",{...f(),className:"border rounded-lg text-center cursor-pointer transition-colors h-[300px] "+(h?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[t.jsx("input",{...m()}),t.jsxs("div",{className:"py-16 px-6 flex flex-col items-center",children:[t.jsx(Ul,{strokeWidth:1,className:"size-[80px] text-[#026CB6]"}),t.jsx("p",{className:"text-muted",children:"Arraste e solte ou selecione um arquivo."}),t.jsxs("p",{className:"text-muted",children:["Arquivos aceitos:",r]})]})]})]})},exports.Input=Ve,exports.Label=Px,exports.Loading=function(){return t.jsxs("div",{className:"flex flex-col items-center justify-center mx-auto",children:[t.jsx(Gw,{size:12}),t.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Loading..."})]})},exports.MarkdownEditor=function({value:n,onChange:o,placeholder:r,error:a,disabled:i,className:s,theme:l}){const c=e.useRef(null),d=e.useRef(!1),[u,p]=e.useState(null),f=ek(r),m=function(){const[t,n]=e.useState(!1);return e.useEffect(()=>{const e=document.documentElement,t=()=>{n(e.classList.contains("dark"))};t();const o=new MutationObserver(t);return o.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>{o.disconnect()}},[]),t}(),h=l??(m?"dark":"light");return e.useEffect(()=>{let e=!0;return Promise.all([import("@toast-ui/react-editor"),import("@toast-ui/editor/dist/toastui-editor.css"),import("@toast-ui/editor/dist/theme/toastui-editor-dark.css")]).then(([t])=>{e&&p(()=>t.Editor)}),()=>{e=!1}},[]),e.useEffect(()=>{d.current=!1},[h]),u?t.jsxs(Ge,{direction:"col",gap:2,className:`markdown-editor ${s??"w-full"}`,children:[t.jsx(u,{initialValue:tk(n,r),usageStatistics:!1,autofocus:!1,initialEditType:"wysiwyg",hideModeSwitch:!0,useCommandShortcut:!i,theme:h,onChange:()=>{if(!d.current)return;const e=c.current?.getInstance()?.getMarkdown()??"";o(Jw(e,f))},onLoad:()=>{const e=c.current?.getInstance(),t=Jw(n,f);e&&(t.trim()?e.setMarkdown(t):e.reset()),window.requestAnimationFrame(()=>{d.current=!0})},ref:c},h),a&&t.jsx("p",{className:"text-sm text-destructive",children:a})]}):t.jsx(Ge,{direction:"col",gap:2,className:s??"w-full min-h-[200px]",children:t.jsx("span",{})})},exports.MultiSelectDropdown=function({options:e,selected:n,onChange:o,placeholder:a="Select items...",className:i,maxDisplay:s=3}){const[l,c]=r.useState(!1),d=n.length===e.length&&e.length>0;return t.jsxs(ch,{open:l,onOpenChange:c,children:[t.jsx(ph,{className:Ie("w-full",i),children:t.jsx("span",{className:Ie("truncate flex-1 text-left",0===n.length&&"text-muted-foreground"),children:(()=>{if(0===n.length)return a;if(n.length>s)return`${n.length} items selected`;const t=n.map(t=>e.find(e=>e.value===t)?.label).join(", ");return t.length>80?`${n.length} item${1!==n.length?"s":""} selected`:t})()})}),t.jsxs(hh,{children:[e.length>0&&t.jsx("div",{className:"border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2 cursor-pointer p-2 hover:bg-accent hover:text-accent-foreground rounded-sm w-full text-left font-medium",children:[t.jsx(Mx,{checked:d,onCheckedChange:()=>{o(d?[]:e.map(e=>e.value))}}),t.jsx("span",{className:"text-sm",children:d?"Unselect All":"Select All"})]})}),t.jsx("div",{className:"p-1 space-y-1",children:e.map(e=>t.jsxs("div",{className:"flex items-center space-x-2 cursor-pointer p-2 hover:bg-accent hover:text-accent-foreground rounded-sm w-full text-left",children:[t.jsx(Mx,{checked:n.includes(e.value),onCheckedChange:()=>(e=>{const t=n.includes(e)?n.filter(t=>t!==e):[...n,e];o(t)})(e.value)}),t.jsx("span",{className:"text-sm",children:e.label})]},e.value))}),n.length>0&&t.jsx("div",{className:"border-t border-border p-2 bg-muted",children:t.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.length," item",1!==n.length?"s":""," selected"]})})]})]})},exports.NoResult=tx,exports.Pagination=({startRecord:e,endRecord:n,hasValidSearchValues:o,tabCount:r,disabledLoadBackButton:a,disabledLoadMoreButton:i,loadBack:s,loadMore:l})=>t.jsxs("div",{className:"flex items-center gap-2 text-fontcolor-secondary",children:[t.jsx("div",{className:"text-sm",children:t.jsxs("p",{children:[e," - ",n," de"," ",o?n:r]})}),t.jsxs("div",{className:"h-[32px] flex items-center",children:[t.jsx(nk,{className:"bg-zinc-900 text-white",trigger:t.jsx(Le,{variant:"ghost",disabled:a,onClick:()=>s(),type:"button",className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:t.jsx("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:t.jsx(Yl,{size:16})})}),children:"Anteriores"}),t.jsx(nk,{className:"bg-zinc-900 text-white",trigger:t.jsx(Le,{variant:"ghost",disabled:i,onClick:()=>l(),className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:t.jsx("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:t.jsx(ql,{size:16})})}),children:"Próximos"})]})]}),exports.PopConfirm=function({title:n,description:o,children:r,onConfirm:a,onCancel:i,confirmText:s="Confirmar",cancelText:l="Cancelar",disabled:c=!1,confirmVariant:d="default",confirmTestId:u,cancelTestId:p,side:f="top",align:m="center"}){const[h,v]=e.useState(!1),[g,x]=e.useState(!1);return t.jsxs(xl,{open:h,onOpenChange:e=>{c||g||(v(e),e||i?.())},children:[t.jsx(yl,{asChild:!0,disabled:c,children:r}),t.jsx(bl,{side:f,align:m,className:"w-80 bg-white p-4",onOpenAutoFocus:e=>e.preventDefault(),children:t.jsxs(Ge,{gap:3,children:[t.jsxs(Ge,{gap:1,children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),o?t.jsx("p",{className:"text-sm text-muted-foreground",children:o}):null]}),t.jsxs(Ge,{direction:"row",gap:2,className:"justify-end",children:[t.jsx(Le,{type:"button",variant:"secondary",size:"sm",onClick:()=>{v(!1),i?.()},disabled:g,"data-testid":p,children:l}),t.jsx(Le,{type:"button",variant:"destructive"===d?"destructive":"default",size:"sm",onClick:async()=>{x(!0);try{await a(),v(!1)}finally{x(!1)}},disabled:g,"data-testid":u,children:g?"Confirmando...":s})]})]})})]})},exports.Popover=xl,exports.PopoverContent=bl,exports.PopoverTrigger=yl,exports.PumpwoodBadge=function({className:e,variant:n,size:o,...r}){const a=Ie(Ml({variant:n,size:o}),e);return t.jsx("div",{className:a,...r})},exports.PumpwoodCard=Sl,exports.PumpwoodTable=px,exports.Radio=Uw,exports.RangePicker=({id:e,placeholder:n,fromValue:o,toValue:r,onFromChange:a,onToChange:i,className:s,dateFormat:l="dd/MM/yyyy"})=>{const c={from:Jg(o),to:Jg(r)},d=Boolean(o?.trim()||r?.trim()),u=((e,t,n,o)=>{const r=ex(e,n),a=ex(t,n);return r&&a?"{from} - {to}".replace("{from}",r).replace("{to}",a):r?"{from} - …".replace("{from}",r):o})(o,r,l,n);return t.jsx("div",{className:Ie("flex w-full min-w-0",s),children:t.jsxs(xl,{children:[t.jsx(yl,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":e,className:Ie(We,"justify-start text-left",!d&&Be),children:[t.jsx(Wl,{className:Ie("mr-2",$e)}),u]})}),t.jsx(bl,{className:"w-fit p-0",align:"start",children:t.jsx(Zg,{mode:"range",selected:c,onSelect:e=>{if(!e)return a?.(""),void i?.("");e.from?a?.(Rh(e.from).toISOString()):a?.(""),e.to?i?.(Fh(e.to).toISOString()):i?.("")},initialFocus:!0,numberOfMonths:2})})]})})},exports.Select=e=>{if("fk"===e.variant){const{variant:n,...o}=e;return t.jsx(Xp,{...o})}return t.jsx(yh,{...e})},exports.SelectContent=hh,exports.SelectGroup=dh,exports.SelectItem=gh,exports.SelectLabel=vh,exports.SelectPrimitive=ch,exports.SelectScrollDownButton=mh,exports.SelectScrollUpButton=fh,exports.SelectSeparator=xh,exports.SelectTrigger=ph,exports.SelectValue=uh,exports.Sidebar=Sc,exports.Skeleton=dx,exports.Spinner=Gw,exports.Stack=Ge,exports.Table=function({data:e,columns:n,getRowKey:o,ordering:r,onSort:a,onRowClick:i,isLoading:s,hasMore:l,onLoadMore:c,className:d}){const u=Boolean(s&&0===e.length),p=n??[];return s||0!==e.length?t.jsx("div",{className:Ie("flex flex-1 min-h-0 flex-col mt-4",d),children:t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsxs(nx,{wrap:!1,className:"table-fixed w-full",children:[t.jsx(ox,{className:"sticky top-0 z-10 bg-primary text-white",children:t.jsx(fx,{columns:p,ordering:r,onSort:a})}),t.jsxs(rx,{children:[u?t.jsx(ux,{columns:p.map(e=>({width:e.width,cellClassName:e.cellClassName}))}):e.map(e=>t.jsx(mx,{item:e,columns:p,onClick:i?()=>i(e):void 0},o(e))),l&&c&&!u&&t.jsx(ix,{children:t.jsx(lx,{colSpan:p.length,className:"text-center py-6",children:t.jsx(Le,{onClick:c,disabled:s,variant:"outline",children:s?"Carregando...":"Carregar Mais"})})})]})]})})}):t.jsx("div",{className:Ie("flex-1 mt-4",d),children:t.jsx("div",{className:"py-20",children:t.jsx(tx,{})})})},exports.TableBody=rx,exports.TableCaption=cx,exports.TableCell=lx,exports.TableFooter=ax,exports.TableHead=sx,exports.TableHeader=ox,exports.TablePrimitive=nx,exports.TableRow=ix,exports.TableSkeleton=ux,exports.Tabs=pd,exports.TabsContent=hd,exports.TabsList=fd,exports.TabsTrigger=md,exports.TagInput=function({value:n=[],onChange:o,keyPlaceholder:r="Chave",valuePlaceholder:a="Valor",disabled:i=!1}){const[s,l]=e.useState(""),[c,d]=e.useState(""),u=()=>{const e=s.trim(),t=c.trim();if(e&&t){n.some(t=>t.key===e)||(o([...n,{key:e,value:t}]),l(""),d(""))}},p=e=>{"Enter"===e.key&&(e.preventDefault(),u())};return t.jsxs(Ge,{direction:"col",gap:3,children:[t.jsxs(Ge,{direction:"row",gap:2,children:[t.jsx(Ve,{value:s,onChange:e=>l(e.target.value),onKeyDown:p,placeholder:r,disabled:i,className:"flex-1"}),t.jsx(Ve,{value:c,onChange:e=>d(e.target.value),onKeyDown:p,placeholder:a,disabled:i,className:"flex-1"}),t.jsx(Le,{type:"button",onClick:u,disabled:!s.trim()||!c.trim()||i,variant:"outline",children:"Adicionar"})]}),n.length>0&&t.jsx(Ge,{direction:"row",gap:2,className:"flex-wrap",children:n.map(e=>t.jsxs(Ge,{direction:"row",gap:1,className:"items-center px-3 py-1 bg-secondary text-secondary-foreground rounded-md text-sm",children:[t.jsxs("span",{className:"font-medium",children:[e.key,":"]}),t.jsx("span",{children:e.value}),t.jsx(Le,{type:"button",onClick:()=>{return t=e.key,void o(n.filter(e=>e.key!==t));var t},disabled:i,variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-secondary-foreground/10 rounded-full","aria-label":`Remover tag ${e.key}`,children:t.jsx(ac,{className:"h-3 w-3"})})]},e.key))})]})},exports.Textarea=Ue,exports.Tooltip=sy,exports.TooltipComponent=nk,exports.TooltipContent=cy,exports.TooltipProvider=iy,exports.TooltipTrigger=ly,exports.Typography=wl,exports.badgeVariants=El,exports.createFKSelectFetcher=(e,t,n={})=>o=>Zw(e,{...o,labelName:t,additionalFilters:n.additionalFilters,fields:n.fields}),exports.fkSelectFetcher=Zw,exports.pumpwoodBadgeVariants=Ml,exports.useSidebarCollapse=function({initialCollapsed:t=!1,onPersist:n}={}){const[o,r]=e.useState(t),[a,i]=e.useState(!1),s=e.useCallback(()=>{i(!0),r(e=>{const t=!e;return n?.(t),t})},[n]),l=e.useCallback(()=>{i(!0),r(!1),n?.(!1)},[n]),c=e.useCallback(()=>{i(!1)},[]),[d,u]=e.useState({}),p=e.useCallback(e=>{if(o)return l(),void u({[e]:!0});u(t=>({...t,[e]:!t[e]}))},[o,l]),f=e.useCallback(()=>{u({})},[]);return{isCollapsed:o,isCollapsing:a,expandedItems:d,setExpandedItems:u,toggleCollapse:s,expand:l,handleTransitionEnd:c,toggleExpanded:p,setExpandedOnCollapse:f}};
40
+ */!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.firstChild?t.insertBefore(n,t.firstChild):t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}\n');var ic=e=>"number"==typeof e&&!isNaN(e),sc=e=>"string"==typeof e,lc=e=>"function"==typeof e,cc=1,dc=()=>""+cc++,uc=new Map,pc=[],fc=new Set,mc=()=>uc.size>0;function hc(e){if(mc()){if(null==e||(e=>sc(e)||ic(e))(e))uc.forEach(t=>{t.removeToast(e)});else if(e&&("containerId"in e||"id"in e)){let t=uc.get(e.containerId);t?t.removeToast(e.id):uc.forEach(t=>{t.removeToast(e.id)})}}else pc=pc.filter(t=>null!=e&&t.options.toastId!==e)}function vc(t,n){(t=>e.isValidElement(t)||sc(t)||lc(t)||ic(t))(t)&&(mc()||pc.push({content:t,options:n}),uc.forEach(e=>{e.buildToast(t,n)}))}function gc(e,t){uc.forEach(n=>{(null==t||null==t||!t.containerId||(null==t?void 0:t.containerId)===n.id)&&n.toggle(e,null==t?void 0:t.id)})}function xc(e){return e&&(sc(e.toastId)||ic(e.toastId))?e.toastId:dc()}function yc(e,t){return vc(e,t),t.toastId}function bc(e,t){return{...t,type:t&&t.type||e,toastId:xc(t)}}function wc(e){return(t,n)=>yc(t,bc(e,n))}function kc(e,t){return yc(e,bc("default",t))}kc.loading=(e,t)=>yc(e,bc("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),kc.promise=function(e,{pending:t,error:n,success:o},r){let a;t&&(a=sc(t)?kc.loading(t,r):kc.loading(t.render,{...r,...t}));let i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},s=(e,t,n)=>{if(null==t)return void kc.dismiss(a);let o={type:e,...i,...r,data:n},s=sc(t)?{render:t}:t;return a?kc.update(a,{...o,...s}):kc(s.render,{...o,...s}),n},l=lc(e)?e():e;return l.then(e=>s("success",o,e)).catch(e=>s("error",n,e)),l},kc.success=wc("success"),kc.info=wc("info"),kc.error=wc("error"),kc.warning=wc("warning"),kc.warn=kc.warning,kc.dark=(e,t)=>yc(e,bc("default",{theme:"dark",...t})),kc.dismiss=function(e){hc(e)},kc.clearWaitingQueue=(e={})=>{uc.forEach(t=>{t.props.limit&&(!e.containerId||t.id===e.containerId)&&t.clearQueue()})},kc.isActive=function(e,t){var n;if(t)return!(null==(n=uc.get(t))||!n.isToastActive(e));let o=!1;return uc.forEach(t=>{t.isToastActive(e)&&(o=!0)}),o},kc.update=(e,t={})=>{let n=((e,{containerId:t})=>{var n;return null==(n=uc.get(t||1))?void 0:n.toasts.get(e)})(e,t);if(n){let{props:o,content:r}=n,a={delay:100,...o,...t,toastId:t.toastId||e,updateId:dc()};a.toastId!==e&&(a.staleId=e);let i=a.render||r;delete a.render,yc(i,a)}},kc.done=e=>{kc.update(e,{progress:1})},kc.onChange=function(e){return fc.add(e),()=>{fc.delete(e)}},kc.play=e=>gc(!0,e),kc.pause=e=>gc(!1,e);const jc={"application/pdf":[".pdf"],"application/msword":[".doc"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":[".docx"],"application/vnd.ms-excel":[".xls"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":[".xlsx"],"application/vnd.ms-powerpoint":[".ppt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":[".pptx"],"image/jpeg":[".jpg",".jpeg"],"image/png":[".png"],"video/mp4":[".mp4"]};const Nc=e=>e.map(e=>e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`),Cc=e=>({"application/octet-stream":Nc(e)});const _c=e.createContext(void 0);function Dc(){const t=e.useContext(_c);if(!t)throw new Error("Sidebar components must be used within a Sidebar.Root");return t}const Sc={Root:function({children:e,isCollapsed:n,isCollapsing:o=!1,onToggleCollapse:r,onTransitionEnd:a,className:i}){const s=n?"smaller:w-20 w-20":"smaller:w-[232px] w-[232px]";return t.jsx(_c.Provider,{value:{isCollapsed:n,isCollapsing:o,onToggleCollapse:r},children:t.jsx("nav",{className:Ie(s,"smaller:p-3 px-2 py-6 flex flex-col items-stretch bg-primary mb-2 rounded-lg transition-all duration-300 ease-in-out h-full min-h-0",i),onTransitionEnd:a,children:e})})},Header:function({children:e,className:n}){return t.jsx("div",{className:Ie("w-full flex justify-between items-center mb-8 gap-4",n),children:e})},Content:function({children:e,className:n}){return t.jsx(Ge,{className:Ie("w-full flex-1 min-h-0 items-stretch gap-1 overflow-y-auto",n),children:e})},Footer:function({children:e,className:n}){return t.jsx("div",{className:Ie("mt-auto w-full",n),children:e})},Toggle:function({className:e}){const{isCollapsed:n,isCollapsing:o,onToggleCollapse:r}=Dc(),a=n&&!o;return t.jsx("div",{className:Ie("w-full flex transition-all duration-300 ease-in-out",a?"justify-center":"justify-end",e),children:t.jsx(Le,{title:a?"Expandir Barra Lateral":"Recolher Barra Lateral",height:48,className:Ie("min-w-[48px] bg-transparent rounded-full hover:bg-white/5 transition-all duration-300 ease-in-out",a?"justify-center":"justify-end"),onClick:r,children:a?t.jsx(ec,{className:"size-[28px] text-white"}):t.jsx(tc,{className:"size-[28px] text-white"})})})},Logo:function({src:e,alt:n,width:o=200,height:r=40,collapsedWidth:a=48,collapsedHeight:i,className:s,ImageComponent:l=({src:e,alt:n,...o})=>t.jsx("img",{src:e,alt:n,...o})}){const{isCollapsed:c,isCollapsing:d}=Dc(),u=c&&!d,p=u?a:o,f=u?i??Math.max(16,Math.round(r/o*a)):r;return t.jsx(Ge,{className:Ie("w-full items-center justify-center py-2",s),children:t.jsx(l,{className:"object-contain transition-all duration-300 ease-in-out",src:e,width:p,height:f,alt:n})})},Link:function({icon:e,children:n,href:o,active:r,className:a,LinkComponent:i=({children:e,...n})=>t.jsx("a",{...n,children:e})}){const{isCollapsed:s,isCollapsing:l}=Dc();return t.jsx(i,{href:o,title:"string"==typeof n?n:void 0,className:Ie("flex w-full h-12 smaller:p-3 p-4 font-bold text-white rounded-md overflow-hidden transition-all duration-300 ease-in-out hover:bg-white/5",r?"bg-white/5":"",a),children:t.jsxs(Ge,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{className:"size-6 shrink-0"}),!s&&!l&&t.jsx("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:n})]})})},NavGroup:function({icon:e,title:n,isExpanded:o,isActive:r=!1,onToggle:a,children:i,className:s}){const{isCollapsed:l,isCollapsing:c}=Dc();return t.jsxs(Ge,{className:Ie("w-full gap-0",s),children:[t.jsx(Le,{type:"button",title:n,onClick:a,variant:"ghost",height:48,className:Ie("w-full smaller:p-3 p-4 font-bold text-white hover:bg-white/5 hover:text-white justify-start rounded-md transition-all duration-300 ease-in-out",r?"bg-white/5":""),children:t.jsxs(Ge,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{className:"size-6 shrink-0"}),!l&&!c&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex-1 text-left transition-opacity duration-300 ease-in-out opacity-100 text-base",children:n}),t.jsx($l,{width:20,height:20,className:Ie("shrink-0 transition-transform duration-300 ease-in-out",o?"rotate-180":"")})]})]})}),!l&&!c&&t.jsx("div",{className:Ie("overflow-hidden transition-all duration-300 ease-in-out",o?"max-h-96 opacity-100 mt-1":"max-h-0 opacity-0"),children:t.jsx(Ge,{className:"w-full gap-1 pl-9 pr-1",children:i})})]})},NavSubLink:function({title:e,href:n,active:o=!1,className:r,LinkComponent:a=({children:e,...n})=>t.jsx("a",{...n,children:e})}){return t.jsx(a,{href:n,title:e,className:Ie("flex w-full h-10 items-center px-3 text-sm text-white rounded-md transition-all duration-200 ease-in-out hover:bg-white/5",o?"bg-white/10 font-semibold":"",r),children:e})},Action:function({icon:e,label:n,onClick:o,className:r}){const{isCollapsed:a,isCollapsing:i}=Dc();return t.jsx(Le,{title:n,onClick:o,variant:"ghost",height:48,className:Ie("w-full smaller:p-3 p-4 font-bold text-white hover:bg-transparent hover:text-white/80 transition-all duration-300 ease-in-out justify-start",r),children:t.jsxs(Ge,{direction:"row",gap:2,className:"w-full items-center",children:[t.jsx(e,{width:24,height:24,className:"shrink-0"}),!a&&!i&&t.jsx("span",{className:"transition-opacity duration-300 ease-in-out opacity-100",children:n})]})})}};var Ec=r.createContext(void 0);function Mc(e){const t=r.useContext(Ec);return e||t||"ltr"}var Oc="rovingFocusGroup.onEntryFocus",Tc={bubbles:!1,cancelable:!0},Rc="RovingFocusGroup",[Pc,Ac,Ic]=function(n){const o=n+"CollectionProvider",[r,a]=Mn(o),[i,s]=r(o,{collectionRef:{current:null},itemMap:new Map}),c=n=>{const{scope:o,children:r}=n,a=e.useRef(null),s=e.useRef(new Map).current;return t.jsx(i,{scope:o,itemMap:s,collectionRef:a,children:r})};c.displayName=o;const d=n+"CollectionSlot",u=Ln(d),p=e.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=l(n,s(d,o).collectionRef);return t.jsx(u,{ref:a,children:r})});p.displayName=d;const f=n+"CollectionItemSlot",m="data-radix-collection-item",h=Ln(f),v=e.forwardRef((n,o)=>{const{scope:r,children:a,...i}=n,c=e.useRef(null),d=l(o,c),u=s(f,r);return e.useEffect(()=>(u.itemMap.set(c,{ref:c,...i}),()=>{u.itemMap.delete(c)})),t.jsx(h,{[m]:"",ref:d,children:a})});return v.displayName=f,[{Provider:c,Slot:p,ItemSlot:v},function(t){const o=s(n+"CollectionConsumer",t);return e.useCallback(()=>{const e=o.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`));return Array.from(o.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[o.collectionRef,o.itemMap])},a]}(Rc),[Fc,zc]=Mn(Rc,[Ic]),[Lc,Wc]=Fc(Rc),Bc=r.forwardRef((e,n)=>t.jsx(Pc.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Pc.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx($c,{...e,ref:n})})}));Bc.displayName=Rc;var $c=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:i=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:u,onEntryFocus:p,preventScrollOnEntryFocus:f=!1,...m}=e,h=r.useRef(null),v=l(n,h),g=Mc(s),[x,y]=zn({prop:c,defaultProp:d??null,onChange:u,caller:Rc}),[b,w]=r.useState(!1),k=qn(p),j=Ac(o),N=r.useRef(!1),[C,_]=r.useState(0);return r.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(Oc,k),()=>e.removeEventListener(Oc,k)},[k]),t.jsx(Lc,{scope:o,orientation:a,dir:g,loop:i,currentTabStopId:x,onItemFocus:r.useCallback(e=>y(e),[y]),onItemShiftTab:r.useCallback(()=>w(!0),[]),onFocusableItemAdd:r.useCallback(()=>_(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>_(e=>e-1),[]),children:t.jsx(Yn.div,{tabIndex:b||0===C?-1:0,"data-orientation":a,...m,ref:v,style:{outline:"none",...e.style},onMouseDown:Tn(e.onMouseDown,()=>{N.current=!0}),onFocus:Tn(e.onFocus,e=>{const t=!N.current;if(e.target===e.currentTarget&&t&&!b){const t=new CustomEvent(Oc,Tc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=j().filter(e=>e.focusable);Vc([e.find(e=>e.active),e.find(e=>e.id===x),...e].filter(Boolean).map(e=>e.ref.current),f)}}N.current=!1}),onBlur:Tn(e.onBlur,()=>w(!1))})})}),Yc="RovingFocusGroupItem",qc=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=In(),u=s||d,p=Wc(Yc,o),f=p.currentTabStopId===u,m=Ac(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=p;return r.useEffect(()=>{if(a)return h(),()=>v()},[a,h,v]),t.jsx(Pc.ItemSlot,{scope:o,id:u,focusable:a,active:i,children:t.jsx(Yn.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:Tn(e.onMouseDown,e=>{a?p.onItemFocus(u):e.preventDefault()}),onFocus:Tn(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:Tn(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:Hc[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const a=r.indexOf(e.currentTarget);r=p.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>Vc(r))}var n,o}),children:"function"==typeof l?l({isCurrentTabStop:f,hasTabStop:null!=g}):l})})});qc.displayName=Yc;var Hc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Vc(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var Kc=Bc,Uc=qc,Gc="Tabs",[Zc]=Mn(Gc,[zc]),Xc=zc(),[Qc,Jc]=Zc(Gc),ed=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:r,onValueChange:a,defaultValue:i,orientation:s="horizontal",dir:l,activationMode:c="automatic",...d}=e,u=Mc(l),[p,f]=zn({prop:r,onChange:a,defaultProp:i??"",caller:Gc});return t.jsx(Qc,{scope:o,baseId:In(),value:p,onValueChange:f,orientation:s,dir:u,activationMode:c,children:t.jsx(Yn.div,{dir:u,"data-orientation":s,...d,ref:n})})});ed.displayName=Gc;var td="TabsList",nd=r.forwardRef((e,n)=>{const{__scopeTabs:o,loop:r=!0,...a}=e,i=Jc(td,o),s=Xc(o);return t.jsx(Kc,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:t.jsx(Yn.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:n})})});nd.displayName=td;var od="TabsTrigger",rd=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:r,disabled:a=!1,...i}=e,s=Jc(od,o),l=Xc(o),c=sd(s.baseId,r),d=ld(s.baseId,r),u=r===s.value;return t.jsx(Uc,{asChild:!0,...l,focusable:!a,active:u,children:t.jsx(Yn.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":d,"data-state":u?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:n,onMouseDown:Tn(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():s.onValueChange(r)}),onKeyDown:Tn(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&s.onValueChange(r)}),onFocus:Tn(e.onFocus,()=>{const e="manual"!==s.activationMode;u||a||!e||s.onValueChange(r)})})})});rd.displayName=od;var ad="TabsContent",id=r.forwardRef((e,n)=>{const{__scopeTabs:o,value:a,forceMount:i,children:s,...l}=e,c=Jc(ad,o),d=sd(c.baseId,a),u=ld(c.baseId,a),p=a===c.value,f=r.useRef(p);return r.useEffect(()=>{const e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),t.jsx(uo,{present:i||p,children:({present:o})=>t.jsx(Yn.div,{"data-state":p?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!o,id:u,tabIndex:0,...l,ref:n,style:{...e.style,animationDuration:f.current?"0s":void 0},children:o&&s})})});function sd(e,t){return`${e}-trigger-${t}`}function ld(e,t){return`${e}-content-${t}`}id.displayName=ad;var cd=nd,dd=rd,ud=id;const pd=ed,fd=r.forwardRef(({className:e,...n},o)=>t.jsx(cd,{ref:o,className:Ie("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...n}));fd.displayName=cd.displayName;const md=r.forwardRef(({className:e,...n},o)=>t.jsx(dd,{ref:o,className:Ie("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground data-[state=active]:shadow",e),...n}));md.displayName=dd.displayName;const hd=r.forwardRef(({className:e,...n},o)=>t.jsx(ud,{ref:o,className:Ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...n}));function vd(e,n=[]){let o=[];const a=()=>{const t=o.map(e=>r.createContext(e));return function(n){const o=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:o}}),[n,o])}};return a.scopeName=e,[function(n,a){const i=r.createContext(a);i.displayName=n+"Context";const s=o.length;o=[...o,a];const l=n=>{const{scope:o,children:a,...l}=n,c=o?.[e]?.[s]||i,d=r.useMemo(()=>l,Object.values(l));return t.jsx(c.Provider,{value:d,children:a})};return l.displayName=n+"Provider",[l,function(t,o){const l=o?.[e]?.[s]||i,c=r.useContext(l);if(c)return c;if(void 0!==a)return a;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},gd(a,...n)]}function gd(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=n.reduce((t,{useScope:n,scopeName:o})=>({...t,...n(e)[`__scope${o}`]}),{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function xd(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function yd(...e){return t=>{let n=!1;const o=e.map(e=>{const o=xd(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){const n=o[t];"function"==typeof n?n():xd(e[t],null)}}}}function bd(...e){return r.useCallback(yd(...e),e)}function wd(e){const t=r.forwardRef((t,n)=>{let{children:o,...a}=t,i=null,s=!1;const l=[];Cd(o)&&"function"==typeof Sd&&(o=Sd(o._payload)),r.Children.forEach(o,e=>{if(t=e,r.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===kd){s=!0;const t=e;let n="child"in t.props?t.props.child:t.props.children;Cd(n)&&"function"==typeof Sd&&(n=Sd(n._payload)),i=jd(t,n),l.push(i?.props?.children)}else l.push(e);var t}),i?i=r.cloneElement(i,void 0,l):!s&&1===r.Children.count(o)&&r.isValidElement(o)&&(i=o);const c=i?function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i):void 0,d=bd(n,c);if(!i){if(o||0===o)throw new Error(s?Dd(e):_d(e));return o}const u=function(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...e)=>{const t=a(...e);return r(...e),t}:r&&(n[o]=r):"style"===o?n[o]={...r,...a}:"className"===o&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}(a,i.props??{});return i.type!==r.Fragment&&(u.ref=n?d:c),r.cloneElement(i,u)});return t.displayName=`${e}.Slot`,t}hd.displayName=ud.displayName;var kd=Symbol.for("radix.slottable");var jd=(e,t)=>{if("child"in e.props){const t=e.props.child;return r.isValidElement(t)?r.cloneElement(t,void 0,e.props.children(t.props.children)):null}return r.isValidElement(t)?t:null};var Nd=Symbol.for("react.lazy");function Cd(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===Nd&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}var _d=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Dd=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Sd=r[" use ".trim().toString()];function Ed(e){const n=e+"CollectionProvider",[o,a]=vd(n),[i,s]=o(n,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:n,children:o}=e,a=r.useRef(null),s=r.useRef(new Map).current;return t.jsx(i,{scope:n,itemMap:s,collectionRef:a,children:o})};l.displayName=n;const c=e+"CollectionSlot",d=wd(c),u=r.forwardRef((e,n)=>{const{scope:o,children:r}=e,a=bd(n,s(c,o).collectionRef);return t.jsx(d,{ref:a,children:r})});u.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",m=wd(p),h=r.forwardRef((e,n)=>{const{scope:o,children:a,...i}=e,l=r.useRef(null),c=bd(n,l),d=s(p,o);return r.useEffect(()=>(d.itemMap.set(l,{ref:l,...i}),()=>{d.itemMap.delete(l)})),t.jsx(m,{[f]:"",ref:c,children:a})});return h.displayName=p,[{Provider:l,Slot:u,ItemSlot:h},function(t){const n=s(e+"CollectionConsumer",t);return r.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])},a]}function Md(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),!1===n||!o.defaultPrevented)return t?.(o)}}var Od=globalThis?.document?r.useLayoutEffect:()=>{},Td=r[" useInsertionEffect ".trim().toString()]||Od;function Rd({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[a,i,s]=function({defaultProp:e,onChange:t}){const[n,o]=r.useState(e),a=r.useRef(n),i=r.useRef(t);return Td(()=>{i.current=t},[t]),r.useEffect(()=>{a.current!==n&&(i.current?.(n),a.current=n)},[n,a]),[n,o,i]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:a;{const t=r.useRef(void 0!==e);r.useEffect(()=>{const e=t.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=l},[l,o])}const d=r.useCallback(t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else i(t)},[l,e,i,s]);return[c,d]}var Pd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const o=wd(`Primitive.${n}`),a=r.forwardRef((e,r)=>{const{asChild:a,...i}=e,s=a?o:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})});return a.displayName=`Primitive.${n}`,{...e,[n]:a}},{});function Ad(e,t){e&&a.flushSync(()=>e.dispatchEvent(t))}var Id=e=>{const{present:t,children:n}=e,o=function(e){const[t,n]=r.useState(),o=r.useRef(null),a=r.useRef(e),i=r.useRef("none"),s=e?"mounted":"unmounted",[l,c]=function(e,t){return r.useReducer((e,n)=>t[e][n]??e,e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const e=zd(o.current);i.current="mounted"===l?e:"none"},[l]),Od(()=>{const t=o.current,n=a.current;if(n!==e){const o=i.current,r=zd(t);if(e)c("MOUNT");else if("none"===r||"none"===t?.display)c("UNMOUNT");else{c(n&&o!==r?"ANIMATION_OUT":"UNMOUNT")}a.current=e}},[e,c]),Od(()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,r=r=>{const i=zd(o.current).includes(CSS.escape(r.animationName));if(r.target===t&&i&&(c("ANIMATION_END"),!a.current)){const o=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=o)})}},s=e=>{e.target===t&&(i.current=zd(o.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",r),t.addEventListener("animationend",r),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",r),t.removeEventListener("animationend",r)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:r.useCallback(e=>{o.current=e?getComputedStyle(e):null,n(e)},[])}}(t),a="function"==typeof n?n({present:o.isPresent}):r.Children.only(n),i=function(...e){const t=r.useRef(e);return t.current=e,r.useCallback(e=>{const n=t.current;let o=!1;const r=n.map(t=>{const n=Fd(t,e);return o||"function"!=typeof n||(o=!0),n});if(o)return()=>{for(let e=0;e<r.length;e++){const t=r[e];"function"==typeof t?t():Fd(n[e],null)}}},[])}(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof n||o.isPresent?r.cloneElement(a,{ref:i}):null};function Fd(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function zd(e){return e?.animationName||"none"}Id.displayName="Presence";var Ld=r[" useId ".trim().toString()]||(()=>{}),Wd=0;function Bd(e){const[t,n]=r.useState(Ld());return Od(()=>{n(e=>e??String(Wd++))},[e]),t?`radix-${t}`:""}var $d="Collapsible",[Yd,qd]=vd($d),[Hd,Vd]=Yd($d),Kd=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,open:a,defaultOpen:i,disabled:s,onOpenChange:l,...c}=e,[d,u]=Rd({prop:a,defaultProp:i??!1,onChange:l,caller:$d});return t.jsx(Hd,{scope:o,disabled:s,contentId:Bd(),open:d,onOpenToggle:r.useCallback(()=>u(e=>!e),[u]),children:t.jsx(Pd.div,{"data-state":Jd(d),"data-disabled":s?"":void 0,...c,ref:n})})});Kd.displayName=$d;var Ud="CollapsibleTrigger",Gd=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,...r}=e,a=Vd(Ud,o);return t.jsx(Pd.button,{type:"button","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open||!1,"data-state":Jd(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:n,onClick:Md(e.onClick,a.onOpenToggle)})});Gd.displayName=Ud;var Zd="CollapsibleContent",Xd=r.forwardRef((e,n)=>{const{forceMount:o,...r}=e,a=Vd(Zd,e.__scopeCollapsible);return t.jsx(Id,{present:o||a.open,children:({present:e})=>t.jsx(Qd,{...r,ref:n,present:e})})});Xd.displayName=Zd;var Qd=r.forwardRef((e,n)=>{const{__scopeCollapsible:o,present:a,children:i,...s}=e,l=Vd(Zd,o),[c,d]=r.useState(a),u=r.useRef(null),p=bd(n,u),f=r.useRef(0),m=f.current,h=r.useRef(0),v=h.current,g=l.open||c,x=r.useRef(g),y=r.useRef(void 0);return r.useEffect(()=>{const e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),Od(()=>{const e=u.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";const t=e.getBoundingClientRect();f.current=t.height,h.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),d(a)}},[l.open,a]),t.jsx(Pd.div,{"data-state":Jd(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!g,...s,ref:p,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&i})});function Jd(e){return e?"open":"closed"}var eu=Kd,tu=Gd,nu=Xd,ou=r.createContext(void 0);function ru(e){const t=r.useContext(ou);return e||t||"ltr"}var au="Accordion",iu=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[su,lu,cu]=Ed(au),[du]=vd(au,[cu,qd]),uu=qd(),pu=r.forwardRef((e,n)=>{const{type:o,...r}=e,a=r,i=r;return t.jsx(su.Provider,{scope:e.__scopeAccordion,children:"multiple"===o?t.jsx(xu,{...i,ref:n}):t.jsx(gu,{...a,ref:n})})});pu.displayName=au;var[fu,mu]=du(au),[hu,vu]=du(au,{collapsible:!1}),gu=r.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:i=()=>{},collapsible:s=!1,...l}=e,[c,d]=Rd({prop:o,defaultProp:a??"",onChange:i,caller:au});return t.jsx(fu,{scope:e.__scopeAccordion,value:r.useMemo(()=>c?[c]:[],[c]),onItemOpen:d,onItemClose:r.useCallback(()=>s&&d(""),[s,d]),children:t.jsx(hu,{scope:e.__scopeAccordion,collapsible:s,children:t.jsx(wu,{...l,ref:n})})})}),xu=r.forwardRef((e,n)=>{const{value:o,defaultValue:a,onValueChange:i=()=>{},...s}=e,[l,c]=Rd({prop:o,defaultProp:a??[],onChange:i,caller:au}),d=r.useCallback(e=>c((t=[])=>[...t,e]),[c]),u=r.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return t.jsx(fu,{scope:e.__scopeAccordion,value:l,onItemOpen:d,onItemClose:u,children:t.jsx(hu,{scope:e.__scopeAccordion,collapsible:!0,children:t.jsx(wu,{...s,ref:n})})})}),[yu,bu]=du(au),wu=r.forwardRef((e,n)=>{const{__scopeAccordion:o,disabled:a,dir:i,orientation:s="vertical",...l}=e,c=bd(r.useRef(null),n),d=lu(o),u="ltr"===ru(i),p=Md(e.onKeyDown,e=>{if(!iu.includes(e.key))return;const t=e.target,n=d().filter(e=>!e.ref.current?.disabled),o=n.findIndex(e=>e.ref.current===t),r=n.length;if(-1===o)return;e.preventDefault();let a=o;const i=r-1,l=()=>{a=o+1,a>i&&(a=0)},c=()=>{a=o-1,a<0&&(a=i)};switch(e.key){case"Home":a=0;break;case"End":a=i;break;case"ArrowRight":"horizontal"===s&&(u?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(u?c():l());break;case"ArrowUp":"vertical"===s&&c()}const p=a%r;n[p].ref.current?.focus()});return t.jsx(yu,{scope:o,disabled:a,direction:i,orientation:s,children:t.jsx(su.Slot,{scope:o,children:t.jsx(Pd.div,{...l,"data-orientation":s,ref:c,onKeyDown:a?void 0:p})})})}),ku="AccordionItem",[ju,Nu]=du(ku),Cu=r.forwardRef((e,n)=>{const{__scopeAccordion:o,value:r,...a}=e,i=bu(ku,o),s=mu(ku,o),l=uu(o),c=Bd(),d=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return t.jsx(ju,{scope:o,open:d,disabled:u,triggerId:c,children:t.jsx(eu,{"data-orientation":i.orientation,"data-state":Tu(d),...l,...a,ref:n,disabled:u,open:d,onOpenChange:e=>{e?s.onItemOpen(r):s.onItemClose(r)}})})});Cu.displayName=ku;var _u="AccordionHeader",Du=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=bu(au,o),i=Nu(_u,o);return t.jsx(Pd.h3,{"data-orientation":a.orientation,"data-state":Tu(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:n})});Du.displayName=_u;var Su="AccordionTrigger",Eu=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=bu(au,o),i=Nu(Su,o),s=vu(Su,o),l=uu(o);return t.jsx(su.ItemSlot,{scope:o,children:t.jsx(tu,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...r,ref:n})})});Eu.displayName=Su;var Mu="AccordionContent",Ou=r.forwardRef((e,n)=>{const{__scopeAccordion:o,...r}=e,a=bu(au,o),i=Nu(Mu,o),s=uu(o);return t.jsx(nu,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...s,...r,ref:n,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function Tu(e){return e?"open":"closed"}Ou.displayName=Mu;var Ru=Cu,Pu=Du,Au=Eu,Iu=Ou;const Fu=pu,zu=r.forwardRef(({className:e,...n},o)=>t.jsx(Ru,{ref:o,className:Ie("border-b",e),...n}));zu.displayName="AccordionItem";const Lu=r.forwardRef(({className:e,children:n,...o},r)=>t.jsx(Pu,{className:"flex",children:t.jsxs(Au,{ref:r,className:Ie("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...o,children:[n,t.jsx($l,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));Lu.displayName=Au.displayName;const Wu=r.forwardRef(({className:e,children:n,...o},r)=>t.jsx(Iu,{ref:r,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...o,children:t.jsx("div",{className:Ie("pb-4 pt-0",e),children:n})}));function Bu({className:e,...n}){return t.jsx("div",{"data-slot":"empty",className:Ie("flex min-w-0 flex-1 flex-col items-center justify-center gap-6 text-balance rounded-lg border-dashed p-6 text-center md:p-12",e),...n})}function $u({className:e,...n}){return t.jsx("div",{"data-slot":"empty-header",className:Ie("flex max-w-sm flex-col items-center gap-2 text-center",e),...n})}Wu.displayName=Iu.displayName;const Yu=w("mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",icon:"bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function qu({className:e,variant:n="default",...o}){return t.jsx("div",{"data-slot":"empty-icon","data-variant":n,className:Ie(Yu({variant:n,className:e})),...o})}function Hu({className:e,...n}){return t.jsx("div",{"data-slot":"empty-title",className:Ie("text-lg font-medium tracking-tight",e),...n})}function Vu({className:e,...n}){return t.jsx("div",{"data-slot":"empty-description",className:Ie("text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4",e),...n})}function Ku({title:e,description:n}){return t.jsx(Bu,{children:t.jsxs($u,{className:"w-[250px]",children:[t.jsx(qu,{children:t.jsx(Ll,{})}),t.jsx(Hu,{children:e}),t.jsx(Vu,{children:n})]})})}var Uu=.999,Gu=/[\\\/_+.#"@\[\(\{&]/,Zu=/[\\\/_+.#"@\[\(\{&]/g,Xu=/[\s-]/,Qu=/[\s-]/g;function Ju(e,t,n,o,r,a,i){if(a===t.length)return r===e.length?1:.99;var s=`${r},${a}`;if(void 0!==i[s])return i[s];for(var l,c,d,u,p=o.charAt(a),f=n.indexOf(p,r),m=0;f>=0;)(l=Ju(e,t,n,o,f+1,a+1,i))>m&&(f===r?l*=1:Gu.test(e.charAt(f-1))?(l*=.8,(d=e.slice(r,f-1).match(Zu))&&r>0&&(l*=Math.pow(Uu,d.length))):Xu.test(e.charAt(f-1))?(l*=.9,(u=e.slice(r,f-1).match(Qu))&&r>0&&(l*=Math.pow(Uu,u.length))):(l*=.17,r>0&&(l*=Math.pow(Uu,f-r))),e.charAt(f)!==t.charAt(a)&&(l*=.9999)),(l<.1&&n.charAt(f-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&n.charAt(f-1)!==o.charAt(a))&&(.1*(c=Ju(e,t,n,o,f+1,a+2,i))>l&&(l=.1*c)),l>m&&(m=l),f=n.indexOf(p,f+1);return i[s]=m,m}function ep(e){return e.toLowerCase().replace(Qu," ")}function tp(e,t,n){return Ju(e=n&&n.length>0?""+(e+" "+n.join(" ")):e,t,ep(e),ep(t),0,0,{})}var np='[cmdk-group=""]',op='[cmdk-group-items=""]',rp='[cmdk-item=""]',ap=`${rp}:not([aria-disabled="true"])`,ip="cmdk-item-select",sp="data-value",lp=(e,t,n)=>tp(e,t,n),cp=r.createContext(void 0),dp=()=>r.useContext(cp),up=r.createContext(void 0),pp=()=>r.useContext(up),fp=r.createContext(void 0),mp=r.forwardRef((e,t)=>{let n=Sp(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=Sp(()=>new Set),a=Sp(()=>new Map),i=Sp(()=>new Map),s=Sp(()=>new Set),l=_p(e),{label:c,children:d,value:u,onValueChange:p,filter:f,shouldFilter:m,loop:h,disablePointerSelection:v=!1,vimBindings:g=!0,...x}=e,y=In(),b=In(),w=In(),k=r.useRef(null),j=Op();Dp(()=>{if(void 0!==u){let e=u.trim();n.current.value=e,N.emit()}},[u]),Dp(()=>{j(6,M)},[]);let N=r.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,o)=>{var r,a,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)E(),D(),j(1,S);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(r=document.getElementById(y))||r.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=O())?void 0:e.id,N.emit()}),o||j(5,M),void 0!==(null==(a=l.current)?void 0:a.value)){let e=null!=t?t:"";return void(null==(s=(i=l.current).onValueChange)||s.call(i,e))}}N.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),C=r.useMemo(()=>({value:(e,t,o)=>{var r;t!==(null==(r=i.current.get(e))?void 0:r.value)&&(i.current.set(e,{value:t,keywords:o}),n.current.filtered.items.set(e,_(t,o)),j(2,()=>{D(),N.emit()}))},item:(e,t)=>(o.current.add(e),t&&(a.current.has(t)?a.current.get(t).add(e):a.current.set(t,new Set([e]))),j(3,()=>{E(),D(),n.current.value||S(),N.emit()}),()=>{i.current.delete(e),o.current.delete(e),n.current.filtered.items.delete(e);let t=O();j(4,()=>{E(),(null==t?void 0:t.getAttribute("id"))===e&&S(),N.emit()})}),group:e=>(a.current.has(e)||a.current.set(e,new Set),()=>{i.current.delete(e),a.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:y,inputId:w,labelId:b,listInnerRef:k}),[]);function _(e,t){var o,r;let a=null!=(r=null==(o=l.current)?void 0:o.filter)?r:lp;return e?a(e,n.current.search,t):0}function D(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let o=a.current.get(n),r=0;o.forEach(t=>{let n=e.get(t);r=Math.max(n,r)}),t.push([n,r])});let o=k.current;T().sort((t,n)=>{var o,r;let a=t.getAttribute("id"),i=n.getAttribute("id");return(null!=(o=e.get(i))?o:0)-(null!=(r=e.get(a))?r:0)}).forEach(e=>{let t=e.closest(op);t?t.appendChild(e.parentElement===t?e:e.closest(`${op} > *`)):o.appendChild(e.parentElement===o?e:e.closest(`${op} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${np}[${sp}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function S(){let e=T().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(sp);N.setState("value",t||void 0)}function E(){var e,t,r,s;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=o.current.size);n.current.filtered.groups=new Set;let c=0;for(let a of o.current){let o=_(null!=(t=null==(e=i.current.get(a))?void 0:e.value)?t:"",null!=(s=null==(r=i.current.get(a))?void 0:r.keywords)?s:[]);n.current.filtered.items.set(a,o),o>0&&c++}for(let[e,t]of a.current)for(let o of t)if(n.current.filtered.items.get(o)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=c}function M(){var e,t,n;let o=O();o&&((null==(e=o.parentElement)?void 0:e.firstChild)===o&&(null==(n=null==(t=o.closest(np))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),o.scrollIntoView({block:"nearest"}))}function O(){var e;return null==(e=k.current)?void 0:e.querySelector(`${rp}[aria-selected="true"]`)}function T(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(ap))||[])}function R(e){let t=T()[e];t&&N.setState("value",t.getAttribute(sp))}function P(e){var t;let n=O(),o=T(),r=o.findIndex(e=>e===n),a=o[r+e];null!=(t=l.current)&&t.loop&&(a=r+e<0?o[o.length-1]:r+e===o.length?o[0]:o[r+e]),a&&N.setState("value",a.getAttribute(sp))}function A(e){let t,n=O(),o=null==n?void 0:n.closest(np);for(;o&&!t;)o=e>0?Np(o,np):Cp(o,np),t=null==o?void 0:o.querySelector(ap);t?N.setState("value",t.getAttribute(sp)):P(e)}let I=()=>R(T().length-1),F=e=>{e.preventDefault(),e.metaKey?I():e.altKey?A(1):P(1)},z=e=>{e.preventDefault(),e.metaKey?R(0):e.altKey?A(-1):P(-1)};return r.createElement(Yn.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=x.onKeyDown)||t.call(x,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!n)switch(e.key){case"n":case"j":g&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":g&&e.ctrlKey&&z(e);break;case"ArrowUp":z(e);break;case"Home":e.preventDefault(),R(0);break;case"End":e.preventDefault(),I();break;case"Enter":{e.preventDefault();let t=O();if(t){let e=new Event(ip);t.dispatchEvent(e)}}}}},r.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:Rp},c),Tp(e,e=>r.createElement(up.Provider,{value:N},r.createElement(cp.Provider,{value:C},e))))}),hp=r.forwardRef((e,t)=>{var n,o;let a=In(),i=r.useRef(null),l=r.useContext(fp),c=dp(),d=_p(e),u=null!=(o=null==(n=d.current)?void 0:n.forceMount)?o:null==l?void 0:l.forceMount;Dp(()=>{if(!u)return c.item(a,null==l?void 0:l.id)},[u]);let p=Mp(a,i,[e.value,e.children,i],e.keywords),f=pp(),m=Ep(e=>e.value&&e.value===p.current),h=Ep(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(a)>0));function v(){var e,t;g(),null==(t=(e=d.current).onSelect)||t.call(e,p.current)}function g(){f.setState("value",p.current,!0)}if(r.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(ip,v),()=>t.removeEventListener(ip,v)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:x,value:y,onSelect:b,forceMount:w,keywords:k,...j}=e;return r.createElement(Yn.div,{ref:s(i,t),...j,id:a,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!m,"data-disabled":!!x,"data-selected":!!m,onPointerMove:x||c.getDisablePointerSelection()?void 0:g,onClick:x?void 0:v},e.children)}),vp=r.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:a,...i}=e,l=In(),c=r.useRef(null),d=r.useRef(null),u=In(),p=dp(),f=Ep(e=>!(!a&&!1!==p.filter())||(!e.search||e.filtered.groups.has(l)));Dp(()=>p.group(l),[]),Mp(l,c,[e.value,e.heading,d]);let m=r.useMemo(()=>({id:l,forceMount:a}),[a]);return r.createElement(Yn.div,{ref:s(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!f||void 0},n&&r.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),Tp(e,e=>r.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},r.createElement(fp.Provider,{value:m},e))))}),gp=r.forwardRef((e,t)=>{let{alwaysRender:n,...o}=e,a=r.useRef(null),i=Ep(e=>!e.search);return n||i?r.createElement(Yn.div,{ref:s(a,t),...o,"cmdk-separator":"",role:"separator"}):null}),xp=r.forwardRef((e,t)=>{let{onValueChange:n,...o}=e,a=null!=e.value,i=pp(),s=Ep(e=>e.search),l=Ep(e=>e.selectedItemId),c=dp();return r.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),r.createElement(Yn.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:a?e.value:s,onChange:e=>{a||i.setState("search",e.target.value),null==n||n(e.target.value)}})}),yp=r.forwardRef((e,t)=>{let{children:n,label:o="Suggestions",...a}=e,i=r.useRef(null),l=r.useRef(null),c=Ep(e=>e.selectedItemId),d=dp();return r.useEffect(()=>{if(l.current&&i.current){let e,t=l.current,n=i.current,o=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;n.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return o.observe(t),()=>{cancelAnimationFrame(e),o.unobserve(t)}}},[]),r.createElement(Yn.div,{ref:s(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":o,id:d.listId},Tp(e,e=>r.createElement("div",{ref:s(l,d.listInnerRef),"cmdk-list-sizer":""},e)))}),bp=r.forwardRef((e,t)=>{let{open:n,onOpenChange:o,overlayClassName:a,contentClassName:i,container:s,...l}=e;return r.createElement(Br,{open:n,onOpenChange:o},r.createElement(Yr,{container:s},r.createElement(qr,{"cmdk-overlay":"",className:a}),r.createElement(Hr,{"aria-label":e.label,"cmdk-dialog":"",className:i},r.createElement(mp,{ref:t,...l}))))}),wp=r.forwardRef((e,t)=>Ep(e=>0===e.filtered.count)?r.createElement(Yn.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),kp=r.forwardRef((e,t)=>{let{progress:n,children:o,label:a="Loading...",...i}=e;return r.createElement(Yn.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Tp(e,e=>r.createElement("div",{"aria-hidden":!0},e)))}),jp=Object.assign(mp,{List:yp,Item:hp,Input:xp,Group:vp,Separator:gp,Dialog:bp,Empty:wp,Loading:kp});function Np(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Cp(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function _p(e){let t=r.useRef(e);return Dp(()=>{t.current=e}),t}var Dp="undefined"==typeof window?r.useEffect:r.useLayoutEffect;function Sp(e){let t=r.useRef();return void 0===t.current&&(t.current=e()),t}function Ep(e){let t=pp(),n=()=>e(t.snapshot());return r.useSyncExternalStore(t.subscribe,n,n)}function Mp(e,t,n,o=[]){let a=r.useRef(),i=dp();return Dp(()=>{var r;let s=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():a.current}})(),l=o.map(e=>e.trim());i.value(e,s,l),null==(r=t.current)||r.setAttribute(sp,s),a.current=s}),a}var Op=()=>{let[e,t]=r.useState(),n=Sp(()=>new Map);return Dp(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,o)=>{n.current.set(e,o),t({})}};function Tp({asChild:e,children:t},n){return e&&r.isValidElement(t)?r.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var Rp={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Pp=Br,Ap=$r,Ip=({className:e,...n})=>t.jsx(Yr,{...n});Ip.displayName=Yr.displayName;const Fp=r.forwardRef(({className:e,...n},o)=>t.jsx(qr,{ref:o,className:Ie("fixed inset-0 z-50 overlay-dialog data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...n}));Fp.displayName=qr.displayName;const zp=r.forwardRef(({className:e,children:n,showCloseButton:o=!0,...r},a)=>t.jsxs(Ip,{children:[t.jsx(Fp,{}),t.jsxs(Hr,{ref:a,className:Ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-2xl md:w-full",e),...r,children:[n,o&&t.jsxs(Ur,{type:"button",className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(ac,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));zp.displayName=Hr.displayName;const Lp=({className:e,...n})=>t.jsx("div",{className:Ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...n});Lp.displayName="DialogHeader";const Wp=({className:e,...n})=>t.jsx("div",{className:Ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...n});Wp.displayName="DialogFooter";const Bp=r.forwardRef(({className:e,...n},o)=>t.jsx(Vr,{ref:o,className:Ie("text-lg font-semibold leading-none tracking-tight",e),...n}));Bp.displayName=Vr.displayName;const $p=r.forwardRef(({className:e,...n},o)=>t.jsx(Kr,{ref:o,className:Ie("text-sm text-muted-foreground",e),...n}));function Yp({className:e,...n}){return t.jsx(jp,{"data-slot":"command",className:Ie("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...n})}function qp({className:e,...n}){return t.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[t.jsx(oc,{className:"size-4 shrink-0 opacity-50"}),t.jsx(jp.Input,{"data-slot":"command-input",className:Ie("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...n})]})}function Hp({className:e,...n}){return t.jsx(jp.List,{"data-slot":"command-list",className:Ie("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...n})}function Vp({...e}){return t.jsx(jp.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Kp({className:e,...n}){return t.jsx(jp.Group,{"data-slot":"command-group",className:Ie("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...n})}function Up({className:e,...n}){return t.jsx(jp.Item,{"data-slot":"command-item",className:Ie("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n})}function Gp({items:e,value:n,onChange:o,placeholder:a="Select an option...",emptyMessage:i="No items found.",className:s,searchPlaceholder:l="Search...",onSearchChange:c,filterLocally:d=!0,loading:u=!1,displayLabel:p,disabled:f=!1}){const[m,h]=r.useState(!1),[v,g]=r.useState(""),[x,y]=r.useState(null);r.useEffect(()=>{if(!n||""===n)return void y(null);const t=e?.find(e=>String(e.value)===String(n));t&&y(t)},[n,e]);const b=d&&v?e?.filter(e=>e.label.toLowerCase().includes(v.toLowerCase())):e,w=p??x?.label??a,k=!p&&!x;return t.jsxs(xl,{open:m,onOpenChange:h,children:[t.jsx(yl,{asChild:!0,children:t.jsxs("button",{type:"button","data-cy":"combobox-trigger",disabled:f,"aria-expanded":m,className:Ie(We,"justify-between overflow-hidden",k&&Be,s),children:[t.jsx("span",{className:"truncate min-w-0 flex-1 text-left",children:w}),t.jsx(Vl,{className:"ml-2 size-4 shrink-0 opacity-50"})]})}),t.jsx(bl,{className:"max-w-[700px] p-0 w-full min-w-(--radix-popover-trigger-width)",children:t.jsxs(Yp,{shouldFilter:!1,children:[t.jsx(qp,{"data-cy":"combobox-input",placeholder:l,value:v,onValueChange:e=>{g(e),c?.(e)},className:"h-9 focus:ring-0 focus:outline-none focus-visible:ring-0 focus-visible:ring-offset-0"}),t.jsxs(Hp,{"data-cy":"combobox-list",children:[t.jsx(Vp,{children:u?"Loading...":i}),t.jsx(Kp,{children:b?.map(e=>t.jsxs(Up,{value:String(e?.value??""),onSelect:t=>((e,t)=>{const r=e===n?null:t;o(r?.value??"",r),h(!1),g(""),y(r)})(t,e),className:Ie("cursor-pointer",Ye),children:[e.label,t.jsx(Bl,{className:Ie("ml-auto size-4",String(n)===String(e.value)?"opacity-100":"opacity-0")})]},e?.value))})]})]})})]})}$p.displayName=Kr.displayName;const Zp={},Xp=({id:n,fetcher:o,resolveValue:r,modelClass:a,labelName:i,valueField:s="pk",placeholder:l="Select item...",emptyMessage:c="No items found",value:d,onChange:u,additionalFilters:p=Zp,fields:f,className:m,debounceWait:h=300})=>{const v=e.useMemo(()=>p??Zp,[p]),[g,x]=e.useState([]),[y,b]=e.useState(""),[w,k]=e.useState(""),[j,N]=e.useState(!1),[C,_]=e.useState();e.useEffect(()=>{const e=setTimeout(()=>{k(y)},h);return()=>clearTimeout(e)},[y,h]);const D=e.useCallback(async()=>{N(!0);try{const e=await o({search:w,modelClass:a,labelName:i,additionalFilters:v,fields:f});x(((e,t,n)=>Array.isArray(e)?e.map(e=>({value:e[n]??e.id??e.pk,label:String(e[t]??e.name??e.pk??""),...e})):[])(e,i,s))}catch(e){console.error("FKSelect fetch error:",e),x([])}finally{N(!1)}},[o,w,a,i,v,f,s]);e.useEffect(()=>{D()},[D]);const S=g.find(e=>String(e.value)===String(d))?.label;e.useEffect(()=>{if(!d)return void _(void 0);if(S)return void _(S);if(!r)return void _(void 0);let e=!0;return r({modelClass:a,value:d}).then(t=>{if(!e||!t)return;const n=String(t[i]??t.name??d);_(n)}).catch(e=>{console.error("FKSelect resolve error:",e)}),()=>{e=!1}},[d,S,r,a,i]);return t.jsx("div",{"data-testid":n,className:Ie("flex w-full min-w-0",m),children:t.jsx(Gp,{items:g,placeholder:l,emptyMessage:c,value:d?String(d):null,onChange:(e,t)=>{t&&u(e,t)},onSearchChange:b,filterLocally:!1,loading:j,displayLabel:C,className:"w-full"})})};function Qp(e,[t,n]){return Math.min(n,Math.max(t,e))}function Jp(e){const t=r.useRef(e);return r.useEffect(()=>{t.current=e}),r.useMemo(()=>(...e)=>t.current?.(...e),[])}var ef,tf="dismissableLayer.update",nf="dismissableLayer.pointerDownOutside",of="dismissableLayer.focusOutside",rf=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),af=r.forwardRef((e,n)=>{const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...u}=e,p=r.useContext(rf),[f,m]=r.useState(null),h=f?.ownerDocument??globalThis?.document,[,v]=r.useState({}),g=bd(n,e=>m(e)),x=Array.from(p.layers),[y]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),b=x.indexOf(y),w=f?x.indexOf(f):-1,k=p.layersWithOutsidePointerEventsDisabled.size>0,j=w>=b,N=r.useRef(!1),C=function(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:i}=t,s=Jp(e),l=r.useRef(!1),c=r.useRef(!1),d=r.useRef(new Map),u=r.useRef(()=>{});return r.useEffect(()=>{function e(){c.current=!1,a.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function r(e){if(!c.current)return;const t=e.target;t instanceof Node&&[...i].some(e=>e.contains(t))||d.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{c.current&&u.current()},0)}function p(e){c.current&&d.current.set(e.type,!1)}const f=r=>{if(r.target&&!l.current){let i=function(){n.removeEventListener("click",u.current);const o=t();e(),o||lf(nf,s,l,{discrete:!0})};const l={originalEvent:r};c.current=!0,a.current=o&&0===r.button,d.current.clear(),o&&0===r.button?(n.removeEventListener("click",u.current),u.current=i,n.addEventListener("click",u.current,{once:!0})):i()}else n.removeEventListener("click",u.current),e();l.current=!1},m=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const e of m)n.addEventListener(e,r,!0),n.addEventListener(e,p);const h=window.setTimeout(()=>{n.addEventListener("pointerdown",f)},0);return()=>{window.clearTimeout(h),n.removeEventListener("pointerdown",f),n.removeEventListener("click",u.current);for(const e of m)n.removeEventListener(e,r,!0),n.removeEventListener(e,p)}},[n,s,o,a,i]),{onPointerDownCapture:()=>l.current=!0}}(e=>{const t=e.target;if(!(t instanceof Node))return;const n=[...p.branches].some(e=>e.contains(t));j&&!n&&(s?.(e),c?.(e),e.defaultPrevented||d?.())},{ownerDocument:h,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:p.dismissableSurfaces}),_=function(e,t=globalThis?.document){const n=Jp(e),o=r.useRef(!1);return r.useEffect(()=>{const e=e=>{if(e.target&&!o.current){lf(of,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{if(a&&N.current)return;const t=e.target;[...p.branches].some(e=>e.contains(t))||(l?.(e),c?.(e),e.defaultPrevented||d?.())},h);return function(e,t=globalThis?.document){const n=Jp(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{w===p.layers.size-1&&(i?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},h),r.useEffect(()=>{if(f)return o&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(ef=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(f)),p.layers.add(f),sf(),()=>{o&&(p.layersWithOutsidePointerEventsDisabled.delete(f),0===p.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=ef))}},[f,h,o,p]),r.useEffect(()=>()=>{f&&(p.layers.delete(f),p.layersWithOutsidePointerEventsDisabled.delete(f),sf())},[f,p]),r.useEffect(()=>{const e=()=>v({});return document.addEventListener(tf,e),()=>document.removeEventListener(tf,e)},[]),t.jsx(Pd.div,{...u,ref:g,style:{pointerEvents:k?j?"auto":"none":void 0,...e.style},onFocusCapture:Md(e.onFocusCapture,_.onFocusCapture),onBlurCapture:Md(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Md(e.onPointerDownCapture,C.onPointerDownCapture)})});af.displayName="DismissableLayer";function sf(){const e=new CustomEvent(tf);document.dispatchEvent(e)}function lf(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Ad(r,a):r.dispatchEvent(a)}r.forwardRef((e,n)=>{const o=r.useContext(rf),a=r.useRef(null),i=bd(n,a);return r.useEffect(()=>{const e=a.current;if(e)return o.branches.add(e),()=>{o.branches.delete(e)}},[o.branches]),t.jsx(Pd.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var cf=0,df=null;function uf(){r.useEffect(()=>{df||(df={start:pf(),end:pf()});const{start:e,end:t}=df;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),cf++,()=>{1===cf&&(df?.start.remove(),df?.end.remove(),df=null),cf=Math.max(0,cf-1)}},[])}function pf(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ff="focusScope.autoFocusOnMount",mf="focusScope.autoFocusOnUnmount",hf={bubbles:!1,cancelable:!0},vf=r.forwardRef((e,n)=>{const{loop:o=!1,trapped:a=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...l}=e,[c,d]=r.useState(null),u=Jp(i),p=Jp(s),f=r.useRef(null),m=bd(n,e=>d(e)),h=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(a){let e=function(e){if(h.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:bf(f.current,{select:!0})},t=function(e){if(h.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||bf(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&bf(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const o=new MutationObserver(n);return c&&o.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),o.disconnect()}}},[a,c,h.paused]),r.useEffect(()=>{if(c){wf.add(h);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(ff,hf);c.addEventListener(ff,u),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(bf(o,{select:t}),document.activeElement!==n)return}((e=gf(c),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&bf(c))}return()=>{c.removeEventListener(ff,u),setTimeout(()=>{const e=new CustomEvent(mf,hf);c.addEventListener(mf,p),c.dispatchEvent(e),e.defaultPrevented||bf(t??document.body,{select:!0}),c.removeEventListener(mf,p),wf.remove(h)},0)}}var e},[c,u,p,h]);const v=r.useCallback(e=>{if(!o&&!a)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[r,a]=function(e){const t=gf(e),n=xf(t,e),o=xf(t.reverse(),e);return[n,o]}(t);r&&a?e.shiftKey||n!==a?e.shiftKey&&n===r&&(e.preventDefault(),o&&bf(a,{select:!0})):(e.preventDefault(),o&&bf(r,{select:!0})):n===t&&e.preventDefault()}},[o,a,h.paused]);return t.jsx(Pd.div,{tabIndex:-1,...l,ref:m,onKeyDown:v})});function gf(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xf(e,t){for(const n of e)if(!yf(n,{upTo:t}))return n}function yf(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function bf(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}vf.displayName="FocusScope";var wf=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=kf(e,t),e.unshift(t)},remove(t){e=kf(e,t),e[0]?.resume()}}}();function kf(e,t){const n=[...e],o=n.indexOf(t);return-1!==o&&n.splice(o,1),n}var jf=r.forwardRef((e,n)=>{const{children:o,width:r=10,height:a=5,...i}=e;return t.jsx(Pd.svg,{...i,ref:n,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?o:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});jf.displayName="Arrow";var Nf=jf;function Cf(e){const[t,n]=r.useState(void 0);return Od(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const o=t[0];let r,a;if("borderBoxSize"in o){const e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,a=t.blockSize}else r=e.offsetWidth,a=e.offsetHeight;n({width:r,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}var _f="Popper",[Df,Sf]=vd(_f),[Ef,Mf]=Df(_f),Of=e=>{const{__scopePopper:n,children:o}=e,[a,i]=r.useState(null),[s,l]=r.useState(void 0);return t.jsx(Ef,{scope:n,anchor:a,onAnchorChange:i,placementState:s,setPlacementState:l,children:o})};Of.displayName=_f;var Tf="PopperAnchor",Rf=r.forwardRef((e,n)=>{const{__scopePopper:o,virtualRef:a,...i}=e,s=Mf(Tf,o),l=r.useRef(null),c=s.onAnchorChange,d=bd(n,r.useCallback(e=>{l.current=e,e&&c(e)},[c])),u=r.useRef(null);r.useEffect(()=>{if(!a)return;const e=u.current;u.current=a.current,e!==u.current&&c(u.current)});const p=s.placementState&&Yf(s.placementState),f=p?.[0],m=p?.[1];return a?null:t.jsx(Pd.div,{"data-radix-popper-side":f,"data-radix-popper-align":m,...i,ref:d})});Rf.displayName=Tf;var Pf="PopperContent",[Af,If]=Df(Pf),Ff=r.forwardRef((e,n)=>{const{__scopePopper:o,side:a="bottom",sideOffset:i=0,align:s="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:d=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=e,x=Mf(Pf,o),[y,b]=r.useState(null),w=bd(n,e=>b(e)),[k,j]=r.useState(null),N=Cf(k),C=N?.width??0,_=N?.height??0,D=a+("center"!==s?"-"+s:""),S="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},E=Array.isArray(u)?u:[u],M=E.length>0,O={padding:S,boundary:E.filter(Bf),altBoundary:M},{refs:T,floatingStyles:R,placement:P,isPositioned:A,middlewareData:I}=vs({strategy:"fixed",placement:D,whileElementsMounted:(...e)=>ns(...e,{animationFrame:"always"===h}),elements:{reference:x.anchor},middleware:[xs({mainAxis:i+_,alignmentAxis:l}),d&&ys({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?bs():void 0,...O}),d&&ws({...O}),ks({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:o})=>{const{width:r,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${o}px`),i.setProperty("--radix-popper-anchor-width",`${r}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),k&&Ns({element:k,padding:c}),$f({arrowWidth:C,arrowHeight:_}),m&&js({strategy:"referenceHidden",...O,boundary:M?O.boundary:void 0})]}),F=x.setPlacementState;Od(()=>(F(P),()=>{F(void 0)}),[P,F]);const[z,L]=Yf(P),W=Jp(v);Od(()=>{A&&W?.()},[A,W]);const B=I.arrow?.x,$=I.arrow?.y,Y=0!==I.arrow?.centerOffset,[q,H]=r.useState();return Od(()=>{y&&H(window.getComputedStyle(y).zIndex)},[y]),t.jsx("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...R,transform:A?R.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:q,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(" "),...I.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(Af,{scope:o,placedSide:z,placedAlign:L,onArrowChange:j,arrowX:B,arrowY:$,shouldHideArrow:Y,children:t.jsx(Pd.div,{"data-side":z,"data-align":L,...g,ref:w,style:{...g.style,animation:A?void 0:"none"}})})})});Ff.displayName=Pf;var zf="PopperArrow",Lf={top:"bottom",right:"left",bottom:"top",left:"right"},Wf=r.forwardRef(function(e,n){const{__scopePopper:o,...r}=e,a=If(zf,o),i=Lf[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(Nf,{...r,ref:n,style:{...r.style,display:"block"}})})});function Bf(e){return null!==e}Wf.displayName=zf;var $f=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=0!==r.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=Yf(n),d={start:"0%",center:"50%",end:"100%"}[c],u=(r.arrow?.x??0)+i/2,p=(r.arrow?.y??0)+s/2;let f="",m="";return"bottom"===l?(f=a?d:`${u}px`,m=-s+"px"):"top"===l?(f=a?d:`${u}px`,m=`${o.floating.height+s}px`):"right"===l?(f=-s+"px",m=a?d:`${p}px`):"left"===l&&(f=`${o.floating.width+s}px`,m=a?d:`${p}px`),{data:{x:f,y:m}}}});function Yf(e){const[t,n="center"]=e.split("-");return[t,n]}var qf=Of,Hf=Rf,Vf=Ff,Kf=Wf,Uf=r.forwardRef((e,n)=>{const{container:o,...i}=e,[s,l]=r.useState(!1);Od(()=>l(!0),[]);const c=o||s&&globalThis?.document?.body;return c?a.createPortal(t.jsx(Pd.div,{...i,ref:n}),c):null});function Gf(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Uf.displayName="Portal";var Zf=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Xf=r.forwardRef((e,n)=>t.jsx(Pd.span,{...e,ref:n,style:{...Zf,...e.style}}));Xf.displayName="VisuallyHidden";var Qf=Xf,Jf=[" ","Enter","ArrowUp","ArrowDown"],em=[" ","Enter"],tm="Select",[nm,om,rm]=Ed(tm),[am]=vd(tm,[rm,Sf]),im=Sf(),[sm,lm]=am(tm),[cm,dm]=am(tm);function um(e){const{__scopeSelect:n,children:o,open:a,defaultOpen:i,onOpenChange:s,value:l,defaultValue:c,onValueChange:d,dir:u,name:p,autoComplete:f,disabled:m,required:h,form:v,internal_do_not_use_render:g}=e,x=im(n),[y,b]=r.useState(null),[w,k]=r.useState(null),[j,N]=r.useState(!1),C=ru(u),[_,D]=Rd({prop:a,defaultProp:i??!1,onChange:s,caller:tm}),[S,E]=Rd({prop:l,defaultProp:c,onChange:d,caller:tm}),M=r.useRef(null),O=!y||(!!v||!!y.closest("form")),[T,R]=r.useState(new Set),P=Bd(),A=Array.from(T).map(e=>e.props.value).join(";"),I=r.useCallback(e=>{R(t=>new Set(t).add(e))},[]),F=r.useCallback(e=>{R(t=>{const n=new Set(t);return n.delete(e),n})},[]),z={required:h,trigger:y,onTriggerChange:b,valueNode:w,onValueNodeChange:k,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:P,value:S,onValueChange:E,open:_,onOpenChange:D,dir:C,triggerPointerDownPosRef:M,disabled:m,name:p,autoComplete:f,form:v,nativeOptions:T,nativeSelectKey:A,isFormControl:O};return t.jsx(qf,{...x,children:t.jsx(sm,{scope:n,...z,children:t.jsx(nm.Provider,{scope:n,children:t.jsx(cm,{scope:n,onNativeOptionAdd:I,onNativeOptionRemove:F,children:ah(g)?g(z):o})})})})}um.displayName="SelectProvider";var pm=e=>{const{__scopeSelect:n,children:o,...r}=e;return t.jsx(um,{__scopeSelect:n,...r,internal_do_not_use_render:({isFormControl:e})=>t.jsxs(t.Fragment,{children:[o,e?t.jsx(rh,{__scopeSelect:n}):null]})})};pm.displayName=tm;var fm="SelectTrigger",mm=r.forwardRef((e,n)=>{const{__scopeSelect:o,disabled:a=!1,...i}=e,s=im(o),l=lm(fm,o),c=l.disabled||a,d=bd(n,l.onTriggerChange),u=om(o),p=r.useRef("touch"),[f,m,h]=sh(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===l.value),o=lh(t,e,n);void 0!==o&&l.onValueChange(o.value)}),v=e=>{c||(l.onOpenChange(!0),h()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(Hf,{asChild:!0,...s,children:t.jsx(Pd.button,{type:"button",role:"combobox","aria-controls":l.open?l.contentId:void 0,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ih(l.value)?"":void 0,...i,ref:d,onClick:Md(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:Md(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:Md(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),t&&" "===e.key||Jf.includes(e.key)&&(v(),e.preventDefault())})})})});mm.displayName=fm;var hm="SelectValue",vm=r.forwardRef((e,n)=>{const{__scopeSelect:o,className:a,style:i,children:s,placeholder:l="",...c}=e,d=lm(hm,o),{onValueNodeHasChildrenChange:u}=d,p=void 0!==s,f=bd(n,d.onValueNodeChange);Od(()=>{u(p)},[u,p]);const m=ih(d.value);return t.jsx(Pd.span,{...c,asChild:!m&&c.asChild,ref:f,style:{pointerEvents:"none"},children:t.jsx(r.Fragment,{children:m?l:s},m?"placeholder":"value")})});vm.displayName=hm;var gm=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,...a}=e;return t.jsx(Pd.span,{"aria-hidden":!0,...a,ref:n,children:r||"▼"})});gm.displayName="SelectIcon";var xm="SelectPortal",[ym,bm]=am(xm,{forceMount:void 0}),wm=e=>{const{__scopeSelect:n,forceMount:o,...r}=e;return t.jsx(ym,{scope:e.__scopeSelect,forceMount:o,children:t.jsx(Uf,{asChild:!0,...r})})};wm.displayName=xm;var km="SelectContent",jm=r.forwardRef((e,n)=>{const o=bm(km,e.__scopeSelect),{forceMount:a=o.forceMount,...i}=e,s=lm(km,e.__scopeSelect),[l,c]=r.useState();return Od(()=>{c(new DocumentFragment)},[]),t.jsx(Id,{present:a||s.open,children:({present:e})=>e?t.jsx(Em,{...i,ref:n}):t.jsx(Nm,{...i,fragment:l})})});jm.displayName=km;var Nm=r.forwardRef((e,n)=>{const{__scopeSelect:o,children:r,fragment:i}=e;return i?a.createPortal(t.jsx(_m,{scope:o,children:t.jsx(nm.Slot,{scope:o,children:t.jsx("div",{ref:n,children:r})})}),i):null});Nm.displayName="SelectContentFragment";var Cm=10,[_m,Dm]=am(km),Sm=wd("SelectContent.RemoveScroll"),Em=r.forwardRef((e,n)=>{const{__scopeSelect:o}=e,{position:a="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:l,side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:x,...y}=e,b=lm(km,o),[w,k]=r.useState(null),[j,N]=r.useState(null),C=bd(n,e=>k(e)),[_,D]=r.useState(null),[S,E]=r.useState(null),M=om(o),[O,T]=r.useState(!1),R=r.useRef(!1);r.useEffect(()=>{if(w)return sr(w)},[w]),uf();const P=r.useCallback(e=>{const[t,...n]=M().map(e=>e.ref.current),[o]=n.slice(-1),r=document.activeElement;for(const n of e){if(n===r)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&j&&(j.scrollTop=0),n===o&&j&&(j.scrollTop=j.scrollHeight),n?.focus(),document.activeElement!==r)return}},[M,j]),A=r.useCallback(()=>P([_,w]),[P,_,w]);r.useEffect(()=>{O&&A()},[O,A]);const{onOpenChange:I,triggerPointerDownPosRef:F}=b;r.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(w)||I(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,I,F]),r.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[z,L]=sh(e=>{const t=M().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),o=lh(t,e,n);o&&setTimeout(()=>o.ref.current?.focus())}),W=r.useCallback((e,t,n)=>{const o=!R.current&&!n;(void 0!==b.value&&b.value===t||o)&&(D(e),o&&(R.current=!0))},[b.value]),B=r.useCallback(()=>w?.focus(),[w]),$=r.useCallback((e,t,n)=>{const o=!R.current&&!n;(void 0!==b.value&&b.value===t||o)&&E(e)},[b.value]),Y="popper"===a?Om:Mm,q=Y===Om?{side:c,sideOffset:d,align:u,alignOffset:p,arrowPadding:f,collisionBoundary:m,collisionPadding:h,sticky:v,hideWhenDetached:g,avoidCollisions:x}:{};return t.jsx(_m,{scope:o,content:w,viewport:j,onViewportChange:N,itemRefCallback:W,selectedItem:_,onItemLeave:B,itemTextRefCallback:$,focusSelectedItem:A,selectedItemText:S,position:a,isPositioned:O,searchRef:z,children:t.jsx(er,{as:Sm,allowPinchZoom:!0,children:t.jsx(vf,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Md(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(af,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx(Y,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...y,...q,onPlaced:()=>T(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Md(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||L(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,o=t.indexOf(n);t=t.slice(o+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})});Em.displayName="SelectContentImpl";var Mm=r.forwardRef((e,n)=>{const{__scopeSelect:o,onPlaced:a,...i}=e,s=lm(km,o),l=Dm(km,o),[c,d]=r.useState(null),[u,p]=r.useState(null),f=bd(n,e=>p(e)),m=om(o),h=r.useRef(!1),v=r.useRef(!0),{viewport:g,selectedItem:x,selectedItemText:y,focusSelectedItem:b}=l,w=r.useCallback(()=>{if(s.trigger&&s.valueNode&&c&&u&&g&&x&&y){const e=s.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=s.valueNode.getBoundingClientRect(),o=y.getBoundingClientRect();if("rtl"!==s.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-Cm,u=Qp(a,[Cm,Math.max(Cm,d-l)]);c.style.minWidth=s+"px",c.style.left=u+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),d=window.innerWidth-Cm,u=Qp(a,[Cm,Math.max(Cm,d-l)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const r=m(),i=window.innerHeight-2*Cm,l=g.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),f=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),b=p+f+l+parseInt(d.paddingBottom,10)+v,w=Math.min(5*x.offsetHeight,b),k=window.getComputedStyle(g),j=parseInt(k.paddingTop,10),N=parseInt(k.paddingBottom,10),C=e.top+e.height/2-Cm,_=i-C,D=x.offsetHeight/2,S=p+f+(x.offsetTop+D),E=b-S;if(S<=C){const e=r.length>0&&x===r[r.length-1].ref.current;c.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=S+Math.max(_,D+(e?N:0)+t+v);c.style.height=n+"px"}else{const e=r.length>0&&x===r[0].ref.current;c.style.top="0px";const t=Math.max(C,p+g.offsetTop+(e?j:0)+D)+E;c.style.height=t+"px",g.scrollTop=S-C+g.offsetTop}c.style.margin=`${Cm}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=i+"px",a?.(),requestAnimationFrame(()=>h.current=!0)}},[m,s.trigger,s.valueNode,c,u,g,x,y,s.dir,a]);Od(()=>w(),[w]);const[k,j]=r.useState();Od(()=>{u&&j(window.getComputedStyle(u).zIndex)},[u]);const N=r.useCallback(e=>{e&&!0===v.current&&(w(),b?.(),v.current=!1)},[w,b]);return t.jsx(Tm,{scope:o,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N,children:t.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:t.jsx(Pd.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Mm.displayName="SelectItemAlignedPosition";var Om=r.forwardRef((e,n)=>{const{__scopeSelect:o,align:r="start",collisionPadding:a=Cm,...i}=e,s=im(o);return t.jsx(Vf,{...s,...i,ref:n,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Om.displayName="SelectPopperPosition";var[Tm,Rm]=am(km,{}),Pm="SelectViewport",Am=r.forwardRef((e,n)=>{const{__scopeSelect:o,nonce:a,...i}=e,s=Dm(Pm,o),l=Rm(Pm,o),c=bd(n,s.onViewportChange),d=r.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),t.jsx(nm.Slot,{scope:o,children:t.jsx(Pd.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Md(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:o}=l;if(o?.current&&n){const e=Math.abs(d.current-t.scrollTop);if(e>0){const o=window.innerHeight-2*Cm,r=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(r,a);if(i<o){const r=i+e,a=Math.min(o,r),s=r-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}d.current=t.scrollTop})})})]})});Am.displayName=Pm;var Im="SelectGroup",[Fm,zm]=am(Im),Lm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=Bd();return t.jsx(Fm,{scope:o,id:a,children:t.jsx(Pd.div,{role:"group","aria-labelledby":a,...r,ref:n})})});Lm.displayName=Im;var Wm="SelectLabel",Bm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=zm(Wm,o);return t.jsx(Pd.div,{id:a.id,...r,ref:n})});Bm.displayName=Wm;var $m="SelectItem",[Ym,qm]=am($m),Hm=r.forwardRef((e,n)=>{const{__scopeSelect:o,value:a,disabled:i=!1,textValue:s,...l}=e,c=lm($m,o),d=Dm($m,o),u=c.value===a,[p,f]=r.useState(s??""),[m,h]=r.useState(!1),v=bd(n,e=>d.itemRefCallback?.(e,a,i)),g=Bd(),x=r.useRef("touch"),y=()=>{i||(c.onValueChange(a),c.onOpenChange(!1))};return t.jsx(Ym,{scope:o,value:a,disabled:i,textId:g,isSelected:u,onItemTextChange:r.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:t.jsx(nm.ItemSlot,{scope:o,value:a,disabled:i,textValue:p,children:t.jsx(Pd.div,{role:"option","aria-labelledby":g,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...l,ref:v,onFocus:Md(l.onFocus,()=>h(!0)),onBlur:Md(l.onBlur,()=>h(!1)),onClick:Md(l.onClick,()=>{"mouse"!==x.current&&y()}),onPointerUp:Md(l.onPointerUp,()=>{"mouse"===x.current&&y()}),onPointerDown:Md(l.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:Md(l.onPointerMove,e=>{x.current=e.pointerType,i?d.onItemLeave?.():"mouse"===x.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Md(l.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Md(l.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(em.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});Hm.displayName=$m;var Vm="SelectItemText",Km=r.forwardRef((e,n)=>{const{__scopeSelect:o,className:i,style:s,...l}=e,c=lm(Vm,o),d=Dm(Vm,o),u=qm(Vm,o),p=dm(Vm,o),[f,m]=r.useState(null),h=bd(n,e=>m(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),v=f?.textContent,g=r.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:x,onNativeOptionRemove:y}=p;return Od(()=>(x(g),()=>y(g)),[x,y,g]),t.jsxs(t.Fragment,{children:[t.jsx(Pd.span,{id:u.textId,...l,ref:h}),u.isSelected&&c.valueNode&&!c.valueNodeHasChildren&&!ih(c.value)?a.createPortal(l.children,c.valueNode):null]})});Km.displayName=Vm;var Um="SelectItemIndicator",Gm=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return qm(Um,o).isSelected?t.jsx(Pd.span,{"aria-hidden":!0,...r,ref:n}):null});Gm.displayName=Um;var Zm="SelectScrollUpButton",Xm=r.forwardRef((e,n)=>{const o=Dm(Zm,e.__scopeSelect),a=Rm(Zm,e.__scopeSelect),[i,s]=r.useState(!1),l=bd(n,a.onScrollButtonChange);return Od(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollTop>0;s(e)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t.jsx(eh,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Xm.displayName=Zm;var Qm="SelectScrollDownButton",Jm=r.forwardRef((e,n)=>{const o=Dm(Qm,e.__scopeSelect),a=Rm(Qm,e.__scopeSelect),[i,s]=r.useState(!1),l=bd(n,a.onScrollButtonChange);return Od(()=>{if(o.viewport&&o.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;s(n)};const t=o.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[o.viewport,o.isPositioned]),i?t.jsx(eh,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=o;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Jm.displayName=Qm;var eh=r.forwardRef((e,n)=>{const{__scopeSelect:o,onAutoScroll:a,...i}=e,s=Dm("SelectScrollButton",o),l=r.useRef(null),c=om(o),d=r.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return r.useEffect(()=>()=>d(),[d]),Od(()=>{const e=c().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[c]),t.jsx(Pd.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:Md(i.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(a,50))}),onPointerMove:Md(i.onPointerMove,()=>{s.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(a,50))}),onPointerLeave:Md(i.onPointerLeave,()=>{d()})})}),th=r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e;return t.jsx(Pd.div,{"aria-hidden":!0,...r,ref:n})});th.displayName="SelectSeparator";var nh="SelectArrow";r.forwardRef((e,n)=>{const{__scopeSelect:o,...r}=e,a=im(o);return"popper"===Dm(nh,o).position?t.jsx(Kf,{...a,...r,ref:n}):null}).displayName=nh;var oh="SelectBubbleInput",rh=r.forwardRef(({__scopeSelect:e,...n},o)=>{const a=lm(oh,e),{value:i,onValueChange:s,required:l,disabled:c,name:d,autoComplete:u,form:p}=a,{nativeOptions:f,nativeSelectKey:m}=a,h=r.useRef(null),v=bd(o,h),g=i??"",x=Gf(g),y=Array.from(f).some(e=>""===(e.props.value??""));return r.useEffect(()=>{const e=h.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(x!==g&&n){const t=new Event("change",{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[x,g]),t.jsxs(Pd.select,{"aria-hidden":!0,required:l,tabIndex:-1,name:d,autoComplete:u,disabled:c,form:p,onChange:e=>s(e.target.value),...n,style:{...Zf,...n.style},ref:v,defaultValue:g,children:[ih(i)&&!y?t.jsx("option",{value:""}):null,Array.from(f)]},m)});function ah(e){return"function"==typeof e}function ih(e){return""===e||void 0===e}function sh(e){const t=Jp(e),n=r.useRef(""),o=r.useRef(0),a=r.useCallback(e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(r)},[t]),i=r.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return r.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,a,i]}function lh(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,r=n?e.indexOf(n):-1;let a=(i=e,s=Math.max(r,0),i.map((e,t)=>i[(s+t)%i.length]));var i,s;1===o.length&&(a=a.filter(e=>e!==n));const l=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}rh.displayName=oh;const ch=pm,dh=Lm,uh=vm,ph=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(mm,{ref:r,"data-slot":"select-trigger",className:Ie(We,"justify-between whitespace-nowrap data-[placeholder]:text-muted-foreground [&>span]:line-clamp-1",e),...o,children:[n,t.jsx(gm,{asChild:!0,children:t.jsx($l,{className:"h-4 w-4 opacity-50"})})]}));ph.displayName=mm.displayName;const fh=r.forwardRef(({className:e,...n},o)=>t.jsx(Xm,{ref:o,"data-slot":"select-scroll-up-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(Hl,{className:"h-4 w-4"})}));fh.displayName=Xm.displayName;const mh=r.forwardRef(({className:e,...n},o)=>t.jsx(Jm,{ref:o,"data-slot":"select-scroll-down-button",className:Ie("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx($l,{className:"h-4 w-4"})}));mh.displayName=Jm.displayName;const hh=r.forwardRef(({className:e,children:n,position:o="popper",...r},a)=>t.jsx(wm,{children:t.jsxs(jm,{ref:a,"data-slot":"select-content",className:Ie("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:[t.jsx(fh,{}),t.jsx(Am,{className:Ie("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(mh,{})]})}));hh.displayName=jm.displayName;const vh=r.forwardRef(({className:e,...n},o)=>t.jsx(Bm,{ref:o,"data-slot":"select-label",className:Ie("px-2 py-1.5 text-sm font-semibold",e),...n}));vh.displayName=Bm.displayName;const gh=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(Hm,{ref:r,"data-slot":"select-item",className:Ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Gm,{children:t.jsx(Bl,{className:"h-4 w-4"})})}),t.jsx(Km,{children:n})]}));gh.displayName=Hm.displayName;const xh=r.forwardRef(({className:e,...n},o)=>t.jsx(th,{ref:o,"data-slot":"select-separator",className:Ie("-mx-1 my-1 h-px bg-muted",e),...n}));xh.displayName=th.displayName;const yh=({id:n,placeholder:o,options:r,className:a,value:i,onValueChange:s,required:l,name:c})=>{const[d,u]=e.useState(i||"");e.useEffect(()=>{u(i||"")},[i]);const p=i??d;return t.jsxs(t.Fragment,{children:[c?t.jsx("input",{type:"hidden",name:c,value:p,required:l}):null,t.jsx("div",{className:Ie("flex w-full min-w-0",a),children:t.jsxs(ch,{value:p||void 0,onValueChange:e=>{u(e),s?.(e)},children:[t.jsx(ph,{"data-testid":n,className:"w-full",children:t.jsx(uh,{placeholder:o})}),t.jsx(hh,{children:(r??[]).map(e=>t.jsx(gh,{"data-testid":e.value,value:e.value,className:Ie("cursor-pointer",Ye,d===e.value?"bg-accent text-accent-foreground":""),children:e.label},e.value))})]})})]})},bh=6048e5,wh=Symbol.for("constructDateFrom");function kh(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&wh in e?e[wh](t):e instanceof Date?new e.constructor(t):new Date(t)}function jh(e,t){return kh(t||e,e)}function Nh(e,t,n){const o=jh(e,n?.in);return isNaN(t)?kh(e,NaN):t?(o.setDate(o.getDate()+t),o):o}function Ch(e,t,n){const o=jh(e,n?.in);if(isNaN(t))return kh(e,NaN);if(!t)return o;const r=o.getDate(),a=kh(e,o.getTime());a.setMonth(o.getMonth()+t+1,0);return r>=a.getDate()?a:(o.setFullYear(a.getFullYear(),a.getMonth(),r),o)}let _h={};function Dh(){return _h}function Sh(e,t){const n=Dh(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=jh(e,t?.in),a=r.getDay(),i=(a<o?7:0)+a-o;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Eh(e,t){return Sh(e,{...t,weekStartsOn:1})}function Mh(e,t){const n=jh(e,t?.in),o=n.getFullYear(),r=kh(n,0);r.setFullYear(o+1,0,4),r.setHours(0,0,0,0);const a=Eh(r),i=kh(n,0);i.setFullYear(o,0,4),i.setHours(0,0,0,0);const s=Eh(i);return n.getTime()>=a.getTime()?o+1:n.getTime()>=s.getTime()?o:o-1}function Oh(e){const t=jh(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Th(e,...t){const n=kh.bind(null,t.find(e=>"object"==typeof e));return t.map(n)}function Rh(e,t){const n=jh(e,t?.in);return n.setHours(0,0,0,0),n}function Ph(e,t,n){const[o,r]=Th(0,e,t),a=Rh(o),i=Rh(r),s=+a-Oh(a),l=+i-Oh(i);return Math.round((s-l)/864e5)}function Ah(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function Ih(e,t,n){const[o,r]=Th(0,e,t);return 12*(o.getFullYear()-r.getFullYear())+(o.getMonth()-r.getMonth())}function Fh(e,t){const n=jh(e,t?.in);return n.setHours(23,59,59,999),n}function zh(e,t){const[n,o]=Th(0,t.start,t.end);return{start:n,end:o}}function Lh(e,t){const n=jh(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Wh(e,t){const n=Dh(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=jh(e,t?.in),a=r.getDay(),i=6+(a<o?-7:0)-(a-o);return r.setDate(r.getDate()+i),r.setHours(23,59,59,999),r}const Bh={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function $h(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Yh={date:$h({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$h({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$h({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},qh={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Hh(e){return(t,n)=>{let o;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;o=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;o=e.values[r]||e.values[t]}return o[e.argumentCallback?e.argumentCallback(t):t]}}const Vh={ordinalNumber:(e,t)=>{const n=Number(e),o=n%100;if(o>20||o<10)switch(o%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Hh({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Hh({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:Hh({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Hh({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Hh({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function Kh(e){return(t,n={})=>{const o=n.width,r=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const i=a[0],s=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,e=>e.test(i)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,e=>e.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(i.length)}}}const Uh={ordinalNumber:(Gh={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(Gh.matchPattern);if(!n)return null;const o=n[0],r=e.match(Gh.parsePattern);if(!r)return null;let a=Gh.valueCallback?Gh.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(o.length)}}),era:Kh({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Kh({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Kh({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Kh({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Kh({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var Gh;const Zh={code:"en-US",formatDistance:(e,t,n)=>{let o;const r=Bh[e];return o="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+o:o+" ago":o},formatLong:Yh,formatRelative:(e,t,n,o)=>qh[e],localize:Vh,match:Uh,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Xh(e,t){const n=jh(e,t?.in),o=+Eh(n)-+function(e,t){const n=Mh(e,t),o=kh(e,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),Eh(o)}(n);return Math.round(o/bh)+1}function Qh(e,t){const n=jh(e,t?.in),o=n.getFullYear(),r=Dh(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=kh(t?.in||e,0);i.setFullYear(o+1,0,a),i.setHours(0,0,0,0);const s=Sh(i,t),l=kh(t?.in||e,0);l.setFullYear(o,0,a),l.setHours(0,0,0,0);const c=Sh(l,t);return+n>=+s?o+1:+n>=+c?o:o-1}function Jh(e,t){const n=jh(e,t?.in),o=+Sh(n,t)-+function(e,t){const n=Dh(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Qh(e,t),a=kh(t?.in||e,0);return a.setFullYear(r,0,o),a.setHours(0,0,0,0),Sh(a,t)}(n,t);return Math.round(o/bh)+1}function ev(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const tv={y(e,t){const n=e.getFullYear(),o=n>0?n:1-n;return ev("yy"===t?o%100:o,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):ev(n+1,2)},d:(e,t)=>ev(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>ev(e.getHours()%12||12,t.length),H:(e,t)=>ev(e.getHours(),t.length),m:(e,t)=>ev(e.getMinutes(),t.length),s:(e,t)=>ev(e.getSeconds(),t.length),S(e,t){const n=t.length,o=e.getMilliseconds();return ev(Math.trunc(o*Math.pow(10,n-3)),t.length)}},nv="midnight",ov="noon",rv="morning",av="afternoon",iv="evening",sv="night",lv={G:function(e,t,n){const o=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(o,{width:"abbreviated"});case"GGGGG":return n.era(o,{width:"narrow"});default:return n.era(o,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),o=t>0?t:1-t;return n.ordinalNumber(o,{unit:"year"})}return tv.y(e,t)},Y:function(e,t,n,o){const r=Qh(e,o),a=r>0?r:1-r;if("YY"===t){return ev(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):ev(a,t.length)},R:function(e,t){return ev(Mh(e),t.length)},u:function(e,t){return ev(e.getFullYear(),t.length)},Q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return ev(o,2);case"Qo":return n.ordinalNumber(o,{unit:"quarter"});case"QQQ":return n.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(o,{width:"narrow",context:"formatting"});default:return n.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,n){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return ev(o,2);case"qo":return n.ordinalNumber(o,{unit:"quarter"});case"qqq":return n.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(o,{width:"narrow",context:"standalone"});default:return n.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,n){const o=e.getMonth();switch(t){case"M":case"MM":return tv.M(e,t);case"Mo":return n.ordinalNumber(o+1,{unit:"month"});case"MMM":return n.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(o,{width:"narrow",context:"formatting"});default:return n.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,n){const o=e.getMonth();switch(t){case"L":return String(o+1);case"LL":return ev(o+1,2);case"Lo":return n.ordinalNumber(o+1,{unit:"month"});case"LLL":return n.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(o,{width:"narrow",context:"standalone"});default:return n.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,n,o){const r=Jh(e,o);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):ev(r,t.length)},I:function(e,t,n){const o=Xh(e);return"Io"===t?n.ordinalNumber(o,{unit:"week"}):ev(o,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):tv.d(e,t)},D:function(e,t,n){const o=function(e,t){const n=jh(e,t?.in);return Ph(n,Lh(n))+1}(e);return"Do"===t?n.ordinalNumber(o,{unit:"dayOfYear"}):ev(o,t.length)},E:function(e,t,n){const o=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,n,o){const r=e.getDay(),a=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return ev(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,o){const r=e.getDay(),a=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return ev(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const o=e.getDay(),r=0===o?7:o;switch(t){case"i":return String(r);case"ii":return ev(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const o=e.getHours();let r;switch(r=12===o?ov:0===o?nv:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const o=e.getHours();let r;switch(r=o>=17?iv:o>=12?av:o>=4?rv:sv,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return tv.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):tv.H(e,t)},K:function(e,t,n){const o=e.getHours()%12;return"Ko"===t?n.ordinalNumber(o,{unit:"hour"}):ev(o,t.length)},k:function(e,t,n){let o=e.getHours();return 0===o&&(o=24),"ko"===t?n.ordinalNumber(o,{unit:"hour"}):ev(o,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):tv.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):tv.s(e,t)},S:function(e,t){return tv.S(e,t)},X:function(e,t,n){const o=e.getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return dv(o);case"XXXX":case"XX":return uv(o);default:return uv(o,":")}},x:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"x":return dv(o);case"xxxx":case"xx":return uv(o);default:return uv(o,":")}},O:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+cv(o,":");default:return"GMT"+uv(o,":")}},z:function(e,t,n){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+cv(o,":");default:return"GMT"+uv(o,":")}},t:function(e,t,n){return ev(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return ev(+e,t.length)}};function cv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e),r=Math.trunc(o/60),a=o%60;return 0===a?n+String(r):n+String(r)+t+ev(a,2)}function dv(e,t){if(e%60==0){return(e>0?"-":"+")+ev(Math.abs(e)/60,2)}return uv(e,t)}function uv(e,t=""){const n=e>0?"-":"+",o=Math.abs(e);return n+ev(Math.trunc(o/60),2)+t+ev(o%60,2)}const pv=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},fv=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},mv={p:fv,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],o=n[1],r=n[2];if(!r)return pv(e,t);let a;switch(o){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",pv(o,t)).replace("{{time}}",fv(r,t))}},hv=/^D+$/,vv=/^Y+$/,gv=["D","DD","YY","YYYY"];const xv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,yv=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bv=/^'([^]*?)'?$/,wv=/''/g,kv=/[a-zA-Z]/;function jv(e,t,n){const o=Dh(),r=n?.locale??o.locale??Zh,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,s=jh(e,n?.in);if(!function(e){return!(!Ah(e)&&"number"!=typeof e||isNaN(+jh(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(yv).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,mv[t])(e,r.formatLong)}return e}).join("").match(xv).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:Nv(e)};if(lv[t])return{isToken:!0,value:e};if(t.match(kv))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(l=r.localize.preprocessor(s,l));const c={firstWeekContainsDate:a,weekStartsOn:i,locale:r};return l.map(o=>{if(!o.isToken)return o.value;const a=o.value;(!n?.useAdditionalWeekYearTokens&&function(e){return vv.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return hv.test(e)}(a))&&function(e,t,n){const o=function(e,t,n){const o="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(o),gv.includes(e))throw new RangeError(o)}(a,t,String(e));return(0,lv[a[0]])(s,a,r.localize,c)}).join("")}function Nv(e){const t=e.match(bv);return t?t[1].replace(wv,"'"):e}function Cv(e,t,n){const o=jh(e,n?.in),r=o.getFullYear(),a=o.getDate(),i=kh(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=jh(e,t?.in),o=n.getFullYear(),r=n.getMonth(),a=kh(n,0);return a.setFullYear(o,r+1,0),a.setHours(0,0,0,0),a.getDate()}(i);return o.setMonth(t,Math.min(a,s)),o}const _v={},Dv={};function Sv(e,t){try{const n=(_v[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in Dv?Dv[n]:Mv(n,n.split(":"))}catch{if(e in Dv)return Dv[e];const t=e?.match(Ev);return t?Mv(e,t.slice(1)):NaN}}const Ev=/([+-]\d\d):?(\d\d)?/;function Mv(e,t){const n=+(t[0]||0),o=+(t[1]||0),r=+(t[2]||0)/60;return Dv[e]=60*n+o>0?60*n+o+r:60*n-o-r}class Ov extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Sv(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),Pv(this),Rv(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new Ov(...t,e):new Ov(Date.now(),e)}withTimeZone(e){return new Ov(+this,e)}getTimezoneOffset(){const e=-Sv(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Rv(this),+this}[Symbol.for("constructDateFrom")](e){return new Ov(+new Date(e),this.timeZone)}}const Tv=/^(get|set)(?!UTC)/;function Rv(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-Sv(e.timeZone,e)))}function Pv(e){const t=Sv(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),o=new Date(+e);o.setUTCHours(o.getUTCHours()-1);const r=-new Date(+e).getTimezoneOffset(),a=r- -new Date(+o).getTimezoneOffset(),i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);const s=r-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const l=new Date(+e);l.setUTCSeconds(0);const c=r>0?l.getSeconds():(l.getSeconds()-60)%60,d=Math.round(-60*Sv(e.timeZone,e))%60;(d||c)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+d),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+d+c));const u=Sv(e.timeZone,e),p=u>0?Math.floor(u):Math.ceil(u),f=-new Date(+e).getTimezoneOffset()-p-s;if(p!==n&&f){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+f);const t=Sv(e.timeZone,e),n=p-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Tv.test(e))return;const t=e.replace(Tv,"$1UTC");Ov.prototype[t]&&(e.startsWith("get")?Ov.prototype[e]=function(){return this.internal[t]()}:(Ov.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Pv(e),+this},Ov.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),Rv(this),+this}))});class Av extends Ov{static tz(e,...t){return t.length?new Av(...t,e):new Av(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),o=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,o]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${o}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,o]=this.tzComponents();return`${e} GMT${t}${n}${o} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new Av(+this,e)}[Symbol.for("constructDateFrom")](e){return new Av(+new Date(e),this.timeZone)}}function Iv(e,t){const n=t.startOfMonth(e),o=n.getDay();return 1===o?n:0===o?t.addDays(n,-6):t.addDays(n,-1*(o-1))}const Fv={...Zh,labels:{labelDayButton:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>jv(e,t,{locale:Zh,...n});let a=r(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let o;return o=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>jv(e,n,{locale:Zh,...t}),o(e,"LLLL yyyy")},labelGridcell:(e,t,n,o)=>{let r;r=o&&"function"==typeof o.format?o.format.bind(o):(e,t)=>jv(e,t,{locale:Zh,...n});let a=r(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let o;return o=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>jv(e,n,{locale:Zh,...t}),o(e,"cccc")}}};class zv{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Av.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new Av(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):Nh(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Ch(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return Nh(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return Ch(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):Ph(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):Ih(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e){const{start:t,end:n}=zh(0,e);let o=+t>+n;const r=o?+t:+n,a=o?n:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=r;)i.push(kh(t,a)),a.setMonth(a.getMonth()+1);return o?i.reverse():i}(e),this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):function(e){const{start:t,end:n}=zh(0,e);let o=+t>+n;const r=o?+t:+n,a=o?n:t;a.setHours(0,0,0,0),a.setMonth(0,1);const i=[];for(;+a<=r;)i.push(kh(t,a)),a.setFullYear(a.getFullYear()+1);return o?i.reverse():i}(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;const o=[];return n.forEach(e=>{o.push(new Date(e,0,1))}),o},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):function(e,t){const n=Iv(e,t),o=function(e,t){const n=t.startOfMonth(e),o=n.getDay()>0?n.getDay():7,r=t.addDays(e,1-o),a=t.addDays(r,34);return t.getMonth(e)===t.getMonth(a)?5:4}(e,t);return t.addDays(n,7*o-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return Wh(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):function(e,t){const n=jh(e,t?.in),o=n.getMonth();return n.setFullYear(n.getFullYear(),o+1,0),n.setHours(23,59,59,999),n}(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):Wh(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=jh(e,t?.in),o=n.getFullYear();return n.setFullYear(o+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t,n)=>{const o=this.overrides?.format?this.overrides.format(e,t,this.options):jv(e,t,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(o):o},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):Xh(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return jh(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return jh(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):Jh(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):function(e,t){return+jh(e)>+jh(t)}(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):function(e,t){return+jh(e)<+jh(t)}(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):Ah(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t){const[n,o]=Th(0,e,t);return+Rh(n)===+Rh(o)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t){const[n,o]=Th(0,e,t);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t){const[n,o]=Th(0,e,t);return n.getFullYear()===o.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,o=t?.in;return e.forEach(e=>{o||"object"!=typeof e||(o=kh.bind(null,e));const t=jh(e,o);(!n||n<t||isNaN(+t))&&(n=t)}),kh(o,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,o=t?.in;return e.forEach(e=>{o||"object"!=typeof e||(o=kh.bind(null,e));const t=jh(e,o);(!n||n>t||isNaN(+t))&&(n=t)}),kh(o,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):Cv(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const o=jh(e,n?.in);return isNaN(+o)?kh(e,NaN):(o.setFullYear(t),o)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):Iv(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Rh(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):Eh(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):function(e,t){const n=jh(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):Sh(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):Lh(e),this.options={locale:Fv,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&zv.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:o}=this.options,r=t?.code;if(r&&zv.yearFirstLocales.has(r))try{const t=new Intl.DateTimeFormat(r,{month:"long",year:"numeric",timeZone:n,numberingSystem:o});return t.format(e)}catch{}const a="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(e,a)}}zv.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Lv=new zv;class Wv{constructor(e,t,n=Lv){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,"yyyy-MM-dd"),this.displayMonthId=n.format(t,"yyyy-MM"),this.dateMonthId=n.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class Bv{constructor(e,t){this.date=e,this.weeks=t}}class $v{constructor(e,t){this.days=t,this.weekNumber=e}}var Yv,qv,Hv,Vv;!function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(Yv||(Yv={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(qv||(qv={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(Hv||(Hv={})),function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"}(Vv||(Vv={}));const Kv=e.createContext(void 0);function Uv(){const t=e.useContext(Kv);if(void 0===t)throw new Error("useDayPicker() must be used within a custom component.");return t}var Gv=Object.freeze({__proto__:null,Button:function(t){return e.createElement("button",{...t})},CaptionLabel:function(t){return e.createElement("span",{...t})},Chevron:function(t){const{size:n=24,orientation:o="left",className:r}=t;return e.createElement("svg",{className:r,width:n,height:n,viewBox:"0 0 24 24"},"up"===o&&e.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===o&&e.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===o&&e.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===o&&e.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))},Day:function(t){const{day:n,modifiers:o,...r}=t;return e.createElement("td",{...r})},DayButton:function(t){const{day:n,modifiers:o,...r}=t,a=e.useRef(null);return e.useEffect(()=>{o.focused&&a.current?.focus()},[o.focused]),e.createElement("button",{ref:a,...r})},Dropdown:function(t){const{options:n,className:o,components:r,classNames:a,...i}=t,s=[a[Yv.Dropdown],o].join(" "),l=n?.find(({value:e})=>e===i.value);return e.createElement("span",{"data-disabled":i.disabled,className:a[Yv.DropdownRoot]},e.createElement(r.Select,{className:s,...i},n?.map(({value:t,label:n,disabled:o})=>e.createElement(r.Option,{key:t,value:t,disabled:o},n))),e.createElement("span",{className:a[Yv.CaptionLabel],"aria-hidden":!0},l?.label,e.createElement(r.Chevron,{orientation:"down",size:18,className:a[Yv.Chevron]})))},DropdownNav:function(t){return e.createElement("div",{...t})},Footer:function(t){return e.createElement("div",{...t})},Month:function(t){const{calendarMonth:n,displayIndex:o,...r}=t;return e.createElement("div",{...r},t.children)},MonthCaption:function(t){const{calendarMonth:n,displayIndex:o,...r}=t;return e.createElement("div",{...r})},MonthGrid:function(t){return e.createElement("table",{...t})},Months:function(t){return e.createElement("div",{...t})},MonthsDropdown:function(t){const{components:n}=Uv();return e.createElement(n.Dropdown,{...t})},Nav:function(t){const{onPreviousClick:n,onNextClick:o,previousMonth:r,nextMonth:a,...i}=t,{components:s,classNames:l,labels:{labelPrevious:c,labelNext:d}}=Uv(),u=e.useCallback(e=>{a&&o?.(e)},[a,o]),p=e.useCallback(e=>{r&&n?.(e)},[r,n]);return e.createElement("nav",{...i},e.createElement(s.PreviousMonthButton,{type:"button",className:l[Yv.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":c(r),onClick:p},e.createElement(s.Chevron,{disabled:!r||void 0,className:l[Yv.Chevron],orientation:"left"})),e.createElement(s.NextMonthButton,{type:"button",className:l[Yv.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":!a||void 0,"aria-label":d(a),onClick:u},e.createElement(s.Chevron,{disabled:!a||void 0,orientation:"right",className:l[Yv.Chevron]})))},NextMonthButton:function(t){const{components:n}=Uv();return e.createElement(n.Button,{...t})},Option:function(t){return e.createElement("option",{...t})},PreviousMonthButton:function(t){const{components:n}=Uv();return e.createElement(n.Button,{...t})},Root:function(t){const{rootRef:n,...o}=t;return e.createElement("div",{...o,ref:n})},Select:function(t){return e.createElement("select",{...t})},Week:function(t){const{week:n,...o}=t;return e.createElement("tr",{...o})},WeekNumber:function(t){const{week:n,...o}=t;return e.createElement("th",{...o})},WeekNumberHeader:function(t){return e.createElement("th",{...t})},Weekday:function(t){return e.createElement("th",{...t})},Weekdays:function(t){return e.createElement("thead",{"aria-hidden":!0},e.createElement("tr",{...t}))},Weeks:function(t){return e.createElement("tbody",{...t})},YearsDropdown:function(t){const{components:n}=Uv();return e.createElement(n.Dropdown,{...t})}});function Zv(e,t,n=!1,o=Lv){let{from:r,to:a}=e;const{differenceInCalendarDays:i,isSameDay:s}=o;if(r&&a){i(a,r)<0&&([r,a]=[a,r]);return i(t,r)>=(n?1:0)&&i(a,t)>=(n?1:0)}return!n&&a?s(a,t):!(n||!r)&&s(r,t)}function Xv(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function Qv(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function Jv(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function eg(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function tg(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function ng(e,t){return Array.isArray(e)&&e.every(t.isDate)}function og(e,t,n=Lv){const o=Array.isArray(t)?t:[t],{isSameDay:r,differenceInCalendarDays:a,isAfter:i}=n;return o.some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return r(e,t);if(ng(t,n))return t.some(t=>r(e,t));if(Qv(t))return Zv(t,e,!1,n);if(tg(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(Xv(t)){const n=a(t.before,e)>0,o=a(t.after,e)<0;return i(t.before,t.after)?o&&n:n||o}return Jv(t)?a(e,t.after)>0:eg(t)?a(t.before,e)>0:"function"==typeof t&&t(e)})}function rg(e){return{...Gv,...e}}function ag(){const e={};for(const t in Yv)e[Yv[t]]=`rdp-${Yv[t]}`;for(const t in qv)e[qv[t]]=`rdp-${qv[t]}`;for(const t in Hv)e[Hv[t]]=`rdp-${Hv[t]}`;for(const t in Vv)e[Vv[t]]=`rdp-${Vv[t]}`;return e}function ig(e,t,n){return(n??new zv(t)).formatMonthYear(e)}const sg=ig;function lg(e,t=Lv){return t.format(e,"yyyy")}const cg=lg;var dg=Object.freeze({__proto__:null,formatCaption:ig,formatDay:function(e,t,n){return(n??new zv(t)).format(e,"d")},formatMonthCaption:sg,formatMonthDropdown:function(e,t=Lv){return t.format(e,"LLLL")},formatWeekNumber:function(e,t=Lv){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)},formatWeekNumberHeader:function(){return""},formatWeekdayName:function(e,t,n){return(n??new zv(t)).format(e,"cccccc")},formatYearCaption:cg,formatYearDropdown:lg});function ug(e,t,n,o){let r=(o??new zv(n)).format(e,"PPPP");return t.today&&(r=`Today, ${r}`),t.selected&&(r=`${r}, selected`),r}const pg=ug;function fg(e,t,n){return(n??new zv(t)).formatMonthYear(e)}const mg=fg;function hg(e,t,n,o){let r=(o??new zv(n)).format(e,"PPPP");return t?.today&&(r=`Today, ${r}`),r}function vg(e){return"Choose the Month"}function gg(){return""}function xg(e,t){return"Go to the Next Month"}function yg(e){return"Go to the Previous Month"}function bg(e,t,n){return(n??new zv(t)).format(e,"cccc")}function wg(e,t){return`Week ${e}`}function kg(e){return"Week Number"}function jg(e){return"Choose the Year"}var Ng=Object.freeze({__proto__:null,labelCaption:mg,labelDay:pg,labelDayButton:ug,labelGrid:fg,labelGridcell:hg,labelMonthDropdown:vg,labelNav:gg,labelNext:xg,labelPrevious:yg,labelWeekNumber:wg,labelWeekNumberHeader:kg,labelWeekday:bg,labelYearDropdown:jg});const Cg=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function _g(e,t){const n=t.locale?.labels??{};return{...Ng,...e??{},labelDayButton:Cg(ug,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:Cg(vg,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Cg(xg,e?.labelNext,n.labelNext),labelPrevious:Cg(yg,e?.labelPrevious,n.labelPrevious),labelWeekNumber:Cg(wg,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Cg(jg,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:Cg(fg,e?.labelGrid,n.labelGrid),labelGridcell:Cg(hg,e?.labelGridcell,n.labelGridcell),labelNav:Cg(gg,e?.labelNav,n.labelNav),labelWeekNumberHeader:Cg(kg,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Cg(bg,e?.labelWeekday,n.labelWeekday)}}function Dg(e,t,n,o,r){const{startOfMonth:a,startOfYear:i,endOfYear:s,eachMonthOfInterval:l,getMonth:c}=r;return l({start:i(e),end:s(e)}).map(e=>{const i=o.formatMonthDropdown(e,r);return{value:c(e),label:i,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function Sg(e,t,n,o,r=!1){if(!e)return;if(!t)return;const{startOfYear:a,endOfYear:i,eachYearOfInterval:s,getYear:l}=o,c=s({start:a(e),end:i(t)});return r&&c.reverse(),c.map(e=>{const t=n.formatYearDropdown(e,o);return{value:l(e),label:t,disabled:!1}})}const Eg=e=>e instanceof HTMLElement?e:null,Mg=e=>[...e.querySelectorAll("[data-animated-month]")??[]],Og=e=>Eg(e.querySelector("[data-animated-caption]")),Tg=e=>Eg(e.querySelector("[data-animated-weeks]"));function Rg(t,n,{classNames:o,months:r,focused:a,dateLib:i}){const s=e.useRef(null),l=e.useRef(r),c=e.useRef(!1);e.useLayoutEffect(()=>{const e=l.current;if(l.current=r,!(n&&t.current&&t.current instanceof HTMLElement&&0!==r.length&&0!==e.length&&r.length===e.length))return;const d=i.isSameMonth(r[0].date,e[0].date),u=i.isAfter(r[0].date,e[0].date),p=u?o[Vv.caption_after_enter]:o[Vv.caption_before_enter],f=u?o[Vv.weeks_after_enter]:o[Vv.weeks_before_enter],m=s.current,h=t.current.cloneNode(!0);if(h instanceof HTMLElement){Mg(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=Eg(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=Og(e);n&&n.classList.remove(p);const o=Tg(e);o&&o.classList.remove(f)}),s.current=h}else s.current=null;if(c.current||d||a)return;const v=m instanceof HTMLElement?Mg(m):[],g=Mg(t.current);if(g?.every(e=>e instanceof HTMLElement)&&v&&v.every(e=>e instanceof HTMLElement)){c.current=!0,t.current.style.isolation="isolate";const e=(x=t.current,Eg(x.querySelector("[data-animated-nav]")));e&&(e.style.zIndex="1"),g.forEach((n,r)=>{const a=v[r];if(!a)return;n.style.position="relative",n.style.overflow="hidden";const i=Og(n);i&&i.classList.add(p);const s=Tg(n);s&&s.classList.add(f);const l=()=>{c.current=!1,t.current&&(t.current.style.isolation=""),e&&(e.style.zIndex=""),i&&i.classList.remove(p),s&&s.classList.remove(f),n.style.position="",n.style.overflow="",n.contains(a)&&n.removeChild(a)};a.style.pointerEvents="none",a.style.position="absolute",a.style.overflow="hidden",a.setAttribute("aria-hidden","true");const d=(e=>Eg(e.querySelector("[data-animated-weekdays]")))(a);d&&(d.style.opacity="0");const m=Og(a);m&&(m.classList.add(u?o[Vv.caption_before_exit]:o[Vv.caption_after_exit]),m.addEventListener("animationend",l));const h=Tg(a);h&&h.classList.add(u?o[Vv.weeks_before_exit]:o[Vv.weeks_after_exit]),n.insertBefore(a,n.firstChild)})}var x})}function Pg(e,t,n,o){const{month:r,defaultMonth:a,today:i=o.today(),numberOfMonths:s=1}=e;let l=r||a||i;const{differenceInCalendarMonths:c,addMonths:d,startOfMonth:u}=o;if(n&&c(n,l)<s-1){l=d(n,-1*(s-1))}return t&&c(l,t)<0&&(l=t),u(l)}function Ag(t,n){const[o,r]=e.useState(t);return[void 0===n?o:n,r]}function Ig(t,n){const[o,r]=function(e,t){let{startMonth:n,endMonth:o}=e;const{startOfYear:r,startOfDay:a,startOfMonth:i,endOfMonth:s,addYears:l,endOfYear:c,newDate:d,today:u}=t,{fromYear:p,toYear:f,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&p&&(n=t.newDate(p,0,1)),!o&&h&&(o=h),!o&&f&&(o=d(f,11,31));const v="dropdown"===e.captionLayout||"dropdown-years"===e.captionLayout;return n?n=i(n):p?n=d(p,0,1):!n&&v&&(n=r(l(e.today??u(),-100))),o?o=s(o):f?o=d(f,11,31):!o&&v&&(o=c(e.today??u())),[n?a(n):n,o?a(o):o]}(t,n),{startOfMonth:a,endOfMonth:i}=n,s=Pg(t,o,r,n),[l,c]=Ag(s,t.month?s:void 0);e.useEffect(()=>{const e=Pg(t,o,r,n);c(e)},[t.timeZone]);const{months:d,weeks:u,days:p,previousMonth:f,nextMonth:m}=e.useMemo(()=>{const e=function(e,t,n,o){const{numberOfMonths:r=1}=n,a=[];for(let n=0;n<r;n++){const r=o.addMonths(e,n);if(t&&r>t)break;a.push(r)}return a}(l,r,{numberOfMonths:t.numberOfMonths},n),a=function(e,t,n,o){const r=e[0],a=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:d,differenceInCalendarMonths:u,endOfBroadcastWeek:p,endOfISOWeek:f,endOfMonth:m,endOfWeek:h,isAfter:v,startOfBroadcastWeek:g,startOfISOWeek:x,startOfWeek:y}=o,b=l?g(r,o):i?x(r):y(r),w=l?p(a):i?f(m(a)):h(m(a)),k=t&&(l?p(t):i?f(t):h(t)),j=d(k&&v(w,k)?k:w,b),N=u(a,r)+1,C=[];for(let e=0;e<=j;e++){const t=c(b,e);C.push(t)}const _=(l?35:42)*N;if(s&&C.length<_){const e=_-C.length;for(let t=0;t<e;t++){const e=c(C[C.length-1],1);C.push(e)}}return C}(e,t.endMonth?i(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},n),s=function(e,t,n,o){const{addDays:r,endOfBroadcastWeek:a,endOfISOWeek:i,endOfMonth:s,endOfWeek:l,getISOWeek:c,getWeek:d,startOfBroadcastWeek:u,startOfISOWeek:p,startOfWeek:f}=o,m=e.reduce((e,m)=>{const h=n.broadcastCalendar?u(m,o):n.ISOWeek?p(m):f(m),v=n.broadcastCalendar?a(m):n.ISOWeek?i(s(m)):l(s(m)),g=t.filter(e=>e>=h&&e<=v),x=n.broadcastCalendar?35:42;if(n.fixedWeeks&&g.length<x){const e=t.filter(e=>{const t=x-g.length;return e>v&&e<=r(v,t)});g.push(...e)}const y=g.reduce((e,t)=>{const r=n.ISOWeek?c(t):d(t),a=e.find(e=>e.weekNumber===r),i=new Wv(t,m,o);return a?a.days.push(i):e.push(new $v(r,[i])),e},[]),b=new Bv(m,y);return e.push(b),e},[]);return n.reverseMonths?m.reverse():m}(e,a,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},n),c=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(s),d=function(e){const t=[];return e.reduce((e,n)=>{const o=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(o.slice())},t.slice())}(s),u=function(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=o,c=r?a??1:1,d=i(e);return t&&l(d,t)<=0?void 0:s(d,-c)}(l,o,t,n),p=function(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:r,numberOfMonths:a=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=o,c=r?a:1,d=i(e);return t&&l(t,e)<a?void 0:s(d,c)}(l,r,t,n);return{months:s,weeks:c,days:d,previousMonth:u,nextMonth:p}},[n,l.getTime(),r?.getTime(),o?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:h,onMonthChange:v}=t,g=e=>{if(h)return;let t=a(e);o&&t<a(o)&&(t=a(o)),r&&t>a(r)&&(t=a(r)),c(t),v?.(t)};return{months:d,weeks:u,days:p,navStart:o,navEnd:r,previousMonth:f,nextMonth:m,goToMonth:g,goToDay:e=>{(e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||g(e.date)}}}var Fg;function zg(e){return!e[qv.disabled]&&!e[qv.hidden]&&!e[qv.outside]}function Lg(e,t,n,o,r,a,i,s=0){if(s>365)return;const l=function(e,t,n,o,r,a,i){const{ISOWeek:s,broadcastCalendar:l}=a,{addDays:c,addMonths:d,addWeeks:u,addYears:p,endOfBroadcastWeek:f,endOfISOWeek:m,endOfWeek:h,max:v,min:g,startOfBroadcastWeek:x,startOfISOWeek:y,startOfWeek:b}=i;let w={day:c,week:u,month:d,year:p,startOfWeek:e=>l?x(e,i):s?y(e):b(e),endOfWeek:e=>l?f(e):s?m(e):h(e)}[e](n,"after"===t?1:-1);return"before"===t&&o?w=v([o,w]):"after"===t&&r&&(w=g([r,w])),w}(e,t,n.date,o,r,a,i),c=Boolean(a.disabled&&og(l,a.disabled,i)),d=Boolean(a.hidden&&og(l,a.hidden,i)),u=new Wv(l,l,i);return c||d?Lg(e,t,u,o,r,a,i,s+1):u}function Wg(t,n,o,r,a){const{autoFocus:i}=t,[s,l]=e.useState(),c=function(e,t,n,o){let r,a=-1;for(const i of e){const e=t(i);zg(e)&&(e[qv.focused]&&a<Fg.FocusedModifier?(r=i,a=Fg.FocusedModifier):o?.isEqualTo(i)&&a<Fg.LastFocused?(r=i,a=Fg.LastFocused):n(i.date)&&a<Fg.Selected?(r=i,a=Fg.Selected):e[qv.today]&&a<Fg.Today&&(r=i,a=Fg.Today))}return r||(r=e.find(e=>zg(t(e)))),r}(n.days,o,r||(()=>!1),s),[d,u]=e.useState(i?c:void 0);return{isFocusTarget:e=>Boolean(c?.isEqualTo(e)),setFocused:u,focused:d,blur:()=>{l(d),u(void 0)},moveFocus:(e,o)=>{if(!d)return;const r=Lg(e,o,d,n.navStart,n.navEnd,t,a);if(r){if(t.disableNavigation){if(!n.days.some(e=>e.isEqualTo(r)))return}n.goToDay(r),u(r)}}}}function Bg(e,t,n=Lv){return Zv(e,t.from,!1,n)||Zv(e,t.to,!1,n)||Zv(t,e.from,!1,n)||Zv(t,e.to,!1,n)}function $g(e,t,n=Lv){const o=Array.isArray(t)?t:[t];if(o.filter(e=>"function"!=typeof e).some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return Zv(e,t,!1,n);if(ng(t,n))return t.some(t=>Zv(e,t,!1,n));if(Qv(t))return!(!t.from||!t.to)&&Bg(e,{from:t.from,to:t.to},n);if(tg(t))return function(e,t,n=Lv){const o=Array.isArray(t)?t:[t];let r=e.from;const a=n.differenceInCalendarDays(e.to,e.from),i=Math.min(a,6);for(let e=0;e<=i;e++){if(o.includes(r.getDay()))return!0;r=n.addDays(r,1)}return!1}(e,t.dayOfWeek,n);if(Xv(t)){return n.isAfter(t.before,t.after)?Bg(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):og(e.from,t,n)||og(e.to,t,n)}return!(!Jv(t)&&!eg(t))&&(og(e.from,t,n)||og(e.to,t,n))}))return!0;const r=o.filter(e=>"function"==typeof e);if(r.length){let t=e.from;const o=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=o;e++){if(r.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function Yg(e,t){const{disabled:n,excludeDisabled:o,selected:r,required:a,onSelect:i}=e,[s,l]=Ag(r,i?r:void 0),c=i?r:s;return{selected:c,select:(r,s,d)=>{const{min:u,max:p}=e,f=r?function(e,t,n=0,o=0,r=!1,a=Lv){const{from:i,to:s}=t||{},{isSameDay:l,isAfter:c,isBefore:d}=a;let u;if(i||s){if(i&&!s)u=l(i,e)?0===n?{from:i,to:e}:r?{from:i,to:void 0}:void 0:d(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&s)if(l(i,e)&&l(s,e))u=r?{from:i,to:s}:void 0;else if(l(i,e))u={from:i,to:n>0?void 0:e};else if(l(s,e))u={from:e,to:n>0?void 0:e};else if(d(e,i))u={from:e,to:s};else if(c(e,i))u={from:i,to:e};else{if(!c(e,s))throw new Error("Invalid range");u={from:i,to:e}}}else u={from:e,to:n>0?void 0:e};if(u?.from&&u?.to){const t=a.differenceInCalendarDays(u.to,u.from);(o>0&&t>o||n>1&&t<n)&&(u={from:e,to:void 0})}return u}(r,c,u,p,a,t):void 0;return o&&n&&f?.from&&f.to&&$g({from:f.from,to:f.to},n,t)&&(f.from=r,f.to=void 0),i||l(f),i?.(f,r,s,d),f},isSelected:e=>c&&Zv(c,e,!1,t)}}function qg(e,t){const n=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=Ag(n,r?n:void 0),s=r?n:a,{isSameDay:l}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!o&&s&&s&&l(e,s)&&(a=void 0),r||i(a),r?.(a,e,t,n),a},isSelected:e=>!!s&&l(s,e)}}(e,t),o=function(e,t){const{selected:n,required:o,onSelect:r}=e,[a,i]=Ag(n,r?n:void 0),s=r?n:a,{isSameDay:l}=t,c=e=>s?.some(t=>l(t,e))??!1,{min:d,max:u}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(c(e)){if(s?.length===d)return;if(o&&1===s?.length)return;a=s?.filter(t=>!l(t,e))}else a=s?.length===u?[e]:[...a,e];return r||i(a),r?.(a,e,t,n),a},isSelected:c}}(e,t),r=Yg(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return r;default:return}}function Hg(e,t){return e instanceof Av&&e.timeZone===t?e:new Av(e,t)}function Vg(e,t,n){return Hg(e,t)}function Kg(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?Vg(e,t):Array.isArray(e)?e.map(e=>e instanceof Date?Vg(e,t):e):Qv(e)?{...e,from:e.from?Hg(e.from,t):e.from,to:e.to?Hg(e.to,t):e.to}:Xv(e)?{before:Vg(e.before,t),after:Vg(e.after,t)}:Jv(e)?{after:Vg(e.after,t)}:eg(e)?{before:Vg(e.before,t)}:e}function Ug(e,t,n){return e?Array.isArray(e)?e.map(e=>Kg(e,t)):Kg(e,t):e}function Gg(t){let n=t;const o=n.timeZone;if(o&&(n={...t,timeZone:o},n.today&&(n.today=Hg(n.today,o)),n.month&&(n.month=Hg(n.month,o)),n.defaultMonth&&(n.defaultMonth=Hg(n.defaultMonth,o)),n.startMonth&&(n.startMonth=Hg(n.startMonth,o)),n.endMonth&&(n.endMonth=Hg(n.endMonth,o)),"single"===n.mode&&n.selected?n.selected=Hg(n.selected,o):"multiple"===n.mode&&n.selected?n.selected=n.selected?.map(e=>Hg(e,o)):"range"===n.mode&&n.selected&&(n.selected={from:n.selected.from?Hg(n.selected.from,o):n.selected.from,to:n.selected.to?Hg(n.selected.to,o):n.selected.to}),void 0!==n.disabled&&(n.disabled=Ug(n.disabled,o)),void 0!==n.hidden&&(n.hidden=Ug(n.hidden,o)),n.modifiers)){const e={};Object.keys(n.modifiers).forEach(t=>{e[t]=Ug(n.modifiers?.[t],o)}),n.modifiers=e}const{components:r,formatters:a,labels:i,dateLib:s,locale:l,classNames:c}=e.useMemo(()=>{const e={...Fv,...n.locale},t=n.broadcastCalendar?1:n.weekStartsOn,o=n.noonSafe&&n.timeZone?function(e,t={}){const{weekStartsOn:n,locale:o}=t,r=n??o?.options?.weekStartsOn??0,a=t=>{const n="number"==typeof t||"string"==typeof t?new Date(t):t;return new Av(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},i=e=>{const t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(Av.tz(e)),newDate:(t,n,o)=>new Av(t,n,o,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{const n=a(e),o=t?.weekStartsOn??r,i=(n.getDay()-o+7)%7;return n.setDate(n.getDate()-i),n},startOfISOWeek:e=>{const t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{const t=a(e);return t.setDate(1),t},startOfYear:e=>{const t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{const n=a(e),o=(((t?.weekStartsOn??r)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+o),n},endOfISOWeek:e=>{const t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{const t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{const t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{const n=a(t.start),o=a(t.end),r=[],i=new Av(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=12*o.getFullYear()+o.getMonth();for(;12*i.getFullYear()+i.getMonth()<=s;)r.push(new Av(i,e)),i.setMonth(i.getMonth()+1,1);return r},addDays:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{const n=a(e);return n.setDate(n.getDate()+7*t),n},addMonths:(e,t)=>{const n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{const n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{const n=a(t.start),o=a(t.end),r=[],i=new Av(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=o.getFullYear();)r.push(new Av(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return r},getWeek:(e,t)=>Jh(i(e),{weekStartsOn:t?.weekStartsOn??r,firstWeekContainsDate:t?.firstWeekContainsDate??o?.options?.firstWeekContainsDate??1}),getISOWeek:e=>Xh(i(e)),differenceInCalendarDays:(e,t)=>Ph(i(e),i(t)),differenceInCalendarMonths:(e,t)=>Ih(i(e),i(t))}}(n.timeZone,{weekStartsOn:t,locale:e}):void 0,r=n.dateLib&&o?{...o,...n.dateLib}:n.dateLib??o,a=new zv({locale:e,weekStartsOn:t,firstWeekContainsDate:n.firstWeekContainsDate,useAdditionalWeekYearTokens:n.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:n.useAdditionalDayOfYearTokens,timeZone:n.timeZone,numerals:n.numerals},r);return{dateLib:a,components:rg(n.components),formatters:(i=n.formatters,i?.formatMonthCaption&&!i.formatCaption&&(i.formatCaption=i.formatMonthCaption),i?.formatYearCaption&&!i.formatYearDropdown&&(i.formatYearDropdown=i.formatYearCaption),{...dg,...i}),labels:_g(n.labels,a.options),locale:e,classNames:{...ag(),...n.classNames}};var i},[n.locale,n.broadcastCalendar,n.weekStartsOn,n.firstWeekContainsDate,n.useAdditionalWeekYearTokens,n.useAdditionalDayOfYearTokens,n.timeZone,n.numerals,n.dateLib,n.noonSafe,n.components,n.formatters,n.labels,n.classNames]);n.today||(n={...n,today:s.today()});const{captionLayout:d,mode:u,navLayout:p,numberOfMonths:f=1,onDayBlur:m,onDayClick:h,onDayFocus:v,onDayKeyDown:g,onDayMouseEnter:x,onDayMouseLeave:y,onNextClick:b,onPrevClick:w,showWeekNumber:k,styles:j}=n,{formatCaption:N,formatDay:C,formatMonthDropdown:_,formatWeekNumber:D,formatWeekNumberHeader:S,formatWeekdayName:E,formatYearDropdown:M}=a,O=Ig(n,s),{days:T,months:R,navStart:P,navEnd:A,previousMonth:I,nextMonth:F,goToMonth:z}=O,L=function(e,t,n,o,r){const{disabled:a,hidden:i,modifiers:s,showOutsideDays:l,broadcastCalendar:c,today:d=r.today()}=t,{isSameDay:u,isSameMonth:p,startOfMonth:f,isBefore:m,endOfMonth:h,isAfter:v}=r,g=n&&f(n),x=o&&h(o),y={[qv.focused]:[],[qv.outside]:[],[qv.disabled]:[],[qv.hidden]:[],[qv.today]:[]},b={};for(const t of e){const{date:e,displayMonth:n}=t,o=Boolean(n&&!p(e,n)),f=Boolean(g&&m(e,g)),h=Boolean(x&&v(e,x)),w=Boolean(a&&og(e,a,r)),k=Boolean(i&&og(e,i,r))||f||h||!c&&!l&&o||c&&!1===l&&o,j=u(e,d);o&&y.outside.push(t),w&&y.disabled.push(t),k&&y.hidden.push(t),j&&y.today.push(t),s&&Object.keys(s).forEach(n=>{const o=s?.[n];o&&og(e,o,r)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{const t={[qv.focused]:!1,[qv.disabled]:!1,[qv.hidden]:!1,[qv.outside]:!1,[qv.today]:!1},n={};for(const n in y){const o=y[n];t[n]=o.some(t=>t===e)}for(const t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}(T,n,P,A,s),{isSelected:W,select:B,selected:$}=qg(n,s)??{},{blur:Y,focused:q,isFocusTarget:H,moveFocus:V,setFocused:K}=Wg(n,O,L,W??(()=>!1),s),{labelDayButton:U,labelGridcell:G,labelGrid:Z,labelMonthDropdown:X,labelNav:Q,labelPrevious:J,labelNext:ee,labelWeekday:te,labelWeekNumber:ne,labelWeekNumberHeader:oe,labelYearDropdown:re}=i,ae=e.useMemo(()=>function(e,t,n,o){const r=o??e.today(),a=n?e.startOfBroadcastWeek(r,e):t?e.startOfISOWeek(r):e.startOfWeek(r),i=[];for(let t=0;t<7;t++){const n=e.addDays(a,t);i.push(n)}return i}(s,n.ISOWeek,n.broadcastCalendar,n.today),[s,n.ISOWeek,n.broadcastCalendar,n.today]),ie=void 0!==u||void 0!==h,se=e.useCallback(()=>{I&&(z(I),w?.(I))},[I,z,w]),le=e.useCallback(()=>{F&&(z(F),b?.(F))},[z,F,b]),ce=e.useCallback((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),K(e),t.disabled||(B?.(e.date,t,n),h?.(e.date,t,n))},[B,h,K]),de=e.useCallback((e,t)=>n=>{K(e),v?.(e.date,t,n)},[v,K]),ue=e.useCallback((e,t)=>n=>{Y(),m?.(e.date,t,n)},[Y,m]),pe=e.useCallback((e,t)=>o=>{const r={ArrowLeft:[o.shiftKey?"month":"day","rtl"===n.dir?"after":"before"],ArrowRight:[o.shiftKey?"month":"day","rtl"===n.dir?"before":"after"],ArrowDown:[o.shiftKey?"year":"week","after"],ArrowUp:[o.shiftKey?"year":"week","before"],PageUp:[o.shiftKey?"year":"month","before"],PageDown:[o.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(r[o.key]){o.preventDefault(),o.stopPropagation();const[e,t]=r[o.key];V(e,t)}g?.(e.date,t,o)},[V,g,n.dir]),fe=e.useCallback((e,t)=>n=>{x?.(e.date,t,n)},[x]),me=e.useCallback((e,t)=>n=>{y?.(e.date,t,n)},[y]),he=e.useCallback(e=>t=>{const n=Number(t.target.value),o=s.setMonth(s.startOfMonth(e),n);z(o)},[s,z]),ve=e.useCallback(e=>t=>{const n=Number(t.target.value),o=s.setYear(s.startOfMonth(e),n);z(o)},[s,z]),{className:ge,style:xe}=e.useMemo(()=>({className:[c[Yv.Root],n.className].filter(Boolean).join(" "),style:{...j?.[Yv.Root],...n.style}}),[c,n.className,n.style,j]),ye=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith("data-")&&(t[e]=n)}),t}(n),be=e.useRef(null);Rg(be,Boolean(n.animate),{classNames:c,months:R,focused:q,dateLib:s});const we={dayPickerProps:n,selected:$,select:B,isSelected:W,months:R,nextMonth:F,previousMonth:I,goToMonth:z,getModifiers:L,components:r,classNames:c,styles:j,labels:i,formatters:a};return e.createElement(Kv.Provider,{value:we},e.createElement(r.Root,{rootRef:n.animate?be:void 0,className:ge,style:xe,dir:n.dir,id:n.id,lang:n.lang,nonce:n.nonce,title:n.title,role:n.role,"aria-label":n["aria-label"],"aria-labelledby":n["aria-labelledby"],...ye},e.createElement(r.Months,{className:c[Yv.Months],style:j?.[Yv.Months]},!n.hideNavigation&&!p&&e.createElement(r.Nav,{"data-animated-nav":n.animate?"true":void 0,className:c[Yv.Nav],style:j?.[Yv.Nav],"aria-label":Q(),onPreviousClick:se,onNextClick:le,previousMonth:I,nextMonth:F}),R.map((t,o)=>e.createElement(r.Month,{"data-animated-month":n.animate?"true":void 0,className:c[Yv.Month],style:j?.[Yv.Month],key:o,displayIndex:o,calendarMonth:t},"around"===p&&!n.hideNavigation&&0===o&&e.createElement(r.PreviousMonthButton,{type:"button",className:c[Yv.PreviousMonthButton],tabIndex:I?void 0:-1,"aria-disabled":!I||void 0,"aria-label":J(I),onClick:se,"data-animated-button":n.animate?"true":void 0},e.createElement(r.Chevron,{disabled:!I||void 0,className:c[Yv.Chevron],orientation:"rtl"===n.dir?"right":"left"})),e.createElement(r.MonthCaption,{"data-animated-caption":n.animate?"true":void 0,className:c[Yv.MonthCaption],style:j?.[Yv.MonthCaption],calendarMonth:t,displayIndex:o},d?.startsWith("dropdown")?e.createElement(r.DropdownNav,{className:c[Yv.Dropdowns],style:j?.[Yv.Dropdowns]},(()=>{const o="dropdown"===d||"dropdown-months"===d?e.createElement(r.MonthsDropdown,{key:"month",className:c[Yv.MonthsDropdown],"aria-label":X(),classNames:c,components:r,disabled:Boolean(n.disableNavigation),onChange:he(t.date),options:Dg(t.date,P,A,a,s),style:j?.[Yv.Dropdown],value:s.getMonth(t.date)}):e.createElement("span",{key:"month"},_(t.date,s)),i="dropdown"===d||"dropdown-years"===d?e.createElement(r.YearsDropdown,{key:"year",className:c[Yv.YearsDropdown],"aria-label":re(s.options),classNames:c,components:r,disabled:Boolean(n.disableNavigation),onChange:ve(t.date),options:Sg(P,A,a,s,Boolean(n.reverseYears)),style:j?.[Yv.Dropdown],value:s.getYear(t.date)}):e.createElement("span",{key:"year"},M(t.date,s));return"year-first"===s.getMonthYearOrder()?[i,o]:[o,i]})(),e.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},N(t.date,s.options,s))):e.createElement(r.CaptionLabel,{className:c[Yv.CaptionLabel],role:"status","aria-live":"polite"},N(t.date,s.options,s))),"around"===p&&!n.hideNavigation&&o===f-1&&e.createElement(r.NextMonthButton,{type:"button",className:c[Yv.NextMonthButton],tabIndex:F?void 0:-1,"aria-disabled":!F||void 0,"aria-label":ee(F),onClick:le,"data-animated-button":n.animate?"true":void 0},e.createElement(r.Chevron,{disabled:!F||void 0,className:c[Yv.Chevron],orientation:"rtl"===n.dir?"left":"right"})),o===f-1&&"after"===p&&!n.hideNavigation&&e.createElement(r.Nav,{"data-animated-nav":n.animate?"true":void 0,className:c[Yv.Nav],style:j?.[Yv.Nav],"aria-label":Q(),onPreviousClick:se,onNextClick:le,previousMonth:I,nextMonth:F}),e.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===u||"range"===u,"aria-label":Z(t.date,s.options,s)||void 0,className:c[Yv.MonthGrid],style:j?.[Yv.MonthGrid]},!n.hideWeekdays&&e.createElement(r.Weekdays,{"data-animated-weekdays":n.animate?"true":void 0,className:c[Yv.Weekdays],style:j?.[Yv.Weekdays]},k&&e.createElement(r.WeekNumberHeader,{"aria-label":oe(s.options),className:c[Yv.WeekNumberHeader],style:j?.[Yv.WeekNumberHeader],scope:"col"},S()),ae.map(t=>e.createElement(r.Weekday,{"aria-label":te(t,s.options,s),className:c[Yv.Weekday],key:String(t),style:j?.[Yv.Weekday],scope:"col"},E(t,s.options,s)))),e.createElement(r.Weeks,{"data-animated-weeks":n.animate?"true":void 0,className:c[Yv.Weeks],style:j?.[Yv.Weeks]},t.weeks.map(t=>e.createElement(r.Week,{className:c[Yv.Week],key:t.weekNumber,style:j?.[Yv.Week],week:t},k&&e.createElement(r.WeekNumber,{week:t,style:j?.[Yv.WeekNumber],"aria-label":ne(t.weekNumber,{locale:l}),className:c[Yv.WeekNumber],scope:"row",role:"rowheader"},D(t.weekNumber,s)),t.days.map(t=>{const{date:o}=t,a=L(t);if(a[qv.focused]=!a.hidden&&Boolean(q?.isEqualTo(t)),a[Hv.selected]=W?.(o)||a.selected,Qv($)){const{from:e,to:t}=$;a[Hv.range_start]=Boolean(e&&t&&s.isSameDay(o,e)),a[Hv.range_end]=Boolean(e&&t&&s.isSameDay(o,t)),a[Hv.range_middle]=Zv($,o,!0,s)}const i=function(e,t={},n={}){let o={...t?.[Yv.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{o={...o,...n?.[e]}}),o}(a,j,n.modifiersStyles),l=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[o])=>(n[o]?e.push(n[o]):t[qv[o]]?e.push(t[qv[o]]):t[Hv[o]]&&e.push(t[Hv[o]]),e),[t[Yv.Day]])}(a,c,n.modifiersClassNames),d=ie||a.hidden?void 0:G(o,a,s.options,s);return e.createElement(r.Day,{key:`${t.isoDate}_${t.displayMonthId}`,day:t,modifiers:a,className:l.join(" "),style:i,role:"gridcell","aria-selected":a.selected||void 0,"aria-label":d,"data-day":t.isoDate,"data-month":t.outside?t.dateMonthId:void 0,"data-selected":a.selected||void 0,"data-disabled":a.disabled||void 0,"data-hidden":a.hidden||void 0,"data-outside":t.outside||void 0,"data-focused":a.focused||void 0,"data-today":a.today||void 0},!a.hidden&&ie?e.createElement(r.DayButton,{className:c[Yv.DayButton],style:j?.[Yv.DayButton],type:"button",day:t,modifiers:a,disabled:!a.focused&&a.disabled||void 0,"aria-disabled":a.focused&&a.disabled||void 0,tabIndex:H(t)?0:-1,"aria-label":U(o,a,s.options,s),onClick:ce(t,a),onBlur:ue(t,a),onFocus:de(t,a),onKeyDown:pe(t,a),onMouseEnter:fe(t,a),onMouseLeave:me(t,a)},C(o,s.options,s)):!a.hidden&&C(t.date,s.options,s))})))))))),n.footer&&e.createElement(r.Footer,{className:c[Yv.Footer],style:j?.[Yv.Footer],role:"status","aria-live":"polite"},n.footer)))}function Zg({className:e,classNames:n,showOutsideDays:o=!0,captionLayout:r="label",buttonVariant:a="ghost",formatters:i,components:s,...l}){const c=ag();return t.jsx(Gg,{showOutsideDays:o,className:Ie("bg-background group/calendar p-3 [--cell-size:2rem]",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:r,formatters:{formatMonthDropdown:e=>e.toLocaleString("default",{month:"short"}),...i},classNames:{root:Ie("w-fit",c.root),months:Ie("relative flex flex-col gap-4 md:flex-row",c.months),month:Ie("flex w-full flex-col gap-4",c.month),nav:Ie("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",c.nav),button_previous:Ie(Fe({variant:a}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_previous),button_next:Ie(Fe({variant:a}),"size-[--cell-size] select-none p-0 aria-disabled:opacity-50",c.button_next),month_caption:Ie("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",c.month_caption),dropdowns:Ie("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",c.dropdowns),dropdown_root:Ie("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",c.dropdown_root),dropdown:Ie("bg-popover absolute inset-0 opacity-0",c.dropdown),caption_label:Ie("select-none font-medium","label"===r?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",c.caption_label),table:"w-full border-collapse",weekdays:Ie("flex",c.weekdays),weekday:Ie("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",c.weekday),week:Ie("mt-2 flex w-full",c.week),week_number_header:Ie("w-[--cell-size] select-none",c.week_number_header),week_number:Ie("text-muted-foreground select-none text-[0.8rem]",c.week_number),day:Ie("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",c.day),range_start:Ie("bg-accent rounded-l-md",c.range_start),range_middle:Ie("rounded-none",c.range_middle),range_end:Ie("bg-accent rounded-r-md",c.range_end),today:Ie("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",c.today),outside:Ie("text-muted-foreground aria-selected:text-muted-foreground",c.outside),disabled:Ie("text-muted-foreground opacity-50",c.disabled),hidden:Ie("invisible",c.hidden),...n},components:{Root:({className:e,rootRef:n,...o})=>t.jsx("div",{"data-slot":"calendar",ref:n,className:Ie(e),...o}),Chevron:({className:e,orientation:n,...o})=>"left"===n?t.jsx(Yl,{className:Ie("size-4",e),...o}):"right"===n?t.jsx(ql,{className:Ie("size-4",e),...o}):t.jsx($l,{className:Ie("size-4",e),...o}),DayButton:Xg,WeekNumber:({children:e,...n})=>t.jsx("td",{...n,children:t.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:e})}),...s},...l})}function Xg({className:e,day:n,modifiers:o,...a}){const i=ag(),s=r.useRef(null);return r.useEffect(()=>{o.focused&&s.current?.focus()},[o.focused]),t.jsx(Le,{ref:s,variant:"ghost",size:"icon","data-day":n.date.toLocaleDateString(),"data-selected-single":o.selected&&!o.range_start&&!o.range_end&&!o.range_middle,"data-range-start":o.range_start,"data-range-end":o.range_end,"data-range-middle":o.range_middle,className:Ie("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",i.day,e),...a})}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(Fg||(Fg={}));const Qg=e=>{if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t},Jg=e=>{if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t},ex=(e,t)=>{const n=Jg(e);return n?jv(n,t):null};function tx({title:e="Nenhum resultado",description:n="Nenhum dado encontrado."}){return t.jsx(Ku,{title:e,description:n})}const nx=r.forwardRef(({className:e,wrap:n=!0,...o},r)=>{const a=t.jsx("table",{ref:r,className:Ie("w-full caption-bottom border-collapse text-sm",e),...o});return n?t.jsx("div",{className:"w-full overflow-auto",children:a}):a});nx.displayName="Table";const ox=r.forwardRef(({className:e,...n},o)=>t.jsx("thead",{ref:o,className:Ie("rounded-md bg-primary h-[36px]",e),...n}));ox.displayName="TableHeader";const rx=r.forwardRef(({className:e,...n},o)=>t.jsx("tbody",{ref:o,className:Ie(e),...n}));rx.displayName="TableBody";const ax=r.forwardRef(({className:e,...n},o)=>t.jsx("tfoot",{ref:o,className:Ie("bg-primary font-medium text-primary-foreground",e),...n}));ax.displayName="TableFooter";const ix=r.forwardRef(({className:e,...n},o)=>t.jsx("tr",{ref:o,className:Ie("text-sm text-foreground transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...n}));ix.displayName="TableRow";const sx=r.forwardRef(({className:e,...n},o)=>t.jsx("th",{ref:o,className:Ie("border-b border-r border-primary-foreground/20 px-4 align-middle text-left text-[12px] font-medium text-primary-foreground last:border-r-0 [&:has([role=checkbox])]:pr-0 first:rounded-l-lg last:rounded-r-lg",e),...n}));sx.displayName="TableHead";const lx=r.forwardRef(({className:e,...n},o)=>t.jsx("td",{ref:o,className:Ie("border-b border-r border-border px-4 py-2 align-middle text-[12px] text-foreground last:border-r-0 [&:has([role=checkbox])]:pr-0",e),...n}));lx.displayName="TableCell";const cx=r.forwardRef(({className:e,...n},o)=>t.jsx("caption",{ref:o,className:Ie("mt-4 text-sm text-muted-foreground",e),...n}));function dx({className:e,...n}){return t.jsx("div",{className:Ie("animate-pulse rounded-md bg-muted",e),...n})}function ux({columns:e,rows:n=5}){const o=function(e){return"number"==typeof e?Array.from({length:e},()=>({})):e}(e),r=Array.from({length:n},(e,t)=>"row-".concat(String(t)));return t.jsx(t.Fragment,{children:r.map(e=>t.jsx(ix,{children:o.map((n,o)=>t.jsx(lx,{className:Ie(n.width,n.cellClassName,"px-2 py-2"),children:t.jsx(dx,{className:"block h-4 w-full"})},e.concat("-col-",String(o))))},e))})}cx.displayName="TableCaption";const px={Root:nx,Body:rx,Cell:lx,Head:sx,Header:ox,Row:ix};function fx({columns:e,ordering:n,onSort:o}){const r=e??[];return t.jsx(ix,{children:r.map(e=>{const r=Boolean(e.sortable),a=n===e.key,i=n==="-".concat(e.key),s=a||i;return t.jsx(sx,{className:Ie(e.width,e.className,r?"cursor-pointer":""),onClick:r&&o?()=>o(e.key):void 0,children:t.jsxs(Ge,{direction:"row",gap:1,children:[e.label,r&&s&&(a?t.jsx(zl,{size:16}):t.jsx(Fl,{size:16}))]})},e.key)})})}function mx({item:e,columns:n,onClick:o}){const r=n??[];return t.jsx(ix,{className:Ie(o?"hover:bg-secondary cursor-pointer":""),onClick:o,children:r.map(n=>{const o=e[n.key];return t.jsx(lx,{className:Ie(n.width,n.cellClassName),children:n.render?n.render(o,e):String(o??"N/D")},n.key)})})}var hx="Checkbox",[vx]=vd(hx),[gx,xx]=vx(hx);function yx(e){const{__scopeCheckbox:n,checked:o,children:a,defaultChecked:i,disabled:s,form:l,name:c,onCheckedChange:d,required:u,value:p="on",internal_do_not_use_render:f}=e,[m,h]=Rd({prop:o,defaultProp:i??!1,onChange:d,caller:hx}),[v,g]=r.useState(null),[x,y]=r.useState(null),b=r.useRef(!1),w=!v||(!!l||!!v.closest("form")),k={checked:m,disabled:s,setChecked:h,control:v,setControl:g,name:c,form:l,value:p,hasConsumerStoppedPropagationRef:b,required:u,defaultChecked:!Sx(i)&&i,isFormControl:w,bubbleInput:x,setBubbleInput:y};return t.jsx(gx,{scope:n,...k,children:Dx(f)?f(k):a})}var bx="CheckboxTrigger",wx=r.forwardRef(({__scopeCheckbox:e,onKeyDown:n,onClick:o,...a},i)=>{const{control:s,value:l,disabled:c,checked:d,required:u,setControl:p,setChecked:f,hasConsumerStoppedPropagationRef:m,isFormControl:h,bubbleInput:v}=xx(bx,e),g=bd(i,p),x=r.useRef(d);return r.useEffect(()=>{const e=s?.form;if(e){const t=()=>f(x.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[s,f]),t.jsx(Pd.button,{type:"button",role:"checkbox","aria-checked":Sx(d)?"mixed":d,"aria-required":u,"data-state":Ex(d),"data-disabled":c?"":void 0,disabled:c,value:l,...a,ref:g,onKeyDown:Md(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:Md(o,e=>{f(e=>!!Sx(e)||!e),v&&h&&(m.current=e.isPropagationStopped(),m.current||e.stopPropagation())})})});wx.displayName=bx;var kx=r.forwardRef((e,n)=>{const{__scopeCheckbox:o,name:r,checked:a,defaultChecked:i,required:s,disabled:l,value:c,onCheckedChange:d,form:u,...p}=e;return t.jsx(yx,{__scopeCheckbox:o,checked:a,defaultChecked:i,disabled:l,required:s,onCheckedChange:d,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>t.jsxs(t.Fragment,{children:[t.jsx(wx,{...p,ref:n,__scopeCheckbox:o}),e&&t.jsx(_x,{__scopeCheckbox:o})]})})});kx.displayName=hx;var jx="CheckboxIndicator",Nx=r.forwardRef((e,n)=>{const{__scopeCheckbox:o,forceMount:r,...a}=e,i=xx(jx,o);return t.jsx(Id,{present:r||Sx(i.checked)||!0===i.checked,children:t.jsx(Pd.span,{"data-state":Ex(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:n,style:{pointerEvents:"none",...e.style}})})});Nx.displayName=jx;var Cx="CheckboxBubbleInput",_x=r.forwardRef(({__scopeCheckbox:e,...n},o)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:s,defaultChecked:l,required:c,disabled:d,name:u,value:p,form:f,bubbleInput:m,setBubbleInput:h}=xx(Cx,e),v=bd(o,h),g=Gf(s),x=Cf(a);r.useEffect(()=>{const e=m;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,o=!i.current;if(g!==s&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Sx(s),n.call(e,!Sx(s)&&s),e.dispatchEvent(t)}},[m,g,s,i]);const y=r.useRef(!Sx(s)&&s);return t.jsx(Pd.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??y.current,required:c,disabled:d,name:u,value:p,form:f,...n,tabIndex:-1,ref:v,style:{...n.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function Dx(e){return"function"==typeof e}function Sx(e){return"indeterminate"===e}function Ex(e){return Sx(e)?"indeterminate":e?"checked":"unchecked"}_x.displayName=Cx;const Mx=r.forwardRef(({className:e,...n},o)=>t.jsx(kx,{ref:o,className:Ie("bg-white peer w-[18px] h-[18px] shrink-0 rounded-md border-gray-300 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:input-data-checked data-[state=checked]:border-none data-[state=checked]:text-primary-foreground",e),...n,children:t.jsx(Nx,{className:Ie("flex items-center justify-center text-current"),children:t.jsx(Bl,{className:"h-4 w-4"})})}));Mx.displayName=kx.displayName;var Ox=r.forwardRef((e,n)=>t.jsx(Pd.label,{...e,ref:n,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Ox.displayName="Label";var Tx=Ox;const Rx=w("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Px=r.forwardRef(({className:e,...n},o)=>t.jsx(Tx,{ref:o,className:Ie(Rx(),e),...n}));Px.displayName=Tx.displayName;var[Ax]=vd("Tooltip",[Sf]),Ix=Sf(),Fx="TooltipProvider",zx=700,Lx="tooltip.open",[Wx,Bx]=Ax(Fx),$x=e=>{const{__scopeTooltip:n,delayDuration:o=zx,skipDelayDuration:a=300,disableHoverableContent:i=!1,children:s}=e,l=r.useRef(!0),c=r.useRef(!1),d=r.useRef(0);return r.useEffect(()=>{const e=d.current;return()=>window.clearTimeout(e)},[]),t.jsx(Wx,{scope:n,isOpenDelayedRef:l,delayDuration:o,onOpen:r.useCallback(()=>{a<=0||(window.clearTimeout(d.current),l.current=!1)},[a]),onClose:r.useCallback(()=>{a<=0||(window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,a))},[a]),isPointerInTransitRef:c,onPointerInTransitChange:r.useCallback(e=>{c.current=e},[]),disableHoverableContent:i,children:s})};$x.displayName=Fx;var Yx="Tooltip",[qx,Hx]=Ax(Yx),Vx=e=>{const{__scopeTooltip:n,children:o,open:a,defaultOpen:i,onOpenChange:s,disableHoverableContent:l,delayDuration:c}=e,d=Bx(Yx,e.__scopeTooltip),u=Ix(n),[p,f]=r.useState(null),m=Bd(),h=r.useRef(0),v=l??d.disableHoverableContent,g=c??d.delayDuration,x=r.useRef(!1),[y,b]=Rd({prop:a,defaultProp:i??!1,onChange:e=>{e?(d.onOpen(),document.dispatchEvent(new CustomEvent(Lx))):d.onClose(),s?.(e)},caller:Yx}),w=r.useMemo(()=>y?x.current?"delayed-open":"instant-open":"closed",[y]),k=r.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x.current=!1,b(!0)},[b]),j=r.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),N=r.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{x.current=!0,b(!0),h.current=0},g)},[g,b]);return r.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),t.jsx(qf,{...u,children:t.jsx(qx,{scope:n,contentId:m,open:y,stateAttribute:w,trigger:p,onTriggerChange:f,onTriggerEnter:r.useCallback(()=>{d.isOpenDelayedRef.current?N():k()},[d.isOpenDelayedRef,N,k]),onTriggerLeave:r.useCallback(()=>{v?j():(window.clearTimeout(h.current),h.current=0)},[j,v]),onOpen:k,onClose:j,disableHoverableContent:v,children:o})})};Vx.displayName=Yx;var Kx="TooltipTrigger",Ux=r.forwardRef((e,n)=>{const{__scopeTooltip:o,...a}=e,i=Hx(Kx,o),s=Bx(Kx,o),l=Ix(o),c=bd(n,r.useRef(null),i.onTriggerChange),d=r.useRef(!1),u=r.useRef(!1),p=r.useCallback(()=>d.current=!1,[]);return r.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(Hf,{asChild:!0,...l,children:t.jsx(Pd.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...a,ref:c,onPointerMove:Md(e.onPointerMove,e=>{"touch"!==e.pointerType&&(u.current||s.isPointerInTransitRef.current||(i.onTriggerEnter(),u.current=!0))}),onPointerLeave:Md(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Md(e.onPointerDown,()=>{i.open&&i.onClose(),d.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Md(e.onFocus,()=>{d.current||i.onOpen()}),onBlur:Md(e.onBlur,i.onClose),onClick:Md(e.onClick,i.onClose)})})});Ux.displayName=Kx;var[Gx,Zx]=Ax("TooltipPortal",{forceMount:void 0}),Xx="TooltipContent",Qx=r.forwardRef((e,n)=>{const o=Zx(Xx,e.__scopeTooltip),{forceMount:r=o.forceMount,side:a="top",...i}=e,s=Hx(Xx,e.__scopeTooltip);return t.jsx(Id,{present:r||s.open,children:s.disableHoverableContent?t.jsx(oy,{side:a,...i,ref:n}):t.jsx(Jx,{side:a,...i,ref:n})})}),Jx=r.forwardRef((e,n)=>{const o=Hx(Xx,e.__scopeTooltip),a=Bx(Xx,e.__scopeTooltip),i=r.useRef(null),s=bd(n,i),[l,c]=r.useState(null),{trigger:d,onClose:u}=o,p=i.current,{onPointerInTransitChange:f}=a,m=r.useCallback(()=>{c(null),f(!1)},[f]),h=r.useCallback((e,t)=>{const n=e.currentTarget,o={x:e.clientX,y:e.clientY},r=function(e,t,n=5){const o=[];switch(t){case"top":o.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":o.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":o.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":o.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return o}(o,function(e,t){const n=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,o,r,a)){case a:return"left";case r:return"right";case n:return"top";case o:return"bottom";default:throw new Error("unreachable")}}(o,n.getBoundingClientRect())),a=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const o=e[n];for(;t.length>=2;){const e=t[t.length-1],n=t[t.length-2];if(!((e.x-n.x)*(o.y-n.y)>=(e.y-n.y)*(o.x-n.x)))break;t.pop()}t.push(o)}t.pop();const n=[];for(let t=e.length-1;t>=0;t--){const o=e[t];for(;n.length>=2;){const e=n[n.length-1],t=n[n.length-2];if(!((e.x-t.x)*(o.y-t.y)>=(e.y-t.y)*(o.x-t.x)))break;n.pop()}n.push(o)}return n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}(t)}([...r,...function(e){const{top:t,right:n,bottom:o,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:o},{x:r,y:o}]}(t.getBoundingClientRect())]);c(a),f(!0)},[f]);return r.useEffect(()=>()=>m(),[m]),r.useEffect(()=>{if(d&&p){const e=e=>h(e,p),t=e=>h(e,d);return d.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[d,p,h,m]),r.useEffect(()=>{if(l){const e=e=>{const t=e.target,n={x:e.clientX,y:e.clientY},o=d?.contains(t)||p?.contains(t),r=!function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>o!=u>o&&n<(d-l)*(o-c)/(u-c)+l&&(r=!r)}return r}(n,l);o?m():r&&(m(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,p,l,u,m]),t.jsx(oy,{...e,ref:s})}),[ey,ty]=Ax(Yx,{isInside:!1}),ny=function(e){const t=e=>"child"in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=kd,t}("TooltipContent"),oy=r.forwardRef((e,n)=>{const{__scopeTooltip:o,children:a,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:l,...c}=e,d=Hx(Xx,o),u=Ix(o),{onClose:p}=d;return r.useEffect(()=>(document.addEventListener(Lx,p),()=>document.removeEventListener(Lx,p)),[p]),r.useEffect(()=>{if(d.trigger){const e=e=>{e.target instanceof Node&&e.target.contains(d.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[d.trigger,p]),t.jsx(af,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(Vf,{"data-state":d.stateAttribute,...u,...c,ref:n,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(ny,{children:a}),t.jsx(ey,{scope:o,isInside:!0,children:t.jsx(Qf,{id:d.contentId,role:"tooltip",children:i||a})})]})})});Qx.displayName=Xx;var ry="TooltipArrow";r.forwardRef((e,n)=>{const{__scopeTooltip:o,...r}=e,a=Ix(o);return ty(ry,o).isInside?null:t.jsx(Kf,{...a,...r,ref:n})}).displayName=ry;var ay=Qx;const iy=$x,sy=Vx,ly=Ux,cy=r.forwardRef(({className:e,sideOffset:n=4,...o},r)=>t.jsx(ay,{ref:r,sideOffset:n,className:Ie("border border-body rounded-md z-50 overflow-hidden bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o}));cy.displayName=ay.displayName;const dy=w("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),uy=r.forwardRef(({className:e,variant:n,...o},r)=>t.jsx("div",{ref:r,role:"alert",className:Ie(dy({variant:n}),e),...o}));uy.displayName="Alert";const py=r.forwardRef(({className:e,...n},o)=>t.jsx("h5",{ref:o,className:Ie("mb-1 font-medium leading-none tracking-tight",e),...n}));py.displayName="AlertTitle";const fy=r.forwardRef(({className:e,...n},o)=>t.jsx("div",{ref:o,className:Ie("text-sm [&_p]:leading-relaxed",e),...n}));fy.displayName="AlertDescription";var my="rovingFocusGroup.onEntryFocus",hy={bubbles:!1,cancelable:!0},vy="RovingFocusGroup",[gy,xy,yy]=Ed(vy),[by,wy]=vd(vy,[yy]),[ky,jy]=by(vy),Ny=r.forwardRef((e,n)=>t.jsx(gy.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(gy.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(Cy,{...e,ref:n})})}));Ny.displayName=vy;var Cy=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,orientation:a,loop:i=!1,dir:s,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...f}=e,m=r.useRef(null),h=bd(n,m),v=ru(s),[g,x]=Rd({prop:l,defaultProp:c??null,onChange:d,caller:vy}),[y,b]=r.useState(!1),w=Jp(u),k=xy(o),j=r.useRef(!1),[N,C]=r.useState(0);return r.useEffect(()=>{const e=m.current;if(e)return e.addEventListener(my,w),()=>e.removeEventListener(my,w)},[w]),t.jsx(ky,{scope:o,orientation:a,dir:v,loop:i,currentTabStopId:g,onItemFocus:r.useCallback(e=>x(e),[x]),onItemShiftTab:r.useCallback(()=>b(!0),[]),onFocusableItemAdd:r.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>C(e=>e-1),[]),children:t.jsx(Pd.div,{tabIndex:y||0===N?-1:0,"data-orientation":a,...f,ref:h,style:{outline:"none",...e.style},onMouseDown:Md(e.onMouseDown,()=>{j.current=!0}),onFocus:Md(e.onFocus,e=>{const t=!j.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(my,hy);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=k().filter(e=>e.focusable);Ey([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),p)}}j.current=!1}),onBlur:Md(e.onBlur,()=>b(!1))})})}),_y="RovingFocusGroupItem",Dy=r.forwardRef((e,n)=>{const{__scopeRovingFocusGroup:o,focusable:a=!0,active:i=!1,tabStopId:s,children:l,...c}=e,d=Bd(),u=s||d,p=jy(_y,o),f=p.currentTabStopId===u,m=xy(o),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:g}=p;return r.useEffect(()=>{if(a)return h(),()=>v()},[a,h,v]),t.jsx(gy.ItemSlot,{scope:o,id:u,focusable:a,active:i,children:t.jsx(Pd.span,{tabIndex:f?0:-1,"data-orientation":p.orientation,...c,ref:n,onMouseDown:Md(e.onMouseDown,e=>{a?p.onItemFocus(u):e.preventDefault()}),onFocus:Md(e.onFocus,()=>p.onItemFocus(u)),onKeyDown:Md(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const o=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(o)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)?void 0:Sy[o]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const a=r.indexOf(e.currentTarget);r=p.loop?(o=a+1,(n=r).map((e,t)=>n[(o+t)%n.length])):r.slice(a+1)}setTimeout(()=>Ey(r))}var n,o}),children:"function"==typeof l?l({isCurrentTabStop:f,hasTabStop:null!=g}):l})})});Dy.displayName=_y;var Sy={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ey(e,t=!1){const n=document.activeElement;for(const o of e){if(o===n)return;if(o.focus({preventScroll:t}),document.activeElement!==n)return}}var My=Ny,Oy=Dy,Ty=["Enter"," "],Ry=["ArrowUp","PageDown","End"],Py=["ArrowDown","PageUp","Home",...Ry],Ay={ltr:[...Ty,"ArrowRight"],rtl:[...Ty,"ArrowLeft"]},Iy={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Fy="Menu",[zy,Ly,Wy]=Ed(Fy),[By,$y]=vd(Fy,[Wy,Sf,wy]),Yy=Sf(),qy=wy(),[Hy,Vy]=By(Fy),[Ky,Uy]=By(Fy),Gy=e=>{const{__scopeMenu:n,open:o=!1,children:a,dir:i,onOpenChange:s,modal:l=!0}=e,c=Yy(n),[d,u]=r.useState(null),p=r.useRef(!1),f=Jp(s),m=ru(i);return r.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),r.useEffect(()=>{if(!o)return;const e=()=>f(!1);return window.addEventListener("blur",e),()=>window.removeEventListener("blur",e)},[o,f]),t.jsx(qf,{...c,children:t.jsx(Hy,{scope:n,open:o,onOpenChange:f,content:d,onContentChange:u,children:t.jsx(Ky,{scope:n,onClose:r.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:p,dir:m,modal:l,children:a})})})};Gy.displayName=Fy;var Zy=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e,a=Yy(o);return t.jsx(Hf,{...a,...r,ref:n})});Zy.displayName="MenuAnchor";var Xy="MenuPortal",[Qy,Jy]=By(Xy,{forceMount:void 0}),eb=e=>{const{__scopeMenu:n,forceMount:o,children:r,container:a}=e,i=Vy(Xy,n);return t.jsx(Qy,{scope:n,forceMount:o,children:t.jsx(Id,{present:o||i.open,children:t.jsx(Uf,{asChild:!0,container:a,children:r})})})};eb.displayName=Xy;var tb="MenuContent",[nb,ob]=By(tb),rb=r.forwardRef((e,n)=>{const o=Jy(tb,e.__scopeMenu),{forceMount:r=o.forceMount,...a}=e,i=Vy(tb,e.__scopeMenu),s=Uy(tb,e.__scopeMenu);return t.jsx(zy.Provider,{scope:e.__scopeMenu,children:t.jsx(Id,{present:r||i.open,children:t.jsx(zy.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(ab,{...a,ref:n}):t.jsx(ib,{...a,ref:n})})})})}),ab=r.forwardRef((e,n)=>{const o=Vy(tb,e.__scopeMenu),a=r.useRef(null),i=bd(n,a);return r.useEffect(()=>{const e=a.current;if(e)return sr(e)},[]),t.jsx(lb,{...e,ref:i,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:Md(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})}),ib=r.forwardRef((e,n)=>{const o=Vy(tb,e.__scopeMenu);return t.jsx(lb,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})}),sb=wd("MenuContent.ScrollLock"),lb=r.forwardRef((e,n)=>{const{__scopeMenu:o,loop:a=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:d,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:h,disableOutsideScroll:v,...g}=e,x=Vy(tb,o),y=Uy(tb,o),b=Yy(o),w=qy(o),k=Ly(o),[j,N]=r.useState(null),C=r.useRef(null),_=bd(n,C,x.onContentChange),D=r.useRef(0),S=r.useRef(""),E=r.useRef(0),M=r.useRef(null),O=r.useRef("right"),T=r.useRef(0),R=v?er:r.Fragment,P=v?{as:sb,allowPinchZoom:!0}:void 0,A=e=>{const t=S.current+e,n=k().filter(e=>!e.disabled),o=document.activeElement,r=n.find(e=>e.ref.current===o)?.textValue,a=function(e,t,n){const o=t.length>1&&Array.from(t).every(e=>e===t[0]),r=o?t[0]:t,a=n?e.indexOf(n):-1;let i=(s=e,l=Math.max(a,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===r.length&&(i=i.filter(e=>e!==n));const c=i.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}(n.map(e=>e.textValue),t,r),i=n.find(e=>e.textValue===a)?.ref.current;!function e(t){S.current=t,window.clearTimeout(D.current),""!==t&&(D.current=window.setTimeout(()=>e(""),1e3))}(t),i&&setTimeout(()=>i.focus())};r.useEffect(()=>()=>window.clearTimeout(D.current),[]),uf();const I=r.useCallback(e=>O.current===M.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:o}=e;let r=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,d=s.x,u=s.y;c>o!=u>o&&n<(d-l)*(o-c)/(u-c)+l&&(r=!r)}return r}(n,t)}(e,M.current?.area),[]);return t.jsx(nb,{scope:o,searchRef:S,onItemEnter:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:r.useCallback(e=>{I(e)||(C.current?.focus(),N(null))},[I]),onTriggerLeave:r.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:E,onPointerGraceIntentChange:r.useCallback(e=>{M.current=e},[]),children:t.jsx(R,{...P,children:t.jsx(vf,{asChild:!0,trapped:i,onMountAutoFocus:Md(s,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(af,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:m,onDismiss:h,children:t.jsx(My,{asChild:!0,...w,dir:y.dir,orientation:"vertical",loop:a,currentTabStopId:j,onCurrentTabStopIdChange:N,onEntryFocus:Md(d,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(Vf,{role:"menu","aria-orientation":"vertical","data-state":Ib(x.open),"data-radix-menu-content":"",dir:y.dir,...b,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:Md(g.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,o=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&o&&A(e.key));const r=C.current;if(e.target!==r)return;if(!Py.includes(e.key))return;e.preventDefault();const a=k().filter(e=>!e.disabled).map(e=>e.ref.current);Ry.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(a)}),onBlur:Md(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),S.current="")}),onPointerMove:Md(e.onPointerMove,Lb(e=>{const t=e.target,n=T.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>T.current?"right":"left";O.current=t,T.current=e.clientX}}))})})})})})})});rb.displayName=tb;var cb=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Pd.div,{role:"group",...r,ref:n})});cb.displayName="MenuGroup";var db=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Pd.div,{...r,ref:n})});db.displayName="MenuLabel";var ub="MenuItem",pb="menu.itemSelect",fb=r.forwardRef((e,n)=>{const{disabled:o=!1,onSelect:a,...i}=e,s=r.useRef(null),l=Uy(ub,e.__scopeMenu),c=ob(ub,e.__scopeMenu),d=bd(n,s),u=r.useRef(!1);return t.jsx(mb,{...i,ref:d,disabled:o,onClick:Md(e.onClick,()=>{const e=s.current;if(!o&&e){const t=new CustomEvent(pb,{bubbles:!0,cancelable:!0});e.addEventListener(pb,e=>a?.(e),{once:!0}),Ad(e,t),t.defaultPrevented?u.current=!1:l.onClose()}}),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:Md(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:Md(e.onKeyDown,e=>{const t=""!==c.searchRef.current;o||t&&" "===e.key||Ty.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});fb.displayName=ub;var mb=r.forwardRef((e,n)=>{const{__scopeMenu:o,disabled:a=!1,textValue:i,...s}=e,l=ob(ub,o),c=qy(o),d=r.useRef(null),u=bd(n,d),[p,f]=r.useState(!1),[m,h]=r.useState("");return r.useEffect(()=>{const e=d.current;e&&h((e.textContent??"").trim())},[s.children]),t.jsx(zy.ItemSlot,{scope:o,disabled:a,textValue:i??m,children:t.jsx(Oy,{asChild:!0,...c,focusable:!a,children:t.jsx(Pd.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...s,ref:u,onPointerMove:Md(e.onPointerMove,Lb(e=>{if(a)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}})),onPointerLeave:Md(e.onPointerLeave,Lb(e=>l.onItemLeave(e))),onFocus:Md(e.onFocus,()=>f(!0)),onBlur:Md(e.onBlur,()=>f(!1))})})})}),hb=r.forwardRef((e,n)=>{const{checked:o=!1,onCheckedChange:r,...a}=e;return t.jsx(jb,{scope:e.__scopeMenu,checked:o,children:t.jsx(fb,{role:"menuitemcheckbox","aria-checked":Fb(o)?"mixed":o,...a,ref:n,"data-state":zb(o),onSelect:Md(a.onSelect,()=>r?.(!!Fb(o)||!o),{checkForDefaultPrevented:!1})})})});hb.displayName="MenuCheckboxItem";var vb="MenuRadioGroup",[gb,xb]=By(vb,{value:void 0,onValueChange:()=>{}}),yb=r.forwardRef((e,n)=>{const{value:o,onValueChange:r,...a}=e,i=Jp(r);return t.jsx(gb,{scope:e.__scopeMenu,value:o,onValueChange:i,children:t.jsx(cb,{...a,ref:n})})});yb.displayName=vb;var bb="MenuRadioItem",wb=r.forwardRef((e,n)=>{const{value:o,...r}=e,a=xb(bb,e.__scopeMenu),i=o===a.value;return t.jsx(jb,{scope:e.__scopeMenu,checked:i,children:t.jsx(fb,{role:"menuitemradio","aria-checked":i,...r,ref:n,"data-state":zb(i),onSelect:Md(r.onSelect,()=>a.onValueChange?.(o),{checkForDefaultPrevented:!1})})})});wb.displayName=bb;var kb="MenuItemIndicator",[jb,Nb]=By(kb,{checked:!1}),Cb=r.forwardRef((e,n)=>{const{__scopeMenu:o,forceMount:r,...a}=e,i=Nb(kb,o);return t.jsx(Id,{present:r||Fb(i.checked)||!0===i.checked,children:t.jsx(Pd.span,{...a,ref:n,"data-state":zb(i.checked)})})});Cb.displayName=kb;var _b=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e;return t.jsx(Pd.div,{role:"separator","aria-orientation":"horizontal",...r,ref:n})});_b.displayName="MenuSeparator";var Db=r.forwardRef((e,n)=>{const{__scopeMenu:o,...r}=e,a=Yy(o);return t.jsx(Kf,{...a,...r,ref:n})});Db.displayName="MenuArrow";var Sb="MenuSub",[Eb,Mb]=By(Sb),Ob=e=>{const{__scopeMenu:n,children:o,open:a=!1,onOpenChange:i}=e,s=Vy(Sb,n),l=Yy(n),[c,d]=r.useState(null),[u,p]=r.useState(null),f=Jp(i);return r.useEffect(()=>(!1===s.open&&f(!1),()=>f(!1)),[s.open,f]),t.jsx(qf,{...l,children:t.jsx(Hy,{scope:n,open:a,onOpenChange:f,content:u,onContentChange:p,children:t.jsx(Eb,{scope:n,contentId:Bd(),triggerId:Bd(),trigger:c,onTriggerChange:d,children:o})})})};Ob.displayName=Sb;var Tb="MenuSubTrigger",Rb=r.forwardRef((e,n)=>{const o=Vy(Tb,e.__scopeMenu),a=Uy(Tb,e.__scopeMenu),i=Mb(Tb,e.__scopeMenu),s=ob(Tb,e.__scopeMenu),l=r.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=s,u={__scopeMenu:e.__scopeMenu},p=r.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return r.useEffect(()=>p,[p]),r.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),t.jsx(Zy,{asChild:!0,...u,children:t.jsx(mb,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?i.contentId:void 0,"data-state":Ib(o.open),...e,ref:yd(n,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),o.open||o.onOpenChange(!0))},onPointerMove:Md(e.onPointerMove,Lb(t=>{s.onItemEnter(t),t.defaultPrevented||e.disabled||o.open||l.current||(s.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{o.onOpenChange(!0),p()},100))})),onPointerLeave:Md(e.onPointerLeave,Lb(e=>{p();const t=o.content?.getBoundingClientRect();if(t){const n=o.content?.dataset.side,r="right"===n,a=r?-5:5,i=t[r?"left":"right"],l=t[r?"right":"left"];s.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:i,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(e),e.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Md(e.onKeyDown,t=>{const n=""!==s.searchRef.current;e.disabled||n&&" "===t.key||Ay[a.dir].includes(t.key)&&(o.onOpenChange(!0),o.content?.focus(),t.preventDefault())})})})});Rb.displayName=Tb;var Pb="MenuSubContent",Ab=r.forwardRef((e,n)=>{const o=Jy(tb,e.__scopeMenu),{forceMount:a=o.forceMount,align:i="start",...s}=e,l=Vy(tb,e.__scopeMenu),c=Uy(tb,e.__scopeMenu),d=Mb(Pb,e.__scopeMenu),u=r.useRef(null),p=bd(n,u);return t.jsx(zy.Provider,{scope:e.__scopeMenu,children:t.jsx(Id,{present:a||l.open,children:t.jsx(zy.Slot,{scope:e.__scopeMenu,children:t.jsx(lb,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:p,align:i,side:"rtl"===c.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Md(e.onFocusOutside,e=>{e.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Md(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:Md(e.onKeyDown,e=>{const t=e.currentTarget.contains(e.target),n=Iy[c.dir].includes(e.key);t&&n&&(l.onOpenChange(!1),d.trigger?.focus(),e.preventDefault())})})})})})});function Ib(e){return e?"open":"closed"}function Fb(e){return"indeterminate"===e}function zb(e){return Fb(e)?"indeterminate":e?"checked":"unchecked"}function Lb(e){return t=>"mouse"===t.pointerType?e(t):void 0}Ab.displayName=Pb;var Wb=Gy,Bb=Zy,$b=eb,Yb=rb,qb=cb,Hb=db,Vb=fb,Kb=hb,Ub=yb,Gb=wb,Zb=Cb,Xb=_b,Qb=Db,Jb=Ob,ew=Rb,tw=Ab,nw="DropdownMenu",[ow]=vd(nw,[$y]),rw=$y(),[aw,iw]=ow(nw),sw=e=>{const{__scopeDropdownMenu:n,children:o,dir:a,open:i,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=rw(n),u=r.useRef(null),[p,f]=Rd({prop:i,defaultProp:s??!1,onChange:l,caller:nw});return t.jsx(aw,{scope:n,triggerId:Bd(),triggerRef:u,contentId:Bd(),open:p,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),modal:c,children:t.jsx(Wb,{...d,open:p,onOpenChange:f,dir:a,modal:c,children:o})})};sw.displayName=nw;var lw="DropdownMenuTrigger",cw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,disabled:r=!1,...a}=e,i=iw(lw,o),s=rw(o);return t.jsx(Bb,{asChild:!0,...s,children:t.jsx(Pd.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:yd(n,i.triggerRef),onPointerDown:Md(e.onPointerDown,e=>{r||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:Md(e.onKeyDown,e=>{r||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});cw.displayName=lw;var dw=e=>{const{__scopeDropdownMenu:n,...o}=e,r=rw(n);return t.jsx($b,{...r,...o})};dw.displayName="DropdownMenuPortal";var uw="DropdownMenuContent",pw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...a}=e,i=iw(uw,o),s=rw(o),l=r.useRef(!1);return t.jsx(Yb,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...a,ref:n,onCloseAutoFocus:Md(e.onCloseAutoFocus,e=>{l.current||i.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:Md(e.onInteractOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,o=2===t.button||n;i.modal&&!o||(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pw.displayName=uw;var fw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(qb,{...a,...r,ref:n})});fw.displayName="DropdownMenuGroup";var mw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Hb,{...a,...r,ref:n})});mw.displayName="DropdownMenuLabel";var hw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Vb,{...a,...r,ref:n})});hw.displayName="DropdownMenuItem";var vw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Kb,{...a,...r,ref:n})});vw.displayName="DropdownMenuCheckboxItem";var gw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Ub,{...a,...r,ref:n})});gw.displayName="DropdownMenuRadioGroup";var xw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Gb,{...a,...r,ref:n})});xw.displayName="DropdownMenuRadioItem";var yw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Zb,{...a,...r,ref:n})});yw.displayName="DropdownMenuItemIndicator";var bw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Xb,{...a,...r,ref:n})});bw.displayName="DropdownMenuSeparator";r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(Qb,{...a,...r,ref:n})}).displayName="DropdownMenuArrow";var ww=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(ew,{...a,...r,ref:n})});ww.displayName="DropdownMenuSubTrigger";var kw=r.forwardRef((e,n)=>{const{__scopeDropdownMenu:o,...r}=e,a=rw(o);return t.jsx(tw,{...a,...r,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});kw.displayName="DropdownMenuSubContent";var jw=dw,Nw=pw,Cw=mw,_w=hw,Dw=vw,Sw=xw,Ew=yw,Mw=bw,Ow=ww,Tw=kw;const Rw=sw,Pw=cw,Aw=fw,Iw=jw,Fw=e=>{const{__scopeDropdownMenu:n,children:o,open:r,onOpenChange:a,defaultOpen:i}=e,s=rw(n),[l,c]=Rd({prop:r,defaultProp:i??!1,onChange:a,caller:"DropdownMenuSub"});return t.jsx(Jb,{...s,open:l,onOpenChange:c,children:o})},zw=gw,Lw=r.forwardRef(({className:e,inset:n,children:o,...r},a)=>t.jsxs(Ow,{ref:a,className:Ie("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",n&&"pl-8",e),...r,children:[o,t.jsx(ql,{className:"ml-auto h-4 w-4"})]}));Lw.displayName=Ow.displayName;const Ww=r.forwardRef(({className:e,...n},o)=>t.jsx(Tw,{ref:o,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Ww.displayName=Tw.displayName;const Bw=r.forwardRef(({className:e,sideOffset:n=4,...o},r)=>t.jsx(jw,{children:t.jsx(Nw,{ref:r,sideOffset:n,className:Ie("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Bw.displayName=Nw.displayName;const $w=r.forwardRef(({className:e,inset:n,...o},r)=>t.jsx(_w,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n&&"pl-8",e),...o}));$w.displayName=_w.displayName;const Yw=r.forwardRef(({className:e,children:n,checked:o,...r},a)=>t.jsxs(Dw,{ref:a,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ew,{children:t.jsx(Bl,{className:"h-4 w-4"})})}),n]}));Yw.displayName=Dw.displayName;const qw=r.forwardRef(({className:e,children:n,...o},r)=>t.jsxs(Sw,{ref:r,className:Ie("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Ew,{children:t.jsx(Kl,{className:"h-2 w-2 fill-current"})})}),n]}));qw.displayName=Sw.displayName;const Hw=r.forwardRef(({className:e,inset:n,...o},r)=>t.jsx(Cw,{ref:r,className:Ie("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...o}));Hw.displayName=Cw.displayName;const Vw=r.forwardRef(({className:e,...n},o)=>t.jsx(Mw,{ref:o,className:Ie("-mx-1 my-1 h-px bg-muted",e),...n}));Vw.displayName=Mw.displayName;const Kw=({className:e,...n})=>t.jsx("span",{className:Ie("ml-auto text-xs tracking-widest opacity-60",e),...n});Kw.displayName="DropdownMenuShortcut";const Uw=r.forwardRef(({className:e,...n},o)=>t.jsx("input",{type:"radio",className:Ie("h-4 w-4 cursor-pointer accent-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...n}));Uw.displayName="Radio";const Gw=({size:e=8})=>t.jsxs("output",{children:[t.jsxs("svg",{width:4*e,height:4*e,viewBox:"0 0 78 78",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin",role:"img","aria-labelledby":"spinnerTitle",children:[t.jsx("title",{id:"spinnerTitle",children:"Loading..."}),t.jsx("path",{d:"M13.2131 9.74186C7.6162 14.6748 3.55158 21.1095 1.50144 28.2828L9.89497 30.6817C11.4862 25.114 14.641 20.1196 18.9852 16.2909L13.2131 9.74186Z",fill:"#0d406e"}),t.jsx("path",{d:"M55.2865 74.4365C62.0653 71.321 67.8083 66.3265 71.8342 60.0455L64.4847 55.3347C61.36 60.2099 56.9025 64.0864 51.641 66.5046L55.2865 74.4365Z",fill:"#0d406e"}),t.jsx("path",{d:"M71.8342 60.0455C75.8601 53.7645 78 46.4605 78 39H69.2704C69.2704 44.7906 67.6095 50.4596 64.4847 55.3347L71.8342 60.0455Z",fill:"#0d406e"}),t.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.2131 9.74186C20.1094 4.11892 24.5245 2.24347 33.0785 0.452148C25.7044 1.58491 18.8101 4.80896 13.2131 9.74186Z",fill:"#0d406e"}),t.jsx("path",{d:"M33.5891 77.6228C40.9774 78.6579 48.5077 77.5521 55.2865 74.4365L51.641 66.5046C46.3795 68.9227 40.5348 69.781 34.8002 68.9776L33.5891 77.6228Z",fill:"#0d406e"}),t.jsx("path",{d:"M13.6026 68.5968C19.2643 73.4552 26.2007 76.5877 33.5891 77.6228L34.8002 68.9776C29.0657 68.1742 23.6818 65.7429 19.2874 61.9719L13.6026 68.5968Z",fill:"#0d406e"}),t.jsx("path",{d:"M1.50144 28.2828C-0.548705 35.4561 -0.498346 43.0669 1.64654 50.2124L10.0076 47.7027C8.34281 42.1566 8.30373 36.2493 9.89497 30.6817L1.50144 28.2828Z",fill:"#0d406e"}),t.jsx("path",{d:"M1.64654 50.2124C3.79143 57.358 7.94084 63.7384 13.6026 68.5968L19.2874 61.9719C14.893 58.201 11.6724 53.2488 10.0076 47.7027L1.64654 50.2124Z",fill:"#0d406e"}),t.jsx("path",{d:"M34.4039 9.08055L33.0785 0.452148C24.5245 2.24347 20.1094 4.11892 13.2131 9.74186L18.9852 16.2909C23.3293 12.4621 28.6805 9.95976 34.4039 9.08055Z",fill:"#0d406e"})]}),t.jsx("span",{className:"sr-only",children:"Loading..."})]});const Zw=async(e,{search:t,modelClass:n,labelName:o,additionalFilters:r={},fields:a})=>{const i={...t?{[`${o}__icontains`]:t}:{},...r},s=a?.length?[o,...a]:[],[l,c]=await e(n,i,s);if(c)throw new Error(c.message);return l??[]},Xw=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Qw=new Set(["Write","Preview","Markdown","WYSIWYG"]);function Jw(e,t=[]){return function(e){return e?e.replace(Xw,"$1"):e}(function(e,t=[]){if(!e)return e;const n=e=>Qw.has(e)||t.some(t=>t===e),o=e.split("\n");for(;o.length>0;){const e=o[0].trim();if(e&&!n(e))break;o.shift()}return o.join("\n")}(e,t))}function ek(e){return e?[e]:[]}function tk(e,t){const n=Jw(e,ek(t));return n.trim()?n:" "}const nk=({triggerClassName:n,className:o,trigger:r,children:a})=>{const i=e.useId();return t.jsx(iy,{children:t.jsxs(sy,{children:[t.jsx(ly,{asChild:!0,children:t.jsx("div",{className:n,children:r})}),t.jsx(cy,{className:o,children:a})]})},i)};exports.Accordion=Fu,exports.AccordionContent=Wu,exports.AccordionItem=zu,exports.AccordionTrigger=Lu,exports.Alert=uy,exports.AlertDescription=fy,exports.AlertDialog=Na,exports.AlertDialogAction=Ta,exports.AlertDialogCancel=Ra,exports.AlertDialogContent=Da,exports.AlertDialogDescription=Oa,exports.AlertDialogFooter=Ea,exports.AlertDialogHeader=Sa,exports.AlertDialogOverlay=_a,exports.AlertDialogPortal=Ca,exports.AlertDialogTitle=Ma,exports.AlertDialogTrigger=function({...e}){return t.jsx(va,{"data-slot":"alert-dialog-trigger",...e})},exports.AlertTitle=py,exports.AlertWithIcon=function({icon:e,title:n,description:o,variant:r="default",className:a}){return t.jsxs(uy,{variant:r,className:a??"w-auto h-auto m-4",children:[e,t.jsx(py,{children:n}),t.jsx(fy,{children:o})]})},exports.Badge=function({className:e,variant:n,...o}){return t.jsx("div",{"data-slot":"badge",className:Ie(El({variant:n}),e),...o})},exports.Breadcrumb=function({...e}){return t.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...e})},exports.BreadcrumbEllipsis=function({className:e,...n}){return t.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:Ie("flex size-9 items-center justify-center",e),...n,children:[t.jsx(Xl,{className:"size-4"}),t.jsx("span",{className:"sr-only",children:"More"})]})},exports.BreadcrumbItem=function({className:e,...n}){return t.jsx("li",{"data-slot":"breadcrumb-item",className:Ie("inline-flex items-center gap-1.5",e),...n})},exports.BreadcrumbLink=function({asChild:e,className:n,...o}){const r=e?f:"a";return t.jsx(r,{"data-slot":"breadcrumb-link",className:Ie("hover:text-foreground transition-colors",n),...o})},exports.BreadcrumbList=function({className:e,...n}){return t.jsx("ol",{"data-slot":"breadcrumb-list",className:Ie("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",e),...n})},exports.BreadcrumbPage=function({className:e,...n}){return t.jsx("span",{"data-slot":"breadcrumb-page","aria-disabled":"true","aria-current":"page",className:Ie("text-foreground font-normal",e),...n})},exports.BreadcrumbSeparator=function({children:e,className:n,...o}){return t.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:Ie("[&>svg]:size-3.5",n),...o,children:e??t.jsx(ql,{})})},exports.Button=Le,exports.Calendar=Zg,exports.Card=kl,exports.CardContent=_l,exports.CardDescription=Cl,exports.CardFooter=Dl,exports.CardHeader=jl,exports.CardTitle=Nl,exports.Checkbox=Mx,exports.ClearButton=({handleClear:e})=>t.jsx("button",{type:"button",className:"h-10 p-2 mt-1 text-xs bg-white",onClick:e,children:t.jsxs(Ge,{direction:"row",gap:2,className:"items-center",children:["Limpar filtros ",t.jsx(ac,{size:16})]})}),exports.Combobox=Gp,exports.Command=Yp,exports.CommandDialog=function({title:e="Command Palette",description:n="Search for a command to run...",children:o,className:r,showCloseButton:a=!0,...i}){return t.jsxs(Pp,{...i,children:[t.jsxs(Lp,{className:"sr-only",children:[t.jsx(Bp,{children:e}),t.jsx($p,{children:n})]}),t.jsx(zp,{className:Ie("overflow-hidden p-0",r),children:t.jsx(Yp,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:o})})]})},exports.CommandEmpty=Vp,exports.CommandGroup=Kp,exports.CommandInput=qp,exports.CommandItem=Up,exports.CommandList=Hp,exports.CommandSeparator=function({className:e,...n}){return t.jsx(jp.Separator,{"data-slot":"command-separator",className:Ie("bg-border -mx-1 h-px",e),...n})},exports.CommandShortcut=function({className:e,...n}){return t.jsx("span",{"data-slot":"command-shortcut",className:Ie("text-muted-foreground ml-auto text-xs tracking-widest",e),...n})},exports.ConfirmationDialog=Pa,exports.DatePicker=({id:e,placeholder:n,value:o,onValueChange:r,className:a,boundary:i="start",dateFormat:s="dd/MM/yyyy"})=>{const l=Qg(o),c=((e,t)=>{const n=Qg(e);return n?jv(n,t):null})(o,s);return t.jsx("div",{className:Ie("flex w-full min-w-0",a),children:t.jsxs(xl,{children:[t.jsx(yl,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":e,className:Ie(We,"justify-start text-left",!c&&Be),children:[t.jsx(Wl,{className:Ie("mr-2",$e)}),c??n]})}),t.jsx(bl,{className:"w-fit p-0",align:"start",children:t.jsx(Zg,{mode:"single",selected:l,onSelect:e=>{if(!e)return void r?.("");const t="end"===i?Fh(e):Rh(e);r?.(t.toISOString())},initialFocus:!0})})]})})},exports.DeleteDialog=({openDialog:e,setOpenDialog:n,handleDelete:o,count:r})=>{const a=void 0!==r&&r>1;return t.jsx(Ge,{direction:"row",children:t.jsx(Pp,{open:e,onOpenChange:n,children:t.jsxs(zp,{className:"max-w-[513px] rounded-xl px-8 py-6 gap-4",children:[t.jsxs(Lp,{children:[t.jsx(Bp,{className:"pb-0 border-none",children:a?`Deseja apagar ${r} registros selecionados?`:"Deseja apagar registro atual?"}),t.jsx($p,{})]}),t.jsx("form",{onSubmit:e=>{e.preventDefault(),o()},children:t.jsxs(Ge,{gap:2,children:[t.jsx("p",{className:"text-fontcolor-secondary font-medium text-sm",children:a?`Essa ação não poderá ser desfeita e os ${r} registros serão removidos permanentemente. Tem certeza de que deseja continuar?`:"Essa ação não poderá ser desfeita e o registro será removido permanentemente. Tem certeza de que deseja continuar?"}),t.jsxs(Wp,{className:"mt-4",children:[t.jsx(Pr,{asChild:!0,children:t.jsx(Le,{variant:"ghost",type:"button",children:"Cancelar"})}),t.jsx(Le,{type:"submit",variant:"default",children:a?`Deletar ${r}`:"Deletar"})]})]})})]})})})},exports.Dialog=Pp,exports.DialogContent=zp,exports.DialogDescription=$p,exports.DialogFooter=Wp,exports.DialogHeader=Lp,exports.DialogTitle=Bp,exports.DialogTrigger=Ap,exports.DownloadButton=({item:n,modelClass:o,propertyName:r,retrieveFile:a})=>{const[i,s]=e.useState(!1);return t.jsx(Le,{variant:"outline",size:"icon",disabled:i||!a,onClick:async()=>{if(a){s(!0);try{const[e,t]=await a(o,Number(n[r]));if(t)return void kc.error(`Houve algum problema: ${t.message}`);if(!e)return void kc.error("Nenhum arquivo encontrado");const i=new Blob([new Uint8Array(e.data)],{type:e.contentType}),s=URL.createObjectURL(i),l=document.createElement("a");l.href=s,l.download=n.file.split(/[\\/]/).pop()??n.file,document.body.appendChild(l);try{l.click()}finally{document.body.removeChild(l),URL.revokeObjectURL(s)}kc.success("Arquivo baixado com sucesso!")}finally{s(!1)}}else kc.error("Função de download não configurada")},children:i?t.jsx(Jl,{className:"animate-spin"}):t.jsx(Zl,{})})},exports.DropdownMenu=Rw,exports.DropdownMenuCheckboxItem=Yw,exports.DropdownMenuContent=Bw,exports.DropdownMenuGroup=Aw,exports.DropdownMenuItem=$w,exports.DropdownMenuLabel=Hw,exports.DropdownMenuPortal=Iw,exports.DropdownMenuRadioGroup=zw,exports.DropdownMenuRadioItem=qw,exports.DropdownMenuSeparator=Vw,exports.DropdownMenuShortcut=Kw,exports.DropdownMenuSub=Fw,exports.DropdownMenuSubContent=Ww,exports.DropdownMenuSubTrigger=Lw,exports.DropdownMenuTrigger=Pw,exports.Dropzone=function({children:n,maxFiles:o=1,maxSize:r=5242880,accept:a={"text/csv":[".csv"]},onFilesAccepted:i}){const[s,l]=e.useState([]),[c,d]=e.useState([]),u=e.useCallback((e,t)=>{const n=t.map(({file:e})=>e);l(n),e.length>0&&(d(e),i(e))},[i]),{getRootProps:p,getInputProps:f,isDragActive:m}=Dn({onDrop:u,maxFiles:o,maxSize:r,accept:a,multiple:o>1});return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{...p(),className:"border-2 border-dashed rounded-lg text-center cursor-pointer transition-colors "+(m?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[t.jsx("input",{...f()}),t.jsxs("div",{className:Ie(c.length>0?"p-6 bg-green-100":"p-6","flex flex-col items-center justify-center gap-2"),children:[m&&t.jsx("p",{className:"font-medium text-blue-500",children:"Clique para selecionar os arquivos ou arraste-os aqui"}),!m&&c.length>0&&c.map(e=>t.jsx(Ge,{children:t.jsxs("p",{className:"font-medium",children:[t.jsx("b",{children:"Nome do arquivo:"})," ",e.name]})},e.name)),!m&&0===c.length&&t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"font-medium",children:"Clique para selecionar os arquivos ou arraste-os aqui"}),t.jsxs("p",{className:"text-sm text-gray-500",children:[r/1024/1024,"MB"]})]})]})]}),c.length>0&&t.jsx("div",{className:"w-full",children:n}),s.length>0&&t.jsxs("div",{className:"text-sm text-red-600",children:[t.jsx("h4",{className:"font-medium mb-2",children:"Rejected files:"}),t.jsx("ul",{className:"space-y-1",children:s.map(e=>t.jsxs("li",{className:"flex items-center justify-between",children:[t.jsxs("span",{children:[e.name," (",(e.size/1024).toFixed(2)," KB)"]}),t.jsx("button",{type:"button",onClick:()=>{return t=e.name,void l(e=>e.filter(e=>e.name!==t));var t},className:"text-red-800 hover:text-red-900",children:"×"})]},e.name))}),t.jsxs("p",{className:"mt-1",children:["File must be ",r/1024/1024,"MB or smaller."]})]})]})},exports.Empty=Bu,exports.EmptyContainer=Ku,exports.EmptyContent=function({className:e,...n}){return t.jsx("div",{"data-slot":"empty-content",className:Ie("flex w-full min-w-0 max-w-sm flex-col items-center gap-4 text-balance text-sm",e),...n})},exports.EmptyDescription=Vu,exports.EmptyHeader=$u,exports.EmptyMedia=qu,exports.EmptyTitle=Hu,exports.ErrorBoundary=({children:e,hasError:n,message:o="Um erro inesperado ocorreu."})=>n?t.jsx(uy,{variant:"destructive",className:"my-2",children:o}):t.jsx(t.Fragment,{children:e}),exports.ErrorMessage=({error:e})=>t.jsx(t.Fragment,{children:e&&t.jsx("span",{className:"text-red-500 text-xs",children:e?.message})}),exports.ErrorToastContent=({message:n,error:o})=>{const[r,a]=e.useState(!1),i=JSON.stringify(o,null,2);return t.jsxs(Ge,{children:[t.jsx("p",{children:n}),t.jsx(Fu,{type:"single",collapsible:!0,className:"max-w-60",children:t.jsxs(zu,{value:"error-details",className:"border-none",children:[t.jsx(Lu,{className:"text-sm py-2 hover:no-underline text-red-100",children:"View Error Details"}),t.jsx(Wu,{children:t.jsx("pre",{className:"text-xs bg-red-950 p-3 rounded overflow-x-auto max-h-40 overflow-y-auto",children:t.jsx("code",{className:"text-red-100",children:i})})})]})}),t.jsx("button",{type:"button",onClick:()=>{const e=JSON.stringify(o,null,2);navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)},className:"flex items-center justify-center gap-2 px-3 py-2 bg-red-600 hover:bg-red-700 text-white text-xs font-medium rounded transition-colors",children:r?t.jsxs(t.Fragment,{children:[t.jsx(Bl,{size:14}),t.jsx("span",{children:"Copied!"})]}):t.jsxs(t.Fragment,{children:[t.jsx(Gl,{size:14}),t.jsx("span",{children:"Copy Error JSON"})]})})]})},exports.FKSelect=Xp,exports.FileDropzone=function({onFileSelected:n,onFileDeleted:o,acceptExtensions:r,accept:a,maxSizeMB:i=25}){const[s,l]=e.useState(null),c=1024*i*1024,d=e.useMemo(()=>a||(r?.length?Cc(r):jc),[a,r]),u=e.useMemo(()=>Object.values(d).reduce((e,t)=>e.concat(t),[]).join(","),[d]),p=e.useCallback((e,t)=>{if(t.length>0){const{errors:e}=t[0],n=e[0];return void("file-too-large"===n.code?kc.error(`File size must be under ${i} MB`):"file-invalid-type"===n.code?kc.error(`Invalid file type. Allowed: ${r}`):kc.error(n.message))}const o=e[0];o&&(l(o),n(new File([o],o.name,{type:o.type,lastModified:o.lastModified})),kc.success(`File "${o.name}" selected successfully!`))},[n,i,r]),{getRootProps:f,getInputProps:m,isDragActive:h}=Dn({onDrop:p,maxFiles:1,maxSize:c,accept:d,multiple:!1});return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("p",{className:"font-bold",children:["Envie um arquivo com até ",i," MB."]}),s?t.jsxs("div",{className:"flex items-center justify-between border rounded-md px-3 py-2 bg-white",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ql,{className:"h-4 w-4 text-gray-600"}),t.jsx("span",{className:"text-sm",children:s.name})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("button",{onClick:()=>{const e=document.createElement("input");e.type="file",e.accept=u,e.onchange=e=>{const t=e.target.files?.[0];if(!t)return;const o=Object.values(d).reduce((e,t)=>e.concat(t),[]);o.some(e=>t.name.toLowerCase().endsWith(e.toLowerCase()))?t.size>c?kc.error(`File size must be under ${i} MB`):(l(t),n(t),kc.success(`File "${t.name}" selected successfully!`)):kc.error(`Invalid file type. Allowed: ${o.join(", ")}`)},e.click()},className:"p-1 hover:bg-gray-100 rounded",children:t.jsx(nc,{className:"h-4 w-4"})}),t.jsx("button",{onClick:()=>{l(null),o?.(),kc.success("File removed")},className:"p-1 hover:bg-red-50 rounded",children:t.jsx(rc,{className:"h-4 w-4 text-red-600"})})]})]}):t.jsxs("div",{...f(),className:"border rounded-lg text-center cursor-pointer transition-colors h-[300px] "+(h?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-gray-400"),children:[t.jsx("input",{...m()}),t.jsxs("div",{className:"py-16 px-6 flex flex-col items-center",children:[t.jsx(Ul,{strokeWidth:1,className:"size-[80px] text-[#026CB6]"}),t.jsx("p",{className:"text-muted",children:"Arraste e solte ou selecione um arquivo."}),t.jsxs("p",{className:"text-muted",children:["Arquivos aceitos:",r]})]})]})]})},exports.Input=Ve,exports.Label=Px,exports.Loading=function(){return t.jsxs("div",{className:"flex flex-col items-center justify-center mx-auto",children:[t.jsx(Gw,{size:12}),t.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Loading..."})]})},exports.MarkdownEditor=function({value:n,onChange:o,placeholder:r,error:a,disabled:i,className:s,theme:l}){const c=e.useRef(null),d=e.useRef(!1),[u,p]=e.useState(null),f=ek(r),m=function(){const[t,n]=e.useState(!1);return e.useEffect(()=>{const e=document.documentElement,t=()=>{n(e.classList.contains("dark"))};t();const o=new MutationObserver(t);return o.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>{o.disconnect()}},[]),t}(),h=l??(m?"dark":"light");return e.useEffect(()=>{let e=!0;return Promise.all([import("@toast-ui/react-editor"),import("@toast-ui/editor/dist/toastui-editor.css"),import("@toast-ui/editor/dist/theme/toastui-editor-dark.css")]).then(([t])=>{e&&p(()=>t.Editor)}),()=>{e=!1}},[]),e.useEffect(()=>{d.current=!1},[h]),u?t.jsxs(Ge,{direction:"col",gap:2,className:`markdown-editor ${s??"w-full"}`,children:[t.jsx(u,{initialValue:tk(n,r),usageStatistics:!1,autofocus:!1,initialEditType:"wysiwyg",hideModeSwitch:!0,useCommandShortcut:!i,theme:h,onChange:()=>{if(!d.current)return;const e=c.current?.getInstance()?.getMarkdown()??"";o(Jw(e,f))},onLoad:()=>{const e=c.current?.getInstance(),t=Jw(n,f);e&&(t.trim()?e.setMarkdown(t):e.reset()),window.requestAnimationFrame(()=>{d.current=!0})},ref:c},h),a&&t.jsx("p",{className:"text-sm text-destructive",children:a})]}):t.jsx(Ge,{direction:"col",gap:2,className:s??"w-full min-h-[200px]",children:t.jsx("span",{})})},exports.MultiSelectDropdown=function({options:e,selected:n,onChange:o,placeholder:a="Select items...",className:i,maxDisplay:s=3}){const[l,c]=r.useState(!1),d=n.length===e.length&&e.length>0;return t.jsxs(ch,{open:l,onOpenChange:c,children:[t.jsx(ph,{className:Ie("w-full",i),children:t.jsx("span",{className:Ie("truncate flex-1 text-left",0===n.length&&"text-muted-foreground"),children:(()=>{if(0===n.length)return a;if(n.length>s)return`${n.length} items selected`;const t=n.map(t=>e.find(e=>e.value===t)?.label).join(", ");return t.length>80?`${n.length} item${1!==n.length?"s":""} selected`:t})()})}),t.jsxs(hh,{children:[e.length>0&&t.jsx("div",{className:"border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2 cursor-pointer p-2 hover:bg-accent hover:text-accent-foreground rounded-sm w-full text-left font-medium",children:[t.jsx(Mx,{checked:d,onCheckedChange:()=>{o(d?[]:e.map(e=>e.value))}}),t.jsx("span",{className:"text-sm",children:d?"Unselect All":"Select All"})]})}),t.jsx("div",{className:"p-1 space-y-1",children:e.map(e=>t.jsxs("div",{className:"flex items-center space-x-2 cursor-pointer p-2 hover:bg-accent hover:text-accent-foreground rounded-sm w-full text-left",children:[t.jsx(Mx,{checked:n.includes(e.value),onCheckedChange:()=>(e=>{const t=n.includes(e)?n.filter(t=>t!==e):[...n,e];o(t)})(e.value)}),t.jsx("span",{className:"text-sm",children:e.label})]},e.value))}),n.length>0&&t.jsx("div",{className:"border-t border-border p-2 bg-muted",children:t.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.length," item",1!==n.length?"s":""," selected"]})})]})]})},exports.NoResult=tx,exports.Pagination=({startRecord:e,endRecord:n,hasValidSearchValues:o,tabCount:r,disabledLoadBackButton:a,disabledLoadMoreButton:i,loadBack:s,loadMore:l})=>t.jsxs("div",{className:"flex items-center gap-2 text-fontcolor-secondary",children:[t.jsx("div",{className:"text-sm",children:t.jsxs("p",{children:[e," - ",n," de"," ",o?n:r]})}),t.jsxs("div",{className:"h-[32px] flex items-center",children:[t.jsx(nk,{className:"bg-zinc-900 text-white",trigger:t.jsx(Le,{variant:"ghost",disabled:a,onClick:()=>s(),type:"button",className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:t.jsx("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:t.jsx(Yl,{size:16})})}),children:"Anteriores"}),t.jsx(nk,{className:"bg-zinc-900 text-white",trigger:t.jsx(Le,{variant:"ghost",disabled:i,onClick:()=>l(),className:"bg-transparent p-0 text-fontcolor-secondary hover:bg-transparent",children:t.jsx("div",{className:"w-[32px] h-[32px] bg-transparent flex items-center justify-center cursor-pointer rounded-md hover:bg-tablerow-hoverlink",children:t.jsx(ql,{size:16})})}),children:"Próximos"})]})]}),exports.PopConfirm=function({title:n,description:o,children:r,onConfirm:a,onCancel:i,confirmText:s="Confirmar",cancelText:l="Cancelar",disabled:c=!1,confirmVariant:d="default",confirmTestId:u,cancelTestId:p,side:f="top",align:m="center"}){const[h,v]=e.useState(!1),[g,x]=e.useState(!1);return t.jsxs(xl,{open:h,onOpenChange:e=>{c||g||(v(e),e||i?.())},children:[t.jsx(yl,{asChild:!0,disabled:c,children:r}),t.jsx(bl,{side:f,align:m,className:"w-80 border-border bg-popover p-4 text-popover-foreground",onOpenAutoFocus:e=>e.preventDefault(),children:t.jsxs(Ge,{gap:3,children:[t.jsxs(Ge,{gap:1,children:[t.jsx("p",{className:"text-sm font-medium text-foreground",children:n}),o?t.jsx("p",{className:"text-sm text-muted-foreground",children:o}):null]}),t.jsxs(Ge,{direction:"row",gap:2,className:"justify-end",children:[t.jsx(Le,{type:"button",variant:"secondary",size:"sm",onClick:()=>{v(!1),i?.()},disabled:g,"data-testid":p,children:l}),t.jsx(Le,{type:"button",variant:"destructive"===d?"destructive":"default",size:"sm",onClick:async()=>{x(!0);try{await a(),v(!1)}finally{x(!1)}},disabled:g,"data-testid":u,children:g?"Confirmando...":s})]})]})})]})},exports.Popover=xl,exports.PopoverContent=bl,exports.PopoverTrigger=yl,exports.PumpwoodBadge=function({className:e,variant:n,size:o,...r}){const a=Ie(Ml({variant:n,size:o}),e);return t.jsx("div",{className:a,...r})},exports.PumpwoodCard=Sl,exports.PumpwoodTable=px,exports.Radio=Uw,exports.RangePicker=({id:e,placeholder:n,fromValue:o,toValue:r,onFromChange:a,onToChange:i,className:s,dateFormat:l="dd/MM/yyyy"})=>{const c={from:Jg(o),to:Jg(r)},d=Boolean(o?.trim()||r?.trim()),u=((e,t,n,o)=>{const r=ex(e,n),a=ex(t,n);return r&&a?"{from} - {to}".replace("{from}",r).replace("{to}",a):r?"{from} - …".replace("{from}",r):o})(o,r,l,n);return t.jsx("div",{className:Ie("flex w-full min-w-0",s),children:t.jsxs(xl,{children:[t.jsx(yl,{asChild:!0,children:t.jsxs("button",{type:"button","data-testid":e,className:Ie(We,"justify-start text-left",!d&&Be),children:[t.jsx(Wl,{className:Ie("mr-2",$e)}),u]})}),t.jsx(bl,{className:"w-fit p-0",align:"start",children:t.jsx(Zg,{mode:"range",selected:c,onSelect:e=>{if(!e)return a?.(""),void i?.("");e.from?a?.(Rh(e.from).toISOString()):a?.(""),e.to?i?.(Fh(e.to).toISOString()):i?.("")},initialFocus:!0,numberOfMonths:2})})]})})},exports.Select=e=>{if("fk"===e.variant){const{variant:n,...o}=e;return t.jsx(Xp,{...o})}return t.jsx(yh,{...e})},exports.SelectContent=hh,exports.SelectGroup=dh,exports.SelectItem=gh,exports.SelectLabel=vh,exports.SelectPrimitive=ch,exports.SelectScrollDownButton=mh,exports.SelectScrollUpButton=fh,exports.SelectSeparator=xh,exports.SelectTrigger=ph,exports.SelectValue=uh,exports.Sidebar=Sc,exports.Skeleton=dx,exports.Spinner=Gw,exports.Stack=Ge,exports.Table=function({data:e,columns:n,getRowKey:o,ordering:r,onSort:a,onRowClick:i,isLoading:s,hasMore:l,onLoadMore:c,className:d}){const u=Boolean(s&&0===e.length),p=n??[];return s||0!==e.length?t.jsx("div",{className:Ie("flex flex-1 min-h-0 flex-col mt-4",d),children:t.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:t.jsxs(nx,{wrap:!1,className:"table-fixed w-full",children:[t.jsx(ox,{className:"sticky top-0 z-10 bg-primary text-white",children:t.jsx(fx,{columns:p,ordering:r,onSort:a})}),t.jsxs(rx,{children:[u?t.jsx(ux,{columns:p.map(e=>({width:e.width,cellClassName:e.cellClassName}))}):e.map(e=>t.jsx(mx,{item:e,columns:p,onClick:i?()=>i(e):void 0},o(e))),l&&c&&!u&&t.jsx(ix,{children:t.jsx(lx,{colSpan:p.length,className:"text-center py-6",children:t.jsx(Le,{onClick:c,disabled:s,variant:"outline",children:s?"Carregando...":"Carregar Mais"})})})]})]})})}):t.jsx("div",{className:Ie("flex-1 mt-4",d),children:t.jsx("div",{className:"py-20",children:t.jsx(tx,{})})})},exports.TableBody=rx,exports.TableCaption=cx,exports.TableCell=lx,exports.TableFooter=ax,exports.TableHead=sx,exports.TableHeader=ox,exports.TablePrimitive=nx,exports.TableRow=ix,exports.TableSkeleton=ux,exports.Tabs=pd,exports.TabsContent=hd,exports.TabsList=fd,exports.TabsTrigger=md,exports.TagInput=function({value:n=[],onChange:o,keyPlaceholder:r="Chave",valuePlaceholder:a="Valor",disabled:i=!1}){const[s,l]=e.useState(""),[c,d]=e.useState(""),u=()=>{const e=s.trim(),t=c.trim();if(e&&t){n.some(t=>t.key===e)||(o([...n,{key:e,value:t}]),l(""),d(""))}},p=e=>{"Enter"===e.key&&(e.preventDefault(),u())};return t.jsxs(Ge,{direction:"col",gap:3,children:[t.jsxs(Ge,{direction:"row",gap:2,children:[t.jsx(Ve,{value:s,onChange:e=>l(e.target.value),onKeyDown:p,placeholder:r,disabled:i,className:"flex-1"}),t.jsx(Ve,{value:c,onChange:e=>d(e.target.value),onKeyDown:p,placeholder:a,disabled:i,className:"flex-1"}),t.jsx(Le,{type:"button",onClick:u,disabled:!s.trim()||!c.trim()||i,variant:"outline",children:"Adicionar"})]}),n.length>0&&t.jsx(Ge,{direction:"row",gap:2,className:"flex-wrap",children:n.map(e=>t.jsxs(Ge,{direction:"row",gap:1,className:"items-center px-3 py-1 bg-secondary text-secondary-foreground rounded-md text-sm",children:[t.jsxs("span",{className:"font-medium",children:[e.key,":"]}),t.jsx("span",{children:e.value}),t.jsx(Le,{type:"button",onClick:()=>{return t=e.key,void o(n.filter(e=>e.key!==t));var t},disabled:i,variant:"ghost",size:"icon",className:"h-4 w-4 p-0 hover:bg-secondary-foreground/10 rounded-full","aria-label":`Remover tag ${e.key}`,children:t.jsx(ac,{className:"h-3 w-3"})})]},e.key))})]})},exports.Textarea=Ue,exports.Tooltip=sy,exports.TooltipComponent=nk,exports.TooltipContent=cy,exports.TooltipProvider=iy,exports.TooltipTrigger=ly,exports.Typography=wl,exports.badgeVariants=El,exports.createFKSelectFetcher=(e,t,n={})=>o=>Zw(e,{...o,labelName:t,additionalFilters:n.additionalFilters,fields:n.fields}),exports.fkSelectFetcher=Zw,exports.pumpwoodBadgeVariants=Ml,exports.useSidebarCollapse=function({initialCollapsed:t=!1,onPersist:n}={}){const[o,r]=e.useState(t),[a,i]=e.useState(!1),s=e.useCallback(()=>{i(!0),r(e=>{const t=!e;return n?.(t),t})},[n]),l=e.useCallback(()=>{i(!0),r(!1),n?.(!1)},[n]),c=e.useCallback(()=>{i(!1)},[]),[d,u]=e.useState({}),p=e.useCallback(e=>{if(o)return l(),void u({[e]:!0});u(t=>({...t,[e]:!t[e]}))},[o,l]),f=e.useCallback(()=>{u({})},[]);return{isCollapsed:o,isCollapsing:a,expandedItems:d,setExpandedItems:u,toggleCollapse:s,expand:l,handleTransitionEnd:c,toggleExpanded:p,setExpandedOnCollapse:f}};