@ahmetilhn/hanui 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.cjs +15 -15
- package/build/index.cjs.map +1 -1
- package/build/index.d.ts +13 -0
- package/build/index.js +2065 -2058
- package/build/index.js.map +1 -1
- package/build/styles.css +1 -1
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),U=require("@ahmetilhn/handy-utils"),D=require("react-bootstrap-icons"),
|
|
2
|
-
`),r=e.fonts??{},
|
|
3
|
-
${
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),U=require("@ahmetilhn/handy-utils"),D=require("react-bootstrap-icons"),rt=require("react-dom"),me={pine:"#00322a",mint:"#43ff9c",ink:"#00120f"},Ue={paper:"#eff4f1",slate:"#38594f",mist:"#8fb3a7"},S={n0:"#ffffff",n25:"#f9fbfa",n100:Ue.paper,n150:"#e8efec",n200:"#e3eae7",n250:"#d6e1dc",n300:"#c5d3cc",n550:"#506d63",n600:Ue.slate,n700:"#26403a",n900:me.ink},de={base:me.pine,two:"#004d40",three:"#0f574a",dark:me.pine,darkLine:"#0a4a3e"},z={page:me.ink,surface:"#0b1614",surfaceTwo:"#14201d",surfaceThree:"#1f2c28",inset:"#000d0b",border:"#26332f",borderStrong:"#3d4f4a",text:Ue.paper,textTwo:Ue.mist,textThree:"#799a8f",actionSoft:"#3f5a53"},Ba={light:me.pine,dark:me.mint},re={base:"#22a76d",hover:"#2ab97a",active:"#1d9a64",soft:"#8fd3b6",dark:"#43d08a",darkHover:"#5ddf9c",darkActive:"#2fbb7a",darkSoft:"#43906f",on:"#02180f"},J={base:"#1a7f61",hover:"#10654b",active:"#0a4d39",text:"#147155",tint:"#e9f6f2",line:"#acd8cb",dark:"#51d6ae",darkHover:"#74e7c5",darkTint:"#113228",darkLine:"#285d4d"},dn={green:"#1d9a64"},M={okBg:"#e6f4ed",okFg:"#156f4e",okLine:"#a8dcc4",okBgDark:"#0b2d23",okFgDark:"#47d191",okLineDark:"#1e5742",warnBg:"#fdf0dd",warnFg:"#7a3e02",warnLine:"#ebc687",warnBgDark:"#2c2008",warnFgDark:"#f5c86b",warnLineDark:"#55401a",offBg:"#f0f4f3",offFg:S.n700,offLine:"#cddad4",offBgDark:"#192e29",offFgDark:"#a2b9b0",offLineDark:"#2a423b",badBg:"#f8ebeb",badFg:"#bb1e1e",badLine:"#e6a6a6",badBgDark:"#310f0f",badFgDark:"#e97575",badLineDark:"#621b1b",oemBg:"#edf8f5",oemFg:"#0d5942",oemLine:"#b5ded2",oemBgDark:"#0f2f25",oemFgDark:"#7eddc1",oemLineDark:"#296553",altBg:"#eeebfa",altFg:"#2e2661",altLine:"#c0b6ea",altBgDark:"#1d1a33",altFgDark:"#bfb3f5",altLineDark:"#332d56"},nt={base:"#dc2626",hover:"#bb1e1e",dark:"#e45b5b",darkHover:"#ef7a72",onDark:"#1a0b0a"},He={red:"#dc2626",redDark:"#e35252",green:dn.green,greenDark:"#43d08a",greenHover:"#17814f",greenHoverDark:"#63e3a3",onGreen:re.on},Kt={bg:M.okBg,fg:M.okFg,bgDark:M.okBgDark,fgDark:M.okFgDark},Ma={light:"#9a5f04",dark:"#f0b429"},F=(e,a)=>{const s=e.replace("#",""),r=s.length===3?s.split("").map(_=>_+_).join(""):s,o=parseInt(r.slice(0,2),16),c=parseInt(r.slice(2,4),16),i=parseInt(r.slice(4,6),16);return`rgba(${o}, ${c}, ${i}, ${a})`},ne="#000000",Pa={page:S.n0,surface:S.n0,"surface-2":S.n100,"surface-3":S.n150,"surface-inset":S.n25,border:S.n250,"border-strong":S.n300,text:S.n900,"text-2":S.n600,"text-3":S.n550,graphite:de.base,"graphite-2":de.two,"graphite-3":de.three,action:de.base,"action-hover":de.two,"action-active":de.three,"on-action":S.n0,"action-line":Ba.light,"action-soft":S.n300,"on-action-soft":S.n700,amber:re.base,"amber-hover":re.hover,"amber-active":re.active,"amber-soft":re.soft,"on-amber":re.on,blue:J.base,"blue-hover":J.hover,"blue-active":J.active,"blue-text":J.text,"blue-tint":J.tint,"blue-line":J.line,"on-blue":S.n0,"ok-bg":M.okBg,"ok-fg":M.okFg,"ok-line":M.okLine,"warn-bg":M.warnBg,"warn-fg":M.warnFg,"warn-line":M.warnLine,"off-bg":M.offBg,"off-fg":M.offFg,"off-line":M.offLine,"bad-bg":M.badBg,"bad-fg":M.badFg,"bad-line":M.badLine,"oem-bg":M.oemBg,"oem-fg":M.oemFg,"oem-line":M.oemLine,"alt-bg":M.altBg,"alt-fg":M.altFg,"alt-line":M.altLine,"sale-bg":Kt.bg,"sale-fg":Kt.fg,"red-accent":He.red,"green-accent":He.green,"green-accent-hover":He.greenHover,"on-green":He.onGreen,star:Ma.light,"danger-solid":nt.base,"danger-solid-hover":nt.hover,"on-danger":S.n0,"nav-bg":S.n0,"nav-bg-2":S.n100,"nav-fg":S.n900,"nav-fg-2":S.n600,"nav-fg-3":S.n550,"nav-line":S.n200,"nav-line-strong":S.n300,"nav-hover":S.n100,"footer-bg":S.n100,"band-bg":de.dark,"band-fg":Ue.paper,"band-fg-2":Ue.mist,"band-line":de.darkLine,"band-hover":F(S.n0,.07),"shadow-xs":`0 1px 2px ${F(S.n900,.05)}`,"shadow-sm":`0 1px 2px ${F(S.n900,.05)}, 0 1px 3px ${F(S.n900,.04)}`,"shadow-md":`0 2px 4px ${F(S.n900,.04)}, 0 6px 16px ${F(S.n900,.07)}`,"shadow-lg":`0 4px 8px ${F(S.n900,.05)}, 0 16px 32px ${F(S.n900,.1)}`,"shadow-xl":`0 8px 16px ${F(S.n900,.06)}, 0 28px 56px ${F(S.n900,.13)}`,"shadow-up":`0 -2px 4px ${F(S.n900,.03)}, 0 -8px 24px ${F(S.n900,.08)}`,ring:`0 0 0 3px ${F(J.base,.28)}`,"ring-color":J.base,"ring-danger":`0 0 0 3px ${F(nt.base,.24)}`,"ring-ok":`0 0 0 4px ${F(M.okFg,.16)}`,scrim:F(S.n900,.6),"scrim-soft":F(S.n900,.32),glass:F(S.n0,.92),"glass-solid":S.n0,"on-scrim":S.n0,"skeleton-a":S.n100,"skeleton-b":S.n25,track:F(S.n900,.12),"media-bg":S.n100,"glow-1":F(me.mint,.1),"glow-2":F(me.pine,.06),"glow-amber":F(re.base,.09)},Oa={page:z.page,surface:z.surface,"surface-2":z.surfaceTwo,"surface-3":z.surfaceThree,"surface-inset":z.inset,border:z.border,"border-strong":z.borderStrong,text:z.text,"text-2":z.textTwo,"text-3":z.textThree,graphite:z.surface,"graphite-2":z.surfaceTwo,"graphite-3":z.surfaceThree,action:me.pine,"action-hover":de.two,"action-active":de.three,"on-action":S.n0,"action-line":Ba.dark,"action-soft":z.actionSoft,"on-action-soft":S.n300,amber:re.dark,"amber-hover":re.darkHover,"amber-active":re.darkActive,"amber-soft":re.darkSoft,"on-amber":re.on,blue:J.dark,"blue-hover":J.darkHover,"blue-active":J.base,"blue-text":J.dark,"blue-tint":J.darkTint,"blue-line":J.darkLine,"on-blue":S.n900,"ok-bg":M.okBgDark,"ok-fg":M.okFgDark,"ok-line":M.okLineDark,"warn-bg":M.warnBgDark,"warn-fg":M.warnFgDark,"warn-line":M.warnLineDark,"off-bg":M.offBgDark,"off-fg":M.offFgDark,"off-line":M.offLineDark,"bad-bg":M.badBgDark,"bad-fg":M.badFgDark,"bad-line":M.badLineDark,"oem-bg":M.oemBgDark,"oem-fg":M.oemFgDark,"oem-line":M.oemLineDark,"alt-bg":M.altBgDark,"alt-fg":M.altFgDark,"alt-line":M.altLineDark,"sale-bg":Kt.bgDark,"sale-fg":Kt.fgDark,"red-accent":He.redDark,"green-accent":He.greenDark,"green-accent-hover":He.greenHoverDark,"on-green":He.onGreen,star:Ma.dark,"danger-solid":nt.dark,"danger-solid-hover":nt.darkHover,"on-danger":nt.onDark,"nav-bg":z.page,"nav-bg-2":z.surfaceTwo,"nav-fg":z.text,"nav-fg-2":z.textTwo,"nav-fg-3":z.textThree,"nav-line":z.border,"nav-line-strong":z.borderStrong,"nav-hover":F(S.n0,.07),"footer-bg":z.surface,"band-bg":de.dark,"band-fg":Ue.paper,"band-fg-2":Ue.mist,"band-line":de.darkLine,"band-hover":F(S.n0,.07),"shadow-xs":`0 1px 2px ${F(ne,.4)}`,"shadow-sm":`0 1px 2px ${F(ne,.4)}, 0 1px 3px ${F(ne,.3)}`,"shadow-md":`0 2px 4px ${F(ne,.35)}, 0 6px 16px ${F(ne,.45)}`,"shadow-lg":`0 4px 8px ${F(ne,.4)}, 0 16px 32px ${F(ne,.55)}`,"shadow-xl":`0 8px 16px ${F(ne,.45)}, 0 28px 56px ${F(ne,.6)}`,"shadow-up":`0 -2px 4px ${F(ne,.3)}, 0 -8px 24px ${F(ne,.45)}`,ring:`0 0 0 3px ${F(J.dark,.36)}`,"ring-color":J.dark,"ring-danger":`0 0 0 3px ${F(nt.dark,.32)}`,"ring-ok":`0 0 0 4px ${F(M.okFgDark,.2)}`,scrim:F(ne,.68),"scrim-soft":F(ne,.45),glass:F(z.surfaceTwo,.92),"glass-solid":z.surfaceTwo,"on-scrim":S.n0,"skeleton-a":z.surfaceTwo,"skeleton-b":z.surfaceThree,track:F(S.n0,.14),"media-bg":z.surfaceTwo,"glow-1":F(me.mint,.2),"glow-2":F(me.pine,.12),"glow-amber":F(re.dark,.12)},un={"radius-xs":"4px","radius-sm":"6px","radius-md":"8px","radius-lg":"12px","radius-xl":"16px","radius-pill":"999px","space-0":"0","space-1":"4px","space-2":"8px","space-3":"12px","space-4":"16px","space-5":"24px","space-6":"32px","space-7":"48px","space-8":"64px","space-9":"96px","font-size-2xs":"12px","font-size-xs":"13px","font-size-sm":"15px","font-size-base":"16px","font-size-body":"17px","font-size-lg":"19px","font-size-xl":"23px","font-size-2xl":"29px","font-size-3xl":"37px","font-size-4xl":"47px","leading-none":"1","leading-tight":"1.16","leading-snug":"1.35","leading-normal":"1.62","leading-relaxed":"1.75","icon-xs":"14px","icon-sm":"16px","icon-md":"18px","icon-lg":"20px","icon-xl":"24px","duration-instant":"80ms","duration-fast":"140ms","duration-normal":"200ms","duration-slow":"320ms","ease-out":"cubic-bezier(0.22, 1, 0.36, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)","ease-spring":"cubic-bezier(0.34, 1.4, 0.64, 1)","duration-spin":"700ms","duration-shimmer":"1400ms"},_n={"space-2":"6px","space-3":"8px","space-4":"12px","space-5":"16px","space-6":"24px","space-7":"32px","font-size-2xs":"11px","font-size-xs":"12px","font-size-sm":"13px","font-size-base":"15px","font-size-body":"16px","font-size-lg":"18px","font-size-xl":"21px","font-size-2xl":"25px","font-size-3xl":"31px","font-size-4xl":"39px","leading-normal":"1.5","leading-relaxed":"1.6"},hn={heading:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",body:"system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif",mono:"ui-monospace, 'SF Mono', Menlo, Consolas, monospace"},wa="--hanui-",ka="hanui-theme-overrides",ze="data-hanui-theme",ca="data-hanui-density",ja="hanui-theme-switching",pn=(e,a)=>{const s=e==="dark"?Oa:Pa,r=(e==="dark"?a==null?void 0:a.dark:a==null?void 0:a.light)??{};return{...s,...r}},Ha=e=>{const a=[],s=(i,_=" ")=>Object.entries(i).map(([h,d])=>`${_}${wa}${h}: ${d};`).join(`
|
|
2
|
+
`),r=e.fonts??{},o=Object.entries(r).filter(([,i])=>!!i);o.length>0&&a.push(`:root {
|
|
3
|
+
${o.map(([i,_])=>` ${wa}font-${i}: ${_};`).join(`
|
|
4
4
|
`)}
|
|
5
|
-
}`);const c=e.metrics??{};if(Object.keys(c).length>0){const
|
|
6
|
-
${
|
|
7
|
-
}`),a.push(`:root[${
|
|
8
|
-
${
|
|
9
|
-
}`)}if(e.light&&Object.keys(e.light).length>0){const
|
|
10
|
-
${
|
|
11
|
-
}`),a.push(`:root[${
|
|
12
|
-
${
|
|
13
|
-
}`)}if(e.dark&&Object.keys(e.dark).length>0){const
|
|
14
|
-
${
|
|
5
|
+
}`);const c=e.metrics??{};if(Object.keys(c).length>0){const i=s(c);a.push(`:root {
|
|
6
|
+
${i}
|
|
7
|
+
}`),a.push(`:root[${ca}='compact'] {
|
|
8
|
+
${i}
|
|
9
|
+
}`)}if(e.light&&Object.keys(e.light).length>0){const i=s(e.light);a.push(`:root {
|
|
10
|
+
${i}
|
|
11
|
+
}`),a.push(`:root[${ze}='light'] {
|
|
12
|
+
${i}
|
|
13
|
+
}`)}if(e.dark&&Object.keys(e.dark).length>0){const i=s(e.dark);a.push(`:root[${ze}='dark'] {
|
|
14
|
+
${i}
|
|
15
15
|
}`),a.push(`@media (prefers-color-scheme: dark) {
|
|
16
|
-
:root:not([${
|
|
16
|
+
:root:not([${ze}]) {
|
|
17
17
|
${s(e.dark," ")}
|
|
18
18
|
}
|
|
19
19
|
}`)}return a.join(`
|
|
20
20
|
|
|
21
|
-
`)},oa=e=>{if(!U.isClient())return;const a=e?za(e):"",s=document.getElementById(ja);if(a===""){s==null||s.remove();return}const r=s??document.createElement("style");r.id=ja,r.textContent=a,s||document.head.appendChild(r)},Ka=n.createContext({}),O=()=>n.useContext(Ka),gn=({children:e,theme:a,linkComponent:s,labels:r})=>{const i=n.useMemo(()=>a?JSON.stringify(a):"",[a]);n.useEffect(()=>{oa(a)},[i]);const c=n.useRef(a);c.current=a;const o=n.useMemo(()=>({theme:c.current,linkComponent:s,labels:r}),[i,s,r]);return t.jsx(Ka.Provider,{value:o,children:e})},fn=(e={})=>{oa(e.theme),U.isClient()&&(e.colorScheme&&document.documentElement.setAttribute(Pe,e.colorScheme),e.density&&document.documentElement.setAttribute(ra,e.density))},xn="hanui-live-region",vn=e=>{if(!U.isClient())return null;const a=`${xn}-${e}`,s=document.getElementById(a);if(s)return s;const r=document.createElement("div");return r.id=a,r.setAttribute("aria-live",e),r.setAttribute("aria-atomic","true"),r.className="hanui-visually-hidden",document.body.appendChild(r),r},yn=(e,a)=>{e.textContent="",window.requestAnimationFrame(()=>{e.textContent=a})},zt=()=>n.useCallback((e,a="polite")=>{const s=e.trim();if(s==="")return;const r=vn(a);r&&yn(r,s)},[]),$a=()=>{var e;return U.isClient()&&((e=window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"},wn=()=>{if(!U.isClient())return"system";const e=document.documentElement.getAttribute(Pe);return e==="dark"||e==="light"?e:"system"},kn=()=>{const[e,a]=n.useState("light"),[s,r]=n.useState("light"),[i,c]=n.useState(!1);n.useEffect(()=>{a(wn()),r($a()),c(!0)},[]),n.useEffect(()=>{if(!U.isClient()||!window.matchMedia)return;const d=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>r($a());return d.addEventListener("change",l),()=>d.removeEventListener("change",l)},[]);const o=e==="system"?s:e,_=n.useCallback(d=>{if(!U.isClient())return;const l=document.documentElement;l.classList.add(Na),d==="system"?l.removeAttribute(Pe):l.setAttribute(Pe,d),a(d),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>l.classList.remove(Na))})},[]),h=n.useCallback(()=>_(o==="dark"?"light":"dark"),[o,_]);return{scheme:o,preference:e,setScheme:_,toggle:h,isReady:i}},jn=()=>{!U.isClient()||typeof window.scrollTo!="function"||window.scrollTo({top:0,left:0,behavior:"instant"})},ia=(e,a)=>{typeof(e==null?void 0:e.scrollIntoView)=="function"&&e.scrollIntoView(a)},ca=({count:e,isOpen:a,initialIndex:s=0,onSelect:r,onClose:i},{hasSpaceSelect:c=!1}={})=>{const[o,_]=n.useState(s),h=n.useRef(null);n.useEffect(()=>{a&&_(s)},[a,s]),n.useEffect(()=>{_(l=>l>=e?Math.max(0,e-1):l)},[e]),n.useEffect(()=>{var l;a&&ia((l=h.current)==null?void 0:l.querySelector(`[data-index="${o}"]`),{block:"nearest"})},[o,a,e]);const d=n.useCallback(l=>{const p=e-1;switch(l.key){case"ArrowDown":l.preventDefault(),_(u=>u>=p?0:u+1);break;case"ArrowUp":l.preventDefault(),_(u=>u<=0?p:u-1);break;case"Home":l.preventDefault(),_(0);break;case"End":l.preventDefault(),_(p);break;case" ":case"Enter":{if(l.key===" "&&!c)break;l.preventDefault(),e>0&&r(o);break}case"Escape":l.preventDefault(),l.stopPropagation(),i();break;case"Tab":i();break}},[o,e,c,i,r]);return{activeIndex:o,setActiveIndex:_,listRef:h,handleKeyDown:d}},Xt={top:"bottom",bottom:"top",left:"right",right:"left"},Ea=(e,a,s)=>s<a?a:Math.min(Math.max(e,a),s),Wt=(e,a,s,r,i)=>{const c=s==="top"||s==="bottom",o={top:e.top-a.height-i,bottom:e.top+e.height+i,left:e.left-a.width-i,right:e.left+e.width+i}[s],_=c?e.left:e.top,h=c?e.width:e.height,d=c?a.width:a.height,l={start:_,center:_+h/2-d/2,end:_+h-d}[r];return c?{top:o,left:l}:{top:l,left:o}},Ca=(e,a,s,r,i)=>({top:e.top>=r,bottom:e.top+a.height<=i.height-r,left:e.left>=r,right:e.left+a.width<=i.width-r})[s],ht=(e,a,{side:s="top",align:r="center",offset:i=8,padding:c=8,isOpen:o})=>{const[_,h]=n.useState({style:{position:"fixed",top:0,left:0},side:s,isPositioned:!1}),d=n.useRef(0),l=n.useCallback(()=>{const b=e.current,g=a.current;if(!b||!g)return;const k=b.getBoundingClientRect(),m=g.getBoundingClientRect(),f={width:window.innerWidth,height:window.innerHeight},N=Wt(k,m,s,r,i),j=Ca(N,m,s,c,f)?s:Ca(Wt(k,m,Xt[s],r,i),m,Xt[s],c,f)?Xt[s]:s,x=Wt(k,m,j,r,i);h({style:{position:"fixed",top:Math.round(Ea(x.top,c,f.height-m.height-c)),left:Math.round(Ea(x.left,c,f.width-m.width-c))},side:j,isPositioned:!0})},[e,a,s,r,i,c]),p=n.useCallback(()=>{d.current||(d.current=window.requestAnimationFrame(()=>{d.current=0,l()}))},[l]);return(U.isClient()?n.useLayoutEffect:n.useEffect)(()=>{var g,k;if(!o){h(m=>m.isPositioned?{...m,isPositioned:!1}:m);return}l(),window.addEventListener("resize",p),(g=window.visualViewport)==null||g.addEventListener("resize",p),(k=window.visualViewport)==null||k.addEventListener("scroll",p),document.addEventListener("scroll",p,!0);const b=typeof ResizeObserver>"u"?null:new ResizeObserver(p);return b&&a.current&&b.observe(a.current),b&&e.current&&b.observe(e.current),()=>{var m,f;window.removeEventListener("resize",p),(m=window.visualViewport)==null||m.removeEventListener("resize",p),(f=window.visualViewport)==null||f.removeEventListener("scroll",p),document.removeEventListener("scroll",p,!0),b==null||b.disconnect(),d.current&&(window.cancelAnimationFrame(d.current),d.current=0)}},[o,l,p,e,a]),_},Nn=40,$n=6,Ua=(e,{rowHeight:a=Nn,overscan:s=$n,isEnabled:r=!0}={})=>{const i=n.useRef(null),[c,o]=n.useState({start:0,end:e,totalHeight:e*a,offset:0}),_=n.useCallback(()=>{const d=i.current,l=!r||!d||d.clientHeight===0?{start:0,end:e,totalHeight:e*a,offset:0}:(()=>{const p=Math.ceil(d.clientHeight/a),u=Math.floor(d.scrollTop/a),b=Math.max(0,u-s),g=Math.min(e,u+p+s);return{start:b,end:g,totalHeight:e*a,offset:b*a}})();o(p=>p.start===l.start&&p.end===l.end&&p.totalHeight===l.totalHeight&&p.offset===l.offset?p:l)},[e,r,s,a]);n.useEffect(_),n.useEffect(()=>{const d=i.current;if(!d)return;d.addEventListener("scroll",_,{passive:!0});const l=typeof ResizeObserver>"u"?null:new ResizeObserver(_);return l==null||l.observe(d),()=>{d.removeEventListener("scroll",_),l==null||l.disconnect()}},[_]);const h=n.useCallback(d=>{const l=i.current;if(!l||!r)return;const p=d*a,u=p+a;p<l.scrollTop?l.scrollTop=p:u>l.scrollTop+l.clientHeight&&(l.scrollTop=u-l.clientHeight)},[r,a]);return{scrollRef:i,range:c,scrollToIndex:h,measure:_}};var ke=(e=>(e.PRIMARY="PRIMARY",e.CART="CART",e.SECONDARY="SECONDARY",e.OUTLINE="OUTLINE",e.DARK="DARK",e.LIGHT="LIGHT",e.GHOST="GHOST",e.DANGER="DANGER",e))(ke||{}),ze=(e=>(e.SMALL="SMALL",e.MEDIUM="MEDIUM",e.LARGE="LARGE",e))(ze||{});const qa=640,En=768,Ya=1024,Cn=`(min-width: ${Ya+1}px)`,Kt=`(min-width: ${qa+1}px)`,ta=e=>e.replace(/İ/g,"i").replace(/I/g,"i").replace(/ı/g,"i").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/ş/g,"s").replace(/ğ/g,"g").replace(/ç/g,"c").replace(/ø/g,"o").replace(/æ/g,"ae").replace(/ß/g,"ss").replace(/đ/g,"d").replace(/ł/g,"l").replace(/\s+/g," ").trim(),Ct=(e,a)=>ta(e).includes(ta(a)),v=(...e)=>{let a="";for(const s of e)s&&(a=a===""?s:`${a} ${s}`);return a},L=(e,a)=>Object.assign(e,{displayName:a}),_e=({children:e,...a})=>{const{linkComponent:s}=O();return s?t.jsx(s,{...a,children:e}):t.jsx("a",{...a,children:e})},Ia=new Set,P=(e,...a)=>{for(const s of a)if(s!==void 0)return s;return process.env.NODE_ENV!=="production"&&!Ia.has(e)&&(Ia.add(e),console.error(`[hanui] Eksik metin: ${e}. Prop olarak geçin ya da <HanuiProvider labels={…}> içinde bir kez tanımlayın. Metinsiz bırakılan öğe ekran okuyucuda adsız kalır.`)),""},fe=(e,a,...s)=>a?a(...s):P(e),In="hanui-spinner-7pXwf",Tn="hanui-spinner__label-sZvSq",Gt={spinner:In,spinner__label:Tn,"spinner--sm":"hanui-spinner--sm-uI0wH","spinner--md":"hanui-spinner--md--VmFK","spinner--lg":"hanui-spinner--lg-K9k-Z"},Rn=({size:e="md",label:a,className:s})=>{const{labels:r}=O();return t.jsx("span",{className:v(Gt.spinner,Gt[`spinner--${e}`],s),role:"status",children:t.jsx("span",{className:Gt.spinner__label,children:a??P("Spinner.label",r==null?void 0:r.loading)})})},la=n.memo(Rn),Dn="hanui-button-SRu4R",Sn="hanui-button__icon-giom6",Ln="hanui-button__spinner-vexVG",An="hanui-button__label-qiMHm",$e={button:Dn,button__icon:Sn,button__spinner:Ln,button__label:An,"button--full":"hanui-button--full-CwPHR","button--loading":"hanui-button--loading-O-naJ","button--small":"hanui-button--small-TF9Hz","button--medium":"hanui-button--medium-JDjkH","button--large":"hanui-button--large-btadu","button--primary":"hanui-button--primary-ym7RJ","button--cart":"hanui-button--cart-5DVmR","button--secondary":"hanui-button--secondary-56m1d","button--outline":"hanui-button--outline-ZI8sw","button--dark":"hanui-button--dark-FGZgn","button--light":"hanui-button--light-YzEPs","button--ghost":"hanui-button--ghost-rijnZ","button--danger":"hanui-button--danger-TNGd2"},Fn=n.forwardRef(({variant:e=ke.PRIMARY,size:a=ze.MEDIUM,isLoading:s,isFullWidth:r,startIcon:i,endIcon:c,className:o,children:_,disabled:h,href:d,isExternal:l,linkProps:p,testId:u,...b},g)=>{const k=v($e.button,$e[`button--${e.toLowerCase()}`],$e[`button--${a.toLowerCase()}`],r&&$e["button--full"],s&&$e["button--loading"],o),m=t.jsxs(t.Fragment,{children:[s&&t.jsx(la,{size:"sm",className:$e.button__spinner,label:""}),!s&&i&&t.jsx("span",{className:$e.button__icon,children:i}),t.jsx("span",{className:$e.button__label,children:_}),c&&t.jsx("span",{className:$e.button__icon,children:c})]}),f=!!h||!!s,N={"aria-busy":s,"aria-disabled":f||void 0,tabIndex:f?-1:b.tabIndex,onClick:j=>{var x;if(f){j.preventDefault();return}(x=b.onClick)==null||x.call(b,j)}};return d&&l?t.jsx("a",{...b,...N,href:d,className:k,target:"_blank",rel:"noopener noreferrer","data-testid":u,children:m}):d?t.jsx(_e,{...b,...N,href:d,className:k,"data-testid":u,...p,children:m}):t.jsx("button",{ref:g,className:k,disabled:h||s,"aria-busy":s,"data-testid":u,...b,children:m})}),_t=n.memo(L(Fn,"Button")),Bn="hanui-iconButton-JdtwM",Qt={iconButton:Bn,"iconButton--sm":"hanui-iconButton--sm-wE6zE","iconButton--md":"hanui-iconButton--md-iTNNS","iconButton--ghost":"hanui-iconButton--ghost-w-8K3","iconButton--outline":"hanui-iconButton--outline-vEhcY","iconButton--solid":"hanui-iconButton--solid-NUszP","iconButton--cart":"hanui-iconButton--cart-nVsH-","iconButton--danger":"hanui-iconButton--danger-xKkEA"},Mn=n.forwardRef(({icon:e,label:a,variant:s="ghost",size:r="md",className:i,type:c="button",href:o,linkProps:_,testId:h,...d},l)=>{const p=v(Qt.iconButton,Qt[`iconButton--${s}`],Qt[`iconButton--${r}`],i),u=!!d.disabled;return o?t.jsx(_e,{...d,href:o,className:p,"aria-label":a,"aria-disabled":u||void 0,tabIndex:u?-1:d.tabIndex,onClick:b=>{var g;if(u){b.preventDefault();return}(g=d.onClick)==null||g.call(d,b)},"data-testid":h,..._,children:e}):t.jsx("button",{ref:l,type:c,className:p,"aria-label":a,"data-testid":h,...d,children:e})}),je=n.memo(L(Mn,"IconButton")),Pn="hanui-link-WBmXY",On="hanui-link__label--OEu-",Hn="hanui-link__arrow-JKXm-",ft={link:Pn,link__label:On,link__arrow:Hn,"link--sm":"hanui-link--sm-a-3Dz","link--md":"hanui-link--md-lZdYP","link--brand":"hanui-link--brand-vr8sW","link--muted":"hanui-link--muted-EeN6l"},zn=({href:e,children:a,hasArrow:s,tone:r="brand",size:i="md",className:c,linkProps:o,..._})=>t.jsxs(_e,{href:e,className:v(ft.link,ft[`link--${r}`],ft[`link--${i}`],c),...o,..._,children:[t.jsx("span",{className:ft.link__label,children:a}),s&&t.jsx(D.ArrowRight,{"aria-hidden":!0,className:ft.link__arrow})]}),Kn=n.memo(zn),Un=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),qn=e=>{if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const a=e.getAttribute("contenteditable");if(a===""||a==="true"||a==="plaintext-only")return!0;const s=e.tagName;return s==="TEXTAREA"?!0:s!=="INPUT"?!1:!Un.has(e.type)},da=e=>{const a=e.ownerDocument.activeElement;!e.contains(a)||!qn(a)||(a.blur(),e.tabIndex=-1,e.focus({preventScroll:!0}))},pt=()=>{const e=typeof document>"u"?null:document.activeElement;return()=>{e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:!0})}},Yn=["a[href]","button:not(:disabled)","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"])'].map(e=>`${e}:not([inert]):not([aria-hidden="true"])`).join(", "),Ut=(e,a="[data-hanui-close]")=>{const s=e.querySelector("[data-hanui-autofocus]");if(s){s.focus({preventScroll:!0});return}const r=[...e.querySelectorAll(Yn)],i=r.find(c=>!c.matches(a))??r[0];if(i){i.focus({preventScroll:!0});return}e.tabIndex=-1,e.focus({preventScroll:!0})},Pt=[],Tt=()=>{const e=Symbol("hanui-modal");return Pt.push(e),{token:e,pop:()=>{const a=Pt.indexOf(e);a>=0&&Pt.splice(a,1)}}},Rt=e=>Pt.at(-1)===e,ua=(e,a)=>{n.useEffect(()=>{if(!e)return;const{token:s,pop:r}=Tt(),i=c=>{c.key==="Escape"&&Rt(s)&&a()};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),r()}},[e,a])},_a=e=>{var s;const a=((s=e==null?void 0:e.closest)==null?void 0:s.call(e,"dialog"))??null;return a&&a.isConnected?{container:a,needsTopLayer:Xn(a)}:{container:document.body,needsTopLayer:!1}},Xn=e=>{try{return e.matches(":modal")}catch{return e.hasAttribute("open")}},ha={margin:0,right:"auto",bottom:"auto"},pa=e=>{if(!e||typeof e.showPopover!="function")return()=>{};try{e.showPopover()}catch{return()=>{}}return()=>{try{e.isConnected&&e.hidePopover()}catch{}}},Wn="hanui-tooltip-RG1g1",Gn="hanui-tooltip__trigger-nWZtO",Qn="hanui-bubble-bcBNk",Lt={tooltip:Wn,tooltip__trigger:Gn,bubble:Qn,"bubble--top":"hanui-bubble--top-uWSZy","bubble--bottom":"hanui-bubble--bottom-jKokL","bubble--left":"hanui-bubble--left-WK4EM","bubble--right":"hanui-bubble--right-EQjUT"},Vn=120,Jn=500,Zn=300,es=({content:e,children:a,side:s,position:r,openDelay:i=Zn,className:c})=>{const[o,_]=n.useState(!1),h=n.useId(),d=s??r??"top",l=n.useRef(null),p=n.useRef(null),u=n.useRef(0),b=n.useRef(0),g=n.useMemo(()=>{if(!n.isValidElement(a))return!1;const T=a.type,y=a.props;return y.tabIndex!==void 0?!0:y.disabled===!0||typeof T!="string"?!1:T==="a"?y.href!==void 0:["button","input","select","textarea"].includes(T)},[a]),[k,m]=n.useState(!1);n.useEffect(()=>{const T=l.current;T&&m(!!T.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))},[a]);const f=g||k,N=ht(l,p,{side:d,align:"center",isOpen:o}),j=o&&U.isClient()?_a(l.current):null;n.useEffect(()=>{if(!(!o||!(j!=null&&j.needsTopLayer)))return pa(p.current)},[o,j==null?void 0:j.needsTopLayer]);const x=n.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=0},[]),E=n.useCallback(T=>{x(),u.current=window.setTimeout(()=>_(!0),T)},[x]),R=n.useCallback((T=Vn)=>{x(),u.current=window.setTimeout(()=>_(!1),T)},[x]);n.useEffect(()=>x,[x]),n.useEffect(()=>()=>{b.current&&window.clearTimeout(b.current)},[]);const I=n.useCallback(()=>R(0),[R]);ua(o,I),n.useEffect(()=>{if(!o)return;const T=y=>{var $;y.pointerType!=="mouse"&&(($=l.current)!=null&&$.contains(y.target)||R(0))};return document.addEventListener("pointerdown",T),()=>document.removeEventListener("pointerdown",T)},[o,R]);const w=()=>{b.current&&window.clearTimeout(b.current),b.current=0},C=T=>{T.pointerType!=="mouse"&&(b.current=window.setTimeout(()=>_(!0),Jn))};return t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:l,className:v(Lt.tooltip,c),tabIndex:f?void 0:0,onPointerEnter:T=>T.pointerType==="mouse"&&E(i),onPointerLeave:T=>{w(),T.pointerType==="mouse"&&R()},onPointerDown:C,onPointerUp:w,onPointerCancel:w,onFocus:()=>E(0),onBlur:()=>R(0),onContextMenu:T=>{(o||b.current)&&T.preventDefault()},children:t.jsx("span",{"aria-describedby":o?h:void 0,className:Lt.tooltip__trigger,children:a})}),o&&j&&It.createPortal(t.jsx("span",{ref:p,...j.needsTopLayer?{popover:"manual"}:{},id:h,role:"tooltip",className:v(Lt.bubble,Lt[`bubble--${N.side}`]),style:{...N.style,...j.needsTopLayer?ha:{},visibility:N.isPositioned?"visible":"hidden"},children:e}),j.container)]})},ts=n.memo(L(es,"Tooltip")),as="hanui-menu-1x-FU",ns="hanui-menu__item-d1iil",ss="hanui-menu__icon-kzLV2",xt={menu:as,"menu--top":"hanui-menu--top-gpo39","menu--bottom":"hanui-menu--bottom-6sL7b","menu--left":"hanui-menu--left-4w-O8","menu--right":"hanui-menu--right-XmM8G",menu__item:ns,"menu__item--danger":"hanui-menu__item--danger-lIINY",menu__icon:ss},rs=e=>e.map((a,s)=>a.isDisabled?-1:s).filter(a=>a>=0),os=({trigger:e,items:a,label:s,side:r="bottom",align:i="start",className:c,testId:o})=>{const _=n.useId(),h=n.useRef(null),d=n.useRef(null),l=n.useRef(null),p=n.useRef({text:"",at:0}),[u,b]=n.useState(!1),[g,k]=n.useState(0),m=ht(h,d,{side:r,align:i,isOpen:u}),f=rs(a),N=u&&U.isClient()?_a(h.current):null;n.useEffect(()=>{if(!(!u||!(N!=null&&N.needsTopLayer)))return pa(d.current)},[u,N==null?void 0:N.needsTopLayer]);const j=n.useCallback(y=>{f.length!==0&&(l.current=pt(),k(y==="first"?f[0]:f[f.length-1]),b(!0))},[f]),x=n.useCallback(()=>{var y;b(!1),(y=l.current)==null||y.call(l),l.current=null},[]);n.useEffect(()=>()=>{var y;(y=l.current)==null||y.call(l),l.current=null},[]),n.useEffect(()=>{var y,$;u&&(($=(y=d.current)==null?void 0:y.querySelector(`[data-index="${g}"]`))==null||$.focus({preventScroll:!0}))},[u,g]),n.useEffect(()=>{if(!u)return;const y=$=>{var q,Y;const M=$.target;(q=d.current)!=null&&q.contains(M)||(Y=h.current)!=null&&Y.contains(M)||x()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[u,x]);const E=y=>{const M=(f.indexOf(g)+y+f.length)%f.length;k(f[M])},R=y=>{const $=Date.now(),M=$-p.current.at>500?y:p.current.text+y;p.current={text:M,at:$};const q=f.find(Y=>a[Y].label.toLocaleLowerCase("tr").startsWith(M.toLocaleLowerCase("tr")));q!==void 0&&k(q)},I=y=>{switch(y.key){case"ArrowDown":y.preventDefault(),E(1);break;case"ArrowUp":y.preventDefault(),E(-1);break;case"Home":y.preventDefault(),k(f[0]);break;case"End":y.preventDefault(),k(f[f.length-1]);break;case"Escape":y.preventDefault(),x();break;case"Tab":x();break;default:y.key.length===1&&!y.metaKey&&!y.ctrlKey&&R(y.key)}},w=y=>{if(y.key==="ArrowUp"){y.preventDefault(),j("last");return}["ArrowDown","Enter"," "].includes(y.key)&&(y.preventDefault(),j("first"))};if(!n.isValidElement(e))return null;const C=e.props,T=n.cloneElement(e,{ref:h,"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?_:void 0,onClick:y=>{var $;($=C.onClick)==null||$.call(C,y),u?x():j("first")},onKeyDown:y=>{var $;($=C.onKeyDown)==null||$.call(C,y),u||w(y)}});return t.jsxs(t.Fragment,{children:[T,u&&N&&It.createPortal(t.jsx("div",{ref:d,id:_,role:"menu","aria-label":s,...N.needsTopLayer?{popover:"manual"}:{},className:v(xt.menu,xt[`menu--${m.side}`],c),style:{...m.style,...N.needsTopLayer?ha:{},visibility:m.isPositioned?"visible":"hidden"},"data-testid":o,onKeyDown:I,children:a.map((y,$)=>t.jsxs("button",{type:"button",role:"menuitem","data-index":$,tabIndex:$===g?0:-1,disabled:y.isDisabled,className:v(xt.menu__item,y.isDanger&&xt["menu__item--danger"]),onClick:()=>{y.onSelect(),x()},children:[y.icon&&t.jsx("span",{className:xt.menu__icon,"aria-hidden":!0,children:y.icon}),y.label]},y.id))}),N.container)]})},is=n.memo(L(os,"Menu")),cs="hanui-popover-VxgiK",Ta={popover:cs,"popover--top":"hanui-popover--top-OUYwo","popover--bottom":"hanui-popover--bottom-Q1K4X","popover--left":"hanui-popover--left-9Rsjx","popover--right":"hanui-popover--right-0TJeo"},ls=({trigger:e,children:a,label:s,side:r="bottom",align:i="start",isOpen:c,onOpenChange:o,className:_,testId:h})=>{const d=n.useId(),l=n.useRef(null),p=n.useRef(null),u=n.useRef(null),[b,g]=n.useState(!1),k=c!==void 0,m=k?c:b,f=ht(l,p,{side:r,align:i,isOpen:m}),N=m&&U.isClient()?_a(l.current):null;n.useEffect(()=>{if(!(!m||!(N!=null&&N.needsTopLayer)))return pa(p.current)},[m,N==null?void 0:N.needsTopLayer]);const j=n.useCallback(I=>{k||g(I),o==null||o(I)},[k,o]);n.useEffect(()=>{if(!m)return;u.current=pt();const I=p.current;return I&&Ut(I),()=>{var w;(w=u.current)==null||w.call(u),u.current=null}},[m]);const x=n.useCallback(()=>j(!1),[j]);if(ua(m,x),n.useEffect(()=>{if(!m)return;const I=w=>{var T,y;const C=w.target;(T=p.current)!=null&&T.contains(C)||(y=l.current)!=null&&y.contains(C)||j(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[m,j]),!n.isValidElement(e))return null;const E=e.props,R=n.cloneElement(e,{ref:l,"aria-expanded":m,"aria-haspopup":"dialog","aria-controls":m?d:void 0,onClick:I=>{var w;(w=E.onClick)==null||w.call(E,I),j(!m)}});return t.jsxs(t.Fragment,{children:[R,m&&N&&It.createPortal(t.jsx("div",{ref:p,id:d,...N.needsTopLayer?{popover:"manual"}:{},role:"dialog","aria-label":s,className:v(Ta.popover,Ta[`popover--${f.side}`],_),style:{...f.style,...N.needsTopLayer?ha:{},visibility:f.isPositioned?"visible":"hidden"},"data-testid":h,onBlur:I=>{var C;const w=I.relatedTarget;w&&(I.currentTarget.contains(w)||(C=l.current)!=null&&C.contains(w)||w.closest('[role="listbox"],[role="menu"],[role="dialog"]')||j(!1))},children:a}),N.container)]})},ds=n.memo(L(ls,"Popover")),us="hanui-chip--NLgU",_s="hanui-chip__icon-IjjSb",hs="hanui-chip__label-cT4hw",ps="hanui-chip__count-MBGO3",Le={chip:us,chip__icon:_s,chip__label:hs,chip__count:ps,"chip--sm":"hanui-chip--sm-60H-S","chip--md":"hanui-chip--md--yAlm","chip--iconOnly":"hanui-chip--iconOnly-5LT1h","chip--selected":"hanui-chip--selected-FdpCr"},ms=n.forwardRef(({children:e,icon:a,endIcon:s,count:r,isSelected:i,size:c="md",label:o,href:_,linkProps:h,className:d,type:l="button",role:p,testId:u,...b},g)=>{const k=v(Le.chip,Le[`chip--${c}`],i&&Le["chip--selected"],!e&&Le["chip--iconOnly"],d),m=t.jsxs(t.Fragment,{children:[a&&t.jsx("span",{className:Le.chip__icon,"aria-hidden":!0,children:a}),e&&t.jsx("span",{className:Le.chip__label,children:e}),U.isDefined(r)&&t.jsx("span",{className:Le.chip__count,children:r}),s&&t.jsx("span",{className:Le.chip__icon,"aria-hidden":!0,children:s})]});return _?t.jsx(_e,{href:_,className:k,"aria-label":e?void 0:o,"aria-current":i?"page":void 0,"data-testid":u,...h,children:m}):t.jsx("button",{ref:g,type:l,role:p,className:k,"aria-label":e?void 0:o,"data-testid":u,...p==="radio"?{"aria-checked":!!i}:{"aria-pressed":!!i},...b,children:m})}),Xa=n.memo(L(ms,"Chip")),bs="hanui-group-0tnVf",Ra={group:bs,"group--scrollable":"hanui-group--scrollable-PMu6V"},gs=({options:e,label:a,size:s="md",isScrollable:r,className:i,...c})=>{var p;const o=n.useRef(null),_=u=>c.isMultiple?c.value.includes(u):c.value===u,h=u=>{if(c.isMultiple){const b=c.value.includes(u)?c.value.filter(g=>g!==u):[...c.value,u];c.onChange(b);return}c.onChange(c.value===u?null:u)},d=u=>{var f,N;if(c.isMultiple)return;const b=u.key==="ArrowRight"||u.key==="ArrowDown"?1:u.key==="ArrowLeft"||u.key==="ArrowUp"?-1:0;if(b===0)return;u.preventDefault();const g=e.filter(j=>!j.isDisabled);if(g.length===0)return;const k=g.findIndex(j=>j.value===c.value),m=g[(k+b+g.length)%g.length];c.onChange(m.value),(N=(f=o.current)==null?void 0:f.querySelector(`[data-chip-value="${m.value}"]`))==null||N.focus()},l=c.isMultiple?null:c.value??((p=e.find(u=>!u.isDisabled))==null?void 0:p.value)??null;return t.jsx("div",{ref:o,className:v(Ra.group,r&&Ra["group--scrollable"],i),role:c.isMultiple?"group":"radiogroup","aria-label":a,onKeyDown:d,children:e.map(u=>t.jsx(Xa,{size:s,icon:u.icon,count:u.count,isSelected:_(u.value),disabled:u.isDisabled,role:c.isMultiple?void 0:"radio",tabIndex:c.isMultiple||u.value===l?0:-1,"data-chip-value":u.value,onClick:()=>h(u.value),children:u.label},u.value))})},fs=n.memo(gs),xs=(e,a,s,r)=>{const i=n.useRef(s);i.current=s,n.useEffect(()=>{if(!a||!i.current)return;const c=window.setTimeout(()=>{var o;return(o=i.current)==null?void 0:o.call(i,e.trim())},r);return()=>window.clearTimeout(c)},[e,a,r])};let $t=0,Re=null;const vs=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgent;return/iP(hone|ad|od)/.test(e)?!0:/Macintosh/.test(e)&&navigator.maxTouchPoints>1},ys=()=>{if($t+=1,$t>1)return;const{body:e,style:a}={body:document.body,style:document.documentElement.style},s=window.scrollY;Re={overflow:e.style.overflow,position:e.style.position,top:e.style.top,width:e.style.width,paddingRight:e.style.paddingRight,scrollY:s};const r=window.innerWidth-document.documentElement.clientWidth;r>0&&(e.style.paddingRight=`${r}px`),a.setProperty("scrollbar-gutter","stable"),e.style.overflow="hidden",vs()&&(e.style.position="fixed",e.style.top=`${-s}px`,e.style.width="100%")},ws=()=>{if($t=Math.max(0,$t-1),$t>0||!Re)return;const{body:e}=document,{scrollY:a}=Re;e.style.overflow=Re.overflow,e.style.position=Re.position,e.style.top=Re.top,e.style.width=Re.width,e.style.paddingRight=Re.paddingRight,document.documentElement.style.removeProperty("scrollbar-gutter"),Re=null,window.scrollTo(0,a)},qt=(e=!0)=>{n.useEffect(()=>{if(e)return ys(),ws},[e])},Wa="--hanui-sheet-height",Ga="--hanui-sheet-inset-bottom";let At=0,ut=0;const ks=240,Qa=()=>{const e=window.visualViewport;if(!e||e.height<ks)return;const a=window.innerHeight-e.height-e.offsetTop,s=document.documentElement;s.style.setProperty(Ga,`${Math.max(0,Math.round(a))}px`),s.style.setProperty(Wa,`${Math.round(e.height)}px`)},at=()=>{ut||(ut=window.requestAnimationFrame(()=>{ut=0,Qa()}))},Da=()=>{ut&&(window.cancelAnimationFrame(ut),ut=0)},Va=(e=!0)=>{n.useEffect(()=>{if(!e)return;const a=window.visualViewport;if(a)return At+=1,At===1&&(a.addEventListener("resize",at),a.addEventListener("scroll",at),window.addEventListener("orientationchange",at)),Da(),Qa(),()=>{At-=1,!(At>0)&&(a.removeEventListener("resize",at),a.removeEventListener("scroll",at),window.removeEventListener("orientationchange",at),Da(),document.documentElement.style.removeProperty(Ga),document.documentElement.style.removeProperty(Wa))}},[e])},js="hanui-sheet-GEvdE",Ns="hanui-sheet__header-NJgw-",$s="hanui-sheet__title-f-b07",Es="hanui-sheet__toolbar-eyhmW",Cs="hanui-sheet__body-eJ2KB",Is="hanui-sheet__footer-NpsY5",Ue={sheet:js,sheet__header:Ns,sheet__title:$s,sheet__toolbar:Es,sheet__body:Cs,sheet__footer:Is},Ts=({title:e,closeLabel:a,onClose:s,children:r,toolbar:i,footer:c,closeAbove:o=Kt,className:_,testId:h})=>{const{labels:d}=O(),l=n.useId(),p=n.useRef(null);Va(),qt(),n.useEffect(()=>{const g=pt(),{token:k,pop:m}=Tt();return p.current=k,()=>{m(),p.current=null,g()}},[]),n.useEffect(()=>{const g=window.matchMedia(o),k=m=>{m.matches&&s()};return g.addEventListener("change",k),()=>g.removeEventListener("change",k)},[o,s]);const u=n.useCallback(g=>{!g||g.open||(g.showModal(),Ut(g,`.${Ue.sheet__header} button`),da(g))},[]),b=n.useCallback(g=>{g.target===g.currentTarget&&s()},[s]);return U.isClient()?It.createPortal(t.jsxs("dialog",{ref:u,className:v(Ue.sheet,_),"aria-labelledby":l,"data-testid":h,onCancel:g=>{g.preventDefault(),!(p.current&&!Rt(p.current))&&s()},onClick:b,children:[t.jsxs("header",{className:Ue.sheet__header,children:[t.jsx("h2",{id:l,className:Ue.sheet__title,children:e}),t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:P("BottomSheet.closeLabel",a,d==null?void 0:d.close),variant:"ghost",size:"sm",onClick:s})]}),i&&t.jsx("div",{className:Ue.sheet__toolbar,children:i}),t.jsx("div",{className:Ue.sheet__body,children:r}),c&&t.jsx("div",{className:Ue.sheet__footer,children:c})]}),document.body):null},ma=n.memo(Ts),Rs=80,Sa=40,Ds=300,Ss="hanui-combobox-NtZoV",Ls="hanui-combobox__trigger-2riRR",As="hanui-combobox__leadingIcon-it2xz",Fs="hanui-combobox__value-acDlr",Bs="hanui-combobox__clear-EXOsc",Ms="hanui-combobox__chevron-g-QzQ",Ps="hanui-combobox__panel-srBxl",Os="hanui-combobox__search-THjer",Hs="hanui-combobox__searchIcon-vr4Bg",zs="hanui-combobox__searchInput-JPp5h",Ks="hanui-combobox__list-p-eCs",Us="hanui-combobox__option-CLWh-",qs="hanui-combobox__optionText-Zm0D6",Ys="hanui-combobox__optionLabel-WvT4W",Xs="hanui-combobox__optionDescription-8OEzi",Ws="hanui-combobox__check-MKlLz",Gs="hanui-combobox__empty-mZwBq",Qs="hanui-combobox__srName-9PNXF",K={combobox:Ss,combobox__trigger:Ls,"combobox__trigger--empty":"hanui-combobox__trigger--empty-RxwCq","combobox__trigger--open":"hanui-combobox__trigger--open-rw1ZS","combobox__trigger--invalid":"hanui-combobox__trigger--invalid-iZgiN","combobox__trigger--clearable":"hanui-combobox__trigger--clearable-shq9I",combobox__leadingIcon:As,combobox__value:Fs,combobox__clear:Bs,combobox__chevron:Ms,"combobox__chevron--open":"hanui-combobox__chevron--open-9kj1j",combobox__panel:Ps,combobox__search:Os,combobox__searchIcon:Hs,combobox__searchInput:zs,combobox__list:Ks,"combobox__list--sheet":"hanui-combobox__list--sheet-r3MzB",combobox__option:Us,"combobox__option--active":"hanui-combobox__option--active--75Vq","combobox__option--selected":"hanui-combobox__option--selected-DVFGy","combobox__option--disabled":"hanui-combobox__option--disabled-e6VjI",combobox__optionText:qs,combobox__optionLabel:Ys,combobox__optionDescription:Xs,combobox__check:Ws,combobox__empty:Gs,combobox__srName:Qs},Vs=({options:e,value:a,onChange:s,labels:r,isSearchHidden:i,onSearch:c,isLoading:o,isDisabled:_,isClearable:h,icon:d,id:l,required:p,className:u,testId:b,"aria-describedby":g,"aria-invalid":k})=>{var wa;const{labels:m}=O(),f={get search(){var A;return P("Combobox.searchPlaceholder",r.searchPlaceholder,(A=m==null?void 0:m.combobox)==null?void 0:A.searchPlaceholder)},get empty(){var A;return P("Combobox.emptyMessage",r.emptyMessage,(A=m==null?void 0:m.combobox)==null?void 0:A.emptyMessage)},get loading(){var A;return P("Combobox.loadingMessage",r.loadingMessage,(A=m==null?void 0:m.combobox)==null?void 0:A.loadingMessage)},get clear(){var A;return P("Combobox.clearLabel",r.clearLabel,(A=m==null?void 0:m.combobox)==null?void 0:A.clearLabel)}},N=n.useId(),j=l??N,x=`${j}-listbox`,E=n.useRef(null),R=n.useRef(null),I=n.useRef(null),w=n.useRef(null),[C,T]=n.useState(null),y=C!==null,[$,M]=n.useState(""),[q,Y]=n.useState(null),G=n.useMemo(()=>{if(c||$.trim()==="")return e;const A=$.trim();return e.filter(xe=>Ct(xe.label,A)||(xe.description?Ct(xe.description,A):!1))},[e,$,c]),Q=e.find(A=>A.value===a)??null;n.useEffect(()=>{Q?Y(Q.label):a===null&&Y(null)},[Q,a]);const he=(Q==null?void 0:Q.label)??q;xs($,y,c,Ds);const ce=n.useCallback(()=>{T(null),M("")},[]),Dt=n.useCallback(()=>{_||(T(window.matchMedia(Kt).matches?"popover":"sheet"),M(""))},[_]);n.useEffect(()=>{if(C!=="popover")return;const A=xe=>{var me;(me=E.current)!=null&&me.contains(xe.target)||ce()};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[C,ce]),n.useEffect(()=>{var A;C==="popover"&&((A=w.current)==null||A.focus({preventScroll:!0}))},[C]);const tt=A=>{A.isDisabled||(Y(A.label),s(A.value),ce())},St=n.useRef(!1);n.useEffect(()=>{var A;St.current&&!y&&((A=R.current)==null||A.focus()),St.current=y},[y]);const mt=ht(R,I,{side:"bottom",align:"start",isOpen:y&&C==="popover"}),{activeIndex:Se,setActiveIndex:bt,listRef:H,handleKeyDown:Z}=ca({count:G.length,isOpen:y,initialIndex:Math.max(e.findIndex(A=>A.value===a),0),onSelect:A=>{const xe=G[A];xe&&tt(xe)},onClose:ce}),Ne=G.some(A=>!!A.description),pe=C==="popover"&&!Ne&&G.length>Rs,{scrollRef:sn,range:Ke,scrollToIndex:xa}=Ua(G.length,{rowHeight:Sa,isEnabled:pe});n.useEffect(()=>{pe&&xa(Se)},[Se,pe,xa]);const rn=A=>{H.current=A,sn.current=A},on=Z,cn=A=>{if(i){if(!y){["ArrowDown","ArrowUp","Enter"," "].includes(A.key)&&(A.preventDefault(),Dt());return}Z(A)}},ln=()=>{s(null),Y(null)},va=i?null:t.jsxs("div",{className:K.combobox__search,children:[t.jsx(D.Search,{"aria-hidden":!0,className:K.combobox__searchIcon}),t.jsx("input",{ref:w,type:"text",role:"combobox",className:K.combobox__searchInput,value:$,placeholder:f.search,autoComplete:"off","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":x,"aria-activedescendant":G[Se]?`${j}-option-${Se}`:void 0,"aria-label":f.search,onChange:A=>{M(A.target.value),bt(0)},onKeyDown:on}),o&&t.jsx(la,{size:"sm",label:""})]}),ya=A=>{const xe=G.slice(Ke.start,Ke.end);return t.jsxs("ul",{ref:rn,id:x,role:"listbox",className:v(K.combobox__list,A&&K["combobox__list--sheet"]),children:[pe&&Ke.offset>0&&t.jsx("li",{"aria-hidden":!0,style:{height:Ke.offset}}),xe.map((me,dn)=>{const gt=Ke.start+dn,un=gt===Se,Yt=me.value===a;return t.jsxs("li",{id:`${j}-option-${gt}`,role:"option","data-index":gt,"aria-setsize":pe?G.length:void 0,"aria-posinset":pe?gt+1:void 0,"aria-selected":Yt,"aria-disabled":me.isDisabled,className:v(K.combobox__option,un&&K["combobox__option--active"],Yt&&K["combobox__option--selected"],me.isDisabled&&K["combobox__option--disabled"]),onMouseEnter:()=>bt(gt),onClick:()=>tt(me),children:[t.jsxs("span",{className:K.combobox__optionText,children:[t.jsx("span",{className:K.combobox__optionLabel,children:me.label}),me.description&&t.jsx("span",{className:K.combobox__optionDescription,children:me.description})]}),Yt&&t.jsx(D.CheckLg,{"aria-hidden":!0,className:K.combobox__check})]},me.value)}),pe&&Ke.end<G.length&&t.jsx("li",{"aria-hidden":!0,style:{height:(G.length-Ke.end)*Sa}}),G.length===0&&t.jsx("li",{className:K.combobox__empty,children:o?f.loading:f.empty})]})};return t.jsxs("div",{ref:E,className:v(K.combobox,u),"data-testid":b,children:[t.jsxs("button",{ref:R,id:j,type:"button",className:v(K.combobox__trigger,!he&&K["combobox__trigger--empty"],y&&K["combobox__trigger--open"],k&&K["combobox__trigger--invalid"],h&&he&&!_&&K["combobox__trigger--clearable"]),disabled:_,"aria-haspopup":"listbox","aria-expanded":y,"aria-controls":y?x:void 0,"aria-labelledby":he?`${j}-name ${j}-value`:`${j}-name`,"aria-describedby":g,"aria-required":p||void 0,onClick:()=>y?ce():Dt(),onKeyDown:cn,children:[d&&t.jsx("span",{className:K.combobox__leadingIcon,"aria-hidden":!0,children:d}),t.jsx("span",{id:`${j}-name`,className:K.combobox__srName,children:r.placeholder}),t.jsx("span",{id:`${j}-value`,className:K.combobox__value,children:he??r.placeholder}),t.jsx(D.CaretDownFill,{"aria-hidden":!0,className:v(K.combobox__chevron,y&&K["combobox__chevron--open"])})]}),h&&he&&!_&&t.jsx("button",{type:"button",className:K.combobox__clear,"aria-label":f.clear,onClick:ln,children:t.jsx(D.XLg,{"aria-hidden":!0})}),C==="popover"&&t.jsxs("div",{ref:I,className:K.combobox__panel,style:{...mt.style,width:(wa=R.current)==null?void 0:wa.offsetWidth,visibility:mt.isPositioned?void 0:"hidden"},children:[va,ya(!1)]}),C==="sheet"&&t.jsx(ma,{title:r.placeholder,closeLabel:r.closeLabel??(m==null?void 0:m.close),onClose:ce,toolbar:va??void 0,children:ya(!0)})]})},Js=n.memo(Vs),Zs="hanui-segmented-qo2Bw",er="hanui-segmented__item-mqRNZ",tr="hanui-segmented__icon-C9CT-",ar="hanui-segmented__label-NVXBv",nt={segmented:Zs,"segmented--sm":"hanui-segmented--sm-7tUry","segmented--md":"hanui-segmented--md-PiSqt",segmented__item:er,"segmented__item--selected":"hanui-segmented__item--selected-r7CLj",segmented__icon:tr,segmented__label:ar},nr=({options:e,value:a,onChange:s,label:r,isIconOnly:i,size:c="md",className:o,testId:_})=>{const h=n.useRef(null),d=l=>{var k,m;const p=l.key==="ArrowRight"||l.key==="ArrowDown"?1:l.key==="ArrowLeft"||l.key==="ArrowUp"?-1:0;if(p===0)return;l.preventDefault();const u=e.filter(f=>!f.isDisabled);if(u.length===0)return;const b=u.findIndex(f=>f.value===a),g=u[(b+p+u.length)%u.length];s(g.value),(m=(k=h.current)==null?void 0:k.querySelector(`[data-value="${g.value}"]`))==null||m.focus({preventScroll:!0})};return t.jsx("div",{ref:h,role:"radiogroup","aria-label":r,className:v(nt.segmented,nt[`segmented--${c}`],o),"data-testid":_,onKeyDown:d,children:e.map(l=>{const p=l.value===a;return t.jsxs("button",{type:"button",role:"radio","aria-checked":p,"aria-label":i?l.label:void 0,"data-value":l.value,disabled:l.isDisabled,tabIndex:p?0:-1,className:v(nt.segmented__item,p&&nt["segmented__item--selected"]),onClick:()=>!p&&s(l.value),children:[l.icon&&t.jsx("span",{className:nt.segmented__icon,"aria-hidden":!0,children:l.icon}),!i&&t.jsx("span",{className:nt.segmented__label,children:l.label})]},l.value)})})},sr=n.memo(L(nr,"SegmentedControl")),rr="hanui-select-tiiPL",or="hanui-trigger-rHQJz",ir="hanui-trigger__icon-apCcx",cr="hanui-trigger__srName-XLCxt",lr="hanui-trigger__value-ioH7K",dr="hanui-trigger__chevron-FtsIZ",ur="hanui-panel-rGOOd",_r="hanui-list-SOKf8",hr="hanui-option-ZDPef",pr="hanui-option__label-SsoYB",mr="hanui-option__check-8CPSG",X={select:rr,trigger:or,"trigger--empty":"hanui-trigger--empty-cuinb","trigger--open":"hanui-trigger--open-1nsvu","trigger--invalid":"hanui-trigger--invalid-NtP0W","trigger--sm":"hanui-trigger--sm-Xnu1C",trigger__icon:ir,trigger__srName:cr,trigger__value:lr,trigger__chevron:dr,"trigger__chevron--open":"hanui-trigger__chevron--open-1P2P-",panel:ur,list:_r,"list--sheet":"hanui-list--sheet-BIjCb",option:hr,"option--active":"hanui-option--active-R4lLF","option--selected":"hanui-option--selected-glQMj","option--disabled":"hanui-option--disabled-h4rdd",option__label:pr,option__check:mr},br=({options:e,value:a,onChange:s,label:r,placeholder:i,closeLabel:c,icon:o,size:_="md",align:h="start",isDisabled:d,id:l,className:p,testId:u,required:b,"aria-describedby":g,"aria-invalid":k})=>{var bt;const{labels:m}=O(),f=P("Select.placeholder",i,m==null?void 0:m.selectPlaceholder),N=n.useId(),j=l??N,x=`${j}-listbox`,E=H=>`${j}-option-${H}`,R=n.useRef(null),I=n.useRef(null),w=n.useRef(null),[C,T]=n.useState(null),y=ht(I,w,{side:"bottom",align:h,isOpen:C==="popover"}),$=C!==null,M=e.findIndex(H=>H.value===a),q=M>=0?e[M]:null,Y=n.useCallback(()=>T(null),[]),G=n.useCallback(()=>{d||e.length===0||T(window.matchMedia(Kt).matches?"popover":"sheet")},[d,e.length]),Q=H=>{H.isDisabled||(s(H.value),Y())},he=n.useRef(!1);n.useEffect(()=>{var H;he.current&&!$&&((H=I.current)==null||H.focus()),he.current=$},[$]),n.useEffect(()=>{if(C!=="popover")return;const H=Z=>{var Ne;(Ne=R.current)!=null&&Ne.contains(Z.target)||Y()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[C,Y]);const{activeIndex:ce,setActiveIndex:Dt,listRef:tt,handleKeyDown:St}=ca({count:e.length,isOpen:$,initialIndex:M>=0?M:0,onSelect:H=>{const Z=e[H];Z&&Q(Z)},onClose:Y});n.useEffect(()=>{var H;C==="sheet"&&((H=tt.current)==null||H.focus({preventScroll:!0}))},[C,tt]);const mt=H=>{if(!$){["ArrowDown","ArrowUp","Enter"," "].includes(H.key)&&(H.preventDefault(),G());return}St(H)},Se=H=>t.jsx("ul",{ref:tt,id:x,role:"listbox","aria-label":r,"aria-activedescendant":H&&e[ce]?E(ce):void 0,tabIndex:H?0:-1,className:v(X.list,H&&X["list--sheet"]),onKeyDown:H?mt:void 0,children:e.map((Z,Ne)=>{const pe=Z.value===a;return t.jsxs("li",{id:E(Ne),role:"option","data-index":Ne,"aria-selected":pe,"aria-disabled":Z.isDisabled,className:v(X.option,Ne===ce&&X["option--active"],pe&&X["option--selected"],Z.isDisabled&&X["option--disabled"]),onMouseEnter:()=>Dt(Ne),onClick:()=>Q(Z),children:[t.jsx("span",{className:X.option__label,children:Z.label}),pe&&t.jsx(D.CheckLg,{"aria-hidden":!0,className:X.option__check})]},Z.value)})});return t.jsxs("span",{ref:R,className:v(X.select,p),"data-testid":u,children:[t.jsxs("button",{ref:I,id:j,type:"button",role:"combobox",className:v(X.trigger,X[`trigger--${_}`],!q&&X["trigger--empty"],$&&X["trigger--open"],k&&X["trigger--invalid"]),disabled:d,"aria-haspopup":"listbox","aria-expanded":$,"aria-controls":$?x:void 0,"aria-activedescendant":C==="popover"&&e[ce]?E(ce):void 0,"aria-labelledby":q?`${j}-name ${j}-value`:`${j}-name`,"aria-describedby":g,"aria-invalid":k,"aria-required":b||void 0,onClick:()=>$?Y():G(),onKeyDown:mt,children:[o&&t.jsx("span",{className:X.trigger__icon,"aria-hidden":!0,children:o}),t.jsx("span",{id:`${j}-name`,className:X.trigger__srName,children:r}),t.jsx("span",{id:`${j}-value`,className:X.trigger__value,children:(q==null?void 0:q.label)??f}),t.jsx(D.CaretDownFill,{"aria-hidden":!0,className:v(X.trigger__chevron,$&&X["trigger__chevron--open"])})]}),C==="popover"&&t.jsx("div",{ref:w,className:X.panel,style:{...y.style,minWidth:(bt=I.current)==null?void 0:bt.offsetWidth,visibility:y.isPositioned?void 0:"hidden"},children:Se(!1)}),C==="sheet"&&t.jsx(ma,{title:r,closeLabel:c??(m==null?void 0:m.close),onClose:Y,children:Se(!0)})]})},gr=n.memo(br),fr="hanui-checkbox-FaFCj",xr="hanui-checkbox__input-nTHne",vr="hanui-checkbox__body-VAEW2",yr="hanui-checkbox__label-sSNZY",wr="hanui-checkbox__hint-ish-J",vt={checkbox:fr,checkbox__input:xr,checkbox__body:vr,checkbox__label:yr,checkbox__hint:wr},kr=n.forwardRef(({label:e,hint:a,className:s,id:r,testId:i,...c},o)=>{const _=n.useId(),h=r??_,d=`${h}-label`,l=`${h}-hint`;return t.jsxs("label",{className:v(vt.checkbox,s),"data-testid":i,children:[t.jsx("input",{ref:o,type:"checkbox",id:h,className:vt.checkbox__input,"aria-labelledby":d,"aria-describedby":a?l:c["aria-describedby"],...c}),t.jsxs("span",{className:vt.checkbox__body,children:[t.jsx("span",{id:d,className:vt.checkbox__label,children:e}),a&&t.jsx("span",{id:l,className:vt.checkbox__hint,children:a})]})]})}),jr=n.memo(L(kr,"Checkbox")),Nr="hanui-switch__input-Q2UQ4",$r="hanui-switch__label-gPZuO",Er="hanui-switch__hint-NRuzC",Cr="hanui-switch__track-3417m",Ir="hanui-switch__thumb-1LHta",Tr="hanui-switch__text-32uMY",Ae={switch:"hanui-switch-KLH29",switch__input:Nr,"switch--labelFirst":"hanui-switch--labelFirst-Grirk",switch__label:$r,switch__hint:Er,switch__track:Cr,switch__thumb:Ir,switch__text:Tr},Rr=n.forwardRef(({label:e,hint:a,isLabelFirst:s,className:r,id:i,testId:c,...o},_)=>{const h=n.useId(),d=i??h,l=`${d}-label`,p=`${d}-hint`;return t.jsxs("label",{className:v(Ae.switch,s&&Ae["switch--labelFirst"],r),"data-testid":c,children:[t.jsx("input",{ref:_,type:"checkbox",role:"switch",id:d,className:Ae.switch__input,"aria-labelledby":l,"aria-describedby":a?p:o["aria-describedby"],...o}),t.jsx("span",{className:Ae.switch__track,"aria-hidden":!0,children:t.jsx("span",{className:Ae.switch__thumb})}),t.jsxs("span",{className:Ae.switch__text,children:[t.jsx("span",{id:l,className:Ae.switch__label,children:e}),a&&t.jsx("span",{id:p,className:Ae.switch__hint,children:a})]})]})}),Dr=n.memo(L(Rr,"Switch")),Sr="hanui-radio-KoZak",Lr="hanui-radio__input-gVMgh",Ar="hanui-radio__body-oZWg6",Fr="hanui-radio__label-d-5ce",Br="hanui-radio__hint-baVbs",Mr="hanui-radio__count-OtkUM",st={radio:Sr,radio__input:Lr,radio__body:Ar,radio__label:Fr,radio__hint:Br,radio__count:Mr},Pr=n.forwardRef(({label:e,hint:a,count:s,className:r,id:i,testId:c,...o},_)=>{const h=n.useId(),d=i??h,l=`${d}-label`,p=`${d}-hint`,u=`${d}-count`;return t.jsxs("label",{className:v(st.radio,r),"data-testid":c,children:[t.jsx("input",{ref:_,type:"radio",id:d,className:st.radio__input,"aria-labelledby":[l,U.isDefined(s)?u:null].filter(Boolean).join(" "),"aria-describedby":a?p:o["aria-describedby"],...o}),t.jsxs("span",{className:st.radio__body,children:[t.jsx("span",{id:l,className:st.radio__label,children:e}),a&&t.jsx("span",{id:p,className:st.radio__hint,children:a})]}),U.isDefined(s)&&t.jsx("span",{id:u,className:st.radio__count,children:s})]})}),Or=n.memo(L(Pr,"Radio")),Hr="hanui-radioCard-sndiC",zr="hanui-radioCard__input-6vuoD",Kr="hanui-radioCard__indicator--x9LT",Ur="hanui-radioCard__body-CFqoi",rt={radioCard:Hr,radioCard__input:zr,"radioCard--selected":"hanui-radioCard--selected-Mi7ee",radioCard__indicator:Kr,"radioCard--disabled":"hanui-radioCard--disabled-YlYee",radioCard__body:Ur},qr=({name:e,value:a,isSelected:s,isDisabled:r,onChange:i,children:c,className:o,id:_,testId:h})=>t.jsxs("label",{className:v(rt.radioCard,s&&rt["radioCard--selected"],r&&rt["radioCard--disabled"],o),"data-testid":h,children:[t.jsx("input",{type:"radio",id:_,name:e,value:a,checked:s,disabled:r,onChange:()=>i(a),className:rt.radioCard__input}),t.jsx("span",{className:rt.radioCard__indicator,"aria-hidden":!0}),t.jsx("span",{className:rt.radioCard__body,children:c})]}),Yr=n.memo(qr),Xr="hanui-range-RpDPh",Wr="hanui-range__readout-itDMd",Gr="hanui-range__separator-u-ZJX",Qr="hanui-range__track-bCh5Y",Vr="hanui-range__fill-VXMCE",Jr="hanui-range__input-TAN2I",Zr="hanui-range__bounds-GIhFd",be={range:Xr,"range--disabled":"hanui-range--disabled-13hlc",range__readout:Wr,range__separator:Gr,range__track:Qr,range__fill:Vr,range__input:Jr,range__bounds:Zr},eo=({min:e,max:a,step:s=1,value:r,onChange:i,onCommit:c,formatValue:o=String,label:_,minLabel:h,maxLabel:d,isDisabled:l,className:p,testId:u})=>{var C,T;const{labels:b}=O(),g=P("RangeSlider.minLabel",h,(C=b==null?void 0:b.range)==null?void 0:C.min),k=P("RangeSlider.maxLabel",d,(T=b==null?void 0:b.range)==null?void 0:T.max),[m,f]=r,N=n.useCallback(y=>i([Math.min(y,f),f]),[f,i]),j=n.useCallback(y=>i([m,Math.max(y,m)]),[m,i]),x=n.useCallback(()=>c==null?void 0:c([m,f]),[m,f,c]),E=a-e,R=E===0?0:U.normalize(m-e,E),I=E===0?0:U.normalize(f-e,E),w=R>50;return t.jsxs("div",{className:v(be.range,l&&be["range--disabled"],p),role:"group","aria-label":_,"data-testid":u,children:[t.jsxs("div",{className:be.range__readout,children:[t.jsx("span",{className:be.range__value,children:o(m)}),t.jsx("span",{className:be.range__separator,"aria-hidden":!0,children:"—"}),t.jsx("span",{className:be.range__value,children:o(f)})]}),t.jsxs("div",{className:be.range__track,children:[t.jsx("span",{className:be.range__fill,style:{left:`${R}%`,right:`${100-I}%`},"aria-hidden":!0}),t.jsx("input",{type:"range",className:be.range__input,style:{zIndex:w?4:3},min:e,max:a,step:s,value:m,disabled:l,"aria-label":`${_} — ${g}`,"aria-valuetext":o(m),onChange:y=>N(Number(y.target.value)),onPointerUp:x,onKeyUp:x}),t.jsx("input",{type:"range",className:be.range__input,style:{zIndex:w?3:4},min:e,max:a,step:s,value:f,disabled:l,"aria-label":`${_} — ${k}`,"aria-valuetext":o(f),onChange:y=>j(Number(y.target.value)),onPointerUp:x,onKeyUp:x})]}),t.jsxs("div",{className:be.range__bounds,"aria-hidden":!0,children:[t.jsx("span",{children:o(e)}),t.jsx("span",{children:o(a)})]})]})},to=n.memo(eo),ao="hanui-rating-neNnF",no="hanui-rating__legend-uYvFS",so="hanui-rating__stars-vJFLk",ro="hanui-rating__star-BANFJ",oo="hanui-rating__input-s2iiO",io="hanui-rating__srOnly-iSCoz",co="hanui-rating__caption-13KFX",Ee={rating:ao,"rating--disabled":"hanui-rating--disabled-ZKjHa",rating__legend:no,rating__stars:so,rating__star:ro,"rating__star--filled":"hanui-rating__star--filled-L3AkT",rating__input:oo,rating__srOnly:io,rating__caption:co},lo=[1,2,3,4,5],uo=({value:e,onChange:a,label:s,ratingLabels:r,formatStarCount:i,isDisabled:c,className:o,testId:_})=>{var g;const{labels:h}=O(),d=r??((g=h==null?void 0:h.rating)==null?void 0:g.scale),l=n.useId(),[p,u]=n.useState(null),b=p??e;return t.jsxs("fieldset",{className:v(Ee.rating,c&&Ee["rating--disabled"],o),disabled:c,"data-testid":_,children:[t.jsx("legend",{className:Ee.rating__legend,children:s}),t.jsx("div",{className:Ee.rating__stars,onMouseLeave:()=>u(null),children:lo.map(k=>{var m;return t.jsxs("label",{className:v(Ee.rating__star,b!==null&&k<=b&&Ee["rating__star--filled"]),onMouseEnter:()=>u(k),children:[t.jsx("input",{type:"radio",name:l,value:k,checked:e===k,onChange:()=>a(k),className:Ee.rating__input}),t.jsx(D.StarFill,{"aria-hidden":!0}),t.jsxs("span",{className:Ee.rating__srOnly,children:[fe("RatingInput.formatStarCount",i??((m=h==null?void 0:h.rating)==null?void 0:m.starCount),k)," ","— ",(d==null?void 0:d[k])??""]})]},k)})}),b!==null&&t.jsx("span",{className:Ee.rating__caption,"aria-hidden":!0,children:(d==null?void 0:d[b])??""})]})},_o=n.memo(uo),ho="hanui-stepper-8s5Ih",po="hanui-stepper__button-h6g7d",mo="hanui-stepper__input-OQh5v",yt={stepper:ho,stepper__button:po,stepper__input:mo,"stepper--sm":"hanui-stepper--sm-RvrBP","stepper--md":"hanui-stepper--md-Cnjei"},bo=({value:e,onChange:a,label:s,decreaseLabel:r,increaseLabel:i,min:c=1,max:o=99,isDisabled:_,size:h="md",className:d,testId:l})=>{var f,N,j;const{labels:p}=O(),u=P("QuantityStepper.label",s,(f=p==null?void 0:p.quantity)==null?void 0:f.label),[b,g]=n.useState(null),k=x=>Math.min(Math.max(x,c),o),m=x=>{g(null);const E=x.replace(/\D/g,"");E!==""&&a(k(Number(E)))};return t.jsxs("div",{className:v(yt.stepper,yt[`stepper--${h}`],d),role:"group","aria-label":u,"data-testid":l,children:[t.jsx("button",{type:"button",className:yt.stepper__button,onClick:()=>a(Math.max(e-1,c)),disabled:_||e<=c,"aria-label":P("QuantityStepper.decreaseLabel",r,(N=p==null?void 0:p.quantity)==null?void 0:N.decrease),children:t.jsx(D.DashLg,{"aria-hidden":!0})}),t.jsx("input",{className:yt.stepper__input,value:b??String(e),onChange:x=>g(x.target.value.replace(/\D/g,"").slice(0,2)),onBlur:x=>m(x.target.value),onKeyDown:x=>{const E=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;if(E!==0){x.preventDefault(),g(null),a(k(e+E));return}const R=x.key==="PageUp"?10:x.key==="PageDown"?-10:0;if(R!==0){x.preventDefault(),g(null),a(k(e+R));return}if(x.key==="Home"||x.key==="End"){x.preventDefault(),g(null),a(x.key==="Home"?c:o);return}x.key==="Enter"&&(x.preventDefault(),m(x.target.value))},inputMode:"numeric",disabled:_,role:"spinbutton","aria-valuenow":e,"aria-valuemin":c,"aria-valuemax":o,"aria-label":u}),t.jsx("button",{type:"button",className:yt.stepper__button,onClick:()=>a(Math.min(e+1,o)),disabled:_||e>=o,"aria-label":P("QuantityStepper.increaseLabel",i,(j=p==null?void 0:p.quantity)==null?void 0:j.increase),children:t.jsx(D.PlusLg,{"aria-hidden":!0})})]})},go=n.memo(bo),fo="hanui-checkbox--dvpB",xo={checkbox:fo},vo=n.forwardRef(({label:e,isIndeterminate:a=!1,className:s,testId:r,...i},c)=>{const o=n.useRef(null);return n.useImperativeHandle(c,()=>o.current,[]),n.useEffect(()=>{o.current&&(o.current.indeterminate=a)},[a]),t.jsx("input",{ref:o,type:"checkbox","aria-label":e,"aria-checked":a?"mixed":void 0,className:v(xo.checkbox,s),"data-testid":r,...i})}),yo=n.memo(L(vo,"TableCheckbox")),wo="hanui-wrapper-IAI4E",ko="hanui-wrapper__prefix-XKDlV",jo="hanui-wrapper__suffix-lT35q",No="hanui-input-pIS2u",qe={wrapper:wo,wrapper__prefix:ko,wrapper__suffix:jo,input:No,"input--hasPrefix":"hanui-input--hasPrefix-nsrWh","input--hasSuffix":"hanui-input--hasSuffix-OrE5A","input--technical":"hanui-input--technical---DCD"},$o=n.forwardRef(({prefix:e,suffix:a,isTechnical:s,className:r,testId:i,...c},o)=>t.jsxs("span",{className:v(qe.wrapper,r),children:[e&&t.jsx("span",{className:qe.wrapper__prefix,"aria-hidden":!0,children:e}),t.jsx("input",{ref:o,className:v(qe.input,!!e&&qe["input--hasPrefix"],!!a&&qe["input--hasSuffix"],s&&qe["input--technical"]),"data-testid":i,...c}),a&&t.jsx("span",{className:qe.wrapper__suffix,"aria-hidden":!0,children:a})]})),ba=n.memo(L($o,"Input")),Eo="hanui-password-viMea",Co="hanui-password__field-WI1h1",Io="hanui-password__toggle-O6R2a",Vt={password:Eo,password__field:Co,password__toggle:Io},To=({className:e,showLabel:a,hideLabel:s,...r})=>{const{labels:i}=O(),[c,o]=n.useState(!1),_=c?P("PasswordInput.hideLabel",s,i==null?void 0:i.passwordHide):P("PasswordInput.showLabel",a,i==null?void 0:i.passwordShow);return t.jsxs("span",{className:Vt.password,children:[t.jsx(ba,{...r,className:`${Vt.password__field} ${e??""}`.trim(),type:c?"text":"password"}),t.jsx(je,{className:Vt.password__toggle,icon:c?t.jsx(D.EyeSlashFill,{"aria-hidden":!0}):t.jsx(D.EyeFill,{"aria-hidden":!0}),label:_,variant:"ghost",size:"sm",onClick:()=>o(h=>!h)})]})},Ro=n.memo(L(To,"PasswordInput")),Do="hanui-tagInput-QraZR",So="hanui-tagInput__field-HeWrC",Lo="hanui-tagInput__tag-D-ZWB",Ao="hanui-tagInput__remove-bpjGG",Ye={tagInput:Do,tagInput__field:So,"tagInput--invalid":"hanui-tagInput--invalid-NQogL","tagInput--disabled":"hanui-tagInput--disabled--AJFF",tagInput__tag:Lo,"tagInput__tag--duplicate":"hanui-tagInput__tag--duplicate-3-FMF",tagInput__remove:Ao},Fo=({values:e,onChange:a,label:s,placeholder:r,removeLabel:i,separators:c=["Enter",","],maxTags:o,isDisabled:_,id:h,required:d,className:l,testId:p,"aria-describedby":u,"aria-invalid":b})=>{const g=n.useId(),k=h??g,m=n.useRef(null),f=n.useRef(0);n.useEffect(()=>()=>{f.current&&window.clearTimeout(f.current)},[]);const{labels:N}=O(),j=zt(),[x,E]=n.useState(""),[R,I]=n.useState(null),w=o!==void 0&&e.length>=o,C=$=>{var q;const M=$.trim();if(M!==""){if(e.includes(M)){I(M),f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>I(null),1e3),j(`${M} zaten ekli`,"assertive"),E("");return}w||(a([...e,M]),E(""),j(fe("TagInput.added",(q=N==null?void 0:N.tagInput)==null?void 0:q.added,M)))}},T=$=>{var M;a(e.filter(q=>q!==$)),j(fe("TagInput.removed",(M=N==null?void 0:N.tagInput)==null?void 0:M.removed,$))},y=$=>{if(c.includes($.key)){$.preventDefault(),C(x);return}if($.key==="Backspace"&&x===""){const M=e.at(-1);M!==void 0&&T(M)}};return t.jsxs("div",{className:v(Ye.tagInput,_&&Ye["tagInput--disabled"],b&&Ye["tagInput--invalid"],l),"data-testid":p,onClick:()=>{var $;return($=m.current)==null?void 0:$.focus()},children:[e.map($=>t.jsxs("span",{className:v(Ye.tagInput__tag,R===$&&Ye["tagInput__tag--duplicate"]),children:[$,t.jsx("button",{type:"button",className:Ye.tagInput__remove,"aria-label":`${$} — ${i}`,disabled:_,onClick:M=>{M.stopPropagation(),T($)},children:t.jsx(D.XLg,{"aria-hidden":!0})})]},$)),t.jsx("input",{ref:m,id:k,type:"text",className:Ye.tagInput__field,value:x,placeholder:e.length===0?r:void 0,"aria-label":s,"aria-describedby":u,"aria-invalid":b,"aria-required":d||void 0,disabled:_||w,onChange:$=>E($.target.value),onKeyDown:y,onBlur:()=>C(x)})]})},Bo=n.memo(L(Fo,"TagInput")),Mo="hanui-textarea-zwJcB",Po="hanui-wrapper-O8aJA",Oo="hanui-counter-bHVh3",wt={textarea:Mo,wrapper:Po,"textarea--autoSize":"hanui-textarea--autoSize--F8yj",counter:Oo,"counter--near":"hanui-counter--near-AZAQm"},Ho=n.forwardRef(({className:e,rows:a=4,isAutoSize:s,maxRows:r=12,hasCounter:i,maxLength:c,value:o,defaultValue:_,onChange:h,testId:d,...l},p)=>{const u=n.useRef(null),[b,g]=n.useState(String(_??"").length),k=o===void 0?b:String(o).length,m=n.useCallback(N=>{u.current=N,typeof p=="function"?p(N):p&&(p.current=N)},[p]);n.useLayoutEffect(()=>{const N=u.current;if(!s||!N)return;N.style.height="auto";const x=(Number.parseFloat(getComputedStyle(N).lineHeight)||20)*r;N.style.height=`${Math.min(N.scrollHeight,x)}px`,N.style.overflowY=N.scrollHeight>x?"auto":"hidden"},[s,r,o,k]);const f=c!==void 0&&k>=c*.9;return t.jsxs("div",{className:v(wt.wrapper,e),"data-testid":d,children:[t.jsx("textarea",{ref:m,rows:a,className:v(wt.textarea,s&&wt["textarea--autoSize"]),maxLength:c,value:o,defaultValue:_,onChange:N=>{g(N.target.value.length),h==null||h(N)},...l}),i&&c!==void 0&&t.jsxs("span",{className:v(wt.counter,f&&wt["counter--near"]),"aria-hidden":!0,children:[k," / ",c]})]})}),Ja=n.memo(L(Ho,"Textarea")),zo="hanui-dateField-UnUwe",Ko="hanui-range-nGuRH",Uo="hanui-range__row--debA",qo="hanui-range__separator-fEqqr",Yo="hanui-range__field-tmoNH",Xo="hanui-range__summary-L6v1T",Je={dateField:zo,range:Ko,range__row:Uo,range__separator:qo,range__field:Yo,range__summary:Xo},aa=n.forwardRef(({type:e="date",className:a,testId:s,...r},i)=>t.jsx("input",{ref:i,type:e,className:v(Je.dateField,a),"data-testid":s,...r})),Wo=n.memo(L(aa,"DateField")),Go=({value:e,onChange:a,startLabel:s,endLabel:r,separator:i="–",min:c,max:o,isSummaryVisible:_,isDisabled:h,className:d,testId:l})=>{const{labels:p}=O(),u=(()=>{if(!_||!(p!=null&&p.locale)||e.start===""||e.end==="")return null;try{const b=new Intl.DateTimeFormat(p.locale,{dateStyle:"medium"});return`${b.format(new Date(e.start))} ${i} ${b.format(new Date(e.end))}`}catch{return null}})();return t.jsxs("div",{className:v(Je.range,d),"data-testid":l,children:[t.jsxs("div",{className:Je.range__row,children:[t.jsx(aa,{className:Je.range__field,"aria-label":s,value:e.start,min:c,max:e.end||o,disabled:h,onChange:b=>a({...e,start:b.target.value})}),t.jsx("span",{className:Je.range__separator,"aria-hidden":!0,children:i}),t.jsx(aa,{className:Je.range__field,"aria-label":r,value:e.end,min:e.start||c,max:o,disabled:h,onChange:b=>a({...e,end:b.target.value})})]}),u&&t.jsx("span",{className:Je.range__summary,children:u})]})},Qo=L(n.memo(Go),"DateRange"),Vo="hanui-field-KKvre",Jo="hanui-field__label-9dlYd",Zo="hanui-field__required-hbDJk",ei="hanui-field__srOnly-2WQFH",ti="hanui-field__hint-SQPiL",ai="hanui-field__error-gLlZ-",ni="hanui-field__errorIcon-uA3o8",Fe={field:Vo,field__label:Jo,"field__label--hidden":"hanui-field__label--hidden-ufuVt",field__required:Zo,field__srOnly:ei,field__hint:ti,field__error:ai,field__errorIcon:ni},si=({label:e,children:a,hint:s,error:r,isRequired:i,requiredLabel:c,isLabelHidden:o,className:_})=>{const{labels:h}=O(),d=n.useId(),l=`${d}-error`,p=`${d}-hint`;return t.jsxs("div",{className:v(Fe.field,_),children:[t.jsxs("label",{htmlFor:d,className:v(Fe.field__label,o&&Fe["field__label--hidden"]),children:[e,i&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:Fe.field__required,"aria-hidden":!0,children:"*"}),t.jsx("span",{className:Fe.field__srOnly,children:P("Field.requiredLabel",c,h==null?void 0:h.required)})]})]}),a({id:d,required:i||void 0,"aria-invalid":r?!0:void 0,"aria-describedby":[r&&l,s&&p].filter(Boolean).join(" ")||void 0}),r&&t.jsxs("p",{id:l,className:Fe.field__error,role:"alert",children:[t.jsx(D.ExclamationCircleFill,{"aria-hidden":!0,className:Fe.field__errorIcon}),r]}),s&&t.jsx("p",{id:p,className:Fe.field__hint,children:s})]})},Za=n.memo(si),ri="hanui-progress-99MrX",oi="hanui-progress__track-Qbp9t",ii="hanui-progress__fill-Bam55",ci="hanui-progress__value-3FYxj",li="hanui-circle-9cn2w",di="hanui-circle__svg-0IwkR",ui="hanui-circle__track-zY2qc",_i="hanui-circle__fill-Jbde6",hi="hanui-circle__label-A3nJB",ae={progress:ri,progress__track:oi,"progress__track--sm":"hanui-progress__track--sm-dbHZq","progress__track--md":"hanui-progress__track--md-v1GdW","progress__track--indeterminate":"hanui-progress__track--indeterminate-8fMxl",progress__fill:ii,"progress__fill--success":"hanui-progress__fill--success-IFuI5","progress__fill--warning":"hanui-progress__fill--warning-wIhgi","progress__fill--danger":"hanui-progress__fill--danger-cuqj0",progress__value:ci,circle:li,circle__svg:di,circle__track:ui,circle__fill:_i,"circle__fill--success":"hanui-circle__fill--success-HTr0m","circle__fill--warning":"hanui-circle__fill--warning-Fkgj2","circle__fill--danger":"hanui-circle__fill--danger-4E3Z8","circle--indeterminate":"hanui-circle--indeterminate-cITY6",circle__label:hi},en=(e,a)=>!Number.isFinite(e)||!Number.isFinite(a)||a<=0?0:Math.min(100,Math.max(0,e/a*100)),pi=({value:e,max:a=100,label:s,valueText:r,isValueVisible:i,tone:c="brand",size:o="md",className:_,testId:h})=>{const d=e===void 0,l=d?0:en(e,a);return t.jsxs("div",{className:v(ae.progress,_),"data-testid":h,children:[t.jsx("div",{role:"progressbar","aria-label":s,"aria-valuenow":d?void 0:Math.round(l),"aria-valuemin":d?void 0:0,"aria-valuemax":d?void 0:100,"aria-valuetext":d?void 0:r,className:v(ae.progress__track,ae[`progress__track--${o}`],d&&ae["progress__track--indeterminate"]),children:t.jsx("span",{className:v(ae.progress__fill,ae[`progress__fill--${c}`]),style:d?void 0:{inlineSize:`${l}%`}})}),i&&!d&&t.jsx("span",{className:ae.progress__value,"aria-hidden":!0,children:r??`%${Math.round(l)}`})]})},tn=n.memo(L(pi,"Progress")),mi=({value:e,max:a=100,label:s,valueText:r,isValueVisible:i,tone:c="brand",size:o=44,className:_,testId:h})=>{const d=e===void 0,l=d?25:en(e,a),p=Math.max(3,Math.round(o*.1)),u=(o-p)/2,b=2*Math.PI*u;return t.jsxs("div",{className:v(ae.circle,d&&ae["circle--indeterminate"],_),style:{width:o,height:o},"data-testid":h,children:[t.jsxs("svg",{className:ae.circle__svg,width:o,height:o,viewBox:`0 0 ${o} ${o}`,role:"progressbar","aria-label":s,"aria-valuenow":d?void 0:Math.round(l),"aria-valuemin":d?void 0:0,"aria-valuemax":d?void 0:100,"aria-valuetext":d?void 0:r,children:[t.jsx("circle",{className:ae.circle__track,cx:o/2,cy:o/2,r:u,fill:"none",strokeWidth:p}),t.jsx("circle",{className:v(ae.circle__fill,ae[`circle__fill--${c}`]),cx:o/2,cy:o/2,r:u,fill:"none",strokeWidth:p,strokeDasharray:b,strokeDashoffset:b*(1-l/100)})]}),i&&!d&&t.jsx("span",{className:ae.circle__label,"aria-hidden":!0,children:r??`%${Math.round(l)}`})]})},bi=L(n.memo(mi),"ProgressCircle"),gi="hanui-upload-v1pRY",fi="hanui-upload__drop-OpNbO",xi="hanui-upload__input-Tcg9-",vi="hanui-upload__icon-KpMkq",yi="hanui-upload__label-M4HJb",wi="hanui-upload__drag-ewSQw",ki="hanui-upload__hint-MZRJ6",ji="hanui-upload__error-7GkCC",Ni="hanui-upload__list-lbViQ",$i="hanui-upload__file-Znp1Q",Ei="hanui-upload__fileText-EtJcs",Ci="hanui-upload__fileName-ArF8-",Ii="hanui-upload__fileMeta-i6sO1",Ti="hanui-upload__progress-JY2a5",W={upload:gi,upload__drop:fi,upload__input:xi,"upload__drop--dragging":"hanui-upload__drop--dragging-YztUx","upload__drop--invalid":"hanui-upload__drop--invalid-JhwnL","upload__drop--disabled":"hanui-upload__drop--disabled-zyfUv",upload__icon:vi,upload__label:yi,upload__drag:wi,upload__hint:ki,upload__error:ji,upload__list:Ni,upload__file:$i,"upload__file--error":"hanui-upload__file--error-wpbtA",upload__fileText:Ei,upload__fileName:Ci,upload__fileMeta:Ii,upload__progress:Ti},Ht=1024,La=Ht*Ht,Jt=e=>e<Ht?`${e} B`:e<La?`${Math.round(e/Ht)} KB`:`${(e/La).toFixed(1)} MB`,Ri=({files:e,onSelect:a,onRemove:s,label:r,hint:i,accept:c,isMultiple:o,maxSize:_,removeLabel:h,dropLabel:d,sizeErrorText:l,isDisabled:p,error:u,children:b,className:g,testId:k})=>{const m=n.useId(),f=n.useId(),N=n.useRef(null),{labels:j}=O(),x=zt(),[E,R]=n.useState(!1),[I,w]=n.useState([]),C=y=>{var G;if(!y||y.length===0)return;const $=[...y],M=_===void 0?[]:$.filter(Q=>Q.size>_),q=$.filter(Q=>!M.includes(Q)),Y=M.map(Q=>{var he;return l===void 0?fe("FileUpload.tooLarge",(he=j==null?void 0:j.fileUpload)==null?void 0:he.tooLarge,Q.name,Jt(_??0)):l.replace("{name}",Q.name).replace("{max}",Jt(_??0))});w(Y),q.length>0&&(a(q),x(fe("FileUpload.added",(G=j==null?void 0:j.fileUpload)==null?void 0:G.added,q.length))),Y.length>0&&x(Y.join(" "),"assertive")},T=y=>{y.preventDefault(),R(!1),!p&&C(y.dataTransfer.files)};return t.jsxs("div",{className:v(W.upload,g),"data-testid":k,children:[t.jsxs("label",{htmlFor:m,className:v(W.upload__drop,E&&W["upload__drop--dragging"],p&&W["upload__drop--disabled"],u&&W["upload__drop--invalid"]),onDragOver:y=>{y.preventDefault(),p||R(!0)},onDragLeave:()=>R(!1),onDrop:T,children:[t.jsx(D.CloudArrowUpFill,{"aria-hidden":!0,className:W.upload__icon}),t.jsx("span",{className:W.upload__label,children:r}),t.jsx("span",{className:W.upload__drag,children:d}),i&&t.jsx("span",{id:f,className:W.upload__hint,children:i}),t.jsx("input",{ref:N,id:m,type:"file",className:W.upload__input,accept:c,multiple:o,disabled:p,"aria-describedby":i?f:void 0,"aria-invalid":u?!0:void 0,onChange:y=>{C(y.target.files),y.target.value=""}})]}),u&&t.jsxs("p",{className:W.upload__error,role:"alert",children:[t.jsx(D.ExclamationCircleFill,{"aria-hidden":!0}),u]}),I.map(y=>t.jsxs("p",{className:W.upload__error,role:"alert",children:[t.jsx(D.ExclamationCircleFill,{"aria-hidden":!0}),y]},y)),e.length>0&&t.jsx("ul",{className:W.upload__list,children:e.map(y=>{var $;return t.jsxs("li",{className:v(W.upload__file,y.error&&W["upload__file--error"]),children:[t.jsxs("span",{className:W.upload__fileText,children:[t.jsx("span",{className:W.upload__fileName,children:y.name}),t.jsx("span",{className:W.upload__fileMeta,children:y.error??Jt(y.size)})]}),y.progress!==void 0&&t.jsx(tn,{value:y.progress,label:fe("FileUpload.uploading",($=j==null?void 0:j.fileUpload)==null?void 0:$.uploading,y.name),size:"sm",className:W.upload__progress}),t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:`${y.name} — ${h}`,variant:"ghost",size:"sm",onClick:()=>s(y.id)})]},y.id)})}),b]})},Di=n.memo(L(Ri,"FileUpload")),Si="hanui-alert-gHI-9",Li="hanui-alert__icon-DhiCT",Ai="hanui-alert__body-52-z2",Fi="hanui-alert__title-I8BAh",Bi="hanui-alert__content-lhBEo",Mi="hanui-alert__action-1mTje",Xe={alert:Si,alert__icon:Li,alert__body:Ai,alert__title:Fi,alert__content:Bi,alert__action:Mi,"alert--info":"hanui-alert--info-lsAVw","alert--success":"hanui-alert--success-RMJR6","alert--warning":"hanui-alert--warning-Rkgln","alert--danger":"hanui-alert--danger-9ei0Y"},Pi={info:t.jsx(D.InfoCircleFill,{"aria-hidden":!0}),success:t.jsx(D.CheckCircleFill,{"aria-hidden":!0}),warning:t.jsx(D.ExclamationTriangleFill,{"aria-hidden":!0}),danger:t.jsx(D.XCircleFill,{"aria-hidden":!0})},Oi=({children:e,tone:a="info",title:s,action:r,className:i,testId:c})=>t.jsxs("div",{className:v(Xe.alert,Xe[`alert--${a}`],i),role:a==="danger"||a==="warning"?"alert":void 0,"data-testid":c,children:[t.jsx("span",{className:Xe.alert__icon,children:Pi[a]}),t.jsxs("div",{className:Xe.alert__body,children:[s&&t.jsx("strong",{className:Xe.alert__title,children:s}),t.jsx("div",{className:Xe.alert__content,children:e})]}),r&&t.jsx("div",{className:Xe.alert__action,children:r})]}),Hi=n.memo(Oi),zi="hanui-avatar-qoh3P",Ki="hanui-avatar__image-uAyAX",Ft={avatar:zi,avatar__image:Ki,"avatar--sm":"hanui-avatar--sm-GGjU4","avatar--md":"hanui-avatar--md-xhXnK","avatar--lg":"hanui-avatar--lg-ULP-r","avatar--tone-0":"hanui-avatar--tone-0-mvjdw","avatar--tone-1":"hanui-avatar--tone-1-RYZOX","avatar--tone-2":"hanui-avatar--tone-2-vP-CS","avatar--tone-3":"hanui-avatar--tone-3-ivgnI","avatar--tone-4":"hanui-avatar--tone-4-V57r3","avatar--tone-5":"hanui-avatar--tone-5-65aPg"},Ui=(e,a)=>{const s=e.trim().split(/\s+/).filter(Boolean);if(s.length===0)return"?";const r=s.length===1?s[0].slice(0,2):`${s[0][0]}${s[s.length-1][0]}`;return a?r.toLocaleUpperCase(a):r.toLocaleUpperCase()},qi=(e,a)=>{let s=5381;for(let r=0;r<e.length;r+=1)s=s*33^e.charCodeAt(r);return Math.abs(s)%a},Yi=6,Xi=({name:e,imageUrl:a,locale:s,size:r="md",className:i,testId:c})=>{const{labels:o}=O();return t.jsx("span",{className:v(Ft.avatar,Ft[`avatar--${r}`],!a&&Ft[`avatar--tone-${qi(e,Yi)}`],i),role:"img","aria-label":e,"data-testid":c,children:a?t.jsx("img",{className:Ft.avatar__image,src:a,alt:""}):Ui(e,s??(o==null?void 0:o.locale))})},Wi=n.memo(Xi),Gi="hanui-badge-uLAaI",Qi="hanui-badge__icon-R2goZ",Bt={badge:Gi,badge__icon:Qi,"badge--neutral":"hanui-badge--neutral-6kddt","badge--soft":"hanui-badge--soft-gFeRF","badge--solid":"hanui-badge--solid-rtdHI","badge--outline":"hanui-badge--outline-QiAAz","badge--success":"hanui-badge--success-Oj11F","badge--danger":"hanui-badge--danger-X3nV0","badge--warning":"hanui-badge--warning-vAsx2","badge--info":"hanui-badge--info-mHOwk","badge--oem":"hanui-badge--oem-Nl-VX","badge--alt":"hanui-badge--alt-gQkww","badge--sale":"hanui-badge--sale-Li1tG","badge--action":"hanui-badge--action-7pUio","badge--link":"hanui-badge--link-zcNJZ"},Vi=({children:e,tone:a="neutral",variant:s="soft",icon:r,className:i,testId:c})=>t.jsxs("span",{className:v(Bt.badge,Bt[`badge--${a}`],Bt[`badge--${s}`],i),"data-testid":c,children:[r&&t.jsx("span",{className:Bt.badge__icon,children:r}),e]}),Ji=n.memo(Vi),Zi="hanui-breadcrumb-amB9n",ec="hanui-breadcrumb__item-Icv1S",tc="hanui-breadcrumb__link-eVkPq",ac="hanui-breadcrumb__current-8XjhU",nc="hanui-breadcrumb__separator-vvaUi",kt={breadcrumb:Zi,breadcrumb__item:ec,breadcrumb__link:tc,breadcrumb__current:ac,breadcrumb__separator:nc},sc=({items:e,label:a,linkProps:s,className:r,testId:i})=>{const{labels:c}=O();return t.jsx("nav",{className:r,"aria-label":P("Breadcrumb.label",a,c==null?void 0:c.breadcrumb),"data-testid":i,children:t.jsx("ol",{className:v(kt.breadcrumb),children:e.map((o,_)=>{const h=_===e.length-1;return t.jsxs("li",{className:kt.breadcrumb__item,children:[o.href&&!h?t.jsx(_e,{href:o.href,className:kt.breadcrumb__link,...s,children:o.label}):t.jsx("span",{className:kt.breadcrumb__current,"aria-current":"page",children:o.label}),!h&&t.jsx(D.CaretRightFill,{"aria-hidden":!0,className:kt.breadcrumb__separator})]},`${o.label}-${_}`)})})})},rc=n.memo(sc),oc="hanui-card-CaHUG",ic="hanui-media__frame-eBv-s",cc="hanui-media-eggk5",lc="hanui-media__link-ujyVV",dc="hanui-overlay-AVMTX",uc="hanui-body-DyI-6",_c="hanui-footer-2WNCZ",we={card:oc,"card--interactive":"hanui-card--interactive-C1pXZ",media__frame:ic,media:cc,media__link:lc,"media__frame--cover":"hanui-media__frame--cover-ddl29","media__frame--contain":"hanui-media__frame--contain-5gosS","media__frame--inset":"hanui-media__frame--inset-oVQIn",overlay:dc,"overlay--top-left":"hanui-overlay--top-left-td1xA","overlay--top-right":"hanui-overlay--top-right-GqD9H","overlay--bottom-left":"hanui-overlay--bottom-left-T5Quw","overlay--bottom-right":"hanui-overlay--bottom-right-za3z3",body:uc,footer:_c},hc=({children:e,isInteractive:a,as:s="div",className:r,testId:i})=>t.jsx(s,{className:v(we.card,a&&we["card--interactive"],r),"data-testid":i,children:e}),pc=(e,a)=>e??(a===!1?"cover":"contain"),mc=L(n.memo(({children:e,ratio:a=1,href:s,linkProps:r,fit:i,isContained:c,className:o})=>{const _=t.jsx("span",{className:v(we.media__frame,we[`media__frame--${pc(i,c)}`]),style:{aspectRatio:a},children:e});return t.jsx("div",{className:v(we.media,o),children:s?t.jsx(_e,{href:s,className:we.media__link,tabIndex:-1,"aria-hidden":!0,...r,children:_}):_})}),"CardMedia"),bc=L(n.memo(({children:e,position:a="top-left",className:s})=>t.jsx("div",{className:v(we.overlay,we[`overlay--${a}`],s),children:e})),"CardOverlay"),gc=L(n.memo(({children:e,className:a})=>t.jsx("div",{className:v(we.body,a),children:e})),"CardBody"),fc=L(n.memo(({children:e,className:a})=>t.jsx("div",{className:v(we.footer,a),children:e})),"CardFooter"),xc=n.memo(hc),vc="hanui-carousel-GJXkW",yc="hanui-carousel__controls-hm5ij",wc="hanui-carousel__arrowIcon-adFey",kc="hanui-carousel__track-mAux5",jc="hanui-carousel__dots-iU8RJ",Nc="hanui-carousel__dot-JTLCB",Be={carousel:vc,carousel__controls:yc,carousel__arrowIcon:wc,carousel__track:kc,carousel__dots:jc,carousel__dot:Nc,"carousel__dot--active":"hanui-carousel__dot--active-riNMm"},$c=({children:e,label:a,previousLabel:s,nextLabel:r,formatDotLabel:i,itemWidth:c,itemMinWidth:o,className:_,testId:h})=>{const d=n.useRef(null),[l,p]=n.useState(!1),[u,b]=n.useState(!1),[g,k]=n.useState(0),[m,f]=n.useState(1),[N,j]=n.useState(!1),x=n.useCallback(()=>{const I=d.current;if(!I)return;const{scrollLeft:w,scrollWidth:C,clientWidth:T}=I;p(w>1),b(w+T<C-1),k(T>0?Math.round(w/T):0),f(T>0?Math.max(1,Math.ceil(C/T)):1),j(C>T&&I.querySelector("a, button, input, select, textarea, [tabindex]")===null)},[]);n.useEffect(()=>{const I=d.current;if(!I)return;x(),I.addEventListener("scroll",x,{passive:!0});const w=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return w==null||w.observe(I),()=>{I.removeEventListener("scroll",x),w==null||w.disconnect()}},[x,e]);const E=()=>{var I;return typeof window<"u"&&((I=window.matchMedia)!=null&&I.call(window,"(prefers-reduced-motion: reduce)").matches)?"auto":"smooth"},R=I=>{var w;return(w=d.current)==null?void 0:w.scrollBy({left:I*d.current.clientWidth,behavior:E()})};return t.jsxs("section",{className:v(Be.carousel,_),"aria-label":a,"data-testid":h,children:[t.jsxs("div",{className:Be.carousel__controls,children:[t.jsx(je,{icon:t.jsx(D.CaretLeftFill,{"aria-hidden":!0,className:Be.carousel__arrowIcon}),label:s,variant:"outline",size:"sm",disabled:!l,onClick:()=>R(-1)}),t.jsx(je,{icon:t.jsx(D.CaretRightFill,{"aria-hidden":!0,className:Be.carousel__arrowIcon}),label:r,variant:"outline",size:"sm",disabled:!u,onClick:()=>R(1)})]}),t.jsx("div",{ref:d,className:Be.carousel__track,style:{"--hanui-carousel-item-default":`${c??o??240}px`},tabIndex:N?0:void 0,role:N?"group":void 0,"aria-label":N?a:void 0,children:e}),i&&m>1&&t.jsx("div",{className:Be.carousel__dots,children:Array.from({length:m},(I,w)=>t.jsx("button",{type:"button",className:v(Be.carousel__dot,w===g&&Be["carousel__dot--active"]),"aria-label":i(w+1,m),"aria-current":w===g?"true":void 0,onClick:()=>{var C;return(C=d.current)==null?void 0:C.scrollTo({left:w*d.current.clientWidth,behavior:E()})}},w))})]})},Ec=n.memo(L($c,"Carousel")),Cc=1600,an=e=>{const[a,s]=n.useState(!1),r=n.useRef(null),i=n.useRef(void 0);n.useEffect(()=>()=>window.clearTimeout(i.current),[]);const c=n.useCallback(()=>{const _=r.current;if(!_)return;const h=document.createRange();h.selectNodeContents(_);const d=window.getSelection();d==null||d.removeAllRanges(),d==null||d.addRange(h)},[]),o=n.useCallback(async()=>{try{await navigator.clipboard.writeText(e),s(!0),i.current=window.setTimeout(()=>s(!1),Cc)}catch{c()}},[e,c]);return{isCopied:a,copy:o,nodeRef:r}},Ic="hanui-badge-b14ZG",Tc="hanui-badge__code-RRDlH",Rc="hanui-badge__button-CVr21",Dc="hanui-badge__srOnly-ow8L5",ot={badge:Ic,"badge--sm":"hanui-badge--sm-Fr4vY",badge__code:Tc,"badge--md":"hanui-badge--md-HGRL4","badge--lg":"hanui-badge--lg-J4aiq",badge__button:Rc,"badge__button--done":"hanui-badge__button--done-k6XeK",badge__srOnly:Dc},Sc=({code:e,isCopyable:a,copyLabel:s,copiedLabel:r,copiedAnnouncement:i,size:c="md",className:o,testId:_})=>{var u,b,g;const{labels:h}=O(),{isCopied:d,copy:l,nodeRef:p}=an(e);return t.jsxs("span",{className:v(ot.badge,ot[`badge--${c}`],o),"data-testid":_,children:[t.jsx("span",{className:ot.badge__code,ref:p,children:e}),a&&t.jsx("button",{type:"button",className:v(ot.badge__button,d&&ot["badge__button--done"]),onClick:l,"aria-label":d?r??fe("CodeBadge.copiedLabel",(u=h==null?void 0:h.copyField)==null?void 0:u.copied,e):s??fe("CodeBadge.copyLabel",(b=h==null?void 0:h.copyField)==null?void 0:b.copy,e),children:d?t.jsx(D.ClipboardCheckFill,{"aria-hidden":!0}):t.jsx(D.ClipboardFill,{"aria-hidden":!0})}),t.jsx("span",{"aria-live":"polite",className:ot.badge__srOnly,children:d?P("CodeBadge.copiedAnnouncement",i,(g=h==null?void 0:h.copyField)==null?void 0:g.announcement):""})]})},Lc=n.memo(L(Sc,"CodeBadge")),Ac="hanui-copy-Yht5s",Fc="hanui-copy__code-CYlCA",Bc="hanui-copy__button-GDdH6",Mc="hanui-copy__srOnly-WMTNN",it={copy:Ac,"copy--sm":"hanui-copy--sm-Tjqws",copy__code:Fc,"copy--md":"hanui-copy--md-00rhU",copy__button:Bc,"copy__button--done":"hanui-copy__button--done-MujUR",copy__srOnly:Mc},Pc=({value:e,copyLabel:a,copiedLabel:s,copiedAnnouncement:r,size:i="sm",isReadOnly:c,className:o,testId:_})=>{var u,b,g;const{labels:h}=O(),{isCopied:d,copy:l,nodeRef:p}=an(e);return t.jsxs("span",{className:v(it.copy,it[`copy--${i}`],o),"data-testid":_,children:[t.jsx("span",{className:it.copy__code,ref:p,children:e}),!c&&t.jsx("button",{type:"button",className:v(it.copy__button,d&&it["copy__button--done"]),onClick:l,"aria-label":d?s??fe("CopyField.copiedLabel",(u=h==null?void 0:h.copyField)==null?void 0:u.copied,e):a??fe("CopyField.copyLabel",(b=h==null?void 0:h.copyField)==null?void 0:b.copy,e),children:d?t.jsx(D.ClipboardCheckFill,{"aria-hidden":!0}):t.jsx(D.ClipboardFill,{"aria-hidden":!0})}),t.jsx("span",{"aria-live":"polite",className:it.copy__srOnly,children:d?P("CopyField.copiedAnnouncement",r,(g=h==null?void 0:h.copyField)==null?void 0:g.announcement):""})]})},Oc=n.memo(Pc),Hc="hanui-divider-RJqCw",zc="hanui-divider__label-M8sBA",Mt={divider:Hc,"divider--labelled":"hanui-divider--labelled-jZH1-",divider__label:zc},Kc=({label:e,className:a})=>e?t.jsx("div",{role:"separator","aria-label":e,className:v(Mt.divider,Mt["divider--labelled"],a),children:t.jsx("span",{className:Mt.divider__label,children:e})}):t.jsx("hr",{className:v(Mt.divider,a)}),Uc=n.memo(Kc),qc="hanui-directory-badEd",Yc="hanui-group-i6An9",Xc="hanui-group__header-rc19c",Wc="hanui-group__label-vQTcs",Gc="hanui-group__link-es5V7",Qc="hanui-group__meta-LtC-u",Vc="hanui-group__list-YxBCG",Jc="hanui-row-3LH7X",Zc="hanui-row__name-75Wbq",el="hanui-row__media-AxZEh",tl="hanui-row__marker-RYHb-",al="hanui-jump-vpGwB",nl="hanui-jump__link-rRnT6",oe={directory:qc,group:Yc,group__header:Xc,group__label:Wc,group__link:Gc,group__meta:Qc,group__list:Vc,row:Jc,row__name:Zc,row__media:el,row__marker:tl,jump:al,jump__link:nl},sl=({children:e,className:a})=>t.jsx("div",{className:v(oe.directory,a),children:e}),rl=L(n.memo(({label:e,href:a,linkProps:s,meta:r,children:i,id:c})=>t.jsxs("section",{className:oe.group,id:c,children:[t.jsxs("header",{className:oe.group__header,children:[t.jsx("h2",{className:oe.group__label,children:a?t.jsx(_e,{href:a,className:oe.group__link,...s,children:e}):e}),r&&t.jsx("span",{className:oe.group__meta,children:r})]}),t.jsx("ul",{className:oe.group__list,children:i})]})),"DirectoryGroup"),ol=L(n.memo(({href:e,name:a,media:s,marker:r,linkProps:i,className:c})=>t.jsx("li",{children:t.jsxs(_e,{href:e,className:v(oe.row,c),...i,children:[s&&t.jsx("span",{className:oe.row__media,children:s}),t.jsx("span",{className:oe.row__name,children:a}),r&&t.jsx("span",{className:oe.row__marker,children:r})]})})),"DirectoryRow"),il=L(n.memo(({labels:e,toId:a,label:s})=>{const{labels:r}=O();return t.jsx("nav",{className:oe.jump,"aria-label":P("DirectoryJump.label",s,r==null?void 0:r.directoryJump),children:e.map(i=>t.jsx("a",{href:`#${a(i)}`,className:oe.jump__link,children:i},i))})}),"DirectoryJump"),cl=n.memo(sl),ll="hanui-empty-47qZR",dl="hanui-empty__icon-okfEc",ul="hanui-empty__title-Z7Dzd",_l="hanui-empty__description-6BoCk",hl="hanui-empty__actions-ARk-k",We={empty:ll,empty__icon:dl,empty__title:ul,empty__description:_l,empty__actions:hl,"empty--sm":"hanui-empty--sm-QXaXx","empty--error":"hanui-empty--error-4BBgp"},pl=({title:e,description:a,icon:s,action:r,secondaryAction:i,tone:c="empty",size:o="md",className:_,testId:h})=>t.jsxs("div",{className:v(We.empty,We[`empty--${o}`],We[`empty--${c}`],_),role:c==="error"?"alert":void 0,"data-testid":h,children:[s&&t.jsx("span",{className:We.empty__icon,children:s}),t.jsx("h3",{className:We.empty__title,children:e}),a&&t.jsx("p",{className:We.empty__description,children:a}),(r||i)&&t.jsxs("div",{className:We.empty__actions,children:[r,i]})]}),ml=n.memo(pl),bl="hanui-header-yJwus",gl="hanui-header__top-UK4si",fl="hanui-header__breadcrumb-A2j0i",xl="hanui-header__text-HIo8U",vl="hanui-header__eyebrow-dZ9Zc",yl="hanui-header__titleRow-KgDZj",wl="hanui-header__title-s1giF",kl="hanui-header__meta-UxuaD",jl="hanui-header__description-NXbbC",Nl="hanui-header__actions-aShpt",ve={header:bl,header__top:gl,header__breadcrumb:fl,header__text:xl,header__eyebrow:vl,header__titleRow:yl,header__title:wl,header__meta:kl,header__description:jl,header__actions:Nl},$l=({title:e,eyebrow:a,description:s,actions:r,breadcrumb:i,meta:c,children:o,as:_="h1",className:h,testId:d})=>t.jsxs("header",{className:v(ve.header,h),"data-testid":d,children:[i&&t.jsx("div",{className:ve.header__breadcrumb,children:i}),t.jsxs("div",{className:ve.header__top,children:[t.jsxs("div",{className:ve.header__text,children:[a&&t.jsx("span",{className:ve.header__eyebrow,children:a}),t.jsxs("div",{className:ve.header__titleRow,children:[t.jsx(_,{className:ve.header__title,children:e}),c&&t.jsx("span",{className:ve.header__meta,children:c})]}),s&&t.jsx("p",{className:ve.header__description,children:s})]}),r&&t.jsx("div",{className:ve.header__actions,children:r})]}),o]}),El=n.memo($l),Cl="hanui-panel-Sv-1m",Il="hanui-panel__header-ysexh",Tl="hanui-panel__heading-xLCsB",Rl="hanui-panel__icon--yPQT",Dl="hanui-panel__headingText--XqxW",Sl="hanui-panel__title-6-6uC",Ll="hanui-panel__description-qXTSM",Al="hanui-panel__actions-Ra-zy",Fl="hanui-panel__body-lo5aX",Bl="hanui-panel__footer-qLpR1",Ml="hanui-panel__footerInner-r6VQI",Pl="hanui-form-o9UqJ",Ol="hanui-row-vUGpa",V={panel:Cl,panel__header:Il,panel__heading:Tl,panel__icon:Rl,panel__headingText:Dl,panel__title:Sl,panel__description:Ll,panel__actions:Al,panel__body:Fl,"panel__body--sm":"hanui-panel__body--sm-6XP6W","panel__body--lg":"hanui-panel__body--lg-RTK5B","panel__body--flush":"hanui-panel__body--flush-iK75R",panel__footer:Bl,panel__footerInner:Ml,form:Pl,"form--2":"hanui-form--2-HdwDc",row:Ol},Hl=({children:e,title:a,description:s,actions:r,icon:i,isFlush:c,gap:o="md",footer:_,as:h="section",className:d,bodyClassName:l,testId:p})=>t.jsxs(h,{className:v(V.panel,d),"data-testid":p,children:[(a||r)&&t.jsxs("div",{className:V.panel__header,children:[t.jsxs("div",{className:V.panel__heading,children:[i&&t.jsx("span",{className:V.panel__icon,children:i}),t.jsxs("div",{className:V.panel__headingText,children:[a&&t.jsx("h2",{className:V.panel__title,children:a}),s&&t.jsx("p",{className:V.panel__description,children:s})]})]}),r&&t.jsx("div",{className:V.panel__actions,children:r})]}),t.jsx("div",{className:v(V.panel__body,V[`panel__body--${o}`],c&&V["panel__body--flush"],l),children:e}),_&&t.jsx("div",{className:V.panel__footer,children:t.jsx("div",{className:V.panel__footerInner,children:_})})]}),zl=L(n.memo(({children:e,columns:a=1,className:s})=>t.jsx("div",{className:v(V.form,V[`form--${a}`],s),children:e})),"PanelForm"),Kl=L(n.memo(({children:e,className:a})=>t.jsx("div",{className:v(V.row,a),children:e})),"PanelRow"),Ul=n.memo(Hl),ql="hanui-price-Oc5Nr",Yl="hanui-price__current-2Xup2",Xl="hanui-price__currency-32NLN",Wl="hanui-price__list-MlQgT",Gl="hanui-price__discount-5Yc6W",Ge={price:ql,price__current:Yl,price__currency:Xl,price__list:Wl,price__discount:Gl,"price--sm":"hanui-price--sm-Hd8Oe","price--md":"hanui-price--md-JMxlK","price--lg":"hanui-price--lg-TFqIF","price--xl":"hanui-price--xl-EJBYq"},Ql=({value:e,currency:a,listValue:s,discountPercent:r,formatDiscount:i=d=>`%${d}`,isFormatted:c,size:o="md",className:_,testId:h})=>{const{labels:d}=O(),l=P("Price.currency",a,d==null?void 0:d.currency),p=u=>{if(!c||!(d!=null&&d.locale)||!/\d/.test(u))return u;const b=Number(u.replace(/[^\d.,-]/g,"").replace(/\.(?=\d{3}\b)/g,"").replace(",","."));if(!Number.isFinite(b))return u;try{return new Intl.NumberFormat(d.locale).format(b)}catch{return u}};return t.jsxs("span",{className:v(Ge.price,Ge[`price--${o}`],_),"data-testid":h,children:[t.jsxs("span",{className:Ge.price__current,children:[p(e),t.jsx("span",{className:Ge.price__currency,children:l})]}),s&&t.jsxs("s",{className:Ge.price__list,children:[p(s),t.jsx("span",{className:Ge.price__currency,children:l})]}),r!==void 0&&r>0&&t.jsx("span",{className:Ge.price__discount,children:i(r)})]})},Vl=n.memo(Ql),Jl="hanui-rating-94dke",Zl="hanui-rating__stars-QkpVU",ed="hanui-rating__empty-Wf6-K",td="hanui-rating__count-pIoEs",ad="hanui-rating__srOnly-E9h0d",ct={rating:Jl,rating__stars:Zl,rating__empty:ed,rating__count:td,rating__srOnly:ad,"rating--sm":"hanui-rating--sm-AtY7U","rating--md":"hanui-rating--md-Q0nxN"},nd=({value:e,count:a,srLabel:s,size:r="sm",className:i,testId:c})=>{var h;const{labels:o}=O(),_=Math.round(e*2)/2;return t.jsxs("span",{className:v(ct.rating,ct[`rating--${r}`],i),"data-testid":c,children:[t.jsx("span",{className:ct.rating__stars,"aria-hidden":!0,children:Array.from({length:5},(d,l)=>{const p=l+1;return _>=p?t.jsx(D.StarFill,{},l):_>=p-.5?t.jsx(D.StarHalf,{},l):t.jsx(D.StarFill,{className:ct.rating__empty},l)})}),t.jsx("span",{className:ct.rating__srOnly,children:s??fe("Rating.srLabel",(h=o==null?void 0:o.rating)==null?void 0:h.srLabel,e,a)}),U.isDefined(a)&&t.jsxs("span",{className:ct.rating__count,"aria-hidden":!0,children:["(",a,")"]})]})},sd=n.memo(nd),rd="hanui-header-a08Jh",od="hanui-header__text-ArJkA",id="hanui-header__overline-X5Epo",cd="hanui-header__title-nQQQJ",ld="hanui-header__description-08oCr",dd="hanui-header__action-xsxQF",Qe={header:rd,header__text:od,header__overline:id,header__title:cd,header__description:ld,header__action:dd,"header--sm":"hanui-header--sm-mIJWZ","header--lg":"hanui-header--lg-QBLIz"},ud=({title:e,description:a,overline:s,action:r,as:i="h2",size:c="md",className:o,testId:_})=>t.jsxs("header",{className:v(Qe.header,Qe[`header--${c}`],o),"data-testid":_,children:[t.jsxs("div",{className:Qe.header__text,children:[s&&t.jsx("span",{className:Qe.header__overline,children:s}),t.jsx(i,{className:Qe.header__title,children:e}),a&&t.jsx("p",{className:Qe.header__description,children:a})]}),r&&t.jsx("div",{className:Qe.header__action,children:r})]}),_d=n.memo(ud),hd="hanui-scrollArea-Ly-yT",Zt={scrollArea:hd,"scrollArea--vertical":"hanui-scrollArea--vertical-2ujC7","scrollArea--horizontal":"hanui-scrollArea--horizontal-e9pu-","scrollArea--both":"hanui-scrollArea--both-lv-8W","scrollArea--fade":"hanui-scrollArea--fade-01Bbm"},pd=({children:e,label:a,axis:s="vertical",maxHeight:r,hasFade:i,className:c,testId:o})=>{const _=n.useRef(null),[h,d]=n.useState(!1),[l,p]=n.useState({start:!1,end:!1});return n.useEffect(()=>{const u=_.current;if(!u||typeof ResizeObserver>"u")return;const b=()=>{const k=u.scrollHeight>u.clientHeight,m=u.scrollWidth>u.clientWidth;d(s==="horizontal"?m:s==="vertical"?k:k||m);const f=s==="horizontal",N=f?u.clientWidth:u.clientHeight,j=f?u.scrollWidth:u.scrollHeight,x=Math.abs(f?u.scrollLeft:u.scrollTop);p({start:x>1,end:x+N<j-1})};b();const g=new ResizeObserver(b);g.observe(u);for(const k of u.children)g.observe(k);return u.addEventListener("scroll",b,{passive:!0}),()=>{g.disconnect(),u.removeEventListener("scroll",b)}},[s,e]),t.jsx("div",{ref:_,className:v(Zt.scrollArea,Zt[`scrollArea--${s}`],i&&Zt["scrollArea--fade"],c),style:r===void 0?void 0:{maxBlockSize:r},"data-fade-start":i&&l.start?"":void 0,"data-fade-end":i&&l.end?"":void 0,tabIndex:h?0:void 0,role:h?"region":void 0,"aria-label":h?a:void 0,"data-testid":o,children:e})},md=n.memo(L(pd,"ScrollArea")),bd="hanui-skeleton-n92if",gd="hanui-group-YMfwa",fd="hanui-card-XQs-Q",xd="hanui-card__media-YLJDv",vd="hanui-card__body-msRvB",yd="hanui-rows-EZ9Am",wd="hanui-row-se56N",kd="hanui-row__text-TD4iS",jd="hanui-table-L328g",Nd="hanui-table__row-rSJTK",ie={skeleton:bd,"skeleton--block":"hanui-skeleton--block-tOZ-a","skeleton--text":"hanui-skeleton--text-k-ROi","skeleton--circle":"hanui-skeleton--circle-x-mX3",group:gd,card:fd,card__media:xd,card__body:vd,rows:yd,row:wd,row__text:kd,table:jd,table__row:Nd},Oe=({width:e,height:a,variant:s="block",lines:r=1,className:i})=>{const c={width:U.isNumber(e)?`${e}px`:e,height:U.isNumber(a)?`${a}px`:a};return s==="text"&&r>1?t.jsx("span",{className:v(ie.group,i),"aria-hidden":!0,children:Array.from({length:r},(o,_)=>t.jsx("span",{className:v(ie.skeleton,ie["skeleton--text"]),style:_===r-1?{width:"60%"}:void 0},_))}):t.jsx("span",{className:v(ie.skeleton,ie[`skeleton--${s}`],i),style:c,"aria-hidden":!0})},$d=n.memo(Oe),Ed=({count:e=1,className:a})=>t.jsx(t.Fragment,{children:Array.from({length:e},(s,r)=>t.jsxs("div",{className:v(ie.card,a),"aria-hidden":!0,children:[t.jsx(Oe,{className:ie.card__media}),t.jsxs("div",{className:ie.card__body,children:[t.jsx(Oe,{variant:"text",width:"70%"}),t.jsx(Oe,{variant:"text",width:"40%"})]})]},r))}),Cd=({count:e=3,className:a})=>t.jsx("div",{className:v(ie.rows,a),"aria-hidden":!0,children:Array.from({length:e},(s,r)=>t.jsxs("div",{className:ie.row,children:[t.jsx(Oe,{variant:"circle",width:36,height:36}),t.jsxs("div",{className:ie.row__text,children:[t.jsx(Oe,{variant:"text",width:"45%"}),t.jsx(Oe,{variant:"text",width:"25%"})]})]},r))}),Id=({count:e=5,columns:a=4,className:s})=>t.jsx("div",{className:v(ie.table,s),"aria-hidden":!0,children:Array.from({length:e},(r,i)=>t.jsx("div",{className:ie.table__row,children:Array.from({length:a},(c,o)=>t.jsx(Oe,{variant:"text"},o))},i))}),Td=L(n.memo(Ed),"SkeletonCard"),Rd=L(n.memo(Cd),"SkeletonRows"),Dd=L(n.memo(Id),"SkeletonTable"),Sd="hanui-stat-Xb7wp",Ld="hanui-stat__icon-MB8NU",Ad="hanui-stat__label-kUX2m",Fd="hanui-stat__value--6p13",Bd="hanui-stat__unit-mjHVk",Md="hanui-stat__delta-YKpOu",Pd="hanui-stat__description-Yvw6J",Od="hanui-stat__srOnly-YKebA",le={stat:Sd,"stat--sm":"hanui-stat--sm-XnK8p","stat--plain":"hanui-stat--plain-N-3RC",stat__icon:Ld,stat__label:Ad,stat__value:Fd,stat__unit:Bd,stat__delta:Md,"stat__delta--positive":"hanui-stat__delta--positive-1AUAM","stat__delta--negative":"hanui-stat__delta--negative--WWEP",stat__description:Pd,stat__srOnly:Od},Hd={up:t.jsx(D.ArrowUpShort,{"aria-hidden":!0}),down:t.jsx(D.ArrowDownShort,{"aria-hidden":!0}),flat:t.jsx(D.DashLg,{"aria-hidden":!0})},Aa={up:"increase",down:"decrease",flat:"unchanged"},zd=({label:e,value:a,unit:s,delta:r,trend:i,isUpPositive:c=!0,description:o,icon:_,variant:h="card",size:d="md",className:l,testId:p})=>{var g;const{labels:u}=O(),b=i==="flat"?void 0:i==="up"===c;return t.jsxs("div",{className:v(le.stat,le[`stat--${d}`],le[`stat--${h}`],l),"data-testid":p,children:[_&&t.jsx("span",{className:le.stat__icon,"aria-hidden":!0,children:_}),t.jsx("span",{className:le.stat__label,children:e}),t.jsxs("span",{className:le.stat__value,children:[a,s&&t.jsx("span",{className:le.stat__unit,children:s})]}),r&&i&&t.jsxs("span",{className:v(le.stat__delta,b===!0&&le["stat__delta--positive"],b===!1&&le["stat__delta--negative"]),children:[Hd[i],r,t.jsx("span",{className:le.stat__srOnly,children:P(`Stat.${Aa[i]}`,(g=u==null?void 0:u.stat)==null?void 0:g[Aa[i]])})]}),o&&t.jsx("span",{className:le.stat__description,children:o})]})},Kd=n.memo(L(zd,"Stat")),Ud="hanui-card-wkzhi",qd="hanui-card__media--Lm-v",Yd="hanui-card__content-8uHkm",Xd="hanui-card__title-1EwbD",Wd="hanui-card__link-mhY-M",Gd="hanui-card__description-3O0R7",Qd="hanui-card__meta-Xzk4q",Ve={card:Ud,card__media:qd,card__content:Yd,card__title:Xd,card__link:Wd,card__description:Gd,card__meta:Qd},Vd=({title:e,href:a,description:s,meta:r,media:i,headingLevel:c=3,linkProps:o,className:_,testId:h})=>{const d=`h${c}`;return t.jsxs("article",{className:v(Ve.card,_),"data-testid":h,children:[i&&t.jsx("span",{className:Ve.card__media,"aria-hidden":!0,children:i}),t.jsxs("div",{className:Ve.card__content,children:[t.jsx(d,{className:Ve.card__title,children:t.jsx(_e,{href:a,className:Ve.card__link,...o,children:e})}),s&&t.jsx("p",{className:Ve.card__description,children:s}),r&&t.jsx("div",{className:Ve.card__meta,children:r})]})]})},Jd=n.memo(L(Vd,"SummaryCard")),Zd="hanui-hub-JoqOf",eu="hanui-toast-U27Of",tu="hanui-toast__icon-p-rgI",au="hanui-toast__text-rG4ji",nu="hanui-toast__message-s6S2-",su="hanui-toast__description-0cYTx",ru="hanui-toast__action-fOXU5",ou="hanui-toast__close-QxSNP",De={hub:Zd,toast:eu,"toast--info":"hanui-toast--info-S1QJr","toast--success":"hanui-toast--success-NUso7","toast--warning":"hanui-toast--warning-7mi-S","toast--danger":"hanui-toast--danger-IhFSz",toast__icon:tu,toast__text:au,toast__message:nu,toast__description:su,toast__action:ru,toast__close:ou},iu={info:t.jsx(D.InfoCircleFill,{"aria-hidden":!0}),success:t.jsx(D.CheckCircleFill,{"aria-hidden":!0}),warning:t.jsx(D.ExclamationTriangleFill,{"aria-hidden":!0}),danger:t.jsx(D.XCircleFill,{"aria-hidden":!0})},cu={info:4e3,success:4e3,warning:6e3,danger:8e3};let Fa=0;const na=new Set;let et=[];const ga=()=>na.forEach(e=>e(et)),sa=e=>{et=et.filter(a=>a.id!==e),ga()},jt=(e,a={})=>{Fa+=1;const s=Fa;return et=[...et,{...a,id:s,message:e}].slice(-3),ga(),s},lu={show:jt,info:(e,a)=>jt(e,{...a,tone:"info"}),success:(e,a)=>jt(e,{...a,tone:"success"}),warning:(e,a)=>jt(e,{...a,tone:"warning"}),error:(e,a)=>jt(e,{...a,tone:"danger"}),dismiss:sa,clear:()=>{et=[],ga()}},du=({toast:e,closeLabel:a,onDismiss:s})=>{const r=e.tone??"info",i=e.duration??cu[r],[c,o]=n.useState(!1),_=n.useRef(i),h=n.useRef(0);return n.useEffect(()=>{if(i===0||c)return;h.current=Date.now();const d=window.setTimeout(()=>s(e.id),_.current);return()=>{window.clearTimeout(d),_.current=Math.max(0,_.current-(Date.now()-h.current))}},[i,c,s,e.id]),t.jsxs("div",{className:v(De.toast,De[`toast--${r}`]),role:r==="danger"?"alert":"status",onPointerEnter:()=>o(!0),onPointerLeave:()=>o(!1),onFocus:()=>o(!0),onBlur:()=>o(!1),children:[t.jsx("span",{className:De.toast__icon,"aria-hidden":!0,children:iu[r]}),t.jsxs("div",{className:De.toast__text,children:[t.jsx("span",{className:De.toast__message,children:e.message}),e.description&&t.jsx("span",{className:De.toast__description,children:e.description})]}),e.action&&t.jsx("button",{type:"button",className:De.toast__action,onClick:()=>{var d;(d=e.action)==null||d.onClick(),s(e.id)},children:e.action.label}),t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:a,variant:"ghost",size:"sm",className:De.toast__close,onClick:()=>s(e.id)})]})},uu=({closeLabel:e,regionLabel:a,className:s})=>{const{labels:r}=O(),[i,c]=n.useState([]);n.useEffect(()=>(na.add(c),c(et),()=>{na.delete(c)}),[]);const o=n.useCallback(l=>sa(l),[]),_=n.useCallback(()=>{const l=i.at(-1);l&&sa(l.id)},[i]);ua(i.length>0,_);const[h,d]=n.useState(!1);return n.useEffect(()=>d(!0),[]),h?It.createPortal(t.jsx("div",{className:v(De.hub,s),role:"region","aria-label":P("ToastHub.regionLabel",a,r==null?void 0:r.notifications),"aria-live":"polite","aria-relevant":"additions",children:i.map(l=>t.jsx(du,{toast:l,closeLabel:P("ToastHub.closeLabel",e,r==null?void 0:r.close),onDismiss:o},l.id))}),document.body):null},nn=n.memo(L(uu,"ToastHub")),_u=()=>{const[e,a]=n.useState(!1);return n.useEffect(()=>a(!0),[]),e?t.jsx(nn,{}):null},hu=n.memo(L(_u,"ToastPortal")),pu="hanui-accordion-h9jLC",mu="hanui-accordion__item--YvzK",bu="hanui-accordion__title-qZOLY",gu="hanui-accordion__meta-PSlsO",fu="hanui-accordion__marker-QcWcI",xu="hanui-accordion__summary-QUhWh",vu="hanui-accordion__panel--3EXE",yu="hanui-accordion__content-fO64s",Ce={accordion:pu,accordion__item:mu,"accordion__item--disabled":"hanui-accordion__item--disabled-x1erZ",accordion__title:bu,accordion__meta:gu,accordion__marker:fu,accordion__summary:xu,accordion__panel:vu,accordion__content:yu},wu=({items:e,isSingle:a,defaultOpenIds:s,openIds:r,onChange:i,className:c,testId:o})=>{const _=n.useId(),[h,d]=n.useState(s??[]),l=r!==void 0,p=l?r:h,u=n.useCallback((g,k)=>{const m=k?a?[g]:[...p.filter(f=>f!==g),g]:p.filter(f=>f!==g);l||d(m),i==null||i(m)},[l,a,i,p]),b=n.useRef(new Map);return n.useEffect(()=>{e.forEach(g=>{const k=b.current.get(g.id);k&&(k.open=p.includes(g.id))})}),t.jsx("div",{className:v(Ce.accordion,c),"data-testid":o,children:e.map(g=>{const k=p.includes(g.id);return t.jsxs("details",{ref:m=>{m?b.current.set(g.id,m):b.current.delete(g.id)},className:v(Ce.accordion__item,g.isDisabled&&Ce["accordion__item--disabled"]),open:k,onToggle:m=>{const f=m.currentTarget.open;f!==k&&u(g.id,f)},children:[t.jsxs("summary",{id:`${_}-${g.id}`,className:Ce.accordion__summary,"aria-disabled":g.isDisabled,tabIndex:g.isDisabled?-1:void 0,onClick:m=>g.isDisabled&&m.preventDefault(),children:[t.jsx(D.CaretRightFill,{"aria-hidden":!0,className:Ce.accordion__marker}),t.jsx("span",{className:Ce.accordion__title,children:g.title}),g.meta&&t.jsx("span",{className:Ce.accordion__meta,children:g.meta})]}),t.jsx("div",{className:Ce.accordion__panel,children:t.jsx("div",{className:Ce.accordion__content,children:g.content})})]},g.id)})})},ku=n.memo(L(wu,"Accordion")),ju="hanui-steps-ntge1",Nu="hanui-steps__label-NSeFM",$u="hanui-steps__item-GrU1x",Eu="hanui-steps__button-XBsnS",Cu="hanui-steps__marker-g-GLE",Iu="hanui-steps__text-Mkpkh",Tu="hanui-steps__description-bQuNT",Ru="hanui-steps__status-wWJfP",de={steps:ju,"steps--horizontal":"hanui-steps--horizontal-O-mkx","steps--vertical":"hanui-steps--vertical-agfwo","steps--static":"hanui-steps--static-t9EED",steps__label:Nu,steps__item:$u,steps__button:Eu,steps__marker:Cu,"steps__item--done":"hanui-steps__item--done-mvOuN","steps__item--current":"hanui-steps__item--current-Qzlal",steps__text:Iu,steps__description:Tu,steps__status:Ru},Du=(e,a)=>e<a?"done":e===a?"current":"upcoming",Ba={done:"completed",current:"current",upcoming:"upcoming"},Su=({steps:e,currentIndex:a,onStepClick:s,label:r,orientation:i="horizontal",className:c,testId:o})=>{const{labels:_}=O();return t.jsx("ol",{className:v(de.steps,de[`steps--${i}`],a===void 0&&de["steps--static"],c),"aria-label":r,"data-testid":o,children:e.map((h,d)=>{var b;const l=a===void 0?void 0:Du(d,a),p=!!s&&l==="done",u=t.jsxs(t.Fragment,{children:[t.jsx("span",{className:de.steps__marker,"aria-hidden":!0,children:l==="done"?t.jsx(D.CheckLg,{}):d+1}),t.jsxs("span",{className:de.steps__text,children:[t.jsx("span",{className:de.steps__label,children:h.label}),h.description&&t.jsx("span",{className:de.steps__description,children:h.description})]}),l&&t.jsx("span",{className:de.steps__status,children:P(`Steps.${Ba[l]}`,(b=_==null?void 0:_.steps)==null?void 0:b[Ba[l]])})]});return t.jsx("li",{className:v(de.steps__item,l&&de[`steps__item--${l}`]),"aria-current":l==="current"?"step":void 0,children:p?t.jsx("button",{type:"button",className:de.steps__button,onClick:()=>s==null?void 0:s(d),children:u}):t.jsx("span",{className:de.steps__button,children:u})},h.id)})})},Lu=n.memo(L(Su,"Steps")),Au="hanui-tabs-l4dFE",Fu="hanui-tabs__list-HJvR8",Bu="hanui-tabs__tab-7gDW7",Mu="hanui-tabs__count-8JX8s",Pu="hanui-tabs__panel-CPklY",lt={tabs:Au,tabs__list:Fu,tabs__tab:Bu,"tabs__tab--active":"hanui-tabs__tab--active-riqNp",tabs__count:Mu,tabs__panel:Pu},Ou=({items:e,defaultTabId:a,activeId:s,onChange:r,ariaLabel:i,isManualActivation:c,className:o,testId:_})=>{var I;const h=n.useId(),[d,l]=n.useState(a??((I=e[0])==null?void 0:I.id)),p=U.isDefined(s),u=p?s:d,b=e.findIndex(w=>w.id===u),[g,k]=n.useState(b<0?0:b),m=n.useRef(null),f=e[b]??e[0],N=g>=0&&g<e.length?g:Math.max(b,0);n.useEffect(()=>{k(b<0?0:b)},[b]);const j=n.useRef(!1);n.useEffect(()=>{var w;if(!j.current){j.current=!0;return}ia((w=m.current)==null?void 0:w.querySelector('[aria-selected="true"]'),{block:"nearest",inline:"nearest"})},[u]);const x=w=>{p||l(w),r==null||r(w)},E=w=>{var y;if(c&&(w.key==="Enter"||w.key===" ")){w.preventDefault();const $=e[N];$&&x($.id);return}const C=w.key==="ArrowRight"?1:w.key==="ArrowLeft"?-1:0;if(C===0)return;w.preventDefault();const T=((c?N:b)+C+e.length)%e.length;k(T),c||x(e[T].id),(y=document.getElementById(`${h}-tab-${e[T].id}`))==null||y.focus()};if(e.length===0)return null;const R=U.isDefined(f==null?void 0:f.content);return t.jsxs("div",{className:v(lt.tabs,o),"data-testid":_,children:[t.jsx("div",{ref:m,className:lt.tabs__list,role:"tablist","aria-label":i,onKeyDown:E,children:e.map(w=>{var T;const C=w.id===f.id;return t.jsxs("button",{id:`${h}-tab-${w.id}`,type:"button",role:"tab","aria-selected":C,"aria-controls":C&&R?`${h}-panel-${w.id}`:void 0,tabIndex:(c?((T=e[N])==null?void 0:T.id)===w.id:C)?0:-1,className:v(lt.tabs__tab,C&<["tabs__tab--active"]),onClick:()=>x(w.id),children:[w.label,U.isDefined(w.count)&&t.jsx("span",{className:lt.tabs__count,children:w.count})]},w.id)})}),R&&t.jsx("div",{id:`${h}-panel-${f.id}`,role:"tabpanel","aria-labelledby":`${h}-tab-${f.id}`,className:lt.tabs__panel,tabIndex:0,children:f.content})]})},Hu=n.memo(Ou),zu="hanui-tile-TGur-",Ku="hanui-tile__medallion--Y0pz",Uu="hanui-tile__label-mI1OQ",qu="hanui-tile__meta-22qnR",Nt={tile:zu,tile__medallion:Ku,tile__label:Uu,tile__meta:qu,"tile--active":"hanui-tile--active-z0F2M"},Yu=({label:e,icon:a,href:s,meta:r,isActive:i,linkProps:c,className:o,testId:_})=>t.jsxs(_e,{href:s,className:v(Nt.tile,i&&Nt["tile--active"],o),"aria-current":i?"page":void 0,"data-testid":_,...c,children:[t.jsx("span",{className:Nt.tile__medallion,"aria-hidden":!0,children:a}),t.jsx("span",{className:Nt.tile__label,children:e}),r&&t.jsx("span",{className:Nt.tile__meta,children:r})]}),Xu=n.memo(Yu),Wu="hanui-timeline-GxubZ",Gu="hanui-timeline__item-qMpF2",Qu="hanui-timeline__marker-MDk07",Vu="hanui-timeline__body-xJi7t",Ju="hanui-timeline__title-pKxZJ",Zu="hanui-timeline__time-ITWYy",e_="hanui-timeline__description-4vrEy",t_="hanui-timeline__srOnly-7K2We",Ie={timeline:Wu,timeline__item:Gu,timeline__marker:Qu,"timeline__item--done":"hanui-timeline__item--done-dqiOQ","timeline__item--current":"hanui-timeline__item--current-TGV5f","timeline__item--pending":"hanui-timeline__item--pending-VMZTS","timeline__item--failed":"hanui-timeline__item--failed-2BbfX",timeline__body:Vu,timeline__title:Ju,timeline__time:Zu,timeline__description:e_,timeline__srOnly:t_},a_={done:t.jsx(D.CheckLg,{}),failed:t.jsx(D.XLg,{}),current:null,pending:null},ea={done:"completed",current:"current",pending:null,failed:"failed"},n_=({events:e,label:a,className:s,testId:r})=>{const{labels:i}=O();return t.jsx("ol",{className:v(Ie.timeline,s),"aria-label":a,"data-testid":r,children:e.map(c=>{var _;const o=c.status??"done";return t.jsxs("li",{className:v(Ie.timeline__item,Ie[`timeline__item--${o}`]),"aria-current":o==="current"?"step":void 0,children:[t.jsx("span",{className:Ie.timeline__marker,"aria-hidden":!0,children:c.icon??a_[o]}),t.jsxs("div",{className:Ie.timeline__body,children:[t.jsxs("span",{className:Ie.timeline__title,children:[c.title,t.jsx("span",{className:Ie.timeline__srOnly,children:ea[o]===null?null:P(`Timeline.${ea[o]}`,(_=i==null?void 0:i.timeline)==null?void 0:_[ea[o]])})]}),c.time&&t.jsx("span",{className:Ie.timeline__time,children:c.time}),c.description&&t.jsx("span",{className:Ie.timeline__description,children:c.description})]})]},c.id)})})},s_=n.memo(L(n_,"Timeline")),r_="hanui-modal-3IDi9",o_="hanui-modal__panel--qLSz",i_="hanui-modal__header-meWm6",c_="hanui-modal__icon-df2dd",l_="hanui-modal__heading-PwDS8",d_="hanui-modal__title-80Sh6",u_="hanui-modal__description-fsCHI",__="hanui-modal__close-vFPbw",h_="hanui-modal__body-PDF12",p_="hanui-modal__footer-CCCkx",se={modal:r_,"modal--sm":"hanui-modal--sm-A7WsS","modal--lg":"hanui-modal--lg-z99Em",modal__panel:o_,modal__header:i_,modal__icon:c_,"modal__icon--neutral":"hanui-modal__icon--neutral-QSL7c","modal__icon--danger":"hanui-modal__icon--danger-6V90a","modal__icon--warning":"hanui-modal__icon--warning-a--FX","modal__icon--success":"hanui-modal__icon--success-YWxZs","modal__icon--info":"hanui-modal__icon--info-WRLah",modal__heading:l_,modal__title:d_,modal__description:u_,modal__close:__,modal__body:h_,modal__footer:p_},m_=({isOpen:e,onClose:a,title:s,closeLabel:r,children:i,description:c,footer:o,icon:_,tone:h="neutral",size:d="md",isDismissable:l=!0,className:p,testId:u})=>{const{labels:b}=O(),g=n.useRef(null),k=n.useRef(null),m=n.useId(),f=n.useId();n.useEffect(()=>{const j=g.current;if(!j)return;if(!e){j.open&&j.close();return}const x=pt();j.open||j.showModal(),Ut(j,`.${se.modal__close}`),da(j);const{token:E,pop:R}=Tt();return k.current=E,()=>{R(),k.current=null,x()}},[e]),qt(e),n.useEffect(()=>{const j=g.current;if(!j)return;const x=E=>{E.preventDefault(),l&&(k.current&&!Rt(k.current)||a())};return j.addEventListener("cancel",x),()=>j.removeEventListener("cancel",x)},[a,l]);const N=n.useCallback(j=>{l&&j.target===g.current&&a()},[l,a]);return t.jsx("dialog",{ref:g,className:v(se.modal,se[`modal--${d}`],p),"aria-labelledby":m,"aria-describedby":c?f:void 0,"data-testid":u,onClick:N,children:t.jsxs("div",{className:se.modal__panel,children:[t.jsxs("header",{className:se.modal__header,children:[_&&t.jsx("span",{className:v(se.modal__icon,se[`modal__icon--${h}`]),children:_}),t.jsxs("div",{className:se.modal__heading,children:[t.jsx("h2",{id:m,className:se.modal__title,children:s}),c&&t.jsx("p",{id:f,className:se.modal__description,children:c})]}),l&&t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:P("Modal.closeLabel",r,b==null?void 0:b.close),variant:"ghost",size:"sm",className:se.modal__close,onClick:a})]}),i&&t.jsx("div",{className:se.modal__body,children:i}),o&&t.jsx("footer",{className:se.modal__footer,children:o})]})})},fa=n.memo(m_),b_="hanui-palette-ag-P9",g_="hanui-palette__search-G3aYv",f_="hanui-palette__searchIcon-2UYj-",x_="hanui-palette__input-vvLvt",v_="hanui-palette__list--KWiH",y_="hanui-palette__group-KPj5Q",w_="hanui-palette__item-UZzkp",k_="hanui-palette__icon-Fg0Lt",j_="hanui-palette__text-flfN9",N_="hanui-palette__label-8-UHe",$_="hanui-palette__description-eRlk9",E_="hanui-palette__shortcut-DwYKX",C_="hanui-palette__empty-vg-I3",ee={palette:b_,palette__search:g_,palette__searchIcon:f_,palette__input:x_,palette__list:v_,palette__group:y_,palette__item:w_,"palette__item--active":"hanui-palette__item--active-XHcka",palette__icon:k_,palette__text:j_,palette__label:N_,palette__description:$_,palette__shortcut:E_,palette__empty:C_},I_=({isOpen:e,onClose:a,items:s,label:r,searchPlaceholder:i,emptyMessage:c,className:o,testId:_})=>{const h=n.useId(),d=`${h}-listbox`,l=n.useRef(null),p=n.useRef(null),u=n.useRef(null),[b,g]=n.useState(""),[k,m]=n.useState(0),f=n.useMemo(()=>{if(b.trim()==="")return s;const x=b.trim();return s.filter(E=>Ct(E.label,x)||(E.description?Ct(E.description,x):!1))},[s,b]);qt(e),n.useEffect(()=>{var w;const x=l.current;if(!x)return;if(!e){x.open&&x.close();return}const E=pt();x.open||x.showModal(),(w=p.current)==null||w.focus({preventScroll:!0}),g(""),m(0);const{token:R,pop:I}=Tt();return u.current=R,()=>{I(),u.current=null,E()}},[e]),n.useEffect(()=>{const x=l.current;if(!x)return;const E=R=>{R.preventDefault(),!(u.current&&!Rt(u.current))&&a()};return x.addEventListener("cancel",E),()=>x.removeEventListener("cancel",E)},[a]),n.useEffect(()=>{var x;ia((x=l.current)==null?void 0:x.querySelector(`[data-index="${k}"]`),{block:"nearest"})},[k]);const N=x=>{x.onSelect(),a()},j=x=>{const E=f.length-1;switch(x.key){case"ArrowDown":x.preventDefault(),m(R=>R>=E?0:R+1);break;case"ArrowUp":x.preventDefault(),m(R=>R<=0?E:R-1);break;case"Home":x.preventDefault(),m(0);break;case"End":x.preventDefault(),m(E);break;case"Enter":{x.preventDefault();const R=f[k];R&&N(R);break}}};return t.jsxs("dialog",{ref:l,className:v(ee.palette,o),"aria-label":r,"data-testid":_,onClick:x=>x.target===l.current&&a(),children:[t.jsxs("div",{className:ee.palette__search,children:[t.jsx(D.Search,{"aria-hidden":!0,className:ee.palette__searchIcon}),t.jsx("input",{ref:p,type:"text",role:"combobox",className:ee.palette__input,value:b,placeholder:i,"aria-label":i,autoComplete:"off","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":d,"aria-activedescendant":f[k]?`${h}-option-${k}`:void 0,onChange:x=>{g(x.target.value),m(0)},onKeyDown:j})]}),t.jsxs("ul",{id:d,role:"listbox","aria-label":r,className:ee.palette__list,children:[f.map((x,E)=>{var I;const R=x.group!==void 0&&x.group!==((I=f[E-1])==null?void 0:I.group);return t.jsxs("li",{role:"presentation",children:[R&&t.jsx("span",{className:ee.palette__group,"aria-hidden":!0,children:x.group}),t.jsxs("div",{id:`${h}-option-${E}`,role:"option","data-index":E,"aria-selected":E===k,className:v(ee.palette__item,E===k&&ee["palette__item--active"]),onMouseEnter:()=>m(E),onClick:()=>N(x),children:[x.icon&&t.jsx("span",{className:ee.palette__icon,"aria-hidden":!0,children:x.icon}),t.jsxs("span",{className:ee.palette__text,children:[t.jsx("span",{className:ee.palette__label,children:x.label}),x.description&&t.jsx("span",{className:ee.palette__description,children:x.description})]}),x.shortcut&&t.jsx("kbd",{className:ee.palette__shortcut,"aria-hidden":!0,children:x.shortcut})]})]},x.id)}),f.length===0&&t.jsx("li",{role:"presentation",className:ee.palette__empty,children:c})]})]})},T_=n.memo(L(I_,"CommandPalette")),R_={destructive:t.jsx(D.TrashFill,{"aria-hidden":!0}),warning:t.jsx(D.ExclamationTriangleFill,{"aria-hidden":!0}),neutral:t.jsx(D.QuestionCircleFill,{"aria-hidden":!0})},D_={destructive:"danger",warning:"warning",neutral:"info"},S_={destructive:ke.DANGER,warning:ke.PRIMARY,neutral:ke.PRIMARY},L_=({isOpen:e,onClose:a,onConfirm:s,title:r,description:i,confirmLabel:c,cancelLabel:o,closeLabel:_,variant:h,kind:d,children:l})=>{const{labels:p}=O(),[u,b]=n.useState(!1),g=h??d??"neutral",k=async()=>{b(!0);try{await s()}finally{b(!1)}};return t.jsx(fa,{isOpen:e,onClose:a,title:r,closeLabel:_??(p==null?void 0:p.close),description:i,icon:R_[g],tone:D_[g],size:"sm",isDismissable:!u,footer:t.jsxs(t.Fragment,{children:[t.jsx(_t,{variant:ke.SECONDARY,size:ze.MEDIUM,onClick:a,disabled:u,children:P("ConfirmDialog.cancelLabel",o,p==null?void 0:p.cancel)}),t.jsx(_t,{variant:S_[g],size:ze.MEDIUM,onClick:k,isLoading:u,children:c})]}),children:l})},A_=n.memo(L_),F_="hanui-drawer-fgfi1",B_="hanui-drawer__header-BDcRe",M_="hanui-drawer__title-9M0e8",P_="hanui-drawer__close-Z30oW",O_="hanui-drawer__toolbar-vcsYi",H_="hanui-drawer__body-x12SX",z_="hanui-drawer__footer-PajTg",ye={drawer:F_,"drawer--sm":"hanui-drawer--sm-ywgof","drawer--md":"hanui-drawer--md-mN8Kg","drawer--lg":"hanui-drawer--lg-5H-oE","drawer--end":"hanui-drawer--end-q-sIP","drawer--start":"hanui-drawer--start-xqVlX",drawer__header:B_,drawer__title:M_,drawer__close:P_,drawer__toolbar:O_,drawer__body:H_,drawer__footer:z_},K_=({isOpen:e,onClose:a,title:s,closeLabel:r,children:i,side:c="end",size:o="md",footer:_,toolbar:h,className:d,testId:l})=>{const{labels:p}=O(),u=n.useRef(null),b=n.useRef(null),g=n.useId();n.useEffect(()=>{const m=u.current;if(!m)return;if(!e){m.open&&m.close();return}const f=pt();m.open||m.showModal(),Ut(m,`.${ye.drawer__close}`),da(m);const{token:N,pop:j}=Tt();return b.current=N,()=>{j(),b.current=null,f()}},[e]),qt(e),Va(e),n.useEffect(()=>{const m=u.current;if(!m)return;const f=N=>{N.preventDefault(),!(b.current&&!Rt(b.current))&&a()};return m.addEventListener("cancel",f),()=>m.removeEventListener("cancel",f)},[a]);const k=n.useCallback(m=>{m.target===u.current&&a()},[a]);return t.jsxs("dialog",{ref:u,className:v(ye.drawer,ye[`drawer--${c}`],ye[`drawer--${o}`],d),"aria-labelledby":g,"data-testid":l,onClick:k,children:[t.jsxs("header",{className:ye.drawer__header,children:[t.jsx("h2",{id:g,className:ye.drawer__title,children:s}),t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:P("Drawer.closeLabel",r,p==null?void 0:p.close),variant:"ghost",size:"sm",className:ye.drawer__close,onClick:a})]}),h&&t.jsx("div",{className:ye.drawer__toolbar,children:h}),t.jsx("div",{className:ye.drawer__body,children:i}),_&&t.jsx("div",{className:ye.drawer__footer,children:_})]})},U_=n.memo(L(K_,"Drawer")),q_="hanui-form-zpZn4",Y_={form:q_},X_=({isOpen:e,onClose:a,onSubmit:s,title:r,label:i,submitLabel:c,cancelLabel:o,closeLabel:_,description:h,hint:d,placeholder:l,defaultValue:p="",isRequired:u,requiredLabel:b,inputMode:g="text",maxLength:k,rows:m=4})=>{const{labels:f}=O(),N=n.useId(),[j,x]=n.useState(p),[E,R]=n.useState(!1),I=n.useRef(!1);n.useEffect(()=>{e&&!I.current&&x(p),I.current=e},[e,p]);const w=j.trim(),C=!!u&&w==="",T=$=>g==="multiline"?t.jsx(Ja,{...$,value:j,onChange:M=>x(M.target.value),placeholder:l,maxLength:k,rows:m}):t.jsx(ba,{...$,type:g==="number"?"number":"text",value:j,onChange:M=>x(M.target.value),placeholder:l,maxLength:k}),y=async()=>{if(!(C||E)){R(!0);try{await s(w),a()}catch{}finally{R(!1)}}};return t.jsx(fa,{isOpen:e,onClose:a,title:r,closeLabel:_??(f==null?void 0:f.close),description:h,size:"sm",isDismissable:!E,footer:t.jsxs(t.Fragment,{children:[t.jsx(_t,{variant:ke.SECONDARY,size:ze.MEDIUM,onClick:a,disabled:E,children:P("PromptDialog.cancelLabel",o,f==null?void 0:f.cancel)}),t.jsx(_t,{type:"submit",form:N,variant:ke.PRIMARY,size:ze.MEDIUM,disabled:C,isLoading:E,children:P("PromptDialog.submitLabel",c,f==null?void 0:f.submit)})]}),children:t.jsx("form",{id:N,className:Y_.form,onSubmit:$=>{$.preventDefault(),y()},children:t.jsx(Za,{label:i,hint:d,isRequired:u,requiredLabel:b,children:T})})})},W_=n.memo(X_),G_="hanui-scroller-EtDmS",Q_="hanui-table-uCv4q",dt={scroller:G_,"scroller--frame":"hanui-scroller--frame-84zz6",table:Q_,"table--compact":"hanui-table--compact-4KCVl","table--regular":"hanui-table--regular-hsA3-","table--spacious":"hanui-table--spacious-BBUX-","table--sticky-head":"hanui-table--sticky-head-FO2L4","table--row-hover":"hanui-table--row-hover--MAoe"},V_=L(n.memo(({hasFrame:e=!0,label:a,className:s,children:r,...i})=>{const c=n.useRef(null),[o,_]=n.useState(!1);return n.useEffect(()=>{const h=c.current;if(!h||typeof ResizeObserver>"u")return;const d=()=>_(h.scrollWidth>h.clientWidth+1);d();const l=new ResizeObserver(d);l.observe(h);for(const p of h.children)l.observe(p);return()=>l.disconnect()},[r]),t.jsx("div",{ref:c,tabIndex:o?0:void 0,role:o?"region":void 0,"aria-label":o?a:void 0,className:v(dt.scroller,e&&dt["scroller--frame"],s),...i,children:r})}),"TableScroller"),J_=({density:e="regular",hasStickyHead:a,hasRowHover:s,className:r,children:i,...c})=>t.jsx("table",{className:v(dt.table,dt[`table--${e}`],a&&dt["table--sticky-head"],s&&dt["table--row-hover"],r),...c,children:i}),Z_=n.memo(J_),eh="hanui-wrapper-KXCZg",th="hanui-table-LF5Ow",ah="hanui-state-YPPb0",nh="hanui-state__message-wwbIW",sh="hanui-srOnly-Oia8c",rh="hanui-sort-3Q6Fx",oh="hanui-sort__arrow-MITWb",ih="hanui-sticky-KDEvQ",ch="hanui-bulkBar-62qk0",te={wrapper:eh,"wrapper--capped":"hanui-wrapper--capped-M2QUJ",table:th,state:ah,"state--error":"hanui-state--error-A492d",state__message:nh,"row--warning":"hanui-row--warning-BAUN2",srOnly:sh,sort:rh,sort__arrow:oh,"sort__arrow--ascending":"hanui-sort__arrow--ascending-85T5d","sort__arrow--descending":"hanui-sort__arrow--descending-gs3VU",sticky:ih,bulkBar:ch},lh=({columns:e,label:a,children:s,isLoading:r,error:i,emptyMessage:c,loadingMessage:o,hasViewportCap:_,onSort:h,bulkBar:d,className:l,testId:p})=>{var k,m;const{labels:u}=O(),b=n.Children.count(s),g=(f,N)=>t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:v(te.state,N&&te[`state--${N}`]),children:f})});return t.jsxs("div",{className:v(te.wrapper,_&&te["wrapper--capped"],l),"data-testid":p,children:[d&&t.jsx("div",{className:te.bulkBar,children:d}),t.jsxs("table",{className:te.table,"aria-label":a,children:[t.jsx("thead",{children:t.jsx("tr",{children:e.map(f=>{const N=!!(f.isSortable&&h),j=f.ariaSort==="ascending"?"descending":"ascending";return t.jsx("th",{scope:"col","aria-sort":f.ariaSort,className:v(f.className,f.isSticky&&te.sticky),children:N?t.jsxs("button",{type:"button",className:te.sort,onClick:()=>h==null?void 0:h(f.key,j),children:[f.label,f.srLabel&&t.jsx("span",{className:te.srOnly,children:f.srLabel}),t.jsx("span",{"aria-hidden":!0,className:v(te.sort__arrow,f.ariaSort&&te[`sort__arrow--${f.ariaSort}`]),children:f.ariaSort==="descending"?"▾":"▴"})]}):t.jsxs(t.Fragment,{children:[f.label,f.srLabel&&t.jsx("span",{className:te.srOnly,children:f.srLabel})]})},f.key)})})}),t.jsx("tbody",{children:i?g(t.jsxs("span",{role:"alert",className:te.state__message,children:[t.jsx(D.ExclamationCircleFill,{"aria-hidden":!0}),i]}),"error"):r?g(P("DataTable.loadingMessage",o,(k=u==null?void 0:u.dataTable)==null?void 0:k.loading)):b===0?g(P("DataTable.emptyMessage",c,(m=u==null?void 0:u.dataTable)==null?void 0:m.empty)):s})]})]})},dh=L(n.memo(({isWarning:e,className:a,children:s,...r})=>t.jsx("tr",{className:v(e&&te["row--warning"],a),...r,children:s})),"DataTableRow"),uh=n.memo(lh),_h="hanui-bar-b4PP4",hh="hanui-bar__hiddenSubmit-jeCyX",ph="hanui-bar__actions-rG69L",mh="hanui-field-f-rvu",Et={bar:_h,bar__hiddenSubmit:hh,bar__actions:ph,field:mh,"field--wide":"hanui-field--wide-FA5gf"},bh=({onSubmit:e,children:a,actions:s,label:r,className:i,testId:c})=>{const{labels:o}=O();return t.jsxs("form",{className:v(Et.bar,i),"aria-label":P("FilterBar.label",r,o==null?void 0:o.filters),"data-testid":c,onSubmit:_=>{_.preventDefault(),e()},children:[a,t.jsx("button",{type:"submit",className:Et.bar__hiddenSubmit,tabIndex:-1,"aria-hidden":!0}),s&&t.jsx("div",{className:Et.bar__actions,children:s})]})},gh=L(n.memo(({children:e,isWide:a,className:s})=>t.jsx("div",{className:v(Et.field,a&&Et["field--wide"],s),children:e})),"FilterBarField"),fh=n.memo(bh),xh="hanui-pagination-K-L20",vh="hanui-pagination__list--9HqC",yh="hanui-pagination__arrow-XIgoX",wh="hanui-pagination__page-TpoJM",kh="hanui-pagination__gap-qoDyI",Te={pagination:xh,pagination__list:vh,pagination__arrow:yh,pagination__page:wh,"pagination__page--active":"hanui-pagination__page--active-XHeaz",pagination__gap:kh},jh=(e,a)=>{if(a<=7)return Array.from({length:a},(c,o)=>o+1);const s=new Set([1,a,e]);e-1>1&&s.add(e-1),e+1<a&&s.add(e+1);const r=[...s].sort((c,o)=>c-o),i=[];return r.forEach((c,o)=>{o>0&&c-r[o-1]>1&&i.push("gap"),i.push(c)}),i},Nh=({page:e,totalPages:a,label:s,previousLabel:r,nextLabel:i,buildHref:c,onPageChange:o,linkProps:_,formatAnnouncement:h,scrollTo:d,className:l,testId:p})=>{var E,R,I;const{labels:u}=O(),b=zt(),g=n.useRef(e);n.useEffect(()=>{g.current!==e&&(g.current=e,h&&b(h(e,a)))},[e,a,h,b]);const k=n.useMemo(()=>jh(e,a),[e,a]);if(a<=1)return null;const m=w=>{d==="top"&&w!==e&&jn()},f=w=>{o&&(o(w),m(w))},N=_==null?void 0:_.onClick,j=(w,C)=>{N==null||N(w),!(w.defaultPrevented||w.button!==0)&&(w.metaKey||w.ctrlKey||w.shiftKey||w.altKey||m(C))},x=(w,C,T)=>{const y=w<1||w>a;return c&&!y?t.jsx(_e,{href:c(w),className:Te.pagination__arrow,"aria-label":C,..._,onClick:$=>j($,w),children:T}):t.jsx(je,{className:Te.pagination__arrow,icon:T,label:C,variant:"outline",disabled:y,onClick:()=>f(w)})};return t.jsxs("nav",{className:v(Te.pagination,l),"aria-label":P("Pagination.label",s,(E=u==null?void 0:u.pagination)==null?void 0:E.label),"data-testid":p,children:[x(e-1,P("Pagination.previousLabel",r,(R=u==null?void 0:u.pagination)==null?void 0:R.previous),t.jsx(D.CaretLeftFill,{"aria-hidden":!0})),t.jsx("ul",{className:Te.pagination__list,children:k.map((w,C)=>w==="gap"?t.jsx("li",{className:Te.pagination__gap,"aria-hidden":!0,children:"…"},`gap-${C}`):t.jsx("li",{children:c?t.jsx(_e,{href:c(w),className:v(Te.pagination__page,w===e&&Te["pagination__page--active"]),"aria-current":w===e?"page":void 0,..._,onClick:T=>j(T,w),children:w}):t.jsx(_t,{variant:ke.SECONDARY,size:ze.SMALL,className:v(Te.pagination__page,w===e&&Te["pagination__page--active"]),"aria-current":w===e?"page":void 0,onClick:()=>f(w),children:w})},w))}),x(e+1,P("Pagination.nextLabel",i,(I=u==null?void 0:u.pagination)==null?void 0:I.next),t.jsx(D.CaretRightFill,{"aria-hidden":!0}))]})},$h=n.memo(Nh);exports.ABOVE_MOBILE_MEDIA_QUERY=Kt;exports.ABOVE_TABLET_MEDIA_QUERY=Cn;exports.Accordion=ku;exports.Alert=Hi;exports.Avatar=Wi;exports.Badge=Ji;exports.BottomSheet=ma;exports.Breadcrumb=rc;exports.Button=_t;exports.COMPACT_DENSITY=pn;exports.Card=xc;exports.CardBody=gc;exports.CardFooter=fc;exports.CardMedia=mc;exports.CardOverlay=bc;exports.Carousel=Ec;exports.Checkbox=jr;exports.Chip=Xa;exports.ChipGroup=fs;exports.CodeBadge=Lc;exports.Combobox=Js;exports.CommandPalette=T_;exports.ConfirmDialog=A_;exports.CopyField=Oc;exports.DARK_THEME=Ha;exports.DEFAULT_FONTS=mn;exports.DENSITY_ATTRIBUTE=ra;exports.DataTable=uh;exports.DataTableRow=dh;exports.DateField=Wo;exports.DateRange=Qo;exports.Directory=cl;exports.DirectoryGroup=rl;exports.DirectoryJump=il;exports.DirectoryRow=ol;exports.Divider=Uc;exports.Drawer=U_;exports.EmptyState=ml;exports.Field=Za;exports.FileUpload=Di;exports.FilterBar=fh;exports.FilterBarField=gh;exports.HanuiProvider=gn;exports.IconButton=je;exports.Input=ba;exports.LIGHT_THEME=Oa;exports.METRIC_TOKENS=hn;exports.MOBILE_BREAKPOINT=qa;exports.Menu=is;exports.Modal=fa;exports.PageHeader=El;exports.Pagination=$h;exports.Panel=Ul;exports.PanelForm=zl;exports.PanelRow=Kl;exports.PasswordInput=Ro;exports.Popover=ds;exports.Price=Vl;exports.Progress=tn;exports.ProgressCircle=bi;exports.PromptDialog=W_;exports.QuantityStepper=go;exports.Radio=Or;exports.RadioCard=Yr;exports.RangeSlider=to;exports.Rating=sd;exports.RatingInput=_o;exports.ScrollArea=md;exports.SectionHeader=_d;exports.SegmentedControl=sr;exports.Select=gr;exports.Skeleton=$d;exports.SkeletonCard=Td;exports.SkeletonRows=Rd;exports.SkeletonTable=Dd;exports.Spinner=la;exports.Stat=Kd;exports.Steps=Lu;exports.SummaryCard=Jd;exports.Switch=Dr;exports.TABLET_BREAKPOINT=Ya;exports.TABLET_PORTRAIT_BREAKPOINT=En;exports.THEME_ATTRIBUTE=Pe;exports.Table=Z_;exports.TableCheckbox=yo;exports.TableScroller=V_;exports.Tabs=Hu;exports.TagInput=Bo;exports.TextLink=Kn;exports.Textarea=Ja;exports.Tile=Xu;exports.Timeline=s_;exports.ToastHub=nn;exports.ToastPortal=hu;exports.Tooltip=ts;exports.UISize=ze;exports.UIVariant=ke;exports.applyThemeConfig=oa;exports.buildThemeCss=za;exports.initHanui=fn;exports.matchesSearch=Ct;exports.normalizeSearchTerm=ta;exports.resolveTokens=bn;exports.toast=lu;exports.useAnnounce=zt;exports.useHanui=O;exports.useHanuiTheme=kn;exports.useListboxNavigation=ca;exports.usePositioning=ht;exports.useVirtualList=Ua;
|
|
21
|
+
`)},la=e=>{if(!U.isClient())return;const a=e?Ha(e):"",s=document.getElementById(ka);if(a===""){s==null||s.remove();return}const r=s??document.createElement("style");r.id=ka,r.textContent=a,s||document.head.appendChild(r)},za=n.createContext({}),O=()=>n.useContext(za),mn=({children:e,theme:a,linkComponent:s,labels:r})=>{const o=n.useMemo(()=>a?JSON.stringify(a):"",[a]);n.useEffect(()=>{la(a)},[o]);const c=n.useRef(a);c.current=a;const i=n.useMemo(()=>({theme:c.current,linkComponent:s,labels:r}),[o,s,r]);return t.jsx(za.Provider,{value:i,children:e})},bn=(e={})=>{la(e.theme),U.isClient()&&(e.colorScheme&&document.documentElement.setAttribute(ze,e.colorScheme),e.density&&document.documentElement.setAttribute(ca,e.density))},gn="hanui-live-region",fn=e=>{if(!U.isClient())return null;const a=`${gn}-${e}`,s=document.getElementById(a);if(s)return s;const r=document.createElement("div");return r.id=a,r.setAttribute("aria-live",e),r.setAttribute("aria-atomic","true"),r.className="hanui-visually-hidden",document.body.appendChild(r),r},xn=(e,a)=>{e.textContent="",window.requestAnimationFrame(()=>{e.textContent=a})},Yt=()=>n.useCallback((e,a="polite")=>{const s=e.trim();if(s==="")return;const r=fn(a);r&&xn(r,s)},[]),Na=()=>{var e;return U.isClient()&&((e=window.matchMedia)!=null&&e.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"},vn=()=>{if(!U.isClient())return"system";const e=document.documentElement.getAttribute(ze);return e==="dark"||e==="light"?e:"system"},yn=()=>{const[e,a]=n.useState("light"),[s,r]=n.useState("light"),[o,c]=n.useState(!1);n.useEffect(()=>{a(vn()),r(Na()),c(!0)},[]),n.useEffect(()=>{if(!U.isClient()||!window.matchMedia)return;const d=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>r(Na());return d.addEventListener("change",l),()=>d.removeEventListener("change",l)},[]);const i=e==="system"?s:e,_=n.useCallback(d=>{if(!U.isClient())return;const l=document.documentElement;l.classList.add(ja),d==="system"?l.removeAttribute(ze):l.setAttribute(ze,d),a(d),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>l.classList.remove(ja))})},[]),h=n.useCallback(()=>_(i==="dark"?"light":"dark"),[i,_]);return{scheme:i,preference:e,setScheme:_,toggle:h,isReady:o}},wn=()=>{!U.isClient()||typeof window.scrollTo!="function"||window.scrollTo({top:0,left:0,behavior:"instant"})},da=(e,a)=>{typeof(e==null?void 0:e.scrollIntoView)=="function"&&e.scrollIntoView(a)},ua=({count:e,isOpen:a,initialIndex:s=0,onSelect:r,onClose:o},{hasSpaceSelect:c=!1}={})=>{const[i,_]=n.useState(s),h=n.useRef(null);n.useEffect(()=>{a&&_(s)},[a,s]),n.useEffect(()=>{_(l=>l>=e?Math.max(0,e-1):l)},[e]),n.useEffect(()=>{var l;a&&da((l=h.current)==null?void 0:l.querySelector(`[data-index="${i}"]`),{block:"nearest"})},[i,a,e]);const d=n.useCallback(l=>{const p=e-1;switch(l.key){case"ArrowDown":l.preventDefault(),_(u=>u>=p?0:u+1);break;case"ArrowUp":l.preventDefault(),_(u=>u<=0?p:u-1);break;case"Home":l.preventDefault(),_(0);break;case"End":l.preventDefault(),_(p);break;case" ":case"Enter":{if(l.key===" "&&!c)break;l.preventDefault(),e>0&&r(i);break}case"Escape":l.preventDefault(),l.stopPropagation(),o();break;case"Tab":o();break}},[i,e,c,o,r]);return{activeIndex:i,setActiveIndex:_,listRef:h,handleKeyDown:d}},Qt={top:"bottom",bottom:"top",left:"right",right:"left"},$a=(e,a,s)=>s<a?a:Math.min(Math.max(e,a),s),Vt=(e,a,s,r,o)=>{const c=s==="top"||s==="bottom",i={top:e.top-a.height-o,bottom:e.top+e.height+o,left:e.left-a.width-o,right:e.left+e.width+o}[s],_=c?e.left:e.top,h=c?e.width:e.height,d=c?a.width:a.height,l={start:_,center:_+h/2-d/2,end:_+h-d}[r];return c?{top:i,left:l}:{top:l,left:i}},Ea=(e,a,s,r,o)=>({top:e.top>=r,bottom:e.top+a.height<=o.height-r,left:e.left>=r,right:e.left+a.width<=o.width-r})[s],ft=(e,a,{side:s="top",align:r="center",offset:o=8,padding:c=8,isOpen:i})=>{const[_,h]=n.useState({style:{position:"fixed",top:0,left:0},side:s,anchorWidth:0,isPositioned:!1}),d=n.useRef(0),l=n.useCallback(()=>{const b=e.current,g=a.current;if(!b||!g)return;const k=b.getBoundingClientRect(),m=g.getBoundingClientRect(),f={width:window.innerWidth,height:window.innerHeight},N=Vt(k,m,s,r,o),j=Ea(N,m,s,c,f)?s:Ea(Vt(k,m,Qt[s],r,o),m,Qt[s],c,f)?Qt[s]:s,x=Vt(k,m,j,r,o);h({style:{position:"fixed",top:Math.round($a(x.top,c,f.height-m.height-c)),left:Math.round($a(x.left,c,f.width-m.width-c))},side:j,anchorWidth:k.width,isPositioned:!0})},[e,a,s,r,o,c]),p=n.useCallback(()=>{d.current||(d.current=window.requestAnimationFrame(()=>{d.current=0,l()}))},[l]);return(U.isClient()?n.useLayoutEffect:n.useEffect)(()=>{var g,k;if(!i){h(m=>m.isPositioned?{...m,isPositioned:!1}:m);return}l(),window.addEventListener("resize",p),(g=window.visualViewport)==null||g.addEventListener("resize",p),(k=window.visualViewport)==null||k.addEventListener("scroll",p),document.addEventListener("scroll",p,!0);const b=typeof ResizeObserver>"u"?null:new ResizeObserver(p);return b&&a.current&&b.observe(a.current),b&&e.current&&b.observe(e.current),()=>{var m,f;window.removeEventListener("resize",p),(m=window.visualViewport)==null||m.removeEventListener("resize",p),(f=window.visualViewport)==null||f.removeEventListener("scroll",p),document.removeEventListener("scroll",p,!0),b==null||b.disconnect(),d.current&&(window.cancelAnimationFrame(d.current),d.current=0)}},[i,l,p,e,a]),_},kn=40,jn=6,Ka=(e,{rowHeight:a=kn,overscan:s=jn,isEnabled:r=!0}={})=>{const o=n.useRef(null),[c,i]=n.useState({start:0,end:e,totalHeight:e*a,offset:0}),_=n.useCallback(()=>{const d=o.current,l=!r||!d||d.clientHeight===0?{start:0,end:e,totalHeight:e*a,offset:0}:(()=>{const p=Math.ceil(d.clientHeight/a),u=Math.floor(d.scrollTop/a),b=Math.max(0,u-s),g=Math.min(e,u+p+s);return{start:b,end:g,totalHeight:e*a,offset:b*a}})();i(p=>p.start===l.start&&p.end===l.end&&p.totalHeight===l.totalHeight&&p.offset===l.offset?p:l)},[e,r,s,a]);n.useEffect(_),n.useEffect(()=>{const d=o.current;if(!d)return;d.addEventListener("scroll",_,{passive:!0});const l=typeof ResizeObserver>"u"?null:new ResizeObserver(_);return l==null||l.observe(d),()=>{d.removeEventListener("scroll",_),l==null||l.disconnect()}},[_]);const h=n.useCallback(d=>{const l=o.current;if(!l||!r)return;const p=d*a,u=p+a;p<l.scrollTop?l.scrollTop=p:u>l.scrollTop+l.clientHeight&&(l.scrollTop=u-l.clientHeight)},[r,a]);return{scrollRef:o,range:c,scrollToIndex:h,measure:_}};var ke=(e=>(e.PRIMARY="PRIMARY",e.CART="CART",e.SECONDARY="SECONDARY",e.OUTLINE="OUTLINE",e.DARK="DARK",e.LIGHT="LIGHT",e.GHOST="GHOST",e.DANGER="DANGER",e))(ke||{}),Ye=(e=>(e.SMALL="SMALL",e.MEDIUM="MEDIUM",e.LARGE="LARGE",e))(Ye||{});const Ua=640,Nn=768,Ya=1024,$n=`(min-width: ${Ya+1}px)`,qt=`(min-width: ${Ua+1}px)`,sa=e=>e.replace(/İ/g,"i").replace(/I/g,"i").replace(/ı/g,"i").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/ş/g,"s").replace(/ğ/g,"g").replace(/ç/g,"c").replace(/ø/g,"o").replace(/æ/g,"ae").replace(/ß/g,"ss").replace(/đ/g,"d").replace(/ł/g,"l").replace(/\s+/g," ").trim(),Rt=(e,a)=>sa(e).includes(sa(a)),v=(...e)=>{let a="";for(const s of e)s&&(a=a===""?s:`${a} ${s}`);return a},L=(e,a)=>Object.assign(e,{displayName:a}),ue=({children:e,...a})=>{const{linkComponent:s}=O();return s?t.jsx(s,{...a,children:e}):t.jsx("a",{...a,children:e})},Ca=new Set,P=(e,...a)=>{for(const s of a)if(s!==void 0)return s;return process.env.NODE_ENV!=="production"&&!Ca.has(e)&&(Ca.add(e),console.error(`[hanui] Eksik metin: ${e}. Prop olarak geçin ya da <HanuiProvider labels={…}> içinde bir kez tanımlayın. Metinsiz bırakılan öğe ekran okuyucuda adsız kalır.`)),""},be=(e,a,...s)=>a?a(...s):P(e),En="hanui-spinner-7pXwf",Cn="hanui-spinner__label-sZvSq",Jt={spinner:En,spinner__label:Cn,"spinner--sm":"hanui-spinner--sm-uI0wH","spinner--md":"hanui-spinner--md--VmFK","spinner--lg":"hanui-spinner--lg-K9k-Z"},In=({size:e="md",label:a,className:s})=>{const{labels:r}=O();return t.jsx("span",{className:v(Jt.spinner,Jt[`spinner--${e}`],s),role:"status",children:t.jsx("span",{className:Jt.spinner__label,children:a??P("Spinner.label",r==null?void 0:r.loading)})})},_a=n.memo(In),Tn="hanui-button-SRu4R",Rn="hanui-button__icon-giom6",Dn="hanui-button__spinner-vexVG",Sn="hanui-button__label-qiMHm",$e={button:Tn,button__icon:Rn,button__spinner:Dn,button__label:Sn,"button--full":"hanui-button--full-CwPHR","button--loading":"hanui-button--loading-O-naJ","button--small":"hanui-button--small-TF9Hz","button--medium":"hanui-button--medium-JDjkH","button--large":"hanui-button--large-btadu","button--primary":"hanui-button--primary-ym7RJ","button--cart":"hanui-button--cart-5DVmR","button--secondary":"hanui-button--secondary-56m1d","button--outline":"hanui-button--outline-ZI8sw","button--dark":"hanui-button--dark-FGZgn","button--light":"hanui-button--light-YzEPs","button--ghost":"hanui-button--ghost-rijnZ","button--danger":"hanui-button--danger-TNGd2"},Ln=n.forwardRef(({variant:e=ke.PRIMARY,size:a=Ye.MEDIUM,isLoading:s,isFullWidth:r,startIcon:o,endIcon:c,className:i,children:_,disabled:h,href:d,isExternal:l,linkProps:p,testId:u,...b},g)=>{const k=v($e.button,$e[`button--${e.toLowerCase()}`],$e[`button--${a.toLowerCase()}`],r&&$e["button--full"],s&&$e["button--loading"],i),m=t.jsxs(t.Fragment,{children:[s&&t.jsx(_a,{size:"sm",className:$e.button__spinner,label:""}),!s&&o&&t.jsx("span",{className:$e.button__icon,children:o}),t.jsx("span",{className:$e.button__label,children:_}),c&&t.jsx("span",{className:$e.button__icon,children:c})]}),f=!!h||!!s,N={"aria-busy":s,"aria-disabled":f||void 0,tabIndex:f?-1:b.tabIndex,onClick:j=>{var x;if(f){j.preventDefault();return}(x=b.onClick)==null||x.call(b,j)}};return d&&l?t.jsx("a",{...b,...N,href:d,className:k,target:"_blank",rel:"noopener noreferrer","data-testid":u,children:m}):d?t.jsx(ue,{...b,...N,href:d,className:k,"data-testid":u,...p,children:m}):t.jsx("button",{ref:g,className:k,disabled:h||s,"aria-busy":s,"data-testid":u,...b,children:m})}),gt=n.memo(L(Ln,"Button")),An="hanui-iconButton-JdtwM",Zt={iconButton:An,"iconButton--sm":"hanui-iconButton--sm-wE6zE","iconButton--md":"hanui-iconButton--md-iTNNS","iconButton--ghost":"hanui-iconButton--ghost-w-8K3","iconButton--outline":"hanui-iconButton--outline-vEhcY","iconButton--solid":"hanui-iconButton--solid-NUszP","iconButton--cart":"hanui-iconButton--cart-nVsH-","iconButton--danger":"hanui-iconButton--danger-xKkEA"},Fn=n.forwardRef(({icon:e,label:a,variant:s="ghost",size:r="md",className:o,type:c="button",href:i,linkProps:_,testId:h,...d},l)=>{const p=v(Zt.iconButton,Zt[`iconButton--${s}`],Zt[`iconButton--${r}`],o),u=!!d.disabled;return i?t.jsx(ue,{...d,href:i,className:p,"aria-label":a,"aria-disabled":u||void 0,tabIndex:u?-1:d.tabIndex,onClick:b=>{var g;if(u){b.preventDefault();return}(g=d.onClick)==null||g.call(d,b)},"data-testid":h,..._,children:e}):t.jsx("button",{ref:l,type:c,className:p,"aria-label":a,"data-testid":h,...d,children:e})}),je=n.memo(L(Fn,"IconButton")),Bn="hanui-link-WBmXY",Mn="hanui-link__label--OEu-",Pn="hanui-link__arrow-JKXm-",yt={link:Bn,link__label:Mn,link__arrow:Pn,"link--sm":"hanui-link--sm-a-3Dz","link--md":"hanui-link--md-lZdYP","link--brand":"hanui-link--brand-vr8sW","link--muted":"hanui-link--muted-EeN6l"},On=({href:e,children:a,hasArrow:s,tone:r="brand",size:o="md",className:c,linkProps:i,..._})=>t.jsxs(ue,{href:e,className:v(yt.link,yt[`link--${r}`],yt[`link--${o}`],c),...i,..._,children:[t.jsx("span",{className:yt.link__label,children:a}),s&&t.jsx(D.ArrowRight,{"aria-hidden":!0,className:yt.link__arrow})]}),Hn=n.memo(On),zn=new Set(["button","checkbox","color","file","hidden","image","radio","range","reset","submit"]),Kn=e=>{if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;const a=e.getAttribute("contenteditable");if(a===""||a==="true"||a==="plaintext-only")return!0;const s=e.tagName;return s==="TEXTAREA"?!0:s!=="INPUT"?!1:!zn.has(e.type)},ha=e=>{const a=e.ownerDocument.activeElement;!e.contains(a)||!Kn(a)||(a.blur(),e.tabIndex=-1,e.focus({preventScroll:!0}))},xt=()=>{const e=typeof document>"u"?null:document.activeElement;return()=>{e instanceof HTMLElement&&e.isConnected&&e.focus({preventScroll:!0})}},Un=["a[href]","button:not(:disabled)","input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"])'].map(e=>`${e}:not([inert]):not([aria-hidden="true"])`).join(", "),Wt=(e,a="[data-hanui-close]")=>{const s=e.querySelector("[data-hanui-autofocus]");if(s){s.focus({preventScroll:!0});return}const r=[...e.querySelectorAll(Un)],o=r.find(c=>!c.matches(a))??r[0];if(o){o.focus({preventScroll:!0});return}e.tabIndex=-1,e.focus({preventScroll:!0})},zt=[],Dt=()=>{const e=Symbol("hanui-modal");return zt.push(e),{token:e,pop:()=>{const a=zt.indexOf(e);a>=0&&zt.splice(a,1)}}},St=e=>zt.at(-1)===e,pa=(e,a)=>{n.useEffect(()=>{if(!e)return;const{token:s,pop:r}=Dt(),o=c=>{c.key==="Escape"&&St(s)&&a()};return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o),r()}},[e,a])},Yn=e=>{var s;const a=((s=e==null?void 0:e.closest)==null?void 0:s.call(e,"dialog"))??null;return a&&a.isConnected?{container:a,needsTopLayer:qn(a)}:{container:document.body,needsTopLayer:!1}},qn=e=>{try{return e.matches(":modal")}catch{return e.hasAttribute("open")}},Wn={margin:0,right:"auto",bottom:"auto"},Xn=e=>{if(!e||typeof e.showPopover!="function")return()=>{};try{e.showPopover()}catch{return()=>{}}return()=>{try{e.isConnected&&e.hidePopover()}catch{}}},Gn={},Qn={},Lt=(e,a,s)=>{const r=e&&U.isClient()?Yn(a.current):null,o=(r==null?void 0:r.needsTopLayer)??!1;return n.useEffect(()=>{if(!(!e||!o))return Xn(s.current)},[e,o,s]),{container:(r==null?void 0:r.container)??null,attributes:o?{popover:"manual"}:Gn,style:o?Wn:Qn}},Vn="hanui-tooltip-RG1g1",Jn="hanui-tooltip__trigger-nWZtO",Zn="hanui-bubble-bcBNk",Bt={tooltip:Vn,tooltip__trigger:Jn,bubble:Zn,"bubble--top":"hanui-bubble--top-uWSZy","bubble--bottom":"hanui-bubble--bottom-jKokL","bubble--left":"hanui-bubble--left-WK4EM","bubble--right":"hanui-bubble--right-EQjUT"},es=120,ts=500,as=300,ns=({content:e,children:a,side:s,position:r,openDelay:o=as,className:c})=>{const[i,_]=n.useState(!1),h=n.useId(),d=s??r??"top",l=n.useRef(null),p=n.useRef(null),u=n.useRef(0),b=n.useRef(0),g=n.useMemo(()=>{if(!n.isValidElement(a))return!1;const T=a.type,y=a.props;return y.tabIndex!==void 0?!0:y.disabled===!0||typeof T!="string"?!1:T==="a"?y.href!==void 0:["button","input","select","textarea"].includes(T)},[a]),[k,m]=n.useState(!1);n.useEffect(()=>{const T=l.current;T&&m(!!T.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))},[a]);const f=g||k,N=ft(l,p,{side:d,align:"center",isOpen:i}),j=Lt(i,l,p),x=n.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=0},[]),$=n.useCallback(T=>{x(),u.current=window.setTimeout(()=>_(!0),T)},[x]),R=n.useCallback((T=es)=>{x(),u.current=window.setTimeout(()=>_(!1),T)},[x]);n.useEffect(()=>x,[x]),n.useEffect(()=>()=>{b.current&&window.clearTimeout(b.current)},[]);const I=n.useCallback(()=>R(0),[R]);pa(i,I),n.useEffect(()=>{if(!i)return;const T=y=>{var C;y.pointerType!=="mouse"&&((C=l.current)!=null&&C.contains(y.target)||R(0))};return document.addEventListener("pointerdown",T),()=>document.removeEventListener("pointerdown",T)},[i,R]);const w=()=>{b.current&&window.clearTimeout(b.current),b.current=0},E=T=>{T.pointerType!=="mouse"&&(b.current=window.setTimeout(()=>_(!0),ts))};return t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:l,className:v(Bt.tooltip,c),tabIndex:f?void 0:0,onPointerEnter:T=>T.pointerType==="mouse"&&$(o),onPointerLeave:T=>{w(),T.pointerType==="mouse"&&R()},onPointerDown:E,onPointerUp:w,onPointerCancel:w,onFocus:()=>$(0),onBlur:()=>R(0),onContextMenu:T=>{(i||b.current)&&T.preventDefault()},children:t.jsx("span",{"aria-describedby":i?h:void 0,className:Bt.tooltip__trigger,children:a})}),i&&j.container&&rt.createPortal(t.jsx("span",{ref:p,...j.attributes,id:h,role:"tooltip",className:v(Bt.bubble,Bt[`bubble--${N.side}`]),style:{...N.style,...j.style,visibility:N.isPositioned?"visible":"hidden"},children:e}),j.container)]})},ss=n.memo(L(ns,"Tooltip")),rs="hanui-menu-1x-FU",os="hanui-menu__item-d1iil",is="hanui-menu__icon-kzLV2",wt={menu:rs,"menu--top":"hanui-menu--top-gpo39","menu--bottom":"hanui-menu--bottom-6sL7b","menu--left":"hanui-menu--left-4w-O8","menu--right":"hanui-menu--right-XmM8G",menu__item:os,"menu__item--danger":"hanui-menu__item--danger-lIINY",menu__icon:is},cs=e=>e.map((a,s)=>a.isDisabled?-1:s).filter(a=>a>=0),ls=({trigger:e,items:a,label:s,side:r="bottom",align:o="start",className:c,testId:i})=>{const _=n.useId(),h=n.useRef(null),d=n.useRef(null),l=n.useRef(null),p=n.useRef({text:"",at:0}),[u,b]=n.useState(!1),[g,k]=n.useState(0),m=ft(h,d,{side:r,align:o,isOpen:u}),f=cs(a),N=Lt(u,h,d),j=n.useCallback(y=>{f.length!==0&&(l.current=xt(),k(y==="first"?f[0]:f[f.length-1]),b(!0))},[f]),x=n.useCallback(()=>{var y;b(!1),(y=l.current)==null||y.call(l),l.current=null},[]);n.useEffect(()=>()=>{var y;(y=l.current)==null||y.call(l),l.current=null},[]),n.useEffect(()=>{var y,C;u&&((C=(y=d.current)==null?void 0:y.querySelector(`[data-index="${g}"]`))==null||C.focus({preventScroll:!0}))},[u,g]),n.useEffect(()=>{if(!u)return;const y=C=>{var Y,X;const B=C.target;(Y=d.current)!=null&&Y.contains(B)||(X=h.current)!=null&&X.contains(B)||x()};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[u,x]);const $=y=>{const B=(f.indexOf(g)+y+f.length)%f.length;k(f[B])},R=y=>{const C=Date.now(),B=C-p.current.at>500?y:p.current.text+y;p.current={text:B,at:C};const Y=f.find(X=>a[X].label.toLocaleLowerCase("tr").startsWith(B.toLocaleLowerCase("tr")));Y!==void 0&&k(Y)},I=y=>{switch(y.key){case"ArrowDown":y.preventDefault(),$(1);break;case"ArrowUp":y.preventDefault(),$(-1);break;case"Home":y.preventDefault(),k(f[0]);break;case"End":y.preventDefault(),k(f[f.length-1]);break;case"Escape":y.preventDefault(),x();break;case"Tab":x();break;default:y.key.length===1&&!y.metaKey&&!y.ctrlKey&&R(y.key)}},w=y=>{if(y.key==="ArrowUp"){y.preventDefault(),j("last");return}["ArrowDown","Enter"," "].includes(y.key)&&(y.preventDefault(),j("first"))};if(!n.isValidElement(e))return null;const E=e.props,T=n.cloneElement(e,{ref:h,"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?_:void 0,onClick:y=>{var C;(C=E.onClick)==null||C.call(E,y),u?x():j("first")},onKeyDown:y=>{var C;(C=E.onKeyDown)==null||C.call(E,y),u||w(y)}});return t.jsxs(t.Fragment,{children:[T,u&&N.container&&rt.createPortal(t.jsx("div",{ref:d,id:_,role:"menu","aria-label":s,...N.attributes,className:v(wt.menu,wt[`menu--${m.side}`],c),style:{...m.style,...N.style,visibility:m.isPositioned?"visible":"hidden"},"data-testid":i,onKeyDown:I,children:a.map((y,C)=>t.jsxs("button",{type:"button",role:"menuitem","data-index":C,tabIndex:C===g?0:-1,disabled:y.isDisabled,className:v(wt.menu__item,y.isDanger&&wt["menu__item--danger"]),onClick:()=>{y.onSelect(),x()},children:[y.icon&&t.jsx("span",{className:wt.menu__icon,"aria-hidden":!0,children:y.icon}),y.label]},y.id))}),N.container)]})},ds=n.memo(L(ls,"Menu")),us="hanui-popover-VxgiK",Ia={popover:us,"popover--top":"hanui-popover--top-OUYwo","popover--bottom":"hanui-popover--bottom-Q1K4X","popover--left":"hanui-popover--left-9Rsjx","popover--right":"hanui-popover--right-0TJeo"},_s=({trigger:e,children:a,label:s,side:r="bottom",align:o="start",isOpen:c,onOpenChange:i,className:_,testId:h})=>{const d=n.useId(),l=n.useRef(null),p=n.useRef(null),u=n.useRef(null),[b,g]=n.useState(!1),k=c!==void 0,m=k?c:b,f=ft(l,p,{side:r,align:o,isOpen:m}),N=Lt(m,l,p),j=n.useCallback(I=>{k||g(I),i==null||i(I)},[k,i]);n.useEffect(()=>{if(!m)return;u.current=xt();const I=p.current;return I&&Wt(I),()=>{var w;(w=u.current)==null||w.call(u),u.current=null}},[m]);const x=n.useCallback(()=>j(!1),[j]);if(pa(m,x),n.useEffect(()=>{if(!m)return;const I=w=>{var T,y;const E=w.target;(T=p.current)!=null&&T.contains(E)||(y=l.current)!=null&&y.contains(E)||j(!1)};return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[m,j]),!n.isValidElement(e))return null;const $=e.props,R=n.cloneElement(e,{ref:l,"aria-expanded":m,"aria-haspopup":"dialog","aria-controls":m?d:void 0,onClick:I=>{var w;(w=$.onClick)==null||w.call($,I),j(!m)}});return t.jsxs(t.Fragment,{children:[R,m&&N.container&&rt.createPortal(t.jsx("div",{ref:p,id:d,...N.attributes,role:"dialog","aria-label":s,className:v(Ia.popover,Ia[`popover--${f.side}`],_),style:{...f.style,...N.style,visibility:f.isPositioned?"visible":"hidden"},"data-testid":h,onBlur:I=>{var E;const w=I.relatedTarget;w&&(I.currentTarget.contains(w)||(E=l.current)!=null&&E.contains(w)||w.closest('[role="listbox"],[role="menu"],[role="dialog"]')||j(!1))},children:a}),N.container)]})},hs=n.memo(L(_s,"Popover")),ps="hanui-chip--NLgU",ms="hanui-chip__icon-IjjSb",bs="hanui-chip__label-cT4hw",gs="hanui-chip__count-MBGO3",Be={chip:ps,chip__icon:ms,chip__label:bs,chip__count:gs,"chip--sm":"hanui-chip--sm-60H-S","chip--md":"hanui-chip--md--yAlm","chip--iconOnly":"hanui-chip--iconOnly-5LT1h","chip--selected":"hanui-chip--selected-FdpCr"},fs=n.forwardRef(({children:e,icon:a,endIcon:s,count:r,isSelected:o,size:c="md",label:i,href:_,linkProps:h,className:d,type:l="button",role:p,testId:u,...b},g)=>{const k=v(Be.chip,Be[`chip--${c}`],o&&Be["chip--selected"],!e&&Be["chip--iconOnly"],d),m=t.jsxs(t.Fragment,{children:[a&&t.jsx("span",{className:Be.chip__icon,"aria-hidden":!0,children:a}),e&&t.jsx("span",{className:Be.chip__label,children:e}),U.isDefined(r)&&t.jsx("span",{className:Be.chip__count,children:r}),s&&t.jsx("span",{className:Be.chip__icon,"aria-hidden":!0,children:s})]});return _?t.jsx(ue,{href:_,className:k,"aria-label":e?void 0:i,"aria-current":o?"page":void 0,"data-testid":u,...h,children:m}):t.jsx("button",{ref:g,type:l,role:p,className:k,"aria-label":e?void 0:i,"data-testid":u,...p==="radio"?{"aria-checked":!!o}:{"aria-pressed":!!o},...b,children:m})}),qa=n.memo(L(fs,"Chip")),xs="hanui-group-0tnVf",Ta={group:xs,"group--scrollable":"hanui-group--scrollable-PMu6V"},vs=({options:e,label:a,size:s="md",isScrollable:r,className:o,...c})=>{var p;const i=n.useRef(null),_=u=>c.isMultiple?c.value.includes(u):c.value===u,h=u=>{if(c.isMultiple){const b=c.value.includes(u)?c.value.filter(g=>g!==u):[...c.value,u];c.onChange(b);return}c.onChange(c.value===u?null:u)},d=u=>{var f,N;if(c.isMultiple)return;const b=u.key==="ArrowRight"||u.key==="ArrowDown"?1:u.key==="ArrowLeft"||u.key==="ArrowUp"?-1:0;if(b===0)return;u.preventDefault();const g=e.filter(j=>!j.isDisabled);if(g.length===0)return;const k=g.findIndex(j=>j.value===c.value),m=g[(k+b+g.length)%g.length];c.onChange(m.value),(N=(f=i.current)==null?void 0:f.querySelector(`[data-chip-value="${m.value}"]`))==null||N.focus()},l=c.isMultiple?null:c.value??((p=e.find(u=>!u.isDisabled))==null?void 0:p.value)??null;return t.jsx("div",{ref:i,className:v(Ta.group,r&&Ta["group--scrollable"],o),role:c.isMultiple?"group":"radiogroup","aria-label":a,onKeyDown:d,children:e.map(u=>t.jsx(qa,{size:s,icon:u.icon,count:u.count,isSelected:_(u.value),disabled:u.isDisabled,role:c.isMultiple?void 0:"radio",tabIndex:c.isMultiple||u.value===l?0:-1,"data-chip-value":u.value,onClick:()=>h(u.value),children:u.label},u.value))})},ys=n.memo(vs),ws=(e,a,s,r)=>{const o=n.useRef(s);o.current=s,n.useEffect(()=>{if(!a||!o.current)return;const c=window.setTimeout(()=>{var i;return(i=o.current)==null?void 0:i.call(o,e.trim())},r);return()=>window.clearTimeout(c)},[e,a,r])};let It=0,Re=null;const ks=()=>{if(typeof navigator>"u")return!1;const e=navigator.userAgent;return/iP(hone|ad|od)/.test(e)?!0:/Macintosh/.test(e)&&navigator.maxTouchPoints>1},js=()=>{if(It+=1,It>1)return;const{body:e,style:a}={body:document.body,style:document.documentElement.style},s=window.scrollY;Re={overflow:e.style.overflow,position:e.style.position,top:e.style.top,width:e.style.width,paddingRight:e.style.paddingRight,scrollY:s};const r=window.innerWidth-document.documentElement.clientWidth;r>0&&(e.style.paddingRight=`${r}px`),a.setProperty("scrollbar-gutter","stable"),e.style.overflow="hidden",ks()&&(e.style.position="fixed",e.style.top=`${-s}px`,e.style.width="100%")},Ns=()=>{if(It=Math.max(0,It-1),It>0||!Re)return;const{body:e}=document,{scrollY:a}=Re;e.style.overflow=Re.overflow,e.style.position=Re.position,e.style.top=Re.top,e.style.width=Re.width,e.style.paddingRight=Re.paddingRight,document.documentElement.style.removeProperty("scrollbar-gutter"),Re=null,window.scrollTo(0,a)},Xt=(e=!0)=>{n.useEffect(()=>{if(e)return js(),Ns},[e])},Wa="--hanui-sheet-height",Xa="--hanui-sheet-inset-bottom";let Mt=0,bt=0;const $s=240,Ga=()=>{const e=window.visualViewport;if(!e||e.height<$s)return;const a=window.innerHeight-e.height-e.offsetTop,s=document.documentElement;s.style.setProperty(Xa,`${Math.max(0,Math.round(a))}px`),s.style.setProperty(Wa,`${Math.round(e.height)}px`)},it=()=>{bt||(bt=window.requestAnimationFrame(()=>{bt=0,Ga()}))},Ra=()=>{bt&&(window.cancelAnimationFrame(bt),bt=0)},Qa=(e=!0)=>{n.useEffect(()=>{if(!e)return;const a=window.visualViewport;if(a)return Mt+=1,Mt===1&&(a.addEventListener("resize",it),a.addEventListener("scroll",it),window.addEventListener("orientationchange",it)),Ra(),Ga(),()=>{Mt-=1,!(Mt>0)&&(a.removeEventListener("resize",it),a.removeEventListener("scroll",it),window.removeEventListener("orientationchange",it),Ra(),document.documentElement.style.removeProperty(Xa),document.documentElement.style.removeProperty(Wa))}},[e])},Es="hanui-sheet-GEvdE",Cs="hanui-sheet__header-NJgw-",Is="hanui-sheet__title-f-b07",Ts="hanui-sheet__toolbar-eyhmW",Rs="hanui-sheet__body-eJ2KB",Ds="hanui-sheet__footer-NpsY5",Xe={sheet:Es,sheet__header:Cs,sheet__title:Is,sheet__toolbar:Ts,sheet__body:Rs,sheet__footer:Ds},Ss=({title:e,closeLabel:a,onClose:s,children:r,toolbar:o,footer:c,closeAbove:i=qt,className:_,testId:h})=>{const{labels:d}=O(),l=n.useId(),p=n.useRef(null);Qa(),Xt(),n.useEffect(()=>{const g=xt(),{token:k,pop:m}=Dt();return p.current=k,()=>{m(),p.current=null,g()}},[]),n.useEffect(()=>{const g=window.matchMedia(i),k=m=>{m.matches&&s()};return g.addEventListener("change",k),()=>g.removeEventListener("change",k)},[i,s]);const u=n.useCallback(g=>{!g||g.open||(g.showModal(),Wt(g,`.${Xe.sheet__header} button`),ha(g))},[]),b=n.useCallback(g=>{g.target===g.currentTarget&&s()},[s]);return U.isClient()?rt.createPortal(t.jsxs("dialog",{ref:u,className:v(Xe.sheet,_),"aria-labelledby":l,"data-testid":h,onCancel:g=>{g.preventDefault(),!(p.current&&!St(p.current))&&s()},onClick:b,children:[t.jsxs("header",{className:Xe.sheet__header,children:[t.jsx("h2",{id:l,className:Xe.sheet__title,children:e}),t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:P("BottomSheet.closeLabel",a,d==null?void 0:d.close),variant:"ghost",size:"sm",onClick:s})]}),o&&t.jsx("div",{className:Xe.sheet__toolbar,children:o}),t.jsx("div",{className:Xe.sheet__body,children:r}),c&&t.jsx("div",{className:Xe.sheet__footer,children:c})]}),document.body):null},ma=n.memo(Ss),Ls=80,Da=40,As=300,Fs="hanui-combobox-NtZoV",Bs="hanui-combobox__trigger-2riRR",Ms="hanui-combobox__chevron-g-QzQ",Ps="hanui-combobox__leadingIcon-it2xz",Os="hanui-combobox__value-acDlr",Hs="hanui-combobox__clear-EXOsc",zs="hanui-combobox__panel-srBxl",Ks="hanui-combobox__search-THjer",Us="hanui-combobox__searchIcon-vr4Bg",Ys="hanui-combobox__searchInput-JPp5h",qs="hanui-combobox__list-p-eCs",Ws="hanui-combobox__option-CLWh-",Xs="hanui-combobox__optionText-Zm0D6",Gs="hanui-combobox__optionLabel-WvT4W",Qs="hanui-combobox__optionDescription-8OEzi",Vs="hanui-combobox__check-MKlLz",Js="hanui-combobox__empty-mZwBq",Zs="hanui-combobox__srName-9PNXF",K={combobox:Fs,combobox__trigger:Bs,"combobox__trigger--empty":"hanui-combobox__trigger--empty-RxwCq","combobox__trigger--open":"hanui-combobox__trigger--open-rw1ZS","combobox__trigger--invalid":"hanui-combobox__trigger--invalid-iZgiN","combobox__trigger--clearable":"hanui-combobox__trigger--clearable-shq9I",combobox__chevron:Ms,combobox__leadingIcon:Ps,combobox__value:Os,combobox__clear:Hs,"combobox__chevron--open":"hanui-combobox__chevron--open-9kj1j",combobox__panel:zs,combobox__search:Ks,combobox__searchIcon:Us,combobox__searchInput:Ys,combobox__list:qs,"combobox__list--sheet":"hanui-combobox__list--sheet-r3MzB",combobox__option:Ws,"combobox__option--active":"hanui-combobox__option--active--75Vq","combobox__option--selected":"hanui-combobox__option--selected-DVFGy","combobox__option--disabled":"hanui-combobox__option--disabled-e6VjI",combobox__optionText:Xs,combobox__optionLabel:Gs,combobox__optionDescription:Qs,combobox__check:Vs,combobox__empty:Js,combobox__srName:Zs},er=({options:e,value:a,onChange:s,labels:r,isSearchHidden:o,onSearch:c,isLoading:i,isDisabled:_,isClearable:h,icon:d,id:l,required:p,className:u,testId:b,"aria-describedby":g,"aria-invalid":k})=>{const{labels:m}=O(),f={get search(){var A;return P("Combobox.searchPlaceholder",r.searchPlaceholder,(A=m==null?void 0:m.combobox)==null?void 0:A.searchPlaceholder)},get empty(){var A;return P("Combobox.emptyMessage",r.emptyMessage,(A=m==null?void 0:m.combobox)==null?void 0:A.emptyMessage)},get loading(){var A;return P("Combobox.loadingMessage",r.loadingMessage,(A=m==null?void 0:m.combobox)==null?void 0:A.loadingMessage)},get clear(){var A;return P("Combobox.clearLabel",r.clearLabel,(A=m==null?void 0:m.combobox)==null?void 0:A.clearLabel)}},N=n.useId(),j=l??N,x=`${j}-listbox`,$=n.useRef(null),R=n.useRef(null),I=n.useRef(null),w=n.useRef(null),[E,T]=n.useState(null),y=E!==null,[C,B]=n.useState(""),[Y,X]=n.useState(null),q=n.useMemo(()=>{if(c||C.trim()==="")return e;const A=C.trim();return e.filter(xe=>Rt(xe.label,A)||(xe.description?Rt(xe.description,A):!1))},[e,C,c]),Q=e.find(A=>A.value===a)??null;n.useEffect(()=>{Q?X(Q.label):a===null&&X(null)},[Q,a]);const _e=(Q==null?void 0:Q.label)??Y;ws(C,y,c,As);const Ne=n.useCallback(()=>{T(null),B("")},[]),Se=n.useCallback(()=>{_||(T(window.matchMedia(qt).matches?"popover":"sheet"),B(""))},[_]);n.useEffect(()=>{if(E!=="popover")return;const A=xe=>{var Ft,Fe;const he=xe.target;(Ft=$.current)!=null&&Ft.contains(he)||(Fe=I.current)!=null&&Fe.contains(he)||Ne()};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[E,Ne]),n.useEffect(()=>{var A;E==="popover"&&((A=w.current)==null||A.focus({preventScroll:!0}))},[E]);const At=A=>{A.isDisabled||(X(A.label),s(A.value),Ne())},ot=n.useRef(!1);n.useEffect(()=>{var A;ot.current&&!y&&((A=R.current)==null||A.focus()),ot.current=y},[y]);const vt=ft(R,I,{side:"bottom",align:"start",isOpen:y&&E==="popover"}),qe=Lt(E==="popover",R,I),{activeIndex:Le,setActiveIndex:H,listRef:ae,handleKeyDown:ge}=ua({count:q.length,isOpen:y,initialIndex:Math.max(e.findIndex(A=>A.value===a),0),onSelect:A=>{const xe=q[A];xe&&At(xe)},onClose:Ne}),Ae=q.some(A=>!!A.description),fe=E==="popover"&&!Ae&&q.length>Ls,{scrollRef:nn,range:We,scrollToIndex:xa}=Ka(q.length,{rowHeight:Da,isEnabled:fe});n.useEffect(()=>{fe&&xa(Le)},[Le,fe,xa]);const sn=A=>{ae.current=A,nn.current=A},rn=ge,on=A=>{if(o){if(!y){["ArrowDown","ArrowUp","Enter"," "].includes(A.key)&&(A.preventDefault(),Se());return}ge(A)}},cn=()=>{s(null),X(null)},va=o?null:t.jsxs("div",{className:K.combobox__search,children:[t.jsx(D.Search,{"aria-hidden":!0,className:K.combobox__searchIcon}),t.jsx("input",{ref:w,type:"text",role:"combobox",className:K.combobox__searchInput,value:C,placeholder:f.search,autoComplete:"off","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":x,"aria-activedescendant":q[Le]?`${j}-option-${Le}`:void 0,"aria-label":f.search,onChange:A=>{B(A.target.value),H(0)},onKeyDown:rn}),i&&t.jsx(_a,{size:"sm",label:""})]}),ya=A=>{const xe=q.slice(We.start,We.end);return t.jsxs("ul",{ref:sn,id:x,role:"listbox",className:v(K.combobox__list,A&&K["combobox__list--sheet"]),children:[fe&&We.offset>0&&t.jsx("li",{"aria-hidden":!0,style:{height:We.offset}}),xe.map((he,Ft)=>{const Fe=We.start+Ft,ln=Fe===Le,Gt=he.value===a;return t.jsxs("li",{id:`${j}-option-${Fe}`,role:"option","data-index":Fe,"aria-setsize":fe?q.length:void 0,"aria-posinset":fe?Fe+1:void 0,"aria-selected":Gt,"aria-disabled":he.isDisabled,className:v(K.combobox__option,ln&&K["combobox__option--active"],Gt&&K["combobox__option--selected"],he.isDisabled&&K["combobox__option--disabled"]),onMouseEnter:()=>H(Fe),onClick:()=>At(he),children:[t.jsxs("span",{className:K.combobox__optionText,children:[t.jsx("span",{className:K.combobox__optionLabel,children:he.label}),he.description&&t.jsx("span",{className:K.combobox__optionDescription,children:he.description})]}),Gt&&t.jsx(D.CheckLg,{"aria-hidden":!0,className:K.combobox__check})]},he.value)}),fe&&We.end<q.length&&t.jsx("li",{"aria-hidden":!0,style:{height:(q.length-We.end)*Da}}),q.length===0&&t.jsx("li",{className:K.combobox__empty,children:i?f.loading:f.empty})]})};return t.jsxs("div",{ref:$,className:v(K.combobox,u),"data-testid":b,children:[t.jsxs("button",{ref:R,id:j,type:"button",className:v(K.combobox__trigger,!_e&&K["combobox__trigger--empty"],y&&K["combobox__trigger--open"],k&&K["combobox__trigger--invalid"],h&&_e&&!_&&K["combobox__trigger--clearable"]),disabled:_,"aria-haspopup":"listbox","aria-expanded":y,"aria-controls":y?x:void 0,"aria-labelledby":_e?`${j}-name ${j}-value`:`${j}-name`,"aria-describedby":g,"aria-required":p||void 0,onClick:()=>y?Ne():Se(),onKeyDown:on,children:[d&&t.jsx("span",{className:K.combobox__leadingIcon,"aria-hidden":!0,children:d}),t.jsx("span",{id:`${j}-name`,className:K.combobox__srName,children:r.placeholder}),t.jsx("span",{id:`${j}-value`,className:K.combobox__value,children:_e??r.placeholder}),t.jsx(D.CaretDownFill,{"aria-hidden":!0,className:v(K.combobox__chevron,y&&K["combobox__chevron--open"])})]}),h&&_e&&!_&&t.jsx("button",{type:"button",className:K.combobox__clear,"aria-label":f.clear,onClick:cn,children:t.jsx(D.XLg,{"aria-hidden":!0})}),E==="popover"&&qe.container&&rt.createPortal(t.jsxs("div",{ref:I,className:K.combobox__panel,...qe.attributes,style:{...vt.style,...qe.style,width:vt.anchorWidth||void 0,visibility:vt.isPositioned?void 0:"hidden"},children:[va,ya(!1)]}),qe.container),E==="sheet"&&t.jsx(ma,{title:r.placeholder,closeLabel:r.closeLabel??(m==null?void 0:m.close),onClose:Ne,toolbar:va??void 0,children:ya(!0)})]})},tr=n.memo(er),ar="hanui-segmented-qo2Bw",nr="hanui-segmented__item-mqRNZ",sr="hanui-segmented__icon-C9CT-",rr="hanui-segmented__label-NVXBv",ct={segmented:ar,"segmented--sm":"hanui-segmented--sm-7tUry","segmented--md":"hanui-segmented--md-PiSqt",segmented__item:nr,"segmented__item--selected":"hanui-segmented__item--selected-r7CLj",segmented__icon:sr,segmented__label:rr},or=({options:e,value:a,onChange:s,label:r,isIconOnly:o,size:c="md",className:i,testId:_})=>{const h=n.useRef(null),d=l=>{var k,m;const p=l.key==="ArrowRight"||l.key==="ArrowDown"?1:l.key==="ArrowLeft"||l.key==="ArrowUp"?-1:0;if(p===0)return;l.preventDefault();const u=e.filter(f=>!f.isDisabled);if(u.length===0)return;const b=u.findIndex(f=>f.value===a),g=u[(b+p+u.length)%u.length];s(g.value),(m=(k=h.current)==null?void 0:k.querySelector(`[data-value="${g.value}"]`))==null||m.focus({preventScroll:!0})};return t.jsx("div",{ref:h,role:"radiogroup","aria-label":r,className:v(ct.segmented,ct[`segmented--${c}`],i),"data-testid":_,onKeyDown:d,children:e.map(l=>{const p=l.value===a;return t.jsxs("button",{type:"button",role:"radio","aria-checked":p,"aria-label":o?l.label:void 0,"data-value":l.value,disabled:l.isDisabled,tabIndex:p?0:-1,className:v(ct.segmented__item,p&&ct["segmented__item--selected"]),onClick:()=>!p&&s(l.value),children:[l.icon&&t.jsx("span",{className:ct.segmented__icon,"aria-hidden":!0,children:l.icon}),!o&&t.jsx("span",{className:ct.segmented__label,children:l.label})]},l.value)})})},ir=n.memo(L(or,"SegmentedControl")),cr="hanui-select-tiiPL",lr="hanui-trigger-rHQJz",dr="hanui-trigger__icon-apCcx",ur="hanui-trigger__srName-XLCxt",_r="hanui-trigger__value-ioH7K",hr="hanui-trigger__chevron-FtsIZ",pr="hanui-panel-rGOOd",mr="hanui-list-SOKf8",br="hanui-option-ZDPef",gr="hanui-option__label-SsoYB",fr="hanui-option__check-8CPSG",W={select:cr,trigger:lr,"trigger--empty":"hanui-trigger--empty-cuinb","trigger--open":"hanui-trigger--open-1nsvu","trigger--invalid":"hanui-trigger--invalid-NtP0W","trigger--sm":"hanui-trigger--sm-Xnu1C",trigger__icon:dr,trigger__srName:ur,trigger__value:_r,trigger__chevron:hr,"trigger__chevron--open":"hanui-trigger__chevron--open-1P2P-",panel:pr,list:mr,"list--sheet":"hanui-list--sheet-BIjCb",option:br,"option--active":"hanui-option--active-R4lLF","option--selected":"hanui-option--selected-glQMj","option--disabled":"hanui-option--disabled-h4rdd",option__label:gr,option__check:fr},xr=({options:e,value:a,onChange:s,label:r,placeholder:o,closeLabel:c,icon:i,size:_="md",align:h="start",isDisabled:d,id:l,className:p,testId:u,required:b,"aria-describedby":g,"aria-invalid":k})=>{const{labels:m}=O(),f=P("Select.placeholder",o,m==null?void 0:m.selectPlaceholder),N=n.useId(),j=l??N,x=`${j}-listbox`,$=H=>`${j}-option-${H}`,R=n.useRef(null),I=n.useRef(null),w=n.useRef(null),[E,T]=n.useState(null),y=ft(I,w,{side:"bottom",align:h,isOpen:E==="popover"}),C=Lt(E==="popover",I,w),B=E!==null,Y=e.findIndex(H=>H.value===a),X=Y>=0?e[Y]:null,q=n.useCallback(()=>T(null),[]),Q=n.useCallback(()=>{d||e.length===0||T(window.matchMedia(qt).matches?"popover":"sheet")},[d,e.length]),_e=H=>{H.isDisabled||(s(H.value),q())},Ne=n.useRef(!1);n.useEffect(()=>{var H;Ne.current&&!B&&((H=I.current)==null||H.focus()),Ne.current=B},[B]),n.useEffect(()=>{if(E!=="popover")return;const H=ae=>{var Ae,fe;const ge=ae.target;(Ae=R.current)!=null&&Ae.contains(ge)||(fe=w.current)!=null&&fe.contains(ge)||q()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[E,q]);const{activeIndex:Se,setActiveIndex:At,listRef:ot,handleKeyDown:vt}=ua({count:e.length,isOpen:B,initialIndex:Y>=0?Y:0,onSelect:H=>{const ae=e[H];ae&&_e(ae)},onClose:q});n.useEffect(()=>{var H;E==="sheet"&&((H=ot.current)==null||H.focus({preventScroll:!0}))},[E,ot]);const qe=H=>{if(!B){["ArrowDown","ArrowUp","Enter"," "].includes(H.key)&&(H.preventDefault(),Q());return}vt(H)},Le=H=>t.jsx("ul",{ref:ot,id:x,role:"listbox","aria-label":r,"aria-activedescendant":H&&e[Se]?$(Se):void 0,tabIndex:H?0:-1,className:v(W.list,H&&W["list--sheet"]),onKeyDown:H?qe:void 0,children:e.map((ae,ge)=>{const Ae=ae.value===a;return t.jsxs("li",{id:$(ge),role:"option","data-index":ge,"aria-selected":Ae,"aria-disabled":ae.isDisabled,className:v(W.option,ge===Se&&W["option--active"],Ae&&W["option--selected"],ae.isDisabled&&W["option--disabled"]),onMouseEnter:()=>At(ge),onClick:()=>_e(ae),children:[t.jsx("span",{className:W.option__label,children:ae.label}),Ae&&t.jsx(D.CheckLg,{"aria-hidden":!0,className:W.option__check})]},ae.value)})});return t.jsxs("span",{ref:R,className:v(W.select,p),"data-testid":u,children:[t.jsxs("button",{ref:I,id:j,type:"button",role:"combobox",className:v(W.trigger,W[`trigger--${_}`],!X&&W["trigger--empty"],B&&W["trigger--open"],k&&W["trigger--invalid"]),disabled:d,"aria-haspopup":"listbox","aria-expanded":B,"aria-controls":B?x:void 0,"aria-activedescendant":E==="popover"&&e[Se]?$(Se):void 0,"aria-labelledby":X?`${j}-name ${j}-value`:`${j}-name`,"aria-describedby":g,"aria-invalid":k,"aria-required":b||void 0,onClick:()=>B?q():Q(),onKeyDown:qe,children:[i&&t.jsx("span",{className:W.trigger__icon,"aria-hidden":!0,children:i}),t.jsx("span",{id:`${j}-name`,className:W.trigger__srName,children:r}),t.jsx("span",{id:`${j}-value`,className:W.trigger__value,children:(X==null?void 0:X.label)??f}),t.jsx(D.CaretDownFill,{"aria-hidden":!0,className:v(W.trigger__chevron,B&&W["trigger__chevron--open"])})]}),E==="popover"&&C.container&&rt.createPortal(t.jsx("div",{ref:w,className:W.panel,...C.attributes,style:{...y.style,...C.style,minWidth:y.anchorWidth||void 0,visibility:y.isPositioned?void 0:"hidden"},children:Le(!1)}),C.container),E==="sheet"&&t.jsx(ma,{title:r,closeLabel:c??(m==null?void 0:m.close),onClose:q,children:Le(!0)})]})},vr=n.memo(xr),yr="hanui-checkbox-FaFCj",wr="hanui-checkbox__input-nTHne",kr="hanui-checkbox__body-VAEW2",jr="hanui-checkbox__label-sSNZY",Nr="hanui-checkbox__hint-ish-J",kt={checkbox:yr,checkbox__input:wr,checkbox__body:kr,checkbox__label:jr,checkbox__hint:Nr},$r=n.forwardRef(({label:e,hint:a,className:s,id:r,testId:o,...c},i)=>{const _=n.useId(),h=r??_,d=`${h}-label`,l=`${h}-hint`;return t.jsxs("label",{className:v(kt.checkbox,s),"data-testid":o,children:[t.jsx("input",{ref:i,type:"checkbox",id:h,className:kt.checkbox__input,"aria-labelledby":d,"aria-describedby":a?l:c["aria-describedby"],...c}),t.jsxs("span",{className:kt.checkbox__body,children:[t.jsx("span",{id:d,className:kt.checkbox__label,children:e}),a&&t.jsx("span",{id:l,className:kt.checkbox__hint,children:a})]})]})}),Er=n.memo(L($r,"Checkbox")),Cr="hanui-switch__input-Q2UQ4",Ir="hanui-switch__label-gPZuO",Tr="hanui-switch__hint-NRuzC",Rr="hanui-switch__track-3417m",Dr="hanui-switch__thumb-1LHta",Sr="hanui-switch__text-32uMY",Me={switch:"hanui-switch-KLH29",switch__input:Cr,"switch--labelFirst":"hanui-switch--labelFirst-Grirk",switch__label:Ir,switch__hint:Tr,switch__track:Rr,switch__thumb:Dr,switch__text:Sr},Lr=n.forwardRef(({label:e,hint:a,isLabelFirst:s,className:r,id:o,testId:c,...i},_)=>{const h=n.useId(),d=o??h,l=`${d}-label`,p=`${d}-hint`;return t.jsxs("label",{className:v(Me.switch,s&&Me["switch--labelFirst"],r),"data-testid":c,children:[t.jsx("input",{ref:_,type:"checkbox",role:"switch",id:d,className:Me.switch__input,"aria-labelledby":l,"aria-describedby":a?p:i["aria-describedby"],...i}),t.jsx("span",{className:Me.switch__track,"aria-hidden":!0,children:t.jsx("span",{className:Me.switch__thumb})}),t.jsxs("span",{className:Me.switch__text,children:[t.jsx("span",{id:l,className:Me.switch__label,children:e}),a&&t.jsx("span",{id:p,className:Me.switch__hint,children:a})]})]})}),Ar=n.memo(L(Lr,"Switch")),Fr="hanui-radio-KoZak",Br="hanui-radio__input-gVMgh",Mr="hanui-radio__body-oZWg6",Pr="hanui-radio__label-d-5ce",Or="hanui-radio__hint-baVbs",Hr="hanui-radio__count-OtkUM",lt={radio:Fr,radio__input:Br,radio__body:Mr,radio__label:Pr,radio__hint:Or,radio__count:Hr},zr=n.forwardRef(({label:e,hint:a,count:s,className:r,id:o,testId:c,...i},_)=>{const h=n.useId(),d=o??h,l=`${d}-label`,p=`${d}-hint`,u=`${d}-count`;return t.jsxs("label",{className:v(lt.radio,r),"data-testid":c,children:[t.jsx("input",{ref:_,type:"radio",id:d,className:lt.radio__input,"aria-labelledby":[l,U.isDefined(s)?u:null].filter(Boolean).join(" "),"aria-describedby":a?p:i["aria-describedby"],...i}),t.jsxs("span",{className:lt.radio__body,children:[t.jsx("span",{id:l,className:lt.radio__label,children:e}),a&&t.jsx("span",{id:p,className:lt.radio__hint,children:a})]}),U.isDefined(s)&&t.jsx("span",{id:u,className:lt.radio__count,children:s})]})}),Kr=n.memo(L(zr,"Radio")),Ur="hanui-radioCard-sndiC",Yr="hanui-radioCard__input-6vuoD",qr="hanui-radioCard__indicator--x9LT",Wr="hanui-radioCard__body-CFqoi",dt={radioCard:Ur,radioCard__input:Yr,"radioCard--selected":"hanui-radioCard--selected-Mi7ee",radioCard__indicator:qr,"radioCard--disabled":"hanui-radioCard--disabled-YlYee",radioCard__body:Wr},Xr=({name:e,value:a,isSelected:s,isDisabled:r,onChange:o,children:c,className:i,id:_,testId:h})=>t.jsxs("label",{className:v(dt.radioCard,s&&dt["radioCard--selected"],r&&dt["radioCard--disabled"],i),"data-testid":h,children:[t.jsx("input",{type:"radio",id:_,name:e,value:a,checked:s,disabled:r,onChange:()=>o(a),className:dt.radioCard__input}),t.jsx("span",{className:dt.radioCard__indicator,"aria-hidden":!0}),t.jsx("span",{className:dt.radioCard__body,children:c})]}),Gr=n.memo(Xr),Qr="hanui-range-RpDPh",Vr="hanui-range__readout-itDMd",Jr="hanui-range__separator-u-ZJX",Zr="hanui-range__track-bCh5Y",eo="hanui-range__fill-VXMCE",to="hanui-range__input-TAN2I",ao="hanui-range__bounds-GIhFd",pe={range:Qr,"range--disabled":"hanui-range--disabled-13hlc",range__readout:Vr,range__separator:Jr,range__track:Zr,range__fill:eo,range__input:to,range__bounds:ao},no=({min:e,max:a,step:s=1,value:r,onChange:o,onCommit:c,formatValue:i=String,label:_,minLabel:h,maxLabel:d,isDisabled:l,className:p,testId:u})=>{var E,T;const{labels:b}=O(),g=P("RangeSlider.minLabel",h,(E=b==null?void 0:b.range)==null?void 0:E.min),k=P("RangeSlider.maxLabel",d,(T=b==null?void 0:b.range)==null?void 0:T.max),[m,f]=r,N=n.useCallback(y=>o([Math.min(y,f),f]),[f,o]),j=n.useCallback(y=>o([m,Math.max(y,m)]),[m,o]),x=n.useCallback(()=>c==null?void 0:c([m,f]),[m,f,c]),$=a-e,R=$===0?0:U.normalize(m-e,$),I=$===0?0:U.normalize(f-e,$),w=R>50;return t.jsxs("div",{className:v(pe.range,l&&pe["range--disabled"],p),role:"group","aria-label":_,"data-testid":u,children:[t.jsxs("div",{className:pe.range__readout,children:[t.jsx("span",{className:pe.range__value,children:i(m)}),t.jsx("span",{className:pe.range__separator,"aria-hidden":!0,children:"—"}),t.jsx("span",{className:pe.range__value,children:i(f)})]}),t.jsxs("div",{className:pe.range__track,children:[t.jsx("span",{className:pe.range__fill,style:{left:`${R}%`,right:`${100-I}%`},"aria-hidden":!0}),t.jsx("input",{type:"range",className:pe.range__input,style:{zIndex:w?4:3},min:e,max:a,step:s,value:m,disabled:l,"aria-label":`${_} — ${g}`,"aria-valuetext":i(m),onChange:y=>N(Number(y.target.value)),onPointerUp:x,onKeyUp:x}),t.jsx("input",{type:"range",className:pe.range__input,style:{zIndex:w?3:4},min:e,max:a,step:s,value:f,disabled:l,"aria-label":`${_} — ${k}`,"aria-valuetext":i(f),onChange:y=>j(Number(y.target.value)),onPointerUp:x,onKeyUp:x})]}),t.jsxs("div",{className:pe.range__bounds,"aria-hidden":!0,children:[t.jsx("span",{children:i(e)}),t.jsx("span",{children:i(a)})]})]})},so=n.memo(no),ro="hanui-rating-neNnF",oo="hanui-rating__legend-uYvFS",io="hanui-rating__stars-vJFLk",co="hanui-rating__star-BANFJ",lo="hanui-rating__input-s2iiO",uo="hanui-rating__srOnly-iSCoz",_o="hanui-rating__caption-13KFX",Ee={rating:ro,"rating--disabled":"hanui-rating--disabled-ZKjHa",rating__legend:oo,rating__stars:io,rating__star:co,"rating__star--filled":"hanui-rating__star--filled-L3AkT",rating__input:lo,rating__srOnly:uo,rating__caption:_o},ho=[1,2,3,4,5],po=({value:e,onChange:a,label:s,ratingLabels:r,formatStarCount:o,isDisabled:c,className:i,testId:_})=>{var g;const{labels:h}=O(),d=r??((g=h==null?void 0:h.rating)==null?void 0:g.scale),l=n.useId(),[p,u]=n.useState(null),b=p??e;return t.jsxs("fieldset",{className:v(Ee.rating,c&&Ee["rating--disabled"],i),disabled:c,"data-testid":_,children:[t.jsx("legend",{className:Ee.rating__legend,children:s}),t.jsx("div",{className:Ee.rating__stars,onMouseLeave:()=>u(null),children:ho.map(k=>{var m;return t.jsxs("label",{className:v(Ee.rating__star,b!==null&&k<=b&&Ee["rating__star--filled"]),onMouseEnter:()=>u(k),children:[t.jsx("input",{type:"radio",name:l,value:k,checked:e===k,onChange:()=>a(k),className:Ee.rating__input}),t.jsx(D.StarFill,{"aria-hidden":!0}),t.jsxs("span",{className:Ee.rating__srOnly,children:[be("RatingInput.formatStarCount",o??((m=h==null?void 0:h.rating)==null?void 0:m.starCount),k)," ","— ",(d==null?void 0:d[k])??""]})]},k)})}),b!==null&&t.jsx("span",{className:Ee.rating__caption,"aria-hidden":!0,children:(d==null?void 0:d[b])??""})]})},mo=n.memo(po),bo="hanui-stepper-8s5Ih",go="hanui-stepper__button-h6g7d",fo="hanui-stepper__input-OQh5v",jt={stepper:bo,stepper__button:go,stepper__input:fo,"stepper--sm":"hanui-stepper--sm-RvrBP","stepper--md":"hanui-stepper--md-Cnjei"},xo=({value:e,onChange:a,label:s,decreaseLabel:r,increaseLabel:o,min:c=1,max:i=99,isDisabled:_,size:h="md",className:d,testId:l})=>{var f,N,j;const{labels:p}=O(),u=P("QuantityStepper.label",s,(f=p==null?void 0:p.quantity)==null?void 0:f.label),[b,g]=n.useState(null),k=x=>Math.min(Math.max(x,c),i),m=x=>{g(null);const $=x.replace(/\D/g,"");$!==""&&a(k(Number($)))};return t.jsxs("div",{className:v(jt.stepper,jt[`stepper--${h}`],d),role:"group","aria-label":u,"data-testid":l,children:[t.jsx("button",{type:"button",className:jt.stepper__button,onClick:()=>a(Math.max(e-1,c)),disabled:_||e<=c,"aria-label":P("QuantityStepper.decreaseLabel",r,(N=p==null?void 0:p.quantity)==null?void 0:N.decrease),children:t.jsx(D.DashLg,{"aria-hidden":!0})}),t.jsx("input",{className:jt.stepper__input,value:b??String(e),onChange:x=>g(x.target.value.replace(/\D/g,"").slice(0,2)),onBlur:x=>m(x.target.value),onKeyDown:x=>{const $=x.key==="ArrowUp"?1:x.key==="ArrowDown"?-1:0;if($!==0){x.preventDefault(),g(null),a(k(e+$));return}const R=x.key==="PageUp"?10:x.key==="PageDown"?-10:0;if(R!==0){x.preventDefault(),g(null),a(k(e+R));return}if(x.key==="Home"||x.key==="End"){x.preventDefault(),g(null),a(x.key==="Home"?c:i);return}x.key==="Enter"&&(x.preventDefault(),m(x.target.value))},inputMode:"numeric",disabled:_,role:"spinbutton","aria-valuenow":e,"aria-valuemin":c,"aria-valuemax":i,"aria-label":u}),t.jsx("button",{type:"button",className:jt.stepper__button,onClick:()=>a(Math.min(e+1,i)),disabled:_||e>=i,"aria-label":P("QuantityStepper.increaseLabel",o,(j=p==null?void 0:p.quantity)==null?void 0:j.increase),children:t.jsx(D.PlusLg,{"aria-hidden":!0})})]})},vo=n.memo(xo),yo="hanui-checkbox--dvpB",wo={checkbox:yo},ko=n.forwardRef(({label:e,isIndeterminate:a=!1,className:s,testId:r,...o},c)=>{const i=n.useRef(null);return n.useImperativeHandle(c,()=>i.current,[]),n.useEffect(()=>{i.current&&(i.current.indeterminate=a)},[a]),t.jsx("input",{ref:i,type:"checkbox","aria-label":e,"aria-checked":a?"mixed":void 0,className:v(wo.checkbox,s),"data-testid":r,...o})}),jo=n.memo(L(ko,"TableCheckbox")),No="hanui-wrapper-IAI4E",$o="hanui-wrapper__prefix-XKDlV",Eo="hanui-wrapper__suffix-lT35q",Co="hanui-input-pIS2u",Ge={wrapper:No,wrapper__prefix:$o,wrapper__suffix:Eo,input:Co,"input--hasPrefix":"hanui-input--hasPrefix-nsrWh","input--hasSuffix":"hanui-input--hasSuffix-OrE5A","input--technical":"hanui-input--technical---DCD"},Io=n.forwardRef(({prefix:e,suffix:a,isTechnical:s,className:r,testId:o,...c},i)=>t.jsxs("span",{className:v(Ge.wrapper,r),children:[e&&t.jsx("span",{className:Ge.wrapper__prefix,"aria-hidden":!0,children:e}),t.jsx("input",{ref:i,className:v(Ge.input,!!e&&Ge["input--hasPrefix"],!!a&&Ge["input--hasSuffix"],s&&Ge["input--technical"]),"data-testid":o,...c}),a&&t.jsx("span",{className:Ge.wrapper__suffix,"aria-hidden":!0,children:a})]})),ba=n.memo(L(Io,"Input")),To="hanui-password-viMea",Ro="hanui-password__field-WI1h1",Do="hanui-password__toggle-O6R2a",ea={password:To,password__field:Ro,password__toggle:Do},So=({className:e,showLabel:a,hideLabel:s,...r})=>{const{labels:o}=O(),[c,i]=n.useState(!1),_=c?P("PasswordInput.hideLabel",s,o==null?void 0:o.passwordHide):P("PasswordInput.showLabel",a,o==null?void 0:o.passwordShow);return t.jsxs("span",{className:ea.password,children:[t.jsx(ba,{...r,className:`${ea.password__field} ${e??""}`.trim(),type:c?"text":"password"}),t.jsx(je,{className:ea.password__toggle,icon:c?t.jsx(D.EyeSlashFill,{"aria-hidden":!0}):t.jsx(D.EyeFill,{"aria-hidden":!0}),label:_,variant:"ghost",size:"sm",onClick:()=>i(h=>!h)})]})},Lo=n.memo(L(So,"PasswordInput")),Ao="hanui-tagInput-QraZR",Fo="hanui-tagInput__field-HeWrC",Bo="hanui-tagInput__tag-D-ZWB",Mo="hanui-tagInput__remove-bpjGG",Qe={tagInput:Ao,tagInput__field:Fo,"tagInput--invalid":"hanui-tagInput--invalid-NQogL","tagInput--disabled":"hanui-tagInput--disabled--AJFF",tagInput__tag:Bo,"tagInput__tag--duplicate":"hanui-tagInput__tag--duplicate-3-FMF",tagInput__remove:Mo},Po=({values:e,onChange:a,label:s,placeholder:r,removeLabel:o,separators:c=["Enter",","],maxTags:i,isDisabled:_,id:h,required:d,className:l,testId:p,"aria-describedby":u,"aria-invalid":b})=>{const g=n.useId(),k=h??g,m=n.useRef(null),f=n.useRef(0);n.useEffect(()=>()=>{f.current&&window.clearTimeout(f.current)},[]);const{labels:N}=O(),j=Yt(),[x,$]=n.useState(""),[R,I]=n.useState(null),w=i!==void 0&&e.length>=i,E=C=>{var Y;const B=C.trim();if(B!==""){if(e.includes(B)){I(B),f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>I(null),1e3),j(`${B} zaten ekli`,"assertive"),$("");return}w||(a([...e,B]),$(""),j(be("TagInput.added",(Y=N==null?void 0:N.tagInput)==null?void 0:Y.added,B)))}},T=C=>{var B;a(e.filter(Y=>Y!==C)),j(be("TagInput.removed",(B=N==null?void 0:N.tagInput)==null?void 0:B.removed,C))},y=C=>{if(c.includes(C.key)){C.preventDefault(),E(x);return}if(C.key==="Backspace"&&x===""){const B=e.at(-1);B!==void 0&&T(B)}};return t.jsxs("div",{className:v(Qe.tagInput,_&&Qe["tagInput--disabled"],b&&Qe["tagInput--invalid"],l),"data-testid":p,onClick:()=>{var C;return(C=m.current)==null?void 0:C.focus()},children:[e.map(C=>t.jsxs("span",{className:v(Qe.tagInput__tag,R===C&&Qe["tagInput__tag--duplicate"]),children:[C,t.jsx("button",{type:"button",className:Qe.tagInput__remove,"aria-label":`${C} — ${o}`,disabled:_,onClick:B=>{B.stopPropagation(),T(C)},children:t.jsx(D.XLg,{"aria-hidden":!0})})]},C)),t.jsx("input",{ref:m,id:k,type:"text",className:Qe.tagInput__field,value:x,placeholder:e.length===0?r:void 0,"aria-label":s,"aria-describedby":u,"aria-invalid":b,"aria-required":d||void 0,disabled:_||w,onChange:C=>$(C.target.value),onKeyDown:y,onBlur:()=>E(x)})]})},Oo=n.memo(L(Po,"TagInput")),Ho="hanui-textarea-zwJcB",zo="hanui-wrapper-O8aJA",Ko="hanui-counter-bHVh3",Nt={textarea:Ho,wrapper:zo,"textarea--autoSize":"hanui-textarea--autoSize--F8yj",counter:Ko,"counter--near":"hanui-counter--near-AZAQm"},Uo=n.forwardRef(({className:e,rows:a=4,isAutoSize:s,maxRows:r=12,hasCounter:o,maxLength:c,value:i,defaultValue:_,onChange:h,testId:d,...l},p)=>{const u=n.useRef(null),[b,g]=n.useState(String(_??"").length),k=i===void 0?b:String(i).length,m=n.useCallback(N=>{u.current=N,typeof p=="function"?p(N):p&&(p.current=N)},[p]);n.useLayoutEffect(()=>{const N=u.current;if(!s||!N)return;N.style.height="auto";const x=(Number.parseFloat(getComputedStyle(N).lineHeight)||20)*r;N.style.height=`${Math.min(N.scrollHeight,x)}px`,N.style.overflowY=N.scrollHeight>x?"auto":"hidden"},[s,r,i,k]);const f=c!==void 0&&k>=c*.9;return t.jsxs("div",{className:v(Nt.wrapper,e),"data-testid":d,children:[t.jsx("textarea",{ref:m,rows:a,className:v(Nt.textarea,s&&Nt["textarea--autoSize"]),maxLength:c,value:i,defaultValue:_,onChange:N=>{g(N.target.value.length),h==null||h(N)},...l}),o&&c!==void 0&&t.jsxs("span",{className:v(Nt.counter,f&&Nt["counter--near"]),"aria-hidden":!0,children:[k," / ",c]})]})}),Va=n.memo(L(Uo,"Textarea")),Yo="hanui-dateField-UnUwe",qo="hanui-range-nGuRH",Wo="hanui-range__row--debA",Xo="hanui-range__separator-fEqqr",Go="hanui-range__field-tmoNH",Qo="hanui-range__summary-L6v1T",at={dateField:Yo,range:qo,range__row:Wo,range__separator:Xo,range__field:Go,range__summary:Qo},ra=n.forwardRef(({type:e="date",className:a,testId:s,...r},o)=>t.jsx("input",{ref:o,type:e,className:v(at.dateField,a),"data-testid":s,...r})),Vo=n.memo(L(ra,"DateField")),Jo=({value:e,onChange:a,startLabel:s,endLabel:r,separator:o="–",min:c,max:i,isSummaryVisible:_,isDisabled:h,className:d,testId:l})=>{const{labels:p}=O(),u=(()=>{if(!_||!(p!=null&&p.locale)||e.start===""||e.end==="")return null;try{const b=new Intl.DateTimeFormat(p.locale,{dateStyle:"medium"});return`${b.format(new Date(e.start))} ${o} ${b.format(new Date(e.end))}`}catch{return null}})();return t.jsxs("div",{className:v(at.range,d),"data-testid":l,children:[t.jsxs("div",{className:at.range__row,children:[t.jsx(ra,{className:at.range__field,"aria-label":s,value:e.start,min:c,max:e.end||i,disabled:h,onChange:b=>a({...e,start:b.target.value})}),t.jsx("span",{className:at.range__separator,"aria-hidden":!0,children:o}),t.jsx(ra,{className:at.range__field,"aria-label":r,value:e.end,min:e.start||c,max:i,disabled:h,onChange:b=>a({...e,end:b.target.value})})]}),u&&t.jsx("span",{className:at.range__summary,children:u})]})},Zo=L(n.memo(Jo),"DateRange"),ei="hanui-field-KKvre",ti="hanui-field__label-9dlYd",ai="hanui-field__required-hbDJk",ni="hanui-field__srOnly-2WQFH",si="hanui-field__hint-SQPiL",ri="hanui-field__error-gLlZ-",oi="hanui-field__errorIcon-uA3o8",Pe={field:ei,field__label:ti,"field__label--hidden":"hanui-field__label--hidden-ufuVt",field__required:ai,field__srOnly:ni,field__hint:si,field__error:ri,field__errorIcon:oi},ii=({label:e,children:a,hint:s,error:r,isRequired:o,requiredLabel:c,isLabelHidden:i,className:_})=>{const{labels:h}=O(),d=n.useId(),l=`${d}-error`,p=`${d}-hint`;return t.jsxs("div",{className:v(Pe.field,_),children:[t.jsxs("label",{htmlFor:d,className:v(Pe.field__label,i&&Pe["field__label--hidden"]),children:[e,o&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:Pe.field__required,"aria-hidden":!0,children:"*"}),t.jsx("span",{className:Pe.field__srOnly,children:P("Field.requiredLabel",c,h==null?void 0:h.required)})]})]}),a({id:d,required:o||void 0,"aria-invalid":r?!0:void 0,"aria-describedby":[r&&l,s&&p].filter(Boolean).join(" ")||void 0}),r&&t.jsxs("p",{id:l,className:Pe.field__error,role:"alert",children:[t.jsx(D.ExclamationCircleFill,{"aria-hidden":!0,className:Pe.field__errorIcon}),r]}),s&&t.jsx("p",{id:p,className:Pe.field__hint,children:s})]})},Ja=n.memo(ii),ci="hanui-progress-99MrX",li="hanui-progress__track-Qbp9t",di="hanui-progress__fill-Bam55",ui="hanui-progress__value-3FYxj",_i="hanui-circle-9cn2w",hi="hanui-circle__svg-0IwkR",pi="hanui-circle__track-zY2qc",mi="hanui-circle__fill-Jbde6",bi="hanui-circle__label-A3nJB",te={progress:ci,progress__track:li,"progress__track--sm":"hanui-progress__track--sm-dbHZq","progress__track--md":"hanui-progress__track--md-v1GdW","progress__track--indeterminate":"hanui-progress__track--indeterminate-8fMxl",progress__fill:di,"progress__fill--success":"hanui-progress__fill--success-IFuI5","progress__fill--warning":"hanui-progress__fill--warning-wIhgi","progress__fill--danger":"hanui-progress__fill--danger-cuqj0",progress__value:ui,circle:_i,circle__svg:hi,circle__track:pi,circle__fill:mi,"circle__fill--success":"hanui-circle__fill--success-HTr0m","circle__fill--warning":"hanui-circle__fill--warning-Fkgj2","circle__fill--danger":"hanui-circle__fill--danger-4E3Z8","circle--indeterminate":"hanui-circle--indeterminate-cITY6",circle__label:bi},Za=(e,a)=>!Number.isFinite(e)||!Number.isFinite(a)||a<=0?0:Math.min(100,Math.max(0,e/a*100)),gi=({value:e,max:a=100,label:s,valueText:r,isValueVisible:o,tone:c="brand",size:i="md",className:_,testId:h})=>{const d=e===void 0,l=d?0:Za(e,a);return t.jsxs("div",{className:v(te.progress,_),"data-testid":h,children:[t.jsx("div",{role:"progressbar","aria-label":s,"aria-valuenow":d?void 0:Math.round(l),"aria-valuemin":d?void 0:0,"aria-valuemax":d?void 0:100,"aria-valuetext":d?void 0:r,className:v(te.progress__track,te[`progress__track--${i}`],d&&te["progress__track--indeterminate"]),children:t.jsx("span",{className:v(te.progress__fill,te[`progress__fill--${c}`]),style:d?void 0:{inlineSize:`${l}%`}})}),o&&!d&&t.jsx("span",{className:te.progress__value,"aria-hidden":!0,children:r??`%${Math.round(l)}`})]})},en=n.memo(L(gi,"Progress")),fi=({value:e,max:a=100,label:s,valueText:r,isValueVisible:o,tone:c="brand",size:i=44,className:_,testId:h})=>{const d=e===void 0,l=d?25:Za(e,a),p=Math.max(3,Math.round(i*.1)),u=(i-p)/2,b=2*Math.PI*u;return t.jsxs("div",{className:v(te.circle,d&&te["circle--indeterminate"],_),style:{width:i,height:i},"data-testid":h,children:[t.jsxs("svg",{className:te.circle__svg,width:i,height:i,viewBox:`0 0 ${i} ${i}`,role:"progressbar","aria-label":s,"aria-valuenow":d?void 0:Math.round(l),"aria-valuemin":d?void 0:0,"aria-valuemax":d?void 0:100,"aria-valuetext":d?void 0:r,children:[t.jsx("circle",{className:te.circle__track,cx:i/2,cy:i/2,r:u,fill:"none",strokeWidth:p}),t.jsx("circle",{className:v(te.circle__fill,te[`circle__fill--${c}`]),cx:i/2,cy:i/2,r:u,fill:"none",strokeWidth:p,strokeDasharray:b,strokeDashoffset:b*(1-l/100)})]}),o&&!d&&t.jsx("span",{className:te.circle__label,"aria-hidden":!0,children:r??`%${Math.round(l)}`})]})},xi=L(n.memo(fi),"ProgressCircle"),vi="hanui-upload-v1pRY",yi="hanui-upload__drop-OpNbO",wi="hanui-upload__input-Tcg9-",ki="hanui-upload__icon-KpMkq",ji="hanui-upload__label-M4HJb",Ni="hanui-upload__drag-ewSQw",$i="hanui-upload__hint-MZRJ6",Ei="hanui-upload__error-7GkCC",Ci="hanui-upload__list-lbViQ",Ii="hanui-upload__file-Znp1Q",Ti="hanui-upload__fileText-EtJcs",Ri="hanui-upload__fileName-ArF8-",Di="hanui-upload__fileMeta-i6sO1",Si="hanui-upload__progress-JY2a5",G={upload:vi,upload__drop:yi,upload__input:wi,"upload__drop--dragging":"hanui-upload__drop--dragging-YztUx","upload__drop--invalid":"hanui-upload__drop--invalid-JhwnL","upload__drop--disabled":"hanui-upload__drop--disabled-zyfUv",upload__icon:ki,upload__label:ji,upload__drag:Ni,upload__hint:$i,upload__error:Ei,upload__list:Ci,upload__file:Ii,"upload__file--error":"hanui-upload__file--error-wpbtA",upload__fileText:Ti,upload__fileName:Ri,upload__fileMeta:Di,upload__progress:Si},Ut=1024,Sa=Ut*Ut,ta=e=>e<Ut?`${e} B`:e<Sa?`${Math.round(e/Ut)} KB`:`${(e/Sa).toFixed(1)} MB`,Li=({files:e,onSelect:a,onRemove:s,label:r,hint:o,accept:c,isMultiple:i,maxSize:_,removeLabel:h,dropLabel:d,sizeErrorText:l,isDisabled:p,error:u,children:b,className:g,testId:k})=>{const m=n.useId(),f=n.useId(),N=n.useRef(null),{labels:j}=O(),x=Yt(),[$,R]=n.useState(!1),[I,w]=n.useState([]),E=y=>{var q;if(!y||y.length===0)return;const C=[...y],B=_===void 0?[]:C.filter(Q=>Q.size>_),Y=C.filter(Q=>!B.includes(Q)),X=B.map(Q=>{var _e;return l===void 0?be("FileUpload.tooLarge",(_e=j==null?void 0:j.fileUpload)==null?void 0:_e.tooLarge,Q.name,ta(_??0)):l.replace("{name}",Q.name).replace("{max}",ta(_??0))});w(X),Y.length>0&&(a(Y),x(be("FileUpload.added",(q=j==null?void 0:j.fileUpload)==null?void 0:q.added,Y.length))),X.length>0&&x(X.join(" "),"assertive")},T=y=>{y.preventDefault(),R(!1),!p&&E(y.dataTransfer.files)};return t.jsxs("div",{className:v(G.upload,g),"data-testid":k,children:[t.jsxs("label",{htmlFor:m,className:v(G.upload__drop,$&&G["upload__drop--dragging"],p&&G["upload__drop--disabled"],u&&G["upload__drop--invalid"]),onDragOver:y=>{y.preventDefault(),p||R(!0)},onDragLeave:()=>R(!1),onDrop:T,children:[t.jsx(D.CloudArrowUpFill,{"aria-hidden":!0,className:G.upload__icon}),t.jsx("span",{className:G.upload__label,children:r}),t.jsx("span",{className:G.upload__drag,children:d}),o&&t.jsx("span",{id:f,className:G.upload__hint,children:o}),t.jsx("input",{ref:N,id:m,type:"file",className:G.upload__input,accept:c,multiple:i,disabled:p,"aria-describedby":o?f:void 0,"aria-invalid":u?!0:void 0,onChange:y=>{E(y.target.files),y.target.value=""}})]}),u&&t.jsxs("p",{className:G.upload__error,role:"alert",children:[t.jsx(D.ExclamationCircleFill,{"aria-hidden":!0}),u]}),I.map(y=>t.jsxs("p",{className:G.upload__error,role:"alert",children:[t.jsx(D.ExclamationCircleFill,{"aria-hidden":!0}),y]},y)),e.length>0&&t.jsx("ul",{className:G.upload__list,children:e.map(y=>{var C;return t.jsxs("li",{className:v(G.upload__file,y.error&&G["upload__file--error"]),children:[t.jsxs("span",{className:G.upload__fileText,children:[t.jsx("span",{className:G.upload__fileName,children:y.name}),t.jsx("span",{className:G.upload__fileMeta,children:y.error??ta(y.size)})]}),y.progress!==void 0&&t.jsx(en,{value:y.progress,label:be("FileUpload.uploading",(C=j==null?void 0:j.fileUpload)==null?void 0:C.uploading,y.name),size:"sm",className:G.upload__progress}),t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:`${y.name} — ${h}`,variant:"ghost",size:"sm",onClick:()=>s(y.id)})]},y.id)})}),b]})},Ai=n.memo(L(Li,"FileUpload")),Fi="hanui-alert-gHI-9",Bi="hanui-alert__icon-DhiCT",Mi="hanui-alert__body-52-z2",Pi="hanui-alert__title-I8BAh",Oi="hanui-alert__content-lhBEo",Hi="hanui-alert__action-1mTje",Ve={alert:Fi,alert__icon:Bi,alert__body:Mi,alert__title:Pi,alert__content:Oi,alert__action:Hi,"alert--info":"hanui-alert--info-lsAVw","alert--success":"hanui-alert--success-RMJR6","alert--warning":"hanui-alert--warning-Rkgln","alert--danger":"hanui-alert--danger-9ei0Y"},zi={info:t.jsx(D.InfoCircleFill,{"aria-hidden":!0}),success:t.jsx(D.CheckCircleFill,{"aria-hidden":!0}),warning:t.jsx(D.ExclamationTriangleFill,{"aria-hidden":!0}),danger:t.jsx(D.XCircleFill,{"aria-hidden":!0})},Ki=({children:e,tone:a="info",title:s,action:r,className:o,testId:c})=>t.jsxs("div",{className:v(Ve.alert,Ve[`alert--${a}`],o),role:a==="danger"||a==="warning"?"alert":void 0,"data-testid":c,children:[t.jsx("span",{className:Ve.alert__icon,children:zi[a]}),t.jsxs("div",{className:Ve.alert__body,children:[s&&t.jsx("strong",{className:Ve.alert__title,children:s}),t.jsx("div",{className:Ve.alert__content,children:e})]}),r&&t.jsx("div",{className:Ve.alert__action,children:r})]}),Ui=n.memo(Ki),Yi="hanui-avatar-qoh3P",qi="hanui-avatar__image-uAyAX",Pt={avatar:Yi,avatar__image:qi,"avatar--sm":"hanui-avatar--sm-GGjU4","avatar--md":"hanui-avatar--md-xhXnK","avatar--lg":"hanui-avatar--lg-ULP-r","avatar--tone-0":"hanui-avatar--tone-0-mvjdw","avatar--tone-1":"hanui-avatar--tone-1-RYZOX","avatar--tone-2":"hanui-avatar--tone-2-vP-CS","avatar--tone-3":"hanui-avatar--tone-3-ivgnI","avatar--tone-4":"hanui-avatar--tone-4-V57r3","avatar--tone-5":"hanui-avatar--tone-5-65aPg"},Wi=(e,a)=>{const s=e.trim().split(/\s+/).filter(Boolean);if(s.length===0)return"?";const r=s.length===1?s[0].slice(0,2):`${s[0][0]}${s[s.length-1][0]}`;return a?r.toLocaleUpperCase(a):r.toLocaleUpperCase()},Xi=(e,a)=>{let s=5381;for(let r=0;r<e.length;r+=1)s=s*33^e.charCodeAt(r);return Math.abs(s)%a},Gi=6,Qi=({name:e,imageUrl:a,locale:s,size:r="md",className:o,testId:c})=>{const{labels:i}=O();return t.jsx("span",{className:v(Pt.avatar,Pt[`avatar--${r}`],!a&&Pt[`avatar--tone-${Xi(e,Gi)}`],o),role:"img","aria-label":e,"data-testid":c,children:a?t.jsx("img",{className:Pt.avatar__image,src:a,alt:""}):Wi(e,s??(i==null?void 0:i.locale))})},Vi=n.memo(Qi),Ji="hanui-badge-uLAaI",Zi="hanui-badge__icon-R2goZ",Ot={badge:Ji,badge__icon:Zi,"badge--neutral":"hanui-badge--neutral-6kddt","badge--soft":"hanui-badge--soft-gFeRF","badge--solid":"hanui-badge--solid-rtdHI","badge--outline":"hanui-badge--outline-QiAAz","badge--success":"hanui-badge--success-Oj11F","badge--danger":"hanui-badge--danger-X3nV0","badge--warning":"hanui-badge--warning-vAsx2","badge--info":"hanui-badge--info-mHOwk","badge--oem":"hanui-badge--oem-Nl-VX","badge--alt":"hanui-badge--alt-gQkww","badge--sale":"hanui-badge--sale-Li1tG","badge--action":"hanui-badge--action-7pUio","badge--link":"hanui-badge--link-zcNJZ"},ec=({children:e,tone:a="neutral",variant:s="soft",icon:r,className:o,testId:c})=>t.jsxs("span",{className:v(Ot.badge,Ot[`badge--${a}`],Ot[`badge--${s}`],o),"data-testid":c,children:[r&&t.jsx("span",{className:Ot.badge__icon,children:r}),e]}),tc=n.memo(ec),ac="hanui-breadcrumb-amB9n",nc="hanui-breadcrumb__item-Icv1S",sc="hanui-breadcrumb__link-eVkPq",rc="hanui-breadcrumb__current-8XjhU",oc="hanui-breadcrumb__separator-vvaUi",$t={breadcrumb:ac,breadcrumb__item:nc,breadcrumb__link:sc,breadcrumb__current:rc,breadcrumb__separator:oc},ic=({items:e,label:a,linkProps:s,className:r,testId:o})=>{const{labels:c}=O();return t.jsx("nav",{className:r,"aria-label":P("Breadcrumb.label",a,c==null?void 0:c.breadcrumb),"data-testid":o,children:t.jsx("ol",{className:v($t.breadcrumb),children:e.map((i,_)=>{const h=_===e.length-1;return t.jsxs("li",{className:$t.breadcrumb__item,children:[i.href&&!h?t.jsx(ue,{href:i.href,className:$t.breadcrumb__link,...s,children:i.label}):t.jsx("span",{className:$t.breadcrumb__current,"aria-current":"page",children:i.label}),!h&&t.jsx(D.CaretRightFill,{"aria-hidden":!0,className:$t.breadcrumb__separator})]},`${i.label}-${_}`)})})})},cc=n.memo(ic),lc="hanui-card-CaHUG",dc="hanui-media__frame-eBv-s",uc="hanui-media-eggk5",_c="hanui-media__link-ujyVV",hc="hanui-overlay-AVMTX",pc="hanui-body-DyI-6",mc="hanui-footer-2WNCZ",we={card:lc,"card--interactive":"hanui-card--interactive-C1pXZ",media__frame:dc,media:uc,media__link:_c,"media__frame--cover":"hanui-media__frame--cover-ddl29","media__frame--contain":"hanui-media__frame--contain-5gosS","media__frame--inset":"hanui-media__frame--inset-oVQIn",overlay:hc,"overlay--top-left":"hanui-overlay--top-left-td1xA","overlay--top-right":"hanui-overlay--top-right-GqD9H","overlay--bottom-left":"hanui-overlay--bottom-left-T5Quw","overlay--bottom-right":"hanui-overlay--bottom-right-za3z3",body:pc,footer:mc},bc=({children:e,isInteractive:a,as:s="div",className:r,testId:o})=>t.jsx(s,{className:v(we.card,a&&we["card--interactive"],r),"data-testid":o,children:e}),gc=(e,a)=>e??(a===!1?"cover":"contain"),fc=L(n.memo(({children:e,ratio:a=1,href:s,linkProps:r,fit:o,isContained:c,className:i})=>{const _=t.jsx("span",{className:v(we.media__frame,we[`media__frame--${gc(o,c)}`]),style:{aspectRatio:a},children:e});return t.jsx("div",{className:v(we.media,i),children:s?t.jsx(ue,{href:s,className:we.media__link,tabIndex:-1,"aria-hidden":!0,...r,children:_}):_})}),"CardMedia"),xc=L(n.memo(({children:e,position:a="top-left",className:s})=>t.jsx("div",{className:v(we.overlay,we[`overlay--${a}`],s),children:e})),"CardOverlay"),vc=L(n.memo(({children:e,className:a})=>t.jsx("div",{className:v(we.body,a),children:e})),"CardBody"),yc=L(n.memo(({children:e,className:a})=>t.jsx("div",{className:v(we.footer,a),children:e})),"CardFooter"),wc=n.memo(bc),kc="hanui-carousel-GJXkW",jc="hanui-carousel__controls-hm5ij",Nc="hanui-carousel__arrowIcon-adFey",$c="hanui-carousel__track-mAux5",Ec="hanui-carousel__dots-iU8RJ",Cc="hanui-carousel__dot-JTLCB",Oe={carousel:kc,carousel__controls:jc,carousel__arrowIcon:Nc,carousel__track:$c,carousel__dots:Ec,carousel__dot:Cc,"carousel__dot--active":"hanui-carousel__dot--active-riNMm"},Ic=({children:e,label:a,previousLabel:s,nextLabel:r,formatDotLabel:o,itemWidth:c,itemMinWidth:i,className:_,testId:h})=>{const d=n.useRef(null),[l,p]=n.useState(!1),[u,b]=n.useState(!1),[g,k]=n.useState(0),[m,f]=n.useState(1),[N,j]=n.useState(!1),x=n.useCallback(()=>{const I=d.current;if(!I)return;const{scrollLeft:w,scrollWidth:E,clientWidth:T}=I;p(w>1),b(w+T<E-1),k(T>0?Math.round(w/T):0),f(T>0?Math.max(1,Math.ceil(E/T)):1),j(E>T&&I.querySelector("a, button, input, select, textarea, [tabindex]")===null)},[]);n.useEffect(()=>{const I=d.current;if(!I)return;x(),I.addEventListener("scroll",x,{passive:!0});const w=typeof ResizeObserver>"u"?null:new ResizeObserver(x);return w==null||w.observe(I),()=>{I.removeEventListener("scroll",x),w==null||w.disconnect()}},[x,e]);const $=()=>{var I;return typeof window<"u"&&((I=window.matchMedia)!=null&&I.call(window,"(prefers-reduced-motion: reduce)").matches)?"auto":"smooth"},R=I=>{var w;return(w=d.current)==null?void 0:w.scrollBy({left:I*d.current.clientWidth,behavior:$()})};return t.jsxs("section",{className:v(Oe.carousel,_),"aria-label":a,"data-testid":h,children:[t.jsxs("div",{className:Oe.carousel__controls,children:[t.jsx(je,{icon:t.jsx(D.CaretLeftFill,{"aria-hidden":!0,className:Oe.carousel__arrowIcon}),label:s,variant:"outline",size:"sm",disabled:!l,onClick:()=>R(-1)}),t.jsx(je,{icon:t.jsx(D.CaretRightFill,{"aria-hidden":!0,className:Oe.carousel__arrowIcon}),label:r,variant:"outline",size:"sm",disabled:!u,onClick:()=>R(1)})]}),t.jsx("div",{ref:d,className:Oe.carousel__track,style:{"--hanui-carousel-item-default":`${c??i??240}px`},tabIndex:N?0:void 0,role:N?"group":void 0,"aria-label":N?a:void 0,children:e}),o&&m>1&&t.jsx("div",{className:Oe.carousel__dots,children:Array.from({length:m},(I,w)=>t.jsx("button",{type:"button",className:v(Oe.carousel__dot,w===g&&Oe["carousel__dot--active"]),"aria-label":o(w+1,m),"aria-current":w===g?"true":void 0,onClick:()=>{var E;return(E=d.current)==null?void 0:E.scrollTo({left:w*d.current.clientWidth,behavior:$()})}},w))})]})},Tc=n.memo(L(Ic,"Carousel")),Rc=1600,tn=e=>{const[a,s]=n.useState(!1),r=n.useRef(null),o=n.useRef(void 0);n.useEffect(()=>()=>window.clearTimeout(o.current),[]);const c=n.useCallback(()=>{const _=r.current;if(!_)return;const h=document.createRange();h.selectNodeContents(_);const d=window.getSelection();d==null||d.removeAllRanges(),d==null||d.addRange(h)},[]),i=n.useCallback(async()=>{try{await navigator.clipboard.writeText(e),s(!0),o.current=window.setTimeout(()=>s(!1),Rc)}catch{c()}},[e,c]);return{isCopied:a,copy:i,nodeRef:r}},Dc="hanui-badge-b14ZG",Sc="hanui-badge__code-RRDlH",Lc="hanui-badge__button-CVr21",Ac="hanui-badge__srOnly-ow8L5",ut={badge:Dc,"badge--sm":"hanui-badge--sm-Fr4vY",badge__code:Sc,"badge--md":"hanui-badge--md-HGRL4","badge--lg":"hanui-badge--lg-J4aiq",badge__button:Lc,"badge__button--done":"hanui-badge__button--done-k6XeK",badge__srOnly:Ac},Fc=({code:e,isCopyable:a,copyLabel:s,copiedLabel:r,copiedAnnouncement:o,size:c="md",className:i,testId:_})=>{var u,b,g;const{labels:h}=O(),{isCopied:d,copy:l,nodeRef:p}=tn(e);return t.jsxs("span",{className:v(ut.badge,ut[`badge--${c}`],i),"data-testid":_,children:[t.jsx("span",{className:ut.badge__code,ref:p,children:e}),a&&t.jsx("button",{type:"button",className:v(ut.badge__button,d&&ut["badge__button--done"]),onClick:l,"aria-label":d?r??be("CodeBadge.copiedLabel",(u=h==null?void 0:h.copyField)==null?void 0:u.copied,e):s??be("CodeBadge.copyLabel",(b=h==null?void 0:h.copyField)==null?void 0:b.copy,e),children:d?t.jsx(D.ClipboardCheckFill,{"aria-hidden":!0}):t.jsx(D.ClipboardFill,{"aria-hidden":!0})}),t.jsx("span",{"aria-live":"polite",className:ut.badge__srOnly,children:d?P("CodeBadge.copiedAnnouncement",o,(g=h==null?void 0:h.copyField)==null?void 0:g.announcement):""})]})},Bc=n.memo(L(Fc,"CodeBadge")),Mc="hanui-copy-Yht5s",Pc="hanui-copy__code-CYlCA",Oc="hanui-copy__button-GDdH6",Hc="hanui-copy__srOnly-WMTNN",_t={copy:Mc,"copy--sm":"hanui-copy--sm-Tjqws",copy__code:Pc,"copy--md":"hanui-copy--md-00rhU",copy__button:Oc,"copy__button--done":"hanui-copy__button--done-MujUR",copy__srOnly:Hc},zc=({value:e,copyLabel:a,copiedLabel:s,copiedAnnouncement:r,size:o="sm",isReadOnly:c,className:i,testId:_})=>{var u,b,g;const{labels:h}=O(),{isCopied:d,copy:l,nodeRef:p}=tn(e);return t.jsxs("span",{className:v(_t.copy,_t[`copy--${o}`],i),"data-testid":_,children:[t.jsx("span",{className:_t.copy__code,ref:p,children:e}),!c&&t.jsx("button",{type:"button",className:v(_t.copy__button,d&&_t["copy__button--done"]),onClick:l,"aria-label":d?s??be("CopyField.copiedLabel",(u=h==null?void 0:h.copyField)==null?void 0:u.copied,e):a??be("CopyField.copyLabel",(b=h==null?void 0:h.copyField)==null?void 0:b.copy,e),children:d?t.jsx(D.ClipboardCheckFill,{"aria-hidden":!0}):t.jsx(D.ClipboardFill,{"aria-hidden":!0})}),t.jsx("span",{"aria-live":"polite",className:_t.copy__srOnly,children:d?P("CopyField.copiedAnnouncement",r,(g=h==null?void 0:h.copyField)==null?void 0:g.announcement):""})]})},Kc=n.memo(zc),Uc="hanui-divider-RJqCw",Yc="hanui-divider__label-M8sBA",Ht={divider:Uc,"divider--labelled":"hanui-divider--labelled-jZH1-",divider__label:Yc},qc=({label:e,className:a})=>e?t.jsx("div",{role:"separator","aria-label":e,className:v(Ht.divider,Ht["divider--labelled"],a),children:t.jsx("span",{className:Ht.divider__label,children:e})}):t.jsx("hr",{className:v(Ht.divider,a)}),Wc=n.memo(qc),Xc="hanui-directory-badEd",Gc="hanui-group-i6An9",Qc="hanui-group__header-rc19c",Vc="hanui-group__label-vQTcs",Jc="hanui-group__link-es5V7",Zc="hanui-group__meta-LtC-u",el="hanui-group__list-YxBCG",tl="hanui-row-3LH7X",al="hanui-row__name-75Wbq",nl="hanui-row__media-AxZEh",sl="hanui-row__marker-RYHb-",rl="hanui-jump-vpGwB",ol="hanui-jump__link-rRnT6",oe={directory:Xc,group:Gc,group__header:Qc,group__label:Vc,group__link:Jc,group__meta:Zc,group__list:el,row:tl,row__name:al,row__media:nl,row__marker:sl,jump:rl,jump__link:ol},il=({children:e,className:a})=>t.jsx("div",{className:v(oe.directory,a),children:e}),cl=L(n.memo(({label:e,href:a,linkProps:s,meta:r,children:o,id:c})=>t.jsxs("section",{className:oe.group,id:c,children:[t.jsxs("header",{className:oe.group__header,children:[t.jsx("h2",{className:oe.group__label,children:a?t.jsx(ue,{href:a,className:oe.group__link,...s,children:e}):e}),r&&t.jsx("span",{className:oe.group__meta,children:r})]}),t.jsx("ul",{className:oe.group__list,children:o})]})),"DirectoryGroup"),ll=L(n.memo(({href:e,name:a,media:s,marker:r,linkProps:o,className:c})=>t.jsx("li",{children:t.jsxs(ue,{href:e,className:v(oe.row,c),...o,children:[s&&t.jsx("span",{className:oe.row__media,children:s}),t.jsx("span",{className:oe.row__name,children:a}),r&&t.jsx("span",{className:oe.row__marker,children:r})]})})),"DirectoryRow"),dl=L(n.memo(({labels:e,toId:a,label:s})=>{const{labels:r}=O();return t.jsx("nav",{className:oe.jump,"aria-label":P("DirectoryJump.label",s,r==null?void 0:r.directoryJump),children:e.map(o=>t.jsx("a",{href:`#${a(o)}`,className:oe.jump__link,children:o},o))})}),"DirectoryJump"),ul=n.memo(il),_l="hanui-empty-47qZR",hl="hanui-empty__icon-okfEc",pl="hanui-empty__title-Z7Dzd",ml="hanui-empty__description-6BoCk",bl="hanui-empty__actions-ARk-k",Je={empty:_l,empty__icon:hl,empty__title:pl,empty__description:ml,empty__actions:bl,"empty--sm":"hanui-empty--sm-QXaXx","empty--error":"hanui-empty--error-4BBgp"},gl=({title:e,description:a,icon:s,action:r,secondaryAction:o,tone:c="empty",size:i="md",className:_,testId:h})=>t.jsxs("div",{className:v(Je.empty,Je[`empty--${i}`],Je[`empty--${c}`],_),role:c==="error"?"alert":void 0,"data-testid":h,children:[s&&t.jsx("span",{className:Je.empty__icon,children:s}),t.jsx("h3",{className:Je.empty__title,children:e}),a&&t.jsx("p",{className:Je.empty__description,children:a}),(r||o)&&t.jsxs("div",{className:Je.empty__actions,children:[r,o]})]}),fl=n.memo(gl),xl="hanui-header-yJwus",vl="hanui-header__top-UK4si",yl="hanui-header__breadcrumb-A2j0i",wl="hanui-header__text-HIo8U",kl="hanui-header__eyebrow-dZ9Zc",jl="hanui-header__titleRow-KgDZj",Nl="hanui-header__title-s1giF",$l="hanui-header__meta-UxuaD",El="hanui-header__description-NXbbC",Cl="hanui-header__actions-aShpt",ve={header:xl,header__top:vl,header__breadcrumb:yl,header__text:wl,header__eyebrow:kl,header__titleRow:jl,header__title:Nl,header__meta:$l,header__description:El,header__actions:Cl},Il=({title:e,eyebrow:a,description:s,actions:r,breadcrumb:o,meta:c,children:i,as:_="h1",className:h,testId:d})=>t.jsxs("header",{className:v(ve.header,h),"data-testid":d,children:[o&&t.jsx("div",{className:ve.header__breadcrumb,children:o}),t.jsxs("div",{className:ve.header__top,children:[t.jsxs("div",{className:ve.header__text,children:[a&&t.jsx("span",{className:ve.header__eyebrow,children:a}),t.jsxs("div",{className:ve.header__titleRow,children:[t.jsx(_,{className:ve.header__title,children:e}),c&&t.jsx("span",{className:ve.header__meta,children:c})]}),s&&t.jsx("p",{className:ve.header__description,children:s})]}),r&&t.jsx("div",{className:ve.header__actions,children:r})]}),i]}),Tl=n.memo(Il),Rl="hanui-panel-Sv-1m",Dl="hanui-panel__header-ysexh",Sl="hanui-panel__heading-xLCsB",Ll="hanui-panel__icon--yPQT",Al="hanui-panel__headingText--XqxW",Fl="hanui-panel__title-6-6uC",Bl="hanui-panel__description-qXTSM",Ml="hanui-panel__actions-Ra-zy",Pl="hanui-panel__body-lo5aX",Ol="hanui-panel__footer-qLpR1",Hl="hanui-panel__footerInner-r6VQI",zl="hanui-form-o9UqJ",Kl="hanui-row-vUGpa",V={panel:Rl,panel__header:Dl,panel__heading:Sl,panel__icon:Ll,panel__headingText:Al,panel__title:Fl,panel__description:Bl,panel__actions:Ml,panel__body:Pl,"panel__body--sm":"hanui-panel__body--sm-6XP6W","panel__body--lg":"hanui-panel__body--lg-RTK5B","panel__body--flush":"hanui-panel__body--flush-iK75R",panel__footer:Ol,panel__footerInner:Hl,form:zl,"form--2":"hanui-form--2-HdwDc",row:Kl},Ul=({children:e,title:a,description:s,actions:r,icon:o,isFlush:c,gap:i="md",footer:_,as:h="section",className:d,bodyClassName:l,testId:p})=>t.jsxs(h,{className:v(V.panel,d),"data-testid":p,children:[(a||r)&&t.jsxs("div",{className:V.panel__header,children:[t.jsxs("div",{className:V.panel__heading,children:[o&&t.jsx("span",{className:V.panel__icon,children:o}),t.jsxs("div",{className:V.panel__headingText,children:[a&&t.jsx("h2",{className:V.panel__title,children:a}),s&&t.jsx("p",{className:V.panel__description,children:s})]})]}),r&&t.jsx("div",{className:V.panel__actions,children:r})]}),t.jsx("div",{className:v(V.panel__body,V[`panel__body--${i}`],c&&V["panel__body--flush"],l),children:e}),_&&t.jsx("div",{className:V.panel__footer,children:t.jsx("div",{className:V.panel__footerInner,children:_})})]}),Yl=L(n.memo(({children:e,columns:a=1,className:s})=>t.jsx("div",{className:v(V.form,V[`form--${a}`],s),children:e})),"PanelForm"),ql=L(n.memo(({children:e,className:a})=>t.jsx("div",{className:v(V.row,a),children:e})),"PanelRow"),Wl=n.memo(Ul),Xl="hanui-price-Oc5Nr",Gl="hanui-price__current-2Xup2",Ql="hanui-price__currency-32NLN",Vl="hanui-price__list-MlQgT",Jl="hanui-price__discount-5Yc6W",Ze={price:Xl,price__current:Gl,price__currency:Ql,price__list:Vl,price__discount:Jl,"price--sm":"hanui-price--sm-Hd8Oe","price--md":"hanui-price--md-JMxlK","price--lg":"hanui-price--lg-TFqIF","price--xl":"hanui-price--xl-EJBYq"},Zl=({value:e,currency:a,listValue:s,discountPercent:r,formatDiscount:o=d=>`%${d}`,isFormatted:c,size:i="md",className:_,testId:h})=>{const{labels:d}=O(),l=P("Price.currency",a,d==null?void 0:d.currency),p=u=>{if(!c||!(d!=null&&d.locale)||!/\d/.test(u))return u;const b=Number(u.replace(/[^\d.,-]/g,"").replace(/\.(?=\d{3}\b)/g,"").replace(",","."));if(!Number.isFinite(b))return u;try{return new Intl.NumberFormat(d.locale).format(b)}catch{return u}};return t.jsxs("span",{className:v(Ze.price,Ze[`price--${i}`],_),"data-testid":h,children:[t.jsxs("span",{className:Ze.price__current,children:[p(e),t.jsx("span",{className:Ze.price__currency,children:l})]}),s&&t.jsxs("s",{className:Ze.price__list,children:[p(s),t.jsx("span",{className:Ze.price__currency,children:l})]}),r!==void 0&&r>0&&t.jsx("span",{className:Ze.price__discount,children:o(r)})]})},ed=n.memo(Zl),td="hanui-rating-94dke",ad="hanui-rating__stars-QkpVU",nd="hanui-rating__empty-Wf6-K",sd="hanui-rating__count-pIoEs",rd="hanui-rating__srOnly-E9h0d",ht={rating:td,rating__stars:ad,rating__empty:nd,rating__count:sd,rating__srOnly:rd,"rating--sm":"hanui-rating--sm-AtY7U","rating--md":"hanui-rating--md-Q0nxN"},od=({value:e,count:a,srLabel:s,size:r="sm",className:o,testId:c})=>{var h;const{labels:i}=O(),_=Math.round(e*2)/2;return t.jsxs("span",{className:v(ht.rating,ht[`rating--${r}`],o),"data-testid":c,children:[t.jsx("span",{className:ht.rating__stars,"aria-hidden":!0,children:Array.from({length:5},(d,l)=>{const p=l+1;return _>=p?t.jsx(D.StarFill,{},l):_>=p-.5?t.jsx(D.StarHalf,{},l):t.jsx(D.StarFill,{className:ht.rating__empty},l)})}),t.jsx("span",{className:ht.rating__srOnly,children:s??be("Rating.srLabel",(h=i==null?void 0:i.rating)==null?void 0:h.srLabel,e,a)}),U.isDefined(a)&&t.jsxs("span",{className:ht.rating__count,"aria-hidden":!0,children:["(",a,")"]})]})},id=n.memo(od),cd="hanui-header-a08Jh",ld="hanui-header__text-ArJkA",dd="hanui-header__overline-X5Epo",ud="hanui-header__title-nQQQJ",_d="hanui-header__description-08oCr",hd="hanui-header__action-xsxQF",et={header:cd,header__text:ld,header__overline:dd,header__title:ud,header__description:_d,header__action:hd,"header--sm":"hanui-header--sm-mIJWZ","header--lg":"hanui-header--lg-QBLIz"},pd=({title:e,description:a,overline:s,action:r,as:o="h2",size:c="md",className:i,testId:_})=>t.jsxs("header",{className:v(et.header,et[`header--${c}`],i),"data-testid":_,children:[t.jsxs("div",{className:et.header__text,children:[s&&t.jsx("span",{className:et.header__overline,children:s}),t.jsx(o,{className:et.header__title,children:e}),a&&t.jsx("p",{className:et.header__description,children:a})]}),r&&t.jsx("div",{className:et.header__action,children:r})]}),md=n.memo(pd),bd="hanui-scrollArea-Ly-yT",aa={scrollArea:bd,"scrollArea--vertical":"hanui-scrollArea--vertical-2ujC7","scrollArea--horizontal":"hanui-scrollArea--horizontal-e9pu-","scrollArea--both":"hanui-scrollArea--both-lv-8W","scrollArea--fade":"hanui-scrollArea--fade-01Bbm"},gd=({children:e,label:a,axis:s="vertical",maxHeight:r,hasFade:o,className:c,testId:i})=>{const _=n.useRef(null),[h,d]=n.useState(!1),[l,p]=n.useState({start:!1,end:!1});return n.useEffect(()=>{const u=_.current;if(!u||typeof ResizeObserver>"u")return;const b=()=>{const k=u.scrollHeight>u.clientHeight,m=u.scrollWidth>u.clientWidth;d(s==="horizontal"?m:s==="vertical"?k:k||m);const f=s==="horizontal",N=f?u.clientWidth:u.clientHeight,j=f?u.scrollWidth:u.scrollHeight,x=Math.abs(f?u.scrollLeft:u.scrollTop);p({start:x>1,end:x+N<j-1})};b();const g=new ResizeObserver(b);g.observe(u);for(const k of u.children)g.observe(k);return u.addEventListener("scroll",b,{passive:!0}),()=>{g.disconnect(),u.removeEventListener("scroll",b)}},[s,e]),t.jsx("div",{ref:_,className:v(aa.scrollArea,aa[`scrollArea--${s}`],o&&aa["scrollArea--fade"],c),style:r===void 0?void 0:{maxBlockSize:r},"data-fade-start":o&&l.start?"":void 0,"data-fade-end":o&&l.end?"":void 0,tabIndex:h?0:void 0,role:h?"region":void 0,"aria-label":h?a:void 0,"data-testid":i,children:e})},fd=n.memo(L(gd,"ScrollArea")),xd="hanui-skeleton-n92if",vd="hanui-group-YMfwa",yd="hanui-card-XQs-Q",wd="hanui-card__media-YLJDv",kd="hanui-card__body-msRvB",jd="hanui-rows-EZ9Am",Nd="hanui-row-se56N",$d="hanui-row__text-TD4iS",Ed="hanui-table-L328g",Cd="hanui-table__row-rSJTK",ie={skeleton:xd,"skeleton--block":"hanui-skeleton--block-tOZ-a","skeleton--text":"hanui-skeleton--text-k-ROi","skeleton--circle":"hanui-skeleton--circle-x-mX3",group:vd,card:yd,card__media:wd,card__body:kd,rows:jd,row:Nd,row__text:$d,table:Ed,table__row:Cd},Ke=({width:e,height:a,variant:s="block",lines:r=1,className:o})=>{const c={width:U.isNumber(e)?`${e}px`:e,height:U.isNumber(a)?`${a}px`:a};return s==="text"&&r>1?t.jsx("span",{className:v(ie.group,o),"aria-hidden":!0,children:Array.from({length:r},(i,_)=>t.jsx("span",{className:v(ie.skeleton,ie["skeleton--text"]),style:_===r-1?{width:"60%"}:void 0},_))}):t.jsx("span",{className:v(ie.skeleton,ie[`skeleton--${s}`],o),style:c,"aria-hidden":!0})},Id=n.memo(Ke),Td=({count:e=1,className:a})=>t.jsx(t.Fragment,{children:Array.from({length:e},(s,r)=>t.jsxs("div",{className:v(ie.card,a),"aria-hidden":!0,children:[t.jsx(Ke,{className:ie.card__media}),t.jsxs("div",{className:ie.card__body,children:[t.jsx(Ke,{variant:"text",width:"70%"}),t.jsx(Ke,{variant:"text",width:"40%"})]})]},r))}),Rd=({count:e=3,className:a})=>t.jsx("div",{className:v(ie.rows,a),"aria-hidden":!0,children:Array.from({length:e},(s,r)=>t.jsxs("div",{className:ie.row,children:[t.jsx(Ke,{variant:"circle",width:36,height:36}),t.jsxs("div",{className:ie.row__text,children:[t.jsx(Ke,{variant:"text",width:"45%"}),t.jsx(Ke,{variant:"text",width:"25%"})]})]},r))}),Dd=({count:e=5,columns:a=4,className:s})=>t.jsx("div",{className:v(ie.table,s),"aria-hidden":!0,children:Array.from({length:e},(r,o)=>t.jsx("div",{className:ie.table__row,children:Array.from({length:a},(c,i)=>t.jsx(Ke,{variant:"text"},i))},o))}),Sd=L(n.memo(Td),"SkeletonCard"),Ld=L(n.memo(Rd),"SkeletonRows"),Ad=L(n.memo(Dd),"SkeletonTable"),Fd="hanui-stat-Xb7wp",Bd="hanui-stat__icon-MB8NU",Md="hanui-stat__label-kUX2m",Pd="hanui-stat__value--6p13",Od="hanui-stat__unit-mjHVk",Hd="hanui-stat__delta-YKpOu",zd="hanui-stat__description-Yvw6J",Kd="hanui-stat__srOnly-YKebA",ce={stat:Fd,"stat--sm":"hanui-stat--sm-XnK8p","stat--plain":"hanui-stat--plain-N-3RC",stat__icon:Bd,stat__label:Md,stat__value:Pd,stat__unit:Od,stat__delta:Hd,"stat__delta--positive":"hanui-stat__delta--positive-1AUAM","stat__delta--negative":"hanui-stat__delta--negative--WWEP",stat__description:zd,stat__srOnly:Kd},Ud={up:t.jsx(D.ArrowUpShort,{"aria-hidden":!0}),down:t.jsx(D.ArrowDownShort,{"aria-hidden":!0}),flat:t.jsx(D.DashLg,{"aria-hidden":!0})},La={up:"increase",down:"decrease",flat:"unchanged"},Yd=({label:e,value:a,unit:s,delta:r,trend:o,isUpPositive:c=!0,description:i,icon:_,variant:h="card",size:d="md",className:l,testId:p})=>{var g;const{labels:u}=O(),b=o==="flat"?void 0:o==="up"===c;return t.jsxs("div",{className:v(ce.stat,ce[`stat--${d}`],ce[`stat--${h}`],l),"data-testid":p,children:[_&&t.jsx("span",{className:ce.stat__icon,"aria-hidden":!0,children:_}),t.jsx("span",{className:ce.stat__label,children:e}),t.jsxs("span",{className:ce.stat__value,children:[a,s&&t.jsx("span",{className:ce.stat__unit,children:s})]}),r&&o&&t.jsxs("span",{className:v(ce.stat__delta,b===!0&&ce["stat__delta--positive"],b===!1&&ce["stat__delta--negative"]),children:[Ud[o],r,t.jsx("span",{className:ce.stat__srOnly,children:P(`Stat.${La[o]}`,(g=u==null?void 0:u.stat)==null?void 0:g[La[o]])})]}),i&&t.jsx("span",{className:ce.stat__description,children:i})]})},qd=n.memo(L(Yd,"Stat")),Wd="hanui-card-wkzhi",Xd="hanui-card__media--Lm-v",Gd="hanui-card__content-8uHkm",Qd="hanui-card__title-1EwbD",Vd="hanui-card__link-mhY-M",Jd="hanui-card__description-3O0R7",Zd="hanui-card__meta-Xzk4q",tt={card:Wd,card__media:Xd,card__content:Gd,card__title:Qd,card__link:Vd,card__description:Jd,card__meta:Zd},eu=({title:e,href:a,description:s,meta:r,media:o,headingLevel:c=3,linkProps:i,className:_,testId:h})=>{const d=`h${c}`;return t.jsxs("article",{className:v(tt.card,_),"data-testid":h,children:[o&&t.jsx("span",{className:tt.card__media,"aria-hidden":!0,children:o}),t.jsxs("div",{className:tt.card__content,children:[t.jsx(d,{className:tt.card__title,children:t.jsx(ue,{href:a,className:tt.card__link,...i,children:e})}),s&&t.jsx("p",{className:tt.card__description,children:s}),r&&t.jsx("div",{className:tt.card__meta,children:r})]})]})},tu=n.memo(L(eu,"SummaryCard")),au="hanui-hub-JoqOf",nu="hanui-toast-U27Of",su="hanui-toast__icon-p-rgI",ru="hanui-toast__text-rG4ji",ou="hanui-toast__message-s6S2-",iu="hanui-toast__description-0cYTx",cu="hanui-toast__action-fOXU5",lu="hanui-toast__close-QxSNP",De={hub:au,toast:nu,"toast--info":"hanui-toast--info-S1QJr","toast--success":"hanui-toast--success-NUso7","toast--warning":"hanui-toast--warning-7mi-S","toast--danger":"hanui-toast--danger-IhFSz",toast__icon:su,toast__text:ru,toast__message:ou,toast__description:iu,toast__action:cu,toast__close:lu},du={info:t.jsx(D.InfoCircleFill,{"aria-hidden":!0}),success:t.jsx(D.CheckCircleFill,{"aria-hidden":!0}),warning:t.jsx(D.ExclamationTriangleFill,{"aria-hidden":!0}),danger:t.jsx(D.XCircleFill,{"aria-hidden":!0})},uu={info:4e3,success:4e3,warning:6e3,danger:8e3};let Aa=0;const oa=new Set;let st=[];const ga=()=>oa.forEach(e=>e(st)),ia=e=>{st=st.filter(a=>a.id!==e),ga()},Et=(e,a={})=>{Aa+=1;const s=Aa;return st=[...st,{...a,id:s,message:e}].slice(-3),ga(),s},_u={show:Et,info:(e,a)=>Et(e,{...a,tone:"info"}),success:(e,a)=>Et(e,{...a,tone:"success"}),warning:(e,a)=>Et(e,{...a,tone:"warning"}),error:(e,a)=>Et(e,{...a,tone:"danger"}),dismiss:ia,clear:()=>{st=[],ga()}},hu=({toast:e,closeLabel:a,onDismiss:s})=>{const r=e.tone??"info",o=e.duration??uu[r],[c,i]=n.useState(!1),_=n.useRef(o),h=n.useRef(0);return n.useEffect(()=>{if(o===0||c)return;h.current=Date.now();const d=window.setTimeout(()=>s(e.id),_.current);return()=>{window.clearTimeout(d),_.current=Math.max(0,_.current-(Date.now()-h.current))}},[o,c,s,e.id]),t.jsxs("div",{className:v(De.toast,De[`toast--${r}`]),role:r==="danger"?"alert":"status",onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),children:[t.jsx("span",{className:De.toast__icon,"aria-hidden":!0,children:du[r]}),t.jsxs("div",{className:De.toast__text,children:[t.jsx("span",{className:De.toast__message,children:e.message}),e.description&&t.jsx("span",{className:De.toast__description,children:e.description})]}),e.action&&t.jsx("button",{type:"button",className:De.toast__action,onClick:()=>{var d;(d=e.action)==null||d.onClick(),s(e.id)},children:e.action.label}),t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:a,variant:"ghost",size:"sm",className:De.toast__close,onClick:()=>s(e.id)})]})},pu=({closeLabel:e,regionLabel:a,className:s})=>{const{labels:r}=O(),[o,c]=n.useState([]);n.useEffect(()=>(oa.add(c),c(st),()=>{oa.delete(c)}),[]);const i=n.useCallback(l=>ia(l),[]),_=n.useCallback(()=>{const l=o.at(-1);l&&ia(l.id)},[o]);pa(o.length>0,_);const[h,d]=n.useState(!1);return n.useEffect(()=>d(!0),[]),h?rt.createPortal(t.jsx("div",{className:v(De.hub,s),role:"region","aria-label":P("ToastHub.regionLabel",a,r==null?void 0:r.notifications),"aria-live":"polite","aria-relevant":"additions",children:o.map(l=>t.jsx(hu,{toast:l,closeLabel:P("ToastHub.closeLabel",e,r==null?void 0:r.close),onDismiss:i},l.id))}),document.body):null},an=n.memo(L(pu,"ToastHub")),mu=()=>{const[e,a]=n.useState(!1);return n.useEffect(()=>a(!0),[]),e?t.jsx(an,{}):null},bu=n.memo(L(mu,"ToastPortal")),gu="hanui-accordion-h9jLC",fu="hanui-accordion__item--YvzK",xu="hanui-accordion__title-qZOLY",vu="hanui-accordion__meta-PSlsO",yu="hanui-accordion__marker-QcWcI",wu="hanui-accordion__summary-QUhWh",ku="hanui-accordion__panel--3EXE",ju="hanui-accordion__content-fO64s",Ce={accordion:gu,accordion__item:fu,"accordion__item--disabled":"hanui-accordion__item--disabled-x1erZ",accordion__title:xu,accordion__meta:vu,accordion__marker:yu,accordion__summary:wu,accordion__panel:ku,accordion__content:ju},Nu=({items:e,isSingle:a,defaultOpenIds:s,openIds:r,onChange:o,className:c,testId:i})=>{const _=n.useId(),[h,d]=n.useState(s??[]),l=r!==void 0,p=l?r:h,u=n.useCallback((g,k)=>{const m=k?a?[g]:[...p.filter(f=>f!==g),g]:p.filter(f=>f!==g);l||d(m),o==null||o(m)},[l,a,o,p]),b=n.useRef(new Map);return n.useEffect(()=>{e.forEach(g=>{const k=b.current.get(g.id);k&&(k.open=p.includes(g.id))})}),t.jsx("div",{className:v(Ce.accordion,c),"data-testid":i,children:e.map(g=>{const k=p.includes(g.id);return t.jsxs("details",{ref:m=>{m?b.current.set(g.id,m):b.current.delete(g.id)},className:v(Ce.accordion__item,g.isDisabled&&Ce["accordion__item--disabled"]),open:k,onToggle:m=>{const f=m.currentTarget.open;f!==k&&u(g.id,f)},children:[t.jsxs("summary",{id:`${_}-${g.id}`,className:Ce.accordion__summary,"aria-disabled":g.isDisabled,tabIndex:g.isDisabled?-1:void 0,onClick:m=>g.isDisabled&&m.preventDefault(),children:[t.jsx(D.CaretRightFill,{"aria-hidden":!0,className:Ce.accordion__marker}),t.jsx("span",{className:Ce.accordion__title,children:g.title}),g.meta&&t.jsx("span",{className:Ce.accordion__meta,children:g.meta})]}),t.jsx("div",{className:Ce.accordion__panel,children:t.jsx("div",{className:Ce.accordion__content,children:g.content})})]},g.id)})})},$u=n.memo(L(Nu,"Accordion")),Eu="hanui-steps-ntge1",Cu="hanui-steps__label-NSeFM",Iu="hanui-steps__item-GrU1x",Tu="hanui-steps__button-XBsnS",Ru="hanui-steps__marker-g-GLE",Du="hanui-steps__text-Mkpkh",Su="hanui-steps__description-bQuNT",Lu="hanui-steps__status-wWJfP",le={steps:Eu,"steps--horizontal":"hanui-steps--horizontal-O-mkx","steps--vertical":"hanui-steps--vertical-agfwo","steps--static":"hanui-steps--static-t9EED",steps__label:Cu,steps__item:Iu,steps__button:Tu,steps__marker:Ru,"steps__item--done":"hanui-steps__item--done-mvOuN","steps__item--current":"hanui-steps__item--current-Qzlal",steps__text:Du,steps__description:Su,steps__status:Lu},Au=(e,a)=>e<a?"done":e===a?"current":"upcoming",Fa={done:"completed",current:"current",upcoming:"upcoming"},Fu=({steps:e,currentIndex:a,onStepClick:s,label:r,orientation:o="horizontal",className:c,testId:i})=>{const{labels:_}=O();return t.jsx("ol",{className:v(le.steps,le[`steps--${o}`],a===void 0&&le["steps--static"],c),"aria-label":r,"data-testid":i,children:e.map((h,d)=>{var b;const l=a===void 0?void 0:Au(d,a),p=!!s&&l==="done",u=t.jsxs(t.Fragment,{children:[t.jsx("span",{className:le.steps__marker,"aria-hidden":!0,children:l==="done"?t.jsx(D.CheckLg,{}):d+1}),t.jsxs("span",{className:le.steps__text,children:[t.jsx("span",{className:le.steps__label,children:h.label}),h.description&&t.jsx("span",{className:le.steps__description,children:h.description})]}),l&&t.jsx("span",{className:le.steps__status,children:P(`Steps.${Fa[l]}`,(b=_==null?void 0:_.steps)==null?void 0:b[Fa[l]])})]});return t.jsx("li",{className:v(le.steps__item,l&&le[`steps__item--${l}`]),"aria-current":l==="current"?"step":void 0,children:p?t.jsx("button",{type:"button",className:le.steps__button,onClick:()=>s==null?void 0:s(d),children:u}):t.jsx("span",{className:le.steps__button,children:u})},h.id)})})},Bu=n.memo(L(Fu,"Steps")),Mu="hanui-tabs-l4dFE",Pu="hanui-tabs__list-HJvR8",Ou="hanui-tabs__tab-7gDW7",Hu="hanui-tabs__count-8JX8s",zu="hanui-tabs__panel-CPklY",pt={tabs:Mu,tabs__list:Pu,tabs__tab:Ou,"tabs__tab--active":"hanui-tabs__tab--active-riqNp",tabs__count:Hu,tabs__panel:zu},Ku=({items:e,defaultTabId:a,activeId:s,onChange:r,ariaLabel:o,isManualActivation:c,className:i,testId:_})=>{var I;const h=n.useId(),[d,l]=n.useState(a??((I=e[0])==null?void 0:I.id)),p=U.isDefined(s),u=p?s:d,b=e.findIndex(w=>w.id===u),[g,k]=n.useState(b<0?0:b),m=n.useRef(null),f=e[b]??e[0],N=g>=0&&g<e.length?g:Math.max(b,0);n.useEffect(()=>{k(b<0?0:b)},[b]);const j=n.useRef(!1);n.useEffect(()=>{var w;if(!j.current){j.current=!0;return}da((w=m.current)==null?void 0:w.querySelector('[aria-selected="true"]'),{block:"nearest",inline:"nearest"})},[u]);const x=w=>{p||l(w),r==null||r(w)},$=w=>{var y;if(c&&(w.key==="Enter"||w.key===" ")){w.preventDefault();const C=e[N];C&&x(C.id);return}const E=w.key==="ArrowRight"?1:w.key==="ArrowLeft"?-1:0;if(E===0)return;w.preventDefault();const T=((c?N:b)+E+e.length)%e.length;k(T),c||x(e[T].id),(y=document.getElementById(`${h}-tab-${e[T].id}`))==null||y.focus()};if(e.length===0)return null;const R=U.isDefined(f==null?void 0:f.content);return t.jsxs("div",{className:v(pt.tabs,i),"data-testid":_,children:[t.jsx("div",{ref:m,className:pt.tabs__list,role:"tablist","aria-label":o,onKeyDown:$,children:e.map(w=>{var T;const E=w.id===f.id;return t.jsxs("button",{id:`${h}-tab-${w.id}`,type:"button",role:"tab","aria-selected":E,"aria-controls":E&&R?`${h}-panel-${w.id}`:void 0,tabIndex:(c?((T=e[N])==null?void 0:T.id)===w.id:E)?0:-1,className:v(pt.tabs__tab,E&&pt["tabs__tab--active"]),onClick:()=>x(w.id),children:[w.label,U.isDefined(w.count)&&t.jsx("span",{className:pt.tabs__count,children:w.count})]},w.id)})}),R&&t.jsx("div",{id:`${h}-panel-${f.id}`,role:"tabpanel","aria-labelledby":`${h}-tab-${f.id}`,className:pt.tabs__panel,tabIndex:0,children:f.content})]})},Uu=n.memo(Ku),Yu="hanui-tile-TGur-",qu="hanui-tile__medallion--Y0pz",Wu="hanui-tile__label-mI1OQ",Xu="hanui-tile__meta-22qnR",Ct={tile:Yu,tile__medallion:qu,tile__label:Wu,tile__meta:Xu,"tile--active":"hanui-tile--active-z0F2M"},Gu=({label:e,icon:a,href:s,meta:r,isActive:o,linkProps:c,className:i,testId:_})=>t.jsxs(ue,{href:s,className:v(Ct.tile,o&&Ct["tile--active"],i),"aria-current":o?"page":void 0,"data-testid":_,...c,children:[t.jsx("span",{className:Ct.tile__medallion,"aria-hidden":!0,children:a}),t.jsx("span",{className:Ct.tile__label,children:e}),r&&t.jsx("span",{className:Ct.tile__meta,children:r})]}),Qu=n.memo(Gu),Vu="hanui-timeline-GxubZ",Ju="hanui-timeline__item-qMpF2",Zu="hanui-timeline__marker-MDk07",e_="hanui-timeline__body-xJi7t",t_="hanui-timeline__title-pKxZJ",a_="hanui-timeline__time-ITWYy",n_="hanui-timeline__description-4vrEy",s_="hanui-timeline__srOnly-7K2We",Ie={timeline:Vu,timeline__item:Ju,timeline__marker:Zu,"timeline__item--done":"hanui-timeline__item--done-dqiOQ","timeline__item--current":"hanui-timeline__item--current-TGV5f","timeline__item--pending":"hanui-timeline__item--pending-VMZTS","timeline__item--failed":"hanui-timeline__item--failed-2BbfX",timeline__body:e_,timeline__title:t_,timeline__time:a_,timeline__description:n_,timeline__srOnly:s_},r_={done:t.jsx(D.CheckLg,{}),failed:t.jsx(D.XLg,{}),current:null,pending:null},na={done:"completed",current:"current",pending:null,failed:"failed"},o_=({events:e,label:a,className:s,testId:r})=>{const{labels:o}=O();return t.jsx("ol",{className:v(Ie.timeline,s),"aria-label":a,"data-testid":r,children:e.map(c=>{var _;const i=c.status??"done";return t.jsxs("li",{className:v(Ie.timeline__item,Ie[`timeline__item--${i}`]),"aria-current":i==="current"?"step":void 0,children:[t.jsx("span",{className:Ie.timeline__marker,"aria-hidden":!0,children:c.icon??r_[i]}),t.jsxs("div",{className:Ie.timeline__body,children:[t.jsxs("span",{className:Ie.timeline__title,children:[c.title,t.jsx("span",{className:Ie.timeline__srOnly,children:na[i]===null?null:P(`Timeline.${na[i]}`,(_=o==null?void 0:o.timeline)==null?void 0:_[na[i]])})]}),c.time&&t.jsx("span",{className:Ie.timeline__time,children:c.time}),c.description&&t.jsx("span",{className:Ie.timeline__description,children:c.description})]})]},c.id)})})},i_=n.memo(L(o_,"Timeline")),c_="hanui-modal-3IDi9",l_="hanui-modal__panel--qLSz",d_="hanui-modal__header-meWm6",u_="hanui-modal__icon-df2dd",__="hanui-modal__heading-PwDS8",h_="hanui-modal__title-80Sh6",p_="hanui-modal__description-fsCHI",m_="hanui-modal__close-vFPbw",b_="hanui-modal__body-PDF12",g_="hanui-modal__footer-CCCkx",se={modal:c_,"modal--sm":"hanui-modal--sm-A7WsS","modal--lg":"hanui-modal--lg-z99Em",modal__panel:l_,modal__header:d_,modal__icon:u_,"modal__icon--neutral":"hanui-modal__icon--neutral-QSL7c","modal__icon--danger":"hanui-modal__icon--danger-6V90a","modal__icon--warning":"hanui-modal__icon--warning-a--FX","modal__icon--success":"hanui-modal__icon--success-YWxZs","modal__icon--info":"hanui-modal__icon--info-WRLah",modal__heading:__,modal__title:h_,modal__description:p_,modal__close:m_,modal__body:b_,modal__footer:g_},f_=({isOpen:e,onClose:a,title:s,closeLabel:r,children:o,description:c,footer:i,icon:_,tone:h="neutral",size:d="md",isDismissable:l=!0,className:p,testId:u})=>{const{labels:b}=O(),g=n.useRef(null),k=n.useRef(null),m=n.useId(),f=n.useId();n.useEffect(()=>{const j=g.current;if(!j)return;if(!e){j.open&&j.close();return}const x=xt();j.open||j.showModal(),Wt(j,`.${se.modal__close}`),ha(j);const{token:$,pop:R}=Dt();return k.current=$,()=>{R(),k.current=null,x()}},[e]),Xt(e),n.useEffect(()=>{const j=g.current;if(!j)return;const x=$=>{$.preventDefault(),l&&(k.current&&!St(k.current)||a())};return j.addEventListener("cancel",x),()=>j.removeEventListener("cancel",x)},[a,l]);const N=n.useCallback(j=>{l&&j.target===g.current&&a()},[l,a]);return t.jsx("dialog",{ref:g,className:v(se.modal,se[`modal--${d}`],p),"aria-labelledby":m,"aria-describedby":c?f:void 0,"data-testid":u,onClick:N,children:t.jsxs("div",{className:se.modal__panel,children:[t.jsxs("header",{className:se.modal__header,children:[_&&t.jsx("span",{className:v(se.modal__icon,se[`modal__icon--${h}`]),children:_}),t.jsxs("div",{className:se.modal__heading,children:[t.jsx("h2",{id:m,className:se.modal__title,children:s}),c&&t.jsx("p",{id:f,className:se.modal__description,children:c})]}),l&&t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:P("Modal.closeLabel",r,b==null?void 0:b.close),variant:"ghost",size:"sm",className:se.modal__close,onClick:a})]}),o&&t.jsx("div",{className:se.modal__body,children:o}),i&&t.jsx("footer",{className:se.modal__footer,children:i})]})})},fa=n.memo(f_),x_="hanui-palette-ag-P9",v_="hanui-palette__search-G3aYv",y_="hanui-palette__searchIcon-2UYj-",w_="hanui-palette__input-vvLvt",k_="hanui-palette__list--KWiH",j_="hanui-palette__group-KPj5Q",N_="hanui-palette__item-UZzkp",$_="hanui-palette__icon-Fg0Lt",E_="hanui-palette__text-flfN9",C_="hanui-palette__label-8-UHe",I_="hanui-palette__description-eRlk9",T_="hanui-palette__shortcut-DwYKX",R_="hanui-palette__empty-vg-I3",Z={palette:x_,palette__search:v_,palette__searchIcon:y_,palette__input:w_,palette__list:k_,palette__group:j_,palette__item:N_,"palette__item--active":"hanui-palette__item--active-XHcka",palette__icon:$_,palette__text:E_,palette__label:C_,palette__description:I_,palette__shortcut:T_,palette__empty:R_},D_=({isOpen:e,onClose:a,items:s,label:r,searchPlaceholder:o,emptyMessage:c,className:i,testId:_})=>{const h=n.useId(),d=`${h}-listbox`,l=n.useRef(null),p=n.useRef(null),u=n.useRef(null),[b,g]=n.useState(""),[k,m]=n.useState(0),f=n.useMemo(()=>{if(b.trim()==="")return s;const x=b.trim();return s.filter($=>Rt($.label,x)||($.description?Rt($.description,x):!1))},[s,b]);Xt(e),n.useEffect(()=>{var w;const x=l.current;if(!x)return;if(!e){x.open&&x.close();return}const $=xt();x.open||x.showModal(),(w=p.current)==null||w.focus({preventScroll:!0}),g(""),m(0);const{token:R,pop:I}=Dt();return u.current=R,()=>{I(),u.current=null,$()}},[e]),n.useEffect(()=>{const x=l.current;if(!x)return;const $=R=>{R.preventDefault(),!(u.current&&!St(u.current))&&a()};return x.addEventListener("cancel",$),()=>x.removeEventListener("cancel",$)},[a]),n.useEffect(()=>{var x;da((x=l.current)==null?void 0:x.querySelector(`[data-index="${k}"]`),{block:"nearest"})},[k]);const N=x=>{x.onSelect(),a()},j=x=>{const $=f.length-1;switch(x.key){case"ArrowDown":x.preventDefault(),m(R=>R>=$?0:R+1);break;case"ArrowUp":x.preventDefault(),m(R=>R<=0?$:R-1);break;case"Home":x.preventDefault(),m(0);break;case"End":x.preventDefault(),m($);break;case"Enter":{x.preventDefault();const R=f[k];R&&N(R);break}}};return t.jsxs("dialog",{ref:l,className:v(Z.palette,i),"aria-label":r,"data-testid":_,onClick:x=>x.target===l.current&&a(),children:[t.jsxs("div",{className:Z.palette__search,children:[t.jsx(D.Search,{"aria-hidden":!0,className:Z.palette__searchIcon}),t.jsx("input",{ref:p,type:"text",role:"combobox",className:Z.palette__input,value:b,placeholder:o,"aria-label":o,autoComplete:"off","aria-autocomplete":"list","aria-expanded":!0,"aria-controls":d,"aria-activedescendant":f[k]?`${h}-option-${k}`:void 0,onChange:x=>{g(x.target.value),m(0)},onKeyDown:j})]}),t.jsxs("ul",{id:d,role:"listbox","aria-label":r,className:Z.palette__list,children:[f.map((x,$)=>{var I;const R=x.group!==void 0&&x.group!==((I=f[$-1])==null?void 0:I.group);return t.jsxs("li",{role:"presentation",children:[R&&t.jsx("span",{className:Z.palette__group,"aria-hidden":!0,children:x.group}),t.jsxs("div",{id:`${h}-option-${$}`,role:"option","data-index":$,"aria-selected":$===k,className:v(Z.palette__item,$===k&&Z["palette__item--active"]),onMouseEnter:()=>m($),onClick:()=>N(x),children:[x.icon&&t.jsx("span",{className:Z.palette__icon,"aria-hidden":!0,children:x.icon}),t.jsxs("span",{className:Z.palette__text,children:[t.jsx("span",{className:Z.palette__label,children:x.label}),x.description&&t.jsx("span",{className:Z.palette__description,children:x.description})]}),x.shortcut&&t.jsx("kbd",{className:Z.palette__shortcut,"aria-hidden":!0,children:x.shortcut})]})]},x.id)}),f.length===0&&t.jsx("li",{role:"presentation",className:Z.palette__empty,children:c})]})]})},S_=n.memo(L(D_,"CommandPalette")),L_={destructive:t.jsx(D.TrashFill,{"aria-hidden":!0}),warning:t.jsx(D.ExclamationTriangleFill,{"aria-hidden":!0}),neutral:t.jsx(D.QuestionCircleFill,{"aria-hidden":!0})},A_={destructive:"danger",warning:"warning",neutral:"info"},F_={destructive:ke.DANGER,warning:ke.PRIMARY,neutral:ke.PRIMARY},B_=({isOpen:e,onClose:a,onConfirm:s,title:r,description:o,confirmLabel:c,cancelLabel:i,closeLabel:_,variant:h,kind:d,children:l})=>{const{labels:p}=O(),[u,b]=n.useState(!1),g=h??d??"neutral",k=async()=>{b(!0);try{await s()}finally{b(!1)}};return t.jsx(fa,{isOpen:e,onClose:a,title:r,closeLabel:_??(p==null?void 0:p.close),description:o,icon:L_[g],tone:A_[g],size:"sm",isDismissable:!u,footer:t.jsxs(t.Fragment,{children:[t.jsx(gt,{variant:ke.SECONDARY,size:Ye.MEDIUM,onClick:a,disabled:u,children:P("ConfirmDialog.cancelLabel",i,p==null?void 0:p.cancel)}),t.jsx(gt,{variant:F_[g],size:Ye.MEDIUM,onClick:k,isLoading:u,children:c})]}),children:l})},M_=n.memo(B_),P_="hanui-drawer-fgfi1",O_="hanui-drawer__header-BDcRe",H_="hanui-drawer__title-9M0e8",z_="hanui-drawer__close-Z30oW",K_="hanui-drawer__toolbar-vcsYi",U_="hanui-drawer__body-x12SX",Y_="hanui-drawer__footer-PajTg",ye={drawer:P_,"drawer--sm":"hanui-drawer--sm-ywgof","drawer--md":"hanui-drawer--md-mN8Kg","drawer--lg":"hanui-drawer--lg-5H-oE","drawer--end":"hanui-drawer--end-q-sIP","drawer--start":"hanui-drawer--start-xqVlX",drawer__header:O_,drawer__title:H_,drawer__close:z_,drawer__toolbar:K_,drawer__body:U_,drawer__footer:Y_},q_=({isOpen:e,onClose:a,title:s,closeLabel:r,children:o,side:c="end",size:i="md",footer:_,toolbar:h,className:d,testId:l})=>{const{labels:p}=O(),u=n.useRef(null),b=n.useRef(null),g=n.useId();n.useEffect(()=>{const m=u.current;if(!m)return;if(!e){m.open&&m.close();return}const f=xt();m.open||m.showModal(),Wt(m,`.${ye.drawer__close}`),ha(m);const{token:N,pop:j}=Dt();return b.current=N,()=>{j(),b.current=null,f()}},[e]),Xt(e),Qa(e),n.useEffect(()=>{const m=u.current;if(!m)return;const f=N=>{N.preventDefault(),!(b.current&&!St(b.current))&&a()};return m.addEventListener("cancel",f),()=>m.removeEventListener("cancel",f)},[a]);const k=n.useCallback(m=>{m.target===u.current&&a()},[a]);return t.jsxs("dialog",{ref:u,className:v(ye.drawer,ye[`drawer--${c}`],ye[`drawer--${i}`],d),"aria-labelledby":g,"data-testid":l,onClick:k,children:[t.jsxs("header",{className:ye.drawer__header,children:[t.jsx("h2",{id:g,className:ye.drawer__title,children:s}),t.jsx(je,{icon:t.jsx(D.XLg,{"aria-hidden":!0}),label:P("Drawer.closeLabel",r,p==null?void 0:p.close),variant:"ghost",size:"sm",className:ye.drawer__close,onClick:a})]}),h&&t.jsx("div",{className:ye.drawer__toolbar,children:h}),t.jsx("div",{className:ye.drawer__body,children:o}),_&&t.jsx("div",{className:ye.drawer__footer,children:_})]})},W_=n.memo(L(q_,"Drawer")),X_="hanui-form-zpZn4",G_={form:X_},Q_=({isOpen:e,onClose:a,onSubmit:s,title:r,label:o,submitLabel:c,cancelLabel:i,closeLabel:_,description:h,hint:d,placeholder:l,defaultValue:p="",isRequired:u,requiredLabel:b,inputMode:g="text",maxLength:k,rows:m=4})=>{const{labels:f}=O(),N=n.useId(),[j,x]=n.useState(p),[$,R]=n.useState(!1),I=n.useRef(!1);n.useEffect(()=>{e&&!I.current&&x(p),I.current=e},[e,p]);const w=j.trim(),E=!!u&&w==="",T=C=>g==="multiline"?t.jsx(Va,{...C,value:j,onChange:B=>x(B.target.value),placeholder:l,maxLength:k,rows:m}):t.jsx(ba,{...C,type:g==="number"?"number":"text",value:j,onChange:B=>x(B.target.value),placeholder:l,maxLength:k}),y=async()=>{if(!(E||$)){R(!0);try{await s(w),a()}catch{}finally{R(!1)}}};return t.jsx(fa,{isOpen:e,onClose:a,title:r,closeLabel:_??(f==null?void 0:f.close),description:h,size:"sm",isDismissable:!$,footer:t.jsxs(t.Fragment,{children:[t.jsx(gt,{variant:ke.SECONDARY,size:Ye.MEDIUM,onClick:a,disabled:$,children:P("PromptDialog.cancelLabel",i,f==null?void 0:f.cancel)}),t.jsx(gt,{type:"submit",form:N,variant:ke.PRIMARY,size:Ye.MEDIUM,disabled:E,isLoading:$,children:P("PromptDialog.submitLabel",c,f==null?void 0:f.submit)})]}),children:t.jsx("form",{id:N,className:G_.form,onSubmit:C=>{C.preventDefault(),y()},children:t.jsx(Ja,{label:o,hint:d,isRequired:u,requiredLabel:b,children:T})})})},V_=n.memo(Q_),J_="hanui-scroller-EtDmS",Z_="hanui-table-uCv4q",mt={scroller:J_,"scroller--frame":"hanui-scroller--frame-84zz6",table:Z_,"table--compact":"hanui-table--compact-4KCVl","table--regular":"hanui-table--regular-hsA3-","table--spacious":"hanui-table--spacious-BBUX-","table--sticky-head":"hanui-table--sticky-head-FO2L4","table--row-hover":"hanui-table--row-hover--MAoe"},eh=L(n.memo(({hasFrame:e=!0,label:a,className:s,children:r,...o})=>{const c=n.useRef(null),[i,_]=n.useState(!1);return n.useEffect(()=>{const h=c.current;if(!h||typeof ResizeObserver>"u")return;const d=()=>_(h.scrollWidth>h.clientWidth+1);d();const l=new ResizeObserver(d);l.observe(h);for(const p of h.children)l.observe(p);return()=>l.disconnect()},[r]),t.jsx("div",{ref:c,tabIndex:i?0:void 0,role:i?"region":void 0,"aria-label":i?a:void 0,className:v(mt.scroller,e&&mt["scroller--frame"],s),...o,children:r})}),"TableScroller"),th=({density:e="regular",hasStickyHead:a,hasRowHover:s,className:r,children:o,...c})=>t.jsx("table",{className:v(mt.table,mt[`table--${e}`],a&&mt["table--sticky-head"],s&&mt["table--row-hover"],r),...c,children:o}),ah=n.memo(th),nh="hanui-wrapper-KXCZg",sh="hanui-table-LF5Ow",rh="hanui-state-YPPb0",oh="hanui-state__message-wwbIW",ih="hanui-srOnly-Oia8c",ch="hanui-sort-3Q6Fx",lh="hanui-sort__arrow-MITWb",dh="hanui-sticky-KDEvQ",uh="hanui-bulkBar-62qk0",ee={wrapper:nh,"wrapper--capped":"hanui-wrapper--capped-M2QUJ",table:sh,state:rh,"state--error":"hanui-state--error-A492d",state__message:oh,"row--warning":"hanui-row--warning-BAUN2",srOnly:ih,sort:ch,sort__arrow:lh,"sort__arrow--ascending":"hanui-sort__arrow--ascending-85T5d","sort__arrow--descending":"hanui-sort__arrow--descending-gs3VU",sticky:dh,bulkBar:uh},_h=({columns:e,label:a,children:s,isLoading:r,error:o,emptyMessage:c,loadingMessage:i,hasViewportCap:_,onSort:h,bulkBar:d,className:l,testId:p})=>{var k,m;const{labels:u}=O(),b=n.Children.count(s),g=(f,N)=>t.jsx("tr",{children:t.jsx("td",{colSpan:e.length,className:v(ee.state,N&&ee[`state--${N}`]),children:f})});return t.jsxs("div",{className:v(ee.wrapper,_&&ee["wrapper--capped"],l),"data-testid":p,children:[d&&t.jsx("div",{className:ee.bulkBar,children:d}),t.jsxs("table",{className:ee.table,"aria-label":a,children:[t.jsx("thead",{children:t.jsx("tr",{children:e.map(f=>{const N=!!(f.isSortable&&h),j=f.ariaSort==="ascending"?"descending":"ascending";return t.jsx("th",{scope:"col","aria-sort":f.ariaSort,className:v(f.className,f.isSticky&&ee.sticky),children:N?t.jsxs("button",{type:"button",className:ee.sort,onClick:()=>h==null?void 0:h(f.key,j),children:[f.label,f.srLabel&&t.jsx("span",{className:ee.srOnly,children:f.srLabel}),t.jsx("span",{"aria-hidden":!0,className:v(ee.sort__arrow,f.ariaSort&&ee[`sort__arrow--${f.ariaSort}`]),children:f.ariaSort==="descending"?"▾":"▴"})]}):t.jsxs(t.Fragment,{children:[f.label,f.srLabel&&t.jsx("span",{className:ee.srOnly,children:f.srLabel})]})},f.key)})})}),t.jsx("tbody",{children:o?g(t.jsxs("span",{role:"alert",className:ee.state__message,children:[t.jsx(D.ExclamationCircleFill,{"aria-hidden":!0}),o]}),"error"):r?g(P("DataTable.loadingMessage",i,(k=u==null?void 0:u.dataTable)==null?void 0:k.loading)):b===0?g(P("DataTable.emptyMessage",c,(m=u==null?void 0:u.dataTable)==null?void 0:m.empty)):s})]})]})},hh=L(n.memo(({isWarning:e,className:a,children:s,...r})=>t.jsx("tr",{className:v(e&&ee["row--warning"],a),...r,children:s})),"DataTableRow"),ph=n.memo(_h),mh="hanui-bar-b4PP4",bh="hanui-bar__hiddenSubmit-jeCyX",gh="hanui-bar__actions-rG69L",fh="hanui-field-f-rvu",Tt={bar:mh,bar__hiddenSubmit:bh,bar__actions:gh,field:fh,"field--wide":"hanui-field--wide-FA5gf"},xh=({onSubmit:e,children:a,actions:s,label:r,className:o,testId:c})=>{const{labels:i}=O();return t.jsxs("form",{className:v(Tt.bar,o),"aria-label":P("FilterBar.label",r,i==null?void 0:i.filters),"data-testid":c,onSubmit:_=>{_.preventDefault(),e()},children:[a,t.jsx("button",{type:"submit",className:Tt.bar__hiddenSubmit,tabIndex:-1,"aria-hidden":!0}),s&&t.jsx("div",{className:Tt.bar__actions,children:s})]})},vh=L(n.memo(({children:e,isWide:a,className:s})=>t.jsx("div",{className:v(Tt.field,a&&Tt["field--wide"],s),children:e})),"FilterBarField"),yh=n.memo(xh),wh="hanui-pagination-K-L20",kh="hanui-pagination__list--9HqC",jh="hanui-pagination__arrow-XIgoX",Nh="hanui-pagination__page-TpoJM",$h="hanui-pagination__gap-qoDyI",Te={pagination:wh,pagination__list:kh,pagination__arrow:jh,pagination__page:Nh,"pagination__page--active":"hanui-pagination__page--active-XHeaz",pagination__gap:$h},Eh=(e,a)=>{if(a<=7)return Array.from({length:a},(c,i)=>i+1);const s=new Set([1,a,e]);e-1>1&&s.add(e-1),e+1<a&&s.add(e+1);const r=[...s].sort((c,i)=>c-i),o=[];return r.forEach((c,i)=>{i>0&&c-r[i-1]>1&&o.push("gap"),o.push(c)}),o},Ch=({page:e,totalPages:a,label:s,previousLabel:r,nextLabel:o,buildHref:c,onPageChange:i,linkProps:_,formatAnnouncement:h,scrollTo:d,className:l,testId:p})=>{var $,R,I;const{labels:u}=O(),b=Yt(),g=n.useRef(e);n.useEffect(()=>{g.current!==e&&(g.current=e,h&&b(h(e,a)))},[e,a,h,b]);const k=n.useMemo(()=>Eh(e,a),[e,a]);if(a<=1)return null;const m=w=>{d==="top"&&w!==e&&wn()},f=w=>{i&&(i(w),m(w))},N=_==null?void 0:_.onClick,j=(w,E)=>{N==null||N(w),!(w.defaultPrevented||w.button!==0)&&(w.metaKey||w.ctrlKey||w.shiftKey||w.altKey||m(E))},x=(w,E,T)=>{const y=w<1||w>a;return c&&!y?t.jsx(ue,{href:c(w),className:Te.pagination__arrow,"aria-label":E,..._,onClick:C=>j(C,w),children:T}):t.jsx(je,{className:Te.pagination__arrow,icon:T,label:E,variant:"outline",disabled:y,onClick:()=>f(w)})};return t.jsxs("nav",{className:v(Te.pagination,l),"aria-label":P("Pagination.label",s,($=u==null?void 0:u.pagination)==null?void 0:$.label),"data-testid":p,children:[x(e-1,P("Pagination.previousLabel",r,(R=u==null?void 0:u.pagination)==null?void 0:R.previous),t.jsx(D.CaretLeftFill,{"aria-hidden":!0})),t.jsx("ul",{className:Te.pagination__list,children:k.map((w,E)=>w==="gap"?t.jsx("li",{className:Te.pagination__gap,"aria-hidden":!0,children:"…"},`gap-${E}`):t.jsx("li",{children:c?t.jsx(ue,{href:c(w),className:v(Te.pagination__page,w===e&&Te["pagination__page--active"]),"aria-current":w===e?"page":void 0,..._,onClick:T=>j(T,w),children:w}):t.jsx(gt,{variant:ke.SECONDARY,size:Ye.SMALL,className:v(Te.pagination__page,w===e&&Te["pagination__page--active"]),"aria-current":w===e?"page":void 0,onClick:()=>f(w),children:w})},w))}),x(e+1,P("Pagination.nextLabel",o,(I=u==null?void 0:u.pagination)==null?void 0:I.next),t.jsx(D.CaretRightFill,{"aria-hidden":!0}))]})},Ih=n.memo(Ch);exports.ABOVE_MOBILE_MEDIA_QUERY=qt;exports.ABOVE_TABLET_MEDIA_QUERY=$n;exports.Accordion=$u;exports.Alert=Ui;exports.Avatar=Vi;exports.Badge=tc;exports.BottomSheet=ma;exports.Breadcrumb=cc;exports.Button=gt;exports.COMPACT_DENSITY=_n;exports.Card=wc;exports.CardBody=vc;exports.CardFooter=yc;exports.CardMedia=fc;exports.CardOverlay=xc;exports.Carousel=Tc;exports.Checkbox=Er;exports.Chip=qa;exports.ChipGroup=ys;exports.CodeBadge=Bc;exports.Combobox=tr;exports.CommandPalette=S_;exports.ConfirmDialog=M_;exports.CopyField=Kc;exports.DARK_THEME=Oa;exports.DEFAULT_FONTS=hn;exports.DENSITY_ATTRIBUTE=ca;exports.DataTable=ph;exports.DataTableRow=hh;exports.DateField=Vo;exports.DateRange=Zo;exports.Directory=ul;exports.DirectoryGroup=cl;exports.DirectoryJump=dl;exports.DirectoryRow=ll;exports.Divider=Wc;exports.Drawer=W_;exports.EmptyState=fl;exports.Field=Ja;exports.FileUpload=Ai;exports.FilterBar=yh;exports.FilterBarField=vh;exports.HanuiProvider=mn;exports.IconButton=je;exports.Input=ba;exports.LIGHT_THEME=Pa;exports.METRIC_TOKENS=un;exports.MOBILE_BREAKPOINT=Ua;exports.Menu=ds;exports.Modal=fa;exports.PageHeader=Tl;exports.Pagination=Ih;exports.Panel=Wl;exports.PanelForm=Yl;exports.PanelRow=ql;exports.PasswordInput=Lo;exports.Popover=hs;exports.Price=ed;exports.Progress=en;exports.ProgressCircle=xi;exports.PromptDialog=V_;exports.QuantityStepper=vo;exports.Radio=Kr;exports.RadioCard=Gr;exports.RangeSlider=so;exports.Rating=id;exports.RatingInput=mo;exports.ScrollArea=fd;exports.SectionHeader=md;exports.SegmentedControl=ir;exports.Select=vr;exports.Skeleton=Id;exports.SkeletonCard=Sd;exports.SkeletonRows=Ld;exports.SkeletonTable=Ad;exports.Spinner=_a;exports.Stat=qd;exports.Steps=Bu;exports.SummaryCard=tu;exports.Switch=Ar;exports.TABLET_BREAKPOINT=Ya;exports.TABLET_PORTRAIT_BREAKPOINT=Nn;exports.THEME_ATTRIBUTE=ze;exports.Table=ah;exports.TableCheckbox=jo;exports.TableScroller=eh;exports.Tabs=Uu;exports.TagInput=Oo;exports.TextLink=Hn;exports.Textarea=Va;exports.Tile=Qu;exports.Timeline=i_;exports.ToastHub=an;exports.ToastPortal=bu;exports.Tooltip=ss;exports.UISize=Ye;exports.UIVariant=ke;exports.applyThemeConfig=la;exports.buildThemeCss=Ha;exports.initHanui=bn;exports.matchesSearch=Rt;exports.normalizeSearchTerm=sa;exports.resolveTokens=pn;exports.toast=_u;exports.useAnnounce=Yt;exports.useHanui=O;exports.useHanuiTheme=yn;exports.useListboxNavigation=ua;exports.usePositioning=ft;exports.useVirtualList=Ka;
|
|
22
22
|
//# sourceMappingURL=index.cjs.map
|