plainframe-ui 0.1.43 → 0.1.44
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.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,7 +10,7 @@ ${h}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),m()
|
|
|
10
10
|
0% { left: -200%; right: 100%; }
|
|
11
11
|
60% { left: 107%; right: -8%; }
|
|
12
12
|
100% { left: 107%; right: -8%; }
|
|
13
|
-
`,_c=e=>e.startsWith("#")||e.startsWith("rgb(")||e.startsWith("rgba(")||e.startsWith("hsl(")||e.startsWith("hsla(")||e.startsWith("oklch(")||e.startsWith("lab(")||e.startsWith("color(")||e.startsWith("var("),jc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Vc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(_c(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],s=o[2]&&jc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let a=e.palette[r];if(a&&a[s]!=null)return a[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var no=me.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:d,"aria-label":y})=>{let f=V(),T=typeof t=="number",I=Math.max(o-n,1),x=T?qa(t,n,o):void 0,R=T?(x-n)/I*100:void 0,g=Vc(f,r),p=f.surface.subtleBg,m=f.radius?.md;return e==="circular"?jsx(qc,{size:s,active:g,isDeterminate:T,percent:R,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:d,ariaLabel:y,thickness:a}):jsx(Uc,{thickness:a,active:g,track:p,radius:m,isDeterminate:T,percent:R,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:y,min:n,max:o,value:x})}),Uc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:d,value:y})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),I=css([{position:"relative",width:"100%",height:ns(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),x=r?Math.max(s??0,Ua):Ua,R=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${x/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),g={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},p=css([{...g,left:"-35%",right:"100%",animation:`${Wc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),m=css([{...g,left:"-200%",right:"100%",animation:`${Kc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":y}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:I,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:R}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:p}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:m})]})})})},qc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=V(),d=40,y=(d-t)/2,f=2*Math.PI*y,I=`${(o?qa((r??0)/100,.01,1):.7)*f} ${f}`,x=css([{display:"inline-block",width:ns(e,`${u.componentHeights.md}`),height:ns(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),R=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),g=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:I,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${Oc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),p=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(p["aria-label"]=l),jsx("span",{css:x,className:"plainframe-ui-progress-circular",...p,children:jsx("svg",{css:R,viewBox:`0 0 ${d} ${d}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:d/2,cy:d/2,r:y,strokeWidth:t,css:g})})})};var Ya=createContext(null),Ja=()=>{let e=useContext(Ya);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},ou=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),ru=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),su=css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:"pointer",lineHeight:0,transition:"opacity 140ms ease","&:disabled":{cursor:"not-allowed",opacity:.5}}),Za=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:c="md",loading:i=false,css:l,children:u,...d},y){let f=V(),T=useId(),I=useId(),x=useMemo(()=>{let F={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?F[c]:F.md},[c,f.typography,f.radius,f.spacing]),R=f.palette??{},g=f.neutral??{},p=useMemo(()=>{let M=(E=>E==="danger"?R.danger??R.error??g:E==="warning"?R.warning??g:E==="success"?R.success??g:E==="info"?R.info??R.primary??g:g)(t),b=M?.[50]??g[50],h=M?.[300]??g[300],A=M?.[600]??M?.[500]??g[600],D=M?.[700]??A,L=M?.[800]??f.text?.primary??"#000",k=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:A,fg:k,border:void 0,iconColor:k}:n==="outlined"?{bg:b,fg:L,border:`1px solid ${h}`,iconColor:L}:n==="ghost"?{bg:"transparent",fg:D,border:"none",iconColor:D}:{bg:b,fg:L,border:void 0,iconColor:D}},[t,n,g,R,f.text]),m=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(no,{variant:"circular",color:p.iconColor,size:x.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):jsx(Info,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor})),[i,o,t,x.iconSize,p.iconColor]),P=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${x.paddingY} ${x.paddingX}`,gap:x.gap,borderRadius:x.radius,backgroundColor:p.bg,color:p.fg,border:p.border,fontSize:x.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[p.bg,p.border,p.fg,x.fontSize,x.gap,x.paddingX,x.paddingY,x.radius,a]),w=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:x.gap,minWidth:0,flex:1}),[x.gap]),v=useMemo(()=>[ru,{color:p.iconColor}],[p.iconColor]),N=useMemo(()=>css({display:"flex",alignItems:"center",gap:x.gap,marginLeft:x.gap,flex:"0 0 auto"}),[x.gap]),B=useMemo(()=>[su,{color:p.fg}],[p.fg]),K=useMemo(()=>({fg:p.fg,iconColor:p.iconColor,s:x,titleId:T,descId:I}),[p.fg,p.iconColor,x,T,I]),O=me.Children.toArray(u).some(F=>me.isValidElement(F)&&F.type===ss),S=me.Children.toArray(u).some(F=>me.isValidElement(F)&&F.type===as);return jsx(Ya.Provider,{value:K,children:jsxs("div",{ref:y,role:m,"aria-live":m==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":O?T:void 0,"aria-describedby":S?I:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[P,l],...d,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:w,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:v,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:ou,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:N,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:B,children:r??jsx(X,{strokeWidth:2,size:x.iconSize-2})})})]})})});Za.displayName="Alert";var ss=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=Ja(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});ss.displayName="AlertTitle";var as=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Ja(),c=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:a,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});as.displayName="AlertDescription";var is=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gt=e=>e==null?[]:Array.isArray(e)?e:[e],Xt=(...e)=>css(e.filter(Boolean));function ei(e,t,n="currentColor"){if(!isValidElement(e))return e;let o=e.props,r={};o.size==null&&(r.size=t),o.color==null&&(r.color=n);let s=o.style;return s?.fontSize==null&&(r.style={...s||{},fontSize:t}),cloneElement(e,{...o,...r})}var Qo=me.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:d="md",variant:y="subtle",rounded:f=false,startIcon:T,endIcon:I,togglePasswordVisible:x=false,showClear:R,type:g="text",step:p,focusRingMode:m="always",className:C,wrapperCss:P,inputCss:w,labelCss:v,helperRowCss:N,helperTextCss:B,startIconCss:K,endIconCss:O,css:S,onBlur:F,onFocus:M,onKeyDown:b,autoFocus:h,name:A,id:D,tabIndex:L,autoComplete:k,readOnly:E,required:W,maxLength:$,onSurfaceClick:z},_){let H=V(),U=Yo(),X$1=useId(),ae=useMemo(()=>{let ce={sm:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.sm,labelFont:H.typography.sizes.xs,helperFont:H.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:21},md:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.md,labelFont:H.typography.sizes.sm,helperFont:H.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:24},lg:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.lg,labelFont:H.typography.sizes.md,helperFont:H.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:28}},ke=["sm","md","lg"].includes(d)?d:"md";return ce[ke]},[d,H]),q=H.neutral,Y=H.text,le=g==="number",ie=g==="password",be=n!==void 0,[Pe,Re]=useState(o),Ce=be?n:Pe,Ie=useCallback(ce=>{be||Re(ce),r?.(ce);},[be,r]),Te=/^-?\d*(?:[.,]\d*)?$/,we=le&&(p!=null&&String(p).includes(".")||/[.,]/.test(Ce??"")),he=le?we?"decimal":"numeric":void 0,je=le?we?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Z=useCallback(ce=>{(ce===""||Te.test(ce))&&Ie(ce);},[Ie]),Ee=i?q[200]:a&&y==="outlined"?H.palette.danger?.[50]??H.surface.panelBg:a&&y==="subtle"?H.palette.danger?.[50]??H.surface.subtleBg:y==="outlined"?H.surface.panelBg:y==="subtle"?H.surface.subtleBg:"transparent",Q=H.componentHeights.border,ee=y==="outlined"?`${Q} solid ${a?H.palette.danger?.[300]??H.surface.border:H.surface.border}`:"none",se=Xt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?is(u):void 0,flex:"0 0 auto",fontWeight:500}),pe=useMemo(()=>Xt({fontSize:ae.labelFont,fontWeight:500,color:a?H.palette.danger?.[700]??Y.primary:i?q[500]:Y.primary,marginBottom:4,display:"inline-block"},...Gt(v)),[ae.labelFont,a,i,q,Y,H.palette.danger,v]),Se=useMemo(()=>Xt({display:"flex",alignItems:"center",gap:H.spacing.sm,padding:`${is(ae.paddingY)} ${is(ae.paddingX)}`,background:Ee,border:ee,borderRadius:f?H.radius.full:H.radius.md,minHeight:ae.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Gt(P),...Gt(S)),[H,ae.minHeight,ae.paddingX,ae.paddingY,Ee,ee,f,i,P,S]),Ne=useMemo(()=>Xt({flex:1,minWidth:0,fontSize:ae.fontSize,fontWeight:500,fontFamily:"inherit",color:i?q[500]:a?H.palette.danger?.[800]??Y.primary:Y.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:a?H.palette.danger?.[700]??Y.secondary:Y.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?H.palette.danger?.[800]??Y.primary:Y.primary} !important`,boxShadow:`0 0 0 1000px ${Ee} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?H.palette.danger?.[800]??Y.primary:Y.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Gt(w)),[ae.fontSize,i,q,Y,a,H.palette.danger,le,Ee,w]),J=useMemo(()=>Xt({display:"inline-flex",alignItems:"center",color:a?H.palette.danger?.[800]??Y.secondary:Y.secondary,marginLeft:-3},...Gt(K)),[a,H.palette.danger,Y.secondary,K]),oe=useMemo(()=>Xt({display:"inline-flex",alignItems:"center",color:a?H.palette.danger?.[800]??Y.secondary:Y.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Gt(O)),[a,H.palette.danger,Y.secondary,i,O]),re=useMemo(()=>Xt({minHeight:16,fontSize:ae.helperFont,color:a?H.palette.danger?.[700]??Y.secondary:Y.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Gt(N)),[ae.helperFont,a,H.palette.danger,Y.secondary,N]),qe=useMemo(()=>Xt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Gt(B)),[B]),j=useRef(null),ue=useCallback(ce=>{j.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),de=useCallback(ce=>{let ke=ce.target.value;if(le){Z(ke);return}$&&ke.length>$||Ie(ke);},[le,$,Ie,Z]),[fe,ze]=useState(false),Oe=useCallback(()=>{i||ze(ce=>!ce);},[i]),st=useCallback(()=>{i||(Ie(""),j.current?.focus());},[i,Ie]),Ye=useMemo(()=>{let ce=ae.fontSize;if(typeof ce=="number")return ce;let ke=parseFloat(String(ce));return Number.isFinite(ke)?ke:16},[ae.fontSize]),yt=useMemo(()=>T?jsx("span",{css:J,children:ei(T,Ye)}):null,[T,J,Ye]),tn=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),nn=useMemo(()=>{let ce=[];if(ie&&x){let bt=fe?jsx(Eye,{strokeWidth:2.5,size:Ye}):jsx(EyeOff,{strokeWidth:2.5,size:Ye});ce.push(jsx("button",{type:"button",css:oe,onMouseDown:Zn=>Zn.preventDefault(),onClick:Zn=>{Zn.stopPropagation(),Oe();},tabIndex:-1,"aria-label":fe?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}R&&Ce&&Ce.length>0&&!i&&ce.push(jsx("button",{type:"button",css:oe,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),st();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:Ye})},"clear"));let ke=I?jsx("span",{css:oe,children:ei(I,Ye)},"user-end"):null,at=ce.length>0,De=!!ke;return !at&&!De?null:!at&&De?ke:at&&!De?ce.length===1?ce[0]:jsx("span",{css:tn,children:ce}):jsxs("span",{css:tn,children:[ce,ke]})},[ie,x,fe,Ye,oe,tn,i,R,Ce,I,Oe,st]),Sn=c!=null?`${D??X$1}-help`:void 0,on=D??X$1,Je=useCallback(ce=>{if(i)return;ce.stopPropagation();let ke=j.current;if(!ke)return;let at=ce.target;if(!(ke.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===ke){ce.preventDefault();return}ce.preventDefault();}},[i]),xt=useCallback(ce=>{if(i)return;let ke=j.current;if(ke&&(z?.(ce),document.activeElement!==ke)){ke.focus({preventScroll:true});try{let at=ke.value?.length??0;ke.setSelectionRange?.(at,at);}catch{}}},[i,z]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:se,children:[t&&jsx("label",{htmlFor:on,className:"plainframe-ui-textfield-label",css:pe,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:m!=="none",color:a?"danger":void 0}),Se],onPointerDownCapture:Je,onClick:xt,"aria-invalid":!!a||void 0,children:[yt,jsx("input",{ref:ue,id:on,className:"plainframe-ui-textfield-input",css:Ne,type:ie?fe?"text":"password":g==="number"?"text":g,inputMode:he,pattern:je,value:Ce,maxLength:le?void 0:$,onChange:le?ce=>Z(ce.target.value):de,placeholder:s||"",disabled:i,onBlur:F,onFocus:M,onKeyDown:b,autoFocus:h,name:A,tabIndex:L,autoComplete:k,readOnly:E,required:W,"aria-invalid":!!a||void 0,"aria-describedby":Sn}),nn]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:re,children:jsx("span",{id:Sn,className:"plainframe-ui-textfield-helper-text",css:qe,children:c})})]})}));Qo.displayName="TextField";var er=me.createContext("ghost"),Tt=me.createContext(false),si=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:l,allItemsTabbable:u=false,...d},y){let f=V(),[T,I]=useState(false),x=useRef(null),R=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),g=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",p=s?void 0:css({background:g,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":R,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),m=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:I}),[T]),P=useMemo(()=>({allItemsTabbable:u}),[u]),w=useCallback(M=>Array.from(M.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(b=>{if(b.closest('[role="menu"]')!==M)return false;let h=window.getComputedStyle(b);return h.display!=="none"&&h.visibility!=="hidden"}),[]),v=useCallback(M=>{M.removeAttribute("data-keyboard-nav"),M.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),I(false);},[]),N=useRef(false),B=useCallback(M=>{if(M.target!==M.currentTarget)return;if(N.current){N.current=false;return}let b=M.currentTarget,h=w(b);h.length>0&&(I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(A=>A.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(A=>A.removeAttribute("data-hovered")),h[0].setAttribute("data-highlighted",""),h[0].focus({preventScroll:true}));},[w]),K=useCallback(M=>{let b=M.currentTarget,h=w(b);if(h.length===0)return;if(M.key==="Tab"){N.current=true,b.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),I(false),b.tabIndex=-1,requestAnimationFrame(()=>{b.tabIndex=0,N.current=false;});return}let A=b.querySelector("[data-highlighted]"),D=b.querySelector("[data-hovered]"),L=A||D,k=L?h.indexOf(L):-1;if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach($=>$.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach($=>$.removeAttribute("data-hovered")),k===-1&&(k=M.key==="ArrowDown"?-1:h.length);let E=M.key==="ArrowDown"?1:-1,W=(k+E+h.length)%h.length;h[W].setAttribute("data-highlighted",""),h[W].focus({preventScroll:true});return}if(M.key==="Home"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(E=>E.removeAttribute("data-hovered")),h[0].setAttribute("data-highlighted",""),h[0].focus({preventScroll:true});return}if(M.key==="End"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(E=>E.removeAttribute("data-hovered")),h[h.length-1].setAttribute("data-highlighted",""),h[h.length-1].focus({preventScroll:true});return}if(M.key==="Escape"){M.preventDefault(),b.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),I(false),b.blur();return}},[w]),O=useCallback(M=>{let b=M.currentTarget;b.hasAttribute("data-keyboard-nav")&&v(b);},[v]),S=useCallback(M=>{let b=M.currentTarget;b.hasAttribute("data-keyboard-nav")&&v(b);},[v]),F=useCallback(M=>{x.current=M,typeof y=="function"?y(M):y&&(y.current=M);},[y]);return jsx(oo.Provider,{value:C,children:jsx(ro.Provider,{value:P,children:jsx(Tt.Provider,{value:m,children:jsx(er.Provider,{value:t,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:f.spacing.sm,width:"100%",maxWidth:o},children:[l?jsx("div",{css:{width:"100%",textAlign:"left"},children:jsx("span",{css:{display:"block",color:f.text.secondary,fontSize:f.typography.sizes.xs,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof f.spacing.sm=="number"?`${f.spacing.sm}px`:f.spacing.sm,paddingTop:0},children:l})}):null,jsx("div",{ref:F,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[p,c],onFocus:B,onKeyDown:K,onPointerMove:O,onPointerDown:S,...d,children:i})]})})})})})});si.displayName="Menu";var ii=createContext(null),or=()=>{let e=useContext(ii);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function Du(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)Du(n,t);},cs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Hu=e=>{useEffect(()=>{if(!e||typeof document>"u"||typeof window>"u")return;let t=document.body,n=t.style.overflow,o=t.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth,s=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${s+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},tr=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"&&t&&e in t){let n=t[e];return typeof n=="number"?`${n}px`:String(n)}return e}},Lu=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=x=>{e===void 0&&i(x),n?.(x);},d=useRef(null),y=useRef(null),f=(x=120)=>{y.current!=null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>u(false),x);},T=()=>{y.current!=null&&(window.clearTimeout(y.current),y.current=null);};Hu(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let x=R=>{if(R.key!=="Tab")return;let g=document.querySelector(".plainframe-ui-popover");if(!g)return;let p=Array.from(g.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});if(p.length===0)return;let m=p[0],C=p[p.length-1],P=document.activeElement;R.shiftKey&&P===m?(R.preventDefault(),C.focus()):!R.shiftKey&&P===C&&(R.preventDefault(),m.focus());};return document.addEventListener("keydown",x,true),()=>document.removeEventListener("keydown",x,true)},[s,l]);let I=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:d,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ii.Provider,{value:I,children:a})},li=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:a,referenceRef:c,scheduleClose:i,cancelClose:l}=or(),u=me.Children.only(t),d=u.props||{},y=io(c,o,u.ref),f=a==="click"?{onClick:I=>{I.stopPropagation(),s(!r),d.onClick?.(I);}}:{onMouseEnter:I=>{l(),r||s(true),d.onMouseEnter?.(I);},onMouseLeave:I=>{i(),d.onMouseLeave?.(I);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let I=u.props?.css;return me.cloneElement(u,{...f,...T,ref:y,css:[I,n].filter(Boolean)})}return me.createElement("button",{ref:y,type:"button",css:[n],...f,...T,children:u})});li.displayName="PopoverTrigger";var ci=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=or(),a=me.Children.only(o),c=io(s,r,a.ref);if(e){let l=a.props?.css;return me.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:cs(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});ci.displayName="PopoverAnchor";function Bu(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var ui=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:l,paddingY:u,radius:d="lg",css:y,...f},T)=>{let{open:I,setOpen:x,triggerOn:R,referenceRef:g,scheduleClose:p,cancelClose:m}=or(),C=V(),P=Bu(e),{refs:w,x:v,y:N,strategy:B,context:K}=useFloating({open:I,onOpenChange:x,whileElementsMounted:autoUpdate,placement:P,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{g.current&&w.setReference(g.current);},[w,g]);let O=useDismiss(K,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(K,{role:"dialog"}),{getFloatingProps:F}=useInteractions([O,S]),[M]=K.placement.split("-"),b=M,h=`${b==="left"?"right":b==="right"?"left":"center"} ${b==="top"?"bottom":b==="bottom"?"top":"center"}`,A=8,D=b==="top"?{y:A}:b==="bottom"?{y:-A}:b==="left"?{x:A}:{x:-A},L={initial:{opacity:0,scale:.96,...D},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...D},transition:{scale:{type:"spring",stiffness:520,damping:32,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.16,ease:"linear"}}},k=C.surface.panelBg,E=C.text.primary,W=`${C.componentHeights.border} solid ${C.surface.border}`,$=tr(i,C.spacing),z=tr(l,C.spacing),_=tr(u,C.spacing),H={};$&&(H.padding=$),z&&(H.paddingInline=z),_&&(H.paddingBlock=_);let U=tr(d,C.radius)??C.radius.md,X="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",ae=css({position:B,top:N??0,left:v??0,zIndex:1e3,transformOrigin:h,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:cs(a)??"fit-content",height:cs(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),q=r?css({}):css({background:k,color:E,border:W,borderRadius:U,boxShadow:X,...H,...H.padding||H.paddingInline||H.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),Y=R==="hover"?{onMouseEnter:m,onMouseLeave:()=>p()}:{},le=io(w.setFloating,T),ie=jsx(motion.div,{className:"plainframe-ui-popover",...F({...f,ref:le,...Y}),...L,css:[ae,q,y],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:I?ie:null})})});ui.displayName="PopoverContent";var $u=()=>{let e=or();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var ms=me.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:d,...y},f){let T=V(),I=xe(),x={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},R={slideMs:250,pressMs:150,easing:"ease"},g=t!==void 0,[p,m]=useState(n),C=g?!!t:p,[P,w]=useState(false);useEffect(()=>{if(r)return;w(true);let z=setTimeout(()=>w(false),R.pressMs);return ()=>clearTimeout(z)},[C,r]);let v=["sm","md","lg"].includes(s)?s:"md",N=x[v],B=`${R.slideMs}ms ${R.easing}`,K=T.palette?.primary?.[600]??T.neutral[900],O=T.neutral[300],S=C?K:O,F=C?T.text.onColors.primary:"#ffffff",{trackW:M,trackH:b,thumb:h}=N,A=(b-h)/2,D=css({display:"inline-flex",alignItems:"center",gap:N.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),L=css({position:"relative",width:M,height:b,backgroundColor:S,borderRadius:T.radius.xl,transition:`background-color ${B}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),k=css({position:"absolute",top:A,left:C?M-h-A:A,width:h,height:h,backgroundColor:F,borderRadius:T.radius.xl,transition:`left ${B}, transform ${B}, background-color 0.25s ease`,transform:P?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),E=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),W=()=>{if(r)return;let z=!C;g||m(z),o?.(z);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:W,onKeyDown:z=>{r||(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),W());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[D,I({color:C?"primary":"neutral"}),i],...y,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[L,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[k,u]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[E,d],children:a})]})}));var Uu=(e,t)=>t==="sm"?{box:16,labelFont:e.typography.sizes.xs,gap:8,borderRadius:e.radius.xxs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:t==="lg"?{box:24,labelFont:e.typography.sizes.md,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:{box:20,labelFont:e.typography.sizes.sm,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75},sr=me.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:d,checkCss:y,labelCss:f,descriptionCss:T,className:I,...x},R)=>{let g=V(),p=xe(),m=typeof e=="boolean",[C,P]=useState(t),w=m?e:C,v=r==="sm"||r==="lg"?r:"md",N=useMemo(()=>Uu(g,v),[g,v]),{checkedBg:B,checkColor:K,borderCol:O,hoverBg:S,gapPx:F}=useMemo(()=>{let z=g.palette||{},_=g.neutral||{},H=g.text?.onColors||{},U,X;l==="neutral"||l==="secondary"?(U=_,X="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(z,l)?(U=z[l]||z.primary||_,X=l):(U=z.primary||_,X="primary");let ae=U[600]??U[500]??U[400]??Object.values(U)[0]??g.palette.primary[600],q=H[X]??H.primary??g.text?.onColors?.primary??g.text.primary,Y=typeof N.gap=="number"?N.gap+2:N.gap;return {checkedBg:ae,checkColor:q,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:Y}},[N.gap,l,g]),M=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:F,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:g.radius.sm,padding:g.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:O,backgroundColor:S},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:B,outlineColor:B,"--pfui-bleed":B},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:B,backgroundColor:B,"--pfui-bleed":B},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[O,B,a,o,F,S,s,g.radius.sm,g.spacing.xs]),b=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),h=useMemo(()=>css({width:N.box,height:N.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${N.borderWidth} solid ${O}`,outlineOffset:`-${N.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?g.radius.full:N.borderRadius,transition:"background-color .16s ease, outline-color .05s ease, box-shadow .16s ease, transform .16s ease",flex:"0 0 auto",verticalAlign:"middle",overflow:"hidden",transform:"translateZ(0)",backfaceVisibility:"hidden"}),[N.box,N.borderRadius,N.borderWidth,O,c,g.radius.full]),A=useMemo(()=>({w:Math.round(N.box*N.iconRatioW),h:Math.round(N.box*N.iconRatioH)}),[N.box,N.iconRatioH,N.iconRatioW]),D=useMemo(()=>css({width:A.w,height:A.h,transition:"opacity .14s ease, transform .14s ease",color:K,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[K,A.h,A.w]),L=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),k=useMemo(()=>css({fontSize:N.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[N.labelFont,g.text.primary]),E=useMemo(()=>css({fontSize:N.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&a?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[N.labelFont,a,s,g.spacing.xs,g.text.secondary]),W=useCallback(()=>{o||(m?n?.(!w):P(z=>{let _=!z;return n?.(_),_}));},[o,m,w,n]),$=useCallback(z=>{o||(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),W());},[o,W]);return jsxs("label",{ref:R,role:"checkbox","aria-checked":w,"aria-disabled":o||void 0,"data-state":w?"checked":"unchecked",className:["plainframe-ui-checkbox",I||""].join(" ").trim(),css:[M,p({color:w?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:$,children:[jsx("input",{type:"checkbox",checked:w,onChange:W,disabled:o,css:b,...x,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[h,d],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[D,y],children:w&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:K,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",css:css({width:"100%",height:"100%",display:"block"}),"aria-hidden":"true",focusable:"false",children:jsx("polyline",{points:"20 6 9 17 4 12"})}))})}),(s||a)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:L,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[k,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[E,T],children:a})]})]})}));sr.displayName="Checkbox";var Xu=()=>useContext(fn),Yu=()=>useContext(ro),Ju=()=>useContext(ur),dn=null,gi=(e,t=35)=>{dn!==null&&window.clearTimeout(dn),dn=window.setTimeout(()=>{e(),dn=null;},t);},lo=()=>{dn!==null&&(window.clearTimeout(dn),dn=null);},pn=me.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:d=false,active:y,meta:f,__index:T,__skipListReg:I,...x},R){let g=Xu(),p=Ju(),m=cr(),C=uo(),P=Yu(),w=V(),N=!!useContext(Tt),B=x["data-subtrigger"]!==void 0,K=B&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,F=useContext(er),M=F==="subtle"?w.surface?.subtleHover??w.neutral[100]:w.surface?.subtleBg??w.neutral[100],b=useMemo(()=>css({width:"100%",borderRadius:w.radius.md,padding:`${w.spacing.sm} ${w.spacing.sm}`,paddingLeft:S>0?`calc(${w.spacing.md} + (${w.spacing.xl} * ${S}))`:w.spacing.md,minHeight:N?w.componentHeights.sm:w.componentHeights.md,display:"flex",alignItems:"center",gap:w.spacing.sm,fontWeight:500,fontSize:w.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?w.palette.danger[800]:w.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?w.palette.danger[50]:M},"&[data-highlighted]":t?{}:{background:n?w.palette.danger[50]:M},"&[data-active]":t?{}:{background:n?w.palette.danger[50]:M},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?w.palette.danger[50]:M},"[role='menu']:not([data-keyboard-nav]) &:not([data-disabled]):hover [data-menu-checkbox-wrapper],&:not([data-disabled])[data-highlighted] [data-menu-checkbox-wrapper],&:not([data-disabled])[data-active] [data-menu-checkbox-wrapper],&[data-subtrigger][aria-expanded='true'] [data-menu-checkbox-wrapper]":{background:w.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[w,N,S,t,n,M]),h=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),A=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:w.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:w.text.secondary}),[w.text.secondary,w.spacing.sm]),D=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:w.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[w.palette.primary]),L=[];N&&L.push({minHeight:w.componentHeights.sm,paddingLeft:w.spacing.sm,paddingRight:w.spacing.xs,paddingTop:w.spacing.xs,paddingBottom:w.spacing.xs});let k=()=>{s?.(),r&&!B&&p?.closeAll();},E=($,z)=>{let _=$.closest('[role="menu"]');if(!_)return;let H=Array.from(_.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(Y=>{if(Y.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(Y);return le.display!=="none"&&le.visibility!=="hidden"});if(!H.length)return;let U=H.indexOf($),X=U>=0?U:0,ae=z(H.length,X),q=H[ae];q&&(document.querySelectorAll("[data-highlighted]").forEach(Y=>{Y.removeAttribute("data-highlighted");}),q.setAttribute("data-highlighted",""),q.focus(),g&&T!=null&&g.setActiveIndex(ae));},W=t?-1:P?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":y?"":void 0,tabIndex:W,ref:$=>{if(g&&!I){let z=g.listRef.current;$&&(T!=null?z[T]=$:z.includes($)||z.push($));}typeof R=="function"?R($):R&&"current"in R&&(R.current=$);},onMouseMove:$=>{if($.currentTarget.hasAttribute("data-hovered"))return;let z=!!$.currentTarget.closest("[data-submenu-content]");!B&&m&&!z&&gi(m.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(H=>{H.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(H=>{H.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(H=>{H.removeAttribute("data-active");}),$.currentTarget.setAttribute("data-hovered","");let _=$.currentTarget.closest("[data-menu-id]")||$.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&g&&T!=null&&g.setActiveIndex(T),!t&&!P?.allItemsTabbable&&$.currentTarget.focus({preventScroll:true});},onMouseEnter:$=>{if(B)lo();else {let H=!!$.currentTarget.closest("[data-submenu-content]");m&&!H&&gi(m.closeAllSubMenus);}$.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(H=>{H.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(H=>{H.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(H=>{H.removeAttribute("data-active");})),$.currentTarget.setAttribute("data-hovered","");let _=$.currentTarget.closest("[data-menu-id]")||$.currentTarget.closest('[role="menu"]');!t&&g&&T!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),g.setActiveIndex(T)),!t&&!P?.allItemsTabbable&&$.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:$=>{if(t)return;let z=$.currentTarget;if($.key==="Tab"&&g&&!P?.allItemsTabbable){$.preventDefault();return}if($.key==="Tab"&&!g){let _=z.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let H=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=H>=0?H:0;});}C&&C.setIsKeyboardNav(false);return}if($.key==="Enter"||$.key===" "||$.key==="ArrowRight"){B||$.key!=="ArrowRight"&&($.preventDefault(),$.stopPropagation(),k());return}if($.key==="ArrowLeft"&&z.closest('[role="menu"]')?.closest("[data-submenu-content]")){$.preventDefault(),$.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let X=U.__pfuiCloseSubmenu;X&&X(),document.querySelectorAll("[data-highlighted]").forEach(q=>q.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(q=>q.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let ae=U.closest("[data-menu-id]");ae&&ae.setAttribute("data-keyboard-nav","");}return}if($.key==="Escape"){$.preventDefault(),$.stopPropagation(),p?.closeAll(),z.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if($.key==="ArrowDown"){$.preventDefault(),$.stopPropagation();let _=z.closest("[data-menu-id]")||z.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),E(z,(H,U)=>(U+1)%H);return}if($.key==="ArrowUp"){$.preventDefault(),$.stopPropagation();let _=z.closest("[data-menu-id]")||z.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),E(z,(H,U)=>(U-1+H)%H);return}if($.key==="Home"){$.preventDefault(),$.stopPropagation();let _=z.closest("[data-menu-id]")||z.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),E(z,()=>0);return}if($.key==="End"){$.preventDefault(),$.stopPropagation();let _=z.closest("[data-menu-id]")||z.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),E(z,H=>H-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[b,...L,i].flat()),...x,onClick:$=>{t||($.currentTarget.removeAttribute("data-highlighted"),k());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:h,children:l}),a,(f!=null||K||d)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:A,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:w.typography.sizes.sm,color:w.text.secondary,whiteSpace:"nowrap"}),children:f}):null,K,d&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:D,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),hi=me.createContext(null),gs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(y=>{let f=i.current,I=f.some(x=>Object.is(x,y))?f.filter(x=>!Object.is(x,y)):[...f,y];a||s(I),l.current?.(I);},[a]),d=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(hi.Provider,{value:d,children:o})},co=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:l,startIcon:u,endIcon:d,...y},f){let T=useContext(hi),I=!!T&&r!==void 0,x=!I&&t!==void 0,[R,g]=useState(()=>I?T.values.some(O=>Object.is(O,r)):!!n),p=I?T.values.some(O=>Object.is(O,r)):x?!!t:R,m=V(),P=!!useContext(Tt),w=()=>{if(!c)if(I)T.toggle(r);else {let O=!p;x||g(O),o?.(O);}},v=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:P?-1:-3,borderRadius:m.radius.xs,transition:"background-color .12s ease"}),N=css({pointerEvents:"none"}),B=useCallback(O=>{O&&(O.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),O.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),K=jsxs(Fragment,{children:[jsx("span",{ref:B,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:v,"aria-hidden":"true",children:jsx(sr,{size:"sm",checked:p,css:N})}),u]});return jsx(pn,{...y,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":p,closeOnSelect:false,onSelect:w,disabled:c,startIcon:K,endIcon:d,css:i,selected:false,children:s})});co.displayName="MenuCheckboxItem";var yi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:l,startIcon:u,className:d,...y},f){let T=t!==void 0,[I,x]=useState(!!n),R=T?!!t:I,p=!!useContext(Tt),m=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:p?2:void 0}),P=()=>{if(a)return;let v=!R;T||x(v),o?.(v);},w=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}});return jsxs(pn,{...y,className:["plainframe-ui-menu-switch-item",d||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:P,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:w,children:u}),jsx("span",{"data-label":true,css:m,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(ms,{checked:R,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});yi.displayName="MenuSwitchItem";var xi=me.createContext(null),lr=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,c=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:c}),[a]);return jsx(xi.Provider,{value:i,children:o})};lr.displayName="MenuRadioGroup";var Zu=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(xi),u=l?.value===t,d=V(),y=css({width:d.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:d.palette.primary[600],transform:u?"scale(1)":"scale(0.4)",opacity:u?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),T=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(pn,{...c,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":u,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:y,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:T,children:n})]})}),mn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...l},u){let d=V(),f=!!useContext(Tt),T=i==="primary"?d.text.primary:i==="secondary"?d.text.secondary:d.palette[i]?.[700]??d.text.primary,I=css({display:"flex",alignItems:"center",padding:f?`${d.spacing.sm} ${d.spacing.md}`:`${d.spacing.sm} ${d.spacing.md}`,fontSize:d.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${d.spacing.lg} * 2)`}:null,gap:d.spacing.xs}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),R=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),g=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(I,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:R,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:x,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:g,children:a})]})});mn.displayName="MenuLabel";var Qu=({className:e,css:t,variant:n="full",...o})=>{let r=V(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var bs=io,po=0,dr=null,pr=null,pd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function md(){if(!(typeof document>"u")){if(po===0){let e=document.body;dr=e.style.overflow||"",pr=e.style.paddingRight||"";let t=pd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function fd(){if(!(typeof document>"u")&&(po>0&&(po-=1),po===0)){let e=document.body;dr!==null&&(e.style.overflow=dr),pr!==null&&(e.style.paddingRight=pr),dr=null,pr=null;}}var fn=createContext(null),mr=()=>{let e=useContext(fn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},mo=createContext(null),gd=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),Ci=createContext(null),cr=()=>useContext(Ci),Ri=createContext(false),bd=()=>useContext(Ri),ro=createContext({allItemsTabbable:true}),ur=me.createContext(null),hs=()=>useContext(ur);function hd(){let e=[],t=new Set,n={current:false};return {registerCloser(o){return e.push(o),()=>{let r=e.indexOf(o);r>=0&&e.splice(r,1);}},closeAll(){if(!n.current){n.current=true;for(let o=e.length-1;o>=0;o--)try{e[o]();}catch{}queueMicrotask(()=>{n.current=false;});}},registerHoverCtl(o){return t.add(o),()=>t.delete(o)},clearAllHover(){t.forEach(o=>o.clear());},isBusClosingRef:n}}var yd=()=>gd()?.activeIndex??null,Ti=0,$n=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(F=>{e===void 0&&i(F),n?.(F);},[e,n]),d=useRef(`pfui-menu-${++Ti}`),y=useRef(null),f=useRef([]),T=useRef(null),[I,x]=useState(null),[R,g]=useState(false);useEffect(()=>{l||(x(null),f.current=[],g(false));},[l]);let p=useRef(null),m=useCallback((F,M)=>{if(o!=="hover")return;window.clearTimeout(p.current??0);let b=M??20;p.current=window.setTimeout(()=>u(F),b);},[o,u]),C=useCallback(()=>{p.current&&(window.clearTimeout(p.current),p.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return md(),()=>fd()},[l,r]);let P=hs(),[w]=useState(()=>P??hd()),v=useRef(new Set),N=useMemo(()=>({registerSubMenu:F=>(v.current.add(F),()=>v.current.delete(F)),closeAllSubMenus:()=>{v.current.forEach(F=>F());}}),[]),B=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:y,listRef:f,floatingRef:T,setActiveIndex:x,scheduleSubmenuHover:m,clearSubmenuHover:C,menuId:d.current}),[l,u,o,x,m,C]),K=useMemo(()=>({activeIndex:I,setActiveIndex:x}),[I,x]),O=useMemo(()=>({isKeyboardNav:R,setIsKeyboardNav:g}),[R]),S=s==="sm";return jsx(ur.Provider,{value:w,children:jsx(Tt.Provider,{value:S,children:jsx(oo.Provider,{value:O,children:jsx(Ci.Provider,{value:N,children:jsx(mo.Provider,{value:K,children:jsx(fn.Provider,{value:B,children:a})})})})})})};$n.displayName="DropdownMenu";var zn=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:d,setActiveIndex:y,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:I,menuId:x}=mr(),R=uo(),g=cr(),p=!!e&&isValidElement(t),m=p?t:null,C=m&&m.props&&typeof m.props=="object"&&"onKeyDown"in m.props?m.props.onKeyDown:void 0,P=m&&m.props&&typeof m.props=="object"&&"onClick"in m.props?m.props.onClick:void 0,{onKeyDown:w,onClick:v,...N}=s,B=useMemo(()=>bs(a,p&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,p,t,u]),K=useCallback(()=>d.current.filter(Boolean),[d]),O=useCallback(h=>{let A=K();requestAnimationFrame(()=>A[h]?.focus());},[K]),S=useCallback(h=>{if(h.key==="Tab"&&c){h.preventDefault(),R?.setIsKeyboardNav(true);let A=I?.current;if(A){A.setAttribute("data-keyboard-nav","");let D=A.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');D&&(document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),D.setAttribute("data-highlighted",""),D.focus());}return}if(h.key==="ArrowRight"&&c){let A=document.querySelector("[data-subtrigger][data-hovered]");if(A){h.preventDefault(),h.stopPropagation(),R?.setIsKeyboardNav(true),A.removeAttribute("data-hovered"),A.setAttribute("data-highlighted",""),A.focus(),requestAnimationFrame(()=>{let D=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});A.dispatchEvent(D);});return}}if(h.key==="ArrowDown"||h.key==="ArrowUp"){if(R?.setIsKeyboardNav(true),!c){h.preventDefault(),i(true),requestAnimationFrame(()=>{let A=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(A){A.setAttribute("data-keyboard-nav","");let D=Array.from(A.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(L=>{let k=L.closest("[data-submenu-content]");if(k&&k!==A)return false;let E=window.getComputedStyle(L);return E.display!=="none"&&E.visibility!=="hidden"});if(D.length>0){let L=h.key==="ArrowDown"?0:D.length-1;y(L),D[L]?.setAttribute("data-highlighted",""),D[L]?.focus();}}}),C?.(h),w?.(h);return}if(c){h.preventDefault();let A=document.querySelectorAll("[data-hovered]");for(let L of Array.from(A))if(L.closest("[data-submenu-content]")){let E=L.closest('[role="menu"]');if(E){E.setAttribute("data-keyboard-nav","");let W=Array.from(E.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(z=>{if(z.closest('[role="menu"]')!==E)return false;let _=window.getComputedStyle(z);return _.display!=="none"&&_.visibility!=="hidden"}),$=W.indexOf(L);if(document.querySelectorAll("[data-highlighted]").forEach(z=>z.removeAttribute("data-highlighted")),L.removeAttribute("data-hovered"),$!==-1&&W.length>0){let z=h.key==="ArrowDown"?1:-1,_=($+z+W.length)%W.length;W[_]?.setAttribute("data-highlighted",""),W[_]?.focus();}return}}let D=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(D){D.setAttribute("data-keyboard-nav",""),g?.closeAllSubMenus();let L=Array.from(D.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(k=>{if(k.closest('[role="menu"]')!==D)return false;let E=window.getComputedStyle(k);return E.display!=="none"&&E.visibility!=="hidden"});if(L.length>0){let k=D.querySelector("[data-highlighted]"),E=D.querySelector("[data-hovered]"),W=-1;k?W=L.indexOf(k):E&&(W=L.indexOf(E)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),E&&E.removeAttribute("data-hovered"),W===-1&&(W=h.key==="ArrowDown"?-1:L.length);let $=h.key==="ArrowDown"?1:-1,z=(W+$+L.length)%L.length;y(z),L[z]?.setAttribute("data-highlighted",""),L[z]?.focus();}}C?.(h),w?.(h);return}}if((h.key==="Enter"||h.key===" ")&&!c){h.preventDefault(),R?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let A=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(A){A.setAttribute("data-keyboard-nav","");let D=Array.from(A.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(L=>{let k=L.closest("[data-submenu-content]");if(k&&k!==A)return false;let E=window.getComputedStyle(L);return E.display!=="none"&&E.visibility!=="hidden"});D.length>0&&(y(0),D[0]?.setAttribute("data-highlighted",""),D[0]?.focus());}}),C?.(h),w?.(h);return}C?.(h),w?.(h);},[c,i,y,C,w,K,O,d,R,x,I,g]),F=useCallback(h=>{l==="click"&&((h.nativeEvent.composedPath?.()??[]).some(k=>{let E=k;if(!E||!("tagName"in E))return false;let W=String(E.tagName).toUpperCase();if(W==="INPUT"||W==="TEXTAREA"||"isContentEditable"in E&&E.isContentEditable)return true;let $="getAttribute"in E?E.getAttribute("role"):null;return $==="textbox"||$==="combobox"})||(h.stopPropagation(),i(!c))),P?.(h),v?.(h);},[l,c,i,P,v]),M=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},b=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(p&&m){let h=m.props,A=h.css,D=typeof h.className=="string"?h.className:void 0,L=typeof h.tabIndex=="number"?h.tabIndex:0,k={ref:B,tabIndex:L,className:[D,o].filter(Boolean).join(" ")||void 0,css:[A,b,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:F,onKeyDown:S,...M,...N};return cloneElement(m,k)}return jsx("button",{ref:B,className:o,css:[css({display:"inline-block"}),b,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:F,onKeyDown:S,...M,...N,children:t})});zn.displayName="DropdownMenuTrigger";var hn=me.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:d=false,allItemsTabbable:y=false,className:f,css:T,children:I,exitPlacement:x,animateOnBusClose:R=true,gap:g,ignoreOutsidePressRefs:p,disableOutsidePressDismiss:m=false,returnFocus:C=false,...P},w)=>{let{open:v,setOpen:N,referenceRef:B,clearSubmenuHover:K,setActiveIndex:O,floatingRef:S,menuId:F}=mr(),M=V(),b=hs(),h=uo();useEffect(()=>{if(!b)return;let J=b.registerCloser(()=>N(false));return ()=>{J&&J();}},[b,N]);let A=typeof o=="string"?parseFloat(o):o,D=typeof r=="string"?parseFloat(r):r,L=typeof s=="string"?parseFloat(s):s,k=`${t}${n==="center"?"":`-${n}`}`,E=useCallback(J=>({getBoundingClientRect:()=>{let oe=Math.round(J.x),re=Math.round(J.y);return {x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0,toJSON:()=>({x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0})}},contextElement:void 0}),[]),W=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let J=e;return E({x:J.x,y:J.y})},[e,E]),{refs:$,x:z,y:_,strategy:H,context:U,update:X}=useFloating({open:v,onOpenChange:N,placement:k,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:A??0,crossAxis:D??0}),flip({padding:L??8}),shift({padding:L??8}),size({apply({rects:J,elements:oe}){let re=oe.floating;re.style.boxSizing="border-box",i!=null?re.style.height=typeof i=="number"?`${i}px`:String(i):re.style.removeProperty("height"),c!=null?re.style.width=typeof c=="number"?`${c}px`:String(c):a?re.style.width=`${Math.round(J.reference.width)}px`:re.style.width="200px",l!=null?re.style.maxHeight=typeof l=="number"?`${l}px`:String(l):re.style.removeProperty("max-height");}})]});useEffect(()=>{W?$.setReference(W):B.current&&$.setReference(B.current);},[$,W,B]),useEffect(()=>{if(!v)return;let J=W||B.current,oe=$.floating.current;if(!(!J||!oe))return autoUpdate(J,oe,X)},[v,W,B,$,X]),useEffect(()=>{X();},[X,a,c,i,l]),useEffect(()=>{v&&!y&&O(0);},[v,y,O]),useEffect(()=>{if(!d||!v)return;let J=()=>{let oe=document.activeElement,re=B.current,qe=$.floating.current;oe&&(re?.contains(oe)||qe?.contains(oe)||N(false));};return document.addEventListener("focusin",J,true),()=>document.removeEventListener("focusin",J,true)},[d,v,N,B,$.floating]);let ae=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:m?false:J=>{if(p?.length){let oe=J.target;for(let re of p)if(re.current?.contains(oe))return false}return true}}),q=useRole(U,{role:"menu"}),{getFloatingProps:Y}=useInteractions([ae,q]),le=useRef(false);useEffect(()=>{v?le.current=true:le.current&&B.current&&C&&(b?.isBusClosingRef.current||requestAnimationFrame(()=>{B.current?.focus();}));},[v,B,b,C]);let ie=typeof M.spacing.xs=="number"?`${M.spacing.xs}px`:String(M.spacing.xs),be=g===void 0?void 0:typeof g=="number"?g:M.spacing[g]??g,Pe=u?void 0:css({boxSizing:"border-box",background:M.surface.panelBg,border:`${M.componentHeights.border} solid ${M.surface.border}`,borderRadius:M.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":ie,padding:"var(--pfui-panel-pad)",color:M.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:be,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Re=-1,Ce=J=>{if(!J||typeof J!="object"||!isValidElement(J))return J;let re=J.type?.displayName;if(re==="DropdownMenu"||re==="DropdownMenuSub")return J;if(re==="MenuItem"||re==="MenuCheckboxItem"||re==="MenuRadioItem"||re==="MenuSwitchItem")return Re+=1,cloneElement(J,{__index:Re,key:J.key??Re});if(re==="DropdownMenuTrigger"){let j=J.props.children;return cloneElement(J,{children:me.Children.map(j,Ce)})}if(re==="DropdownMenuSubTrigger"){Re+=1;let j=Re;return cloneElement(J,{__index:j,key:J.key??j})}let qe=J.props.children;return qe==null?J:cloneElement(J,{children:me.Children.map(qe,Ce)})},Ie=me.Children.map(I,Ce),we=U.placement.split("-")[0]||"bottom",he=we==="bottom"?"center top":we==="top"?"center bottom":we==="left"?"right center":"left center",je=we==="bottom"?{opacity:0,y:-8,scale:.96}:we==="top"?{opacity:0,y:8,scale:.96}:we==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Z=x??we,Ee=Z==="bottom"?{opacity:0,y:-8,scale:.96}:Z==="top"?{opacity:0,y:8,scale:.96}:Z==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},ee=!!b?.isBusClosingRef.current&&!R?{scale:{duration:0},x:{duration:0},y:{duration:0},opacity:{duration:0}}:{scale:{type:"spring",stiffness:520,damping:38,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.12,ease:"linear"}},se=css({position:H,top:_??0,left:z??0,zIndex:1e3,transformOrigin:he}),pe=useCallback(J=>{if(J.key==="Tab"){J.preventDefault();return}if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),h?.setIsKeyboardNav(true);let oe=J.currentTarget;oe.setAttribute("data-keyboard-nav","");let re=Array.from(oe.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(qe=>{if(qe.closest('[role="menu"]')!==oe)return false;let j=window.getComputedStyle(qe);return j.display!=="none"&&j.visibility!=="hidden"});if(re.length>0){let qe=oe.querySelector("[data-highlighted]"),j=oe.querySelector("[data-hovered]"),ue=-1;qe?ue=re.indexOf(qe):j&&(ue=re.indexOf(j)),document.querySelectorAll("[data-highlighted]").forEach(ze=>ze.removeAttribute("data-highlighted")),j&&j.removeAttribute("data-hovered"),ue===-1&&(ue=J.key==="ArrowDown"?-1:re.length);let de=J.key==="ArrowDown"?1:-1,fe=(ue+de+re.length)%re.length;O(fe),re[fe]?.setAttribute("data-highlighted",""),re[fe]?.focus();}}},[h,O]),Se=useCallback(J=>{let oe=J.currentTarget;oe.removeAttribute("data-keyboard-nav"),oe.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),h?.isKeyboardNav&&h.setIsKeyboardNav(false);},[h]),Ne=useCallback(J=>{J.removeAttribute("data-keyboard-nav"),J.querySelectorAll("[data-highlighted]").forEach(oe=>oe.removeAttribute("data-highlighted")),h?.isKeyboardNav&&h.setIsKeyboardNav(false);},[h]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:v?jsx(ro.Provider,{value:{allItemsTabbable:y},children:jsx(motion.div,{...Y({...P,ref:bs(w,$.setFloating,J=>{S&&(S.current=J);})}),"data-menu-id":F,"data-keyboard-nav":h?.isKeyboardNav?"":void 0,className:f,css:[Pe,se,T],initial:je,animate:{opacity:1,x:0,y:0,scale:1},exit:Ee,transition:ee,onPointerMove:J=>Ne(J.currentTarget),onPointerDown:J=>Ne(J.currentTarget),onKeyDown:pe,onMouseMove:Se,onMouseEnter:()=>{K(),b?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(J=>J.removeAttribute("data-hovered"));},children:Ie})}):null})})});hn.displayName="DropdownMenuContent";var wi=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=bd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{e===void 0&&i(S),n?.(S);},[e,n]),d=useRef(null),y=useRef(false),f=useCallback((S,F)=>{if(o!=="hover")return;window.clearTimeout(d.current??0),y.current=S;let M=F??20;d.current=window.setTimeout(()=>{y.current=false,u(S);},M);},[o,u]),T=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null,y.current=false);},[]);useEffect(()=>()=>T(),[T]);let I=cr();useEffect(()=>{if(!I)return;let S=()=>{T(),u(false);};return I.registerSubMenu(S)},[I,u,T]);let x=useRef(`pfui-submenu-${++Ti}`),R=useRef(null),g=useRef([]),p=useRef(null),[m,C]=useState(null),[P,w]=useState(false);useEffect(()=>{l||(C(null),g.current=[],w(false));},[l]);let v=useContext(Tt),N=r??v,B=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:R,listRef:g,floatingRef:p,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:y,menuId:x.current}),[l,u,o,C,f,T]),K=useMemo(()=>({activeIndex:m,setActiveIndex:C}),[m,C]),O=useMemo(()=>({isKeyboardNav:P,setIsKeyboardNav:w}),[P]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:me.Children.map(s,S=>{if(!isValidElement(S))return S;let F=S.type;return F?.displayName==="DropdownMenuSubTrigger"||F?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Ri.Provider,{value:true,children:jsx(Tt.Provider,{value:N,children:jsx(mo.Provider,{value:K,children:jsx(oo.Provider,{value:O,children:jsx(fn.Provider,{value:B,children:s})})})})})};wi.displayName="DropdownMenuSub";var Ei=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,scheduleSubmenuHover:d,clearSubmenuHover:y,pendingOpenRef:f,menuId:T}=mr(),I=uo(),x=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),R=!!e&&isValidElement(t),g=R?t:null,p=g?.props,m=p?.onKeyDown,C=p?.onClick,{onKeyDown:P,onClick:w,...v}=s,N=useMemo(()=>bs(a,R&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,x),[a,R,t,u,x]),B=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,K=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let F=S.currentTarget,M=b=>{I?.setIsKeyboardNav(true);let h=F.closest("[data-menu-id]");if(!h)return;h.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted"));let A=Array.from(h.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(E=>{if(E.closest("[data-menu-id]")!==h)return false;let W=window.getComputedStyle(E);return W.display!=="none"&&W.visibility!=="hidden"});if(!A.length)return;let D=A.indexOf(F),L=D>=0?D:0,k=b==="next"?(L+1)%A.length:(L-1+A.length)%A.length;A[k]?.setAttribute("data-highlighted",""),A[k]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&i(false),M("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&i(false),M("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),I?.setIsKeyboardNav(true);let b=S.currentTarget;i(true),requestAnimationFrame(()=>{let h=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(h){h.setAttribute("data-keyboard-nav",""),b.removeAttribute("data-highlighted"),b.removeAttribute("data-hovered");let A=h.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');A&&(A.setAttribute("data-highlighted",""),A.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let b=F.closest("[data-menu-id]");b&&b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(h=>h.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(h=>h.removeAttribute("data-hovered")),F.setAttribute("data-highlighted",""),F.focus(),I&&I.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),m?.(S);return}m?.(S),P?.(S);},[c,i,m,P,u,I,T]),O=l==="hover"?{onMouseEnter:S=>{let F=S.currentTarget;lo(),y(),document.querySelectorAll("[data-hovered]").forEach(b=>b.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),F.setAttribute("data-hovered",""),F.focus({preventScroll:true});let M=F.closest("[data-menu-id]");M?.hasAttribute("data-keyboard-nav")&&M.removeAttribute("data-keyboard-nav"),I&&I.setIsKeyboardNav(false),c||d(true,90);},onMouseMove:S=>{let F=S.currentTarget;lo(),F.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(M=>M.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(M=>M.removeAttribute("data-highlighted")),F.setAttribute("data-hovered","")),!c&&!f?.current&&d(true,90);},onMouseLeave:()=>{d(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),w?.(S);}};if(R&&g){let S=p?.css,F=typeof p?.className=="string"?p.className:void 0,M=typeof p?.tabIndex=="number"?p.tabIndex:0,b={ref:N,tabIndex:M,className:[F,o].filter(Boolean).join(" ")||void 0,css:[S,B,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:K,onFocus:h=>{if(h.target.hasAttribute("data-highlighted")){let A=h.target.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),I&&I.setIsKeyboardNav(true));}p&&"onFocus"in p&&typeof p.onFocus=="function"&&p.onFocus(h);},...O,...v};return cloneElement(g,b)}return jsx("div",{ref:N,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),B,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:K,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let F=S.currentTarget.closest("[data-menu-id]");F&&!F.hasAttribute("data-keyboard-nav")&&(F.setAttribute("data-keyboard-nav",""),I&&I.setIsKeyboardNav(true));}},...O,...v,children:t})});Ei.displayName="DropdownMenuSubTrigger";var ki=me.forwardRef((e,t)=>{let n=hs(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=mr(),a=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(hn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),lo(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});ki.displayName="DropdownMenuSubContent";var fr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Cd=css({display:"inline"}),Si=css({display:"inline",fontWeight:700}),Rd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Td=css({display:"flex",alignItems:"center",gap:4}),wd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Mi=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Ed=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),kd=()=>{},Id=e=>e,Sd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Md=e=>{e.preventDefault(),e.stopPropagation();},Fd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Ad=e=>{e.preventDefault(),e.stopPropagation();},Fi=me.memo(({onCapture:e})=>{let t=useContext(fn),n=useContext(mo),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Fi.displayName="CtxCapture";var ys=me.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:d,descriptionColor:y})=>{let f=o(),T=useMemo(()=>{let R=String(e.title??e.value);return s?R:a(R)},[a,e.title,e.value,s]),I=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:wd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Mi,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Ed,{color:y}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Mi,children:T}),[T,e.description,y]),x=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let R=f.some(g=>Object.is(g,e.value));return s?jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:d,children:s(e,R)},e.value):jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:d,startIcon:e.startIcon,endIcon:e.endIcon,children:I},e.value)}return s?jsx(pn,{__index:t,onClick:x,onSelect:x,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:d,selected:r,children:s(e,r)},e.value):jsx(pn,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:x,onSelect:x,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:d,selected:r,children:I},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));ys.displayName="AutocompleteRow";var Ai=me.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:d,variant:y,startIcon:f,endIcon:T,size:I,disabled:x=false,error:R=false,showClear:g=false,open:p,onOpenChange:m,openOnFocus:C=false,openOnType:P=true,openOnClick:w=true,closeOnSelect:v=true,closeOnBlur:N=true,blurOnSelect:B=false,freeSolo:K=false,customValueLabel:O=false,maxHeight:S,maxItems:F,noResultsText:M="No Items Found",highlightTypedValue:b,typedValueHighlightCss:h,showNoResults:A=true,noResultsLabelCss:D,loadingLabelCss:L,loadItems:k,loading:E,loadingText:W="Loading\u2026",debounceMs:$=200,multiple:z=false,selectedValues:_,defaultSelectedValues:H,onChangeSelected:U,expandIcon:X,showExpandIcon:ae=true,expandIconCss:q,textFieldWrapperCss:Y,textFieldInputCss:le,textFieldLabelCss:ie,textFieldHelperRowCss:be,textFieldHelperTextCss:Pe,textFieldStartIconCss:Re,textFieldEndIconCss:Ce,menuContentCss:Ie})=>{let we=V().text.secondary,[he,je]=useState(""),Z=typeof p=="boolean",[Ee,Q]=useState(false),ee=Z?p:Ee,se=useRef(null),pe=useRef(null),Se=useRef(null),Ne=useRef(null),J=useRef(false),oe=useRef(null),re=useRef(false),qe=useRef(0),j=useMemo(()=>[pe],[]),[ue,de]=useState(H??[]),fe=_??ue,ze=useRef(fe);ze.current=fe;let[Oe,st]=useState(null),Ye=useRef(Oe);Ye.current=Oe;let yt=useCallback(()=>ze.current,[]),[tn,nn]=useState([]),[Sn,on]=useState(false),Je=typeof k=="function",xt=Je?tn:e,ce=useRef(xt);ce.current=xt;let ke=!!E||Sn&&Je,at=useRef(m);useEffect(()=>{at.current=m;},[m]);let De=useCallback(G=>{Z||Q(G),at.current?.(G);},[Z]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let G=he;return bt.current=window.setTimeout(async()=>{on(true);try{let ne=await k(G)||[];nn(Array.isArray(ne)?ne:[]);}catch{nn([]);}finally{on(false);}},Math.max(0,$)),()=>{bt.current&&window.clearTimeout(bt.current);}},[he,Je,k,$]);let Zn=useMemo(()=>{let G=fr(he);return G?xt.some(ne=>fr(ne.title??ne.value)===G):false},[xt,he]),sa=K&&!!O&&he.trim().length>0&&!Zn,nc=G=>{if(typeof O=="object"){let ne=Object.prototype.hasOwnProperty.call(O,"prefix"),ve=Object.prototype.hasOwnProperty.call(O,"suffix");if(ne||ve){let Me=ne?O.prefix??"":"",ge=ve?O.suffix??"":"";return `${Me}${G}${ge}`}return `Add "${G}"`}return `Add "${G}"`},Or=useMemo(()=>{if(Je)return xt;let G=fr(he);if(!G)return xt;let ne=[],ve=[];for(let Me of xt){let ge=fr(Me.title??Me.value);ge.split(" ").some(Ze=>Ze.startsWith(G))?ne.push(Me):ge.includes(G)&&ve.push(Me);}return ne.length>0?ne:ve},[xt,he,Je]),aa=useMemo(()=>{if(sa){let G=he.trim();return [...Or,{value:G,title:nc(G),__pfui_free__:true}]}return Or},[Or,sa,he]),Kt=useMemo(()=>{let G=[],ne=new Map;for(let pt of aa){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),G.push(Ze)),ne.get(Ze).push(pt);}let Me=typeof F=="number"?Math.max(0,F):1/0,ge=[];for(let pt of G){if(Me<=0)break;let sn=ne.get(pt).slice(0,Me);sn.length>0&&(ge.push({label:pt==="__ungrouped__"?void 0:pt,items:sn}),Me-=sn.length);}return ge},[aa,F]),Mn=useMemo(()=>Kt.reduce((G,ne)=>(G.push(...ne.items),G),[]),[Kt]),Ho=Mn.length>0,Wr=!Ho&&!!A&&!ke&&he.trim().length>0,Fn=ke||Ho||Wr,Lo=Fn||Je;useEffect(()=>{!Je&&ee&&!Fn&&(re.current=true,De(false),setTimeout(()=>{re.current=false;},150));},[Je,ee,Fn,De]);let Kr=useRef(null),_r=useRef(false);useEffect(()=>{if(K&&!z){if(_r.current){_r.current=false;return}let G=he.trim();if(Kr.current===G)return;Kr.current=G,t?.({value:G,title:G});}},[he,K,z,t]);let jr=useCallback(G=>{let ne=ce.current,ve=new Map(ne.map(ge=>[ge.value,ge])),Me=G.map(ge=>ve.get(ge)??{value:ge,title:ge});U?.(Me);},[U]),Bo=useCallback(G=>{let ne=G.map(String);_||de(ne),jr(ne);},[_,jr]),ia=useCallback(G=>{let ve=fe.includes(G)?fe.filter(Me=>Me!==G):[...fe,G];Bo(ve);},[fe,Bo]),$o=useCallback(G=>{let ne=ce.current.find(ve=>ve.value===G)??{value:G,title:G};ne.disabled||(_r.current=true,Kr.current=(ne.title??ne.value).trim(),st(ne),je(ne.title??ne.value),t?.(ne),Z||(v?(J.current=false,re.current=true,Q(false),at.current?.(false),setTimeout(()=>{re.current=false;},150)):J.current=true),!v&&Se.current?.setActiveIndex&&Se.current.setActiveIndex(null),B?(J.current=false,setTimeout(()=>{Ne.current&&se.current?(Ne.current.tabIndex=0,Ne.current.focus(),Ne.current.blur(),Ne.current.tabIndex=-1):se.current?.blur();},0)):requestAnimationFrame(()=>se.current?.focus()));},[t,Z,v,B]),oc=useCallback(G=>{if(x)return;je(G);let ne=!G.trim();z||(ne?(st(null),t?.(null)):K&&st(null)),!Z&&!ne&&P&&!ee&&De(true);},[z,Z,P,ee,De,x,K,t]),it=Sd,la=kd,rc=Id,ca=useMemo(()=>h?[Si,h]:Si,[h]),sc=useCallback(G=>{let ne=he.trim();if(!ne||ne.length<1)return G;let ve=ne.toLowerCase(),ge=G.toLowerCase().indexOf(ve);return ge<0?G:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Cd,children:[G.slice(0,ge),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:ca,children:G.slice(ge,ge+ne.length)}),G.slice(ge+ne.length)]})},[he,ca]),zo=b?sc:rc,ac=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Md,Wo=Fd,ic=useCallback(G=>{Se.current=G;},[]),ua=useCallback(G=>{let ne=Se.current;if(!ne)return;let ve=Mn.length;if(ve===0)return;let Me=pe.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),ge=-1;if(Me){let Ze=Me.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),sn=Me.querySelector("[data-active]")||Me.querySelector("[data-hovered]");sn&&(ge=Array.from(Ze).indexOf(sn));}ge<0&&typeof ne.activeIndex=="number"&&(ge=ne.activeIndex);let pt=ge<0?G===1?0:ve-1:(ge+G+ve)%ve;ne.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=pe.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(Ur=>Ur.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(Ur=>Ur.removeAttribute("data-hovered"));let Vr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Vr&&(Vr.setAttribute("data-active",""),Vr.scrollIntoView?.({block:"nearest"}));});},[Mn.length]),lc=useCallback(G=>{if(G.key===" "||G.code==="Space"||G.key==="Spacebar"){G.stopPropagation();return}if(G.key==="ArrowDown"||G.key==="ArrowUp"){if(x||!Fn&&!Je)return;G.preventDefault(),!ee&&!Z&&De(true),ua(G.key==="ArrowDown"?1:-1);return}if(G.key==="Enter"){if(x)return;let ne=Se.current&&typeof Se.current.activeIndex=="number"?Se.current.activeIndex:-1,ve=ne>=0&&ne<Mn.length?Mn[ne]:null;if(ee&&ve&&ne>=0){G.preventDefault(),G.stopPropagation(),z?(ia(ve.value),v||requestAnimationFrame(()=>se.current?.focus())):$o(ve.value);return}}else G.key==="Escape"?(G.preventDefault(),G.stopPropagation(),ee&&!Z&&(re.current=true,De(false),G.target.focus(),setTimeout(()=>{re.current=false;},150))):G.key==="Tab"&&ee&&!Z&&De(false);},[Fn,Je,ee,Z,Mn,z,v,ua,ia,$o,De,x]),cc=useCallback(()=>{x||re.current||C&&Lo&&(qe.current=Date.now(),Z||De(true));},[Z,C,Lo,De,x]),uc=useCallback(()=>{if(J.current){J.current=false;return}N&&De(false),!K&&!z&&(Oe?je(Oe.title??Oe.value):he.trim()&&je(""));},[N,K,z,Oe,he,De]),da=useCallback(()=>{let G=[],ne=0;return Kt.forEach((ve,Me)=>{ve.label&&G.push(jsx(mn,{className:it("group-label"),children:ve.label},`g-${Me}`)),ve.items.forEach(ge=>{G.push(jsx(ys,{item:ge,absIndex:ne,multiple:true,getCurrentMulti:yt,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:la,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:we},`${ge.group??"__"}|${ge.value}`)),ne+=1;});}),jsx(gs,{values:fe,onValuesChange:Bo,children:G},"multi-group")},[Kt,it,yt,s,zo,fe,Bo,la,Wo,Oo,we]),pa=useCallback(()=>{let G=[],ne=0;return Kt.forEach((ve,Me)=>{ve.label&&G.push(jsx(mn,{className:it("group-label"),children:ve.label},`g-${Me}`)),ve.items.forEach(ge=>{let pt=Oe?.value===ge.value;G.push(jsx(ys,{item:ge,absIndex:ne,multiple:false,getCurrentMulti:yt,isSelected:pt,renderItem:s,paint:zo,cls:it,closeOnSelect:v,pickSingle:$o,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:we},`${ge.group??"__"}|${ge.value}`)),ne+=1;});}),G},[Kt,it,Oe,yt,s,zo,v,$o,Wo,Oo,we]),dc=useMemo(()=>ke?jsx(mn,{css:L,className:it("label-loading"),children:W},"loading"):Wr?jsx(mn,{css:D,className:it("label-empty"),children:M},"empty"):Kt.length===0?null:z?da():pa(),[ke,Wr,Kt.length,it,W,M,z,da,pa]),rn=ee?false:x||!Je&&!Ho&&!A,ma=useCallback(G=>{G.preventDefault(),G.stopPropagation(),!(rn||x)&&(Z||(ee?(re.current=true,De(false),queueMicrotask(()=>se.current?.focus()),setTimeout(()=>{re.current=false;},150)):(De(true),queueMicrotask(()=>se.current?.focus()))));},[ee,Ho,Je,De,rn,x,Z]),fa=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:ee?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:rn?"not-allowed":"pointer",userSelect:"none",opacity:rn?.5:1}),[ee,rn]),Ko=useMemo(()=>ae?jsx("span",{ref:oe,role:"button",tabIndex:-1,css:[fa,q],"aria-disabled":rn||void 0,onMouseDown:Ad,onClick:ma,children:X??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[ae,fa,q,rn,ma,X]),pc=useMemo(()=>T&&Ko?jsxs("span",{css:Td,children:[T,Ko]}):T??Ko,[T,Ko]),mc=useCallback(G=>{if(!(oe.current&&oe.current.contains(G.target)||re.current||x||Date.now()-qe.current<300)){if(ee){!he.trim()&&!Z&&(re.current=true,De(false),setTimeout(()=>{re.current=false;},150));return}w&&Lo&&(!Z||w)&&De(true);}},[ee,he,w,Lo,De,x,Z]);return jsx("div",{ref:pe,className:it(""),css:[ac,l,c],children:jsxs($n,{open:x?false:ee,onOpenChange:x?void 0:De,children:[jsx(Fi,{onCapture:ic}),jsx(zn,{asChild:true,children:jsx("span",{className:it("anchor"),css:Rd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:se,className:it("input"),focusRingMode:a,value:he,onChange:oc,onKeyDown:lc,onFocus:cc,onBlur:uc,onSurfaceClick:mc,placeholder:r,label:u,helperText:d,variant:y,startIcon:f,endIcon:pc,size:I,width:n,fullWidth:o,disabled:x,error:R,showClear:g,css:i,wrapperCss:Y,inputCss:le,labelCss:ie,helperRowCss:be,helperTextCss:Pe,startIconCss:Re,endIconCss:Ce}),jsx("span",{ref:Ne,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),Fn&&jsx(hn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ie,ignoreOutsidePressRefs:j,disableOutsidePressDismiss:Z,returnFocus:!B,children:dc})]})})});Ai.displayName="Autocomplete";var Ld=["sm","md","lg"],Bd=(e,t)=>typeof e=="number"?e:Ld.includes(e)?t.componentHeights[e]:t.componentHeights.md,$d=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},zd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Od=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Pi=me.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},l)=>{let u=V(),[d,y]=useState(!!e);useEffect(()=>{y(!!e);},[e]);let f=Bd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,I=T?Math.round(T*(T<=28?.55:.52)):void 0,x=r?u.radius.full:u.radius.md,R=$d(u,o),g=zd(u,o),p=Od(c,t),m=css({width:f,height:f,borderRadius:x,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:d?"transparent":R,color:d?"inherit":g,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),P=css({fontSize:I,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:l,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[m,a],role:d?void 0:"img","aria-label":d?void 0:t,...i,children:d&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>y(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:P,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:P,children:p})})}));Pi.displayName="Avatar";var Ni=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,jd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:l})=>{let u=V(),d=xe(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let w=(u.componentHeights&&u.componentHeights[n])??(u.spacing&&u.spacing[n]);return Ni(w??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),I=typeof t=="number"&&t>=0,x=I&&T.length>t?T.slice(0,t):T,R=I&&T.length>t?T.length-t:0,g=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,p=Ni(i)??"4px",m=css({display:"flex",alignItems:"center"}),C=w=>css({marginLeft:w===0?0:o,zIndex:x.length-w,boxShadow:`0 0 0 ${p} ${g}`,backgroundColor:g,borderRadius:s?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),P=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[m,r,d()],children:[x.map((w,v)=>{if(!isValidElement(w))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(v),children:jsx("span",{css:P,children:w})},v);let N=w,B=N.props?.css,K=B==null?P:[P,B],O=cloneElement(N,{size:n,rounded:s,css:K,style:{...N.props?.style,width:"100%",height:"100%",objectFit:N.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(v),children:O},v)}),R>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${R} more`,children:["+",R]})]})};var Li=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ud=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},qd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",Gd=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",Xd=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",Yd=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),Jd=me.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:d,animate:y=true,size:f,outline:T=false,outlineColor:I,className:x,badgeClassName:R,css:g,badgeCss:p,offsetX:m,offsetY:C})=>{let P=V(),w=s==="dot",v=f??(w?8:17),N=r??(w?0:10),{scale:B,onKey:K}=Ud(P,t),O=qd(B),S=P.text?.onColors||{},F=Gd(P,S,K,n),M=Xd(e,a,s),b=Yd(i,s,e,c),h=css({position:"relative",display:"inline-block"}),A=u==="circular"?w?"12.5%":"5%":w?"5%":"2.5%",D=Li(m??A),L=Li(C??A),k=l.vertical||"top",E=l.horizontal||"right",W={},$="0",z="0";k==="center"?(W.top="50%",z="-50%"):k==="top"?(W.top=L,z="-45%"):(W.bottom=L,z="45%"),E==="center"?(W.left="50%",$="-50%"):E==="right"?(W.right=D,$="45%"):(W.left=D,$="-45%");let _=b?1:.8,H=css({minWidth:w?v:v/2,height:v,background:O,color:F,fontSize:typeof N=="number"?`${N}px`:N,fontWeight:o,borderRadius:999,padding:w?0:`0 ${v/4}px`,boxShadow:"0 2px 8px rgba(0,0,0,0.04)",lineHeight:1,position:"absolute",pointerEvents:"none",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",...T?{boxShadow:`0 0 0 2px ${I??P.surface?.appBg}`}:{},opacity:b?1:0,transform:`translate(${$}, ${z}) scale(${b?_:.5})`,...y?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...W});return jsxs("div",{className:["plainframe-ui-badge-wrapper",x||""].join(" ").trim(),css:[h,g],children:[d,jsx("span",{"aria-hidden":!b,className:["plainframe-ui-badge",R||""].join(" ").trim(),css:[H,p],children:M})]})});var Es=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:d=true,className:y,contentClassName:f,lockScroll:T=true,...I})=>{let x=V(),R=useMemo(()=>r??x.surface.overlayBg,[r,x.surface.overlayBg]),[g,p]=useState(e),[m,C]=useState(e),P=useRef(null),w=useRef(null),v=useRef(null);useEffect(()=>(P.current&&(clearTimeout(P.current),P.current=null),w.current!=null&&(cancelAnimationFrame(w.current),w.current=null),e?(p(true),w.current=requestAnimationFrame(()=>{C(true),w.current=null;})):(C(false),P.current=setTimeout(()=>{p(false),P.current=null;},u)),()=>{P.current&&(clearTimeout(P.current),P.current=null),w.current!=null&&(cancelAnimationFrame(w.current),w.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let F=document.body,M=F.style.overflow,b=F.style.paddingRight,h=window.innerWidth-document.documentElement.clientWidth,A=parseFloat(getComputedStyle(F).paddingRight||"0");return F.style.overflow="hidden",h>0&&(F.style.paddingRight=`${A+h}px`),()=>{F.style.overflow=M,F.style.paddingRight=b;}},[e,T]),useEffect(()=>{if(!m||!t)return;let F=M=>{M.key==="Escape"&&t();};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[m,t]);let N=F=>{if(!m||!t||!v.current)return;let M=F.target;M&&!v.current.contains(M)&&t();},B=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!d&&!g)return null;let K=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:m?"auto":"none",visibility:g?"visible":"hidden"}),O=css({position:"absolute",inset:0,background:R,backdropFilter:B?`blur(${B})`:void 0,WebkitBackdropFilter:B?`blur(${B})`:void 0,opacity:m?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:m?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:m?"auto":"none"});return jsxs("div",{"aria-hidden":!g||void 0,className:["plainframe-ui-backdrop",y||""].join(" ").trim(),css:[K,a],onPointerDown:N,...I,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[O,i],role:"presentation"}),jsx("div",{ref:v,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[S,c],children:l})]})};var yr=()=>null;Object.defineProperty(yr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function np(e){let t=e.props??{};return {type:typeof t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__<"u"?t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__:e.type,props:t}}var op=me.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:l,...u})=>{let d=V(),y=xe(),f=me.useMemo(()=>me.Children.toArray(e).flatMap(p=>{if(!me.isValidElement(p))return [];let{type:m,props:C}=np(p);if(!(m===yr||typeof m=="function"&&"displayName"in m&&m.displayName===yr.displayName))return [];let w=C;return [{href:w.href,disabled:w.disabled,node:w.children,className:w.className,css:w.css,onClick:w.onClick,startIcon:w.startIcon,endIcon:w.endIcon}]}),[e]),T=me.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:d.typography.sizes.sm,fontWeight:500,gap:d.spacing.xs,cursor:"default"}),[d]),I=me.useMemo(()=>css({margin:"0 0.15rem",color:d.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[d]),x=me.useCallback((p,m,C)=>{let P=p?d.text.primary:d.text.secondary,w=i&&m&&!C;return css({display:"inline-flex",alignItems:"center",gap:d.spacing.xs,color:P,cursor:m&&!C?"pointer":"default",textDecoration:"none",borderRadius:d.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":w?{textDecoration:"underline",color:d.text.primary}:{textDecoration:"none"}})},[d,i]),R=me.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=me.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((p,m)=>{let C=m===f.length-1,P=!!p.href&&!p.disabled&&!C,w=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",P?"plainframe-ui-breadcrumb--link":"",p.className||""].join(" ").trim(),v=[x(C,P,p.disabled),o,C?r:s,P?a:void 0,y(),p.css],N=jsxs(Fragment,{children:[p.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:R,children:p.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:g,children:p.node}),p.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:R,children:p.endIcon})]});return jsxs(me.Fragment,{children:[m!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[I,c],children:t}),P?jsx("a",{href:p.href,onClick:p.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:w,css:v,children:N}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:w,css:v,children:N})]},m)})})});var ks=(e,t)=>{if(!isValidElement(e))return e;let n=e.props,o={};return n.size===void 0&&(o.size=t),n.color===void 0&&(o.color="currentColor"),cloneElement(e,{...n,...o})},Is=e=>typeof e=="number"?`${e}px`:e,Oi=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Oi(n)&&(t=true));}),t};function ip(e,t){let n=e,o=typeof t=="string"&&(t==="sm"||t==="md"||t==="lg")?t:"md";return o==="sm"?{fontSize:n.typography.sizes.sm,paddingY:n.spacing.xs,paddingX:n.spacing.md,paddingXIcon:n.spacing.md,iconSize:14,minHeight:n.componentHeights.sm,radius:n.radius.sm}:o==="lg"?{fontSize:n.typography.sizes.md,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:18,minHeight:n.componentHeights.lg,radius:n.radius.md}:{fontSize:n.typography.sizes.sm,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:16,minHeight:n.componentHeights.md,radius:n.radius.md}}function lp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(d,y,f)=>d&&d[y]||f;if(t==="primary"){let d=s,y=u(d,600,n[900])||u(d,500,n[900]),f=u(d,500,n[800])||u(d,600,n[800]);return {bg:y,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let d=a,y=u(d,600,n[900])||u(d,500,n[900]),f=u(d,500,n[800])||u(d,600,n[800]);return {bg:y,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var Wi=me.memo(me.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:d,hoverEffect:y=true,icon:f,onClick:T,css:I,...x},R)=>{let g=V(),p=xe(),m=useMemo(()=>ip(g,t),[g,t]),C=useMemo(()=>lp(g,e),[g,e]),P=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Oi(u)&&me.Children.count(u)===1,[f,n,o,u]),w=m.iconSize,v=useMemo(()=>ks(n,w),[n,w]),N=useMemo(()=>ks(o,w),[o,w]),B=useMemo(()=>i??jsx(no,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),K=useMemo(()=>P?"center":l??"center",[P,l]),O=!!c&&K==="center",S=!!c&&K==="start",F=!!c&&K==="end",M=a||c,b=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:m.minHeight,lineHeight:1,fontWeight:600,cursor:M?"not-allowed":"pointer",opacity:M?.5:1,userSelect:"none",position:"relative",borderRadius:r?g.radius.full:m.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,m,r,g,M]),h=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),A=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":y&&!M?{":hover::before":{opacity:1}}:{}}),[C,y,M]),D=useMemo(()=>css(P&&!s?{width:"100%",height:"100%",maxWidth:m.minHeight,minWidth:m.minHeight,maxHeight:m.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Is(m.iconSize)}:{fontSize:Is(m.fontSize),padding:n||o?`${m.paddingY} ${m.paddingXIcon}`:`${m.paddingY} ${m.paddingX}`}),[P,s,m,n,o]),L=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Is(g.spacing.sm),opacity:O?0:1,transition:"opacity 140ms ease"}),[g,O]),k=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),E=useMemo(()=>typeof m.iconSize=="number"?m.iconSize:Math.max(12,Math.round(parseFloat(String(m.iconSize))||16)),[m.iconSize]),W=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:E,minWidth:E,maxWidth:E,height:"1em"}),[E]),$=useMemo(()=>X=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:X?1:0,transition:"opacity 140ms ease"}),[]),z=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:O?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[O]),_=useMemo(()=>()=>{if(P)return null;let X=!!n;return !X&&!S?null:jsxs("span",{css:W,"aria-hidden":c?true:void 0,children:[jsx("span",{css:$(!S),children:X?v||n:null}),jsx("span",{css:$(!!S),children:B})]})},[P,n,S,W,$,v,c,B]),H=useMemo(()=>()=>{if(P)return null;let X=!!o;return !X&&!F?null:jsxs("span",{css:W,"aria-hidden":c?true:void 0,children:[jsx("span",{css:$(!F),children:X?N||o:null}),jsx("span",{css:$(!!F),children:B})]})},[P,o,F,W,$,N,c,B]),U=!(a||c);return jsxs("button",{ref:R,type:"type"in x&&x.type?x.type:"button","data-variant":e,className:["plainframe-ui-button",d||""].join(" ").trim(),css:[b,p({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),h,A,D,I],onClick:U?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...x,children:[jsxs("span",{className:"plainframe-ui-button-content",css:L,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:k,children:P?c?B:ks(u,m.iconSize):u}),H()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:z,"aria-hidden":"true",children:O?B:null})]})}));Wi.displayName="Button";var Rr=e=>isValidElement(e),cp=e=>{let t=e.type;return t.displayName??t.name},As=(e,t)=>cp(e)===t,ji=e=>As(e,"ButtonGroup"),Vi=e=>As(e,"DropdownMenu"),Ms=e=>As(e,"DropdownMenuTrigger"),Kn=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,up=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,dp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Fs=(e,t)=>{if(!Rr(e))return null;if(ji(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Fs(t?n[0]:n[n.length-1],t):null}if(Vi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Ms);return o?Fs(o,t):null}if(Ms(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},_i=(e,t)=>{if(!e)return false;let n=Fs(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return dp(o)},Ui=me.memo(me.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:d="group",css:y,__clipLeft:f,__clipRight:T,...I},x){let R=V(),g=a==="sm"?R.radius.sm:R.radius.md,p=c?R.radius.full:g,m=o==="vertical",C=up(R.componentHeights.border,1),P=R.surface.border,w=n&&!!f,v=n&&!!T,N=css({display:"flex",flexDirection:m?"column":"row",width:r?"100%":l!=null?Kn(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Kn(i??R.spacing.sm)}),B=Children.toArray(t),O=B.filter(Rr).length,S=0,F=false,M=[];for(let b of B){if(!Rr(b)){M.push(b);continue}let h=S===0,A=S===O-1,D=b.props??{},L=D.disabled??s,k=D.size??a,E=0,W=0,$=0,z=0;n&&(m?(E=h?w?0:p:0,W=h?v?0:p:0,z=A?w?0:p:0,$=A?v?0:p:0):(E=h?w?0:p:0,z=h?w?0:p:0,W=A?v?0:p:0,$=A?v?0:p:0));let _=_i(b,"left"),H=_i(b,"right"),ae=n&&!h&&!(F&&_)&&!(F||_)?css({[m?"borderTop":"borderLeft"]:`${C} solid ${P}`}):null,q=n&&!h&&F&&_?css(m?{borderTopWidth:0}:{borderLeftWidth:0}):null,Y=n?css({borderTopLeftRadius:Kn(E),borderTopRightRadius:Kn(W),borderBottomRightRadius:Kn($),borderBottomLeftRadius:Kn(z)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ie=css([Y,ae,q,le]);if(!Vi(b)){let Ce=D.css,Ie=[D.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Te=ji(b)&&n?{__clipLeft:!h,__clipRight:!A}:{},we=cloneElement(b,{...D,disabled:L,size:k,className:Ie,css:[Ce,ie],...Te});M.push(we),F=H,S+=1;continue}let be=D.children,Pe=Children.map(be,Ce=>{if(!Rr(Ce)||!Ms(Ce))return Ce;let Ie=Ce.props,Te=[Ie.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(Ce,{...Ie,css:[Ie.css,ie],className:Te,disabled:L,size:k})}),Re=cloneElement(b,{...D,children:Pe});M.push(Re),F=H,S+=1;}return jsx("div",{ref:x,role:d,"aria-orientation":m?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[N,y],...I,children:M})}));Ui.displayName="ButtonGroup";var Tr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,hp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Tr(n?.[e]??e)}}},yp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Tr(n?.[e]??e)}}},xp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},vp=(e,t,n)=>{let o=t.surface??{};return e==="panel"||e==="outlined"?o.panelHover??o.panelBg??n:e==="subtle"?o.subtleHover??o.subtleBg??n:o.subtleBg??n},_n=me.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:d,width:y,height:f,onClick:T,onKeyDown:I,role:x,tabIndex:R,...g},p){let m=V(),C=m.surface??{},[P,w]=useState(!!u),v=l!=null,N=v?!!l:P,B=useMemo(()=>xp(o,m),[o,m]),K=useMemo(()=>vp(o,m,B),[o,m,B]),O=K,S=useMemo(()=>hp(r,m),[r,m]),F=useMemo(()=>yp(s,m),[s,m]),M=!!c||!!i,b=useMemo(()=>css({backgroundColor:B,padding:S,borderRadius:F,border:o==="outlined"?`${m.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:y?"100%":void 0,maxWidth:Tr(y),height:Tr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:M?"pointer":void 0,...M?{"&:hover":{backgroundColor:K}}:{},'&[data-selected="true"]':{backgroundColor:O},...M?{'&[data-selected="true"]:hover':{backgroundColor:O}}:{}}),[B,S,F,o,m.componentHeights,C.border,y,f,M,K,O]),h=useCallback(()=>{if(!i)return;let k=!N;v||w(k),d?.(k);},[v,d,i,N]),A=useCallback(k=>{i&&h(),T?.(k);},[i,h,T]),D=useCallback(k=>{i&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),h()),I?.(k);},[i,h,I]),L=xe();return jsx("div",{ref:p,"data-variant":o,"data-selected":i&&N?"true":void 0,"aria-pressed":i?N:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[L(),b,n],onClick:A,onKeyDown:D,role:i?x??"button":x,tabIndex:i?R??0:R,...g,children:t})}));_n.displayName="Container";var Rp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Ns(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return Rp(o)}return e}}}function yo(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Ds(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Tp(e,t){if(e==null)return t.spacing?.md??void 0;if(typeof e=="number")return e;if(typeof e=="string"){let n=t.spacing??t.space??{};return e in n?n[e]:e}}function xo(e,t,n,o){let r=Ns(t,e),s=Ns(n,e),a=Ns(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function qi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Gi=me.createContext("horizontal"),Hs=()=>me.useContext(Gi),Xi=me.memo(me.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:d,gap:y,direction:f="horizontal",className:T,onClick:I,...x},R)=>{let g=V(),p=xe(),m=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:m?"column":"row",gap:Tp(y,g),alignItems:m?"stretch":"center",transition:"all .16s ease"});return jsx(Gi.Provider,{value:f,children:jsx(_n,{ref:R,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:d,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[p(),C,t],onClick:I,tabIndex:I?0:void 0,...x,children:e})})}));Xi.displayName="Card";var wp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Hs()==="vertical",d=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:yo(o),textAlign:Ds(o),...u?{width:"100%"}:{flex:1,minWidth:0},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[d,t],...c,children:e})}),Ep=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Hs()==="vertical",d=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[d,t],...c,children:e})}),kp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Hs()==="vertical",d=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[d,t],...c,children:e})}),Ip=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let d=V(),y=css({fontWeight:c??500,fontSize:i??(d.typography?.sizes?.sm!==void 0?d.typography.sizes.sm:"1rem"),color:qi(d,l)??d.text?.primary,textAlign:Ds(o),...xo(d,r,s,a),display:"flex",alignItems:"center",gap:d.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[y,t],...u,children:e})}),Sp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let d=V(),y=css({fontWeight:c??400,fontSize:i??(d.typography?.sizes?.sm!==void 0?d.typography.sizes.sm:"0.875rem"),color:qi(d,l)??d.text?.secondary,marginTop:d.spacing?.xxs??2,textAlign:Ds(o),...xo(d,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[y,t],...u,children:e})});var Ji=e=>isValidElement(e),Pp=e=>Ji(e)?e.type?.displayName||e.type?.name:void 0,Yi=e=>Pp(e)==="Card",Np=e=>typeof e=="number"?`${e}px`:e,Zi=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=V(),u=r==="vertical",d=String(l.componentHeights?.border??"1px"),y=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?Np(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),x=T.filter(Yi).length,R=0,g=T.map((p,m)=>{if(!Yi(p)||!Ji(p))return p;let C=p.props,P=R++,w=P===0,v=P===x-1,N=s??C.variant,B=t?u?{borderTopLeftRadius:w?C.radius:0,borderTopRightRadius:w?C.radius:0,borderBottomLeftRadius:v?C.radius:0,borderBottomRightRadius:v?C.radius:0}:{borderTopLeftRadius:w?C.radius:0,borderBottomLeftRadius:w?C.radius:0,borderTopRightRadius:v?C.radius:0,borderBottomRightRadius:v?C.radius:0}:void 0,K=t&&!w?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,O=N==="subtle"&&x>1&&!w?u?{borderTop:`${d} solid ${y}`}:{borderLeft:`${d} solid ${y}`}:null,F=[B,K,O,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),M=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(p,{...C,variant:N??C.variant,css:[C.css,...F],className:M,key:typeof p=="object"&&"key"in p?p.key:m})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:g})};Zi.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,el=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&el(n)&&(t=true));}),t},Bp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},tl=me.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:d,disabled:y,cursor:f,className:T,css:I},x){let R=V(),g=xe(),p=["sm","md","lg"].includes(i)?i:"md",m=useMemo(()=>Bp(R,p),[R,p]),C=!!l&&!y,P=y?"not-allowed":f||(C?"pointer":"inherit"),w=String(R.componentHeights?.border??"1px"),v=useMemo(()=>{let X=R.palette;return r==="secondary"||r==="neutral"?"neutral":r&&X[r]?r:"primary"},[r,R.palette]),N=useCallback(X=>{let ae=R.palette;return (v==="neutral"?R.neutral[X]:ae[v]?.[X])??ae.primary?.[X]},[v,R.neutral,R.palette]),B=useMemo(()=>v==="neutral"?R.neutral[100]:N(50),[v,N,R.neutral]),K=useMemo(()=>v==="neutral"?R.text.secondary:N(800),[v,N,R.text.secondary]),O=useMemo(()=>v==="neutral"?R.neutral[100]:N(50),[v,N,R.neutral]),S=useMemo(()=>v==="neutral"?R.text.secondary:N(800),[v,N,R.text.secondary]),F=useMemo(()=>v==="neutral"?R.neutral[400]:N(300),[v,N,R.neutral]),M=useMemo(()=>v==="neutral"?R.surface.subtleBg:N(600),[v,N,R.surface.subtleBg]),b=useMemo(()=>(R.text.onColors??{})[v]??(v==="neutral"?R.neutral[900]:R.neutral[0]??"#fff"),[v,R.text.onColors,R.neutral]),h="transparent",A=useMemo(()=>v==="neutral"?R.text.secondary:N(700)??R.text.primary,[v,N,R.text.primary,R.text.secondary]),D=useMemo(()=>!a&&!c&&t!=null&&!el(t)&&me.Children.count(t)===1,[a,c,t]),L=useMemo(()=>o==="filled"?css({backgroundColor:M,color:b,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:O,color:S,border:"none",boxShadow:`inset 0 0 0 ${w} ${F}`}):o==="ghost"?css({backgroundColor:h,color:A,border:"none",boxShadow:"none"}):css({backgroundColor:B,color:K,border:"none",boxShadow:"none"}),[M,b,A,O,S,F,B,K,w,o]),k=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Le(m.gap),padding:o==="ghost"?0:D||t==null?Le(m.soloPadding):`${Le(m.paddingY)} ${Le(m.paddingX)}`,borderRadius:s?R.radius.full:m.radius,fontWeight:600,cursor:P,opacity:y?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...D?{lineHeight:1,minWidth:`calc(${Le(m.iconSize)} + ${Le(m.soloPadding)} * 2)`,minHeight:`calc(${Le(m.iconSize)} + ${Le(m.soloPadding)} * 2)`,justifyContent:"center"}:null}),[m,P,t,y,D,s,R.radius.full,o]),E=useMemo(()=>css({fontSize:Le(D?m.iconSize:m.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:D?Le(m.iconSize):void 0,height:D?Le(m.iconSize):void 0,display:D?"block":void 0}}),[m.fontSize,m.iconSize,D]),W=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Le(m.iconSize),lineHeight:0,"& > svg":{width:Le(m.iconSize),height:Le(m.iconSize),display:"block"}}),[m.iconSize]),$=useMemo(()=>css({marginRight:D||t==null?0:Le(m.gap),marginLeft:D||t==null?0:Le(m.iconOffset)}),[m.gap,m.iconOffset,t,D]),z=useMemo(()=>css({marginLeft:D||t==null?0:Le(m.gap),marginRight:D||t==null?0:Le(s?m.iconOffsetRounded:m.iconOffset)}),[m.gap,m.iconOffset,m.iconOffsetRounded,t,D,s]),_=useMemo(()=>css({marginRight:s?0:Le(m.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:y?"not-allowed":"pointer",color:"currentColor",opacity:y?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:Le(m.iconSize),borderRadius:R.radius.xs}),[m.iconOffset,m.iconSize,y,s,R.radius.xs]),H=useCallback(X=>{C&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:m.iconSize,height:m.iconSize},strokeWidth:2.5}),[m.iconSize]);return jsxs("div",{ref:x,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[k,L,C?g({color:r??"primary"}):null,I],onClick:C?l:void 0,onKeyDown:H,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":y||void 0,"data-variant":o,"data-color":v,"data-size":i,"data-icon-only":D||void 0,children:[a&&jsx("span",{css:[W,$],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[E,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[W,z],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:y,tabIndex:0,onClick:X=>{X.stopPropagation(),y||u?.();},css:[_,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:d||U})]})}));tl.displayName="Chip";var Wp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Kp=me.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:d,placeholder:y,separator:f,gapPx:T}){let I=xe(),x=r.neutral,R=r.text,g=r.componentHeights.border,p=useRef([]),[m,C]=useState(0),P=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),w=useMemo(()=>{if(!y)return Array(o).fill("");if(y.length===1)return Array(o).fill(y);let D=y.slice(0,o).split("");for(;D.length<o;)D.push("");return D},[y,o]),v=useMemo(()=>{let D=r.componentHeights[s];return `calc(${typeof D=="number"?`${D}px`:D} * 1.5)`},[r.componentHeights,s]),N=l?x[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",B=c==="outlined"?`${g} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",K=D=>css({width:v,height:v,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:N,border:B,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?x[500]:i?r.palette.danger?.[800]??R.primary:R.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??R.primary:R.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??R.secondary:R.secondary,opacity:.85}},u?I({enabled:true,disabled:l,mode:d==="always"?"always":"visible",color:i?"danger":void 0}):void 0,D?css({}):null),O=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.secondary,userSelect:"none"}),F=D=>D.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),M=useCallback(D=>{let L=Math.max(0,Math.min(o-1,D));C(L),p.current[L]?.focus();},[o]),b=useCallback((D,L)=>{let k=F(L).slice(0,1),E=[...P];E[D]=k,n(E.join("")),k&&D<o-1&&M(D+1);},[P,o,n,M]),h=useCallback((D,L)=>{if(L.key==="Backspace")if(!P[D]&&D>0){let k=[...P];k[D-1]="",n(k.join("")),M(D-1),L.preventDefault();return}else {let k=[...P];k[D]="",n(k.join(""));return}if(L.key==="ArrowLeft"&&D>0){L.preventDefault(),M(D-1);return}if(L.key==="ArrowRight"&&D<o-1){L.preventDefault(),M(D+1);return}if(L.key==="Home"){L.preventDefault(),M(0);return}if(L.key==="End"){L.preventDefault(),M(o-1);return}},[P,o,n,M]),A=useCallback(D=>{let L=F(D.clipboardData.getData("text")).slice(0,o);L&&(n(L),requestAnimationFrame(()=>{let k=Math.min(L.length,o-1);M(k);}),D.preventDefault());},[o,n,M]);return jsx("div",{className:"plainframe-ui-code-boxes",css:O,children:Array.from({length:o}).map((D,L)=>jsxs(me.Fragment,{children:[jsx("input",{ref:k=>{p.current[L]=k;},type:"text",inputMode:"text",maxLength:1,value:P[L]||"",placeholder:P[L]?"":w[L]||"",disabled:l,onChange:k=>b(L,k.target.value),onKeyDown:k=>h(L,k),onFocus:()=>C(L),onPaste:L===0?A:void 0,className:"plainframe-ui-code-box",css:K(L===m),"aria-label":`Code character ${L+1}`,tabIndex:L===m?0:-1}),f&&L<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:S,children:f}):null]},L))})}),_p=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:d="subtle",length:y=4,focusRingMode:f="always",className:T,wrapperCss:I,labelCss:x,helperRowCss:R,helperTextCss:g,css:p})=>{let m=V(),C=useId(),P=useMemo(()=>({sm:{labelFont:m.typography.sizes.xs,helperFont:m.typography.sizes.xs,minHeight:m.componentHeights.sm,paddingY:0,paddingX:m.spacing.md,codeFontSize:21},md:{labelFont:m.typography.sizes.sm,helperFont:m.typography.sizes.xs,minHeight:m.componentHeights.md,paddingY:0,paddingX:m.spacing.md,codeFontSize:24},lg:{labelFont:m.typography.sizes.md,helperFont:m.typography.sizes.sm,minHeight:m.componentHeights.lg,paddingY:0,paddingX:m.spacing.md,codeFontSize:28}}),[m]),w=["sm","md","lg"].includes(u)?u:"md",v=P[w],N=m.neutral,B=m.text,K=t!=null,[O,S]=useState(n),F=K?t:O,M=$=>{K||S($),o?.($);},b=Math.max(2,Math.min(y,10)),h=m.spacing.sm,A=Wp(l??h)??"0px",D=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:i?"not-allowed":"auto"},...Array.isArray(I)?I:I?[I]:[]),L=css({fontSize:v.labelFont,fontWeight:500,color:a?m.palette.danger?.[700]??B.primary:i?N[500]:B.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(x)?x:x?[x]:[]),k=css({display:"flex",alignItems:"center",justifyContent:"center",gap:A,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(p)?p:p?[p]:[]),E=css({minHeight:16,fontSize:v.helperFont,color:a?m.palette.danger?.[700]??B.secondary:B.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(R)?R:R?[R]:[]),W=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?m.palette.danger?.[700]??B.primary:i?N[500]:B.primary},...Array.isArray(g)?g:g?[g]:[]);return jsxs("div",{className:["plainframe-ui-codefield",T||""].join(" ").trim(),css:D,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:L,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:k,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Kp,{value:F||"",onChange:M,len:b,theme:m,sizeKey:w,s:{codeFontSize:v.codeFontSize},variant:d,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:A})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:E,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:W,children:c})})]})};var al=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},Bs=e=>{if(!e||typeof e!="object")return false;let t=al(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some(Bs):Bs(o)},Vp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=me.useRef(null),[c,i]=me.useState(false),l=me.useCallback(E=>{i(E),o?.(E);},[o]),u=me.useCallback(()=>l(false),[l]),d=me.useRef({x:0,y:0}),y=me.useRef(null),f=me.useRef(null),T=me.useCallback(()=>{f.current=null;let E=y.current;if(!E)return;let W=Math.round(d.current.x),$=Math.round(d.current.y);E.style.transform=`translate3d(${W}px, ${$}px, 0)`;},[]),I=me.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);me.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let x=me.useMemo(()=>({getBoundingClientRect:()=>{let E=Math.round(d.current.x),W=Math.round(d.current.y);return {x:E,y:W,left:E,top:W,right:E,bottom:W,width:0,height:0,toJSON:()=>({x:E,y:W})}}}),[]),R=me.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=me.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${R.current}"]`):null,[]),p=me.useRef(null),m=me.useRef(null),C=me.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),P=me.useCallback(()=>{m.current!=null&&clearTimeout(m.current),m.current=null;},[]),w=me.useCallback(()=>{P(),m.current=window.setTimeout(()=>l(false),0);},[P,l]),v=me.useCallback(()=>{let E=a.current?.getBoundingClientRect();return E?{x:E.left+E.width/2,y:E.top+E.height/2}:{x:0,y:0}},[]),N=me.useCallback((E,W)=>{d.current={x:E,y:W},I(),l(true);},[I,l]),B=typeof t=="function"?t({close:u}):t,K=Bs(B),O=E=>{if(!me.isValidElement(E))return E;let W=al(E),$=E,z=$.props.children,_=z==null?z:Array.isArray(z)?z.map(H=>me.isValidElement(H)?O(H):H):me.isValidElement(z)?O(z):z;if(W==="DropdownMenu"){let H=$.props.onOpenChange;return me.cloneElement($,{...$.props,open:c,onOpenChange:U=>{H?.(U),l(U);},children:_})}if(W==="DropdownMenuContent"){let H=$.props.onMouseEnter,U=$.props.onMouseLeave;return me.cloneElement($,{...$.props,anchor:x,"data-cz-id":R.current,onMouseEnter:X=>{P(),H?.(X);},onMouseLeave:X=>{w(),U?.(X);},children:_})}return _===z?$:me.cloneElement($,{...$.props,children:_})},S=K?O(B):B,F=me.useCallback(E=>{E.preventDefault(),N(E.clientX,E.clientY);},[N]),M=me.useCallback(E=>{n==="contextmenu"&&F(E);},[n,F]),b=me.useCallback(E=>{n==="dblclick"&&F(E);},[n,F]),h=me.useCallback(E=>{n==="click"&&F(E);},[n,F]),A=me.useCallback(E=>{if(n!=="hover")return;C(),P();let W=r==="center"?v():{x:E.clientX,y:E.clientY};p.current=window.setTimeout(()=>{let $=W.x+(r==="cursor"?s:0),z=W.y+(r==="cursor"?s:0);N($,z);},0);},[n,r,s,v,N,C,P]),D=me.useCallback(E=>{n==="hover"&&c&&r==="cursor"&&!K&&(d.current={x:E.clientX+s,y:E.clientY+s},I());},[n,c,r,K,s,I]),L=me.useCallback(()=>{n==="hover"&&(C(),w());},[n,C,w]);me.useEffect(()=>{if(n!=="hover")return;let E=()=>{if(!c)return;let W=a.current?.matches(":hover"),$=g()?.matches?.(":hover");W||$?P():w();};return window.addEventListener("pointermove",E,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",E,{capture:true})},[c,n,g,P,w]),me.useEffect(()=>{let E=()=>{if(c)if(n==="hover"){let W=a.current?.matches(":hover"),$=g()?.matches?.(":hover");if(W||$?P():w(),r==="center"&&a.current){let z=v();d.current={x:z.x,y:z.y},I();}}else l(false);};return window.addEventListener("scroll",E,true),window.addEventListener("resize",E,true),()=>{window.removeEventListener("scroll",E,true),window.removeEventListener("resize",E,true);}},[c,n,r,v,I,l,P,w,g]),me.useEffect(()=>()=>{C(),P();},[C,P]);let k=({children:E})=>c?jsx("div",{ref:y,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(d.current.x)}px, ${Math.round(d.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&P(),onMouseLeave:()=>n==="hover"&&w(),children:E}):null;return jsxs("div",{ref:a,onContextMenu:M,onDoubleClick:b,onClick:h,onMouseEnter:A,onMouseMove:D,onMouseLeave:L,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,K?S:jsx(k,{children:S})]})};var Vn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,Xp=me.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:d=false,margin:y=10,css:f,labelCss:T,strokeCss:I,className:x,...R},g){let p=V(),{t:m,strokeColor:C,labelTextColor:P,chipSubtleBg:w,chipOutlinedBg:v,outerM:N,padX:B,verticalStrokeMargin:K}=useMemo(()=>{let b=typeof s=="number"?`${s}px`:s,h=p.surface.border,A=p.text.secondary,D=p.surface.subtleBg,L=p.surface.panelBg,k=Vn(y,"10px"),E=o==="horizontal"?n==="middle"?Vn(c):n==="inset"?Vn(i,"0px"):"0":"0",W=o==="vertical"?n==="middle"?Vn(c):n==="inset"?Vn(i,"0px"):"0":"0";return {t:b,strokeColor:h,labelTextColor:A,chipSubtleBg:D,chipOutlinedBg:L,outerM:k,padX:E,verticalStrokeMargin:W}},[s,p,o,n,c,i,y]),O=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":m,minWidth:t?"max-content":m,marginLeft:N,marginRight:N}:{flexDirection:"row",width:a?Vn(a):"100%",minWidth:0,paddingLeft:B,paddingRight:n==="middle"?B:"0",marginTop:N,marginBottom:N},...Array.isArray(f)?f:f?[f]:[]]),[o,t,m,N,a,B,n,f]),S=useMemo(()=>css([{background:C,borderRadius:d?p.radius.full:p.radius.xs},o==="vertical"?{width:m,minHeight:18,flex:1,marginTop:K,marginBottom:K}:{height:m,flex:1}]),[C,d,p.radius.full,p.radius.xs,o,m,K]),F=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?d?p.radius.full:`calc(${p.radius.sm} * 0.75)`:`calc(${p.radius.sm} * 0.75)`,color:P,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:w,border:"none"}:{background:v,border:`${m} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,d,p.radius.full,p.radius.sm,P,u,w,v,m,C,T]),M=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,I]}),[S,I]);return o==="vertical"?jsxs("div",{ref:g,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",x||""].join(" ").trim(),css:O,...R,children:[t&&r!=="top"&&M,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="bottom"&&M,!t&&M]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",x||""].join(" ").trim(),css:O,...R,children:[t&&r!=="left"&&M,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="right"&&M,!t&&M]})}));var ml=me.createContext(null),fl=()=>{let e=useContext(ml);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},gl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(d=>{t===void 0&&c(d),o?.(d);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(ml.Provider,{value:u,children:e})},Zp=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=fl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let d;me.isValidElement(t)&&(d=t.props.onClick),d?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let d;me.isValidElement(t)&&(d=t.props.onKeyDown),d?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,d=u.props.css;return me.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[d,o].filter(Boolean),onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:i,onKeyDown:l,...r,children:t})});Zp.displayName="DrawerTrigger";var To=0,bl="",hl="",Qp=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function em(){if(!(typeof document>"u")){if(To===0){let e=document.body;bl=e.style.overflow||"",hl=e.style.paddingRight||"";let t=Qp();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function tm(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=bl,e.style.paddingRight=hl;}}var nm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,yl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:d,snapClosePct:y=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:I,css:x,...R},g){let p=V(),{open:m,setOpen:C,lockScroll:P,closeOnEscape:w}=fl();useEffect(()=>{if(!(!P||!m))return em(),()=>tm()},[m,P]);let v=useMemo(()=>nm(a,0),[a]),N=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),B=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),K=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${v*2}px)`:"100%"),[n,r,s,v]),O=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${v*2}px)`:"100%"),[o,r,s,v]),S=useMemo(()=>{let q=String(p.radius.lg);switch(r){case "left":return `0 ${q} ${q} 0`;case "right":return `${q} 0 0 ${q}`;case "top":return `0 0 ${q} ${q}`;default:return `${q} ${q} 0 0`}},[r,p.radius.lg]),F=useMemo(()=>c??(s==="inset"?p.radius.lg:S),[c,s,p.radius.lg,S]),M=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:v,bottom:r==="top"?void 0:v,left:r==="right"?void 0:v,right:r==="left"?void 0:v}:{top:r==="bottom"?void 0:0,bottom:r==="top"?void 0:0,left:r==="right"?void 0:0,right:r==="left"?void 0:0},[s,r,v]),b=useRef(null),h=useCallback(()=>{let q=b.current;if(!q)return 1;let Y=q.getBoundingClientRect();return N==="x"?Y.width:Y.height},[N]),A=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),D=useMemo(()=>({duration:(d??280)/1e3,ease:[.22,1,.36,1]}),[d]),L=useMemo(()=>B*1.1,[B]),k=useMemo(()=>N==="x"?{x:`${L*100}%`,y:0}:{y:`${L*100}%`,x:0},[N,L]),E=useMemo(()=>css({position:"fixed",zIndex:1100,...M,width:K,height:O,backgroundColor:p.surface.panelBg,borderRadius:F,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:m?"auto":"none",touchAction:N==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[M,K,O,p.surface,F,m,N]),W=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:p.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,p.surface]),$=useCallback(()=>{u&&C(false);},[u,C]),z=useMemo(()=>N==="x"?{left:B===-1?T:0,right:B===1?T:0}:{top:B===-1?T:0,bottom:B===1?T:0},[N,B,T]),_=useMemo(()=>N==="x"?{left:0,right:0}:{top:0,bottom:0},[N]),H=useMemo(()=>Math.max(0,Math.min(1,y)),[y]),U=useCallback((q,Y)=>{let le=N==="x"?Y.offset.x:Y.offset.y,ie=N==="x"?Y.velocity.x:Y.velocity.y,be=B*le>0,Pe=Math.abs(le)>=h()*H,Re=B*ie>f;be&&(Pe||Re)&&C(false);},[N,B,h,H,f,C]),X=useRef(null);useEffect(()=>{if(!m)return;X.current=document.activeElement;let q=setTimeout(()=>{let ie=b.current;if(!ie)return;let be=ie.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');be.length>0?be[0].focus():ie.focus();},100),Y=ie=>{let be=b.current;if(!be||!ie.target)return;let Pe=ie.target;if(!be.contains(Pe)){ie.preventDefault();let Re=be.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Re.length>0?Re[0].focus():be.focus();}},le=ie=>{ie.key==="Escape"&&w&&(ie.stopPropagation(),C(false));};return document.addEventListener("focusin",Y,true),window.addEventListener("keydown",le),()=>{clearTimeout(q),document.removeEventListener("focusin",Y,true),window.removeEventListener("keydown",le),X.current&&typeof X.current.focus=="function"&&X.current.focus();}},[m,C,w]);let{...ae}=R;return jsx(AnimatePresence,{children:m?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:W,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:d?D:{duration:.18,ease:"linear"},onClick:$},"overlay"),jsx(motion.div,{ref:q=>{b.current=q,typeof g=="function"?g(q):g&&(g.current=q);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",I||""].join(" ").trim(),css:[E,x],drag:N,dragConstraints:_,dragElastic:z,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...k,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...k,opacity:.98},transition:d?D:A,...ae,children:t},"panel")]}):null})});yl.displayName="DrawerContent";var om=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,d=o!==void 0?o:r,y=u!==void 0,[f,T]=useState(!!d),I=y?!!u:f,x=useCallback(R=>{y||T(R),R||a?.(),s?.(R);},[y,a,s]);return jsx(gl,{open:I,onOpenChange:x,children:jsx(yl,{ref:l,...i,children:c})})});om.displayName="DrawerLegacy";var Ws=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=d=>y=>{y.target===y.currentTarget&&(y.propertyName==="opacity"||y.propertyName==="filter")&&r?.(),d?.(y);};if(s&&isValidElement(e)){let d=e,y=d.props.css,f=Array.isArray(y)?[...y,i]:y?[y,i]:[i],T=["plainframe-ui-transition-fade",d.props.className||"",a||""].join(" ").trim(),I=d.props.onTransitionEnd;return cloneElement(d,{...d.props,css:f,className:T,onTransitionEnd:l(I)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var xl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,vl=me.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=V(),d=e==="vertical"||e==="column"?"column":"row",y=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:d,gap:y,justifyContent:n,alignItems:o,maxWidth:xl(c),width:c?"100%":void 0,maxHeight:xl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:a})});vl.displayName="Flex";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=y=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),y?.(f);};if(c&&isValidElement(e)){let y=e,f=y.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],I=y.props.onTransitionEnd,x=["plainframe-ui-transition-grow",y.props.className||"",i||""].join(" ").trim();return cloneElement(y,{...y.props,css:T,className:x,onTransitionEnd:u(I)})}let d=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:d,onTransitionEnd:u(),children:e})};var Cl={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},ym=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),xm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Un=me.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:d="solid",decorationThickness:y=1,decorationColor:f,italic:T,className:I,style:x,as:R})=>{let g=V(),p=Cl[e]??Cl.body,m=R??xm[e]??"span",C=F=>F==null?p.size:typeof F=="number"?F:g?.typography?.sizes?.[F]??F,P=C(o)??C(p.size),w=r??p.weight,v=s??p.lh,N=a??p.ls,B=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",K=f??g.surface.border,O=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:P,fontWeight:w,lineHeight:v,letterSpacing:N,color:B,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:d,textDecorationColor:K,textDecorationThickness:ym(y),textDecorationSkipInk:"auto"});return jsx(m,{className:[`pfui-typo-${e}`,I||""].join(" ").trim(),css:[O,S],style:x,"data-variant":e,children:t})});Un.displayName="Typography";var Us=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Rm=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Us(typeof n=="number"||typeof n=="string"?n:e)}return e}}},Tl=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:d="lazy",decoding:y="async",fetchPriority:f,srcSet:T,sizes:I,placeholder:x,blurDataURL:R,placeholderColor:g="#f1f1f1",fallbackSrc:p,className:m,css:C,onClick:P,onLoad:w,onError:v,...N},B){let[K,O]=useState(false),[S,F]=useState(false),[M,b]=useState(false),h=V(),A=Rm(s,h)??"0px",D=i?"figure":"div",L=css({display:"flex",flexDirection:"column",gap:i?h.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${A})`}),k=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${A})`,maxWidth:o?Us(o):"100%",maxHeight:r?Us(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:u,boxShadow:a?"0 12px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.04)":"none",overflow:"hidden",padding:0,lineHeight:0,transition:"transform 0.3s ease",willChange:"transform",transform:K&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:P?"pointer":void 0}),E=css({position:"absolute",inset:0,background:x==="color"?g:void 0,backgroundImage:x==="blur"&&R?`url(${R})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:x==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:M?0:1,pointerEvents:"none"}),W=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:K&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(D,{className:["plainframe-ui-image",m||""].join(" ").trim(),css:[L,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:k,onMouseEnter:()=>O(true),onMouseLeave:()=>O(false),onClick:P,children:[!M&&x&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:E}),jsx("img",{ref:B,className:"plainframe-ui-image-img",css:W,src:S&&p?p:t,alt:n,srcSet:T,sizes:I,loading:d,decoding:y,fetchPriority:f,onLoad:$=>{b(true),w?.($);},onError:$=>{F(true),v?.($);},...N})]}),i&&jsx(Un,{as:"figcaption",variant:"caption",align:l,children:i})]})});Tl.displayName="Image";var wl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,km=e=>{if(typeof e=="number"&&isFinite(e)&&e>0)return e;if(typeof e=="string"){let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(t){let o=parseFloat(t[1]),r=parseFloat(t[2]);if(o>0&&r>0)return o/r}let n=parseFloat(e);if(isFinite(n)&&n>0)return n}},Im=e=>e*Math.PI/180,Sm=(e,t,n)=>{let o=Math.abs(Im(n)),r=Math.cos(o),s=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*s),h:Math.abs(t*r)+Math.abs(e*s)}};function Mm(e,t){if(t<=1){let r={ang:[0],dx:[0],dy:[0]};return {base:r,exp:r}}return e==="fan"?{base:t===2?{ang:[-14,10],dx:[-40,24],dy:[0,0]}:{ang:[-14,0,14],dx:[-55,0,55],dy:[-7.5,0,-7.5]},exp:t===2?{ang:[-7,5],dx:[-20,12],dy:[0,0]}:{ang:[-7,0,7],dx:[-32.5,0,32.5],dy:[0,0,0]}}:e==="slide"?{base:t===2?{ang:[-20,3],dx:[-10,5],dy:[-2,0]}:{ang:[-20,-5,10],dx:[-35,-10,12],dy:[4,0,4]},exp:t===2?{ang:[-10,1.5],dx:[-10,5],dy:[-2,0]}:{ang:[-10,-2.5,5],dx:[-30.5,-7.5,6],dy:[4,0,4]}}:e==="domino"?{base:t===2?{ang:[0,0],dx:[0,0],dy:[-11,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-18,-5,6]},exp:t===2?{ang:[0,0],dx:[0,0],dy:[-5,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-14,-2.5,7]}}:{base:t===2?{ang:[-4,8],dx:[-22,18],dy:[-30,40]}:{ang:[-10,10,.5],dx:[-30,30,-15],dy:[-65,2,65]},exp:t===2?{ang:[-3,6],dx:[-11,9],dy:[-22.5,30]}:{ang:[-7.5,7.5,.35],dx:[-15,20,-10.5],dy:[-55.5,2,55.5]}}}var Fm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,El=[1.02,1.03,1.02],kl=[1.06,1.08,1.06],Am={sm:150,md:200,lg:260,xl:340},Pm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Nm(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Pm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Dm=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:d,outlineColor:y,outlineWidth:f=3,outlineOffset:T=0,radius:I="md",label:x,labelAlign:R="center",css:g,className:p,...m}){let C=V(),P=km(r)??4/5,w=typeof o=="string"?o:void 0,v=typeof o=="number"?o:w&&/px$/.test(w)?parseFloat(w):Am[s],N=Math.max(1,v/P),K=Children.toArray(t).filter(isValidElement).slice(0,i),O=K.length,S=Mm(n,O),F=K.map((q,Y)=>Fm(n,O,Y)),M=q=>N*.6*F[q],b=q=>M(q)*P,h=0,A=0;for(let q=0;q<O;q++){let Y=b(q),le=M(q),ie=Math.max(Math.abs(S.base.ang[q]??0),Math.abs(S.exp.ang[q]??0)),be=Math.max(Math.abs(S.base.dx[q]??0),Math.abs(S.exp.dx[q]??0)),Pe=Math.max(Math.abs(S.base.dy[q]??0),Math.abs(S.exp.dy[q]??0)),Re=a==="expand"?kl[q]??1.08:a==="reveal"?El[q]??1.03:1,Ce=Sm(Y,le,ie),Ie=Ce.w*Re,Te=Ce.h*Re,we=be/100*Y*Re,he=Pe/100*le*Re;h=Math.max(h,Ie/2+we),A=Math.max(A,Te/2+he);}let D=Math.max(1,2*h),L=Math.max(1,2*A),k=Math.min(1,v/D,N/L),E=c===void 0?"pointer":"controlled",W=c?"true":void 0,$=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:x?C.spacing.xs:0}),z=css({position:"relative",width:wl(typeof o=="number"?o:v)??(typeof o=="string"?o:void 0),height:wl(N)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${D}px`,height:`${L}px`,transform:`translate(-50%, -50%) scale(${k})`,transformOrigin:"center center"}),H=Nm(I,C)??"0px",U=q=>{let Y=n==="fan"?`rotate(${S.base.ang[q]}deg) translate(${S.base.dx[q]}%, ${S.base.dy[q]}%)`:n==="slide"?`translate(${S.base.dx[q]}%, ${S.base.dy[q]}%) rotate(${S.base.ang[q]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[q]}%)`:`translate(${S.base.dx[q]}%, ${S.base.dy[q]}%) rotate(${S.base.ang[q]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[q]}deg) translate(${S.exp.dx[q]}%, ${S.exp.dy[q]}%)`:n==="slide"?`translate(${S.exp.dx[q]}%, ${S.exp.dy[q]}%) rotate(${S.exp.ang[q]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[q]}%)`:`translate(${S.exp.dx[q]}%, ${S.exp.dy[q]}%) rotate(${S.exp.ang[q]}deg)`,ie=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Y} scale(1)`,be=a==="expand"?`${le} scale(${kl[q]??1.06})`:a==="reveal"?`${Y} scale(${El[q]??1.03})`:`${Y} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${ie}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&q===1?10:q+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:d?`${f}px solid ${y??C.surface.appBg}`:void 0,outlineOffset:d?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${be}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${be}`}})},X=q=>css({width:`${b(q)}px`,aspectRatio:`${P}`,position:"relative",overflow:"hidden",borderRadius:H,"--pfui-image-radius":H,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(x?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",p||""].join(" ").trim(),"data-hover-mode":E,"data-hovered":W,css:[$,g],tabIndex:-1,...m,children:[jsx("div",{className:"plainframe-ui-image-stack",css:z,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:_,children:K.map((q,Y)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(Y),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:X(Y),children:q})},Y))})}),x&&jsx(Un,{as:"figcaption",variant:"caption",align:R,children:x})]})});var Il=e=>typeof e=="number"?`${e}px`:e,Sl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Bm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Il(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Il(n)}return e}function $m(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var zm=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:c=2,css:i,className:l="plainframe-ui-kbd",...u},d){let y=V(),f=xe(),T=Sl[o]??Sl.sm,I=Bm(r,y),x={br:y.neutral[300],txt:y.neutral[800],inset:y.neutral[0]},R=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?y.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:I,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),g=css({"&&":{background:y.surface.subtleBg,border:"none",boxShadow:"none",color:x.txt}}),p=css({"&&":{background:"transparent",color:x.txt,border:"none",boxShadow:"none"}}),m=css({"&&":{background:y.surface.panelBg,color:x.txt,border:`1px solid ${x.br}`,boxShadow:`inset 0 1px 0 ${x.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?g:n==="ghost"?p:m,w=s&&c>0&&$m(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:d,className:l,css:[f(),R,C,i],...u,children:w})});var _m=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,qs=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:a=false,className:c,distance:i})=>{let u=_m(i,t==="left"||t==="right"?"100vw":"100vh"),d=t==="left"?`-${u}`:t==="right"?u:"0",y=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${d}, ${y}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=x=>R=>{R.target===R.currentTarget&&R.propertyName==="transform"&&s?.(),x?.(R);};if(a&&isValidElement(e)){let x=e,R=x.props.css,g=Array.isArray(R)?[...R,f]:R?[R,f]:[f],p=["plainframe-ui-transition-slide",x.props.className||"",c||""].join(" ").trim(),m=x.props.onTransitionEnd;return cloneElement(x,{...x.props,css:g,className:p,onTransitionEnd:T(m)})}let I=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:I,onTransitionEnd:T(),children:e})};var Gs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pl=me.createContext(null),Nl=()=>{let e=useContext(Pl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},Xm=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(d=>{t===void 0&&c(d),o?.(d);},[t,o]);useEffect(()=>{if(!i||!s)return;let d=y=>{y.key==="Escape"&&(y.stopPropagation(),l(false));};return window.addEventListener("keydown",d,true),()=>window.removeEventListener("keydown",d,true)},[i,s,l]);let u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Pl.Provider,{value:u,children:e})},Dl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Nl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let d;me.isValidElement(t)&&(d=t.props.onClick),d?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let d;me.isValidElement(t)&&(d=t.props.onKeyDown),d?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,d=u.props.css;return me.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[d,o].filter(Boolean),"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r,children:t})});Dl.displayName="ModalTrigger";var Hl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:d="up",transitionDuration:y=300,containerCss:f,backdropCss:T,className:I,...x},R)=>{let g=V(),{open:p,setOpen:m,lockScroll:C}=Nl(),P=me.useRef(null),w=me.useRef(null);me.useEffect(()=>{if(!p)return;w.current=document.activeElement;let S=setTimeout(()=>{let M=P.current;if(!M)return;let b=M.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');b.length>0?b[0].focus():M.focus();},100),F=M=>{let b=P.current;if(!b||!M.target)return;let h=M.target;if(!b.contains(h)){M.preventDefault();let A=b.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');A.length>0?A[0].focus():b.focus();}};return document.addEventListener("focusin",F,true),()=>{clearTimeout(S),document.removeEventListener("focusin",F,true),w.current&&typeof w.current.focus=="function"&&w.current.focus();}},[p]);let v=typeof g.spacing.sm=="number"?`${g.spacing.sm}px`:String(g.spacing.sm),N=css({width:"100%",height:Gs(o),maxWidth:t==="inset"?`min(${Gs(n)||"100%"}, calc(100% - ${v} * 2))`:Gs(n),maxHeight:t==="inset"?`calc(100% - ${v} * 2)`:"100%",margin:t==="inset"?v:void 0}),B=jsx(_n,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",I||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[N,f],ref:S=>{P.current=S,typeof R=="function"?R(S):R&&(R.current=S);},...x,children:e}),K=u==="none"?B:u==="slide"?jsx(qs,{on:p,direction:d,duration:y,children:B}):u==="grow"?jsx(Ks,{initialScale:.75,on:p,duration:y,children:B}):jsx(Ws,{on:p,duration:y,children:B});if(!a)return jsx(Fragment,{children:K});let O=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Es,{on:p,blur:c,blurDepth:i,onClickAway:l?()=>m(false):void 0,css:[O,T].filter(Boolean),contentCss:O,lockScroll:C,children:K})});Hl.displayName="ModalContent";var of=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:c=false,loop:i=false,variant:l="subtle",gap:u,className:d,css:y})=>{let f=V(),T=xe(),I=t!==void 0,[x,R]=useState(n),g=Math.max(1,e),p=Sr(I?t:x,1,g),m=useCallback(k=>{let E=Sr(k,1,g);I||R(E),o?.(E);},[I,g,o]),C=useMemo(()=>rf({count:g,page:p,siblingCount:r,boundaryCount:s}),[g,p,r,s]),P=f.palette?.primary?.[600],w=f.surface?.border,v=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,N=f.text?.primary??"#111",B=l==="subtle"?f.surface?.subtleBg:"transparent",K=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:B,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(y)?y:y?[y]:[]),O=css({minWidth:28,height:28,padding:"0 10px",borderRadius:9,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:N,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),F=(k=false)=>css([O,T({color:k?"primary":"neutral"}),l==="outlined"?k?{background:P,color:f.text.onColors.primary,borderColor:P}:{background:"transparent",borderColor:w,":hover":{background:v}}:l==="ghost"?k?{background:P,color:f.text.onColors.primary}:{":hover":{background:v}}:k?{background:P,color:f.text.onColors.primary,borderColor:P}:{":hover":{background:v}}]),M=useCallback(()=>m(1),[m]),b=useCallback(()=>m(g),[m,g]),h=useCallback(()=>{p===1?i&&m(g):m(p-1);},[p,i,g,m]),A=useCallback(()=>{p===g?i&&m(1):m(p+1);},[p,i,g,m]),D=a||p===1&&!i,L=a||p===g&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",d||""].join(" ").trim(),css:K,onKeyDown:k=>{a||(k.key==="ArrowLeft"&&(k.preventDefault(),h()),k.key==="ArrowRight"&&(k.preventDefault(),A()),k.key==="Home"&&(k.preventDefault(),M()),k.key==="End"&&(k.preventDefault(),b()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":D,disabled:D,css:[F(false),S],onClick:M,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":D,disabled:D,css:[F(false),S],onClick:h,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((k,E)=>typeof k=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":k===p?`Page ${k}, current page`:`Go to page ${k}`,"aria-current":k===p?"page":void 0,css:F(k===p),onClick:()=>m(k),children:k},k):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([O,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${E}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":L,disabled:L,css:[F(false),S],onClick:A,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":L,disabled:L,css:[F(false),S],onClick:b,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Sr(e,t,n){return Math.max(t,Math.min(n,e))}function rf({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Ir(1,e);let s=Ir(1,Math.min(o,e)),a=Ir(Math.max(e-o+1,o+1),e),c=Sr(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Sr(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],u=d=>{let y=l[l.length-1];y!==d&&(y==="ellipsis"&&d==="ellipsis"||l.push(d));};return s.forEach(u),c>o+2?u("ellipsis"):o+1<c&&u(o+1),Ir(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Ir(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var cf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,uf=me.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=V(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:cf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var zl=createContext(null),ff=()=>{let e=useContext(zl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},gf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},bf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let d=V(),y=e!==void 0&&n!==void 0,[f,T]=useState(t),I=y?e:f,x=useRef([]),[R,g]=useState(0),p=()=>g(F=>F+1),m=useCallback(F=>{y||T(F),n?.(F);},[y,n]),C=useCallback(F=>(x.current.push(F),p(),x.current.length-1),[]),P=useCallback((F,M)=>{let b=x.current[F];b&&(x.current[F]={...b,...M},p());},[]),w=()=>x.current.map((F,M)=>({it:F,i:M})).filter(({it:F})=>F.ref&&!F.disabled).map(({i:F})=>F),v=useCallback((F,M)=>{let b=w();if(!b.length)return;let h=Math.max(0,b.indexOf(F)),A=b[(h+M+b.length)%b.length],D=x.current[A]?.ref;if(D){D.focus();let L=x.current[A]?.value;L!==void 0&&m(L);}},[m]),N=useCallback(F=>{let M=w();if(!M.length)return;let b=F==="first"?M[0]:M[M.length-1],h=x.current[b]?.ref;if(h){h.focus();let A=x.current[b]?.value;A!==void 0&&m(A);}},[m]),B=useMemo(()=>{let F=x.current.filter(b=>b.ref&&!b.disabled);return F.length?F.some(b=>b.value===I)?I:F[0]?.value:void 0},[I,R]),K=useMemo(()=>({selected:I,setSelected:m,disabled:o,size:r,direction:s,variant:a,register:C,update:P,moveFocusBy:v,moveToEdge:N,focusValue:B,theme:d,anchorOrigin:gf(l)}),[I,m,o,r,s,a,C,P,v,N,B,d,l]),O=css({width:"fit-content"}),S=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:d.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[O,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(zl.Provider,{value:K,children:i})})})},hf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:d,moveToEdge:y,theme:f,variant:T,focusValue:I,anchorOrigin:x}=ff(),R=c||t,g=s===e,p=["sm","md","lg"].includes(i)?i:"md",m=p==="sm"?16:p==="lg"?24:20,C=z=>f.palette?.primary?.[z],P=C(600),w=C(100),v=f.neutral[300],N=f.palette.primary[300],B=f.text.onColors?.primary??f.neutral[0],K="transparent",O=N,S=B;T==="soft"?(K=w,O=null,S=P):T==="outlined"?(K=C(50),O=N,S=P):(K=f.neutral[200],O="transparent",S=B),g&&(T==="outlined"?(K=w,O=N,S=P):T==="filled"?(K=P,O=null,S=B):(K=w,O=null,S=P));let F=T==="filled"?v:f.palette.primary[100],M=useRef(null),b=useRef(-1);useEffect(()=>{b.current=l({ref:M.current,value:e,disabled:!!R});},[l]),useEffect(()=>{u(b.current,{ref:M.current,value:e,disabled:!!R});},[u,R,e]);let h=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:x.vertical==="center"?f.spacing.sm:0,rowGap:x.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:R?.5:1,borderRadius:f.radius.md,cursor:R?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":R||g?{}:{background:F,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${N}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),A=css({width:m,height:m,minWidth:m,minHeight:m,borderRadius:f.radius.full,background:K,boxShadow:O?`inset 0 0 0 ${f.componentHeights.border} ${O}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),D=css({width:g?m*.45:0,height:g?m*.45:0,borderRadius:f.radius.full,background:g?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:g?"scale(1)":"scale(0.6)",opacity:g?1:0}),L=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),k=(()=>{let z=x.horizontal,_=x.vertical;return _==="center"?{col:z==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),W=!R&&I===e?0:-1,$=xe();return jsxs("button",{ref:M,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":g,"aria-disabled":R||void 0,disabled:R,tabIndex:W,onClick:()=>{R||a(e);},onKeyDown:z=>{R||(z.key==="Enter"||z.key===" "?(z.preventDefault(),a(e)):z.key==="ArrowRight"||z.key==="ArrowDown"?(z.preventDefault(),d(b.current,1)):z.key==="ArrowLeft"||z.key==="ArrowUp"?(z.preventDefault(),d(b.current,-1)):z.key==="Home"?(z.preventDefault(),y("first")):z.key==="End"&&(z.preventDefault(),y("last")));},css:[h,$({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[A,css({gridColumn:k.col,gridRow:k.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:D})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:L,children:o})]})};var Rf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=y=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),y?.(f);};if(c&&isValidElement(e)){let y=e,f=y.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],I=["plainframe-ui-transition-rotate",y.props.className||"",i||""].join(" ").trim(),x=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:T,className:I,onTransitionEnd:u(x)})}let d=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:d,onTransitionEnd:u(),children:e})};var Fo=(...e)=>e.filter(Boolean).flat(),Mr=e=>me.isValidElement(e),Ao=(e,t)=>{if(!Mr(e))return false;let n=e.type,o=(n?.displayName??n?.name??"")||"";return typeof o=="string"&&t.includes(o)},Ef=(e,t)=>{let n=e.props,o=n.value;if(typeof o<"u")return o;let r=n["data-value"];return typeof r<"u"?r:t};function kf({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,disabled:c,size:i="md",variant:l="subtle",fullWidth:u,width:d=200,menuAlign:y="left",menuWidth:f,menuMaxHeight:T=280,wrapperCss:I,labelCss:x,triggerCss:R,menuCss:g,optionCss:p,children:m,className:C,menuSize:P="md",triggerRender:w}){let v=V(),N=xe(),B=me.useId(),K=`${B}-label`,O=`${B}-menu`,S={sm:{minHeight:v.componentHeights.sm,radius:v.radius.sm},md:{minHeight:v.componentHeights.md,radius:v.radius.md},lg:{minHeight:v.componentHeights.lg,radius:v.radius.md}},F=S[i]||S.md,[M,b]=me.useState(false),h=j=>b(!!j),A=typeof e<"u",D=Array.isArray(e)||Array.isArray(t),[L,k]=me.useState(typeof t<"u"?t:D?[]:void 0),E=A?e:L,W=j=>{A||k(j),n?.(j);},$=me.Children.toArray(m).filter(Mr),z,_=[];for(let j of $)if(Ao(j,["MenuRadioGroup"]))z=j;else if(Ao(j,["MenuCheckboxGroup"])){let ue=j.props.children,de=ue?me.Children.toArray(ue).filter(Mr):[];_.push(...de);}else _.push(j);let U=(z?me.Children.toArray(z.props.children).filter(Mr):_).filter(j=>!Ao(j,["MenuLabel","MenuSeparator"])).map((j,ue)=>{let de=j.props,fe=Ef(j,ue),ze=de.children,Oe=de.label,st=typeof Oe=="string"||typeof Oe=="number"?String(Oe):typeof ze=="string"||typeof ze=="number"?String(ze):void 0,Ye=de.role??"",yt=Ao(j,["MenuCheckboxItem"]),tn=Ao(j,["MenuRadioItem"]),nn=yt||Ye==="menuitemcheckbox"||typeof de.onCheckedChange=="function"||typeof de.checked=="boolean"||typeof de.defaultChecked=="boolean",Sn=!nn&&(tn||Ye==="menuitemradio"||!!z),on=typeof de.children>"u"?st??String(fe):de.children;return {el:j,key:j.key??ue,value:fe,labelText:st,title:de.title,description:de.description,nodeForTrigger:on,disabled:!!de.disabled,className:de.className,itemCss:de.css,startIcon:de.startIcon,endIcon:de.endIcon,isCheckbox:nn,isRadio:Sn}}),X=U.some(j=>j.isCheckbox),ae=U.length>0&&U.every(j=>j.isRadio),Y=(D||X)&&!ae,le=me.useCallback(j=>Y?(Array.isArray(E)?E:[]).some(de=>Object.is(de,j)):Object.is(E,j),[E,Y]),ie=me.useMemo(()=>{if(Y){let ue=Array.isArray(E)?E:[];return U.filter(fe=>ue.some(ze=>Object.is(ze,fe.value))).map(fe=>typeof fe.nodeForTrigger=="string"||typeof fe.nodeForTrigger=="number"?String(fe.nodeForTrigger):fe.nodeForTrigger)}let j=U.find(ue=>Object.is(ue.value,E));if(j)return typeof j.nodeForTrigger=="string"||typeof j.nodeForTrigger=="number"?String(j.nodeForTrigger):j.nodeForTrigger},[E,Y,U]),be=j=>{c||(Object.is(j,E)||W(j),h(false));},Pe=j=>{c||Object.is(j,E)||W(j);},Re=j=>{if(c)return;let ue=Array.isArray(E)?E:[],fe=ue.some(ze=>Object.is(ze,j))?ue.filter(ze=>!Object.is(ze,j)):[...ue,j];W(fe);},Ce={position:"relative",width:u?"100%":typeof d=="number"?`${d}px`:d,maxWidth:"100%"},Ie={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:F.radius,minHeight:F.minHeight,fontSize:v.typography.sizes.sm,padding:`0 ${typeof v.spacing.sm=="number"?`${v.spacing.sm}px`:v.spacing.sm} 0 ${typeof v.spacing.md=="number"?`${v.spacing.md}px`:v.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:c?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:v.text.primary,background:"transparent",whiteSpace:"nowrap"},Te=l==="subtle"?{background:v.surface.subtleBg}:l==="outlined"?{background:v.surface.panelBg,border:`1px solid ${v.surface.border}`}:{background:"transparent"},we={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},he={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},je={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Z=jsx(ChevronsUpDown,{size:16,css:css({color:v.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Ee=()=>{if(w)return w(ie);if(Array.isArray(ie)){let ue=ie.map(fe=>typeof fe=="string"?fe:"").filter(Boolean),de=ue.length?ue.join(", "):String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(he),children:s}),jsx("span",{css:css(je),title:de,children:de})]})}let j=ie??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(he),children:s}),jsx("span",{css:css(je),title:typeof j=="string"?j:void 0,children:j})]})},Q={left:"start",center:"center",right:"end"},ee=j=>{c||(j.key==="ArrowDown"||j.key==="ArrowUp"||j.key==="Enter"||j.key===" ")&&(j.preventDefault(),h(true));},se={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",marginRight:8},pe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",marginLeft:8},Se={flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2},Ne={fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"},J={fontSize:"0.875em",color:v.text.secondary,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400},oe=(j,ue)=>{let de=j.title||j.description?jsxs("span",{className:"plainframe-ui-select-option-content",css:css(Se),children:[jsx("span",{className:"plainframe-ui-select-option-title",css:css(Ne),children:j.title??ue}),j.description&&jsx("span",{className:"plainframe-ui-select-option-description",css:css(J),children:j.description})]}):jsx("span",{className:"plainframe-ui-select-option-text",css:css(Ne),children:ue});return jsxs(Fragment,{children:[j.startIcon&&jsx("span",{css:css(se),children:j.startIcon}),de,j.endIcon&&jsx("span",{css:css(pe),children:j.endIcon})]})},re=(j,ue)=>{let de=j.value,fe=le(de),ze=Fo(p,j.itemCss),Oe=j.el.props,st=typeof Oe.children>"u"?j.labelText??String(de):Oe.children;if(Y||j.isCheckbox)return me.cloneElement(j.el,{key:j.key??ue,disabled:c||j.disabled,checked:!!Oe.checked||fe,onCheckedChange:()=>Re(de),closeOnSelect:false,css:ze,className:`plainframe-ui-select-option ${j.className||""}`.trim(),children:oe(j,st)});if(j.isRadio)return me.cloneElement(j.el,{key:j.key??ue,value:de,disabled:c||j.disabled,closeOnSelect:false,css:ze,className:`plainframe-ui-select-option ${j.className||""}`.trim(),children:oe(j,st)});let Ye=yt=>{yt?.preventDefault?.(),be(de);};return me.cloneElement(j.el,{key:j.key??ue,role:"menuitem","aria-checked":void 0,"aria-selected":fe||void 0,"aria-disabled":c||j.disabled||void 0,disabled:c||j.disabled,closeOnSelect:true,onSelect:Ye,onClick:Ye,css:ze,className:`plainframe-ui-select-option ${j.className||""}`.trim(),children:oe(j,st)})},qe=(()=>{let j=!Y&&(z||U.length>0&&U.every(ue=>ue.isRadio));return z?me.cloneElement(z,{key:"controlled-inner-group",value:E,onValueChange:ue=>Pe(ue),children:U.map(re)}):j?jsx(lr,{value:E,onValueChange:ue=>Pe(ue),children:U.map(re)}):U.map(re)})();return jsxs("div",{css:Fo(Ce,I),className:["plainframe-ui-select-wrapper",C||""].join(" ").trim(),children:[o&&jsx("div",{id:K,className:"plainframe-ui-select-label",css:Fo({marginBottom:6,fontSize:v.typography.sizes.sm,fontWeight:500,color:v.text.secondary},x),children:o}),jsxs($n,{size:P,open:M,onOpenChange:h,children:[jsx(zn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:c,"aria-haspopup":"menu","aria-expanded":M||void 0,"aria-controls":O,"aria-labelledby":o?K:void 0,onKeyDown:ee,onClick:()=>h(!M),className:"plainframe-ui-select-trigger",css:Fo(css(Ie),css(Te),R,N()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(we),children:Ee()}),a??Z]})}),jsx(hn,{id:O,gap:"xs",align:Q[y],sameWidth:f==null,width:f??d,className:"plainframe-ui-select-menu",css:Fo({maxHeight:typeof T=="number"?`${T}px`:T,overflowY:"auto"},g),children:qe})]})]})}var Zs=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Sf=keyframes`
|
|
13
|
+
`,_c=e=>e.startsWith("#")||e.startsWith("rgb(")||e.startsWith("rgba(")||e.startsWith("hsl(")||e.startsWith("hsla(")||e.startsWith("oklch(")||e.startsWith("lab(")||e.startsWith("color(")||e.startsWith("var("),jc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Vc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(_c(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],s=o[2]&&jc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[s])return e.palette.primary[s];let a=e.palette[r];if(a&&a[s]!=null)return a[s];if(r==="neutral"||r==="secondary"&&e.neutral[s]!=null)return e.neutral[s]}return e.palette.primary[600]}var no=me.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:d,"aria-label":y})=>{let f=V(),T=typeof t=="number",I=Math.max(o-n,1),x=T?qa(t,n,o):void 0,R=T?(x-n)/I*100:void 0,g=Vc(f,r),p=f.surface.subtleBg,m=f.radius?.md;return e==="circular"?jsx(qc,{size:s,active:g,isDeterminate:T,percent:R,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:d,ariaLabel:y,thickness:a}):jsx(Uc,{thickness:a,active:g,track:p,radius:m,isDeterminate:T,percent:R,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:y,min:n,max:o,value:x})}),Uc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:d,value:y})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),I=css([{position:"relative",width:"100%",height:ns(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),x=r?Math.max(s??0,Ua):Ua,R=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${x/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),g={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},p=css([{...g,left:"-35%",right:"100%",animation:`${Wc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),m=css([{...g,left:"-200%",right:"100%",animation:`${Kc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":d,"aria-valuenow":y}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:I,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:R}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:p}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:m})]})})})},qc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=V(),d=40,y=(d-t)/2,f=2*Math.PI*y,I=`${(o?qa((r??0)/100,.01,1):.7)*f} ${f}`,x=css([{display:"inline-block",width:ns(e,`${u.componentHeights.md}`),height:ns(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),R=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),g=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:I,strokeDashoffset:0,transition:o?"stroke-dasharray 160ms cubic-bezier(.2,0,.2,1)":"none",transformBox:"fill-box",transformOrigin:"50% 50%",fill:"none",willChange:o?"stroke-dasharray":"transform",animation:o?"none":`${Oc} ${s}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(i)?i:i?[i]:[]]),p=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(p["aria-label"]=l),jsx("span",{css:x,className:"plainframe-ui-progress-circular",...p,children:jsx("svg",{css:R,viewBox:`0 0 ${d} ${d}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:d/2,cy:d/2,r:y,strokeWidth:t,css:g})})})};var Ya=createContext(null),Ja=()=>{let e=useContext(Ya);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},ou=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),ru=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),su=css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:"pointer",lineHeight:0,transition:"opacity 140ms ease","&:disabled":{cursor:"not-allowed",opacity:.5}}),Za=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:c="md",loading:i=false,css:l,children:u,...d},y){let f=V(),T=useId(),I=useId(),x=useMemo(()=>{let F={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?F[c]:F.md},[c,f.typography,f.radius,f.spacing]),R=f.palette??{},g=f.neutral??{},p=useMemo(()=>{let M=(E=>E==="danger"?R.danger??R.error??g:E==="warning"?R.warning??g:E==="success"?R.success??g:E==="info"?R.info??R.primary??g:g)(t),b=M?.[50]??g[50],h=M?.[300]??g[300],A=M?.[600]??M?.[500]??g[600],D=M?.[700]??A,L=M?.[800]??f.text?.primary??"#000",k=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:A,fg:k,border:void 0,iconColor:k}:n==="outlined"?{bg:b,fg:L,border:`1px solid ${h}`,iconColor:L}:n==="ghost"?{bg:"transparent",fg:D,border:"none",iconColor:D}:{bg:b,fg:L,border:void 0,iconColor:D}},[t,n,g,R,f.text]),m=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(no,{variant:"circular",color:p.iconColor,size:x.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor}):jsx(Info,{css:{width:x.iconSize,height:x.iconSize},color:p.iconColor})),[i,o,t,x.iconSize,p.iconColor]),P=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${x.paddingY} ${x.paddingX}`,gap:x.gap,borderRadius:x.radius,backgroundColor:p.bg,color:p.fg,border:p.border,fontSize:x.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[p.bg,p.border,p.fg,x.fontSize,x.gap,x.paddingX,x.paddingY,x.radius,a]),w=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:x.gap,minWidth:0,flex:1}),[x.gap]),v=useMemo(()=>[ru,{color:p.iconColor}],[p.iconColor]),N=useMemo(()=>css({display:"flex",alignItems:"center",gap:x.gap,marginLeft:x.gap,flex:"0 0 auto"}),[x.gap]),B=useMemo(()=>[su,{color:p.fg}],[p.fg]),K=useMemo(()=>({fg:p.fg,iconColor:p.iconColor,s:x,titleId:T,descId:I}),[p.fg,p.iconColor,x,T,I]),O=me.Children.toArray(u).some(F=>me.isValidElement(F)&&F.type===ss),S=me.Children.toArray(u).some(F=>me.isValidElement(F)&&F.type===as);return jsx(Ya.Provider,{value:K,children:jsxs("div",{ref:y,role:m,"aria-live":m==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":O?T:void 0,"aria-describedby":S?I:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[P,l],...d,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:w,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:v,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:ou,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:N,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:B,children:r??jsx(X,{strokeWidth:2,size:x.iconSize-2})})})]})})});Za.displayName="Alert";var ss=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=Ja(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});ss.displayName="AlertTitle";var as=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Ja(),c=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:a,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});as.displayName="AlertDescription";var is=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gt=e=>e==null?[]:Array.isArray(e)?e:[e],Xt=(...e)=>css(e.filter(Boolean));function ei(e,t,n="currentColor"){if(!isValidElement(e))return e;let o=e.props,r={};o.size==null&&(r.size=t),o.color==null&&(r.color=n);let s=o.style;return s?.fontSize==null&&(r.style={...s||{},fontSize:t}),cloneElement(e,{...o,...r})}var Qo=me.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:d="md",variant:y="subtle",rounded:f=false,startIcon:T,endIcon:I,togglePasswordVisible:x=false,showClear:R,type:g="text",step:p,focusRingMode:m="always",className:C,wrapperCss:P,inputCss:w,labelCss:v,helperRowCss:N,helperTextCss:B,startIconCss:K,endIconCss:O,css:S,onBlur:F,onFocus:M,onKeyDown:b,autoFocus:h,name:A,id:D,tabIndex:L,autoComplete:k,readOnly:E,required:W,maxLength:$,onSurfaceClick:z},_){let H=V(),U=Yo(),X$1=useId(),ae=useMemo(()=>{let ce={sm:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.sm,labelFont:H.typography.sizes.xs,helperFont:H.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:21},md:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.md,labelFont:H.typography.sizes.sm,helperFont:H.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:24},lg:{fontSize:H.typography.sizes.sm,minHeight:H.componentHeights.lg,labelFont:H.typography.sizes.md,helperFont:H.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:H.spacing.md,iconSize:H.typography.sizes.xs,codeFontSize:28}},ke=["sm","md","lg"].includes(d)?d:"md";return ce[ke]},[d,H]),q=H.neutral,Y=H.text,le=g==="number",ie=g==="password",be=n!==void 0,[Pe,Re]=useState(o),Ce=be?n:Pe,Ie=useCallback(ce=>{be||Re(ce),r?.(ce);},[be,r]),Te=/^-?\d*(?:[.,]\d*)?$/,we=le&&(p!=null&&String(p).includes(".")||/[.,]/.test(Ce??"")),he=le?we?"decimal":"numeric":void 0,je=le?we?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Z=useCallback(ce=>{(ce===""||Te.test(ce))&&Ie(ce);},[Ie]),Ee=i?q[200]:a&&y==="outlined"?H.palette.danger?.[50]??H.surface.panelBg:a&&y==="subtle"?H.palette.danger?.[50]??H.surface.subtleBg:y==="outlined"?H.surface.panelBg:y==="subtle"?H.surface.subtleBg:"transparent",Q=H.componentHeights.border,ee=y==="outlined"?`${Q} solid ${a?H.palette.danger?.[300]??H.surface.border:H.surface.border}`:"none",se=Xt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?is(u):void 0,flex:"0 0 auto",fontWeight:500}),pe=useMemo(()=>Xt({fontSize:ae.labelFont,fontWeight:500,color:a?H.palette.danger?.[700]??Y.primary:i?q[500]:Y.primary,marginBottom:4,display:"inline-block"},...Gt(v)),[ae.labelFont,a,i,q,Y,H.palette.danger,v]),Se=useMemo(()=>Xt({display:"flex",alignItems:"center",gap:H.spacing.sm,padding:`${is(ae.paddingY)} ${is(ae.paddingX)}`,background:Ee,border:ee,borderRadius:f?H.radius.full:H.radius.md,minHeight:ae.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Gt(P),...Gt(S)),[H,ae.minHeight,ae.paddingX,ae.paddingY,Ee,ee,f,i,P,S]),Ne=useMemo(()=>Xt({flex:1,minWidth:0,fontSize:ae.fontSize,fontWeight:500,fontFamily:"inherit",color:i?q[500]:a?H.palette.danger?.[800]??Y.primary:Y.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:a?H.palette.danger?.[700]??Y.secondary:Y.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?H.palette.danger?.[800]??Y.primary:Y.primary} !important`,boxShadow:`0 0 0 1000px ${Ee} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?H.palette.danger?.[800]??Y.primary:Y.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Gt(w)),[ae.fontSize,i,q,Y,a,H.palette.danger,le,Ee,w]),J=useMemo(()=>Xt({display:"inline-flex",alignItems:"center",color:a?H.palette.danger?.[800]??Y.secondary:Y.secondary,marginLeft:-3},...Gt(K)),[a,H.palette.danger,Y.secondary,K]),oe=useMemo(()=>Xt({display:"inline-flex",alignItems:"center",color:a?H.palette.danger?.[800]??Y.secondary:Y.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Gt(O)),[a,H.palette.danger,Y.secondary,i,O]),re=useMemo(()=>Xt({minHeight:16,fontSize:ae.helperFont,color:a?H.palette.danger?.[700]??Y.secondary:Y.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Gt(N)),[ae.helperFont,a,H.palette.danger,Y.secondary,N]),qe=useMemo(()=>Xt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Gt(B)),[B]),j=useRef(null),ue=useCallback(ce=>{j.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),de=useCallback(ce=>{let ke=ce.target.value;if(le){Z(ke);return}$&&ke.length>$||Ie(ke);},[le,$,Ie,Z]),[fe,ze]=useState(false),Oe=useCallback(()=>{i||ze(ce=>!ce);},[i]),st=useCallback(()=>{i||(Ie(""),j.current?.focus());},[i,Ie]),Ye=useMemo(()=>{let ce=ae.fontSize;if(typeof ce=="number")return ce;let ke=parseFloat(String(ce));return Number.isFinite(ke)?ke:16},[ae.fontSize]),yt=useMemo(()=>T?jsx("span",{css:J,children:ei(T,Ye)}):null,[T,J,Ye]),tn=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),nn=useMemo(()=>{let ce=[];if(ie&&x){let bt=fe?jsx(Eye,{strokeWidth:2.5,size:Ye}):jsx(EyeOff,{strokeWidth:2.5,size:Ye});ce.push(jsx("button",{type:"button",css:oe,onMouseDown:Zn=>Zn.preventDefault(),onClick:Zn=>{Zn.stopPropagation(),Oe();},tabIndex:-1,"aria-label":fe?"Hide password":"Show password",disabled:i,children:bt},"pw-toggle"));}R&&Ce&&Ce.length>0&&!i&&ce.push(jsx("button",{type:"button",css:oe,onMouseDown:bt=>bt.preventDefault(),onClick:bt=>{bt.stopPropagation(),st();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:Ye})},"clear"));let ke=I?jsx("span",{css:oe,children:ei(I,Ye)},"user-end"):null,at=ce.length>0,De=!!ke;return !at&&!De?null:!at&&De?ke:at&&!De?ce.length===1?ce[0]:jsx("span",{css:tn,children:ce}):jsxs("span",{css:tn,children:[ce,ke]})},[ie,x,fe,Ye,oe,tn,i,R,Ce,I,Oe,st]),Sn=c!=null?`${D??X$1}-help`:void 0,on=D??X$1,Je=useCallback(ce=>{if(i)return;ce.stopPropagation();let ke=j.current;if(!ke)return;let at=ce.target;if(!(ke.contains(at)||at.closest("button,[role='button']"))){if(document.activeElement===ke){ce.preventDefault();return}ce.preventDefault();}},[i]),xt=useCallback(ce=>{if(i)return;let ke=j.current;if(ke&&(z?.(ce),document.activeElement!==ke)){ke.focus({preventScroll:true});try{let at=ke.value?.length??0;ke.setSelectionRange?.(at,at);}catch{}}},[i,z]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:se,children:[t&&jsx("label",{htmlFor:on,className:"plainframe-ui-textfield-label",css:pe,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:m!=="none",color:a?"danger":void 0}),Se],onPointerDownCapture:Je,onClick:xt,"aria-invalid":!!a||void 0,children:[yt,jsx("input",{ref:ue,id:on,className:"plainframe-ui-textfield-input",css:Ne,type:ie?fe?"text":"password":g==="number"?"text":g,inputMode:he,pattern:je,value:Ce,maxLength:le?void 0:$,onChange:le?ce=>Z(ce.target.value):de,placeholder:s||"",disabled:i,onBlur:F,onFocus:M,onKeyDown:b,autoFocus:h,name:A,tabIndex:L,autoComplete:k,readOnly:E,required:W,"aria-invalid":!!a||void 0,"aria-describedby":Sn}),nn]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:re,children:jsx("span",{id:Sn,className:"plainframe-ui-textfield-helper-text",css:qe,children:c})})]})}));Qo.displayName="TextField";var er=me.createContext("ghost"),Tt=me.createContext(false),si=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:l,allItemsTabbable:u=false,...d},y){let f=V(),[T,I]=useState(false),x=useRef(null),R=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),g=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",p=s?void 0:css({background:g,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":R,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),m=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:I}),[T]),P=useMemo(()=>({allItemsTabbable:u}),[u]),w=useCallback(M=>Array.from(M.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(b=>{if(b.closest('[role="menu"]')!==M)return false;let h=window.getComputedStyle(b);return h.display!=="none"&&h.visibility!=="hidden"}),[]),v=useCallback(M=>{M.removeAttribute("data-keyboard-nav"),M.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),I(false);},[]),N=useRef(false),B=useCallback(M=>{if(M.target!==M.currentTarget)return;if(N.current){N.current=false;return}let b=M.currentTarget,h=w(b);h.length>0&&(I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(A=>A.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(A=>A.removeAttribute("data-hovered")),h[0].setAttribute("data-highlighted",""),h[0].focus({preventScroll:true}));},[w]),K=useCallback(M=>{let b=M.currentTarget,h=w(b);if(h.length===0)return;if(M.key==="Tab"){N.current=true,b.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),I(false),b.tabIndex=-1,requestAnimationFrame(()=>{b.tabIndex=0,N.current=false;});return}let A=b.querySelector("[data-highlighted]"),D=b.querySelector("[data-hovered]"),L=A||D,k=L?h.indexOf(L):-1;if(M.key==="ArrowDown"||M.key==="ArrowUp"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach($=>$.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach($=>$.removeAttribute("data-hovered")),k===-1&&(k=M.key==="ArrowDown"?-1:h.length);let E=M.key==="ArrowDown"?1:-1,W=(k+E+h.length)%h.length;h[W].setAttribute("data-highlighted",""),h[W].focus({preventScroll:true});return}if(M.key==="Home"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(E=>E.removeAttribute("data-hovered")),h[0].setAttribute("data-highlighted",""),h[0].focus({preventScroll:true});return}if(M.key==="End"){M.preventDefault(),M.stopPropagation(),I(true),b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(E=>E.removeAttribute("data-hovered")),h[h.length-1].setAttribute("data-highlighted",""),h[h.length-1].focus({preventScroll:true});return}if(M.key==="Escape"){M.preventDefault(),b.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),I(false),b.blur();return}},[w]),O=useCallback(M=>{let b=M.currentTarget;b.hasAttribute("data-keyboard-nav")&&v(b);},[v]),S=useCallback(M=>{let b=M.currentTarget;b.hasAttribute("data-keyboard-nav")&&v(b);},[v]),F=useCallback(M=>{x.current=M,typeof y=="function"?y(M):y&&(y.current=M);},[y]);return jsx(oo.Provider,{value:C,children:jsx(ro.Provider,{value:P,children:jsx(Tt.Provider,{value:m,children:jsx(er.Provider,{value:t,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:f.spacing.sm,width:"100%",maxWidth:o},children:[l?jsx("div",{css:{width:"100%",textAlign:"left"},children:jsx("span",{css:{display:"block",color:f.text.secondary,fontSize:f.typography.sizes.xs,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof f.spacing.sm=="number"?`${f.spacing.sm}px`:f.spacing.sm,paddingTop:0},children:l})}):null,jsx("div",{ref:F,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[p,c],onFocus:B,onKeyDown:K,onPointerMove:O,onPointerDown:S,...d,children:i})]})})})})})});si.displayName="Menu";var ii=createContext(null),or=()=>{let e=useContext(ii);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function Du(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var io=(...e)=>t=>{for(let n of e)Du(n,t);},cs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Hu=e=>{useEffect(()=>{if(!e||typeof document>"u"||typeof window>"u")return;let t=document.body,n=t.style.overflow,o=t.style.paddingRight,r=window.innerWidth-document.documentElement.clientWidth,s=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${s+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},tr=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"&&t&&e in t){let n=t[e];return typeof n=="number"?`${n}px`:String(n)}return e}},Lu=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=x=>{e===void 0&&i(x),n?.(x);},d=useRef(null),y=useRef(null),f=(x=120)=>{y.current!=null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>u(false),x);},T=()=>{y.current!=null&&(window.clearTimeout(y.current),y.current=null);};Hu(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let x=R=>{if(R.key!=="Tab")return;let g=document.querySelector(".plainframe-ui-popover");if(!g)return;let p=Array.from(g.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), [role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(w=>{let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});if(p.length===0)return;let m=p[0],C=p[p.length-1],P=document.activeElement;R.shiftKey&&P===m?(R.preventDefault(),C.focus()):!R.shiftKey&&P===C&&(R.preventDefault(),m.focus());};return document.addEventListener("keydown",x,true),()=>document.removeEventListener("keydown",x,true)},[s,l]);let I=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:d,scheduleClose:f,cancelClose:T}),[l,o]);return jsx(ii.Provider,{value:I,children:a})},li=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:a,referenceRef:c,scheduleClose:i,cancelClose:l}=or(),u=me.Children.only(t),d=u.props||{},y=io(c,o,u.ref),f=a==="click"?{onClick:I=>{I.stopPropagation(),s(!r),d.onClick?.(I);}}:{onMouseEnter:I=>{l(),r||s(true),d.onMouseEnter?.(I);},onMouseLeave:I=>{i(),d.onMouseLeave?.(I);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let I=u.props?.css;return me.cloneElement(u,{...f,...T,ref:y,css:[I,n].filter(Boolean)})}return me.createElement("button",{ref:y,type:"button",css:[n],...f,...T,children:u})});li.displayName="PopoverTrigger";var ci=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=or(),a=me.Children.only(o),c=io(s,r,a.ref);if(e){let l=a.props?.css;return me.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:cs(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});ci.displayName="PopoverAnchor";function Bu(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let s=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?s:`${s}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var ui=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:c,padding:i,paddingX:l,paddingY:u,radius:d="lg",css:y,...f},T)=>{let{open:I,setOpen:x,triggerOn:R,referenceRef:g,scheduleClose:p,cancelClose:m}=or(),C=V(),P=Bu(e),{refs:w,x:v,y:N,strategy:B,context:K}=useFloating({open:I,onOpenChange:x,whileElementsMounted:autoUpdate,placement:P,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{g.current&&w.setReference(g.current);},[w,g]);let O=useDismiss(K,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(K,{role:"dialog"}),{getFloatingProps:F}=useInteractions([O,S]),[M]=K.placement.split("-"),b=M,h=`${b==="left"?"right":b==="right"?"left":"center"} ${b==="top"?"bottom":b==="bottom"?"top":"center"}`,A=8,D=b==="top"?{y:A}:b==="bottom"?{y:-A}:b==="left"?{x:A}:{x:-A},L={initial:{opacity:0,scale:.96,...D},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...D},transition:{scale:{type:"spring",stiffness:520,damping:32,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.16,ease:"linear"}}},k=C.surface.panelBg,E=C.text.primary,W=`${C.componentHeights.border} solid ${C.surface.border}`,$=tr(i,C.spacing),z=tr(l,C.spacing),_=tr(u,C.spacing),H={};$&&(H.padding=$),z&&(H.paddingInline=z),_&&(H.paddingBlock=_);let U=tr(d,C.radius)??C.radius.md,X="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",ae=css({position:B,top:N??0,left:v??0,zIndex:1e3,transformOrigin:h,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:cs(a)??"fit-content",height:cs(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),q=r?css({}):css({background:k,color:E,border:W,borderRadius:U,boxShadow:X,...H,...H.padding||H.paddingInline||H.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),Y=R==="hover"?{onMouseEnter:m,onMouseLeave:()=>p()}:{},le=io(w.setFloating,T),ie=jsx(motion.div,{className:"plainframe-ui-popover",...F({...f,ref:le,...Y}),...L,css:[ae,q,y],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:I?ie:null})})});ui.displayName="PopoverContent";var $u=()=>{let e=or();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var ms=me.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:d,...y},f){let T=V(),I=xe(),x={sm:{trackW:25,trackH:16,thumb:11,labelGap:8},md:{trackW:35,trackH:20,thumb:14,labelGap:8},lg:{trackW:45,trackH:24,thumb:18,labelGap:10}},R={slideMs:250,pressMs:150,easing:"ease"},g=t!==void 0,[p,m]=useState(n),C=g?!!t:p,[P,w]=useState(false);useEffect(()=>{if(r)return;w(true);let z=setTimeout(()=>w(false),R.pressMs);return ()=>clearTimeout(z)},[C,r]);let v=["sm","md","lg"].includes(s)?s:"md",N=x[v],B=`${R.slideMs}ms ${R.easing}`,K=T.palette?.primary?.[600]??T.neutral[900],O=T.neutral[300],S=C?K:O,F=C?T.text.onColors.primary:"#ffffff",{trackW:M,trackH:b,thumb:h}=N,A=(b-h)/2,D=css({display:"inline-flex",alignItems:"center",gap:N.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),L=css({position:"relative",width:M,height:b,backgroundColor:S,borderRadius:T.radius.xl,transition:`background-color ${B}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),k=css({position:"absolute",top:A,left:C?M-h-A:A,width:h,height:h,backgroundColor:F,borderRadius:T.radius.xl,transition:`left ${B}, transform ${B}, background-color 0.25s ease`,transform:P?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),E=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),W=()=>{if(r)return;let z=!C;g||m(z),o?.(z);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:W,onKeyDown:z=>{r||(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),W());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[D,I({color:C?"primary":"neutral"}),i],...y,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[L,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[k,u]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[E,d],children:a})]})}));var Uu=(e,t)=>t==="sm"?{box:16,labelFont:e.typography.sizes.xs,gap:8,borderRadius:e.radius.xxs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:t==="lg"?{box:24,labelFont:e.typography.sizes.md,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:{box:20,labelFont:e.typography.sizes.sm,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75},sr=me.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:d,checkCss:y,labelCss:f,descriptionCss:T,className:I,...x},R)=>{let g=V(),p=xe(),m=typeof e=="boolean",[C,P]=useState(t),w=m?e:C,v=r==="sm"||r==="lg"?r:"md",N=useMemo(()=>Uu(g,v),[g,v]),{checkedBg:B,checkColor:K,borderCol:O,hoverBg:S,gapPx:F}=useMemo(()=>{let z=g.palette||{},_=g.neutral||{},H=g.text?.onColors||{},U,X;l==="neutral"||l==="secondary"?(U=_,X="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(z,l)?(U=z[l]||z.primary||_,X=l):(U=z.primary||_,X="primary");let ae=U[600]??U[500]??U[400]??Object.values(U)[0]??g.palette.primary[600],q=H[X]??H.primary??g.text?.onColors?.primary??g.text.primary,Y=typeof N.gap=="number"?N.gap+2:N.gap;return {checkedBg:ae,checkColor:q,borderCol:g.surface.border,hoverBg:g.surface.panelHover,gapPx:Y}},[N.gap,l,g]),M=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:F,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:g.radius.sm,padding:g.spacing.xs,transition:"background-color .16s ease, color .16s ease, opacity .16s ease",'&:not([data-disabled="true"]):hover input:not(:checked) + .plainframe-ui-checkbox-box':{outlineColor:O,backgroundColor:S},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:B,outlineColor:B,"--pfui-bleed":B},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:B,backgroundColor:B,"--pfui-bleed":B},".plainframe-ui-checkbox-check":{opacity:0,transform:"scale(0.2)"},"input:checked + .plainframe-ui-checkbox-box .plainframe-ui-checkbox-check":{opacity:1,transform:"scale(1)"}}),[O,B,a,o,F,S,s,g.radius.sm,g.spacing.xs]),b=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),h=useMemo(()=>css({width:N.box,height:N.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${N.borderWidth} solid ${O}`,outlineOffset:`-${N.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?g.radius.full:N.borderRadius,transition:"background-color .16s ease, outline-color .05s ease, box-shadow .16s ease, transform .16s ease",flex:"0 0 auto",verticalAlign:"middle",overflow:"hidden",transform:"translateZ(0)",backfaceVisibility:"hidden"}),[N.box,N.borderRadius,N.borderWidth,O,c,g.radius.full]),A=useMemo(()=>({w:Math.round(N.box*N.iconRatioW),h:Math.round(N.box*N.iconRatioH)}),[N.box,N.iconRatioH,N.iconRatioW]),D=useMemo(()=>css({width:A.w,height:A.h,transition:"opacity .14s ease, transform .14s ease",color:K,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[K,A.h,A.w]),L=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),k=useMemo(()=>css({fontSize:N.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:g.text.primary}),[N.labelFont,g.text.primary]),E=useMemo(()=>css({fontSize:N.labelFont,lineHeight:1.25,color:g.text.secondary,fontWeight:400,marginTop:s&&a?g.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[N.labelFont,a,s,g.spacing.xs,g.text.secondary]),W=useCallback(()=>{o||(m?n?.(!w):P(z=>{let _=!z;return n?.(_),_}));},[o,m,w,n]),$=useCallback(z=>{o||(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),W());},[o,W]);return jsxs("label",{ref:R,role:"checkbox","aria-checked":w,"aria-disabled":o||void 0,"data-state":w?"checked":"unchecked",className:["plainframe-ui-checkbox",I||""].join(" ").trim(),css:[M,p({color:w?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:$,children:[jsx("input",{type:"checkbox",checked:w,onChange:W,disabled:o,css:b,...x,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[h,d],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[D,y],children:w&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:K,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",css:css({width:"100%",height:"100%",display:"block"}),"aria-hidden":"true",focusable:"false",children:jsx("polyline",{points:"20 6 9 17 4 12"})}))})}),(s||a)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:L,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[k,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[E,T],children:a})]})]})}));sr.displayName="Checkbox";var Xu=()=>useContext(fn),Yu=()=>useContext(ro),Ju=()=>useContext(ur),dn=null,gi=(e,t=35)=>{dn!==null&&window.clearTimeout(dn),dn=window.setTimeout(()=>{e(),dn=null;},t);},lo=()=>{dn!==null&&(window.clearTimeout(dn),dn=null);},pn=me.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:d=false,active:y,meta:f,__index:T,__skipListReg:I,...x},R){let g=Xu(),p=Ju(),m=cr(),C=uo(),P=Yu(),w=V(),N=!!useContext(Tt),B=x["data-subtrigger"]!==void 0,K=B&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,F=useContext(er),M=F==="subtle"?w.surface?.subtleHover??w.neutral[100]:w.surface?.subtleBg??w.neutral[100],b=useMemo(()=>css({width:"100%",borderRadius:w.radius.md,padding:`${w.spacing.sm} ${w.spacing.sm}`,paddingLeft:S>0?`calc(${w.spacing.md} + (${w.spacing.xl} * ${S}))`:w.spacing.md,minHeight:N?w.componentHeights.sm:w.componentHeights.md,display:"flex",alignItems:"center",gap:w.spacing.sm,fontWeight:500,fontSize:w.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?w.palette.danger[800]:w.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?w.palette.danger[50]:M},"&[data-highlighted]":t?{}:{background:n?w.palette.danger[50]:M},"&[data-active]":t?{}:{background:n?w.palette.danger[50]:M},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?w.palette.danger[50]:M},"[role='menu']:not([data-keyboard-nav]) &:not([data-disabled]):hover [data-menu-checkbox-wrapper],&:not([data-disabled])[data-highlighted] [data-menu-checkbox-wrapper],&:not([data-disabled])[data-active] [data-menu-checkbox-wrapper],&[data-subtrigger][aria-expanded='true'] [data-menu-checkbox-wrapper]":{background:w.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[w,N,S,t,n,M]),h=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}}),[]),A=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:w.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:w.text.secondary}),[w.text.secondary,w.spacing.sm]),D=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:w.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[w.palette.primary]),L=[];N&&L.push({minHeight:w.componentHeights.sm,paddingLeft:w.spacing.sm,paddingRight:w.spacing.xs,paddingTop:w.spacing.xs,paddingBottom:w.spacing.xs});let k=()=>{s?.(),r&&!B&&p?.closeAll();},E=($,z)=>{let _=$.closest('[role="menu"]');if(!_)return;let H=Array.from(_.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(Y=>{if(Y.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(Y);return le.display!=="none"&&le.visibility!=="hidden"});if(!H.length)return;let U=H.indexOf($),X=U>=0?U:0,ae=z(H.length,X),q=H[ae];q&&(document.querySelectorAll("[data-highlighted]").forEach(Y=>{Y.removeAttribute("data-highlighted");}),q.setAttribute("data-highlighted",""),q.focus(),g&&T!=null&&g.setActiveIndex(ae));},W=t?-1:P?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":y?"":void 0,tabIndex:W,ref:$=>{if(g&&!I){let z=g.listRef.current;$&&(T!=null?z[T]=$:z.includes($)||z.push($));}typeof R=="function"?R($):R&&"current"in R&&(R.current=$);},onMouseMove:$=>{if($.currentTarget.hasAttribute("data-hovered"))return;let z=!!$.currentTarget.closest("[data-submenu-content]");!B&&m&&!z&&gi(m.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(H=>{H.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(H=>{H.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(H=>{H.removeAttribute("data-active");}),$.currentTarget.setAttribute("data-hovered","");let _=$.currentTarget.closest("[data-menu-id]")||$.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&g&&T!=null&&g.setActiveIndex(T),!t&&!P?.allItemsTabbable&&$.currentTarget.focus({preventScroll:true});},onMouseEnter:$=>{if(B)lo();else {let H=!!$.currentTarget.closest("[data-submenu-content]");m&&!H&&gi(m.closeAllSubMenus);}$.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(H=>{H.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(H=>{H.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(H=>{H.removeAttribute("data-active");})),$.currentTarget.setAttribute("data-hovered","");let _=$.currentTarget.closest("[data-menu-id]")||$.currentTarget.closest('[role="menu"]');!t&&g&&T!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),g.setActiveIndex(T)),!t&&!P?.allItemsTabbable&&$.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{g&&g.setActiveIndex(null);},onKeyDown:$=>{if(t)return;let z=$.currentTarget;if($.key==="Tab"&&g&&!P?.allItemsTabbable){$.preventDefault();return}if($.key==="Tab"&&!g){let _=z.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let H=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=H>=0?H:0;});}C&&C.setIsKeyboardNav(false);return}if($.key==="Enter"||$.key===" "||$.key==="ArrowRight"){B||$.key!=="ArrowRight"&&($.preventDefault(),$.stopPropagation(),k());return}if($.key==="ArrowLeft"&&z.closest('[role="menu"]')?.closest("[data-submenu-content]")){$.preventDefault(),$.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let X=U.__pfuiCloseSubmenu;X&&X(),document.querySelectorAll("[data-highlighted]").forEach(q=>q.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(q=>q.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let ae=U.closest("[data-menu-id]");ae&&ae.setAttribute("data-keyboard-nav","");}return}if($.key==="Escape"){$.preventDefault(),$.stopPropagation(),p?.closeAll(),z.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if($.key==="ArrowDown"){$.preventDefault(),$.stopPropagation();let _=z.closest("[data-menu-id]")||z.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),E(z,(H,U)=>(U+1)%H);return}if($.key==="ArrowUp"){$.preventDefault(),$.stopPropagation();let _=z.closest("[data-menu-id]")||z.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),E(z,(H,U)=>(U-1+H)%H);return}if($.key==="Home"){$.preventDefault(),$.stopPropagation();let _=z.closest("[data-menu-id]")||z.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),E(z,()=>0);return}if($.key==="End"){$.preventDefault(),$.stopPropagation();let _=z.closest("[data-menu-id]")||z.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),E(z,H=>H-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[b,...L,i].flat()),...x,onClick:$=>{t||($.currentTarget.removeAttribute("data-highlighted"),k());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:h,children:l}),a,(f!=null||K||d)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:A,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:w.typography.sizes.sm,color:w.text.secondary,whiteSpace:"nowrap"}),children:f}):null,K,d&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:D,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),hi=me.createContext(null),gs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(y=>{let f=i.current,I=f.some(x=>Object.is(x,y))?f.filter(x=>!Object.is(x,y)):[...f,y];a||s(I),l.current?.(I);},[a]),d=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(hi.Provider,{value:d,children:o})},co=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:l,startIcon:u,endIcon:d,...y},f){let T=useContext(hi),I=!!T&&r!==void 0,x=!I&&t!==void 0,[R,g]=useState(()=>I?T.values.some(O=>Object.is(O,r)):!!n),p=I?T.values.some(O=>Object.is(O,r)):x?!!t:R,m=V(),P=!!useContext(Tt),w=()=>{if(!c)if(I)T.toggle(r);else {let O=!p;x||g(O),o?.(O);}},v=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:P?-1:-3,borderRadius:m.radius.xs,transition:"background-color .12s ease"}),N=css({pointerEvents:"none"}),B=useCallback(O=>{O&&(O.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),O.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),K=jsxs(Fragment,{children:[jsx("span",{ref:B,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:v,"aria-hidden":"true",children:jsx(sr,{size:"sm",checked:p,css:N})}),u]});return jsx(pn,{...y,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":p,closeOnSelect:false,onSelect:w,disabled:c,startIcon:K,endIcon:d,css:i,selected:false,children:s})});co.displayName="MenuCheckboxItem";var yi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:l,startIcon:u,className:d,...y},f){let T=t!==void 0,[I,x]=useState(!!n),R=T?!!t:I,p=!!useContext(Tt),m=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:p?2:void 0}),P=()=>{if(a)return;let v=!R;T||x(v),o?.(v);},w=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,"& > *":{flexShrink:0},"& > svg:only-child":{width:16,height:16,display:"block"}});return jsxs(pn,{...y,className:["plainframe-ui-menu-switch-item",d||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:P,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:w,children:u}),jsx("span",{"data-label":true,css:m,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(ms,{checked:R,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});yi.displayName="MenuSwitchItem";var xi=me.createContext(null),lr=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,c=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:c}),[a]);return jsx(xi.Provider,{value:i,children:o})};lr.displayName="MenuRadioGroup";var Zu=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(xi),u=l?.value===t,d=V(),y=css({width:d.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:d.palette.primary[600],transform:u?"scale(1)":"scale(0.4)",opacity:u?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),T=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(pn,{...c,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":u,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:y,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:T,children:n})]})}),mn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...l},u){let d=V(),f=!!useContext(Tt),T=i==="primary"?d.text.primary:i==="secondary"?d.text.secondary:d.palette[i]?.[700]??d.text.primary,I=css({display:"flex",alignItems:"center",padding:f?`${d.spacing.sm} ${d.spacing.md}`:`${d.spacing.sm} ${d.spacing.md}`,fontSize:d.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${d.spacing.lg} * 2)`}:null,gap:d.spacing.xs}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),R=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,padding:"0 3px 0 2px",marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),g=css({display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,lineHeight:0,"& > svg":{width:16,height:16,display:"block"}});return jsxs("div",{ref:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(I,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:R,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:x,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:g,children:a})]})});mn.displayName="MenuLabel";var Qu=({className:e,css:t,variant:n="full",...o})=>{let r=V(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var bs=io,po=0,dr=null,pr=null,pd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function md(){if(!(typeof document>"u")){if(po===0){let e=document.body;dr=e.style.overflow||"",pr=e.style.paddingRight||"";let t=pd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}po+=1;}}function fd(){if(!(typeof document>"u")&&(po>0&&(po-=1),po===0)){let e=document.body;dr!==null&&(e.style.overflow=dr),pr!==null&&(e.style.paddingRight=pr),dr=null,pr=null;}}var fn=createContext(null),mr=()=>{let e=useContext(fn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},mo=createContext(null),gd=()=>useContext(mo),oo=createContext(null),uo=()=>useContext(oo),Ci=createContext(null),cr=()=>useContext(Ci),Ri=createContext(false),bd=()=>useContext(Ri),ro=createContext({allItemsTabbable:true}),ur=me.createContext(null),hs=()=>useContext(ur);function hd(){let e=[],t=new Set,n={current:false};return {registerCloser(o){return e.push(o),()=>{let r=e.indexOf(o);r>=0&&e.splice(r,1);}},closeAll(){if(!n.current){n.current=true;for(let o=e.length-1;o>=0;o--)try{e[o]();}catch{}queueMicrotask(()=>{n.current=false;});}},registerHoverCtl(o){return t.add(o),()=>t.delete(o)},clearAllHover(){t.forEach(o=>o.clear());},isBusClosingRef:n}}var yd=()=>gd()?.activeIndex??null,Ti=0,$n=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(F=>{e===void 0&&i(F),n?.(F);},[e,n]),d=useRef(`pfui-menu-${++Ti}`),y=useRef(null),f=useRef([]),T=useRef(null),[I,x]=useState(null),[R,g]=useState(false);useEffect(()=>{l||(x(null),f.current=[],g(false));},[l]);let p=useRef(null),m=useCallback((F,M)=>{if(o!=="hover")return;window.clearTimeout(p.current??0);let b=M??20;p.current=window.setTimeout(()=>u(F),b);},[o,u]),C=useCallback(()=>{p.current&&(window.clearTimeout(p.current),p.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return md(),()=>fd()},[l,r]);let P=hs(),[w]=useState(()=>P??hd()),v=useRef(new Set),N=useMemo(()=>({registerSubMenu:F=>(v.current.add(F),()=>v.current.delete(F)),closeAllSubMenus:()=>{v.current.forEach(F=>F());}}),[]),B=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:y,listRef:f,floatingRef:T,setActiveIndex:x,scheduleSubmenuHover:m,clearSubmenuHover:C,menuId:d.current}),[l,u,o,x,m,C]),K=useMemo(()=>({activeIndex:I,setActiveIndex:x}),[I,x]),O=useMemo(()=>({isKeyboardNav:R,setIsKeyboardNav:g}),[R]),S=s==="sm";return jsx(ur.Provider,{value:w,children:jsx(Tt.Provider,{value:S,children:jsx(oo.Provider,{value:O,children:jsx(Ci.Provider,{value:N,children:jsx(mo.Provider,{value:K,children:jsx(fn.Provider,{value:B,children:a})})})})})})};$n.displayName="DropdownMenu";var zn=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:d,setActiveIndex:y,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:I,menuId:x}=mr(),R=uo(),g=cr(),p=!!e&&isValidElement(t),m=p?t:null,C=m&&m.props&&typeof m.props=="object"&&"onKeyDown"in m.props?m.props.onKeyDown:void 0,P=m&&m.props&&typeof m.props=="object"&&"onClick"in m.props?m.props.onClick:void 0,{onKeyDown:w,onClick:v,...N}=s,B=useMemo(()=>bs(a,p&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,p,t,u]),K=useCallback(()=>d.current.filter(Boolean),[d]),O=useCallback(h=>{let A=K();requestAnimationFrame(()=>A[h]?.focus());},[K]),S=useCallback(h=>{if(h.key==="Tab"&&c){h.preventDefault(),R?.setIsKeyboardNav(true);let A=I?.current;if(A){A.setAttribute("data-keyboard-nav","");let D=A.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');D&&(document.querySelectorAll("[data-highlighted]").forEach(L=>L.removeAttribute("data-highlighted")),D.setAttribute("data-highlighted",""),D.focus());}return}if(h.key==="ArrowRight"&&c){let A=document.querySelector("[data-subtrigger][data-hovered]");if(A){h.preventDefault(),h.stopPropagation(),R?.setIsKeyboardNav(true),A.removeAttribute("data-hovered"),A.setAttribute("data-highlighted",""),A.focus(),requestAnimationFrame(()=>{let D=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});A.dispatchEvent(D);});return}}if(h.key==="ArrowDown"||h.key==="ArrowUp"){if(R?.setIsKeyboardNav(true),!c){h.preventDefault(),i(true),requestAnimationFrame(()=>{let A=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(A){A.setAttribute("data-keyboard-nav","");let D=Array.from(A.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(L=>{let k=L.closest("[data-submenu-content]");if(k&&k!==A)return false;let E=window.getComputedStyle(L);return E.display!=="none"&&E.visibility!=="hidden"});if(D.length>0){let L=h.key==="ArrowDown"?0:D.length-1;y(L),D[L]?.setAttribute("data-highlighted",""),D[L]?.focus();}}}),C?.(h),w?.(h);return}if(c){h.preventDefault();let A=document.querySelectorAll("[data-hovered]");for(let L of Array.from(A))if(L.closest("[data-submenu-content]")){let E=L.closest('[role="menu"]');if(E){E.setAttribute("data-keyboard-nav","");let W=Array.from(E.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(z=>{if(z.closest('[role="menu"]')!==E)return false;let _=window.getComputedStyle(z);return _.display!=="none"&&_.visibility!=="hidden"}),$=W.indexOf(L);if(document.querySelectorAll("[data-highlighted]").forEach(z=>z.removeAttribute("data-highlighted")),L.removeAttribute("data-hovered"),$!==-1&&W.length>0){let z=h.key==="ArrowDown"?1:-1,_=($+z+W.length)%W.length;W[_]?.setAttribute("data-highlighted",""),W[_]?.focus();}return}}let D=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(D){D.setAttribute("data-keyboard-nav",""),g?.closeAllSubMenus();let L=Array.from(D.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(k=>{if(k.closest('[role="menu"]')!==D)return false;let E=window.getComputedStyle(k);return E.display!=="none"&&E.visibility!=="hidden"});if(L.length>0){let k=D.querySelector("[data-highlighted]"),E=D.querySelector("[data-hovered]"),W=-1;k?W=L.indexOf(k):E&&(W=L.indexOf(E)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),E&&E.removeAttribute("data-hovered"),W===-1&&(W=h.key==="ArrowDown"?-1:L.length);let $=h.key==="ArrowDown"?1:-1,z=(W+$+L.length)%L.length;y(z),L[z]?.setAttribute("data-highlighted",""),L[z]?.focus();}}C?.(h),w?.(h);return}}if((h.key==="Enter"||h.key===" ")&&!c){h.preventDefault(),R?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let A=x?document.querySelector(`[data-menu-id="${x}"]`):I?.current;if(A){A.setAttribute("data-keyboard-nav","");let D=Array.from(A.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(L=>{let k=L.closest("[data-submenu-content]");if(k&&k!==A)return false;let E=window.getComputedStyle(L);return E.display!=="none"&&E.visibility!=="hidden"});D.length>0&&(y(0),D[0]?.setAttribute("data-highlighted",""),D[0]?.focus());}}),C?.(h),w?.(h);return}C?.(h),w?.(h);},[c,i,y,C,w,K,O,d,R,x,I,g]),F=useCallback(h=>{l==="click"&&((h.nativeEvent.composedPath?.()??[]).some(k=>{let E=k;if(!E||!("tagName"in E))return false;let W=String(E.tagName).toUpperCase();if(W==="INPUT"||W==="TEXTAREA"||"isContentEditable"in E&&E.isContentEditable)return true;let $="getAttribute"in E?E.getAttribute("role"):null;return $==="textbox"||$==="combobox"})||(h.stopPropagation(),i(!c))),P?.(h),v?.(h);},[l,c,i,P,v]),M=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},b=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(p&&m){let h=m.props,A=h.css,D=typeof h.className=="string"?h.className:void 0,L=typeof h.tabIndex=="number"?h.tabIndex:0,k={ref:B,tabIndex:L,className:[D,o].filter(Boolean).join(" ")||void 0,css:[A,b,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:F,onKeyDown:S,...M,...N};return cloneElement(m,k)}return jsx("button",{ref:B,className:o,css:[css({display:"inline-block"}),b,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:F,onKeyDown:S,...M,...N,children:t})});zn.displayName="DropdownMenuTrigger";var hn=me.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:d=false,allItemsTabbable:y=false,className:f,css:T,children:I,exitPlacement:x,animateOnBusClose:R=true,gap:g,ignoreOutsidePressRefs:p,disableOutsidePressDismiss:m=false,returnFocus:C=false,...P},w)=>{let{open:v,setOpen:N,referenceRef:B,clearSubmenuHover:K,setActiveIndex:O,floatingRef:S,menuId:F}=mr(),M=V(),b=hs(),h=uo();useEffect(()=>{if(!b)return;let J=b.registerCloser(()=>N(false));return ()=>{J&&J();}},[b,N]);let A=typeof o=="string"?parseFloat(o):o,D=typeof r=="string"?parseFloat(r):r,L=typeof s=="string"?parseFloat(s):s,k=`${t}${n==="center"?"":`-${n}`}`,E=useCallback(J=>({getBoundingClientRect:()=>{let oe=Math.round(J.x),re=Math.round(J.y);return {x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0,toJSON:()=>({x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0})}},contextElement:void 0}),[]),W=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let J=e;return E({x:J.x,y:J.y})},[e,E]),{refs:$,x:z,y:_,strategy:H,context:U,update:X}=useFloating({open:v,onOpenChange:N,placement:k,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:A??0,crossAxis:D??0}),flip({padding:L??8}),shift({padding:L??8}),size({apply({rects:J,elements:oe}){let re=oe.floating;re.style.boxSizing="border-box",i!=null?re.style.height=typeof i=="number"?`${i}px`:String(i):re.style.removeProperty("height"),c!=null?re.style.width=typeof c=="number"?`${c}px`:String(c):a?re.style.width=`${Math.round(J.reference.width)}px`:re.style.width="200px",l!=null?re.style.maxHeight=typeof l=="number"?`${l}px`:String(l):re.style.removeProperty("max-height");}})]});useEffect(()=>{W?$.setReference(W):B.current&&$.setReference(B.current);},[$,W,B]),useEffect(()=>{if(!v)return;let J=W||B.current,oe=$.floating.current;if(!(!J||!oe))return autoUpdate(J,oe,X)},[v,W,B,$,X]),useEffect(()=>{X();},[X,a,c,i,l]),useEffect(()=>{v&&!y&&O(0);},[v,y,O]),useEffect(()=>{if(!d||!v)return;let J=()=>{let oe=document.activeElement,re=B.current,qe=$.floating.current;oe&&(re?.contains(oe)||qe?.contains(oe)||N(false));};return document.addEventListener("focusin",J,true),()=>document.removeEventListener("focusin",J,true)},[d,v,N,B,$.floating]);let ae=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:m?false:J=>{if(p?.length){let oe=J.target;for(let re of p)if(re.current?.contains(oe))return false}return true}}),q=useRole(U,{role:"menu"}),{getFloatingProps:Y}=useInteractions([ae,q]),le=useRef(false);useEffect(()=>{v?le.current=true:le.current&&B.current&&C&&(b?.isBusClosingRef.current||requestAnimationFrame(()=>{B.current?.focus();}));},[v,B,b,C]);let ie=typeof M.spacing.xs=="number"?`${M.spacing.xs}px`:String(M.spacing.xs),be=g===void 0?void 0:typeof g=="number"?g:M.spacing[g]??g,Pe=u?void 0:css({boxSizing:"border-box",background:M.surface.panelBg,border:`${M.componentHeights.border} solid ${M.surface.border}`,borderRadius:M.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":ie,padding:"var(--pfui-panel-pad)",color:M.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:be,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Re=-1,Ce=J=>{if(!J||typeof J!="object"||!isValidElement(J))return J;let re=J.type?.displayName;if(re==="DropdownMenu"||re==="DropdownMenuSub")return J;if(re==="MenuItem"||re==="MenuCheckboxItem"||re==="MenuRadioItem"||re==="MenuSwitchItem")return Re+=1,cloneElement(J,{__index:Re,key:J.key??Re});if(re==="DropdownMenuTrigger"){let j=J.props.children;return cloneElement(J,{children:me.Children.map(j,Ce)})}if(re==="DropdownMenuSubTrigger"){Re+=1;let j=Re;return cloneElement(J,{__index:j,key:J.key??j})}let qe=J.props.children;return qe==null?J:cloneElement(J,{children:me.Children.map(qe,Ce)})},Ie=me.Children.map(I,Ce),we=U.placement.split("-")[0]||"bottom",he=we==="bottom"?"center top":we==="top"?"center bottom":we==="left"?"right center":"left center",je=we==="bottom"?{opacity:0,y:-8,scale:.96}:we==="top"?{opacity:0,y:8,scale:.96}:we==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Z=x??we,Ee=Z==="bottom"?{opacity:0,y:-8,scale:.96}:Z==="top"?{opacity:0,y:8,scale:.96}:Z==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},ee=!!b?.isBusClosingRef.current&&!R?{scale:{duration:0},x:{duration:0},y:{duration:0},opacity:{duration:0}}:{scale:{type:"spring",stiffness:520,damping:38,mass:.5},x:{type:"spring",stiffness:420,damping:30,mass:.6},y:{type:"spring",stiffness:420,damping:30,mass:.6},opacity:{duration:.12,ease:"linear"}},se=css({position:H,top:_??0,left:z??0,zIndex:1e3,transformOrigin:he}),pe=useCallback(J=>{if(J.key==="Tab"){J.preventDefault();return}if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),h?.setIsKeyboardNav(true);let oe=J.currentTarget;oe.setAttribute("data-keyboard-nav","");let re=Array.from(oe.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(qe=>{if(qe.closest('[role="menu"]')!==oe)return false;let j=window.getComputedStyle(qe);return j.display!=="none"&&j.visibility!=="hidden"});if(re.length>0){let qe=oe.querySelector("[data-highlighted]"),j=oe.querySelector("[data-hovered]"),ue=-1;qe?ue=re.indexOf(qe):j&&(ue=re.indexOf(j)),document.querySelectorAll("[data-highlighted]").forEach(ze=>ze.removeAttribute("data-highlighted")),j&&j.removeAttribute("data-hovered"),ue===-1&&(ue=J.key==="ArrowDown"?-1:re.length);let de=J.key==="ArrowDown"?1:-1,fe=(ue+de+re.length)%re.length;O(fe),re[fe]?.setAttribute("data-highlighted",""),re[fe]?.focus();}}},[h,O]),Se=useCallback(J=>{let oe=J.currentTarget;oe.removeAttribute("data-keyboard-nav"),oe.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),h?.isKeyboardNav&&h.setIsKeyboardNav(false);},[h]),Ne=useCallback(J=>{J.removeAttribute("data-keyboard-nav"),J.querySelectorAll("[data-highlighted]").forEach(oe=>oe.removeAttribute("data-highlighted")),h?.isKeyboardNav&&h.setIsKeyboardNav(false);},[h]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:v?jsx(ro.Provider,{value:{allItemsTabbable:y},children:jsx(motion.div,{...Y({...P,ref:bs(w,$.setFloating,J=>{S&&(S.current=J);})}),"data-menu-id":F,"data-keyboard-nav":h?.isKeyboardNav?"":void 0,className:f,css:[Pe,se,T],initial:je,animate:{opacity:1,x:0,y:0,scale:1},exit:Ee,transition:ee,onPointerMove:J=>Ne(J.currentTarget),onPointerDown:J=>Ne(J.currentTarget),onKeyDown:pe,onMouseMove:Se,onMouseEnter:()=>{K(),b?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(J=>J.removeAttribute("data-hovered"));},children:Ie})}):null})})});hn.displayName="DropdownMenuContent";var wi=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=bd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{e===void 0&&i(S),n?.(S);},[e,n]),d=useRef(null),y=useRef(false),f=useCallback((S,F)=>{if(o!=="hover")return;window.clearTimeout(d.current??0),y.current=S;let M=F??20;d.current=window.setTimeout(()=>{y.current=false,u(S);},M);},[o,u]),T=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null,y.current=false);},[]);useEffect(()=>()=>T(),[T]);let I=cr();useEffect(()=>{if(!I)return;let S=()=>{T(),u(false);};return I.registerSubMenu(S)},[I,u,T]);let x=useRef(`pfui-submenu-${++Ti}`),R=useRef(null),g=useRef([]),p=useRef(null),[m,C]=useState(null),[P,w]=useState(false);useEffect(()=>{l||(C(null),g.current=[],w(false));},[l]);let v=useContext(Tt),N=r??v,B=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:R,listRef:g,floatingRef:p,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:y,menuId:x.current}),[l,u,o,C,f,T]),K=useMemo(()=>({activeIndex:m,setActiveIndex:C}),[m,C]),O=useMemo(()=>({isKeyboardNav:P,setIsKeyboardNav:w}),[P]);return a?(console.warn("[DropdownMenu] Nested submenus are not supported. DropdownMenuSub can only be used one level deep inside DropdownMenu. The nested submenu content will not be rendered."),jsx(Fragment,{children:me.Children.map(s,S=>{if(!isValidElement(S))return S;let F=S.type;return F?.displayName==="DropdownMenuSubTrigger"||F?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(Ri.Provider,{value:true,children:jsx(Tt.Provider,{value:N,children:jsx(mo.Provider,{value:K,children:jsx(oo.Provider,{value:O,children:jsx(fn.Provider,{value:B,children:s})})})})})};wi.displayName="DropdownMenuSub";var Ei=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,scheduleSubmenuHover:d,clearSubmenuHover:y,pendingOpenRef:f,menuId:T}=mr(),I=uo(),x=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),R=!!e&&isValidElement(t),g=R?t:null,p=g?.props,m=p?.onKeyDown,C=p?.onClick,{onKeyDown:P,onClick:w,...v}=s,N=useMemo(()=>bs(a,R&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,x),[a,R,t,u,x]),B=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,K=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let F=S.currentTarget,M=b=>{I?.setIsKeyboardNav(true);let h=F.closest("[data-menu-id]");if(!h)return;h.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted"));let A=Array.from(h.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(E=>{if(E.closest("[data-menu-id]")!==h)return false;let W=window.getComputedStyle(E);return W.display!=="none"&&W.visibility!=="hidden"});if(!A.length)return;let D=A.indexOf(F),L=D>=0?D:0,k=b==="next"?(L+1)%A.length:(L-1+A.length)%A.length;A[k]?.setAttribute("data-highlighted",""),A[k]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&i(false),M("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&i(false),M("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),I?.setIsKeyboardNav(true);let b=S.currentTarget;i(true),requestAnimationFrame(()=>{let h=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(h){h.setAttribute("data-keyboard-nav",""),b.removeAttribute("data-highlighted"),b.removeAttribute("data-hovered");let A=h.querySelector('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]):not([data-subtrigger]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])');A&&(A.setAttribute("data-highlighted",""),A.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let b=F.closest("[data-menu-id]");b&&b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(h=>h.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(h=>h.removeAttribute("data-hovered")),F.setAttribute("data-highlighted",""),F.focus(),I&&I.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),m?.(S);return}m?.(S),P?.(S);},[c,i,m,P,u,I,T]),O=l==="hover"?{onMouseEnter:S=>{let F=S.currentTarget;lo(),y(),document.querySelectorAll("[data-hovered]").forEach(b=>b.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),F.setAttribute("data-hovered",""),F.focus({preventScroll:true});let M=F.closest("[data-menu-id]");M?.hasAttribute("data-keyboard-nav")&&M.removeAttribute("data-keyboard-nav"),I&&I.setIsKeyboardNav(false),c||d(true,90);},onMouseMove:S=>{let F=S.currentTarget;lo(),F.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(M=>M.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(M=>M.removeAttribute("data-highlighted")),F.setAttribute("data-hovered","")),!c&&!f?.current&&d(true,90);},onMouseLeave:()=>{d(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),w?.(S);}};if(R&&g){let S=p?.css,F=typeof p?.className=="string"?p.className:void 0,M=typeof p?.tabIndex=="number"?p.tabIndex:0,b={ref:N,tabIndex:M,className:[F,o].filter(Boolean).join(" ")||void 0,css:[S,B,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:K,onFocus:h=>{if(h.target.hasAttribute("data-highlighted")){let A=h.target.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),I&&I.setIsKeyboardNav(true));}p&&"onFocus"in p&&typeof p.onFocus=="function"&&p.onFocus(h);},...O,...v};return cloneElement(g,b)}return jsx("div",{ref:N,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),B,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:K,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let F=S.currentTarget.closest("[data-menu-id]");F&&!F.hasAttribute("data-keyboard-nav")&&(F.setAttribute("data-keyboard-nav",""),I&&I.setIsKeyboardNav(true));}},...O,...v,children:t})});Ei.displayName="DropdownMenuSubTrigger";var ki=me.forwardRef((e,t)=>{let n=hs(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=mr(),a=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(hn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),lo(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});ki.displayName="DropdownMenuSubContent";var fr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Cd=css({display:"inline"}),Si=css({display:"inline",fontWeight:700}),Rd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Td=css({display:"flex",alignItems:"center",gap:4}),wd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Mi=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Ed=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),kd=()=>{},Id=e=>e,Sd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Md=e=>{e.preventDefault(),e.stopPropagation();},Fd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Ad=e=>{e.preventDefault(),e.stopPropagation();},Fi=me.memo(({onCapture:e})=>{let t=useContext(fn),n=useContext(mo),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Fi.displayName="CtxCapture";var ys=me.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:d,descriptionColor:y})=>{let f=o(),T=useMemo(()=>{let R=String(e.title??e.value);return s?R:a(R)},[a,e.title,e.value,s]),I=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:wd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Mi,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Ed,{color:y}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Mi,children:T}),[T,e.description,y]),x=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let R=f.some(g=>Object.is(g,e.value));return s?jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:d,children:s(e,R)},e.value):jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:d,startIcon:e.startIcon,endIcon:e.endIcon,children:I},e.value)}return s?jsx(pn,{__index:t,onClick:x,onSelect:x,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:d,selected:r,children:s(e,r)},e.value):jsx(pn,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:x,onSelect:x,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:d,selected:r,children:I},e.value)},(e,t)=>!(e.item.value!==t.item.value||e.item.disabled!==t.item.disabled||e.item.description!==t.item.description||e.absIndex!==t.absIndex||e.multiple!==t.multiple||e.closeOnSelect!==t.closeOnSelect||e.renderItem!==t.renderItem||e.pickSingle!==t.pickSingle||e.isSelected!==t.isSelected||e.paint!==t.paint||e.descriptionColor!==t.descriptionColor));ys.displayName="AutocompleteRow";var Ai=me.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:d,variant:y,startIcon:f,endIcon:T,size:I,disabled:x=false,error:R=false,showClear:g=false,open:p,onOpenChange:m,openOnFocus:C=false,openOnType:P=true,openOnClick:w=true,closeOnSelect:v=true,closeOnBlur:N=true,blurOnSelect:B=false,freeSolo:K=false,customValueLabel:O=false,maxHeight:S,maxItems:F,noResultsText:M="No Items Found",highlightTypedValue:b,typedValueHighlightCss:h,showNoResults:A=true,noResultsLabelCss:D,loadingLabelCss:L,loadItems:k,loading:E,loadingText:W="Loading\u2026",debounceMs:$=200,multiple:z=false,selectedValues:_,defaultSelectedValues:H,onChangeSelected:U,expandIcon:X,showExpandIcon:ae=true,expandIconCss:q,textFieldWrapperCss:Y,textFieldInputCss:le,textFieldLabelCss:ie,textFieldHelperRowCss:be,textFieldHelperTextCss:Pe,textFieldStartIconCss:Re,textFieldEndIconCss:Ce,menuContentCss:Ie})=>{let we=V().text.secondary,[he,je]=useState(""),Z=typeof p=="boolean",[Ee,Q]=useState(false),ee=Z?p:Ee,se=useRef(null),pe=useRef(null),Se=useRef(null),Ne=useRef(null),J=useRef(false),oe=useRef(null),re=useRef(false),qe=useRef(0),j=useMemo(()=>[pe],[]),[ue,de]=useState(H??[]),fe=_??ue,ze=useRef(fe);ze.current=fe;let[Oe,st]=useState(null),Ye=useRef(Oe);Ye.current=Oe;let yt=useCallback(()=>ze.current,[]),[tn,nn]=useState([]),[Sn,on]=useState(false),Je=typeof k=="function",xt=Je?tn:e,ce=useRef(xt);ce.current=xt;let ke=!!E||Sn&&Je,at=useRef(m);useEffect(()=>{at.current=m;},[m]);let De=useCallback(G=>{Z||Q(G),at.current?.(G);},[Z]),bt=useRef(null);useEffect(()=>{if(!Je)return;bt.current&&window.clearTimeout(bt.current);let G=he;return bt.current=window.setTimeout(async()=>{on(true);try{let ne=await k(G)||[];nn(Array.isArray(ne)?ne:[]);}catch{nn([]);}finally{on(false);}},Math.max(0,$)),()=>{bt.current&&window.clearTimeout(bt.current);}},[he,Je,k,$]);let Zn=useMemo(()=>{let G=fr(he);return G?xt.some(ne=>fr(ne.title??ne.value)===G):false},[xt,he]),sa=K&&!!O&&he.trim().length>0&&!Zn,nc=G=>{if(typeof O=="object"){let ne=Object.prototype.hasOwnProperty.call(O,"prefix"),ve=Object.prototype.hasOwnProperty.call(O,"suffix");if(ne||ve){let Me=ne?O.prefix??"":"",ge=ve?O.suffix??"":"";return `${Me}${G}${ge}`}return `Add "${G}"`}return `Add "${G}"`},Or=useMemo(()=>{if(Je)return xt;let G=fr(he);if(!G)return xt;let ne=[],ve=[];for(let Me of xt){let ge=fr(Me.title??Me.value);ge.split(" ").some(Ze=>Ze.startsWith(G))?ne.push(Me):ge.includes(G)&&ve.push(Me);}return ne.length>0?ne:ve},[xt,he,Je]),aa=useMemo(()=>{if(sa){let G=he.trim();return [...Or,{value:G,title:nc(G),__pfui_free__:true}]}return Or},[Or,sa,he]),Kt=useMemo(()=>{let G=[],ne=new Map;for(let pt of aa){let Ze=pt.group??"__ungrouped__";ne.has(Ze)||(ne.set(Ze,[]),G.push(Ze)),ne.get(Ze).push(pt);}let Me=typeof F=="number"?Math.max(0,F):1/0,ge=[];for(let pt of G){if(Me<=0)break;let sn=ne.get(pt).slice(0,Me);sn.length>0&&(ge.push({label:pt==="__ungrouped__"?void 0:pt,items:sn}),Me-=sn.length);}return ge},[aa,F]),Mn=useMemo(()=>Kt.reduce((G,ne)=>(G.push(...ne.items),G),[]),[Kt]),Ho=Mn.length>0,Wr=!Ho&&!!A&&!ke&&he.trim().length>0,Fn=ke||Ho||Wr,Lo=Fn||Je;useEffect(()=>{!Je&&ee&&!Fn&&(re.current=true,De(false),setTimeout(()=>{re.current=false;},150));},[Je,ee,Fn,De]);let Kr=useRef(null),_r=useRef(false);useEffect(()=>{if(K&&!z){if(_r.current){_r.current=false;return}let G=he.trim();if(Kr.current===G)return;Kr.current=G,t?.({value:G,title:G});}},[he,K,z,t]);let jr=useCallback(G=>{let ne=ce.current,ve=new Map(ne.map(ge=>[ge.value,ge])),Me=G.map(ge=>ve.get(ge)??{value:ge,title:ge});U?.(Me);},[U]),Bo=useCallback(G=>{let ne=G.map(String);_||de(ne),jr(ne);},[_,jr]),ia=useCallback(G=>{let ve=fe.includes(G)?fe.filter(Me=>Me!==G):[...fe,G];Bo(ve);},[fe,Bo]),$o=useCallback(G=>{let ne=ce.current.find(ve=>ve.value===G)??{value:G,title:G};ne.disabled||(_r.current=true,Kr.current=(ne.title??ne.value).trim(),st(ne),je(ne.title??ne.value),t?.(ne),Z||(v?(J.current=false,re.current=true,Q(false),at.current?.(false),setTimeout(()=>{re.current=false;},150)):J.current=true),!v&&Se.current?.setActiveIndex&&Se.current.setActiveIndex(null),B?(J.current=false,setTimeout(()=>{Ne.current&&se.current?(Ne.current.tabIndex=0,Ne.current.focus(),Ne.current.blur(),Ne.current.tabIndex=-1):se.current?.blur();},0)):requestAnimationFrame(()=>se.current?.focus()));},[t,Z,v,B]),oc=useCallback(G=>{if(x)return;je(G);let ne=!G.trim();z||(ne?(st(null),t?.(null)):K&&st(null)),!Z&&!ne&&P&&!ee&&De(true);},[z,Z,P,ee,De,x,K,t]),it=Sd,la=kd,rc=Id,ca=useMemo(()=>h?[Si,h]:Si,[h]),sc=useCallback(G=>{let ne=he.trim();if(!ne||ne.length<1)return G;let ve=ne.toLowerCase(),ge=G.toLowerCase().indexOf(ve);return ge<0?G:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Cd,children:[G.slice(0,ge),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:ca,children:G.slice(ge,ge+ne.length)}),G.slice(ge+ne.length)]})},[he,ca]),zo=b?sc:rc,ac=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),Oo=Md,Wo=Fd,ic=useCallback(G=>{Se.current=G;},[]),ua=useCallback(G=>{let ne=Se.current;if(!ne)return;let ve=Mn.length;if(ve===0)return;let Me=pe.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),ge=-1;if(Me){let Ze=Me.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),sn=Me.querySelector("[data-active]")||Me.querySelector("[data-hovered]");sn&&(ge=Array.from(Ze).indexOf(sn));}ge<0&&typeof ne.activeIndex=="number"&&(ge=ne.activeIndex);let pt=ge<0?G===1?0:ve-1:(ge+G+ve)%ve;ne.setActiveIndex?.(pt),requestAnimationFrame(()=>{let Ze=pe.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!Ze)return;Ze.setAttribute("data-keyboard-nav",""),Ze.querySelectorAll("[data-active]").forEach(Ur=>Ur.removeAttribute("data-active")),Ze.querySelectorAll("[data-hovered]").forEach(Ur=>Ur.removeAttribute("data-hovered"));let Vr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];Vr&&(Vr.setAttribute("data-active",""),Vr.scrollIntoView?.({block:"nearest"}));});},[Mn.length]),lc=useCallback(G=>{if(G.key===" "||G.code==="Space"||G.key==="Spacebar"){G.stopPropagation();return}if(G.key==="ArrowDown"||G.key==="ArrowUp"){if(x||!Fn&&!Je)return;G.preventDefault(),!ee&&!Z&&De(true),ua(G.key==="ArrowDown"?1:-1);return}if(G.key==="Enter"){if(x)return;let ne=Se.current&&typeof Se.current.activeIndex=="number"?Se.current.activeIndex:-1,ve=ne>=0&&ne<Mn.length?Mn[ne]:null;if(ee&&ve&&ne>=0){G.preventDefault(),G.stopPropagation(),z?(ia(ve.value),v||requestAnimationFrame(()=>se.current?.focus())):$o(ve.value);return}}else G.key==="Escape"?(G.preventDefault(),G.stopPropagation(),ee&&!Z&&(re.current=true,De(false),G.target.focus(),setTimeout(()=>{re.current=false;},150))):G.key==="Tab"&&ee&&!Z&&De(false);},[Fn,Je,ee,Z,Mn,z,v,ua,ia,$o,De,x]),cc=useCallback(()=>{x||re.current||C&&Lo&&(qe.current=Date.now(),Z||De(true));},[Z,C,Lo,De,x]),uc=useCallback(()=>{if(J.current){J.current=false;return}N&&De(false),!K&&!z&&(Oe?je(Oe.title??Oe.value):he.trim()&&je(""));},[N,K,z,Oe,he,De]),da=useCallback(()=>{let G=[],ne=0;return Kt.forEach((ve,Me)=>{ve.label&&G.push(jsx(mn,{className:it("group-label"),children:ve.label},`g-${Me}`)),ve.items.forEach(ge=>{G.push(jsx(ys,{item:ge,absIndex:ne,multiple:true,getCurrentMulti:yt,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:la,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:we},`${ge.group??"__"}|${ge.value}`)),ne+=1;});}),jsx(gs,{values:fe,onValuesChange:Bo,children:G},"multi-group")},[Kt,it,yt,s,zo,fe,Bo,la,Wo,Oo,we]),pa=useCallback(()=>{let G=[],ne=0;return Kt.forEach((ve,Me)=>{ve.label&&G.push(jsx(mn,{className:it("group-label"),children:ve.label},`g-${Me}`)),ve.items.forEach(ge=>{let pt=Oe?.value===ge.value;G.push(jsx(ys,{item:ge,absIndex:ne,multiple:false,getCurrentMulti:yt,isSelected:pt,renderItem:s,paint:zo,cls:it,closeOnSelect:v,pickSingle:$o,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:we},`${ge.group??"__"}|${ge.value}`)),ne+=1;});}),G},[Kt,it,Oe,yt,s,zo,v,$o,Wo,Oo,we]),dc=useMemo(()=>ke?jsx(mn,{css:L,className:it("label-loading"),children:W},"loading"):Wr?jsx(mn,{css:D,className:it("label-empty"),children:M},"empty"):Kt.length===0?null:z?da():pa(),[ke,Wr,Kt.length,it,W,M,z,da,pa]),rn=ee?false:x||!Je&&!Ho&&!A,ma=useCallback(G=>{G.preventDefault(),G.stopPropagation(),!(rn||x)&&(Z||(ee?(re.current=true,De(false),queueMicrotask(()=>se.current?.focus()),setTimeout(()=>{re.current=false;},150)):(De(true),queueMicrotask(()=>se.current?.focus()))));},[ee,Ho,Je,De,rn,x,Z]),fa=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:ee?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:rn?"not-allowed":"pointer",userSelect:"none",opacity:rn?.5:1}),[ee,rn]),Ko=useMemo(()=>ae?jsx("span",{ref:oe,role:"button",tabIndex:-1,css:[fa,q],"aria-disabled":rn||void 0,onMouseDown:Ad,onClick:ma,children:X??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[ae,fa,q,rn,ma,X]),pc=useMemo(()=>T&&Ko?jsxs("span",{css:Td,children:[T,Ko]}):T??Ko,[T,Ko]),mc=useCallback(G=>{if(!(oe.current&&oe.current.contains(G.target)||re.current||x||Date.now()-qe.current<300)){if(ee){!he.trim()&&!Z&&(re.current=true,De(false),setTimeout(()=>{re.current=false;},150));return}w&&Lo&&(!Z||w)&&De(true);}},[ee,he,w,Lo,De,x,Z]);return jsx("div",{ref:pe,className:it(""),css:[ac,l,c],children:jsxs($n,{open:x?false:ee,onOpenChange:x?void 0:De,children:[jsx(Fi,{onCapture:ic}),jsx(zn,{asChild:true,children:jsx("span",{className:it("anchor"),css:Rd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Qo,{ref:se,className:it("input"),focusRingMode:a,value:he,onChange:oc,onKeyDown:lc,onFocus:cc,onBlur:uc,onSurfaceClick:mc,placeholder:r,label:u,helperText:d,variant:y,startIcon:f,endIcon:pc,size:I,width:n,fullWidth:o,disabled:x,error:R,showClear:g,css:i,wrapperCss:Y,inputCss:le,labelCss:ie,helperRowCss:be,helperTextCss:Pe,startIconCss:Re,endIconCss:Ce}),jsx("span",{ref:Ne,tabIndex:-1,"aria-hidden":"true",style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}}),Fn&&jsx(hn,{className:it("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ie,ignoreOutsidePressRefs:j,disableOutsidePressDismiss:Z,returnFocus:!B,children:dc})]})})});Ai.displayName="Autocomplete";var Ld=["sm","md","lg"],Bd=(e,t)=>typeof e=="number"?e:Ld.includes(e)?t.componentHeights[e]:t.componentHeights.md,$d=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},zd=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Od=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Pi=me.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},l)=>{let u=V(),[d,y]=useState(!!e);useEffect(()=>{y(!!e);},[e]);let f=Bd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,I=T?Math.round(T*(T<=28?.55:.52)):void 0,x=r?u.radius.full:u.radius.md,R=$d(u,o),g=zd(u,o),p=Od(c,t),m=css({width:f,height:f,borderRadius:x,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:d?"transparent":R,color:d?"inherit":g,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),P=css({fontSize:I,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:l,className:["plainframe-ui-avatar",s||""].join(" ").trim(),css:[m,a],role:d?void 0:"img","aria-label":d?void 0:t,...i,children:d&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>y(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:P,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:P,children:p})})}));Pi.displayName="Avatar";var Ni=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,jd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:l})=>{let u=V(),d=xe(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let w=(u.componentHeights&&u.componentHeights[n])??(u.spacing&&u.spacing[n]);return Ni(w??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),I=typeof t=="number"&&t>=0,x=I&&T.length>t?T.slice(0,t):T,R=I&&T.length>t?T.length-t:0,g=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,p=Ni(i)??"4px",m=css({display:"flex",alignItems:"center"}),C=w=>css({marginLeft:w===0?0:o,zIndex:x.length-w,boxShadow:`0 0 0 ${p} ${g}`,backgroundColor:g,borderRadius:s?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),P=css({width:"100%",height:"100%",display:"inline-flex",alignItems:"center",justifyContent:"center",objectFit:"cover",boxSizing:"border-box"});return jsxs("div",{role:"group",tabIndex:-1,"aria-label":"Avatar group",className:`plainframe-ui-avatar-group${l?` ${l}`:""}`,css:[m,r,d()],children:[x.map((w,v)=>{if(!isValidElement(w))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(v),children:jsx("span",{css:P,children:w})},v);let N=w,B=N.props?.css,K=B==null?P:[P,B],O=cloneElement(N,{size:n,rounded:s,css:K,style:{...N.props?.style,width:"100%",height:"100%",objectFit:N.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(v),children:O},v)}),R>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${R} more`,children:["+",R]})]})};var Li=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ud=(e,t)=>{let n=e,o=n.palette||{},r=n.neutral||{};return t==="neutral"||t==="secondary"?{scale:r,onKey:"neutral"}:typeof t=="string"&&o[t]?{scale:o[t],onKey:t}:{scale:n.primary||r,onKey:"primary"}},qd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",Gd=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",Xd=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",Yd=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),Jd=me.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:d,animate:y=true,size:f,outline:T=false,outlineColor:I,className:x,badgeClassName:R,css:g,badgeCss:p,offsetX:m,offsetY:C})=>{let P=V(),w=s==="dot",v=f??(w?8:17),N=r??(w?0:10),{scale:B,onKey:K}=Ud(P,t),O=qd(B),S=P.text?.onColors||{},F=Gd(P,S,K,n),M=Xd(e,a,s),b=Yd(i,s,e,c),h=css({position:"relative",display:"inline-block"}),A=u==="circular"?w?"12.5%":"5%":w?"5%":"2.5%",D=Li(m??A),L=Li(C??A),k=l.vertical||"top",E=l.horizontal||"right",W={},$="0",z="0";k==="center"?(W.top="50%",z="-50%"):k==="top"?(W.top=L,z="-45%"):(W.bottom=L,z="45%"),E==="center"?(W.left="50%",$="-50%"):E==="right"?(W.right=D,$="45%"):(W.left=D,$="-45%");let _=b?1:.8,H=css({minWidth:w?v:v/2,height:v,background:O,color:F,fontSize:typeof N=="number"?`${N}px`:N,fontWeight:o,borderRadius:999,padding:w?0:`0 ${v/4}px`,boxShadow:"0 2px 8px rgba(0,0,0,0.04)",lineHeight:1,position:"absolute",pointerEvents:"none",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",...T?{boxShadow:`0 0 0 2px ${I??P.surface?.appBg}`}:{},opacity:b?1:0,transform:`translate(${$}, ${z}) scale(${b?_:.5})`,...y?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...W});return jsxs("div",{className:["plainframe-ui-badge-wrapper",x||""].join(" ").trim(),css:[h,g],children:[d,jsx("span",{"aria-hidden":!b,className:["plainframe-ui-badge",R||""].join(" ").trim(),css:[H,p],children:M})]})});var Es=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:d=true,className:y,contentClassName:f,lockScroll:T=true,...I})=>{let x=V(),R=useMemo(()=>r??x.surface.overlayBg,[r,x.surface.overlayBg]),[g,p]=useState(e),[m,C]=useState(e),P=useRef(null),w=useRef(null),v=useRef(null);useEffect(()=>(P.current&&(clearTimeout(P.current),P.current=null),w.current!=null&&(cancelAnimationFrame(w.current),w.current=null),e?(p(true),w.current=requestAnimationFrame(()=>{C(true),w.current=null;})):(C(false),P.current=setTimeout(()=>{p(false),P.current=null;},u)),()=>{P.current&&(clearTimeout(P.current),P.current=null),w.current!=null&&(cancelAnimationFrame(w.current),w.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let F=document.body,M=F.style.overflow,b=F.style.paddingRight,h=window.innerWidth-document.documentElement.clientWidth,A=parseFloat(getComputedStyle(F).paddingRight||"0");return F.style.overflow="hidden",h>0&&(F.style.paddingRight=`${A+h}px`),()=>{F.style.overflow=M,F.style.paddingRight=b;}},[e,T]),useEffect(()=>{if(!m||!t)return;let F=M=>{M.key==="Escape"&&t();};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[m,t]);let N=F=>{if(!m||!t||!v.current)return;let M=F.target;M&&!v.current.contains(M)&&t();},B=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!d&&!g)return null;let K=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:m?"auto":"none",visibility:g?"visible":"hidden"}),O=css({position:"absolute",inset:0,background:R,backdropFilter:B?`blur(${B})`:void 0,WebkitBackdropFilter:B?`blur(${B})`:void 0,opacity:m?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:m?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:m?"auto":"none"});return jsxs("div",{"aria-hidden":!g||void 0,className:["plainframe-ui-backdrop",y||""].join(" ").trim(),css:[K,a],onPointerDown:N,...I,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[O,i],role:"presentation"}),jsx("div",{ref:v,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[S,c],children:l})]})};var yr=()=>null;Object.defineProperty(yr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function np(e){let t=e.props??{};return {type:typeof t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__<"u"?t.__EMOTION_TYPE_PLEASE_DO_NOT_USE__:e.type,props:t}}var op=me.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:l,...u})=>{let d=V(),y=xe(),f=me.useMemo(()=>me.Children.toArray(e).flatMap(p=>{if(!me.isValidElement(p))return [];let{type:m,props:C}=np(p);if(!(m===yr||typeof m=="function"&&"displayName"in m&&m.displayName===yr.displayName))return [];let w=C;return [{href:w.href,disabled:w.disabled,node:w.children,className:w.className,css:w.css,onClick:w.onClick,startIcon:w.startIcon,endIcon:w.endIcon}]}),[e]),T=me.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:d.typography.sizes.sm,fontWeight:500,gap:d.spacing.xs,cursor:"default"}),[d]),I=me.useMemo(()=>css({margin:"0 0.15rem",color:d.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[d]),x=me.useCallback((p,m,C)=>{let P=p?d.text.primary:d.text.secondary,w=i&&m&&!C;return css({display:"inline-flex",alignItems:"center",gap:d.spacing.xs,color:P,cursor:m&&!C?"pointer":"default",textDecoration:"none",borderRadius:d.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":w?{textDecoration:"underline",color:d.text.primary}:{textDecoration:"none"}})},[d,i]),R=me.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),g=me.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((p,m)=>{let C=m===f.length-1,P=!!p.href&&!p.disabled&&!C,w=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",P?"plainframe-ui-breadcrumb--link":"",p.className||""].join(" ").trim(),v=[x(C,P,p.disabled),o,C?r:s,P?a:void 0,y(),p.css],N=jsxs(Fragment,{children:[p.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:R,children:p.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:g,children:p.node}),p.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:R,children:p.endIcon})]});return jsxs(me.Fragment,{children:[m!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[I,c],children:t}),P?jsx("a",{href:p.href,onClick:p.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:w,css:v,children:N}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:w,css:v,children:N})]},m)})})});var ks=(e,t)=>{if(!isValidElement(e))return e;let n=e.props,o={};return n.size===void 0&&(o.size=t),n.color===void 0&&(o.color="currentColor"),cloneElement(e,{...n,...o})},Is=e=>typeof e=="number"?`${e}px`:e,Oi=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Oi(n)&&(t=true));}),t};function ip(e,t){let n=e,o=typeof t=="string"&&(t==="sm"||t==="md"||t==="lg")?t:"md";return o==="sm"?{fontSize:n.typography.sizes.sm,paddingY:n.spacing.xs,paddingX:n.spacing.md,paddingXIcon:n.spacing.md,iconSize:14,minHeight:n.componentHeights.sm,radius:n.radius.sm}:o==="lg"?{fontSize:n.typography.sizes.md,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:18,minHeight:n.componentHeights.lg,radius:n.radius.md}:{fontSize:n.typography.sizes.sm,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:16,minHeight:n.componentHeights.md,radius:n.radius.md}}function lp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(d,y,f)=>d&&d[y]||f;if(t==="primary"){let d=s,y=u(d,600,n[900])||u(d,500,n[900]),f=u(d,500,n[800])||u(d,600,n[800]);return {bg:y,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let d=a,y=u(d,600,n[900])||u(d,500,n[900]),f=u(d,500,n[800])||u(d,600,n[800]);return {bg:y,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:a[700],hoverBg:e.palette.danger[50],border:"none"}:t==="subtle"?{bg:e.surface.subtleBg,fg:o.primary,hoverBg:e.surface.subtleHover,border:"none"}:t==="outlined"?{bg:e.surface.panelBg,fg:o.primary,hoverBg:e.surface.panelHover,border:`${e.componentHeights.border} solid ${e.surface.border}`}:t==="ghost"?{bg:"transparent",fg:e.text.primary,hoverBg:e.surface.subtleBg,border:"none"}:t==="quiet"?{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}:{bg:"transparent",fg:o.secondary,hoverBg:e.surface.subtleBg,border:"none"}}var Wi=me.memo(me.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:d,hoverEffect:y=true,icon:f,onClick:T,css:I,...x},R)=>{let g=V(),p=xe(),m=useMemo(()=>ip(g,t),[g,t]),C=useMemo(()=>lp(g,e),[g,e]),P=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Oi(u)&&me.Children.count(u)===1,[f,n,o,u]),w=m.iconSize,v=useMemo(()=>ks(n,w),[n,w]),N=useMemo(()=>ks(o,w),[o,w]),B=useMemo(()=>i??jsx(no,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),K=useMemo(()=>P?"center":l??"center",[P,l]),O=!!c&&K==="center",S=!!c&&K==="start",F=!!c&&K==="end",M=a||c,b=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:m.minHeight,lineHeight:1,fontWeight:600,cursor:M?"not-allowed":"pointer",opacity:M?.5:1,userSelect:"none",position:"relative",borderRadius:r?g.radius.full:m.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,m,r,g,M]),h=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),A=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":y&&!M?{":hover::before":{opacity:1}}:{}}),[C,y,M]),D=useMemo(()=>css(P&&!s?{width:"100%",height:"100%",maxWidth:m.minHeight,minWidth:m.minHeight,maxHeight:m.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Is(m.iconSize)}:{fontSize:Is(m.fontSize),padding:n||o?`${m.paddingY} ${m.paddingXIcon}`:`${m.paddingY} ${m.paddingX}`}),[P,s,m,n,o]),L=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Is(g.spacing.sm),opacity:O?0:1,transition:"opacity 140ms ease"}),[g,O]),k=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),E=useMemo(()=>typeof m.iconSize=="number"?m.iconSize:Math.max(12,Math.round(parseFloat(String(m.iconSize))||16)),[m.iconSize]),W=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:E,minWidth:E,maxWidth:E,height:"1em"}),[E]),$=useMemo(()=>X=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:X?1:0,transition:"opacity 140ms ease"}),[]),z=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:O?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[O]),_=useMemo(()=>()=>{if(P)return null;let X=!!n;return !X&&!S?null:jsxs("span",{css:W,"aria-hidden":c?true:void 0,children:[jsx("span",{css:$(!S),children:X?v||n:null}),jsx("span",{css:$(!!S),children:B})]})},[P,n,S,W,$,v,c,B]),H=useMemo(()=>()=>{if(P)return null;let X=!!o;return !X&&!F?null:jsxs("span",{css:W,"aria-hidden":c?true:void 0,children:[jsx("span",{css:$(!F),children:X?N||o:null}),jsx("span",{css:$(!!F),children:B})]})},[P,o,F,W,$,N,c,B]),U=!(a||c);return jsxs("button",{ref:R,type:"type"in x&&x.type?x.type:"button","data-variant":e,className:["plainframe-ui-button",d||""].join(" ").trim(),css:[b,p({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),h,A,D,I],onClick:U?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...x,children:[jsxs("span",{className:"plainframe-ui-button-content",css:L,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:k,children:P?c?B:ks(u,m.iconSize):u}),H()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:z,"aria-hidden":"true",children:O?B:null})]})}));Wi.displayName="Button";var Rr=e=>isValidElement(e),cp=e=>{let t=e.type;return t.displayName??t.name},As=(e,t)=>cp(e)===t,ji=e=>As(e,"ButtonGroup"),Vi=e=>As(e,"DropdownMenu"),Ms=e=>As(e,"DropdownMenuTrigger"),Kn=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,up=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,dp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Fs=(e,t)=>{if(!Rr(e))return null;if(ji(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Fs(t?n[0]:n[n.length-1],t):null}if(Vi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Ms);return o?Fs(o,t):null}if(Ms(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},_i=(e,t)=>{if(!e)return false;let n=Fs(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return dp(o)},Ui=me.memo(me.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:d="group",css:y,__clipLeft:f,__clipRight:T,...I},x){let R=V(),g=a==="sm"?R.radius.sm:R.radius.md,p=c?R.radius.full:g,m=o==="vertical",C=up(R.componentHeights.border,1),P=R.surface.border,w=n&&!!f,v=n&&!!T,N=css({display:"flex",flexDirection:m?"column":"row",width:r?"100%":l!=null?Kn(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Kn(i??R.spacing.sm)}),B=Children.toArray(t),O=B.filter(Rr).length,S=0,F=false,M=[];for(let b of B){if(!Rr(b)){M.push(b);continue}let h=S===0,A=S===O-1,D=b.props??{},L=D.disabled??s,k=D.size??a,E=0,W=0,$=0,z=0;n&&(m?(E=h?w?0:p:0,W=h?v?0:p:0,z=A?w?0:p:0,$=A?v?0:p:0):(E=h?w?0:p:0,z=h?w?0:p:0,W=A?v?0:p:0,$=A?v?0:p:0));let _=_i(b,"left"),H=_i(b,"right"),ae=n&&!h&&!(F&&_)&&!(F||_)?css({[m?"borderTop":"borderLeft"]:`${C} solid ${P}`}):null,q=n&&!h&&F&&_?css(m?{borderTopWidth:0}:{borderLeftWidth:0}):null,Y=n?css({borderTopLeftRadius:Kn(E),borderTopRightRadius:Kn(W),borderBottomRightRadius:Kn($),borderBottomLeftRadius:Kn(z)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ie=css([Y,ae,q,le]);if(!Vi(b)){let Ce=D.css,Ie=[D.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Te=ji(b)&&n?{__clipLeft:!h,__clipRight:!A}:{},we=cloneElement(b,{...D,disabled:L,size:k,className:Ie,css:[Ce,ie],...Te});M.push(we),F=H,S+=1;continue}let be=D.children,Pe=Children.map(be,Ce=>{if(!Rr(Ce)||!Ms(Ce))return Ce;let Ie=Ce.props,Te=[Ie.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(Ce,{...Ie,css:[Ie.css,ie],className:Te,disabled:L,size:k})}),Re=cloneElement(b,{...D,children:Pe});M.push(Re),F=H,S+=1;}return jsx("div",{ref:x,role:d,"aria-orientation":m?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[N,y],...I,children:M})}));Ui.displayName="ButtonGroup";var Tr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,hp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Tr(n?.[e]??e)}}},yp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Tr(n?.[e]??e)}}},xp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},vp=(e,t,n)=>{let o=t.surface??{};return e==="panel"||e==="outlined"?o.panelHover??o.panelBg??n:e==="subtle"?o.subtleHover??o.subtleBg??n:o.subtleBg??n},_n=me.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:d,width:y,height:f,onClick:T,onKeyDown:I,role:x,tabIndex:R,...g},p){let m=V(),C=m.surface??{},[P,w]=useState(!!u),v=l!=null,N=v?!!l:P,B=useMemo(()=>xp(o,m),[o,m]),K=useMemo(()=>vp(o,m,B),[o,m,B]),O=K,S=useMemo(()=>hp(r,m),[r,m]),F=useMemo(()=>yp(s,m),[s,m]),M=!!c||!!i,b=useMemo(()=>css({backgroundColor:B,padding:S,borderRadius:F,border:o==="outlined"?`${m.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:y?"100%":void 0,maxWidth:Tr(y),height:Tr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:M?"pointer":void 0,...M?{"&:hover":{backgroundColor:K}}:{},'&[data-selected="true"]':{backgroundColor:O},...M?{'&[data-selected="true"]:hover':{backgroundColor:O}}:{}}),[B,S,F,o,m.componentHeights,C.border,y,f,M,K,O]),h=useCallback(()=>{if(!i)return;let k=!N;v||w(k),d?.(k);},[v,d,i,N]),A=useCallback(k=>{i&&h(),T?.(k);},[i,h,T]),D=useCallback(k=>{i&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),h()),I?.(k);},[i,h,I]),L=xe();return jsx("div",{ref:p,"data-variant":o,"data-selected":i&&N?"true":void 0,"aria-pressed":i?N:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[L(),b,n],onClick:A,onKeyDown:D,role:i?x??"button":x,tabIndex:i?R??0:R,...g,children:t})}));_n.displayName="Container";var Rp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Ns(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return Rp(o)}return e}}}function yo(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function Ds(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Tp(e,t){if(e==null)return t.spacing?.md??void 0;if(typeof e=="number")return e;if(typeof e=="string"){let n=t.spacing??t.space??{};return e in n?n[e]:e}}function xo(e,t,n,o){let r=Ns(t,e),s=Ns(n,e),a=Ns(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function qi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Gi=me.createContext("horizontal"),Hs=()=>me.useContext(Gi),Xi=me.memo(me.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:d,gap:y,direction:f="horizontal",className:T,onClick:I,...x},R)=>{let g=V(),p=xe(),m=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:m?"column":"row",gap:Tp(y,g),alignItems:m?"stretch":"center",transition:"all .16s ease"});return jsx(Gi.Provider,{value:f,children:jsx(_n,{ref:R,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:d,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[p(),C,t],onClick:I,tabIndex:I?0:void 0,...x,children:e})})}));Xi.displayName="Card";var wp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Hs()==="vertical",d=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:yo(o),textAlign:Ds(o),...u?{width:"100%"}:{flex:1,minWidth:0},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[d,t],...c,children:e})}),Ep=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Hs()==="vertical",d=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[d,t],...c,children:e})}),kp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=V(),u=Hs()==="vertical",d=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[d,t],...c,children:e})}),Ip=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let d=V(),y=css({fontWeight:c??500,fontSize:i??(d.typography?.sizes?.sm!==void 0?d.typography.sizes.sm:"1rem"),color:qi(d,l)??d.text?.primary,textAlign:Ds(o),...xo(d,r,s,a),display:"flex",alignItems:"center",gap:d.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[y,t],...u,children:e})}),Sp=me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let d=V(),y=css({fontWeight:c??400,fontSize:i??(d.typography?.sizes?.sm!==void 0?d.typography.sizes.sm:"0.875rem"),color:qi(d,l)??d.text?.secondary,marginTop:d.spacing?.xxs??2,textAlign:Ds(o),...xo(d,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[y,t],...u,children:e})});var Ji=e=>isValidElement(e),Pp=e=>Ji(e)?e.type?.displayName||e.type?.name:void 0,Yi=e=>Pp(e)==="Card",Np=e=>typeof e=="number"?`${e}px`:e,Zi=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=V(),u=r==="vertical",d=String(l.componentHeights?.border??"1px"),y=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?Np(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),x=T.filter(Yi).length,R=0,g=T.map((p,m)=>{if(!Yi(p)||!Ji(p))return p;let C=p.props,P=R++,w=P===0,v=P===x-1,N=s??C.variant,B=t?u?{borderTopLeftRadius:w?C.radius:0,borderTopRightRadius:w?C.radius:0,borderBottomLeftRadius:v?C.radius:0,borderBottomRightRadius:v?C.radius:0}:{borderTopLeftRadius:w?C.radius:0,borderBottomLeftRadius:w?C.radius:0,borderTopRightRadius:v?C.radius:0,borderBottomRightRadius:v?C.radius:0}:void 0,K=t&&!w?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,O=N==="subtle"&&x>1&&!w?u?{borderTop:`${d} solid ${y}`}:{borderLeft:`${d} solid ${y}`}:null,F=[B,K,O,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),M=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(p,{...C,variant:N??C.variant,css:[C.css,...F],className:M,key:typeof p=="object"&&"key"in p?p.key:m})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:g})};Zi.displayName="CardGroup";var Le=e=>typeof e=="number"?`${e}px`:e,el=e=>{let t=false;return me.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&el(n)&&(t=true));}),t},Bp=(e,t)=>t==="sm"?{fontSize:e.typography.sizes.xs,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.xs,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.typography.sizes.md,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.typography.sizes.md,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.typography.sizes.sm,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.typography.sizes.sm,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},tl=me.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:d,disabled:y,cursor:f,className:T,css:I},x){let R=V(),g=xe(),p=["sm","md","lg"].includes(i)?i:"md",m=useMemo(()=>Bp(R,p),[R,p]),C=!!l&&!y,P=y?"not-allowed":f||(C?"pointer":"inherit"),w=String(R.componentHeights?.border??"1px"),v=useMemo(()=>{let X=R.palette;return r==="secondary"||r==="neutral"?"neutral":r&&X[r]?r:"primary"},[r,R.palette]),N=useCallback(X=>{let ae=R.palette;return (v==="neutral"?R.neutral[X]:ae[v]?.[X])??ae.primary?.[X]},[v,R.neutral,R.palette]),B=useMemo(()=>v==="neutral"?R.neutral[100]:N(50),[v,N,R.neutral]),K=useMemo(()=>v==="neutral"?R.text.secondary:N(800),[v,N,R.text.secondary]),O=useMemo(()=>v==="neutral"?R.neutral[100]:N(50),[v,N,R.neutral]),S=useMemo(()=>v==="neutral"?R.text.secondary:N(800),[v,N,R.text.secondary]),F=useMemo(()=>v==="neutral"?R.neutral[400]:N(300),[v,N,R.neutral]),M=useMemo(()=>v==="neutral"?R.surface.subtleBg:N(600),[v,N,R.surface.subtleBg]),b=useMemo(()=>(R.text.onColors??{})[v]??(v==="neutral"?R.neutral[900]:R.neutral[0]??"#fff"),[v,R.text.onColors,R.neutral]),h="transparent",A=useMemo(()=>v==="neutral"?R.text.secondary:N(700)??R.text.primary,[v,N,R.text.primary,R.text.secondary]),D=useMemo(()=>!a&&!c&&t!=null&&!el(t)&&me.Children.count(t)===1,[a,c,t]),L=useMemo(()=>o==="filled"?css({backgroundColor:M,color:b,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:O,color:S,border:"none",boxShadow:`inset 0 0 0 ${w} ${F}`}):o==="ghost"?css({backgroundColor:h,color:A,border:"none",boxShadow:"none"}):css({backgroundColor:B,color:K,border:"none",boxShadow:"none"}),[M,b,A,O,S,F,B,K,w,o]),k=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Le(m.gap),padding:o==="ghost"?0:D||t==null?Le(m.soloPadding):`${Le(m.paddingY)} ${Le(m.paddingX)}`,borderRadius:s?R.radius.full:m.radius,fontWeight:600,cursor:P,opacity:y?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...D?{lineHeight:1,minWidth:`calc(${Le(m.iconSize)} + ${Le(m.soloPadding)} * 2)`,minHeight:`calc(${Le(m.iconSize)} + ${Le(m.soloPadding)} * 2)`,justifyContent:"center"}:null}),[m,P,t,y,D,s,R.radius.full,o]),E=useMemo(()=>css({fontSize:Le(D?m.iconSize:m.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:D?Le(m.iconSize):void 0,height:D?Le(m.iconSize):void 0,display:D?"block":void 0}}),[m.fontSize,m.iconSize,D]),W=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Le(m.iconSize),lineHeight:0,"& > svg":{width:Le(m.iconSize),height:Le(m.iconSize),display:"block"}}),[m.iconSize]),$=useMemo(()=>css({marginRight:D||t==null?0:Le(m.gap),marginLeft:D||t==null?0:Le(m.iconOffset)}),[m.gap,m.iconOffset,t,D]),z=useMemo(()=>css({marginLeft:D||t==null?0:Le(m.gap),marginRight:D||t==null?0:Le(s?m.iconOffsetRounded:m.iconOffset)}),[m.gap,m.iconOffset,m.iconOffsetRounded,t,D,s]),_=useMemo(()=>css({marginRight:s?0:Le(m.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:y?"not-allowed":"pointer",color:"currentColor",opacity:y?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:Le(m.iconSize),borderRadius:R.radius.xs}),[m.iconOffset,m.iconSize,y,s,R.radius.xs]),H=useCallback(X=>{C&&(X.key==="Enter"||X.key===" ")&&(X.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:m.iconSize,height:m.iconSize},strokeWidth:2.5}),[m.iconSize]);return jsxs("div",{ref:x,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[k,L,C?g({color:r??"primary"}):null,I],onClick:C?l:void 0,onKeyDown:H,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":y||void 0,"data-variant":o,"data-color":v,"data-size":i,"data-icon-only":D||void 0,children:[a&&jsx("span",{css:[W,$],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[E,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[W,z],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:y,tabIndex:0,onClick:X=>{X.stopPropagation(),y||u?.();},css:[_,g({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:d||U})]})}));tl.displayName="Chip";var Wp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Kp=me.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:d,placeholder:y,separator:f,gapPx:T}){let I=xe(),x=r.neutral,R=r.text,g=r.componentHeights.border,p=useRef([]),[m,C]=useState(0),P=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),w=useMemo(()=>{if(!y)return Array(o).fill("");if(y.length===1)return Array(o).fill(y);let D=y.slice(0,o).split("");for(;D.length<o;)D.push("");return D},[y,o]),v=useMemo(()=>{let D=r.componentHeights[s];return `calc(${typeof D=="number"?`${D}px`:D} * 1.5)`},[r.componentHeights,s]),N=l?x[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",B=c==="outlined"?`${g} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",K=D=>css({width:v,height:v,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:N,border:B,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?x[500]:i?r.palette.danger?.[800]??R.primary:R.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??R.primary:R.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??R.secondary:R.secondary,opacity:.85}},u?I({enabled:true,disabled:l,mode:d==="always"?"always":"visible",color:i?"danger":void 0}):void 0,D?css({}):null),O=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.secondary,userSelect:"none"}),F=D=>D.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),M=useCallback(D=>{let L=Math.max(0,Math.min(o-1,D));C(L),p.current[L]?.focus();},[o]),b=useCallback((D,L)=>{let k=F(L).slice(0,1),E=[...P];E[D]=k,n(E.join("")),k&&D<o-1&&M(D+1);},[P,o,n,M]),h=useCallback((D,L)=>{if(L.key==="Backspace")if(!P[D]&&D>0){let k=[...P];k[D-1]="",n(k.join("")),M(D-1),L.preventDefault();return}else {let k=[...P];k[D]="",n(k.join(""));return}if(L.key==="ArrowLeft"&&D>0){L.preventDefault(),M(D-1);return}if(L.key==="ArrowRight"&&D<o-1){L.preventDefault(),M(D+1);return}if(L.key==="Home"){L.preventDefault(),M(0);return}if(L.key==="End"){L.preventDefault(),M(o-1);return}},[P,o,n,M]),A=useCallback(D=>{let L=F(D.clipboardData.getData("text")).slice(0,o);L&&(n(L),requestAnimationFrame(()=>{let k=Math.min(L.length,o-1);M(k);}),D.preventDefault());},[o,n,M]);return jsx("div",{className:"plainframe-ui-code-boxes",css:O,children:Array.from({length:o}).map((D,L)=>jsxs(me.Fragment,{children:[jsx("input",{ref:k=>{p.current[L]=k;},type:"text",inputMode:"text",maxLength:1,value:P[L]||"",placeholder:P[L]?"":w[L]||"",disabled:l,onChange:k=>b(L,k.target.value),onKeyDown:k=>h(L,k),onFocus:()=>C(L),onPaste:L===0?A:void 0,className:"plainframe-ui-code-box",css:K(L===m),"aria-label":`Code character ${L+1}`,tabIndex:L===m?0:-1}),f&&L<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:S,children:f}):null]},L))})}),_p=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:d="subtle",length:y=4,focusRingMode:f="always",className:T,wrapperCss:I,labelCss:x,helperRowCss:R,helperTextCss:g,css:p})=>{let m=V(),C=useId(),P=useMemo(()=>({sm:{labelFont:m.typography.sizes.xs,helperFont:m.typography.sizes.xs,minHeight:m.componentHeights.sm,paddingY:0,paddingX:m.spacing.md,codeFontSize:21},md:{labelFont:m.typography.sizes.sm,helperFont:m.typography.sizes.xs,minHeight:m.componentHeights.md,paddingY:0,paddingX:m.spacing.md,codeFontSize:24},lg:{labelFont:m.typography.sizes.md,helperFont:m.typography.sizes.sm,minHeight:m.componentHeights.lg,paddingY:0,paddingX:m.spacing.md,codeFontSize:28}}),[m]),w=["sm","md","lg"].includes(u)?u:"md",v=P[w],N=m.neutral,B=m.text,K=t!=null,[O,S]=useState(n),F=K?t:O,M=$=>{K||S($),o?.($);},b=Math.max(2,Math.min(y,10)),h=m.spacing.sm,A=Wp(l??h)??"0px",D=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:i?"not-allowed":"auto"},...Array.isArray(I)?I:I?[I]:[]),L=css({fontSize:v.labelFont,fontWeight:500,color:a?m.palette.danger?.[700]??B.primary:i?N[500]:B.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(x)?x:x?[x]:[]),k=css({display:"flex",alignItems:"center",justifyContent:"center",gap:A,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(p)?p:p?[p]:[]),E=css({minHeight:16,fontSize:v.helperFont,color:a?m.palette.danger?.[700]??B.secondary:B.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(R)?R:R?[R]:[]),W=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?m.palette.danger?.[700]??B.primary:i?N[500]:B.primary},...Array.isArray(g)?g:g?[g]:[]);return jsxs("div",{className:["plainframe-ui-codefield",T||""].join(" ").trim(),css:D,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:L,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:k,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Kp,{value:F||"",onChange:M,len:b,theme:m,sizeKey:w,s:{codeFontSize:v.codeFontSize},variant:d,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:A})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:E,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:W,children:c})})]})};var al=e=>{if(typeof e=="object"&&e!==null&&"type"in e&&e.type){let t=e.type;return (typeof t=="object"&&t!==null||typeof t=="function")&&(t?.displayName||t?.name)||""}return ""},Bs=e=>{if(!e||typeof e!="object")return false;let t=al(e);if(t==="DropdownMenu"||t==="DropdownMenuContent")return true;let n=e?.props,o=n&&typeof n=="object"&&n!==null&&"children"in n?n.children:void 0;return o==null?false:Array.isArray(o)?o.some(Bs):Bs(o)},Vp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=me.useRef(null),[c,i]=me.useState(false),l=me.useCallback(E=>{i(E),o?.(E);},[o]),u=me.useCallback(()=>l(false),[l]),d=me.useRef({x:0,y:0}),y=me.useRef(null),f=me.useRef(null),T=me.useCallback(()=>{f.current=null;let E=y.current;if(!E)return;let W=Math.round(d.current.x),$=Math.round(d.current.y);E.style.transform=`translate3d(${W}px, ${$}px, 0)`;},[]),I=me.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);me.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let x=me.useMemo(()=>({getBoundingClientRect:()=>{let E=Math.round(d.current.x),W=Math.round(d.current.y);return {x:E,y:W,left:E,top:W,right:E,bottom:W,width:0,height:0,toJSON:()=>({x:E,y:W})}}}),[]),R=me.useRef(`cz-${Math.random().toString(36).slice(2)}`),g=me.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${R.current}"]`):null,[]),p=me.useRef(null),m=me.useRef(null),C=me.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),P=me.useCallback(()=>{m.current!=null&&clearTimeout(m.current),m.current=null;},[]),w=me.useCallback(()=>{P(),m.current=window.setTimeout(()=>l(false),0);},[P,l]),v=me.useCallback(()=>{let E=a.current?.getBoundingClientRect();return E?{x:E.left+E.width/2,y:E.top+E.height/2}:{x:0,y:0}},[]),N=me.useCallback((E,W)=>{d.current={x:E,y:W},I(),l(true);},[I,l]),B=typeof t=="function"?t({close:u}):t,K=Bs(B),O=E=>{if(!me.isValidElement(E))return E;let W=al(E),$=E,z=$.props.children,_=z==null?z:Array.isArray(z)?z.map(H=>me.isValidElement(H)?O(H):H):me.isValidElement(z)?O(z):z;if(W==="DropdownMenu"){let H=$.props.onOpenChange;return me.cloneElement($,{...$.props,open:c,onOpenChange:U=>{H?.(U),l(U);},children:_})}if(W==="DropdownMenuContent"){let H=$.props.onMouseEnter,U=$.props.onMouseLeave;return me.cloneElement($,{...$.props,anchor:x,"data-cz-id":R.current,onMouseEnter:X=>{P(),H?.(X);},onMouseLeave:X=>{w(),U?.(X);},children:_})}return _===z?$:me.cloneElement($,{...$.props,children:_})},S=K?O(B):B,F=me.useCallback(E=>{E.preventDefault(),N(E.clientX,E.clientY);},[N]),M=me.useCallback(E=>{n==="contextmenu"&&F(E);},[n,F]),b=me.useCallback(E=>{n==="dblclick"&&F(E);},[n,F]),h=me.useCallback(E=>{n==="click"&&F(E);},[n,F]),A=me.useCallback(E=>{if(n!=="hover")return;C(),P();let W=r==="center"?v():{x:E.clientX,y:E.clientY};p.current=window.setTimeout(()=>{let $=W.x+(r==="cursor"?s:0),z=W.y+(r==="cursor"?s:0);N($,z);},0);},[n,r,s,v,N,C,P]),D=me.useCallback(E=>{n==="hover"&&c&&r==="cursor"&&!K&&(d.current={x:E.clientX+s,y:E.clientY+s},I());},[n,c,r,K,s,I]),L=me.useCallback(()=>{n==="hover"&&(C(),w());},[n,C,w]);me.useEffect(()=>{if(n!=="hover")return;let E=()=>{if(!c)return;let W=a.current?.matches(":hover"),$=g()?.matches?.(":hover");W||$?P():w();};return window.addEventListener("pointermove",E,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",E,{capture:true})},[c,n,g,P,w]),me.useEffect(()=>{let E=()=>{if(c)if(n==="hover"){let W=a.current?.matches(":hover"),$=g()?.matches?.(":hover");if(W||$?P():w(),r==="center"&&a.current){let z=v();d.current={x:z.x,y:z.y},I();}}else l(false);};return window.addEventListener("scroll",E,true),window.addEventListener("resize",E,true),()=>{window.removeEventListener("scroll",E,true),window.removeEventListener("resize",E,true);}},[c,n,r,v,I,l,P,w,g]),me.useEffect(()=>()=>{C(),P();},[C,P]);let k=({children:E})=>c?jsx("div",{ref:y,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(d.current.x)}px, ${Math.round(d.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&P(),onMouseLeave:()=>n==="hover"&&w(),children:E}):null;return jsxs("div",{ref:a,onContextMenu:M,onDoubleClick:b,onClick:h,onMouseEnter:A,onMouseMove:D,onMouseLeave:L,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,K?S:jsx(k,{children:S})]})};var Vn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,Xp=me.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:d=false,margin:y=10,css:f,labelCss:T,strokeCss:I,className:x,...R},g){let p=V(),{t:m,strokeColor:C,labelTextColor:P,chipSubtleBg:w,chipOutlinedBg:v,outerM:N,padX:B,verticalStrokeMargin:K}=useMemo(()=>{let b=typeof s=="number"?`${s}px`:s,h=p.surface.border,A=p.text.secondary,D=p.surface.subtleBg,L=p.surface.panelBg,k=Vn(y,"10px"),E=o==="horizontal"?n==="middle"?Vn(c):n==="inset"?Vn(i,"0px"):"0":"0",W=o==="vertical"?n==="middle"?Vn(c):n==="inset"?Vn(i,"0px"):"0":"0";return {t:b,strokeColor:h,labelTextColor:A,chipSubtleBg:D,chipOutlinedBg:L,outerM:k,padX:E,verticalStrokeMargin:W}},[s,p,o,n,c,i,y]),O=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":m,minWidth:t?"max-content":m,marginLeft:N,marginRight:N}:{flexDirection:"row",width:a?Vn(a):"100%",minWidth:0,paddingLeft:B,paddingRight:n==="middle"?B:"0",marginTop:N,marginBottom:N},...Array.isArray(f)?f:f?[f]:[]]),[o,t,m,N,a,B,n,f]),S=useMemo(()=>css([{background:C,borderRadius:d?p.radius.full:p.radius.xs},o==="vertical"?{width:m,minHeight:18,flex:1,marginTop:K,marginBottom:K}:{height:m,flex:1}]),[C,d,p.radius.full,p.radius.xs,o,m,K]),F=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?d?p.radius.full:`calc(${p.radius.sm} * 0.75)`:`calc(${p.radius.sm} * 0.75)`,color:P,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:w,border:"none"}:{background:v,border:`${m} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,d,p.radius.full,p.radius.sm,P,u,w,v,m,C,T]),M=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,I]}),[S,I]);return o==="vertical"?jsxs("div",{ref:g,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",x||""].join(" ").trim(),css:O,...R,children:[t&&r!=="top"&&M,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="bottom"&&M,!t&&M]}):jsxs("div",{ref:g,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",x||""].join(" ").trim(),css:O,...R,children:[t&&r!=="left"&&M,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="right"&&M,!t&&M]})}));var ml=me.createContext(null),fl=()=>{let e=useContext(ml);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},gl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(d=>{t===void 0&&c(d),o?.(d);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(ml.Provider,{value:u,children:e})},Zp=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=fl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let d;me.isValidElement(t)&&(d=t.props.onClick),d?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let d;me.isValidElement(t)&&(d=t.props.onKeyDown),d?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,d=u.props.css;return me.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[d,o].filter(Boolean),onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,onClick:i,onKeyDown:l,...r,children:t})});Zp.displayName="DrawerTrigger";var To=0,bl="",hl="",Qp=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function em(){if(!(typeof document>"u")){if(To===0){let e=document.body;bl=e.style.overflow||"",hl=e.style.paddingRight||"";let t=Qp();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function tm(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=bl,e.style.paddingRight=hl;}}var nm=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,yl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:d,snapClosePct:y=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:I,css:x,...R},g){let p=V(),{open:m,setOpen:C,lockScroll:P,closeOnEscape:w}=fl();useEffect(()=>{if(!(!P||!m))return em(),()=>tm()},[m,P]);let v=useMemo(()=>nm(a,0),[a]),N=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),B=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),K=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${v*2}px)`:"100%"),[n,r,s,v]),O=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${v*2}px)`:"100%"),[o,r,s,v]),S=useMemo(()=>{let q=String(p.radius.lg);switch(r){case "left":return `0 ${q} ${q} 0`;case "right":return `${q} 0 0 ${q}`;case "top":return `0 0 ${q} ${q}`;default:return `${q} ${q} 0 0`}},[r,p.radius.lg]),F=useMemo(()=>c??(s==="inset"?p.radius.lg:S),[c,s,p.radius.lg,S]),M=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:v,bottom:r==="top"?void 0:v,left:r==="right"?void 0:v,right:r==="left"?void 0:v}:{top:r==="bottom"?void 0:0,bottom:r==="top"?void 0:0,left:r==="right"?void 0:0,right:r==="left"?void 0:0},[s,r,v]),b=useRef(null),h=useCallback(()=>{let q=b.current;if(!q)return 1;let Y=q.getBoundingClientRect();return N==="x"?Y.width:Y.height},[N]),A=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),D=useMemo(()=>({duration:(d??280)/1e3,ease:[.22,1,.36,1]}),[d]),L=useMemo(()=>B*1.1,[B]),k=useMemo(()=>N==="x"?{x:`${L*100}%`,y:0}:{y:`${L*100}%`,x:0},[N,L]),E=useMemo(()=>css({position:"fixed",zIndex:1100,...M,width:K,height:O,backgroundColor:p.surface.panelBg,borderRadius:F,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:m?"auto":"none",touchAction:N==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[M,K,O,p.surface,F,m,N]),W=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:p.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,p.surface]),$=useCallback(()=>{u&&C(false);},[u,C]),z=useMemo(()=>N==="x"?{left:B===-1?T:0,right:B===1?T:0}:{top:B===-1?T:0,bottom:B===1?T:0},[N,B,T]),_=useMemo(()=>N==="x"?{left:0,right:0}:{top:0,bottom:0},[N]),H=useMemo(()=>Math.max(0,Math.min(1,y)),[y]),U=useCallback((q,Y)=>{let le=N==="x"?Y.offset.x:Y.offset.y,ie=N==="x"?Y.velocity.x:Y.velocity.y,be=B*le>0,Pe=Math.abs(le)>=h()*H,Re=B*ie>f;be&&(Pe||Re)&&C(false);},[N,B,h,H,f,C]),X=useRef(null);useEffect(()=>{if(!m)return;X.current=document.activeElement;let q=setTimeout(()=>{let ie=b.current;if(!ie)return;let be=ie.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');be.length>0?be[0].focus():ie.focus();},100),Y=ie=>{let be=b.current;if(!be||!ie.target)return;let Pe=ie.target;if(!be.contains(Pe)){ie.preventDefault();let Re=be.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Re.length>0?Re[0].focus():be.focus();}},le=ie=>{ie.key==="Escape"&&w&&(ie.stopPropagation(),C(false));};return document.addEventListener("focusin",Y,true),window.addEventListener("keydown",le),()=>{clearTimeout(q),document.removeEventListener("focusin",Y,true),window.removeEventListener("keydown",le),X.current&&typeof X.current.focus=="function"&&X.current.focus();}},[m,C,w]);let{...ae}=R;return jsx(AnimatePresence,{children:m?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:W,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:d?D:{duration:.18,ease:"linear"},onClick:$},"overlay"),jsx(motion.div,{ref:q=>{b.current=q,typeof g=="function"?g(q):g&&(g.current=q);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",I||""].join(" ").trim(),css:[E,x],drag:N,dragConstraints:_,dragElastic:z,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...k,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...k,opacity:.98},transition:d?D:A,...ae,children:t},"panel")]}):null})});yl.displayName="DrawerContent";var om=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,d=o!==void 0?o:r,y=u!==void 0,[f,T]=useState(!!d),I=y?!!u:f,x=useCallback(R=>{y||T(R),R||a?.(),s?.(R);},[y,a,s]);return jsx(gl,{open:I,onOpenChange:x,children:jsx(yl,{ref:l,...i,children:c})})});om.displayName="DrawerLegacy";var Ws=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=d=>y=>{y.target===y.currentTarget&&(y.propertyName==="opacity"||y.propertyName==="filter")&&r?.(),d?.(y);};if(s&&isValidElement(e)){let d=e,y=d.props.css,f=Array.isArray(y)?[...y,i]:y?[y,i]:[i],T=["plainframe-ui-transition-fade",d.props.className||"",a||""].join(" ").trim(),I=d.props.onTransitionEnd;return cloneElement(d,{...d.props,css:f,className:T,onTransitionEnd:l(I)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var xl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,vl=me.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=V(),d=e==="vertical"||e==="column"?"column":"row",y=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:d,gap:y,justifyContent:n,alignItems:o,maxWidth:xl(c),width:c?"100%":void 0,maxHeight:xl(i),height:i?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,s],...l,children:a})});vl.displayName="Flex";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=y=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),y?.(f);};if(c&&isValidElement(e)){let y=e,f=y.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],I=y.props.onTransitionEnd,x=["plainframe-ui-transition-grow",y.props.className||"",i||""].join(" ").trim();return cloneElement(y,{...y.props,css:T,className:x,onTransitionEnd:u(I)})}let d=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:d,onTransitionEnd:u(),children:e})};var Cl={h1:{size:"2.25rem",weight:800,lh:1.1,ls:"-0.02em"},h2:{size:"1.875rem",weight:700,lh:1.15,ls:"-0.01em"},h3:{size:"1.5rem",weight:600,lh:1.2,ls:"-0.005em"},h4:{size:"1.25rem",weight:500,lh:1.2,ls:"0"},h5:{size:"1.125rem",weight:500,lh:1.3,ls:"0"},h6:{size:"1rem",weight:500,lh:1.3,ls:"0"},body:{size:"sm",weight:400,lh:1.4,ls:"0"},caption:{size:"xs",weight:400,lh:1.4,ls:"0.01em"}},ym=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),xm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Un=me.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:d="solid",decorationThickness:y=1,decorationColor:f,italic:T,className:I,style:x,as:R})=>{let g=V(),p=Cl[e]??Cl.body,m=R??xm[e]??"span",C=F=>F==null?p.size:typeof F=="number"?F:g?.typography?.sizes?.[F]??F,P=C(o)??C(p.size),w=r??p.weight,v=s??p.lh,N=a??p.ls,B=n==="secondary"?g.text.secondary:n==="primary"?g.text.primary:n??"inherit",K=f??g.surface.border,O=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:g?.typography?.fonts?.sans||"inherit",fontSize:P,fontWeight:w,lineHeight:v,letterSpacing:N,color:B,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:d,textDecorationColor:K,textDecorationThickness:ym(y),textDecorationSkipInk:"auto"});return jsx(m,{className:[`pfui-typo-${e}`,I||""].join(" ").trim(),css:[O,S],style:x,"data-variant":e,children:t})});Un.displayName="Typography";var Us=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Rm=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Us(typeof n=="number"||typeof n=="string"?n:e)}return e}}},Tl=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:d="lazy",decoding:y="async",fetchPriority:f,srcSet:T,sizes:I,placeholder:x,blurDataURL:R,placeholderColor:g="#f1f1f1",fallbackSrc:p,className:m,css:C,onClick:P,onLoad:w,onError:v,...N},B){let[K,O]=useState(false),[S,F]=useState(false),[M,b]=useState(false),h=V(),A=Rm(s,h)??"0px",D=i?"figure":"div",L=css({display:"flex",flexDirection:"column",gap:i?h.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${A})`}),k=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${A})`,maxWidth:o?Us(o):"100%",maxHeight:r?Us(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:u,boxShadow:a?"0 12px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.04)":"none",overflow:"hidden",padding:0,lineHeight:0,transition:"transform 0.3s ease",willChange:"transform",transform:K&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:P?"pointer":void 0}),E=css({position:"absolute",inset:0,background:x==="color"?g:void 0,backgroundImage:x==="blur"&&R?`url(${R})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:x==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:M?0:1,pointerEvents:"none"}),W=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:K&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(D,{className:["plainframe-ui-image",m||""].join(" ").trim(),css:[L,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:k,onMouseEnter:()=>O(true),onMouseLeave:()=>O(false),onClick:P,children:[!M&&x&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:E}),jsx("img",{ref:B,className:"plainframe-ui-image-img",css:W,src:S&&p?p:t,alt:n,srcSet:T,sizes:I,loading:d,decoding:y,fetchPriority:f,onLoad:$=>{b(true),w?.($);},onError:$=>{F(true),v?.($);},...N})]}),i&&jsx(Un,{as:"figcaption",variant:"caption",align:l,children:i})]})});Tl.displayName="Image";var wl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,km=e=>{if(typeof e=="number"&&isFinite(e)&&e>0)return e;if(typeof e=="string"){let t=e.trim().match(/^(\d+(?:\.\d+)?)\s*\/\s*(\d+(?:\.\d+)?)$/);if(t){let o=parseFloat(t[1]),r=parseFloat(t[2]);if(o>0&&r>0)return o/r}let n=parseFloat(e);if(isFinite(n)&&n>0)return n}},Im=e=>e*Math.PI/180,Sm=(e,t,n)=>{let o=Math.abs(Im(n)),r=Math.cos(o),s=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*s),h:Math.abs(t*r)+Math.abs(e*s)}};function Mm(e,t){if(t<=1){let r={ang:[0],dx:[0],dy:[0]};return {base:r,exp:r}}return e==="fan"?{base:t===2?{ang:[-14,10],dx:[-40,24],dy:[0,0]}:{ang:[-14,0,14],dx:[-55,0,55],dy:[-7.5,0,-7.5]},exp:t===2?{ang:[-7,5],dx:[-20,12],dy:[0,0]}:{ang:[-7,0,7],dx:[-32.5,0,32.5],dy:[0,0,0]}}:e==="slide"?{base:t===2?{ang:[-20,3],dx:[-10,5],dy:[-2,0]}:{ang:[-20,-5,10],dx:[-35,-10,12],dy:[4,0,4]},exp:t===2?{ang:[-10,1.5],dx:[-10,5],dy:[-2,0]}:{ang:[-10,-2.5,5],dx:[-30.5,-7.5,6],dy:[4,0,4]}}:e==="domino"?{base:t===2?{ang:[0,0],dx:[0,0],dy:[-11,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-18,-5,6]},exp:t===2?{ang:[0,0],dx:[0,0],dy:[-5,5]}:{ang:[0,0,0],dx:[0,0,0],dy:[-14,-2.5,7]}}:{base:t===2?{ang:[-4,8],dx:[-22,18],dy:[-30,40]}:{ang:[-10,10,.5],dx:[-30,30,-15],dy:[-65,2,65]},exp:t===2?{ang:[-3,6],dx:[-11,9],dy:[-22.5,30]}:{ang:[-7.5,7.5,.35],dx:[-15,20,-10.5],dy:[-55.5,2,55.5]}}}var Fm=(e,t,n)=>e==="fan"?t===2?[.9,1.08][n]??1:[.8,1,.8][n]??1:e==="slide"?t===2?[.8,1][n]??1:[.7,.85,1][n]??1:e==="domino"?t===2?[.9,1][n]??1:[.85,.95,1][n]??1:1,El=[1.02,1.03,1.02],kl=[1.06,1.08,1.06],Am={sm:150,md:200,lg:260,xl:340},Pm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Nm(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl","full"].includes(e)){let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return Pm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Dm=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:d,outlineColor:y,outlineWidth:f=3,outlineOffset:T=0,radius:I="md",label:x,labelAlign:R="center",css:g,className:p,...m}){let C=V(),P=km(r)??4/5,w=typeof o=="string"?o:void 0,v=typeof o=="number"?o:w&&/px$/.test(w)?parseFloat(w):Am[s],N=Math.max(1,v/P),K=Children.toArray(t).filter(isValidElement).slice(0,i),O=K.length,S=Mm(n,O),F=K.map((q,Y)=>Fm(n,O,Y)),M=q=>N*.6*F[q],b=q=>M(q)*P,h=0,A=0;for(let q=0;q<O;q++){let Y=b(q),le=M(q),ie=Math.max(Math.abs(S.base.ang[q]??0),Math.abs(S.exp.ang[q]??0)),be=Math.max(Math.abs(S.base.dx[q]??0),Math.abs(S.exp.dx[q]??0)),Pe=Math.max(Math.abs(S.base.dy[q]??0),Math.abs(S.exp.dy[q]??0)),Re=a==="expand"?kl[q]??1.08:a==="reveal"?El[q]??1.03:1,Ce=Sm(Y,le,ie),Ie=Ce.w*Re,Te=Ce.h*Re,we=be/100*Y*Re,he=Pe/100*le*Re;h=Math.max(h,Ie/2+we),A=Math.max(A,Te/2+he);}let D=Math.max(1,2*h),L=Math.max(1,2*A),k=Math.min(1,v/D,N/L),E=c===void 0?"pointer":"controlled",W=c?"true":void 0,$=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:x?C.spacing.xs:0}),z=css({position:"relative",width:wl(typeof o=="number"?o:v)??(typeof o=="string"?o:void 0),height:wl(N)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${D}px`,height:`${L}px`,transform:`translate(-50%, -50%) scale(${k})`,transformOrigin:"center center"}),H=Nm(I,C)??"0px",U=q=>{let Y=n==="fan"?`rotate(${S.base.ang[q]}deg) translate(${S.base.dx[q]}%, ${S.base.dy[q]}%)`:n==="slide"?`translate(${S.base.dx[q]}%, ${S.base.dy[q]}%) rotate(${S.base.ang[q]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[q]}%)`:`translate(${S.base.dx[q]}%, ${S.base.dy[q]}%) rotate(${S.base.ang[q]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[q]}deg) translate(${S.exp.dx[q]}%, ${S.exp.dy[q]}%)`:n==="slide"?`translate(${S.exp.dx[q]}%, ${S.exp.dy[q]}%) rotate(${S.exp.ang[q]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[q]}%)`:`translate(${S.exp.dx[q]}%, ${S.exp.dy[q]}%) rotate(${S.exp.ang[q]}deg)`,ie=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Y} scale(1)`,be=a==="expand"?`${le} scale(${kl[q]??1.06})`:a==="reveal"?`${Y} scale(${El[q]??1.03})`:`${Y} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${ie}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&q===1?10:q+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:d?`${f}px solid ${y??C.surface.appBg}`:void 0,outlineOffset:d?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${be}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${be}`}})},X=q=>css({width:`${b(q)}px`,aspectRatio:`${P}`,position:"relative",overflow:"hidden",borderRadius:H,"--pfui-image-radius":H,"& > *":{position:"absolute",inset:"0",width:"100% !important",height:"100% !important",maxWidth:"none !important",maxHeight:"none !important",display:"block"},"& img, & picture img, & video, & canvas":{width:"100% !important",height:"100% !important",objectFit:"cover",display:"block"}});return jsxs(x?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",p||""].join(" ").trim(),"data-hover-mode":E,"data-hovered":W,css:[$,g],tabIndex:-1,...m,children:[jsx("div",{className:"plainframe-ui-image-stack",css:z,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:_,children:K.map((q,Y)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(Y),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:X(Y),children:q})},Y))})}),x&&jsx(Un,{as:"figcaption",variant:"caption",align:R,children:x})]})});var Il=e=>typeof e=="number"?`${e}px`:e,Sl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Bm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Il(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Il(n)}return e}function $m(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var zm=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:c=2,css:i,className:l="plainframe-ui-kbd",...u},d){let y=V(),f=xe(),T=Sl[o]??Sl.sm,I=Bm(r,y),x={br:y.neutral[300],txt:y.neutral[800],inset:y.neutral[0]},R=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?y.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:I,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),g=css({"&&":{background:y.surface.subtleBg,border:"none",boxShadow:"none",color:x.txt}}),p=css({"&&":{background:"transparent",color:x.txt,border:"none",boxShadow:"none"}}),m=css({"&&":{background:y.surface.panelBg,color:x.txt,border:`1px solid ${x.br}`,boxShadow:`inset 0 1px 0 ${x.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?g:n==="ghost"?p:m,w=s&&c>0&&$m(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:d,className:l,css:[f(),R,C,i],...u,children:w})});var _m=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,qs=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:a=false,className:c,distance:i})=>{let u=_m(i,t==="left"||t==="right"?"100vw":"100vh"),d=t==="left"?`-${u}`:t==="right"?u:"0",y=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${d}, ${y}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=x=>R=>{R.target===R.currentTarget&&R.propertyName==="transform"&&s?.(),x?.(R);};if(a&&isValidElement(e)){let x=e,R=x.props.css,g=Array.isArray(R)?[...R,f]:R?[R,f]:[f],p=["plainframe-ui-transition-slide",x.props.className||"",c||""].join(" ").trim(),m=x.props.onTransitionEnd;return cloneElement(x,{...x.props,css:g,className:p,onTransitionEnd:T(m)})}let I=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:I,onTransitionEnd:T(),children:e})};var Gs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pl=me.createContext(null),Nl=()=>{let e=useContext(Pl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},Xm=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(d=>{t===void 0&&c(d),o?.(d);},[t,o]);useEffect(()=>{if(!i||!s)return;let d=y=>{y.key==="Escape"&&(y.stopPropagation(),l(false));};return window.addEventListener("keydown",d,true),()=>window.removeEventListener("keydown",d,true)},[i,s,l]);let u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Pl.Provider,{value:u,children:e})},Dl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Nl(),c=!!e&&me.isValidElement(t),i=useCallback(u=>{if(c){let d;me.isValidElement(t)&&(d=t.props.onClick),d?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let d;me.isValidElement(t)&&(d=t.props.onKeyDown),d?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,d=u.props.css;return me.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[d,o].filter(Boolean),"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r})}return jsx("button",{ref:s,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:i,onKeyDown:l,...r,children:t})});Dl.displayName="ModalTrigger";var Hl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:d="up",transitionDuration:y=300,containerCss:f,backdropCss:T,className:I,...x},R)=>{let g=V(),{open:p,setOpen:m,lockScroll:C}=Nl(),P=me.useRef(null),w=me.useRef(null);me.useEffect(()=>{if(!p)return;w.current=document.activeElement;let S=setTimeout(()=>{let M=P.current;if(!M)return;let b=M.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');b.length>0?b[0].focus():M.focus();},100),F=M=>{let b=P.current;if(!b||!M.target)return;let h=M.target;if(!b.contains(h)){M.preventDefault();let A=b.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');A.length>0?A[0].focus():b.focus();}};return document.addEventListener("focusin",F,true),()=>{clearTimeout(S),document.removeEventListener("focusin",F,true),w.current&&typeof w.current.focus=="function"&&w.current.focus();}},[p]);let v=typeof g.spacing.sm=="number"?`${g.spacing.sm}px`:String(g.spacing.sm),N=css({width:"100%",height:Gs(o),maxWidth:t==="inset"?`min(${Gs(n)||"100%"}, calc(100% - ${v} * 2))`:Gs(n),maxHeight:t==="inset"?`calc(100% - ${v} * 2)`:"100%",margin:t==="inset"?v:void 0}),B=jsx(_n,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",I||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[N,f],ref:S=>{P.current=S,typeof R=="function"?R(S):R&&(R.current=S);},...x,children:e}),K=u==="none"?B:u==="slide"?jsx(qs,{on:p,direction:d,duration:y,children:B}):u==="grow"?jsx(Ks,{initialScale:.75,on:p,duration:y,children:B}):jsx(Ws,{on:p,duration:y,children:B});if(!a)return jsx(Fragment,{children:K});let O=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Es,{on:p,blur:c,blurDepth:i,onClickAway:l?()=>m(false):void 0,css:[O,T].filter(Boolean),contentCss:O,lockScroll:C,children:K})});Hl.displayName="ModalContent";var of=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:c=false,loop:i=false,variant:l="subtle",gap:u,className:d,css:y})=>{let f=V(),T=xe(),I=t!==void 0,[x,R]=useState(n),g=Math.max(1,e),p=Sr(I?t:x,1,g),m=useCallback(k=>{let E=Sr(k,1,g);I||R(E),o?.(E);},[I,g,o]),C=useMemo(()=>rf({count:g,page:p,siblingCount:r,boundaryCount:s}),[g,p,r,s]),P=f.palette?.primary?.[600],w=f.surface?.border,v=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,N=f.text?.primary??"#111",B=l==="subtle"?f.surface?.subtleBg:"transparent",K=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:B,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(y)?y:y?[y]:[]),O=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:N,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),F=(k=false)=>css([O,T({color:k?"primary":"neutral"}),l==="outlined"?k?{background:P,color:f.text.onColors.primary,borderColor:P}:{background:"transparent",borderColor:w,":hover":{background:v}}:l==="ghost"?k?{background:P,color:f.text.onColors.primary}:{":hover":{background:v}}:k?{background:P,color:f.text.onColors.primary,borderColor:P}:{":hover":{background:v}}]),M=useCallback(()=>m(1),[m]),b=useCallback(()=>m(g),[m,g]),h=useCallback(()=>{p===1?i&&m(g):m(p-1);},[p,i,g,m]),A=useCallback(()=>{p===g?i&&m(1):m(p+1);},[p,i,g,m]),D=a||p===1&&!i,L=a||p===g&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",d||""].join(" ").trim(),css:K,onKeyDown:k=>{a||(k.key==="ArrowLeft"&&(k.preventDefault(),h()),k.key==="ArrowRight"&&(k.preventDefault(),A()),k.key==="Home"&&(k.preventDefault(),M()),k.key==="End"&&(k.preventDefault(),b()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":D,disabled:D,css:[F(false),S],onClick:M,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":D,disabled:D,css:[F(false),S],onClick:h,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((k,E)=>typeof k=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":k===p?`Page ${k}, current page`:`Go to page ${k}`,"aria-current":k===p?"page":void 0,css:F(k===p),onClick:()=>m(k),children:k},k):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([O,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${E}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":L,disabled:L,css:[F(false),S],onClick:A,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":L,disabled:L,css:[F(false),S],onClick:b,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Sr(e,t,n){return Math.max(t,Math.min(n,e))}function rf({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Ir(1,e);let s=Ir(1,Math.min(o,e)),a=Ir(Math.max(e-o+1,o+1),e),c=Sr(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Sr(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],u=d=>{let y=l[l.length-1];y!==d&&(y==="ellipsis"&&d==="ellipsis"||l.push(d));};return s.forEach(u),c>o+2?u("ellipsis"):o+1<c&&u(o+1),Ir(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Ir(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var cf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,uf=me.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=V(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:cf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var zl=createContext(null),ff=()=>{let e=useContext(zl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},gf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},bf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let d=V(),y=e!==void 0&&n!==void 0,[f,T]=useState(t),I=y?e:f,x=useRef([]),[R,g]=useState(0),p=()=>g(F=>F+1),m=useCallback(F=>{y||T(F),n?.(F);},[y,n]),C=useCallback(F=>(x.current.push(F),p(),x.current.length-1),[]),P=useCallback((F,M)=>{let b=x.current[F];b&&(x.current[F]={...b,...M},p());},[]),w=()=>x.current.map((F,M)=>({it:F,i:M})).filter(({it:F})=>F.ref&&!F.disabled).map(({i:F})=>F),v=useCallback((F,M)=>{let b=w();if(!b.length)return;let h=Math.max(0,b.indexOf(F)),A=b[(h+M+b.length)%b.length],D=x.current[A]?.ref;if(D){D.focus();let L=x.current[A]?.value;L!==void 0&&m(L);}},[m]),N=useCallback(F=>{let M=w();if(!M.length)return;let b=F==="first"?M[0]:M[M.length-1],h=x.current[b]?.ref;if(h){h.focus();let A=x.current[b]?.value;A!==void 0&&m(A);}},[m]),B=useMemo(()=>{let F=x.current.filter(b=>b.ref&&!b.disabled);return F.length?F.some(b=>b.value===I)?I:F[0]?.value:void 0},[I,R]),K=useMemo(()=>({selected:I,setSelected:m,disabled:o,size:r,direction:s,variant:a,register:C,update:P,moveFocusBy:v,moveToEdge:N,focusValue:B,theme:d,anchorOrigin:gf(l)}),[I,m,o,r,s,a,C,P,v,N,B,d,l]),O=css({width:"fit-content"}),S=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:d.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[O,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(zl.Provider,{value:K,children:i})})})},hf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:d,moveToEdge:y,theme:f,variant:T,focusValue:I,anchorOrigin:x}=ff(),R=c||t,g=s===e,p=["sm","md","lg"].includes(i)?i:"md",m=p==="sm"?16:p==="lg"?24:20,C=z=>f.palette?.primary?.[z],P=C(600),w=C(100),v=f.neutral[300],N=f.palette.primary[300],B=f.text.onColors?.primary??f.neutral[0],K="transparent",O=N,S=B;T==="soft"?(K=w,O=null,S=P):T==="outlined"?(K=C(50),O=N,S=P):(K=f.neutral[200],O="transparent",S=B),g&&(T==="outlined"?(K=w,O=N,S=P):T==="filled"?(K=P,O=null,S=B):(K=w,O=null,S=P));let F=T==="filled"?v:f.palette.primary[100],M=useRef(null),b=useRef(-1);useEffect(()=>{b.current=l({ref:M.current,value:e,disabled:!!R});},[l]),useEffect(()=>{u(b.current,{ref:M.current,value:e,disabled:!!R});},[u,R,e]);let h=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:x.vertical==="center"?f.spacing.sm:0,rowGap:x.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:R?.5:1,borderRadius:f.radius.md,cursor:R?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":R||g?{}:{background:F,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${N}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),A=css({width:m,height:m,minWidth:m,minHeight:m,borderRadius:f.radius.full,background:K,boxShadow:O?`inset 0 0 0 ${f.componentHeights.border} ${O}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),D=css({width:g?m*.45:0,height:g?m*.45:0,borderRadius:f.radius.full,background:g?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:g?"scale(1)":"scale(0.6)",opacity:g?1:0}),L=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),k=(()=>{let z=x.horizontal,_=x.vertical;return _==="center"?{col:z==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),W=!R&&I===e?0:-1,$=xe();return jsxs("button",{ref:M,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":g,"aria-disabled":R||void 0,disabled:R,tabIndex:W,onClick:()=>{R||a(e);},onKeyDown:z=>{R||(z.key==="Enter"||z.key===" "?(z.preventDefault(),a(e)):z.key==="ArrowRight"||z.key==="ArrowDown"?(z.preventDefault(),d(b.current,1)):z.key==="ArrowLeft"||z.key==="ArrowUp"?(z.preventDefault(),d(b.current,-1)):z.key==="Home"?(z.preventDefault(),y("first")):z.key==="End"&&(z.preventDefault(),y("last")));},css:[h,$({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[A,css({gridColumn:k.col,gridRow:k.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:D})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:L,children:o})]})};var Rf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=y=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),y?.(f);};if(c&&isValidElement(e)){let y=e,f=y.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],I=["plainframe-ui-transition-rotate",y.props.className||"",i||""].join(" ").trim(),x=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:T,className:I,onTransitionEnd:u(x)})}let d=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:d,onTransitionEnd:u(),children:e})};var Fo=(...e)=>e.filter(Boolean).flat(),Mr=e=>me.isValidElement(e),Ao=(e,t)=>{if(!Mr(e))return false;let n=e.type,o=(n?.displayName??n?.name??"")||"";return typeof o=="string"&&t.includes(o)},Ef=(e,t)=>{let n=e.props,o=n.value;if(typeof o<"u")return o;let r=n["data-value"];return typeof r<"u"?r:t};function kf({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,disabled:c,size:i="md",variant:l="subtle",fullWidth:u,width:d=200,menuAlign:y="left",menuWidth:f,menuMaxHeight:T=280,wrapperCss:I,labelCss:x,triggerCss:R,menuCss:g,optionCss:p,children:m,className:C,menuSize:P="md",triggerRender:w}){let v=V(),N=xe(),B=me.useId(),K=`${B}-label`,O=`${B}-menu`,S={sm:{minHeight:v.componentHeights.sm,radius:v.radius.sm},md:{minHeight:v.componentHeights.md,radius:v.radius.md},lg:{minHeight:v.componentHeights.lg,radius:v.radius.md}},F=S[i]||S.md,[M,b]=me.useState(false),h=j=>b(!!j),A=typeof e<"u",D=Array.isArray(e)||Array.isArray(t),[L,k]=me.useState(typeof t<"u"?t:D?[]:void 0),E=A?e:L,W=j=>{A||k(j),n?.(j);},$=me.Children.toArray(m).filter(Mr),z,_=[];for(let j of $)if(Ao(j,["MenuRadioGroup"]))z=j;else if(Ao(j,["MenuCheckboxGroup"])){let ue=j.props.children,de=ue?me.Children.toArray(ue).filter(Mr):[];_.push(...de);}else _.push(j);let U=(z?me.Children.toArray(z.props.children).filter(Mr):_).filter(j=>!Ao(j,["MenuLabel","MenuSeparator"])).map((j,ue)=>{let de=j.props,fe=Ef(j,ue),ze=de.children,Oe=de.label,st=typeof Oe=="string"||typeof Oe=="number"?String(Oe):typeof ze=="string"||typeof ze=="number"?String(ze):void 0,Ye=de.role??"",yt=Ao(j,["MenuCheckboxItem"]),tn=Ao(j,["MenuRadioItem"]),nn=yt||Ye==="menuitemcheckbox"||typeof de.onCheckedChange=="function"||typeof de.checked=="boolean"||typeof de.defaultChecked=="boolean",Sn=!nn&&(tn||Ye==="menuitemradio"||!!z),on=typeof de.children>"u"?st??String(fe):de.children;return {el:j,key:j.key??ue,value:fe,labelText:st,title:de.title,description:de.description,nodeForTrigger:on,disabled:!!de.disabled,className:de.className,itemCss:de.css,startIcon:de.startIcon,endIcon:de.endIcon,isCheckbox:nn,isRadio:Sn}}),X=U.some(j=>j.isCheckbox),ae=U.length>0&&U.every(j=>j.isRadio),Y=(D||X)&&!ae,le=me.useCallback(j=>Y?(Array.isArray(E)?E:[]).some(de=>Object.is(de,j)):Object.is(E,j),[E,Y]),ie=me.useMemo(()=>{if(Y){let ue=Array.isArray(E)?E:[];return U.filter(fe=>ue.some(ze=>Object.is(ze,fe.value))).map(fe=>typeof fe.nodeForTrigger=="string"||typeof fe.nodeForTrigger=="number"?String(fe.nodeForTrigger):fe.nodeForTrigger)}let j=U.find(ue=>Object.is(ue.value,E));if(j)return typeof j.nodeForTrigger=="string"||typeof j.nodeForTrigger=="number"?String(j.nodeForTrigger):j.nodeForTrigger},[E,Y,U]),be=j=>{c||(Object.is(j,E)||W(j),h(false));},Pe=j=>{c||Object.is(j,E)||W(j);},Re=j=>{if(c)return;let ue=Array.isArray(E)?E:[],fe=ue.some(ze=>Object.is(ze,j))?ue.filter(ze=>!Object.is(ze,j)):[...ue,j];W(fe);},Ce={position:"relative",width:u?"100%":typeof d=="number"?`${d}px`:d,maxWidth:"100%"},Ie={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:F.radius,minHeight:F.minHeight,fontSize:v.typography.sizes.sm,padding:`0 ${typeof v.spacing.sm=="number"?`${v.spacing.sm}px`:v.spacing.sm} 0 ${typeof v.spacing.md=="number"?`${v.spacing.md}px`:v.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:c?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:v.text.primary,background:"transparent",whiteSpace:"nowrap"},Te=l==="subtle"?{background:v.surface.subtleBg}:l==="outlined"?{background:v.surface.panelBg,border:`1px solid ${v.surface.border}`}:{background:"transparent"},we={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},he={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},je={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Z=jsx(ChevronsUpDown,{size:16,css:css({color:v.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Ee=()=>{if(w)return w(ie);if(Array.isArray(ie)){let ue=ie.map(fe=>typeof fe=="string"?fe:"").filter(Boolean),de=ue.length?ue.join(", "):String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(he),children:s}),jsx("span",{css:css(je),title:de,children:de})]})}let j=ie??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(he),children:s}),jsx("span",{css:css(je),title:typeof j=="string"?j:void 0,children:j})]})},Q={left:"start",center:"center",right:"end"},ee=j=>{c||(j.key==="ArrowDown"||j.key==="ArrowUp"||j.key==="Enter"||j.key===" ")&&(j.preventDefault(),h(true));},se={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",marginRight:8},pe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",marginLeft:8},Se={flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2},Ne={fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"},J={fontSize:"0.875em",color:v.text.secondary,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400},oe=(j,ue)=>{let de=j.title||j.description?jsxs("span",{className:"plainframe-ui-select-option-content",css:css(Se),children:[jsx("span",{className:"plainframe-ui-select-option-title",css:css(Ne),children:j.title??ue}),j.description&&jsx("span",{className:"plainframe-ui-select-option-description",css:css(J),children:j.description})]}):jsx("span",{className:"plainframe-ui-select-option-text",css:css(Ne),children:ue});return jsxs(Fragment,{children:[j.startIcon&&jsx("span",{css:css(se),children:j.startIcon}),de,j.endIcon&&jsx("span",{css:css(pe),children:j.endIcon})]})},re=(j,ue)=>{let de=j.value,fe=le(de),ze=Fo(p,j.itemCss),Oe=j.el.props,st=typeof Oe.children>"u"?j.labelText??String(de):Oe.children;if(Y||j.isCheckbox)return me.cloneElement(j.el,{key:j.key??ue,disabled:c||j.disabled,checked:!!Oe.checked||fe,onCheckedChange:()=>Re(de),closeOnSelect:false,css:ze,className:`plainframe-ui-select-option ${j.className||""}`.trim(),children:oe(j,st)});if(j.isRadio)return me.cloneElement(j.el,{key:j.key??ue,value:de,disabled:c||j.disabled,closeOnSelect:false,css:ze,className:`plainframe-ui-select-option ${j.className||""}`.trim(),children:oe(j,st)});let Ye=yt=>{yt?.preventDefault?.(),be(de);};return me.cloneElement(j.el,{key:j.key??ue,role:"menuitem","aria-checked":void 0,"aria-selected":fe||void 0,"aria-disabled":c||j.disabled||void 0,disabled:c||j.disabled,closeOnSelect:true,onSelect:Ye,onClick:Ye,css:ze,className:`plainframe-ui-select-option ${j.className||""}`.trim(),children:oe(j,st)})},qe=(()=>{let j=!Y&&(z||U.length>0&&U.every(ue=>ue.isRadio));return z?me.cloneElement(z,{key:"controlled-inner-group",value:E,onValueChange:ue=>Pe(ue),children:U.map(re)}):j?jsx(lr,{value:E,onValueChange:ue=>Pe(ue),children:U.map(re)}):U.map(re)})();return jsxs("div",{css:Fo(Ce,I),className:["plainframe-ui-select-wrapper",C||""].join(" ").trim(),children:[o&&jsx("div",{id:K,className:"plainframe-ui-select-label",css:Fo({marginBottom:6,fontSize:v.typography.sizes.sm,fontWeight:500,color:v.text.secondary},x),children:o}),jsxs($n,{size:P,open:M,onOpenChange:h,children:[jsx(zn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:c,"aria-haspopup":"menu","aria-expanded":M||void 0,"aria-controls":O,"aria-labelledby":o?K:void 0,onKeyDown:ee,onClick:()=>h(!M),className:"plainframe-ui-select-trigger",css:Fo(css(Ie),css(Te),R,N()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(we),children:Ee()}),a??Z]})}),jsx(hn,{id:O,gap:"xs",align:Q[y],sameWidth:f==null,width:f??d,className:"plainframe-ui-select-menu",css:Fo({maxHeight:typeof T=="number"?`${T}px`:T,overflowY:"auto"},g),children:qe})]})]})}var Zs=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Sf=keyframes`
|
|
14
14
|
0% { background-position: -200% 0; }
|
|
15
15
|
100% { background-position: 200% 0; }
|
|
16
16
|
`,Mf=keyframes`
|