module.exports=[13647,(a,b,c)=>{"use strict";var d=a.r(54297);d.useState,d.useEffect,d.useLayoutEffect,d.useDebugValue,c.useSyncExternalStore=void 0!==d.useSyncExternalStore?d.useSyncExternalStore:function(a,b){return b()}},81271,(a,b,c)=>{"use strict";b.exports=a.r(13647)},64041,a=>{"use strict";var b=a.i(6155),c=a.i(54297),d=a.i(74719),e=a.i(43181),f=a.i(13866),g=a.i(99766),h=a.i(8895),i=a.i(82953),j=a.i(68771),k=a.i(33293),l=a.i(58011),m=a.i(25278),n=a.i(13909),o=a.i(9562),p=a.i(94446),q=a.i(19766),r=a.i(6789),s=a.i(39622),t=a.i(18607),u=a.i(93392),v=a.i(9478),w=a.i(4777),x=a.i(92192),y="Popover",[z,A]=(0,l.createContextScope)(y,[q.createPopperScope]),B=(0,q.createPopperScope)(),[C,D]=z(y),E=a=>{let{__scopePopover:d,children:e,open:f,defaultOpen:g,onOpenChange:h,modal:i=!1}=a,j=B(d),k=c.useRef(null),[l,m]=c.useState(!1),[n=!1,o]=(0,v.useControllableState)({prop:f,defaultProp:g,onChange:h});return(0,b.jsx)(q.Root,{...j,children:(0,b.jsx)(C,{scope:d,contentId:(0,p.useId)(),triggerRef:k,open:n,onOpenChange:o,onOpenToggle:c.useCallback(()=>o(a=>!a),[o]),hasCustomAnchor:l,onCustomAnchorAdd:c.useCallback(()=>m(!0),[]),onCustomAnchorRemove:c.useCallback(()=>m(!1),[]),modal:i,children:e})})};E.displayName=y;var F="PopoverAnchor";c.forwardRef((a,d)=>{let{__scopePopover:e,...f}=a,g=D(F,e),h=B(e),{onCustomAnchorAdd:i,onCustomAnchorRemove:j}=g;return c.useEffect(()=>(i(),()=>j()),[i,j]),(0,b.jsx)(q.Anchor,{...h,...f,ref:d})}).displayName=F;var G="PopoverTrigger",H=c.forwardRef((a,c)=>{let{__scopePopover:d,...e}=a,f=D(G,d),g=B(d),h=(0,k.useComposedRefs)(c,f.triggerRef),i=(0,b.jsx)(t.Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.contentId,"data-state":S(f.open),...e,ref:h,onClick:(0,j.composeEventHandlers)(a.onClick,f.onOpenToggle)});return f.hasCustomAnchor?i:(0,b.jsx)(q.Anchor,{asChild:!0,...g,children:i})});H.displayName=G;var I="PopoverPortal",[J,K]=z(I,{forceMount:void 0}),L=a=>{let{__scopePopover:c,forceMount:d,children:e,container:f}=a,g=D(I,c);return(0,b.jsx)(J,{scope:c,forceMount:d,children:(0,b.jsx)(s.Presence,{present:d||g.open,children:(0,b.jsx)(r.Portal,{asChild:!0,container:f,children:e})})})};L.displayName=I;var M="PopoverContent",N=c.forwardRef((a,c)=>{let d=K(M,a.__scopePopover),{forceMount:e=d.forceMount,...f}=a,g=D(M,a.__scopePopover);return(0,b.jsx)(s.Presence,{present:e||g.open,children:g.modal?(0,b.jsx)(O,{...f,ref:c}):(0,b.jsx)(P,{...f,ref:c})})});N.displayName=M;var O=c.forwardRef((a,d)=>{let e=D(M,a.__scopePopover),f=c.useRef(null),g=(0,k.useComposedRefs)(d,f),h=c.useRef(!1);return c.useEffect(()=>{let a=f.current;if(a)return(0,w.hideOthers)(a)},[]),(0,b.jsx)(x.RemoveScroll,{as:u.Slot,allowPinchZoom:!0,children:(0,b.jsx)(Q,{...a,ref:g,trapFocus:e.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,j.composeEventHandlers)(a.onCloseAutoFocus,a=>{a.preventDefault(),h.current||e.triggerRef.current?.focus()}),onPointerDownOutside:(0,j.composeEventHandlers)(a.onPointerDownOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey;h.current=2===b.button||c},{checkForDefaultPrevented:!1}),onFocusOutside:(0,j.composeEventHandlers)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),P=c.forwardRef((a,d)=>{let e=D(M,a.__scopePopover),f=c.useRef(!1),g=c.useRef(!1);return(0,b.jsx)(Q,{...a,ref:d,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),b.defaultPrevented||(f.current||e.triggerRef.current?.focus(),b.preventDefault()),f.current=!1,g.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||(f.current=!0,"pointerdown"===b.detail.originalEvent.type&&(g.current=!0));let c=b.target;e.triggerRef.current?.contains(c)&&b.preventDefault(),"focusin"===b.detail.originalEvent.type&&g.current&&b.preventDefault()}})}),Q=c.forwardRef((a,c)=>{let{__scopePopover:d,trapFocus:e,onOpenAutoFocus:f,onCloseAutoFocus:g,disableOutsidePointerEvents:h,onEscapeKeyDown:i,onPointerDownOutside:j,onFocusOutside:k,onInteractOutside:l,...p}=a,r=D(M,d),s=B(d);return(0,n.useFocusGuards)(),(0,b.jsx)(o.FocusScope,{asChild:!0,loop:!0,trapped:e,onMountAutoFocus:f,onUnmountAutoFocus:g,children:(0,b.jsx)(m.DismissableLayer,{asChild:!0,disableOutsidePointerEvents:h,onInteractOutside:l,onEscapeKeyDown:i,onPointerDownOutside:j,onFocusOutside:k,onDismiss:()=>r.onOpenChange(!1),children:(0,b.jsx)(q.Content,{"data-state":S(r.open),role:"dialog",id:r.contentId,...s,...p,ref:c,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),R="PopoverClose";function S(a){return a?"open":"closed"}c.forwardRef((a,c)=>{let{__scopePopover:d,...e}=a,f=D(R,d);return(0,b.jsx)(t.Primitive.button,{type:"button",...e,ref:c,onClick:(0,j.composeEventHandlers)(a.onClick,()=>f.onOpenChange(!1))})}).displayName=R,c.forwardRef((a,c)=>{let{__scopePopover:d,...e}=a,f=B(d);return(0,b.jsx)(q.Arrow,{...f,...e,ref:c})}).displayName="PopoverArrow";var T=a.i(12348);function U({...a}){return(0,b.jsx)(E,{"data-slot":"popover",...a})}function V({...a}){return(0,b.jsx)(H,{"data-slot":"popover-trigger",...a})}function W({className:a,align:c="center",sideOffset:d=4,...e}){return(0,b.jsx)(L,{children:(0,b.jsx)(N,{"data-slot":"popover-content",align:c,sideOffset:d,className:(0,T.cn)("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",a),...e})})}var X=/[\\\/_+.#"@\[\(\{&]/,Y=/[\\\/_+.#"@\[\(\{&]/g,Z=/[\s-]/,$=/[\s-]/g;function _(a){return a.toLowerCase().replace($," ")}var aa=a.i(61660);function ab(a,b){if("function"==typeof a)return a(b);null!=a&&(a.current=b)}a.i(7614);var ac=Symbol.for("react.lazy"),ad=c[" use ".trim().toString()];function ae(a){var b;return null!=a&&"object"==typeof a&&"$$typeof"in a&&a.$$typeof===ac&&"_payload"in a&&"object"==typeof(b=a._payload)&&null!==b&&"then"in b}var af=Symbol("radix.slottable");function ag(a){return c.isValidElement(a)&&"function"==typeof a.type&&"__radixId"in a.type&&a.type.__radixId===af}var ah=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((a,d)=>{var e,f;let g,h,i,j=(f=e=`Primitive.${d}`,(g=c.forwardRef((a,b)=>{let{children:d,...e}=a;if(ae(d)&&"function"==typeof ad&&(d=ad(d._payload)),c.isValidElement(d)){var f;let a,g,h=(f=d,(g=(a=Object.getOwnPropertyDescriptor(f.props,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?f.ref:(g=(a=Object.getOwnPropertyDescriptor(f,"ref")?.get)&&"isReactWarning"in a&&a.isReactWarning)?f.props.ref:f.props.ref||f.ref),i=function(a,b){let c={...b};for(let d in b){let e=a[d],f=b[d];/^on[A-Z]/.test(d)?e&&f?c[d]=(...a)=>{let b=f(...a);return e(...a),b}:e&&(c[d]=e):"style"===d?c[d]={...e,...f}:"className"===d&&(c[d]=[e,f].filter(Boolean).join(" "))}return{...a,...c}}(e,d.props);return d.type!==c.Fragment&&(i.ref=b?function(...a){return b=>{let c=!1,d=a.map(a=>{let d=ab(a,b);return c||"function"!=typeof d||(c=!0),d});if(c)return()=>{for(let b=0;b1?c.Children.only(null):null})).displayName=`${f}.SlotClone`,h=g,(i=c.forwardRef((a,d)=>{let{children:e,...f}=a;ae(e)&&"function"==typeof ad&&(e=ad(e._payload));let g=c.Children.toArray(e),i=g.find(ag);if(i){let a=i.props.children,e=g.map(b=>b!==i?b:c.Children.count(a)>1?c.Children.only(null):c.isValidElement(a)?a.props.children:null);return(0,b.jsx)(h,{...f,ref:d,children:c.isValidElement(a)?c.cloneElement(a,void 0,e):null})}return(0,b.jsx)(h,{...f,ref:d,children:e})})).displayName=`${e}.Slot`,i),k=c.forwardRef((a,c)=>{let{asChild:e,...f}=a;return(0,b.jsx)(e?j:d,{...f,ref:c})});return k.displayName=`Primitive.${d}`,{...a,[d]:k}},{}),ai=globalThis?.document?c.useLayoutEffect:()=>{},aj=c[" useId ".trim().toString()]||(()=>void 0),ak=0;function al(a){let[b,d]=c.useState(aj());return ai(()=>{a||d(a=>a??String(ak++))},[a]),a||(b?`radix-${b}`:"")}var am=a.i(81271),an='[cmdk-group=""]',ao='[cmdk-group-items=""]',ap='[cmdk-item=""]',aq=`${ap}:not([aria-disabled="true"])`,ar="cmdk-item-select",as="data-value",at=(a,b,c)=>{var d;return d=a,function a(b,c,d,e,f,g,h){if(g===c.length)return f===b.length?1:.99;var i=`${f},${g}`;if(void 0!==h[i])return h[i];for(var j,k,l,m,n=e.charAt(g),o=d.indexOf(n,f),p=0;o>=0;)(j=a(b,c,d,e,o+1,g+1,h))>p&&(o===f?j*=1:X.test(b.charAt(o-1))?(j*=.8,(l=b.slice(f,o-1).match(Y))&&f>0&&(j*=Math.pow(.999,l.length))):Z.test(b.charAt(o-1))?(j*=.9,(m=b.slice(f,o-1).match($))&&f>0&&(j*=Math.pow(.999,m.length))):(j*=.17,f>0&&(j*=Math.pow(.999,o-f))),b.charAt(o)!==c.charAt(g)&&(j*=.9999)),(j<.1&&d.charAt(o-1)===e.charAt(g+1)||e.charAt(g+1)===e.charAt(g)&&d.charAt(o-1)!==e.charAt(g))&&.1*(k=a(b,c,d,e,o+1,g+2,h))>j&&(j=.1*k),j>p&&(p=j),o=d.indexOf(n,o+1);return h[i]=p,p}(d=c&&c.length>0?`${d+" "+c.join(" ")}`:d,b,_(d),_(b),0,0,{})},au=c.createContext(void 0),av=c.createContext(void 0),aw=c.createContext(void 0),ax=c.forwardRef((a,b)=>{let d=aH(()=>{var b,c;return{search:"",value:null!=(c=null!=(b=a.value)?b:a.defaultValue)?c:"",filtered:{count:0,items:new Map,groups:new Set}}}),e=aH(()=>new Set),f=aH(()=>new Map),g=aH(()=>new Map),h=aH(()=>new Set),i=aF(a),{label:j,children:k,value:l,onValueChange:m,filter:n,shouldFilter:o,loop:p,disablePointerSelection:q=!1,vimBindings:r=!0,...s}=a,t=al(),u=al(),v=al(),w=c.useRef(null),x=aL();aG(()=>{if(void 0!==l){let a=l.trim();d.current.value=a,y.emit()}},[l]),aG(()=>{x(6,E)},[]);let y=c.useMemo(()=>({subscribe:a=>(h.current.add(a),()=>h.current.delete(a)),snapshot:()=>d.current,setState:(a,b,c)=>{var e,f,g;if(!Object.is(d.current[a],b)){if(d.current[a]=b,"search"===a)D(),B(),x(1,C);else if("value"===a&&(c||x(5,E),(null==(e=i.current)?void 0:e.value)!==void 0)){null==(g=(f=i.current).onValueChange)||g.call(f,null!=b?b:"");return}y.emit()}},emit:()=>{h.current.forEach(a=>a())}}),[]),z=c.useMemo(()=>({value:(a,b,c)=>{var e;b!==(null==(e=g.current.get(a))?void 0:e.value)&&(g.current.set(a,{value:b,keywords:c}),d.current.filtered.items.set(a,A(b,c)),x(2,()=>{B(),y.emit()}))},item:(a,b)=>(e.current.add(a),b&&(f.current.has(b)?f.current.get(b).add(a):f.current.set(b,new Set([a]))),x(3,()=>{D(),B(),d.current.value||C(),y.emit()}),()=>{g.current.delete(a),e.current.delete(a),d.current.filtered.items.delete(a);let b=F();x(4,()=>{D(),(null==b?void 0:b.getAttribute("id"))===a&&C(),y.emit()})}),group:a=>(f.current.has(a)||f.current.set(a,new Set),()=>{g.current.delete(a),f.current.delete(a)}),filter:()=>i.current.shouldFilter,label:j||a["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:t,inputId:v,labelId:u,listInnerRef:w}),[]);function A(a,b){var c,e;let f=null!=(e=null==(c=i.current)?void 0:c.filter)?e:at;return a?f(a,d.current.search,b):0}function B(){if(!d.current.search||!1===i.current.shouldFilter)return;let a=d.current.filtered.items,b=[];d.current.filtered.groups.forEach(c=>{let d=f.current.get(c),e=0;d.forEach(b=>{e=Math.max(a.get(b),e)}),b.push([c,e])});let c=w.current;G().sort((b,c)=>{var d,e;let f=b.getAttribute("id"),g=c.getAttribute("id");return(null!=(d=a.get(g))?d:0)-(null!=(e=a.get(f))?e:0)}).forEach(a=>{let b=a.closest(ao);b?b.appendChild(a.parentElement===b?a:a.closest(`${ao} > *`)):c.appendChild(a.parentElement===c?a:a.closest(`${ao} > *`))}),b.sort((a,b)=>b[1]-a[1]).forEach(a=>{var b;let c=null==(b=w.current)?void 0:b.querySelector(`${an}[${as}="${encodeURIComponent(a[0])}"]`);null==c||c.parentElement.appendChild(c)})}function C(){let a=G().find(a=>"true"!==a.getAttribute("aria-disabled")),b=null==a?void 0:a.getAttribute(as);y.setState("value",b||void 0)}function D(){var a,b,c,h;if(!d.current.search||!1===i.current.shouldFilter){d.current.filtered.count=e.current.size;return}d.current.filtered.groups=new Set;let j=0;for(let f of e.current){let e=A(null!=(b=null==(a=g.current.get(f))?void 0:a.value)?b:"",null!=(h=null==(c=g.current.get(f))?void 0:c.keywords)?h:[]);d.current.filtered.items.set(f,e),e>0&&j++}for(let[a,b]of f.current)for(let c of b)if(d.current.filtered.items.get(c)>0){d.current.filtered.groups.add(a);break}d.current.filtered.count=j}function E(){var a,b,c;let d=F();d&&((null==(a=d.parentElement)?void 0:a.firstChild)===d&&(null==(c=null==(b=d.closest(an))?void 0:b.querySelector('[cmdk-group-heading=""]'))||c.scrollIntoView({block:"nearest"})),d.scrollIntoView({block:"nearest"}))}function F(){var a;return null==(a=w.current)?void 0:a.querySelector(`${ap}[aria-selected="true"]`)}function G(){var a;return Array.from((null==(a=w.current)?void 0:a.querySelectorAll(aq))||[])}function H(a){let b=G()[a];b&&y.setState("value",b.getAttribute(as))}function I(a){var b;let c=F(),d=G(),e=d.findIndex(a=>a===c),f=d[e+a];null!=(b=i.current)&&b.loop&&(f=e+a<0?d[d.length-1]:e+a===d.length?d[0]:d[e+a]),f&&y.setState("value",f.getAttribute(as))}function J(a){let b=F(),c=null==b?void 0:b.closest(an),d;for(;c&&!d;)d=null==(c=a>0?function(a,b){let c=a.nextElementSibling;for(;c;){if(c.matches(b))return c;c=c.nextElementSibling}}(c,an):function(a,b){let c=a.previousElementSibling;for(;c;){if(c.matches(b))return c;c=c.previousElementSibling}}(c,an))?void 0:c.querySelector(aq);d?y.setState("value",d.getAttribute(as)):I(a)}let K=()=>H(G().length-1),L=a=>{a.preventDefault(),a.metaKey?K():a.altKey?J(1):I(1)},M=a=>{a.preventDefault(),a.metaKey?H(0):a.altKey?J(-1):I(-1)};return c.createElement(ah.div,{ref:b,tabIndex:-1,...s,"cmdk-root":"",onKeyDown:a=>{var b;if(null==(b=s.onKeyDown)||b.call(s,a),!a.defaultPrevented)switch(a.key){case"n":case"j":r&&a.ctrlKey&&L(a);break;case"ArrowDown":L(a);break;case"p":case"k":r&&a.ctrlKey&&M(a);break;case"ArrowUp":M(a);break;case"Home":a.preventDefault(),H(0);break;case"End":a.preventDefault(),K();break;case"Enter":if(!a.nativeEvent.isComposing&&229!==a.keyCode){a.preventDefault();let b=F();if(b){let a=new Event(ar);b.dispatchEvent(a)}}}}},c.createElement("label",{"cmdk-label":"",htmlFor:z.inputId,id:z.labelId,style:aN},j),aM(a,a=>c.createElement(av.Provider,{value:y},c.createElement(au.Provider,{value:z},a))))}),ay=c.forwardRef((a,b)=>{var d,e;let f=al(),g=c.useRef(null),h=c.useContext(aw),i=c.useContext(au),j=aF(a),k=null!=(e=null==(d=j.current)?void 0:d.forceMount)?e:null==h?void 0:h.forceMount;aG(()=>{if(!k)return i.item(f,null==h?void 0:h.id)},[k]);let l=aK(f,g,[a.value,a.children,g],a.keywords),m=c.useContext(av),n=aJ(a=>a.value&&a.value===l.current),o=aJ(a=>!!k||!1===i.filter()||!a.search||a.filtered.items.get(f)>0);function p(){var a,b;q(),null==(b=(a=j.current).onSelect)||b.call(a,l.current)}function q(){m.setState("value",l.current,!0)}if(c.useEffect(()=>{let b=g.current;if(!(!b||a.disabled))return b.addEventListener(ar,p),()=>b.removeEventListener(ar,p)},[o,a.onSelect,a.disabled]),!o)return null;let{disabled:r,value:s,onSelect:t,forceMount:u,keywords:v,...w}=a;return c.createElement(ah.div,{ref:aI([g,b]),...w,id:f,"cmdk-item":"",role:"option","aria-disabled":!!r,"aria-selected":!!n,"data-disabled":!!r,"data-selected":!!n,onPointerMove:r||i.getDisablePointerSelection()?void 0:q,onClick:r?void 0:p},a.children)}),az=c.forwardRef((a,b)=>{let{heading:d,children:e,forceMount:f,...g}=a,h=al(),i=c.useRef(null),j=c.useRef(null),k=al(),l=c.useContext(au),m=aJ(a=>!!f||!1===l.filter()||!a.search||a.filtered.groups.has(h));aG(()=>l.group(h),[]),aK(h,i,[a.value,a.heading,j]);let n=c.useMemo(()=>({id:h,forceMount:f}),[f]);return c.createElement(ah.div,{ref:aI([i,b]),...g,"cmdk-group":"",role:"presentation",hidden:!m||void 0},d&&c.createElement("div",{ref:j,"cmdk-group-heading":"","aria-hidden":!0,id:k},d),aM(a,a=>c.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":d?k:void 0},c.createElement(aw.Provider,{value:n},a))))}),aA=c.forwardRef((a,b)=>{let{alwaysRender:d,...e}=a,f=c.useRef(null),g=aJ(a=>!a.search);return d||g?c.createElement(ah.div,{ref:aI([f,b]),...e,"cmdk-separator":"",role:"separator"}):null}),aB=c.forwardRef((a,b)=>{let{onValueChange:d,...e}=a,f=null!=a.value,g=c.useContext(av),h=aJ(a=>a.search),i=aJ(a=>a.value),j=c.useContext(au),k=c.useMemo(()=>{var a;let b=null==(a=j.listInnerRef.current)?void 0:a.querySelector(`${ap}[${as}="${encodeURIComponent(i)}"]`);return null==b?void 0:b.getAttribute("id")},[]);return c.useEffect(()=>{null!=a.value&&g.setState("search",a.value)},[a.value]),c.createElement(ah.input,{ref:b,...e,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":j.listId,"aria-labelledby":j.labelId,"aria-activedescendant":k,id:j.inputId,type:"text",value:f?a.value:h,onChange:a=>{f||g.setState("search",a.target.value),null==d||d(a.target.value)}})}),aC=c.forwardRef((a,b)=>{let{children:d,label:e="Suggestions",...f}=a,g=c.useRef(null),h=c.useRef(null),i=c.useContext(au);return c.useEffect(()=>{if(h.current&&g.current){let a=h.current,b=g.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let c=a.offsetHeight;b.style.setProperty("--cmdk-list-height",c.toFixed(1)+"px")})});return d.observe(a),()=>{cancelAnimationFrame(c),d.unobserve(a)}}},[]),c.createElement(ah.div,{ref:aI([g,b]),...f,"cmdk-list":"",role:"listbox","aria-label":e,id:i.listId},aM(a,a=>c.createElement("div",{ref:aI([h,i.listInnerRef]),"cmdk-list-sizer":""},a)))}),aD=c.forwardRef((a,b)=>{let{open:d,onOpenChange:e,overlayClassName:f,contentClassName:g,container:h,...i}=a;return c.createElement(aa.Root,{open:d,onOpenChange:e},c.createElement(aa.Portal,{container:h},c.createElement(aa.Overlay,{"cmdk-overlay":"",className:f}),c.createElement(aa.Content,{"aria-label":a.label,"cmdk-dialog":"",className:g},c.createElement(ax,{ref:b,...i}))))}),aE=Object.assign(ax,{List:aC,Item:ay,Input:aB,Group:az,Separator:aA,Dialog:aD,Empty:c.forwardRef((a,b)=>aJ(a=>0===a.filtered.count)?c.createElement(ah.div,{ref:b,...a,"cmdk-empty":"",role:"presentation"}):null),Loading:c.forwardRef((a,b)=>{let{progress:d,children:e,label:f="Loading...",...g}=a;return c.createElement(ah.div,{ref:b,...g,"cmdk-loading":"",role:"progressbar","aria-valuenow":d,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f},aM(a,a=>c.createElement("div",{"aria-hidden":!0},a)))})});function aF(a){let b=c.useRef(a);return aG(()=>{b.current=a}),b}var aG=c.useEffect;function aH(a){let b=c.useRef();return void 0===b.current&&(b.current=a()),b}function aI(a){return b=>{a.forEach(a=>{"function"==typeof a?a(b):null!=a&&(a.current=b)})}}function aJ(a){let b=c.useContext(av),d=()=>a(b.snapshot());return(0,am.useSyncExternalStore)(b.subscribe,d,d)}function aK(a,b,d,e=[]){let f=c.useRef(),g=c.useContext(au);return aG(()=>{var c;let h=(()=>{var a;for(let b of d){if("string"==typeof b)return b.trim();if("object"==typeof b&&"current"in b)return b.current?null==(a=b.current.textContent)?void 0:a.trim():f.current}})(),i=e.map(a=>a.trim());g.value(a,h,i),null==(c=b.current)||c.setAttribute(as,h),f.current=h}),f}var aL=()=>{let[a,b]=c.useState(),d=aH(()=>new Map);return aG(()=>{d.current.forEach(a=>a()),d.current=new Map},[a]),(a,c)=>{d.current.set(a,c),b({})}};function aM({asChild:a,children:b},d){let e;return a&&c.isValidElement(b)?c.cloneElement("function"==typeof(e=b.type)?e(b.props):"render"in e?e.render(b.props):b,{ref:b.ref},d(b.props.children)):d(b)}var aN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},aO=a.i(60873),aO=aO;function aP({className:a,...c}){return(0,b.jsx)(aE,{"data-slot":"command",className:(0,T.cn)("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",a),...c})}function aQ({className:a,...c}){return(0,b.jsxs)("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[(0,b.jsx)(aO.default,{className:"size-4 shrink-0 opacity-50"}),(0,b.jsx)(aE.Input,{"data-slot":"command-input",className:(0,T.cn)("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",a),...c})]})}function aR({className:a,...c}){return(0,b.jsx)(aE.List,{"data-slot":"command-list",className:(0,T.cn)("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",a),...c})}function aS({...a}){return(0,b.jsx)(aE.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...a})}function aT({className:a,...c}){return(0,b.jsx)(aE.Group,{"data-slot":"command-group",className:(0,T.cn)("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",a),...c})}function aU({className:a,...c}){return(0,b.jsx)(aE.Item,{"data-slot":"command-item",className:(0,T.cn)("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",a),...c})}a.i(87240);var aV=a.i(13852),aV=aV;let aW=(0,a.i(37111).default)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);var aX=a.i(18951),aY=a.i(26269),aZ=a.i(24681),a$=a.i(1845),a_=a.i(14672);function a0(){let a,j,k,l,m,n,{treeData:o}=(0,e.useFamily)(),{calculateRelationship:p,getDirectRelatives:q,getSiblings:r}=(0,f.useRelationship)(),{data:s,status:t}=(0,a$.useSession)(),u=(0,a_.useRouter)(),[v,w]=(0,c.useState)(""),[x,y]=(0,c.useState)(""),[z,A]=(0,c.useState)(null),[B,C]=(0,c.useState)(!1),[D,E]=(0,c.useState)(!1);(0,c.useEffect)(()=>{"unauthenticated"===t&&u.push("/auth/signin")},[t,u]);let F=Object.values(o.members);if("loading"===t||!s)return null;if(0===F.length)return(0,b.jsxs)("div",{className:"min-h-screen flex flex-col bg-background",children:[(0,b.jsx)(d.SiteHeader,{}),(0,b.jsx)("main",{className:"flex-1 flex items-center justify-center",children:(0,b.jsxs)("div",{className:"text-center space-y-4",children:[(0,b.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 text-primary/80",children:(0,b.jsx)(aX.Users,{className:"h-16 w-16",strokeWidth:1})}),(0,b.jsx)("p",{className:"text-base text-foreground font-light tracking-wide",children:"关系待解"})]})})]});return(0,b.jsxs)("div",{className:"min-h-screen flex flex-col bg-background",children:[(0,b.jsx)(d.SiteHeader,{}),(0,b.jsx)("main",{className:"flex-1 container mx-auto px-4 py-6",children:(0,b.jsxs)("div",{className:"max-w-4xl mx-auto space-y-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-serif font-bold mb-1",children:"家族关系计算器"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:"选择两个家族成员,自动计算他们之间的亲属关系"})]}),(0,b.jsxs)(g.Card,{className:"border-none shadow-sm bg-card/50 backdrop-blur",children:[(0,b.jsxs)(g.CardHeader,{className:"text-center pb-4",children:[(0,b.jsx)(g.CardTitle,{className:"text-xl font-serif font-light",children:"选择成员"}),(0,b.jsx)(g.CardDescription,{className:"text-sm font-light",children:"请选择要计算关系的两个成员"})]}),(0,b.jsxs)(g.CardContent,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:"成员A"}),(0,b.jsxs)(U,{open:B,onOpenChange:C,children:[(0,b.jsx)(V,{asChild:!0,children:(0,b.jsxs)(h.Button,{variant:"outline",role:"combobox","aria-expanded":B,className:"w-full justify-between",children:[v&&(m=F.find(a=>a.id===v))?(0,b.jsx)(aY.MemberNameWithStatus,{name:m.fullName,isDead:!!m.deathDate}):"搜索或选择成员A...",(0,b.jsx)(aW,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(W,{className:"w-full p-0",align:"start",children:(0,b.jsxs)(aP,{children:[(0,b.jsx)(aQ,{placeholder:"输入姓名搜索..."}),(0,b.jsxs)(aR,{children:[(0,b.jsx)(aS,{children:"未找到成员"}),(0,b.jsx)(aT,{children:F.map(a=>(0,b.jsxs)(aU,{value:`${a.fullName} ${a.generation}`,onSelect:()=>{w(a.id),C(!1)},children:[(0,b.jsx)(aV.default,{className:(0,T.cn)("mr-2 h-4 w-4",v===a.id?"opacity-100":"opacity-0")}),(0,b.jsx)(aY.MemberNameWithStatus,{name:a.fullName,isDead:!!a.deathDate})," (第",a.generation,"世)"]},a.id))})]})]})})]})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("label",{className:"text-sm font-medium",children:"成员B"}),(0,b.jsxs)(U,{open:D,onOpenChange:E,children:[(0,b.jsx)(V,{asChild:!0,children:(0,b.jsxs)(h.Button,{variant:"outline",role:"combobox","aria-expanded":D,className:"w-full justify-between",children:[x&&(n=F.find(a=>a.id===x))?(0,b.jsx)(aY.MemberNameWithStatus,{name:n.fullName,isDead:!!n.deathDate}):"搜索或选择成员B...",(0,b.jsx)(aW,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,b.jsx)(W,{className:"w-full p-0",align:"start",children:(0,b.jsxs)(aP,{children:[(0,b.jsx)(aQ,{placeholder:"输入姓名搜索..."}),(0,b.jsxs)(aR,{children:[(0,b.jsx)(aS,{children:"未找到成员"}),(0,b.jsx)(aT,{children:F.map(a=>(0,b.jsxs)(aU,{value:`${a.fullName} ${a.generation}`,onSelect:()=>{y(a.id),E(!1)},children:[(0,b.jsx)(aV.default,{className:(0,T.cn)("mr-2 h-4 w-4",x===a.id?"opacity-100":"opacity-0")}),(0,b.jsx)(aY.MemberNameWithStatus,{name:a.fullName,isDead:!!a.deathDate})," (第",a.generation,"世)"]},a.id))})]})]})})]})]})]}),(0,b.jsx)(h.Button,{onClick:()=>{if(!v||!x)return;let a=p(v,x);A({from:o.members[v],to:o.members[x],relationship:a})},disabled:!v||!x,className:"w-full h-10 bg-primary text-primary-foreground hover:bg-primary/90",children:"计算关系"})]})]}),z&&(0,b.jsxs)(g.Card,{className:"border-none shadow-sm bg-card/50 backdrop-blur",children:[(0,b.jsx)(g.CardHeader,{className:"text-center pb-4",children:(0,b.jsx)(g.CardTitle,{className:"text-xl font-serif font-light",children:"计算结果"})}),(0,b.jsxs)(g.CardContent,{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-center gap-4 p-5 bg-muted/30 rounded-lg",children:[(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)("div",{className:"text-xl font-serif font-light mb-1",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:z.from.fullName,isDead:!!z.from.deathDate})}),(0,b.jsxs)("div",{className:"text-sm text-muted-foreground font-light",children:["第",z.from.generation,"世"]})]}),(0,b.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,b.jsx)(i.Badge,{className:"text-base px-5 py-1.5 bg-primary text-primary-foreground",children:z.relationship.term}),z.relationship.path&&(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,b.jsx)("div",{className:"mb-1",children:"路径:"}),(0,b.jsx)(aZ.RelationshipPathDisplay,{path:z.relationship.path})]})]}),(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)("div",{className:"text-xl font-serif font-light mb-1",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:z.to.fullName,isDead:!!z.to.deathDate})}),(0,b.jsxs)("div",{className:"text-sm text-muted-foreground font-light",children:["第",z.to.generation,"世"]})]})]}),z.relationship.description&&(0,b.jsxs)("div",{className:"p-4 bg-primary/5 rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm font-light mb-2 text-center",children:"关系说明"}),(0,b.jsxs)("div",{className:"text-muted-foreground font-light text-center",children:[(0,b.jsx)("strong",{children:(0,b.jsx)(aY.MemberNameWithStatus,{name:z.from.fullName,isDead:!!z.from.deathDate})})," 是 ",(0,b.jsx)("strong",{children:(0,b.jsx)(aY.MemberNameWithStatus,{name:z.to.fullName,isDead:!!z.to.deathDate})})," 的 ",(0,b.jsx)("strong",{className:"text-primary",children:z.relationship.term})]})]}),!1===z.relationship.success&&(0,b.jsx)("div",{className:"p-4 bg-yellow-50 dark:bg-yellow-950 rounded-lg",children:(0,b.jsxs)("div",{className:"text-sm text-yellow-800 dark:text-yellow-200",children:["⚠️ ",z.relationship.error||"无法计算关系"]})})]})]}),(v||x)&&(0,b.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[v&&(0,b.jsxs)(g.Card,{className:"border-none shadow-sm bg-card/50 backdrop-blur",children:[(0,b.jsx)(g.CardHeader,{className:"pb-3",children:(0,b.jsxs)(g.CardTitle,{className:"text-lg font-serif font-light",children:[(0,b.jsx)(aY.MemberNameWithStatus,{name:o.members[v]?.fullName||"",isDead:!!o.members[v]?.deathDate})," 的直系亲属"]})}),(0,b.jsx)(g.CardContent,{children:(j=q(v))?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-2",children:[j.father&&(0,b.jsxs)("div",{className:"p-2.5 bg-muted rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"父亲"}),(0,b.jsx)("div",{className:"font-medium",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:j.father.fullName,isDead:!!j.father.deathDate})})]}),j.mother&&(0,b.jsxs)("div",{className:"p-2.5 bg-muted rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"母亲"}),(0,b.jsx)("div",{className:"font-medium",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:j.mother.fullName,isDead:!!j.mother.deathDate})})]}),j.spouses.length>0&&(0,b.jsxs)("div",{className:"p-2.5 bg-muted rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"配偶"}),j.spouses.map(a=>(0,b.jsx)("div",{className:"font-medium",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:a.fullName,isDead:!!a.deathDate})},a.id))]}),j.children.length>0&&(0,b.jsxs)("div",{className:"p-2.5 bg-muted rounded-lg",children:[(0,b.jsxs)("div",{className:"text-sm text-muted-foreground mb-1",children:["子女 (",j.children.length,"人)"]}),(0,b.jsxs)("div",{className:"space-y-1",children:[j.children.slice(0,3).map(a=>(0,b.jsx)("div",{className:"font-medium text-sm",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:a.fullName,isDead:!!a.deathDate})},a.id)),j.children.length>3&&(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:["还有 ",j.children.length-3," 人..."]})]})]})]}),0===(a=r(v)).length?null:(0,b.jsxs)("div",{className:"mt-2 p-2.5 bg-muted rounded-lg",children:[(0,b.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["兄弟姐妹 (",a.length,"人)"]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:a.map(a=>(0,b.jsx)(i.Badge,{variant:"outline",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:a.fullName,isDead:!!a.deathDate})},a.id))})]})]}):null})]}),x&&(0,b.jsxs)(g.Card,{className:"border-none shadow-sm bg-card/50 backdrop-blur",children:[(0,b.jsx)(g.CardHeader,{className:"pb-3",children:(0,b.jsxs)(g.CardTitle,{className:"text-lg font-serif font-light",children:[o.members[x]?.fullName," 的直系亲属"]})}),(0,b.jsx)(g.CardContent,{children:(l=q(x))?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-2",children:[l.father&&(0,b.jsxs)("div",{className:"p-2.5 bg-muted rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"父亲"}),(0,b.jsx)("div",{className:"font-medium",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:l.father.fullName,isDead:!!l.father.deathDate})})]}),l.mother&&(0,b.jsxs)("div",{className:"p-2.5 bg-muted rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"母亲"}),(0,b.jsx)("div",{className:"font-medium",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:l.mother.fullName,isDead:!!l.mother.deathDate})})]}),l.spouses.length>0&&(0,b.jsxs)("div",{className:"p-2.5 bg-muted rounded-lg",children:[(0,b.jsx)("div",{className:"text-sm text-muted-foreground mb-1",children:"配偶"}),l.spouses.map(a=>(0,b.jsx)("div",{className:"font-medium",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:a.fullName,isDead:!!a.deathDate})},a.id))]}),l.children.length>0&&(0,b.jsxs)("div",{className:"p-2.5 bg-muted rounded-lg",children:[(0,b.jsxs)("div",{className:"text-sm text-muted-foreground mb-1",children:["子女 (",l.children.length,"人)"]}),(0,b.jsxs)("div",{className:"space-y-1",children:[l.children.slice(0,3).map(a=>(0,b.jsx)("div",{className:"font-medium text-sm",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:a.fullName,isDead:!!a.deathDate})},a.id)),l.children.length>3&&(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:["还有 ",l.children.length-3," 人..."]})]})]})]}),0===(k=r(x)).length?null:(0,b.jsxs)("div",{className:"mt-2 p-2.5 bg-muted rounded-lg",children:[(0,b.jsxs)("div",{className:"text-sm text-muted-foreground mb-2",children:["兄弟姐妹 (",k.length,"人)"]}),(0,b.jsx)("div",{className:"flex flex-wrap gap-2",children:k.map(a=>(0,b.jsx)(i.Badge,{variant:"outline",children:(0,b.jsx)(aY.MemberNameWithStatus,{name:a.fullName,isDead:!!a.deathDate})},a.id))})]})]}):null})]})]})]})})]})}a.s(["default",()=>a0],64041)}]; //# sourceMappingURL=Documents_go-new_chinese-family-tree_d1d294e0._.js.map