@1d1s/design-system 0.2.28 → 0.2.29

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.es.js CHANGED
@@ -11571,6 +11571,7 @@ function dy({
11571
11571
  className: P(
11572
11572
  "group flex w-full items-center justify-between whitespace-nowrap border bg-white outline-none transition-all duration-200",
11573
11573
  "disabled:cursor-not-allowed disabled:opacity-50",
11574
+ "hover:border-gray-400",
11574
11575
  "data-[placeholder]:text-gray-500 focus-visible:ring-3 focus-visible:ring-main-300/60",
11575
11576
  t === "sm" ? "h-10 min-w-[150px] rounded-3 border-gray-300 px-3.5" : "h-10 min-w-[150px] rounded-3 border-gray-300 px-4",
11576
11577
  e
package/dist/index.umd.js CHANGED
@@ -42,4 +42,4 @@
42
42
 
43
43
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
44
 
45
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Nv="DialogDescriptionWarning",Sv=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xi(Nv).contentName}}.`;return h.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Av=Fi,kv=Bi,Pv=$i,Ev=Hi,_v=Vi,Mv=ji,Tv=Ui,Zi=Qi;const Dv=Av,Ov=kv,Ji=Pv,Iv=Zi;function Ri({className:e,...t}){return s.jsx(Ev,{className:k("fixed inset-0 z-50 bg-black/50","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function Lv({className:e,children:t,...n}){return s.jsxs(Ji,{children:[s.jsx(Ri,{}),s.jsxs(_v,{className:k("fixed top-[50%] left-[50%] z-50","w-full max-w-[calc(100%-2rem)] sm:max-w-md","translate-x-[-50%] translate-y-[-50%]","rounded-2 bg-white p-4 sm:p-6 shadow-default","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-slot=button].h-13]:!h-11","[&_[data-slot=button].h-13]:!px-3.5","[&_[data-slot=button].h-11]:!h-9","[&_[data-slot=button]_.text-lg]:!text-base","[&_[data-slot=button]_.text-base]:!text-sm","duration-200",e),...n,children:[t,s.jsxs(Zi,{className:"absolute top-3 right-3 sm:top-4 sm:right-4 rounded-full p-1.5 opacity-70 transition-opacity hover:opacity-100 focus:outline-none cursor-pointer",children:[s.jsx(vr,{width:18,height:18,className:"text-gray-500 sm:w-5 sm:h-5"}),s.jsx("span",{className:"sr-only",children:"닫기"})]})]})]})}function Fv({className:e,...t}){return s.jsx("div",{className:k("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Wv({className:e,...t}){return s.jsx("div",{className:k("mt-4 sm:mt-6 flex flex-row justify-end gap-2",e),...t})}function Bv({className:e,children:t,...n}){return s.jsx(Mv,{asChild:!0,...n,children:s.jsx(L,{size:"heading2",weight:"bold",className:k("text-black",e),children:t})})}function zv({className:e,children:t,...n}){return s.jsx(Tv,{asChild:!0,...n,children:s.jsx(L,{size:"body2",weight:"regular",className:k("text-gray-600 mt-2",e),children:t})})}function el(e,[t,n]){return Math.min(n,Math.max(t,e))}var tl=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$v="VisuallyHidden",nl=h.forwardRef((e,t)=>s.jsx(j.span,{...e,ref:t,style:{...tl,...e.style}}));nl.displayName=$v;var Hv=nl,Vv=[" ","Enter","ArrowUp","ArrowDown"],Yv=[" ","Enter"],pt="Select",[Xn,Zn,jv]=ar(pt),[It]=ke(pt,[jv,Et]),Jn=Et(),[Gv,at]=It(pt),[Uv,Kv]=It(pt),rl=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:i,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:f,disabled:p,required:v,form:b}=e,g=Jn(t),[m,w]=h.useState(null),[y,C]=h.useState(null),[A,N]=h.useState(!1),_=cn(d),[E,S]=Ne({prop:r,defaultProp:o??!1,onChange:a,caller:pt}),[z,V]=Ne({prop:i,defaultProp:l,onChange:c,caller:pt}),B=h.useRef(null),G=m?b||!!m.closest("form"):!0,[U,Y]=h.useState(new Set),q=Array.from(U).map(F=>F.props.value).join(";");return s.jsx(co,{...g,children:s.jsxs(Gv,{required:v,scope:t,trigger:m,onTriggerChange:w,valueNode:y,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:N,contentId:Pe(),value:z,onValueChange:V,open:E,onOpenChange:S,dir:_,triggerPointerDownPosRef:B,disabled:p,children:[s.jsx(Xn.Provider,{scope:t,children:s.jsx(Uv,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(F=>{Y(M=>new Set(M).add(F))},[]),onNativeOptionRemove:h.useCallback(F=>{Y(M=>{const x=new Set(M);return x.delete(F),x})},[]),children:n})}),G?s.jsxs(El,{"aria-hidden":!0,required:v,tabIndex:-1,name:u,autoComplete:f,value:z,onChange:F=>V(F.target.value),disabled:p,form:b,children:[z===void 0?s.jsx("option",{value:""}):null,Array.from(U)]},q):null]})})};rl.displayName=pt;var ol="SelectTrigger",al=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=Jn(n),i=at(ol,n),l=i.disabled||r,c=ee(t,i.onTriggerChange),d=Zn(n),u=h.useRef("touch"),[f,p,v]=Ml(g=>{const m=d().filter(C=>!C.disabled),w=m.find(C=>C.value===i.value),y=Tl(m,g,w);y!==void 0&&i.onValueChange(y.value)}),b=g=>{l||(i.onOpenChange(!0),v()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return s.jsx(Bn,{asChild:!0,...a,children:s.jsx(j.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":_l(i.value)?"":void 0,...o,ref:c,onClick:H(o.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&b(g)}),onPointerDown:H(o.onPointerDown,g=>{u.current=g.pointerType;const m=g.target;m.hasPointerCapture(g.pointerId)&&m.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(b(g),g.preventDefault())}),onKeyDown:H(o.onKeyDown,g=>{const m=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(m&&g.key===" ")&&Vv.includes(g.key)&&(b(),g.preventDefault())})})})});al.displayName=ol;var sl="SelectValue",il=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...l}=e,c=at(sl,n),{onValueNodeHasChildrenChange:d}=c,u=a!==void 0,f=ee(t,c.onValueNodeChange);return pe(()=>{d(u)},[d,u]),s.jsx(j.span,{...l,ref:f,style:{pointerEvents:"none"},children:_l(c.value)?s.jsx(s.Fragment,{children:i}):a})});il.displayName=sl;var Qv="SelectIcon",ll=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(j.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ll.displayName=Qv;var qv="SelectPortal",cl=e=>s.jsx(Xt,{asChild:!0,...e});cl.displayName=qv;var gt="SelectContent",dl=h.forwardRef((e,t)=>{const n=at(gt,e.__scopeSelect),[r,o]=h.useState();if(pe(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?an.createPortal(s.jsx(ul,{scope:e.__scopeSelect,children:s.jsx(Xn.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),a):null}return s.jsx(fl,{...e,ref:t})});dl.displayName=gt;var Le=10,[ul,st]=It(gt),Xv="SelectContentImpl",Zv=mt("SelectContent.RemoveScroll"),fl=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:g,avoidCollisions:m,...w}=e,y=at(gt,n),[C,A]=h.useState(null),[N,_]=h.useState(null),E=ee(t,D=>A(D)),[S,z]=h.useState(null),[V,B]=h.useState(null),G=Zn(n),[U,Y]=h.useState(!1),q=h.useRef(!1);h.useEffect(()=>{if(C)return po(C)},[C]),Kr();const F=h.useCallback(D=>{const[oe,...ce]=G().map(ae=>ae.ref.current),[X]=ce.slice(-1),te=document.activeElement;for(const ae of D)if(ae===te||(ae?.scrollIntoView({block:"nearest"}),ae===oe&&N&&(N.scrollTop=0),ae===X&&N&&(N.scrollTop=N.scrollHeight),ae?.focus(),document.activeElement!==te))return},[G,N]),M=h.useCallback(()=>F([S,C]),[F,S,C]);h.useEffect(()=>{U&&M()},[U,M]);const{onOpenChange:x,triggerPointerDownPosRef:W}=y;h.useEffect(()=>{if(C){let D={x:0,y:0};const oe=X=>{D={x:Math.abs(Math.round(X.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(X.pageY)-(W.current?.y??0))}},ce=X=>{D.x<=10&&D.y<=10?X.preventDefault():C.contains(X.target)||x(!1),document.removeEventListener("pointermove",oe),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ce,{capture:!0})}}},[C,x,W]),h.useEffect(()=>{const D=()=>x(!1);return window.addEventListener("blur",D),window.addEventListener("resize",D),()=>{window.removeEventListener("blur",D),window.removeEventListener("resize",D)}},[x]);const[Q,le]=Ml(D=>{const oe=G().filter(te=>!te.disabled),ce=oe.find(te=>te.ref.current===document.activeElement),X=Tl(oe,D,ce);X&&setTimeout(()=>X.ref.current.focus())}),Z=h.useCallback((D,oe,ce)=>{const X=!q.current&&!ce;(y.value!==void 0&&y.value===oe||X)&&(z(D),X&&(q.current=!0))},[y.value]),J=h.useCallback(()=>C?.focus(),[C]),ie=h.useCallback((D,oe,ce)=>{const X=!q.current&&!ce;(y.value!==void 0&&y.value===oe||X)&&B(D)},[y.value]),me=r==="popper"?Eo:hl,ve=me===Eo?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:g,avoidCollisions:m}:{};return s.jsx(ul,{scope:n,content:C,viewport:N,onViewportChange:_,itemRefCallback:Z,selectedItem:S,onItemLeave:J,itemTextRefCallback:ie,focusSelectedItem:M,selectedItemText:V,position:r,isPositioned:U,searchRef:Q,children:s.jsx(Un,{as:Zv,allowPinchZoom:!0,children:s.jsx(Pn,{asChild:!0,trapped:y.open,onMountAutoFocus:D=>{D.preventDefault()},onUnmountAutoFocus:H(o,D=>{y.trigger?.focus({preventScroll:!0}),D.preventDefault()}),children:s.jsx(Ut,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:D=>D.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:s.jsx(me,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:D=>D.preventDefault(),...w,...ve,onPlaced:()=>Y(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:H(w.onKeyDown,D=>{const oe=D.ctrlKey||D.altKey||D.metaKey;if(D.key==="Tab"&&D.preventDefault(),!oe&&D.key.length===1&&le(D.key),["ArrowUp","ArrowDown","Home","End"].includes(D.key)){let X=G().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(D.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(D.key)){const te=D.target,ae=X.indexOf(te);X=X.slice(ae+1)}setTimeout(()=>F(X)),D.preventDefault()}})})})})})})});fl.displayName=Xv;var Jv="SelectItemAlignedPosition",hl=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=at(gt,n),i=st(gt,n),[l,c]=h.useState(null),[d,u]=h.useState(null),f=ee(t,E=>u(E)),p=Zn(n),v=h.useRef(!1),b=h.useRef(!0),{viewport:g,selectedItem:m,selectedItemText:w,focusSelectedItem:y}=i,C=h.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&g&&m&&w){const E=a.trigger.getBoundingClientRect(),S=d.getBoundingClientRect(),z=a.valueNode.getBoundingClientRect(),V=w.getBoundingClientRect();if(a.dir!=="rtl"){const te=V.left-S.left,ae=z.left-te,Ce=E.left-ae,R=E.width+Ce,be=Math.max(R,S.width),ye=window.innerWidth-Le,on=el(ae,[Le,Math.max(Le,ye-be)]);l.style.minWidth=R+"px",l.style.left=on+"px"}else{const te=S.right-V.right,ae=window.innerWidth-z.right-te,Ce=window.innerWidth-E.right-ae,R=E.width+Ce,be=Math.max(R,S.width),ye=window.innerWidth-Le,on=el(ae,[Le,Math.max(Le,ye-be)]);l.style.minWidth=R+"px",l.style.right=on+"px"}const B=p(),G=window.innerHeight-Le*2,U=g.scrollHeight,Y=window.getComputedStyle(d),q=parseInt(Y.borderTopWidth,10),F=parseInt(Y.paddingTop,10),M=parseInt(Y.borderBottomWidth,10),x=parseInt(Y.paddingBottom,10),W=q+F+U+x+M,Q=Math.min(m.offsetHeight*5,W),le=window.getComputedStyle(g),Z=parseInt(le.paddingTop,10),J=parseInt(le.paddingBottom,10),ie=E.top+E.height/2-Le,me=G-ie,ve=m.offsetHeight/2,D=m.offsetTop+ve,oe=q+F+D,ce=W-oe;if(oe<=ie){const te=B.length>0&&m===B[B.length-1].ref.current;l.style.bottom="0px";const ae=d.clientHeight-g.offsetTop-g.offsetHeight,Ce=Math.max(me,ve+(te?J:0)+ae+M),R=oe+Ce;l.style.height=R+"px"}else{const te=B.length>0&&m===B[0].ref.current;l.style.top="0px";const Ce=Math.max(ie,q+g.offsetTop+(te?Z:0)+ve)+ce;l.style.height=Ce+"px",g.scrollTop=oe-ie+g.offsetTop}l.style.margin=`${Le}px 0`,l.style.minHeight=Q+"px",l.style.maxHeight=G+"px",r?.(),requestAnimationFrame(()=>v.current=!0)}},[p,a.trigger,a.valueNode,l,d,g,m,w,a.dir,r]);pe(()=>C(),[C]);const[A,N]=h.useState();pe(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const _=h.useCallback(E=>{E&&b.current===!0&&(C(),y?.(),b.current=!1)},[C,y]);return s.jsx(e0,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:_,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:s.jsx(j.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});hl.displayName=Jv;var Rv="SelectPopperPosition",Eo=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Le,...a}=e,i=Jn(n);return s.jsx(uo,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Eo.displayName=Rv;var[e0,_o]=It(gt,{}),Mo="SelectViewport",pl=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=st(Mo,n),i=_o(Mo,n),l=ee(t,a.onViewportChange),c=h.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(Xn.Slot,{scope:n,children:s.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:H(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p?.current&&f){const v=Math.abs(c.current-u.scrollTop);if(v>0){const b=window.innerHeight-Le*2,g=parseFloat(f.style.minHeight),m=parseFloat(f.style.height),w=Math.max(g,m);if(w<b){const y=w+v,C=Math.min(b,y),A=y-C;f.style.height=C+"px",f.style.bottom==="0px"&&(u.scrollTop=A>0?A:0,f.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});pl.displayName=Mo;var gl="SelectGroup",[t0,n0]=It(gl),ml=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pe();return s.jsx(t0,{scope:n,id:o,children:s.jsx(j.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ml.displayName=gl;var vl="SelectLabel",bl=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=n0(vl,n);return s.jsx(j.div,{id:o.id,...r,ref:t})});bl.displayName=vl;var Rn="SelectItem",[r0,yl]=It(Rn),wl=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...i}=e,l=at(Rn,n),c=st(Rn,n),d=l.value===r,[u,f]=h.useState(a??""),[p,v]=h.useState(!1),b=ee(t,y=>c.itemRefCallback?.(y,r,o)),g=Pe(),m=h.useRef("touch"),w=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(r0,{scope:n,value:r,disabled:o,textId:g,isSelected:d,onItemTextChange:h.useCallback(y=>{f(C=>C||(y?.textContent??"").trim())},[]),children:s.jsx(Xn.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:s.jsx(j.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:b,onFocus:H(i.onFocus,()=>v(!0)),onBlur:H(i.onBlur,()=>v(!1)),onClick:H(i.onClick,()=>{m.current!=="mouse"&&w()}),onPointerUp:H(i.onPointerUp,()=>{m.current==="mouse"&&w()}),onPointerDown:H(i.onPointerDown,y=>{m.current=y.pointerType}),onPointerMove:H(i.onPointerMove,y=>{m.current=y.pointerType,o?c.onItemLeave?.():m.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(i.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(i.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(Yv.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})})})})});wl.displayName=Rn;var Jt="SelectItemText",xl=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,i=at(Jt,n),l=st(Jt,n),c=yl(Jt,n),d=Kv(Jt,n),[u,f]=h.useState(null),p=ee(t,w=>f(w),c.onItemTextChange,w=>l.itemTextRefCallback?.(w,c.value,c.disabled)),v=u?.textContent,b=h.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:m}=d;return pe(()=>(g(b),()=>m(b)),[g,m,b]),s.jsxs(s.Fragment,{children:[s.jsx(j.span,{id:c.textId,...a,ref:p}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?an.createPortal(a.children,i.valueNode):null]})});xl.displayName=Jt;var Cl="SelectItemIndicator",Nl=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yl(Cl,n).isSelected?s.jsx(j.span,{"aria-hidden":!0,...r,ref:t}):null});Nl.displayName=Cl;var To="SelectScrollUpButton",Sl=h.forwardRef((e,t)=>{const n=st(To,e.__scopeSelect),r=_o(To,e.__scopeSelect),[o,a]=h.useState(!1),i=ee(t,r.onScrollButtonChange);return pe(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;a(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?s.jsx(kl,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Sl.displayName=To;var Do="SelectScrollDownButton",Al=h.forwardRef((e,t)=>{const n=st(Do,e.__scopeSelect),r=_o(Do,e.__scopeSelect),[o,a]=h.useState(!1),i=ee(t,r.onScrollButtonChange);return pe(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?s.jsx(kl,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Al.displayName=Do;var kl=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=st("SelectScrollButton",n),i=h.useRef(null),l=Zn(n),c=h.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),pe(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),s.jsx(j.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:H(o.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:H(o.onPointerLeave,()=>{c()})})}),o0="SelectSeparator",Pl=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(j.div,{"aria-hidden":!0,...r,ref:t})});Pl.displayName=o0;var Oo="SelectArrow",a0=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jn(n),a=at(Oo,n),i=st(Oo,n);return a.open&&i.position==="popper"?s.jsx(fo,{...o,...r,ref:t}):null});a0.displayName=Oo;var s0="SelectBubbleInput",El=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),a=ee(r,o),i=ps(t);return h.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const f=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(f)}},[i,t]),s.jsx(j.select,{...n,style:{...tl,...n.style},ref:a,defaultValue:t})});El.displayName=s0;function _l(e){return e===""||e===void 0}function Ml(e){const t=et(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(i=>{const l=n.current+i;t(l),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),a=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function Tl(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=i0(e,Math.max(a,0));o.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function i0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var l0=rl,c0=al,d0=il,u0=ll,f0=cl,h0=dl,p0=pl,g0=ml,m0=bl,v0=wl,b0=xl,y0=Nl,w0=Sl,x0=Al,C0=Pl;const N0=l0,S0=g0,A0=d0;function k0({className:e,size:t="default",children:n,...r}){const o=t==="sm";return s.jsxs(c0,{"data-slot":"select-trigger","data-size":t,className:k("group flex w-full items-center justify-between whitespace-nowrap border bg-white outline-none transition-all duration-200","disabled:cursor-not-allowed disabled:opacity-50","data-[placeholder]:text-gray-500 focus-visible:ring-3 focus-visible:ring-main-300/60",o?"h-10 min-w-[150px] rounded-3 border-gray-300 px-3.5":"h-10 min-w-[150px] rounded-3 border-gray-300 px-4",e),...r,children:[s.jsx(L,{size:"body2",weight:"medium",className:"line-clamp-1 text-gray-900",children:n}),s.jsx(u0,{asChild:!0,children:s.jsx(mn,{"data-slot":"select-chevron",className:k("pointer-events-none shrink-0 text-gray-600 transition-transform duration-200 group-data-[state=open]:rotate-180","h-4 w-4"),strokeWidth:2.8})})]})}function P0({className:e,children:t,...n}){return s.jsxs(v0,{"data-slot":"select-item",className:k("relative flex w-full cursor-pointer items-center gap-3 rounded-2 px-3.5 py-2.5 outline-hidden select-none","text-gray-900 transition-colors focus:bg-gray-100 focus:text-gray-900","data-disabled:pointer-events-none data-disabled:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute right-3 flex size-4 items-center justify-center",children:s.jsx(y0,{children:s.jsx(zt,{className:"size-4 text-main-800"})})}),s.jsx(b0,{children:s.jsx(L,{size:"body2",weight:"medium",children:t})})]})}function E0({className:e,...t}){return s.jsx(C0,{"data-slot":"select-separator",className:k("pointer-events-none my-1 h-px bg-gray-200",e),...t})}function Dl({className:e,...t}){return s.jsx(w0,{"data-slot":"select-scroll-up-button",className:k("flex cursor-default items-center justify-center py-1 text-gray-600",e),...t,children:s.jsx(Ia,{className:"size-4"})})}function Ol({className:e,...t}){return s.jsx(x0,{"data-slot":"select-scroll-down-button",className:k("flex cursor-default items-center justify-center py-1 text-gray-600",e),...t,children:s.jsx(mn,{className:"size-4"})})}function _0({className:e,children:t,position:n="popper",...r}){return s.jsx(f0,{children:s.jsxs(h0,{"data-slot":"select-content",className:k("relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto","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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1","rounded-[24px] border border-gray-300 bg-white",e),position:n,...r,children:[s.jsx(Dl,{}),s.jsx(p0,{className:k("p-2",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"),children:t}),s.jsx(Ol,{})]})})}function M0({className:e,...t}){return s.jsx(m0,{"data-slot":"select-label",className:k("px-4 py-2 text-xs font-bold text-gray-500",e),...t})}const Il=ct(["w-full transition-all duration-200 outline-none","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-gray-500","focus-visible:outline-none"],{variants:{variant:{default:["rounded-3 border border-gray-300 bg-white px-5 text-gray-900 shadow-none","hover:border-gray-400","focus-visible:border-main-500 focus-visible:ring-3 focus-visible:ring-main-300/60"],search:["rounded-3 !h-10 border border-gray-300 bg-white pl-11 pr-4 text-gray-700 placeholder:text-gray-500","hover:border-gray-400","focus-visible:border-main-500 focus-visible:ring-3 focus-visible:ring-main-300/60"]},multiline:{false:"h-10 py-0",true:"min-h-[120px] resize-none py-3 align-top leading-relaxed"}},defaultVariants:{variant:"default",multiline:!1}});function T0(e,t){return"body2"}function D0({label:e,labelHint:t,required:n,htmlFor:r}){return e?s.jsxs("label",{htmlFor:r,className:"mb-2 inline-flex items-center gap-2",children:[s.jsx(L,{size:"body1",weight:"bold",className:"text-gray-900",children:e}),n?s.jsx(L,{size:"body1",weight:"bold",className:"text-main-800",children:"*"}):null,t?s.jsx(L,{size:"body1",weight:"regular",className:"text-gray-500",children:t}):null]}):null}const er=h.forwardRef(({className:e,variant:t="default",label:n,labelHint:r,error:o,type:a,multiline:i=!1,rows:l=8,cols:c,required:d,id:u,...f},p)=>{const v=t==="search",b=T0(t,i);return s.jsxs("div",{className:"flex w-full flex-col",children:[s.jsx(D0,{label:n,labelHint:r,required:d,htmlFor:u}),s.jsxs("div",{className:"relative w-full",children:[i?s.jsx("textarea",{id:u,rows:l,cols:c,required:d,className:k(bn({size:b,weight:"regular"}),Il({variant:t,multiline:!0}),e),ref:p,...f}):s.jsx("input",{id:u,type:a,required:d,className:k(bn({size:b,weight:v?"light":"regular"}),Il({variant:t,multiline:!1}),e),ref:p,...f}),v&&!i?s.jsx(Fa,{width:20,height:20,className:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-gray-500"}):null]}),o?s.jsx(L,{size:"caption1",weight:"regular",className:"mt-2 text-warning",children:o}):null]})});er.displayName="TextField";const Ll=h.forwardRef((e,t)=>s.jsx(er,{...e,ref:t,multiline:!0}));Ll.displayName="TextArea";function O0({goals:e,defaultGoals:t=[],onGoalsChange:n,placeholder:r="목표를 입력하세요",disabled:o=!1,addOnBlur:a=!1,inputAriaLabel:i="목표 입력",maxGoals:l,className:c,...d}){const u=e!==void 0,[f,p]=P.useState(t),[v,b]=P.useState(""),g=P.useRef(!1),m=u?e:f,w=l!==void 0&&m.length>=l,y=N=>{u||p(N),n?.(N)},C=()=>{if(o)return;const N=v.trim();N&&(y([...m,N]),b(""))},A=N=>{o||y(m.filter((_,E)=>E!==N))};return s.jsxs("div",{className:k("flex w-full flex-col gap-2",c),...d,children:[m.map((N,_)=>s.jsxs("div",{className:"flex h-10 w-full items-center justify-between rounded-3 border border-gray-300 bg-white px-5",children:[s.jsx(L,{size:"body2",weight:"regular",className:"line-clamp-1 text-gray-900",children:N}),s.jsx("button",{type:"button","aria-label":`목표 삭제: ${N}`,disabled:o,onClick:()=>A(_),className:k("inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-2 text-gray-500 transition-colors hover:cursor-pointer",!o&&"hover:bg-gray-100 hover:text-gray-700",o&&"cursor-not-allowed text-gray-400"),children:s.jsx(vr,{className:"h-4 w-4"})})]},`${N}-${_}`)),s.jsx(er,{value:v,disabled:o||w,"aria-label":i,placeholder:w?`최대 ${l}개까지 입력할 수 있습니다`:r,onChange:N=>b(N.target.value),onCompositionStart:()=>{g.current=!0},onCompositionEnd:()=>{g.current=!1},onKeyDown:N=>{N.key==="Enter"&&(N.nativeEvent.isComposing||g.current||N.nativeEvent.keyCode===229||(N.preventDefault(),C()))},onBlur:()=>{a&&C()}})]})}function I0({onChange:e,size:t=300,defaultImageUrl:n,changeLabel:r="Change",...o}){const a=Math.max(t,120),i=Math.max(Math.round(a*.3),28),l=Math.max(Math.round(i*.6),18),c=P.useRef(null),d=P.useRef(null),[u,f]=P.useState(n??null),p=()=>{c.current?.click()};P.useEffect(()=>{f(n??null)},[n]),P.useEffect(()=>()=>{d.current&&URL.revokeObjectURL(d.current)},[]);const v=b=>{const g=b.target.files?.[0];if(g){d.current&&URL.revokeObjectURL(d.current);const m=URL.createObjectURL(g);d.current=m,f(m)}};return s.jsxs("div",{className:"relative inline-flex",style:{width:a,height:a},children:[s.jsx("input",{type:"file",accept:"image/*",ref:c,className:"hidden",onChange:b=>{e!==void 0&&e(b),v(b)},...o}),s.jsx("button",{type:"button",onClick:p,"aria-label":"이미지 선택",className:k("relative h-full w-full overflow-hidden rounded-full","cursor-pointer",u?"bg-main-300":"border-2 border-dashed border-gray-400 bg-white"),children:u?s.jsx("img",{src:u,alt:"이미지 미리보기",className:"h-full w-full object-cover",loading:"lazy"}):s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx($t,{width:l,height:i,className:"text-gray-300"})})}),s.jsxs("button",{type:"button",onClick:p,className:k("absolute bottom-0 left-1/2 z-10 inline-flex h-9 -translate-x-1/2 translate-y-1/2 items-center gap-1.5 rounded-full border border-gray-200 bg-white px-5","cursor-pointer shadow-[0_6px_16px_rgba(34,34,34,0.16)]"),children:[s.jsx(xn,{className:"h-3.5 w-3.5 text-gray-700"}),s.jsx(L,{size:"caption1",weight:"medium",className:"text-gray-700 whitespace-nowrap",children:r})]})]})}function L0({className:e,logoSize:t="md"}){const n={sm:"w-4 h-6",md:"w-6 h-10",lg:"w-8 h-14"};return s.jsx("div",{className:k("flex items-center justify-center bg-main-200",e),children:s.jsx($t,{className:k("text-main-500",n[t])})})}function F0({previewUrl:e,onSelectFile:t,onClear:n,placeholderTitle:r="썸네일 영역을 클릭해 이미지를 선택하세요.",placeholderSubtitle:o="또는 이미지를 드래그해서 놓아주세요.",helperText:a="JPG, PNG, GIF 파일을 업로드할 수 있습니다.",clearLabel:i="선택 해제",dropZoneClassName:l="min-h-[220px] flex-1 lg:min-h-[440px]",className:c}){const d=P.useRef(null),[u,f]=P.useState(!1),[p,v]=P.useState(null),b=!!e&&p!==e,g=!!e,m=()=>{d.current?.click()},w=S=>{!S||!S.type.startsWith("image/")||(v(null),t(S))},y=S=>{const z=S.target.files?.[0]??null;w(z),S.target.value=""},C=S=>{S.preventDefault(),f(!0)},A=S=>{S.preventDefault(),u||f(!0)},N=S=>{S.preventDefault(),f(!1)},_=S=>{S.preventDefault(),f(!1);const z=S.dataTransfer.files?.[0]??null;w(z)},E=S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),m())};return s.jsxs("div",{className:k("flex h-full flex-col rounded-2xl border border-gray-200 bg-white p-4",c),children:[s.jsxs("div",{role:"button",tabIndex:0,"aria-label":"썸네일 이미지 선택",className:k("relative flex w-full cursor-pointer items-center justify-center overflow-hidden rounded-xl border bg-gray-100 transition outline-none",l,u?"border-main-700 ring-3 ring-main-300":"border-gray-200 hover:border-gray-300"),onClick:m,onKeyDown:E,onDragEnter:C,onDragOver:A,onDragLeave:N,onDrop:_,children:[b?s.jsx("img",{src:e,alt:"썸네일 미리보기",className:"absolute inset-0 h-full w-full object-cover",onError:()=>v(e??null)}):s.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 text-center",children:[s.jsx(L,{size:"body2",weight:"medium",className:"text-gray-700",children:r}),s.jsx(L,{size:"caption1",weight:"regular",className:"text-gray-500",children:o})]}),s.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:y,className:"hidden"})]}),s.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3",children:[s.jsx(L,{size:"caption1",weight:"regular",className:"text-gray-500",children:a}),g&&n?s.jsx(ue,{type:"button",variant:"outlined",size:"small",className:"shrink-0",onClick:n,children:i}):null]})]})}function W0({mainText:e,subText:t,imageSrc:n,imageAlt:r="icon",gradientFrom:o,gradientTo:a,onClick:i,className:l}){return s.jsxs("div",{className:k("relative overflow-hidden rounded-2 text-white","flex flex-col justify-between","p-4 sm:p-4 lg:p-6","h-24 w-full sm:h-36 lg:h-47.5 lg:w-56","hover:shadow-default hover:-translate-y-1 transition-all duration-300",i&&"cursor-pointer",l),style:{backgroundImage:`linear-gradient(to bottom right, ${o}, ${a})`},onClick:i,children:[s.jsxs("div",{className:"flex w-full flex-col gap-0.5 sm:gap-1",children:[s.jsx(L,{size:"caption3",weight:"medium",className:"opacity-80",children:e}),s.jsx(L,{size:"caption2",weight:"bold",className:"mt-0.5 sm:text-xl sm:mt-1 lg:text-2xl",children:t})]}),s.jsx("div",{className:"absolute bottom-2 left-2 sm:bottom-4 sm:left-4 lg:bottom-6 lg:left-6",children:s.jsx(Yo,{src:n,alt:r,width:24,height:40,className:"object-contain sm:w-9 sm:h-15 lg:w-12 lg:h-19.5"})}),s.jsx(L,{size:"body2",weight:"bold",className:"absolute right-2 bottom-2 sm:right-4 sm:bottom-4 sm:text-3xl lg:right-6 lg:bottom-6 lg:text-4xl",children:"→"})]})}function B0({children:e,className:t}){return s.jsx("div",{className:k("flex min-h-screen w-screen flex-col bg-white",t),children:e})}function z0({children:e,className:t}){return s.jsx("header",{className:k("sticky top-0 z-30 shrink-0 bg-white px-4 pt-3",t),children:e})}function $0({children:e,sidebar:t,className:n}){return t?s.jsxs("div",{className:k("flex min-h-0 flex-1 gap-4",n),children:[s.jsx("main",{className:"min-h-0 min-w-0 flex-1 overflow-x-hidden",children:e}),t]}):s.jsx("main",{className:k("min-h-0 min-w-0 flex-1",n),children:e})}function H0({children:e,stickyTop:t="top-28",className:n}){return s.jsx("aside",{className:k("sticky hidden h-fit min-h-0 shrink-0 self-start pt-3 pr-3 lg:block",t,n),children:e})}function V0({children:e,open:t,className:n}){return s.jsx("div",{className:k("fixed top-4 right-3 z-50 transition-opacity duration-200",t?"opacity-100":"opacity-0",n),children:e})}const Fl=P.createContext({hasRightSidebar:!1,isRightSidebarCollapsed:!1});function Y0({value:e,children:t}){return s.jsx(Fl.Provider,{value:e,children:t})}function j0(){return P.useContext(Fl)}function G0(){return s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx($t,{width:24,height:40,className:"text-gray-300"}),s.jsx(L,{size:"body1",weight:"bold",className:"my-2.5 text-gray-300",children:"1D1S"})]})}const Rt="...";function U0({currentPage:e,totalPages:t,siblingCount:n=1}){return h.useMemo(()=>{if(n+5>=t)return Array.from({length:t},(f,p)=>p+1);const a=Math.max(e-n,1),i=Math.min(e+n,t),l=a>2,c=i<t-2,d=1,u=t;if(!l&&c){const f=3+2*n;return[...Array.from({length:f},(v,b)=>b+1),Rt,t]}if(l&&!c){const f=3+2*n,p=Array.from({length:f},(v,b)=>t-f+b+1);return[d,Rt,...p]}if(l&&c){const f=Array.from({length:i-a+1},(p,v)=>a+v);return[d,Rt,...f,Rt,u]}},[t,e,n])}function K0({currentPage:e,totalPages:t,onPageChange:n,siblingCount:r=1,className:o}){const a=U0({currentPage:e,totalPages:t,siblingCount:r});if(e===0||t<2)return null;const i=()=>{e<t&&n(e+1)},l=()=>{e>1&&n(e-1)};return s.jsxs("nav",{role:"navigation","aria-label":"Pagination",className:k("flex items-center justify-center gap-3",o),children:[s.jsx(ue,{onClick:l,disabled:e===1,variant:"outlined",size:"icon",className:"rounded-3 border-gray-300 bg-white text-gray-600 hover:bg-gray-100 disabled:bg-gray-100 disabled:text-gray-400","aria-label":"Go to previous page",children:s.jsx(yn,{className:"h-5 w-5"})}),a?.map((c,d)=>{if(c===Rt)return s.jsx("div",{className:"flex h-10 min-w-10 items-center justify-center px-1",children:s.jsx("span",{className:"text-lg font-medium text-gray-400",children:"..."})},`dots-${d}`);const u=c===e;return s.jsx(ue,{onClick:()=>n(c),variant:u?"default":"secondary",size:"icon",className:k("rounded-3",u?"bg-main-800 text-white shadow-[0_8px_16px_rgba(255,87,34,0.3)] hover:bg-main-800":"bg-gray-100 text-gray-700 hover:bg-gray-200"),"aria-current":u?"page":void 0,children:s.jsx("span",{className:k("text-2xl leading-none",u?"font-bold text-white":"font-medium text-gray-700"),children:c})},c)}),s.jsx(ue,{onClick:i,disabled:e===t,variant:"outlined",size:"icon",className:"rounded-3 border-gray-300 bg-white text-gray-600 hover:bg-gray-100 disabled:bg-gray-100 disabled:text-gray-400","aria-label":"Go to next page",children:s.jsx(wn,{className:"h-5 w-5"})})]})}const Q0={sm:{avatar:"sm",textSize:"caption1",statusSize:"caption2"},md:{avatar:"md",textSize:"body2",statusSize:"caption1"},lg:{avatar:"lg",textSize:"body1",statusSize:"caption1"}};function q0({nickname:e,imageUrl:t,size:n="md",layout:r="horizontal",statusText:o,onClick:a,className:i}){const{avatar:l,textSize:c,statusSize:d}=Q0[n],u=!!a,f=u?"button":"div";return s.jsxs(f,{type:u?"button":void 0,onClick:a,className:k("inline-flex items-center",r==="horizontal"?"flex-row gap-2.5":"flex-col gap-2",u&&["cursor-pointer rounded-2xl px-3 py-2 transition-colors","hover:bg-gray-100"],i),children:[s.jsx(Bt,{imageUrl:t,size:l}),r==="horizontal"?s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(L,{size:c,weight:"bold",className:"line-clamp-1 text-gray-900",children:e}),o?s.jsx(L,{size:d,weight:"regular",className:"text-gray-500",children:o}):null]}):s.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[s.jsx(L,{size:c,weight:"bold",className:"text-gray-900",children:e}),o?s.jsx(L,{size:d,weight:"regular",className:"text-gray-500",children:o}):null]})]})}function Wl({value:e,label:t,showLabel:n,showValueText:r=!0,valueText:o,infinite:a=!1,thickness:i=6,fillColor:l,trackColor:c,className:d,labelClassName:u,valueClassName:f,trackClassName:p,fillClassName:v,...b}){const g=Math.min(Math.max(e,0),100),m=a?"100%":`${g}%`,w=o??(a?"∞":`${g}%`),y=n??t!==void 0;return s.jsxs("div",{className:k("w-full",d),...b,children:[(y||r)&&s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y?s.jsx(L,{size:"caption1",weight:"medium",className:k("line-clamp-1 text-gray-800",u),children:t}):s.jsx("span",{}),r?s.jsx(L,{size:"caption1",weight:"medium",className:k("shrink-0 text-gray-600",f),children:w}):null]}),s.jsx("div",{className:k("mt-2.5 overflow-hidden rounded-full bg-gray-200",p),style:{height:`${i}px`,...c?{backgroundColor:c}:{}},children:s.jsx("div",{className:k("h-full rounded-full bg-main-800 transition-all duration-200",v),style:{width:m,...l?{backgroundColor:l}:{}}})})]})}function X0({value:e}){const t=Math.max(0,Math.floor(e)),[n,r]=P.useState(0);P.useEffect(()=>{let a=0;const i=performance.now(),l=Math.min(1400,Math.max(500,t*30)),c=u=>1-(1-u)**3;r(0);const d=u=>{const f=u-i,p=Math.min(f/l,1),v=Math.floor(t*c(p));r(v),p<1&&(a=requestAnimationFrame(d))};return a=requestAnimationFrame(d),()=>{cancelAnimationFrame(a)}},[t]);const o=Math.max(String(t).length,1);return s.jsx("span",{className:"inline-flex justify-start tabular-nums",style:{minWidth:`${o}ch`},children:n})}function Fe({className:e}){return s.jsx("span",{"aria-hidden":!0,className:k("block animate-pulse rounded-md bg-gray-200",e)})}function Lt({className:e}){return s.jsx("span",{"aria-hidden":!0,className:k("block h-12 w-12 shrink-0 animate-pulse bg-gray-200",e),style:{borderRadius:"9999px"}})}function en({loading:e,skeleton:t,children:n,className:r,durationMs:o=280}){return s.jsxs("div",{className:k("relative",r),children:[s.jsx("div",{className:k("transition-opacity ease-out",e?"pointer-events-none opacity-0":"opacity-100"),style:{transitionDuration:`${o}ms`},"aria-hidden":e,children:n}),s.jsx("div",{className:k("pointer-events-none absolute inset-0 transition-opacity ease-out",e?"opacity-100":"opacity-0"),style:{transitionDuration:`${o}ms`},"aria-hidden":!e,children:t})]})}const Z0=[{id:"1",title:"알고리즘 부시기",progress:56,tone:"blue"},{id:"2",title:"새벽 러닝",progress:84,tone:"green"}],J0={blue:"#3b82f6",green:"#22c55e",orange:"#ff5722"};function R0({isLoggedIn:e=!0,isLoading:t=!1,userName:n,userSubtitle:r,userImage:o,streakDays:a,fixed:i=!0,collapsible:l=!0,className:c,diaryButtonLabel:d="일지 작성하기",myPageButtonLabel:u="마이페이지",loginButtonLabel:f="로그인",loginPromptMessage:p="로그인하고 연속 기록을 시작해보세요",settingButtonLabel:v="설정",challengeTitle:b="참여중인 챌린지",challenges:g=Z0,emptyChallengeMessage:m="챌린지가 없어요.",joinChallengeButtonLabel:w="챌린지 참여하기",joinChallengeMaxUserCount:y,createChallengeButtonLabel:C="챌린지 생성하기",onCollapseClick:A,onOpenSettings:N,onWriteDiary:_,onGoMyPage:E,onLogin:S,onJoinChallenge:z,onCreateChallenge:V,onChallengeClick:B}){const[F,M]=P.useState(!1),[x,W]=P.useState("expanded"),[Q,le]=P.useState(!0),[Z,J]=P.useState(!1),[ie,me]=P.useState(null),ve=P.useRef(null),D=P.useRef([]),oe=typeof y=="number"&&y<=0,ce=()=>{D.current.forEach(R=>clearTimeout(R)),D.current=[]},X=(R,be)=>{const ye=setTimeout(()=>{R(),D.current=D.current.filter(on=>on!==ye)},be);D.current.push(ye)};P.useEffect(()=>()=>{ce()},[]);const te=()=>{const R=ve.current;return R?Math.max(Math.ceil(R.scrollHeight),0):null},ae=()=>{const R=ve.current;if(!R)return null;const be=R.style.height;R.style.height="auto";const ye=te();return R.style.height=be,ye},Ce=()=>{if(Z)return;const R=!F,be=ve.current?.offsetHeight;be&&be>0&&me(be),J(!0),le(!1),A?.(),ce(),X(()=>{M(R),W(R?"collapsed":"expanded")},140),X(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{const ye=ae();ye&&ye>0&&me(ye)})})},440),X(()=>{le(!0)},720),X(()=>{me(null),J(!1)},940)};return s.jsxs("div",{className:k("z-40 transition-[width] duration-300 ease-in-out",i?"fixed top-4 right-3 max-h-[calc(100vh-2rem)]":"relative max-h-190",F?"w-22":"w-69",c),children:[l&&s.jsx(ue,{type:"button",variant:"outlined",size:"icon","aria-label":"사이드바 접기",onClick:Ce,disabled:Z,className:"absolute top-6 -left-4 z-20 h-8 w-8 min-w-8 rounded-full p-0 text-gray-500 shadow-sm",children:s.jsx(wn,{className:k("h-4 w-4 transition-transform duration-200",F?"rotate-180":"rotate-0")})}),s.jsx("aside",{ref:ve,className:k("relative flex w-full flex-col overflow-x-hidden overflow-y-auto rounded-4 border border-gray-200 bg-white p-3 shadow-[0_6px_16px_rgba(34,34,34,0.06)]",ie!==null&&"transition-[height] duration-300 ease-in-out",i&&"max-h-[calc(100vh-2rem)]",!i&&"max-h-full"),style:{height:ie?`${ie}px`:void 0},children:s.jsx("div",{className:k("flex h-full w-full transition-opacity ease-out",Q?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"),style:{transitionDuration:`${Q?220:140}ms`},"aria-hidden":!Q,children:x==="expanded"?s.jsxs("div",{className:"flex w-full flex-col px-2 py-2",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsx(en,{loading:t,skeleton:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Lt,{}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(Fe,{className:"h-6 w-24 rounded-sm"}),s.jsx(Fe,{className:"h-4 w-28 rounded-sm"})]})]}),children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Bt,{imageUrl:o,size:"md",className:"ring-2 ring-mint-900/40"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(L,{size:"body1",weight:"bold",className:"text-gray-900",children:e?n??"고라니":"게스트"}),s.jsx(L,{size:"caption1",weight:"regular",className:"text-gray-600",children:e?r??"":"로그인 후 이용 가능"})]})]})}),s.jsx(en,{loading:t,skeleton:s.jsx(Fe,{className:"h-9 w-9 rounded-full"}),children:e?s.jsx(ue,{type:"button",variant:"ghost",size:"icon","aria-label":"설정",onClick:N,className:"text-gray-500 hover:text-gray-700",children:s.jsx(wr,{className:"h-5 w-5"})}):null})]}),s.jsx("div",{className:"mt-6 rounded-3 border border-main-400 bg-main-200 px-4 py-4 text-center",children:s.jsx(en,{loading:t,skeleton:s.jsxs("div",{children:[s.jsx(Fe,{className:"mx-auto h-4 w-20 rounded-sm"}),s.jsxs("div",{className:"mt-3 flex items-center justify-center gap-2",children:[s.jsx(Lt,{className:"h-7 w-7"}),s.jsx(Fe,{className:"h-9 w-16 rounded-sm"}),s.jsx(Fe,{className:"h-5 w-12 rounded-sm"})]})]}),children:s.jsxs("div",{children:[s.jsx(L,{as:"p",size:"caption1",weight:"medium",className:"text-gray-700",children:"현재 연속 기록"}),e?s.jsxs("div",{className:"mt-3 flex items-center justify-center gap-2.5",children:[s.jsx(Oa,{className:"h-7 w-7 text-main-800",strokeWidth:2.2}),s.jsx(L,{size:"heading1",weight:"bold",className:"text-main-800",children:s.jsx(X0,{value:a})}),s.jsx(L,{size:"body1",weight:"bold",className:"text-gray-800",children:"Days"})]}):s.jsx(L,{as:"p",size:"caption1",weight:"medium",className:"mt-3 block leading-tight text-gray-700",children:p})]})})}),s.jsx(en,{loading:t,skeleton:s.jsxs("div",{children:[s.jsx(Fe,{className:"mt-5 h-10 w-full rounded-2"}),s.jsx(Fe,{className:"mt-3 h-10 w-full rounded-2"}),s.jsxs("div",{className:"mt-5 pt-5",children:[s.jsx(Fe,{className:"h-4 w-30 rounded-sm"}),s.jsx("div",{className:"mt-4 flex flex-col gap-3",children:Array.from({length:2},(R,be)=>s.jsxs("div",{className:"rounded-2 border border-gray-100 px-3 py-3",children:[s.jsx(Fe,{className:"h-4 w-32 rounded-sm"}),s.jsx(Fe,{className:"mt-3 h-2 w-full rounded-full"})]},be))})]})]}),children:e?s.jsxs(s.Fragment,{children:[s.jsxs(ue,{className:"mt-5 w-full",size:"medium",disabled:g.length===0,onClick:_,children:[s.jsx(xn,{className:"h-4 w-4"}),s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:d})]}),s.jsxs(ue,{variant:"outlined",className:"mt-3 w-full",size:"medium",onClick:E,children:[s.jsx(yr,{className:"h-4 w-4"}),s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:u})]}),s.jsxs("div",{className:"mt-5 pt-5",children:[s.jsx(L,{size:"caption1",weight:"medium",className:"text-gray-500",children:b}),g.length>0?s.jsx("div",{className:"mt-4 flex flex-col gap-1",children:g.map(R=>{const be=R.tone??"blue";return s.jsx("div",{role:B?"button":void 0,tabIndex:B?0:void 0,onClick:B?()=>B(R):void 0,onKeyDown:B?ye=>{(ye.key==="Enter"||ye.key===" ")&&B(R)}:void 0,className:k("-mx-2 rounded-2 px-2 py-2 transition-colors duration-150",B&&"cursor-pointer hover:bg-gray-100 active:bg-gray-200"),children:s.jsx(Wl,{label:R.title,value:R.progress,infinite:R.hasDeadline===!1,fillColor:J0[be]})},R.id)})}):s.jsxs("div",{className:"mt-4",children:[s.jsx(L,{as:"p",size:"caption1",weight:"medium",className:"text-gray-600",children:m}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2.5",children:[s.jsx(ue,{type:"button",className:"w-full",size:"medium",disabled:oe,onClick:z,children:w}),s.jsx(ue,{type:"button",variant:"outlined",className:"w-full",size:"medium",onClick:V,children:C})]})]})]})]}):s.jsxs(ue,{className:"mt-5 w-full",size:"medium",onClick:S,children:[s.jsx(br,{className:"h-4 w-4"}),s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:f})]})})]}):s.jsx("div",{className:"flex w-full flex-col items-center pt-2",children:s.jsx(en,{loading:t,className:"w-full",skeleton:s.jsxs("div",{className:"flex w-full flex-col items-center",children:[s.jsx(Lt,{}),s.jsxs("div",{className:"mt-5 flex flex-col items-center gap-3",children:[s.jsx(Lt,{className:"h-10 w-10"}),s.jsx(Lt,{className:"h-10 w-10"}),s.jsx(Lt,{className:"h-10 w-10"})]})]}),children:s.jsxs("div",{className:"flex w-full flex-col items-center",children:[s.jsx(Bt,{imageUrl:o,size:"md",className:"ring-2 ring-mint-900/40"}),s.jsx("div",{className:"mt-5 flex flex-col items-center gap-3",children:e?s.jsxs(s.Fragment,{children:[s.jsx(ue,{type:"button",size:"icon","aria-label":d,onClick:_,children:s.jsx(xn,{className:"h-4 w-4"})}),s.jsx(ue,{type:"button",variant:"outlined",size:"icon","aria-label":u,onClick:E,children:s.jsx(yr,{className:"h-4 w-4"})}),s.jsx(ue,{type:"button",variant:"outlined",size:"icon","aria-label":v,onClick:N,children:s.jsx(wr,{className:"h-4 w-4"})})]}):s.jsx(ue,{type:"button",size:"icon","aria-label":f,onClick:S,children:s.jsx(br,{className:"h-4 w-4"})})})]})})})})})]})}const eb=["SUN","MON","TUE","WED","THU","FRI","SAT"];function tb(e){return e===void 0?"100%":typeof e=="number"?`${e}%`:e}function nb(e="default"){return e==="strong"?"text-gray-900 font-bold":e==="accent"?"text-main-800 font-bold":e==="muted"?"text-gray-500 font-medium":"text-gray-600 font-medium"}function rb(e="main"){return e==="soft"?"bg-main-600/50":"bg-main-800"}function ob({rows:e,weekLabels:t=[...eb],cellMinHeight:n=140,className:r}){return s.jsx("div",{className:k("w-full overflow-hidden rounded-4 border border-gray-300 bg-white",r),children:s.jsxs("table",{className:"w-full table-fixed border-collapse",children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map((o,a)=>s.jsx("th",{className:k("h-8 border-b border-r border-gray-300 bg-gray-100 px-1 text-center align-middle sm:h-12 sm:px-2.5",a===t.length-1&&"border-r-0"),scope:"col",children:s.jsx(L,{size:"caption3",weight:"bold",className:"text-gray-600 sm:text-lg",children:o})},`${o}-${a}`))})}),s.jsx("tbody",{children:e.map((o,a)=>s.jsx("tr",{children:o.map((i,l)=>{const c=i.colSpan??1,d=i.id??`r${a}-c${l}`,u=o.slice(0,l+1).reduce((f,p)=>f+(p.colSpan??1),0)>=7;return s.jsx("td",{colSpan:c,className:k("border-r border-b border-gray-300 align-top",u&&"border-r-0"),children:s.jsx("div",{className:k("flex h-full flex-col gap-1 p-1 sm:gap-2 sm:p-2",i.muted&&"bg-gray-300",i.highlighted&&"bg-main-200 ring-1 ring-inset ring-main-400"),style:{minHeight:`${n}px`},children:i.content?i.content:s.jsxs(s.Fragment,{children:[i.day!==void 0?s.jsx(L,{size:"caption3",weight:"medium",className:k("leading-tight sm:text-lg",nb(i.dayTone)),children:i.day}):null,i.title!==void 0?s.jsx(L,{size:"caption3",weight:"bold",className:"line-clamp-1 text-gray-900 sm:text-lg",children:i.title}):null,i.bars&&i.bars.length>0?s.jsx("div",{className:"mt-0.5 flex flex-col gap-1",children:i.bars.map((f,p)=>s.jsx("span",{className:k("block h-1 rounded-full transition-all duration-200 sm:h-1.5",rb(f.tone)),style:{width:tb(f.width)}},`${d}-bar-${p}`))}):null,i.subtitle!==void 0?s.jsx(L,{size:"caption3",weight:"medium",className:"hidden text-gray-600 sm:block",children:i.subtitle}):null]})})},d)})},`row-${a}`))})]})})}function ab({icon:e,iconName:t,title:n,value:r,unit:o,className:a,iconClassName:i,...l}){const c=e??(t?s.jsx(Wa,{name:t,size:32}):null);return s.jsxs("div",{className:k("rounded-[24px] border border-gray-200 bg-white p-7","shadow-[0_1px_4px_rgba(17,17,17,0.08)]","w-full",a),...l,children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:k("text-main-800","[&_svg]:h-8 [&_svg]:w-8",i),children:c}),s.jsx(L,{size:"heading2",weight:"medium",className:"leading-tight text-gray-600",children:n})]}),s.jsxs("div",{className:"mt-6 flex items-end gap-1.5",children:[s.jsx(L,{size:"display1",weight:"bold",className:"text-gray-900",children:r}),s.jsx(L,{size:"heading2",weight:"medium",className:"pb-1 text-gray-600",children:o})]})]})}const sb={sm:{circle:"h-7 w-7",trackTop:"top-3.5",checkIcon:"h-3 w-3",numberSize:"caption1",labelSize:"body2",labelMargin:"mt-3"},md:{circle:"h-10 w-10",trackTop:"top-5",checkIcon:"h-4 w-4",numberSize:"body1",labelSize:"heading2",labelMargin:"mt-5"},lg:{circle:"h-14 w-14",trackTop:"top-7",checkIcon:"h-5 w-5",numberSize:"body1",labelSize:"heading1",labelMargin:"mt-7"}};function ib({steps:e,currentStep:t,size:n="md",className:r}){const o=sb[n];if(e.length===0)return s.jsx("div",{className:k("w-full",r)});const a=Math.max(e.length-1,0),i=Math.min(Math.max(t-1,0),a),l=`${100/(e.length*2)}%`,c=a===0?100:i/a*100;return s.jsx("div",{className:k("w-full",r),children:s.jsxs("div",{className:"relative",children:[e.length>1?s.jsxs("div",{className:k("absolute",o.trackTop),style:{left:l,right:l},children:[s.jsx("div",{className:"h-0.5 w-full bg-gray-200"}),s.jsx("div",{className:"absolute top-0 left-0 h-0.5 bg-main-800 transition-all duration-300 ease-in-out",style:{width:`${c}%`}})]}):null,s.jsx("ol",{className:"relative z-10 flex items-start",children:e.map((d,u)=>{const f=u<i,p=u===i,v=d.id??`step-${u}`;return s.jsxs("li",{className:"flex flex-1 flex-col items-center",children:[s.jsx("span",{className:k("flex items-center justify-center rounded-full border-2 bg-white transition-colors duration-200",o.circle,f&&"border-main-800 bg-main-800 text-white",p&&"border-main-800 bg-main-800 text-white ring-4 ring-main-300",!f&&!p&&"border-gray-300 text-gray-600"),"aria-current":p?"step":void 0,children:f?s.jsx(zt,{className:o.checkIcon,strokeWidth:2.5}):s.jsx(L,{size:o.numberSize,weight:"bold",className:k(p?"text-white":"text-gray-600"),children:u+1})}),s.jsx(L,{size:o.labelSize,weight:p?"bold":"medium",className:k("text-center leading-tight",o.labelMargin,f&&"text-gray-900",p&&"text-main-800",!f&&!p&&"text-gray-600"),children:d.label})]},v)})})]})})}function lb({data:e=[],size:t=26,gap:n=8,className:r,renderCellActions:o}){const[a,i]=P.useState(null),[l,c]=P.useState(null),d=P.useRef(null),u=P.useRef(!1),f=P.useRef(!1),p=()=>{d.current!==null&&(clearTimeout(d.current),d.current=null)},v=b=>b<=0?"bg-gray-100":b===1?"bg-main-300":b===2?"bg-main-500":b===3?"bg-main-700":"bg-main-800";return s.jsx("div",{className:k("w-full overflow-x-auto pb-2",r),children:s.jsx("div",{className:"grid w-max grid-flow-col grid-rows-7",style:{gridTemplateRows:`repeat(7, ${t}px)`,gridAutoColumns:`${t}px`,gap:`${n}px`},children:e.map((b,g)=>s.jsxs(wo,{open:a===g,onOpenChange:m=>{if(!m){if(u.current){u.current=!1;return}i(null),c(null),f.current=!0,setTimeout(()=>{f.current=!1},200)}},children:[s.jsx(xo,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":`${b.date} · ${b.count}회 활동`,className:k("cursor-pointer transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-800 focus-visible:ring-offset-1",v(b.count),l===g&&"ring-2 ring-gray-800 ring-offset-1"),style:{width:t,height:t,borderRadius:`${Math.max(4,Math.round(t*.23))}px`},onMouseEnter:()=>{p(),l===null&&!f.current&&i(g)},onMouseLeave:()=>{l===null&&(d.current=setTimeout(()=>i(null),80))},onClick:()=>{p(),l===g?(c(null),i(null),f.current=!0,setTimeout(()=>{f.current=!1},200)):(u.current=!0,c(g),i(g))}})}),s.jsx(Co,{children:s.jsxs(No,{side:"top",sideOffset:4,onOpenAutoFocus:m=>m.preventDefault(),onMouseEnter:()=>{p()},onMouseLeave:()=>{l===null&&i(null)},className:k("z-50 min-w-[120px] rounded-xl bg-gray-900 px-3 py-2 text-white shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:slide-in-from-top-2"),children:[s.jsxs("p",{className:"whitespace-nowrap text-xs",children:[b.date," · ",b.count,"회 활동"]}),l===g&&o?s.jsx("div",{className:"mt-2",children:o(b)}):null]})})]},g))})})}const cb=ct("inline-flex items-center rounded-2 px-2.5 py-1 bg-main-800 text-white",{variants:{hasIcon:{true:"gap-1.5",false:""}},defaultVariants:{hasIcon:!1}});function db({icon:e,children:t,size:n="caption2",weight:r="bold",className:o}){return s.jsxs("span",{className:k(cb({hasIcon:!!e}),o),children:[e&&s.jsx(L,{size:n,weight:"medium",children:e}),s.jsx(L,{size:n,weight:r,children:t})]})}var Bl="Toggle",Io=h.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...a}=e,[i,l]=Ne({prop:n,onChange:o,defaultProp:r??!1,caller:Bl});return s.jsx(j.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:H(e.onClick,()=>{e.disabled||l(!i)})})});Io.displayName=Bl;var ub=Io;const fb=ct(["inline-flex w-fit items-center justify-center gap-2.5 border bg-white whitespace-nowrap","text-gray-700 transition-all duration-200 ease-out active:scale-95","cursor-pointer disabled:pointer-events-none disabled:opacity-50 disabled:active:scale-100","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-main-300/60","hover:border-gray-400 hover:bg-gray-100","data-[state=on]:border-main-800 data-[state=on]:bg-main-800 data-[state=on]:text-white","data-[state=on]:hover:bg-main-600 data-[state=on]:hover:border-main-600","data-[state=on]:shadow-[0_4px_10px_rgba(255,87,34,0.22)]"],{variants:{shape:{rounded:"h-10 rounded-full px-5",square:"h-10 rounded-3 px-4"}},defaultVariants:{shape:"rounded"}});function hb({icon:e,shape:t="rounded",children:n,className:r,...o}){return s.jsxs(ub,{className:k(fb({shape:t}),r),...o,children:[e?s.jsx("span",{className:"inline-flex items-center justify-center text-[18px] leading-none text-inherit [&>svg]:h-5 [&>svg]:w-5",children:e}):null,s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:n})]})}var Lo="rovingFocusGroup.onEntryFocus",pb={bubbles:!1,cancelable:!0},tn="RovingFocusGroup",[Fo,zl,gb]=ar(tn),[mb,$l]=ke(tn,[gb]),[vb,bb]=mb(tn),Hl=h.forwardRef((e,t)=>s.jsx(Fo.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Fo.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(yb,{...e,ref:t})})}));Hl.displayName=tn;var yb=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,p=h.useRef(null),v=ee(t,p),b=cn(a),[g,m]=Ne({prop:i,defaultProp:l??null,onChange:c,caller:tn}),[w,y]=h.useState(!1),C=et(d),A=zl(n),N=h.useRef(!1),[_,E]=h.useState(0);return h.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(Lo,C),()=>S.removeEventListener(Lo,C)},[C]),s.jsx(vb,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:g,onItemFocus:h.useCallback(S=>m(S),[m]),onItemShiftTab:h.useCallback(()=>y(!0),[]),onFocusableItemAdd:h.useCallback(()=>E(S=>S+1),[]),onFocusableItemRemove:h.useCallback(()=>E(S=>S-1),[]),children:s.jsx(j.div,{tabIndex:w||_===0?-1:0,"data-orientation":r,...f,ref:v,style:{outline:"none",...e.style},onMouseDown:H(e.onMouseDown,()=>{N.current=!0}),onFocus:H(e.onFocus,S=>{const z=!N.current;if(S.target===S.currentTarget&&z&&!w){const V=new CustomEvent(Lo,pb);if(S.currentTarget.dispatchEvent(V),!V.defaultPrevented){const B=A().filter(F=>F.focusable),G=B.find(F=>F.active),U=B.find(F=>F.id===g),q=[G,U,...B].filter(Boolean).map(F=>F.ref.current);jl(q,u)}}N.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})}),Vl="RovingFocusGroupItem",Yl=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...l}=e,c=Pe(),d=a||c,u=bb(Vl,n),f=u.currentTabStopId===d,p=zl(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:g}=u;return h.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),s.jsx(Fo.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:s.jsx(j.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:H(e.onMouseDown,m=>{r?u.onItemFocus(d):m.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const w=Cb(m,u.orientation,u.dir);if(w!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let C=p().filter(A=>A.focusable).map(A=>A.ref.current);if(w==="last")C.reverse();else if(w==="prev"||w==="next"){w==="prev"&&C.reverse();const A=C.indexOf(m.currentTarget);C=u.loop?Nb(C,A+1):C.slice(A+1)}setTimeout(()=>jl(C))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});Yl.displayName=Vl;var wb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Cb(e,t,n){const r=xb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return wb[r]}function jl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Nb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Sb=Hl,Ab=Yl,it="ToggleGroup",[Gl]=ke(it,[$l]),Ul=$l(),Wo=P.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return s.jsx(kb,{...o,ref:t})}if(n==="multiple"){const o=r;return s.jsx(Pb,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${it}\``)});Wo.displayName=it;var[Kl,Ql]=Gl(it),kb=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...a}=e,[i,l]=Ne({prop:n,defaultProp:r??"",onChange:o,caller:it});return s.jsx(Kl,{scope:e.__scopeToggleGroup,type:"single",value:P.useMemo(()=>i?[i]:[],[i]),onItemActivate:l,onItemDeactivate:P.useCallback(()=>l(""),[l]),children:s.jsx(ql,{...a,ref:t})})}),Pb=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...a}=e,[i,l]=Ne({prop:n,defaultProp:r??[],onChange:o,caller:it}),c=P.useCallback(u=>l((f=[])=>[...f,u]),[l]),d=P.useCallback(u=>l((f=[])=>f.filter(p=>p!==u)),[l]);return s.jsx(Kl,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:d,children:s.jsx(ql,{...a,ref:t})})});Wo.displayName=it;var[Eb,_b]=Gl(it),ql=P.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:a,dir:i,loop:l=!0,...c}=e,d=Ul(n),u=cn(i),f={role:"group",dir:u,...c};return s.jsx(Eb,{scope:n,rovingFocus:o,disabled:r,children:o?s.jsx(Sb,{asChild:!0,...d,orientation:a,dir:u,loop:l,children:s.jsx(j.div,{...f,ref:t})}):s.jsx(j.div,{...f,ref:t})})}),tr="ToggleGroupItem",Xl=P.forwardRef((e,t)=>{const n=Ql(tr,e.__scopeToggleGroup),r=_b(tr,e.__scopeToggleGroup),o=Ul(e.__scopeToggleGroup),a=n.value.includes(e.value),i=r.disabled||e.disabled,l={...e,pressed:a,disabled:i},c=P.useRef(null);return r.rovingFocus?s.jsx(Ab,{asChild:!0,...o,focusable:!i,active:a,ref:c,children:s.jsx(Zl,{...l,ref:t})}):s.jsx(Zl,{...l,ref:t})});Xl.displayName=tr;var Zl=P.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,a=Ql(tr,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=a.type==="single"?i:void 0;return s.jsx(Io,{...l,...o,ref:t,onPressedChange:c=>{c?a.onItemActivate(r):a.onItemDeactivate(r)}})}),Mb=Wo,Tb=Xl;const Db=ct(["inline-flex w-fit items-center justify-center gap-2.5 border bg-white whitespace-nowrap","text-gray-700 transition-all duration-200 ease-out active:scale-95","cursor-pointer disabled:pointer-events-none disabled:opacity-50 disabled:active:scale-100","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-main-300/60","hover:border-gray-400 hover:bg-gray-100","data-[state=on]:border-main-800 data-[state=on]:bg-main-800 data-[state=on]:text-white","data-[state=on]:hover:bg-main-600 data-[state=on]:hover:border-main-600","data-[state=on]:shadow-[0_4px_10px_rgba(255,87,34,0.22)]"],{variants:{shape:{rounded:"h-10 rounded-full px-5",square:"h-10 rounded-3 px-4"}},defaultVariants:{shape:"rounded"}});function Ob({children:e,className:t,...n}){return s.jsx(Mb,{"data-slot":"toggle-group",className:k("flex flex-wrap gap-4 rounded-none",t),...n,children:e})}function Ib({icon:e,shape:t="rounded",children:n,className:r,...o}){return s.jsxs(Tb,{"data-slot":"toggle-group-item",className:k(Db({shape:t}),r),...o,children:[e?s.jsx("span",{className:"inline-flex items-center justify-center text-[18px] leading-none text-inherit [&>svg]:h-5 [&>svg]:w-5",children:e}):null,s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:n})]})}var[nr]=ke("Tooltip",[Et]),rr=Et(),Jl="TooltipProvider",Lb=700,Bo="tooltip.open",[Fb,zo]=nr(Jl),Rl=e=>{const{__scopeTooltip:t,delayDuration:n=Lb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,i=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(Fb,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:a})};Rl.displayName=Jl;var nn="Tooltip",[Wb,rn]=nr(nn),ec=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:l}=e,c=zo(nn,e.__scopeTooltip),d=rr(t),[u,f]=h.useState(null),p=Pe(),v=h.useRef(0),b=i??c.disableHoverableContent,g=l??c.delayDuration,m=h.useRef(!1),[w,y]=Ne({prop:r,defaultProp:o??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Bo))):c.onClose(),a?.(E)},caller:nn}),C=h.useMemo(()=>w?m.current?"delayed-open":"instant-open":"closed",[w]),A=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,m.current=!1,y(!0)},[y]),N=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,y(!1)},[y]),_=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{m.current=!0,y(!0),v.current=0},g)},[g,y]);return h.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),s.jsx(co,{...d,children:s.jsx(Wb,{scope:t,contentId:p,open:w,stateAttribute:C,trigger:u,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?_():A()},[c.isOpenDelayedRef,_,A]),onTriggerLeave:h.useCallback(()=>{b?N():(window.clearTimeout(v.current),v.current=0)},[N,b]),onOpen:A,onClose:N,disableHoverableContent:b,children:n})})};ec.displayName=nn;var $o="TooltipTrigger",tc=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=rn($o,n),a=zo($o,n),i=rr(n),l=h.useRef(null),c=ee(t,l,o.onTriggerChange),d=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>d.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(Bn,{asChild:!0,...i,children:s.jsx(j.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:H(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:H(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:H(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:H(e.onBlur,o.onClose),onClick:H(e.onClick,o.onClose)})})});tc.displayName=$o;var Ho="TooltipPortal",[Bb,zb]=nr(Ho,{forceMount:void 0}),nc=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=rn(Ho,t);return s.jsx(Bb,{scope:t,forceMount:n,children:s.jsx(We,{present:n||a.open,children:s.jsx(Xt,{asChild:!0,container:o,children:r})})})};nc.displayName=Ho;var Ft="TooltipContent",rc=h.forwardRef((e,t)=>{const n=zb(Ft,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,i=rn(Ft,e.__scopeTooltip);return s.jsx(We,{present:r||i.open,children:i.disableHoverableContent?s.jsx(oc,{side:o,...a,ref:t}):s.jsx($b,{side:o,...a,ref:t})})}),$b=h.forwardRef((e,t)=>{const n=rn(Ft,e.__scopeTooltip),r=zo(Ft,e.__scopeTooltip),o=h.useRef(null),a=ee(t,o),[i,l]=h.useState(null),{trigger:c,onClose:d}=n,u=o.current,{onPointerInTransitChange:f}=r,p=h.useCallback(()=>{l(null),f(!1)},[f]),v=h.useCallback((b,g)=>{const m=b.currentTarget,w={x:b.clientX,y:b.clientY},y=Gb(w,m.getBoundingClientRect()),C=Ub(w,y),A=Kb(g.getBoundingClientRect()),N=qb([...C,...A]);l(N),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(c&&u){const b=m=>v(m,u),g=m=>v(m,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",g)}}},[c,u,v,p]),h.useEffect(()=>{if(i){const b=g=>{const m=g.target,w={x:g.clientX,y:g.clientY},y=c?.contains(m)||u?.contains(m),C=!Qb(w,i);y?p():C&&(p(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,i,d,p]),s.jsx(oc,{...e,ref:a})}),[Hb,Vb]=nr(nn,{isInside:!1}),Yb=cc("TooltipContent"),oc=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,c=rn(Ft,n),d=rr(n),{onClose:u}=c;return h.useEffect(()=>(document.addEventListener(Bo,u),()=>document.removeEventListener(Bo,u)),[u]),h.useEffect(()=>{if(c.trigger){const f=p=>{p.target?.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),s.jsx(Ut,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:s.jsxs(uo,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(Yb,{children:r}),s.jsx(Hb,{scope:n,isInside:!0,children:s.jsx(Hv,{id:c.contentId,role:"tooltip",children:o||r})})]})})});rc.displayName=Ft;var ac="TooltipArrow",jb=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=rr(n);return Vb(ac,n).isInside?null:s.jsx(fo,{...o,...r,ref:t})});jb.displayName=ac;function Gb(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ub(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Kb(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Qb(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],c=t[i],d=l.x,u=l.y,f=c.x,p=c.y;u>r!=p>r&&n<(f-d)*(r-u)/(p-u)+d&&(o=!o)}return o}function qb(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Xb(t)}function Xb(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Zb=Rl,Jb=ec,Rb=tc,ey=nc,ty=rc;function ny({delayDuration:e=200,...t}){return s.jsx(Zb,{delayDuration:e,...t})}const ry=Jb,oy=Rb;function ay({className:e,sideOffset:t=4,...n}){return s.jsx(ey,{children:s.jsx(ty,{sideOffset:t,className:k("z-50 overflow-hidden rounded-xl bg-gray-900 px-3 py-2 text-caption2 text-white shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})}T.Accordion=Td,T.AccordionContent=Id,T.AccordionItem=Dd,T.AccordionTrigger=Od,T.AppHeader=hu,T.AppLayout=B0,T.AppLayoutBody=$0,T.AppLayoutHeader=z0,T.AppLayoutOverlay=V0,T.AppLayoutProvider=Y0,T.AppLayoutSidebar=H0,T.AvatarImagePicker=I0,T.BannerCarousel=vu,T.Button=ue,T.Calendar=Hr,T.CheckContainer=Tp,T.CheckList=Fp,T.Checkbox=jr,T.CircleAvatar=Bt,T.CircularProgress=Bp,T.DatePicker=pv,T.Dialog=Dv,T.DialogClose=Iv,T.DialogContent=Lv,T.DialogDescription=zv,T.DialogFooter=Wv,T.DialogHeader=Fv,T.DialogOverlay=Ri,T.DialogPortal=Ji,T.DialogTitle=Bv,T.DialogTrigger=Ov,T.GoalAddList=O0,T.Icon=Wa,T.ImagePicker=F0,T.ImagePlaceholder=L0,T.InfoButton=W0,T.PageWatermark=G0,T.Pagination=K0,T.Profile=q0,T.ProgressBar=Wl,T.RangeDatePicker=gv,T.RightSidebar=R0,T.ScheduleCalendar=ob,T.Select=N0,T.SelectContent=_0,T.SelectGroup=S0,T.SelectItem=P0,T.SelectLabel=M0,T.SelectScrollDownButton=Ol,T.SelectScrollUpButton=Dl,T.SelectSeparator=E0,T.SelectTrigger=k0,T.SelectValue=A0,T.StatContainer=ab,T.StepIndicator=ib,T.Streak=lb,T.Tag=db,T.Text=L,T.TextArea=Ll,T.TextField=er,T.Toggle=hb,T.ToggleGroup=Ob,T.ToggleGroupItem=Ib,T.Tooltip=ry,T.TooltipContent=ay,T.TooltipProvider=ny,T.TooltipTrigger=oy,T.cn=k,T.textVariants=bn,T.useAppLayoutContext=j0,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Nv="DialogDescriptionWarning",Sv=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Xi(Nv).contentName}}.`;return h.useEffect(()=>{const o=e.current?.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Av=Fi,kv=Bi,Pv=$i,Ev=Hi,_v=Vi,Mv=ji,Tv=Ui,Zi=Qi;const Dv=Av,Ov=kv,Ji=Pv,Iv=Zi;function Ri({className:e,...t}){return s.jsx(Ev,{className:k("fixed inset-0 z-50 bg-black/50","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t})}function Lv({className:e,children:t,...n}){return s.jsxs(Ji,{children:[s.jsx(Ri,{}),s.jsxs(_v,{className:k("fixed top-[50%] left-[50%] z-50","w-full max-w-[calc(100%-2rem)] sm:max-w-md","translate-x-[-50%] translate-y-[-50%]","rounded-2 bg-white p-4 sm:p-6 shadow-default","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-slot=button].h-13]:!h-11","[&_[data-slot=button].h-13]:!px-3.5","[&_[data-slot=button].h-11]:!h-9","[&_[data-slot=button]_.text-lg]:!text-base","[&_[data-slot=button]_.text-base]:!text-sm","duration-200",e),...n,children:[t,s.jsxs(Zi,{className:"absolute top-3 right-3 sm:top-4 sm:right-4 rounded-full p-1.5 opacity-70 transition-opacity hover:opacity-100 focus:outline-none cursor-pointer",children:[s.jsx(vr,{width:18,height:18,className:"text-gray-500 sm:w-5 sm:h-5"}),s.jsx("span",{className:"sr-only",children:"닫기"})]})]})]})}function Fv({className:e,...t}){return s.jsx("div",{className:k("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Wv({className:e,...t}){return s.jsx("div",{className:k("mt-4 sm:mt-6 flex flex-row justify-end gap-2",e),...t})}function Bv({className:e,children:t,...n}){return s.jsx(Mv,{asChild:!0,...n,children:s.jsx(L,{size:"heading2",weight:"bold",className:k("text-black",e),children:t})})}function zv({className:e,children:t,...n}){return s.jsx(Tv,{asChild:!0,...n,children:s.jsx(L,{size:"body2",weight:"regular",className:k("text-gray-600 mt-2",e),children:t})})}function el(e,[t,n]){return Math.min(n,Math.max(t,e))}var tl=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),$v="VisuallyHidden",nl=h.forwardRef((e,t)=>s.jsx(j.span,{...e,ref:t,style:{...tl,...e.style}}));nl.displayName=$v;var Hv=nl,Vv=[" ","Enter","ArrowUp","ArrowDown"],Yv=[" ","Enter"],pt="Select",[Xn,Zn,jv]=ar(pt),[It]=ke(pt,[jv,Et]),Jn=Et(),[Gv,at]=It(pt),[Uv,Kv]=It(pt),rl=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:i,defaultValue:l,onValueChange:c,dir:d,name:u,autoComplete:f,disabled:p,required:v,form:b}=e,g=Jn(t),[m,w]=h.useState(null),[y,C]=h.useState(null),[A,N]=h.useState(!1),_=cn(d),[E,S]=Ne({prop:r,defaultProp:o??!1,onChange:a,caller:pt}),[z,V]=Ne({prop:i,defaultProp:l,onChange:c,caller:pt}),B=h.useRef(null),G=m?b||!!m.closest("form"):!0,[U,Y]=h.useState(new Set),q=Array.from(U).map(F=>F.props.value).join(";");return s.jsx(co,{...g,children:s.jsxs(Gv,{required:v,scope:t,trigger:m,onTriggerChange:w,valueNode:y,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:N,contentId:Pe(),value:z,onValueChange:V,open:E,onOpenChange:S,dir:_,triggerPointerDownPosRef:B,disabled:p,children:[s.jsx(Xn.Provider,{scope:t,children:s.jsx(Uv,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(F=>{Y(M=>new Set(M).add(F))},[]),onNativeOptionRemove:h.useCallback(F=>{Y(M=>{const x=new Set(M);return x.delete(F),x})},[]),children:n})}),G?s.jsxs(El,{"aria-hidden":!0,required:v,tabIndex:-1,name:u,autoComplete:f,value:z,onChange:F=>V(F.target.value),disabled:p,form:b,children:[z===void 0?s.jsx("option",{value:""}):null,Array.from(U)]},q):null]})})};rl.displayName=pt;var ol="SelectTrigger",al=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=Jn(n),i=at(ol,n),l=i.disabled||r,c=ee(t,i.onTriggerChange),d=Zn(n),u=h.useRef("touch"),[f,p,v]=Ml(g=>{const m=d().filter(C=>!C.disabled),w=m.find(C=>C.value===i.value),y=Tl(m,g,w);y!==void 0&&i.onValueChange(y.value)}),b=g=>{l||(i.onOpenChange(!0),v()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return s.jsx(Bn,{asChild:!0,...a,children:s.jsx(j.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":_l(i.value)?"":void 0,...o,ref:c,onClick:H(o.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&b(g)}),onPointerDown:H(o.onPointerDown,g=>{u.current=g.pointerType;const m=g.target;m.hasPointerCapture(g.pointerId)&&m.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(b(g),g.preventDefault())}),onKeyDown:H(o.onKeyDown,g=>{const m=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&p(g.key),!(m&&g.key===" ")&&Vv.includes(g.key)&&(b(),g.preventDefault())})})})});al.displayName=ol;var sl="SelectValue",il=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...l}=e,c=at(sl,n),{onValueNodeHasChildrenChange:d}=c,u=a!==void 0,f=ee(t,c.onValueNodeChange);return pe(()=>{d(u)},[d,u]),s.jsx(j.span,{...l,ref:f,style:{pointerEvents:"none"},children:_l(c.value)?s.jsx(s.Fragment,{children:i}):a})});il.displayName=sl;var Qv="SelectIcon",ll=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return s.jsx(j.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});ll.displayName=Qv;var qv="SelectPortal",cl=e=>s.jsx(Xt,{asChild:!0,...e});cl.displayName=qv;var gt="SelectContent",dl=h.forwardRef((e,t)=>{const n=at(gt,e.__scopeSelect),[r,o]=h.useState();if(pe(()=>{o(new DocumentFragment)},[]),!n.open){const a=r;return a?an.createPortal(s.jsx(ul,{scope:e.__scopeSelect,children:s.jsx(Xn.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),a):null}return s.jsx(fl,{...e,ref:t})});dl.displayName=gt;var Le=10,[ul,st]=It(gt),Xv="SelectContentImpl",Zv=mt("SelectContent.RemoveScroll"),fl=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:g,avoidCollisions:m,...w}=e,y=at(gt,n),[C,A]=h.useState(null),[N,_]=h.useState(null),E=ee(t,D=>A(D)),[S,z]=h.useState(null),[V,B]=h.useState(null),G=Zn(n),[U,Y]=h.useState(!1),q=h.useRef(!1);h.useEffect(()=>{if(C)return po(C)},[C]),Kr();const F=h.useCallback(D=>{const[oe,...ce]=G().map(ae=>ae.ref.current),[X]=ce.slice(-1),te=document.activeElement;for(const ae of D)if(ae===te||(ae?.scrollIntoView({block:"nearest"}),ae===oe&&N&&(N.scrollTop=0),ae===X&&N&&(N.scrollTop=N.scrollHeight),ae?.focus(),document.activeElement!==te))return},[G,N]),M=h.useCallback(()=>F([S,C]),[F,S,C]);h.useEffect(()=>{U&&M()},[U,M]);const{onOpenChange:x,triggerPointerDownPosRef:W}=y;h.useEffect(()=>{if(C){let D={x:0,y:0};const oe=X=>{D={x:Math.abs(Math.round(X.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(X.pageY)-(W.current?.y??0))}},ce=X=>{D.x<=10&&D.y<=10?X.preventDefault():C.contains(X.target)||x(!1),document.removeEventListener("pointermove",oe),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",ce,{capture:!0})}}},[C,x,W]),h.useEffect(()=>{const D=()=>x(!1);return window.addEventListener("blur",D),window.addEventListener("resize",D),()=>{window.removeEventListener("blur",D),window.removeEventListener("resize",D)}},[x]);const[Q,le]=Ml(D=>{const oe=G().filter(te=>!te.disabled),ce=oe.find(te=>te.ref.current===document.activeElement),X=Tl(oe,D,ce);X&&setTimeout(()=>X.ref.current.focus())}),Z=h.useCallback((D,oe,ce)=>{const X=!q.current&&!ce;(y.value!==void 0&&y.value===oe||X)&&(z(D),X&&(q.current=!0))},[y.value]),J=h.useCallback(()=>C?.focus(),[C]),ie=h.useCallback((D,oe,ce)=>{const X=!q.current&&!ce;(y.value!==void 0&&y.value===oe||X)&&B(D)},[y.value]),me=r==="popper"?Eo:hl,ve=me===Eo?{side:l,sideOffset:c,align:d,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:g,avoidCollisions:m}:{};return s.jsx(ul,{scope:n,content:C,viewport:N,onViewportChange:_,itemRefCallback:Z,selectedItem:S,onItemLeave:J,itemTextRefCallback:ie,focusSelectedItem:M,selectedItemText:V,position:r,isPositioned:U,searchRef:Q,children:s.jsx(Un,{as:Zv,allowPinchZoom:!0,children:s.jsx(Pn,{asChild:!0,trapped:y.open,onMountAutoFocus:D=>{D.preventDefault()},onUnmountAutoFocus:H(o,D=>{y.trigger?.focus({preventScroll:!0}),D.preventDefault()}),children:s.jsx(Ut,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:D=>D.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:s.jsx(me,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:D=>D.preventDefault(),...w,...ve,onPlaced:()=>Y(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:H(w.onKeyDown,D=>{const oe=D.ctrlKey||D.altKey||D.metaKey;if(D.key==="Tab"&&D.preventDefault(),!oe&&D.key.length===1&&le(D.key),["ArrowUp","ArrowDown","Home","End"].includes(D.key)){let X=G().filter(te=>!te.disabled).map(te=>te.ref.current);if(["ArrowUp","End"].includes(D.key)&&(X=X.slice().reverse()),["ArrowUp","ArrowDown"].includes(D.key)){const te=D.target,ae=X.indexOf(te);X=X.slice(ae+1)}setTimeout(()=>F(X)),D.preventDefault()}})})})})})})});fl.displayName=Xv;var Jv="SelectItemAlignedPosition",hl=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=at(gt,n),i=st(gt,n),[l,c]=h.useState(null),[d,u]=h.useState(null),f=ee(t,E=>u(E)),p=Zn(n),v=h.useRef(!1),b=h.useRef(!0),{viewport:g,selectedItem:m,selectedItemText:w,focusSelectedItem:y}=i,C=h.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&d&&g&&m&&w){const E=a.trigger.getBoundingClientRect(),S=d.getBoundingClientRect(),z=a.valueNode.getBoundingClientRect(),V=w.getBoundingClientRect();if(a.dir!=="rtl"){const te=V.left-S.left,ae=z.left-te,Ce=E.left-ae,R=E.width+Ce,be=Math.max(R,S.width),ye=window.innerWidth-Le,on=el(ae,[Le,Math.max(Le,ye-be)]);l.style.minWidth=R+"px",l.style.left=on+"px"}else{const te=S.right-V.right,ae=window.innerWidth-z.right-te,Ce=window.innerWidth-E.right-ae,R=E.width+Ce,be=Math.max(R,S.width),ye=window.innerWidth-Le,on=el(ae,[Le,Math.max(Le,ye-be)]);l.style.minWidth=R+"px",l.style.right=on+"px"}const B=p(),G=window.innerHeight-Le*2,U=g.scrollHeight,Y=window.getComputedStyle(d),q=parseInt(Y.borderTopWidth,10),F=parseInt(Y.paddingTop,10),M=parseInt(Y.borderBottomWidth,10),x=parseInt(Y.paddingBottom,10),W=q+F+U+x+M,Q=Math.min(m.offsetHeight*5,W),le=window.getComputedStyle(g),Z=parseInt(le.paddingTop,10),J=parseInt(le.paddingBottom,10),ie=E.top+E.height/2-Le,me=G-ie,ve=m.offsetHeight/2,D=m.offsetTop+ve,oe=q+F+D,ce=W-oe;if(oe<=ie){const te=B.length>0&&m===B[B.length-1].ref.current;l.style.bottom="0px";const ae=d.clientHeight-g.offsetTop-g.offsetHeight,Ce=Math.max(me,ve+(te?J:0)+ae+M),R=oe+Ce;l.style.height=R+"px"}else{const te=B.length>0&&m===B[0].ref.current;l.style.top="0px";const Ce=Math.max(ie,q+g.offsetTop+(te?Z:0)+ve)+ce;l.style.height=Ce+"px",g.scrollTop=oe-ie+g.offsetTop}l.style.margin=`${Le}px 0`,l.style.minHeight=Q+"px",l.style.maxHeight=G+"px",r?.(),requestAnimationFrame(()=>v.current=!0)}},[p,a.trigger,a.valueNode,l,d,g,m,w,a.dir,r]);pe(()=>C(),[C]);const[A,N]=h.useState();pe(()=>{d&&N(window.getComputedStyle(d).zIndex)},[d]);const _=h.useCallback(E=>{E&&b.current===!0&&(C(),y?.(),b.current=!1)},[C,y]);return s.jsx(e0,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:_,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:s.jsx(j.div,{...o,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});hl.displayName=Jv;var Rv="SelectPopperPosition",Eo=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Le,...a}=e,i=Jn(n);return s.jsx(uo,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Eo.displayName=Rv;var[e0,_o]=It(gt,{}),Mo="SelectViewport",pl=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=st(Mo,n),i=_o(Mo,n),l=ee(t,a.onViewportChange),c=h.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),s.jsx(Xn.Slot,{scope:n,children:s.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:H(o.onScroll,d=>{const u=d.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p?.current&&f){const v=Math.abs(c.current-u.scrollTop);if(v>0){const b=window.innerHeight-Le*2,g=parseFloat(f.style.minHeight),m=parseFloat(f.style.height),w=Math.max(g,m);if(w<b){const y=w+v,C=Math.min(b,y),A=y-C;f.style.height=C+"px",f.style.bottom==="0px"&&(u.scrollTop=A>0?A:0,f.style.justifyContent="flex-end")}}}c.current=u.scrollTop})})})]})});pl.displayName=Mo;var gl="SelectGroup",[t0,n0]=It(gl),ml=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Pe();return s.jsx(t0,{scope:n,id:o,children:s.jsx(j.div,{role:"group","aria-labelledby":o,...r,ref:t})})});ml.displayName=gl;var vl="SelectLabel",bl=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=n0(vl,n);return s.jsx(j.div,{id:o.id,...r,ref:t})});bl.displayName=vl;var Rn="SelectItem",[r0,yl]=It(Rn),wl=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...i}=e,l=at(Rn,n),c=st(Rn,n),d=l.value===r,[u,f]=h.useState(a??""),[p,v]=h.useState(!1),b=ee(t,y=>c.itemRefCallback?.(y,r,o)),g=Pe(),m=h.useRef("touch"),w=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(r0,{scope:n,value:r,disabled:o,textId:g,isSelected:d,onItemTextChange:h.useCallback(y=>{f(C=>C||(y?.textContent??"").trim())},[]),children:s.jsx(Xn.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:s.jsx(j.div,{role:"option","aria-labelledby":g,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:b,onFocus:H(i.onFocus,()=>v(!0)),onBlur:H(i.onBlur,()=>v(!1)),onClick:H(i.onClick,()=>{m.current!=="mouse"&&w()}),onPointerUp:H(i.onPointerUp,()=>{m.current==="mouse"&&w()}),onPointerDown:H(i.onPointerDown,y=>{m.current=y.pointerType}),onPointerMove:H(i.onPointerMove,y=>{m.current=y.pointerType,o?c.onItemLeave?.():m.current==="mouse"&&y.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(i.onPointerLeave,y=>{y.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(i.onKeyDown,y=>{c.searchRef?.current!==""&&y.key===" "||(Yv.includes(y.key)&&w(),y.key===" "&&y.preventDefault())})})})})});wl.displayName=Rn;var Jt="SelectItemText",xl=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,i=at(Jt,n),l=st(Jt,n),c=yl(Jt,n),d=Kv(Jt,n),[u,f]=h.useState(null),p=ee(t,w=>f(w),c.onItemTextChange,w=>l.itemTextRefCallback?.(w,c.value,c.disabled)),v=u?.textContent,b=h.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:m}=d;return pe(()=>(g(b),()=>m(b)),[g,m,b]),s.jsxs(s.Fragment,{children:[s.jsx(j.span,{id:c.textId,...a,ref:p}),c.isSelected&&i.valueNode&&!i.valueNodeHasChildren?an.createPortal(a.children,i.valueNode):null]})});xl.displayName=Jt;var Cl="SelectItemIndicator",Nl=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yl(Cl,n).isSelected?s.jsx(j.span,{"aria-hidden":!0,...r,ref:t}):null});Nl.displayName=Cl;var To="SelectScrollUpButton",Sl=h.forwardRef((e,t)=>{const n=st(To,e.__scopeSelect),r=_o(To,e.__scopeSelect),[o,a]=h.useState(!1),i=ee(t,r.onScrollButtonChange);return pe(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;a(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?s.jsx(kl,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Sl.displayName=To;var Do="SelectScrollDownButton",Al=h.forwardRef((e,t)=>{const n=st(Do,e.__scopeSelect),r=_o(Do,e.__scopeSelect),[o,a]=h.useState(!1),i=ee(t,r.onScrollButtonChange);return pe(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,u=Math.ceil(c.scrollTop)<d;a(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?s.jsx(kl,{...e,ref:i,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Al.displayName=Do;var kl=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=st("SelectScrollButton",n),i=h.useRef(null),l=Zn(n),c=h.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return h.useEffect(()=>()=>c(),[c]),pe(()=>{l().find(u=>u.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),s.jsx(j.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:H(o.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:H(o.onPointerMove,()=>{a.onItemLeave?.(),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:H(o.onPointerLeave,()=>{c()})})}),o0="SelectSeparator",Pl=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(j.div,{"aria-hidden":!0,...r,ref:t})});Pl.displayName=o0;var Oo="SelectArrow",a0=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Jn(n),a=at(Oo,n),i=st(Oo,n);return a.open&&i.position==="popper"?s.jsx(fo,{...o,...r,ref:t}):null});a0.displayName=Oo;var s0="SelectBubbleInput",El=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=h.useRef(null),a=ee(r,o),i=ps(t);return h.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(c,"value").set;if(i!==t&&u){const f=new Event("change",{bubbles:!0});u.call(l,t),l.dispatchEvent(f)}},[i,t]),s.jsx(j.select,{...n,style:{...tl,...n.style},ref:a,defaultValue:t})});El.displayName=s0;function _l(e){return e===""||e===void 0}function Ml(e){const t=et(e),n=h.useRef(""),r=h.useRef(0),o=h.useCallback(i=>{const l=n.current+i;t(l),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),a=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function Tl(e,t,n){const o=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=i0(e,Math.max(a,0));o.length===1&&(i=i.filter(d=>d!==n));const c=i.find(d=>d.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function i0(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var l0=rl,c0=al,d0=il,u0=ll,f0=cl,h0=dl,p0=pl,g0=ml,m0=bl,v0=wl,b0=xl,y0=Nl,w0=Sl,x0=Al,C0=Pl;const N0=l0,S0=g0,A0=d0;function k0({className:e,size:t="default",children:n,...r}){const o=t==="sm";return s.jsxs(c0,{"data-slot":"select-trigger","data-size":t,className:k("group flex w-full items-center justify-between whitespace-nowrap border bg-white outline-none transition-all duration-200","disabled:cursor-not-allowed disabled:opacity-50","hover:border-gray-400","data-[placeholder]:text-gray-500 focus-visible:ring-3 focus-visible:ring-main-300/60",o?"h-10 min-w-[150px] rounded-3 border-gray-300 px-3.5":"h-10 min-w-[150px] rounded-3 border-gray-300 px-4",e),...r,children:[s.jsx(L,{size:"body2",weight:"medium",className:"line-clamp-1 text-gray-900",children:n}),s.jsx(u0,{asChild:!0,children:s.jsx(mn,{"data-slot":"select-chevron",className:k("pointer-events-none shrink-0 text-gray-600 transition-transform duration-200 group-data-[state=open]:rotate-180","h-4 w-4"),strokeWidth:2.8})})]})}function P0({className:e,children:t,...n}){return s.jsxs(v0,{"data-slot":"select-item",className:k("relative flex w-full cursor-pointer items-center gap-3 rounded-2 px-3.5 py-2.5 outline-hidden select-none","text-gray-900 transition-colors focus:bg-gray-100 focus:text-gray-900","data-disabled:pointer-events-none data-disabled:opacity-50",e),...n,children:[s.jsx("span",{className:"absolute right-3 flex size-4 items-center justify-center",children:s.jsx(y0,{children:s.jsx(zt,{className:"size-4 text-main-800"})})}),s.jsx(b0,{children:s.jsx(L,{size:"body2",weight:"medium",children:t})})]})}function E0({className:e,...t}){return s.jsx(C0,{"data-slot":"select-separator",className:k("pointer-events-none my-1 h-px bg-gray-200",e),...t})}function Dl({className:e,...t}){return s.jsx(w0,{"data-slot":"select-scroll-up-button",className:k("flex cursor-default items-center justify-center py-1 text-gray-600",e),...t,children:s.jsx(Ia,{className:"size-4"})})}function Ol({className:e,...t}){return s.jsx(x0,{"data-slot":"select-scroll-down-button",className:k("flex cursor-default items-center justify-center py-1 text-gray-600",e),...t,children:s.jsx(mn,{className:"size-4"})})}function _0({className:e,children:t,position:n="popper",...r}){return s.jsx(f0,{children:s.jsxs(h0,{"data-slot":"select-content",className:k("relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto","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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1","rounded-[24px] border border-gray-300 bg-white",e),position:n,...r,children:[s.jsx(Dl,{}),s.jsx(p0,{className:k("p-2",n==="popper"&&"h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1"),children:t}),s.jsx(Ol,{})]})})}function M0({className:e,...t}){return s.jsx(m0,{"data-slot":"select-label",className:k("px-4 py-2 text-xs font-bold text-gray-500",e),...t})}const Il=ct(["w-full transition-all duration-200 outline-none","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-gray-500","focus-visible:outline-none"],{variants:{variant:{default:["rounded-3 border border-gray-300 bg-white px-5 text-gray-900 shadow-none","hover:border-gray-400","focus-visible:border-main-500 focus-visible:ring-3 focus-visible:ring-main-300/60"],search:["rounded-3 !h-10 border border-gray-300 bg-white pl-11 pr-4 text-gray-700 placeholder:text-gray-500","hover:border-gray-400","focus-visible:border-main-500 focus-visible:ring-3 focus-visible:ring-main-300/60"]},multiline:{false:"h-10 py-0",true:"min-h-[120px] resize-none py-3 align-top leading-relaxed"}},defaultVariants:{variant:"default",multiline:!1}});function T0(e,t){return"body2"}function D0({label:e,labelHint:t,required:n,htmlFor:r}){return e?s.jsxs("label",{htmlFor:r,className:"mb-2 inline-flex items-center gap-2",children:[s.jsx(L,{size:"body1",weight:"bold",className:"text-gray-900",children:e}),n?s.jsx(L,{size:"body1",weight:"bold",className:"text-main-800",children:"*"}):null,t?s.jsx(L,{size:"body1",weight:"regular",className:"text-gray-500",children:t}):null]}):null}const er=h.forwardRef(({className:e,variant:t="default",label:n,labelHint:r,error:o,type:a,multiline:i=!1,rows:l=8,cols:c,required:d,id:u,...f},p)=>{const v=t==="search",b=T0(t,i);return s.jsxs("div",{className:"flex w-full flex-col",children:[s.jsx(D0,{label:n,labelHint:r,required:d,htmlFor:u}),s.jsxs("div",{className:"relative w-full",children:[i?s.jsx("textarea",{id:u,rows:l,cols:c,required:d,className:k(bn({size:b,weight:"regular"}),Il({variant:t,multiline:!0}),e),ref:p,...f}):s.jsx("input",{id:u,type:a,required:d,className:k(bn({size:b,weight:v?"light":"regular"}),Il({variant:t,multiline:!1}),e),ref:p,...f}),v&&!i?s.jsx(Fa,{width:20,height:20,className:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-gray-500"}):null]}),o?s.jsx(L,{size:"caption1",weight:"regular",className:"mt-2 text-warning",children:o}):null]})});er.displayName="TextField";const Ll=h.forwardRef((e,t)=>s.jsx(er,{...e,ref:t,multiline:!0}));Ll.displayName="TextArea";function O0({goals:e,defaultGoals:t=[],onGoalsChange:n,placeholder:r="목표를 입력하세요",disabled:o=!1,addOnBlur:a=!1,inputAriaLabel:i="목표 입력",maxGoals:l,className:c,...d}){const u=e!==void 0,[f,p]=P.useState(t),[v,b]=P.useState(""),g=P.useRef(!1),m=u?e:f,w=l!==void 0&&m.length>=l,y=N=>{u||p(N),n?.(N)},C=()=>{if(o)return;const N=v.trim();N&&(y([...m,N]),b(""))},A=N=>{o||y(m.filter((_,E)=>E!==N))};return s.jsxs("div",{className:k("flex w-full flex-col gap-2",c),...d,children:[m.map((N,_)=>s.jsxs("div",{className:"flex h-10 w-full items-center justify-between rounded-3 border border-gray-300 bg-white px-5",children:[s.jsx(L,{size:"body2",weight:"regular",className:"line-clamp-1 text-gray-900",children:N}),s.jsx("button",{type:"button","aria-label":`목표 삭제: ${N}`,disabled:o,onClick:()=>A(_),className:k("inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-2 text-gray-500 transition-colors hover:cursor-pointer",!o&&"hover:bg-gray-100 hover:text-gray-700",o&&"cursor-not-allowed text-gray-400"),children:s.jsx(vr,{className:"h-4 w-4"})})]},`${N}-${_}`)),s.jsx(er,{value:v,disabled:o||w,"aria-label":i,placeholder:w?`최대 ${l}개까지 입력할 수 있습니다`:r,onChange:N=>b(N.target.value),onCompositionStart:()=>{g.current=!0},onCompositionEnd:()=>{g.current=!1},onKeyDown:N=>{N.key==="Enter"&&(N.nativeEvent.isComposing||g.current||N.nativeEvent.keyCode===229||(N.preventDefault(),C()))},onBlur:()=>{a&&C()}})]})}function I0({onChange:e,size:t=300,defaultImageUrl:n,changeLabel:r="Change",...o}){const a=Math.max(t,120),i=Math.max(Math.round(a*.3),28),l=Math.max(Math.round(i*.6),18),c=P.useRef(null),d=P.useRef(null),[u,f]=P.useState(n??null),p=()=>{c.current?.click()};P.useEffect(()=>{f(n??null)},[n]),P.useEffect(()=>()=>{d.current&&URL.revokeObjectURL(d.current)},[]);const v=b=>{const g=b.target.files?.[0];if(g){d.current&&URL.revokeObjectURL(d.current);const m=URL.createObjectURL(g);d.current=m,f(m)}};return s.jsxs("div",{className:"relative inline-flex",style:{width:a,height:a},children:[s.jsx("input",{type:"file",accept:"image/*",ref:c,className:"hidden",onChange:b=>{e!==void 0&&e(b),v(b)},...o}),s.jsx("button",{type:"button",onClick:p,"aria-label":"이미지 선택",className:k("relative h-full w-full overflow-hidden rounded-full","cursor-pointer",u?"bg-main-300":"border-2 border-dashed border-gray-400 bg-white"),children:u?s.jsx("img",{src:u,alt:"이미지 미리보기",className:"h-full w-full object-cover",loading:"lazy"}):s.jsx("div",{className:"flex h-full w-full items-center justify-center",children:s.jsx($t,{width:l,height:i,className:"text-gray-300"})})}),s.jsxs("button",{type:"button",onClick:p,className:k("absolute bottom-0 left-1/2 z-10 inline-flex h-9 -translate-x-1/2 translate-y-1/2 items-center gap-1.5 rounded-full border border-gray-200 bg-white px-5","cursor-pointer shadow-[0_6px_16px_rgba(34,34,34,0.16)]"),children:[s.jsx(xn,{className:"h-3.5 w-3.5 text-gray-700"}),s.jsx(L,{size:"caption1",weight:"medium",className:"text-gray-700 whitespace-nowrap",children:r})]})]})}function L0({className:e,logoSize:t="md"}){const n={sm:"w-4 h-6",md:"w-6 h-10",lg:"w-8 h-14"};return s.jsx("div",{className:k("flex items-center justify-center bg-main-200",e),children:s.jsx($t,{className:k("text-main-500",n[t])})})}function F0({previewUrl:e,onSelectFile:t,onClear:n,placeholderTitle:r="썸네일 영역을 클릭해 이미지를 선택하세요.",placeholderSubtitle:o="또는 이미지를 드래그해서 놓아주세요.",helperText:a="JPG, PNG, GIF 파일을 업로드할 수 있습니다.",clearLabel:i="선택 해제",dropZoneClassName:l="min-h-[220px] flex-1 lg:min-h-[440px]",className:c}){const d=P.useRef(null),[u,f]=P.useState(!1),[p,v]=P.useState(null),b=!!e&&p!==e,g=!!e,m=()=>{d.current?.click()},w=S=>{!S||!S.type.startsWith("image/")||(v(null),t(S))},y=S=>{const z=S.target.files?.[0]??null;w(z),S.target.value=""},C=S=>{S.preventDefault(),f(!0)},A=S=>{S.preventDefault(),u||f(!0)},N=S=>{S.preventDefault(),f(!1)},_=S=>{S.preventDefault(),f(!1);const z=S.dataTransfer.files?.[0]??null;w(z)},E=S=>{(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),m())};return s.jsxs("div",{className:k("flex h-full flex-col rounded-2xl border border-gray-200 bg-white p-4",c),children:[s.jsxs("div",{role:"button",tabIndex:0,"aria-label":"썸네일 이미지 선택",className:k("relative flex w-full cursor-pointer items-center justify-center overflow-hidden rounded-xl border bg-gray-100 transition outline-none",l,u?"border-main-700 ring-3 ring-main-300":"border-gray-200 hover:border-gray-300"),onClick:m,onKeyDown:E,onDragEnter:C,onDragOver:A,onDragLeave:N,onDrop:_,children:[b?s.jsx("img",{src:e,alt:"썸네일 미리보기",className:"absolute inset-0 h-full w-full object-cover",onError:()=>v(e??null)}):s.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 text-center",children:[s.jsx(L,{size:"body2",weight:"medium",className:"text-gray-700",children:r}),s.jsx(L,{size:"caption1",weight:"regular",className:"text-gray-500",children:o})]}),s.jsx("input",{ref:d,type:"file",accept:"image/*",onChange:y,className:"hidden"})]}),s.jsxs("div",{className:"mt-4 flex items-center justify-between gap-3",children:[s.jsx(L,{size:"caption1",weight:"regular",className:"text-gray-500",children:a}),g&&n?s.jsx(ue,{type:"button",variant:"outlined",size:"small",className:"shrink-0",onClick:n,children:i}):null]})]})}function W0({mainText:e,subText:t,imageSrc:n,imageAlt:r="icon",gradientFrom:o,gradientTo:a,onClick:i,className:l}){return s.jsxs("div",{className:k("relative overflow-hidden rounded-2 text-white","flex flex-col justify-between","p-4 sm:p-4 lg:p-6","h-24 w-full sm:h-36 lg:h-47.5 lg:w-56","hover:shadow-default hover:-translate-y-1 transition-all duration-300",i&&"cursor-pointer",l),style:{backgroundImage:`linear-gradient(to bottom right, ${o}, ${a})`},onClick:i,children:[s.jsxs("div",{className:"flex w-full flex-col gap-0.5 sm:gap-1",children:[s.jsx(L,{size:"caption3",weight:"medium",className:"opacity-80",children:e}),s.jsx(L,{size:"caption2",weight:"bold",className:"mt-0.5 sm:text-xl sm:mt-1 lg:text-2xl",children:t})]}),s.jsx("div",{className:"absolute bottom-2 left-2 sm:bottom-4 sm:left-4 lg:bottom-6 lg:left-6",children:s.jsx(Yo,{src:n,alt:r,width:24,height:40,className:"object-contain sm:w-9 sm:h-15 lg:w-12 lg:h-19.5"})}),s.jsx(L,{size:"body2",weight:"bold",className:"absolute right-2 bottom-2 sm:right-4 sm:bottom-4 sm:text-3xl lg:right-6 lg:bottom-6 lg:text-4xl",children:"→"})]})}function B0({children:e,className:t}){return s.jsx("div",{className:k("flex min-h-screen w-screen flex-col bg-white",t),children:e})}function z0({children:e,className:t}){return s.jsx("header",{className:k("sticky top-0 z-30 shrink-0 bg-white px-4 pt-3",t),children:e})}function $0({children:e,sidebar:t,className:n}){return t?s.jsxs("div",{className:k("flex min-h-0 flex-1 gap-4",n),children:[s.jsx("main",{className:"min-h-0 min-w-0 flex-1 overflow-x-hidden",children:e}),t]}):s.jsx("main",{className:k("min-h-0 min-w-0 flex-1",n),children:e})}function H0({children:e,stickyTop:t="top-28",className:n}){return s.jsx("aside",{className:k("sticky hidden h-fit min-h-0 shrink-0 self-start pt-3 pr-3 lg:block",t,n),children:e})}function V0({children:e,open:t,className:n}){return s.jsx("div",{className:k("fixed top-4 right-3 z-50 transition-opacity duration-200",t?"opacity-100":"opacity-0",n),children:e})}const Fl=P.createContext({hasRightSidebar:!1,isRightSidebarCollapsed:!1});function Y0({value:e,children:t}){return s.jsx(Fl.Provider,{value:e,children:t})}function j0(){return P.useContext(Fl)}function G0(){return s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx($t,{width:24,height:40,className:"text-gray-300"}),s.jsx(L,{size:"body1",weight:"bold",className:"my-2.5 text-gray-300",children:"1D1S"})]})}const Rt="...";function U0({currentPage:e,totalPages:t,siblingCount:n=1}){return h.useMemo(()=>{if(n+5>=t)return Array.from({length:t},(f,p)=>p+1);const a=Math.max(e-n,1),i=Math.min(e+n,t),l=a>2,c=i<t-2,d=1,u=t;if(!l&&c){const f=3+2*n;return[...Array.from({length:f},(v,b)=>b+1),Rt,t]}if(l&&!c){const f=3+2*n,p=Array.from({length:f},(v,b)=>t-f+b+1);return[d,Rt,...p]}if(l&&c){const f=Array.from({length:i-a+1},(p,v)=>a+v);return[d,Rt,...f,Rt,u]}},[t,e,n])}function K0({currentPage:e,totalPages:t,onPageChange:n,siblingCount:r=1,className:o}){const a=U0({currentPage:e,totalPages:t,siblingCount:r});if(e===0||t<2)return null;const i=()=>{e<t&&n(e+1)},l=()=>{e>1&&n(e-1)};return s.jsxs("nav",{role:"navigation","aria-label":"Pagination",className:k("flex items-center justify-center gap-3",o),children:[s.jsx(ue,{onClick:l,disabled:e===1,variant:"outlined",size:"icon",className:"rounded-3 border-gray-300 bg-white text-gray-600 hover:bg-gray-100 disabled:bg-gray-100 disabled:text-gray-400","aria-label":"Go to previous page",children:s.jsx(yn,{className:"h-5 w-5"})}),a?.map((c,d)=>{if(c===Rt)return s.jsx("div",{className:"flex h-10 min-w-10 items-center justify-center px-1",children:s.jsx("span",{className:"text-lg font-medium text-gray-400",children:"..."})},`dots-${d}`);const u=c===e;return s.jsx(ue,{onClick:()=>n(c),variant:u?"default":"secondary",size:"icon",className:k("rounded-3",u?"bg-main-800 text-white shadow-[0_8px_16px_rgba(255,87,34,0.3)] hover:bg-main-800":"bg-gray-100 text-gray-700 hover:bg-gray-200"),"aria-current":u?"page":void 0,children:s.jsx("span",{className:k("text-2xl leading-none",u?"font-bold text-white":"font-medium text-gray-700"),children:c})},c)}),s.jsx(ue,{onClick:i,disabled:e===t,variant:"outlined",size:"icon",className:"rounded-3 border-gray-300 bg-white text-gray-600 hover:bg-gray-100 disabled:bg-gray-100 disabled:text-gray-400","aria-label":"Go to next page",children:s.jsx(wn,{className:"h-5 w-5"})})]})}const Q0={sm:{avatar:"sm",textSize:"caption1",statusSize:"caption2"},md:{avatar:"md",textSize:"body2",statusSize:"caption1"},lg:{avatar:"lg",textSize:"body1",statusSize:"caption1"}};function q0({nickname:e,imageUrl:t,size:n="md",layout:r="horizontal",statusText:o,onClick:a,className:i}){const{avatar:l,textSize:c,statusSize:d}=Q0[n],u=!!a,f=u?"button":"div";return s.jsxs(f,{type:u?"button":void 0,onClick:a,className:k("inline-flex items-center",r==="horizontal"?"flex-row gap-2.5":"flex-col gap-2",u&&["cursor-pointer rounded-2xl px-3 py-2 transition-colors","hover:bg-gray-100"],i),children:[s.jsx(Bt,{imageUrl:t,size:l}),r==="horizontal"?s.jsxs("div",{className:"flex min-w-0 flex-col",children:[s.jsx(L,{size:c,weight:"bold",className:"line-clamp-1 text-gray-900",children:e}),o?s.jsx(L,{size:d,weight:"regular",className:"text-gray-500",children:o}):null]}):s.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[s.jsx(L,{size:c,weight:"bold",className:"text-gray-900",children:e}),o?s.jsx(L,{size:d,weight:"regular",className:"text-gray-500",children:o}):null]})]})}function Wl({value:e,label:t,showLabel:n,showValueText:r=!0,valueText:o,infinite:a=!1,thickness:i=6,fillColor:l,trackColor:c,className:d,labelClassName:u,valueClassName:f,trackClassName:p,fillClassName:v,...b}){const g=Math.min(Math.max(e,0),100),m=a?"100%":`${g}%`,w=o??(a?"∞":`${g}%`),y=n??t!==void 0;return s.jsxs("div",{className:k("w-full",d),...b,children:[(y||r)&&s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[y?s.jsx(L,{size:"caption1",weight:"medium",className:k("line-clamp-1 text-gray-800",u),children:t}):s.jsx("span",{}),r?s.jsx(L,{size:"caption1",weight:"medium",className:k("shrink-0 text-gray-600",f),children:w}):null]}),s.jsx("div",{className:k("mt-2.5 overflow-hidden rounded-full bg-gray-200",p),style:{height:`${i}px`,...c?{backgroundColor:c}:{}},children:s.jsx("div",{className:k("h-full rounded-full bg-main-800 transition-all duration-200",v),style:{width:m,...l?{backgroundColor:l}:{}}})})]})}function X0({value:e}){const t=Math.max(0,Math.floor(e)),[n,r]=P.useState(0);P.useEffect(()=>{let a=0;const i=performance.now(),l=Math.min(1400,Math.max(500,t*30)),c=u=>1-(1-u)**3;r(0);const d=u=>{const f=u-i,p=Math.min(f/l,1),v=Math.floor(t*c(p));r(v),p<1&&(a=requestAnimationFrame(d))};return a=requestAnimationFrame(d),()=>{cancelAnimationFrame(a)}},[t]);const o=Math.max(String(t).length,1);return s.jsx("span",{className:"inline-flex justify-start tabular-nums",style:{minWidth:`${o}ch`},children:n})}function Fe({className:e}){return s.jsx("span",{"aria-hidden":!0,className:k("block animate-pulse rounded-md bg-gray-200",e)})}function Lt({className:e}){return s.jsx("span",{"aria-hidden":!0,className:k("block h-12 w-12 shrink-0 animate-pulse bg-gray-200",e),style:{borderRadius:"9999px"}})}function en({loading:e,skeleton:t,children:n,className:r,durationMs:o=280}){return s.jsxs("div",{className:k("relative",r),children:[s.jsx("div",{className:k("transition-opacity ease-out",e?"pointer-events-none opacity-0":"opacity-100"),style:{transitionDuration:`${o}ms`},"aria-hidden":e,children:n}),s.jsx("div",{className:k("pointer-events-none absolute inset-0 transition-opacity ease-out",e?"opacity-100":"opacity-0"),style:{transitionDuration:`${o}ms`},"aria-hidden":!e,children:t})]})}const Z0=[{id:"1",title:"알고리즘 부시기",progress:56,tone:"blue"},{id:"2",title:"새벽 러닝",progress:84,tone:"green"}],J0={blue:"#3b82f6",green:"#22c55e",orange:"#ff5722"};function R0({isLoggedIn:e=!0,isLoading:t=!1,userName:n,userSubtitle:r,userImage:o,streakDays:a,fixed:i=!0,collapsible:l=!0,className:c,diaryButtonLabel:d="일지 작성하기",myPageButtonLabel:u="마이페이지",loginButtonLabel:f="로그인",loginPromptMessage:p="로그인하고 연속 기록을 시작해보세요",settingButtonLabel:v="설정",challengeTitle:b="참여중인 챌린지",challenges:g=Z0,emptyChallengeMessage:m="챌린지가 없어요.",joinChallengeButtonLabel:w="챌린지 참여하기",joinChallengeMaxUserCount:y,createChallengeButtonLabel:C="챌린지 생성하기",onCollapseClick:A,onOpenSettings:N,onWriteDiary:_,onGoMyPage:E,onLogin:S,onJoinChallenge:z,onCreateChallenge:V,onChallengeClick:B}){const[F,M]=P.useState(!1),[x,W]=P.useState("expanded"),[Q,le]=P.useState(!0),[Z,J]=P.useState(!1),[ie,me]=P.useState(null),ve=P.useRef(null),D=P.useRef([]),oe=typeof y=="number"&&y<=0,ce=()=>{D.current.forEach(R=>clearTimeout(R)),D.current=[]},X=(R,be)=>{const ye=setTimeout(()=>{R(),D.current=D.current.filter(on=>on!==ye)},be);D.current.push(ye)};P.useEffect(()=>()=>{ce()},[]);const te=()=>{const R=ve.current;return R?Math.max(Math.ceil(R.scrollHeight),0):null},ae=()=>{const R=ve.current;if(!R)return null;const be=R.style.height;R.style.height="auto";const ye=te();return R.style.height=be,ye},Ce=()=>{if(Z)return;const R=!F,be=ve.current?.offsetHeight;be&&be>0&&me(be),J(!0),le(!1),A?.(),ce(),X(()=>{M(R),W(R?"collapsed":"expanded")},140),X(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{const ye=ae();ye&&ye>0&&me(ye)})})},440),X(()=>{le(!0)},720),X(()=>{me(null),J(!1)},940)};return s.jsxs("div",{className:k("z-40 transition-[width] duration-300 ease-in-out",i?"fixed top-4 right-3 max-h-[calc(100vh-2rem)]":"relative max-h-190",F?"w-22":"w-69",c),children:[l&&s.jsx(ue,{type:"button",variant:"outlined",size:"icon","aria-label":"사이드바 접기",onClick:Ce,disabled:Z,className:"absolute top-6 -left-4 z-20 h-8 w-8 min-w-8 rounded-full p-0 text-gray-500 shadow-sm",children:s.jsx(wn,{className:k("h-4 w-4 transition-transform duration-200",F?"rotate-180":"rotate-0")})}),s.jsx("aside",{ref:ve,className:k("relative flex w-full flex-col overflow-x-hidden overflow-y-auto rounded-4 border border-gray-200 bg-white p-3 shadow-[0_6px_16px_rgba(34,34,34,0.06)]",ie!==null&&"transition-[height] duration-300 ease-in-out",i&&"max-h-[calc(100vh-2rem)]",!i&&"max-h-full"),style:{height:ie?`${ie}px`:void 0},children:s.jsx("div",{className:k("flex h-full w-full transition-opacity ease-out",Q?"pointer-events-auto opacity-100":"pointer-events-none opacity-0"),style:{transitionDuration:`${Q?220:140}ms`},"aria-hidden":!Q,children:x==="expanded"?s.jsxs("div",{className:"flex w-full flex-col px-2 py-2",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsx(en,{loading:t,skeleton:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Lt,{}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(Fe,{className:"h-6 w-24 rounded-sm"}),s.jsx(Fe,{className:"h-4 w-28 rounded-sm"})]})]}),children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Bt,{imageUrl:o,size:"md",className:"ring-2 ring-mint-900/40"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx(L,{size:"body1",weight:"bold",className:"text-gray-900",children:e?n??"고라니":"게스트"}),s.jsx(L,{size:"caption1",weight:"regular",className:"text-gray-600",children:e?r??"":"로그인 후 이용 가능"})]})]})}),s.jsx(en,{loading:t,skeleton:s.jsx(Fe,{className:"h-9 w-9 rounded-full"}),children:e?s.jsx(ue,{type:"button",variant:"ghost",size:"icon","aria-label":"설정",onClick:N,className:"text-gray-500 hover:text-gray-700",children:s.jsx(wr,{className:"h-5 w-5"})}):null})]}),s.jsx("div",{className:"mt-6 rounded-3 border border-main-400 bg-main-200 px-4 py-4 text-center",children:s.jsx(en,{loading:t,skeleton:s.jsxs("div",{children:[s.jsx(Fe,{className:"mx-auto h-4 w-20 rounded-sm"}),s.jsxs("div",{className:"mt-3 flex items-center justify-center gap-2",children:[s.jsx(Lt,{className:"h-7 w-7"}),s.jsx(Fe,{className:"h-9 w-16 rounded-sm"}),s.jsx(Fe,{className:"h-5 w-12 rounded-sm"})]})]}),children:s.jsxs("div",{children:[s.jsx(L,{as:"p",size:"caption1",weight:"medium",className:"text-gray-700",children:"현재 연속 기록"}),e?s.jsxs("div",{className:"mt-3 flex items-center justify-center gap-2.5",children:[s.jsx(Oa,{className:"h-7 w-7 text-main-800",strokeWidth:2.2}),s.jsx(L,{size:"heading1",weight:"bold",className:"text-main-800",children:s.jsx(X0,{value:a})}),s.jsx(L,{size:"body1",weight:"bold",className:"text-gray-800",children:"Days"})]}):s.jsx(L,{as:"p",size:"caption1",weight:"medium",className:"mt-3 block leading-tight text-gray-700",children:p})]})})}),s.jsx(en,{loading:t,skeleton:s.jsxs("div",{children:[s.jsx(Fe,{className:"mt-5 h-10 w-full rounded-2"}),s.jsx(Fe,{className:"mt-3 h-10 w-full rounded-2"}),s.jsxs("div",{className:"mt-5 pt-5",children:[s.jsx(Fe,{className:"h-4 w-30 rounded-sm"}),s.jsx("div",{className:"mt-4 flex flex-col gap-3",children:Array.from({length:2},(R,be)=>s.jsxs("div",{className:"rounded-2 border border-gray-100 px-3 py-3",children:[s.jsx(Fe,{className:"h-4 w-32 rounded-sm"}),s.jsx(Fe,{className:"mt-3 h-2 w-full rounded-full"})]},be))})]})]}),children:e?s.jsxs(s.Fragment,{children:[s.jsxs(ue,{className:"mt-5 w-full",size:"medium",disabled:g.length===0,onClick:_,children:[s.jsx(xn,{className:"h-4 w-4"}),s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:d})]}),s.jsxs(ue,{variant:"outlined",className:"mt-3 w-full",size:"medium",onClick:E,children:[s.jsx(yr,{className:"h-4 w-4"}),s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:u})]}),s.jsxs("div",{className:"mt-5 pt-5",children:[s.jsx(L,{size:"caption1",weight:"medium",className:"text-gray-500",children:b}),g.length>0?s.jsx("div",{className:"mt-4 flex flex-col gap-1",children:g.map(R=>{const be=R.tone??"blue";return s.jsx("div",{role:B?"button":void 0,tabIndex:B?0:void 0,onClick:B?()=>B(R):void 0,onKeyDown:B?ye=>{(ye.key==="Enter"||ye.key===" ")&&B(R)}:void 0,className:k("-mx-2 rounded-2 px-2 py-2 transition-colors duration-150",B&&"cursor-pointer hover:bg-gray-100 active:bg-gray-200"),children:s.jsx(Wl,{label:R.title,value:R.progress,infinite:R.hasDeadline===!1,fillColor:J0[be]})},R.id)})}):s.jsxs("div",{className:"mt-4",children:[s.jsx(L,{as:"p",size:"caption1",weight:"medium",className:"text-gray-600",children:m}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2.5",children:[s.jsx(ue,{type:"button",className:"w-full",size:"medium",disabled:oe,onClick:z,children:w}),s.jsx(ue,{type:"button",variant:"outlined",className:"w-full",size:"medium",onClick:V,children:C})]})]})]})]}):s.jsxs(ue,{className:"mt-5 w-full",size:"medium",onClick:S,children:[s.jsx(br,{className:"h-4 w-4"}),s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:f})]})})]}):s.jsx("div",{className:"flex w-full flex-col items-center pt-2",children:s.jsx(en,{loading:t,className:"w-full",skeleton:s.jsxs("div",{className:"flex w-full flex-col items-center",children:[s.jsx(Lt,{}),s.jsxs("div",{className:"mt-5 flex flex-col items-center gap-3",children:[s.jsx(Lt,{className:"h-10 w-10"}),s.jsx(Lt,{className:"h-10 w-10"}),s.jsx(Lt,{className:"h-10 w-10"})]})]}),children:s.jsxs("div",{className:"flex w-full flex-col items-center",children:[s.jsx(Bt,{imageUrl:o,size:"md",className:"ring-2 ring-mint-900/40"}),s.jsx("div",{className:"mt-5 flex flex-col items-center gap-3",children:e?s.jsxs(s.Fragment,{children:[s.jsx(ue,{type:"button",size:"icon","aria-label":d,onClick:_,children:s.jsx(xn,{className:"h-4 w-4"})}),s.jsx(ue,{type:"button",variant:"outlined",size:"icon","aria-label":u,onClick:E,children:s.jsx(yr,{className:"h-4 w-4"})}),s.jsx(ue,{type:"button",variant:"outlined",size:"icon","aria-label":v,onClick:N,children:s.jsx(wr,{className:"h-4 w-4"})})]}):s.jsx(ue,{type:"button",size:"icon","aria-label":f,onClick:S,children:s.jsx(br,{className:"h-4 w-4"})})})]})})})})})]})}const eb=["SUN","MON","TUE","WED","THU","FRI","SAT"];function tb(e){return e===void 0?"100%":typeof e=="number"?`${e}%`:e}function nb(e="default"){return e==="strong"?"text-gray-900 font-bold":e==="accent"?"text-main-800 font-bold":e==="muted"?"text-gray-500 font-medium":"text-gray-600 font-medium"}function rb(e="main"){return e==="soft"?"bg-main-600/50":"bg-main-800"}function ob({rows:e,weekLabels:t=[...eb],cellMinHeight:n=140,className:r}){return s.jsx("div",{className:k("w-full overflow-hidden rounded-4 border border-gray-300 bg-white",r),children:s.jsxs("table",{className:"w-full table-fixed border-collapse",children:[s.jsx("thead",{children:s.jsx("tr",{children:t.map((o,a)=>s.jsx("th",{className:k("h-8 border-b border-r border-gray-300 bg-gray-100 px-1 text-center align-middle sm:h-12 sm:px-2.5",a===t.length-1&&"border-r-0"),scope:"col",children:s.jsx(L,{size:"caption3",weight:"bold",className:"text-gray-600 sm:text-lg",children:o})},`${o}-${a}`))})}),s.jsx("tbody",{children:e.map((o,a)=>s.jsx("tr",{children:o.map((i,l)=>{const c=i.colSpan??1,d=i.id??`r${a}-c${l}`,u=o.slice(0,l+1).reduce((f,p)=>f+(p.colSpan??1),0)>=7;return s.jsx("td",{colSpan:c,className:k("border-r border-b border-gray-300 align-top",u&&"border-r-0"),children:s.jsx("div",{className:k("flex h-full flex-col gap-1 p-1 sm:gap-2 sm:p-2",i.muted&&"bg-gray-300",i.highlighted&&"bg-main-200 ring-1 ring-inset ring-main-400"),style:{minHeight:`${n}px`},children:i.content?i.content:s.jsxs(s.Fragment,{children:[i.day!==void 0?s.jsx(L,{size:"caption3",weight:"medium",className:k("leading-tight sm:text-lg",nb(i.dayTone)),children:i.day}):null,i.title!==void 0?s.jsx(L,{size:"caption3",weight:"bold",className:"line-clamp-1 text-gray-900 sm:text-lg",children:i.title}):null,i.bars&&i.bars.length>0?s.jsx("div",{className:"mt-0.5 flex flex-col gap-1",children:i.bars.map((f,p)=>s.jsx("span",{className:k("block h-1 rounded-full transition-all duration-200 sm:h-1.5",rb(f.tone)),style:{width:tb(f.width)}},`${d}-bar-${p}`))}):null,i.subtitle!==void 0?s.jsx(L,{size:"caption3",weight:"medium",className:"hidden text-gray-600 sm:block",children:i.subtitle}):null]})})},d)})},`row-${a}`))})]})})}function ab({icon:e,iconName:t,title:n,value:r,unit:o,className:a,iconClassName:i,...l}){const c=e??(t?s.jsx(Wa,{name:t,size:32}):null);return s.jsxs("div",{className:k("rounded-[24px] border border-gray-200 bg-white p-7","shadow-[0_1px_4px_rgba(17,17,17,0.08)]","w-full",a),...l,children:[s.jsxs("div",{className:"flex items-center gap-3.5",children:[s.jsx("div",{className:k("text-main-800","[&_svg]:h-8 [&_svg]:w-8",i),children:c}),s.jsx(L,{size:"heading2",weight:"medium",className:"leading-tight text-gray-600",children:n})]}),s.jsxs("div",{className:"mt-6 flex items-end gap-1.5",children:[s.jsx(L,{size:"display1",weight:"bold",className:"text-gray-900",children:r}),s.jsx(L,{size:"heading2",weight:"medium",className:"pb-1 text-gray-600",children:o})]})]})}const sb={sm:{circle:"h-7 w-7",trackTop:"top-3.5",checkIcon:"h-3 w-3",numberSize:"caption1",labelSize:"body2",labelMargin:"mt-3"},md:{circle:"h-10 w-10",trackTop:"top-5",checkIcon:"h-4 w-4",numberSize:"body1",labelSize:"heading2",labelMargin:"mt-5"},lg:{circle:"h-14 w-14",trackTop:"top-7",checkIcon:"h-5 w-5",numberSize:"body1",labelSize:"heading1",labelMargin:"mt-7"}};function ib({steps:e,currentStep:t,size:n="md",className:r}){const o=sb[n];if(e.length===0)return s.jsx("div",{className:k("w-full",r)});const a=Math.max(e.length-1,0),i=Math.min(Math.max(t-1,0),a),l=`${100/(e.length*2)}%`,c=a===0?100:i/a*100;return s.jsx("div",{className:k("w-full",r),children:s.jsxs("div",{className:"relative",children:[e.length>1?s.jsxs("div",{className:k("absolute",o.trackTop),style:{left:l,right:l},children:[s.jsx("div",{className:"h-0.5 w-full bg-gray-200"}),s.jsx("div",{className:"absolute top-0 left-0 h-0.5 bg-main-800 transition-all duration-300 ease-in-out",style:{width:`${c}%`}})]}):null,s.jsx("ol",{className:"relative z-10 flex items-start",children:e.map((d,u)=>{const f=u<i,p=u===i,v=d.id??`step-${u}`;return s.jsxs("li",{className:"flex flex-1 flex-col items-center",children:[s.jsx("span",{className:k("flex items-center justify-center rounded-full border-2 bg-white transition-colors duration-200",o.circle,f&&"border-main-800 bg-main-800 text-white",p&&"border-main-800 bg-main-800 text-white ring-4 ring-main-300",!f&&!p&&"border-gray-300 text-gray-600"),"aria-current":p?"step":void 0,children:f?s.jsx(zt,{className:o.checkIcon,strokeWidth:2.5}):s.jsx(L,{size:o.numberSize,weight:"bold",className:k(p?"text-white":"text-gray-600"),children:u+1})}),s.jsx(L,{size:o.labelSize,weight:p?"bold":"medium",className:k("text-center leading-tight",o.labelMargin,f&&"text-gray-900",p&&"text-main-800",!f&&!p&&"text-gray-600"),children:d.label})]},v)})})]})})}function lb({data:e=[],size:t=26,gap:n=8,className:r,renderCellActions:o}){const[a,i]=P.useState(null),[l,c]=P.useState(null),d=P.useRef(null),u=P.useRef(!1),f=P.useRef(!1),p=()=>{d.current!==null&&(clearTimeout(d.current),d.current=null)},v=b=>b<=0?"bg-gray-100":b===1?"bg-main-300":b===2?"bg-main-500":b===3?"bg-main-700":"bg-main-800";return s.jsx("div",{className:k("w-full overflow-x-auto pb-2",r),children:s.jsx("div",{className:"grid w-max grid-flow-col grid-rows-7",style:{gridTemplateRows:`repeat(7, ${t}px)`,gridAutoColumns:`${t}px`,gap:`${n}px`},children:e.map((b,g)=>s.jsxs(wo,{open:a===g,onOpenChange:m=>{if(!m){if(u.current){u.current=!1;return}i(null),c(null),f.current=!0,setTimeout(()=>{f.current=!1},200)}},children:[s.jsx(xo,{asChild:!0,children:s.jsx("button",{type:"button","aria-label":`${b.date} · ${b.count}회 활동`,className:k("cursor-pointer transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-800 focus-visible:ring-offset-1",v(b.count),l===g&&"ring-2 ring-gray-800 ring-offset-1"),style:{width:t,height:t,borderRadius:`${Math.max(4,Math.round(t*.23))}px`},onMouseEnter:()=>{p(),l===null&&!f.current&&i(g)},onMouseLeave:()=>{l===null&&(d.current=setTimeout(()=>i(null),80))},onClick:()=>{p(),l===g?(c(null),i(null),f.current=!0,setTimeout(()=>{f.current=!1},200)):(u.current=!0,c(g),i(g))}})}),s.jsx(Co,{children:s.jsxs(No,{side:"top",sideOffset:4,onOpenAutoFocus:m=>m.preventDefault(),onMouseEnter:()=>{p()},onMouseLeave:()=>{l===null&&i(null)},className:k("z-50 min-w-[120px] rounded-xl bg-gray-900 px-3 py-2 text-white shadow-md","animate-in fade-in-0 zoom-in-95","data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95","data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:slide-in-from-top-2"),children:[s.jsxs("p",{className:"whitespace-nowrap text-xs",children:[b.date," · ",b.count,"회 활동"]}),l===g&&o?s.jsx("div",{className:"mt-2",children:o(b)}):null]})})]},g))})})}const cb=ct("inline-flex items-center rounded-2 px-2.5 py-1 bg-main-800 text-white",{variants:{hasIcon:{true:"gap-1.5",false:""}},defaultVariants:{hasIcon:!1}});function db({icon:e,children:t,size:n="caption2",weight:r="bold",className:o}){return s.jsxs("span",{className:k(cb({hasIcon:!!e}),o),children:[e&&s.jsx(L,{size:n,weight:"medium",children:e}),s.jsx(L,{size:n,weight:r,children:t})]})}var Bl="Toggle",Io=h.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r,onPressedChange:o,...a}=e,[i,l]=Ne({prop:n,onChange:o,defaultProp:r??!1,caller:Bl});return s.jsx(j.button,{type:"button","aria-pressed":i,"data-state":i?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:H(e.onClick,()=>{e.disabled||l(!i)})})});Io.displayName=Bl;var ub=Io;const fb=ct(["inline-flex w-fit items-center justify-center gap-2.5 border bg-white whitespace-nowrap","text-gray-700 transition-all duration-200 ease-out active:scale-95","cursor-pointer disabled:pointer-events-none disabled:opacity-50 disabled:active:scale-100","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-main-300/60","hover:border-gray-400 hover:bg-gray-100","data-[state=on]:border-main-800 data-[state=on]:bg-main-800 data-[state=on]:text-white","data-[state=on]:hover:bg-main-600 data-[state=on]:hover:border-main-600","data-[state=on]:shadow-[0_4px_10px_rgba(255,87,34,0.22)]"],{variants:{shape:{rounded:"h-10 rounded-full px-5",square:"h-10 rounded-3 px-4"}},defaultVariants:{shape:"rounded"}});function hb({icon:e,shape:t="rounded",children:n,className:r,...o}){return s.jsxs(ub,{className:k(fb({shape:t}),r),...o,children:[e?s.jsx("span",{className:"inline-flex items-center justify-center text-[18px] leading-none text-inherit [&>svg]:h-5 [&>svg]:w-5",children:e}):null,s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:n})]})}var Lo="rovingFocusGroup.onEntryFocus",pb={bubbles:!1,cancelable:!0},tn="RovingFocusGroup",[Fo,zl,gb]=ar(tn),[mb,$l]=ke(tn,[gb]),[vb,bb]=mb(tn),Hl=h.forwardRef((e,t)=>s.jsx(Fo.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Fo.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(yb,{...e,ref:t})})}));Hl.displayName=tn;var yb=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:u=!1,...f}=e,p=h.useRef(null),v=ee(t,p),b=cn(a),[g,m]=Ne({prop:i,defaultProp:l??null,onChange:c,caller:tn}),[w,y]=h.useState(!1),C=et(d),A=zl(n),N=h.useRef(!1),[_,E]=h.useState(0);return h.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(Lo,C),()=>S.removeEventListener(Lo,C)},[C]),s.jsx(vb,{scope:n,orientation:r,dir:b,loop:o,currentTabStopId:g,onItemFocus:h.useCallback(S=>m(S),[m]),onItemShiftTab:h.useCallback(()=>y(!0),[]),onFocusableItemAdd:h.useCallback(()=>E(S=>S+1),[]),onFocusableItemRemove:h.useCallback(()=>E(S=>S-1),[]),children:s.jsx(j.div,{tabIndex:w||_===0?-1:0,"data-orientation":r,...f,ref:v,style:{outline:"none",...e.style},onMouseDown:H(e.onMouseDown,()=>{N.current=!0}),onFocus:H(e.onFocus,S=>{const z=!N.current;if(S.target===S.currentTarget&&z&&!w){const V=new CustomEvent(Lo,pb);if(S.currentTarget.dispatchEvent(V),!V.defaultPrevented){const B=A().filter(F=>F.focusable),G=B.find(F=>F.active),U=B.find(F=>F.id===g),q=[G,U,...B].filter(Boolean).map(F=>F.ref.current);jl(q,u)}}N.current=!1}),onBlur:H(e.onBlur,()=>y(!1))})})}),Vl="RovingFocusGroupItem",Yl=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,children:i,...l}=e,c=Pe(),d=a||c,u=bb(Vl,n),f=u.currentTabStopId===d,p=zl(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:g}=u;return h.useEffect(()=>{if(r)return v(),()=>b()},[r,v,b]),s.jsx(Fo.ItemSlot,{scope:n,id:d,focusable:r,active:o,children:s.jsx(j.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...l,ref:t,onMouseDown:H(e.onMouseDown,m=>{r?u.onItemFocus(d):m.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(d)),onKeyDown:H(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){u.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const w=Cb(m,u.orientation,u.dir);if(w!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let C=p().filter(A=>A.focusable).map(A=>A.ref.current);if(w==="last")C.reverse();else if(w==="prev"||w==="next"){w==="prev"&&C.reverse();const A=C.indexOf(m.currentTarget);C=u.loop?Nb(C,A+1):C.slice(A+1)}setTimeout(()=>jl(C))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:g!=null}):i})})});Yl.displayName=Vl;var wb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xb(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Cb(e,t,n){const r=xb(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return wb[r]}function jl(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Nb(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Sb=Hl,Ab=Yl,it="ToggleGroup",[Gl]=ke(it,[$l]),Ul=$l(),Wo=P.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const o=r;return s.jsx(kb,{...o,ref:t})}if(n==="multiple"){const o=r;return s.jsx(Pb,{...o,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${it}\``)});Wo.displayName=it;var[Kl,Ql]=Gl(it),kb=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...a}=e,[i,l]=Ne({prop:n,defaultProp:r??"",onChange:o,caller:it});return s.jsx(Kl,{scope:e.__scopeToggleGroup,type:"single",value:P.useMemo(()=>i?[i]:[],[i]),onItemActivate:l,onItemDeactivate:P.useCallback(()=>l(""),[l]),children:s.jsx(ql,{...a,ref:t})})}),Pb=P.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...a}=e,[i,l]=Ne({prop:n,defaultProp:r??[],onChange:o,caller:it}),c=P.useCallback(u=>l((f=[])=>[...f,u]),[l]),d=P.useCallback(u=>l((f=[])=>f.filter(p=>p!==u)),[l]);return s.jsx(Kl,{scope:e.__scopeToggleGroup,type:"multiple",value:i,onItemActivate:c,onItemDeactivate:d,children:s.jsx(ql,{...a,ref:t})})});Wo.displayName=it;var[Eb,_b]=Gl(it),ql=P.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:o=!0,orientation:a,dir:i,loop:l=!0,...c}=e,d=Ul(n),u=cn(i),f={role:"group",dir:u,...c};return s.jsx(Eb,{scope:n,rovingFocus:o,disabled:r,children:o?s.jsx(Sb,{asChild:!0,...d,orientation:a,dir:u,loop:l,children:s.jsx(j.div,{...f,ref:t})}):s.jsx(j.div,{...f,ref:t})})}),tr="ToggleGroupItem",Xl=P.forwardRef((e,t)=>{const n=Ql(tr,e.__scopeToggleGroup),r=_b(tr,e.__scopeToggleGroup),o=Ul(e.__scopeToggleGroup),a=n.value.includes(e.value),i=r.disabled||e.disabled,l={...e,pressed:a,disabled:i},c=P.useRef(null);return r.rovingFocus?s.jsx(Ab,{asChild:!0,...o,focusable:!i,active:a,ref:c,children:s.jsx(Zl,{...l,ref:t})}):s.jsx(Zl,{...l,ref:t})});Xl.displayName=tr;var Zl=P.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...o}=e,a=Ql(tr,n),i={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=a.type==="single"?i:void 0;return s.jsx(Io,{...l,...o,ref:t,onPressedChange:c=>{c?a.onItemActivate(r):a.onItemDeactivate(r)}})}),Mb=Wo,Tb=Xl;const Db=ct(["inline-flex w-fit items-center justify-center gap-2.5 border bg-white whitespace-nowrap","text-gray-700 transition-all duration-200 ease-out active:scale-95","cursor-pointer disabled:pointer-events-none disabled:opacity-50 disabled:active:scale-100","focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-main-300/60","hover:border-gray-400 hover:bg-gray-100","data-[state=on]:border-main-800 data-[state=on]:bg-main-800 data-[state=on]:text-white","data-[state=on]:hover:bg-main-600 data-[state=on]:hover:border-main-600","data-[state=on]:shadow-[0_4px_10px_rgba(255,87,34,0.22)]"],{variants:{shape:{rounded:"h-10 rounded-full px-5",square:"h-10 rounded-3 px-4"}},defaultVariants:{shape:"rounded"}});function Ob({children:e,className:t,...n}){return s.jsx(Mb,{"data-slot":"toggle-group",className:k("flex flex-wrap gap-4 rounded-none",t),...n,children:e})}function Ib({icon:e,shape:t="rounded",children:n,className:r,...o}){return s.jsxs(Tb,{"data-slot":"toggle-group-item",className:k(Db({shape:t}),r),...o,children:[e?s.jsx("span",{className:"inline-flex items-center justify-center text-[18px] leading-none text-inherit [&>svg]:h-5 [&>svg]:w-5",children:e}):null,s.jsx(L,{size:"body2",weight:"bold",className:"text-inherit",children:n})]})}var[nr]=ke("Tooltip",[Et]),rr=Et(),Jl="TooltipProvider",Lb=700,Bo="tooltip.open",[Fb,zo]=nr(Jl),Rl=e=>{const{__scopeTooltip:t,delayDuration:n=Lb,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,i=h.useRef(!0),l=h.useRef(!1),c=h.useRef(0);return h.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),s.jsx(Fb,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(c.current),i.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:a})};Rl.displayName=Jl;var nn="Tooltip",[Wb,rn]=nr(nn),ec=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:a,disableHoverableContent:i,delayDuration:l}=e,c=zo(nn,e.__scopeTooltip),d=rr(t),[u,f]=h.useState(null),p=Pe(),v=h.useRef(0),b=i??c.disableHoverableContent,g=l??c.delayDuration,m=h.useRef(!1),[w,y]=Ne({prop:r,defaultProp:o??!1,onChange:E=>{E?(c.onOpen(),document.dispatchEvent(new CustomEvent(Bo))):c.onClose(),a?.(E)},caller:nn}),C=h.useMemo(()=>w?m.current?"delayed-open":"instant-open":"closed",[w]),A=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,m.current=!1,y(!0)},[y]),N=h.useCallback(()=>{window.clearTimeout(v.current),v.current=0,y(!1)},[y]),_=h.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{m.current=!0,y(!0),v.current=0},g)},[g,y]);return h.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),s.jsx(co,{...d,children:s.jsx(Wb,{scope:t,contentId:p,open:w,stateAttribute:C,trigger:u,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{c.isOpenDelayedRef.current?_():A()},[c.isOpenDelayedRef,_,A]),onTriggerLeave:h.useCallback(()=>{b?N():(window.clearTimeout(v.current),v.current=0)},[N,b]),onOpen:A,onClose:N,disableHoverableContent:b,children:n})})};ec.displayName=nn;var $o="TooltipTrigger",tc=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=rn($o,n),a=zo($o,n),i=rr(n),l=h.useRef(null),c=ee(t,l,o.onTriggerChange),d=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>d.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(Bn,{asChild:!0,...i,children:s.jsx(j.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:c,onPointerMove:H(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:H(e.onPointerDown,()=>{o.open&&o.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:H(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:H(e.onBlur,o.onClose),onClick:H(e.onClick,o.onClose)})})});tc.displayName=$o;var Ho="TooltipPortal",[Bb,zb]=nr(Ho,{forceMount:void 0}),nc=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=rn(Ho,t);return s.jsx(Bb,{scope:t,forceMount:n,children:s.jsx(We,{present:n||a.open,children:s.jsx(Xt,{asChild:!0,container:o,children:r})})})};nc.displayName=Ho;var Ft="TooltipContent",rc=h.forwardRef((e,t)=>{const n=zb(Ft,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,i=rn(Ft,e.__scopeTooltip);return s.jsx(We,{present:r||i.open,children:i.disableHoverableContent?s.jsx(oc,{side:o,...a,ref:t}):s.jsx($b,{side:o,...a,ref:t})})}),$b=h.forwardRef((e,t)=>{const n=rn(Ft,e.__scopeTooltip),r=zo(Ft,e.__scopeTooltip),o=h.useRef(null),a=ee(t,o),[i,l]=h.useState(null),{trigger:c,onClose:d}=n,u=o.current,{onPointerInTransitChange:f}=r,p=h.useCallback(()=>{l(null),f(!1)},[f]),v=h.useCallback((b,g)=>{const m=b.currentTarget,w={x:b.clientX,y:b.clientY},y=Gb(w,m.getBoundingClientRect()),C=Ub(w,y),A=Kb(g.getBoundingClientRect()),N=qb([...C,...A]);l(N),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(c&&u){const b=m=>v(m,u),g=m=>v(m,c);return c.addEventListener("pointerleave",b),u.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",b),u.removeEventListener("pointerleave",g)}}},[c,u,v,p]),h.useEffect(()=>{if(i){const b=g=>{const m=g.target,w={x:g.clientX,y:g.clientY},y=c?.contains(m)||u?.contains(m),C=!Qb(w,i);y?p():C&&(p(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[c,u,i,d,p]),s.jsx(oc,{...e,ref:a})}),[Hb,Vb]=nr(nn,{isInside:!1}),Yb=cc("TooltipContent"),oc=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...l}=e,c=rn(Ft,n),d=rr(n),{onClose:u}=c;return h.useEffect(()=>(document.addEventListener(Bo,u),()=>document.removeEventListener(Bo,u)),[u]),h.useEffect(()=>{if(c.trigger){const f=p=>{p.target?.contains(c.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,u]),s.jsx(Ut,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:s.jsxs(uo,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(Yb,{children:r}),s.jsx(Hb,{scope:n,isInside:!0,children:s.jsx(Hv,{id:c.contentId,role:"tooltip",children:o||r})})]})})});rc.displayName=Ft;var ac="TooltipArrow",jb=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=rr(n);return Vb(ac,n).isInside?null:s.jsx(fo,{...o,...r,ref:t})});jb.displayName=ac;function Gb(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ub(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Kb(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Qb(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const l=t[a],c=t[i],d=l.x,u=l.y,f=c.x,p=c.y;u>r!=p>r&&n<(f-d)*(r-u)/(p-u)+d&&(o=!o)}return o}function qb(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Xb(t)}function Xb(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Zb=Rl,Jb=ec,Rb=tc,ey=nc,ty=rc;function ny({delayDuration:e=200,...t}){return s.jsx(Zb,{delayDuration:e,...t})}const ry=Jb,oy=Rb;function ay({className:e,sideOffset:t=4,...n}){return s.jsx(ey,{children:s.jsx(ty,{sideOffset:t,className:k("z-50 overflow-hidden rounded-xl bg-gray-900 px-3 py-2 text-caption2 text-white shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})})}T.Accordion=Td,T.AccordionContent=Id,T.AccordionItem=Dd,T.AccordionTrigger=Od,T.AppHeader=hu,T.AppLayout=B0,T.AppLayoutBody=$0,T.AppLayoutHeader=z0,T.AppLayoutOverlay=V0,T.AppLayoutProvider=Y0,T.AppLayoutSidebar=H0,T.AvatarImagePicker=I0,T.BannerCarousel=vu,T.Button=ue,T.Calendar=Hr,T.CheckContainer=Tp,T.CheckList=Fp,T.Checkbox=jr,T.CircleAvatar=Bt,T.CircularProgress=Bp,T.DatePicker=pv,T.Dialog=Dv,T.DialogClose=Iv,T.DialogContent=Lv,T.DialogDescription=zv,T.DialogFooter=Wv,T.DialogHeader=Fv,T.DialogOverlay=Ri,T.DialogPortal=Ji,T.DialogTitle=Bv,T.DialogTrigger=Ov,T.GoalAddList=O0,T.Icon=Wa,T.ImagePicker=F0,T.ImagePlaceholder=L0,T.InfoButton=W0,T.PageWatermark=G0,T.Pagination=K0,T.Profile=q0,T.ProgressBar=Wl,T.RangeDatePicker=gv,T.RightSidebar=R0,T.ScheduleCalendar=ob,T.Select=N0,T.SelectContent=_0,T.SelectGroup=S0,T.SelectItem=P0,T.SelectLabel=M0,T.SelectScrollDownButton=Ol,T.SelectScrollUpButton=Dl,T.SelectSeparator=E0,T.SelectTrigger=k0,T.SelectValue=A0,T.StatContainer=ab,T.StepIndicator=ib,T.Streak=lb,T.Tag=db,T.Text=L,T.TextArea=Ll,T.TextField=er,T.Toggle=hb,T.ToggleGroup=Ob,T.ToggleGroupItem=Ib,T.Tooltip=ry,T.TooltipContent=ay,T.TooltipProvider=ny,T.TooltipTrigger=oy,T.cn=k,T.textVariants=bn,T.useAppLayoutContext=j0,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1d1s/design-system",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "main": "dist/index.umd.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",