@cashdoc/cashdoc-cms-design-system 2.3.0 → 2.3.1

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.
package/dist/index.umd.js CHANGED
@@ -25,7 +25,7 @@
25
25
  `),ghost:P("border-none bg-transparent","hover:bg-cms-gray-100 hover:text-cms-gray-900","disabled:bg-transparent disabled:text-cms-gray-450",`
26
26
  disabled:cursor-not-allowed
27
27
  disabled:hover:bg-transparent
28
- `)},size:{sm:"h-7 px-2.5 text-[13px]",default:"h-9 px-3 text-sm",lg:"h-11 px-3.5 text-[15px]"}},defaultVariants:{variant:"default",size:"default"}}),QP=Ee(P("box-border h-9 w-full","px-3","rounded-cms-md","border border-solid","leading-tight font-normal","transition-[border-color,box-shadow] duration-150 ease-out","outline-none","bg-cms-white text-sm text-cms-gray-900","placeholder:text-sm placeholder:text-cms-gray-450","hover:border-cms-gray-350"),{variants:{variant:{default:P("border-cms-gray-250","focus:border-cms-gray-900","focus:shadow-[0_0_0_3px_rgba(15,20,25,0.08)]","disabled:bg-cms-gray-100","disabled:text-cms-gray-450","disabled:border-cms-gray-200","disabled:cursor-not-allowed","disabled:hover:border-cms-gray-200"),error:P("border-cms-red-500","focus:border-cms-red-500","focus:shadow-[0_0_0_3px_rgba(229,56,74,0.22)]","hover:border-cms-red-500")},fullWidth:{true:"w-full",false:"w-auto"}},defaultVariants:{variant:"default",fullWidth:!0}}),rm=Ee("mb-1.5 block text-[13px] font-medium text-cms-gray-800"),JP=Ee("mt-1.5 block text-[12px] font-normal text-cms-red-500"),RP=Ee("mt-1.5 block text-[12px] font-normal text-cms-gray-550"),nu=y.forwardRef(({className:e,variant:t,fullWidth:r,label:n,required:o,error:a,errorMessage:i,helperText:s,showCharCount:l,maxLength:c,value:d,defaultValue:u,onChange:f,id:p,labelLayout:g="vertical",labelWidth:m="120px",prefix:v,suffix:b,disabled:x,...O},S)=>{const E=y.useId(),C=d!==void 0,_=te=>te==null?"":String(te),[k,D]=y.useState(_(u)),N=p||E,T=`${N}-error`,M=`${N}-helper`,K=a?"error":t,$=(C?_(d):k).length,A=te=>{C||D(te.target.value),f==null||f(te)},j=C?{value:d}:{defaultValue:u},L=n||l&&c,V=g==="horizontal",H=a&&i?T:s?M:void 0,J=v!=null||b!=null,re=P("absolute inset-y-0 flex items-center","pointer-events-none",x?"text-cms-gray-400":"text-cms-gray-450"),R=te=>{const ne=h.jsx("input",{id:N,ref:S,className:P(QP({variant:K,fullWidth:te}),v!=null&&"pl-9",b!=null&&"pr-9",e),maxLength:c,...j,onChange:A,required:o,disabled:x,"aria-invalid":a||void 0,"aria-describedby":H,...O});return J?h.jsxs("div",{className:"relative",children:[v!=null&&h.jsx("div",{className:P(re,"left-3"),"aria-hidden":"true",children:v}),ne,b!=null&&h.jsx("div",{className:P(re,"right-3"),"aria-hidden":"true",children:b})]}):ne};return h.jsxs("div",{className:P("w-full",!r&&"w-auto"),children:[V&&L?h.jsxs("div",{className:"flex items-center gap-3",children:[n&&h.jsxs("label",{htmlFor:N,className:P(rm(),"mb-0 shrink-0"),style:{width:m},children:[n,o&&h.jsx("span",{className:"ml-1 text-cms-red-400",children:"*"})]}),h.jsx("div",{className:"flex-1",children:R(!0)}),l&&c&&h.jsxs("span",{className:"shrink-0 text-sm text-cms-gray-600",children:[$," / ",c]})]}):h.jsxs(h.Fragment,{children:[L&&h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[n?h.jsxs("label",{htmlFor:N,className:rm(),children:[n,o&&h.jsx("span",{className:"ml-1 text-cms-red-400",children:"*"})]}):h.jsx("div",{}),l&&c&&h.jsxs("span",{className:"text-sm text-cms-gray-600",children:[$," / ",c]})]}),R(r)]}),a&&i&&h.jsx("span",{id:T,className:JP(),children:i}),!a&&s&&h.jsx("span",{id:M,className:RP(),children:s})]})});nu.displayName="TextInput";const nm=y.forwardRef(({options:e,value:t,placeholder:r="선택하세요",onValueChange:n,onValuesChange:o,disabled:a=!1,className:i,dropdownClassName:s,variant:l,size:c,searchable:d=!1,clearable:u=!1,multiple:f=!1,selectAll:p=!1,maxHeight:g=200,defaultOpen:m=!1,renderOption:v,onSearchChange:b,...x},O)=>{if(p&&!f)throw new Error("Dropdown: selectAll={true} requires multiple={true}.");const[S,E]=y.useState(m),[C,_]=y.useState(!1),[k,D]=y.useState(!1),[N,T]=y.useState(null),[M,K]=y.useState(""),[I,$]=y.useState(f?t?t.split(",").filter(Boolean):[]:[]),A=f&&t!==void 0?t.split(",").filter(Boolean):I,[j,L]=y.useState(null),V=y.useRef(new Map),H=y.useRef(null),{ref:J,nodeRef:re,showEnd:R,refresh:te}=em("y"),ne=y.useRef(null),oe=y.useRef(null),pe=y.useRef(null),le=y.useRef(null),B=(ce,ye)=>{for(const Ce of ce){if(Ce.value===ye)return Ce;if(Ce.children){const ft=B(Ce.children,ye);if(ft)return ft}}},U=B(e,t||""),G=f?A.length>0?`${A.length}개 선택됨`:r:(U==null?void 0:U.label)||r,F=e.filter(ce=>ce.label.toLowerCase().includes(M.toLowerCase())),ee=y.useCallback(()=>{_(!0)},[]),q=()=>{if(a)return;if(S&&!C){ee();return}const ce=oe.current;if(ce){const ye=ce.getBoundingClientRect(),Ce=window.innerHeight-ye.bottom,ft=ye.top,yt=(d?40:0)+g+16,Vr=Ce<yt&&ft>Ce;D(Vr),T({topAnchor:ye.bottom+4,bottomAnchor:window.innerHeight-ye.top+4,left:ye.left,width:ye.width})}_(!1),E(!0),M&&(K(""),b==null||b(""))},Z=ce=>{ce.animationName==="dropdownHide"&&ce.currentTarget===ce.target&&(E(!1),_(!1),M&&(K(""),b==null||b("")))},ae=()=>{H.current!==null&&(window.clearTimeout(H.current),H.current=null)},z=()=>{ae(),H.current=window.setTimeout(()=>{L(null)},300)},Q=y.useCallback((ce,ye)=>{if(ae(),!ye){L(null);return}const Ce=V.current.get(ce.value);if(Ce&&re.current){const ft=Ce.getBoundingClientRect(),yt=re.current.getBoundingClientRect();L({value:ce.value,top:ft.top-yt.top+re.current.scrollTop})}},[re]);y.useEffect(()=>()=>{ae()},[]);const ie=ce=>{o?o(ce):n==null||n(ce.join(","))},we=ce=>{if(!ce.disabled)if(f){const ye=A.includes(ce.value)?A.filter(Ce=>Ce!==ce.value):[...A,ce.value];t===void 0&&$(ye),ie(ye)}else n==null||n(ce.value),ee()},Ze=()=>{if(!f)return;const ce=F.filter(Ce=>!Ce.disabled).map(Ce=>Ce.value),ye=Array.from(new Set([...A,...ce]));t===void 0&&$(ye),n==null||n(ye.join(","))},Ye=ce=>{ce.stopPropagation(),f?(t===void 0&&$([]),ie([])):n==null||n("")},kt=ce=>{ce.key==="Escape"?ee():(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),q())};return y.useEffect(()=>{if(!S)return;const ce=ye=>{var ft,yt;const Ce=ye.target;(ft=ne.current)!=null&&ft.contains(Ce)||(yt=pe.current)!=null&&yt.contains(Ce)||ee()};return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[S,ee]),y.useEffect(()=>{if(!S)return;const ce=Ce=>{var yt;const ft=Ce.target;ft&&((yt=pe.current)!=null&&yt.contains(ft))||ee()},ye=()=>ee();return window.addEventListener("scroll",ce,!0),window.addEventListener("resize",ye),()=>{window.removeEventListener("scroll",ce,!0),window.removeEventListener("resize",ye)}},[S,ee]),y.useEffect(()=>{S&&d&&le.current&&le.current.focus()},[S,d]),h.jsxs("div",{ref:ne,className:"relative w-full",children:[p&&h.jsxs("div",{className:"mb-1 flex justify-start -space-x-4",children:[h.jsx(bt,{variant:"underline",type:"button",onClick:Ze,disabled:a,children:"모두 선택"}),h.jsx(bt,{variant:"underline",type:"button",onClick:Ye,disabled:a,children:"해제"})]}),h.jsxs("div",{ref:oe,className:"relative",children:[h.jsx("button",{ref:O,type:"button",className:P(tm({variant:l,size:c}),"pr-8",i),onClick:q,onKeyDown:kt,disabled:a,"aria-expanded":S,"aria-haspopup":"listbox",...x,children:h.jsx("span",{className:P("flex-1 truncate text-left",!U&&!f&&"text-cms-gray-400"),children:G})}),h.jsxs("div",{className:P("absolute top-1/2 right-3 -translate-y-1/2","flex items-center gap-2","pointer-events-none",a&&"text-cms-gray-400"),children:[u&&(t||A.length>0)&&h.jsx("button",{type:"button",className:P("pointer-events-auto border-0 bg-transparent","rounded-cms-md p-1 text-cms-gray-400 transition-colors","hover:text-cms-black"),onClick:Ye,"aria-label":"선택 취소",children:h.jsx(yn,{className:"size-3"})}),h.jsx(Ri,{size:14,strokeWidth:2,className:P("transition-transform duration-200",S&&"rotate-180")})]}),S&&N&&Da.createPortal(h.jsxs("div",{ref:pe,role:"listbox","aria-multiselectable":f||void 0,className:P("fixed z-cms-overlay min-w-0 py-1","rounded-cms-xl border border-cms-gray-300","bg-cms-white shadow-lg",C?"cms-dropdown-hide":"cms-dropdown-show",s),style:{top:k?"auto":N.topAnchor,bottom:k?N.bottomAnchor:"auto",left:N.left,width:N.width,maxHeight:`${g}px`},onAnimationEnd:Z,children:[d&&h.jsx("div",{className:"border-b border-cms-gray-200 p-2",children:h.jsx(nu,{ref:le,type:"text",value:M,onChange:ce=>{K(ce.target.value),b==null||b(ce.target.value),requestAnimationFrame(()=>te())},placeholder:"검색..."})}),h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx("div",{className:P("h-full overflow-hidden",d?"rounded-b-cms-xl":"rounded-cms-xl"),children:h.jsxs("div",{ref:J,className:"max-h-48 overflow-y-auto",onMouseEnter:ae,onMouseLeave:z,children:[F.length===0?h.jsx("div",{className:P("px-3 py-2","text-sm text-cms-gray-400","text-center"),children:M?"검색 결과가 없습니다":"옵션이 없습니다"}):F.map(ce=>{var yt;const ye=f?A.includes(ce.value):t===ce.value,Ce=!!((yt=ce.children)!=null&&yt.length),ft=(j==null?void 0:j.value)===ce.value;return h.jsx("div",{ref:Vr=>{Vr?V.current.set(ce.value,Vr):V.current.delete(ce.value)},onMouseEnter:()=>Q(ce,Ce),onMouseLeave:()=>{Ce&&z()},children:h.jsxs("button",{type:"button",role:"option","aria-selected":ye,"aria-haspopup":Ce?"menu":void 0,className:P("border-0","flex items-center justify-between gap-2","w-full px-3 py-2","text-left text-sm","transition-colors",ce.disabled?P("cursor-not-allowed bg-cms-white","text-cms-gray-400"):P("bg-cms-white text-cms-black","hover:bg-cms-gray-100","cursor-pointer"),ye&&"bg-cms-gray-150 font-medium",ft&&"bg-cms-gray-100"),onClick:()=>{Ce||we(ce)},disabled:ce.disabled,children:[v?v(ce):h.jsx("span",{className:"truncate",children:ce.label}),Ce?h.jsx(Up,{className:P("size-3 shrink-0","text-cms-gray-400")}):ye?h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-4 w-4 shrink-0 text-cms-black",children:h.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null]})},ce.value)}),R&&h.jsx("div",{className:P("sticky bottom-0 -mt-8 flex h-8 w-full items-end","justify-center pb-1","bg-linear-to-t from-cms-white to-transparent","pointer-events-none"),children:h.jsx(Ri,{size:16,strokeWidth:2,className:P("text-cms-gray-400","animate-bounce")})})]})}),j&&(()=>{const ce=F.find(ye=>ye.value===j.value);return ce!=null&&ce.children?h.jsx("div",{role:"menu",className:P(`
28
+ `)},size:{sm:"h-7 px-2.5 text-[13px]",default:"h-9 px-3 text-sm",lg:"h-11 px-3.5 text-[15px]"}},defaultVariants:{variant:"default",size:"default"}}),QP=Ee(P("box-border h-9 w-full","px-3","rounded-cms-md","border border-solid","leading-tight font-normal","transition-[border-color,box-shadow] duration-150 ease-out","outline-none","bg-cms-white text-sm text-cms-gray-900","placeholder:text-sm placeholder:text-cms-gray-450","hover:border-cms-gray-350"),{variants:{variant:{default:P("border-cms-gray-250","focus:border-cms-gray-900","focus:shadow-[0_0_0_3px_rgba(15,20,25,0.08)]","disabled:bg-cms-gray-100","disabled:text-cms-gray-450","disabled:border-cms-gray-200","disabled:cursor-not-allowed","disabled:hover:border-cms-gray-200"),error:P("border-cms-red-500","focus:border-cms-red-500","focus:shadow-[0_0_0_3px_rgba(229,56,74,0.22)]","hover:border-cms-red-500")},fullWidth:{true:"w-full",false:"w-auto"}},defaultVariants:{variant:"default",fullWidth:!0}}),rm=Ee("mb-1.5 block text-[13px] font-medium text-cms-gray-800"),JP=Ee("mt-1.5 block text-[12px] font-normal text-cms-red-500"),RP=Ee("mt-1.5 block text-[12px] font-normal text-cms-gray-550"),nu=y.forwardRef(({className:e,variant:t,fullWidth:r,label:n,required:o,error:a,errorMessage:i,helperText:s,showCharCount:l,maxLength:c,value:d,defaultValue:u,onChange:f,id:p,labelLayout:g="vertical",labelWidth:m="120px",prefix:v,suffix:b,disabled:x,...O},S)=>{const E=y.useId(),C=d!==void 0,_=te=>te==null?"":String(te),[k,D]=y.useState(_(u)),N=p||E,T=`${N}-error`,M=`${N}-helper`,K=a?"error":t,$=(C?_(d):k).length,A=te=>{C||D(te.target.value),f==null||f(te)},j=C?{value:d}:{defaultValue:u},L=n||l&&c,V=g==="horizontal",H=a&&i?T:s?M:void 0,J=v!=null||b!=null,re=P("absolute inset-y-0 flex items-center","pointer-events-none",x?"text-cms-gray-400":"text-cms-gray-450"),R=te=>{const ne=h.jsx("input",{id:N,ref:S,className:P(QP({variant:K,fullWidth:te}),v!=null&&"pl-9",b!=null&&"pr-9",e),maxLength:c,...j,onChange:A,required:o,disabled:x,"aria-invalid":a||void 0,"aria-describedby":H,...O});return J?h.jsxs("div",{className:"relative",children:[v!=null&&h.jsx("div",{className:P(re,"left-3"),"aria-hidden":"true",children:v}),ne,b!=null&&h.jsx("div",{className:P(re,"right-3"),"aria-hidden":"true",children:b})]}):ne};return h.jsxs("div",{className:P("w-full",!r&&"w-auto"),children:[V&&L?h.jsxs("div",{className:"flex items-center gap-3",children:[n&&h.jsxs("label",{htmlFor:N,className:P(rm(),"mb-0 shrink-0"),style:{width:m},children:[n,o&&h.jsx("span",{className:"ml-1 text-cms-red-400",children:"*"})]}),h.jsx("div",{className:"flex-1",children:R(!0)}),l&&c&&h.jsxs("span",{className:"shrink-0 text-sm text-cms-gray-600",children:[$," / ",c]})]}):h.jsxs(h.Fragment,{children:[L&&h.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[n?h.jsxs("label",{htmlFor:N,className:rm(),children:[n,o&&h.jsx("span",{className:"ml-1 text-cms-red-400",children:"*"})]}):h.jsx("div",{}),l&&c&&h.jsxs("span",{className:"text-sm text-cms-gray-600",children:[$," / ",c]})]}),R(r)]}),a&&i&&h.jsx("span",{id:T,className:JP(),children:i}),!a&&s&&h.jsx("span",{id:M,className:RP(),children:s})]})});nu.displayName="TextInput";const nm=y.forwardRef(({options:e,value:t,placeholder:r="선택하세요",onValueChange:n,onValuesChange:o,disabled:a=!1,className:i,dropdownClassName:s,variant:l,size:c,searchable:d=!1,clearable:u=!1,multiple:f=!1,selectAll:p=!1,maxHeight:g=200,defaultOpen:m=!1,renderOption:v,onSearchChange:b,...x},O)=>{if(p&&!f)throw new Error("Dropdown: selectAll={true} requires multiple={true}.");const[S,E]=y.useState(m),[C,_]=y.useState(!1),[k,D]=y.useState(!1),[N,T]=y.useState(null),[M,K]=y.useState(""),[I,$]=y.useState(f?t?t.split(",").filter(Boolean):[]:[]),A=f&&t!==void 0?t.split(",").filter(Boolean):I,[j,L]=y.useState(null),V=y.useRef(new Map),H=y.useRef(null),{ref:J,nodeRef:re,showEnd:R,refresh:te}=em("y"),ne=y.useRef(null),oe=y.useRef(null),pe=y.useRef(null),le=y.useRef(null),B=(ce,ye)=>{for(const Ce of ce){if(Ce.value===ye)return Ce;if(Ce.children){const ft=B(Ce.children,ye);if(ft)return ft}}},U=B(e,t||""),G=f?A.length>0?`${A.length}개 선택됨`:r:(U==null?void 0:U.label)||r,F=e.filter(ce=>ce.label.toLowerCase().includes(M.toLowerCase())),ee=y.useCallback(()=>{_(!0)},[]),q=()=>{if(a)return;if(S&&!C){ee();return}const ce=oe.current;if(ce){const ye=ce.getBoundingClientRect(),Ce=window.innerHeight-ye.bottom,ft=ye.top,yt=(d?40:0)+g+16,Vr=Ce<yt&&ft>Ce;D(Vr),T({topAnchor:ye.bottom+4,bottomAnchor:window.innerHeight-ye.top+4,left:ye.left,width:ye.width})}_(!1),E(!0),M&&(K(""),b==null||b(""))},Z=ce=>{ce.animationName==="dropdownHide"&&ce.currentTarget===ce.target&&(E(!1),_(!1),M&&(K(""),b==null||b("")))},ae=()=>{H.current!==null&&(window.clearTimeout(H.current),H.current=null)},z=()=>{ae(),H.current=window.setTimeout(()=>{L(null)},300)},Q=y.useCallback((ce,ye)=>{if(ae(),!ye){L(null);return}const Ce=V.current.get(ce.value);if(Ce&&re.current){const ft=Ce.getBoundingClientRect(),yt=re.current.getBoundingClientRect();L({value:ce.value,top:ft.top-yt.top+re.current.scrollTop})}},[re]);y.useEffect(()=>()=>{ae()},[]);const ie=ce=>{o?o(ce):n==null||n(ce.join(","))},we=ce=>{if(!ce.disabled)if(f){const ye=A.includes(ce.value)?A.filter(Ce=>Ce!==ce.value):[...A,ce.value];t===void 0&&$(ye),ie(ye)}else n==null||n(ce.value),ee()},Ze=()=>{if(!f)return;const ce=F.filter(Ce=>!Ce.disabled).map(Ce=>Ce.value),ye=Array.from(new Set([...A,...ce]));t===void 0&&$(ye),n==null||n(ye.join(","))},Ye=ce=>{ce.stopPropagation(),f?(t===void 0&&$([]),ie([])):n==null||n("")},kt=ce=>{ce.key==="Escape"?ee():(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),q())};return y.useEffect(()=>{if(!S)return;const ce=ye=>{var ft,yt;const Ce=ye.target;(ft=ne.current)!=null&&ft.contains(Ce)||(yt=pe.current)!=null&&yt.contains(Ce)||ee()};return document.addEventListener("mousedown",ce),()=>document.removeEventListener("mousedown",ce)},[S,ee]),y.useEffect(()=>{if(!S)return;const ce=Ce=>{var yt;const ft=Ce.target;ft&&((yt=pe.current)!=null&&yt.contains(ft))||ee()},ye=()=>ee();return window.addEventListener("scroll",ce,!0),window.addEventListener("resize",ye),()=>{window.removeEventListener("scroll",ce,!0),window.removeEventListener("resize",ye)}},[S,ee]),y.useEffect(()=>{S&&d&&le.current&&le.current.focus()},[S,d]),h.jsxs("div",{ref:ne,className:"relative w-full",children:[p&&h.jsxs("div",{className:"mb-1 flex justify-start -space-x-4",children:[h.jsx(bt,{variant:"underline",type:"button",onClick:Ze,disabled:a,children:"모두 선택"}),h.jsx(bt,{variant:"underline",type:"button",onClick:Ye,disabled:a,children:"해제"})]}),h.jsxs("div",{ref:oe,className:"relative",children:[h.jsx("button",{ref:O,type:"button",className:P(tm({variant:l,size:c}),"pr-8",i),onClick:q,onKeyDown:kt,disabled:a,"aria-expanded":S,"aria-haspopup":"listbox",...x,children:h.jsx("span",{className:P("flex-1 truncate text-left",!U&&!f&&"text-cms-gray-400"),children:G})}),h.jsxs("div",{className:P("absolute top-1/2 right-3 -translate-y-1/2","flex items-center gap-2","pointer-events-none",a&&"text-cms-gray-400"),children:[u&&(t||A.length>0)&&h.jsx("button",{type:"button",className:P("pointer-events-auto border-0 bg-transparent","rounded-cms-md p-1 text-cms-gray-400 transition-colors","hover:text-cms-black"),onClick:Ye,"aria-label":"선택 취소",children:h.jsx(yn,{className:"size-3"})}),h.jsx(Ri,{size:14,strokeWidth:2,className:P("transition-transform duration-200",S&&"rotate-180")})]}),S&&N&&Da.createPortal(h.jsxs("div",{ref:pe,role:"listbox","aria-multiselectable":f||void 0,className:P("fixed z-cms-overlay min-w-0 py-1","rounded-cms-xl border border-cms-gray-300","bg-cms-white shadow-lg",C?"cms-dropdown-hide":"cms-dropdown-show",s),style:{top:k?"auto":N.topAnchor,bottom:k?N.bottomAnchor:"auto",left:N.left,width:N.width,maxHeight:`${g}px`},onAnimationEnd:Z,children:[d&&h.jsx("div",{className:"border-b border-cms-gray-200 p-2",children:h.jsx(nu,{ref:le,type:"text",value:M,onChange:ce=>{K(ce.target.value),b==null||b(ce.target.value),requestAnimationFrame(()=>te())},placeholder:"검색..."})}),h.jsxs("div",{className:"relative min-h-0 flex-1",children:[h.jsx("div",{className:P("h-full overflow-hidden",d?"rounded-b-cms-xl":"rounded-cms-xl"),children:h.jsxs("div",{ref:J,className:"overflow-y-auto",style:{maxHeight:`${g}px`},onMouseEnter:ae,onMouseLeave:z,children:[F.length===0?h.jsx("div",{className:P("px-3 py-2","text-sm text-cms-gray-400","text-center"),children:M?"검색 결과가 없습니다":"옵션이 없습니다"}):F.map(ce=>{var yt;const ye=f?A.includes(ce.value):t===ce.value,Ce=!!((yt=ce.children)!=null&&yt.length),ft=(j==null?void 0:j.value)===ce.value;return h.jsx("div",{ref:Vr=>{Vr?V.current.set(ce.value,Vr):V.current.delete(ce.value)},onMouseEnter:()=>Q(ce,Ce),onMouseLeave:()=>{Ce&&z()},children:h.jsxs("button",{type:"button",role:"option","aria-selected":ye,"aria-haspopup":Ce?"menu":void 0,className:P("border-0","flex items-center justify-between gap-2","w-full px-3 py-2","text-left text-sm","transition-colors",ce.disabled?P("cursor-not-allowed bg-cms-white","text-cms-gray-400"):P("bg-cms-white text-cms-black","hover:bg-cms-gray-100","cursor-pointer"),ye&&"bg-cms-gray-150 font-medium",ft&&"bg-cms-gray-100"),onClick:()=>{Ce||we(ce)},disabled:ce.disabled,children:[v?v(ce):h.jsx("span",{className:"truncate",children:ce.label}),Ce?h.jsx(Up,{className:P("size-3 shrink-0","text-cms-gray-400")}):ye?h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-4 w-4 shrink-0 text-cms-black",children:h.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):null]})},ce.value)}),R&&h.jsx("div",{className:P("sticky bottom-0 -mt-8 flex h-8 w-full items-end","justify-center pb-1","bg-linear-to-t from-cms-white to-transparent","pointer-events-none"),children:h.jsx(Ri,{size:16,strokeWidth:2,className:P("text-cms-gray-400","animate-bounce")})})]})}),j&&(()=>{const ce=F.find(ye=>ye.value===j.value);return ce!=null&&ce.children?h.jsx("div",{role:"menu",className:P(`
29
29
  absolute left-full z-cms-overlay ml-1 min-w-40
30
30
  py-1
31
31
  `,"rounded-cms-xl border border-cms-gray-300","bg-cms-white shadow-lg","cms-dropdown-show"),style:{top:j.top},onMouseEnter:()=>{ae(),L(j)},onMouseLeave:z,children:ce.children.map(ye=>{const Ce=f?A.includes(ye.value):t===ye.value;return h.jsxs("button",{type:"button",role:"menuitem","aria-selected":Ce,className:P("border-0","flex items-center justify-between gap-2","w-full px-3 py-2","text-left text-sm","transition-colors",ye.disabled?P("cursor-not-allowed bg-cms-white","text-cms-gray-400"):P("bg-cms-white text-cms-black","hover:bg-cms-gray-100","cursor-pointer"),Ce&&"bg-cms-gray-150 font-medium"),onClick:()=>we(ye),disabled:ye.disabled,children:[h.jsx("span",{className:"truncate",children:ye.label}),Ce&&h.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-4 w-4 shrink-0 text-cms-black",children:h.jsx("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]},ye.value)})}):null})()]})]}),document.body)]})]})});nm.displayName="Dropdown";const ns=nm,om=y.forwardRef(({label:e,helperText:t,error:r,required:n,className:o,...a},i)=>h.jsxs("div",{className:P("space-y-1",o),children:[e&&h.jsxs("label",{className:"block text-sm font-medium text-cms-black",children:[e,n&&h.jsx("span",{className:"ml-1 text-cms-red-500",children:"*"})]}),h.jsx(ns,{ref:i,...a,className:P(r&&"border-cms-red-500 focus:ring-cms-red-500")}),(t||r)&&h.jsx("p",{className:P("text-xs",r?"text-cms-red-500":"text-cms-gray-400"),children:r||t})]}));om.displayName="Select";const am=y.forwardRef(({options:e,loading:t=!1,createable:r=!1,onCreateOption:n,...o},a)=>{const[i]=y.useState(""),s=e.filter(g=>g.label.toLowerCase().includes(i.toLowerCase())),l=s.some(g=>g.label.toLowerCase()===i.toLowerCase()),c=[...s,...r&&i&&!l?[{value:`__create__${i}`,label:`"${i}" 생성`,disabled:!1}]:[]],d=g=>{var m;if(g.startsWith("__create__")){const v=g.replace("__create__","");n==null||n(v)}else(m=o.onValueChange)==null||m.call(o,g)},{multiple:u,selectAll:f,...p}=o;return u===!0?h.jsx(ns,{...p,ref:a,options:c,searchable:!0,multiple:!0,selectAll:f,dropdownClassName:P(t&&"opacity-75",o.dropdownClassName),onValueChange:d}):h.jsx(ns,{...p,ref:a,options:c,searchable:!0,dropdownClassName:P(t&&"opacity-75",o.dropdownClassName),onValueChange:d})});am.displayName="Combobox";function Se(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function im(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function sm(...e){return t=>{let r=!1;const n=e.map(o=>{const a=im(o,t);return!r&&typeof a=="function"&&(r=!0),a});if(r)return()=>{for(let o=0;o<n.length;o++){const a=n[o];typeof a=="function"?a():im(e[o],null)}}}}function We(...e){return w.useCallback(sm(...e),e)}function eM(e,t){const r=w.createContext(t),n=a=>{const{children:i,...s}=a,l=w.useMemo(()=>s,Object.values(s));return h.jsx(r.Provider,{value:l,children:i})};n.displayName=e+"Provider";function o(a){const i=w.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[n,o]}function At(e,t=[]){let r=[];function n(a,i){const s=w.createContext(i),l=r.length;r=[...r,i];const c=u=>{var b;const{scope:f,children:p,...g}=u,m=((b=f==null?void 0:f[e])==null?void 0:b[l])||s,v=w.useMemo(()=>g,Object.values(g));return h.jsx(m.Provider,{value:v,children:p})};c.displayName=a+"Provider";function d(u,f){var m;const p=((m=f==null?void 0:f[e])==null?void 0:m[l])||s,g=w.useContext(p);if(g)return g;if(i!==void 0)return i;throw new Error(`\`${u}\` must be used within \`${a}\``)}return[c,d]}const o=()=>{const a=r.map(i=>w.createContext(i));return function(s){const l=(s==null?void 0:s[e])||a;return w.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[n,tM(o,...t)]}function tM(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=n.reduce((s,{useScope:l,scopeName:c})=>{const u=l(a)[`__scope${c}`];return{...s,...u}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function La(e){const t=rM(e),r=w.forwardRef((n,o)=>{const{children:a,...i}=n,s=w.Children.toArray(a),l=s.find(oM);if(l){const c=l.props.children,d=s.map(u=>u===l?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:u);return h.jsx(t,{...i,ref:o,children:w.isValidElement(c)?w.cloneElement(c,void 0,d):null})}return h.jsx(t,{...i,ref:o,children:a})});return r.displayName=`${e}.Slot`,r}function rM(e){const t=w.forwardRef((r,n)=>{const{children:o,...a}=r;if(w.isValidElement(o)){const i=iM(o),s=aM(a,o.props);return o.type!==w.Fragment&&(s.ref=n?sm(n,i):i),w.cloneElement(o,s)}return w.Children.count(o)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lm=Symbol("radix.slottable");function nM(e){const t=({children:r})=>h.jsx(h.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=lm,t}function oM(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lm}function aM(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...s)=>{const l=a(...s);return o(...s),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}function iM(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var sM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],xe=sM.reduce((e,t)=>{const r=La(`Primitive.${t}`),n=w.forwardRef((o,a)=>{const{asChild:i,...s}=o,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(l,{...s,ref:a})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lM(e,t){e&&Ap.flushSync(()=>e.dispatchEvent(t))}function Bn(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function cM(e,t=globalThis==null?void 0:globalThis.document){const r=Bn(e);w.useEffect(()=>{const n=o=>{o.key==="Escape"&&r(o)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var uM="DismissableLayer",ou="dismissableLayer.update",dM="dismissableLayer.pointerDownOutside",fM="dismissableLayer.focusOutside",cm,um=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),os=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:i,onDismiss:s,...l}=e,c=w.useContext(um),[d,u]=w.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=w.useState({}),g=We(t,_=>u(_)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),x=d?m.indexOf(d):-1,O=c.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,E=mM(_=>{const k=_.target,D=[...c.branches].some(N=>N.contains(k));!S||D||(o==null||o(_),i==null||i(_),_.defaultPrevented||s==null||s())},f),C=vM(_=>{const k=_.target;[...c.branches].some(N=>N.contains(k))||(a==null||a(_),i==null||i(_),_.defaultPrevented||s==null||s())},f);return cM(_=>{x===c.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&s&&(_.preventDefault(),s()))},f),w.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(cm=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),dm(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=cm)}},[d,f,r,c]),w.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),dm())},[d,c]),w.useEffect(()=>{const _=()=>p({});return document.addEventListener(ou,_),()=>document.removeEventListener(ou,_)},[]),h.jsx(xe.div,{...l,ref:g,style:{pointerEvents:O?S?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,E.onPointerDownCapture)})});os.displayName=uM;var hM="DismissableLayerBranch",pM=w.forwardRef((e,t)=>{const r=w.useContext(um),n=w.useRef(null),o=We(t,n);return w.useEffect(()=>{const a=n.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),h.jsx(xe.div,{...e,ref:o})});pM.displayName=hM;function mM(e,t=globalThis==null?void 0:globalThis.document){const r=Bn(e),n=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const a=s=>{if(s.target&&!n.current){let l=function(){fm(dM,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function vM(e,t=globalThis==null?void 0:globalThis.document){const r=Bn(e),n=w.useRef(!1);return w.useEffect(()=>{const o=a=>{a.target&&!n.current&&fm(fM,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function dm(){const e=new CustomEvent(ou);document.dispatchEvent(e)}function fm(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?lM(o,a):o.dispatchEvent(a)}var au=0;function hm(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pm()),document.body.insertAdjacentElement("beforeend",e[1]??pm()),au++,()=>{au===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),au--}},[])}function pm(){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 iu="focusScope.autoFocusOnMount",su="focusScope.autoFocusOnUnmount",mm={bubbles:!1,cancelable:!0},gM="FocusScope",lu=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,l]=w.useState(null),c=Bn(o),d=Bn(a),u=w.useRef(null),f=We(t,m=>l(m)),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let m=function(O){if(p.paused||!s)return;const S=O.target;s.contains(S)?u.current=S:bn(u.current,{select:!0})},v=function(O){if(p.paused||!s)return;const S=O.relatedTarget;S!==null&&(s.contains(S)||bn(u.current,{select:!0}))},b=function(O){if(document.activeElement===document.body)for(const E of O)E.removedNodes.length>0&&bn(s)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const x=new MutationObserver(b);return s&&x.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),x.disconnect()}}},[n,s,p.paused]),w.useEffect(()=>{if(s){ym.add(p);const m=document.activeElement;if(!s.contains(m)){const b=new CustomEvent(iu,mm);s.addEventListener(iu,c),s.dispatchEvent(b),b.defaultPrevented||(yM(CM(vm(s)),{select:!0}),document.activeElement===m&&bn(s))}return()=>{s.removeEventListener(iu,c),setTimeout(()=>{const b=new CustomEvent(su,mm);s.addEventListener(su,d),s.dispatchEvent(b),b.defaultPrevented||bn(m??document.body,{select:!0}),s.removeEventListener(su,d),ym.remove(p)},0)}}},[s,c,d,p]);const g=w.useCallback(m=>{if(!r&&!n||p.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const x=m.currentTarget,[O,S]=bM(x);O&&S?!m.shiftKey&&b===S?(m.preventDefault(),r&&bn(O,{select:!0})):m.shiftKey&&b===O&&(m.preventDefault(),r&&bn(S,{select:!0})):b===x&&m.preventDefault()}},[r,n,p.paused]);return h.jsx(xe.div,{tabIndex:-1,...i,ref:f,onKeyDown:g})});lu.displayName=gM;function yM(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(bn(n,{select:t}),document.activeElement!==r)return}function bM(e){const t=vm(e),r=gm(t,e),n=gm(t.reverse(),e);return[r,n]}function vm(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const o=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||o?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function gm(e,t){for(const r of e)if(!wM(r,{upTo:t}))return r}function wM(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function xM(e){return e instanceof HTMLInputElement&&"select"in e}function bn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&xM(e)&&t&&e.select()}}var ym=OM();function OM(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=bm(e,t),e.unshift(t)},remove(t){var r;e=bm(e,t),(r=e[0])==null||r.resume()}}}function bm(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function CM(e){return e.filter(t=>t.tagName!=="A")}var Ur=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},SM=w[" useId ".trim().toString()]||(()=>{}),EM=0;function Gr(e){const[t,r]=w.useState(SM());return Ur(()=>{r(n=>n??String(EM++))},[e]),e||(t?`radix-${t}`:"")}const _M=["top","right","bottom","left"],wn=Math.min,zt=Math.max,as=Math.round,is=Math.floor,wr=e=>({x:e,y:e}),PM={left:"right",right:"left",bottom:"top",top:"bottom"},MM={start:"end",end:"start"};function cu(e,t,r){return zt(e,wn(t,r))}function Kr(e,t){return typeof e=="function"?e(t):e}function qr(e){return e.split("-")[0]}function ko(e){return e.split("-")[1]}function uu(e){return e==="x"?"y":"x"}function du(e){return e==="y"?"height":"width"}const kM=new Set(["top","bottom"]);function xr(e){return kM.has(qr(e))?"y":"x"}function fu(e){return uu(xr(e))}function NM(e,t,r){r===void 0&&(r=!1);const n=ko(e),o=fu(e),a=du(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ss(i)),[i,ss(i)]}function AM(e){const t=ss(e);return[hu(e),t,hu(t)]}function hu(e){return e.replace(/start|end/g,t=>MM[t])}const wm=["left","right"],xm=["right","left"],DM=["top","bottom"],TM=["bottom","top"];function IM(e,t,r){switch(e){case"top":case"bottom":return r?t?xm:wm:t?wm:xm;case"left":case"right":return t?DM:TM;default:return[]}}function $M(e,t,r,n){const o=ko(e);let a=IM(qr(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(hu)))),a}function ss(e){return e.replace(/left|right|bottom|top/g,t=>PM[t])}function jM(e){return{top:0,right:0,bottom:0,left:0,...e}}function Om(e){return typeof e!="number"?jM(e):{top:e,right:e,bottom:e,left:e}}function ls(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Cm(e,t,r){let{reference:n,floating:o}=e;const a=xr(t),i=fu(t),s=du(i),l=qr(t),c=a==="y",d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,f=n[s]/2-o[s]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-o.width,y:u};break;default:p={x:n.x,y:n.y}}switch(ko(t)){case"start":p[i]-=f*(r&&c?-1:1);break;case"end":p[i]+=f*(r&&c?-1:1);break}return p}const LM=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=Cm(c,n,l),f=n,p={},g=0;for(let m=0;m<s.length;m++){const{name:v,fn:b}=s[m],{x,y:O,data:S,reset:E}=await b({x:d,y:u,initialPlacement:n,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});d=x??d,u=O??u,p={...p,[v]:{...p[v],...S}},E&&g<=50&&(g++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(c=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:d,y:u}=Cm(c,f,l)),m=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:p}};async function Ya(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:f=!1,padding:p=0}=Kr(t,e),g=Om(p),v=s[f?u==="floating"?"reference":"floating":u],b=ls(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(v)))==null||r?v:v.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),x=u==="floating"?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,O=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),S=await(a.isElement==null?void 0:a.isElement(O))?await(a.getScale==null?void 0:a.getScale(O))||{x:1,y:1}:{x:1,y:1},E=ls(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:O,strategy:l}):x);return{top:(b.top-E.top+g.top)/S.y,bottom:(E.bottom-b.bottom+g.bottom)/S.y,left:(b.left-E.left+g.left)/S.x,right:(E.right-b.right+g.right)/S.x}}const YM=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:d=0}=Kr(e,t)||{};if(c==null)return{};const u=Om(d),f={x:r,y:n},p=fu(o),g=du(p),m=await i.getDimensions(c),v=p==="y",b=v?"top":"left",x=v?"bottom":"right",O=v?"clientHeight":"clientWidth",S=a.reference[g]+a.reference[p]-f[p]-a.floating[g],E=f[p]-a.reference[p],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let _=C?C[O]:0;(!_||!await(i.isElement==null?void 0:i.isElement(C)))&&(_=s.floating[O]||a.floating[g]);const k=S/2-E/2,D=_/2-m[g]/2-1,N=wn(u[b],D),T=wn(u[x],D),M=N,K=_-m[g]-T,I=_/2-m[g]/2+k,$=cu(M,I,K),A=!l.arrow&&ko(o)!=null&&I!==$&&a.reference[g]/2-(I<M?N:T)-m[g]/2<0,j=A?I<M?I-M:I-K:0;return{[p]:f[p]+j,data:{[p]:$,centerOffset:I-$-j,...A&&{alignmentOffset:j}},reset:A}}}),zM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...v}=Kr(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const b=qr(o),x=xr(s),O=qr(s)===s,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=f||(O||!m?[ss(s)]:AM(s)),C=g!=="none";!f&&C&&E.push(...$M(s,m,g,S));const _=[s,...E],k=await Ya(t,v),D=[];let N=((n=a.flip)==null?void 0:n.overflows)||[];if(d&&D.push(k[b]),u){const I=NM(o,i,S);D.push(k[I[0]],k[I[1]])}if(N=[...N,{placement:o,overflows:D}],!D.every(I=>I<=0)){var T,M;const I=(((T=a.flip)==null?void 0:T.index)||0)+1,$=_[I];if($&&(!(u==="alignment"?x!==xr($):!1)||N.every(L=>xr(L.placement)===x?L.overflows[0]>0:!0)))return{data:{index:I,overflows:N},reset:{placement:$}};let A=(M=N.filter(j=>j.overflows[0]<=0).sort((j,L)=>j.overflows[1]-L.overflows[1])[0])==null?void 0:M.placement;if(!A)switch(p){case"bestFit":{var K;const j=(K=N.filter(L=>{if(C){const V=xr(L.placement);return V===x||V==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(V=>V>0).reduce((V,H)=>V+H,0)]).sort((L,V)=>L[1]-V[1])[0])==null?void 0:K[0];j&&(A=j);break}case"initialPlacement":A=s;break}if(o!==A)return{reset:{placement:A}}}return{}}}};function Sm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Em(e){return _M.some(t=>e[t]>=0)}const FM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Kr(e,t);switch(n){case"referenceHidden":{const a=await Ya(t,{...o,elementContext:"reference"}),i=Sm(a,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Em(i)}}}case"escaped":{const a=await Ya(t,{...o,altBoundary:!0}),i=Sm(a,r.floating);return{data:{escapedOffsets:i,escaped:Em(i)}}}default:return{}}}}},_m=new Set(["left","top"]);async function WM(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=qr(r),s=ko(r),l=xr(r)==="y",c=_m.has(i)?-1:1,d=a&&l?-1:1,u=Kr(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&typeof g=="number"&&(p=s==="end"?g*-1:g),l?{x:p*d,y:f*c}:{x:f*c,y:p*d}}const BM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await WM(t,e);return i===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},VM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...l}=Kr(e,t),c={x:r,y:n},d=await Ya(t,l),u=xr(qr(o)),f=uu(u);let p=c[f],g=c[u];if(a){const v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=p+d[v],O=p-d[b];p=cu(x,p,O)}if(i){const v=u==="y"?"top":"left",b=u==="y"?"bottom":"right",x=g+d[v],O=g-d[b];g=cu(x,g,O)}const m=s.fn({...t,[f]:p,[u]:g});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[f]:a,[u]:i}}}}}},HM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Kr(e,t),d={x:r,y:n},u=xr(o),f=uu(u);let p=d[f],g=d[u];const m=Kr(s,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const O=f==="y"?"height":"width",S=a.reference[f]-a.floating[O]+v.mainAxis,E=a.reference[f]+a.reference[O]-v.mainAxis;p<S?p=S:p>E&&(p=E)}if(c){var b,x;const O=f==="y"?"width":"height",S=_m.has(qr(o)),E=a.reference[u]-a.floating[O]+(S&&((b=i.offset)==null?void 0:b[u])||0)+(S?0:v.crossAxis),C=a.reference[u]+a.reference[O]+(S?0:((x=i.offset)==null?void 0:x[u])||0)-(S?v.crossAxis:0);g<E?g=E:g>C&&(g=C)}return{[f]:p,[u]:g}}}},UM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Kr(e,t),d=await Ya(t,c),u=qr(o),f=ko(o),p=xr(o)==="y",{width:g,height:m}=a.floating;let v,b;u==="top"||u==="bottom"?(v=u,b=f===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(b=u,v=f==="end"?"top":"bottom");const x=m-d.top-d.bottom,O=g-d.left-d.right,S=wn(m-d[v],x),E=wn(g-d[b],O),C=!t.middlewareData.shift;let _=S,k=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=O),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(_=x),C&&!f){const N=zt(d.left,0),T=zt(d.right,0),M=zt(d.top,0),K=zt(d.bottom,0);p?k=g-2*(N!==0||T!==0?N+T:zt(d.left,d.right)):_=m-2*(M!==0||K!==0?M+K:zt(d.top,d.bottom))}await l({...t,availableWidth:k,availableHeight:_});const D=await i.getDimensions(s.floating);return g!==D.width||m!==D.height?{reset:{rects:!0}}:{}}}};function cs(){return typeof window<"u"}function No(e){return Pm(e)?(e.nodeName||"").toLowerCase():"#document"}function Ft(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Or(e){var t;return(t=(Pm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Pm(e){return cs()?e instanceof Node||e instanceof Ft(e).Node:!1}function or(e){return cs()?e instanceof Element||e instanceof Ft(e).Element:!1}function Cr(e){return cs()?e instanceof HTMLElement||e instanceof Ft(e).HTMLElement:!1}function Mm(e){return!cs()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ft(e).ShadowRoot}const GM=new Set(["inline","contents"]);function za(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=ar(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!GM.has(o)}const KM=new Set(["table","td","th"]);function qM(e){return KM.has(No(e))}const XM=[":popover-open",":modal"];function us(e){return XM.some(t=>{try{return e.matches(t)}catch{return!1}})}const ZM=["transform","translate","scale","rotate","perspective"],QM=["transform","translate","scale","rotate","perspective","filter"],JM=["paint","layout","strict","content"];function pu(e){const t=mu(),r=or(e)?ar(e):e;return ZM.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||QM.some(n=>(r.willChange||"").includes(n))||JM.some(n=>(r.contain||"").includes(n))}function RM(e){let t=xn(e);for(;Cr(t)&&!Ao(t);){if(pu(t))return t;if(us(t))return null;t=xn(t)}return null}function mu(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ek=new Set(["html","body","#document"]);function Ao(e){return ek.has(No(e))}function ar(e){return Ft(e).getComputedStyle(e)}function ds(e){return or(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xn(e){if(No(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mm(e)&&e.host||Or(e);return Mm(t)?t.host:t}function km(e){const t=xn(e);return Ao(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&za(t)?t:km(t)}function Fa(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=km(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=Ft(o);if(a){const s=vu(i);return t.concat(i,i.visualViewport||[],za(o)?o:[],s&&r?Fa(s):[])}return t.concat(o,Fa(o,[],r))}function vu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nm(e){const t=ar(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Cr(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=as(r)!==a||as(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function gu(e){return or(e)?e:e.contextElement}function Do(e){const t=gu(e);if(!Cr(t))return wr(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Nm(t);let i=(a?as(r.width):r.width)/n,s=(a?as(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const tk=wr(0);function Am(e){const t=Ft(e);return!mu()||!t.visualViewport?tk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rk(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ft(e)?!1:t}function Vn(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=gu(e);let i=wr(1);t&&(n?or(n)&&(i=Do(n)):i=Do(e));const s=rk(a,r,n)?Am(a):wr(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,d=o.width/i.x,u=o.height/i.y;if(a){const f=Ft(a),p=n&&or(n)?Ft(n):n;let g=f,m=vu(g);for(;m&&n&&p!==g;){const v=Do(m),b=m.getBoundingClientRect(),x=ar(m),O=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*v.x,S=b.top+(m.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,u*=v.y,l+=O,c+=S,g=Ft(m),m=vu(g)}}return ls({width:d,height:u,x:l,y:c})}function fs(e,t){const r=ds(e).scrollLeft;return t?t.left+r:Vn(Or(e)).left+r}function Dm(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-fs(e,r),o=r.top+t.scrollTop;return{x:n,y:o}}function nk(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a=o==="fixed",i=Or(n),s=t?us(t.floating):!1;if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=wr(1);const d=wr(0),u=Cr(n);if((u||!u&&!a)&&((No(n)!=="body"||za(i))&&(l=ds(n)),Cr(n))){const p=Vn(n);c=Do(n),d.x=p.x+n.clientLeft,d.y=p.y+n.clientTop}const f=i&&!u&&!a?Dm(i,l):wr(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+d.x+f.x,y:r.y*c.y-l.scrollTop*c.y+d.y+f.y}}function ok(e){return Array.from(e.getClientRects())}function ak(e){const t=Or(e),r=ds(e),n=e.ownerDocument.body,o=zt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=zt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+fs(e);const s=-r.scrollTop;return ar(n).direction==="rtl"&&(i+=zt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}const Tm=25;function ik(e,t){const r=Ft(e),n=Or(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const d=mu();(!d||d&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}const c=fs(n);if(c<=0){const d=n.ownerDocument,u=d.body,f=getComputedStyle(u),p=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(n.clientWidth-u.clientWidth-p);g<=Tm&&(a-=g)}else c<=Tm&&(a+=c);return{width:a,height:i,x:s,y:l}}const sk=new Set(["absolute","fixed"]);function lk(e,t){const r=Vn(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Cr(e)?Do(e):wr(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=o*a.x,c=n*a.y;return{width:i,height:s,x:l,y:c}}function Im(e,t,r){let n;if(t==="viewport")n=ik(e,r);else if(t==="document")n=ak(Or(e));else if(or(t))n=lk(t,r);else{const o=Am(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return ls(n)}function $m(e,t){const r=xn(e);return r===t||!or(r)||Ao(r)?!1:ar(r).position==="fixed"||$m(r,t)}function ck(e,t){const r=t.get(e);if(r)return r;let n=Fa(e,[],!1).filter(s=>or(s)&&No(s)!=="body"),o=null;const a=ar(e).position==="fixed";let i=a?xn(e):e;for(;or(i)&&!Ao(i);){const s=ar(i),l=pu(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&sk.has(o.position)||za(i)&&!l&&$m(e,i))?n=n.filter(d=>d!==i):o=s,i=xn(i)}return t.set(e,n),n}function uk(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?us(t)?[]:ck(t,this._c):[].concat(r),n],s=i[0],l=i.reduce((c,d)=>{const u=Im(t,d,o);return c.top=zt(u.top,c.top),c.right=wn(u.right,c.right),c.bottom=wn(u.bottom,c.bottom),c.left=zt(u.left,c.left),c},Im(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dk(e){const{width:t,height:r}=Nm(e);return{width:t,height:r}}function fk(e,t,r){const n=Cr(t),o=Or(t),a=r==="fixed",i=Vn(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=wr(0);function c(){l.x=fs(o)}if(n||!n&&!a)if((No(t)!=="body"||za(o))&&(s=ds(t)),n){const p=Vn(t,!0,a,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();a&&!n&&o&&c();const d=o&&!n&&!a?Dm(o,s):wr(0),u=i.left+s.scrollLeft-l.x-d.x,f=i.top+s.scrollTop-l.y-d.y;return{x:u,y:f,width:i.width,height:i.height}}function yu(e){return ar(e).position==="static"}function jm(e,t){if(!Cr(e)||ar(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Or(e)===r&&(r=r.ownerDocument.body),r}function Lm(e,t){const r=Ft(e);if(us(e))return r;if(!Cr(e)){let o=xn(e);for(;o&&!Ao(o);){if(or(o)&&!yu(o))return o;o=xn(o)}return r}let n=jm(e,t);for(;n&&qM(n)&&yu(n);)n=jm(n,t);return n&&Ao(n)&&yu(n)&&!pu(n)?r:n||RM(e)||r}const hk=async function(e){const t=this.getOffsetParent||Lm,r=this.getDimensions,n=await r(e.floating);return{reference:fk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function pk(e){return ar(e).direction==="rtl"}const mk={convertOffsetParentRelativeRectToViewportRelativeRect:nk,getDocumentElement:Or,getClippingRect:uk,getOffsetParent:Lm,getElementRects:hk,getClientRects:ok,getDimensions:dk,getScale:Do,isElement:or,isRTL:pk};function Ym(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vk(e,t){let r=null,n;const o=Or(e);function a(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:d,top:u,width:f,height:p}=c;if(s||t(),!f||!p)return;const g=is(u),m=is(o.clientWidth-(d+f)),v=is(o.clientHeight-(u+p)),b=is(d),O={rootMargin:-g+"px "+-m+"px "+-v+"px "+-b+"px",threshold:zt(0,wn(1,l))||1};let S=!0;function E(C){const _=C[0].intersectionRatio;if(_!==l){if(!S)return i();_?i(!1,_):n=setTimeout(()=>{i(!1,1e-7)},1e3)}_===1&&!Ym(c,e.getBoundingClientRect())&&i(),S=!1}try{r=new IntersectionObserver(E,{...O,root:o.ownerDocument})}catch{r=new IntersectionObserver(E,O)}r.observe(e)}return i(!0),a}function gk(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=gu(e),d=o||a?[...c?Fa(c):[],...Fa(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",r,{passive:!0}),a&&b.addEventListener("resize",r)});const u=c&&s?vk(c,r):null;let f=-1,p=null;i&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var O;(O=p)==null||O.observe(t)})),r()}),c&&!l&&p.observe(c),p.observe(t));let g,m=l?Vn(e):null;l&&v();function v(){const b=Vn(e);m&&!Ym(m,b)&&r(),m=b,g=requestAnimationFrame(v)}return r(),()=>{var b;d.forEach(x=>{o&&x.removeEventListener("scroll",r),a&&x.removeEventListener("resize",r)}),u==null||u(),(b=p)==null||b.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const yk=BM,bk=VM,wk=zM,xk=UM,Ok=FM,zm=YM,Ck=HM,Sk=(e,t,r)=>{const n=new Map,o={platform:mk,...r},a={...o.platform,_c:n};return LM(e,t,{...o,platform:a})};var Ek=typeof document<"u",_k=function(){},hs=Ek?y.useLayoutEffect:_k;function ps(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!ps(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!ps(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Fm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wm(e,t){const r=Fm(e);return Math.round(t*r)/r}function bu(e){const t=w.useRef(e);return hs(()=>{t.current=e}),t}function Pk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[d,u]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(n);ps(f,n)||p(n);const[g,m]=w.useState(null),[v,b]=w.useState(null),x=w.useCallback(L=>{L!==C.current&&(C.current=L,m(L))},[]),O=w.useCallback(L=>{L!==_.current&&(_.current=L,b(L))},[]),S=a||g,E=i||v,C=w.useRef(null),_=w.useRef(null),k=w.useRef(d),D=l!=null,N=bu(l),T=bu(o),M=bu(c),K=w.useCallback(()=>{if(!C.current||!_.current)return;const L={placement:t,strategy:r,middleware:f};T.current&&(L.platform=T.current),Sk(C.current,_.current,L).then(V=>{const H={...V,isPositioned:M.current!==!1};I.current&&!ps(k.current,H)&&(k.current=H,Ap.flushSync(()=>{u(H)}))})},[f,t,r,T,M]);hs(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,u(L=>({...L,isPositioned:!1})))},[c]);const I=w.useRef(!1);hs(()=>(I.current=!0,()=>{I.current=!1}),[]),hs(()=>{if(S&&(C.current=S),E&&(_.current=E),S&&E){if(N.current)return N.current(S,E,K);K()}},[S,E,K,N,D]);const $=w.useMemo(()=>({reference:C,floating:_,setReference:x,setFloating:O}),[x,O]),A=w.useMemo(()=>({reference:S,floating:E}),[S,E]),j=w.useMemo(()=>{const L={position:r,left:0,top:0};if(!A.floating)return L;const V=Wm(A.floating,d.x),H=Wm(A.floating,d.y);return s?{...L,transform:"translate("+V+"px, "+H+"px)",...Fm(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:V,top:H}},[r,s,A.floating,d.x,d.y]);return w.useMemo(()=>({...d,update:K,refs:$,elements:A,floatingStyles:j}),[d,K,$,A,j])}const Mk=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:o}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?zm({element:n.current,padding:o}).fn(r):{}:n?zm({element:n,padding:o}).fn(r):{}}}},kk=(e,t)=>({...yk(e),options:[e,t]}),Nk=(e,t)=>({...bk(e),options:[e,t]}),Ak=(e,t)=>({...Ck(e),options:[e,t]}),Dk=(e,t)=>({...wk(e),options:[e,t]}),Tk=(e,t)=>({...xk(e),options:[e,t]}),Ik=(e,t)=>({...Ok(e),options:[e,t]}),$k=(e,t)=>({...Mk(e),options:[e,t]});var jk="Arrow",Bm=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:o=5,...a}=e;return h.jsx(xe.svg,{...a,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});Bm.displayName=jk;var Lk=Bm;function ms(e){const[t,r]=w.useState(void 0);return Ur(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,s=c.blockSize}else i=e.offsetWidth,s=e.offsetHeight;r({width:i,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var wu="Popper",[Vm,vs]=At(wu),[Yk,Hm]=Vm(wu),Um=e=>{const{__scopePopper:t,children:r}=e,[n,o]=w.useState(null);return h.jsx(Yk,{scope:t,anchor:n,onAnchorChange:o,children:r})};Um.displayName=wu;var Gm="PopperAnchor",Km=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...o}=e,a=Hm(Gm,r),i=w.useRef(null),s=We(t,i),l=w.useRef(null);return w.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||i.current,c!==l.current&&a.onAnchorChange(l.current)}),n?null:h.jsx(xe.div,{...o,ref:s})});Km.displayName=Gm;var xu="PopperContent",[zk,Fk]=Vm(xu),qm=w.forwardRef((e,t)=>{var pe,le,B,U,G,F;const{__scopePopper:r,side:n="bottom",sideOffset:o=0,align:a="center",alignOffset:i=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:u="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:g,...m}=e,v=Hm(xu,r),[b,x]=w.useState(null),O=We(t,ee=>x(ee)),[S,E]=w.useState(null),C=ms(S),_=(C==null?void 0:C.width)??0,k=(C==null?void 0:C.height)??0,D=n+(a!=="center"?"-"+a:""),N=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},T=Array.isArray(c)?c:[c],M=T.length>0,K={padding:N,boundary:T.filter(Bk),altBoundary:M},{refs:I,floatingStyles:$,placement:A,isPositioned:j,middlewareData:L}=Pk({strategy:"fixed",placement:D,whileElementsMounted:(...ee)=>gk(...ee,{animationFrame:p==="always"}),elements:{reference:v.anchor},middleware:[kk({mainAxis:o+k,alignmentAxis:i}),l&&Nk({mainAxis:!0,crossAxis:!1,limiter:u==="partial"?Ak():void 0,...K}),l&&Dk({...K}),Tk({...K,apply:({elements:ee,rects:q,availableWidth:Z,availableHeight:ae})=>{const{width:z,height:Q}=q.reference,ie=ee.floating.style;ie.setProperty("--radix-popper-available-width",`${Z}px`),ie.setProperty("--radix-popper-available-height",`${ae}px`),ie.setProperty("--radix-popper-anchor-width",`${z}px`),ie.setProperty("--radix-popper-anchor-height",`${Q}px`)}}),S&&$k({element:S,padding:s}),Vk({arrowWidth:_,arrowHeight:k}),f&&Ik({strategy:"referenceHidden",...K})]}),[V,H]=Qm(A),J=Bn(g);Ur(()=>{j&&(J==null||J())},[j,J]);const re=(pe=L.arrow)==null?void 0:pe.x,R=(le=L.arrow)==null?void 0:le.y,te=((B=L.arrow)==null?void 0:B.centerOffset)!==0,[ne,oe]=w.useState();return Ur(()=>{b&&oe(window.getComputedStyle(b).zIndex)},[b]),h.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:j?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(U=L.transformOrigin)==null?void 0:U.x,(G=L.transformOrigin)==null?void 0:G.y].join(" "),...((F=L.hide)==null?void 0:F.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(zk,{scope:r,placedSide:V,onArrowChange:E,arrowX:re,arrowY:R,shouldHideArrow:te,children:h.jsx(xe.div,{"data-side":V,"data-align":H,...m,ref:O,style:{...m.style,animation:j?void 0:"none"}})})})});qm.displayName=xu;var Xm="PopperArrow",Wk={top:"bottom",right:"left",bottom:"top",left:"right"},Zm=w.forwardRef(function(t,r){const{__scopePopper:n,...o}=t,a=Fk(Xm,n),i=Wk[a.placedSide];return h.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:h.jsx(Lk,{...o,ref:r,style:{...o.style,display:"block"}})})});Zm.displayName=Xm;function Bk(e){return e!==null}var Vk=e=>({name:"transformOrigin",options:e,fn(t){var v,b,x;const{placement:r,rects:n,middlewareData:o}=t,i=((v=o.arrow)==null?void 0:v.centerOffset)!==0,s=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=Qm(r),u={start:"0%",center:"50%",end:"100%"}[d],f=(((b=o.arrow)==null?void 0:b.x)??0)+s/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let g="",m="";return c==="bottom"?(g=i?u:`${f}px`,m=`${-l}px`):c==="top"?(g=i?u:`${f}px`,m=`${n.floating.height+l}px`):c==="right"?(g=`${-l}px`,m=i?u:`${p}px`):c==="left"&&(g=`${n.floating.width+l}px`,m=i?u:`${p}px`),{data:{x:g,y:m}}}});function Qm(e){const[t,r="center"]=e.split("-");return[t,r]}var Jm=Um,Ou=Km,Rm=qm,ev=Zm,Hk="Portal",gs=w.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[o,a]=w.useState(!1);Ur(()=>a(!0),[]);const i=r||o&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return i?Da.createPortal(h.jsx(xe.div,{...n,ref:t}),i):null});gs.displayName=Hk;function Uk(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var qt=e=>{const{present:t,children:r}=e,n=Gk(t),o=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),a=We(n.ref,Kk(o));return typeof r=="function"||n.isPresent?w.cloneElement(o,{ref:a}):null};qt.displayName="Presence";function Gk(e){const[t,r]=w.useState(),n=w.useRef(null),o=w.useRef(e),a=w.useRef("none"),i=e?"mounted":"unmounted",[s,l]=Uk(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=ys(n.current);a.current=s==="mounted"?c:"none"},[s]),Ur(()=>{const c=n.current,d=o.current;if(d!==e){const f=a.current,p=ys(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ur(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,u=p=>{const m=ys(n.current).includes(CSS.escape(p.animationName));if(p.target===t&&m&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},f=p=>{p.target===t&&(a.current=ys(n.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:w.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function ys(e){return(e==null?void 0:e.animationName)||"none"}function Kk(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var qk=w[" useInsertionEffect ".trim().toString()]||Ur;function Dt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,i]=Xk({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:o;{const d=w.useRef(e!==void 0);w.useEffect(()=>{const u=d.current;u!==s&&console.warn(`${n} is changing from ${u?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. 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.`),d.current=s},[s,n])}const c=w.useCallback(d=>{var u;if(s){const f=Zk(d)?d(e):d;f!==e&&((u=i.current)==null||u.call(i,f))}else a(d)},[s,e,a,i]);return[l,c]}function Xk({defaultProp:e,onChange:t}){const[r,n]=w.useState(e),o=w.useRef(r),a=w.useRef(t);return qk(()=>{a.current=t},[t]),w.useEffect(()=>{var i;o.current!==r&&((i=a.current)==null||i.call(a,r),o.current=r)},[r,o]),[r,n,a]}function Zk(e){return typeof e=="function"}var Qk=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},To=new WeakMap,bs=new WeakMap,ws={},Cu=0,tv=function(e){return e&&(e.host||tv(e.parentNode))},Jk=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=tv(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Rk=function(e,t,r,n){var o=Jk(t,Array.isArray(e)?e:[e]);ws[r]||(ws[r]=new WeakMap);var a=ws[r],i=[],s=new Set,l=new Set(o),c=function(u){!u||s.has(u)||(s.add(u),c(u.parentNode))};o.forEach(c);var d=function(u){!u||l.has(u)||Array.prototype.forEach.call(u.children,function(f){if(s.has(f))d(f);else try{var p=f.getAttribute(n),g=p!==null&&p!=="false",m=(To.get(f)||0)+1,v=(a.get(f)||0)+1;To.set(f,m),a.set(f,v),i.push(f),m===1&&g&&bs.set(f,!0),v===1&&f.setAttribute(r,"true"),g||f.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),s.clear(),Cu++,function(){i.forEach(function(u){var f=To.get(u)-1,p=a.get(u)-1;To.set(u,f),a.set(u,p),f||(bs.has(u)||u.removeAttribute(n),bs.delete(u)),p||u.removeAttribute(r)}),Cu--,Cu||(To=new WeakMap,To=new WeakMap,bs=new WeakMap,ws={})}},rv=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=Qk(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Rk(n,o,r,"aria-hidden")):function(){return null}},Sr=function(){return Sr=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Sr.apply(this,arguments)};function nv(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function eN(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var xs="right-scroll-bar-position",Os="width-before-scroll-bar",tN="with-scroll-bars-hidden",rN="--removed-body-scroll-bar-size";function Su(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function nN(e,t){var r=y.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}var oN=typeof window<"u"?w.useLayoutEffect:w.useEffect,ov=new WeakMap;function aN(e,t){var r=nN(null,function(n){return e.forEach(function(o){return Su(o,n)})});return oN(function(){var n=ov.get(r);if(n){var o=new Set(n),a=new Set(e),i=r.current;o.forEach(function(s){a.has(s)||Su(s,null)}),a.forEach(function(s){o.has(s)||Su(s,i)})}ov.set(r,e)},[e]),r}function iN(e){return e}function sN(e,t){t===void 0&&(t=iN);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(s){return s!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(s){return a(s)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var s=r;r=[],s.forEach(a),i=r}var l=function(){var d=i;i=[],d.forEach(a)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){i.push(d),c()},filter:function(d){return i=i.filter(d),r}}}};return o}function lN(e){e===void 0&&(e={});var t=sN(null);return t.options=Sr({async:!0,ssr:!1},e),t}var av=function(e){var t=e.sideCar,r=nv(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,Sr({},r))};av.isSideCarExport=!0;function cN(e,t){return e.useMedium(t),av}var iv=lN(),Eu=function(){},Cs=w.forwardRef(function(e,t){var r=w.useRef(null),n=w.useState({onScrollCapture:Eu,onWheelCapture:Eu,onTouchMoveCapture:Eu}),o=n[0],a=n[1],i=e.forwardProps,s=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,u=e.shards,f=e.sideCar,p=e.noRelative,g=e.noIsolation,m=e.inert,v=e.allowPinchZoom,b=e.as,x=b===void 0?"div":b,O=e.gapMode,S=nv(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,C=aN([r,t]),_=Sr(Sr({},S),o);return w.createElement(w.Fragment,null,d&&w.createElement(E,{sideCar:iv,removeScrollBar:c,shards:u,noRelative:p,noIsolation:g,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:r,gapMode:O}),i?w.cloneElement(w.Children.only(s),Sr(Sr({},_),{ref:C})):w.createElement(x,Sr({},_,{className:l,ref:C}),s))});Cs.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Cs.classNames={fullWidth:Os,zeroRight:xs};var uN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uN();return t&&e.setAttribute("nonce",t),e}function fN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hN(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var pN=function(){var e=0,t=null;return{add:function(r){e==0&&(t=dN())&&(fN(t,r),hN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mN=function(){var e=pN();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},sv=function(){var e=mN(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},vN={left:0,top:0,right:0,gap:0},_u=function(e){return parseInt(e||"",10)||0},gN=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[_u(r),_u(n),_u(o)]},yN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return vN;var t=gN(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},bN=sv(),Io="data-scroll-locked",wN=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return r===void 0&&(r="margin"),`