@owodesign/owoui 0.1.7-beta → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -1 +1,3168 @@
1
- "use client";import{clsx as To}from"clsx";import{useState as ko}from"react";var it={};import{jsx as Xe}from"react/jsx-runtime";function Po(e){let t=e.trim().split(/\s+/);return t.length>=2?(t[0][0]+t[t.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()}function st({src:e,alt:t,name:o,size:r="md",tone:a="neutral",className:i}){let[n,c]=ko(!1),d=e&&!n,u=o?Po(o):"?";return Xe("span",{"data-tone":a,"data-size":r,className:To("owo-avatar",it.root,i),children:d?Xe("img",{src:e,alt:t??o??"",onError:()=>c(!0)}):Xe("span",{"aria-label":t??o,children:u})})}import{clsx as Co}from"clsx";var dt={};import{jsx as Io}from"react/jsx-runtime";function ct({tone:e="neutral",variant:t="soft",size:o="xs",className:r,children:a,...i}){return Io("span",{"data-tone":e,"data-variant":t,"data-size":o,className:Co("owo-badge",dt.root,r),...i,children:a})}import{clsx as Xo}from"clsx";import{clsx as Ro}from"clsx";var lt={};import{jsx as k,jsxs as ae}from"react/jsx-runtime";var So={xs:12,sm:14,md:16,lg:24};function Lo({px:e}){let o=Math.PI*2*9;return ae("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",children:[k("circle",{cx:"12",cy:"12",r:9,stroke:"currentColor",strokeWidth:"3",opacity:"0.2"}),k("circle",{cx:"12",cy:"12",r:9,stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:`${o*.28} ${o*.72}`})]})}function Do({px:e}){return ae("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[k("path",{d:"M12 2a10 10 0 0 1 10 10",opacity:"0.9"}),k("path",{d:"M12 2a10 10 0 0 0-7.07 2.93",opacity:"0.2"}),k("path",{d:"M4.93 4.93A10 10 0 0 0 2 12",opacity:"0.2"}),k("path",{d:"M2 12a10 10 0 0 0 2.93 7.07",opacity:"0.2"}),k("path",{d:"M4.93 19.07A10 10 0 0 0 12 22",opacity:"0.2"}),k("path",{d:"M12 22a10 10 0 0 0 7.07-2.93",opacity:"0.2"}),k("path",{d:"M19.07 19.07A10 10 0 0 0 22 12",opacity:"0.2"})]})}function Eo({px:e}){return k("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[0,1,2,3,4,5,6,7].map(o=>{let r=o/8*360,a=.15+o/8*.85;return k("circle",{cx:"12",cy:"3.5",r:"1.8",fill:"currentColor",opacity:a,transform:`rotate(${r} 12 12)`},o)})})}function zo({px:e}){return k("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[0,1,2,3].map(t=>ae("rect",{x:3+t*5.5,y:"4",width:"3",height:"16",rx:"1.5",fill:"currentColor",opacity:"0.3",children:[k("animate",{attributeName:"opacity",values:"0.3;1;0.3",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"}),k("animate",{attributeName:"height",values:"16;8;16",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"}),k("animate",{attributeName:"y",values:"4;8;4",dur:"1s",begin:`${t*.15}s`,repeatCount:"indefinite"})]},t))})}function Ho({px:e}){let t=e*.14,o=e*.33,r=e/2-o,a=e/2,i=e/2+o,n=e/2;return k("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[r,a,i].map((c,d)=>ae("circle",{cx:c,cy:n,r:t,fill:"currentColor",opacity:"0.4",children:[k("animate",{attributeName:"cy",values:`${n};${n-e*.25};${n}`,dur:"0.6s",begin:`${d*.12}s`,repeatCount:"indefinite",calcMode:"spline",keySplines:"0.4 0 0.2 1;0.4 0 0.2 1"}),k("animate",{attributeName:"opacity",values:"0.4;1;0.4",dur:"0.6s",begin:`${d*.12}s`,repeatCount:"indefinite"})]},d))})}function Ao({px:e}){return ae("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[ae("circle",{cx:"12",cy:"12",r:"0",fill:"currentColor",opacity:"0",children:[k("animate",{attributeName:"r",values:"4;10;4",dur:"1.2s",repeatCount:"indefinite"}),k("animate",{attributeName:"opacity",values:"0.8;0.1;0.8",dur:"1.2s",repeatCount:"indefinite"})]}),k("circle",{cx:"12",cy:"12",r:"3.5",fill:"currentColor",opacity:"0.7"})]})}function Bo({px:e}){return ae("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[k("circle",{cx:"12",cy:"12",r:"8",stroke:"currentColor",strokeWidth:"1.5",fill:"none",opacity:"0.15"}),k("circle",{cx:"12",cy:"4",r:"2.2",fill:"currentColor",children:k("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"360 12 12",dur:"0.9s",repeatCount:"indefinite"})}),k("circle",{cx:"12",cy:"20",r:"1.5",fill:"currentColor",opacity:"0.5",children:k("animateTransform",{attributeName:"transform",type:"rotate",from:"0 12 12",to:"-360 12 12",dur:"0.9s",repeatCount:"indefinite"})})]})}function Oo({px:e}){let t=e*.14,o=e*.33,r=e/2-o,a=e/2,i=e/2+o,n=e/2;return k("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,children:[r,a,i].map((c,d)=>k("circle",{cx:c,cy:n,r:t,fill:"currentColor",opacity:"0.25",children:k("animate",{attributeName:"opacity",values:"0.25;1;0.25",dur:"0.9s",begin:`${d*.2}s`,repeatCount:"indefinite"})},d))})}var Vo={ring:Lo,arc:Do,dots:Eo,bars:zo,bounce:Ho,pulse:Ao,orbit:Bo,flow:Oo},Fo=new Set(["ring","arc","dots"]);function Ie({variant:e="ring",size:t="md",className:o,label:r}){let a=typeof t=="number"?t:So[t],i=Vo[e];return k("span",{"aria-hidden":!r,"aria-label":r,role:r?"img":void 0,"data-animate":Fo.has(e)?"spin":void 0,className:Ro("owo-spinner",lt.root,o),children:k(i,{px:a})})}var ce={};import{Fragment as Ko,jsx as ne,jsxs as Uo}from"react/jsx-runtime";function pt({className:e}){return Xo("owo-button",ce.root,e)}function be(e){let{variant:t="secondary",size:o="md",loading:r=!1,leadingIcon:a,trailingIcon:i,className:n,children:c,...d}=e,u=Uo(Ko,{children:[r?ne("span",{className:ce.icon,children:ne(Ie,{size:o==="xs"?"xs":o==="sm"?"sm":o==="xl"?"lg":"md"})}):a?ne("span",{className:ce.icon,children:a}):null,ne("span",{className:ce.label,children:c}),!r&&i?ne("span",{className:ce.icon,children:i}):null]}),s=pt({variant:t,size:o,loading:r,className:n});if("href"in e&&e.href){let{href:l,...b}=d;return ne("a",{href:l,"data-variant":t,"data-size":o,"data-loading":r?"true":void 0,"aria-disabled":r||void 0,tabIndex:r?-1:void 0,className:s,onClick:r?p=>p.preventDefault():void 0,...b,children:u})}let m=d;return ne("button",{type:m.type??"button","data-variant":t,"data-size":o,"data-loading":r?"true":void 0,disabled:m.disabled||r,className:s,...m,children:u})}import{clsx as q}from"clsx";import{createContext as _o,useContext as qo,useEffect as Go,useId as Yo,useMemo as Jo,useRef as ut,useState as mt}from"react";var ee={};import{jsx as G,jsxs as er}from"react/jsx-runtime";var gt=_o(null);function ft(e){let t=qo(gt);if(!t)throw new Error(`${e} must be used within Collapsible.Root`);return t}function Zo({open:e,defaultOpen:t,onOpenChange:o}){let[r,a]=mt(t??!1),i=e!==void 0,n=i?e:r;function c(d){i||a(d),o?.(d)}return[n,c]}function Ke({children:e,open:t,defaultOpen:o,onOpenChange:r,classNames:a,className:i,...n}){let[c,d]=Zo({open:t,defaultOpen:o,onOpenChange:r}),u=Yo(),s=Jo(()=>({open:c,setOpen:d,contentId:u,classNames:a}),[u,c,d,a]);return G(gt.Provider,{value:s,children:G("div",{"data-state":c?"open":"closed","data-scope":"collapsible",className:q("owo-collapsible",ee.root,i),...n,children:e})})}function bt({children:e,icon:t,indicator:o,iconPosition:r="start",className:a,onClick:i,...n}){let{open:c,setOpen:d,contentId:u,classNames:s}=ft("Collapsible.Trigger"),l=t!==void 0||o!==void 0?er("span",{"data-part":"triggerInner",className:q(ee.triggerInner,s?.triggerInner),children:[t&&r==="start"?G("span",{"data-part":"triggerIcon","aria-hidden":"true",className:q(ee.triggerIcon,s?.triggerIcon),children:t}):null,G("span",{"data-part":"triggerLabel",className:q(ee.triggerLabel,s?.triggerLabel),children:e}),t&&r==="end"?G("span",{"data-part":"triggerIcon","aria-hidden":"true",className:q(ee.triggerIcon,s?.triggerIcon),children:t}):null,o?G("span",{"data-part":"triggerIndicator","aria-hidden":"true",className:q(ee.triggerIndicator,s?.triggerIndicator),children:o}):null]}):e;return G("button",{type:"button","aria-expanded":c,"aria-controls":u,"data-state":c?"open":"closed","data-scope":"collapsible","data-part":"trigger",className:q(s?.trigger,a),onClick:b=>{i?.(b),b.defaultPrevented||d(!c)},...n,children:l})}function ht({children:e,className:t,...o}){let{open:r,contentId:a,classNames:i}=ft("Collapsible.Content"),[n,c]=mt(r),d=ut(null),u=ut(null);return Go(()=>{let s=d.current,m=u.current;if(!s||!m)return;let l=0,b=0,p=()=>{s.style.height="auto",s.style.overflow="visible"};if(r&&c(!0),!n&&!r)return;let f=h=>{h.target!==s||h.propertyName!=="height"||(s.removeEventListener("transitionend",f),r?p():c(!1))};return(()=>{let h=m.scrollHeight;if(s.style.overflow="hidden",r){s.style.height="0px",l=window.requestAnimationFrame(()=>{s.addEventListener("transitionend",f),s.style.height=`${h}px`}),b=window.setTimeout(p,240);return}s.style.height=`${h}px`,l=window.requestAnimationFrame(()=>{s.addEventListener("transitionend",f),s.style.height="0px"}),b=window.setTimeout(()=>c(!1),240)})(),()=>{window.cancelAnimationFrame(l),window.clearTimeout(b),s.removeEventListener("transitionend",f)}},[r,n]),!n&&!r?null:G("div",{id:a,ref:d,"data-state":r?"open":"closed","data-scope":"collapsible","data-part":"content","aria-hidden":!r,className:q(i?.content,t),...o,children:G("div",{ref:u,"data-part":"contentInner",className:q(ee.contentInner,i?.contentInner),children:e})})}var jo=Object.assign(Ke,{Root:Ke,Trigger:bt,Content:ht}),Qo=jo;import{createContext as cr,useCallback as wt,useContext as lr,useRef as pr,useState as ur}from"react";import{clsx as le}from"clsx";import{createContext as or,useEffect as rr,useRef as vt,useCallback as ar,useContext as Ue}from"react";var he={};import{jsx as pe,jsxs as dr}from"react/jsx-runtime";var Ne=or(void 0);function nr({className:e,children:t,...o}){let r=Ue(Ne);return pe("div",{"data-scope":"dialog","data-part":"header",className:le(r?.header,e),...o,children:t})}function ir({className:e,children:t,...o}){let r=Ue(Ne);return pe("div",{"data-scope":"dialog","data-part":"body",className:le(r?.body,e),...o,children:t})}function sr({className:e,children:t,...o}){let r=Ue(Ne);return pe("div",{"data-scope":"dialog","data-part":"footer",className:le(r?.footer,e),...o,children:t})}function W({open:e,onClose:t,size:o="sm",children:r,className:a,overlayClassName:i,panelClassName:n,classNames:c,...d}){let u=vt(null),s=vt(null),m=ar(l=>{l.key==="Escape"&&(l.stopPropagation(),t())},[t]);return rr(()=>(e?(s.current=document.activeElement,document.body.style.overflow="hidden",requestAnimationFrame(()=>{let l=u.current;if(!l)return;let b=l.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');b?b.focus():l.focus()}),document.addEventListener("keydown",m)):(document.body.style.overflow="",s.current?.focus()),()=>{document.removeEventListener("keydown",m),document.body.style.overflow=""}),[e,m]),e?pe(Ne.Provider,{value:c,children:dr("div",{"data-state":"open","data-scope":"dialog","data-part":"overlay",className:le("owo-dialog-overlay",he.overlay,c?.overlay),children:[pe("button",{type:"button","aria-label":"Close dialog","data-state":"open","data-scope":"dialog","data-part":"backdrop",className:le("owo-dialog-backdrop",i,c?.backdrop),onClick:t}),pe("div",{ref:u,role:"dialog","aria-modal":"true",tabIndex:-1,"data-state":"open","data-size":o,className:le("owo-dialog",he.panel,n,a),...d,children:r})]})}):null}W.Header=nr;W.Body=ir;W.Footer=sr;import{Fragment as fr,jsx as ue,jsxs as We}from"react/jsx-runtime";var xt=cr(null);function mr(){let e=lr(xt);if(!e)throw new Error("useConfirm must be used within <ConfirmProvider>");return e}function gr({children:e}){let[t,o]=ur(null),r=pr(null),a=wt(n=>(r.current&&r.current.resolve(!1),new Promise(c=>{let d={options:n,resolve:c};r.current=d,o(d)})),[]),i=wt(n=>{r.current&&(r.current.resolve(n),r.current=null),o(null)},[]);return We(xt.Provider,{value:a,children:[e,ue(W,{open:t!==null,onClose:()=>i(!1),children:t&&We(fr,{children:[ue(W.Header,{children:t.options.title}),ue(W.Body,{children:typeof t.options.description=="string"?ue("p",{className:he.confirmDescription,children:t.options.description}):t.options.description}),We(W.Footer,{children:[ue(be,{variant:"ghost",size:"sm",onClick:()=>i(!1),children:t.options.cancelLabel??"\u53D6\u6D88"}),ue(be,{variant:t.options.variant??"primary",size:"sm",onClick:()=>i(!0),children:t.options.confirmLabel??"\u786E\u8BA4"})]})]})})]})}import{clsx as oe}from"clsx";import{autoUpdate as hr,computePosition as vr,flip as wr,offset as xr,shift as yr}from"@floating-ui/dom";import{Children as Tr,cloneElement as kr,createContext as yt,isValidElement as Pr,useCallback as A,useContext as _e,useEffect as ie,useId as Re,useLayoutEffect as Mr,useMemo as Le,useRef as te,useState as ve}from"react";import{createPortal as Cr}from"react-dom";var O={};import{jsx as B,jsxs as Ct}from"react/jsx-runtime";var Tt=yt(null),qe=yt(null);function se(e){let t=_e(Tt);if(!t)throw new Error(`${e} must be used within DropdownMenu.`);return t}function kt(e){let t=_e(qe);if(!t)throw new Error(`${e} must be used within DropdownMenu.Content.`);return t}function me(e,t){return o=>{e?.(o),t(o)}}function Pt(...e){return t=>{for(let o of e)o&&(typeof o=="function"?o(t):o.current=t)}}function Se(e){return typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Se).join(" "):!e||typeof e=="boolean"?"":Pr(e)?Se(e.props.children):""}function Ir(e){return[...e].sort((t,o)=>{let r=t.ref.current,a=o.ref.current;if(!r||!a)return 0;let i=r.compareDocumentPosition(a);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Nr(e,t){return t==="center"?e:`${e}-${t}`}function Rr(e){let t=e.split("-");return{side:t[0],align:t[1]??"center"}}function Mt({open:e,defaultOpen:t=!1,onOpenChange:o,side:r="bottom",align:a="start",sideOffset:i=8,alignOffset:n=0,collisionPadding:c=8,portal:d=!0,contentRole:u="menu",classNames:s,children:m}){let l=_e(qe),[b,p]=ve(t),f=e!==void 0,P=f?e:b,h=te(null),v=te(null),x=te("selected"),C=Re(),I=Re(),y=A(M=>{f||p(M),o?.(M)},[f,o]),D=A(()=>{y(!1)},[y]),N=A(()=>{y(!1),l?.closeTree()},[l,y]),z=A(()=>{y(!P)},[P,y]),H=A(()=>{h.current?.focus()},[]),g=Le(()=>({open:P,setOpen:y,toggleOpen:z,triggerRef:h,contentRef:v,side:r,align:a,sideOffset:i,alignOffset:n,collisionPadding:c,portal:d,contentRole:u,triggerId:C,contentId:I,focusIntentRef:x,parentList:l,isSubmenu:!!l,closeSelf:D,closeTree:N,focusTrigger:H,classNames:s}),[P,a,n,s,D,N,c,u,l,d,y,r,i,z,C,I,H]);return B(Tt.Provider,{value:g,children:m})}function Sr({asChild:e=!1,disabled:t=!1,className:o,children:r}){let{open:a,setOpen:i,toggleOpen:n,triggerRef:c,contentRole:d,triggerId:u,contentId:s,focusIntentRef:m,isSubmenu:l,classNames:b}=se("DropdownMenu.Trigger"),p=Tr.only(r),f=p.props??{},P=typeof f.className=="string"?f.className:void 0,h={id:u,"data-state":a?"open":"closed","aria-expanded":a,"aria-haspopup":d,"aria-controls":a?s:void 0,onClick:me(f.onClick,v=>{if(t){v.preventDefault();return}m.current="selected",n()}),onKeyDown:me(f.onKeyDown,v=>{t||(v.key==="ArrowDown"?(v.preventDefault(),m.current="first",i(!0)):v.key==="ArrowUp"?(v.preventDefault(),m.current="last",i(!0)):!l&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),m.current="selected",n()))})};return e?kr(p,{...h,ref:Pt(c,f.ref),className:oe(O.trigger,b?.trigger,o,P),type:p.type==="button"?f.type??"button":f.type}):B("button",{ref:c,disabled:t,type:"button","data-scope":"dropdown-menu","data-part":"trigger",className:oe(O.trigger,b?.trigger,o),...h,children:p})}function Lr({className:e,children:t,style:o,matchTriggerWidth:r=!1,maxHeight:a=320,...i}){let{open:n,setOpen:c,triggerRef:d,contentRef:u,side:s,align:m,sideOffset:l,alignOffset:b,collisionPadding:p,portal:f,contentRole:P,triggerId:h,contentId:v,focusIntentRef:x,parentList:C,isSubmenu:I,closeSelf:y,closeTree:D,focusTrigger:N,classNames:z}=se("DropdownMenu.Content"),H=te([]),[g,M]=ve(null),[V,J]=ve(null),[F,Z]=ve(null),[$,ot]=ve(!1),fe=te(""),j=te(null),Ce=A(w=>(H.current=[...H.current.filter(R=>R.id!==w.id),w],()=>{H.current=H.current.filter(R=>R.id!==w.id)}),[]),E=A(()=>Ir(H.current),[]),rt=A(w=>{x.current=w},[x]);ie(()=>{ot(!0)},[]);let wo=Le(()=>({role:P,highlightedId:g,setHighlightedId:M,registerItem:Ce,getItems:E,requestFocusIntent:rt,closeTree:D,closeSelf:y,focusTrigger:N,activeSubmenuId:V,setActiveSubmenuId:J,contentRef:u}),[V,y,D,u,P,N,E,g,Ce,rt]);Mr(()=>!n||!$||!d.current||!u.current?void 0:hr(d.current,u.current,()=>{!d.current||!u.current||vr(d.current,u.current,{placement:Nr(s,m),strategy:"fixed",middleware:[xr({mainAxis:l,crossAxis:b}),wr({padding:p}),yr({padding:p})]}).then(({x:R,y:T,placement:S})=>{let X=Rr(S);Z({top:T,left:R,side:X.side,align:X.align})})}),[m,b,p,u,$,n,s,l,d]),ie(()=>{if(!n){M(null),J(null);return}let w=E().filter(T=>!T.disabled);if(w.length===0)return;let R=w[0];x.current==="last"?R=w[w.length-1]:x.current==="selected"&&(R=w.find(T=>T.selected)??w[0]),M(R.id),requestAnimationFrame(()=>{u.current?.focus(),R.ref.current?.scrollIntoView({block:"nearest"})})},[u,x,E,n]),ie(()=>{if(!n)return;function w(R){let T=R.target,S=d.current?.contains(T),X=u.current?.contains(T);if(!S&&!X){let U=C?.contentRef.current?.contains(T);if(I&&U){y(),C?.setActiveSubmenuId(null);return}D()}}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[y,D,u,I,n,C,d]),ie(()=>{if(n)return()=>{j.current&&clearTimeout(j.current)}},[n]);let Q=A(w=>{if(M(w),!w){J(null);return}E().find(T=>T.id===w)?.submenu||J(null)},[E]),$e=A((w,R="first")=>{let T=E().filter(_=>!_.disabled);if(T.length===0)return;let S=T.findIndex(_=>_.id===g);if(S===-1){Q(R==="last"?T[T.length-1].id:T[0].id);return}let X=(S+w+T.length)%T.length,U=T[X];Q(U.id),U.ref.current?.scrollIntoView({block:"nearest"})},[E,g,Q]),at=A(w=>{let R=w.length===1?w.toLowerCase():"";if(!R)return;j.current&&clearTimeout(j.current),fe.current+=R,j.current=setTimeout(()=>{fe.current="",j.current=null},350);let T=E().filter(_=>!_.disabled);if(T.length===0)return;let S=T.findIndex(_=>_.id===g),U=(S>=0?[...T.slice(S+1),...T.slice(0,S+1)]:T).find(_=>_.textValue.toLowerCase().startsWith(fe.current));U&&(Q(U.id),U.ref.current?.scrollIntoView({block:"nearest"}))},[E,g,Q]),xo=A(w=>{let R=E(),T=R.find(S=>S.id===g)??null;switch(w.key){case"ArrowDown":w.preventDefault(),$e(1);break;case"ArrowUp":w.preventDefault(),$e(-1,"last");break;case"Home":w.preventDefault();{let S=R.find(X=>!X.disabled);S&&Q(S.id)}break;case"End":w.preventDefault();{let S=R.filter(U=>!U.disabled),X=S[S.length-1];X&&Q(X.id)}break;case"Enter":case" ":T&&!T.disabled&&(w.preventDefault(),T.click());break;case"ArrowRight":T?.submenu&&(w.preventDefault(),T.openSubmenu?.());break;case"ArrowLeft":I&&(w.preventDefault(),y(),N(),C?.setActiveSubmenuId(null));break;case"Tab":D();break;case"Escape":w.preventDefault(),y(),N(),I&&C?.setActiveSubmenuId(null);break;default:at(w.key)}},[y,D,N,E,at,g,Q,I,$e,C]);if(!n||!$)return null;let nt=B(qe.Provider,{value:wo,children:B("div",{ref:u,id:v,role:P,tabIndex:-1,"aria-labelledby":P==="menu"?h:void 0,"data-state":"open","data-side":F?.side??s,"data-align":F?.align??m,"data-scope":"dropdown-menu","data-part":"content",className:oe(O.content,z?.content,e),style:{...o,position:"fixed",top:F?.top??0,left:F?.left??0,maxHeight:a,minWidth:r?d.current?.getBoundingClientRect().width:void 0},onKeyDown:xo,...i,children:t})});return f?Cr(nt,document.body):nt}function Dr({className:e,children:t,...o}){let{classNames:r}=se("DropdownMenu.Group");return B("div",{"data-scope":"dropdown-menu","data-part":"group",className:oe(r?.group,e),...o,children:t})}function Er({className:e,children:t,...o}){let{classNames:r}=se("DropdownMenu.Label");return B("div",{"data-scope":"dropdown-menu","data-part":"label",className:oe(r?.label,e),...o,children:t})}function zr({className:e,...t}){let{classNames:o}=se("DropdownMenu.Separator");return B("div",{role:"separator","data-scope":"dropdown-menu","data-part":"separator",className:oe(o?.separator,e),...t})}function Hr({className:e,children:t,inset:o=!1,disabled:r=!1,selected:a=!1,destructive:i=!1,closeOnSelect:n=!0,shortcut:c,indicator:d,onSelect:u,onMouseEnter:s,onClick:m,...l}){let b=Re(),p=te(null),{role:f,highlightedId:P,setHighlightedId:h,registerItem:v,closeTree:x,setActiveSubmenuId:C}=kt("DropdownMenu.Item"),{classNames:I}=se("DropdownMenu.Item"),y=Le(()=>Se(t),[t]),D=P===b,N=A(()=>{r||(u?.(),n&&x())},[n,x,r,u]);return ie(()=>v({id:b,ref:p,disabled:r,submenu:!1,selected:a,textValue:y,closeOnSelect:n,click:N}),[n,r,N,b,v,a,y]),Ct("button",{ref:p,id:b,type:"button",role:f==="listbox"?"option":"menuitem",tabIndex:-1,disabled:r,"aria-selected":f==="listbox"?a:void 0,"data-highlighted":D||void 0,"data-selected":a||void 0,"data-disabled":r||void 0,"data-destructive":i||void 0,"data-scope":"dropdown-menu","data-part":"item",className:oe(o&&O.itemInset,I?.item,e),onMouseEnter:me(s,()=>{r||(h(b),C(null))}),onClick:me(m,z=>{z.preventDefault(),N()}),...l,children:[B("span",{className:O.itemMain,children:t}),c?B("span",{className:O.shortcut,children:c}):null,a?B("span",{className:O.indicator,children:d??"\u2713"}):null]})}function Ar(e){return B(Mt,{side:"right",align:"start",sideOffset:6,...e,contentRole:"menu"})}function Br({className:e,children:t,inset:o=!1,disabled:r=!1,destructive:a=!1,shortcut:i,onSelect:n,onMouseEnter:c,onClick:d,...u}){let s=Re(),m=te(null),l=se("DropdownMenu.SubTrigger"),{highlightedId:b,setHighlightedId:p,registerItem:f,setActiveSubmenuId:P,activeSubmenuId:h}=kt("DropdownMenu.SubTrigger"),v=Le(()=>Se(t),[t]),x=b===s,C=l.open&&h===s,I=A(()=>{r||(l.focusIntentRef.current="first",p(s),P(s),l.setOpen(!0))},[r,s,P,p,l]);return ie(()=>f({id:s,ref:m,disabled:r,submenu:!0,selected:!1,textValue:v,closeOnSelect:!1,click:I,openSubmenu:I}),[r,s,I,f,v]),ie(()=>{h!==s&&l.open&&l.setOpen(!1)},[h,s,l]),Ct("button",{ref:Pt(m,l.triggerRef),id:l.triggerId,type:"button",role:"menuitem",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-highlighted":x||void 0,"data-state":C?"open":"closed","data-disabled":r||void 0,"data-destructive":a||void 0,className:oe(O.subTrigger,o&&O.itemInset,e),onMouseEnter:me(c,()=>{I()}),onClick:me(d,y=>{y.preventDefault(),I(),n?.()}),...u,children:[B("span",{className:O.itemMain,children:t}),i?B("span",{className:O.shortcut,children:i}):null,B("span",{className:O.submenuIndicator,"aria-hidden":"true",children:"\u203A"})]})}var Or=Object.assign(Mt,{Trigger:Sr,Content:Lr,Group:Dr,Label:Er,Item:Hr,Separator:zr,Submenu:Ar,SubTrigger:Br}),Vr=Or;import{clsx as It}from"clsx";var Ge={};import{Fragment as $r,jsx as Nt,jsxs as Xr}from"react/jsx-runtime";function Rt({as:e="aside",open:t,children:o,side:r="right",position:a="fixed",showBackdrop:i=!0,onClose:n,closeLabel:c="\u5173\u95ED\u62BD\u5C49",backdropClassName:d,className:u,classNames:s,...m}){return Xr($r,{children:[i&&t&&n&&Nt("button",{type:"button","aria-label":c,"data-state":"open","data-scope":"drawer","data-part":"backdrop","data-position":a,className:It("owo-drawer-backdrop",Ge.backdrop,d,s?.backdrop),onClick:n}),Nt(e,{"aria-hidden":!t,"data-state":t?"open":"closed","data-side":r,"data-position":a,"data-scope":"drawer","data-part":"panel",className:It("owo-drawer",Ge.panel,u,s?.panel),...m,children:o})]})}import{clsx as Ur}from"clsx";var De={};import{jsx as St,jsxs as Wr}from"react/jsx-runtime";function Lt({label:e,help:t,htmlFor:o,children:r,className:a,...i}){return Wr("div",{className:Ur("owo-field",De.root,a),...i,children:[St("label",{htmlFor:o,className:De.label,children:e}),r,t?St("span",{className:De.help,children:t}):null]})}import{clsx as qr}from"clsx";var Dt={};import{jsx as Et}from"react/jsx-runtime";function zt({variant:e="ghost",size:t="md",label:o,icon:r,className:a,...i}){let n=qr("owo-icon-button",Dt.root,a);if("href"in i&&i.href){let{href:d,...u}=i;return Et("a",{href:d,"aria-label":o,title:u.title??o,"data-variant":e,"data-size":t,className:n,...u,children:r})}let c=i;return Et("button",{type:c.type??"button","aria-label":o,title:c.title??o,"data-variant":e,"data-size":t,className:n,...c,children:r})}import{clsx as Ht}from"clsx";var we={};import{jsx as At}from"react/jsx-runtime";function Bt(e){let{className:t,tone:o="default",size:r="md",...a}=e;return e.as==="textarea"?At("textarea",{"data-tone":o,"data-size":r,className:Ht("owo-input",we.root,t),...a}):At("input",{"data-tone":o,"data-size":r,className:Ht("owo-input",we.root,t),...a})}import{clsx as Ee}from"clsx";var Ot={};import{jsx as ze}from"react/jsx-runtime";function Vt({as:e="section",variant:t="default",padding:o="none",className:r,children:a,...i}){return ze(e,{"data-variant":t,"data-padding":o!=="none"?o:void 0,"data-scope":"panel",className:Ee("owo-panel",Ot.root,r),...i,children:a})}function Jr({className:e,children:t,...o}){return ze("div",{"data-scope":"panel","data-part":"header",className:Ee(e),...o,children:t})}function Zr({className:e,children:t,...o}){return ze("div",{"data-scope":"panel","data-part":"body",className:Ee(e),...o,children:t})}function jr({className:e,children:t,...o}){return ze("div",{"data-scope":"panel","data-part":"footer",className:Ee(e),...o,children:t})}import{clsx as ea}from"clsx";var Ye={};import{jsx as Ft}from"react/jsx-runtime";function $t({value:e,onChange:t,options:o,size:r="md",className:a,ariaLabel:i}){return Ft("div",{role:"tablist","aria-label":i,"data-size":r,className:ea("owo-segmented-control",Ye.root,a),children:o.map(n=>{let c=n.value===e;return Ft("button",{type:"button",role:"tab","aria-selected":c,disabled:n.disabled,"data-active":c?"true":void 0,className:Ye.item,onClick:()=>t(n.value),children:n.label},n.value)})})}import{clsx as ge}from"clsx";import{useCallback as Je,useEffect as Xt,useId as oa,useMemo as ra,useRef as Kt,useState as Ut}from"react";var He={};import{jsx as xe,jsxs as Wt}from"react/jsx-runtime";function _t({value:e,onChange:t,options:o,placeholder:r="Select\u2026",size:a="md",tone:i="default",disabled:n=!1,className:c,ariaLabel:d,renderValue:u,renderOption:s,classNames:m}){let[l,b]=Ut(!1),[p,f]=Ut(-1),P=Kt(null),h=Kt(null),v=oa(),x=o.find(g=>g.value===e),C=ra(()=>o.reduce((g,M,V)=>(M.disabled||g.push(V),g),[]),[o]),I=Je(()=>{if(n||o.length===0)return;b(!0);let g=o.findIndex(M=>M.value===e);f(g>=0?g:C[0]??-1)},[n,o,e,C]),y=Je(()=>{b(!1),f(-1)},[]),D=Je(g=>{g.disabled||(t(g.value),y())},[t,y]);Xt(()=>{if(!l)return;function g(M){P.current&&!P.current.contains(M.target)&&y()}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[l,y]),Xt(()=>{if(!l||p<0)return;h.current?.children[p]?.scrollIntoView({block:"nearest"})},[l,p]);function N(g){if(!n)switch(g.key){case"Enter":case" ":{g.preventDefault(),l?p>=0&&o[p]&&!o[p].disabled&&D(o[p]):I();break}case"ArrowDown":{if(g.preventDefault(),!l)I();else{let M=C.indexOf(p),V=C[M+1];V!==void 0&&f(V)}break}case"ArrowUp":{if(g.preventDefault(),!l)I();else{let M=C.indexOf(p),V=C[M-1];V!==void 0&&f(V)}break}case"Escape":{l&&(g.preventDefault(),y());break}case"Tab":{l&&y();break}}}let z=e!==""&&x,H=u?u({open:l,placeholder:r,selectedOption:x}):xe("span",{className:ge(He.valueText,!z&&He.placeholder),children:z?x.label:r});return Wt("div",{ref:P,"data-state":l?"open":"closed","data-disabled":n||void 0,"data-size":a,"data-tone":i,"data-scope":"select",className:ge("owo-select",He.root,c),children:[Wt("button",{type:"button",role:"combobox","aria-expanded":l,"aria-haspopup":"listbox","aria-controls":v,"aria-label":d,"aria-activedescendant":l&&p>=0?`${v}-opt-${p}`:void 0,"data-state":l?"open":"closed","data-disabled":n||void 0,"data-tone":i,"data-size":a,"data-has-value":z||void 0,"data-scope":"select","data-part":"trigger",disabled:n,className:ge(m?.trigger),onClick:()=>l?y():I(),onKeyDown:N,children:[H,xe("svg",{"aria-hidden":"true","data-state":l?"open":"closed","data-scope":"select","data-part":"chevron",className:ge(m?.chevron),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:xe("path",{d:"M4 6l4 4 4-4"})})]}),l&&xe("ul",{ref:h,id:v,role:"listbox","aria-label":d,"data-state":"open","data-size":a,"data-scope":"select","data-part":"dropdown",className:ge(m?.dropdown),children:o.map((g,M)=>xe("li",{id:`${v}-opt-${M}`,role:"option","aria-selected":g.value===e,"aria-disabled":g.disabled||void 0,"data-state":g.value===e?"selected":M===p?"highlighted":"idle","data-focused":M===p||void 0,"data-selected":g.value===e||void 0,"data-disabled":g.disabled||void 0,"data-highlighted":M===p||void 0,"data-scope":"select","data-part":"option",className:ge(m?.option),onClick:()=>D(g),onMouseEnter:()=>!g.disabled&&f(M),children:s?s({option:g,index:M,selected:g.value===e,highlighted:M===p}):g.label},g.value))})]})}import{clsx as na}from"clsx";var qt={};import{jsx as sa}from"react/jsx-runtime";var ia={slow:"4s",medium:"3s",fast:"2s"};function Gt({className:e,animation:t="scan",tone:o="default",speed:r="medium",style:a,...i}){let n=o==="warm"?"emphasis":o,c={...a,"--_owo-skeleton-scan-duration":ia[r]};return sa("div",{className:na("owo-skeleton",qt.root,e),"data-animation":t,"data-tone":n,"aria-hidden":"true",style:c,...i})}import{clsx as Yt}from"clsx";var K={};import{Fragment as Jt,jsx as Y,jsxs as Ae}from"react/jsx-runtime";function Zt({tone:e="neutral",layout:t="horizontal",icon:o,title:r,description:a,action:i,className:n,children:c,...d}){if(t==="vertical"){let u=o||r||a||i;return Y("div",{"data-tone":e,"data-layout":"vertical",className:Yt("owo-status-notice",K.root,n),...d,children:u?Ae("div",{className:K.body,children:[o&&Y("div",{className:K.icon,children:o}),r&&Y("div",{className:K.title,children:r}),a&&Y("div",{children:a}),i&&Y("div",{className:K.action,children:i})]}):c})}return Y("div",{"data-tone":e,className:Yt("owo-status-notice",K.root,o&&K.withIcon,n),...d,children:o?Ae(Jt,{children:[Y("span",{className:K.icon,"aria-hidden":"true",children:o}),Ae("div",{className:K.text,children:[r&&Y("div",{className:K.title,children:r}),c]})]}):Ae(Jt,{children:[r&&Y("div",{className:K.title,children:r}),c]})})}import{clsx as la}from"clsx";var Ze={};import{jsx as jt}from"react/jsx-runtime";function Qt({checked:e,onChange:t,size:o="md",disabled:r=!1,className:a,ariaLabel:i}){return jt("button",{type:"button",role:"switch","aria-checked":e,"aria-label":i,disabled:r,"data-size":o,className:la("owo-switch",Ze.root,a),onClick:()=>t(!e),children:jt("span",{"aria-hidden":"true",className:Ze.thumb})})}import{clsx as Oe}from"clsx";import{createContext as ua,useContext as ma,useId as ga,useMemo as fa,useState as ba}from"react";var eo={};import{jsx as ye}from"react/jsx-runtime";var to=ua(null);function oo(e){let t=ma(to);if(!t)throw new Error(`${e} must be used within Tabs.Root`);return t}function Be(e){return e.replace(/[^a-zA-Z0-9_-]+/g,"-")}function ha({value:e,defaultValue:t,onValueChange:o}){let[r,a]=ba(t??""),i=e!==void 0,n=i?e:r;function c(d){i||a(d),o?.(d)}return[n,c]}function je({children:e,value:t,defaultValue:o,onValueChange:r,className:a,...i}){let[n,c]=ha({value:t,defaultValue:o,onValueChange:r}),d=ga(),u=fa(()=>({value:n,setValue:c,baseId:d}),[d,n,c]);return ye(to.Provider,{value:u,children:ye("div",{"data-scope":"tabs",className:Oe("owo-tabs",eo.root,a),...i,children:e})})}function ro({children:e,className:t,ariaLabel:o,...r}){return ye("div",{role:"tablist","aria-label":o,"data-scope":"tabs","data-part":"list",className:Oe(t),...r,children:e})}function ao({children:e,className:t,value:o,disabled:r,onClick:a,onKeyDown:i,...n}){let{value:c,setValue:d,baseId:u}=oo("Tabs.Trigger"),s=c===o,m=`${u}-trigger-${Be(o)}`,l=`${u}-panel-${Be(o)}`;function b(p,f){let P=p.closest('[role="tablist"]');if(!P)return;let h=Array.from(P.querySelectorAll('[role="tab"]:not([disabled])')),v=h.indexOf(p);if(v<0)return;let x;f==="first"&&(x=h[0]),f==="last"&&(x=h[h.length-1]),f==="next"&&(x=h[(v+1)%h.length]),f==="prev"&&(x=h[(v-1+h.length)%h.length]),x&&(x.focus(),x.click())}return ye("button",{type:"button",id:m,role:"tab","aria-selected":s,"aria-controls":l,tabIndex:s?0:-1,"data-state":s?"active":"inactive","data-scope":"tabs","data-part":"trigger",disabled:r,className:Oe(t),onClick:p=>{a?.(p),!p.defaultPrevented&&!r&&d(o)},onKeyDown:p=>{if(i?.(p),p.defaultPrevented||r)return;let f=p.currentTarget;switch(p.key){case"ArrowRight":p.preventDefault(),b(f,"next");break;case"ArrowLeft":p.preventDefault(),b(f,"prev");break;case"Home":p.preventDefault(),b(f,"first");break;case"End":p.preventDefault(),b(f,"last");break}},...n,children:e})}function no({children:e,className:t,value:o,...r}){let{value:a,baseId:i}=oo("Tabs.Content"),n=a===o,c=`${i}-trigger-${Be(o)}`,d=`${i}-panel-${Be(o)}`;return n?ye("div",{id:d,role:"tabpanel","aria-labelledby":c,"data-state":"active","data-scope":"tabs","data-part":"content",className:Oe(t),...r,children:e}):null}var va=Object.assign(je,{Root:je,List:ro,Trigger:ao,Content:no}),wa=va;import{clsx as ya}from"clsx";import{useCallback as Ta,useEffect as ka,useRef as Pa}from"react";var io={};import{jsx as Ma}from"react/jsx-runtime";function so({className:e,tone:t="default",size:o="md",resize:r="vertical",autoResize:a=!1,style:i,onInput:n,rows:c=3,...d}){let u=Pa(null),s=n,m=Ta(()=>{if(!a||!u.current)return;let p=u.current;p.style.height="auto",p.style.height=`${p.scrollHeight}px`},[a]);ka(()=>{m()},[m,d.value,d.defaultValue,c]);function l(p){m(),s?.(p)}let b={...i,resize:a?"none":r};return Ma("textarea",{...d,ref:u,rows:c,"data-tone":t,"data-size":o,"data-auto-resize":a||void 0,className:ya("owo-input",we.root,"owo-textarea",io.root,e),style:b,onInput:l})}import{clsx as re}from"clsx";import{createContext as Ia,useCallback as co,useContext as Na,useMemo as Ra,useRef as lo,useState as Sa}from"react";var Te={};import{jsx as L,jsxs as ke}from"react/jsx-runtime";var uo=Ia(null),Qe=5,po=4e3;function La(){let e=Na(uo);if(!e)throw new Error("useToast must be used within <ToastProvider>");return e}function Da({tone:e}){let t={width:16,height:16,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"success":return L("svg",{...t,children:L("path",{d:"M3.5 8.5l3 3 6-7"})});case"warning":return ke("svg",{...t,children:[L("path",{d:"M8 5v4"}),L("circle",{cx:"8",cy:"11.5",r:"0.5",fill:"currentColor",stroke:"none"})]});case"danger":return L("svg",{...t,children:L("path",{d:"M4.5 4.5l7 7M11.5 4.5l-7 7"})});case"info":return ke("svg",{...t,children:[L("circle",{cx:"8",cy:"3.5",r:"1.2",fill:"currentColor",stroke:"none"}),L("path",{d:"M8 7v5.5"})]})}}function Ea(e,t){return typeof e=="string"?{message:e,duration:t??po}:{title:e.title,message:e.message,duration:e.duration??t??po}}function za({item:e,onDismiss:t,renderToast:o,classNames:r}){let a=()=>t(e.id),i=L(Da,{tone:e.tone});return o?L("div",{role:"status","aria-live":"polite","data-state":"open","data-tone":e.tone,"data-scope":"toast","data-part":"toast",className:re("owo-toast",Te.toast,r?.toast),children:o({item:e,dismiss:a,icon:i})}):ke("div",{role:"status","aria-live":"polite","data-state":"open","data-tone":e.tone,"data-scope":"toast","data-part":"toast",className:re("owo-toast",Te.toast,Te.toastDefault,r?.toast),children:[L("span",{"data-scope":"toast","data-part":"icon",className:re(r?.icon),"aria-hidden":"true",children:i}),ke("span",{"data-scope":"toast","data-part":"content",className:re(r?.content),children:[e.title?L("span",{"data-scope":"toast","data-part":"title",className:re(r?.title),children:e.title}):null,L("span",{"data-scope":"toast","data-part":"message",className:re(r?.message),children:e.message})]}),L("button",{type:"button",onClick:a,"data-scope":"toast","data-part":"close",className:re(r?.close),"aria-label":"Dismiss",children:L("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:L("path",{d:"M4 4l8 8M12 4l-8 8"})})})]})}function Ha({children:e,renderToast:t,classNames:o}){let[r,a]=Sa([]),i=lo(0),n=lo(new Map),c=co(s=>{let m=n.current.get(s);m&&clearTimeout(m),n.current.delete(s),a(l=>l.filter(b=>b.id!==s))},[]),d=co((s,m,l)=>{let b=i.current++,p=Ea(m,l),f={id:b,tone:s,...p};a(P=>{let h=[...P,f];if(h.length>Qe){let v=h.slice(0,h.length-Qe);for(let x of v){let C=n.current.get(x.id);C&&clearTimeout(C),n.current.delete(x.id)}return h.slice(-Qe)}return h}),f.duration>0&&n.current.set(b,setTimeout(()=>c(b),f.duration))},[c]),u=Ra(()=>({success:(s,m)=>d("success",s,m),warning:(s,m)=>d("warning",s,m),danger:(s,m)=>d("danger",s,m),info:(s,m)=>d("info",s,m)}),[d]);return ke(uo.Provider,{value:u,children:[e,L("div",{"aria-label":"Notifications","data-state":r.length>0?"open":"closed","data-scope":"toast","data-part":"container",className:re("owo-toast-container",Te.container,o?.container),children:r.map(s=>L(za,{item:s,onDismiss:c,renderToast:t,classNames:o},s.id))})]})}import{clsx as tt}from"clsx";import{autoUpdate as Ba,computePosition as Oa,flip as Va,offset as Fa,shift as $a,arrow as Xa}from"@floating-ui/dom";import{useCallback as de,useEffect as mo,useId as Ka,useLayoutEffect as Ua,useRef as Pe,useState as Ve}from"react";import{createPortal as Wa}from"react-dom";var et={};import{Fragment as qa,jsx as Fe,jsxs as ho}from"react/jsx-runtime";var Me=6,go=8,fo=4;function _a(e){return e.split("-")[0]}var bo={top:"",bottom:"rotate(180deg)",left:"rotate(-90deg)",right:"rotate(90deg)"};function vo({content:e,placement:t="top",density:o="default",showDelay:r=300,hideDelay:a=150,arrow:i=!0,renderArrow:n,className:c,children:d,classNames:u}){let[s,m]=Ve(!1),[l,b]=Ve(null),[p,f]=Ve(t),[P,h]=Ve({}),v=Pe(null),x=Pe(null),C=Pe(null),I=Pe(void 0),y=Pe(void 0),D=Ka(),N=de(()=>{clearTimeout(I.current),clearTimeout(y.current)},[]),z=de(()=>{N(),I.current=setTimeout(()=>m(!0),r)},[N,r]),H=de(()=>{N(),m(!0)},[N]),g=de(()=>{N(),y.current=setTimeout(()=>m(!1),a)},[N,a]),M=de($=>{if($.target===v.current){z();return}H()},[z,H]),V=de($=>{$.pointerType!=="mouse"&&H()},[H]),J=de($=>{$.key==="Escape"&&s&&m(!1)},[s]);Ua(()=>{if(!s||!v.current||!x.current)return;let $=[Fa(i?go+Me:go),Va({padding:fo}),$a({padding:fo})];return i&&C.current&&$.push(Xa({element:C.current})),Ba(v.current,x.current,()=>{!v.current||!x.current||Oa(v.current,x.current,{placement:t,strategy:"fixed",middleware:$}).then(({x:fe,y:j,placement:Ce,middlewareData:E})=>{b({top:j,left:fe}),f(_a(Ce)),E.arrow&&h({x:E.arrow.x,y:E.arrow.y})})})},[s,t,i]),mo(()=>{if(s)return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[s,J]),mo(()=>N,[N]);let F={position:"absolute"},Z=p;return Z==="top"||Z==="bottom"?(F.left=P.x??0,F[Z==="top"?"bottom":"top"]=-Me,F.transform=bo[Z]||void 0):(F.top=P.y??0,F[Z==="left"?"right":"left"]=-Me,F.transform=bo[Z]),ho(qa,{children:[Fe("span",{ref:v,"data-state":s?"open":"closed","data-scope":"tooltip","data-part":"trigger",className:tt("owo-tooltip-trigger",et.trigger,u?.trigger),onMouseEnter:z,onMouseLeave:g,onFocus:M,onBlur:g,onPointerDown:V,"aria-describedby":s?D:void 0,children:d}),s&&Wa(ho("div",{ref:x,id:D,role:"tooltip","data-state":s?"open":"closed","data-placement":p,"data-density":o,"data-scope":"tooltip","data-part":"content",className:tt("owo-tooltip",et.content,u?.content,c),style:l?{top:l.top,left:l.left}:{visibility:"hidden"},onMouseEnter:z,onMouseLeave:g,children:[e,i&&Fe("span",{ref:C,"data-scope":"tooltip","data-part":"arrow",className:tt(u?.arrow),style:F,children:n?n({placement:p}):Fe("svg",{width:Me*2,height:Me,viewBox:"0 0 12 6",children:Fe("path",{d:"M0 0l6 6 6-6z",fill:"currentColor"})})})]}),document.body)]})}export{st as Avatar,ct as Badge,be as Button,Qo as Collapsible,ht as CollapsibleContent,Ke as CollapsibleRoot,bt as CollapsibleTrigger,gr as ConfirmProvider,W as Dialog,Rt as Drawer,Vr as DropdownMenu,Lt as Field,zt as IconButton,Bt as Input,Vt as Panel,Zr as PanelBody,jr as PanelFooter,Jr as PanelHeader,$t as SegmentedControl,_t as Select,Gt as Skeleton,Ie as Spinner,Zt as StatusNotice,Qt as Switch,wa as Tabs,no as TabsContent,ro as TabsList,je as TabsRoot,ao as TabsTrigger,so as Textarea,Ha as ToastProvider,vo as Tooltip,pt as buttonClassName,mr as useConfirm,La as useToast};
1
+ "use client";
2
+ import { Children as e, cloneElement as t, createContext as n, isValidElement as r, useCallback as i, useContext as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
3
+ import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
4
+ import { createPortal as h } from "react-dom";
5
+ //#region node_modules/clsx/dist/clsx.mjs
6
+ function g(e) {
7
+ var t, n, r = "";
8
+ if (typeof e == "string" || typeof e == "number") r += e;
9
+ else if (typeof e == "object") if (Array.isArray(e)) {
10
+ var i = e.length;
11
+ for (t = 0; t < i; t++) e[t] && (n = g(e[t])) && (r && (r += " "), r += n);
12
+ } else for (n in e) e[n] && (r && (r += " "), r += n);
13
+ return r;
14
+ }
15
+ function _() {
16
+ for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = g(e)) && (r && (r += " "), r += t);
17
+ return r;
18
+ }
19
+ var v = { root: "_root_crrwl_1" };
20
+ //#endregion
21
+ //#region src/components/Avatar.tsx
22
+ function y(e) {
23
+ let t = e.trim().split(/\s+/);
24
+ return t.length >= 2 ? (t[0][0] + t[t.length - 1][0]).toUpperCase() : e.slice(0, 2).toUpperCase();
25
+ }
26
+ function b({ src: e, alt: t, name: n, size: r = "md", tone: i = "neutral", className: a }) {
27
+ let [o, s] = d(!1), c = e && !o, l = n ? y(n) : "?";
28
+ return /* @__PURE__ */ p("span", {
29
+ "data-tone": i,
30
+ "data-size": r,
31
+ className: _("owo-avatar", v.root, a),
32
+ children: c ? /* @__PURE__ */ p("img", {
33
+ src: e,
34
+ alt: t ?? n ?? "",
35
+ onError: () => s(!0)
36
+ }) : /* @__PURE__ */ p("span", {
37
+ "aria-label": t ?? n,
38
+ children: l
39
+ })
40
+ });
41
+ }
42
+ var x = { root: "_root_6bx55_1" };
43
+ //#endregion
44
+ //#region src/components/Badge.tsx
45
+ function S({ tone: e = "neutral", variant: t = "soft", size: n = "xs", className: r, children: i, ...a }) {
46
+ return /* @__PURE__ */ p("span", {
47
+ "data-tone": e,
48
+ "data-variant": t,
49
+ "data-size": n,
50
+ className: _("owo-badge", x.root, r),
51
+ ...a,
52
+ children: i
53
+ });
54
+ }
55
+ var C = {
56
+ root: "_root_1oxco_1",
57
+ "owo-spin": "_owo-spin_1oxco_1"
58
+ }, w = {
59
+ xs: 12,
60
+ sm: 14,
61
+ md: 16,
62
+ lg: 24
63
+ };
64
+ function T({ px: e }) {
65
+ let t = Math.PI * 2 * 9;
66
+ return /* @__PURE__ */ m("svg", {
67
+ width: e,
68
+ height: e,
69
+ viewBox: "0 0 24 24",
70
+ fill: "none",
71
+ children: [/* @__PURE__ */ p("circle", {
72
+ cx: "12",
73
+ cy: "12",
74
+ r: 9,
75
+ stroke: "currentColor",
76
+ strokeWidth: "3",
77
+ opacity: "0.2"
78
+ }), /* @__PURE__ */ p("circle", {
79
+ cx: "12",
80
+ cy: "12",
81
+ r: 9,
82
+ stroke: "currentColor",
83
+ strokeWidth: "3",
84
+ strokeLinecap: "round",
85
+ strokeDasharray: `${t * .28} ${t * .72}`
86
+ })]
87
+ });
88
+ }
89
+ function E({ px: e }) {
90
+ return /* @__PURE__ */ m("svg", {
91
+ width: e,
92
+ height: e,
93
+ viewBox: "0 0 24 24",
94
+ fill: "none",
95
+ stroke: "currentColor",
96
+ strokeWidth: "2.5",
97
+ strokeLinecap: "round",
98
+ children: [
99
+ /* @__PURE__ */ p("path", {
100
+ d: "M12 2a10 10 0 0 1 10 10",
101
+ opacity: "0.9"
102
+ }),
103
+ /* @__PURE__ */ p("path", {
104
+ d: "M12 2a10 10 0 0 0-7.07 2.93",
105
+ opacity: "0.2"
106
+ }),
107
+ /* @__PURE__ */ p("path", {
108
+ d: "M4.93 4.93A10 10 0 0 0 2 12",
109
+ opacity: "0.2"
110
+ }),
111
+ /* @__PURE__ */ p("path", {
112
+ d: "M2 12a10 10 0 0 0 2.93 7.07",
113
+ opacity: "0.2"
114
+ }),
115
+ /* @__PURE__ */ p("path", {
116
+ d: "M4.93 19.07A10 10 0 0 0 12 22",
117
+ opacity: "0.2"
118
+ }),
119
+ /* @__PURE__ */ p("path", {
120
+ d: "M12 22a10 10 0 0 0 7.07-2.93",
121
+ opacity: "0.2"
122
+ }),
123
+ /* @__PURE__ */ p("path", {
124
+ d: "M19.07 19.07A10 10 0 0 0 22 12",
125
+ opacity: "0.2"
126
+ })
127
+ ]
128
+ });
129
+ }
130
+ function D({ px: e }) {
131
+ return /* @__PURE__ */ p("svg", {
132
+ width: e,
133
+ height: e,
134
+ viewBox: "0 0 24 24",
135
+ children: [
136
+ 0,
137
+ 1,
138
+ 2,
139
+ 3,
140
+ 4,
141
+ 5,
142
+ 6,
143
+ 7
144
+ ].map((e) => {
145
+ let t = e / 8 * 360;
146
+ return /* @__PURE__ */ p("circle", {
147
+ cx: "12",
148
+ cy: "3.5",
149
+ r: "1.8",
150
+ fill: "currentColor",
151
+ opacity: .15 + e / 8 * .85,
152
+ transform: `rotate(${t} 12 12)`
153
+ }, e);
154
+ })
155
+ });
156
+ }
157
+ function O({ px: e }) {
158
+ return /* @__PURE__ */ p("svg", {
159
+ width: e,
160
+ height: e,
161
+ viewBox: "0 0 24 24",
162
+ children: [
163
+ 0,
164
+ 1,
165
+ 2,
166
+ 3
167
+ ].map((e) => /* @__PURE__ */ m("rect", {
168
+ x: 3 + e * 5.5,
169
+ y: "4",
170
+ width: "3",
171
+ height: "16",
172
+ rx: "1.5",
173
+ fill: "currentColor",
174
+ opacity: "0.3",
175
+ children: [
176
+ /* @__PURE__ */ p("animate", {
177
+ attributeName: "opacity",
178
+ values: "0.3;1;0.3",
179
+ dur: "1s",
180
+ begin: `${e * .15}s`,
181
+ repeatCount: "indefinite"
182
+ }),
183
+ /* @__PURE__ */ p("animate", {
184
+ attributeName: "height",
185
+ values: "16;8;16",
186
+ dur: "1s",
187
+ begin: `${e * .15}s`,
188
+ repeatCount: "indefinite"
189
+ }),
190
+ /* @__PURE__ */ p("animate", {
191
+ attributeName: "y",
192
+ values: "4;8;4",
193
+ dur: "1s",
194
+ begin: `${e * .15}s`,
195
+ repeatCount: "indefinite"
196
+ })
197
+ ]
198
+ }, e))
199
+ });
200
+ }
201
+ function k({ px: e }) {
202
+ let t = e * .14, n = e * .33, r = e / 2 - n, i = e / 2, a = e / 2 + n, o = e / 2;
203
+ return /* @__PURE__ */ p("svg", {
204
+ width: e,
205
+ height: e,
206
+ viewBox: `0 0 ${e} ${e}`,
207
+ children: [
208
+ r,
209
+ i,
210
+ a
211
+ ].map((n, r) => /* @__PURE__ */ m("circle", {
212
+ cx: n,
213
+ cy: o,
214
+ r: t,
215
+ fill: "currentColor",
216
+ opacity: "0.4",
217
+ children: [/* @__PURE__ */ p("animate", {
218
+ attributeName: "cy",
219
+ values: `${o};${o - e * .25};${o}`,
220
+ dur: "0.6s",
221
+ begin: `${r * .12}s`,
222
+ repeatCount: "indefinite",
223
+ calcMode: "spline",
224
+ keySplines: "0.4 0 0.2 1;0.4 0 0.2 1"
225
+ }), /* @__PURE__ */ p("animate", {
226
+ attributeName: "opacity",
227
+ values: "0.4;1;0.4",
228
+ dur: "0.6s",
229
+ begin: `${r * .12}s`,
230
+ repeatCount: "indefinite"
231
+ })]
232
+ }, r))
233
+ });
234
+ }
235
+ function A({ px: e }) {
236
+ return /* @__PURE__ */ m("svg", {
237
+ width: e,
238
+ height: e,
239
+ viewBox: "0 0 24 24",
240
+ children: [/* @__PURE__ */ m("circle", {
241
+ cx: "12",
242
+ cy: "12",
243
+ r: "0",
244
+ fill: "currentColor",
245
+ opacity: "0",
246
+ children: [/* @__PURE__ */ p("animate", {
247
+ attributeName: "r",
248
+ values: "4;10;4",
249
+ dur: "1.2s",
250
+ repeatCount: "indefinite"
251
+ }), /* @__PURE__ */ p("animate", {
252
+ attributeName: "opacity",
253
+ values: "0.8;0.1;0.8",
254
+ dur: "1.2s",
255
+ repeatCount: "indefinite"
256
+ })]
257
+ }), /* @__PURE__ */ p("circle", {
258
+ cx: "12",
259
+ cy: "12",
260
+ r: "3.5",
261
+ fill: "currentColor",
262
+ opacity: "0.7"
263
+ })]
264
+ });
265
+ }
266
+ function j({ px: e }) {
267
+ return /* @__PURE__ */ m("svg", {
268
+ width: e,
269
+ height: e,
270
+ viewBox: "0 0 24 24",
271
+ children: [
272
+ /* @__PURE__ */ p("circle", {
273
+ cx: "12",
274
+ cy: "12",
275
+ r: "8",
276
+ stroke: "currentColor",
277
+ strokeWidth: "1.5",
278
+ fill: "none",
279
+ opacity: "0.15"
280
+ }),
281
+ /* @__PURE__ */ p("circle", {
282
+ cx: "12",
283
+ cy: "4",
284
+ r: "2.2",
285
+ fill: "currentColor",
286
+ children: /* @__PURE__ */ p("animateTransform", {
287
+ attributeName: "transform",
288
+ type: "rotate",
289
+ from: "0 12 12",
290
+ to: "360 12 12",
291
+ dur: "0.9s",
292
+ repeatCount: "indefinite"
293
+ })
294
+ }),
295
+ /* @__PURE__ */ p("circle", {
296
+ cx: "12",
297
+ cy: "20",
298
+ r: "1.5",
299
+ fill: "currentColor",
300
+ opacity: "0.5",
301
+ children: /* @__PURE__ */ p("animateTransform", {
302
+ attributeName: "transform",
303
+ type: "rotate",
304
+ from: "0 12 12",
305
+ to: "-360 12 12",
306
+ dur: "0.9s",
307
+ repeatCount: "indefinite"
308
+ })
309
+ })
310
+ ]
311
+ });
312
+ }
313
+ function M({ px: e }) {
314
+ let t = e * .14, n = e * .33, r = e / 2 - n, i = e / 2, a = e / 2 + n, o = e / 2;
315
+ return /* @__PURE__ */ p("svg", {
316
+ width: e,
317
+ height: e,
318
+ viewBox: `0 0 ${e} ${e}`,
319
+ children: [
320
+ r,
321
+ i,
322
+ a
323
+ ].map((e, n) => /* @__PURE__ */ p("circle", {
324
+ cx: e,
325
+ cy: o,
326
+ r: t,
327
+ fill: "currentColor",
328
+ opacity: "0.25",
329
+ children: /* @__PURE__ */ p("animate", {
330
+ attributeName: "opacity",
331
+ values: "0.25;1;0.25",
332
+ dur: "0.9s",
333
+ begin: `${n * .2}s`,
334
+ repeatCount: "indefinite"
335
+ })
336
+ }, n))
337
+ });
338
+ }
339
+ var N = {
340
+ ring: T,
341
+ arc: E,
342
+ dots: D,
343
+ bars: O,
344
+ bounce: k,
345
+ pulse: A,
346
+ orbit: j,
347
+ flow: M
348
+ }, P = new Set([
349
+ "ring",
350
+ "arc",
351
+ "dots"
352
+ ]);
353
+ function F({ variant: e = "ring", size: t = "md", className: n, label: r }) {
354
+ let i = typeof t == "number" ? t : w[t], a = N[e];
355
+ return /* @__PURE__ */ p("span", {
356
+ "aria-hidden": !r,
357
+ "aria-label": r,
358
+ role: r ? "img" : void 0,
359
+ "data-animate": P.has(e) ? "spin" : void 0,
360
+ className: _("owo-spinner", C.root, n),
361
+ children: /* @__PURE__ */ p(a, { px: i })
362
+ });
363
+ }
364
+ var I = {
365
+ root: "_root_yhdgl_1",
366
+ icon: "_icon_yhdgl_83",
367
+ label: "_label_yhdgl_95"
368
+ };
369
+ //#endregion
370
+ //#region src/components/Button.tsx
371
+ function L({ className: e }) {
372
+ return _("owo-button", I.root, e);
373
+ }
374
+ function R(e) {
375
+ let { variant: t = "secondary", size: n = "md", loading: r = !1, leadingIcon: i, trailingIcon: a, className: o, children: s, ...c } = e, l = /* @__PURE__ */ m(f, { children: [
376
+ r ? /* @__PURE__ */ p("span", {
377
+ className: I.icon,
378
+ children: /* @__PURE__ */ p(F, { size: n === "xs" ? "xs" : n === "sm" ? "sm" : n === "xl" ? "lg" : "md" })
379
+ }) : i ? /* @__PURE__ */ p("span", {
380
+ className: I.icon,
381
+ children: i
382
+ }) : null,
383
+ /* @__PURE__ */ p("span", {
384
+ className: I.label,
385
+ children: s
386
+ }),
387
+ !r && a ? /* @__PURE__ */ p("span", {
388
+ className: I.icon,
389
+ children: a
390
+ }) : null
391
+ ] }), u = L({
392
+ variant: t,
393
+ size: n,
394
+ loading: r,
395
+ className: o
396
+ });
397
+ if ("href" in e && e.href) {
398
+ let { href: e, ...i } = c;
399
+ return /* @__PURE__ */ p("a", {
400
+ href: e,
401
+ "data-variant": t,
402
+ "data-size": n,
403
+ "data-loading": r ? "true" : void 0,
404
+ "aria-disabled": r || void 0,
405
+ tabIndex: r ? -1 : void 0,
406
+ className: u,
407
+ onClick: r ? (e) => e.preventDefault() : void 0,
408
+ ...i,
409
+ children: l
410
+ });
411
+ }
412
+ let d = c;
413
+ return /* @__PURE__ */ p("button", {
414
+ type: d.type ?? "button",
415
+ "data-variant": t,
416
+ "data-size": n,
417
+ "data-loading": r ? "true" : void 0,
418
+ disabled: d.disabled || r,
419
+ className: u,
420
+ ...d,
421
+ children: l
422
+ });
423
+ }
424
+ //#endregion
425
+ //#region src/contexts/FieldContext.ts
426
+ var ee = n(void 0);
427
+ function z() {
428
+ return a(ee);
429
+ }
430
+ //#endregion
431
+ //#region src/hooks/useFieldProps.ts
432
+ function B(e) {
433
+ let t = z();
434
+ return {
435
+ id: e.id ?? t?.controlId,
436
+ disabled: e.disabled ?? t?.disabled ?? !1,
437
+ required: e.required ?? t?.required ?? !1,
438
+ invalid: e.invalid ?? t?.invalid ?? !1,
439
+ "aria-describedby": e["aria-describedby"] ?? t?.describedBy
440
+ };
441
+ }
442
+ //#endregion
443
+ //#region src/hooks/useControllableState.ts
444
+ function V({ value: e, defaultValue: t, onChange: n, fallback: r }) {
445
+ let [i, a] = d(t ?? r), o = e !== void 0, s = o ? e : i;
446
+ function c(e) {
447
+ o || a(e), n?.(e);
448
+ }
449
+ return [s, c];
450
+ }
451
+ var H = {
452
+ root: "_root_16v37_1",
453
+ input: "_input_16v37_15",
454
+ control: "_control_16v37_28",
455
+ icon: "_icon_16v37_91",
456
+ label: "_label_16v37_101"
457
+ };
458
+ //#endregion
459
+ //#region src/components/Checkbox.tsx
460
+ function U({ checked: e, defaultChecked: t, onCheckedChange: n, indeterminate: r = !1, disabled: i, required: a, invalid: s, name: c, value: l = "on", id: d, size: f = "md", className: h, ariaLabel: g, children: v, "aria-describedby": y }) {
461
+ let [b, x] = V({
462
+ value: e,
463
+ defaultValue: t,
464
+ onChange: n,
465
+ fallback: !1
466
+ }), S = B({
467
+ id: d,
468
+ disabled: i,
469
+ required: a,
470
+ invalid: s,
471
+ "aria-describedby": y
472
+ }), C = u(null);
473
+ o(() => {
474
+ C.current && (C.current.indeterminate = r);
475
+ }, [r]);
476
+ let w = r ? "indeterminate" : b ? "checked" : "unchecked";
477
+ return /* @__PURE__ */ m("label", {
478
+ "data-scope": "checkbox",
479
+ "data-disabled": S.disabled || void 0,
480
+ "data-invalid": S.invalid || void 0,
481
+ className: _("owo-checkbox", H.root, h),
482
+ children: [
483
+ /* @__PURE__ */ p("input", {
484
+ ref: C,
485
+ id: S.id,
486
+ type: "checkbox",
487
+ name: c,
488
+ value: l,
489
+ checked: b,
490
+ disabled: S.disabled,
491
+ required: S.required,
492
+ "aria-label": g,
493
+ "aria-describedby": S["aria-describedby"],
494
+ "aria-invalid": S.invalid || void 0,
495
+ "aria-checked": r ? "mixed" : b,
496
+ className: H.input,
497
+ onChange: (e) => {
498
+ S.disabled || x(e.target.checked);
499
+ }
500
+ }),
501
+ /* @__PURE__ */ p("span", {
502
+ "data-part": "control",
503
+ "data-state": w,
504
+ "data-size": f,
505
+ className: H.control,
506
+ children: w === "indeterminate" ? /* @__PURE__ */ p("svg", {
507
+ "aria-hidden": "true",
508
+ viewBox: "0 0 16 16",
509
+ className: H.icon,
510
+ children: /* @__PURE__ */ p("path", { d: "M4 8h8" })
511
+ }) : w === "checked" ? /* @__PURE__ */ p("svg", {
512
+ "aria-hidden": "true",
513
+ viewBox: "0 0 16 16",
514
+ className: H.icon,
515
+ children: /* @__PURE__ */ p("path", { d: "M3.5 8.5l3 3 6-7" })
516
+ }) : null
517
+ }),
518
+ v != null && /* @__PURE__ */ p("span", {
519
+ "data-part": "label",
520
+ className: H.label,
521
+ children: v
522
+ })
523
+ ]
524
+ });
525
+ }
526
+ var W = {
527
+ root: "_root_bx150_1",
528
+ triggerInner: "_triggerInner_bx150_27",
529
+ triggerIcon: "_triggerIcon_bx150_34",
530
+ triggerIndicator: "_triggerIndicator_bx150_35",
531
+ triggerLabel: "_triggerLabel_bx150_44",
532
+ contentInner: "_contentInner_bx150_50"
533
+ }, te = n(null);
534
+ function G(e) {
535
+ let t = a(te);
536
+ if (!t) throw Error(`${e} must be used within Collapsible.Root`);
537
+ return t;
538
+ }
539
+ function ne({ open: e, defaultOpen: t, onOpenChange: n }) {
540
+ let [r, i] = d(t ?? !1), a = e !== void 0, o = a ? e : r;
541
+ function s(e) {
542
+ a || i(e), n?.(e);
543
+ }
544
+ return [o, s];
545
+ }
546
+ function re({ children: e, open: t, defaultOpen: n, onOpenChange: r, classNames: i, className: a, ...o }) {
547
+ let [c, u] = ne({
548
+ open: t,
549
+ defaultOpen: n,
550
+ onOpenChange: r
551
+ }), d = s(), f = l(() => ({
552
+ open: c,
553
+ setOpen: u,
554
+ contentId: d,
555
+ classNames: i
556
+ }), [
557
+ d,
558
+ c,
559
+ u,
560
+ i
561
+ ]);
562
+ return /* @__PURE__ */ p(te.Provider, {
563
+ value: f,
564
+ children: /* @__PURE__ */ p("div", {
565
+ "data-state": c ? "open" : "closed",
566
+ "data-scope": "collapsible",
567
+ className: _("owo-collapsible", W.root, a),
568
+ ...o,
569
+ children: e
570
+ })
571
+ });
572
+ }
573
+ function K({ children: e, icon: t, indicator: n, iconPosition: r = "start", className: i, onClick: a, ...o }) {
574
+ let { open: s, setOpen: c, contentId: l, classNames: u } = G("Collapsible.Trigger"), d = t !== void 0 || n !== void 0 ? /* @__PURE__ */ m("span", {
575
+ "data-part": "triggerInner",
576
+ className: _(W.triggerInner, u?.triggerInner),
577
+ children: [
578
+ t && r === "start" ? /* @__PURE__ */ p("span", {
579
+ "data-part": "triggerIcon",
580
+ "aria-hidden": "true",
581
+ className: _(W.triggerIcon, u?.triggerIcon),
582
+ children: t
583
+ }) : null,
584
+ /* @__PURE__ */ p("span", {
585
+ "data-part": "triggerLabel",
586
+ className: _(W.triggerLabel, u?.triggerLabel),
587
+ children: e
588
+ }),
589
+ t && r === "end" ? /* @__PURE__ */ p("span", {
590
+ "data-part": "triggerIcon",
591
+ "aria-hidden": "true",
592
+ className: _(W.triggerIcon, u?.triggerIcon),
593
+ children: t
594
+ }) : null,
595
+ n ? /* @__PURE__ */ p("span", {
596
+ "data-part": "triggerIndicator",
597
+ "aria-hidden": "true",
598
+ className: _(W.triggerIndicator, u?.triggerIndicator),
599
+ children: n
600
+ }) : null
601
+ ]
602
+ }) : e;
603
+ return /* @__PURE__ */ p("button", {
604
+ type: "button",
605
+ "aria-expanded": s,
606
+ "aria-controls": l,
607
+ "data-state": s ? "open" : "closed",
608
+ "data-scope": "collapsible",
609
+ "data-part": "trigger",
610
+ className: _(u?.trigger, i),
611
+ onClick: (e) => {
612
+ a?.(e), e.defaultPrevented || c(!s);
613
+ },
614
+ ...o,
615
+ children: d
616
+ });
617
+ }
618
+ function ie({ children: e, className: t, ...n }) {
619
+ let { open: r, contentId: i, classNames: a } = G("Collapsible.Content"), [s, c] = d(r), l = u(null), f = u(null);
620
+ return o(() => {
621
+ let e = l.current, t = f.current;
622
+ if (!e || !t) return;
623
+ let n = 0, i = 0, a = () => {
624
+ e.style.height = "auto", e.style.overflow = "visible";
625
+ };
626
+ if (r && c(!0), !s && !r) return;
627
+ let o = (t) => {
628
+ t.target !== e || t.propertyName !== "height" || (e.removeEventListener("transitionend", o), r ? a() : c(!1));
629
+ };
630
+ return (() => {
631
+ let s = t.scrollHeight;
632
+ if (e.style.overflow = "hidden", r) {
633
+ e.style.height = "0px", n = window.requestAnimationFrame(() => {
634
+ e.addEventListener("transitionend", o), e.style.height = `${s}px`;
635
+ }), i = window.setTimeout(a, 240);
636
+ return;
637
+ }
638
+ e.style.height = `${s}px`, n = window.requestAnimationFrame(() => {
639
+ e.addEventListener("transitionend", o), e.style.height = "0px";
640
+ }), i = window.setTimeout(() => c(!1), 240);
641
+ })(), () => {
642
+ window.cancelAnimationFrame(n), window.clearTimeout(i), e.removeEventListener("transitionend", o);
643
+ };
644
+ }, [r, s]), !s && !r ? null : /* @__PURE__ */ p("div", {
645
+ id: i,
646
+ ref: l,
647
+ "data-state": r ? "open" : "closed",
648
+ "data-scope": "collapsible",
649
+ "data-part": "content",
650
+ "aria-hidden": !r,
651
+ className: _(a?.content, t),
652
+ ...n,
653
+ children: /* @__PURE__ */ p("div", {
654
+ ref: f,
655
+ "data-part": "contentInner",
656
+ className: _(W.contentInner, a?.contentInner),
657
+ children: e
658
+ })
659
+ });
660
+ }
661
+ var ae = Object.assign(re, {
662
+ Root: re,
663
+ Trigger: K,
664
+ Content: ie
665
+ }), oe = "_overlay_1p0ee_1", se = "_panel_1p0ee_19", ce = "_confirmDescription_1p0ee_64", le = {
666
+ overlay: oe,
667
+ "dialog-backdrop-in": "_dialog-backdrop-in_1p0ee_1",
668
+ panel: se,
669
+ "dialog-in": "_dialog-in_1p0ee_1",
670
+ confirmDescription: ce
671
+ }, ue = n(void 0);
672
+ function de({ className: e, children: t, ...n }) {
673
+ let r = a(ue);
674
+ return /* @__PURE__ */ p("div", {
675
+ "data-scope": "dialog",
676
+ "data-part": "header",
677
+ className: _(r?.header, e),
678
+ ...n,
679
+ children: t
680
+ });
681
+ }
682
+ function fe({ className: e, children: t, ...n }) {
683
+ let r = a(ue);
684
+ return /* @__PURE__ */ p("div", {
685
+ "data-scope": "dialog",
686
+ "data-part": "body",
687
+ className: _(r?.body, e),
688
+ ...n,
689
+ children: t
690
+ });
691
+ }
692
+ function pe({ className: e, children: t, ...n }) {
693
+ let r = a(ue);
694
+ return /* @__PURE__ */ p("div", {
695
+ "data-scope": "dialog",
696
+ "data-part": "footer",
697
+ className: _(r?.footer, e),
698
+ ...n,
699
+ children: t
700
+ });
701
+ }
702
+ function me({ open: e, onClose: t, size: n = "sm", children: r, className: a, overlayClassName: s, panelClassName: c, classNames: l, ...d }) {
703
+ let f = u(null), h = u(null), g = i((e) => {
704
+ e.key === "Escape" && (e.stopPropagation(), t());
705
+ }, [t]);
706
+ return o(() => (e ? (h.current = document.activeElement, document.body.style.overflow = "hidden", requestAnimationFrame(() => {
707
+ let e = f.current;
708
+ if (!e) return;
709
+ let t = e.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
710
+ t ? t.focus() : e.focus();
711
+ }), document.addEventListener("keydown", g)) : (document.body.style.overflow = "", h.current?.focus()), () => {
712
+ document.removeEventListener("keydown", g), document.body.style.overflow = "";
713
+ }), [e, g]), e ? /* @__PURE__ */ p(ue.Provider, {
714
+ value: l,
715
+ children: /* @__PURE__ */ m("div", {
716
+ "data-state": "open",
717
+ "data-scope": "dialog",
718
+ "data-part": "overlay",
719
+ className: _("owo-dialog-overlay", le.overlay, l?.overlay),
720
+ children: [/* @__PURE__ */ p("button", {
721
+ type: "button",
722
+ "aria-label": "Close dialog",
723
+ "data-state": "open",
724
+ "data-scope": "dialog",
725
+ "data-part": "backdrop",
726
+ className: _("owo-dialog-backdrop", s, l?.backdrop),
727
+ onClick: t
728
+ }), /* @__PURE__ */ p("div", {
729
+ ref: f,
730
+ role: "dialog",
731
+ "aria-modal": "true",
732
+ tabIndex: -1,
733
+ "data-state": "open",
734
+ "data-size": n,
735
+ className: _("owo-dialog", le.panel, c, a),
736
+ ...d,
737
+ children: r
738
+ })]
739
+ })
740
+ }) : null;
741
+ }
742
+ me.Header = de, me.Body = fe, me.Footer = pe;
743
+ //#endregion
744
+ //#region src/components/ConfirmDialog.tsx
745
+ var he = n(null);
746
+ function ge() {
747
+ let e = a(he);
748
+ if (!e) throw Error("useConfirm must be used within <ConfirmProvider>");
749
+ return e;
750
+ }
751
+ function _e({ children: e }) {
752
+ let [t, n] = d(null), r = u(null), a = i((e) => (r.current && r.current.resolve(!1), new Promise((t) => {
753
+ let i = {
754
+ options: e,
755
+ resolve: t
756
+ };
757
+ r.current = i, n(i);
758
+ })), []), o = i((e) => {
759
+ r.current &&= (r.current.resolve(e), null), n(null);
760
+ }, []);
761
+ return /* @__PURE__ */ m(he.Provider, {
762
+ value: a,
763
+ children: [e, /* @__PURE__ */ p(me, {
764
+ open: t !== null,
765
+ onClose: () => o(!1),
766
+ children: t && /* @__PURE__ */ m(f, { children: [
767
+ /* @__PURE__ */ p(me.Header, { children: t.options.title }),
768
+ /* @__PURE__ */ p(me.Body, { children: typeof t.options.description == "string" ? /* @__PURE__ */ p("p", {
769
+ className: le.confirmDescription,
770
+ children: t.options.description
771
+ }) : t.options.description }),
772
+ /* @__PURE__ */ m(me.Footer, { children: [/* @__PURE__ */ p(R, {
773
+ variant: "ghost",
774
+ size: "sm",
775
+ onClick: () => o(!1),
776
+ children: t.options.cancelLabel ?? "取消"
777
+ }), /* @__PURE__ */ p(R, {
778
+ variant: t.options.variant ?? "primary",
779
+ size: "sm",
780
+ onClick: () => o(!0),
781
+ children: t.options.confirmLabel ?? "确认"
782
+ })] })
783
+ ] })
784
+ })]
785
+ });
786
+ }
787
+ //#endregion
788
+ //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
789
+ var ve = Math.min, ye = Math.max, be = Math.round, xe = Math.floor, q = (e) => ({
790
+ x: e,
791
+ y: e
792
+ }), Se = {
793
+ left: "right",
794
+ right: "left",
795
+ bottom: "top",
796
+ top: "bottom"
797
+ };
798
+ function Ce(e, t, n) {
799
+ return ye(e, ve(t, n));
800
+ }
801
+ function we(e, t) {
802
+ return typeof e == "function" ? e(t) : e;
803
+ }
804
+ function Te(e) {
805
+ return e.split("-")[0];
806
+ }
807
+ function Ee(e) {
808
+ return e.split("-")[1];
809
+ }
810
+ function De(e) {
811
+ return e === "x" ? "y" : "x";
812
+ }
813
+ function Oe(e) {
814
+ return e === "y" ? "height" : "width";
815
+ }
816
+ function ke(e) {
817
+ let t = e[0];
818
+ return t === "t" || t === "b" ? "y" : "x";
819
+ }
820
+ function Ae(e) {
821
+ return De(ke(e));
822
+ }
823
+ function je(e, t, n) {
824
+ n === void 0 && (n = !1);
825
+ let r = Ee(e), i = Ae(e), a = Oe(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
826
+ return t.reference[a] > t.floating[a] && (o = Be(o)), [o, Be(o)];
827
+ }
828
+ function Me(e) {
829
+ let t = Be(e);
830
+ return [
831
+ Ne(e),
832
+ t,
833
+ Ne(t)
834
+ ];
835
+ }
836
+ function Ne(e) {
837
+ return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
838
+ }
839
+ var Pe = ["left", "right"], Fe = ["right", "left"], Ie = ["top", "bottom"], Le = ["bottom", "top"];
840
+ function Re(e, t, n) {
841
+ switch (e) {
842
+ case "top":
843
+ case "bottom": return n ? t ? Fe : Pe : t ? Pe : Fe;
844
+ case "left":
845
+ case "right": return t ? Ie : Le;
846
+ default: return [];
847
+ }
848
+ }
849
+ function ze(e, t, n, r) {
850
+ let i = Ee(e), a = Re(Te(e), n === "start", r);
851
+ return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Ne)))), a;
852
+ }
853
+ function Be(e) {
854
+ let t = Te(e);
855
+ return Se[t] + e.slice(t.length);
856
+ }
857
+ function Ve(e) {
858
+ return {
859
+ top: 0,
860
+ right: 0,
861
+ bottom: 0,
862
+ left: 0,
863
+ ...e
864
+ };
865
+ }
866
+ function He(e) {
867
+ return typeof e == "number" ? {
868
+ top: e,
869
+ right: e,
870
+ bottom: e,
871
+ left: e
872
+ } : Ve(e);
873
+ }
874
+ function Ue(e) {
875
+ let { x: t, y: n, width: r, height: i } = e;
876
+ return {
877
+ width: r,
878
+ height: i,
879
+ top: n,
880
+ left: t,
881
+ right: t + r,
882
+ bottom: n + i,
883
+ x: t,
884
+ y: n
885
+ };
886
+ }
887
+ //#endregion
888
+ //#region node_modules/@floating-ui/core/dist/floating-ui.core.mjs
889
+ function We(e, t, n) {
890
+ let { reference: r, floating: i } = e, a = ke(t), o = Ae(t), s = Oe(o), c = Te(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
891
+ switch (c) {
892
+ case "top":
893
+ p = {
894
+ x: u,
895
+ y: r.y - i.height
896
+ };
897
+ break;
898
+ case "bottom":
899
+ p = {
900
+ x: u,
901
+ y: r.y + r.height
902
+ };
903
+ break;
904
+ case "right":
905
+ p = {
906
+ x: r.x + r.width,
907
+ y: d
908
+ };
909
+ break;
910
+ case "left":
911
+ p = {
912
+ x: r.x - i.width,
913
+ y: d
914
+ };
915
+ break;
916
+ default: p = {
917
+ x: r.x,
918
+ y: r.y
919
+ };
920
+ }
921
+ switch (Ee(t)) {
922
+ case "start":
923
+ p[o] -= f * (n && l ? -1 : 1);
924
+ break;
925
+ case "end":
926
+ p[o] += f * (n && l ? -1 : 1);
927
+ break;
928
+ }
929
+ return p;
930
+ }
931
+ async function Ge(e, t) {
932
+ t === void 0 && (t = {});
933
+ let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = we(t, e), p = He(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = Ue(await i.getClippingRect({
934
+ element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
935
+ boundary: c,
936
+ rootBoundary: l,
937
+ strategy: s
938
+ })), g = u === "floating" ? {
939
+ x: n,
940
+ y: r,
941
+ width: a.floating.width,
942
+ height: a.floating.height
943
+ } : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
944
+ x: 1,
945
+ y: 1
946
+ }, y = Ue(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
947
+ elements: o,
948
+ rect: g,
949
+ offsetParent: _,
950
+ strategy: s
951
+ }) : g);
952
+ return {
953
+ top: (h.top - y.top + p.top) / v.y,
954
+ bottom: (y.bottom - h.bottom + p.bottom) / v.y,
955
+ left: (h.left - y.left + p.left) / v.x,
956
+ right: (y.right - h.right + p.right) / v.x
957
+ };
958
+ }
959
+ var Ke = 50, qe = async (e, t, n) => {
960
+ let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
961
+ ...o,
962
+ detectOverflow: Ge
963
+ }, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
964
+ reference: e,
965
+ floating: t,
966
+ strategy: i
967
+ }), { x: u, y: d } = We(l, r, c), f = r, p = 0, m = {};
968
+ for (let n = 0; n < a.length; n++) {
969
+ let h = a[n];
970
+ if (!h) continue;
971
+ let { name: g, fn: _ } = h, { x: v, y, data: b, reset: x } = await _({
972
+ x: u,
973
+ y: d,
974
+ initialPlacement: r,
975
+ placement: f,
976
+ strategy: i,
977
+ middlewareData: m,
978
+ rects: l,
979
+ platform: s,
980
+ elements: {
981
+ reference: e,
982
+ floating: t
983
+ }
984
+ });
985
+ u = v ?? u, d = y ?? d, m[g] = {
986
+ ...m[g],
987
+ ...b
988
+ }, x && p < Ke && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
989
+ reference: e,
990
+ floating: t,
991
+ strategy: i
992
+ }) : x.rects), {x: u, y: d} = We(l, f, c)), n = -1);
993
+ }
994
+ return {
995
+ x: u,
996
+ y: d,
997
+ placement: f,
998
+ strategy: i,
999
+ middlewareData: m
1000
+ };
1001
+ }, Je = (e) => ({
1002
+ name: "arrow",
1003
+ options: e,
1004
+ async fn(t) {
1005
+ let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = we(e, t) || {};
1006
+ if (l == null) return {};
1007
+ let d = He(u), f = {
1008
+ x: n,
1009
+ y: r
1010
+ }, p = Ae(i), m = Oe(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
1011
+ (!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
1012
+ let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = ve(d[_], T), D = ve(d[v], T), O = E, k = C - h[m] - D, A = C / 2 - h[m] / 2 + w, j = Ce(O, A, k), M = !c.arrow && Ee(i) != null && A !== j && a.reference[m] / 2 - (A < O ? E : D) - h[m] / 2 < 0, N = M ? A < O ? A - O : A - k : 0;
1013
+ return {
1014
+ [p]: f[p] + N,
1015
+ data: {
1016
+ [p]: j,
1017
+ centerOffset: A - j - N,
1018
+ ...M && { alignmentOffset: N }
1019
+ },
1020
+ reset: M
1021
+ };
1022
+ }
1023
+ }), Ye = function(e) {
1024
+ return e === void 0 && (e = {}), {
1025
+ name: "flip",
1026
+ options: e,
1027
+ async fn(t) {
1028
+ var n;
1029
+ let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = we(e, t);
1030
+ if ((n = i.arrow) != null && n.alignmentOffset) return {};
1031
+ let g = Te(r), _ = ke(o), v = Te(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [Be(o)] : Me(o)), x = p !== "none";
1032
+ !d && x && b.push(...ze(o, m, p, y));
1033
+ let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
1034
+ if (l && w.push(C[g]), u) {
1035
+ let e = je(r, a, y);
1036
+ w.push(C[e[0]], C[e[1]]);
1037
+ }
1038
+ if (T = [...T, {
1039
+ placement: r,
1040
+ overflows: w
1041
+ }], !w.every((e) => e <= 0)) {
1042
+ let e = (i.flip?.index || 0) + 1, t = S[e];
1043
+ if (t && (!(u === "alignment" && _ !== ke(t)) || T.every((e) => ke(e.placement) === _ ? e.overflows[0] > 0 : !0))) return {
1044
+ data: {
1045
+ index: e,
1046
+ overflows: T
1047
+ },
1048
+ reset: { placement: t }
1049
+ };
1050
+ let n = T.filter((e) => e.overflows[0] <= 0).sort((e, t) => e.overflows[1] - t.overflows[1])[0]?.placement;
1051
+ if (!n) switch (f) {
1052
+ case "bestFit": {
1053
+ let e = T.filter((e) => {
1054
+ if (x) {
1055
+ let t = ke(e.placement);
1056
+ return t === _ || t === "y";
1057
+ }
1058
+ return !0;
1059
+ }).map((e) => [e.placement, e.overflows.filter((e) => e > 0).reduce((e, t) => e + t, 0)]).sort((e, t) => e[1] - t[1])[0]?.[0];
1060
+ e && (n = e);
1061
+ break;
1062
+ }
1063
+ case "initialPlacement":
1064
+ n = o;
1065
+ break;
1066
+ }
1067
+ if (r !== n) return { reset: { placement: n } };
1068
+ }
1069
+ return {};
1070
+ }
1071
+ };
1072
+ }, Xe = /* @__PURE__ */ new Set(["left", "top"]);
1073
+ async function Ze(e, t) {
1074
+ let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = Te(n), s = Ee(n), c = ke(n) === "y", l = Xe.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = we(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
1075
+ mainAxis: d,
1076
+ crossAxis: 0,
1077
+ alignmentAxis: null
1078
+ } : {
1079
+ mainAxis: d.mainAxis || 0,
1080
+ crossAxis: d.crossAxis || 0,
1081
+ alignmentAxis: d.alignmentAxis
1082
+ };
1083
+ return s && typeof m == "number" && (p = s === "end" ? m * -1 : m), c ? {
1084
+ x: p * u,
1085
+ y: f * l
1086
+ } : {
1087
+ x: f * l,
1088
+ y: p * u
1089
+ };
1090
+ }
1091
+ var Qe = function(e) {
1092
+ return e === void 0 && (e = 0), {
1093
+ name: "offset",
1094
+ options: e,
1095
+ async fn(t) {
1096
+ var n;
1097
+ let { x: r, y: i, placement: a, middlewareData: o } = t, s = await Ze(t, e);
1098
+ return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
1099
+ x: r + s.x,
1100
+ y: i + s.y,
1101
+ data: {
1102
+ ...s,
1103
+ placement: a
1104
+ }
1105
+ };
1106
+ }
1107
+ };
1108
+ }, $e = function(e) {
1109
+ return e === void 0 && (e = {}), {
1110
+ name: "shift",
1111
+ options: e,
1112
+ async fn(t) {
1113
+ let { x: n, y: r, placement: i, platform: a } = t, { mainAxis: o = !0, crossAxis: s = !1, limiter: c = { fn: (e) => {
1114
+ let { x: t, y: n } = e;
1115
+ return {
1116
+ x: t,
1117
+ y: n
1118
+ };
1119
+ } }, ...l } = we(e, t), u = {
1120
+ x: n,
1121
+ y: r
1122
+ }, d = await a.detectOverflow(t, l), f = ke(Te(i)), p = De(f), m = u[p], h = u[f];
1123
+ if (o) {
1124
+ let e = p === "y" ? "top" : "left", t = p === "y" ? "bottom" : "right", n = m + d[e], r = m - d[t];
1125
+ m = Ce(n, m, r);
1126
+ }
1127
+ if (s) {
1128
+ let e = f === "y" ? "top" : "left", t = f === "y" ? "bottom" : "right", n = h + d[e], r = h - d[t];
1129
+ h = Ce(n, h, r);
1130
+ }
1131
+ let g = c.fn({
1132
+ ...t,
1133
+ [p]: m,
1134
+ [f]: h
1135
+ });
1136
+ return {
1137
+ ...g,
1138
+ data: {
1139
+ x: g.x - n,
1140
+ y: g.y - r,
1141
+ enabled: {
1142
+ [p]: o,
1143
+ [f]: s
1144
+ }
1145
+ }
1146
+ };
1147
+ }
1148
+ };
1149
+ };
1150
+ //#endregion
1151
+ //#region node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1152
+ function et() {
1153
+ return typeof window < "u";
1154
+ }
1155
+ function tt(e) {
1156
+ return nt(e) ? (e.nodeName || "").toLowerCase() : "#document";
1157
+ }
1158
+ function J(e) {
1159
+ var t;
1160
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1161
+ }
1162
+ function Y(e) {
1163
+ return ((nt(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
1164
+ }
1165
+ function nt(e) {
1166
+ return et() ? e instanceof Node || e instanceof J(e).Node : !1;
1167
+ }
1168
+ function X(e) {
1169
+ return et() ? e instanceof Element || e instanceof J(e).Element : !1;
1170
+ }
1171
+ function rt(e) {
1172
+ return et() ? e instanceof HTMLElement || e instanceof J(e).HTMLElement : !1;
1173
+ }
1174
+ function it(e) {
1175
+ return !et() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof J(e).ShadowRoot;
1176
+ }
1177
+ function at(e) {
1178
+ let { overflow: t, overflowX: n, overflowY: r, display: i } = Z(e);
1179
+ return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
1180
+ }
1181
+ function ot(e) {
1182
+ return /^(table|td|th)$/.test(tt(e));
1183
+ }
1184
+ function st(e) {
1185
+ try {
1186
+ if (e.matches(":popover-open")) return !0;
1187
+ } catch {}
1188
+ try {
1189
+ return e.matches(":modal");
1190
+ } catch {
1191
+ return !1;
1192
+ }
1193
+ }
1194
+ var ct = /transform|translate|scale|rotate|perspective|filter/, lt = /paint|layout|strict|content/, ut = (e) => !!e && e !== "none", dt;
1195
+ function ft(e) {
1196
+ let t = X(e) ? Z(e) : e;
1197
+ return ut(t.transform) || ut(t.translate) || ut(t.scale) || ut(t.rotate) || ut(t.perspective) || !mt() && (ut(t.backdropFilter) || ut(t.filter)) || ct.test(t.willChange || "") || lt.test(t.contain || "");
1198
+ }
1199
+ function pt(e) {
1200
+ let t = _t(e);
1201
+ for (; rt(t) && !ht(t);) {
1202
+ if (ft(t)) return t;
1203
+ if (st(t)) return null;
1204
+ t = _t(t);
1205
+ }
1206
+ return null;
1207
+ }
1208
+ function mt() {
1209
+ return dt ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), dt;
1210
+ }
1211
+ function ht(e) {
1212
+ return /^(html|body|#document)$/.test(tt(e));
1213
+ }
1214
+ function Z(e) {
1215
+ return J(e).getComputedStyle(e);
1216
+ }
1217
+ function gt(e) {
1218
+ return X(e) ? {
1219
+ scrollLeft: e.scrollLeft,
1220
+ scrollTop: e.scrollTop
1221
+ } : {
1222
+ scrollLeft: e.scrollX,
1223
+ scrollTop: e.scrollY
1224
+ };
1225
+ }
1226
+ function _t(e) {
1227
+ if (tt(e) === "html") return e;
1228
+ let t = e.assignedSlot || e.parentNode || it(e) && e.host || Y(e);
1229
+ return it(t) ? t.host : t;
1230
+ }
1231
+ function vt(e) {
1232
+ let t = _t(e);
1233
+ return ht(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : rt(t) && at(t) ? t : vt(t);
1234
+ }
1235
+ function yt(e, t, n) {
1236
+ t === void 0 && (t = []), n === void 0 && (n = !0);
1237
+ let r = vt(e), i = r === e.ownerDocument?.body, a = J(r);
1238
+ if (i) {
1239
+ let e = bt(a);
1240
+ return t.concat(a, a.visualViewport || [], at(r) ? r : [], e && n ? yt(e) : []);
1241
+ } else return t.concat(r, yt(r, [], n));
1242
+ }
1243
+ function bt(e) {
1244
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1245
+ }
1246
+ //#endregion
1247
+ //#region node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
1248
+ function xt(e) {
1249
+ let t = Z(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = rt(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = be(n) !== a || be(r) !== o;
1250
+ return s && (n = a, r = o), {
1251
+ width: n,
1252
+ height: r,
1253
+ $: s
1254
+ };
1255
+ }
1256
+ function St(e) {
1257
+ return X(e) ? e : e.contextElement;
1258
+ }
1259
+ function Ct(e) {
1260
+ let t = St(e);
1261
+ if (!rt(t)) return q(1);
1262
+ let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = xt(t), o = (a ? be(n.width) : n.width) / r, s = (a ? be(n.height) : n.height) / i;
1263
+ return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
1264
+ x: o,
1265
+ y: s
1266
+ };
1267
+ }
1268
+ var wt = /* @__PURE__ */ q(0);
1269
+ function Tt(e) {
1270
+ let t = J(e);
1271
+ return !mt() || !t.visualViewport ? wt : {
1272
+ x: t.visualViewport.offsetLeft,
1273
+ y: t.visualViewport.offsetTop
1274
+ };
1275
+ }
1276
+ function Et(e, t, n) {
1277
+ return t === void 0 && (t = !1), !n || t && n !== J(e) ? !1 : t;
1278
+ }
1279
+ function Dt(e, t, n, r) {
1280
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
1281
+ let i = e.getBoundingClientRect(), a = St(e), o = q(1);
1282
+ t && (r ? X(r) && (o = Ct(r)) : o = Ct(e));
1283
+ let s = Et(a, n, r) ? Tt(a) : q(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
1284
+ if (a) {
1285
+ let e = J(a), t = r && X(r) ? J(r) : r, n = e, i = bt(n);
1286
+ for (; i && r && t !== n;) {
1287
+ let e = Ct(i), t = i.getBoundingClientRect(), r = Z(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
1288
+ c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = J(i), i = bt(n);
1289
+ }
1290
+ }
1291
+ return Ue({
1292
+ width: u,
1293
+ height: d,
1294
+ x: c,
1295
+ y: l
1296
+ });
1297
+ }
1298
+ function Ot(e, t) {
1299
+ let n = gt(e).scrollLeft;
1300
+ return t ? t.left + n : Dt(Y(e)).left + n;
1301
+ }
1302
+ function kt(e, t) {
1303
+ let n = e.getBoundingClientRect();
1304
+ return {
1305
+ x: n.left + t.scrollLeft - Ot(e, n),
1306
+ y: n.top + t.scrollTop
1307
+ };
1308
+ }
1309
+ function At(e) {
1310
+ let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = Y(r), s = t ? st(t.floating) : !1;
1311
+ if (r === o || s && a) return n;
1312
+ let c = {
1313
+ scrollLeft: 0,
1314
+ scrollTop: 0
1315
+ }, l = q(1), u = q(0), d = rt(r);
1316
+ if ((d || !d && !a) && ((tt(r) !== "body" || at(o)) && (c = gt(r)), d)) {
1317
+ let e = Dt(r);
1318
+ l = Ct(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
1319
+ }
1320
+ let f = o && !d && !a ? kt(o, c) : q(0);
1321
+ return {
1322
+ width: n.width * l.x,
1323
+ height: n.height * l.y,
1324
+ x: n.x * l.x - c.scrollLeft * l.x + u.x + f.x,
1325
+ y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
1326
+ };
1327
+ }
1328
+ function jt(e) {
1329
+ return Array.from(e.getClientRects());
1330
+ }
1331
+ function Mt(e) {
1332
+ let t = Y(e), n = gt(e), r = e.ownerDocument.body, i = ye(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = ye(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight), o = -n.scrollLeft + Ot(e), s = -n.scrollTop;
1333
+ return Z(r).direction === "rtl" && (o += ye(t.clientWidth, r.clientWidth) - i), {
1334
+ width: i,
1335
+ height: a,
1336
+ x: o,
1337
+ y: s
1338
+ };
1339
+ }
1340
+ var Nt = 25;
1341
+ function Pt(e, t) {
1342
+ let n = J(e), r = Y(e), i = n.visualViewport, a = r.clientWidth, o = r.clientHeight, s = 0, c = 0;
1343
+ if (i) {
1344
+ a = i.width, o = i.height;
1345
+ let e = mt();
1346
+ (!e || e && t === "fixed") && (s = i.offsetLeft, c = i.offsetTop);
1347
+ }
1348
+ let l = Ot(r);
1349
+ if (l <= 0) {
1350
+ let e = r.ownerDocument, t = e.body, n = getComputedStyle(t), i = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, o = Math.abs(r.clientWidth - t.clientWidth - i);
1351
+ o <= Nt && (a -= o);
1352
+ } else l <= Nt && (a += l);
1353
+ return {
1354
+ width: a,
1355
+ height: o,
1356
+ x: s,
1357
+ y: c
1358
+ };
1359
+ }
1360
+ function Ft(e, t) {
1361
+ let n = Dt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = rt(e) ? Ct(e) : q(1);
1362
+ return {
1363
+ width: e.clientWidth * a.x,
1364
+ height: e.clientHeight * a.y,
1365
+ x: i * a.x,
1366
+ y: r * a.y
1367
+ };
1368
+ }
1369
+ function It(e, t, n) {
1370
+ let r;
1371
+ if (t === "viewport") r = Pt(e, n);
1372
+ else if (t === "document") r = Mt(Y(e));
1373
+ else if (X(t)) r = Ft(t, n);
1374
+ else {
1375
+ let n = Tt(e);
1376
+ r = {
1377
+ x: t.x - n.x,
1378
+ y: t.y - n.y,
1379
+ width: t.width,
1380
+ height: t.height
1381
+ };
1382
+ }
1383
+ return Ue(r);
1384
+ }
1385
+ function Lt(e, t) {
1386
+ let n = _t(e);
1387
+ return n === t || !X(n) || ht(n) ? !1 : Z(n).position === "fixed" || Lt(n, t);
1388
+ }
1389
+ function Rt(e, t) {
1390
+ let n = t.get(e);
1391
+ if (n) return n;
1392
+ let r = yt(e, [], !1).filter((e) => X(e) && tt(e) !== "body"), i = null, a = Z(e).position === "fixed", o = a ? _t(e) : e;
1393
+ for (; X(o) && !ht(o);) {
1394
+ let t = Z(o), n = ft(o);
1395
+ !n && t.position === "fixed" && (i = null), (a ? !n && !i : !n && t.position === "static" && i && (i.position === "absolute" || i.position === "fixed") || at(o) && !n && Lt(e, o)) ? r = r.filter((e) => e !== o) : i = t, o = _t(o);
1396
+ }
1397
+ return t.set(e, r), r;
1398
+ }
1399
+ function zt(e) {
1400
+ let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? st(t) ? [] : Rt(t, this._c) : [].concat(n), r], o = It(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
1401
+ for (let e = 1; e < a.length; e++) {
1402
+ let n = It(t, a[e], i);
1403
+ s = ye(n.top, s), c = ve(n.right, c), l = ve(n.bottom, l), u = ye(n.left, u);
1404
+ }
1405
+ return {
1406
+ width: c - u,
1407
+ height: l - s,
1408
+ x: u,
1409
+ y: s
1410
+ };
1411
+ }
1412
+ function Bt(e) {
1413
+ let { width: t, height: n } = xt(e);
1414
+ return {
1415
+ width: t,
1416
+ height: n
1417
+ };
1418
+ }
1419
+ function Vt(e, t, n) {
1420
+ let r = rt(t), i = Y(t), a = n === "fixed", o = Dt(e, !0, a, t), s = {
1421
+ scrollLeft: 0,
1422
+ scrollTop: 0
1423
+ }, c = q(0);
1424
+ function l() {
1425
+ c.x = Ot(i);
1426
+ }
1427
+ if (r || !r && !a) if ((tt(t) !== "body" || at(i)) && (s = gt(t)), r) {
1428
+ let e = Dt(t, !0, a, t);
1429
+ c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
1430
+ } else i && l();
1431
+ a && !r && i && l();
1432
+ let u = i && !r && !a ? kt(i, s) : q(0);
1433
+ return {
1434
+ x: o.left + s.scrollLeft - c.x - u.x,
1435
+ y: o.top + s.scrollTop - c.y - u.y,
1436
+ width: o.width,
1437
+ height: o.height
1438
+ };
1439
+ }
1440
+ function Ht(e) {
1441
+ return Z(e).position === "static";
1442
+ }
1443
+ function Ut(e, t) {
1444
+ if (!rt(e) || Z(e).position === "fixed") return null;
1445
+ if (t) return t(e);
1446
+ let n = e.offsetParent;
1447
+ return Y(e) === n && (n = n.ownerDocument.body), n;
1448
+ }
1449
+ function Wt(e, t) {
1450
+ let n = J(e);
1451
+ if (st(e)) return n;
1452
+ if (!rt(e)) {
1453
+ let t = _t(e);
1454
+ for (; t && !ht(t);) {
1455
+ if (X(t) && !Ht(t)) return t;
1456
+ t = _t(t);
1457
+ }
1458
+ return n;
1459
+ }
1460
+ let r = Ut(e, t);
1461
+ for (; r && ot(r) && Ht(r);) r = Ut(r, t);
1462
+ return r && ht(r) && Ht(r) && !ft(r) ? n : r || pt(e) || n;
1463
+ }
1464
+ var Gt = async function(e) {
1465
+ let t = this.getOffsetParent || Wt, n = this.getDimensions, r = await n(e.floating);
1466
+ return {
1467
+ reference: Vt(e.reference, await t(e.floating), e.strategy),
1468
+ floating: {
1469
+ x: 0,
1470
+ y: 0,
1471
+ width: r.width,
1472
+ height: r.height
1473
+ }
1474
+ };
1475
+ };
1476
+ function Kt(e) {
1477
+ return Z(e).direction === "rtl";
1478
+ }
1479
+ var qt = {
1480
+ convertOffsetParentRelativeRectToViewportRelativeRect: At,
1481
+ getDocumentElement: Y,
1482
+ getClippingRect: zt,
1483
+ getOffsetParent: Wt,
1484
+ getElementRects: Gt,
1485
+ getClientRects: jt,
1486
+ getDimensions: Bt,
1487
+ getScale: Ct,
1488
+ isElement: X,
1489
+ isRTL: Kt
1490
+ };
1491
+ function Jt(e, t) {
1492
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1493
+ }
1494
+ function Yt(e, t) {
1495
+ let n = null, r, i = Y(e);
1496
+ function a() {
1497
+ var e;
1498
+ clearTimeout(r), (e = n) == null || e.disconnect(), n = null;
1499
+ }
1500
+ function o(s, c) {
1501
+ s === void 0 && (s = !1), c === void 0 && (c = 1), a();
1502
+ let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
1503
+ if (s || t(), !f || !p) return;
1504
+ let m = xe(d), h = xe(i.clientWidth - (u + f)), g = xe(i.clientHeight - (d + p)), _ = xe(u), v = {
1505
+ rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
1506
+ threshold: ye(0, ve(1, c)) || 1
1507
+ }, y = !0;
1508
+ function b(t) {
1509
+ let n = t[0].intersectionRatio;
1510
+ if (n !== c) {
1511
+ if (!y) return o();
1512
+ n ? o(!1, n) : r = setTimeout(() => {
1513
+ o(!1, 1e-7);
1514
+ }, 1e3);
1515
+ }
1516
+ n === 1 && !Jt(l, e.getBoundingClientRect()) && o(), y = !1;
1517
+ }
1518
+ try {
1519
+ n = new IntersectionObserver(b, {
1520
+ ...v,
1521
+ root: i.ownerDocument
1522
+ });
1523
+ } catch {
1524
+ n = new IntersectionObserver(b, v);
1525
+ }
1526
+ n.observe(e);
1527
+ }
1528
+ return o(!0), a;
1529
+ }
1530
+ function Xt(e, t, n, r) {
1531
+ r === void 0 && (r = {});
1532
+ let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = St(e), u = i || a ? [...l ? yt(l) : [], ...t ? yt(t) : []] : [];
1533
+ u.forEach((e) => {
1534
+ i && e.addEventListener("scroll", n, { passive: !0 }), a && e.addEventListener("resize", n);
1535
+ });
1536
+ let d = l && s ? Yt(l, n) : null, f = -1, p = null;
1537
+ o && (p = new ResizeObserver((e) => {
1538
+ let [r] = e;
1539
+ r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1540
+ var e;
1541
+ (e = p) == null || e.observe(t);
1542
+ })), n();
1543
+ }), l && !c && p.observe(l), t && p.observe(t));
1544
+ let m, h = c ? Dt(e) : null;
1545
+ c && g();
1546
+ function g() {
1547
+ let t = Dt(e);
1548
+ h && !Jt(h, t) && n(), h = t, m = requestAnimationFrame(g);
1549
+ }
1550
+ return n(), () => {
1551
+ var e;
1552
+ u.forEach((e) => {
1553
+ i && e.removeEventListener("scroll", n), a && e.removeEventListener("resize", n);
1554
+ }), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
1555
+ };
1556
+ }
1557
+ var Zt = Qe, Qt = $e, $t = Ye, en = Je, tn = (e, t, n) => {
1558
+ let r = /* @__PURE__ */ new Map(), i = {
1559
+ platform: qt,
1560
+ ...n
1561
+ }, a = {
1562
+ ...i.platform,
1563
+ _c: r
1564
+ };
1565
+ return qe(e, t, {
1566
+ ...i,
1567
+ platform: a
1568
+ });
1569
+ }, nn = "_trigger_e00wn_1", rn = "_content_e00wn_10", an = "_subTrigger_e00wn_61", on = "_itemMain_e00wn_90", sn = "_itemInset_e00wn_106", cn = "_shortcut_e00wn_118", ln = "_indicator_e00wn_119", un = "_submenuIndicator_e00wn_120", Q = {
1570
+ trigger: nn,
1571
+ content: rn,
1572
+ "owo-dropdown-menu-in": "_owo-dropdown-menu-in_e00wn_1",
1573
+ subTrigger: an,
1574
+ itemMain: on,
1575
+ itemInset: sn,
1576
+ shortcut: cn,
1577
+ indicator: ln,
1578
+ submenuIndicator: un
1579
+ }, dn = n(null), fn = n(null);
1580
+ function pn(e) {
1581
+ let t = a(dn);
1582
+ if (!t) throw Error(`${e} must be used within DropdownMenu.`);
1583
+ return t;
1584
+ }
1585
+ function mn(e) {
1586
+ let t = a(fn);
1587
+ if (!t) throw Error(`${e} must be used within DropdownMenu.Content.`);
1588
+ return t;
1589
+ }
1590
+ function hn(e, t) {
1591
+ return (n) => {
1592
+ e?.(n), t(n);
1593
+ };
1594
+ }
1595
+ function gn(...e) {
1596
+ return (t) => {
1597
+ for (let n of e) n && (typeof n == "function" ? n(t) : n.current = t);
1598
+ };
1599
+ }
1600
+ function _n(e) {
1601
+ return typeof e == "string" || typeof e == "number" ? String(e) : Array.isArray(e) ? e.map(_n).join(" ") : !e || typeof e == "boolean" ? "" : r(e) ? _n(e.props.children) : "";
1602
+ }
1603
+ function vn(e) {
1604
+ return [...e].sort((e, t) => {
1605
+ let n = e.ref.current, r = t.ref.current;
1606
+ if (!n || !r) return 0;
1607
+ let i = n.compareDocumentPosition(r);
1608
+ return i & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : i & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
1609
+ });
1610
+ }
1611
+ function yn(e, t) {
1612
+ return t === "center" ? e : `${e}-${t}`;
1613
+ }
1614
+ function bn(e) {
1615
+ let t = e.split("-");
1616
+ return {
1617
+ side: t[0],
1618
+ align: t[1] ?? "center"
1619
+ };
1620
+ }
1621
+ function xn({ open: e, defaultOpen: t = !1, onOpenChange: n, side: r = "bottom", align: o = "start", sideOffset: c = 8, alignOffset: f = 0, collisionPadding: m = 8, portal: h = !0, contentRole: g = "menu", classNames: _, children: v }) {
1622
+ let y = a(fn), [b, x] = d(t), S = e !== void 0, C = S ? e : b, w = u(null), T = u(null), E = u("selected"), D = s(), O = s(), k = i((e) => {
1623
+ S || x(e), n?.(e);
1624
+ }, [S, n]), A = i(() => {
1625
+ k(!1);
1626
+ }, [k]), j = i(() => {
1627
+ k(!1), y?.closeTree();
1628
+ }, [y, k]), M = i(() => {
1629
+ k(!C);
1630
+ }, [C, k]), N = i(() => {
1631
+ w.current?.focus();
1632
+ }, []), P = l(() => ({
1633
+ open: C,
1634
+ setOpen: k,
1635
+ toggleOpen: M,
1636
+ triggerRef: w,
1637
+ contentRef: T,
1638
+ side: r,
1639
+ align: o,
1640
+ sideOffset: c,
1641
+ alignOffset: f,
1642
+ collisionPadding: m,
1643
+ portal: h,
1644
+ contentRole: g,
1645
+ triggerId: D,
1646
+ contentId: O,
1647
+ focusIntentRef: E,
1648
+ parentList: y,
1649
+ isSubmenu: !!y,
1650
+ closeSelf: A,
1651
+ closeTree: j,
1652
+ focusTrigger: N,
1653
+ classNames: _
1654
+ }), [
1655
+ C,
1656
+ o,
1657
+ f,
1658
+ _,
1659
+ A,
1660
+ j,
1661
+ m,
1662
+ g,
1663
+ y,
1664
+ h,
1665
+ k,
1666
+ r,
1667
+ c,
1668
+ M,
1669
+ D,
1670
+ O,
1671
+ N
1672
+ ]);
1673
+ return /* @__PURE__ */ p(dn.Provider, {
1674
+ value: P,
1675
+ children: v
1676
+ });
1677
+ }
1678
+ function Sn({ asChild: n = !1, disabled: r = !1, className: i, children: a }) {
1679
+ let { open: o, setOpen: s, toggleOpen: c, triggerRef: l, contentRole: u, triggerId: d, contentId: f, focusIntentRef: m, isSubmenu: h, classNames: g } = pn("DropdownMenu.Trigger"), v = e.only(a), y = v.props ?? {}, b = typeof y.className == "string" ? y.className : void 0, x = {
1680
+ id: d,
1681
+ "data-state": o ? "open" : "closed",
1682
+ "aria-expanded": o,
1683
+ "aria-haspopup": u,
1684
+ "aria-controls": o ? f : void 0,
1685
+ onClick: hn(y.onClick, (e) => {
1686
+ if (r) {
1687
+ e.preventDefault();
1688
+ return;
1689
+ }
1690
+ m.current = "selected", c();
1691
+ }),
1692
+ onKeyDown: hn(y.onKeyDown, (e) => {
1693
+ r || (e.key === "ArrowDown" ? (e.preventDefault(), m.current = "first", s(!0)) : e.key === "ArrowUp" ? (e.preventDefault(), m.current = "last", s(!0)) : !h && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m.current = "selected", c()));
1694
+ })
1695
+ };
1696
+ return n ? t(v, {
1697
+ ...x,
1698
+ ref: gn(l, y.ref),
1699
+ className: _(Q.trigger, g?.trigger, i, b),
1700
+ type: v.type === "button" ? y.type ?? "button" : y.type
1701
+ }) : /* @__PURE__ */ p("button", {
1702
+ ref: l,
1703
+ disabled: r,
1704
+ type: "button",
1705
+ "data-scope": "dropdown-menu",
1706
+ "data-part": "trigger",
1707
+ className: _(Q.trigger, g?.trigger, i),
1708
+ ...x,
1709
+ children: v
1710
+ });
1711
+ }
1712
+ function Cn({ className: e, children: t, style: n, matchTriggerWidth: r = !1, maxHeight: a = 320, ...s }) {
1713
+ let { open: f, setOpen: m, triggerRef: g, contentRef: v, side: y, align: b, sideOffset: x, alignOffset: S, collisionPadding: C, portal: w, contentRole: T, triggerId: E, contentId: D, focusIntentRef: O, parentList: k, isSubmenu: A, closeSelf: j, closeTree: M, focusTrigger: N, classNames: P } = pn("DropdownMenu.Content"), F = u([]), [I, L] = d(null), [R, ee] = d(null), [z, B] = d(null), [V, H] = d(!1), U = u(""), W = u(null), te = i((e) => (F.current = [...F.current.filter((t) => t.id !== e.id), e], () => {
1714
+ F.current = F.current.filter((t) => t.id !== e.id);
1715
+ }), []), G = i(() => vn(F.current), []), ne = i((e) => {
1716
+ O.current = e;
1717
+ }, [O]);
1718
+ o(() => {
1719
+ H(!0);
1720
+ }, []);
1721
+ let re = l(() => ({
1722
+ role: T,
1723
+ highlightedId: I,
1724
+ setHighlightedId: L,
1725
+ registerItem: te,
1726
+ getItems: G,
1727
+ requestFocusIntent: ne,
1728
+ closeTree: M,
1729
+ closeSelf: j,
1730
+ focusTrigger: N,
1731
+ activeSubmenuId: R,
1732
+ setActiveSubmenuId: ee,
1733
+ contentRef: v
1734
+ }), [
1735
+ R,
1736
+ j,
1737
+ M,
1738
+ v,
1739
+ T,
1740
+ N,
1741
+ G,
1742
+ I,
1743
+ te,
1744
+ ne
1745
+ ]);
1746
+ c(() => {
1747
+ if (!(!f || !V || !g.current || !v.current)) return Xt(g.current, v.current, () => {
1748
+ !g.current || !v.current || tn(g.current, v.current, {
1749
+ placement: yn(y, b),
1750
+ strategy: "fixed",
1751
+ middleware: [
1752
+ Zt({
1753
+ mainAxis: x,
1754
+ crossAxis: S
1755
+ }),
1756
+ $t({ padding: C }),
1757
+ Qt({ padding: C })
1758
+ ]
1759
+ }).then(({ x: e, y: t, placement: n }) => {
1760
+ let r = bn(n);
1761
+ B({
1762
+ top: t,
1763
+ left: e,
1764
+ side: r.side,
1765
+ align: r.align
1766
+ });
1767
+ });
1768
+ });
1769
+ }, [
1770
+ b,
1771
+ S,
1772
+ C,
1773
+ v,
1774
+ V,
1775
+ f,
1776
+ y,
1777
+ x,
1778
+ g
1779
+ ]), o(() => {
1780
+ if (!f) {
1781
+ L(null), ee(null);
1782
+ return;
1783
+ }
1784
+ let e = G().filter((e) => !e.disabled);
1785
+ if (e.length === 0) return;
1786
+ let t = e[0];
1787
+ O.current === "last" ? t = e[e.length - 1] : O.current === "selected" && (t = e.find((e) => e.selected) ?? e[0]), L(t.id), requestAnimationFrame(() => {
1788
+ v.current?.focus(), t.ref.current?.scrollIntoView({ block: "nearest" });
1789
+ });
1790
+ }, [
1791
+ v,
1792
+ O,
1793
+ G,
1794
+ f
1795
+ ]), o(() => {
1796
+ if (!f) return;
1797
+ function e(e) {
1798
+ let t = e.target, n = g.current?.contains(t), r = v.current?.contains(t);
1799
+ if (!n && !r) {
1800
+ let e = k?.contentRef.current?.contains(t);
1801
+ if (A && e) {
1802
+ j(), k?.setActiveSubmenuId(null);
1803
+ return;
1804
+ }
1805
+ M();
1806
+ }
1807
+ }
1808
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
1809
+ }, [
1810
+ j,
1811
+ M,
1812
+ v,
1813
+ A,
1814
+ f,
1815
+ k,
1816
+ g
1817
+ ]), o(() => {
1818
+ if (f) return () => {
1819
+ W.current && clearTimeout(W.current);
1820
+ };
1821
+ }, [f]);
1822
+ let K = i((e) => {
1823
+ if (L(e), !e) {
1824
+ ee(null);
1825
+ return;
1826
+ }
1827
+ G().find((t) => t.id === e)?.submenu || ee(null);
1828
+ }, [G]), ie = i((e, t = "first") => {
1829
+ let n = G().filter((e) => !e.disabled);
1830
+ if (n.length === 0) return;
1831
+ let r = n.findIndex((e) => e.id === I);
1832
+ if (r === -1) {
1833
+ K(t === "last" ? n[n.length - 1].id : n[0].id);
1834
+ return;
1835
+ }
1836
+ let i = n[(r + e + n.length) % n.length];
1837
+ K(i.id), i.ref.current?.scrollIntoView({ block: "nearest" });
1838
+ }, [
1839
+ G,
1840
+ I,
1841
+ K
1842
+ ]), ae = i((e) => {
1843
+ let t = e.length === 1 ? e.toLowerCase() : "";
1844
+ if (!t) return;
1845
+ W.current && clearTimeout(W.current), U.current += t, W.current = setTimeout(() => {
1846
+ U.current = "", W.current = null;
1847
+ }, 350);
1848
+ let n = G().filter((e) => !e.disabled);
1849
+ if (n.length === 0) return;
1850
+ let r = n.findIndex((e) => e.id === I), i = (r >= 0 ? [...n.slice(r + 1), ...n.slice(0, r + 1)] : n).find((e) => e.textValue.toLowerCase().startsWith(U.current));
1851
+ i && (K(i.id), i.ref.current?.scrollIntoView({ block: "nearest" }));
1852
+ }, [
1853
+ G,
1854
+ I,
1855
+ K
1856
+ ]), oe = i((e) => {
1857
+ let t = G(), n = t.find((e) => e.id === I) ?? null;
1858
+ switch (e.key) {
1859
+ case "ArrowDown":
1860
+ e.preventDefault(), ie(1);
1861
+ break;
1862
+ case "ArrowUp":
1863
+ e.preventDefault(), ie(-1, "last");
1864
+ break;
1865
+ case "Home":
1866
+ e.preventDefault();
1867
+ {
1868
+ let e = t.find((e) => !e.disabled);
1869
+ e && K(e.id);
1870
+ }
1871
+ break;
1872
+ case "End":
1873
+ e.preventDefault();
1874
+ {
1875
+ let e = t.filter((e) => !e.disabled), n = e[e.length - 1];
1876
+ n && K(n.id);
1877
+ }
1878
+ break;
1879
+ case "Enter":
1880
+ case " ":
1881
+ n && !n.disabled && (e.preventDefault(), n.click());
1882
+ break;
1883
+ case "ArrowRight":
1884
+ n?.submenu && (e.preventDefault(), n.openSubmenu?.());
1885
+ break;
1886
+ case "ArrowLeft":
1887
+ A && (e.preventDefault(), j(), N(), k?.setActiveSubmenuId(null));
1888
+ break;
1889
+ case "Tab":
1890
+ M();
1891
+ break;
1892
+ case "Escape":
1893
+ e.preventDefault(), j(), N(), A && k?.setActiveSubmenuId(null);
1894
+ break;
1895
+ default: ae(e.key);
1896
+ }
1897
+ }, [
1898
+ j,
1899
+ M,
1900
+ N,
1901
+ G,
1902
+ ae,
1903
+ I,
1904
+ K,
1905
+ A,
1906
+ ie,
1907
+ k
1908
+ ]);
1909
+ if (!f || !V) return null;
1910
+ let se = /* @__PURE__ */ p(fn.Provider, {
1911
+ value: re,
1912
+ children: /* @__PURE__ */ p("div", {
1913
+ ref: v,
1914
+ id: D,
1915
+ role: T,
1916
+ tabIndex: -1,
1917
+ "aria-labelledby": T === "menu" ? E : void 0,
1918
+ "data-state": "open",
1919
+ "data-side": z?.side ?? y,
1920
+ "data-align": z?.align ?? b,
1921
+ "data-scope": "dropdown-menu",
1922
+ "data-part": "content",
1923
+ className: _(Q.content, P?.content, e),
1924
+ style: {
1925
+ ...n,
1926
+ position: "fixed",
1927
+ top: z?.top ?? 0,
1928
+ left: z?.left ?? 0,
1929
+ maxHeight: a,
1930
+ minWidth: r ? g.current?.getBoundingClientRect().width : void 0
1931
+ },
1932
+ onKeyDown: oe,
1933
+ ...s,
1934
+ children: t
1935
+ })
1936
+ });
1937
+ return w ? h(se, document.body) : se;
1938
+ }
1939
+ function wn({ className: e, children: t, ...n }) {
1940
+ let { classNames: r } = pn("DropdownMenu.Group");
1941
+ return /* @__PURE__ */ p("div", {
1942
+ "data-scope": "dropdown-menu",
1943
+ "data-part": "group",
1944
+ className: _(r?.group, e),
1945
+ ...n,
1946
+ children: t
1947
+ });
1948
+ }
1949
+ function Tn({ className: e, children: t, ...n }) {
1950
+ let { classNames: r } = pn("DropdownMenu.Label");
1951
+ return /* @__PURE__ */ p("div", {
1952
+ "data-scope": "dropdown-menu",
1953
+ "data-part": "label",
1954
+ className: _(r?.label, e),
1955
+ ...n,
1956
+ children: t
1957
+ });
1958
+ }
1959
+ function En({ className: e, ...t }) {
1960
+ let { classNames: n } = pn("DropdownMenu.Separator");
1961
+ return /* @__PURE__ */ p("div", {
1962
+ role: "separator",
1963
+ "data-scope": "dropdown-menu",
1964
+ "data-part": "separator",
1965
+ className: _(n?.separator, e),
1966
+ ...t
1967
+ });
1968
+ }
1969
+ function Dn({ className: e, children: t, inset: n = !1, disabled: r = !1, selected: a = !1, destructive: c = !1, closeOnSelect: d = !0, shortcut: f, indicator: h, onSelect: g, onMouseEnter: v, onClick: y, ...b }) {
1970
+ let x = s(), S = u(null), { role: C, highlightedId: w, setHighlightedId: T, registerItem: E, closeTree: D, setActiveSubmenuId: O } = mn("DropdownMenu.Item"), { classNames: k } = pn("DropdownMenu.Item"), A = l(() => _n(t), [t]), j = w === x, M = i(() => {
1971
+ r || (g?.(), d && D());
1972
+ }, [
1973
+ d,
1974
+ D,
1975
+ r,
1976
+ g
1977
+ ]);
1978
+ return o(() => E({
1979
+ id: x,
1980
+ ref: S,
1981
+ disabled: r,
1982
+ submenu: !1,
1983
+ selected: a,
1984
+ textValue: A,
1985
+ closeOnSelect: d,
1986
+ click: M
1987
+ }), [
1988
+ d,
1989
+ r,
1990
+ M,
1991
+ x,
1992
+ E,
1993
+ a,
1994
+ A
1995
+ ]), /* @__PURE__ */ m("button", {
1996
+ ref: S,
1997
+ id: x,
1998
+ type: "button",
1999
+ role: C === "listbox" ? "option" : "menuitem",
2000
+ tabIndex: -1,
2001
+ disabled: r,
2002
+ "aria-selected": C === "listbox" ? a : void 0,
2003
+ "data-highlighted": j || void 0,
2004
+ "data-selected": a || void 0,
2005
+ "data-disabled": r || void 0,
2006
+ "data-destructive": c || void 0,
2007
+ "data-scope": "dropdown-menu",
2008
+ "data-part": "item",
2009
+ className: _(n && Q.itemInset, k?.item, e),
2010
+ onMouseEnter: hn(v, () => {
2011
+ r || (T(x), O(null));
2012
+ }),
2013
+ onClick: hn(y, (e) => {
2014
+ e.preventDefault(), M();
2015
+ }),
2016
+ ...b,
2017
+ children: [
2018
+ /* @__PURE__ */ p("span", {
2019
+ className: Q.itemMain,
2020
+ children: t
2021
+ }),
2022
+ f ? /* @__PURE__ */ p("span", {
2023
+ className: Q.shortcut,
2024
+ children: f
2025
+ }) : null,
2026
+ a ? /* @__PURE__ */ p("span", {
2027
+ className: Q.indicator,
2028
+ children: h ?? "✓"
2029
+ }) : null
2030
+ ]
2031
+ });
2032
+ }
2033
+ function On(e) {
2034
+ return /* @__PURE__ */ p(xn, {
2035
+ side: "right",
2036
+ align: "start",
2037
+ sideOffset: 6,
2038
+ ...e,
2039
+ contentRole: "menu"
2040
+ });
2041
+ }
2042
+ function kn({ className: e, children: t, inset: n = !1, disabled: r = !1, destructive: a = !1, shortcut: c, onSelect: d, onMouseEnter: f, onClick: h, ...g }) {
2043
+ let v = s(), y = u(null), b = pn("DropdownMenu.SubTrigger"), { highlightedId: x, setHighlightedId: S, registerItem: C, setActiveSubmenuId: w, activeSubmenuId: T } = mn("DropdownMenu.SubTrigger"), E = l(() => _n(t), [t]), D = x === v, O = b.open && T === v, k = i(() => {
2044
+ r || (b.focusIntentRef.current = "first", S(v), w(v), b.setOpen(!0));
2045
+ }, [
2046
+ r,
2047
+ v,
2048
+ w,
2049
+ S,
2050
+ b
2051
+ ]);
2052
+ return o(() => C({
2053
+ id: v,
2054
+ ref: y,
2055
+ disabled: r,
2056
+ submenu: !0,
2057
+ selected: !1,
2058
+ textValue: E,
2059
+ closeOnSelect: !1,
2060
+ click: k,
2061
+ openSubmenu: k
2062
+ }), [
2063
+ r,
2064
+ v,
2065
+ k,
2066
+ C,
2067
+ E
2068
+ ]), o(() => {
2069
+ T !== v && b.open && b.setOpen(!1);
2070
+ }, [
2071
+ T,
2072
+ v,
2073
+ b
2074
+ ]), /* @__PURE__ */ m("button", {
2075
+ ref: gn(y, b.triggerRef),
2076
+ id: b.triggerId,
2077
+ type: "button",
2078
+ role: "menuitem",
2079
+ tabIndex: -1,
2080
+ "aria-haspopup": "menu",
2081
+ "aria-expanded": b.open,
2082
+ "aria-controls": b.open ? b.contentId : void 0,
2083
+ "data-highlighted": D || void 0,
2084
+ "data-state": O ? "open" : "closed",
2085
+ "data-disabled": r || void 0,
2086
+ "data-destructive": a || void 0,
2087
+ className: _(Q.subTrigger, n && Q.itemInset, e),
2088
+ onMouseEnter: hn(f, () => {
2089
+ k();
2090
+ }),
2091
+ onClick: hn(h, (e) => {
2092
+ e.preventDefault(), k(), d?.();
2093
+ }),
2094
+ ...g,
2095
+ children: [
2096
+ /* @__PURE__ */ p("span", {
2097
+ className: Q.itemMain,
2098
+ children: t
2099
+ }),
2100
+ c ? /* @__PURE__ */ p("span", {
2101
+ className: Q.shortcut,
2102
+ children: c
2103
+ }) : null,
2104
+ /* @__PURE__ */ p("span", {
2105
+ className: Q.submenuIndicator,
2106
+ "aria-hidden": "true",
2107
+ children: "›"
2108
+ })
2109
+ ]
2110
+ });
2111
+ }
2112
+ var An = Object.assign(xn, {
2113
+ Trigger: Sn,
2114
+ Content: Cn,
2115
+ Group: wn,
2116
+ Label: Tn,
2117
+ Item: Dn,
2118
+ Separator: En,
2119
+ Submenu: On,
2120
+ SubTrigger: kn
2121
+ }), jn = {
2122
+ panel: "_panel_7f715_1",
2123
+ backdrop: "_backdrop_7f715_55"
2124
+ };
2125
+ //#endregion
2126
+ //#region src/components/Drawer.tsx
2127
+ function Mn({ as: e = "aside", open: t, children: n, side: r = "right", position: i = "fixed", showBackdrop: a = !0, onClose: o, closeLabel: s = "关闭抽屉", backdropClassName: c, className: l, classNames: u, ...d }) {
2128
+ return /* @__PURE__ */ m(f, { children: [a && t && o && /* @__PURE__ */ p("button", {
2129
+ type: "button",
2130
+ "aria-label": s,
2131
+ "data-state": "open",
2132
+ "data-scope": "drawer",
2133
+ "data-part": "backdrop",
2134
+ "data-position": i,
2135
+ className: _("owo-drawer-backdrop", jn.backdrop, c, u?.backdrop),
2136
+ onClick: o
2137
+ }), /* @__PURE__ */ p(e, {
2138
+ "aria-hidden": !t,
2139
+ "data-state": t ? "open" : "closed",
2140
+ "data-side": r,
2141
+ "data-position": i,
2142
+ "data-scope": "drawer",
2143
+ "data-part": "panel",
2144
+ className: _("owo-drawer", jn.panel, l, u?.panel),
2145
+ ...d,
2146
+ children: n
2147
+ })] });
2148
+ }
2149
+ var Nn = {
2150
+ root: "_root_38gc5_1",
2151
+ label: "_label_38gc5_10",
2152
+ required: "_required_38gc5_18",
2153
+ description: "_description_38gc5_23",
2154
+ error: "_error_38gc5_31",
2155
+ help: "_help_38gc5_39"
2156
+ };
2157
+ //#endregion
2158
+ //#region src/components/Field.tsx
2159
+ function Pn({ label: e, description: t, error: n, help: r, required: i = !1, disabled: a = !1, invalid: o = !1, htmlFor: c, children: u, className: d, classNames: f, ...h }) {
2160
+ let g = s(), v = c ?? g, y = `${v}-label`, b = t ? `${v}-description` : void 0, x = n ? `${v}-error` : void 0, S = r ? `${v}-help` : void 0, C = [
2161
+ b,
2162
+ x,
2163
+ S
2164
+ ].filter(Boolean).join(" ") || void 0, w = l(() => ({
2165
+ controlId: v,
2166
+ labelId: y,
2167
+ describedBy: C,
2168
+ disabled: a,
2169
+ invalid: o,
2170
+ required: i
2171
+ }), [
2172
+ v,
2173
+ y,
2174
+ C,
2175
+ a,
2176
+ o,
2177
+ i
2178
+ ]);
2179
+ return /* @__PURE__ */ m("div", {
2180
+ className: _("owo-field", Nn.root, d),
2181
+ "data-disabled": a || void 0,
2182
+ "data-invalid": o || void 0,
2183
+ "data-required": i || void 0,
2184
+ ...h,
2185
+ children: [
2186
+ /* @__PURE__ */ m("label", {
2187
+ id: y,
2188
+ htmlFor: v,
2189
+ "data-part": "label",
2190
+ className: _(Nn.label, f?.label),
2191
+ children: [e, i && /* @__PURE__ */ p("span", {
2192
+ "data-part": "required",
2193
+ "aria-hidden": "true",
2194
+ className: _(Nn.required, f?.required),
2195
+ children: "*"
2196
+ })]
2197
+ }),
2198
+ t != null && /* @__PURE__ */ p("span", {
2199
+ id: b,
2200
+ "data-part": "description",
2201
+ className: _(Nn.description, f?.description),
2202
+ children: t
2203
+ }),
2204
+ /* @__PURE__ */ p(ee.Provider, {
2205
+ value: w,
2206
+ children: u
2207
+ }),
2208
+ n != null && /* @__PURE__ */ p("span", {
2209
+ id: x,
2210
+ "data-part": "error",
2211
+ role: "alert",
2212
+ className: _(Nn.error, f?.error),
2213
+ children: n
2214
+ }),
2215
+ r != null && /* @__PURE__ */ p("span", {
2216
+ id: S,
2217
+ "data-part": "help",
2218
+ className: _(Nn.help, f?.help),
2219
+ children: r
2220
+ })
2221
+ ]
2222
+ });
2223
+ }
2224
+ var Fn = { root: "_root_1hqa8_1" };
2225
+ //#endregion
2226
+ //#region src/components/IconButton.tsx
2227
+ function In({ variant: e = "ghost", size: t = "md", label: n, icon: r, className: i, ...a }) {
2228
+ let o = _("owo-icon-button", Fn.root, i);
2229
+ if ("href" in a && a.href) {
2230
+ let { href: i, ...s } = a;
2231
+ return /* @__PURE__ */ p("a", {
2232
+ href: i,
2233
+ "aria-label": n,
2234
+ title: s.title ?? n,
2235
+ "data-variant": e,
2236
+ "data-size": t,
2237
+ className: o,
2238
+ ...s,
2239
+ children: r
2240
+ });
2241
+ }
2242
+ let s = a;
2243
+ return /* @__PURE__ */ p("button", {
2244
+ type: s.type ?? "button",
2245
+ "aria-label": n,
2246
+ title: s.title ?? n,
2247
+ "data-variant": e,
2248
+ "data-size": t,
2249
+ className: o,
2250
+ ...s,
2251
+ children: r
2252
+ });
2253
+ }
2254
+ var Ln = { root: "_root_8zge1_1" };
2255
+ //#endregion
2256
+ //#region src/components/Input.tsx
2257
+ function Rn({ className: e, tone: t = "default", size: n = "md", invalid: r, ...i }) {
2258
+ let a = B({
2259
+ id: i.id,
2260
+ disabled: i.disabled,
2261
+ required: i.required,
2262
+ invalid: r,
2263
+ "aria-describedby": i["aria-describedby"]
2264
+ });
2265
+ return /* @__PURE__ */ p("input", {
2266
+ ...i,
2267
+ id: a.id,
2268
+ disabled: a.disabled,
2269
+ required: a.required,
2270
+ "aria-describedby": a["aria-describedby"],
2271
+ "aria-invalid": a.invalid || void 0,
2272
+ "data-tone": t,
2273
+ "data-size": n,
2274
+ "data-invalid": a.invalid || void 0,
2275
+ className: _("owo-input", Ln.root, e)
2276
+ });
2277
+ }
2278
+ var zn = { root: "_root_1226l_1" };
2279
+ //#endregion
2280
+ //#region src/components/Panel.tsx
2281
+ function Bn({ as: e = "section", variant: t = "default", padding: n = "none", className: r, children: i, ...a }) {
2282
+ return /* @__PURE__ */ p(e, {
2283
+ "data-variant": t,
2284
+ "data-padding": n === "none" ? void 0 : n,
2285
+ "data-scope": "panel",
2286
+ className: _("owo-panel", zn.root, r),
2287
+ ...a,
2288
+ children: i
2289
+ });
2290
+ }
2291
+ function Vn({ className: e, children: t, ...n }) {
2292
+ return /* @__PURE__ */ p("div", {
2293
+ "data-scope": "panel",
2294
+ "data-part": "header",
2295
+ className: _(e),
2296
+ ...n,
2297
+ children: t
2298
+ });
2299
+ }
2300
+ function Hn({ className: e, children: t, ...n }) {
2301
+ return /* @__PURE__ */ p("div", {
2302
+ "data-scope": "panel",
2303
+ "data-part": "body",
2304
+ className: _(e),
2305
+ ...n,
2306
+ children: t
2307
+ });
2308
+ }
2309
+ function Un({ className: e, children: t, ...n }) {
2310
+ return /* @__PURE__ */ p("div", {
2311
+ "data-scope": "panel",
2312
+ "data-part": "footer",
2313
+ className: _(e),
2314
+ ...n,
2315
+ children: t
2316
+ });
2317
+ }
2318
+ var Wn = {
2319
+ root: "_root_c2l0v_1",
2320
+ item: "_item_c2l0v_41"
2321
+ };
2322
+ //#endregion
2323
+ //#region src/components/SegmentedControl.tsx
2324
+ function Gn({ value: e, defaultValue: t, onValueChange: n, options: r, size: i = "md", disabled: a, required: o, invalid: s, id: c, name: l, className: d, ariaLabel: f, "aria-describedby": h }) {
2325
+ let g = z(), [v, y] = V({
2326
+ value: e,
2327
+ defaultValue: t,
2328
+ onChange: n,
2329
+ fallback: r.find((e) => !e.disabled)?.value ?? r[0]?.value ?? ""
2330
+ }), b = B({
2331
+ id: c,
2332
+ disabled: a,
2333
+ required: o,
2334
+ invalid: s,
2335
+ "aria-describedby": h
2336
+ }), x = u([]), S = r.reduce((e, t, n) => (!t.disabled && !b.disabled && e.push(n), e), []), C = r.findIndex((e) => e.value === v), w = C >= 0 ? C : S[0] ?? -1;
2337
+ function T(e, t) {
2338
+ if (S.length === 0) return;
2339
+ let n = S.indexOf(e), i;
2340
+ t === "first" && (i = S[0]), t === "last" && (i = S[S.length - 1]), t === "next" && (i = n >= 0 ? S[(n + 1) % S.length] : S[0]), t === "prev" && (i = n >= 0 ? S[(n - 1 + S.length) % S.length] : S[S.length - 1]), i !== void 0 && (y(r[i].value), x.current[i]?.focus());
2341
+ }
2342
+ return /* @__PURE__ */ m("div", {
2343
+ role: "radiogroup",
2344
+ id: b.id,
2345
+ "aria-label": f,
2346
+ "aria-labelledby": f ? void 0 : g?.labelId,
2347
+ "aria-describedby": b["aria-describedby"],
2348
+ "aria-invalid": b.invalid || void 0,
2349
+ "aria-required": b.required || void 0,
2350
+ "data-size": i,
2351
+ "data-disabled": b.disabled || void 0,
2352
+ "data-invalid": b.invalid || void 0,
2353
+ className: _("owo-segmented-control", Wn.root, d),
2354
+ children: [r.map((e, t) => {
2355
+ let n = e.value === v, r = e.disabled || b.disabled;
2356
+ return /* @__PURE__ */ p("button", {
2357
+ ref: (e) => {
2358
+ x.current[t] = e;
2359
+ },
2360
+ type: "button",
2361
+ role: "radio",
2362
+ "aria-checked": n,
2363
+ disabled: r,
2364
+ tabIndex: r ? -1 : t === w ? 0 : -1,
2365
+ "data-disabled": r || void 0,
2366
+ "data-active": n ? "true" : void 0,
2367
+ className: Wn.item,
2368
+ onClick: () => y(e.value),
2369
+ onKeyDown: (e) => {
2370
+ if (!r) switch (e.key) {
2371
+ case "ArrowRight":
2372
+ case "ArrowDown":
2373
+ e.preventDefault(), T(t, "next");
2374
+ break;
2375
+ case "ArrowLeft":
2376
+ case "ArrowUp":
2377
+ e.preventDefault(), T(t, "prev");
2378
+ break;
2379
+ case "Home":
2380
+ e.preventDefault(), T(t, "first");
2381
+ break;
2382
+ case "End":
2383
+ e.preventDefault(), T(t, "last");
2384
+ break;
2385
+ }
2386
+ },
2387
+ children: e.label
2388
+ }, e.value);
2389
+ }), l != null && /* @__PURE__ */ p("input", {
2390
+ type: "hidden",
2391
+ name: l,
2392
+ value: v,
2393
+ disabled: b.disabled,
2394
+ "aria-hidden": "true"
2395
+ })]
2396
+ });
2397
+ }
2398
+ var Kn = {
2399
+ root: "_root_1kzdq_1",
2400
+ valueText: "_valueText_1kzdq_96",
2401
+ placeholder: "_placeholder_1kzdq_102"
2402
+ };
2403
+ //#endregion
2404
+ //#region src/components/Select.tsx
2405
+ function qn(e) {
2406
+ return e.textValue ? e.textValue : typeof e.label == "string" ? e.label : "";
2407
+ }
2408
+ function Jn({ value: e, defaultValue: t, onValueChange: n, options: r, placeholder: a = "Select…", size: c = "md", tone: f = "default", disabled: h, required: g, invalid: v, id: y, name: b, className: x, ariaLabel: S, "aria-describedby": C, renderValue: w, renderOption: T, classNames: E }) {
2409
+ let [D, O] = V({
2410
+ value: e,
2411
+ defaultValue: t,
2412
+ onChange: (e) => {
2413
+ e !== "" && n?.(e);
2414
+ },
2415
+ fallback: ""
2416
+ }), k = B({
2417
+ id: y,
2418
+ disabled: h,
2419
+ required: g,
2420
+ invalid: v,
2421
+ "aria-describedby": C
2422
+ }), A = k.disabled, [j, M] = d(!1), [N, P] = d(-1), F = u(null), I = u(null), L = s(), R = r.find((e) => e.value === D), ee = R ? qn(R) : "", z = l(() => r.reduce((e, t, n) => (t.disabled || e.push(n), e), []), [r]), H = i(() => {
2423
+ if (A || r.length === 0) return;
2424
+ M(!0);
2425
+ let e = r.findIndex((e) => e.value === D);
2426
+ P(e >= 0 ? e : z[0] ?? -1);
2427
+ }, [
2428
+ A,
2429
+ r,
2430
+ D,
2431
+ z
2432
+ ]), U = i(() => {
2433
+ M(!1), P(-1);
2434
+ }, []), W = i((e) => {
2435
+ e.disabled || (O(e.value), U());
2436
+ }, [O, U]);
2437
+ o(() => {
2438
+ if (!j) return;
2439
+ function e(e) {
2440
+ F.current && !F.current.contains(e.target) && U();
2441
+ }
2442
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2443
+ }, [j, U]), o(() => {
2444
+ !j || N < 0 || (I.current?.children[N])?.scrollIntoView?.({ block: "nearest" });
2445
+ }, [j, N]);
2446
+ function te(e) {
2447
+ if (!A) switch (e.key) {
2448
+ case "Enter":
2449
+ case " ":
2450
+ e.preventDefault(), j ? N >= 0 && r[N] && !r[N].disabled && W(r[N]) : H();
2451
+ break;
2452
+ case "ArrowDown":
2453
+ if (e.preventDefault(), !j) H();
2454
+ else {
2455
+ let e = z[z.indexOf(N) + 1];
2456
+ e !== void 0 && P(e);
2457
+ }
2458
+ break;
2459
+ case "ArrowUp":
2460
+ if (e.preventDefault(), !j) H();
2461
+ else {
2462
+ let e = z[z.indexOf(N) - 1];
2463
+ e !== void 0 && P(e);
2464
+ }
2465
+ break;
2466
+ case "Escape":
2467
+ j && (e.preventDefault(), U());
2468
+ break;
2469
+ case "Tab":
2470
+ j && U();
2471
+ break;
2472
+ }
2473
+ }
2474
+ let G = D !== "" && R, ne = G ? R.label : null, re = w ? w({
2475
+ open: j,
2476
+ placeholder: a,
2477
+ selectedOption: R
2478
+ }) : /* @__PURE__ */ p("span", {
2479
+ className: _(Kn.valueText, !G && Kn.placeholder),
2480
+ children: G ? ne : a
2481
+ });
2482
+ return /* @__PURE__ */ m("div", {
2483
+ ref: F,
2484
+ "data-state": j ? "open" : "closed",
2485
+ "data-disabled": A || void 0,
2486
+ "data-invalid": k.invalid || void 0,
2487
+ "data-size": c,
2488
+ "data-tone": f,
2489
+ "data-scope": "select",
2490
+ className: _("owo-select", Kn.root, x),
2491
+ children: [
2492
+ /* @__PURE__ */ m("button", {
2493
+ type: "button",
2494
+ role: "combobox",
2495
+ id: k.id,
2496
+ "aria-expanded": j,
2497
+ "aria-haspopup": "listbox",
2498
+ "aria-controls": L,
2499
+ "aria-label": S,
2500
+ "aria-describedby": k["aria-describedby"],
2501
+ "aria-invalid": k.invalid || void 0,
2502
+ "aria-required": k.required || void 0,
2503
+ "aria-activedescendant": j && N >= 0 ? `${L}-opt-${N}` : void 0,
2504
+ "data-state": j ? "open" : "closed",
2505
+ "data-disabled": A || void 0,
2506
+ "data-tone": f,
2507
+ "data-size": c,
2508
+ "data-has-value": G || void 0,
2509
+ "data-scope": "select",
2510
+ "data-part": "trigger",
2511
+ disabled: A,
2512
+ className: _(E?.trigger),
2513
+ onClick: () => j ? U() : H(),
2514
+ onKeyDown: te,
2515
+ children: [re, /* @__PURE__ */ p("svg", {
2516
+ "aria-hidden": "true",
2517
+ "data-state": j ? "open" : "closed",
2518
+ "data-scope": "select",
2519
+ "data-part": "chevron",
2520
+ className: _(E?.chevron),
2521
+ viewBox: "0 0 16 16",
2522
+ fill: "none",
2523
+ stroke: "currentColor",
2524
+ strokeWidth: "2",
2525
+ strokeLinecap: "round",
2526
+ strokeLinejoin: "round",
2527
+ children: /* @__PURE__ */ p("path", { d: "M4 6l4 4 4-4" })
2528
+ })]
2529
+ }),
2530
+ j && /* @__PURE__ */ p("ul", {
2531
+ ref: I,
2532
+ id: L,
2533
+ role: "listbox",
2534
+ "aria-label": S ?? (ee || a),
2535
+ "data-state": "open",
2536
+ "data-size": c,
2537
+ "data-scope": "select",
2538
+ "data-part": "dropdown",
2539
+ className: _(E?.dropdown),
2540
+ children: r.map((e, t) => /* @__PURE__ */ p("li", {
2541
+ id: `${L}-opt-${t}`,
2542
+ role: "option",
2543
+ "aria-selected": e.value === D,
2544
+ "aria-disabled": e.disabled || void 0,
2545
+ "data-state": e.value === D ? "selected" : t === N ? "highlighted" : "idle",
2546
+ "data-focused": t === N || void 0,
2547
+ "data-selected": e.value === D || void 0,
2548
+ "data-disabled": e.disabled || void 0,
2549
+ "data-highlighted": t === N || void 0,
2550
+ "data-scope": "select",
2551
+ "data-part": "option",
2552
+ className: _(E?.option),
2553
+ onClick: () => W(e),
2554
+ onMouseEnter: () => !e.disabled && P(t),
2555
+ children: T ? T({
2556
+ option: e,
2557
+ index: t,
2558
+ selected: e.value === D,
2559
+ highlighted: t === N
2560
+ }) : e.label
2561
+ }, e.value))
2562
+ }),
2563
+ b != null && /* @__PURE__ */ p("input", {
2564
+ type: "hidden",
2565
+ name: b,
2566
+ value: D,
2567
+ disabled: A,
2568
+ "aria-hidden": "true"
2569
+ })
2570
+ ]
2571
+ });
2572
+ }
2573
+ var Yn = {
2574
+ root: "_root_1sshx_1",
2575
+ "owo-skeleton-breathe": "_owo-skeleton-breathe_1sshx_1",
2576
+ "owo-skeleton-scan": "_owo-skeleton-scan_1sshx_1"
2577
+ }, Xn = {
2578
+ slow: "4s",
2579
+ medium: "3s",
2580
+ fast: "2s"
2581
+ };
2582
+ function Zn({ className: e, animation: t = "scan", tone: n = "default", speed: r = "medium", style: i, ...a }) {
2583
+ let o = n === "warm" ? "emphasis" : n, s = {
2584
+ ...i,
2585
+ "--_owo-skeleton-scan-duration": Xn[r]
2586
+ };
2587
+ return /* @__PURE__ */ p("div", {
2588
+ className: _("owo-skeleton", Yn.root, e),
2589
+ "data-animation": t,
2590
+ "data-tone": o,
2591
+ "aria-hidden": "true",
2592
+ style: s,
2593
+ ...a
2594
+ });
2595
+ }
2596
+ var $ = {
2597
+ root: "_root_h4455_1",
2598
+ withIcon: "_withIcon_h4455_19",
2599
+ icon: "_icon_h4455_25",
2600
+ text: "_text_h4455_36",
2601
+ title: "_title_h4455_40",
2602
+ body: "_body_h4455_50",
2603
+ action: "_action_h4455_68"
2604
+ };
2605
+ //#endregion
2606
+ //#region src/components/StatusNotice.tsx
2607
+ function Qn({ tone: e = "neutral", layout: t = "horizontal", icon: n, title: r, description: i, action: a, className: o, children: s, classNames: c, ...l }) {
2608
+ if (t === "vertical") {
2609
+ let t = n || r || i || a;
2610
+ return /* @__PURE__ */ p("div", {
2611
+ "data-tone": e,
2612
+ "data-layout": "vertical",
2613
+ className: _("owo-status-notice", $.root, o),
2614
+ ...l,
2615
+ children: /* @__PURE__ */ p("div", {
2616
+ "data-part": "body",
2617
+ className: _($.body, c?.body),
2618
+ children: t ? /* @__PURE__ */ m(f, { children: [
2619
+ n ? /* @__PURE__ */ p("div", {
2620
+ "data-part": "icon",
2621
+ className: _($.icon, c?.icon),
2622
+ children: n
2623
+ }) : null,
2624
+ r ? /* @__PURE__ */ p("div", {
2625
+ "data-part": "title",
2626
+ className: _($.title, c?.title),
2627
+ children: r
2628
+ }) : null,
2629
+ i ? /* @__PURE__ */ p("div", { children: i }) : s,
2630
+ a ? /* @__PURE__ */ p("div", {
2631
+ "data-part": "action",
2632
+ className: _($.action, c?.action),
2633
+ children: a
2634
+ }) : null
2635
+ ] }) : s
2636
+ })
2637
+ });
2638
+ }
2639
+ return /* @__PURE__ */ m("div", {
2640
+ "data-tone": e,
2641
+ className: _("owo-status-notice", $.root, n && $.withIcon, o),
2642
+ ...l,
2643
+ children: [n ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
2644
+ "data-part": "icon",
2645
+ className: _($.icon, c?.icon),
2646
+ "aria-hidden": "true",
2647
+ children: n
2648
+ }), /* @__PURE__ */ m("div", {
2649
+ "data-part": "body",
2650
+ className: _($.text, c?.body),
2651
+ children: [r ? /* @__PURE__ */ p("div", {
2652
+ "data-part": "title",
2653
+ className: _($.title, c?.title),
2654
+ children: r
2655
+ }) : null, s]
2656
+ })] }) : /* @__PURE__ */ m("div", {
2657
+ "data-part": "body",
2658
+ className: _(c?.body),
2659
+ children: [r ? /* @__PURE__ */ p("div", {
2660
+ "data-part": "title",
2661
+ className: _($.title, c?.title),
2662
+ children: r
2663
+ }) : null, s]
2664
+ }), a ? /* @__PURE__ */ p("div", {
2665
+ "data-part": "action",
2666
+ className: _($.action, c?.action),
2667
+ children: a
2668
+ }) : null]
2669
+ });
2670
+ }
2671
+ var $n = {
2672
+ root: "_root_91dlh_1",
2673
+ thumb: "_thumb_91dlh_81"
2674
+ };
2675
+ //#endregion
2676
+ //#region src/components/Switch.tsx
2677
+ function er({ checked: e, defaultChecked: t, onCheckedChange: n, size: r = "md", disabled: i, required: a, invalid: o, id: s, name: c, className: l, ariaLabel: u, "aria-describedby": d }) {
2678
+ let [f, h] = V({
2679
+ value: e,
2680
+ defaultValue: t,
2681
+ onChange: n,
2682
+ fallback: !1
2683
+ }), g = B({
2684
+ id: s,
2685
+ disabled: i,
2686
+ required: a,
2687
+ invalid: o,
2688
+ "aria-describedby": d
2689
+ });
2690
+ return /* @__PURE__ */ m("button", {
2691
+ type: "button",
2692
+ role: "switch",
2693
+ id: g.id,
2694
+ "aria-checked": f,
2695
+ "aria-label": u,
2696
+ "aria-describedby": g["aria-describedby"],
2697
+ "aria-invalid": g.invalid || void 0,
2698
+ "aria-required": g.required || void 0,
2699
+ disabled: g.disabled,
2700
+ "data-size": r,
2701
+ "data-invalid": g.invalid || void 0,
2702
+ className: _("owo-switch", $n.root, l),
2703
+ onClick: () => h(!f),
2704
+ children: [/* @__PURE__ */ p("span", {
2705
+ "aria-hidden": "true",
2706
+ className: $n.thumb
2707
+ }), c != null && /* @__PURE__ */ p("input", {
2708
+ type: "checkbox",
2709
+ name: c,
2710
+ checked: f,
2711
+ disabled: g.disabled,
2712
+ hidden: !0,
2713
+ readOnly: !0,
2714
+ tabIndex: -1,
2715
+ "aria-hidden": "true"
2716
+ })]
2717
+ });
2718
+ }
2719
+ var tr = { root: "_root_1dxq8_1" }, nr = n(null);
2720
+ function rr(e) {
2721
+ let t = a(nr);
2722
+ if (!t) throw Error(`${e} must be used within Tabs.Root`);
2723
+ return t;
2724
+ }
2725
+ function ir(e) {
2726
+ return e.replace(/[^a-zA-Z0-9_-]+/g, "-");
2727
+ }
2728
+ function ar({ children: e, value: t, defaultValue: n, onValueChange: r, className: i, ...a }) {
2729
+ let [o, c] = V({
2730
+ value: t,
2731
+ defaultValue: n,
2732
+ onChange: r,
2733
+ fallback: ""
2734
+ }), u = s(), d = l(() => ({
2735
+ value: o,
2736
+ setValue: c,
2737
+ baseId: u
2738
+ }), [
2739
+ u,
2740
+ o,
2741
+ c
2742
+ ]);
2743
+ return /* @__PURE__ */ p(nr.Provider, {
2744
+ value: d,
2745
+ children: /* @__PURE__ */ p("div", {
2746
+ "data-scope": "tabs",
2747
+ className: _("owo-tabs", tr.root, i),
2748
+ ...a,
2749
+ children: e
2750
+ })
2751
+ });
2752
+ }
2753
+ function or({ children: e, className: t, ariaLabel: n, ...r }) {
2754
+ return /* @__PURE__ */ p("div", {
2755
+ role: "tablist",
2756
+ "aria-label": n,
2757
+ "data-scope": "tabs",
2758
+ "data-part": "list",
2759
+ className: _(t),
2760
+ ...r,
2761
+ children: e
2762
+ });
2763
+ }
2764
+ function sr({ children: e, className: t, value: n, disabled: r, onClick: i, onKeyDown: a, ...o }) {
2765
+ let { value: s, setValue: c, baseId: l } = rr("Tabs.Trigger"), u = s === n, d = `${l}-trigger-${ir(n)}`, f = `${l}-panel-${ir(n)}`;
2766
+ function m(e, t) {
2767
+ let n = e.closest("[role=\"tablist\"]");
2768
+ if (!n) return;
2769
+ let r = Array.from(n.querySelectorAll("[role=\"tab\"]:not([disabled])")), i = r.indexOf(e);
2770
+ if (i < 0) return;
2771
+ let a;
2772
+ t === "first" && (a = r[0]), t === "last" && (a = r[r.length - 1]), t === "next" && (a = r[(i + 1) % r.length]), t === "prev" && (a = r[(i - 1 + r.length) % r.length]), a && (a.focus(), a.click());
2773
+ }
2774
+ return /* @__PURE__ */ p("button", {
2775
+ type: "button",
2776
+ id: d,
2777
+ role: "tab",
2778
+ "aria-selected": u,
2779
+ "aria-controls": f,
2780
+ tabIndex: u ? 0 : -1,
2781
+ "data-state": u ? "active" : "inactive",
2782
+ "data-scope": "tabs",
2783
+ "data-part": "trigger",
2784
+ disabled: r,
2785
+ className: _(t),
2786
+ onClick: (e) => {
2787
+ i?.(e), !e.defaultPrevented && !r && c(n);
2788
+ },
2789
+ onKeyDown: (e) => {
2790
+ if (a?.(e), e.defaultPrevented || r) return;
2791
+ let t = e.currentTarget;
2792
+ switch (e.key) {
2793
+ case "ArrowRight":
2794
+ e.preventDefault(), m(t, "next");
2795
+ break;
2796
+ case "ArrowLeft":
2797
+ e.preventDefault(), m(t, "prev");
2798
+ break;
2799
+ case "Home":
2800
+ e.preventDefault(), m(t, "first");
2801
+ break;
2802
+ case "End":
2803
+ e.preventDefault(), m(t, "last");
2804
+ break;
2805
+ }
2806
+ },
2807
+ ...o,
2808
+ children: e
2809
+ });
2810
+ }
2811
+ function cr({ children: e, className: t, value: n, ...r }) {
2812
+ let { value: i, baseId: a } = rr("Tabs.Content"), o = i === n, s = `${a}-trigger-${ir(n)}`, c = `${a}-panel-${ir(n)}`;
2813
+ return o ? /* @__PURE__ */ p("div", {
2814
+ id: c,
2815
+ role: "tabpanel",
2816
+ "aria-labelledby": s,
2817
+ "data-state": "active",
2818
+ "data-scope": "tabs",
2819
+ "data-part": "content",
2820
+ className: _(t),
2821
+ ...r,
2822
+ children: e
2823
+ }) : null;
2824
+ }
2825
+ var lr = Object.assign(ar, {
2826
+ Root: ar,
2827
+ List: or,
2828
+ Trigger: sr,
2829
+ Content: cr
2830
+ }), ur = { root: "_root_17j1y_1" };
2831
+ //#endregion
2832
+ //#region src/components/Textarea.tsx
2833
+ function dr({ className: e, tone: t = "default", size: n = "md", resize: r = "vertical", autoResize: a = !1, invalid: s, style: c, onInput: l, rows: d = 3, ...f }) {
2834
+ let m = B({
2835
+ id: f.id,
2836
+ disabled: f.disabled,
2837
+ required: f.required,
2838
+ invalid: s,
2839
+ "aria-describedby": f["aria-describedby"]
2840
+ }), h = u(null), g = l, v = i(() => {
2841
+ if (!a || !h.current) return;
2842
+ let e = h.current;
2843
+ e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
2844
+ }, [a]);
2845
+ o(() => {
2846
+ v();
2847
+ }, [
2848
+ v,
2849
+ f.value,
2850
+ f.defaultValue,
2851
+ d
2852
+ ]);
2853
+ function y(e) {
2854
+ v(), g?.(e);
2855
+ }
2856
+ let b = {
2857
+ ...c,
2858
+ resize: a ? "none" : r
2859
+ };
2860
+ return /* @__PURE__ */ p("textarea", {
2861
+ ...f,
2862
+ ref: h,
2863
+ id: m.id,
2864
+ disabled: m.disabled,
2865
+ required: m.required,
2866
+ "aria-describedby": m["aria-describedby"],
2867
+ "aria-invalid": m.invalid || void 0,
2868
+ rows: d,
2869
+ "data-tone": t,
2870
+ "data-size": n,
2871
+ "data-invalid": m.invalid || void 0,
2872
+ "data-auto-resize": a || void 0,
2873
+ className: _("owo-input", Ln.root, "owo-textarea", ur.root, e),
2874
+ style: b,
2875
+ onInput: y
2876
+ });
2877
+ }
2878
+ //#endregion
2879
+ //#region src/styles/ui/toast.module.css
2880
+ var fr = "_container_73rls_1", pr = "_toast_73rls_12", mr = "_toastDefault_73rls_32", hr = {
2881
+ container: fr,
2882
+ toast: pr,
2883
+ "toast-in": "_toast-in_73rls_1",
2884
+ toastDefault: mr
2885
+ }, gr = n(null), _r = 5, vr = 4e3;
2886
+ function yr() {
2887
+ let e = a(gr);
2888
+ if (!e) throw Error("useToast must be used within <ToastProvider>");
2889
+ return e;
2890
+ }
2891
+ function br({ tone: e }) {
2892
+ let t = {
2893
+ width: 16,
2894
+ height: 16,
2895
+ viewBox: "0 0 16 16",
2896
+ fill: "none",
2897
+ stroke: "currentColor",
2898
+ strokeWidth: 2,
2899
+ strokeLinecap: "round",
2900
+ strokeLinejoin: "round"
2901
+ };
2902
+ switch (e) {
2903
+ case "success": return /* @__PURE__ */ p("svg", {
2904
+ ...t,
2905
+ children: /* @__PURE__ */ p("path", { d: "M3.5 8.5l3 3 6-7" })
2906
+ });
2907
+ case "warning": return /* @__PURE__ */ m("svg", {
2908
+ ...t,
2909
+ children: [/* @__PURE__ */ p("path", { d: "M8 5v4" }), /* @__PURE__ */ p("circle", {
2910
+ cx: "8",
2911
+ cy: "11.5",
2912
+ r: "0.5",
2913
+ fill: "currentColor",
2914
+ stroke: "none"
2915
+ })]
2916
+ });
2917
+ case "danger": return /* @__PURE__ */ p("svg", {
2918
+ ...t,
2919
+ children: /* @__PURE__ */ p("path", { d: "M4.5 4.5l7 7M11.5 4.5l-7 7" })
2920
+ });
2921
+ case "info": return /* @__PURE__ */ m("svg", {
2922
+ ...t,
2923
+ children: [/* @__PURE__ */ p("circle", {
2924
+ cx: "8",
2925
+ cy: "3.5",
2926
+ r: "1.2",
2927
+ fill: "currentColor",
2928
+ stroke: "none"
2929
+ }), /* @__PURE__ */ p("path", { d: "M8 7v5.5" })]
2930
+ });
2931
+ }
2932
+ }
2933
+ function xr(e, t) {
2934
+ return typeof e == "string" ? {
2935
+ message: e,
2936
+ duration: t ?? vr
2937
+ } : {
2938
+ title: e.title,
2939
+ message: e.message,
2940
+ duration: e.duration ?? t ?? vr
2941
+ };
2942
+ }
2943
+ function Sr({ item: e, onDismiss: t, renderToast: n, classNames: r }) {
2944
+ let i = () => t(e.id), a = /* @__PURE__ */ p(br, { tone: e.tone });
2945
+ return n ? /* @__PURE__ */ p("div", {
2946
+ role: "status",
2947
+ "aria-live": "polite",
2948
+ "data-state": "open",
2949
+ "data-tone": e.tone,
2950
+ "data-scope": "toast",
2951
+ "data-part": "toast",
2952
+ className: _("owo-toast", hr.toast, r?.toast),
2953
+ children: n({
2954
+ item: e,
2955
+ dismiss: i,
2956
+ icon: a
2957
+ })
2958
+ }) : /* @__PURE__ */ m("div", {
2959
+ role: "status",
2960
+ "aria-live": "polite",
2961
+ "data-state": "open",
2962
+ "data-tone": e.tone,
2963
+ "data-scope": "toast",
2964
+ "data-part": "toast",
2965
+ className: _("owo-toast", hr.toast, hr.toastDefault, r?.toast),
2966
+ children: [
2967
+ /* @__PURE__ */ p("span", {
2968
+ "data-scope": "toast",
2969
+ "data-part": "icon",
2970
+ className: _(r?.icon),
2971
+ "aria-hidden": "true",
2972
+ children: a
2973
+ }),
2974
+ /* @__PURE__ */ m("span", {
2975
+ "data-scope": "toast",
2976
+ "data-part": "content",
2977
+ className: _(r?.content),
2978
+ children: [e.title ? /* @__PURE__ */ p("span", {
2979
+ "data-scope": "toast",
2980
+ "data-part": "title",
2981
+ className: _(r?.title),
2982
+ children: e.title
2983
+ }) : null, /* @__PURE__ */ p("span", {
2984
+ "data-scope": "toast",
2985
+ "data-part": "message",
2986
+ className: _(r?.message),
2987
+ children: e.message
2988
+ })]
2989
+ }),
2990
+ /* @__PURE__ */ p("button", {
2991
+ type: "button",
2992
+ onClick: i,
2993
+ "data-scope": "toast",
2994
+ "data-part": "close",
2995
+ className: _(r?.close),
2996
+ "aria-label": "Dismiss",
2997
+ children: /* @__PURE__ */ p("svg", {
2998
+ width: "14",
2999
+ height: "14",
3000
+ viewBox: "0 0 16 16",
3001
+ fill: "none",
3002
+ stroke: "currentColor",
3003
+ strokeWidth: "2",
3004
+ strokeLinecap: "round",
3005
+ children: /* @__PURE__ */ p("path", { d: "M4 4l8 8M12 4l-8 8" })
3006
+ })
3007
+ })
3008
+ ]
3009
+ });
3010
+ }
3011
+ function Cr({ children: e, renderToast: t, classNames: n }) {
3012
+ let [r, a] = d([]), o = u(0), s = u(/* @__PURE__ */ new Map()), c = i((e) => {
3013
+ let t = s.current.get(e);
3014
+ t && clearTimeout(t), s.current.delete(e), a((t) => t.filter((t) => t.id !== e));
3015
+ }, []), f = i((e, t, n) => {
3016
+ let r = o.current++, i = {
3017
+ id: r,
3018
+ tone: e,
3019
+ ...xr(t, n)
3020
+ };
3021
+ a((e) => {
3022
+ let t = [...e, i];
3023
+ if (t.length > _r) {
3024
+ let e = t.slice(0, t.length - _r);
3025
+ for (let t of e) {
3026
+ let e = s.current.get(t.id);
3027
+ e && clearTimeout(e), s.current.delete(t.id);
3028
+ }
3029
+ return t.slice(-_r);
3030
+ }
3031
+ return t;
3032
+ }), i.duration > 0 && s.current.set(r, setTimeout(() => c(r), i.duration));
3033
+ }, [c]), h = l(() => ({
3034
+ success: (e, t) => f("success", e, t),
3035
+ warning: (e, t) => f("warning", e, t),
3036
+ danger: (e, t) => f("danger", e, t),
3037
+ info: (e, t) => f("info", e, t)
3038
+ }), [f]);
3039
+ return /* @__PURE__ */ m(gr.Provider, {
3040
+ value: h,
3041
+ children: [e, /* @__PURE__ */ p("div", {
3042
+ "aria-label": "Notifications",
3043
+ "data-state": r.length > 0 ? "open" : "closed",
3044
+ "data-scope": "toast",
3045
+ "data-part": "container",
3046
+ className: _("owo-toast-container", hr.container, n?.container),
3047
+ children: r.map((e) => /* @__PURE__ */ p(Sr, {
3048
+ item: e,
3049
+ onDismiss: c,
3050
+ renderToast: t,
3051
+ classNames: n
3052
+ }, e.id))
3053
+ })]
3054
+ });
3055
+ }
3056
+ var wr = {
3057
+ trigger: "_trigger_xunrw_1",
3058
+ content: "_content_xunrw_5",
3059
+ "tooltip-in": "_tooltip-in_xunrw_1"
3060
+ }, Tr = 6, Er = 8, Dr = 4;
3061
+ function Or(e) {
3062
+ return e.split("-")[0];
3063
+ }
3064
+ var kr = {
3065
+ top: "",
3066
+ bottom: "rotate(180deg)",
3067
+ left: "rotate(-90deg)",
3068
+ right: "rotate(90deg)"
3069
+ };
3070
+ function Ar({ content: e, placement: t = "top", density: n = "default", showDelay: r = 300, hideDelay: a = 150, arrow: l = !0, renderArrow: g, className: v, children: y, classNames: b }) {
3071
+ let [x, S] = d(!1), [C, w] = d(null), [T, E] = d(t), [D, O] = d({}), k = u(null), A = u(null), j = u(null), M = u(void 0), N = u(void 0), P = s(), F = i(() => {
3072
+ clearTimeout(M.current), clearTimeout(N.current);
3073
+ }, []), I = i(() => {
3074
+ F(), M.current = setTimeout(() => S(!0), r);
3075
+ }, [F, r]), L = i(() => {
3076
+ F(), S(!0);
3077
+ }, [F]), R = i(() => {
3078
+ F(), N.current = setTimeout(() => S(!1), a);
3079
+ }, [F, a]), ee = i((e) => {
3080
+ if (e.target === k.current) {
3081
+ I();
3082
+ return;
3083
+ }
3084
+ L();
3085
+ }, [I, L]), z = i((e) => {
3086
+ e.pointerType !== "mouse" && L();
3087
+ }, [L]), B = i((e) => {
3088
+ e.key === "Escape" && x && S(!1);
3089
+ }, [x]);
3090
+ c(() => {
3091
+ if (!x || !k.current || !A.current) return;
3092
+ let e = [
3093
+ Zt(l ? Er + Tr : Er),
3094
+ $t({ padding: Dr }),
3095
+ Qt({ padding: Dr })
3096
+ ];
3097
+ return l && j.current && e.push(en({ element: j.current })), Xt(k.current, A.current, () => {
3098
+ !k.current || !A.current || tn(k.current, A.current, {
3099
+ placement: t,
3100
+ strategy: "fixed",
3101
+ middleware: e
3102
+ }).then(({ x: e, y: t, placement: n, middlewareData: r }) => {
3103
+ w({
3104
+ top: t,
3105
+ left: e
3106
+ }), E(Or(n)), r.arrow && O({
3107
+ x: r.arrow.x,
3108
+ y: r.arrow.y
3109
+ });
3110
+ });
3111
+ });
3112
+ }, [
3113
+ x,
3114
+ t,
3115
+ l
3116
+ ]), o(() => {
3117
+ if (x) return document.addEventListener("keydown", B), () => document.removeEventListener("keydown", B);
3118
+ }, [x, B]), o(() => F, [F]);
3119
+ let V = { position: "absolute" }, H = T;
3120
+ return H === "top" || H === "bottom" ? (V.left = D.x ?? 0, V[H === "top" ? "bottom" : "top"] = -Tr, V.transform = kr[H] || void 0) : (V.top = D.y ?? 0, V[H === "left" ? "right" : "left"] = -Tr, V.transform = kr[H]), /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("span", {
3121
+ ref: k,
3122
+ "data-state": x ? "open" : "closed",
3123
+ "data-scope": "tooltip",
3124
+ "data-part": "trigger",
3125
+ className: _("owo-tooltip-trigger", wr.trigger, b?.trigger),
3126
+ onMouseEnter: I,
3127
+ onMouseLeave: R,
3128
+ onFocus: ee,
3129
+ onBlur: R,
3130
+ onPointerDown: z,
3131
+ "aria-describedby": x ? P : void 0,
3132
+ children: y
3133
+ }), x && h(/* @__PURE__ */ m("div", {
3134
+ ref: A,
3135
+ id: P,
3136
+ role: "tooltip",
3137
+ "data-state": x ? "open" : "closed",
3138
+ "data-placement": T,
3139
+ "data-density": n,
3140
+ "data-scope": "tooltip",
3141
+ "data-part": "content",
3142
+ className: _("owo-tooltip", wr.content, b?.content, v),
3143
+ style: C ? {
3144
+ top: C.top,
3145
+ left: C.left
3146
+ } : { visibility: "hidden" },
3147
+ onMouseEnter: I,
3148
+ onMouseLeave: R,
3149
+ children: [e, l && /* @__PURE__ */ p("span", {
3150
+ ref: j,
3151
+ "data-scope": "tooltip",
3152
+ "data-part": "arrow",
3153
+ className: _(b?.arrow),
3154
+ style: V,
3155
+ children: g ? g({ placement: T }) : /* @__PURE__ */ p("svg", {
3156
+ width: Tr * 2,
3157
+ height: Tr,
3158
+ viewBox: "0 0 12 6",
3159
+ children: /* @__PURE__ */ p("path", {
3160
+ d: "M0 0l6 6 6-6z",
3161
+ fill: "currentColor"
3162
+ })
3163
+ })
3164
+ })]
3165
+ }), document.body)] });
3166
+ }
3167
+ //#endregion
3168
+ export { b as Avatar, S as Badge, R as Button, U as Checkbox, ae as Collapsible, ie as CollapsibleContent, re as CollapsibleRoot, K as CollapsibleTrigger, _e as ConfirmProvider, me as Dialog, Mn as Drawer, An as DropdownMenu, Pn as Field, In as IconButton, Rn as Input, Bn as Panel, Hn as PanelBody, Un as PanelFooter, Vn as PanelHeader, Gn as SegmentedControl, Jn as Select, Zn as Skeleton, F as Spinner, Qn as StatusNotice, er as Switch, lr as Tabs, cr as TabsContent, or as TabsList, ar as TabsRoot, sr as TabsTrigger, dr as Textarea, Cr as ToastProvider, Ar as Tooltip, L as buttonClassName, ge as useConfirm, yr as useToast };