plainframe-ui 0.1.9 → 0.1.11

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +201 -241
  2. package/dist/index.js +20 -54
  3. package/package.json +6 -5
package/dist/index.js CHANGED
@@ -1,82 +1,48 @@
1
- import ie,{forwardRef,createContext,useMemo,useId,useState,useCallback,useRef,isValidElement,cloneElement,useContext,useEffect,Children,memo,useLayoutEffect,useSyncExternalStore}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,Check,ChevronFirst,ChevronLeft,ChevronRight,ChevronLast,ChevronsUpDown}from'lucide-react';import {useFloating,offset,flip,shift,size,autoUpdate,useDismiss,useRole,useInteractions,FloatingPortal,arrow,useHover,safePolygon,useFocus}from'@floating-ui/react';import {AnimatePresence,motion,useAnimationControls}from'framer-motion';import {createPortal}from'react-dom';var hs={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},ys={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},xs={xs:"10px",sm:"12px",md:"14px",lg:"16px",xl:"20px",xxl:"32px"},vs={sm:32,md:36,lg:40,border:"1px"},Cs={sans:'"Geist", system-ui, -apple-system, Segoe UI, Roboto, sans-serif',mono:'"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace'},Zo={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#C6C6C6",500:"#b3b3b3",600:"#7a7a7a",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},er={0:"#0c0c0c",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},gs={mono:{0:"#FFFFFF",50:"#FAFAFA",100:"#F2F2F2",200:"#E6E6E6",300:"#D1D1D1",400:"#8A8A8A",500:"#2A2A2A",600:"#1A1A1A",700:"#121212",800:"#0B0B0B",900:"#000000"},danger:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#FFC2C5",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},success:{0:"#FFFFFF",50:"#EEFFF3",100:"#D7FFE8",200:"#B9FBD5",300:"#8EF5BB",400:"#5BEA9A",500:"#0FD45D",600:"#00C853",700:"#109C47",800:"#0E8242",900:"#064D2B"},warning:{0:"#FFFFFF",50:"#FFF7EB",100:"#FFEFC6",200:"#FFE094",300:"#FFC552",400:"#FFB83A",500:"#FFA414",600:"#FF9F0A",700:"#D97500",800:"#AF5E00",900:"#6E3600"},info:{0:"#FFFFFF",50:"#ECFAFF",100:"#D2F2FF",200:"#AEE6FF",300:"#84D6FF",400:"#4BC1FF",500:"#2B9FFF",600:"#1093FF",700:"#0077C0",800:"#0066A8",900:"#083B61"},amber:{0:"#FFFFFF",50:"#FFF3EA",100:"#FFE3D1",200:"#FFC7A6",300:"#FFAC80",400:"#FF874D",500:"#FF6C1F",600:"#FF5A00",700:"#D24500",800:"#B63C00",900:"#6F2300"},orange:{0:"#FFFFFF",50:"#FFF4EB",100:"#FFE6CC",200:"#FFCE9E",300:"#FFAE66",400:"#FF8B33",500:"#FF7310",600:"#FF6B00",700:"#CC4400",800:"#AF3F00",900:"#6B2400"},yellow:{0:"#FFFFFF",50:"#FFFAE6",100:"#FFF2BF",200:"#FFE780",300:"#FFDB3D",400:"#FFD000",500:"#FFE03F",600:"#FFD60A",700:"#B38600",800:"#8E6D00",900:"#534300"},lime:{0:"#FFFFFF",50:"#F6FFE8",100:"#E7FFC2",200:"#CCFF83",300:"#A8FA3D",400:"#8BE11C",500:"#87DE10",600:"#7ACC00",700:"#4A8C00",800:"#3B7100",900:"#224300"},green:{0:"#FFFFFF",50:"#F0FFF5",100:"#DBFFE9",200:"#BDF7CF",300:"#8FE7A8",400:"#5BD57D",500:"#1DAE52",600:"#16A34A",700:"#168A40",800:"#136A34",900:"#0B3D1F"},teal:{0:"#FFFFFF",50:"#EDFFFB",100:"#D2FFF4",200:"#A6FAEA",300:"#74EEDC",400:"#41DECB",500:"#00CFAA",600:"#00BFA5",700:"#0C8C7F",800:"#0B786C",900:"#084741"},cyan:{0:"#FFFFFF",50:"#EFFFFF",100:"#D4FCFF",200:"#AFF5FD",300:"#7FE8F6",400:"#45D3EB",500:"#09C6E7",600:"#00B8D9",700:"#0A7C92",800:"#0B6E81",900:"#0A4250"},blue:{0:"#FFFFFF",50:"#EFF6FF",100:"#DBE8FF",200:"#B8D3FF",300:"#90BAFF",400:"#5E97FF",500:"#406FFF",600:"#2F66FF",700:"#2452DE",800:"#2248C8",900:"#172C80"},indigo:{0:"#FFFFFF",50:"#EEF2FF",100:"#E0E6FF",200:"#C5D0FF",300:"#A3B5FF",400:"#879CFF",500:"#707AF5",600:"#5A63F3",700:"#4951DA",800:"#3E40BF",900:"#2A2A82"},purple:{0:"#FFFFFF",50:"#F4F0FF",100:"#E8DBFF",200:"#D2B8FF",300:"#B590FF",400:"#996AF5",500:"#7A52F1",600:"#6B3CF0",700:"#592FBE",800:"#4D27A3",900:"#2F1767"},magenta:{0:"#FFFFFF",50:"#FFF0FE",100:"#FCE0FF",200:"#F7BCFF",300:"#F393FD",400:"#E85FF8",500:"#C645D6",600:"#C026D3",700:"#951CAB",800:"#801790",900:"#4C0C59"},pink:{0:"#FFFFFF",50:"#FFF0F7",100:"#FFE0F0",200:"#FFC0E2",300:"#FF9ACE",400:"#FF6CB3",500:"#ED5CA2",600:"#EC4899",700:"#AB236F",800:"#96205D",900:"#5A1238"},rose:{0:"#FFFFFF",50:"#FFF0F3",100:"#FFE1E9",200:"#FFC1D3",300:"#FF98B8",400:"#FF6B98",500:"#EE4278",600:"#E52E69",700:"#B52156",800:"#991A43",900:"#5B0F28"}},bs={mono:{0:"#0B0B0C",50:"#0F0F10",100:"#151515",200:"#1B1B1C",300:"#232323",400:"#DADADA",500:"#E0E0E0",600:"#EDEDED",700:"#F5F5F5",800:"#FCFCFC",900:"#FFFFFF"},danger:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},success:{0:"#06150B",50:"#0A1B10",100:"#0E2416",200:"#11301C",300:"#143B21",400:"#16502C",500:"#22D85A",600:"#00C853",700:"#2FE976",800:"#7FF1AE",900:"#D6FADF"},warning:{0:"#150E05",50:"#1C1408",100:"#261B0B",200:"#31240E",300:"#3D2C12",400:"#583C16",500:"#FFA61A",600:"#FF9F0A",700:"#FFB347",800:"#FFD089",900:"#FFF0C9"},info:{0:"#07131E",50:"#0A1926",100:"#0E2233",200:"#112C44",300:"#143654",400:"#184A78",500:"#1C9CFF",600:"#1093FF",700:"#4FB2FF",800:"#9DD2FF",900:"#D8ECFF"},amber:{0:"#150D07",50:"#1C120A",100:"#26180E",200:"#311F12",300:"#3E2716",400:"#59361C",500:"#FF6A1E",600:"#FF5A00",700:"#FF8747",800:"#FFB98A",900:"#FFE2CC"},orange:{0:"#140D07",50:"#1B120A",100:"#25190D",200:"#302010",300:"#3B2813",400:"#553817",500:"#FF7F22",600:"#FF6B00",700:"#FF9247",800:"#FFBE8A",900:"#FFE1CC"},yellow:{0:"#141303",50:"#1B1906",100:"#25210A",200:"#2F2A0D",300:"#383212",400:"#524717",500:"#FFE042",600:"#FFD60A",700:"#FFE457",800:"#FFF194",900:"#FFF8CF"},lime:{0:"#0C1306",50:"#101A08",100:"#14210B",200:"#1A2B0F",300:"#203614",400:"#2A4A1A",500:"#86E21A",600:"#7ACC00",700:"#9EEA3B",800:"#C9F57F",900:"#EAFCC4"},green:{0:"#07140C",50:"#0B1B11",100:"#0E2416",200:"#112C1B",300:"#143722",400:"#17502F",500:"#20BF55",600:"#16A34A",700:"#39C964",800:"#86E5A5",900:"#D4F6E1"},teal:{0:"#081815",50:"#0B1F1C",100:"#0F2824",200:"#13322E",300:"#173E39",400:"#14584F",500:"#14CEBD",600:"#00BFA5",700:"#2CD6C6",800:"#7FEAE3",900:"#CFF7F3"},cyan:{0:"#07171C",50:"#0A1E24",100:"#0E2830",200:"#11333D",300:"#153E4A",400:"#165B6A",500:"#20CBE6",600:"#00B8D9",700:"#3FD2E9",800:"#93EBF6",900:"#D5F7FC"},blue:{0:"#081421",50:"#0A1829",100:"#0E2139",200:"#112A4B",300:"#153660",400:"#184A86",500:"#4A78FF",600:"#2F66FF",700:"#5A8AFF",800:"#A7C3FF",900:"#D9E7FF"},indigo:{0:"#0B1023",50:"#0E162C",100:"#141F3F",200:"#1C2A56",300:"#24366E",400:"#2F4894",500:"#707CF6",600:"#5A63F3",700:"#7D86FF",800:"#B5C0FF",900:"#E0E6FF"},purple:{0:"#100B1F",50:"#130E26",100:"#1A1638",200:"#231F4E",300:"#2E2A67",400:"#3C388D",500:"#8256F3",600:"#6B3CF0",700:"#8B66FA",800:"#C1B0FF",900:"#E4DCFF"},magenta:{0:"#160A18",50:"#1C0C21",100:"#25102E",200:"#321544",300:"#421A5C",400:"#58247C",500:"#CB44DB",600:"#C026D3",700:"#D960EB",800:"#F0B5FA",900:"#F9E4FE"},pink:{0:"#170911",50:"#1D0C18",100:"#271220",200:"#371830",300:"#462042",400:"#622C5C",500:"#F067AE",600:"#EC4899",700:"#F679BB",800:"#FFC2E1",900:"#FFE6F3"},rose:{0:"#17090E",50:"#1F0C13",100:"#2A121B",200:"#3A1B28",300:"#4B2636",400:"#673449",500:"#EE457B",600:"#E52E69",700:"#FF558A",800:"#FFA9C6",900:"#FFE0EA"}};function Rs(e){return {...e,red:e.danger,error:e.danger,green:e.success,success:e.success,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,teal:e.teal,cyan:e.cyan,blue:e.blue,indigo:e.indigo,purple:e.purple,violet:e.purple,magenta:e.magenta,fuchsia:e.magenta,pink:e.pink,rose:e.rose,gray:e.mono,grey:e.mono,neutral:e.mono}}var mn=(e,t)=>e==="light"?{appBg:t[0],panelBg:t[0],subtleBg:t[100],panelHover:t[50],subtleHover:t[200],overlayBg:"linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.525))",border:t[300]}:{appBg:t[0],panelBg:t[0],subtleBg:t[50],panelHover:t[50],subtleHover:t[100],overlayBg:"linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.75))",border:t[200]},Yn=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),qn=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),Qi=["danger","success","warning","info","amber","orange","yellow","lime","green","teal","cyan","blue","indigo","purple","magenta","pink","rose"];function ws(e){let t={};for(let n of Qi)t[n]=e[n]??"#FFFFFF";return t}var Ts={spacing:hs,radius:ys,fontSizes:xs,componentHeights:vs,fonts:Cs,neutral:Zo,palette:{...Rs(gs),primary:gs.mono},surface:mn("light",Zo),text:{...Yn(Zo),onColors:{primary:"#FFFFFF",...ws({yellow:"#000000"})}}},Ss={spacing:hs,radius:ys,fontSizes:xs,componentHeights:vs,fonts:Cs,neutral:er,palette:{...Rs(bs),primary:bs.mono},surface:mn("dark",er),text:{...qn(er),onColors:{primary:"#000000",...ws({yellow:"#000000",lime:"#000000"})}}};function ks(e){let t=e,n=new Set;return {get:()=>t,set:o=>{t=o,n.forEach(r=>r());},subscribe:o=>(n.add(o),()=>n.delete(o))}}var Ps={red:"danger",error:"danger",green:"success",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},fn=e=>Ps[e]??e;function St(e){let t={...e};return Object.entries(Ps).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Ms=ie.createContext(null),As=ie.createContext(null),Ns=ie.createContext({setMode:()=>{},toggleMode:()=>{}}),Ds=ie.createContext({setPrimary:()=>{}}),Hs=ie.createContext(null);function j(){return useTheme()}function tl(){let e=ie.useContext(Ms);if(!e)throw new Error("useColorModeValue must be used within ThemeProvider");return ie.useSyncExternalStore(e.subscribe,e.get,e.get)}function Yf(){return useContext(Ns)}function nl(){let e=ie.useContext(As);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=ie.useSyncExternalStore(e.subscribe,e.get,e.get),n=useContext(Ds).setPrimary;return {primary:t,setPrimary:n}}function qf(e){let t=ie.useContext(Hs);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let n=tl(),{primary:o}=nl(),r=ie.useMemo(()=>{let i=n==="light"?t.light:t.dark,a=i.palette[fn(o)]??i.palette.primary,l=St(i.text.onColors)[fn(o)]??nr(a[600]);return {...i,palette:{...i.palette,primary:a},text:{...i.text,onColors:{...St(i.text.onColors),primary:l,[fn(o)]:l,[o]:l}}}},[t,n,o]);return e?e(r):r}function Jn(e,t){return t?{...e,spacing:{...e.spacing,...t.spacing??{}},radius:{...e.radius,...t.radius??{}},fontSizes:{...e.fontSizes,...t.fontSizes??{}},componentHeights:{...e.componentHeights,...t.componentHeights??{}},fonts:{...e.fonts,...t.fonts??{}},palette:{...e.palette,...t.palette??{}},neutral:t.neutral??e.neutral,surface:{...e.surface,...t.surface??{}},text:{...e.text,...t.text??{},onColors:{...e.text.onColors,...t.text?.onColors??{}}}}:e}function nr(e){let t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16),i=l=>{let s=l/255;return s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)};return .2126*i(n)+.7152*i(o)+.0722*i(r)>.53?"#000":"#FFF"}function Is(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function tr(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Zn(e,t,n){let o=[],r=l=>l.startsWith("var(")?l.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():l;o.push(`--pf-font-sans:${r(e.fonts.sans)};`),o.push(`--pf-font-mono:${r(e.fonts.mono)};`),o.push(`--pf-text-primary:${e.text.primary};`),o.push(`--pf-text-secondary:${e.text.secondary};`),o.push(`--pf-text-muted:${e.text.muted};`),Object.entries(e.text.onColors).forEach(([l,s])=>o.push(`--pf-text-on-${l}:${s};`)),Object.entries(e.spacing).forEach(([l,s])=>o.push(`--pf-space-${l}:${typeof s=="number"?`${s}px`:s};`)),Object.entries(e.radius).forEach(([l,s])=>o.push(`--pf-radius-${l}:${typeof s=="number"?`${s}px`:s};`)),Object.entries(e.fontSizes).forEach(([l,s])=>o.push(`--pf-fontSize-${l}:${typeof s=="number"?`${s}px`:s};`)),Object.entries(e.componentHeights).forEach(([l,s])=>o.push(`--pf-cmph-${l}:${typeof s=="number"?`${s}px`:s};`)),Object.entries(e.neutral).forEach(([l,s])=>o.push(`--pf-neutral-${l}:${s};`)),o.push(`--pf-surface-appBg:${e.surface.appBg};`),o.push(`--pf-surface-panelBg:${e.surface.panelBg};`),o.push(`--pf-surface-subtleBg:${e.surface.subtleBg};`),o.push(`--pf-surface-panelHover:${e.surface.panelHover};`),o.push(`--pf-surface-subtleHover:${e.surface.subtleHover};`),o.push(`--pf-surface-overlayBg:${e.surface.overlayBg};`),o.push(`--pf-surface-border:${e.surface.border};`),o.push("--pf-focus-main:var(--pf-neutral-400);"),o.push(n==="dark"?"--pf-focus-soft:var(--pf-neutral-200);":"--pf-focus-soft:var(--pf-neutral-300);"),Object.entries(e.palette).forEach(([l,s])=>{Object.entries(s).forEach(([c,d])=>{o.push(`--pf-palette-${l}-${c}:${d};`);});});let i="300";Object.keys(e.palette).forEach(l=>{o.push(`--pf-focus-${l}-main: var(--pf-palette-${l}-${i});`),o.push(`--pf-focus-${l}-soft: transparent;`);}),[0,50,100,200,300,400,500,600,700,800,900].forEach(l=>o.push(`--pf-primary-${l}:var(--pf-palette-${t}-${l});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft:transparent;");let a=e.text.onColors[t]??(()=>{let s=(e.palette[t]?.["600"]??e.palette.primary[600]).replace("#",""),c=parseInt(s.slice(0,2),16),d=parseInt(s.slice(2,4),16),m=parseInt(s.slice(4,6),16),g=b=>{let C=b/255;return C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4)};return .2126*g(c)+.7152*g(d)+.0722*g(m)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${a};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function Qn(e,t,n){return Zn(e,t,n).join("")}var Jf=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let i=!!r,a=t?.primaryKey??"primary",l=ie.useMemo(()=>ks("light"),[]),s=ie.useMemo(()=>ks(a),[a]),c=useRef(null),d=useRef(0),m=useRef(r??"__root__");ie.useLayoutEffect(()=>{let w=0,E=c.current;for(;E&&E!==document.body;)E.hasAttribute("data-pfui-scope")&&w++,E=E.parentElement;d.current=w;},[r]);let g=useMemo(()=>{let w=Jn(Ts,t),E=Jn(w,t?.light),$=t?.light?.primaryKey??a,I=fn($),H=E.palette.primary??E.palette[I]??E.palette.mono,k=St({...Yn(E.neutral).onColors,...E.text.onColors}),F=k[I]??nr(H[600]),B=t?.surface||t?.light?.surface?E.surface:mn("light",E.neutral),W={...t?.text||t?.light?.text?E.text:Yn(E.neutral),onColors:St({...k,primary:F,[I]:F})};return {...E,palette:{...E.palette,primary:H},surface:B,text:W}},[t,a]),u=useMemo(()=>{let w=Jn(Ss,t),E=Jn(w,t?.dark),$=t?.dark?.primaryKey??a,I=fn($),H=E.palette.primary??E.palette[I]??E.palette.mono,k=St({...qn(E.neutral).onColors,...E.text.onColors}),F=k[I]??nr(H[600]),B=t?.surface||t?.dark?.surface?E.surface:mn("dark",E.neutral),W={...t?.text||t?.dark?.text?E.text:qn(E.neutral),onColors:St({...k,primary:F,[I]:F})};return {...E,palette:{...E.palette,primary:H},surface:B,text:W}},[t,a]),b=useRef(null),C=useRef(null),R=ie.useInsertionEffect||ie.useLayoutEffect,y=useRef((()=>{if(!i)try{let w=JSON.parse(localStorage.getItem(o)||"null");if(w?.mode==="light"||w?.mode==="dark")return w.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),p=ie.useRef(false),f=useCallback(()=>{let w=tr(r);Is(C,i?`pfui-guard-${r}`:"pfui-guard-root"),C.current&&(C.current.textContent=`${w} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{C.current&&(C.current.textContent="");}));},[r,i]);R(()=>{Is(b,i?`pfui-vars-${r}`:"pfui-vars-root");let w=t?.light?.primaryKey??t?.primaryKey??a,E=t?.dark?.primaryKey??t?.primaryKey??a,$=tr(r),I=Qn(g,w,"light"),H=Qn(u,E,"dark");if(b.current&&(b.current.textContent=`${$}.pf-light{${I}}
2
- ${$}.pf-dark{${H}}`+(i?`
3
- ${$}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),!p.current){p.current=true;let k=i?c.current:document.documentElement;k?.classList?.toggle("pf-dark",y.current==="dark"),k?.classList?.toggle("pf-light",y.current!=="dark"),l.set(y.current);}},[g,u,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,i,a,l]);let x=useCallback(()=>{window.__pfuiActiveScope={id:m.current,depth:d.current,ts:Date.now()};},[]),S=useCallback(()=>{let w=i?c.current:document.documentElement,E={capture:true},$=()=>x();return w?.addEventListener("pointerdown",$,E),w?.addEventListener("mouseenter",$,E),w?.addEventListener("focusin",$,E),w?.addEventListener("keydown",$,E),()=>{w?.removeEventListener("pointerdown",$,E),w?.removeEventListener("mouseenter",$,E),w?.removeEventListener("focusin",$,E),w?.removeEventListener("keydown",$,E);}},[i,x]),v=useCallback(w=>{let E=window.__pfuiActiveScope,$=E&&Date.now()-E.ts<1500;if(!E||!$||E.id!==m.current)return;let I=l.get(),H=s.get(),F=Zn(I==="light"?g:u,H,I).join("");w.style.cssText+=`;${F}`,w.classList.toggle("pf-light",I==="light"),w.classList.toggle("pf-dark",I==="dark"),w.setAttribute("data-pfui-portal-owner",m.current);},[l,s,g,u]),M=w=>{if(w.getAttribute("data-floating-ui-portal")==="true"||w.getAttribute("data-radix-portal")==="true"||w.getAttribute("data-portal")==="true")return true;let E=w.getAttribute("role");if(E==="tooltip"||E==="dialog")return true;let $=window.getComputedStyle(w);return $.position==="fixed"||$.position==="absolute"},P=useCallback(()=>{let w=new MutationObserver(E=>{for(let $ of E)$.addedNodes.forEach(I=>{I instanceof HTMLElement&&(M(I)&&v(I),I.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(H=>v(H)));});});return w.observe(document.body,{childList:true,subtree:true}),()=>w.disconnect()},[v]);ie.useEffect(()=>{let w=S(),E=P();return ()=>{w(),E();}},[S,P]);let z=useCallback(w=>{let E=i?c.current:document.documentElement,$=s.get(),H=Zn(w==="light"?g:u,$,w).join("");E&&(E.style.cssText+=`;${H}`,E.classList.toggle("pf-light",w==="light"),E.classList.toggle("pf-dark",w==="dark"));},[i,g,u,s]),D=useCallback(w=>{let E=s.get(),I=Zn(w==="light"?g:u,E,w).join("");document.querySelectorAll(`[data-pfui-portal-owner="${m.current}"]`).forEach(H=>{H.style.cssText+=`;${I}`,H.classList.toggle("pf-light",w==="light"),H.classList.toggle("pf-dark",w==="dark");});},[g,u,s]),N=useCallback(w=>{if(l.get()!==w&&(f(),l.set(w),z(w),D(w),!i))try{let E=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...E,mode:w}));}catch{}},[l,i,o,f,z,D]),A=useCallback(()=>N(l.get()==="light"?"dark":"light"),[N,l]),T=useCallback(w=>{s.set(w);let E=tr(r),$=Qn(g,w,"light"),I=Qn(u,w,"dark");b.current&&(b.current.textContent=`${E}.pf-light{${$}}
4
- ${E}.pf-dark{${I}}`+(i?`
5
- ${E}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),f();let H=l.get();if(z(H),D(H),!i)try{let k=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...k,primary:w}));}catch{}},[g,u,r,i,l,s,f,z,D]),L=jsx(Hs.Provider,{value:{light:g,dark:u},children:jsx(Ms.Provider,{value:l,children:jsx(As.Provider,{value:s,children:jsx(Ns.Provider,{value:{setMode:N,toggleMode:A},children:jsx(Ds.Provider,{value:{setPrimary:T},children:jsx(ThemeProvider,{theme:ol(g),children:e})})})})})});return i?jsx("div",{ref:c,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:L}):jsx("div",{ref:c,children:L})};function ol(e){let t=(c,d)=>Object.fromEntries(Object.keys(c).map(m=>[m,d(m)])),n=t(e.spacing,c=>`var(--pf-space-${c})`),o=t(e.radius,c=>`var(--pf-radius-${c})`),r=t(e.fontSizes,c=>`var(--pf-fontSize-${c})`),i=t(e.componentHeights,c=>`var(--pf-cmph-${c})`),a={sans:"var(--pf-font-sans)",mono:"var(--pf-font-mono)"},l=t(e.neutral,c=>`var(--pf-neutral-${c})`),s={};return Object.keys(e.palette).forEach(c=>{s[c]={},Object.keys(e.palette[c]).forEach(d=>{s[c][d]=`var(--pf-palette-${c}-${d})`;});}),s.primary=Object.fromEntries(["0","50","100","200","300","400","500","600","700","800","900"].map(c=>[c,`var(--pf-primary-${c})`])),{...e,spacing:n,radius:o,fontSizes:r,componentHeights:i,fonts:a,neutral:l,palette:s,surface:{appBg:"var(--pf-surface-appBg)",panelBg:"var(--pf-surface-panelBg)",subtleBg:"var(--pf-surface-subtleBg)",panelHover:"var(--pf-surface-panelHover)",subtleHover:"var(--pf-surface-subtleHover)",overlayBg:"var(--pf-surface-overlayBg)",border:"var(--pf-surface-border)"},text:{primary:"var(--pf-text-primary)",secondary:"var(--pf-text-secondary)",muted:"var(--pf-text-muted)",onColors:Object.fromEntries(Object.keys(St(e.text.onColors)).map(c=>[c,`var(--pf-text-on-${c})`]))}}}var Bs=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ls=(e,t)=>{let n=Bs(e,t);return n==="neutral"?{soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"}:t==="primary"?{soft:"var(--pf-focus-accent-soft)",main:"var(--pf-focus-accent-main)"}:{soft:`var(--pf-focus-${n}-soft, transparent)`,main:`var(--pf-focus-${n}-main)`}};function le(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let o=Bs(e,t?.color),{soft:r,main:i}=Ls(e,t?.color),a=t?.outlineWidth??(o==="primary"||o==="danger"?3.5:1.5),l=t?.haloWidth??3,s=t?.offset??(o==="primary"||o==="danger"?-1.5:-a),c=t?.mode==="always"?"&:focus":"&:focus-visible",d={outline:"1px solid transparent",boxShadow:"0 0 0 0 transparent",outlineOffset:s,transition:"box-shadow .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",":root.pf-mode-switching &":{transition:"none !important"},"&[disabled], &[aria-disabled='true'], &[data-disabled='true']":{outline:"0 !important",boxShadow:"none !important",outlineOffset:0}};return d[c]={boxShadow:`0 0 0 ${l}px ${r}`,outline:`${a}px solid ${i}`,outlineOffset:s,zIndex:1e4},css(d)}}function to(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ls(e,t?.color),i=t?.outlineWidth??1.5,a=t?.haloWidth??3,l=t?.offset??-i,s=t?.mode==="always"?"&:focus-within":"&:has(:focus-visible)",c={outline:"1.5px solid transparent",boxShadow:"0 0 0 0 transparent",outlineOffset:l,position:"relative",transition:"box-shadow .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",":root.pf-mode-switching &":{transition:"none !important"},"&[disabled], &[aria-disabled='true'], &[data-disabled='true']":{outline:"0 !important",boxShadow:"none !important",outlineOffset:0}};return c[s]={boxShadow:`0 0 0 ${a}px ${o}`,outline:`${i}px solid ${r}`,outlineOffset:l,zIndex:1e3},css(c)}}var Os=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ws=e=>{let t=e.type;return t?.__PFUI_SLOT||t?.displayName||t?.name||""},js=({expanded:e,defaultExpanded:t=false,onChange:n,className:o,variant:r="subtle",disabled:i=false,width:a,css:l,children:s})=>{let c=j(),d=useId(),m=c.radius?.md,g=c.text,u=c.componentHeights?.border??1,b=Os(u)??"1px",C=e!==void 0,[R,h]=useState(!!t),y=C?!!e:R,p=le(),[f,x]=useState(0),[S,v]=useState(false),M=useRef(null),P=()=>{i||(C?n?.(!e):h(k=>{let F=!k;return n?.(F),F}));},z=ie.Children.toArray(s).filter(k=>isValidElement(k)),D=z.findIndex(k=>Ws(k)==="AccordionSummary"),N=z.findIndex(k=>Ws(k)==="AccordionDetails");D===-1&&z.length&&(D=0),N===-1&&(N=z.findIndex((k,F)=>F!==D),N===-1&&z.length>=2&&(N=1));let A=z[D]??null,T=z[N]??null,L=r==="subtle"?c.surface.subtleBg:r==="outlined"?c.surface.panelBg:"transparent",w=css({backgroundColor:L,color:g.primary,borderRadius:m,outline:r==="outlined"?`${b} solid ${c.surface.border}`:`${b} solid transparent`,outlineOffset:`-${b}`,marginBottom:c.spacing.sm,maxWidth:a!=null?Os(a):void 0,overflow:"hidden",boxSizing:"border-box",cursor:i?"not-allowed":"default",opacity:i?.55:1});useLayoutEffect(()=>{let k=M.current;k&&x(k.scrollHeight);},[y,s]),useEffect(()=>{let k=M.current;if(!k)return;let F=new ResizeObserver(()=>x(k.scrollHeight));return F.observe(k),()=>F.disconnect()},[]),useEffect(()=>{f>0&&!S&&v(true);},[f,S]);let E=css({maxHeight:y?f||"none":0,overflow:y&&!S?"visible":"hidden",transition:S?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:S?"max-height":void 0}),$=css({opacity:y?1:0,transform:y?"translateY(0)":"translateY(1rem)",transition:S?"transform 0.28s ease, opacity 0.28s ease":"none",pointerEvents:y?"auto":"none"}),I=A&&cloneElement(A,{...typeof A.props=="object"&&A.props?A.props:{},expanded:y,disabled:i,onClick:P,role:"presentation",tabIndex:-1}),H=T&&cloneElement(T,typeof T.props=="object"&&T.props?{...T.props}:{});return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-expanded":y?"true":"false",css:[p(),w,l],tabIndex:i?-1:0,role:"button","aria-expanded":y,"aria-controls":d,"aria-disabled":i||void 0,onKeyDown:k=>{i||(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),P());},children:[jsx("div",{tabIndex:-1,className:"plainframe-ui-accordion-summary-wrapper",children:I}),jsx("div",{id:d,"aria-hidden":!y,className:"plainframe-ui-accordion-details-clip",css:E,tabIndex:-1,children:jsx("div",{ref:M,className:"plainframe-ui-accordion-details-inner",css:$,children:H})})]})};js.displayName="Accordion";var ar=forwardRef(({children:e,expandIcon:t,onClick:n,expanded:o,disabled:r,className:i,noExpandIcon:a,expandIconPosition:l="right",css:s},c)=>{let d=j(),m=d.fontSizes.md,g=20,u=10,b=d.spacing.lg,C=d.spacing.md,R=Number(d.componentHeights?.md),h=d.neutral,y=d.text,p=r?y.secondary:d.text.secondary,f=css({display:"flex",alignItems:"center",cursor:r?"not-allowed":"pointer",outline:"none",userSelect:"none",fontWeight:500,minHeight:R,padding:`${C} ${b}`,gap:u,fontSize:m,color:r?h[500]:y.primary}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),S=css({marginRight:8,marginLeft:-4,lineHeight:0}),v=css({marginLeft:14,marginRight:-4,lineHeight:0}),M=css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:o?"rotate(180deg)":"rotate(0deg)"});return jsxs("div",{ref:c,role:"button","aria-expanded":!!o,"aria-disabled":r||void 0,tabIndex:-1,className:["plainframe-ui-accordion-summary",i||""].join(" ").trim(),css:[f,s],onClick:r?void 0:n,onKeyDown:P=>{!r&&(P.key===" "||P.key==="Enter")&&(P.preventDefault(),n?.(P));},children:[!a&&l==="left"&&jsx("span",{className:"plainframe-ui-accordion-expander-left",css:[S,M],children:t??jsx(ChevronDown,{strokeWidth:2.125,css:{width:g,height:g},color:p})}),jsx("span",{className:"plainframe-ui-accordion-content",css:x,children:e}),!a&&l==="right"&&jsx("span",{className:"plainframe-ui-accordion-expander-right",css:[v,M],children:t??jsx(ChevronDown,{strokeWidth:2.125,css:{width:g,height:g},color:p})})]})});ar.__PFUI_SLOT="AccordionSummary";ar.displayName="AccordionSummary";var ir=({children:e,className:t,css:n})=>{let o=j(),r=o.fontSizes.md,i=o.spacing.lg,a="0.15rem",l=o.spacing.md,s=css({padding:`${a} ${i} ${l} ${i}`,fontSize:r,boxSizing:"border-box",minHeight:0});return jsx("div",{className:["plainframe-ui-accordion-details",t||""].join(" ").trim(),css:[s,n],tabIndex:-1,children:e})};ir.__PFUI_SLOT="AccordionDetails";ir.displayName="AccordionDetails";var yl=e=>isValidElement(e),xl=e=>yl(e)?e.type?.displayName||e.type?.name:void 0,Us=e=>xl(e)==="Accordion",vl=e=>typeof e=="number"?`${e}px`:e,Cl=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,_s=({children:e,attached:t=false,variant:n,exclusive:o=false,expandedIndex:r,defaultExpandedIndex:i,onExpandedIndexChange:a,disabled:l=false,width:s,className:c,role:d="group",css:m})=>{let g=j(),u=Children.toArray(e),b=u.filter(Us),C=b.length,R=o&&r!==void 0,[h,y]=ie.useState(()=>{if(!o)return null;if(i!==void 0)return i;for(let N=0;N<b.length;N++){let A=b[N].props;if(A.expanded||A.defaultExpanded)return N}return null}),p=o?R?r??null:h:null,f=Cl(g.componentHeights?.border,1),x=g.surface.border,S=g.radius.md,v=n,M=v==="outlined",P=css({display:"flex",flexDirection:"column",width:s!=null?vl(s):"auto",gap:t?0:g.spacing.sm,border:t&&M?`${f} solid ${x}`:"none",borderRadius:t&&M?S:void 0,background:t&&M?g.surface.panelBg:"transparent",overflow:t&&M?"hidden":"visible"}),z=0,D=[];return u.forEach((N,A)=>{if(!Us(N)){D.push(N);return}let T=N.props,L=z++,w=L===0,E=L===C-1,$=v??T.variant,I=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:w?S:0,borderTopRightRadius:w?S:0,borderBottomLeftRadius:E?S:0,borderBottomRightRadius:E?S:0}):css({width:"100%",marginBottom:0}),H=!w&&C>1&&t?css({borderTop:`${f} solid ${x}`}):null,k=M?css({borderLeft:"0 !important",borderRight:"0 !important",borderBottom:"0 !important",outline:"0 !important"}):null,F={variant:$,disabled:l||!!T.disabled,width:"100%",css:[T.css,I,k,H],className:[T.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let B=T.onChange,_=p===L;F.expanded=_,F.defaultExpanded=void 0,F.onChange=W=>{let O=W?L:null;R||y(O),a?.(O),B?.(W);};}D.push(cloneElement(N,{...T,...F,key:N?.key??A}));}),jsx("div",{role:d,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",c||""].join(" ").trim(),css:[P,m],children:D})};_s.displayName="AccordionGroup";var pt=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Sl(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){if(["xs","sm","md","lg","xl"].includes(e)){let n=(t.spacing&&t.spacing[e])??(t.space&&t.space[e]);return pt(n??e)}return e}}}function El(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 pt(n??e)}return e}}}var Xs=({children:e,anchorOrigin:t={vertical:"bottom",horizontal:"center"},padding:n,radius:o,gap:r,offset:i,offsetX:a,offsetY:l,shadow:s=true,width:c,height:d,open:m=true,unstyled:g=false,css:u,className:b,containerCss:C,containerClassName:R})=>{let h=j(),y=useRef(null);useEffect(()=>{let E=y.current;E&&(m?(E.removeAttribute("inert"),E.removeAttribute("aria-hidden")):(E.contains(document.activeElement)&&document.activeElement?.blur?.(),E.setAttribute("inert",""),E.setAttribute("aria-hidden","true")));},[m]);let p=t.horizontal??"center",f=t.vertical??"bottom",x=h.componentHeights?.border??1,S=typeof x=="number"?`${x}px`:x,v=h.surface.panelBg,M=`${S} solid ${h.surface.border}`,P=a??i??h.spacing.lg,z=l??i??h.spacing.lg,D=css({position:"fixed",insetInline:0,top:0,bottom:0,display:"flex",justifyContent:p==="left"?"flex-start":p==="right"?"flex-end":"center",alignItems:f==="top"?"flex-start":f==="bottom"?"flex-end":"center",width:"100%",zIndex:1e3,pointerEvents:"none"}),N,A;p==="left"?(N="translateX(-100%) scale(0.98)",A="translateX(0) scale(1)"):p==="right"?(N="translateX(100%) scale(0.98)",A="translateX(0) scale(1)"):f==="top"?(N="translateY(-100%) scale(0.98)",A="translateY(0) scale(1)"):f==="bottom"?(N="translateY(100%) scale(0.98)",A="translateY(0) scale(1)"):(N="scale(0.95)",A="scale(1)");let T=Sl(n,h)??h.spacing.sm,L=El(o,h)??h.radius.lg,w=css({marginInline:pt(P),marginTop:f==="top"||f==="center"?pt(z):void 0,marginBottom:f==="bottom"||f==="center"?pt(z):void 0,padding:g?void 0:T,background:g?"transparent":v,border:g?"none":M,borderRadius:g?0:L,boxShadow:g||!s?"none":"0 20px 40px rgba(0,0,0,.08), 0 6px 14px rgba(0,0,0,.06)",display:"flex",alignItems:"center",gap:g?0:r??h.spacing.xs,width:c?pt(c):"auto",height:d?pt(d):"auto",maxWidth:`calc(100% - (${pt(P)||"24px"} * 2))`,pointerEvents:m?"auto":"none",transition:"transform 0.25s ease, opacity 0.25s ease",transform:m?A:N,opacity:m?1:0,"& > .plainframe-ui-textfield, & > .plainframe-ui-textarea, & > .plainframe-ui-codefield":{flex:"1 1 auto",minWidth:0,width:"auto",maxWidth:"none"},"& > .plainframe-ui-textfield .plainframe-ui-textfield-surface, & > .plainframe-ui-textarea .plainframe-ui-textarea-surface":{width:"100%"},"& > *:not(.plainframe-ui-textfield):not(.plainframe-ui-textarea):not(.plainframe-ui-codefield)":{flex:"0 0 auto"}});return jsx("div",{className:["plainframe-ui-action-bar-container",R||""].join(" ").trim(),css:[D,C],children:jsx("div",{ref:y,className:["plainframe-ui-action-bar",b||""].join(" ").trim(),css:[w,u],children:e})})};Xs.displayName="ActionBar";var Ys=createContext(null),qs=()=>{let e=useContext(Ys);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},Dl=forwardRef(function({intent:t="neutral",variant:n="soft",icon:o,actionButton:r,onClose:i,width:a="100%",size:l="md",className:s,css:c,children:d,...m},g){let u=j(),b=useMemo(()=>{let D={sm:{paddingX:u.spacing?.md??12,paddingY:"0.6rem",gap:8,radius:u.radius?.md??8,fontSize:u.fontSizes?.sm??"0.875rem",titleWeight:600,iconSize:16},md:{paddingX:u.spacing?.lg??16,paddingY:"0.9rem",gap:8,radius:u.radius?.md??8,fontSize:u.fontSizes?.md??"1rem",titleWeight:600,iconSize:20},lg:{paddingX:u.spacing?.xl??20,paddingY:"1.1rem",gap:10,radius:u.radius?.md??8,fontSize:u.fontSizes?.lg??"1.125rem",titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(l)?D[l]:D.md},[l,u.fontSizes,u.radius,u.spacing]),C=u.palette??{},R=u.neutral??{},h=useMemo(()=>{let N=(I=>I==="danger"?C.danger??C.error??R:I==="warning"?C.warning??R:I==="success"?C.success??R:I==="info"?C.info??C.primary??R:R)(t),A=N?.[50]??R[50],T=N?.[300]??R[300],L=N?.[600]??N?.[500]??R[600],w=N?.[700]??L,E=N?.[800]??u.text?.primary??"#000",$=u.text?.onColors?.[t]??u.text?.onColors?.primary??u.text?.primary??"#fff";return n==="filled"?{bg:L,fg:$,border:void 0,iconColor:$}:n==="outlined"?{bg:A,fg:E,border:`1px solid ${T}`,iconColor:E}:n==="ghost"?{bg:"transparent",fg:w,border:"none",iconColor:w}:{bg:A,fg:E,border:void 0,iconColor:w}},[t,n,R,C,u.text]),y=t==="danger"||t==="warning"?"alert":"status",p=useMemo(()=>o??(t==="danger"?jsx(CircleAlert,{css:{width:b.iconSize,height:b.iconSize},color:h.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:b.iconSize,height:b.iconSize},color:h.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:b.iconSize,height:b.iconSize},color:h.iconColor}):jsx(Info,{css:{width:b.iconSize,height:b.iconSize},color:h.iconColor})),[o,t,b.iconSize,h.iconColor]),f=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${b.paddingY} ${b.paddingX}`,gap:b.gap,borderRadius:b.radius,backgroundColor:h.bg,color:h.fg,border:h.border,fontSize:b.fontSize,fontWeight:500,width:typeof a=="number"?`${a}px`:a}),[h.bg,h.border,h.fg,b.fontSize,b.gap,b.paddingX,b.paddingY,b.radius,a]),x=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:b.gap,minWidth:0,flex:1}),[b.gap]),S=useMemo(()=>css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",color:h.iconColor,flex:"0 0 auto"}),[h.iconColor]),v=useMemo(()=>css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),[]),M=useMemo(()=>css({display:"flex",alignItems:"center",gap:b.gap,marginLeft:b.gap,flex:"0 0 auto"}),[b.gap]),P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none",background:"transparent",padding:0,cursor:i?"pointer":"default",lineHeight:0,color:h.fg}),[h.fg,i]),z=useMemo(()=>({fg:h.fg,iconColor:h.iconColor,s:b}),[h.fg,h.iconColor,b]);return jsx(Ys.Provider,{value:z,children:jsxs("div",{ref:g,role:y,"aria-atomic":"true",className:["plainframe-ui-alert",`plainframe-ui-alert-${t}`,`plainframe-ui-alert-${n}`,s||""].join(" ").trim(),css:[f,c],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:x,children:[p&&jsx("span",{className:"plainframe-ui-alert-icon",css:S,children:p}),jsx("div",{className:"plainframe-ui-alert-content",css:v,children:d})]}),(r||i)&&jsxs("div",{className:"plainframe-ui-alert-actions",css:M,children:[r,i&&jsx("button",{type:"button","aria-label":"Close alert",onClick:i,className:"plainframe-ui-alert-close",css:P,children:jsx(X,{size:b.iconSize-2})})]})]})})}),Hl=forwardRef(function({children:t,className:n,css:o,...r},i){let{fg:a,s:l}=qs(),s=useMemo(()=>css({color:a,fontWeight:l.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[a,l.titleWeight]);return jsx("span",{ref:i,className:["plainframe-ui-alert-title",n||""].join(" ").trim(),css:[s,o],...r,children:t})}),Bl=forwardRef(function({children:t,className:n,css:o,...r},i){let{fg:a}=qs(),l=useMemo(()=>css({color:a,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[a]);return jsx("span",{ref:i,className:["plainframe-ui-alert-desc",n||""].join(" ").trim(),css:[l,o],...r,children:t})});var dr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,ft=e=>e==null?[]:Array.isArray(e)?e:[e],gt=(...e)=>css(e.filter(Boolean));function Qs(e,t,n="currentColor"){if(!isValidElement(e))return e;let o=e.props||{},r={};return o.size==null&&(r.size=t),o.color==null&&(r.color=n),o.style?.fontSize==null&&(r.style={...o.style||{},fontSize:t}),cloneElement(e,{...o,...r})}var no=forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:i,error:a,helperText:l,disabled:s=false,fullWidth:c=false,width:d=250,size:m="md",variant:g="subtle",rounded:u=false,startIcon:b,endIcon:C,togglePasswordVisible:R=false,showClear:h,type:y="text",step:p,focusRingMode:f="always",className:x,wrapperCss:S,inputCss:v,labelCss:M,helperRowCss:P,helperTextCss:z,startIconCss:D,endIconCss:N,css:A,onBlur:T,onFocus:L,onKeyDown:w,autoFocus:E,name:$,id:I,tabIndex:H,autoComplete:k,readOnly:F,required:B,maxLength:_},W){let O=j(),q=to(),Q=useId(),J=useMemo(()=>{let re={sm:{fontSize:O.fontSizes.md,minHeight:O.componentHeights.sm,labelFont:O.fontSizes.sm,helperFont:O.fontSizes.sm,width:"12.5rem",paddingY:0,paddingX:O.spacing.md,iconSize:O.fontSizes.sm,codeFontSize:21},md:{fontSize:O.fontSizes.md,minHeight:O.componentHeights.md,labelFont:O.fontSizes.md,helperFont:O.fontSizes.sm,width:"15rem",paddingY:0,paddingX:O.spacing.md,iconSize:O.fontSizes.sm,codeFontSize:24},lg:{fontSize:O.fontSizes.md,minHeight:O.componentHeights.lg,labelFont:O.fontSizes.lg,helperFont:O.fontSizes.md,width:"18.125rem",paddingY:0,paddingX:O.spacing.md,iconSize:O.fontSizes.sm,codeFontSize:28}},xe=["sm","md","lg"].includes(m)?m:"md";return re[xe]},[m,O]),de=O.neutral,K=O.text,ne=y==="number",me=y==="password",pe=n!==void 0,[fe,oe]=useState(o),ee=pe?n:fe,se=useCallback(re=>{pe||oe(re),r?.(re);},[pe,r]),ge=/^-?\d*(?:[.,]\d*)?$/,ve=ne&&(p!=null&&String(p).includes(".")||/[.,]/.test(ee??"")),Se=ne?ve?"decimal":"numeric":void 0,De=ne?ve?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Pe=useCallback(re=>{(re===""||ge.test(re))&&se(re);},[se]),te=s?de[200]:g==="outlined"?O.surface.panelBg:g==="subtle"?O.surface.subtleBg:"transparent",ye=O.componentHeights.border,V=g==="outlined"?`${ye} solid ${a?O.palette.danger[600]:O.surface.border}`:"none",Y=gt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:c?"100%":d!=null?dr(d):void 0,flex:"0 0 auto",fontWeight:500}),X$1=useMemo(()=>gt({fontSize:J.labelFont,fontWeight:500,color:a?O.palette.danger?.[700]??K.primary:s?de[500]:K.primary,marginBottom:4,display:"inline-block"},...ft(M)),[J.labelFont,a,s,de,K,O.palette.danger,M]),ae=useMemo(()=>gt({display:"flex",alignItems:"center",gap:O.spacing.sm,padding:`${dr(J.paddingY)} ${dr(J.paddingX)}`,background:te,border:V,borderRadius:u?O.radius.full:O.radius.md,minHeight:J.minHeight,boxSizing:"border-box",width:"100%",cursor:s?"not-allowed":"text",opacity:s?.65:1,transition:"box-shadow .18s, border-color .16s"},...ft(S),...ft(A)),[O,J.minHeight,J.paddingX,J.paddingY,te,V,u,s,S,A]),Ee=useMemo(()=>gt({flex:1,minWidth:0,font:"inherit",fontWeight:500,fontSize:J.fontSize,color:s?de[500]:K.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:s?"not-allowed":"text",appearance:ne?"textfield":"auto","&::placeholder":{color:K.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${K.primary} !important`,boxShadow:`0 0 0 1000px ${te} inset !important`,transition:"opacity 99999s ease-out",caretColor:K.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...ft(v)),[J.fontSize,s,de,K,ne,te,v]),$e=useMemo(()=>gt({display:"inline-flex",alignItems:"center",color:K.secondary,marginLeft:-3},...ft(D)),[K.secondary,D]),be=useMemo(()=>gt({display:"inline-flex",alignItems:"center",color:K.secondary,border:"none",background:"transparent",lineHeight:0,cursor:s?"not-allowed":"pointer",padding:0},...ft(N)),[K.secondary,s,N]),Ce=useMemo(()=>gt({minHeight:16,fontSize:J.helperFont,color:a?O.palette.danger?.[700]??K.secondary:K.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...ft(P)),[J.helperFont,a,O.palette.danger,K.secondary,P]),ln=useMemo(()=>gt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...ft(z)),[z]),cn=useRef(null),qo=useCallback(re=>{cn.current=re,W&&(typeof W=="function"?W(re):W.current=re);},[W]),Jo=useCallback(re=>{let xe=re.target.value;if(ne){Pe(xe);return}_&&xe.length>_||se(xe);},[ne,_,se,Pe]),[Lt,Gn]=useState(false),dn=useCallback(()=>{s||Gn(re=>!re);},[s]),un=useCallback(()=>{s||(se(""),cn.current?.focus());},[s,se]),ze=useMemo(()=>{let re=J.fontSize;if(typeof re=="number")return re;let xe=parseFloat(String(re));return Number.isFinite(xe)?xe:16},[J.fontSize]),Qo=useMemo(()=>b?jsx("span",{css:$e,children:Qs(b,ze)}):null,[b,$e,ze]),U=useMemo(()=>me&&R?jsx("button",{type:"button",css:be,onClick:xe=>{xe.stopPropagation(),dn();},tabIndex:-1,"aria-label":Lt?"Hide password":"Show password",disabled:s,children:Lt?jsx(Eye,{strokeWidth:2.5,size:ze}):jsx(EyeOff,{strokeWidth:2.5,size:ze})}):h&&ee&&ee.length>0&&!s?jsx("button",{type:"button",css:be,onClick:re=>{re.stopPropagation(),un();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:ze})}):C?jsx("span",{css:be,children:Qs(C,ze)}):null,[me,R,Lt,ze,be,s,h,ee,C,dn,un]),Z=l!=null?`${I??Q}-help`:void 0,ue=I??Q;return jsxs("div",{className:["plainframe-ui-textfield",x||""].join(" ").trim(),css:Y,children:[t&&jsx("label",{htmlFor:ue,className:"plainframe-ui-textfield-label",css:X$1,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[q({enabled:f!=="none"}),ae],onClick:re=>{re.target.closest("button,[role='button']")||cn.current?.focus();},"aria-invalid":!!a||void 0,children:[Qo,jsx("input",{ref:qo,id:ue,className:"plainframe-ui-textfield-input",css:Ee,type:me&&!Lt?"password":"text",inputMode:Se,pattern:De,value:ee,maxLength:ne?void 0:_,onChange:ne?re=>Pe(re.target.value):Jo,placeholder:i||"",disabled:s,onBlur:T,onFocus:L,onKeyDown:w,autoFocus:E,name:$,tabIndex:H,autoComplete:k,readOnly:F,required:B,"aria-invalid":!!a||void 0,"aria-describedby":Z}),U]}),l!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:Ce,children:jsx("span",{id:Z,className:"plainframe-ui-textfield-helper-text",css:ln,children:l})})]})});no.displayName="TextField";var so=ie.createContext("ghost"),Et=ie.createContext(false),yn=ie.createContext(0),ur=ie.createContext(void 0),ea=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:i=false,className:a,css:l,gap:s,children:c,label:d,...m},g){let u=j(),b=typeof u.spacing.xs=="number"?`${u.spacing.xs}px`:String(u.spacing.xs),C=t==="outlined"?u.surface.panelBg:t==="subtle"?u.surface.subtleBg??u.neutral[50]:"transparent",R=s===void 0?void 0:typeof s=="string"&&u.spacing[s]!==void 0?u.spacing[s]:s,h=i?void 0:css({boxSizing:"border-box",background:C,border:t==="outlined"?`${u.componentHeights.border} solid ${u.surface.border}`:"none",borderRadius:u.radius.lg,"--pfui-panel-pad":b,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:u.text.primary,width:typeof o=="number"?`${o}px`:o,maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",gap:R}),y=n==="sm";return jsx(Et.Provider,{value:y,children:jsx(so.Provider,{value:t,children:jsx(yn.Provider,{value:0,children:jsx(ur.Provider,{value:R,children:jsxs("div",{css:{display:"flex",flexDirection:"column",gap:u.spacing.sm},children:[d?jsx("div",{css:{width:"100%",textAlign:"left",maxWidth:o},children:jsx("span",{css:{display:"block",color:u.text.secondary,fontSize:u.fontSizes.sm,fontWeight:600,textTransform:"uppercase",letterSpacing:".04em",padding:typeof u.spacing.sm=="number"?`${u.spacing.sm}px`:u.spacing.sm,paddingTop:0},children:d})}):null,jsx("div",{ref:g,role:"menu","aria-label":d||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[h,l],...m,children:c})]})})})})})});ea.displayName="Menu";var ta=createContext(null),na=()=>{let e=useContext(ta);if(!e)throw new Error("SubMenu components must be used inside <SubMenu>.");return e},ec=({open:e,defaultOpen:t=false,onOpenChange:n,children:o})=>{let[r,i]=useState(()=>!!t),a=e!==void 0,l=a?!!e:r,s=d=>{a||i(d),n?.(d);},c=useContext(ur);return jsx(ta.Provider,{value:{open:l,setOpen:s},children:jsx("div",{className:"plainframe-ui-submenu-root",css:css({display:"flex",flexDirection:"column",gap:c,width:"100%"}),children:o})})},tc=({children:e,chevron:t,asChild:n=true})=>{let{open:o,setOpen:r}=na(),i=j(),a=css({display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 16px",width:16,height:16,lineHeight:0,marginLeft:6,pointerEvents:"none",color:i.text.secondary,transformOrigin:"50% 50%",backfaceVisibility:"hidden",willChange:"transform",transform:o?"rotate(0deg)":"rotate(-90deg)",transition:"transform 300ms cubic-bezier(.6,1.3,.5,1)","& > svg":{width:16,height:16,display:"block"}}),l=jsx("span",{className:"pfui-submenu-chevron",css:a,"aria-hidden":true,children:t??jsx(ChevronDown,{strokeWidth:2.5})}),s=c=>cloneElement(c,{...c.props,"data-subtrigger":"","data-open":o?"":void 0,"aria-expanded":o,endIcon:jsxs(Fragment,{children:[typeof c.props=="object"&&c.props&&"endIcon"in c.props?c.props.endIcon:null,l]}),onClick:d=>{typeof c.props=="object"&&c.props&&"onClick"in c.props&&typeof c.props.onClick=="function"&&c.props.onClick(d),!d?.defaultPrevented&&(d?.currentTarget?.tagName==="A"&&d.preventDefault(),r(!o));},onKeyDown:d=>{typeof c.props=="object"&&c.props&&typeof c.props.onKeyDown=="function"&&c.props.onKeyDown(d),!d.defaultPrevented&&((d.key==="Enter"||d.key===" ")&&(d.preventDefault(),r(!o)),d.key==="ArrowRight"&&(d.preventDefault(),r(true)),d.key==="ArrowLeft"&&(d.preventDefault(),r(false)));},onSelect:()=>r(!o)});return n&&isValidElement(e),s(e)},nc=({children:e,css:t})=>{let{open:n}=na(),o=useContext(yn),r=useContext(ur),i=useRef(null);useEffect(()=>{let s=i.current;if(!s)return;let c="a[href],button,input,select,textarea,summary,[contenteditable='true']",d="[role='menuitem'],[role='menuitemradio'],[role='menuitemcheckbox']",m=Array.from(s.querySelectorAll(c)),g=Array.from(s.querySelectorAll(d));n?(m.forEach(u=>{if(u.hasAttribute("data-pf-prev-tabindex")){let b=u.getAttribute("data-pf-prev-tabindex");b===""?u.removeAttribute("tabindex"):b!=null&&u.setAttribute("tabindex",b),u.removeAttribute("data-pf-prev-tabindex");}else u.removeAttribute("tabindex");}),g.forEach(u=>{u.hasAttribute("tabindex")?u.getAttribute("tabindex")==="-1"&&u.setAttribute("tabindex","0"):u.setAttribute("tabindex","0");})):(m.forEach(u=>{if(!u.hasAttribute("data-pf-prev-tabindex")){let b=u.getAttribute("tabindex");b!=null?u.setAttribute("data-pf-prev-tabindex",b):u.setAttribute("data-pf-prev-tabindex","");}u.setAttribute("tabindex","-1");}),g.forEach(u=>{u.setAttribute("tabindex","-1");}));},[n]);let a=css({display:"grid",gridTemplateRows:n?"1fr":"0fr",transition:"grid-template-rows 360ms cubic-bezier(.25,.8,.4,1)",overflow:"hidden",contain:"layout style",position:"relative"}),l=css({minHeight:0,width:"100%",display:"flex",flexDirection:"column",gap:r,margin:0,padding:0,opacity:n?1:0,transform:n?"translateY(0) scale(1)":"translateY(1rem) scale(0.95)",transition:"opacity 0.35s ease, transform 0.28s ease",pointerEvents:n?"auto":"none",willChange:"opacity, transform"});return jsx(yn.Provider,{value:o+1,children:jsx("div",{role:"group","data-open":n?"":void 0,className:"plainframe-ui-submenu-content",css:[css({width:"100%"}),t],children:jsx("div",{className:"plainframe-ui-submenu-clip",css:a,children:jsx("div",{ref:i,className:"plainframe-ui-submenu-inner",css:l,children:e})})})})};function gc(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var mr=(...e)=>t=>{for(let n of e)gc(n,t);},vn=0,ao=null,io=null,bc=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function hc(){if(!(typeof document>"u")){if(vn===0){let e=document.body;ao=e.style.overflow||"",io=e.style.paddingRight||"";let t=bc();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}vn+=1;}}function yc(){if(!(typeof document>"u")&&(vn>0&&(vn-=1),vn===0)){let e=document.body;ao!==null&&(e.style.overflow=ao),io!==null&&(e.style.paddingRight=io),ao=null,io=null;}}var Rn=createContext(null),wn=()=>{let e=useContext(Rn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},fr=createContext({allItemsTabbable:true}),lo=ie.createContext(null),gr=()=>useContext(lo);function xc(){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 br=()=>wn().activeIndex,Ut=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:i="md",children:a})=>{let[l,s]=useState(!!t),c=e??l,d=useCallback(S=>{e===void 0&&s(S),n?.(S);},[e,n]),m=useRef(null),g=useRef([]),[u,b]=useState(null),C=useRef(null),R=useCallback((S=120)=>{o==="hover"&&(window.clearTimeout(C.current??0),C.current=window.setTimeout(()=>d(false),S));},[o,d]),h=useCallback(()=>{C.current&&(window.clearTimeout(C.current),C.current=null);},[]);useEffect(()=>()=>h(),[h]),useEffect(()=>{if(!(!r||!c))return hc(),()=>yc()},[c,r]);let y=gr(),[p]=useState(()=>y??xc()),f=useMemo(()=>({open:c,setOpen:d,trigger:o,referenceRef:m,listRef:g,activeIndex:u,setActiveIndex:b,scheduleHoverClose:R,clearHoverClose:h}),[c,d,o,u,R,h]),x=i==="sm";return jsx(lo.Provider,{value:p,children:jsx(Et.Provider,{value:x,children:jsx(Rn.Provider,{value:f,children:a})})})};Ut.displayName="DropdownMenu";var _t=ie.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...i},a)=>{let{open:l,setOpen:s,trigger:c,referenceRef:d,listRef:m,setActiveIndex:g,scheduleHoverClose:u,clearHoverClose:b,activeIndex:C}=wn(),R=!!e&&isValidElement(t),h=R?t:null,y=h&&h.props&&typeof h.props=="object"&&"onKeyDown"in h.props?h.props.onKeyDown:void 0,p=h&&h.props&&typeof h.props=="object"&&"onClick"in h.props?h.props.onClick:void 0,{onKeyDown:f,onClick:x,...S}=i,v=useMemo(()=>mr(a,R&&typeof t.ref<"u"?t.ref:void 0,d),[a,R,t,d]),M=useCallback(()=>m.current.filter(Boolean),[m]),P=useCallback(T=>{let L=M();requestAnimationFrame(()=>L[T]?.focus());},[M]),z=useCallback(T=>{let w=M().length;if(T.key==="ArrowDown"||T.key==="ArrowUp"){if(!l){if(T.preventDefault(),s(true),w){let E=T.key==="ArrowDown"?0:w-1;g(E),P(E);}y?.(T),f?.(T);return}if(l&&w){T.preventDefault();let E=T.key==="ArrowDown"?1:-1,$=C??(T.key==="ArrowDown"?-1:w),I=Math.min(Math.max($+E,0),w-1);g(I),P(I),y?.(T),f?.(T);return}}if((T.key==="Enter"||T.key===" ")&&!l){T.preventDefault(),s(true),y?.(T),f?.(T);return}if(T.key==="Tab"&&l&&!T.shiftKey&&w){T.preventDefault(),g(0),P(0),y?.(T),f?.(T);return}y?.(T),f?.(T);},[l,s,C,g,y,f,M,P]),D=useCallback(T=>{c==="click"&&((T.nativeEvent?.composedPath?.()??[]).some(E=>{if(!E||!E.tagName)return false;let $=String(E.tagName).toUpperCase();if($==="INPUT"||$==="TEXTAREA"||E.isContentEditable)return true;let I=E.getAttribute?.("role");return I==="textbox"||I==="combobox"})||(T.stopPropagation(),s(!l))),p?.(T),x?.(T);},[c,l,s,p,x]),N=c==="hover"?{onMouseEnter:()=>{b(),s(true);},onMouseLeave:()=>{u();}}:{},A=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(R&&h){let T=h.props?.css;return cloneElement(h,{ref:v,tabIndex:h.props.tabIndex??0,className:[h.props.className,o].filter(Boolean).join(" ")||void 0,css:[T,A,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":l,onClick:D,onKeyDown:z,...N,...S})}return jsx("button",{ref:v,className:o,css:[css({display:"inline-block"}),A,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":l,onClick:D,onKeyDown:z,...N,...S,children:t})});_t.displayName="DropdownMenuTrigger";var kt=ie.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:i=8,sameWidth:a=false,width:l=200,height:s,maxHeight:c,unstyled:d=false,closeOnBlur:m=false,allItemsTabbable:g=true,className:u,css:b,children:C,exitPlacement:R,animateOnBusClose:h=true,gap:y,...p},f)=>{let{open:x,setOpen:S,referenceRef:v,scheduleHoverClose:M,clearHoverClose:P,setActiveIndex:z}=wn(),D=j(),N=gr();useEffect(()=>{if(!N)return;let V=N.registerCloser(()=>S(false));return ()=>{V&&V();}},[N,S]);let A=typeof o=="string"?parseFloat(o):o,T=typeof r=="string"?parseFloat(r):r,L=typeof i=="string"?parseFloat(i):i,w=`${t}${n==="center"?"":`-${n}`}`,E=useCallback(V=>({getBoundingClientRect:()=>{let Y=Math.round(V.x),X=Math.round(V.y);return {x:Y,y:X,left:Y,top:X,right:Y,bottom:X,width:0,height:0,toJSON:()=>({x:Y,y:X,left:Y,top:X,right:Y,bottom:X,width:0,height:0})}},contextElement:void 0}),[]),$=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let V=e;return E({x:V.x,y:V.y})},[e,E]),{refs:I,x:H,y:k,strategy:F,context:B,update:_}=useFloating({open:x,onOpenChange:S,placement:w,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:A??0,crossAxis:T??0}),flip({padding:L??8}),shift({padding:L??8}),size({apply({elements:V}){let Y=V.floating;Y.style.boxSizing="border-box",s!=null?Y.style.height=typeof s=="number"?`${s}px`:String(s):Y.style.removeProperty("height");}})]});useEffect(()=>{$?I.setReference($):v.current&&I.setReference(v.current);},[I,$,v]),useEffect(()=>{if(!x)return;let V=$||v.current,Y=I.floating.current;if(!(!V||!Y))return autoUpdate(V,Y,_)},[x,$,v,I,_]),useEffect(()=>{x&&!g&&z(0);},[x,g,z]),useEffect(()=>{if(!m||!x)return;let V=()=>{let Y=document.activeElement,X=v.current,ae=I.floating.current;Y&&(X?.contains(Y)||ae?.contains(Y)||S(false));};return document.addEventListener("focusin",V,true),()=>document.removeEventListener("focusin",V,true)},[m,x,S,v,I.floating]);let W=useDismiss(B,{outsidePressEvent:"pointerdown",escapeKey:true}),O=useRole(B,{role:"menu"}),{getFloatingProps:q}=useInteractions([W,O]),Q=typeof D.spacing.xs=="number"?`${D.spacing.xs}px`:String(D.spacing.xs),J=y===void 0?void 0:typeof y=="number"?y:D.spacing[y]??y,de=d?void 0:css({boxSizing:"border-box",background:D.surface.panelBg,border:`${D.componentHeights.border} solid ${D.surface.border}`,borderRadius:D.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":Q,padding:"var(--pfui-panel-pad)",color:D.text.primary,maxHeight:c,overflowY:"auto",display:"flex",flexDirection:"column",gap:J}),K=-1,ne=V=>{if(!V||typeof V!="object")return V;let X=V.type?.displayName;if(X==="DropdownMenu"||X==="DropdownMenuSub")return V;if(X==="MenuItem"||X==="MenuCheckboxItem"||X==="MenuRadioItem"||X==="MenuSwitchItem")return K+=1,cloneElement(V,{__index:K,key:V.key??K});if(X==="DropdownMenuTrigger"||X==="DropdownMenuSubTrigger"){let Ee=V.props?.children;return cloneElement(V,{children:ie.Children.map(Ee,ne)})}let ae=V.props?.children;return ae==null?V:cloneElement(V,{children:ie.Children.map(ae,ne)})},me=ie.Children.map(C,ne),[pe,fe]=useState(null);useEffect(()=>{if(!a)return;let V=$ instanceof HTMLElement&&$||v.current;if(!V)return;let Y=()=>fe(Math.round(V.getBoundingClientRect().width));Y(),_();let X=new ResizeObserver(()=>{Y(),_();});return X.observe(V),()=>X.disconnect()},[$,v,a,_]);let oe=l?typeof l=="number"?`${l}px`:String(l):a&&pe!=null?`${pe}px`:void 0,se=B.placement.split("-")[0]||"bottom",ge=se==="bottom"?"center top":se==="top"?"center bottom":se==="left"?"right center":"left center",ve=se==="bottom"?{opacity:0,y:-8,scale:.96}:se==="top"?{opacity:0,y:8,scale:.96}:se==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},Se=R??se,De=Se==="bottom"?{opacity:0,y:-8,scale:.96}:Se==="top"?{opacity:0,y:8,scale:.96}:Se==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},te=!!N?.isBusClosingRef.current&&!h?{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"}},ye=css({position:F,top:k??0,left:H??0,zIndex:1e3,transformOrigin:ge,width:oe});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:x?jsx(fr.Provider,{value:{allItemsTabbable:g},children:jsx(motion.div,{...q({...p,ref:mr(f,I.setFloating)}),className:u,css:[de,ye,b],initial:ve,animate:{opacity:1,x:0,y:0,scale:1},exit:De,transition:te,onMouseEnter:()=>{P(),N?.clearAllHover();},onMouseLeave:()=>M(),children:me})}):null})})});kt.displayName="DropdownMenuContent";var ia=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:i})=>{let[a,l]=useState(!!t),s=e??a,c=useCallback(f=>{e===void 0&&l(f),n?.(f);},[e,n]),d=useRef(null),m=useRef([]),[g,u]=useState(null),b=useRef(null),C=useCallback((f=160)=>{o==="hover"&&(window.clearTimeout(b.current??0),b.current=window.setTimeout(()=>c(false),f));},[o,c]),R=useCallback(()=>{b.current&&(window.clearTimeout(b.current),b.current=null);},[]);useEffect(()=>()=>R(),[R]);let h=useContext(Et),y=r??h,p=useMemo(()=>({open:s,setOpen:c,trigger:o,referenceRef:d,listRef:m,activeIndex:g,setActiveIndex:u,scheduleHoverClose:C,clearHoverClose:R}),[s,c,o,g,C,R]);return jsx(Et.Provider,{value:y,children:jsx(Rn.Provider,{value:p,children:i})})};ia.displayName="DropdownMenuSub";var la=ie.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...i},a)=>{let{open:l,setOpen:s,trigger:c,referenceRef:d,setActiveIndex:m,scheduleHoverClose:g,clearHoverClose:u}=wn(),b=!!e&&isValidElement(t),C=b?t:null,R=C?.props?.onKeyDown,h=C?.props?.onClick,{onKeyDown:y,onClick:p,...f}=i,x=useMemo(()=>mr(a,b?t.ref:void 0,d),[a,b,t,d]),S=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,v=useCallback(P=>{P.key==="ArrowRight"&&(P.preventDefault(),m(0),s(true)),P.key==="ArrowLeft"&&(P.preventDefault(),s(false)),R?.(P),y?.(P);},[m,s,R,y]),M=c==="hover"?{onMouseEnter:()=>{u(),s(true);},onMouseLeave:()=>{g();}}:{onClick:P=>{P.stopPropagation(),s(!l),h?.(P),p?.(P);}};if(b&&C){let P=C.props?.css;return cloneElement(C,{ref:x,tabIndex:C.props.tabIndex??0,className:[C.props.className,o].filter(Boolean).join(" ")||void 0,css:[P,S,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":l,"data-subtrigger":"",onKeyDown:v,...M,...f})}return jsx("div",{ref:x,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),S,r],"aria-haspopup":"menu","aria-expanded":l,"data-subtrigger":"",onKeyDown:v,...M,...f,children:t})});la.displayName="DropdownMenuSubTrigger";var ca=ie.forwardRef((e,t)=>{let n=gr(),{referenceRef:o,scheduleHoverClose:r,clearHoverClose:i}=wn();return jsx(kt,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,anchor:o.current,onMouseEnter:a=>{i(),n?.clearAllHover(),e.onMouseEnter?.(a);},onMouseLeave:a=>{r(),e.onMouseLeave?.(a);}})});ca.displayName="DropdownMenuSubContent";var yr=forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:i="md",label:a,className:l,css:s,trackCss:c,thumbCss:d,labelCss:m,...g},u){let b=j(),C=le(),R={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}},h={slideMs:250,pressMs:150,easing:"ease"},y=t!==void 0,[p,f]=useState(n),x=y?!!t:p,[S,v]=useState(false);useEffect(()=>{if(r)return;v(true);let W=setTimeout(()=>v(false),h.pressMs);return ()=>clearTimeout(W)},[x,r]);let M=["sm","md","lg"].includes(i)?i:"md",P=R[M],z=`${h.slideMs}ms ${h.easing}`,D=b.palette?.primary?.[600]??b.neutral[900],N=b.neutral[300],A=x?D:N,T=x?b.text.onColors.primary:"#ffffff",{trackW:L,trackH:w,thumb:E}=P,$=(w-E)/2,I=css({display:"inline-flex",alignItems:"center",gap:P.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:b.spacing.xs,borderRadius:b.radius.sm,outline:"none"}),H=css({position:"relative",width:L,height:w,backgroundColor:A,borderRadius:b.radius.full,transition:`background-color ${z}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),k=css({position:"absolute",top:$,left:x?L-E-$:$,width:E,height:E,backgroundColor:T,borderRadius:b.radius.full,transition:`left ${z}, transform ${z}, background-color 0.25s ease`,transform:S?"scaleX(1.2)":"scaleX(1)",transformOrigin:x?"right center":"left center"}),F=css({fontSize:b.fontSizes.md,fontWeight:500,color:r?b.text.muted:b.text.primary}),B=()=>{if(r)return;let W=!x;y||f(W),o?.(W);};return jsxs("label",{ref:u,role:"switch","aria-checked":x,"aria-disabled":r||void 0,"data-checked":x?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:B,onKeyDown:W=>{r||(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),B());},className:["plainframe-ui-switch",l||""].join(" ").trim(),css:[I,C({color:x?"primary":"neutral"}),s],...g,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[H,c],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[k,d]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[F,m],children:a})]})});var Sc=(e,t)=>t==="sm"?{box:16,labelFont:e.fontSizes.sm,gap:8,borderRadius:e.radius.xxs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:t==="lg"?{box:24,labelFont:e.fontSizes.lg,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75}:{box:20,labelFont:e.fontSizes.md,gap:8,borderRadius:e.radius.xs,borderWidth:e.componentHeights.border,iconRatioW:.7,iconRatioH:.75},uo=forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:i,description:a,rounded:l=false,checkedIcon:s,color:c="primary",css:d,boxCss:m,checkCss:g,labelCss:u,descriptionCss:b,className:C,...R},h)=>{let y=j(),p=le(),f=typeof e=="boolean",[x,S]=useState(t),v=f?e:x,M=r==="sm"||r==="lg"?r:"md",P=useMemo(()=>Sc(y,M),[y,M]),{checkedBg:z,checkColor:D,borderCol:N,hoverBg:A,gapPx:T}=useMemo(()=>{let W=y.palette||{},O=y.neutral||{},q=y.text?.onColors||{},Q,J;c==="neutral"||c==="secondary"?(Q=O,J="neutral"):typeof c=="string"&&Object.prototype.hasOwnProperty.call(W,c)?(Q=W[c]||W.primary||O,J=c):(Q=W.primary||O,J="primary");let de=Q[600]??Q[500]??Q[400]??Object.values(Q)[0]??y.palette.primary[600],K=q[J]??q.primary??y.text?.onColors?.primary??y.text.primary,ne=typeof P.gap=="number"?P.gap+2:P.gap;return {checkedBg:de,checkColor:K,borderCol:y.surface.border,hoverBg:y.surface.panelHover,gapPx:ne}},[P.gap,c,y]),L=useMemo(()=>css({display:"inline-flex",alignItems:i&&a?"flex-start":"center",gap:T,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:y.radius.sm,padding:y.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':{backgroundColor:A,outlineColor:N},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:z,outlineColor:z},".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)"}}),[N,z,a,o,T,A,i,y.radius.sm,y.spacing.xs]),w=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),E=useMemo(()=>css({width:P.box,height:P.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${P.borderWidth} solid ${N}`,outlineOffset:`-${P.borderWidth}`,borderRadius:l?y.radius.full:P.borderRadius,transition:"background-color .16s ease, outline-color .05s ease, transform .16s ease",flex:"0 0 auto",verticalAlign:"middle",overflow:"hidden"}),[P.box,P.borderRadius,P.borderWidth,N,l,y.radius.full]),$=useMemo(()=>({w:Math.round(P.box*P.iconRatioW),h:Math.round(P.box*P.iconRatioH)}),[P.box,P.iconRatioH,P.iconRatioW]),I=useMemo(()=>css({width:$.w,height:$.h,transition:"opacity .14s ease, transform .14s ease",color:D,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[D,$.h,$.w]),H=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),k=useMemo(()=>css({fontSize:P.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:y.text.primary}),[P.labelFont,y.text.primary]),F=useMemo(()=>css({fontSize:P.labelFont,lineHeight:1.25,color:y.text.secondary,fontWeight:400,marginTop:i&&a?y.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[P.labelFont,a,i,y.spacing.xs,y.text.secondary]),B=useCallback(()=>{o||(f?n?.(!v):S(W=>{let O=!W;return n?.(O),O}));},[o,f,v,n]),_=useCallback(W=>{o||(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),B());},[o,B]);return jsxs("label",{ref:h,role:"checkbox","aria-checked":v,"aria-disabled":o||void 0,"data-state":v?"checked":"unchecked",className:["plainframe-ui-checkbox",C||""].join(" ").trim(),css:[L,p({color:v?"primary":"neutral"}),d,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:_,children:[jsx("input",{type:"checkbox",checked:v,onChange:B,disabled:o,css:w,...R,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[E,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[I,g],children:v&&(s||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:D,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"})}))})}),(i||a)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:H,children:[i&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[k,u],children:i}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[F,b],children:a})]})]})});uo.displayName="Checkbox";var Ec=()=>useContext(Rn),kc=()=>useContext(fr),Ic=()=>useContext(lo),Kt=ie.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:i,children:a,className:l,css:s,startIcon:c,endIcon:d,selected:m=false,meta:g,__index:u,...b},C){let R=Ec(),h=Ic(),{allItemsTabbable:y}=kc()??{allItemsTabbable:true},p=j(),f=le(),S=!!useContext(Et),v=R&&u!=null&&R.activeIndex===u,M=b["data-subtrigger"]!==void 0,P=useContext(yn)??0,z=typeof o=="number"?o:o===false?0:P,D=useContext(so),N=D==="subtle"?p.surface?.subtleHover??p.neutral[100]:p.surface?.subtleBg??p.neutral[100],A=css({width:"100%",borderRadius:p.radius.md,padding:`${S?p.spacing.xs:p.spacing.sm} ${p.spacing.sm}`,paddingLeft:z>0?`calc(${p.spacing.md} + (${p.spacing.xl} * ${z}))`:p.spacing.md,minHeight:S?p.componentHeights.sm:p.componentHeights.md,display:"flex",alignItems:"center",gap:p.spacing.sm,fontWeight:500,fontSize:p.fontSizes.md,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:m||v?n?p.palette.danger[50]:N:"transparent",color:n?p.palette.danger[800]:p.text.primary,transition:"background-color .16s ease, color .16s ease","&:hover":t?{}:{background:n?p.palette.danger[50]:N},"&:focus-visible":t?{}:{background:n?p.palette.danger[50]:N},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),T=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}}),L=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,"& > svg":{width:16,height:16,display:"block"},color:p.text.secondary}),w=[];S&&w.push({minHeight:p.componentHeights.sm});let E=()=>{i?.(),r&&!M&&h?.closeAll();},$=(I,H)=>{if(R){let W=(R.listRef.current||[]).filter(Boolean);if(W.length){let O=Math.max(0,W.indexOf(I)),q=H(W.length,O);R.setActiveIndex(q),W[q]?.focus();return}}let k=I.closest('[role="menu"]');if(!k)return;let F=Array.from(k.querySelectorAll('[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]')).filter(W=>!W.hasAttribute("aria-disabled"));if(!F.length)return;let B=Math.max(0,F.indexOf(I)),_=H(F.length,B);F[_]?.focus();};return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,tabIndex:t?-1:R?y||v?0:-1:0,ref:I=>{if(R){let H=R.listRef.current;I&&(u!=null?H[u]=I:H.includes(I)||H.push(I));}typeof C=="function"?C(I):C&&"current"in C&&(C.current=I);},onMouseEnter:()=>{!t&&R&&u!=null&&R.setActiveIndex(u);},onFocus:()=>{!t&&R&&u!=null&&R.setActiveIndex(u);},onMouseLeave:()=>{R&&u!=null&&R.activeIndex===u&&R.setActiveIndex(null);},onKeyDown:I=>{if(t)return;let H=I.currentTarget;if(I.key==="Enter"||I.key===" "){I.preventDefault(),E();return}if(I.key==="Escape"){h?.closeAll();return}if(I.key==="ArrowDown"){I.preventDefault(),$(H,(k,F)=>(F+1)%k);return}if(I.key==="ArrowUp"){I.preventDefault(),$(H,(k,F)=>(F-1+k)%k);return}if(I.key==="Home"){I.preventDefault(),$(H,k=>0);return}if(I.key==="End"){I.preventDefault(),$(H,k=>k-1);return}},className:["plainframe-ui-menu-item",l||""].join(" ").trim(),css:css(...[f({color:n?"danger":"neutral"}),A,...w,s].flat()),...b,onClick:()=>{t||E();},children:[c&&jsx("span",{className:"plainframe-ui-menu-item-start",css:T,children:c}),a,(g!=null||d)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:L,children:[g!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:p.fontSizes.md,color:p.text.secondary,whiteSpace:"nowrap",marginRight:d?6:0}),children:g}):null,d]})]})}),fa=ie.createContext(null),Fc=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,i]=useState(t??[]),a=e!==void 0,l=a?e:r,s=d=>{let g=l.some(u=>Object.is(u,d))?l.filter(u=>!Object.is(u,d)):[...l,d];a||i(g),n?.(g);},c=useMemo(()=>({values:l,toggle:s}),[l]);return jsx(fa.Provider,{value:c,children:o})},fo=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:i,__index:a,disabled:l=false,css:s,className:c,...d},m){let g=useContext(fa),u=!!g&&r!==void 0,b=!u&&t!==void 0,[C,R]=useState(()=>u?g.values.some(v=>Object.is(v,r)):!!n),h=u?g.values.some(v=>Object.is(v,r)):b?!!t:C,y=j(),p=()=>{if(!l)if(u)g.toggle(r);else {let v=!h;b||R(v),o?.(v);}},f=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),x=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:-2,borderRadius:y.radius.sm,transition:"background-color .12s ease"}),S=css({pointerEvents:"none"});return jsx(Kt,{...d,className:["plainframe-ui-menu-checkbox-item",c||""].join(" ").trim(),ref:m,__index:a,role:"menuitemcheckbox","aria-checked":h,closeOnSelect:false,onSelect:p,disabled:l,startIcon:jsx("span",{"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:x,children:jsx(uo,{size:"sm",checked:h,css:S,className:"plainframe-ui-menu-checkbox"})}),css:s,children:jsx("span",{"data-label":true,css:f,className:"plainframe-ui-menu-item-label",children:i})})});fo.displayName="MenuCheckboxItem";var ga=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:i,disabled:a=false,css:l,switchSize:s="md",switchCss:c,startIcon:d,className:m,...g},u){let b=t!==void 0,[C,R]=useState(!!n),h=b?!!t:C,y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),p=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0}),f=()=>{if(a)return;let S=!h;b||R(S),o?.(S);},x=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:-2,"& > svg":{width:16,height:16,display:"block"}});return jsxs(Kt,{...g,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:u,__index:i,disabled:a,closeOnSelect:false,onSelect:f,css:l,children:[d&&jsx("span",{className:"plainframe-ui-menu-item-start",css:x,children:d}),jsx("span",{"data-label":true,css:y,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:p,children:jsx(yr,{size:s,checked:h,css:css({pointerEvents:"none",padding:0,marginRight:-1},c),className:"plainframe-ui-menu-switch",tabIndex:-1})})]})});ga.displayName="MenuSwitchItem";var ba=ie.createContext(null),ha=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,i]=useState(t),a=e??r,l=c=>{e!==void 0||i(c),n?.(c);},s=useMemo(()=>({value:a,onChange:l}),[a]);return jsx(ba.Provider,{value:s,children:o})};ha.displayName="MenuRadioGroup";var Pc=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:i,className:a,...l},s){let c=useContext(ba),d=c?.value===t,m=j(),g=css({width:m.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),u=css({width:7,height:7,borderRadius:"100%",backgroundColor:m.palette.primary[600],transform:d?"scale(1)":"scale(0.4)",opacity:d?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),b=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(Kt,{...l,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:s,__index:o,role:"menuitemradio","aria-checked":d,closeOnSelect:false,onSelect:()=>{r||c?.onChange?.(t);},disabled:r,css:i,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:g,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:u})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:b,children:n})]})}),Gt=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:i,endIcon:a,wrap:l=false,...s},c){let d=j(),m=css({display:"flex",alignItems:"center",padding:`${d.spacing.sm} ${d.spacing.md}`,fontSize:d.fontSizes.md,color:d.text.secondary,fontWeight:500,...t?{paddingLeft:`calc(${d.spacing.lg} * 2)`}:null,gap:d.spacing.xs}),g=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:l?"normal":"nowrap"}),u=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"}}),b=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:c,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(m,o),...s,children:[i&&jsx("span",{className:"plainframe-ui-menu-label-start",css:u,children:i}),jsx("span",{className:"plainframe-ui-menu-label-text",css:g,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:b,children:a})]})});Gt.displayName="MenuLabel";var Mc=({className:e,css:t,variant:n="full",...o})=>{let r=j(),i=`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:i,marginBottom:i,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),l=css({height:1,background:r.surface.border,marginTop:i,marginBottom:i,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),s=css({height:1,background:r.surface.border,marginTop:i,marginBottom:i,marginLeft:`${r.spacing.lg}`,marginRight:0}),c=n==="full"?a:n==="middle"?l:s;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(c,t),...o})};var go=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Hc=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return go(n?.[e]??e)}}},Bc=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return go(n?.[e]??e)}}},Lc=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},$c=(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},Xt=forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:i,className:a,hoverable:l,selectable:s,selected:c,defaultSelected:d,onSelectedChange:m,width:g,height:u,onClick:b,onKeyDown:C,role:R,tabIndex:h,...y},p){let f=j();f.surface??{};let [S,v]=useState(!!d),M=c!=null,P=M?!!c:S,z=useMemo(()=>Lc(o,f),[o,f]),D=useMemo(()=>$c(o,f,z),[o,f,z]),N=D,A=useMemo(()=>Hc(r,f),[r,f]),T=useMemo(()=>Bc(i,f),[i,f]),L=!!l||!!s,w=useMemo(()=>css({backgroundColor:z,padding:A,borderRadius:T,border:o==="outlined"?`${f.componentHeights?.border??"1px"} solid ${f.surface.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:g?"100%":void 0,maxWidth:go(g),height:go(u),transition:"background-color .16s ease, border-color .16s ease",cursor:L?"pointer":void 0,...L?{"&:hover":{backgroundColor:D}}:{},'&[data-selected="true"]':{backgroundColor:N},...L?{'&[data-selected="true"]:hover':{backgroundColor:N}}:{}}),[z,A,T,o,f.componentHeights,f.surface.border,g,u,L,D,N]),E=useCallback(()=>{if(!s)return;let k=!P;M||v(k),m?.(k);},[M,m,s,P]),$=useCallback(k=>{s&&E(),b?.(k);},[s,E,b]),I=useCallback(k=>{s&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),E()),C?.(k);},[s,E,C]),H=le();return jsx("div",{ref:p,"data-variant":o,"data-selected":s&&P?"true":void 0,"aria-pressed":s?P:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[H(),w,n],onClick:$,onKeyDown:I,role:s?R??"button":R,tabIndex:s?h??0:h,...y,children:t})});Xt.displayName="Container";var Oc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Cr(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 Oc(o)}return e}}}function En(e){switch(e){case "center":return "center";case "end":return "flex-end";case "start":default:return "flex-start"}}function wr(e){switch(e){case "center":return "center";case "end":return "right";case "start":default:return "left"}}function Wc(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 kn(e,t,n,o){let r=Cr(t,e),i=Cr(n,e),a=Cr(o,e),l={};return r&&!i&&!a&&(l.padding=r),i&&(l.paddingLeft=i,l.paddingRight=i),a&&(l.paddingTop=a,l.paddingBottom=a),l}function ya(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var xa=ie.createContext("horizontal"),Tr=()=>ie.useContext(xa),In=ie.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:i,selectable:a,selected:l,defaultSelected:s,onSelectedChange:c,width:d="100%",height:m,gap:g,direction:u="horizontal",className:b,onClick:C,...R},h)=>{let y=j(),p=le(),f=u==="vertical",x=css({position:"relative",display:"flex",flexDirection:f?"column":"row",gap:Wc(g,y),alignItems:f?"stretch":"center",transition:"all .16s ease"});return jsx(xa.Provider,{value:u,children:jsx(Xt,{ref:h,variant:n,padding:o,radius:r,hoverable:i,selectable:a,selected:l,defaultSelected:s,onSelectedChange:c,width:d,height:m,className:["plainframe-ui-card",b||""].join(" ").trim(),css:[p(),x,t],onClick:C,tabIndex:C?0:void 0,...R,children:e})})});In.displayName="Card";var bo=({children:e,css:t,className:n,align:o="start",padding:r,paddingX:i,paddingY:a,...l})=>{let s=j(),d=Tr()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:En(o),textAlign:wr(o),...d?{width:"100%"}:{flex:1,minWidth:0},...kn(s,r,i,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[m,t],...l,children:e})},ho=({children:e,css:t,className:n,align:o="start",padding:r,paddingX:i,paddingY:a,...l})=>{let s=j(),d=Tr()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:En(o),alignItems:En(o),...d?{width:"100%"}:{},...kn(s,r,i,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[m,t],...l,children:e})},yo=({children:e,css:t,className:n,align:o="start",padding:r,paddingX:i,paddingY:a,...l})=>{let s=j(),d=Tr()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:En(o),alignItems:En(o),...d?{width:"100%"}:{},gap:s.spacing.xs,color:s.text.secondary,...kn(s,r,i,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[m,t],...l,children:e})},xo=({children:e,css:t,className:n,align:o="start",padding:r,paddingX:i,paddingY:a,weight:l,size:s,color:c,...d})=>{let m=j(),g=css({fontWeight:l??500,fontSize:s??(m.fontSizes?.md!==void 0?m.fontSizes.md:"1rem"),color:ya(m,c)??m.text?.primary,textAlign:wr(o),...kn(m,r,i,a),display:"flex",alignItems:"center",gap:m.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[g,t],...d,children:e})},vo=({children:e,css:t,className:n,align:o="start",padding:r,paddingX:i,paddingY:a,weight:l,size:s,color:c,...d})=>{let m=j(),g=css({fontWeight:l??400,fontSize:s??(m.fontSizes?.md!==void 0?m.fontSizes.md:"0.875rem"),color:ya(m,c)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:wr(o),...kn(m,r,i,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[g,t],...d,children:e})};var Fn=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Uc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,_c=({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:i,focusRingMode:a,css:l,inputCss:s,containerCss:c,className:d,label:m,helperText:g,variant:u,startIcon:b,endIcon:C,size:R,itemsOpen:h,onItemsOpenChange:y,openOnFocus:p=true,openOnType:f=true,freeItem:x=false,maxHeight:S,maxItems:v=6,noResultsText:M="No results",highlightTypedValue:P,typedValueHighlightCss:z,showNoResults:D=false,loadItems:N,loading:A,loadingText:T="Loading\u2026",debounceMs:L=200,multiple:w=false,selectedValues:E,defaultSelectedValues:$,onChangeSelected:I})=>{let[H,k]=useState(""),F=typeof h=="boolean",[B,_]=useState(false),W=F?h:B,O=U=>{F||_(U),y?.(U);},[q,Q]=useState($??[]),J=E??q,[de,K]=useState(null),[ne,me]=useState([]),[pe,fe]=useState(false),oe=typeof N=="function",ee=oe?ne:e,se=!!A||pe&&oe,ge=useRef(null);useEffect(()=>{if(!oe)return;ge.current&&window.clearTimeout(ge.current);let U=H;return ge.current=window.setTimeout(async()=>{fe(true);try{let Z=await N(U)||[];me(Array.isArray(Z)?Z:[]);}catch{me([]);}finally{fe(false);}},Math.max(0,L)),()=>{ge.current&&window.clearTimeout(ge.current);}},[H,oe,N,L]);let ve=useMemo(()=>{let U=Fn(H);return U?ee.some(Z=>Fn(Z.title??Z.value)===U):false},[ee,H]),Se=!!x&&H.trim().length>0&&!ve,De=U=>{if(typeof x=="object"){let Z=Object.prototype.hasOwnProperty.call(x,"prefix"),ue=Object.prototype.hasOwnProperty.call(x,"suffix");if(Z||ue){let re=Z?x.prefix??"":"",xe=ue?x.suffix??"":"";return `${re}${U}${xe}`}return `Add "${U}"`}return `Add "${U}"`},Pe=useMemo(()=>{if(oe)return ee;let U=Fn(H);if(!U)return ee;let Z=ee.filter(ue=>Fn(ue.title??ue.value).split(" ").some(xe=>xe.startsWith(U)));return Z.length===0&&(Z=ee.filter(ue=>Fn(ue.title??ue.value).includes(U))),Z},[ee,H,oe]),te=useMemo(()=>{if(Se&&Pe.length===0){let U=H.trim();return [...Pe,{value:U,title:De(U),__pfui_free__:true}]}return Pe},[Pe,Se,H]),ye=useMemo(()=>{let U=[],Z=new Map,ue=Ue=>Ue.group??"__ungrouped__";for(let Ue of te){let dt=ue(Ue);Z.has(dt)||(Z.set(dt,[]),U.push(dt)),Z.get(dt).push(Ue);}let xe=typeof v=="number"?Math.max(0,v):1/0,Xn=[];for(let Ue of U){if(xe<=0)break;let pn=Z.get(Ue).slice(0,xe);pn.length>0&&(Xn.push({label:Ue==="__ungrouped__"?void 0:Ue,items:pn}),xe-=pn.length);}return Xn},[te,v]),V=ye.some(U=>U.items.length>0),Y=!V&&!!D&&!se,X=se||V||Y,ae=U=>{let Z=ee.filter(ue=>U.includes(ue.value)).concat(U.filter(ue=>!ee.some(re=>re.value===ue)).map(ue=>({value:ue,title:ue})));I?.(Z);},Ee=U=>{let Z=ee.find(ue=>ue.value===U)??{value:U,title:U};if(!Z.disabled)if(t?.(Z),w){let re=J.includes(Z.value)?J.filter(xe=>xe!==Z.value):[...J,Z.value];E||Q(re),ae(re),k(""),F||O(true);}else K(Z),k(Z.title??Z.value),F||O(false);},$e=U=>{w||K(null),k(U),!F&&f&&U.trim().length>0&&O(true);},be=U=>`plainframe-ui-autocomplete${U?`-${U}`:""}`,Ce=()=>{if(typeof document>"u")return;let U=document.querySelector(`.${be("menu")}`);if(!U)return;U.querySelector('[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]')?.focus();},ln=U=>{if(U.key===" "||U.code==="Space"||U.key==="Spacebar"){U.stopPropagation();return}if(U.key==="ArrowDown"){U.preventDefault(),!W&&!F?(O(true),requestAnimationFrame(Ce)):Ce();return}if(U.key==="Tab"&&!U.shiftKey&&W){let Z=typeof document<"u"?document.querySelector(`.${be("menu")}`):null;if(Z){let ue=Z.querySelector('[role="menuitem"],[role="menuitemcheckbox"],[role="menuitemradio"]');if(ue){U.preventDefault(),ue.focus();return}}}if(U.key==="Enter"){if(W){U.preventDefault();return}w||(Pe.length>0?Ee(Pe[0].value):x&&H.trim()&&Ee(H.trim()));}else U.key==="Escape"&&(F||O(false));},cn=()=>{!F&&p&&O(true);},qo=css({position:"relative",display:o?"block":"inline-block",width:o?"100%":"auto"}),Jo=css({width:o?"100%":n!=null?Uc(n):"auto"}),Lt=css({position:"absolute",inset:0,pointerEvents:"none"}),Gn=U=>{if(!P||!H)return U;let Z=U.toLowerCase().indexOf(H.toLowerCase());return Z<0?U:jsxs("span",{className:be("highlight-wrap"),css:css({display:"inline"}),children:[U.slice(0,Z),jsx("span",{className:be("highlight"),css:[css({display:"inline",fontWeight:600}),z],children:U.slice(Z,Z+H.length)}),U.slice(Z+H.length)]})},dn=css({minWidth:0}),un=css({width:"100%"}),ze=[],Qo=({item:U,absIndex:Z})=>{let re=br()===Z;if(w){let dt=J.includes(U.value),pn=i?i(U,dt,re):jsxs(In,{variant:"ghost",hoverable:false,selectable:false,padding:0,radius:"sm",css:un,children:[U.startIcon&&jsx(ho,{align:"center",children:U.startIcon}),jsxs(bo,{align:"start",children:[jsx(xo,{children:Gn(String(U.title??U.value))}),U.description&&jsx(vo,{children:U.description})]}),U.endIcon&&jsx(yo,{align:"center",children:U.endIcon})]});return jsx(fo,{__index:Z,checked:dt,onCheckedChange:()=>!U.disabled&&Ee(U.value),"aria-disabled":!!U.disabled,disabled:!!U.disabled,className:be("checkbox-item"),css:css(dn,U.css),children:pn},U.value)}let xe=de?.value===U.value,Xn=i?i(U,xe,re):jsxs(In,{variant:"ghost",hoverable:false,selectable:false,padding:0,radius:"sm",css:un,children:[U.startIcon&&jsx(ho,{align:"center",children:U.startIcon}),jsxs(bo,{align:"start",children:[jsx(xo,{children:Gn(String(U.title??U.value))}),U.description&&jsx(vo,{children:U.description})]}),U.endIcon&&jsx(yo,{align:"center",children:U.endIcon})]}),Ue=()=>{U.disabled||Ee(U.value);};return jsx(Kt,{__index:Z,onClick:Ue,onSelect:Ue,"aria-disabled":!!U.disabled,disabled:!!U.disabled,className:be("item"),css:css(dn,U.css),selected:xe,children:Xn},U.value)};if(se)ze.push(jsx(Gt,{className:be("label-loading"),children:T},"loading"));else if(Y)ze.push(jsx(Gt,{className:be("label-empty"),children:M},"empty"));else {let U=0;ye.forEach((Z,ue)=>{Z.label&&ze.push(jsx(Gt,{className:be("group-label"),children:Z.label},`g-${ue}`)),Z.items.forEach(re=>{ze.push(jsx(Qo,{item:re,absIndex:U},`${re.value}-${U}`)),U+=1;});});}return jsx("div",{className:[be(""),d||""].join(" ").trim(),css:[qo,c,l],tabIndex:-1,children:jsxs(Ut,{open:W,onOpenChange:O,children:[jsx(_t,{asChild:true,children:jsx("div",{"aria-hidden":"true",tabIndex:-1,className:be("anchor"),css:Lt})}),jsx("div",{className:be("trigger"),css:Jo,children:jsx(no,{className:be("input"),focusRingMode:a,value:H,onChange:$e,onKeyDown:ln,onFocus:cn,placeholder:r,label:m,helperText:g,variant:u,startIcon:b,endIcon:C,size:R,width:n,fullWidth:o,css:s})}),X&&jsx(kt,{className:be("menu"),sameWidth:true,side:"bottom",align:"start",maxHeight:typeof S=="number"?`${S}px`:S,children:ze})]})})};var Yc=["sm","md","lg"],qc=(e,t)=>typeof e=="number"?e:Yc.includes(e)?t.componentHeights[e]:t.componentHeights.md,Jc=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},Qc=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},Zc=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),va=forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:i,css:a,children:l,...s},c)=>{let d=j(),[m,g]=useState(!!e);useEffect(()=>{g(!!e);},[e]);let u=qc(n,d),b=typeof u=="number"?u:Number.parseFloat(String(u))||0,C=b?Math.round(b*(b<=28?.55:.52)):void 0,R=r?d.radius.full:d.radius.md,h=Jc(d,o),y=Qc(d,o),p=Zc(l,t),f=css({width:u,height:u,borderRadius:R,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":h,color:m?"inherit":y,boxSizing:"border-box",userSelect:"none"}),x=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),S=css({fontSize:C,lineHeight:1,fontWeight:600,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",marginTop:-1});return jsx("div",{ref:c,className:["plainframe-ui-avatar",i||""].join(" ").trim(),css:[f,a],role:m?void 0:"img","aria-label":m?void 0:t,...s,children:m&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:x,onError:()=>g(false),decoding:"async",loading:"lazy"}):typeof l=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:S,children:l}):l||jsx("span",{className:"plainframe-ui-avatar-initials",css:S,children:p})})});va.displayName="Avatar";var Ca=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,od=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:i=true,bgColor:a,extraLabelCss:l,outlineThickness:s=4,className:c})=>{let d=j(),m=le(),u=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let v=(d.componentHeights&&d.componentHeights[n])??(d.spacing&&d.spacing[n]);return Ca(v??n)}return "32px"})(),b=Children.toArray(e).filter(Boolean),C=typeof t=="number"&&t>=0,R=C&&b.length>t?b.slice(0,t):b,h=C&&b.length>t?b.length-t:0,y=a==="panel"?d.surface.panelBg:a==="subtle"?d.surface.subtleBg:a??d.surface.appBg,p=Ca(s)??"4px",f=css({display:"flex",alignItems:"center"}),x=v=>css({marginLeft:v===0?0:o,zIndex:R.length-v,boxShadow:`0 0 0 ${p} ${y}`,backgroundColor:y,borderRadius:i?d.radius.full:d.radius.md,display:"inline-flex",width:u,height:u,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),S=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${c?` ${c}`:""}`,css:[f,r,m()],children:[R.map((v,M)=>{if(!isValidElement(v))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:x(M),children:jsx("span",{css:S,children:v})},M);let P=v,z=P.props?.css,D=z==null?S:[S,z],N=cloneElement(P,{size:n,rounded:i,css:D,style:{...P.props?.style,width:"100%",height:"100%",objectFit:P.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:x(M),children:N},M)}),h>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:d.fontSizes.md,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:d.text.secondary}),l],"aria-label":`+${h} more`,children:["+",h]})]})};var Ta=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,rd=(e,t)=>{let n=e.palette||{},o=e.neutral||{};return t==="neutral"||t==="secondary"?{scale:o,onKey:"neutral"}:typeof t=="string"&&n[t]?{scale:n[t],onKey:t}:{scale:n.primary||o,onKey:"primary"}},sd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",ad=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",id=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",ld=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),cd=({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:i="dot",max:a=99,showZero:l=false,visible:s=true,anchorOrigin:c={vertical:"top",horizontal:"right"},overlap:d="rectangular",children:m,animate:g=true,size:u,outline:b=false,outlineColor:C,className:R,badgeClassName:h,css:y,badgeCss:p,offsetX:f,offsetY:x})=>{let S=j(),v=i==="dot",M=u??(v?8:17),P=r??(v?0:10),{scale:z,onKey:D}=rd(S,t),N=sd(z),A=S.text?.onColors||{},T=ad(S,A,D,n),L=id(e,a,i),w=ld(s,i,e,l),E=css({position:"relative",display:"inline-block"}),$=d==="circular"?v?"12.5%":"5%":0,I=Ta(f??$),H=Ta(x??$),k=c.vertical||"top",F=c.horizontal||"right",B={},_="0",W="0";k==="center"?(B.top="50%",W="-50%"):k==="top"?(B.top=H,W="-45%"):(B.bottom=H,W="45%"),F==="center"?(B.left="50%",_="-50%"):F==="right"?(B.right=I,_="45%"):(B.left=I,_="-45%");let O=w?1:.8,q=css({minWidth:v?M:M/2,height:M,background:N,color:T,fontSize:typeof P=="number"?`${P}px`:P,fontWeight:o,borderRadius:999,padding:v?0:`0 ${M/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",...b?{boxShadow:`0 0 0 2px ${C??S.surface?.appBg}`}:{},opacity:w?1:0,transform:`translate(${_}, ${W}) scale(${w?O:.5})`,...g?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...B});return jsxs("div",{className:["plainframe-ui-badge-wrapper",R||""].join(" ").trim(),css:[E,y],children:[m,jsx("span",{"aria-hidden":!w,className:["plainframe-ui-badge",h||""].join(" ").trim(),css:[q,p],children:L})]})};var Pr=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:i=1e3,css:a,contentCss:l,overlayCss:s,children:c,transitionDuration:d=300,keepMounted:m=true,className:g,contentClassName:u,lockScroll:b=true,...C})=>{let R=j(),h=useMemo(()=>r??R.surface.overlayBg,[r,R.surface.overlayBg]),[y,p]=useState(e),[f,x]=useState(e),S=useRef(null),v=useRef(null),M=useRef(null);useEffect(()=>(S.current&&(clearTimeout(S.current),S.current=null),v.current!=null&&(cancelAnimationFrame(v.current),v.current=null),e?(p(true),v.current=requestAnimationFrame(()=>{x(true),v.current=null;})):(x(false),S.current=setTimeout(()=>{p(false),S.current=null;},d)),()=>{S.current&&(clearTimeout(S.current),S.current=null),v.current!=null&&(cancelAnimationFrame(v.current),v.current=null);}),[e,d]),useEffect(()=>{if(!b||!e)return;let T=document.body,L=T.style.overflow,w=T.style.paddingRight,E=window.innerWidth-document.documentElement.clientWidth,$=parseFloat(getComputedStyle(T).paddingRight||"0");return T.style.overflow="hidden",E>0&&(T.style.paddingRight=`${$+E}px`),()=>{T.style.overflow=L,T.style.paddingRight=w;}},[e,b]),useEffect(()=>{if(!f||!t)return;let T=L=>{L.key==="Escape"&&t();};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[f,t]);let P=T=>{if(!f||!t||!M.current)return;let L=T.target;L&&!M.current.contains(L)&&t();},z=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!y)return null;let D=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:i,display:"grid",placeItems:"center",pointerEvents:f?"auto":"none",visibility:y?"visible":"hidden"}),N=css({position:"absolute",inset:0,background:h,backdropFilter:z?`blur(${z})`:void 0,WebkitBackdropFilter:z?`blur(${z})`:void 0,opacity:f?1:0,transition:`opacity ${d}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:f?"auto":"none"}),A=css({position:"relative",zIndex:1,pointerEvents:f?"auto":"none"});return jsxs("div",{"aria-hidden":!y||void 0,className:["plainframe-ui-backdrop",g||""].join(" ").trim(),css:[D,a],onPointerDown:P,...C,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[N,s],role:"presentation"}),jsx("div",{ref:M,className:["plainframe-ui-backdrop-content",u||""].join(" ").trim(),css:[A,l],children:c})]})};var To=()=>null;Object.defineProperty(To,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function fd(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 gd=ie.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:i,linkCrumbCss:a,separatorCss:l,hover:s=true,className:c,...d})=>{let m=j(),g=le(),u=ie.useMemo(()=>ie.Children.toArray(e).flatMap(p=>{if(!ie.isValidElement(p))return [];let{type:f,props:x}=fd(p);if(!(f===To||typeof f=="function"&&"displayName"in f&&f.displayName===To.displayName))return [];let v=x;return [{href:v.href,disabled:v.disabled,node:v.children,className:v.className,css:v.css,onClick:v.onClick,startIcon:v.startIcon,endIcon:v.endIcon}]}),[e]),b=ie.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.fontSizes.md,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),C=ie.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),R=ie.useCallback((p,f,x)=>{let S=p?m.text.primary:m.text.secondary,v=s&&f&&!x;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:S,cursor:f&&!x?"pointer":"default",textDecoration:"none",borderRadius:m.radius.xs,fontWeight:500,transition:"all .16s ease !important","&:hover":v?{textDecoration:"underline",color:m.text.primary}:{textDecoration:"none"}})},[m,s]),h=ie.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),y=ie.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",c||""].join(" ").trim(),css:[b,n],...d,children:u.map((p,f)=>{let x=f===u.length-1,S=!!p.href&&!p.disabled&&!x,v=["plainframe-ui-breadcrumb",x?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",S?"plainframe-ui-breadcrumb--link":"",p.className||""].join(" ").trim(),M=[R(x,S,p.disabled),o,x?r:i,S?a:void 0,g(),p.css],P=jsxs(Fragment,{children:[p.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:h,children:p.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:y,children:p.node}),p.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:h,children:p.endIcon})]});return jsxs(ie.Fragment,{children:[f!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[C,l],children:t}),S?jsx("a",{href:p.href,onClick:p.onClick,tabIndex:0,"data-active":x?"true":"false","data-link":"true",className:v,css:M,children:P}):jsx("span",{"aria-current":x?"page":void 0,tabIndex:x?-1:0,"data-active":x?"true":"false","data-link":"false",className:v,css:M,children:P})]},f)})})});var Fa=(e,t,n)=>Math.min(n,Math.max(t,e)),Mr=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ia=1,hd=keyframes`100% { transform: rotate(360deg); }`,yd=keyframes`
1
+ import me,{forwardRef,createContext,useId,useMemo,useState,useCallback,useRef,useEffect,useContext,isValidElement,cloneElement,Children,memo,useSyncExternalStore,useLayoutEffect}from'react';import {css,keyframes,useTheme,ThemeProvider,Global}from'@emotion/react';import {jsxs,jsx,Fragment}from'@emotion/react/jsx-runtime';import {ChevronDown,CircleAlert,TriangleAlert,CircleCheckBig,Info,X,Eye,EyeOff,ChevronRight,Check,ChevronFirst,ChevronLeft,ChevronLast,ChevronsUpDown}from'lucide-react';import {useFloating,offset,flip,shift,autoUpdate,useDismiss,useRole,useInteractions,FloatingPortal,size,arrow,useHover,safePolygon,useFocus}from'@floating-ui/react';import {motion,AnimatePresence,useAnimationControls}from'framer-motion';import {createRoot}from'react-dom/client';var ya={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},xa={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},va={sm:32,md:36,lg:40,border:"1px"},Ca={fonts:{sans:"system-ui, -apple-system, Segoe UI, Roboto, sans-serif",mono:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"},sizes:{xs:"12px",sm:"14px",md:"16px",lg:"18px",xl:"20px","2xl":"24px","3xl":"30px","4xl":"36px","5xl":"48px","6xl":"60px"}},qr={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#C6C6C6",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},Gr={0:"#0c0c0c",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ba={mono:{0:"#FFFFFF",50:"#FAFAFA",100:"#F2F2F2",200:"#E6E6E6",300:"#D1D1D1",400:"#8A8A8A",500:"#2A2A2A",600:"#1A1A1A",700:"#121212",800:"#0B0B0B",900:"#000000"},danger:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},success:{0:"#FFFFFF",50:"#EEFFF3",100:"#D7FFE8",200:"#d6ffe7ff",300:"#8EF5BB",400:"#5BEA9A",500:"#0FD45D",600:"#00C853",700:"#109C47",800:"#0E8242",900:"#064D2B"},warning:{0:"#FFFFFF",50:"#FFF7EB",100:"#FFEFC6",200:"#FFE094",300:"#FFC552",400:"#FFB83A",500:"#FFA414",600:"#FF9F0A",700:"#D97500",800:"#AF5E00",900:"#6E3600"},info:{0:"#FFFFFF",50:"#ECFAFF",100:"#D2F2FF",200:"#AEE6FF",300:"#84D6FF",400:"#4BC1FF",500:"#2B9FFF",600:"#1093FF",700:"#0077C0",800:"#0066A8",900:"#083B61"},red:{0:"#FFFFFF",50:"#FFF1F1",100:"#FFE0E0",200:"#ffd2d5ff",300:"#FF9AA6",400:"#FF6A7B",500:"#EF2F23",600:"#E7000B",700:"#DB1424",800:"#C11225",900:"#7A0A18"},amber:{0:"#FFFFFF",50:"#FFF3EA",100:"#FFE3D1",200:"#FFC7A6",300:"#FFAC80",400:"#FF874D",500:"#FF6C1F",600:"#FF5A00",700:"#D24500",800:"#B63C00",900:"#6F2300"},orange:{0:"#FFFFFF",50:"#FFF4EB",100:"#FFE6CC",200:"#FFCE9E",300:"#FFAE66",400:"#FF8B33",500:"#FF7310",600:"#FF6B00",700:"#CC4400",800:"#AF3F00",900:"#6B2400"},yellow:{0:"#FFFFFF",50:"#FFFAE6",100:"#FFF2BF",200:"#FFE780",300:"#FFDB3D",400:"#FFD000",500:"#FFE03F",600:"#FFD60A",700:"#B38600",800:"#8E6D00",900:"#534300"},lime:{0:"#FFFFFF",50:"#F6FFE8",100:"#E7FFC2",200:"#CCFF83",300:"#A8FA3D",400:"#8BE11C",500:"#87DE10",600:"#7ACC00",700:"#4A8C00",800:"#3B7100",900:"#224300"},green:{0:"#FFFFFF",50:"#F0FFF5",100:"#DBFFE9",200:"#BDF7CF",300:"#8FE7A8",400:"#5BD57D",500:"#1DAE52",600:"#16A34A",700:"#168A40",800:"#136A34",900:"#0B3D1F"},teal:{0:"#FFFFFF",50:"#EDFFFB",100:"#D2FFF4",200:"#A6FAEA",300:"#74EEDC",400:"#41DECB",500:"#00CFAA",600:"#00BFA5",700:"#0C8C7F",800:"#0B786C",900:"#084741"},cyan:{0:"#FFFFFF",50:"#EFFFFF",100:"#D4FCFF",200:"#AFF5FD",300:"#7FE8F6",400:"#45D3EB",500:"#09C6E7",600:"#00B8D9",700:"#0A7C92",800:"#0B6E81",900:"#0A4250"},blue:{0:"#FFFFFF",50:"#EFF6FF",100:"#DBE8FF",200:"#B8D3FF",300:"#90BAFF",400:"#5E97FF",500:"#406FFF",600:"#2F66FF",700:"#2452DE",800:"#2248C8",900:"#172C80"},indigo:{0:"#FFFFFF",50:"#EEF2FF",100:"#E0E6FF",200:"#C5D0FF",300:"#A3B5FF",400:"#879CFF",500:"#707AF5",600:"#5A63F3",700:"#4951DA",800:"#3E40BF",900:"#2A2A82"},purple:{0:"#FFFFFF",50:"#F4F0FF",100:"#E8DBFF",200:"#D2B8FF",300:"#B590FF",400:"#996AF5",500:"#7A52F1",600:"#6B3CF0",700:"#592FBE",800:"#4D27A3",900:"#2F1767"},magenta:{0:"#FFFFFF",50:"#FFF0FE",100:"#FCE0FF",200:"#F7BCFF",300:"#F393FD",400:"#E85FF8",500:"#C645D6",600:"#C026D3",700:"#951CAB",800:"#801790",900:"#4C0C59"},pink:{0:"#FFFFFF",50:"#FFF0F7",100:"#FFE0F0",200:"#FFC0E2",300:"#FF9ACE",400:"#FF6CB3",500:"#ED5CA2",600:"#EC4899",700:"#AB236F",800:"#96205D",900:"#5A1238"},rose:{0:"#FFFFFF",50:"#FFF0F3",100:"#FFE1E9",200:"#FFC1D3",300:"#FF98B8",400:"#FF6B98",500:"#EE4278",600:"#E52E69",700:"#B52156",800:"#991A43",900:"#5B0F28"}},ha={mono:{0:"#0B0B0C",50:"#0F0F10",100:"#151515",200:"#1B1B1C",300:"#232323",400:"#DADADA",500:"#E0E0E0",600:"#EDEDED",700:"#F5F5F5",800:"#FCFCFC",900:"#FFFFFF"},danger:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},success:{0:"#06150B",50:"#0A1B10",100:"#0E2416",200:"#11301C",300:"#143B21",400:"#16502C",500:"#22D85A",600:"#00C853",700:"#2FE976",800:"#7FF1AE",900:"#D6FADF"},warning:{0:"#150E05",50:"#1C1408",100:"#261B0B",200:"#31240E",300:"#3D2C12",400:"#583C16",500:"#FFA61A",600:"#FF9F0A",700:"#FFB347",800:"#FFD089",900:"#FFF0C9"},info:{0:"#07131E",50:"#0A1926",100:"#0E2233",200:"#112C44",300:"#143654",400:"#184A78",500:"#1C9CFF",600:"#1093FF",700:"#4FB2FF",800:"#9DD2FF",900:"#D8ECFF"},red:{0:"#17080A",50:"#1E0B0D",100:"#290F11",200:"#3A1416",300:"#4B191B",400:"#6A1D21",500:"#FF3B30",600:"#E7000B",700:"#FF2A20",800:"#FF463D",900:"#FFD9DB"},amber:{0:"#150D07",50:"#1C120A",100:"#26180E",200:"#311F12",300:"#3E2716",400:"#59361C",500:"#FF6A1E",600:"#FF5A00",700:"#FF8747",800:"#FFB98A",900:"#FFE2CC"},orange:{0:"#140D07",50:"#1B120A",100:"#25190D",200:"#302010",300:"#3B2813",400:"#553817",500:"#FF7F22",600:"#FF6B00",700:"#FF9247",800:"#FFBE8A",900:"#FFE1CC"},yellow:{0:"#141303",50:"#1B1906",100:"#25210A",200:"#2F2A0D",300:"#383212",400:"#524717",500:"#FFE042",600:"#FFD60A",700:"#FFE457",800:"#FFF194",900:"#FFF8CF"},lime:{0:"#0C1306",50:"#101A08",100:"#14210B",200:"#1A2B0F",300:"#203614",400:"#2A4A1A",500:"#86E21A",600:"#7ACC00",700:"#9EEA3B",800:"#C9F57F",900:"#EAFCC4"},green:{0:"#07140C",50:"#0B1B11",100:"#0E2416",200:"#112C1B",300:"#143722",400:"#17502F",500:"#20BF55",600:"#16A34A",700:"#39C964",800:"#86E5A5",900:"#D4F6E1"},teal:{0:"#081815",50:"#0B1F1C",100:"#0F2824",200:"#13322E",300:"#173E39",400:"#14584F",500:"#14CEBD",600:"#00BFA5",700:"#2CD6C6",800:"#7FEAE3",900:"#CFF7F3"},cyan:{0:"#07171C",50:"#0A1E24",100:"#0E2830",200:"#11333D",300:"#153E4A",400:"#165B6A",500:"#20CBE6",600:"#00B8D9",700:"#3FD2E9",800:"#93EBF6",900:"#D5F7FC"},blue:{0:"#081421",50:"#0A1829",100:"#0E2139",200:"#112A4B",300:"#153660",400:"#184A86",500:"#4A78FF",600:"#2F66FF",700:"#5A8AFF",800:"#A7C3FF",900:"#D9E7FF"},indigo:{0:"#0B1023",50:"#0E162C",100:"#141F3F",200:"#1C2A56",300:"#24366E",400:"#2F4894",500:"#707CF6",600:"#5A63F3",700:"#7D86FF",800:"#B5C0FF",900:"#E0E6FF"},purple:{0:"#100B1F",50:"#130E26",100:"#1A1638",200:"#231F4E",300:"#2E2A67",400:"#3C388D",500:"#8256F3",600:"#6B3CF0",700:"#8B66FA",800:"#C1B0FF",900:"#E4DCFF"},magenta:{0:"#160A18",50:"#1C0C21",100:"#25102E",200:"#321544",300:"#421A5C",400:"#58247C",500:"#CB44DB",600:"#C026D3",700:"#D960EB",800:"#F0B5FA",900:"#F9E4FE"},pink:{0:"#170911",50:"#1D0C18",100:"#271220",200:"#371830",300:"#462042",400:"#622C5C",500:"#F067AE",600:"#EC4899",700:"#F679BB",800:"#FFC2E1",900:"#FFE6F3"},rose:{0:"#17090E",50:"#1F0C13",100:"#2A121B",200:"#3A1B28",300:"#4B2636",400:"#673449",500:"#EE457B",600:"#E52E69",700:"#FF558A",800:"#FFA9C6",900:"#FFE0EA"}},Ra=e=>({...e,red:e.danger,error:e.danger,green:e.success,success:e.success,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,teal:e.teal,cyan:e.cyan,blue:e.blue,indigo:e.indigo,purple:e.purple,violet:e.purple,magenta:e.magenta,fuchsia:e.magenta,pink:e.pink,rose:e.rose,gray:e.mono,grey:e.mono,neutral:e.mono}),Qn=(e,t)=>e==="light"?{appBg:t[0],panelBg:t[0],subtleBg:t[100],panelHover:t[50],subtleHover:t[200],overlayBg:"linear-gradient(rgba(0,0,0,.15),rgba(0,0,0,.525))",border:t[300]}:{appBg:t[0],panelBg:t[0],subtleBg:t[50],panelHover:t[50],subtleHover:t[100],overlayBg:"linear-gradient(rgba(0,0,0,.35),rgba(0,0,0,.75))",border:t[200]},_o=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),Vo=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),fc=["danger","success","warning","info","amber","orange","yellow","lime","green","teal","cyan","blue","indigo","purple","magenta","pink","rose"],Ta=e=>fc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:ya,radius:xa,componentHeights:va,typography:Ca,neutral:qr,palette:{...Ra(ba),primary:ba.mono},surface:Qn("light",qr),text:{..._o(qr),onColors:{primary:"#FFFFFF",...Ta({yellow:"#000000"})}}},wa={spacing:ya,radius:xa,componentHeights:va,typography:Ca,neutral:Gr,palette:{...Ra(ha),primary:ha.mono},surface:Qn("dark",Gr),text:{...Vo(Gr),onColors:{primary:"#000000",...Ta({yellow:"#000000",lime:"#000000"})}}};function ka(e){let t=e,n=new Set;return {get:()=>t,set:o=>{t=o,n.forEach(r=>r());},subscribe:o=>(n.add(o),()=>n.delete(o))}}var Ma={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},eo=e=>Ma[e]??e;function an(e){let t={...e};return Object.entries(Ma).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Jr=me.createContext(null),Fa=me.createContext(null),Aa=me.createContext({setMode:e=>{},toggleMode:()=>{}}),Pa=me.createContext({setPrimary:e=>{}}),Na=me.createContext(null);function U(){return useTheme()}function hc(){let e=me.useContext(Jr);if(!e)throw new Error("useColorModeValue must be used within ThemeProvider");return me.useSyncExternalStore(e.subscribe,e.get,e.get)}function rb(){let e=me.useContext(Jr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=me.useSyncExternalStore(e.subscribe,e.get,e.get),{setMode:n,toggleMode:o}=useContext(Aa);return {mode:t,setMode:n,toggleMode:o}}function yc(){let e=me.useContext(Fa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=me.useSyncExternalStore(e.subscribe,e.get,e.get),n=useContext(Pa).setPrimary;return {primary:t,setPrimary:n}}function sb(e){let t=me.useContext(Na);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let n=hc(),{primary:o}=yc(),r=me.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[eo(o)]??s.palette.primary,u=an(s.text.onColors)[eo(o)]??Yr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...an(s.text.onColors),primary:u,[eo(o)]:u,[o]:u}}}},[t,n,o]);return e?e(r):r}function Uo(e,t){return t?{...e,spacing:{...e.spacing,...t.spacing??{}},radius:{...e.radius,...t.radius??{}},componentHeights:{...e.componentHeights,...t.componentHeights??{}},typography:{fonts:{...e.typography.fonts,...t.typography?.fonts??{}},sizes:{...e.typography.sizes,...t.typography?.sizes??{}}},palette:{...e.palette,...t.palette??{}},neutral:t.neutral??e.neutral,surface:{...e.surface,...t.surface??{}},text:{...e.text,...t.text??{},onColors:{...e.text.onColors,...t.text?.onColors??{}}}}:e}function Yr(e){let t=e.replace("#",""),n=parseInt(t.slice(0,2),16),o=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16),s=u=>{let i=u/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*s(n)+.7152*s(o)+.0722*s(r)>.53?"#000":"#FFF"}function Ia(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function Xr(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Go(e,t,n){let o=[],r=i=>i.startsWith("var(")?i.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():i;o.push(`--pf-font-sans:${r(e.typography.fonts.sans)};`),o.push(`--pf-font-mono:${r(e.typography.fonts.mono)};`),o.push(`--pf-text-primary:${e.text.primary};`),o.push(`--pf-text-secondary:${e.text.secondary};`),o.push(`--pf-text-muted:${e.text.muted};`),Object.entries(e.text.onColors).forEach(([i,l])=>o.push(`--pf-text-on-${i}:${l};`)),Object.entries(e.spacing).forEach(([i,l])=>o.push(`--pf-space-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.radius).forEach(([i,l])=>o.push(`--pf-radius-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.typography.sizes).forEach(([i,l])=>o.push(`--pf-fontSize-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.componentHeights).forEach(([i,l])=>o.push(`--pf-cmph-${i}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.neutral).forEach(([i,l])=>o.push(`--pf-neutral-${i}:${l};`)),o.push(`--pf-surface-appBg:${e.surface.appBg};`),o.push(`--pf-surface-panelBg:${e.surface.panelBg};`),o.push(`--pf-surface-subtleBg:${e.surface.subtleBg};`),o.push(`--pf-surface-panelHover:${e.surface.panelHover};`),o.push(`--pf-surface-subtleHover:${e.surface.subtleHover};`),o.push(`--pf-surface-overlayBg:${e.surface.overlayBg};`),o.push(`--pf-surface-border:${e.surface.border};`),o.push("--pf-focus-main:var(--pf-neutral-400);"),o.push(n==="dark"?"--pf-focus-soft:var(--pf-neutral-200);":"--pf-focus-soft:var(--pf-neutral-300);"),Object.entries(e.palette).forEach(([i,l])=>{Object.entries(l).forEach(([c,p])=>{o.push(`--pf-palette-${i}-${c}:${p};`);});});let s="300";Object.keys(e.palette).forEach(i=>{o.push(`--pf-focus-${i}-main: var(--pf-palette-${i}-${s});`),o.push(`--pf-focus-${i}-soft: transparent;`);});let a=t;[0,50,100,200,300,400,500,600,700,800,900].forEach(i=>o.push(`--pf-primary-${i}:var(--pf-palette-${a}-${i});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft: transparent;");let u=e.text.onColors[a]??(()=>{let l=(e.palette[a]?.[600]??e.palette.primary[600]).replace("#",""),c=parseInt(l.slice(0,2),16),p=parseInt(l.slice(2,4),16),R=parseInt(l.slice(4,6),16),f=k=>{let C=k/255;return C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4)};return .2126*f(c)+.7152*f(p)+.0722*f(R)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${u};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function qo(e,t,n){return Go(e,t,n).join("")}var Da=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,a=t?.primaryKey??"mono",i=useRef((()=>{if(!s)try{let g=JSON.parse(localStorage.getItem(o)||"null");if(g?.mode==="light"||g?.mode==="dark")return g.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),l=me.useMemo(()=>ka(i.current),[]),c=me.useMemo(()=>ka(a),[a]),p=useRef(null),R=useRef(0),f=useRef(r??"__root__");me.useLayoutEffect(()=>{let g=0,b=p.current;for(;b&&b!==document.body;)b.hasAttribute("data-pfui-scope")&&g++,b=b.parentElement;R.current=g;},[r]);let v=useMemo(()=>{let g=Uo(jo,t),b=Uo(g,t?.light),A=t?.light?.primaryKey??a,H=eo(A),B=b.palette.primary??b.palette[H]??b.palette.mono,M=an({..._o(b.neutral).onColors,...b.text.onColors}),E=M[H]??Yr(B[600]),L=t?.surface||t?.light?.surface?b.surface:Qn("light",b.neutral),O={...t?.text||t?.light?.text?b.text:_o(b.neutral),onColors:an({...M,primary:E,[H]:E})};return {...b,palette:{...b.palette,primary:B},surface:L,text:O}},[t,a]),k=useMemo(()=>{let g=Uo(wa,t),b=Uo(g,t?.dark),A=t?.dark?.primaryKey??a,H=eo(A),B=b.palette.primary??b.palette[H]??b.palette.mono,M=an({...Vo(b.neutral).onColors,...b.text.onColors}),E=M[H]??Yr(B[600]),L=t?.surface||t?.dark?.surface?b.surface:Qn("dark",b.neutral),O={...t?.text||t?.dark?.text?b.text:Vo(b.neutral),onColors:an({...M,primary:E,[H]:E})};return {...b,palette:{...b.palette,primary:B},surface:L,text:O}},[t,a]),C=useRef(null),T=useRef(null),h=me.useInsertionEffect||me.useLayoutEffect,d=me.useRef(false),m=useCallback(()=>{let g=Xr(r);Ia(T,s?`pfui-guard-${r}`:"pfui-guard-root"),T.current.textContent=`${g} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{T.current.textContent="";});},[r,s]);h(()=>{Ia(C,s?`pfui-vars-${r}`:"pfui-vars-root");let g=t?.light?.primaryKey??t?.primaryKey??a,b=t?.dark?.primaryKey??t?.primaryKey??a,A=Xr(r),H=qo(v,g,"light"),B=qo(k,b,"dark");C.current.textContent=`${A}.pf-light{${H}}
2
+ ${A}.pf-dark{${B}}`+(s?`
3
+ ${A}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[v,k,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,s,a]),me.useLayoutEffect(()=>{if(!d.current){d.current=true;let g=s?p.current:document.documentElement;g&&(g.classList.toggle("pf-dark",i.current==="dark"),g.classList.toggle("pf-light",i.current!=="dark"),l.set(i.current));}},[s,l]);let y=useCallback(()=>{window.__pfuiActiveScope={id:f.current,depth:R.current,ts:Date.now()};},[]),N=useCallback(()=>{let g=s?p.current:document.documentElement,b={capture:true},A=()=>y();return g?.addEventListener("pointerdown",A,b),g?.addEventListener("mouseenter",A,b),g?.addEventListener("focusin",A,b),g?.addEventListener("keydown",A,b),()=>{g?.removeEventListener("pointerdown",A,b),g?.removeEventListener("mouseenter",A,b),g?.removeEventListener("focusin",A,b),g?.removeEventListener("keydown",A,b);}},[s,y]),x=useCallback(g=>{let b=window.__pfuiActiveScope,A=b&&Date.now()-b.ts<1500;if(!b||!A||b.id!==f.current)return;let H=l.get(),B=c.get(),E=Go(H==="light"?v:k,B,H).join("");g.style.cssText+=`;${E}`,g.classList.toggle("pf-light",H==="light"),g.classList.toggle("pf-dark",H==="dark"),g.setAttribute("data-pfui-portal-owner",f.current);},[l,c,v,k]),w=g=>{if(g.getAttribute("data-floating-ui-portal")==="true"||g.getAttribute("data-radix-portal")==="true"||g.getAttribute("data-portal")==="true")return true;let b=g.getAttribute("role");if(b==="tooltip"||b==="dialog")return true;let A=window.getComputedStyle(g);return A.position==="fixed"||A.position==="absolute"},P=useCallback(()=>{let g=new MutationObserver(b=>{for(let A of b)A.addedNodes.forEach(H=>{H instanceof HTMLElement&&(w(H)&&x(H),H.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(B=>x(B)));});});return g.observe(document.body,{childList:true,subtree:true}),()=>g.disconnect()},[x]);me.useEffect(()=>{let g=N(),b=P();return ()=>{g(),b();}},[N,P]);let $=useCallback(g=>{let b=s?p.current:document.documentElement,A=c.get(),B=Go(g==="light"?v:k,A,g).join("");b.style.cssText+=`;${B}`,b.classList.toggle("pf-light",g==="light"),b.classList.toggle("pf-dark",g==="dark");},[s,v,k,c]),W=useCallback(g=>{let b=c.get(),H=Go(g==="light"?v:k,b,g).join("");document.querySelectorAll(`[data-pfui-portal-owner="${f.current}"]`).forEach(B=>{B.style.cssText+=`;${H}`,B.classList.toggle("pf-light",g==="light"),B.classList.toggle("pf-dark",g==="dark");});},[v,k,c]),K=useCallback(g=>{if(l.get()!==g&&(m(),l.set(g),$(g),W(g),!s))try{let b=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...b,mode:g}));}catch{}},[l,s,o,m,$,W]),I=useCallback(()=>K(l.get()==="light"?"dark":"light"),[K,l]),F=useCallback(g=>{c.set(g);let b=Xr(r),A=qo(v,g,"light"),H=qo(k,g,"dark");C.current&&(C.current.textContent=`${b}.pf-light{${A}}
4
+ ${b}.pf-dark{${H}}`+(s?`
5
+ ${b}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),m();let B=l.get();if($(B),W(B),!s)try{let M=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...M,primary:g}));}catch{}},[v,k,r,s,l,c,m,$,W]),S=jsx(Na.Provider,{value:{light:v,dark:k},children:jsx(Jr.Provider,{value:l,children:jsx(Fa.Provider,{value:c,children:jsx(Aa.Provider,{value:{setMode:K,toggleMode:I},children:jsx(Pa.Provider,{value:{setPrimary:F},children:jsx(ThemeProvider,{theme:xc(v),children:e})})})})})});return s?jsx("div",{ref:p,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:S}):jsx("div",{ref:p,children:S})};function xc(e){let t=(l,c)=>Object.fromEntries(Object.keys(l).map(p=>[p,c(p)])),n=t(e.spacing,l=>`var(--pf-space-${l})`),o=t(e.radius,l=>`var(--pf-radius-${l})`),r=t(e.typography.sizes,l=>`var(--pf-fontSize-${l})`),s=t(e.componentHeights,l=>`var(--pf-cmph-${l})`),a={sans:"var(--pf-font-sans)",mono:"var(--pf-font-mono)"},u=t(e.neutral,l=>`var(--pf-neutral-${l})`),i={};return Object.keys(e.palette).forEach(l=>{i[l]={},Object.keys(e.palette[l]).forEach(c=>{i[l][c]=`var(--pf-palette-${l}-${c})`;});}),i.primary=Object.fromEntries(["0","50","100","200","300","400","500","600","700","800","900"].map(l=>[l,`var(--pf-primary-${l})`])),{...e,spacing:n,radius:o,componentHeights:s,typography:{fonts:a,sizes:r},neutral:u,palette:i,surface:{appBg:"var(--pf-surface-appBg)",panelBg:"var(--pf-surface-panelBg)",subtleBg:"var(--pf-surface-subtleBg)",panelHover:"var(--pf-surface-panelHover)",subtleHover:"var(--pf-surface-subtleHover)",overlayBg:"var(--pf-surface-overlayBg)",border:"var(--pf-surface-border)"},text:{primary:"var(--pf-text-primary)",secondary:"var(--pf-text-secondary)",muted:"var(--pf-text-muted)",onColors:Object.fromEntries(Object.keys(an(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var vc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ha=(e,t)=>{let n=vc(e,t);if(n==="neutral")return {soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"};let o=e?.palette?.[n];return o?{soft:o[300]??"transparent",main:o[600]??o[500]??"currentColor"}:{soft:"var(--pf-focus-soft)",main:"var(--pf-focus-main)"}};function xe(){let e=U();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),s=t?.haloWidth??3,a=t?.offset??0,u=t?.mode==="always"?"&:focus":"&:focus-visible",i={transition:"box-shadow .16s ease, border-color 0s ease, outline-color 0s ease, outline-offset .16s ease",":root.pf-mode-switching &":{transition:"none !important"},"&[disabled], &[aria-disabled='true'], &[data-disabled='true']":{boxShadow:"none !important"}};return i[u]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:a,zIndex:1e4},css(i)}}function Yo(){let e=U();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),s=t?.haloWidth??3,a=t?.offset??0,u=t?.mode==="always"?"&:focus-within":"&:has(:focus-visible)",i={position:"relative",transition:"box-shadow .16s ease, border-color 0s ease, outline-color 0s ease, outline-offset .16s ease",":root.pf-mode-switching &":{transition:"none !important"},"&[disabled], &[aria-disabled='true'], &[data-disabled='true']":{boxShadow:"none !important"}};return i[u]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:a,zIndex:1e3},css(i)}}var za=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Oa=e=>{let t=e.type;return t?.__PFUI_SLOT||t?.displayName||t?.name||""},ts=forwardRef(({children:e,expandIcon:t,expandIconPosition:n="right",hideExpandIcon:o=false,className:r,css:s,expandIconCss:a},u)=>{let i=U(),l=i.typography.sizes.sm,c=20,p=10,R=i.spacing.lg,f=i.spacing.md,v=Number(i.componentHeights?.md),k=i.text,C=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:v,padding:`${f} ${R}`,gap:p,fontSize:l,color:k.primary}),T=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),h=css({marginRight:0,marginLeft:-2,lineHeight:0,color:i.text.secondary}),d=css({marginLeft:5,marginRight:-2,lineHeight:0,color:i.text.secondary});return jsxs("div",{ref:u,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[C,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[h,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:c,height:c}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:T,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[d,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:c,height:c}})})]})});ts.__PFUI_SLOT="AccordionSummary";ts.displayName="AccordionSummary";var ns=({children:e,className:t,css:n})=>{let o=U(),r=o.typography.sizes.sm,s=o.spacing.lg,a="0.15rem",u=o.spacing.md,i=css({padding:`${a} ${s} ${u} ${s}`,fontSize:r,boxSizing:"border-box",minHeight:0});return jsx("div",{className:["plainframe-ui-accordion-details",t||""].join(" ").trim(),css:[i,n],tabIndex:-1,children:e})};ns.__PFUI_SLOT="AccordionDetails";ns.displayName="AccordionDetails";var Wa=({open:e,defaultOpen:t=false,onChange:n,className:o,variant:r="subtle",disabled:s=false,width:a,fullWidth:u=false,css:i,children:l})=>{let c=U(),p=useId(),R=useId(),f=c.radius?.md,v=c.text,k=c.componentHeights?.border??1,C=za(k)??"1px",T=e!==void 0,[h,d]=useState(!!t),m=T?!!e:h,y=xe(),[N,x]=useState(0),[w,P]=useState(false),$=useRef(null),W=useRef(null),K=useRef(null),I=()=>{if(!m)return;let D=document.activeElement;W.current?.contains(D)&&K.current?.focus();},F=()=>{s||(I(),T?n?.(!e):d(D=>{let j=!D;return n?.(j),j}));},S=me.Children.toArray(l).filter(D=>isValidElement(D)),g=S.findIndex(D=>Oa(D)==="AccordionSummary"),b=S.findIndex(D=>Oa(D)==="AccordionDetails");g===-1&&S.length&&(g=0),b===-1&&(b=S.findIndex((D,j)=>j!==g),b===-1&&S.length>=2&&(b=1));let A=S[g]??null,H=S[b]??null,B=r==="subtle"?c.surface.subtleBg:r==="outlined"?c.surface.panelBg:"transparent",M=css({backgroundColor:B,color:v.primary,borderRadius:f,border:r==="outlined"?`${C} solid ${c.surface.border}`:"none",outline:"none",marginBottom:c.spacing.sm,maxWidth:a!=null?za(a):void 0,width:u?"100%":a!=null?void 0:"auto",boxSizing:"border-box",opacity:s?.55:1,cursor:s?"not-allowed":void 0});useLayoutEffect(()=>{let D=$.current;D&&x(D.scrollHeight);},[m,l]),useEffect(()=>{let D=$.current;if(!D)return;let j=new ResizeObserver(()=>x(D.scrollHeight));return j.observe(D),()=>j.disconnect()},[]),useEffect(()=>{N>0&&!w&&P(true);},[N,w]),useLayoutEffect(()=>{if(!m&&W.current){let D=document.activeElement;W.current.contains(D)&&K.current?.focus();}},[m]),useLayoutEffect(()=>{let D=W.current;if(!D)return;let j=Array.from(D.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]"));m?(j.forEach(J=>{let ae=J.dataset.accordionTabindex;ae!=null&&(ae===""?J.removeAttribute("tabindex"):J.tabIndex=Number(ae),delete J.dataset.accordionTabindex);}),D.removeAttribute("inert")):(j.forEach(J=>{J.dataset.accordionTabindex==null&&(J.dataset.accordionTabindex=J.hasAttribute("tabindex")?J.getAttribute("tabindex")??"":""),J.tabIndex=-1;}),D.setAttribute("inert",""));},[m]);let E=css({maxHeight:m?N||"none":0,overflow:m&&!w?"visible":"hidden",transition:w?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:w?"max-height":void 0}),L=css({opacity:m?1:0,transform:m?"translateY(0)":"translateY(1rem)",transition:w?"transform 0.28s ease, opacity 0.28s ease":"none"}),z=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:m?"rotate(180deg)":"rotate(0deg)"}}),O=A&&cloneElement(A,{...typeof A.props=="object"&&A.props?A.props:{},className:[A.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),_=H;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":m?"true":"false","data-disabled":s?"true":"false",css:[y(),M,i],tabIndex:s?-1:0,ref:K,role:"button","aria-expanded":m,"aria-controls":p,"aria-labelledby":R,"aria-disabled":s||void 0,onClick:D=>{D.detail===0&&document.activeElement!==K.current||F();},onKeyDown:D=>{s||document.activeElement===K.current&&D.target===K.current&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),F());},children:[jsx("div",{id:R,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),z],children:O}),jsx("div",{id:p,"aria-hidden":!m,className:"plainframe-ui-accordion-details-clip",css:E,tabIndex:-1,ref:W,onClick:D=>D.stopPropagation(),children:jsx("div",{ref:$,className:"plainframe-ui-accordion-details-inner",css:L,children:_})})]})};Wa.displayName="Accordion";var Ac=e=>isValidElement(e),Pc=e=>Ac(e)?e.type?.displayName||e.type?.name:void 0,_a=e=>Pc(e)==="Accordion",Nc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Dc=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,Va=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:s,onOpenIndexChange:a,disabled:u=false,width:i,fullWidth:l=false,className:c,role:p="group",css:R})=>{let f=U(),v=useRef(null),k=Children.toArray(e),C=k.filter(_a),T=C.length,h=o&&r!==void 0,[d,m]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let F=0;F<C.length;F++){let S=C[F].props;if(S.open||S.defaultOpen)return F}return null}),y=o?h?r??null:d:null,N=Dc(f.componentHeights?.border,1),x=f.surface.border,w=f.radius.md,P=n,$=P==="outlined";useEffect(()=>{let F=v.current;if(!F)return;let S=g=>{if(g.key!=="ArrowDown"&&g.key!=="ArrowUp"&&g.key!=="Home"&&g.key!=="End")return;let A=Array.from(F.querySelectorAll(".plainframe-ui-accordion")).filter(E=>E.getAttribute("data-disabled")!=="true");if(A.length===0)return;let H=document.activeElement,B=A.findIndex(E=>E.contains(H));if(B===-1)return;g.preventDefault();let M=B;g.key==="ArrowDown"?M=(B+1)%A.length:g.key==="ArrowUp"?M=(B-1+A.length)%A.length:g.key==="Home"?M=0:g.key==="End"&&(M=A.length-1),A[M]?.focus();};return F.addEventListener("keydown",S),()=>F.removeEventListener("keydown",S)},[T]);let W=css({display:"flex",flexDirection:"column",maxWidth:i!=null?Nc(i):void 0,width:l?"100%":i!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&$?`${N} solid ${x}`:"none",borderRadius:t&&$?w:void 0,background:t&&$?f.surface.panelBg:"transparent"}),K=0,I=[];return k.forEach((F,S)=>{if(!_a(F)){I.push(F);return}let g=F.props,b=K++,A=b===0,H=b===T-1,B=u||!!g.disabled,M=P??g.variant,E=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:A?w:0,borderTopRightRadius:A?w:0,borderBottomLeftRadius:H?w:0,borderBottomRightRadius:H?w:0}):css({width:"100%",marginBottom:0}),L=!A&&T>1&&t?css({borderTop:`${N} solid ${x}`}):null,z=$?css({border:"1px solid transparent"}):null,O={variant:M,disabled:B,width:"100%",css:[g.css,E,z,L],className:[g.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=g.onChange,D=y===b;O.open=D,O.defaultOpen=void 0,O.onChange=j=>{let J=j?b:null;h||m(J),a?.(J),_?.(j);};}I.push(cloneElement(F,{...g,...O,key:F?.key??S}));}),jsx("div",{ref:v,role:p,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",c||""].join(" ").trim(),css:[W,R],children:I})};Va.displayName="AccordionGroup";var Vt=e=>typeof e=="number"?`${e}px`:e,Ua=({children:e,open:t=true,anchorOrigin:n={horizontal:"center",vertical:"bottom"},direction:o="horizontal",padding:r="sm",gap:s="xs",radius:a="lg",offset:u=0,offsetX:i=0,offsetY:l=0,elevated:c=true,unstyled:p=false,fullWidth:R=false,width:f,height:v,role:k="toolbar","aria-label":C,onClose:T})=>{let h=U(),d=useRef(null),m=useRef(null),y=useRef(false),N=useRef(t),x=n.horizontal??"center",w=n.vertical??"bottom",P=M=>typeof M=="string"?h.spacing[M]??M:M,$=M=>typeof M=="string"?h.radius[M]??M:M,W=Vt(P(u)),K=Vt(P(i)),I=Vt(P(l)),F={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:x==="left"?"flex-start":x==="right"?"flex-end":"center",alignItems:w==="top"?"flex-start":w==="bottom"?"flex-end":"center"},S=()=>`${x==="left"?"left":x==="right"?"right":"center"} ${w==="top"?"top":w==="bottom"?"bottom":"center"}`,g=()=>w==="top"||w==="bottom"?`translateY(${w==="bottom"?100:-100}px) scale(0.98)`:w==="center"?x==="left"?"translateX(-100px) scale(0.98)":x==="right"?"translateX(100px) scale(0.98)":"scale(0.95)":"scale(0.98)",b=()=>w==="center"&&x==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",A=24,H={margin:A,marginTop:w==="top"?`calc(${A}px + ${W} + ${I})`:A,marginBottom:w==="bottom"?`calc(${A}px + ${W} + ${I})`:A,marginLeft:x==="left"?`calc(${A}px + ${W} + ${K})`:A,marginRight:x==="right"?`calc(${A}px + ${W} + ${K})`:A,padding:p?0:Vt(P(r)),background:p?"transparent":h.surface.panelBg,border:p?"none":`1px solid ${h.surface.border}`,borderRadius:p?0:Vt($(a)),boxShadow:p||!c?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Vt(P(s)),transformOrigin:S(),pointerEvents:t?"auto":"none",width:R?"calc(100% - 48px)":f?Vt(f):"auto",height:v?Vt(v):"auto",maxWidth:R?"100%":"none"},B=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let M=d.current;if(!M)return;let E=g(),L=b();if(!y.current){y.current=true,N.current=t,M.style.opacity=t?"1":"0",M.style.transform=t?L:E;return}if(N.current===t){M.style.opacity=t?"1":"0",M.style.transform=t?L:E;return}N.current=t,m.current&&m.current.cancel();let z=t?[{opacity:0,transform:E},{opacity:1,transform:L}]:[{opacity:1,transform:L},{opacity:0,transform:E}];return m.current=M.animate(z,{duration:250,easing:"ease",fill:"forwards"}),()=>{m.current&&m.current.cancel();}},[t,x,w]),useEffect(()=>{if(!t||!T)return;let M=E=>{E.key==="Escape"&&T();};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[t,T]),jsx("div",{css:F,children:jsx("div",{ref:d,css:B,style:H,role:k,"aria-label":C,"aria-hidden":!t,...!t&&{inert:true},children:e})})};Ua.displayName="ActionBar";var Ga=(e,t,n)=>Math.min(n,Math.max(t,e)),os=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,qa=1,Oc=keyframes`100% { transform: rotate(360deg); }`,Wc=keyframes`
6
6
  0% { left: -35%; right: 100%; }
7
7
  60% { left: 100%; right: -90%; }
8
8
  100% { left: 100%; right: -90%; }
9
- `,xd=keyframes`
9
+ `,Kc=keyframes`
10
10
  0% { left: -200%; right: 100%; }
11
11
  60% { left: 107%; right: -8%; }
12
12
  100% { left: 107%; right: -8%; }
13
- `,vd=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("),Cd=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Rd(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(vd(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],i=o[2]&&Cd.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[i])return e.palette.primary[i];let a=e.palette[r];if(a&&a[i]!=null)return a[i];if(r==="neutral"||r==="secondary"&&e.neutral[i]!=null)return e.neutral[i]}return e.palette.primary[600]}var Nr=({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:i,thickness:a,spinDuration:l=.75,wrapperCss:s,trackCss:c,barCss:d,circleCss:m,"aria-label":g})=>{let u=j(),b=typeof t=="number",C=Math.max(o-n,1),R=b?Fa(t,n,o):void 0,h=b?(R-n)/C*100:void 0,y=Rd(u,r),p=u.surface.subtleBg,f=u.radius?.md;return e==="circular"?jsx(Td,{size:i,active:y,isDeterminate:b,percent:h,spinDuration:l,wrapperCss:s,trackCss:c,circleCss:m,ariaLabel:g,thickness:a}):jsx(wd,{thickness:a,active:y,track:p,radius:f,isDeterminate:b,percent:h,wrapperCss:s,trackCss:c,barCss:d,ariaLabel:g,min:n,max:o,value:R})},wd=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:i,wrapperCss:a,trackCss:l,barCss:s,ariaLabel:c,min:d,max:m,value:g})=>{let u=o==null?"8px":typeof o=="number"?`${o}px`:String(o),b=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),C=css([{position:"relative",width:"100%",height:Mr(e,"6px"),backgroundColor:n,borderRadius:u,overflow:"hidden"},...Array.isArray(l)?l:l?[l]:[]]),R=r?Math.max(i??0,Ia):Ia,h=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${R/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(s)?s:s?[s]:[]]),y={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},p=css([{...y,left:"-35%",right:"100%",animation:`${yd} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(s)?s:s?[s]:[]]),f=css([{...y,left:"-200%",right:"100%",animation:`${xd} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(s)?s:s?[s]:[]]),x=r?{role:"progressbar","aria-valuemin":d,"aria-valuemax":m,"aria-valuenow":g}:{role:"progressbar","aria-busy":true};return c&&(x["aria-label"]=c),jsx("span",{css:b,...x,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:C,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:h}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:p}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:f})]})})})},Td=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:i,wrapperCss:a,trackCss:l,circleCss:s,ariaLabel:c})=>{let d=j(),m=40,g=(m-t)/2,u=2*Math.PI*g,C=`${(o?Fa((r??0)/100,.01,1):.7)*u} ${u}`,R=css([{display:"inline-block",width:Mr(e,`${d.componentHeights.md}`),height:Mr(e,`${d.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),h=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(l)?l:l?[l]:[]]),y=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:C,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":`${hd} ${i}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(s)?s:s?[s]:[]]),p=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return c&&(p["aria-label"]=c),jsx("span",{css:R,className:"plainframe-ui-progress-circular",...p,children:jsx("svg",{css:h,viewBox:`0 0 ${m} ${m}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:m/2,cy:m/2,r:g,strokeWidth:t,css:y})})})};var Dr=(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})},Hr=e=>typeof e=="number"?`${e}px`:e,Pa=e=>{let t=false;return ie.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Pa(n)&&(t=true));}),t};function Fd(e,t){let n=e,o=typeof t=="string"&&(t==="sm"||t==="md"||t==="lg")?t:"md";return o==="sm"?{fontSize:n.fontSizes.md,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.fontSizes.lg,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:18,minHeight:n.componentHeights.lg,radius:n.radius.md}:{fontSize:n.fontSizes.md,paddingY:n.spacing.sm,paddingX:n.spacing.lg,paddingXIcon:n.spacing.md,iconSize:16,minHeight:n.componentHeights.md,radius:n.radius.md}}function Pd(e,t){let n=e.neutral,o=e.text,r=e.palette,i=r.primary||n,a=r.danger||r.error||i,l=e.text.onColors||{},s=l.primary??o.onColors.primary,c=l.danger??s,d=(m,g,u)=>m&&m[g]||u;if(t==="primary"){let m=i,g=d(m,600,n[900])||d(m,500,n[900]),u=d(m,500,n[800])||d(m,600,n[800]);return {bg:g,fg:s,hoverBg:u,border:"none"}}if(t==="destructive"){let m=a,g=d(m,600,n[900])||d(m,500,n[900]),u=d(m,500,n[800])||d(m,600,n[800]);return {bg:g,fg:c,hoverBg:u,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 Ma=ie.memo(ie.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:i=false,disabled:a=false,loading:l=false,loadingIndicator:s,loadingPosition:c="center",children:d,className:m,hoverEffect:g=true,onClick:u,css:b,...C},R)=>{let h=j(),y=le(),p=useMemo(()=>Fd(h,t),[h,t]),f=useMemo(()=>Pd(h,e),[h,e]),x=useMemo(()=>!n&&!o&&!Pa(d)&&ie.Children.count(d)===1,[n,o,d]),S=p.iconSize,v=useMemo(()=>Dr(n,S),[n,S]),M=useMemo(()=>Dr(o,S),[o,S]),P=useMemo(()=>s??jsx(Nr,{variant:"circular",size:14,thickness:5}),[s]),z=useMemo(()=>x?"center":c??"center",[x,c]),D=!!l&&z==="center",N=!!l&&z==="start",A=!!l&&z==="end",T=a||l,L=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:i?"100%":"auto",minHeight:p.minHeight,lineHeight:1,fontWeight:600,cursor:T?"not-allowed":"pointer",opacity:T?.5:1,userSelect:"none",position:"relative",borderRadius:r?h.radius.full:p.radius,willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[i,p,r,h,T]),w=useMemo(()=>css({backgroundColor:f.bg,color:f.fg,border:f.border,outline:`${h.componentHeights.border} solid transparent`}),[f,h]),E=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:f.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":g&&!T?{":hover::before":{opacity:1}}:{}}),[f,g,T]),$=useMemo(()=>css(x&&!i?{width:"100%",height:"100%",maxWidth:p.minHeight,minWidth:p.minHeight,maxHeight:p.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Hr(p.iconSize)}:{fontSize:Hr(p.fontSize),padding:n||o?`${p.paddingY} ${p.paddingXIcon}`:`${p.paddingY} ${p.paddingX}`}),[x,i,p,n,o]),I=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Hr(h.spacing.sm),opacity:D?0:1,transition:"opacity 140ms ease"}),[h,D]),H=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),k=useMemo(()=>typeof p.iconSize=="number"?p.iconSize:Math.max(12,Math.round(parseFloat(String(p.iconSize))||16)),[p.iconSize]),F=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:k,minWidth:k,maxWidth:k,height:"1em"}),[k]),B=useMemo(()=>Q=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:Q?1:0,transition:"opacity 140ms ease"}),[]),_=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:D?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[D]),W=useMemo(()=>()=>{if(x)return null;let Q=!!n;return !Q&&!N?null:jsxs("span",{css:F,"aria-hidden":l?true:void 0,children:[jsx("span",{css:B(!N),children:Q?v||n:null}),jsx("span",{css:B(!!N),children:P})]})},[x,n,N,F,B,v,l,P]),O=useMemo(()=>()=>{if(x)return null;let Q=!!o;return !Q&&!A?null:jsxs("span",{css:F,"aria-hidden":l?true:void 0,children:[jsx("span",{css:B(!A),children:Q?M||o:null}),jsx("span",{css:B(!!A),children:P})]})},[x,o,A,F,B,M,l,P]),q=!(a||l);return jsxs("button",{ref:R,type:"type"in C&&C.type?C.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[L,w,E,$,b,y({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"})],onClick:q?u:void 0,disabled:a||l,"aria-disabled":a||l||void 0,"aria-busy":l||void 0,...C,children:[jsxs("span",{className:"plainframe-ui-button-content",css:I,children:[W(),jsx("span",{className:"plainframe-ui-button-label",css:H,children:x?l?P:Dr(d,p.iconSize):d}),O()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:_,"aria-hidden":"true",children:D?P:null})]})}));Ma.displayName="Button";var Io=e=>isValidElement(e),Md=e=>{let t=e.type;return t.displayName??t.name},zr=(e,t)=>Md(e)===t,Da=e=>zr(e,"ButtonGroup"),Ha=e=>zr(e,"DropdownMenu"),Lr=e=>zr(e,"DropdownMenuTrigger"),Zt=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ad=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,Nd=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),$r=(e,t)=>{if(!Io(e))return null;if(Da(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?$r(t?n[0]:n[n.length-1],t):null}if(Ha(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Lr);return o?$r(o,t):null}if(Lr(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},Na=(e,t)=>{if(!e)return false;let n=$r(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return Nd(o)},Ba=ie.memo(ie.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:i=false,size:a="md",rounded:l=false,gap:s,width:c,className:d,role:m="group",css:g,__clipLeft:u,__clipRight:b,...C},R){let h=j(),y=a==="sm"?h.radius.sm:h.radius.md,p=l?h.radius.full:y,f=o==="vertical",x=Ad(h.componentHeights.border,1),S=h.surface.border,v=n&&!!u,M=n&&!!b,P=css({display:"flex",flexDirection:f?"column":"row",width:r?"100%":c!=null?Zt(c):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Zt(s??h.spacing.sm)}),z=Children.toArray(t),N=z.filter(Io).length,A=0,T=false,L=[];for(let w of z){if(!Io(w)){L.push(w);continue}let E=A===0,$=A===N-1,I=w.props??{},H=I.disabled??i,k=I.size??a,F=0,B=0,_=0,W=0;n&&(f?(F=E?v?0:p:0,B=E?M?0:p:0,W=$?v?0:p:0,_=$?M?0:p:0):(F=E?v?0:p:0,W=E?v?0:p:0,B=$?M?0:p:0,_=$?M?0:p:0));let O=Na(w,"left"),q=Na(w,"right"),de=n&&!E&&!(T&&O)&&!(T||O)?css({[f?"borderTop":"borderLeft"]:`${x} solid ${S}`}):null,K=n&&!E&&T&&O?css(f?{borderTopWidth:0}:{borderLeftWidth:0}):null,ne=n?css({borderTopLeftRadius:Zt(F),borderTopRightRadius:Zt(B),borderBottomRightRadius:Zt(_),borderBottomLeftRadius:Zt(W)}):null,me=r?css({flex:1}):null,pe=css([ne,de,K,me]);if(!Ha(w)){let se=I.css,ge=[I.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),ve=Da(w)&&n?{__clipLeft:!E,__clipRight:!$}:{},Se=cloneElement(w,{...I,disabled:H,size:k,className:ge,css:[se,pe],...ve});L.push(Se),T=q,A+=1;continue}let fe=I.children,oe=Children.map(fe,se=>{if(!Io(se)||!Lr(se))return se;let ge=se.props,ve=[ge.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(se,{...ge,css:[ge.css,pe],className:ve,disabled:H,size:k})}),ee=cloneElement(w,{...I,children:oe});L.push(ee),T=q,A+=1;}return jsx("div",{ref:R,role:m,"aria-orientation":f?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",d||""].join(" ").trim(),css:[P,g],...C,children:L})}));Ba.displayName="ButtonGroup";var $a=e=>isValidElement(e),$d=e=>$a(e)?e.type?.displayName||e.type?.name:void 0,La=e=>$d(e)==="Card",zd=e=>typeof e=="number"?`${e}px`:e,za=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:i,className:a,role:l="group",css:s})=>{let c=j(),d=r==="vertical",m=String(c.componentHeights?.border??"1px"),g=c.surface.border,u={display:"flex",flexDirection:d?"column":"row",width:o!=null?zd(o):"auto",maxWidth:"none",gap:t?0:n??c.spacing?.sm},b=Children.toArray(e),R=b.filter(La).length,h=0,y=b.map((p,f)=>{if(!La(p)||!$a(p))return p;let x=p.props,S=h++,v=S===0,M=S===R-1,P=i??x.variant,z=t?d?{borderTopLeftRadius:v?x.radius:0,borderTopRightRadius:v?x.radius:0,borderBottomLeftRadius:M?x.radius:0,borderBottomRightRadius:M?x.radius:0}:{borderTopLeftRadius:v?x.radius:0,borderBottomLeftRadius:v?x.radius:0,borderTopRightRadius:M?x.radius:0,borderBottomRightRadius:M?x.radius:0}:void 0,D=t&&!v?d?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,N=P==="subtle"&&R>1&&!v?d?{borderTop:`${m} solid ${g}`}:{borderLeft:`${m} solid ${g}`}:null,T=[z,D,N,t?{width:"100%"}:{width:"100%",marginBottom:d?0:void 0,marginRight:d?void 0:0}].filter(Boolean),L=[x.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(p,{...x,variant:P??x.variant,css:[x.css,...T],className:L,key:typeof p=="object"&&"key"in p?p.key:f})});return jsx("div",{role:l,"aria-orientation":d?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[u,s],children:y})};za.displayName="CardGroup";var Re=e=>typeof e=="number"?`${e}px`:e,ja=e=>{let t=false;return ie.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&ja(n)&&(t=true));}),t},Vd=(e,t)=>t==="sm"?{fontSize:e.fontSizes.sm,paddingX:`calc(${e.spacing.sm} * 0.7)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.fontSizes.sm,radius:`calc(${e.radius.sm} * 0.8)`,soloPadding:e.spacing.xs,iconOffset:"0px",iconOffsetRounded:"-2px"}:t==="lg"?{fontSize:e.fontSizes.lg,paddingX:e.spacing.sm,paddingY:`calc(${e.spacing.sm} * 0.6)`,gap:e.spacing.xs,iconSize:e.fontSizes.lg,radius:e.radius.md,soloPadding:e.spacing.sm,iconOffset:"0px",iconOffsetRounded:"-3px"}:{fontSize:e.fontSizes.md,paddingX:`calc(${e.spacing.sm} * 0.9)`,paddingY:e.spacing.xs,gap:e.spacing.xxs,iconSize:e.fontSizes.md,radius:e.radius.sm,soloPadding:e.spacing.xs,iconOffset:"-1px",iconOffsetRounded:"-3px"},Va=forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:i=false,startIcon:a,endIcon:l,size:s="md",onClick:c,onDelete:d,deleteIcon:m,disabled:g,cursor:u,className:b,css:C},R){let h=j(),y=le(),p=["sm","md","lg"].includes(s)?s:"md",f=useMemo(()=>Vd(h,p),[h,p]),x=!!c&&!g,S=g?"not-allowed":u||(x?"pointer":"default"),v=String(h.componentHeights?.border??"1px"),M=useMemo(()=>{let J=h.palette;return r==="secondary"||r==="neutral"?"neutral":r&&J[r]?r:"primary"},[r,h.palette]),P=useCallback(J=>{let de=h.palette;return (M==="neutral"?h.neutral[J]:de[M]?.[J])??de.primary?.[J]},[M,h.neutral,h.palette]),z=useMemo(()=>M==="neutral"?h.neutral[100]:P(50),[M,P,h.neutral]),D=useMemo(()=>M==="neutral"?h.text.secondary:P(800),[M,P,h.text.secondary]),N=useMemo(()=>M==="neutral"?h.neutral[100]:P(50),[M,P,h.neutral]),A=useMemo(()=>M==="neutral"?h.text.secondary:P(800),[M,P,h.text.secondary]),T=useMemo(()=>M==="neutral"?h.neutral[400]:P(300),[M,P,h.neutral]),L=useMemo(()=>M==="neutral"?h.surface.subtleBg:P(600),[M,P,h.surface.subtleBg]),w=useMemo(()=>(h.text.onColors??{})[M]??(M==="neutral"?h.neutral[900]:h.neutral[0]??"#fff"),[M,h.text.onColors,h.neutral]),E="transparent",$=useMemo(()=>M==="neutral"?h.text.secondary:P(700)??h.text.primary,[M,P,h.text.primary,h.text.secondary]),I=useMemo(()=>!a&&!l&&t!=null&&!ja(t)&&ie.Children.count(t)===1,[a,l,t]),H=useMemo(()=>o==="filled"?css({backgroundColor:L,color:w,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:N,color:A,border:"none",boxShadow:`inset 0 0 0 ${v} ${T}`}):o==="ghost"?css({backgroundColor:E,color:$,border:"none",boxShadow:"none"}):css({backgroundColor:z,color:D,border:"none",boxShadow:"none"}),[L,w,$,N,A,T,z,D,v,o]),k=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Re(f.gap),padding:o==="ghost"?0:I||t==null?Re(f.soloPadding):`${Re(f.paddingY)} ${Re(f.paddingX)}`,borderRadius:i?h.radius.full:f.radius,fontWeight:600,cursor:S,opacity:g?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...I?{lineHeight:1,minWidth:`calc(${Re(f.iconSize)} + ${Re(f.soloPadding)} * 2)`,minHeight:`calc(${Re(f.iconSize)} + ${Re(f.soloPadding)} * 2)`,justifyContent:"center"}:null}),[f,S,t,g,I,i,h.radius.full,o]),F=useMemo(()=>css({fontSize:Re(I?f.iconSize:f.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:I?Re(f.iconSize):void 0,height:I?Re(f.iconSize):void 0,display:I?"block":void 0}}),[f.fontSize,f.iconSize,I]),B=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Re(f.iconSize),lineHeight:0,"& > svg":{width:Re(f.iconSize),height:Re(f.iconSize),display:"block"}}),[f.iconSize]),_=useMemo(()=>css({marginRight:I||t==null?0:Re(f.gap),marginLeft:I||t==null?0:Re(f.iconOffset)}),[f.gap,f.iconOffset,t,I]),W=useMemo(()=>css({marginLeft:I||t==null?0:Re(f.gap),marginRight:I||t==null?0:Re(i?f.iconOffsetRounded:f.iconOffset)}),[f.gap,f.iconOffset,f.iconOffsetRounded,t,I,i]),O=useMemo(()=>css({marginRight:i?0:Re(f.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:g?"not-allowed":"pointer",color:"currentColor",opacity:g?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:Re(f.iconSize),borderRadius:h.radius.xs}),[f.iconOffset,f.iconSize,g,i,h.radius.xs]),q=useCallback(J=>{x&&(J.key==="Enter"||J.key===" ")&&(J.preventDefault(),c?.());},[x,c]),Q=useMemo(()=>jsx(X,{css:{width:f.iconSize,height:f.iconSize},strokeWidth:2.5}),[f.iconSize]);return jsxs("div",{ref:R,className:["plainframe-ui-chip",x?"plainframe-ui-chip-clickable":"",b||""].join(" ").trim(),css:[k,H,x?y({color:r??"primary"}):null,C],onClick:x?c:void 0,onKeyDown:q,role:x?"button":void 0,tabIndex:x?0:void 0,"aria-disabled":g||void 0,"data-variant":o,"data-color":M,"data-size":s,"data-icon-only":I||void 0,children:[a&&jsx("span",{css:[B,_],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[F,n],className:"plainframe-ui-chip-label",children:t}),l&&jsx("span",{css:[B,W],className:"plainframe-ui-chip-icon-right",children:l}),d&&jsx("button",{type:"button","aria-label":"Delete",disabled:g,tabIndex:0,onClick:J=>{J.stopPropagation(),g||d?.();},css:[O,y({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||Q})]})});Va.displayName="Chip";var Gd=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Xd=ie.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:i,s:a,variant:l,error:s,disabled:c,ringEnabled:d,focusRingMode:m,placeholder:g,separator:u,gapPx:b}){let C=le(),R=r.neutral,h=r.text,y=r.componentHeights.border,p=useRef([]),[f,x]=useState(0),S=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),v=useMemo(()=>{if(!g)return Array(o).fill("");if(g.length===1)return Array(o).fill(g);let I=g.slice(0,o).split("");for(;I.length<o;)I.push("");return I},[g,o]),M=useMemo(()=>{let I=r.componentHeights[i];return `calc(${typeof I=="number"?`${I}px`:I} * 1.5)`},[r.componentHeights,i]),P=c?R[200]:l==="subtle"?r.surface.subtleBg:l==="outlined"?r.surface.panelBg:"transparent",z=l==="outlined"?`${y} solid ${s?r.palette.danger?.[600]??R[500]:r.surface.border}`:"none",D=I=>css({width:M,height:M,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:P,border:z,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:c?R[500]:h.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:h.primary,"&::placeholder":{color:h.secondary,opacity:.85}},d?C({enabled:true,disabled:c,mode:m==="always"?"always":"visible"}):void 0,I?css({}):null),N=css({display:"flex",gap:b,justifyContent:"center",width:"auto",pointerEvents:c?"none":"auto",opacity:c?.65:1}),A=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:h.secondary,userSelect:"none"}),T=I=>I.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),L=useCallback(I=>{let H=Math.max(0,Math.min(o-1,I));x(H),p.current[H]?.focus();},[o]),w=useCallback((I,H)=>{let k=T(H).slice(0,1),F=[...S];F[I]=k,n(F.join("")),k&&I<o-1&&L(I+1);},[S,o,n,L]),E=useCallback((I,H)=>{if(H.key==="Backspace")if(!S[I]&&I>0){let k=[...S];k[I-1]="",n(k.join("")),L(I-1),H.preventDefault();return}else {let k=[...S];k[I]="",n(k.join(""));return}if(H.key==="ArrowLeft"&&I>0){H.preventDefault(),L(I-1);return}if(H.key==="ArrowRight"&&I<o-1){H.preventDefault(),L(I+1);return}if(H.key==="Home"){H.preventDefault(),L(0);return}if(H.key==="End"){H.preventDefault(),L(o-1);return}},[S,o,n,L]),$=useCallback(I=>{let H=T(I.clipboardData.getData("text")).slice(0,o);H&&(n(H),requestAnimationFrame(()=>{let k=Math.min(H.length,o-1);L(k);}),I.preventDefault());},[o,n,L]);return jsx("div",{className:"plainframe-ui-code-boxes",css:N,children:Array.from({length:o}).map((I,H)=>jsxs(ie.Fragment,{children:[jsx("input",{ref:k=>{p.current[H]=k;},type:"text",inputMode:"text",maxLength:1,value:S[H]||"",placeholder:S[H]?"":v[H]||"",disabled:c,onChange:k=>w(H,k.target.value),onKeyDown:k=>E(H,k),onFocus:()=>x(H),onPaste:H===0?$:void 0,className:"plainframe-ui-code-box",css:D(H===f),"aria-label":`Code character ${H+1}`,tabIndex:H===f?0:-1}),u&&H<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:A,children:u}):null]},H))})}),Yd=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:i,error:a,helperText:l,disabled:s=false,gap:c,size:d="md",variant:m="subtle",length:g=4,focusRingMode:u="always",className:b,wrapperCss:C,labelCss:R,helperRowCss:h,helperTextCss:y,css:p})=>{let f=j(),x=useId(),S=useMemo(()=>({sm:{labelFont:f.fontSizes.sm,helperFont:f.fontSizes.sm,minHeight:f.componentHeights.sm,paddingY:0,paddingX:f.spacing.md,codeFontSize:21},md:{labelFont:f.fontSizes.md,helperFont:f.fontSizes.sm,minHeight:f.componentHeights.md,paddingY:0,paddingX:f.spacing.md,codeFontSize:24},lg:{labelFont:f.fontSizes.lg,helperFont:f.fontSizes.md,minHeight:f.componentHeights.lg,paddingY:0,paddingX:f.spacing.md,codeFontSize:28}}),[f]),v=["sm","md","lg"].includes(d)?d:"md",M=S[v],P=f.neutral,z=f.text,D=t!=null,[N,A]=useState(n),T=D?t:N,L=_=>{D||A(_),o?.(_);},w=Math.max(2,Math.min(g,10)),E=f.spacing.sm,$=Gd(c??E)??"0px",I=css({boxSizing:"border-box",display:"inline-flex",flexDirection:"column",alignItems:"flex-start",gap:4,width:"auto",maxWidth:"unset",fontWeight:500,cursor:s?"not-allowed":"auto"},...Array.isArray(C)?C:C?[C]:[]),H=css({fontSize:M.labelFont,fontWeight:500,color:a?f.palette.danger?.[700]??z.primary:s?P[500]:z.primary,marginBottom:4,display:"block",cursor:s?"not-allowed":"auto"},...Array.isArray(R)?R:R?[R]:[]),k=css({display:"flex",alignItems:"center",justifyContent:"center",gap:$,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(p)?p:p?[p]:[]),F=css({minHeight:16,fontSize:M.helperFont,color:a?f.palette.danger?.[700]??z.secondary:z.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(h)?h:h?[h]:[]),B=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?f.palette.danger?.[700]??z.primary:s?P[500]:z.primary},...Array.isArray(y)?y:y?[y]:[]);return jsxs("div",{className:["plainframe-ui-codefield",b||""].join(" ").trim(),css:I,children:[e&&jsx("span",{id:x,className:"plainframe-ui-codefield-label",css:H,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:k,role:"group","aria-labelledby":e?x:void 0,tabIndex:-1,children:jsx(Xd,{value:T||"",onChange:L,len:w,theme:f,sizeKey:v,s:{codeFontSize:M.codeFontSize},variant:m,error:!!a,disabled:s,ringEnabled:u!=="none",focusRingMode:u,placeholder:r,separator:i,gapPx:$})}),l!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:F,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:B,children:l})})]})};var Ga=e=>typeof e=="number"?`${e}px`:e,Xa=(e,t)=>e==null?t:typeof e=="number"?e:Number.parseFloat(e)||t,qd=ie.memo(({items:e,size:t,gap:n,rounded:o=false,radius:r,wrap:i=true,width:a,wrapperCss:l,patchCss:s})=>{let c=j(),d=t??24,m=n??c.spacing.xs,g=Ga(r??(o?c.radius.full:c.radius.sm)),u=ie.useMemo(()=>e.findIndex(D=>!D.disabled),[e]),[b,C]=ie.useState(u>=0?u:-1);ie.useEffect(()=>{C(u>=0?u:-1);},[u]);let R=ie.useRef([]),h=ie.useRef(null),[y,p]=ie.useState(e.length||1),f=Xa(m,8),x=Xa(d,24);ie.useLayoutEffect(()=>{let D=h.current;if(!D)return;let N=()=>{if(!i){p(e.length||1);return}let T=D.clientWidth||0,L=Math.max(1,Math.floor((T+f)/(x+f)));p(L||1);};N();let A=new ResizeObserver(N);return A.observe(D),()=>A.disconnect()},[i,e.length,f,x]);let S=D=>{D<0||D>=e.length||e[D]?.disabled||(C(D),R.current[D]?.focus());},v=D=>{if(!e.length)return;let N=b;for(let A=0;A<e.length;A++)if(N=(N+D+e.length)%e.length,!e[N]?.disabled){S(N);return}},M=D=>{if(!i||b<0)return;let N=Math.max(y,1),A=Math.ceil(e.length/N),T=Math.floor(b/N),L=b%N,w=T+D;if(w<0||w>=A)return;let E=w*N,$=Math.min(e.length-1,E+N-1),I=Math.min($,E+L);if(e[I]?.disabled)for(let H=1;H<N;H++){let k=I-H,F=I+H;if(k>=E&&!e[k]?.disabled){I=k;break}if(F<=$&&!e[F]?.disabled){I=F;break}}e[I]?.disabled||S(I);},P=[{display:"flex",flexWrap:i?"wrap":"nowrap",gap:m,width:a!=null?Ga(a):void 0,alignItems:"center",boxSizing:"border-box"},l],z={width:d,height:d,borderRadius:g,border:0,padding:0,appearance:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",userSelect:"none",outline:"none","&:focus":{outline:"none"},"&:focus-visible":{outline:"none"},"&::-moz-focus-inner":{border:0}};return jsx("div",{ref:h,css:P,className:"plainframe-ui-color-patches",children:e.map((D,N)=>{let A=!!D.disabled;return jsx("button",{className:"plainframe-ui-color-patch",type:"button",ref:T=>{R.current[N]=T;},"aria-label":D.label??D.title??D.color,"data-disabled":A,tabIndex:-1,onClick:()=>{A||D.onClick?.();},onKeyDown:T=>{if(!A)switch(T.key){case "ArrowRight":T.preventDefault(),v(1);break;case "ArrowLeft":T.preventDefault(),v(-1);break;case "ArrowDown":T.preventDefault(),M(1);break;case "ArrowUp":T.preventDefault(),M(-1);break;case "Home":T.preventDefault(),S(0);break;case "End":T.preventDefault(),S(e.length-1);break;case "Enter":case " ":T.preventDefault(),D.onClick?.();break}},css:[z,{backgroundColor:D.color},s,D.css],title:D.title??D.label,disabled:A},N)})})});var Ja=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 ""},Or=e=>{if(!e||typeof e!="object")return false;let t=Ja(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(Or):Or(o)},Qd=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:i=10})=>{let a=ie.useRef(null),[l,s]=ie.useState(false),c=ie.useCallback(F=>{s(F),o?.(F);},[o]),d=ie.useCallback(()=>c(false),[c]),m=ie.useRef({x:0,y:0}),g=ie.useRef(null),u=ie.useRef(null),b=ie.useCallback(()=>{u.current=null;let F=g.current;if(!F)return;let B=Math.round(m.current.x),_=Math.round(m.current.y);F.style.transform=`translate3d(${B}px, ${_}px, 0)`;},[]),C=ie.useCallback(()=>{u.current==null&&(u.current=requestAnimationFrame(b));},[b]);ie.useEffect(()=>()=>{u.current&&cancelAnimationFrame(u.current);},[]);let R=ie.useMemo(()=>({getBoundingClientRect:()=>{let F=Math.round(m.current.x),B=Math.round(m.current.y);return {x:F,y:B,left:F,top:B,right:F,bottom:B,width:0,height:0,toJSON:()=>({x:F,y:B})}}}),[]),h=ie.useRef(`cz-${Math.random().toString(36).slice(2)}`),y=ie.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${h.current}"]`):null,[]),p=ie.useRef(null),f=ie.useRef(null),x=ie.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),S=ie.useCallback(()=>{f.current!=null&&clearTimeout(f.current),f.current=null;},[]),v=ie.useCallback(()=>{S(),f.current=window.setTimeout(()=>c(false),0);},[S,c]),M=ie.useCallback(()=>{let F=a.current?.getBoundingClientRect();return F?{x:F.left+F.width/2,y:F.top+F.height/2}:{x:0,y:0}},[]),P=ie.useCallback((F,B)=>{m.current={x:F,y:B},C(),c(true);},[C,c]),z=typeof t=="function"?t({close:d}):t,D=Or(z),N=F=>{if(!ie.isValidElement(F))return F;let B=Ja(F),_=F,W=_.props.children,O=W==null?W:Array.isArray(W)?W.map(q=>ie.isValidElement(q)?N(q):q):ie.isValidElement(W)?N(W):W;if(B==="DropdownMenu"){let q=_.props.onOpenChange;return ie.cloneElement(_,{..._.props,open:l,onOpenChange:Q=>{q?.(Q),c(Q);},children:O})}if(B==="DropdownMenuContent"){let q=_.props.onMouseEnter,Q=_.props.onMouseLeave;return ie.cloneElement(_,{..._.props,anchor:R,"data-cz-id":h.current,onMouseEnter:J=>{S(),q?.(J);},onMouseLeave:J=>{v(),Q?.(J);},children:O})}return O===W?_:ie.cloneElement(_,{..._.props,children:O})},A=D?N(z):z,T=ie.useCallback(F=>{F.preventDefault(),P(F.clientX,F.clientY);},[P]),L=ie.useCallback(F=>{n==="contextmenu"&&T(F);},[n,T]),w=ie.useCallback(F=>{n==="dblclick"&&T(F);},[n,T]),E=ie.useCallback(F=>{n==="click"&&T(F);},[n,T]),$=ie.useCallback(F=>{if(n!=="hover")return;x(),S();let B=r==="center"?M():{x:F.clientX,y:F.clientY};p.current=window.setTimeout(()=>{let _=B.x+(r==="cursor"?i:0),W=B.y+(r==="cursor"?i:0);P(_,W);},0);},[n,r,i,M,P,x,S]),I=ie.useCallback(F=>{n==="hover"&&l&&r==="cursor"&&!D&&(m.current={x:F.clientX+i,y:F.clientY+i},C());},[n,l,r,D,i,C]),H=ie.useCallback(()=>{n==="hover"&&(x(),v());},[n,x,v]);ie.useEffect(()=>{if(n!=="hover")return;let F=()=>{if(!l)return;let B=a.current?.matches(":hover"),_=y()?.matches?.(":hover");B||_?S():v();};return window.addEventListener("pointermove",F,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",F,{capture:true})},[l,n,y,S,v]),ie.useEffect(()=>{let F=()=>{if(l)if(n==="hover"){let B=a.current?.matches(":hover"),_=y()?.matches?.(":hover");if(B||_?S():v(),r==="center"&&a.current){let W=M();m.current={x:W.x,y:W.y},C();}}else c(false);};return window.addEventListener("scroll",F,true),window.addEventListener("resize",F,true),()=>{window.removeEventListener("scroll",F,true),window.removeEventListener("resize",F,true);}},[l,n,r,M,C,c,S,v,y]),ie.useEffect(()=>()=>{x(),S();},[x,S]);let k=({children:F})=>l?jsx("div",{ref:g,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(m.current.x)}px, ${Math.round(m.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&S(),onMouseLeave:()=>n==="hover"&&v(),children:F}):null;return jsxs("div",{ref:a,onContextMenu:L,onDoubleClick:w,onClick:E,onMouseEnter:$,onMouseMove:I,onMouseLeave:H,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,D?A:jsx(k,{children:A})]})};var en=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,tu=forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:i=1,width:a,middleMargin:l="5px",insetMargin:s="10px",chip:c=false,chipVariant:d="subtle",rounded:m=false,margin:g=10,css:u,labelCss:b,strokeCss:C,className:R,...h},y){let p=j(),{t:f,strokeColor:x,labelTextColor:S,chipSubtleBg:v,chipOutlinedBg:M,outerM:P,padX:z,verticalStrokeMargin:D}=useMemo(()=>{let w=typeof i=="number"?`${i}px`:i,E=p.surface.border,$=p.text.secondary,I=p.surface.subtleBg,H=p.surface.panelBg,k=en(g,"10px"),F=o==="horizontal"?n==="middle"?en(l):n==="inset"?en(s,"0px"):"0":"0",B=o==="vertical"?n==="middle"?en(l):n==="inset"?en(s,"0px"):"0":"0";return {t:w,strokeColor:E,labelTextColor:$,chipSubtleBg:I,chipOutlinedBg:H,outerM:k,padX:F,verticalStrokeMargin:B}},[i,p,o,n,l,s,g]),N=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":f,minWidth:t?"max-content":f,marginLeft:P,marginRight:P}:{flexDirection:"row",width:a?en(a):"100%",minWidth:0,paddingLeft:z,paddingRight:n==="middle"?z:"0",marginTop:P,marginBottom:P},...Array.isArray(u)?u:u?[u]:[]]),[o,t,f,P,a,z,n,u]),A=useMemo(()=>css([{background:x,borderRadius:m?p.radius.full:p.radius.xs},o==="vertical"?{width:f,minHeight:18,flex:1,marginTop:D,marginBottom:D}:{height:f,flex:1}]),[x,m,p.radius.full,p.radius.xs,o,f,D]),T=useMemo(()=>css([{margin:c?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:c?"3px 7px":0,borderRadius:c?m?p.radius.full:`calc(${p.radius.sm} * 0.75)`:`calc(${p.radius.sm} * 0.75)`,color:S,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...c?d==="subtle"?{background:v,border:"none"}:{background:M,border:`${f} solid ${x}`}:{}},...Array.isArray(b)?b:b?[b]:[]]),[c,o,m,p.radius.full,p.radius.sm,S,d,v,M,f,x,b]),L=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[A,C]}),[A,C]);return o==="vertical"?jsxs("div",{ref:y,"data-direction":"vertical","data-variant":n,"data-chip":c?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",R||""].join(" ").trim(),css:N,...h,children:[t&&r!=="top"&&L,t&&jsx("span",{className:"plainframe-ui-divider-label",css:T,children:t}),t&&r!=="bottom"&&L,!t&&L]}):jsxs("div",{ref:y,"data-direction":"horizontal","data-variant":n,"data-chip":c?"true":void 0,className:["plainframe-ui-divider-wrapper",R||""].join(" ").trim(),css:N,...h,children:[t&&r!=="left"&&L,t&&jsx("span",{className:"plainframe-ui-divider-label",css:T,children:t}),t&&r!=="right"&&L,!t&&L]})});var Dn=0,ni="",oi="",au=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function iu(){if(!(typeof document>"u")){if(Dn===0){let e=document.body;ni=e.style.overflow||"",oi=e.style.paddingRight||"";let t=au();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}Dn+=1;}}function lu(){if(!(typeof document>"u")&&(Dn>0&&(Dn-=1),Dn===0)){let e=document.body;e.style.overflow=ni,e.style.paddingRight=oi;}}var cu=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,ri=forwardRef(function({on:t,defaultOn:n,onOpenChange:o,onClose:r,children:i,width:a,height:l,position:s="left",variant:c="inset",margin:d=10,radius:m,backdropBlur:g=true,backdropBlurDepth:u,closeOnClickAway:b=true,lockScroll:C=true,transitionMs:R,snapClosePct:h=.33,velocityClosePxS:y=950,dragElasticOut:p=.2,className:f,css:x,...S},v){let M=j(),P=t!==void 0,[z,D]=useState(!!n),N=P?!!t:z,A=useCallback(oe=>{P||D(oe),oe||r?.(),o?.(oe);},[P,r,o]);useEffect(()=>{if(!(!C||!N))return iu(),()=>lu()},[N,C]);let T=useMemo(()=>cu(d,0),[d]),L=useMemo(()=>s==="left"||s==="right"?"x":"y",[s]),w=useMemo(()=>s==="left"||s==="top"?-1:1,[s]),E=useMemo(()=>a??(s==="left"||s==="right"?320:c==="inset"?`calc(100% - ${T*2}px)`:"100%"),[a,s,c,T]),$=useMemo(()=>l??(s==="top"||s==="bottom"?420:c==="inset"?`calc(100% - ${T*2}px)`:"100%"),[l,s,c,T]),I=useMemo(()=>{let oe=String(M.radius.lg);switch(s){case "left":return `0 ${oe} ${oe} 0`;case "right":return `${oe} 0 0 ${oe}`;case "top":return `0 0 ${oe} ${oe}`;default:return `${oe} ${oe} 0 0`}},[s,M.radius.lg]),H=useMemo(()=>m??(c==="inset"?M.radius.lg:I),[m,c,M.radius.lg,I]),k=useMemo(()=>c==="inset"?{top:s==="bottom"?void 0:T,bottom:s==="top"?void 0:T,left:s==="right"?void 0:T,right:s==="left"?void 0:T}:{top:s==="bottom"?void 0:0,bottom:s==="top"?void 0:0,left:s==="right"?void 0:0,right:s==="left"?void 0:0},[c,s,T]),F=useRef(null),B=useCallback(()=>{let oe=F.current;if(!oe)return 1;let ee=oe.getBoundingClientRect();return L==="x"?ee.width:ee.height},[L]),_=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),W=useMemo(()=>({duration:(R??280)/1e3,ease:[.22,1,.36,1]}),[R]),O=useMemo(()=>w*1.1,[w]),q=useMemo(()=>L==="x"?{x:`${O*100}%`,y:0}:{y:`${O*100}%`,x:0},[L,O]),Q=useMemo(()=>css({position:"fixed",zIndex:1100,...k,width:E,height:$,backgroundColor:M.surface.panelBg,borderRadius:H,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:N?"auto":"none",touchAction:L==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[k,E,$,M.surface,H,N,L]),J=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:M.surface.overlayBg,transition:"all .3s ease",...g?{backdropFilter:`blur(${u??"2px"})`}:null}),[g,u,M.surface]),de=useCallback(()=>{b&&A(false);},[b,A]),K=useMemo(()=>L==="x"?{left:w===-1?p:0,right:w===1?p:0}:{top:w===-1?p:0,bottom:w===1?p:0},[L,w,p]),ne=useMemo(()=>L==="x"?{left:0,right:0}:{top:0,bottom:0},[L]),me=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),pe=useCallback((oe,ee)=>{let se=L==="x"?ee.offset.x:ee.offset.y,ge=L==="x"?ee.velocity.x:ee.velocity.y,ve=w*se>0,Se=Math.abs(se)>=B()*me,De=w*ge>y;ve&&(Se||De)&&A(false);},[L,w,B,me,y,A]);useEffect(()=>{if(!N)return;let oe=ee=>{ee.key==="Escape"&&A(false);};return window.addEventListener("keydown",oe,{passive:true}),()=>window.removeEventListener("keydown",oe)},[N,A]);let{...fe}=S;return jsx(AnimatePresence,{children:N?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:J,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:R?W:{duration:.18,ease:"linear"},onClick:de},"overlay"),jsx(motion.div,{ref:oe=>{F.current=oe,typeof v=="function"?v(oe):v&&(v.current=oe);},role:"dialog","aria-modal":"true","data-position":s,"data-variant":c,className:["plainframe-ui-drawer",f||""].join(" ").trim(),css:[Q,x],drag:L,dragConstraints:ne,dragElastic:K,dragMomentum:false,dragDirectionLock:true,onDragEnd:pe,initial:{...q,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...q,opacity:.98},transition:R?W:_,...fe,children:i},"panel")]}):null})});ri.displayName="Drawer";var Ur=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:i=true,className:a,blur:l=false})=>{let s={opacity:o?1:0,filter:l?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"},c=m=>g=>{g.target===g.currentTarget&&(g.propertyName==="opacity"||g.propertyName==="filter")&&r?.(),m?.(g);};if(i&&isValidElement(e)){let m=e,g=m.props.css,u=Array.isArray(g)?[...g,s]:g?[g,s]:[s],b=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),C=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:u,className:b,onTransitionEnd:c(C)})}let d=css(s);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:d,onTransitionEnd:c(),children:e})};var si=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,ai=forwardRef(function({direction:t="row",gap:n="sm",justify:o,align:r="center",className:i,css:a,children:l,width:s,height:c,...d},m){let g=j(),u=t==="vertical"||t==="column"?"column":"row",b=n===void 0?void 0:typeof n=="number"?n:g.spacing[n]??n,C=css({display:"flex",flexDirection:u,gap:b,justifyContent:o,alignItems:r,maxWidth:si(s),width:s?"100%":void 0,maxHeight:si(c),height:c?"100%":void 0,boxSizing:"border-box"});return jsx("div",{ref:m,className:["plainframe-ui-flex",i||""].join(" ").trim(),css:[C,a],...d,children:l})});ai.displayName="Flex";var _r=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:i=1,onAnimationEnd:a,asChild:l=true,className:s})=>{let c={transform:o?`scale(${i})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},d=g=>u=>{u.target===u.currentTarget&&u.propertyName==="transform"&&a?.(),g?.(u);};if(l&&isValidElement(e)){let g=e,u=g.props.css,b=Array.isArray(u)?[...u,c]:u?[u,c]:[c],C=g.props.onTransitionEnd,R=["plainframe-ui-transition-grow",g.props.className||"",s||""].join(" ").trim();return cloneElement(g,{...g.props,css:b,className:R,onTransitionEnd:d(C)})}let m=css(c);return jsx("div",{className:["plainframe-ui-transition-grow",s||""].join(" ").trim(),css:m,onTransitionEnd:d(),children:e})};var ii={h1:{size:"2.25rem",weight:700,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:600,lh:1.2,ls:"0"},body:{size:"0.95rem",weight:500,lh:1.2,ls:"0"},caption:{size:"0.8rem",weight:500,lh:1.2,ls:"0.01em"}},wu=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Tu={h1:"h1",h2:"h2",h3:"h3",h4:"h4",body:"span",caption:"span"},tn=({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:i,letterSpacing:a,align:l="left",textTransform:s="none",whiteSpace:c="normal",decoration:d="none",decorationStyle:m="solid",decorationThickness:g=1,decorationColor:u,italic:b,className:C,style:R,as:h})=>{let y=j(),p=ii[e]??ii.body,f=h??Tu[e]??"span",x=o??(y?.fontSizes&&y.fontSizes[e])??p.size,S=r??p.weight,v=i??p.lh,M=a??p.ls,P=n==="secondary"?y.text.secondary:n==="primary"?y.text.primary:n??"inherit",z=u??y.surface.border,D=css({boxSizing:"border-box",display:l==="left"?"inline":"block",textAlign:l==="left"?void 0:l,fontFamily:y?.fonts?.sans||"inherit",fontSize:x,fontWeight:S,lineHeight:v,letterSpacing:M,color:P,textTransform:s,whiteSpace:c,fontStyle:b?"italic":"normal",margin:0,padding:0}),N=d==="none"?css({textDecoration:"none"}):css({textDecorationLine:d,textDecorationStyle:m,textDecorationColor:z,textDecorationThickness:wu(g),textDecorationSkipInk:"auto"});return jsx(f,{className:[`pfui-typo-${e}`,C||""].join(" ").trim(),css:[D,N],style:R,"data-variant":e,children:t})};tn.displayName="Typography";var Yr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,ku=(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 Yr(n??e)}return e}}},ci=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:i="md",shadow:a=false,hoverEffect:l="none",label:s,labelAlign:c="center",aspectRatio:d,loading:m="lazy",decoding:g="async",fetchPriority:u,srcSet:b,sizes:C,placeholder:R,blurDataURL:h,placeholderColor:y="#f1f1f1",fallbackSrc:p,className:f,css:x,onClick:S,onLoad:v,onError:M,...P},z){let[D,N]=useState(false),[A,T]=useState(false),[L,w]=useState(false),E=j(),$=ku(i,E)??"0px",I=s?"figure":"div",H=css({display:"flex",flexDirection:"column",gap:s?E.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${$})`}),k=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${$})`,maxWidth:o?Yr(o):"100%",maxHeight:r?Yr(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:d,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:D&&(l==="rotate"||l==="scale-rotate")?"rotate(3deg)":"none",cursor:S?"pointer":void 0}),F=css({position:"absolute",inset:0,background:R==="color"?y:void 0,backgroundImage:R==="blur"&&h?`url(${h})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:R==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:L?0:1,pointerEvents:"none"}),B=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:D&&(l==="scale"||l==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(I,{className:["plainframe-ui-image",f||""].join(" ").trim(),css:[H,x],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:k,onMouseEnter:()=>N(true),onMouseLeave:()=>N(false),onClick:S,children:[!L&&R&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:F}),jsx("img",{ref:z,className:"plainframe-ui-image-img",css:B,src:A&&p?p:t,alt:n,srcSet:b,sizes:C,loading:m,decoding:g,fetchPriority:u,onLoad:_=>{w(true),v?.(_);},onError:_=>{T(true),M?.(_);},...P})]}),s&&jsx(tn,{as:"figcaption",variant:"caption",align:c,children:s})]})});ci.displayName="Image";var di=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Mu=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}},Au=e=>e*Math.PI/180,Nu=(e,t,n)=>{let o=Math.abs(Au(n)),r=Math.cos(o),i=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*i),h:Math.abs(t*r)+Math.abs(e*i)}};function Du(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 Hu=(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,ui=[1.02,1.03,1.02],pi=[1.06,1.08,1.06],Bu={sm:150,md:200,lg:260,xl:340},Lu=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function $u(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 Lu(n??e)}return e}}}var zu=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:i="md",hoverEffect:a="none",hovering:l,maxItems:s=3,shadow:c=false,cursor:d,outline:m,outlineColor:g,outlineWidth:u=3,outlineOffset:b=0,radius:C="md",label:R,labelAlign:h="center",css:y,className:p,...f}){let x=j(),S=Mu(r)??4/5,v=typeof o=="string"?o:void 0,M=typeof o=="number"?o:v&&/px$/.test(v)?parseFloat(v):Bu[i],P=Math.max(1,M/S),D=Children.toArray(t).filter(isValidElement).slice(0,s),N=D.length,A=Du(n,N),T=D.map((K,ne)=>Hu(n,N,ne)),L=K=>P*.6*T[K],w=K=>L(K)*S,E=0,$=0;for(let K=0;K<N;K++){let ne=w(K),me=L(K),pe=Math.max(Math.abs(A.base.ang[K]??0),Math.abs(A.exp.ang[K]??0)),fe=Math.max(Math.abs(A.base.dx[K]??0),Math.abs(A.exp.dx[K]??0)),oe=Math.max(Math.abs(A.base.dy[K]??0),Math.abs(A.exp.dy[K]??0)),ee=a==="expand"?pi[K]??1.08:a==="reveal"?ui[K]??1.03:1,se=Nu(ne,me,pe),ge=se.w*ee,ve=se.h*ee,Se=fe/100*ne*ee,De=oe/100*me*ee;E=Math.max(E,ge/2+Se),$=Math.max($,ve/2+De);}let I=Math.max(1,2*E),H=Math.max(1,2*$),k=Math.min(1,M/I,P/H),F=l===void 0?"pointer":"controlled",B=l?"true":void 0,_=css({display:"flex",flexDirection:"column",cursor:d||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:R?x.spacing.xs:0}),W=css({position:"relative",width:di(typeof o=="number"?o:M)??(typeof o=="string"?o:void 0),height:di(P)}),O=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${I}px`,height:`${H}px`,transform:`translate(-50%, -50%) scale(${k})`,transformOrigin:"center center"}),q=$u(C,x)??"0px",Q=K=>{let ne=n==="fan"?`rotate(${A.base.ang[K]}deg) translate(${A.base.dx[K]}%, ${A.base.dy[K]}%)`:n==="slide"?`translate(${A.base.dx[K]}%, ${A.base.dy[K]}%) rotate(${A.base.ang[K]}deg)`:n==="domino"?`translate(0%, ${A.base.dy[K]}%)`:`translate(${A.base.dx[K]}%, ${A.base.dy[K]}%) rotate(${A.base.ang[K]}deg)`,me=n==="fan"?`rotate(${A.exp.ang[K]}deg) translate(${A.exp.dx[K]}%, ${A.exp.dy[K]}%)`:n==="slide"?`translate(${A.exp.dx[K]}%, ${A.exp.dy[K]}%) rotate(${A.exp.ang[K]}deg)`:n==="domino"?`translate(0%, ${A.exp.dy[K]}%)`:`translate(${A.exp.dx[K]}%, ${A.exp.dy[K]}%) rotate(${A.exp.ang[K]}deg)`,pe=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${ne} scale(1)`,fe=a==="expand"?`${me} scale(${pi[K]??1.06})`:a==="reveal"?`${ne} scale(${ui[K]??1.03})`:`${ne} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${pe}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&K===1?10:K+1,lineHeight:0,boxShadow:c?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${u}px solid ${g??x.surface.appBg}`:void 0,outlineOffset:m?b:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${fe}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${fe}`}})},J=K=>css({width:`${w(K)}px`,aspectRatio:`${S}`,position:"relative",overflow:"hidden",borderRadius:q,"--pfui-image-radius":q,"& > *":{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(R?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",p||""].join(" ").trim(),"data-hover-mode":F,"data-hovered":B,css:[_,y],tabIndex:-1,...f,children:[jsx("div",{className:"plainframe-ui-image-stack",css:W,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:O,children:D.map((K,ne)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:Q(ne),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:J(ne),children:K})},ne))})}),R&&jsx(tn,{as:"figcaption",variant:"caption",align:h,children:R})]})});var mi=e=>typeof e=="number"?`${e}px`:e,fi={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function ju(e,t){if(e==null){let o=t.radius?.xs??t.radius?.sm??3;return mi(o)}if(typeof e=="number")return `${e}px`;let n=t.radius&&t.radius[e]||t.radii&&t.radii[e];return n!=null?mi(n):e}var Vu=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:i=true,uppercase:a=false,css:l,className:s="plainframe-ui-kbd",...c},d){let m=j(),g=le(),u=fi[o]??fi.sm,b=ju(r,m),C={br:m.neutral[300],txt:m.neutral[800],inset:m.neutral[0]},R=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",height:n==="ghost"?void 0:`${u.h}px !important`,minHeight:n==="ghost"?void 0:`${u.h}px !important`,paddingInline:n==="ghost"?0:`${u.px}px !important`,paddingBlock:"0 !important",fontFamily:i?'var(--pf-font-mono, Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, "Liberation Mono", "Courier New", monospace)':"inherit",fontSize:n==="ghost"?`${u.font*1.2}px !important`:`${u.font}px !important`,fontWeight:600,letterSpacing:.2,lineHeight:"0.2 !important",textTransform:a?"uppercase":"none",borderRadius:b,userSelect:"none",whiteSpace:"nowrap",verticalAlign:"baseline",position:"relative",transition:"box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease",outline:"none"}),h=css({"&&":{background:m.neutral[200],border:"none",boxShadow:"none",color:C.txt}}),y=css({"&&":{background:"transparent",color:C.txt,border:"none",boxShadow:"none"}}),p=css({"&&":{background:m.surface.panelBg,color:C.txt,border:`1px solid ${C.br}`,boxShadow:`inset 0 1px 0 ${C.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),f=n==="subtle"?h:n==="ghost"?y:p;return jsx("kbd",{ref:d,className:s,css:[g(),R,f,l],...c,children:t})});var Xu=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,qr=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:i,asChild:a=true,className:l,distance:s})=>{let d=Xu(s,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${d}`:t==="right"?d:"0",g=t==="up"?d:t==="down"?`-${d}`:"0",u={transform:r?"translate3d(0,0,0)":`translate3d(${m}, ${g}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},b=R=>h=>{h.target===h.currentTarget&&h.propertyName==="transform"&&i?.(),R?.(h);};if(a&&isValidElement(e)){let R=e,h=R.props.css,y=Array.isArray(h)?[...h,u]:h?[h,u]:[u],p=["plainframe-ui-transition-slide",R.props.className||"",l||""].join(" ").trim(),f=R.props.onTransitionEnd;return cloneElement(R,{...R.props,css:y,className:p,onTransitionEnd:b(f)})}let C=css(u);return jsx("div",{className:["plainframe-ui-transition-slide",l||""].join(" ").trim(),css:C,onTransitionEnd:b(),children:e})};var bi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,ep=(e,t)=>{e&&(typeof e=="function"?e(t):e.current=t);},tp=(...e)=>t=>{for(let n of e)ep(n,t);},yi=ie.createContext(null),xi=()=>{let e=useContext(yi);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},np=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEsc:i=true})=>{let[a,l]=useState(!!n),s=t??a,c=useCallback(m=>{t===void 0&&l(m),o?.(m);},[t,o]);useEffect(()=>{if(!s||!i)return;let m=g=>{g.key==="Escape"&&(g.stopPropagation(),c(false));};return window.addEventListener("keydown",m,true),()=>window.removeEventListener("keydown",m,true)},[s,i,c]);let d=useMemo(()=>({open:s,setOpen:c,lockScroll:r,closeOnEsc:i}),[s,c,r,i]);return jsx(yi.Provider,{value:d,children:e})},vi=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},i)=>{let{setOpen:a}=xi(),l=!!e&&ie.isValidElement(t),s=useCallback(d=>{if(l){let m=t.props.onClick;m?.(d);}r.onClick?.(d),d.defaultPrevented||a(true);},[l,t,r.onClick,a]),c=useCallback(d=>{if((d.key==="Enter"||d.key===" ")&&(d.preventDefault(),a(true)),l){let m=t.props.onKeyDown;m?.(d);}r.onKeyDown?.(d);},[l,t,r.onKeyDown,a]);if(l){let d=t,m=d.props?.css;return ie.cloneElement(d,{ref:tp(i,d.ref),className:[d.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,o].filter(Boolean),"aria-haspopup":"dialog",onClick:s,onKeyDown:c,...r})}return jsx("button",{ref:i,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:s,onKeyDown:c,...r,children:t})});vi.displayName="ModalTrigger";var Ci=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:i="lg",backdrop:a=true,backdropBlur:l=true,backdropBlurDepth:s=5,closeOnBackdropClick:c=true,transitionVariant:d="fade",direction:m="up",transitionDuration:g=300,containerCss:u,backdropCss:b,className:C,...R},h)=>{let{open:y,setOpen:p,lockScroll:f}=xi(),x=css({width:bi(n),height:bi(o),maxWidth:t==="inset"?"100%":void 0,maxHeight:t==="inset"?"100%":void 0}),S=jsx(Xt,{role:"dialog","aria-modal":"true",className:["plainframe-ui-modal",C||""].join(" ").trim(),padding:i,radius:r,variant:"panel",css:[x,u],ref:h,...R,children:e}),v=d==="none"?S:d==="slide"?jsx(qr,{on:y,direction:m,duration:g,children:S}):d==="grow"?jsx(_r,{on:y,duration:g,children:S}):jsx(Ur,{on:y,duration:g,children:S});if(!a)return jsx(Fragment,{children:v});let M=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Pr,{on:y,blur:l,blurDepth:s,onClickAway:c?()=>p(false):void 0,css:[M,b].filter(Boolean),lockScroll:f,children:v})});Ci.displayName="ModalContent";var dp={xs:{h:22,px:8,font:11,radius:8,gap:4,icon:12},sm:{h:28,px:10,font:13,radius:9,gap:6,icon:14},md:{h:34,px:12,font:14,radius:10,gap:8,icon:16}},up=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:i=1,disabled:a=false,showFirstLast:l=false,loop:s=false,size:c="sm",variant:d="subtle",gap:m,className:g,css:u})=>{let b=j(),C=le(),R=t!==void 0,[h,y]=useState(n),p=Math.max(1,e),f=Ho(R?t:h,1,p),x=useCallback(B=>{let _=Ho(B,1,p);R||y(_),o?.(_);},[R,p,o]),S=useMemo(()=>pp({count:p,page:f,siblingCount:r,boundaryCount:i}),[p,f,r,i]),v=dp[c],M=b.palette?.primary?.[600],P=b.surface?.border,z=d==="subtle"?b.surface.subtleHover:d==="ghost"?b.surface?.subtleBg:b.surface.panelHover,D=b.text?.primary??"#111",N=d==="subtle"?b.surface?.subtleBg:"transparent",A=css({display:"inline-flex",alignItems:"center",gap:m??v.gap,flexWrap:"wrap",borderRadius:b.radius?.md,background:N,padding:d==="subtle"?b.spacing.xs:0,userSelect:"none"},...Array.isArray(u)?u:u?[u]:[]),T=css({minWidth:v.h,height:v.h,padding:`0 ${v.px}px`,borderRadius:v.radius,fontSize:v.font,lineHeight:1,border:"1px solid transparent",background:"transparent",color:D,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",transition:"all .16s ease !important",outline:"1.5px solid transparent","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),L=css({width:v.h,minWidth:v.h,height:v.h,padding:0}),w=(B=false)=>css([T,C({color:B?"primary":"neutral"}),d==="outlined"?B?{background:M,color:b.text.onColors.primary,borderColor:M}:{background:"transparent",borderColor:P,":hover":{background:z}}:d==="ghost"?B?{background:M,color:b.text.onColors.primary}:{":hover":{background:z}}:B?{background:M,color:b.text.onColors.primary,borderColor:M}:{":hover":{background:z}}]),E=useCallback(()=>x(1),[x]),$=useCallback(()=>x(p),[x,p]),I=useCallback(()=>{f===1?s&&x(p):x(f-1);},[f,s,p,x]),H=useCallback(()=>{f===p?s&&x(1):x(f+1);},[f,s,p,x]),k=a||f===1&&!s,F=a||f===p&&!s;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",g||""].join(" ").trim(),css:A,onKeyDown:B=>{a||(B.key==="ArrowLeft"&&(B.preventDefault(),I()),B.key==="ArrowRight"&&(B.preventDefault(),H()),B.key==="Home"&&(B.preventDefault(),E()),B.key==="End"&&(B.preventDefault(),$()));},children:[l&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":k,disabled:k,css:[w(false),L],onClick:E,style:{backgroundColor:d==="subtle"?b.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:v.icon,height:v.icon}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":k,disabled:k,css:[w(false),L],onClick:I,style:{backgroundColor:d==="subtle"?b.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:v.icon,height:v.icon}})}),S.map((B,_)=>typeof B=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":B===f?`Page ${B}, current page`:`Go to page ${B}`,"aria-current":B===f?"page":void 0,css:w(B===f),onClick:()=>x(B),children:B},B):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([T,C(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:v.h}]),children:"\u2026"},`e${_}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":F,disabled:F,css:[w(false),L],onClick:H,style:{backgroundColor:d==="subtle"?b.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:v.icon,height:v.icon}})}),l&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":F,disabled:F,css:[w(false),L],onClick:$,style:{backgroundColor:d==="subtle"?b.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:v.icon,height:v.icon}})})]})};function Ho(e,t,n){return Math.max(t,Math.min(n,e))}function pp({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Do(1,e);let i=Do(1,Math.min(o,e)),a=Do(Math.max(e-o+1,o+1),e),l=Ho(t-n,o+2,Math.max(o+2,e-o-2*n-1)),s=Ho(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),c=[],d=m=>{let g=c[c.length-1];g!==m&&(g==="ellipsis"&&m==="ellipsis"||c.push(m));};return i.forEach(d),l>o+2?d("ellipsis"):o+1<l&&d(o+1),Do(l,s).forEach(d),s<e-o-1?d("ellipsis"):e-o>s&&d(e-o),a.forEach(d),c}function Do(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var Ti=createContext(null),$o=()=>{let e=useContext(Ti);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function Fp(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ts=(...e)=>t=>{for(let n of e)Fp(n,t);},Zr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Pp=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,i=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${i+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},Bo=(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}},Mp=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,children:i})=>{let[a,l]=useState(!!t),s=e??a,c=C=>{e===void 0&&l(C),n?.(C);},d=useRef(null),m=useRef(null),g=(C=120)=>{m.current!=null&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>c(false),C);},u=()=>{m.current!=null&&(window.clearTimeout(m.current),m.current=null);};Pp(r&&s);let b=useMemo(()=>({open:s,setOpen:c,triggerOn:o,referenceRef:d,scheduleClose:g,cancelClose:u}),[s,o]);return jsx(Ti.Provider,{value:b,children:i})},Si=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:i,triggerOn:a,referenceRef:l,scheduleClose:s,cancelClose:c}=$o(),d=ie.Children.only(t),m=d.props||{},g=ts(l,o,d.ref),u=a==="click"?{onClick:C=>{C.stopPropagation(),i(!r),m.onClick?.(C);}}:{onMouseEnter:C=>{c(),r||i(true),m.onMouseEnter?.(C);},onMouseLeave:C=>{s(),m.onMouseLeave?.(C);}},b={"aria-haspopup":"dialog","aria-expanded":r};if(e){let C=d.props?.css;return ie.cloneElement(d,{ref:g,css:[C,n].filter(Boolean),...u,...b})}return ie.createElement("button",{ref:g,type:"button",css:[n],...u,...b,children:d})});Si.displayName="PopoverTrigger";var Ei=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:i}=$o(),a=ie.Children.only(o),l=ts(i,r,a.ref);if(e){let c=a.props?.css;return ie.cloneElement(a,{ref:l,css:[c,n].filter(Boolean)})}let s=css({display:"inline-block",width:Zr(t),verticalAlign:"middle",...n});return jsx("span",{ref:l,css:s,children:a})});Ei.displayName="PopoverAnchor";function Ap(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let i=t,a=n==="left"?"start":n==="right"?"end":"center";return a==="center"?i:`${i}-${a}`}let o=n==="left"?"left":"right",r="center";return r==="center"?o:`${o}-${r}`}var ki=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:i,width:a,height:l,padding:s,paddingX:c,paddingY:d,radius:m="lg",css:g,...u},b)=>{let{open:C,setOpen:R,triggerOn:h,referenceRef:y,scheduleClose:p,cancelClose:f}=$o(),x=j(),S=Ap(e),{refs:v,x:M,y:P,strategy:z,context:D}=useFloating({open:C,onOpenChange:R,whileElementsMounted:autoUpdate,placement:S,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{y.current&&v.setReference(y.current);},[v,y]);let N=useDismiss(D,{outsidePressEvent:"pointerdown",escapeKey:true}),A=useRole(D,{role:"dialog"}),{getFloatingProps:T}=useInteractions([N,A]),[L]=D.placement.split("-"),w=L,E=`${w==="left"?"right":w==="right"?"left":"center"} ${w==="top"?"bottom":w==="bottom"?"top":"center"}`,$=8,I=w==="top"?{y:$}:w==="bottom"?{y:-$}:w==="left"?{x:$}:{x:-$},H={initial:{opacity:0,scale:.96,...I},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...I},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=x.surface.panelBg,F=x.text.primary,B=`${x.componentHeights.border} solid ${x.surface.border}`,_=Bo(s,x.spacing),W=Bo(c,x.spacing),O=Bo(d,x.spacing),q={};_&&(q.padding=_),W&&(q.paddingInline=W),O&&(q.paddingBlock=O);let Q=Bo(m,x.radius)??x.radius.md,J="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",de=css({position:z,top:P??0,left:M??0,zIndex:1e3,transformOrigin:E,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:Zr(a)??"fit-content",height:Zr(l)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),K=r?css({}):css({background:k,color:F,border:B,borderRadius:Q,boxShadow:J,...q,...q.padding||q.paddingInline||q.paddingBlock?{}:{padding:typeof x.spacing?.sm=="number"?`${x.spacing.sm}px ${x.spacing.md}px`:`${x.spacing?.sm??"0.5rem"} ${x.spacing?.md??"1rem"}`}}),ne=h==="hover"?{onMouseEnter:f,onMouseLeave:()=>p()}:{},me=ts(v.setFloating,b),pe=jsx(motion.div,{className:"plainframe-ui-popover",...T({...u,ref:me,...ne}),...H,css:[de,K,g],children:i});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:C?pe:null})})});ki.displayName="PopoverContent";var Np=()=>{let e=$o();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var Hp=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Bp=({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:i,as:a="div"})=>{let l=j(),s=l.surface.border,c=css([{display:"inline-block",boxSizing:"border-box",maxWidth:Hp(n,"fit-content"),width:"100%",padding:`0 ${l.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${s}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${s}`:"none"},i]);return jsx(a,{className:r??"plainframe-ui-quote",css:c,children:e})};var Mi=createContext(null),Op=()=>{let e=useContext(Mi);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},Wp=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},jp=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:i="horizontal",variant:a="filled",className:l,children:s,anchorOrigin:c,css:d})=>{let m=j(),g=e!==void 0&&n!==void 0,[u,b]=useState(t),C=g?e:u,R=useRef([]),[h,y]=useState(0),p=()=>y(T=>T+1),f=useCallback(T=>{g||b(T),n?.(T);},[g,n]),x=useCallback(T=>(R.current.push(T),p(),R.current.length-1),[]),S=useCallback((T,L)=>{let w=R.current[T];w&&(R.current[T]={...w,...L},p());},[]),v=()=>R.current.map((T,L)=>({it:T,i:L})).filter(({it:T})=>T.ref&&!T.disabled).map(({i:T})=>T),M=useCallback((T,L)=>{let w=v();if(!w.length)return;let E=Math.max(0,w.indexOf(T)),$=w[(E+L+w.length)%w.length],I=R.current[$]?.ref;if(I){I.focus();let H=R.current[$]?.value;H!==void 0&&f(H);}},[f]),P=useCallback(T=>{let L=v();if(!L.length)return;let w=T==="first"?L[0]:L[L.length-1],E=R.current[w]?.ref;if(E){E.focus();let $=R.current[w]?.value;$!==void 0&&f($);}},[f]),z=useMemo(()=>{let T=R.current.filter(w=>w.ref&&!w.disabled);return T.length?T.some(w=>w.value===C)?C:T[0]?.value:void 0},[C,h]),D=useMemo(()=>({selected:C,setSelected:f,disabled:o,size:r,direction:i,variant:a,register:x,update:S,moveFocusBy:M,moveToEdge:P,focusValue:z,theme:m,anchorOrigin:Wp(c)}),[C,f,o,r,i,a,x,S,M,P,z,m,c]),N=css({width:"fit-content"}),A=css({display:"flex",flexDirection:i==="vertical"?"column":"row",gap:m.spacing.sm,width:"fit-content",alignItems:i==="vertical"?"stretch":"center"});return jsx("div",{className:l??"plainframe-ui-radio-group",css:[N,d],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:A,children:jsx(Mi.Provider,{value:D,children:s})})})},Vp=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:i,setSelected:a,disabled:l,size:s,register:c,update:d,moveFocusBy:m,moveToEdge:g,theme:u,variant:b,focusValue:C,anchorOrigin:R}=Op(),h=l||t,y=i===e,p=["sm","md","lg"].includes(s)?s:"md",f=p==="sm"?16:p==="lg"?24:20,x=W=>u.palette?.primary?.[W],S=x(600),v=x(100),M=u.neutral[300],P=u.palette.primary[300],z=u.text.onColors?.primary??u.neutral[0],D="transparent",N=P,A=z;b==="soft"?(D=v,N=null,A=S):b==="outlined"?(D=x(50),N=P,A=S):(D=u.neutral[200],N="transparent",A=z),y&&(b==="outlined"?(D=v,N=P,A=S):b==="filled"?(D=S,N=null,A=z):(D=v,N=null,A=S));let T=b==="filled"?M:u.palette.primary[100],L=useRef(null),w=useRef(-1);useEffect(()=>{w.current=c({ref:L.current,value:e,disabled:!!h});},[c]),useEffect(()=>{d(w.current,{ref:L.current,value:e,disabled:!!h});},[d,h,e]);let E=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:R.vertical==="center"?u.spacing.sm:0,rowGap:R.vertical==="center"?0:u.spacing.xs,justifyItems:"center",alignItems:"center",opacity:h?.5:1,borderRadius:u.radius.md,cursor:h?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:u.fontSizes.md,fontWeight:500,padding:u.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":h||y?{}:{background:T,boxShadow:b==="outlined"?`inset 0 0 0 ${u.componentHeights.border} ${P}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none",filter:"brightness(1.06)"}}),$=css({width:f,height:f,minWidth:f,minHeight:f,borderRadius:u.radius.full,background:D,boxShadow:N?`inset 0 0 0 ${u.componentHeights.border} ${N}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),I=css({width:y?f*.45:0,height:y?f*.45:0,borderRadius:u.radius.full,background:y?A:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:y?"scale(1)":"scale(0.6)",opacity:y?1:0}),H=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),k=(()=>{let W=R.horizontal,O=R.vertical;return O==="center"?{col:W==="right"?3:1,row:2}:{col:2,row:O==="top"?1:3}})(),B=!h&&C===e?0:-1,_=le();return jsxs("button",{ref:L,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":y,"aria-disabled":h||void 0,disabled:h,tabIndex:B,onClick:()=>{h||a(e);},onKeyDown:W=>{h||(W.key==="Enter"||W.key===" "?(W.preventDefault(),a(e)):W.key==="ArrowRight"||W.key==="ArrowDown"?(W.preventDefault(),m(w.current,1)):W.key==="ArrowLeft"||W.key==="ArrowUp"?(W.preventDefault(),m(w.current,-1)):W.key==="Home"?(W.preventDefault(),g("first")):W.key==="End"&&(W.preventDefault(),g("last")));},css:[E,_({color:y?"primary":"neutral"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[$,css({gridColumn:k.col,gridRow:k.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:I})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:H,children:o})]})};var Xp=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:i=0,onAnimationEnd:a,asChild:l=true,className:s})=>{let c={transform:`rotate(${o?i:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},d=g=>u=>{u.target===u.currentTarget&&u.propertyName==="transform"&&a?.(),g?.(u);};if(l&&isValidElement(e)){let g=e,u=g.props.css,b=Array.isArray(u)?[...u,c]:u?[u,c]:[c],C=["plainframe-ui-transition-rotate",g.props.className||"",s||""].join(" ").trim(),R=g.props.onTransitionEnd;return cloneElement(g,{...g.props,css:b,className:C,onTransitionEnd:d(R)})}let m=css(c);return jsx("div",{className:["plainframe-ui-transition-rotate",s||""].join(" ").trim(),css:m,onTransitionEnd:d(),children:e})};var os=e=>ie.isValidElement(e),jn=e=>e.type?.displayName||e.type?.name||"",Jp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,rs=e=>{let t=e.props;if(typeof t.label=="string"||typeof t.label=="number")return String(t.label);let n=t.children;if(typeof n=="string"||typeof n=="number")return String(n)};function Qp(e,t){let o=ie.Children.toArray(e).filter(os).find(s=>jn(s)==="MenuRadioGroup");if(o){let s=t??o.props.value;if(s===void 0)return {mode:"radio",selectedLabels:[]};let d=ie.Children.toArray(o.props.children).filter(os).filter(g=>jn(g).includes("MenuRadioItem")).find(g=>Object.is(g.props.value,s)),m=d?rs(d):void 0;return {mode:"radio",selectedLabels:m?[m]:[]}}let r=[],i=s=>{ie.Children.forEach(s,c=>{if(!os(c))return;let d=jn(c);d.includes("MenuItem")||d.includes("MenuCheckboxItem")||d.includes("MenuRadioItem")?r.push(c):c.props&&c.props.children&&i(c.props.children);});};if(i(e),t!==void 0){let c=(Array.isArray(t)?t:[t]).map(m=>{let g=r.find(u=>Object.is(u.props.value,m));return g?rs(g):void 0}).filter(m=>typeof m=="string");return {mode:r.some(m=>jn(m).includes("Checkbox"))?"checkbox":"menu",selectedLabels:c}}let a=[],l=false;return r.forEach(s=>{let c=s.props,d=!!c.checked||c["aria-checked"]===true,m=!!c.selected||c["aria-selected"]===true;if(d||m){let g=rs(s);g&&a.push(g);}jn(s).includes("Checkbox")&&(l=true);}),{mode:l?"checkbox":"menu",selectedLabels:a}}function Zp({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:i,endIcon:a,disabled:l,size:s="md",variant:c="subtle",fullWidth:d,width:m=200,menuAlign:g="left",menuWidth:u,menuMaxHeight:b=280,wrapperCss:C,labelCss:R,triggerCss:h,menuCss:y,children:p,className:f,menuSize:x="md",triggerRender:S}){let v=j(),M=le(),P=ie.useId(),z=`${P}-label`,D=`${P}-menu`,[N,A]=ie.useState(false),{selectedLabels:T}=Qp(p,e??t);T.length===0?typeof r=="string"?r:void 0:T.join(", ");let w={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}},E=w[s]||w.md,$={position:"relative",width:d?"100%":Jp(m)??"auto",maxWidth:"100%"},I={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:E.radius,minHeight:E.minHeight,fontSize:v.fontSizes.md,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:l?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:v.text.primary,background:"transparent",whiteSpace:"nowrap"},H=c==="subtle"?{background:v.surface.subtleBg}:c==="outlined"?{background:v.surface.panelBg,border:`1px solid ${v.surface.border}`}:{background:"transparent"},k={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},F={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},B={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},_=jsx(ChevronsUpDown,{size:16,css:css({color:v.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),W={left:"start",center:"center",right:"end"},O=q=>{l||(q.key==="ArrowDown"||q.key==="ArrowUp"||q.key==="Enter"||q.key===" ")&&(q.preventDefault(),A(true));};return jsxs("div",{css:[css($),C].filter(Boolean),className:["plainframe-ui-select-wrapper",f||""].join(" ").trim(),children:[o&&jsx("div",{id:z,className:"plainframe-ui-select-label",css:[css({marginBottom:6,fontSize:v.fontSizes.md,fontWeight:500,color:v.text.secondary}),R].filter(Boolean),children:o}),jsxs(Ut,{size:x,open:N,onOpenChange:A,children:[jsx(_t,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:l,"aria-haspopup":"menu","aria-expanded":N||void 0,"aria-controls":D,"aria-labelledby":o?z:void 0,onKeyDown:O,onClick:()=>A(q=>!q),className:"plainframe-ui-select-trigger",css:[css(I),css(H),h,M()].filter(Boolean),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(k),children:S?S(T.length>1?T:T[0]??void 0):jsxs(Fragment,{children:[i&&jsx("span",{css:css(F),children:i}),jsx("span",{css:css(B),title:typeof(T.length?T.join(", "):r)=="string"?(T.length?T.join(", "):r)??void 0:void 0,children:T.length?T.join(", "):r??"Select\u2026"})]})}),a??_]})}),jsx(kt,{id:D,gap:2,align:W[g],sameWidth:u==null,width:u??m,className:"plainframe-ui-select-menu",css:[css({maxHeight:typeof b=="number"?`${b}px`:b,overflowY:"auto"}),y].filter(Boolean),children:p})]})]})}var ss=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,tm=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("),Vc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function jc(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]&&Vc.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:u=.75,wrapperCss:i,trackCss:l,barCss:c,circleCss:p,"aria-label":R})=>{let f=U(),v=typeof t=="number",k=Math.max(o-n,1),C=v?Ga(t,n,o):void 0,T=v?(C-n)/k*100:void 0,h=jc(f,r),d=f.surface.subtleBg,m=f.radius?.md;return e==="circular"?jsx(qc,{size:s,active:h,isDeterminate:v,percent:T,spinDuration:u,wrapperCss:i,trackCss:l,circleCss:p,ariaLabel:R,thickness:a}):jsx(Uc,{thickness:a,active:h,track:d,radius:m,isDeterminate:v,percent:T,wrapperCss:i,trackCss:l,barCss:c,ariaLabel:R,min:n,max:o,value:C})}),Uc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:u,barCss:i,ariaLabel:l,min:c,max:p,value:R})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),v=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),k=css([{position:"relative",width:"100%",height:os(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(u)?u:u?[u]:[]]),C=r?Math.max(s??0,qa):qa,T=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${C/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),h={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...h,left:"-35%",right:"100%",animation:`${Wc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),m=css([{...h,left:"-200%",right:"100%",animation:`${Kc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),y=r?{role:"progressbar","aria-valuemin":c,"aria-valuemax":p,"aria-valuenow":R}:{role:"progressbar","aria-busy":true};return l&&(y["aria-label"]=l),jsx("span",{css:v,...y,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:k,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:T}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),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:u,circleCss:i,ariaLabel:l})=>{let c=U(),p=40,R=(p-t)/2,f=2*Math.PI*R,k=`${(o?Ga((r??0)/100,.01,1):.7)*f} ${f}`,C=css([{display:"inline-block",width:os(e,`${c.componentHeights.md}`),height:os(e,`${c.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),T=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(u)?u:u?[u]:[]]),h=css([{stroke:n,strokeLinecap:"butt",strokeDasharray:k,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]:[]]),d=o?{role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(r??0)}:{role:"progressbar","aria-busy":true};return l&&(d["aria-label"]=l),jsx("span",{css:C,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:T,viewBox:`0 0 ${p} ${p}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:p/2,cy:p/2,r:R,strokeWidth:t,css:h})})})};var Ja=createContext(null),Za=()=>{let e=useContext(Ja);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}}),Qa=forwardRef(function({intent:t="neutral",variant:n="soft",intentIcon:o,closeIcon:r,onClose:s,width:a="100%",size:u="md",loading:i=false,css:l,children:c,...p},R){let f=U(),v=useId(),k=useId(),C=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(u)?F[u]:F.md},[u,f.typography,f.radius,f.spacing]),T=f.palette??{},h=f.neutral??{},d=useMemo(()=>{let S=(E=>E==="danger"?T.danger??T.error??h:E==="warning"?T.warning??h:E==="success"?T.success??h:E==="info"?T.info??T.primary??h:h)(t),g=S?.[50]??h[50],b=S?.[300]??h[300],A=S?.[600]??S?.[500]??h[600],H=S?.[700]??A,B=S?.[800]??f.text?.primary??"#000",M=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:A,fg:M,border:void 0,iconColor:M}:n==="outlined"?{bg:g,fg:B,border:`1px solid ${b}`,iconColor:B}:n==="ghost"?{bg:"transparent",fg:H,border:"none",iconColor:H}:{bg:g,fg:B,border:void 0,iconColor:H}},[t,n,h,T,f.text]),m=t==="danger"||t==="warning"?"alert":"status",y=useMemo(()=>i?jsx(no,{variant:"circular",color:d.iconColor,size:C.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:C.iconSize,height:C.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:C.iconSize,height:C.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:C.iconSize,height:C.iconSize},color:d.iconColor}):jsx(Info,{css:{width:C.iconSize,height:C.iconSize},color:d.iconColor})),[i,o,t,C.iconSize,d.iconColor]),N=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${C.paddingY} ${C.paddingX}`,gap:C.gap,borderRadius:C.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:C.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[d.bg,d.border,d.fg,C.fontSize,C.gap,C.paddingX,C.paddingY,C.radius,a]),x=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:C.gap,minWidth:0,flex:1}),[C.gap]),w=useMemo(()=>[ru,{color:d.iconColor}],[d.iconColor]),P=useMemo(()=>css({display:"flex",alignItems:"center",gap:C.gap,marginLeft:C.gap,flex:"0 0 auto"}),[C.gap]),$=useMemo(()=>[su,{color:d.fg}],[d.fg]),W=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:C,titleId:v,descId:k}),[d.fg,d.iconColor,C,v,k]),K=me.Children.toArray(c).some(F=>me.isValidElement(F)&&F.type===as),I=me.Children.toArray(c).some(F=>me.isValidElement(F)&&F.type===is);return jsx(Ja.Provider,{value:W,children:jsxs("div",{ref:R,role:m,"aria-live":m==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":K?v:void 0,"aria-describedby":I?k:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[N,l],...p,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:x,children:[y&&jsx("span",{className:"plainframe-ui-alert-icon",css:w,children:y}),jsx("div",{className:"plainframe-ui-alert-content",css:ou,children:c})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:P,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:s,disabled:i,className:"plainframe-ui-alert-close",css:$,children:r??jsx(X,{strokeWidth:2,size:C.iconSize-2})})})]})})});Qa.displayName="Alert";var as=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:u}=Za(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:u,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});as.displayName="AlertTitle";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Za(),u=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:[u,n],...o,children:t})});is.displayName="AlertDescription";var ls=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 ti(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:u,disabled:i=false,fullWidth:l=false,width:c=250,size:p="md",variant:R="subtle",rounded:f=false,startIcon:v,endIcon:k,togglePasswordVisible:C=false,showClear:T,type:h="text",step:d,focusRingMode:m="always",className:y,wrapperCss:N,inputCss:x,labelCss:w,helperRowCss:P,helperTextCss:$,startIconCss:W,endIconCss:K,css:I,onBlur:F,onFocus:S,onKeyDown:g,autoFocus:b,name:A,id:H,tabIndex:B,autoComplete:M,readOnly:E,required:L,maxLength:z,onSurfaceClick:O},_){let D=U(),j=Yo(),J=useId(),ae=useMemo(()=>{let ce={sm:{fontSize:D.typography.sizes.sm,minHeight:D.componentHeights.sm,labelFont:D.typography.sizes.xs,helperFont:D.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:D.spacing.md,iconSize:D.typography.sizes.xs,codeFontSize:21},md:{fontSize:D.typography.sizes.sm,minHeight:D.componentHeights.md,labelFont:D.typography.sizes.sm,helperFont:D.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:D.spacing.md,iconSize:D.typography.sizes.xs,codeFontSize:24},lg:{fontSize:D.typography.sizes.sm,minHeight:D.componentHeights.lg,labelFont:D.typography.sizes.md,helperFont:D.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:D.spacing.md,iconSize:D.typography.sizes.xs,codeFontSize:28}},ke=["sm","md","lg"].includes(p)?p:"md";return ce[ke]},[p,D]),q=D.neutral,X$1=D.text,le=h==="number",ie=h==="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&&(d!=null&&String(d).includes(".")||/[.,]/.test(Ce??"")),he=le?we?"decimal":"numeric":void 0,Ve=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&&R==="outlined"?D.palette.danger?.[50]??D.surface.panelBg:a&&R==="subtle"?D.palette.danger?.[50]??D.surface.subtleBg:R==="outlined"?D.surface.panelBg:R==="subtle"?D.surface.subtleBg:"transparent",Q=D.componentHeights.border,ee=R==="outlined"?`${Q} solid ${a?D.palette.danger?.[300]??D.surface.border:D.surface.border}`:"none",se=Xt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":c!=null?ls(c):void 0,flex:"0 0 auto",fontWeight:500}),pe=useMemo(()=>Xt({fontSize:ae.labelFont,fontWeight:500,color:a?D.palette.danger?.[700]??X$1.primary:i?q[500]:X$1.primary,marginBottom:4,display:"inline-block"},...Gt(w)),[ae.labelFont,a,i,q,X$1,D.palette.danger,w]),Se=useMemo(()=>Xt({display:"flex",alignItems:"center",gap:D.spacing.sm,padding:`${ls(ae.paddingY)} ${ls(ae.paddingX)}`,background:Ee,border:ee,borderRadius:f?D.radius.full:D.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(N),...Gt(I)),[D,ae.minHeight,ae.paddingX,ae.paddingY,Ee,ee,f,i,N,I]),Ne=useMemo(()=>Xt({flex:1,minWidth:0,fontSize:ae.fontSize,fontWeight:500,fontFamily:"inherit",color:i?q[500]:a?D.palette.danger?.[800]??X$1.primary:X$1.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:a?D.palette.danger?.[700]??X$1.secondary:X$1.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?D.palette.danger?.[800]??X$1.primary:X$1.primary} !important`,boxShadow:`0 0 0 1000px ${Ee} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?D.palette.danger?.[800]??X$1.primary:X$1.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Gt(x)),[ae.fontSize,i,q,X$1,a,D.palette.danger,le,Ee,x]),Y=useMemo(()=>Xt({display:"inline-flex",alignItems:"center",color:a?D.palette.danger?.[800]??X$1.secondary:X$1.secondary,marginLeft:-3},...Gt(W)),[a,D.palette.danger,X$1.secondary,W]),oe=useMemo(()=>Xt({display:"inline-flex",alignItems:"center",color:a?D.palette.danger?.[800]??X$1.secondary:X$1.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Gt(K)),[a,D.palette.danger,X$1.secondary,i,K]),re=useMemo(()=>Xt({minHeight:16,fontSize:ae.helperFont,color:a?D.palette.danger?.[700]??X$1.secondary:X$1.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Gt(P)),[ae.helperFont,a,D.palette.danger,X$1.secondary,P]),qe=useMemo(()=>Xt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Gt($)),[$]),V=useRef(null),ue=useCallback(ce=>{V.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),de=useCallback(ce=>{let ke=ce.target.value;if(le){Z(ke);return}z&&ke.length>z||Ie(ke);},[le,z,Ie,Z]),[fe,ze]=useState(false),Oe=useCallback(()=>{i||ze(ce=>!ce);},[i]),st=useCallback(()=>{i||(Ie(""),V.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(()=>v?jsx("span",{css:Y,children:ti(v,Ye)}):null,[v,Y,Ye]),tn=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),nn=useMemo(()=>{let ce=[];if(ie&&C){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"));}T&&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=k?jsx("span",{css:oe,children:ti(k,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,C,fe,Ye,oe,tn,i,T,Ce,k,Oe,st]),Sn=u!=null?`${H??J}-help`:void 0,on=H??J,Je=useCallback(ce=>{if(i)return;ce.stopPropagation();let ke=V.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=V.current;if(ke&&(O?.(ce),document.activeElement!==ke)){ke.focus({preventScroll:true});try{let at=ke.value?.length??0;ke.setSelectionRange?.(at,at);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",y||""].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:[j({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?"password":h==="number"?"text":h,inputMode:he,pattern:Ve,value:Ce,maxLength:le?void 0:z,onChange:le?ce=>Z(ce.target.value):de,placeholder:s||"",disabled:i,onBlur:F,onFocus:S,onKeyDown:g,autoFocus:b,name:A,tabIndex:B,autoComplete:M,readOnly:E,required:L,"aria-invalid":!!a||void 0,"aria-describedby":Sn}),nn]}),u!=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:u})})]})}));Qo.displayName="TextField";var er=me.createContext("ghost"),Tt=me.createContext(false),ai=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:u,children:i,label:l,allItemsTabbable:c=false,...p},R){let f=U(),[v,k]=useState(false),C=useRef(null),T=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),h=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",d=s?void 0:css({background:h,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":T,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",y=useMemo(()=>({isKeyboardNav:v,setIsKeyboardNav:k}),[v]),N=useMemo(()=>({allItemsTabbable:c}),[c]),x=useCallback(S=>Array.from(S.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(g=>{if(g.closest('[role="menu"]')!==S)return false;let b=window.getComputedStyle(g);return b.display!=="none"&&b.visibility!=="hidden"}),[]),w=useCallback(S=>{S.removeAttribute("data-keyboard-nav"),S.querySelectorAll("[data-highlighted]").forEach(g=>g.removeAttribute("data-highlighted")),k(false);},[]),P=useRef(false),$=useCallback(S=>{if(S.target!==S.currentTarget)return;if(P.current){P.current=false;return}let g=S.currentTarget,b=x(g);b.length>0&&(k(true),g.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(A=>A.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(A=>A.removeAttribute("data-hovered")),b[0].setAttribute("data-highlighted",""),b[0].focus({preventScroll:true}));},[x]),W=useCallback(S=>{let g=S.currentTarget,b=x(g);if(b.length===0)return;if(S.key==="Tab"){P.current=true,g.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),k(false),g.tabIndex=-1,requestAnimationFrame(()=>{g.tabIndex=0,P.current=false;});return}let A=g.querySelector("[data-highlighted]"),H=g.querySelector("[data-hovered]"),B=A||H,M=B?b.indexOf(B):-1;if(S.key==="ArrowDown"||S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),k(true),g.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(z=>z.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(z=>z.removeAttribute("data-hovered")),M===-1&&(M=S.key==="ArrowDown"?-1:b.length);let E=S.key==="ArrowDown"?1:-1,L=(M+E+b.length)%b.length;b[L].setAttribute("data-highlighted",""),b[L].focus({preventScroll:true});return}if(S.key==="Home"){S.preventDefault(),S.stopPropagation(),k(true),g.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(E=>E.removeAttribute("data-hovered")),b[0].setAttribute("data-highlighted",""),b[0].focus({preventScroll:true});return}if(S.key==="End"){S.preventDefault(),S.stopPropagation(),k(true),g.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(E=>E.removeAttribute("data-hovered")),b[b.length-1].setAttribute("data-highlighted",""),b[b.length-1].focus({preventScroll:true});return}if(S.key==="Escape"){S.preventDefault(),g.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),k(false),g.blur();return}},[x]),K=useCallback(S=>{let g=S.currentTarget;g.hasAttribute("data-keyboard-nav")&&w(g);},[w]),I=useCallback(S=>{let g=S.currentTarget;g.hasAttribute("data-keyboard-nav")&&w(g);},[w]),F=useCallback(S=>{C.current=S,typeof R=="function"?R(S):R&&(R.current=S);},[R]);return jsx(oo.Provider,{value:y,children:jsx(ro.Provider,{value:N,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":v?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[d,u],onFocus:$,onKeyDown:W,onPointerMove:K,onPointerDown:I,...p,children:i})]})})})})})});ai.displayName="Menu";var li=createContext(null),or=()=>{let e=useContext(li);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);},us=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[u,i]=useState(!!t),l=e??u,c=C=>{e===void 0&&i(C),n?.(C);},p=useRef(null),R=useRef(null),f=(C=120)=>{R.current!=null&&window.clearTimeout(R.current),R.current=window.setTimeout(()=>c(false),C);},v=()=>{R.current!=null&&(window.clearTimeout(R.current),R.current=null);};Hu(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let C=T=>{if(T.key!=="Tab")return;let h=document.querySelector(".plainframe-ui-popover");if(!h)return;let d=Array.from(h.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(x=>{let w=window.getComputedStyle(x);return w.display!=="none"&&w.visibility!=="hidden"});if(d.length===0)return;let m=d[0],y=d[d.length-1],N=document.activeElement;T.shiftKey&&N===m?(T.preventDefault(),y.focus()):!T.shiftKey&&N===y&&(T.preventDefault(),m.focus());};return document.addEventListener("keydown",C,true),()=>document.removeEventListener("keydown",C,true)},[s,l]);let k=useMemo(()=>({open:l,setOpen:c,triggerOn:o,referenceRef:p,scheduleClose:f,cancelClose:v}),[l,o]);return jsx(li.Provider,{value:k,children:a})},ci=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:s,triggerOn:a,referenceRef:u,scheduleClose:i,cancelClose:l}=or(),c=me.Children.only(t),p=c.props||{},R=io(u,o,c.ref),f=a==="click"?{onClick:k=>{k.stopPropagation(),s(!r),p.onClick?.(k);}}:{onMouseEnter:k=>{l(),r||s(true),p.onMouseEnter?.(k);},onMouseLeave:k=>{i(),p.onMouseLeave?.(k);}},v={"aria-haspopup":"dialog","aria-expanded":r};if(e){let k=c.props?.css;return me.cloneElement(c,{...f,...v,ref:R,css:[k,n].filter(Boolean)})}return me.createElement("button",{ref:R,type:"button",css:[n],...f,...v,children:c})});ci.displayName="PopoverTrigger";var ui=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=or(),a=me.Children.only(o),u=io(s,r,a.ref);if(e){let l=a.props?.css;return me.cloneElement(a,{ref:u,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:us(t),verticalAlign:"middle",...n});return jsx("span",{ref:u,css:i,children:a})});ui.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 di=forwardRef(({anchorOrigin:e={vertical:"bottom",horizontal:"center"},sideOffset:t=8,alignOffset:n=0,collisionPadding:o=8,unstyled:r=false,children:s,width:a,height:u,padding:i,paddingX:l,paddingY:c,radius:p="lg",css:R,...f},v)=>{let{open:k,setOpen:C,triggerOn:T,referenceRef:h,scheduleClose:d,cancelClose:m}=or(),y=U(),N=Bu(e),{refs:x,x:w,y:P,strategy:$,context:W}=useFloating({open:k,onOpenChange:C,whileElementsMounted:autoUpdate,placement:N,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{h.current&&x.setReference(h.current);},[x,h]);let K=useDismiss(W,{outsidePressEvent:"pointerdown",escapeKey:true}),I=useRole(W,{role:"dialog"}),{getFloatingProps:F}=useInteractions([K,I]),[S]=W.placement.split("-"),g=S,b=`${g==="left"?"right":g==="right"?"left":"center"} ${g==="top"?"bottom":g==="bottom"?"top":"center"}`,A=8,H=g==="top"?{y:A}:g==="bottom"?{y:-A}:g==="left"?{x:A}:{x:-A},B={initial:{opacity:0,scale:.96,...H},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...H},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"}}},M=y.surface.panelBg,E=y.text.primary,L=`${y.componentHeights.border} solid ${y.surface.border}`,z=tr(i,y.spacing),O=tr(l,y.spacing),_=tr(c,y.spacing),D={};z&&(D.padding=z),O&&(D.paddingInline=O),_&&(D.paddingBlock=_);let j=tr(p,y.radius)??y.radius.md,J="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",ae=css({position:$,top:P??0,left:w??0,zIndex:1e3,transformOrigin:b,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:us(a)??"fit-content",height:us(u)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),q=r?css({}):css({background:M,color:E,border:L,borderRadius:j,boxShadow:J,...D,...D.padding||D.paddingInline||D.paddingBlock?{}:{padding:typeof y.spacing?.sm=="number"?`${y.spacing.sm}px ${y.spacing.md}px`:`${y.spacing?.sm??"0.5rem"} ${y.spacing?.md??"1rem"}`}}),X=T==="hover"?{onMouseEnter:m,onMouseLeave:()=>d()}:{},le=io(x.setFloating,v),ie=jsx(motion.div,{className:"plainframe-ui-popover",...F({...f,ref:le,...X}),...B,css:[ae,q,R],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:k?ie:null})})});di.displayName="PopoverContent";var $u=()=>{let e=or();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var fs=me.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:u,css:i,trackCss:l,thumbCss:c,labelCss:p,...R},f){let v=U(),k=xe(),C={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}},T={slideMs:250,pressMs:150,easing:"ease"},h=t!==void 0,[d,m]=useState(n),y=h?!!t:d,[N,x]=useState(false);useEffect(()=>{if(r)return;x(true);let O=setTimeout(()=>x(false),T.pressMs);return ()=>clearTimeout(O)},[y,r]);let w=["sm","md","lg"].includes(s)?s:"md",P=C[w],$=`${T.slideMs}ms ${T.easing}`,W=v.palette?.primary?.[600]??v.neutral[900],K=v.neutral[300],I=y?W:K,F=y?v.text.onColors.primary:"#ffffff",{trackW:S,trackH:g,thumb:b}=P,A=(g-b)/2,H=css({display:"inline-flex",alignItems:"center",gap:P.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:v.spacing.xs,borderRadius:v.radius.sm,outline:"none"}),B=css({position:"relative",width:S,height:g,backgroundColor:I,borderRadius:v.radius.full,transition:`background-color ${$}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),M=css({position:"absolute",top:A,left:y?S-b-A:A,width:b,height:b,backgroundColor:F,borderRadius:v.radius.full,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:N?"scaleX(1.2)":"scaleX(1)",transformOrigin:y?"right center":"left center"}),E=css({fontSize:v.typography.sizes.sm,fontWeight:500,color:r?v.text.muted:v.text.primary}),L=()=>{if(r)return;let O=!y;h||m(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":y,"aria-disabled":r||void 0,"data-checked":y?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:L,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},className:["plainframe-ui-switch",u||""].join(" ").trim(),css:[H,k({color:y?"primary":"neutral"}),i],...R,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[B,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[M,c]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[E,p],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:u=false,checkedIcon:i,color:l="primary",css:c,boxCss:p,checkCss:R,labelCss:f,descriptionCss:v,className:k,...C},T)=>{let h=U(),d=xe(),m=typeof e=="boolean",[y,N]=useState(t),x=m?e:y,w=r==="sm"||r==="lg"?r:"md",P=useMemo(()=>Uu(h,w),[h,w]),{checkedBg:$,checkColor:W,borderCol:K,hoverBg:I,gapPx:F}=useMemo(()=>{let O=h.palette||{},_=h.neutral||{},D=h.text?.onColors||{},j,J;l==="neutral"||l==="secondary"?(j=_,J="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(j=O[l]||O.primary||_,J=l):(j=O.primary||_,J="primary");let ae=j[600]??j[500]??j[400]??Object.values(j)[0]??h.palette.primary[600],q=D[J]??D.primary??h.text?.onColors?.primary??h.text.primary,X=typeof P.gap=="number"?P.gap+2:P.gap;return {checkedBg:ae,checkColor:q,borderCol:h.surface.border,hoverBg:h.surface.panelHover,gapPx:X}},[P.gap,l,h]),S=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:h.radius.sm,padding:h.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:K,backgroundColor:I},"input:checked + .plainframe-ui-checkbox-box":{backgroundColor:$,outlineColor:$,"--pfui-bleed":$},'&:not([data-disabled="true"]):hover input:checked + .plainframe-ui-checkbox-box':{outlineColor:$,backgroundColor:$,"--pfui-bleed":$},".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)"}}),[K,$,a,o,F,I,s,h.radius.sm,h.spacing.xs]),g=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),b=useMemo(()=>css({width:P.box,height:P.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${P.borderWidth} solid ${K}`,outlineOffset:`-${P.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:u?h.radius.full:P.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"}),[P.box,P.borderRadius,P.borderWidth,K,u,h.radius.full]),A=useMemo(()=>({w:Math.round(P.box*P.iconRatioW),h:Math.round(P.box*P.iconRatioH)}),[P.box,P.iconRatioH,P.iconRatioW]),H=useMemo(()=>css({width:A.w,height:A.h,transition:"opacity .14s ease, transform .14s ease",color:W,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[W,A.h,A.w]),B=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),M=useMemo(()=>css({fontSize:P.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:h.text.primary}),[P.labelFont,h.text.primary]),E=useMemo(()=>css({fontSize:P.labelFont,lineHeight:1.25,color:h.text.secondary,fontWeight:400,marginTop:s&&a?h.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[P.labelFont,a,s,h.spacing.xs,h.text.secondary]),L=useCallback(()=>{o||(m?n?.(!x):N(O=>{let _=!O;return n?.(_),_}));},[o,m,x,n]),z=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},[o,L]);return jsxs("label",{ref:T,role:"checkbox","aria-checked":x,"aria-disabled":o||void 0,"data-state":x?"checked":"unchecked",className:["plainframe-ui-checkbox",k||""].join(" ").trim(),css:[S,d({color:x?"primary":"neutral"}),c,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:z,children:[jsx("input",{type:"checkbox",checked:x,onChange:L,disabled:o,css:g,...C,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[b,p],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[H,R],children:x&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:W,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:B,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[M,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[E,v],children:a})]})]})}));sr.displayName="Checkbox";var Xu=()=>useContext(fn),Yu=()=>useContext(ro),Ju=()=>useContext(ur),dn=null,bi=(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:u,css:i,startIcon:l,endIcon:c,selected:p=false,active:R,meta:f,__index:v,__skipListReg:k,...C},T){let h=Xu(),d=Ju(),m=cr(),y=uo(),N=Yu(),x=U(),P=!!useContext(Tt),$=C["data-subtrigger"]!==void 0,W=$&&c===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):c,I=typeof o=="number"?o:o===false?0:0,F=useContext(er),S=F==="subtle"?x.surface?.subtleHover??x.neutral[100]:x.surface?.subtleBg??x.neutral[100],g=useMemo(()=>css({width:"100%",borderRadius:x.radius.md,padding:`${x.spacing.sm} ${x.spacing.sm}`,paddingLeft:I>0?`calc(${x.spacing.md} + (${x.spacing.xl} * ${I}))`:x.spacing.md,minHeight:P?x.componentHeights.sm:x.componentHeights.md,display:"flex",alignItems:"center",gap:x.spacing.sm,fontWeight:500,fontSize:x.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?x.palette.danger[800]:x.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?x.palette.danger[50]:S},"&[data-highlighted]":t?{}:{background:n?x.palette.danger[50]:S},"&[data-active]":t?{}:{background:n?x.palette.danger[50]:S},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?x.palette.danger[50]:S},"[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:x.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[x,P,I,t,n,S]),b=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:x.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:x.text.secondary}),[x.text.secondary,x.spacing.sm]),H=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:x.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[x.palette.primary]),B=[];P&&B.push({minHeight:x.componentHeights.sm,paddingLeft:x.spacing.sm,paddingRight:x.spacing.xs,paddingTop:x.spacing.xs,paddingBottom:x.spacing.xs});let M=()=>{s?.(),r&&!$&&d?.closeAll();},E=(z,O)=>{let _=z.closest('[role="menu"]');if(!_)return;let D=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(X=>{if(X.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(X);return le.display!=="none"&&le.visibility!=="hidden"});if(!D.length)return;let j=D.indexOf(z),J=j>=0?j:0,ae=O(D.length,J),q=D[ae];q&&(document.querySelectorAll("[data-highlighted]").forEach(X=>{X.removeAttribute("data-highlighted");}),q.setAttribute("data-highlighted",""),q.focus(),h&&v!=null&&h.setActiveIndex(ae));},L=t?-1:N?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":R?"":void 0,tabIndex:L,ref:z=>{if(h&&!k){let O=h.listRef.current;z&&(v!=null?O[v]=z:O.includes(z)||O.push(z));}typeof T=="function"?T(z):T&&"current"in T&&(T.current=z);},onMouseMove:z=>{if(z.currentTarget.hasAttribute("data-hovered"))return;let O=!!z.currentTarget.closest("[data-submenu-content]");!$&&m&&!O&&bi(m.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(D=>{D.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(D=>{D.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(D=>{D.removeAttribute("data-active");}),z.currentTarget.setAttribute("data-hovered","");let _=z.currentTarget.closest("[data-menu-id]")||z.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&h&&v!=null&&h.setActiveIndex(v),!t&&!N?.allItemsTabbable&&z.currentTarget.focus({preventScroll:true});},onMouseEnter:z=>{if($)lo();else {let D=!!z.currentTarget.closest("[data-submenu-content]");m&&!D&&bi(m.closeAllSubMenus);}z.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(D=>{D.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(D=>{D.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(D=>{D.removeAttribute("data-active");})),z.currentTarget.setAttribute("data-hovered","");let _=z.currentTarget.closest("[data-menu-id]")||z.currentTarget.closest('[role="menu"]');!t&&h&&v!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),y&&y.setIsKeyboardNav(false)),h.setActiveIndex(v)),!t&&!N?.allItemsTabbable&&z.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{h&&h.setActiveIndex(null);},onKeyDown:z=>{if(t)return;let O=z.currentTarget;if(z.key==="Tab"&&h&&!N?.allItemsTabbable){z.preventDefault();return}if(z.key==="Tab"&&!h){let _=O.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(j=>j.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(j=>j.removeAttribute("data-hovered"));let D=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=D>=0?D:0;});}y&&y.setIsKeyboardNav(false);return}if(z.key==="Enter"||z.key===" "||z.key==="ArrowRight"){$||z.key!=="ArrowRight"&&(z.preventDefault(),z.stopPropagation(),M());return}if(z.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){z.preventDefault(),z.stopPropagation();let j=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(j){let J=j.__pfuiCloseSubmenu;J&&J(),document.querySelectorAll("[data-highlighted]").forEach(q=>q.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(q=>q.removeAttribute("data-hovered")),j.setAttribute("data-highlighted",""),j.focus();let ae=j.closest("[data-menu-id]");ae&&ae.setAttribute("data-keyboard-nav","");}return}if(z.key==="Escape"){z.preventDefault(),z.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(z.key==="ArrowDown"){z.preventDefault(),z.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),y&&y.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),E(O,(D,j)=>(j+1)%D);return}if(z.key==="ArrowUp"){z.preventDefault(),z.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),y&&y.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),E(O,(D,j)=>(j-1+D)%D);return}if(z.key==="Home"){z.preventDefault(),z.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),E(O,()=>0);return}if(z.key==="End"){z.preventDefault(),z.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),E(O,D=>D-1);return}},className:["plainframe-ui-menu-item",u||""].join(" ").trim(),css:css(...[g,...B,i].flat()),...C,onClick:z=>{t||(z.currentTarget.removeAttribute("data-highlighted"),M());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:b,children:l}),a,(f!=null||W||p)&&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:x.typography.sizes.sm,color:x.text.secondary,whiteSpace:"nowrap"}),children:f}):null,W,p&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:H,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),yi=me.createContext(null),bs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,u=a?e:r,i=useRef(u);i.current=u;let l=useRef(n);l.current=n;let c=useCallback(R=>{let f=i.current,k=f.some(C=>Object.is(C,R))?f.filter(C=>!Object.is(C,R)):[...f,R];a||s(k),l.current?.(k);},[a]),p=useMemo(()=>({values:u,toggle:c}),[u,c]);return jsx(yi.Provider,{value:p,children:o})},co=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:u=false,css:i,className:l,startIcon:c,endIcon:p,...R},f){let v=useContext(yi),k=!!v&&r!==void 0,C=!k&&t!==void 0,[T,h]=useState(()=>k?v.values.some(K=>Object.is(K,r)):!!n),d=k?v.values.some(K=>Object.is(K,r)):C?!!t:T,m=U(),N=!!useContext(Tt),x=()=>{if(!u)if(k)v.toggle(r);else {let K=!d;C||h(K),o?.(K);}},w=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:N?-1:-3,borderRadius:m.radius.xs,transition:"background-color .12s ease"}),P=css({pointerEvents:"none"}),$=useCallback(K=>{K&&(K.querySelectorAll("[tabindex]").forEach(I=>{I.tabIndex=-1;}),K.querySelectorAll('input, button, a, [role="checkbox"]').forEach(I=>{I.tabIndex=-1;}));},[]),W=jsxs(Fragment,{children:[jsx("span",{ref:$,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:w,"aria-hidden":"true",children:jsx(sr,{size:"sm",checked:d,css:P})}),c]});return jsx(pn,{...R,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:x,disabled:u,startIcon:W,endIcon:p,css:i,selected:false,children:s})});co.displayName="MenuCheckboxItem";var xi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:u,switchSize:i="md",switchCss:l,startIcon:c,className:p,...R},f){let v=t!==void 0,[k,C]=useState(!!n),T=v?!!t:k,d=!!useContext(Tt),m=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),y=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),N=()=>{if(a)return;let w=!T;v||C(w),o?.(w);},x=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,{...R,className:["plainframe-ui-menu-switch-item",p||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:N,css:u,selected:false,children:[c&&jsx("span",{className:"plainframe-ui-menu-item-start",css:x,children:c}),jsx("span",{"data-label":true,css:m,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:y,children:jsx(fs,{checked:T,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});xi.displayName="MenuSwitchItem";var vi=me.createContext(null),lr=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,u=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:u}),[a]);return jsx(vi.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,...u},i){let l=useContext(vi),c=l?.value===t,p=U(),R=css({width:p.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:p.palette.primary[600],transform:c?"scale(1)":"scale(0.4)",opacity:c?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),v=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(pn,{...u,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":c,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:R,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:v,children:n})]})}),mn=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:u=false,color:i="primary",...l},c){let p=U(),f=!!useContext(Tt),v=i==="primary"?p.text.primary:i==="secondary"?p.text.secondary:p.palette[i]?.[700]??p.text.primary,k=css({display:"flex",alignItems:"center",padding:f?`${p.spacing.sm} ${p.spacing.md}`:`${p.spacing.sm} ${p.spacing.md}`,fontSize:p.typography.sizes.sm,color:v,fontWeight:500,...t?{paddingLeft:`calc(${p.spacing.lg} * 2)`}:null,gap:p.spacing.xs}),C=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:u?"normal":"nowrap"}),T=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"}}),h=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:c,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(k,o),...l,children:[s&&jsx("span",{className:"plainframe-ui-menu-label-start",css:T,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:C,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:h,children:a})]})});mn.displayName="MenuLabel";var Qu=({className:e,css:t,variant:n="full",...o})=>{let r=U(),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)"}),u=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"?u:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var hs=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),Ri=createContext(null),cr=()=>useContext(Ri),Ti=createContext(false),bd=()=>useContext(Ti),ro=createContext({allItemsTabbable:true}),ur=me.createContext(null),ys=()=>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,wi=0,$n=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[u,i]=useState(!!t),l=e??u,c=useCallback(F=>{e===void 0&&i(F),n?.(F);},[e,n]),p=useRef(`pfui-menu-${++wi}`),R=useRef(null),f=useRef([]),v=useRef(null),[k,C]=useState(null),[T,h]=useState(false);useEffect(()=>{l||(C(null),f.current=[],h(false));},[l]);let d=useRef(null),m=useCallback((F,S)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let g=S??20;d.current=window.setTimeout(()=>c(F),g);},[o,c]),y=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>y(),[y]),useEffect(()=>{if(!(!r||!l))return md(),()=>fd()},[l,r]);let N=ys(),[x]=useState(()=>N??hd()),w=useRef(new Set),P=useMemo(()=>({registerSubMenu:F=>(w.current.add(F),()=>w.current.delete(F)),closeAllSubMenus:()=>{w.current.forEach(F=>F());}}),[]),$=useMemo(()=>({open:l,setOpen:c,trigger:o,referenceRef:R,listRef:f,floatingRef:v,setActiveIndex:C,scheduleSubmenuHover:m,clearSubmenuHover:y,menuId:p.current}),[l,c,o,C,m,y]),W=useMemo(()=>({activeIndex:k,setActiveIndex:C}),[k,C]),K=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:h}),[T]),I=s==="sm";return jsx(ur.Provider,{value:x,children:jsx(Tt.Provider,{value:I,children:jsx(oo.Provider,{value:K,children:jsx(Ri.Provider,{value:P,children:jsx(mo.Provider,{value:W,children:jsx(fn.Provider,{value:$,children:a})})})})})})};$n.displayName="DropdownMenu";var zn=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:u,setOpen:i,trigger:l,referenceRef:c,listRef:p,setActiveIndex:R,scheduleSubmenuHover:f,clearSubmenuHover:v,floatingRef:k,menuId:C}=mr(),T=uo(),h=cr(),d=!!e&&isValidElement(t),m=d?t:null,y=m&&m.props&&typeof m.props=="object"&&"onKeyDown"in m.props?m.props.onKeyDown:void 0,N=m&&m.props&&typeof m.props=="object"&&"onClick"in m.props?m.props.onClick:void 0,{onKeyDown:x,onClick:w,...P}=s,$=useMemo(()=>hs(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,c),[a,d,t,c]),W=useCallback(()=>p.current.filter(Boolean),[p]),K=useCallback(b=>{let A=W();requestAnimationFrame(()=>A[b]?.focus());},[W]),I=useCallback(b=>{if(b.key==="Tab"&&u){b.preventDefault(),T?.setIsKeyboardNav(true);let A=k?.current;if(A){A.setAttribute("data-keyboard-nav","");let H=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])');H&&(document.querySelectorAll("[data-highlighted]").forEach(B=>B.removeAttribute("data-highlighted")),H.setAttribute("data-highlighted",""),H.focus());}return}if(b.key==="ArrowRight"&&u){let A=document.querySelector("[data-subtrigger][data-hovered]");if(A){b.preventDefault(),b.stopPropagation(),T?.setIsKeyboardNav(true),A.removeAttribute("data-hovered"),A.setAttribute("data-highlighted",""),A.focus(),requestAnimationFrame(()=>{let H=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});A.dispatchEvent(H);});return}}if(b.key==="ArrowDown"||b.key==="ArrowUp"){if(T?.setIsKeyboardNav(true),!u){b.preventDefault(),i(true),requestAnimationFrame(()=>{let A=C?document.querySelector(`[data-menu-id="${C}"]`):k?.current;if(A){A.setAttribute("data-keyboard-nav","");let H=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(B=>{let M=B.closest("[data-submenu-content]");if(M&&M!==A)return false;let E=window.getComputedStyle(B);return E.display!=="none"&&E.visibility!=="hidden"});if(H.length>0){let B=b.key==="ArrowDown"?0:H.length-1;R(B),H[B]?.setAttribute("data-highlighted",""),H[B]?.focus();}}}),y?.(b),x?.(b);return}if(u){b.preventDefault();let A=document.querySelectorAll("[data-hovered]");for(let B of Array.from(A))if(B.closest("[data-submenu-content]")){let E=B.closest('[role="menu"]');if(E){E.setAttribute("data-keyboard-nav","");let L=Array.from(E.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==E)return false;let _=window.getComputedStyle(O);return _.display!=="none"&&_.visibility!=="hidden"}),z=L.indexOf(B);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),B.removeAttribute("data-hovered"),z!==-1&&L.length>0){let O=b.key==="ArrowDown"?1:-1,_=(z+O+L.length)%L.length;L[_]?.setAttribute("data-highlighted",""),L[_]?.focus();}return}}let H=C?document.querySelector(`[data-menu-id="${C}"]`):k?.current;if(H){H.setAttribute("data-keyboard-nav",""),h?.closeAllSubMenus();let B=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(M=>{if(M.closest('[role="menu"]')!==H)return false;let E=window.getComputedStyle(M);return E.display!=="none"&&E.visibility!=="hidden"});if(B.length>0){let M=H.querySelector("[data-highlighted]"),E=H.querySelector("[data-hovered]"),L=-1;M?L=B.indexOf(M):E&&(L=B.indexOf(E)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),E&&E.removeAttribute("data-hovered"),L===-1&&(L=b.key==="ArrowDown"?-1:B.length);let z=b.key==="ArrowDown"?1:-1,O=(L+z+B.length)%B.length;R(O),B[O]?.setAttribute("data-highlighted",""),B[O]?.focus();}}y?.(b),x?.(b);return}}if((b.key==="Enter"||b.key===" ")&&!u){b.preventDefault(),T?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let A=C?document.querySelector(`[data-menu-id="${C}"]`):k?.current;if(A){A.setAttribute("data-keyboard-nav","");let H=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(B=>{let M=B.closest("[data-submenu-content]");if(M&&M!==A)return false;let E=window.getComputedStyle(B);return E.display!=="none"&&E.visibility!=="hidden"});H.length>0&&(R(0),H[0]?.setAttribute("data-highlighted",""),H[0]?.focus());}}),y?.(b),x?.(b);return}y?.(b),x?.(b);},[u,i,R,y,x,W,K,p,T,C,k,h]),F=useCallback(b=>{l==="click"&&((b.nativeEvent.composedPath?.()??[]).some(M=>{let E=M;if(!E||!("tagName"in E))return false;let L=String(E.tagName).toUpperCase();if(L==="INPUT"||L==="TEXTAREA"||"isContentEditable"in E&&E.isContentEditable)return true;let z="getAttribute"in E?E.getAttribute("role"):null;return z==="textbox"||z==="combobox"})||(b.stopPropagation(),i(!u))),N?.(b),w?.(b);},[l,u,i,N,w]),S=l==="hover"?{onMouseEnter:()=>{v(),i(true);},onMouseLeave:()=>{f(false);}}:{},g=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&m){let b=m.props,A=b.css,H=typeof b.className=="string"?b.className:void 0,B=typeof b.tabIndex=="number"?b.tabIndex:0,M={ref:$,tabIndex:B,className:[H,o].filter(Boolean).join(" ")||void 0,css:[A,g,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":u,onClick:F,onKeyDown:I,...S,...P};return cloneElement(m,M)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),g,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":u,onClick:F,onKeyDown:I,...S,...P,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:u,height:i,maxHeight:l,unstyled:c=false,closeOnBlur:p=false,allItemsTabbable:R=false,className:f,css:v,children:k,exitPlacement:C,animateOnBusClose:T=true,gap:h,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:m=false,returnFocus:y=false,...N},x)=>{let{open:w,setOpen:P,referenceRef:$,clearSubmenuHover:W,setActiveIndex:K,floatingRef:I,menuId:F}=mr(),S=U(),g=ys(),b=uo();useEffect(()=>{if(!g)return;let Y=g.registerCloser(()=>P(false));return ()=>{Y&&Y();}},[g,P]);let A=typeof o=="string"?parseFloat(o):o,H=typeof r=="string"?parseFloat(r):r,B=typeof s=="string"?parseFloat(s):s,M=`${t}${n==="center"?"":`-${n}`}`,E=useCallback(Y=>({getBoundingClientRect:()=>{let oe=Math.round(Y.x),re=Math.round(Y.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}),[]),L=useMemo(()=>{if(!e)return null;if(e instanceof HTMLElement||typeof e=="object"&&e!==null&&"getBoundingClientRect"in e&&typeof e.getBoundingClientRect=="function")return e;let Y=e;return E({x:Y.x,y:Y.y})},[e,E]),{refs:z,x:O,y:_,strategy:D,context:j,update:J}=useFloating({open:w,onOpenChange:P,placement:M,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:A??0,crossAxis:H??0}),flip({padding:B??8}),shift({padding:B??8}),size({apply({rects:Y,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"),u!=null?re.style.width=typeof u=="number"?`${u}px`:String(u):a?re.style.width=`${Math.round(Y.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(()=>{L?z.setReference(L):$.current&&z.setReference($.current);},[z,L,$]),useEffect(()=>{if(!w)return;let Y=L||$.current,oe=z.floating.current;if(!(!Y||!oe))return autoUpdate(Y,oe,J)},[w,L,$,z,J]),useEffect(()=>{J();},[J,a,u,i,l]),useEffect(()=>{w&&!R&&K(0);},[w,R,K]),useEffect(()=>{if(!p||!w)return;let Y=()=>{let oe=document.activeElement,re=$.current,qe=z.floating.current;oe&&(re?.contains(oe)||qe?.contains(oe)||P(false));};return document.addEventListener("focusin",Y,true),()=>document.removeEventListener("focusin",Y,true)},[p,w,P,$,z.floating]);let ae=useDismiss(j,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:m?false:Y=>{if(d?.length){let oe=Y.target;for(let re of d)if(re.current?.contains(oe))return false}return true}}),q=useRole(j,{role:"menu"}),{getFloatingProps:X}=useInteractions([ae,q]),le=useRef(false);useEffect(()=>{w?le.current=true:le.current&&$.current&&y&&(g?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[w,$,g,y]);let ie=typeof S.spacing.xs=="number"?`${S.spacing.xs}px`:String(S.spacing.xs),be=h===void 0?void 0:typeof h=="number"?h:S.spacing[h]??h,Pe=c?void 0:css({boxSizing:"border-box",background:S.surface.panelBg,border:`${S.componentHeights.border} solid ${S.surface.border}`,borderRadius:S.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:S.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=Y=>{if(!Y||typeof Y!="object"||!isValidElement(Y))return Y;let re=Y.type?.displayName;if(re==="DropdownMenu"||re==="DropdownMenuSub")return Y;if(re==="MenuItem"||re==="MenuCheckboxItem"||re==="MenuRadioItem"||re==="MenuSwitchItem")return Re+=1,cloneElement(Y,{__index:Re,key:Y.key??Re});if(re==="DropdownMenuTrigger"){let V=Y.props.children;return cloneElement(Y,{children:me.Children.map(V,Ce)})}if(re==="DropdownMenuSubTrigger"){Re+=1;let V=Re;return cloneElement(Y,{__index:V,key:Y.key??V})}let qe=Y.props.children;return qe==null?Y:cloneElement(Y,{children:me.Children.map(qe,Ce)})},Ie=me.Children.map(k,Ce),we=j.placement.split("-")[0]||"bottom",he=we==="bottom"?"center top":we==="top"?"center bottom":we==="left"?"right center":"left center",Ve=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=C??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=!!g?.isBusClosingRef.current&&!T?{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:D,top:_??0,left:O??0,zIndex:1e3,transformOrigin:he}),pe=useCallback(Y=>{if(Y.key==="Tab"){Y.preventDefault();return}if(Y.key==="ArrowDown"||Y.key==="ArrowUp"){Y.preventDefault(),b?.setIsKeyboardNav(true);let oe=Y.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 V=window.getComputedStyle(qe);return V.display!=="none"&&V.visibility!=="hidden"});if(re.length>0){let qe=oe.querySelector("[data-highlighted]"),V=oe.querySelector("[data-hovered]"),ue=-1;qe?ue=re.indexOf(qe):V&&(ue=re.indexOf(V)),document.querySelectorAll("[data-highlighted]").forEach(ze=>ze.removeAttribute("data-highlighted")),V&&V.removeAttribute("data-hovered"),ue===-1&&(ue=Y.key==="ArrowDown"?-1:re.length);let de=Y.key==="ArrowDown"?1:-1,fe=(ue+de+re.length)%re.length;K(fe),re[fe]?.setAttribute("data-highlighted",""),re[fe]?.focus();}}},[b,K]),Se=useCallback(Y=>{let oe=Y.currentTarget;oe.removeAttribute("data-keyboard-nav"),oe.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),b?.isKeyboardNav&&b.setIsKeyboardNav(false);},[b]),Ne=useCallback(Y=>{Y.removeAttribute("data-keyboard-nav"),Y.querySelectorAll("[data-highlighted]").forEach(oe=>oe.removeAttribute("data-highlighted")),b?.isKeyboardNav&&b.setIsKeyboardNav(false);},[b]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:w?jsx(ro.Provider,{value:{allItemsTabbable:R},children:jsx(motion.div,{...X({...N,ref:hs(x,z.setFloating,Y=>{I&&(I.current=Y);})}),"data-menu-id":F,"data-keyboard-nav":b?.isKeyboardNav?"":void 0,className:f,css:[Pe,se,v],initial:Ve,animate:{opacity:1,x:0,y:0,scale:1},exit:Ee,transition:ee,onPointerMove:Y=>Ne(Y.currentTarget),onPointerDown:Y=>Ne(Y.currentTarget),onKeyDown:pe,onMouseMove:Se,onMouseEnter:()=>{W(),g?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(Y=>Y.removeAttribute("data-hovered"));},children:Ie})}):null})})});hn.displayName="DropdownMenuContent";var Ei=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=bd(),[u,i]=useState(!!t),l=e??u,c=useCallback(I=>{e===void 0&&i(I),n?.(I);},[e,n]),p=useRef(null),R=useRef(false),f=useCallback((I,F)=>{if(o!=="hover")return;window.clearTimeout(p.current??0),R.current=I;let S=F??20;p.current=window.setTimeout(()=>{R.current=false,c(I);},S);},[o,c]),v=useCallback(()=>{p.current&&(window.clearTimeout(p.current),p.current=null,R.current=false);},[]);useEffect(()=>()=>v(),[v]);let k=cr();useEffect(()=>{if(!k)return;let I=()=>{v(),c(false);};return k.registerSubMenu(I)},[k,c,v]);let C=useRef(`pfui-submenu-${++wi}`),T=useRef(null),h=useRef([]),d=useRef(null),[m,y]=useState(null),[N,x]=useState(false);useEffect(()=>{l||(y(null),h.current=[],x(false));},[l]);let w=useContext(Tt),P=r??w,$=useMemo(()=>({open:l,setOpen:c,trigger:o,referenceRef:T,listRef:h,floatingRef:d,setActiveIndex:y,scheduleSubmenuHover:f,clearSubmenuHover:v,pendingOpenRef:R,menuId:C.current}),[l,c,o,y,f,v]),W=useMemo(()=>({activeIndex:m,setActiveIndex:y}),[m,y]),K=useMemo(()=>({isKeyboardNav:N,setIsKeyboardNav:x}),[N]);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,I=>{if(!isValidElement(I))return I;let F=I.type;return F?.displayName==="DropdownMenuSubTrigger"||F?.displayName==="DropdownMenuSubContent"?null:I})})):jsx(Ti.Provider,{value:true,children:jsx(Tt.Provider,{value:P,children:jsx(mo.Provider,{value:W,children:jsx(oo.Provider,{value:K,children:jsx(fn.Provider,{value:$,children:s})})})})})};Ei.displayName="DropdownMenuSub";var ki=me.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:u,setOpen:i,trigger:l,referenceRef:c,scheduleSubmenuHover:p,clearSubmenuHover:R,pendingOpenRef:f,menuId:v}=mr(),k=uo(),C=useCallback(I=>{I&&(I.__pfuiCloseSubmenu=()=>i(false));},[i]),T=!!e&&isValidElement(t),h=T?t:null,d=h?.props,m=d?.onKeyDown,y=d?.onClick,{onKeyDown:N,onClick:x,...w}=s,P=useMemo(()=>hs(a,T&&isValidElement(t)&&"ref"in t?t.ref:void 0,c,C),[a,T,t,c,C]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,W=useCallback(I=>{if(I.key==="Tab"){I.preventDefault();return}let F=I.currentTarget,S=g=>{k?.setIsKeyboardNav(true);let b=F.closest("[data-menu-id]");if(!b)return;b.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted"));let A=Array.from(b.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]")!==b)return false;let L=window.getComputedStyle(E);return L.display!=="none"&&L.visibility!=="hidden"});if(!A.length)return;let H=A.indexOf(F),B=H>=0?H:0,M=g==="next"?(B+1)%A.length:(B-1+A.length)%A.length;A[M]?.setAttribute("data-highlighted",""),A[M]?.focus();};if(I.key==="ArrowDown"){I.preventDefault(),I.stopPropagation(),u&&i(false),S("next");return}if(I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),u&&i(false),S("prev");return}if(I.key==="ArrowRight"||I.key==="Enter"||I.key===" "){I.preventDefault(),I.stopPropagation(),k?.setIsKeyboardNav(true);let g=I.currentTarget;i(true),requestAnimationFrame(()=>{let b=v?document.querySelector(`[data-menu-id="${v}"]`):document.querySelector("[data-submenu-content]");if(b){b.setAttribute("data-keyboard-nav",""),g.removeAttribute("data-highlighted"),g.removeAttribute("data-hovered");let A=b.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(I.key==="ArrowLeft"){I.preventDefault(),I.stopPropagation(),u&&i(false);let g=F.closest("[data-menu-id]");g&&g.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(b=>b.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(b=>b.removeAttribute("data-hovered")),F.setAttribute("data-highlighted",""),F.focus(),k&&k.setIsKeyboardNav(true);return}if(I.key==="Escape"){I.preventDefault(),I.stopPropagation(),m?.(I);return}m?.(I),N?.(I);},[u,i,m,N,c,k,v]),K=l==="hover"?{onMouseEnter:I=>{let F=I.currentTarget;lo(),R(),document.querySelectorAll("[data-hovered]").forEach(g=>g.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(g=>g.removeAttribute("data-highlighted")),F.setAttribute("data-hovered",""),F.focus({preventScroll:true});let S=F.closest("[data-menu-id]");S?.hasAttribute("data-keyboard-nav")&&S.removeAttribute("data-keyboard-nav"),k&&k.setIsKeyboardNav(false),u||p(true,90);},onMouseMove:I=>{let F=I.currentTarget;lo(),F.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(S=>S.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(S=>S.removeAttribute("data-highlighted")),F.setAttribute("data-hovered","")),!u&&!f?.current&&p(true,90);},onMouseLeave:()=>{p(false,60);}}:{onClick:I=>{I.stopPropagation(),i(!u),y?.(I),x?.(I);}};if(T&&h){let I=d?.css,F=typeof d?.className=="string"?d.className:void 0,S=typeof d?.tabIndex=="number"?d.tabIndex:0,g={ref:P,tabIndex:S,className:[F,o].filter(Boolean).join(" ")||void 0,css:[I,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":u,"data-subtrigger":"",__skipListReg:true,onKeyDown:W,onFocus:b=>{if(b.target.hasAttribute("data-highlighted")){let A=b.target.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(b);},...K,...w};return cloneElement(h,g)}return jsx("div",{ref:P,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":u,"data-subtrigger":"",onKeyDown:W,onFocus:I=>{if(I.currentTarget.hasAttribute("data-highlighted")){let F=I.currentTarget.closest("[data-menu-id]");F&&!F.hasAttribute("data-keyboard-nav")&&(F.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}},...K,...w,children:t})});ki.displayName="DropdownMenuSubTrigger";var Ii=me.forwardRef((e,t)=>{let n=ys(),{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:u=>{r(),n?.clearAllHover(),lo(),e.onMouseEnter?.(u);},onMouseLeave:u=>{s(false,60),e.onMouseLeave?.(u);}})});Ii.displayName="DropdownMenuSubContent";var fr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Cd=css({display:"inline"}),Mi=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}),Fi=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();},Ai=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});Ai.displayName="CtxCapture";var xs=me.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:u,closeOnSelect:i,pickSingle:l,handleItemKeyDown:c,handleItemMouseDown:p,descriptionColor:R})=>{let f=o(),v=useMemo(()=>{let T=String(e.title??e.value);return s?T:a(T)},[a,e.title,e.value,s]),k=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:wd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Fi,children:v}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Ed,{color:R}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Fi,children:v}),[v,e.description,R]),C=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let T=f.some(h=>Object.is(h,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 ${u("checkbox-item")}`.trim(),css:e.css,onMouseDown:p,children:s(e,T)},e.value):jsx(co,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${u("checkbox-item")}`.trim(),css:e.css,onMouseDown:p,startIcon:e.startIcon,endIcon:e.endIcon,children:k},e.value)}return s?jsx(pn,{__index:t,onClick:C,onSelect:C,onKeyDown:c,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:u("item"),css:e.css,closeOnSelect:i,onMouseDown:p,selected:r,children:s(e,r)},e.value):jsx(pn,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:C,onSelect:C,onKeyDown:c,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:u("item"),css:e.css,closeOnSelect:i,onMouseDown:p,selected:r,children:k},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));xs.displayName="AutocompleteRow";var Pi=me.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:u,inputCss:i,containerCss:l,label:c,helperText:p,variant:R,startIcon:f,endIcon:v,size:k,disabled:C=false,error:T=false,showClear:h=false,open:d,onOpenChange:m,openOnFocus:y=false,openOnType:N=true,openOnClick:x=true,closeOnSelect:w=true,closeOnBlur:P=true,blurOnSelect:$=false,freeSolo:W=false,customValueLabel:K=false,maxHeight:I,maxItems:F,noResultsText:S="No Items Found",highlightTypedValue:g,typedValueHighlightCss:b,showNoResults:A=true,noResultsLabelCss:H,loadingLabelCss:B,loadItems:M,loading:E,loadingText:L="Loading\u2026",debounceMs:z=200,multiple:O=false,selectedValues:_,defaultSelectedValues:D,onChangeSelected:j,expandIcon:J,showExpandIcon:ae=true,expandIconCss:q,textFieldWrapperCss:X,textFieldInputCss:le,textFieldLabelCss:ie,textFieldHelperRowCss:be,textFieldHelperTextCss:Pe,textFieldStartIconCss:Re,textFieldEndIconCss:Ce,menuContentCss:Ie})=>{let we=U().text.secondary,[he,Ve]=useState(""),Z=typeof d=="boolean",[Ee,Q]=useState(false),ee=Z?d:Ee,se=useRef(null),pe=useRef(null),Se=useRef(null),Ne=useRef(null),Y=useRef(false),oe=useRef(null),re=useRef(false),qe=useRef(0),V=useMemo(()=>[pe],[]),[ue,de]=useState(D??[]),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 M=="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 M(G)||[];nn(Array.isArray(ne)?ne:[]);}catch{nn([]);}finally{on(false);}},Math.max(0,z)),()=>{bt.current&&window.clearTimeout(bt.current);}},[he,Je,M,z]);let Zn=useMemo(()=>{let G=fr(he);return G?xt.some(ne=>fr(ne.title??ne.value)===G):false},[xt,he]),aa=W&&!!K&&he.trim().length>0&&!Zn,nc=G=>{if(typeof K=="object"){let ne=Object.prototype.hasOwnProperty.call(K,"prefix"),ve=Object.prototype.hasOwnProperty.call(K,"suffix");if(ne||ve){let Me=ne?K.prefix??"":"",ge=ve?K.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]),ia=useMemo(()=>{if(aa){let G=he.trim();return [...Or,{value:G,title:nc(G),__pfui_free__:true}]}return Or},[Or,aa,he]),Kt=useMemo(()=>{let G=[],ne=new Map;for(let pt of ia){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},[ia,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(W&&!O){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,W,O,t]);let Vr=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});j?.(Me);},[j]),Bo=useCallback(G=>{let ne=G.map(String);_||de(ne),Vr(ne);},[_,Vr]),la=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),Ve(ne.title??ne.value),t?.(ne),Z||(w?(Y.current=false,re.current=true,Q(false),at.current?.(false),setTimeout(()=>{re.current=false;},150)):Y.current=true),!w&&Se.current?.setActiveIndex&&Se.current.setActiveIndex(null),$?(Y.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,w,$]),oc=useCallback(G=>{if(C)return;Ve(G);let ne=!G.trim();O||(ne?(st(null),t?.(null)):W&&st(null)),!Z&&!ne&&N&&!ee&&De(true);},[O,Z,N,ee,De,C,W,t]),it=Sd,ca=kd,rc=Id,ua=useMemo(()=>b?[Mi,b]:Mi,[b]),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:ua,children:G.slice(ge,ge+ne.length)}),G.slice(ge+ne.length)]})},[he,ua]),zo=g?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;},[]),da=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 jr=Ze.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[pt];jr&&(jr.setAttribute("data-active",""),jr.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(C||!Fn&&!Je)return;G.preventDefault(),!ee&&!Z&&De(true),da(G.key==="ArrowDown"?1:-1);return}if(G.key==="Enter"){if(C)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(),O?(la(ve.value),w||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,O,w,da,la,$o,De,C]),cc=useCallback(()=>{C||re.current||y&&Lo&&(qe.current=Date.now(),Z||De(true));},[Z,y,Lo,De,C]),uc=useCallback(()=>{if(Y.current){Y.current=false;return}P&&De(false),!W&&!O&&(Oe?Ve(Oe.title??Oe.value):he.trim()&&Ve(""));},[P,W,O,Oe,he,De]),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=>{G.push(jsx(xs,{item:ge,absIndex:ne,multiple:true,getCurrentMulti:yt,isSelected:false,renderItem:s,paint:zo,cls:it,closeOnSelect:false,pickSingle:ca,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:we},`${ge.group??"__"}|${ge.value}`)),ne+=1;});}),jsx(bs,{values:fe,onValuesChange:Bo,children:G},"multi-group")},[Kt,it,yt,s,zo,fe,Bo,ca,Wo,Oo,we]),ma=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(xs,{item:ge,absIndex:ne,multiple:false,getCurrentMulti:yt,isSelected:pt,renderItem:s,paint:zo,cls:it,closeOnSelect:w,pickSingle:$o,handleItemKeyDown:Wo,handleItemMouseDown:Oo,descriptionColor:we},`${ge.group??"__"}|${ge.value}`)),ne+=1;});}),G},[Kt,it,Oe,yt,s,zo,w,$o,Wo,Oo,we]),dc=useMemo(()=>ke?jsx(mn,{css:B,className:it("label-loading"),children:L},"loading"):Wr?jsx(mn,{css:H,className:it("label-empty"),children:S},"empty"):Kt.length===0?null:O?pa():ma(),[ke,Wr,Kt.length,it,L,S,O,pa,ma]),rn=ee?false:C||!Je&&!Ho&&!A,fa=useCallback(G=>{G.preventDefault(),G.stopPropagation(),!(rn||C)&&(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,C,Z]),ga=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:[ga,q],"aria-disabled":rn||void 0,onMouseDown:Ad,onClick:fa,children:J??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[ae,ga,q,rn,fa,J]),pc=useMemo(()=>v&&Ko?jsxs("span",{css:Td,children:[v,Ko]}):v??Ko,[v,Ko]),mc=useCallback(G=>{if(!(oe.current&&oe.current.contains(G.target)||re.current||C||Date.now()-qe.current<300)){if(ee){!he.trim()&&!Z&&(re.current=true,De(false),setTimeout(()=>{re.current=false;},150));return}x&&Lo&&(!Z||x)&&De(true);}},[ee,he,x,Lo,De,C,Z]);return jsx("div",{ref:pe,className:it(""),css:[ac,l,u],children:jsxs($n,{open:C?false:ee,onOpenChange:C?void 0:De,children:[jsx(Ai,{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:c,helperText:p,variant:R,startIcon:f,endIcon:pc,size:k,width:n,fullWidth:o,disabled:C,error:T,showClear:h,css:i,wrapperCss:X,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 I=="number"?`${I}px`:I,css:Ie,ignoreOutsidePressRefs:V,disableOutsidePressDismiss:Z,returnFocus:!$,children:dc})]})})});Pi.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(),Ni=me.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:u,...i},l)=>{let c=U(),[p,R]=useState(!!e);useEffect(()=>{R(!!e);},[e]);let f=Bd(n,c),v=typeof f=="number"?f:Number.parseFloat(String(f))||0,k=v?Math.round(v*(v<=28?.55:.52)):void 0,C=r?c.radius.full:c.radius.md,T=$d(c,o),h=zd(c,o),d=Od(u,t),m=css({width:f,height:f,borderRadius:C,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:p?"transparent":T,color:p?"inherit":h,boxSizing:"border-box",userSelect:"none"}),y=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),N=css({fontSize:k,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:p?void 0:"img","aria-label":p?void 0:t,...i,children:p&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:y,onError:()=>R(false),decoding:"async",loading:"lazy"}):typeof u=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:N,children:u}):u||jsx("span",{className:"plainframe-ui-avatar-initials",css:N,children:d})})}));Ni.displayName="Avatar";var Di=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Vd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:u,outlineThickness:i=4,className:l})=>{let c=U(),p=xe(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let x=(c.componentHeights&&c.componentHeights[n])??(c.spacing&&c.spacing[n]);return Di(x??n)}return "32px"})(),v=Children.toArray(e).filter(Boolean),k=typeof t=="number"&&t>=0,C=k&&v.length>t?v.slice(0,t):v,T=k&&v.length>t?v.length-t:0,h=a==="panel"?c.surface.panelBg:a==="subtle"?c.surface.subtleBg:a??c.surface.appBg,d=Di(i)??"4px",m=css({display:"flex",alignItems:"center"}),y=x=>css({marginLeft:x===0?0:o,zIndex:C.length-x,boxShadow:`0 0 0 ${d} ${h}`,backgroundColor:h,borderRadius:s?c.radius.full:c.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),N=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,p()],children:[C.map((x,w)=>{if(!isValidElement(x))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:y(w),children:jsx("span",{css:N,children:x})},w);let P=x,$=P.props?.css,W=$==null?N:[N,$],K=cloneElement(P,{size:n,rounded:s,css:W,style:{...P.props?.style,width:"100%",height:"100%",objectFit:P.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:y(w),children:K},w)}),T>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:c.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:c.text.secondary}),u],"aria-label":`+${T} more`,children:["+",T]})]})};var Bi=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:u=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:c="rectangular",children:p,animate:R=true,size:f,outline:v=false,outlineColor:k,className:C,badgeClassName:T,css:h,badgeCss:d,offsetX:m,offsetY:y})=>{let N=U(),x=s==="dot",w=f??(x?8:17),P=r??(x?0:10),{scale:$,onKey:W}=Ud(N,t),K=qd($),I=N.text?.onColors||{},F=Gd(N,I,W,n),S=Xd(e,a,s),g=Yd(i,s,e,u),b=css({position:"relative",display:"inline-block"}),A=c==="circular"?x?"12.5%":"5%":x?"5%":"2.5%",H=Bi(m??A),B=Bi(y??A),M=l.vertical||"top",E=l.horizontal||"right",L={},z="0",O="0";M==="center"?(L.top="50%",O="-50%"):M==="top"?(L.top=B,O="-45%"):(L.bottom=B,O="45%"),E==="center"?(L.left="50%",z="-50%"):E==="right"?(L.right=H,z="45%"):(L.left=H,z="-45%");let _=g?1:.8,D=css({minWidth:x?w:w/2,height:w,background:K,color:F,fontSize:typeof P=="number"?`${P}px`:P,fontWeight:o,borderRadius:999,padding:x?0:`0 ${w/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",...v?{boxShadow:`0 0 0 2px ${k??N.surface?.appBg}`}:{},opacity:g?1:0,transform:`translate(${z}, ${O}) scale(${g?_:.5})`,...R?{transition:"opacity .18s cubic-bezier(.4,1.6,.6,1), transform .18s cubic-bezier(.4,1.6,.6,1)"}:{},...L});return jsxs("div",{className:["plainframe-ui-badge-wrapper",C||""].join(" ").trim(),css:[b,h],children:[p,jsx("span",{"aria-hidden":!g,className:["plainframe-ui-badge",T||""].join(" ").trim(),css:[D,d],children:S})]})});var ks=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:u,overlayCss:i,children:l,transitionDuration:c=300,keepMounted:p=true,className:R,contentClassName:f,lockScroll:v=true,...k})=>{let C=U(),T=useMemo(()=>r??C.surface.overlayBg,[r,C.surface.overlayBg]),[h,d]=useState(e),[m,y]=useState(e),N=useRef(null),x=useRef(null),w=useRef(null);useEffect(()=>(N.current&&(clearTimeout(N.current),N.current=null),x.current!=null&&(cancelAnimationFrame(x.current),x.current=null),e?(d(true),x.current=requestAnimationFrame(()=>{y(true),x.current=null;})):(y(false),N.current=setTimeout(()=>{d(false),N.current=null;},c)),()=>{N.current&&(clearTimeout(N.current),N.current=null),x.current!=null&&(cancelAnimationFrame(x.current),x.current=null);}),[e,c]),useEffect(()=>{if(!v||!e)return;let F=document.body,S=F.style.overflow,g=F.style.paddingRight,b=window.innerWidth-document.documentElement.clientWidth,A=parseFloat(getComputedStyle(F).paddingRight||"0");return F.style.overflow="hidden",b>0&&(F.style.paddingRight=`${A+b}px`),()=>{F.style.overflow=S,F.style.paddingRight=g;}},[e,v]),useEffect(()=>{if(!m||!t)return;let F=S=>{S.key==="Escape"&&t();};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[m,t]);let P=F=>{if(!m||!t||!w.current)return;let S=F.target;S&&!w.current.contains(S)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!p&&!h)return null;let W=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:m?"auto":"none",visibility:h?"visible":"hidden"}),K=css({position:"absolute",inset:0,background:T,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:m?1:0,transition:`opacity ${c}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:m?"auto":"none"}),I=css({position:"relative",zIndex:1,pointerEvents:m?"auto":"none"});return jsxs("div",{"aria-hidden":!h||void 0,className:["plainframe-ui-backdrop",R||""].join(" ").trim(),css:[W,a],onPointerDown:P,...k,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[K,i],role:"presentation"}),jsx("div",{ref:w,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[I,u],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:u,hover:i=true,className:l,...c})=>{let p=U(),R=xe(),f=me.useMemo(()=>me.Children.toArray(e).flatMap(d=>{if(!me.isValidElement(d))return [];let{type:m,props:y}=np(d);if(!(m===yr||typeof m=="function"&&"displayName"in m&&m.displayName===yr.displayName))return [];let x=y;return [{href:x.href,disabled:x.disabled,node:x.children,className:x.className,css:x.css,onClick:x.onClick,startIcon:x.startIcon,endIcon:x.endIcon}]}),[e]),v=me.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:p.typography.sizes.sm,fontWeight:500,gap:p.spacing.xs,cursor:"default"}),[p]),k=me.useMemo(()=>css({margin:"0 0.15rem",color:p.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[p]),C=me.useCallback((d,m,y)=>{let N=d?p.text.primary:p.text.secondary,x=i&&m&&!y;return css({display:"inline-flex",alignItems:"center",gap:p.spacing.xs,color:N,cursor:m&&!y?"pointer":"default",textDecoration:"none",borderRadius:p.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":x?{textDecoration:"underline",color:p.text.primary}:{textDecoration:"none"}})},[p,i]),T=me.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),h=me.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[v,n],...c,children:f.map((d,m)=>{let y=m===f.length-1,N=!!d.href&&!d.disabled&&!y,x=["plainframe-ui-breadcrumb",y?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",N?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),w=[C(y,N,d.disabled),o,y?r:s,N?a:void 0,R(),d.css],P=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:T,children:d.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:h,children:d.node}),d.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:T,children:d.endIcon})]});return jsxs(me.Fragment,{children:[m!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[k,u],children:t}),N?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":y?"true":"false","data-link":"true",className:x,css:w,children:P}):jsx("span",{"aria-current":y?"page":void 0,tabIndex:y?-1:0,"data-active":y?"true":"false","data-link":"false",className:x,css:w,children:P})]},m)})})});var Is=(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})},Ss=e=>typeof e=="number"?`${e}px`:e,Wi=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)&&Wi(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,u=e.text.onColors||{},i=u.primary??o.onColors.primary,l=u.danger??i,c=(p,R,f)=>p&&p[R]||f;if(t==="primary"){let p=s,R=c(p,600,n[900])||c(p,500,n[900]),f=c(p,500,n[800])||c(p,600,n[800]);return {bg:R,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let p=a,R=c(p,600,n[900])||c(p,500,n[900]),f=c(p,500,n[800])||c(p,600,n[800]);return {bg:R,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 Ki=me.memo(me.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:u=false,loadingIndicator:i,loadingPosition:l="center",children:c,className:p,hoverEffect:R=true,onClick:f,css:v,...k},C)=>{let T=U(),h=xe(),d=useMemo(()=>ip(T,t),[T,t]),m=useMemo(()=>lp(T,e),[T,e]),y=useMemo(()=>!n&&!o&&!Wi(c)&&me.Children.count(c)===1,[n,o,c]),N=d.iconSize,x=useMemo(()=>Is(n,N),[n,N]),w=useMemo(()=>Is(o,N),[o,N]),P=useMemo(()=>i??jsx(no,{color:m.fg,variant:"circular",size:14,thickness:5}),[i,m]),$=useMemo(()=>y?"center":l??"center",[y,l]),W=!!u&&$==="center",K=!!u&&$==="start",I=!!u&&$==="end",F=a||u,S=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:d.minHeight,lineHeight:1,fontWeight:600,cursor:F?"not-allowed":"pointer",opacity:F?.5:1,userSelect:"none",position:"relative",borderRadius:r?T.radius.full:d.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,d,r,T,F]),g=useMemo(()=>css({backgroundColor:m.bg,color:m.fg,border:m.border}),[m,T]),b=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:m.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":R&&!F?{":hover::before":{opacity:1}}:{}}),[m,R,F]),A=useMemo(()=>css(y&&!s?{width:"100%",height:"100%",maxWidth:d.minHeight,minWidth:d.minHeight,maxHeight:d.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:Ss(d.iconSize)}:{fontSize:Ss(d.fontSize),padding:n||o?`${d.paddingY} ${d.paddingXIcon}`:`${d.paddingY} ${d.paddingX}`}),[y,s,d,n,o]),H=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:Ss(T.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[T,W]),B=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),M=useMemo(()=>typeof d.iconSize=="number"?d.iconSize:Math.max(12,Math.round(parseFloat(String(d.iconSize))||16)),[d.iconSize]),E=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:M,minWidth:M,maxWidth:M,height:"1em"}),[M]),L=useMemo(()=>j=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:j?1:0,transition:"opacity 140ms ease"}),[]),z=useMemo(()=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:W?1:0,pointerEvents:"none",zIndex:2,transition:"opacity 140ms ease"}),[W]),O=useMemo(()=>()=>{if(y)return null;let j=!!n;return !j&&!K?null:jsxs("span",{css:E,"aria-hidden":u?true:void 0,children:[jsx("span",{css:L(!K),children:j?x||n:null}),jsx("span",{css:L(!!K),children:P})]})},[y,n,K,E,L,x,u,P]),_=useMemo(()=>()=>{if(y)return null;let j=!!o;return !j&&!I?null:jsxs("span",{css:E,"aria-hidden":u?true:void 0,children:[jsx("span",{css:L(!I),children:j?w||o:null}),jsx("span",{css:L(!!I),children:P})]})},[y,o,I,E,L,w,u,P]),D=!(a||u);return jsxs("button",{ref:C,type:"type"in k&&k.type?k.type:"button","data-variant":e,className:["plainframe-ui-button",p||""].join(" ").trim(),css:[S,h({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),g,b,A,v],onClick:D?f:void 0,disabled:a||void 0,tabIndex:u?-1:void 0,"aria-disabled":a||void 0,"aria-busy":u||void 0,...k,children:[jsxs("span",{className:"plainframe-ui-button-content",css:H,children:[O(),jsx("span",{className:"plainframe-ui-button-label",css:B,children:y?u?P:Is(c,d.iconSize):c}),_()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:z,"aria-hidden":"true",children:W?P:null})]})}));Ki.displayName="Button";var Rr=e=>isValidElement(e),cp=e=>{let t=e.type;return t.displayName??t.name},Ps=(e,t)=>cp(e)===t,ji=e=>Ps(e,"ButtonGroup"),Ui=e=>Ps(e,"DropdownMenu"),Fs=e=>Ps(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),As=(e,t)=>{if(!Rr(e))return null;if(ji(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?As(t?n[0]:n[n.length-1],t):null}if(Ui(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(Fs);return o?As(o,t):null}if(Fs(e)){let n=Children.toArray(e.props.children??[]).filter(isValidElement);return n.length?n[0]:null}return e},Vi=(e,t)=>{if(!e)return false;let n=As(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return dp(o)},qi=me.memo(me.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:u=false,gap:i,width:l,className:c,role:p="group",css:R,__clipLeft:f,__clipRight:v,...k},C){let T=U(),h=a==="sm"?T.radius.sm:T.radius.md,d=u?T.radius.full:h,m=o==="vertical",y=up(T.componentHeights.border,1),N=T.surface.border,x=n&&!!f,w=n&&!!v,P=css({display:"flex",flexDirection:m?"column":"row",width:r?"100%":l!=null?Kn(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Kn(i??T.spacing.sm)}),$=Children.toArray(t),K=$.filter(Rr).length,I=0,F=false,S=[];for(let g of $){if(!Rr(g)){S.push(g);continue}let b=I===0,A=I===K-1,H=g.props??{},B=H.disabled??s,M=H.size??a,E=0,L=0,z=0,O=0;n&&(m?(E=b?x?0:d:0,L=b?w?0:d:0,O=A?x?0:d:0,z=A?w?0:d:0):(E=b?x?0:d:0,O=b?x?0:d:0,L=A?w?0:d:0,z=A?w?0:d:0));let _=Vi(g,"left"),D=Vi(g,"right"),ae=n&&!b&&!(F&&_)&&!(F||_)?css({[m?"borderTop":"borderLeft"]:`${y} solid ${N}`}):null,q=n&&!b&&F&&_?css(m?{borderTopWidth:0}:{borderLeftWidth:0}):null,X=n?css({borderTopLeftRadius:Kn(E),borderTopRightRadius:Kn(L),borderBottomRightRadius:Kn(z),borderBottomLeftRadius:Kn(O)}):null,le=r?css({flex:1}):null,ie=css([X,ae,q,le]);if(!Ui(g)){let Ce=H.css,Ie=[H.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Te=ji(g)&&n?{__clipLeft:!b,__clipRight:!A}:{},we=cloneElement(g,{...H,disabled:B,size:M,className:Ie,css:[Ce,ie],...Te});S.push(we),F=D,I+=1;continue}let be=H.children,Pe=Children.map(be,Ce=>{if(!Rr(Ce)||!Fs(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:B,size:M})}),Re=cloneElement(g,{...H,children:Pe});S.push(Re),F=D,I+=1;}return jsx("div",{ref:C,role:p,"aria-orientation":m?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",c||""].join(" ").trim(),css:[P,R],...k,children:S})}));qi.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:u,selectable:i,selected:l,defaultSelected:c,onSelectedChange:p,width:R,height:f,onClick:v,onKeyDown:k,role:C,tabIndex:T,...h},d){let m=U(),y=m.surface??{},[N,x]=useState(!!c),w=l!=null,P=w?!!l:N,$=useMemo(()=>xp(o,m),[o,m]),W=useMemo(()=>vp(o,m,$),[o,m,$]),K=W,I=useMemo(()=>hp(r,m),[r,m]),F=useMemo(()=>yp(s,m),[s,m]),S=!!u||!!i,g=useMemo(()=>css({backgroundColor:$,padding:I,borderRadius:F,border:o==="outlined"?`${m.componentHeights?.border??"1px"} solid ${y.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:R?"100%":void 0,maxWidth:Tr(R),height:Tr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:S?"pointer":void 0,...S?{"&:hover":{backgroundColor:W}}:{},'&[data-selected="true"]':{backgroundColor:K},...S?{'&[data-selected="true"]:hover':{backgroundColor:K}}:{}}),[$,I,F,o,m.componentHeights,y.border,R,f,S,W,K]),b=useCallback(()=>{if(!i)return;let M=!P;w||x(M),p?.(M);},[w,p,i,P]),A=useCallback(M=>{i&&b(),v?.(M);},[i,b,v]),H=useCallback(M=>{i&&(M.key==="Enter"||M.key===" ")&&(M.preventDefault(),b()),k?.(M);},[i,b,k]),B=xe();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&P?"true":void 0,"aria-pressed":i?P:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[B(),g,n],onClick:A,onKeyDown:H,role:i?C??"button":C,tabIndex:i?T??0:T,...h,children:t})}));_n.displayName="Container";var Rp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Ds(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 Hs(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=Ds(t,e),s=Ds(n,e),a=Ds(o,e),u={};return r&&!s&&!a&&(u.padding=r),s&&(u.paddingLeft=s,u.paddingRight=s),a&&(u.paddingTop=a,u.paddingBottom=a),u}function Gi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Xi=me.createContext("horizontal"),Ls=()=>me.useContext(Xi),Yi=me.memo(me.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:u,defaultSelected:i,onSelectedChange:l,width:c="100%",height:p,gap:R,direction:f="horizontal",className:v,onClick:k,...C},T)=>{let h=U(),d=xe(),m=f==="vertical",y=css({position:"relative",display:"flex",flexDirection:m?"column":"row",gap:Tp(R,h),alignItems:m?"stretch":"center",transition:"all .16s ease"});return jsx(Xi.Provider,{value:f,children:jsx(_n,{ref:T,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:u,defaultSelected:i,onSelectedChange:l,width:c,height:p,className:["plainframe-ui-card",v||""].join(" ").trim(),css:[d(),y,t],onClick:k,tabIndex:k?0:void 0,...C,children:e})})}));Yi.displayName="Card";me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...u})=>{let i=U(),c=Ls()==="vertical",p=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:yo(o),textAlign:Hs(o),...c?{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:[p,t],...u,children:e})});me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...u})=>{let i=U(),c=Ls()==="vertical",p=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...c?{width:"100%"}:{},...xo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[p,t],...u,children:e})});me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...u})=>{let i=U(),c=Ls()==="vertical",p=css({display:"flex",flexShrink:0,justifyContent:yo(o),alignItems:yo(o),...c?{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:[p,t],...u,children:e})});me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:u,size:i,color:l,...c})=>{let p=U(),R=css({fontWeight:u??500,fontSize:i??(p.typography?.sizes?.sm!==void 0?p.typography.sizes.sm:"1rem"),color:Gi(p,l)??p.text?.primary,textAlign:Hs(o),...xo(p,r,s,a),display:"flex",alignItems:"center",gap:p.spacing?.xs??6});return jsx("div",{"data-slot":"card-title",className:["plainframe-ui-card-title",n||""].join(" ").trim(),css:[R,t],...c,children:e})});me.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:u,size:i,color:l,...c})=>{let p=U(),R=css({fontWeight:u??400,fontSize:i??(p.typography?.sizes?.sm!==void 0?p.typography.sizes.sm:"0.875rem"),color:Gi(p,l)??p.text?.secondary,marginTop:p.spacing?.xxs??2,textAlign:Hs(o),...xo(p,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[R,t],...c,children:e})});var Zi=e=>isValidElement(e),Ip=e=>Zi(e)?e.type?.displayName||e.type?.name:void 0,Ji=e=>Ip(e)==="Card",Sp=e=>typeof e=="number"?`${e}px`:e,Qi=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:u="group",css:i})=>{let l=U(),c=r==="vertical",p=String(l.componentHeights?.border??"1px"),R=l.surface.border,f={display:"flex",flexDirection:c?"column":"row",width:typeof o=="string"||typeof o=="number"?Sp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},v=Children.toArray(e),C=v.filter(Ji).length,T=0,h=v.map((d,m)=>{if(!Ji(d)||!Zi(d))return d;let y=d.props,N=T++,x=N===0,w=N===C-1,P=s??y.variant,$=t?c?{borderTopLeftRadius:x?y.radius:0,borderTopRightRadius:x?y.radius:0,borderBottomLeftRadius:w?y.radius:0,borderBottomRightRadius:w?y.radius:0}:{borderTopLeftRadius:x?y.radius:0,borderBottomLeftRadius:x?y.radius:0,borderTopRightRadius:w?y.radius:0,borderBottomRightRadius:w?y.radius:0}:void 0,W=t&&!x?c?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,K=P==="subtle"&&C>1&&!x?c?{borderTop:`${p} solid ${R}`}:{borderLeft:`${p} solid ${R}`}:null,F=[$,W,K,t?{width:"100%"}:{width:"100%",marginBottom:c?0:void 0,marginRight:c?void 0:0}].filter(Boolean),S=[y.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...y,variant:P??y.variant,css:[y.css,...F],className:S,key:typeof d=="object"&&"key"in d?d.key:m})});return jsx("div",{role:u,"aria-orientation":c?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:h})};Qi.displayName="CardGroup";var He=e=>typeof e=="number"?`${e}px`:e,tl=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)&&tl(n)&&(t=true));}),t},Pp=(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"},nl=me.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:u,size:i="md",onClick:l,onDelete:c,deleteIcon:p,disabled:R,cursor:f,className:v,css:k},C){let T=U(),h=xe(),d=["sm","md","lg"].includes(i)?i:"md",m=useMemo(()=>Pp(T,d),[T,d]),y=!!l&&!R,N=R?"not-allowed":f||(y?"pointer":"inherit"),x=String(T.componentHeights?.border??"1px"),w=useMemo(()=>{let J=T.palette;return r==="secondary"||r==="neutral"?"neutral":r&&J[r]?r:"primary"},[r,T.palette]),P=useCallback(J=>{let ae=T.palette;return (w==="neutral"?T.neutral[J]:ae[w]?.[J])??ae.primary?.[J]},[w,T.neutral,T.palette]),$=useMemo(()=>w==="neutral"?T.neutral[100]:P(50),[w,P,T.neutral]),W=useMemo(()=>w==="neutral"?T.text.secondary:P(800),[w,P,T.text.secondary]),K=useMemo(()=>w==="neutral"?T.neutral[100]:P(50),[w,P,T.neutral]),I=useMemo(()=>w==="neutral"?T.text.secondary:P(800),[w,P,T.text.secondary]),F=useMemo(()=>w==="neutral"?T.neutral[400]:P(300),[w,P,T.neutral]),S=useMemo(()=>w==="neutral"?T.surface.subtleBg:P(600),[w,P,T.surface.subtleBg]),g=useMemo(()=>(T.text.onColors??{})[w]??(w==="neutral"?T.neutral[900]:T.neutral[0]??"#fff"),[w,T.text.onColors,T.neutral]),b="transparent",A=useMemo(()=>w==="neutral"?T.text.secondary:P(700)??T.text.primary,[w,P,T.text.primary,T.text.secondary]),H=useMemo(()=>!a&&!u&&t!=null&&!tl(t)&&me.Children.count(t)===1,[a,u,t]),B=useMemo(()=>o==="filled"?css({backgroundColor:S,color:g,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:K,color:I,border:"none",boxShadow:`inset 0 0 0 ${x} ${F}`}):o==="ghost"?css({backgroundColor:b,color:A,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:W,border:"none",boxShadow:"none"}),[S,g,A,K,I,F,$,W,x,o]),M=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:He(m.gap),padding:o==="ghost"?0:H||t==null?He(m.soloPadding):`${He(m.paddingY)} ${He(m.paddingX)}`,borderRadius:s?T.radius.full:m.radius,fontWeight:600,cursor:N,opacity:R?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...H?{lineHeight:1,minWidth:`calc(${He(m.iconSize)} + ${He(m.soloPadding)} * 2)`,minHeight:`calc(${He(m.iconSize)} + ${He(m.soloPadding)} * 2)`,justifyContent:"center"}:null}),[m,N,t,R,H,s,T.radius.full,o]),E=useMemo(()=>css({fontSize:He(H?m.iconSize:m.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:H?He(m.iconSize):void 0,height:H?He(m.iconSize):void 0,display:H?"block":void 0}}),[m.fontSize,m.iconSize,H]),L=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:He(m.iconSize),lineHeight:0,"& > svg":{width:He(m.iconSize),height:He(m.iconSize),display:"block"}}),[m.iconSize]),z=useMemo(()=>css({marginRight:H||t==null?0:He(m.gap),marginLeft:H||t==null?0:He(m.iconOffset)}),[m.gap,m.iconOffset,t,H]),O=useMemo(()=>css({marginLeft:H||t==null?0:He(m.gap),marginRight:H||t==null?0:He(s?m.iconOffsetRounded:m.iconOffset)}),[m.gap,m.iconOffset,m.iconOffsetRounded,t,H,s]),_=useMemo(()=>css({marginRight:s?0:He(m.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:R?"not-allowed":"pointer",color:"currentColor",opacity:R?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:He(m.iconSize),borderRadius:T.radius.xs}),[m.iconOffset,m.iconSize,R,s,T.radius.xs]),D=useCallback(J=>{y&&(J.key==="Enter"||J.key===" ")&&(J.preventDefault(),l?.());},[y,l]),j=useMemo(()=>jsx(X,{css:{width:m.iconSize,height:m.iconSize},strokeWidth:2.5}),[m.iconSize]);return jsxs("div",{ref:C,className:["plainframe-ui-chip",y?"plainframe-ui-chip-clickable":"",v||""].join(" ").trim(),css:[M,B,y?h({color:r??"primary"}):null,k],onClick:y?l:void 0,onKeyDown:D,role:y?"button":void 0,tabIndex:y?0:void 0,"aria-disabled":R||void 0,"data-variant":o,"data-color":w,"data-size":i,"data-icon-only":H||void 0,children:[a&&jsx("span",{css:[L,z],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[E,n],className:"plainframe-ui-chip-label",children:t}),u&&jsx("span",{css:[L,O],className:"plainframe-ui-chip-icon-right",children:u}),c&&jsx("button",{type:"button","aria-label":"Delete",disabled:R,tabIndex:0,onClick:J=>{J.stopPropagation(),R||c?.();},css:[_,h({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:p||j})]})}));nl.displayName="Chip";var Lp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Bp=me.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:u,error:i,disabled:l,ringEnabled:c,focusRingMode:p,placeholder:R,separator:f,gapPx:v}){let k=xe(),C=r.neutral,T=r.text,h=r.componentHeights.border,d=useRef([]),[m,y]=useState(0),N=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),x=useMemo(()=>{if(!R)return Array(o).fill("");if(R.length===1)return Array(o).fill(R);let H=R.slice(0,o).split("");for(;H.length<o;)H.push("");return H},[R,o]),w=useMemo(()=>{let H=r.componentHeights[s];return `calc(${typeof H=="number"?`${H}px`:H} * 1.5)`},[r.componentHeights,s]),P=l?C[200]:i&&u==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&u==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:u==="subtle"?r.surface.subtleBg:u==="outlined"?r.surface.panelBg:"transparent",$=u==="outlined"?`${h} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",W=H=>css({width:w,height:w,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:P,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?C[500]:i?r.palette.danger?.[800]??T.primary:T.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??T.primary:T.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??T.secondary:T.secondary,opacity:.85}},c?k({enabled:true,disabled:l,mode:p==="always"?"always":"visible",color:i?"danger":void 0}):void 0,H?css({}):null),K=css({display:"flex",gap:v,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),I=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:T.secondary,userSelect:"none"}),F=H=>H.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),S=useCallback(H=>{let B=Math.max(0,Math.min(o-1,H));y(B),d.current[B]?.focus();},[o]),g=useCallback((H,B)=>{let M=F(B).slice(0,1),E=[...N];E[H]=M,n(E.join("")),M&&H<o-1&&S(H+1);},[N,o,n,S]),b=useCallback((H,B)=>{if(B.key==="Backspace")if(!N[H]&&H>0){let M=[...N];M[H-1]="",n(M.join("")),S(H-1),B.preventDefault();return}else {let M=[...N];M[H]="",n(M.join(""));return}if(B.key==="ArrowLeft"&&H>0){B.preventDefault(),S(H-1);return}if(B.key==="ArrowRight"&&H<o-1){B.preventDefault(),S(H+1);return}if(B.key==="Home"){B.preventDefault(),S(0);return}if(B.key==="End"){B.preventDefault(),S(o-1);return}},[N,o,n,S]),A=useCallback(H=>{let B=F(H.clipboardData.getData("text")).slice(0,o);B&&(n(B),requestAnimationFrame(()=>{let M=Math.min(B.length,o-1);S(M);}),H.preventDefault());},[o,n,S]);return jsx("div",{className:"plainframe-ui-code-boxes",css:K,children:Array.from({length:o}).map((H,B)=>jsxs(me.Fragment,{children:[jsx("input",{ref:M=>{d.current[B]=M;},type:"text",inputMode:"text",maxLength:1,value:N[B]||"",placeholder:N[B]?"":x[B]||"",disabled:l,onChange:M=>g(B,M.target.value),onKeyDown:M=>b(B,M),onFocus:()=>y(B),onPaste:B===0?A:void 0,className:"plainframe-ui-code-box",css:W(B===m),"aria-label":`Code character ${B+1}`,tabIndex:B===m?0:-1}),f&&B<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:I,children:f}):null]},B))})}),$p=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:u,disabled:i=false,gap:l,size:c="md",variant:p="subtle",length:R=4,focusRingMode:f="always",className:v,wrapperCss:k,labelCss:C,helperRowCss:T,helperTextCss:h,css:d})=>{let m=U(),y=useId(),N=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]),x=["sm","md","lg"].includes(c)?c:"md",w=N[x],P=m.neutral,$=m.text,W=t!=null,[K,I]=useState(n),F=W?t:K,S=z=>{W||I(z),o?.(z);},g=Math.max(2,Math.min(R,10)),b=m.spacing.sm,A=Lp(l??b)??"0px",H=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(k)?k:k?[k]:[]),B=css({fontSize:w.labelFont,fontWeight:500,color:a?m.palette.danger?.[700]??$.primary:i?P[500]:$.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(C)?C:C?[C]:[]),M=css({display:"flex",alignItems:"center",justifyContent:"center",gap:A,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),E=css({minHeight:16,fontSize:w.helperFont,color:a?m.palette.danger?.[700]??$.secondary:$.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(T)?T:T?[T]:[]),L=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?m.palette.danger?.[700]??$.primary:i?P[500]:$.primary},...Array.isArray(h)?h:h?[h]:[]);return jsxs("div",{className:["plainframe-ui-codefield",v||""].join(" ").trim(),css:H,children:[e&&jsx("span",{id:y,className:"plainframe-ui-codefield-label",css:B,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:M,role:"group","aria-labelledby":e?y:void 0,tabIndex:-1,children:jsx(Bp,{value:F||"",onChange:S,len:g,theme:m,sizeKey:x,s:{codeFontSize:w.codeFontSize},variant:p,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:A})}),u!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:E,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:L,children:u})})]})};var il=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 ""},$s=e=>{if(!e||typeof e!="object")return false;let t=il(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($s):$s(o)},Op=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=me.useRef(null),[u,i]=me.useState(false),l=me.useCallback(E=>{i(E),o?.(E);},[o]),c=me.useCallback(()=>l(false),[l]),p=me.useRef({x:0,y:0}),R=me.useRef(null),f=me.useRef(null),v=me.useCallback(()=>{f.current=null;let E=R.current;if(!E)return;let L=Math.round(p.current.x),z=Math.round(p.current.y);E.style.transform=`translate3d(${L}px, ${z}px, 0)`;},[]),k=me.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(v));},[v]);me.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let C=me.useMemo(()=>({getBoundingClientRect:()=>{let E=Math.round(p.current.x),L=Math.round(p.current.y);return {x:E,y:L,left:E,top:L,right:E,bottom:L,width:0,height:0,toJSON:()=>({x:E,y:L})}}}),[]),T=me.useRef(`cz-${Math.random().toString(36).slice(2)}`),h=me.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${T.current}"]`):null,[]),d=me.useRef(null),m=me.useRef(null),y=me.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),N=me.useCallback(()=>{m.current!=null&&clearTimeout(m.current),m.current=null;},[]),x=me.useCallback(()=>{N(),m.current=window.setTimeout(()=>l(false),0);},[N,l]),w=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}},[]),P=me.useCallback((E,L)=>{p.current={x:E,y:L},k(),l(true);},[k,l]),$=typeof t=="function"?t({close:c}):t,W=$s($),K=E=>{if(!me.isValidElement(E))return E;let L=il(E),z=E,O=z.props.children,_=O==null?O:Array.isArray(O)?O.map(D=>me.isValidElement(D)?K(D):D):me.isValidElement(O)?K(O):O;if(L==="DropdownMenu"){let D=z.props.onOpenChange;return me.cloneElement(z,{...z.props,open:u,onOpenChange:j=>{D?.(j),l(j);},children:_})}if(L==="DropdownMenuContent"){let D=z.props.onMouseEnter,j=z.props.onMouseLeave;return me.cloneElement(z,{...z.props,anchor:C,"data-cz-id":T.current,onMouseEnter:J=>{N(),D?.(J);},onMouseLeave:J=>{x(),j?.(J);},children:_})}return _===O?z:me.cloneElement(z,{...z.props,children:_})},I=W?K($):$,F=me.useCallback(E=>{E.preventDefault(),P(E.clientX,E.clientY);},[P]),S=me.useCallback(E=>{n==="contextmenu"&&F(E);},[n,F]),g=me.useCallback(E=>{n==="dblclick"&&F(E);},[n,F]),b=me.useCallback(E=>{n==="click"&&F(E);},[n,F]),A=me.useCallback(E=>{if(n!=="hover")return;y(),N();let L=r==="center"?w():{x:E.clientX,y:E.clientY};d.current=window.setTimeout(()=>{let z=L.x+(r==="cursor"?s:0),O=L.y+(r==="cursor"?s:0);P(z,O);},0);},[n,r,s,w,P,y,N]),H=me.useCallback(E=>{n==="hover"&&u&&r==="cursor"&&!W&&(p.current={x:E.clientX+s,y:E.clientY+s},k());},[n,u,r,W,s,k]),B=me.useCallback(()=>{n==="hover"&&(y(),x());},[n,y,x]);me.useEffect(()=>{if(n!=="hover")return;let E=()=>{if(!u)return;let L=a.current?.matches(":hover"),z=h()?.matches?.(":hover");L||z?N():x();};return window.addEventListener("pointermove",E,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",E,{capture:true})},[u,n,h,N,x]),me.useEffect(()=>{let E=()=>{if(u)if(n==="hover"){let L=a.current?.matches(":hover"),z=h()?.matches?.(":hover");if(L||z?N():x(),r==="center"&&a.current){let O=w();p.current={x:O.x,y:O.y},k();}}else l(false);};return window.addEventListener("scroll",E,true),window.addEventListener("resize",E,true),()=>{window.removeEventListener("scroll",E,true),window.removeEventListener("resize",E,true);}},[u,n,r,w,k,l,N,x,h]),me.useEffect(()=>()=>{y(),N();},[y,N]);let M=({children:E})=>u?jsx("div",{ref:R,style:{position:"fixed",left:0,top:0,transform:`translate3d(${Math.round(p.current.x)}px, ${Math.round(p.current.y)}px, 0)`,willChange:"transform",zIndex:1e3,pointerEvents:"auto"},onMouseEnter:()=>n==="hover"&&N(),onMouseLeave:()=>n==="hover"&&x(),children:E}):null;return jsxs("div",{ref:a,onContextMenu:S,onDoubleClick:g,onClick:b,onMouseEnter:A,onMouseMove:H,onMouseLeave:B,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,W?I:jsx(M,{children:I})]})};var jn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,Vp=me.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:u="5px",insetMargin:i="10px",chip:l=false,chipVariant:c="subtle",rounded:p=false,margin:R=10,css:f,labelCss:v,strokeCss:k,className:C,...T},h){let d=U(),{t:m,strokeColor:y,labelTextColor:N,chipSubtleBg:x,chipOutlinedBg:w,outerM:P,padX:$,verticalStrokeMargin:W}=useMemo(()=>{let g=typeof s=="number"?`${s}px`:s,b=d.surface.border,A=d.text.secondary,H=d.surface.subtleBg,B=d.surface.panelBg,M=jn(R,"10px"),E=o==="horizontal"?n==="middle"?jn(u):n==="inset"?jn(i,"0px"):"0":"0",L=o==="vertical"?n==="middle"?jn(u):n==="inset"?jn(i,"0px"):"0":"0";return {t:g,strokeColor:b,labelTextColor:A,chipSubtleBg:H,chipOutlinedBg:B,outerM:M,padX:E,verticalStrokeMargin:L}},[s,d,o,n,u,i,R]),K=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":m,minWidth:t?"max-content":m,marginLeft:P,marginRight:P}:{flexDirection:"row",width:a?jn(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:P,marginBottom:P},...Array.isArray(f)?f:f?[f]:[]]),[o,t,m,P,a,$,n,f]),I=useMemo(()=>css([{background:y,borderRadius:p?d.radius.full:d.radius.xs},o==="vertical"?{width:m,minHeight:18,flex:1,marginTop:W,marginBottom:W}:{height:m,flex:1}]),[y,p,d.radius.full,d.radius.xs,o,m,W]),F=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?p?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:N,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?c==="subtle"?{background:x,border:"none"}:{background:w,border:`${m} solid ${y}`}:{}},...Array.isArray(v)?v:v?[v]:[]]),[l,o,p,d.radius.full,d.radius.sm,N,c,x,w,m,y,v]),S=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[I,k]}),[I,k]);return o==="vertical"?jsxs("div",{ref:h,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",C||""].join(" ").trim(),css:K,...T,children:[t&&r!=="top"&&S,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="bottom"&&S,!t&&S]}):jsxs("div",{ref:h,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",C||""].join(" ").trim(),css:K,...T,children:[t&&r!=="left"&&S,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="right"&&S,!t&&S]})}));var fl=me.createContext(null),gl=()=>{let e=useContext(fl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},bl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,u]=useState(!!n),i=t??a,l=useCallback(p=>{t===void 0&&u(p),o?.(p);},[t,o]),c=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(fl.Provider,{value:c,children:e})},qp=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=gl(),u=!!e&&me.isValidElement(t),i=useCallback(c=>{if(u){let p;me.isValidElement(t)&&(p=t.props.onClick),p?.(c);}r.onClick?.(c),c.defaultPrevented||a(true);},[u,t,r.onClick,a]),l=useCallback(c=>{if((c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a(true)),u){let p;me.isValidElement(t)&&(p=t.props.onKeyDown),p?.(c);}r.onKeyDown?.(c);},[u,t,r.onKeyDown,a]);if(u){let c=t,p=c.props.css;return me.cloneElement(c,{...c.props||{},className:[c.props.className,n].filter(Boolean).join(" ")||void 0,css:[p,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})});qp.displayName="DrawerTrigger";var To=0,hl="",yl="",Gp=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function Xp(){if(!(typeof document>"u")){if(To===0){let e=document.body;hl=e.style.overflow||"",yl=e.style.paddingRight||"";let t=Gp();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}To+=1;}}function Yp(){if(!(typeof document>"u")&&(To>0&&(To-=1),To===0)){let e=document.body;e.style.overflow=hl,e.style.paddingRight=yl;}}var Jp=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,xl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:u,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:c=true,transitionMs:p,snapClosePct:R=.33,velocityClosePxS:f=950,dragElasticOut:v=.2,className:k,css:C,...T},h){let d=U(),{open:m,setOpen:y,lockScroll:N,closeOnEscape:x}=gl();useEffect(()=>{if(!(!N||!m))return Xp(),()=>Yp()},[m,N]);let w=useMemo(()=>Jp(a,0),[a]),P=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),W=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[n,r,s,w]),K=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[o,r,s,w]),I=useMemo(()=>{let q=String(d.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,d.radius.lg]),F=useMemo(()=>u??(s==="inset"?d.radius.lg:I),[u,s,d.radius.lg,I]),S=useMemo(()=>s==="inset"?{top:r==="bottom"?void 0:w,bottom:r==="top"?void 0:w,left:r==="right"?void 0:w,right:r==="left"?void 0:w}:{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,w]),g=useRef(null),b=useCallback(()=>{let q=g.current;if(!q)return 1;let X=q.getBoundingClientRect();return P==="x"?X.width:X.height},[P]),A=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),H=useMemo(()=>({duration:(p??280)/1e3,ease:[.22,1,.36,1]}),[p]),B=useMemo(()=>$*1.1,[$]),M=useMemo(()=>P==="x"?{x:`${B*100}%`,y:0}:{y:`${B*100}%`,x:0},[P,B]),E=useMemo(()=>css({position:"fixed",zIndex:1100,...S,width:W,height:K,backgroundColor:d.surface.panelBg,borderRadius:F,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:m?"auto":"none",touchAction:P==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[S,W,K,d.surface,F,m,P]),L=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:d.surface.overlayBg,transition:"all .3s ease",...i?{backdropFilter:`blur(${l??"2px"})`}:null}),[i,l,d.surface]),z=useCallback(()=>{c&&y(false);},[c,y]),O=useMemo(()=>P==="x"?{left:$===-1?v:0,right:$===1?v:0}:{top:$===-1?v:0,bottom:$===1?v:0},[P,$,v]),_=useMemo(()=>P==="x"?{left:0,right:0}:{top:0,bottom:0},[P]),D=useMemo(()=>Math.max(0,Math.min(1,R)),[R]),j=useCallback((q,X)=>{let le=P==="x"?X.offset.x:X.offset.y,ie=P==="x"?X.velocity.x:X.velocity.y,be=$*le>0,Pe=Math.abs(le)>=b()*D,Re=$*ie>f;be&&(Pe||Re)&&y(false);},[P,$,b,D,f,y]),J=useRef(null);useEffect(()=>{if(!m)return;J.current=document.activeElement;let q=setTimeout(()=>{let ie=g.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),X=ie=>{let be=g.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"&&x&&(ie.stopPropagation(),y(false));};return document.addEventListener("focusin",X,true),window.addEventListener("keydown",le),()=>{clearTimeout(q),document.removeEventListener("focusin",X,true),window.removeEventListener("keydown",le),J.current&&typeof J.current.focus=="function"&&J.current.focus();}},[m,y,x]);let{...ae}=T;return jsx(AnimatePresence,{children:m?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:L,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:p?H:{duration:.18,ease:"linear"},onClick:z},"overlay"),jsx(motion.div,{ref:q=>{g.current=q,typeof h=="function"?h(q):h&&(h.current=q);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",k||""].join(" ").trim(),css:[E,C],drag:P,dragConstraints:_,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:j,initial:{...M,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...M,opacity:.98},transition:p?H:A,...ae,children:t},"panel")]}):null})});xl.displayName="DrawerContent";var Zp=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:u,...i},l){let c=t!==void 0?t:n,p=o!==void 0?o:r,R=c!==void 0,[f,v]=useState(!!p),k=R?!!c:f,C=useCallback(T=>{R||v(T),T||a?.(),s?.(T);},[R,a,s]);return jsx(bl,{open:k,onOpenChange:C,children:jsx(xl,{ref:l,...i,children:u})})});Zp.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=true,className:a,blur:u=false})=>{let i={opacity:o?1:0,filter:u?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=p=>R=>{R.target===R.currentTarget&&(R.propertyName==="opacity"||R.propertyName==="filter")&&r?.(),p?.(R);};if(s&&isValidElement(e)){let p=e,R=p.props.css,f=Array.isArray(R)?[...R,i]:R?[R,i]:[i],v=["plainframe-ui-transition-fade",p.props.className||"",a||""].join(" ").trim(),k=p.props.onTransitionEnd;return cloneElement(p,{...p.props,css:f,className:v,onTransitionEnd:l(k)})}let c=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:c,onTransitionEnd:l(),children:e})};var vl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Cl=me.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:u,height:i,...l})=>{let c=U(),p=e==="vertical"||e==="column"?"column":"row",R=t===void 0?void 0:typeof t=="number"?t:c.spacing[t]??t,f=css({display:"flex",flexDirection:p,gap:R,justifyContent:n,alignItems:o,maxWidth:vl(u),width:u?"100%":void 0,maxHeight:vl(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})});Cl.displayName="Flex";var _s=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:u=true,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"},c=R=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),R?.(f);};if(u&&isValidElement(e)){let R=e,f=R.props.css,v=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=R.props.onTransitionEnd,C=["plainframe-ui-transition-grow",R.props.className||"",i||""].join(" ").trim();return cloneElement(R,{...R.props,css:v,className:C,onTransitionEnd:c(k)})}let p=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:p,onTransitionEnd:c(),children:e})};var Rl={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"}},mm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),fm={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:u="left",textTransform:i="none",whiteSpace:l="normal",decoration:c="none",decorationStyle:p="solid",decorationThickness:R=1,decorationColor:f,italic:v,className:k,style:C,as:T})=>{let h=U(),d=Rl[e]??Rl.body,m=T??fm[e]??"span",y=F=>F==null?d.size:typeof F=="number"?F:h?.typography?.sizes?.[F]??F,N=y(o)??y(d.size),x=r??d.weight,w=s??d.lh,P=a??d.ls,$=n==="secondary"?h.text.secondary:n==="primary"?h.text.primary:n??"inherit",W=f??h.surface.border,K=css({boxSizing:"border-box",display:u==="left"?"inline":"block",textAlign:u==="left"?void 0:u,fontFamily:h?.typography?.fonts?.sans||"inherit",fontSize:N,fontWeight:x,lineHeight:w,letterSpacing:P,color:$,textTransform:i,whiteSpace:l,fontStyle:v?"italic":"normal",margin:0,padding:0}),I=c==="none"?css({textDecoration:"none"}):css({textDecorationLine:c,textDecorationStyle:p,textDecorationColor:W,textDecorationThickness:mm(R),textDecorationSkipInk:"auto"});return jsx(m,{className:[`pfui-typo-${e}`,k||""].join(" ").trim(),css:[K,I],style:C,"data-variant":e,children:t})});Un.displayName="Typography";var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,hm=(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 qs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},wl=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:u="none",label:i,labelAlign:l="center",aspectRatio:c,loading:p="lazy",decoding:R="async",fetchPriority:f,srcSet:v,sizes:k,placeholder:C,blurDataURL:T,placeholderColor:h="#f1f1f1",fallbackSrc:d,className:m,css:y,onClick:N,onLoad:x,onError:w,...P},$){let[W,K]=useState(false),[I,F]=useState(false),[S,g]=useState(false),b=U(),A=hm(s,b)??"0px",H=i?"figure":"div",B=css({display:"flex",flexDirection:"column",gap:i?b.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${A})`}),M=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${A})`,maxWidth:o?qs(o):"100%",maxHeight:r?qs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:c,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:W&&(u==="rotate"||u==="scale-rotate")?"rotate(3deg)":"none",cursor:N?"pointer":void 0}),E=css({position:"absolute",inset:0,background:C==="color"?h:void 0,backgroundImage:C==="blur"&&T?`url(${T})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:C==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:S?0:1,pointerEvents:"none"}),L=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:W&&(u==="scale"||u==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(H,{className:["plainframe-ui-image",m||""].join(" ").trim(),css:[B,y],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:M,onMouseEnter:()=>K(true),onMouseLeave:()=>K(false),onClick:N,children:[!S&&C&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:E}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css:L,src:I&&d?d:t,alt:n,srcSet:v,sizes:k,loading:p,decoding:R,fetchPriority:f,onLoad:z=>{g(true),x?.(z);},onError:z=>{F(true),w?.(z);},...P})]}),i&&jsx(Un,{as:"figcaption",variant:"caption",align:l,children:i})]})});wl.displayName="Image";var El=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Cm=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}},Rm=e=>e*Math.PI/180,Tm=(e,t,n)=>{let o=Math.abs(Rm(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 wm(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 Em=(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,kl=[1.02,1.03,1.02],Il=[1.06,1.08,1.06],km={sm:150,md:200,lg:260,xl:340},Im=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Sm(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 Im(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var Mm=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:u,maxItems:i=3,shadow:l=false,cursor:c,outline:p,outlineColor:R,outlineWidth:f=3,outlineOffset:v=0,radius:k="md",label:C,labelAlign:T="center",css:h,className:d,...m}){let y=U(),N=Cm(r)??4/5,x=typeof o=="string"?o:void 0,w=typeof o=="number"?o:x&&/px$/.test(x)?parseFloat(x):km[s],P=Math.max(1,w/N),W=Children.toArray(t).filter(isValidElement).slice(0,i),K=W.length,I=wm(n,K),F=W.map((q,X)=>Em(n,K,X)),S=q=>P*.6*F[q],g=q=>S(q)*N,b=0,A=0;for(let q=0;q<K;q++){let X=g(q),le=S(q),ie=Math.max(Math.abs(I.base.ang[q]??0),Math.abs(I.exp.ang[q]??0)),be=Math.max(Math.abs(I.base.dx[q]??0),Math.abs(I.exp.dx[q]??0)),Pe=Math.max(Math.abs(I.base.dy[q]??0),Math.abs(I.exp.dy[q]??0)),Re=a==="expand"?Il[q]??1.08:a==="reveal"?kl[q]??1.03:1,Ce=Tm(X,le,ie),Ie=Ce.w*Re,Te=Ce.h*Re,we=be/100*X*Re,he=Pe/100*le*Re;b=Math.max(b,Ie/2+we),A=Math.max(A,Te/2+he);}let H=Math.max(1,2*b),B=Math.max(1,2*A),M=Math.min(1,w/H,P/B),E=u===void 0?"pointer":"controlled",L=u?"true":void 0,z=css({display:"flex",flexDirection:"column",cursor:c||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:C?y.spacing.xs:0}),O=css({position:"relative",width:El(typeof o=="number"?o:w)??(typeof o=="string"?o:void 0),height:El(P)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${H}px`,height:`${B}px`,transform:`translate(-50%, -50%) scale(${M})`,transformOrigin:"center center"}),D=Sm(k,y)??"0px",j=q=>{let X=n==="fan"?`rotate(${I.base.ang[q]}deg) translate(${I.base.dx[q]}%, ${I.base.dy[q]}%)`:n==="slide"?`translate(${I.base.dx[q]}%, ${I.base.dy[q]}%) rotate(${I.base.ang[q]}deg)`:n==="domino"?`translate(0%, ${I.base.dy[q]}%)`:`translate(${I.base.dx[q]}%, ${I.base.dy[q]}%) rotate(${I.base.ang[q]}deg)`,le=n==="fan"?`rotate(${I.exp.ang[q]}deg) translate(${I.exp.dx[q]}%, ${I.exp.dy[q]}%)`:n==="slide"?`translate(${I.exp.dx[q]}%, ${I.exp.dy[q]}%) rotate(${I.exp.ang[q]}deg)`:n==="domino"?`translate(0%, ${I.exp.dy[q]}%)`:`translate(${I.exp.dx[q]}%, ${I.exp.dy[q]}%) rotate(${I.exp.ang[q]}deg)`,ie=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${X} scale(1)`,be=a==="expand"?`${le} scale(${Il[q]??1.06})`:a==="reveal"?`${X} scale(${kl[q]??1.03})`:`${X} 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:p?`${f}px solid ${R??y.surface.appBg}`:void 0,outlineOffset:p?v: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}`}})},J=q=>css({width:`${g(q)}px`,aspectRatio:`${N}`,position:"relative",overflow:"hidden",borderRadius:D,"--pfui-image-radius":D,"& > *":{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(C?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":E,"data-hovered":L,css:[z,h],tabIndex:-1,...m,children:[jsx("div",{className:"plainframe-ui-image-stack",css:O,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:_,children:W.map((q,X)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:j(X),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:J(X),children:q})},X))})}),C&&jsx(Un,{as:"figcaption",variant:"caption",align:T,children:C})]})});var Sl=e=>typeof e=="number"?`${e}px`:e,Ml={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Pm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Sl(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Sl(n)}return e}var Nm=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,css:u,className:i="plainframe-ui-kbd",...l},c){let p=U(),R=xe(),f=Ml[o]??Ml.sm,v=Pm(r,p),k={br:p.neutral[300],txt:p.neutral[800],inset:p.neutral[0]},C=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",height:n==="ghost"?void 0:`${f.h}px !important`,minHeight:n==="ghost"?void 0:`${f.h}px !important`,paddingInline:n==="ghost"?0:`${f.px}px !important`,paddingBlock:"0 !important",fontFamily:s?p.typography.fonts.mono:"inherit",fontSize:n==="ghost"?`${f.font*1.2}px !important`:`${f.font}px !important`,fontWeight:600,letterSpacing:.2,lineHeight:"0.2 !important",textTransform:a?"uppercase":"none",borderRadius:v,userSelect:"none",whiteSpace:"nowrap",verticalAlign:"baseline",position:"relative",outline:"none"}),T=css({"&&":{background:p.neutral[200],border:"none",boxShadow:"none",color:k.txt}}),h=css({"&&":{background:"transparent",color:k.txt,border:"none",boxShadow:"none"}}),d=css({"&&":{background:p.surface.panelBg,color:k.txt,border:`1px solid ${k.br}`,boxShadow:`inset 0 1px 0 ${k.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),m=n==="subtle"?T:n==="ghost"?h:d;return jsx("kbd",{ref:c,className:i,css:[R(),C,m,u],...l,children:t})});var $m=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Gs=({children:e,direction:t="up",duration:n=450,delay:o=0,on:r=false,onAnimationEnd:s,asChild:a=true,className:u,distance:i})=>{let c=$m(i,t==="left"||t==="right"?"100vw":"100vh"),p=t==="left"?`-${c}`:t==="right"?c:"0",R=t==="up"?c:t==="down"?`-${c}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${p}, ${R}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},v=C=>T=>{T.target===T.currentTarget&&T.propertyName==="transform"&&s?.(),C?.(T);};if(a&&isValidElement(e)){let C=e,T=C.props.css,h=Array.isArray(T)?[...T,f]:T?[T,f]:[f],d=["plainframe-ui-transition-slide",C.props.className||"",u||""].join(" ").trim(),m=C.props.onTransitionEnd;return cloneElement(C,{...C.props,css:h,className:d,onTransitionEnd:v(m)})}let k=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",u||""].join(" ").trim(),css:k,onTransitionEnd:v(),children:e})};var Xs=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},Vm=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,u]=useState(!!n),i=t??a,l=useCallback(p=>{t===void 0&&u(p),o?.(p);},[t,o]);useEffect(()=>{if(!i||!s)return;let p=R=>{R.key==="Escape"&&(R.stopPropagation(),l(false));};return window.addEventListener("keydown",p,true),()=>window.removeEventListener("keydown",p,true)},[i,s,l]);let c=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Pl.Provider,{value:c,children:e})},Dl=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Nl(),u=!!e&&me.isValidElement(t),i=useCallback(c=>{if(u){let p;me.isValidElement(t)&&(p=t.props.onClick),p?.(c);}r.onClick?.(c),c.defaultPrevented||a(true);},[u,t,r.onClick,a]),l=useCallback(c=>{if((c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a(true)),u){let p;me.isValidElement(t)&&(p=t.props.onKeyDown),p?.(c);}r.onKeyDown?.(c);},[u,t,r.onKeyDown,a]);if(u){let c=t,p=c.props.css;return me.cloneElement(c,{...c.props||{},className:[c.props.className,n].filter(Boolean).join(" ")||void 0,css:[p,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:u=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:c="fade",direction:p="up",transitionDuration:R=300,containerCss:f,backdropCss:v,className:k,...C},T)=>{let h=U(),{open:d,setOpen:m,lockScroll:y}=Nl(),N=me.useRef(null),x=me.useRef(null);me.useEffect(()=>{if(!d)return;x.current=document.activeElement;let I=setTimeout(()=>{let S=N.current;if(!S)return;let g=S.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');g.length>0?g[0].focus():S.focus();},100),F=S=>{let g=N.current;if(!g||!S.target)return;let b=S.target;if(!g.contains(b)){S.preventDefault();let A=g.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');A.length>0?A[0].focus():g.focus();}};return document.addEventListener("focusin",F,true),()=>{clearTimeout(I),document.removeEventListener("focusin",F,true),x.current&&typeof x.current.focus=="function"&&x.current.focus();}},[d]);let w=typeof h.spacing.sm=="number"?`${h.spacing.sm}px`:String(h.spacing.sm),P=css({width:"100%",height:Xs(o),maxWidth:t==="inset"?`min(${Xs(n)||"100%"}, calc(100% - ${w} * 2))`:Xs(n),maxHeight:t==="inset"?`calc(100% - ${w} * 2)`:"100%",margin:t==="inset"?w:void 0}),$=jsx(_n,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",k||""].join(" ").trim(),padding:s,radius:r,variant:"panel",css:[P,f],ref:I=>{N.current=I,typeof T=="function"?T(I):T&&(T.current=I);},...C,children:e}),W=c==="none"?$:c==="slide"?jsx(Gs,{on:d,direction:p,duration:R,children:$}):c==="grow"?jsx(_s,{initialScale:.75,on:d,duration:R,children:$}):jsx(Ks,{on:d,duration:R,children:$});if(!a)return jsx(Fragment,{children:W});let K=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(ks,{on:d,blur:u,blurDepth:i,onClickAway:l?()=>m(false):void 0,css:[K,v].filter(Boolean),contentCss:K,lockScroll:y,children:W})});Hl.displayName="ModalContent";var Zm={xs:{h:22,px:8,font:11,radius:8,gap:4,icon:12},sm:{h:28,px:10,font:13,radius:9,gap:6,icon:14},md:{h:34,px:12,font:14,radius:10,gap:8,icon:16}},Qm=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:u=false,loop:i=false,size:l="sm",variant:c="subtle",gap:p,className:R,css:f})=>{let v=U(),k=xe(),C=t!==void 0,[T,h]=useState(n),d=Math.max(1,e),m=Mr(C?t:T,1,d),y=useCallback(L=>{let z=Mr(L,1,d);C||h(z),o?.(z);},[C,d,o]),N=useMemo(()=>ef({count:d,page:m,siblingCount:r,boundaryCount:s}),[d,m,r,s]),x=Zm[l],w=v.palette?.primary?.[600],P=v.surface?.border,$=c==="subtle"?v.surface.subtleHover:c==="ghost"?v.surface?.subtleBg:v.surface.panelHover,W=v.text?.primary??"#111",K=c==="subtle"?v.surface?.subtleBg:"transparent",I=css({display:"inline-flex",alignItems:"center",gap:p??x.gap,flexWrap:"wrap",borderRadius:v.radius?.md,background:K,padding:c==="subtle"?v.spacing.xs:0,userSelect:"none"},...Array.isArray(f)?f:f?[f]:[]),F=css({minWidth:x.h,height:x.h,padding:`0 ${x.px}px`,borderRadius:x.radius,fontSize:x.font,lineHeight:1,border:"1px solid transparent",background:"transparent",color:W,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:x.h,minWidth:x.h,height:x.h,padding:0}),g=(L=false)=>css([F,k({color:L?"primary":"neutral"}),c==="outlined"?L?{background:w,color:v.text.onColors.primary,borderColor:w}:{background:"transparent",borderColor:P,":hover":{background:$}}:c==="ghost"?L?{background:w,color:v.text.onColors.primary}:{":hover":{background:$}}:L?{background:w,color:v.text.onColors.primary,borderColor:w}:{":hover":{background:$}}]),b=useCallback(()=>y(1),[y]),A=useCallback(()=>y(d),[y,d]),H=useCallback(()=>{m===1?i&&y(d):y(m-1);},[m,i,d,y]),B=useCallback(()=>{m===d?i&&y(1):y(m+1);},[m,i,d,y]),M=a||m===1&&!i,E=a||m===d&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",R||""].join(" ").trim(),css:I,onKeyDown:L=>{a||(L.key==="ArrowLeft"&&(L.preventDefault(),H()),L.key==="ArrowRight"&&(L.preventDefault(),B()),L.key==="Home"&&(L.preventDefault(),b()),L.key==="End"&&(L.preventDefault(),A()));},children:[u&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":M,disabled:M,css:[g(false),S],onClick:b,style:{backgroundColor:c==="subtle"?v.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:x.icon,height:x.icon}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":M,disabled:M,css:[g(false),S],onClick:H,style:{backgroundColor:c==="subtle"?v.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:x.icon,height:x.icon}})}),N.map((L,z)=>typeof L=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":L===m?`Page ${L}, current page`:`Go to page ${L}`,"aria-current":L===m?"page":void 0,css:g(L===m),onClick:()=>y(L),children:L},L):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([F,k(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:x.h}]),children:"\u2026"},`e${z}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":E,disabled:E,css:[g(false),S],onClick:B,style:{backgroundColor:c==="subtle"?v.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:x.icon,height:x.icon}})}),u&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":E,disabled:E,css:[g(false),S],onClick:A,style:{backgroundColor:c==="subtle"?v.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:x.icon,height:x.icon}})})]})};function Mr(e,t,n){return Math.max(t,Math.min(n,e))}function ef({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Sr(1,e);let s=Sr(1,Math.min(o,e)),a=Sr(Math.max(e-o+1,o+1),e),u=Mr(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Mr(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],c=p=>{let R=l[l.length-1];R!==p&&(R==="ellipsis"&&p==="ellipsis"||l.push(p));};return s.forEach(c),u>o+2?c("ellipsis"):o+1<u&&c(o+1),Sr(u,i).forEach(c),i<e-o-1?c("ellipsis"):e-o>i&&c(e-o),a.forEach(c),l}function Sr(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var rf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,sf=me.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=U(),u=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:rf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${u}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${u}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var zl=createContext(null),uf=()=>{let e=useContext(zl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},df=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},pf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:u,children:i,anchorOrigin:l,css:c})=>{let p=U(),R=e!==void 0&&n!==void 0,[f,v]=useState(t),k=R?e:f,C=useRef([]),[T,h]=useState(0),d=()=>h(F=>F+1),m=useCallback(F=>{R||v(F),n?.(F);},[R,n]),y=useCallback(F=>(C.current.push(F),d(),C.current.length-1),[]),N=useCallback((F,S)=>{let g=C.current[F];g&&(C.current[F]={...g,...S},d());},[]),x=()=>C.current.map((F,S)=>({it:F,i:S})).filter(({it:F})=>F.ref&&!F.disabled).map(({i:F})=>F),w=useCallback((F,S)=>{let g=x();if(!g.length)return;let b=Math.max(0,g.indexOf(F)),A=g[(b+S+g.length)%g.length],H=C.current[A]?.ref;if(H){H.focus();let B=C.current[A]?.value;B!==void 0&&m(B);}},[m]),P=useCallback(F=>{let S=x();if(!S.length)return;let g=F==="first"?S[0]:S[S.length-1],b=C.current[g]?.ref;if(b){b.focus();let A=C.current[g]?.value;A!==void 0&&m(A);}},[m]),$=useMemo(()=>{let F=C.current.filter(g=>g.ref&&!g.disabled);return F.length?F.some(g=>g.value===k)?k:F[0]?.value:void 0},[k,T]),W=useMemo(()=>({selected:k,setSelected:m,disabled:o,size:r,direction:s,variant:a,register:y,update:N,moveFocusBy:w,moveToEdge:P,focusValue:$,theme:p,anchorOrigin:df(l)}),[k,m,o,r,s,a,y,N,w,P,$,p,l]),K=css({width:"fit-content"}),I=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:p.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:u??"plainframe-ui-radio-group",css:[K,c],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:I,children:jsx(zl.Provider,{value:W,children:i})})})},mf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:u,size:i,register:l,update:c,moveFocusBy:p,moveToEdge:R,theme:f,variant:v,focusValue:k,anchorOrigin:C}=uf(),T=u||t,h=s===e,d=["sm","md","lg"].includes(i)?i:"md",m=d==="sm"?16:d==="lg"?24:20,y=O=>f.palette?.primary?.[O],N=y(600),x=y(100),w=f.neutral[300],P=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],W="transparent",K=P,I=$;v==="soft"?(W=x,K=null,I=N):v==="outlined"?(W=y(50),K=P,I=N):(W=f.neutral[200],K="transparent",I=$),h&&(v==="outlined"?(W=x,K=P,I=N):v==="filled"?(W=N,K=null,I=$):(W=x,K=null,I=N));let F=v==="filled"?w:f.palette.primary[100],S=useRef(null),g=useRef(-1);useEffect(()=>{g.current=l({ref:S.current,value:e,disabled:!!T});},[l]),useEffect(()=>{c(g.current,{ref:S.current,value:e,disabled:!!T});},[c,T,e]);let b=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:C.vertical==="center"?f.spacing.sm:0,rowGap:C.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:T?.5:1,borderRadius:f.radius.md,cursor:T?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":T||h?{}:{background:F,boxShadow:v==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${P}`:"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:W,boxShadow:K?`inset 0 0 0 ${f.componentHeights.border} ${K}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),H=css({width:h?m*.45:0,height:h?m*.45:0,borderRadius:f.radius.full,background:h?I:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:h?"scale(1)":"scale(0.6)",opacity:h?1:0}),B=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),M=(()=>{let O=C.horizontal,_=C.vertical;return _==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),L=!T&&k===e?0:-1,z=xe();return jsxs("button",{ref:S,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":h,"aria-disabled":T||void 0,disabled:T,tabIndex:L,onClick:()=>{T||a(e);},onKeyDown:O=>{T||(O.key==="Enter"||O.key===" "?(O.preventDefault(),a(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),p(g.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),p(g.current,-1)):O.key==="Home"?(O.preventDefault(),R("first")):O.key==="End"&&(O.preventDefault(),R("last")));},css:[b,z({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[A,css({gridColumn:M.col,gridRow:M.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:H})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:B,children:o})]})};var yf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:u=true,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"},c=R=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),R?.(f);};if(u&&isValidElement(e)){let R=e,f=R.props.css,v=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=["plainframe-ui-transition-rotate",R.props.className||"",i||""].join(" ").trim(),C=R.props.onTransitionEnd;return cloneElement(R,{...R.props,css:v,className:k,onTransitionEnd:c(C)})}let p=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:p,onTransitionEnd:c(),children:e})};var Mo=(...e)=>e.filter(Boolean).flat(),Fr=e=>me.isValidElement(e),Fo=(e,t)=>{if(!Fr(e))return false;let n=e.type,o=(n?.displayName??n?.name??"")||"";return typeof o=="string"&&t.includes(o)},Cf=(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 Rf({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,disabled:u,size:i="md",variant:l="subtle",fullWidth:c,width:p=200,menuAlign:R="left",menuWidth:f,menuMaxHeight:v=280,wrapperCss:k,labelCss:C,triggerCss:T,menuCss:h,optionCss:d,children:m,className:y,menuSize:N="md",triggerRender:x}){let w=U(),P=xe(),$=me.useId(),W=`${$}-label`,K=`${$}-menu`,I={sm:{minHeight:w.componentHeights.sm,radius:w.radius.sm},md:{minHeight:w.componentHeights.md,radius:w.radius.md},lg:{minHeight:w.componentHeights.lg,radius:w.radius.md}},F=I[i]||I.md,[S,g]=me.useState(false),b=V=>g(!!V),A=typeof e<"u",H=Array.isArray(e)||Array.isArray(t),[B,M]=me.useState(typeof t<"u"?t:H?[]:void 0),E=A?e:B,L=V=>{A||M(V),n?.(V);},z=me.Children.toArray(m).filter(Fr),O,_=[];for(let V of z)if(Fo(V,["MenuRadioGroup"]))O=V;else if(Fo(V,["MenuCheckboxGroup"])){let ue=V.props.children,de=ue?me.Children.toArray(ue).filter(Fr):[];_.push(...de);}else _.push(V);let j=(O?me.Children.toArray(O.props.children).filter(Fr):_).filter(V=>!Fo(V,["MenuLabel","MenuSeparator"])).map((V,ue)=>{let de=V.props,fe=Cf(V,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=Fo(V,["MenuCheckboxItem"]),tn=Fo(V,["MenuRadioItem"]),nn=yt||Ye==="menuitemcheckbox"||typeof de.onCheckedChange=="function"||typeof de.checked=="boolean"||typeof de.defaultChecked=="boolean",Sn=!nn&&(tn||Ye==="menuitemradio"||!!O),on=typeof de.children>"u"?st??String(fe):de.children;return {el:V,key:V.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}}),J=j.some(V=>V.isCheckbox),ae=j.length>0&&j.every(V=>V.isRadio),X=(H||J)&&!ae,le=me.useCallback(V=>X?(Array.isArray(E)?E:[]).some(de=>Object.is(de,V)):Object.is(E,V),[E,X]),ie=me.useMemo(()=>{if(X){let ue=Array.isArray(E)?E:[];return j.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 V=j.find(ue=>Object.is(ue.value,E));if(V)return typeof V.nodeForTrigger=="string"||typeof V.nodeForTrigger=="number"?String(V.nodeForTrigger):V.nodeForTrigger},[E,X,j]),be=V=>{u||(Object.is(V,E)||L(V),b(false));},Pe=V=>{u||Object.is(V,E)||L(V);},Re=V=>{if(u)return;let ue=Array.isArray(E)?E:[],fe=ue.some(ze=>Object.is(ze,V))?ue.filter(ze=>!Object.is(ze,V)):[...ue,V];L(fe);},Ce={position:"relative",width:c?"100%":typeof p=="number"?`${p}px`:p,maxWidth:"100%"},Ie={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:F.radius,minHeight:F.minHeight,fontSize:w.typography.sizes.sm,padding:`0 ${typeof w.spacing.sm=="number"?`${w.spacing.sm}px`:w.spacing.sm} 0 ${typeof w.spacing.md=="number"?`${w.spacing.md}px`:w.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:u?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:w.text.primary,background:"transparent",whiteSpace:"nowrap"},Te=l==="subtle"?{background:w.surface.subtleBg}:l==="outlined"?{background:w.surface.panelBg,border:`1px solid ${w.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"},Ve={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Z=jsx(ChevronsUpDown,{size:16,css:css({color:w.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),Ee=()=>{if(x)return x(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(Ve),title:de,children:de})]})}let V=ie??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(he),children:s}),jsx("span",{css:css(Ve),title:typeof V=="string"?V:void 0,children:V})]})},Q={left:"start",center:"center",right:"end"},ee=V=>{u||(V.key==="ArrowDown"||V.key==="ArrowUp"||V.key==="Enter"||V.key===" ")&&(V.preventDefault(),b(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"},Y={fontSize:"0.875em",color:w.text.secondary,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400},oe=(V,ue)=>{let de=V.title||V.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:V.title??ue}),V.description&&jsx("span",{className:"plainframe-ui-select-option-description",css:css(Y),children:V.description})]}):jsx("span",{className:"plainframe-ui-select-option-text",css:css(Ne),children:ue});return jsxs(Fragment,{children:[V.startIcon&&jsx("span",{css:css(se),children:V.startIcon}),de,V.endIcon&&jsx("span",{css:css(pe),children:V.endIcon})]})},re=(V,ue)=>{let de=V.value,fe=le(de),ze=Mo(d,V.itemCss),Oe=V.el.props,st=typeof Oe.children>"u"?V.labelText??String(de):Oe.children;if(X||V.isCheckbox)return me.cloneElement(V.el,{key:V.key??ue,disabled:u||V.disabled,checked:!!Oe.checked||fe,onCheckedChange:()=>Re(de),closeOnSelect:false,css:ze,className:`plainframe-ui-select-option ${V.className||""}`.trim(),children:oe(V,st)});if(V.isRadio)return me.cloneElement(V.el,{key:V.key??ue,value:de,disabled:u||V.disabled,closeOnSelect:false,css:ze,className:`plainframe-ui-select-option ${V.className||""}`.trim(),children:oe(V,st)});let Ye=yt=>{yt?.preventDefault?.(),be(de);};return me.cloneElement(V.el,{key:V.key??ue,role:"menuitem","aria-checked":void 0,"aria-selected":fe||void 0,"aria-disabled":u||V.disabled||void 0,disabled:u||V.disabled,closeOnSelect:true,onSelect:Ye,onClick:Ye,css:ze,className:`plainframe-ui-select-option ${V.className||""}`.trim(),children:oe(V,st)})},qe=(()=>{let V=!X&&(O||j.length>0&&j.every(ue=>ue.isRadio));return O?me.cloneElement(O,{key:"controlled-inner-group",value:E,onValueChange:ue=>Pe(ue),children:j.map(re)}):V?jsx(lr,{value:E,onValueChange:ue=>Pe(ue),children:j.map(re)}):j.map(re)})();return jsxs("div",{css:Mo(Ce,k),className:["plainframe-ui-select-wrapper",y||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Mo({marginBottom:6,fontSize:w.typography.sizes.sm,fontWeight:500,color:w.text.secondary},C),children:o}),jsxs($n,{size:N,open:S,onOpenChange:b,children:[jsx(zn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:u,"aria-haspopup":"menu","aria-expanded":S||void 0,"aria-controls":K,"aria-labelledby":o?W:void 0,onKeyDown:ee,onClick:()=>b(!S),className:"plainframe-ui-select-trigger",css:Mo(css(Ie),css(Te),T,P()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(we),children:Ee()}),a??Z]})}),jsx(hn,{id:K,gap:"xs",align:Q[R],sameWidth:f==null,width:f??p,className:"plainframe-ui-select-menu",css:Mo({maxHeight:typeof v=="number"?`${v}px`:v,overflowY:"auto"},h),children:qe})]})]})}var Qs=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,wf=keyframes`
14
14
  0% { background-position: -200% 0; }
15
15
  100% { background-position: 200% 0; }
16
- `,nm=keyframes`
16
+ `,Ef=keyframes`
17
17
  0% { opacity: .6; }
18
18
  50% { opacity: 1; }
19
19
  100% { opacity: .6; }
20
- `,om=({isLoading:e=true,radius:t,animation:n="wave",as:o="span",children:r,width:i,height:a,style:l,className:s,css:c})=>{let d=j(),m=d.surface.subtleBg,g=d.neutral[200],u=ss(t??d.radius?.lg??8,"8px"),b=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:i==null?"fit-content":ss(i,String(i)),height:a==null?"fit-content":ss(a,String(a))}),C=css({position:"absolute",inset:0,borderRadius:u,pointerEvents:"none",background:m,willChange:"background-position, opacity"}),R=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${m} 25%, ${g} 50%, ${m} 75%)`,backgroundSize:"200% 100%",animation:`${tm} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${nm} 1.2s ease-in-out infinite`}):css({}),h=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:u});return jsxs(o,{className:["plainframe-ui-skeleton",s||""].join(" ").trim(),css:[b,c],style:l,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[C,R]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:h,children:r})]})};var Wo=8,as=20,sn=4,Bi=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:i=1,disabled:a=false,rounded:l=false,showValue:s=false,showStepper:c=false,label:d,fullWidth:m=false,css:g,trackCss:u,thumbCss:b,direction:C="horizontal",className:R,...h})=>{let y=j(),p=C==="vertical",f=useRef(null),[x,S]=useState(false),[v,M]=useState(false),[P,z]=useState(false),D=e!==void 0,N=useCallback(te=>Math.min(r,Math.max(o,te)),[o,r]),A=useCallback(te=>N(Math.round((te-o)/i)*i+o),[o,i,N]),[T,L]=useState(()=>A(t??o)),w=D?A(e):T;useEffect(()=>{D||L(te=>A(te));},[o,r,i,D,A]);let E=y.palette.primary[600],$=y.surface.panelBg,I=y.neutral[500],H=useMemo(()=>{let te=r-o||1;return (w-o)/te*100},[w,o,r]),k=useCallback(te=>{D||L(te),n?.(te);},[D,n]),F=useCallback((te,ye)=>{let V=f.current;if(!V)return w;let Y=V.getBoundingClientRect(),X=p?(Y.bottom-ye)/Y.height:(te-Y.left)/Y.width;return X=Math.max(0,Math.min(1,X)),A(o+X*(r-o))},[w,p,o,r,A]),B=useCallback(te=>{a||(te.currentTarget.setPointerCapture?.(te.pointerId),k(F(te.clientX,te.clientY)),S(true));},[a,k,F]),_=useCallback(te=>{a||(te.currentTarget.setPointerCapture?.(te.pointerId),S(true));},[a]),W=useCallback(te=>{!x||a||k(F(te.clientX,te.clientY));},[x,a,k,F]),O=useCallback(()=>S(false),[]);useEffect(()=>{if(x)return window.addEventListener("pointermove",W),window.addEventListener("pointerup",O),window.addEventListener("pointercancel",O),()=>{window.removeEventListener("pointermove",W),window.removeEventListener("pointerup",O),window.removeEventListener("pointercancel",O);}},[x,W,O]);let q=useCallback(te=>{if(a)return;let ye=w;if(te.key==="ArrowRight"||te.key==="ArrowUp")ye=w+i;else if(te.key==="ArrowLeft"||te.key==="ArrowDown")ye=w-i;else if(te.key==="Home")ye=o;else if(te.key==="End")ye=r;else return;te.preventDefault(),k(A(ye));},[a,w,i,o,r,k,A]),Q=x||v||P,J=(v||x)&&!a,de=`color-mix(in srgb, ${E} 25%, transparent)`,K=css({display:"flex",flexDirection:p?"row":"column",alignItems:"center",padding:p?"1rem":"1rem 0",width:p?"fit-content":m?"100%":350,height:p?250:"auto",boxSizing:"border-box"}),ne=css({marginBottom:p?0:4,marginRight:p?8:0,color:y.text.primary,userSelect:"none"}),me=css({position:"relative",width:p?Wo:"100%",height:p?"100%":Wo,backgroundColor:y.neutral[200],borderRadius:y.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),pe=css({position:"absolute",left:p?"50%":0,top:p?2:"50%",transform:p?"translateX(-50%)":"translateY(-50%)",width:p?Wo:`calc(100% - ${sn*.5}px)`,height:p?`calc(100% - ${sn*.5}px)`:Wo,display:"flex",flexDirection:p?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),fe=css({width:sn,height:sn,borderRadius:"50%",backgroundColor:y.text.primary,opacity:.15,flex:"0 0 auto"}),oe=css({position:"absolute",left:0,top:p?`calc(${100-H}% )`:0,bottom:0,width:p?"100%":`${H}%`,height:p?`${H}%`:"100%",backgroundColor:a?I:E,borderRadius:y.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),ee=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:$,width:as,height:as,left:p?"50%":`calc(${H}% - ${as/2}px)`,bottom:p?`${H}%`:"auto",top:p?"auto":"50%",transform:p?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:l?y.radius.full:`calc(${y.radius.md} * 0.75)`,border:`2px solid ${a?I:E}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:J?`0 0 0 ${x?4:8}px ${de}`:`0 0 0 0px ${de}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${de}`,outline:"none"}}),se=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:p?-7.5:-28,left:p?9:-7.5,pointerEvents:"none"}),ge=css({position:"absolute",top:p?`calc(50% - ${sn*2.5}px)`:0,left:p?"auto":`calc(50% - ${sn*3}px)`,transform:p?"translateY(-50%)":"translateX(-50%)",backgroundColor:y.neutral[800],color:y.neutral[0],padding:"0.6rem 0.25rem",fontSize:12,borderRadius:6,whiteSpace:"nowrap",pointerEvents:"auto",zIndex:6,"&::after":{content:'""',position:"absolute",width:6,height:6,backgroundColor:y.neutral[800],borderRadius:2,bottom:p?"50%":-2,left:p?-2.5:"50%",transform:p?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),ve=g,Se=u,De=b,Pe=Math.floor((r-o)/i)+1;return jsxs("div",{...h,role:"group","aria-label":d,className:["plainframe-ui-slider",R||""].join(" ").trim(),css:[K,ve],"data-orientation":p?"vertical":"horizontal",children:[d&&!p&&jsx("div",{className:"plainframe-ui-slider-label",css:ne,children:d}),jsxs("div",{ref:f,className:"plainframe-ui-slider-track",css:[me,Se],onPointerDown:B,children:[c&&i>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:pe,children:Array.from({length:Pe}).map((te,ye)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:fe},ye))}),jsx("div",{className:"plainframe-ui-slider-fill",css:oe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":w,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:q,onPointerDown:_,onPointerUp:O,onPointerCancel:O,onMouseEnter:()=>M(true),onMouseLeave:()=>M(false),className:"plainframe-ui-slider-thumb",css:[ee,De],children:[jsx(AnimatePresence,{children:Q&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:se,initial:{opacity:0,scale:.9,y:p?0:4,x:p?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:p?0:4,x:p?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:ge,initial:{opacity:0,y:p?0:4,x:p?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:p?0:4,x:p?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>z(true),onMouseLeave:()=>z(false),children:w})})}),null]})]}),d&&p&&jsx("div",{className:"plainframe-ui-slider-label",css:[ne,{marginLeft:8}],children:d})]})};Bi.displayName="Slider";var cm=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),dm=css({display:"flex",alignItems:"center",width:"100%",gap:12}),um=e=>css({display:"flex",minWidth:0,flex:"0 0 auto",alignItems:"center",justifyContent:"center",gap:8,flexDirection:e==="left"?"row-reverse":e==="right"?"row":e==="top"?"column-reverse":"column"}),pm=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),mm=(e,t,n)=>css({position:"absolute",inset:0,transformOrigin:"left center",transform:`scaleX(${e})`,background:t,transition:n?"all .28s var(--pf-ease)":"none",willChange:"transform"}),fm=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),gm=(e,t,n,o,r)=>css({position:"relative",appearance:"none",border:`2px solid ${o}`,width:e,height:e,minWidth:e,minHeight:e,borderRadius:r,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none",background:t,color:n,transition:"all .22s var(--pf-ease)","&:disabled, &[aria-disabled='true']":{opacity:.55,cursor:"not-allowed"}}),bm=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Li=e=>css({position:"absolute",inset:0,display:"inline-flex",alignItems:"center",justifyContent:"center",transform:`scale(${e?1:.3})`,opacity:e?1:0,transition:"background .22s var(--pf-ease), transform .16s var(--pf-ease), opacity .16s var(--pf-ease)",willChange:"transform, opacity"}),hm=(e,t,n,o,r)=>css({fontSize:14,color:e?t:n,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"all .16s ease",textAlign:"center",fontWeight:700,margin:`0 ${r}px`,borderRadius:o}),ym=ie.memo(function({i:t,item:n,size:o,tokens:r,variant:i,titlePosition:a,isActive:l,completed:s,disabled:c,connectorColor:d,showConnector:m,animate:g,separator:u,canGoToIndex:b,setSelected:C}){let R=j(),h=le(),{MAIN:y,ACTIVE_TEXT:p,ACTIVE_TEXT_OUTLINED:f,COMPLETE_BG:x,COMPLETE_FG:S,UPCOMING_BG_FILLED:v,UPCOMING_OUTLINE:M,UPCOMING_FG:P}=r,z="transparent",D=P,N=M;i==="subtle"?s?(z=x,D=S,N=x):l?(z=y,D=p,N=y):(z=v,D=P,N=v):s?(z=x,D=S,N=x):l?(z="transparent",D=f,N=y):(z="transparent",D=P,N=M);let A=n.label,T=n.icon??jsx("span",{css:bm,children:typeof A=="number"?A:t+1}),L=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:um(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[gm(o,z,D,N,String(R.radius.full)),!c&&h({color:l?"primary":"neutral"})],onClick:()=>{!c&&b(t)&&C(n.value);},tabIndex:c?-1:0,"aria-current":l?"step":void 0,"aria-disabled":c||void 0,disabled:c,"aria-label":typeof A=="string"?A:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Li(!s),children:T}),jsx("span",{className:"plainframe-ui-step-check",css:Li(!!s),children:L})]}),A&&jsx("span",{className:"plainframe-ui-step-label",css:hm(s||l,R.text.primary,R.text.secondary,String(R.radius.xs),Number(R.spacing.xs)),children:A})]}),m&&(u?jsx("div",{className:"plainframe-ui-stepper-separator",css:fm,children:u}):jsx("div",{className:"plainframe-ui-step-connector",css:pm(R.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:mm(s?1:0,d,g),"aria-hidden":"true"})}))]})},(e,t)=>e.isActive===t.isActive&&e.completed===t.completed&&e.disabled===t.disabled&&e.variant===t.variant&&e.separator===t.separator&&e.connectorColor===t.connectorColor&&e.titlePosition===t.titlePosition&&e.size===t.size),cs=()=>null;cs.displayName="PlainframeUIStep";var xm=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:i=true,allComplete:a=false,color:l,activeBgColor:s,activeColor:c,completeBgColor:d,completeColor:m,separator:g,titlePosition:u="right",width:b,css:C,className:R,children:h,...y})=>{let p=j(),f=e==="outlined"?"outlined":"subtle",x=ie.useMemo(()=>{let F=ie.Children.toArray(h).filter(B=>ie.isValidElement(B)&&B.type===cs);return F.length?F.map((B,_)=>({index:_,...B.props})):[{value:1},{value:2},{value:3}]},[h]),S=ie.useCallback((F,B)=>F?p.palette?.[F]??F:B,[p.palette]),v=ie.useMemo(()=>({MAIN:String(S(s,typeof p.palette.primary[600]=="string"?p.palette.primary[600]:"")),ACTIVE_TEXT:String(S(c,typeof p.text.onColors.primary=="string"?p.text.onColors.primary:"")),ACTIVE_TEXT_OUTLINED:String(S(c,typeof p.text.primary=="string"?p.text.primary:"")),COMPLETE_BG:String(S(d,typeof p.palette.primary[600]=="string"?p.palette.primary[600]:"")),COMPLETE_FG:String(S(m,typeof p.text.onColors.primary=="string"?p.text.onColors.primary:"")),UPCOMING_BG_FILLED:String(typeof p.neutral[100]=="string"?p.neutral[100]:""),UPCOMING_OUTLINE:String(typeof p.neutral[300]=="string"?p.neutral[300]:""),UPCOMING_FG:String(typeof p.text.secondary=="string"?p.text.secondary:"")}),[S,s,c,d,m,p.palette.primary,p.neutral,p.text]),M=ie.useMemo(()=>{let F=S(l,p.palette.primary[600]);return typeof F=="string"?F:String(F)},[S,l,p.palette.primary]),[P,z]=ie.useState(()=>x.some(B=>B?.value===n)?n:x[0]?.value),D=t!==void 0,N=D?t:P,{activeIndex:A,afterLast:T}=ie.useMemo(()=>{let F=x.findIndex(B=>B.value===N);if(F!==-1)return {activeIndex:F,afterLast:false};if(typeof N=="number"){let B=Math.floor(N)-1;if(B>=x.length)return {activeIndex:x.length-1,afterLast:true};if(B>=0)return {activeIndex:B,afterLast:false}}return {activeIndex:0,afterLast:false}},[x,N]),L=ie.useCallback(F=>{r||(D||z(F),o?.(F));},[r,D,o]),w=ie.useCallback(F=>a||!!x[F]?.complete||(T?true:F<A),[a,x,T,A]),E=ie.useCallback(F=>{if(r)return false;let B=x[F];if(!B||B.disabled)return false;if(typeof i=="boolean"){if(i===false&&F>A)return false}else if(typeof i=="function"&&!i(A,F))return false;return true},[r,x,i,A]),[$,I]=ie.useState(false);ie.useEffect(()=>{let F=requestAnimationFrame(()=>I(true));return ()=>cancelAnimationFrame(F)},[]);let H=ie.useCallback(F=>{if(!x.length||r)return;let B=A;if(F.key==="ArrowRight")B=Math.min(x.length-1,A+1);else if(F.key==="ArrowLeft")B=Math.max(0,A-1);else if(F.key==="Home")B=0;else if(F.key==="End")B=x.length-1;else return;F.preventDefault(),E(B)&&L(x[B].value);},[x,r,A,E,L]),k=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",R||""].join(" ").trim(),css:[cm(b),C],...y,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:H,css:dm,children:x.map((F,B)=>jsx(ie.Fragment,{children:jsx(ym,{i:B,item:F,size:k,tokens:v,variant:f,titlePosition:u,isActive:!T&&B===A,completed:w(B),disabled:r||!!F.disabled,connectorColor:M,showConnector:B<x.length-1,animate:$,separator:g,canGoToIndex:E,setSelected:L})},String(F.value??B)))})})};var Wi=createContext(null),km=()=>{let e=useContext(Wi);if(!e)throw new Error("SwapItem must be used within Swap");return e},jo=220,Im=keyframes`
21
- 0% { transform: scale(1); }
22
- 45% { transform: scale(0.85); }
23
- 55% { transform: scale(0.85); }
24
- 100% { transform: scale(1); }
25
- `,Fm=keyframes`
26
- 0% { transform: rotate(0deg); }
27
- 49% { transform: rotate(179deg); }
28
- 51% { transform: rotate(181deg); }
29
- 100% { transform: rotate(360deg); }
30
- `,Pm=keyframes`
31
- 0% { transform: scale(1) rotate(0deg); }
32
- 40% { transform: scale(0.9) rotate(140deg); }
33
- 50% { transform: scale(0.85) rotate(180deg); }
34
- 60% { transform: scale(0.9) rotate(220deg); }
35
- 100% { transform: scale(1) rotate(360deg); }
36
- `,ps=ie.forwardRef(({value:e,children:t,className:n="",css:o},r)=>{let{activeValue:i,animationEffect:a,isAnimating:l,transitionFrom:s,transitionTo:c,transitionPhase:d}=km(),m=a==="rotate"||a==="scale-rotate"||a==="scale",g=false,u=0;if(!l||!m)g=e===i,u=g?1:0;else {let C=e===s,R=e===c;C||R?(g=true,d==="first"?u=C?1:0:u=R?1:0):(g=false,u=0);}let b=css({gridArea:"1 / 1 / 2 / 2",transition:`opacity ${jo/2}ms ease-out`,opacity:u,display:g?"block":"none"});return jsx("div",{ref:r,className:`pfui-swap-item ${n}`,css:[b,o],"aria-hidden":u===0,children:t})});ps.displayName="SwapItem";var ji=ie.forwardRef(({variant:e="toggle",animationEffect:t="scale",flashDuration:n=750,value:o,defaultValue:r,onChange:i,disabled:a=false,children:l,className:s="",css:c},d)=>{let g=Children.toArray(l).filter(isValidElement).filter(k=>k.type===ps).map(k=>k.props.value),u=r??g[0]??"",[b,C]=useState(u),[R,h]=useState(false),[y,p]=useState(false),[f,x]=useState(null),[S,v]=useState(null),[M,P]=useState("idle"),z=o!==void 0,D=z?o:b,N=n??200,A=useRef([]),T=()=>{A.current.forEach(k=>window.clearTimeout(k)),A.current=[];};useEffect(()=>()=>{T();},[]);let L=k=>{z?i?.(k):C(k);},w=useCallback((k,F,B)=>{T(),h(true),x(k),v(F),P("first");let _=window.setTimeout(()=>{L(F),P("second");},jo/2),W=window.setTimeout(()=>{h(false),x(null),v(null),P("idle"),B?.();},jo);A.current.push(_,W);},[z,i]),E=useCallback(()=>{if(a||R||y||g.length<=1)return;let k=u,F=g.indexOf(k),B=F===-1?0:(F+1)%g.length,_=g[B];if(e==="toggle"){let O=(g.indexOf(D)+1)%g.length,q=g[O];w(D,q);}else {p(true);let W=_===k?g[(B+1)%g.length]:_;w(k,W,()=>{let O=window.setTimeout(()=>{w(W,k,()=>{p(false);});},N);A.current.push(O);});}},[a,R,y,g,D,e,N,w,u]),I=css({position:"relative",display:"inline-grid",cursor:a?"not-allowed":"pointer",opacity:a?.55:1,transformOrigin:"center",backfaceVisibility:"hidden",...R&&{animation:`${t==="rotate"?Fm:t==="scale-rotate"?Pm:Im} ${jo}ms cubic-bezier(0.4, 0, 0.2, 1)`}}),H={activeValue:D,variant:e,animationEffect:t,flashDuration:N,isAnimating:R,handleSwap:E,disabled:a,transitionFrom:f,transitionTo:S,transitionPhase:M};return jsx(Wi.Provider,{value:H,children:jsx("div",{ref:d,className:`pfui-swap ${s}`,css:[I,c],onClick:E,role:"button",tabIndex:a?-1:0,onKeyDown:k=>{a||(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),E());},"aria-disabled":a,children:l})})});ji.displayName="Swap";var Vo=()=>null;Vo.displayName="PF.Tab";var Uo=({children:e})=>jsx(Fragment,{children:e});Uo.displayName="PF.TabContent";function Mm(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var Am=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:i="horizontal",className:a,shadow:l=false,width:s,fullWidth:c=false,rounded:d=false,titlePosition:m="right",align:g,css:u,trackCss:b,thumbCss:C,activeTabCss:R,activeIndicatorCss:h})=>{let y=j(),p=le(),f=i==="vertical",x=c||s!=null,S=g??(f?"left":"center"),v={left:"flex-start",center:"center",right:"flex-end"},{tabs:M,contents:P}=ie.useMemo(()=>{let V=[],Y=[];return ie.Children.forEach(e,X=>{if(!ie.isValidElement(X))return;let{type:ae,props:Ee}=Mm(X),$e=ae===Vo||ae?.displayName===Vo.displayName,be=ae===Uo||ae?.displayName===Uo.displayName;if($e){let Ce=Ee;if(Ce?.value===void 0)return;V.push({value:Ce.value,disabled:Ce.disabled,node:Ce.children,className:Ce.className,css:Ce.css,activeCss:Ce.activeCss});}else if(be){let Ce=Ee;if(Ce?.value===void 0)return;Y.push({value:Ce.value,node:Ce.children,className:Ce.className,css:Ce.css});}}),{tabs:V,contents:Y}},[e]),z=ie.useMemo(()=>M.find(V=>!V.disabled)?.value,[M]),[D,N]=ie.useState(()=>t!==void 0&&M.some(Y=>Y.value===t&&!Y.disabled)?t:z),A=n!==void 0,T=A?n:D,L=ie.useRef(null),w=ie.useRef([]),E=Math.max(0,M.findIndex(V=>V.value===T)),[$,I]=ie.useState({left:0,top:0,width:0,height:0}),[H,k]=ie.useState(false),[F,B]=ie.useState(false),_=ie.useCallback(()=>{let V=L.current,Y=w.current[E];if(!V||!Y)return;let X=V.getBoundingClientRect(),ae=Y.getBoundingClientRect();I({left:ae.left-X.left,top:ae.top-X.top,width:ae.width,height:ae.height});},[E]);ie.useLayoutEffect(()=>{_(),H||(k(true),requestAnimationFrame(()=>B(true)));},[_,H]),ie.useEffect(()=>{let V=new ResizeObserver(()=>_());L.current&&V.observe(L.current);let Y=w.current[E];Y&&V.observe(Y);let X=()=>_();return window.addEventListener("resize",X),()=>{V.disconnect(),window.removeEventListener("resize",X);}},[_,E]);let W=(V,Y)=>{if(!M.length)return V;let X=V;for(let ae=0;ae<M.length;ae++)if(X=(X+Y+M.length)%M.length,!M[X].disabled)return X;return V},O=V=>{A||N(V),o?.(V);},q=V=>{if(!M.length)return;let Y=E;if(V.key===(f?"ArrowDown":"ArrowRight"))Y=W(E,1);else if(V.key===(f?"ArrowUp":"ArrowLeft"))Y=W(E,-1);else if(V.key==="Home")Y=M.findIndex(ae=>!ae.disabled);else if(V.key==="End"){let ae=[...M].reverse().findIndex(Ee=>!Ee.disabled);Y=ae===-1?E:M.length-1-ae;}else return;V.preventDefault();let X=M[Y]?.value;X!==void 0&&O(X),requestAnimationFrame(()=>w.current[Y]?.focus());},Q=y.text.primary,J=y.text.secondary,de=y.neutral[500],K=r==="subtle"?y.surface.subtleBg:"transparent",ne=r==="subtle"?y.surface.panelBg??y.surface.panelBg:r==="ghost"?y.surface.subtleBg:"transparent",me=y.text.primary,pe=r==="subtle"||r==="ghost"||r==="underlined",fe=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:c?"100%":s==null?"auto":typeof s=="number"?`${s}px`:s}),oe=r==="subtle",ee=css({position:"relative",display:x?"flex":"inline-flex",width:x?"100%":"auto",flexDirection:f?"column":"row",alignItems:f?"stretch":"center",flexWrap:"nowrap",gap:y.spacing.xs,padding:oe?y.spacing.xs:0,background:K,borderRadius:r==="subtle"?d?f?y.radius.lg:y.radius.full:y.radius.lg:"none"}),se=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:H?1:0,visibility:H?"visible":"hidden",transition:F?`${f?"top":"left"} .24s var(--pf-ease), ${f?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?d?y.radius.full:y.radius.md:0,background:r==="underlined"?"transparent":ne,...f?{top:`${$.top}px`,height:`${$.height}px`,left:y.spacing.xs,right:y.spacing.xs}:{left:`${$.left}px`,width:`${$.width}px`,top:y.spacing.xs,bottom:y.spacing.xs},boxShadow:l&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),ge=css(r!=="underlined"?{}:f?{background:"transparent",top:`${$.top}px`,height:`${$.height}px`,left:0,width:0,borderLeft:`2px solid ${me}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${$.left}px`,width:`${$.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${me}`,borderLeft:"none",borderRadius:2}),ve=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&i!=="vertical"?`${y.spacing.md}`:r==="ghost"&&i!=="vertical"?`${y.spacing.md}`:`${y.spacing.xs} ${y.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&d?y.radius.full:y.radius.md,minHeight:y.componentHeights.sm,transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...f?{width:x?"100%":"auto",flex:"0 0 auto",textAlign:S}:x?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:y.fontSizes.md,fontWeight:600,color:J,"&[aria-selected='true']":{color:Q},"&:hover":{color:Q},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:de}}),Se=css({display:"inline-flex",alignItems:"center",justifyContent:f?v[S]:"center",gap:6,width:"100%",flexDirection:m==="top"?"column-reverse":m==="bottom"?"column":m==="left"?"row-reverse":"row"}),De=css({marginTop:y.spacing.sm,width:"100%"}),Pe=ie.useId(),te=new Map;P.forEach((V,Y)=>te.set(V.value,`${Pe}-panel-${Y}`));let ye=V=>`${Pe}-tab-${V}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[fe,u],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:L,role:"tablist","aria-orientation":f?"vertical":"horizontal",onKeyDown:q,css:[ee,b],children:[pe&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[se,ge,C,h]}),M.map((V,Y)=>{let X=T===V.value;return jsx("button",{ref:ae=>{w.current[Y]=ae;},role:"tab",id:ye(Y),"aria-selected":X,"aria-controls":te.get(V.value),"aria-disabled":V.disabled||void 0,disabled:V.disabled,tabIndex:V.disabled?-1:Y===E?0:-1,className:["plainframe-ui-tab",V.className||""].join(" ").trim(),onClick:()=>{V.disabled||O(V.value);},css:[ve,!V.disabled&&p(),V.css,X?V.activeCss??R:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Se,children:V.node})},String(V.value??Y))})]}),P.map((V,Y)=>{let X=V.value===T,ae=M.findIndex($e=>$e.value===V.value),Ee=ae>=0?ye(ae):void 0;return jsx("div",{role:"tabpanel",id:te.get(V.value),"aria-labelledby":Ee,hidden:!X,className:["plainframe-ui-tab-panel",V.className||""].join(" ").trim(),css:[De,V.css],children:X?V.node:null},Y)})]})};var Un=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Ht=e=>e==null?[]:Array.isArray(e)?e:[e],_n=(...e)=>css(e.filter(Boolean)),zm=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:i,helperText:a,disabled:l=false,fullWidth:s=false,width:c=235,size:d="md",variant:m="subtle",rounded:g=false,rows:u=3,maxRows:b,maxLength:C,showCharCount:R,focusRingMode:h="always",resizable:y=false,className:p,wrapperCss:f,inputCss:x,labelCss:S,helperRowCss:v,helperTextCss:M,charCountCss:P,css:z,onBlur:D,onFocus:N,onKeyDown:A,autoFocus:T,name:L,id:w,tabIndex:E,autoComplete:$,readOnly:I,required:H})=>{let k=j(),F=to(),B=useId(),_=useMemo(()=>({sm:{fontSize:k.fontSizes.md,minHeight:k.componentHeights.sm,labelFont:k.fontSizes.sm,helperFont:k.fontSizes.sm,width:"12.5rem",paddingY:0,paddingX:k.spacing.md},md:{fontSize:k.fontSizes.md,minHeight:k.componentHeights.md,labelFont:k.fontSizes.md,helperFont:k.fontSizes.sm,width:"15rem",paddingY:0,paddingX:k.spacing.md},lg:{fontSize:k.fontSizes.md,minHeight:k.componentHeights.lg,labelFont:k.fontSizes.lg,helperFont:k.fontSizes.md,width:"18.125rem",paddingY:0,paddingX:k.spacing.md}}),[k]),W=["sm","md","lg"].includes(d)?d:"md",O=_[W],q=k.neutral,Q=k.text,J=t!==void 0,[de,K]=useState(n),ne=J?t:de,me=useCallback(X=>{J||K(X),o?.(X);},[J,o]),pe=useMemo(()=>l?q[200]:m==="outlined"?k.surface.panelBg:m==="subtle"?k.surface.subtleBg:"transparent",[l,m,q,k.surface]),fe=k.componentHeights.border,oe=useMemo(()=>m==="outlined"?`${fe} solid ${i?k.palette.danger[600]:k.surface.border}`:`${fe} solid transparent`,[m,fe,i,k.palette.danger,k.surface.border]),ee=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:s?"100%":c!=null?Un(c):void 0,flex:"0 0 auto",fontWeight:500}),[s,c]),se=useMemo(()=>_n({fontSize:O.labelFont,fontWeight:500,color:i?k.palette.danger?.[700]??Q.primary:l?q[500]:Q.primary,marginBottom:4,display:"inline-block"},...Ht(S)),[O.labelFont,i,l,q,Q,k.palette.danger,S]),ge=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:k.spacing.sm,padding:`${Un(O.paddingY)} 0 ${Un(O.paddingY)} ${Un(O.paddingX)}`,background:pe,outline:oe,outlineOffset:`-${fe}`,borderRadius:g?k.radius.full:k.radius.md,minHeight:O.minHeight,width:"100%",cursor:l?"not-allowed":"text",opacity:l?.65:1,transition:"box-shadow .18s, border-color .16s"},...Ht(f),...Ht(z)],[k,O,pe,oe,fe,g,l,f,z]),ve=typeof O.minHeight=="number"?`${O.minHeight}px`:O.minHeight,Se=useMemo(()=>_n({width:"100%",minWidth:0,flex:1,resize:y?"vertical":"none",font:"inherit",fontWeight:500,fontSize:O.fontSize,lineHeight:1.5,color:l?q[500]:Q.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Un(O.paddingX),overflowY:"auto",minHeight:ve,"&::placeholder":{color:Q.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${Q.primary} !important`,boxShadow:`0 0 0 1000px ${pe} inset !important`,transition:"opacity 99999s ease-out",caretColor:Q.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"},...u===1?{paddingBlock:`calc((${ve} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...Ht(x)),[y,O,l,q,Q,ve,pe,u,x]),De=useMemo(()=>_n({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...Ht(v)),[v]),Pe=useMemo(()=>_n({fontSize:O.helperFont,color:i?k.palette.danger?.[700]??Q.secondary:Q.secondary,flex:1,minWidth:0},...Ht(M)),[O.helperFont,i,k.palette.danger,Q,M]),te=useMemo(()=>_n({fontSize:O.helperFont,color:C&&ne.length>C?k.palette.danger?.[700]??Q.secondary:Q.secondary,flexShrink:0},...Ht(P)),[O.helperFont,C,ne.length,k.palette.danger,Q,P]),ye=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let X=ye.current;if(!X)return;if(y){let Ee=window.getComputedStyle(X),$e=parseFloat(Ee.lineHeight||"20"),be=typeof O.minHeight=="number"?O.minHeight:parseFloat(String(O.minHeight)),Ce=Math.max($e*(u??1),be);X.style.setProperty("--pf-minh",`${Ce}px`);return}(()=>{let Ee=window.getComputedStyle(X),$e=parseFloat(Ee.lineHeight||"20"),be=typeof O.minHeight=="number"?O.minHeight:parseFloat(String(O.minHeight)),Ce=Math.max($e*(u??1),be);X.style.setProperty("--pf-minh",`${Ce}px`);let ln=b?$e*b:1/0;X.style.height="auto",X.style.height=`${Math.min(X.scrollHeight,ln)}px`;})();},[ne,u,b,O.minHeight,y]);let V=a!=null||R?`${w??B}-help`:void 0,Y=w??B;return jsxs("div",{className:["plainframe-ui-textarea",p||""].join(" ").trim(),css:ee,children:[e&&jsx("label",{htmlFor:Y,className:"plainframe-ui-textarea-label",css:se,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[F({enabled:h!=="none",disabled:l}),ge],"aria-invalid":!!i||void 0,"aria-disabled":l||void 0,onClick:()=>!l&&ye.current?.focus(),children:jsx("textarea",{ref:ye,id:Y,className:"plainframe-ui-textarea-input",css:Se,rows:u,value:ne,onChange:X=>{let ae=X.target.value;C&&ae.length>C||me(ae);},placeholder:r||"",disabled:l,onBlur:D,onFocus:N,onKeyDown:A,autoFocus:T,name:L,tabIndex:E,autoComplete:$,readOnly:I,required:H,"aria-invalid":!!i||void 0,"aria-describedby":V})}),(a!=null||R&&C!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:De,children:[jsx("span",{id:V,className:"plainframe-ui-textarea-helper-text",css:Pe,children:a}),R&&C!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:te,children:[ne.length,"/",C]})]})]})};var Xm=e=>e!=null&&typeof e[Symbol.iterator]=="function",Ym=e=>!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function";function qm(e){return e==null||typeof e!="object"||ie.isValidElement(e)||Ym(e)||Xm(e)?false:Object.keys(e).length===0||["status","content","title","description","render","bare","startIcon","endIcon","action","onClose","pauseOnHover","showDismiss","onClick","width","duration","createdAt","id"].some(n=>n in e)}var Jm={type:"spring",stiffness:920,damping:100},_i="toast-host",Qm=(e,t)=>t.split(".").reduce((n,o)=>n==null?n:n[o],e),Ko=(e,t)=>{for(let n of t){let o=Qm(e,n);if(o!=null&&o!=="")return o}},fs=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function Zm(e){let t=Ko(e,["radius.md","shape.borderRadius","radii.md"]),n=Ko(e,["spacing.lg","space.4","spacing.4"]),o=Ko(e,["spacing.md","space.3","spacing.3"]),r=Ko(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:fs(t,16),padX:fs(n,14),padY:fs(o,12),shadow:String(r)}}var wt=null;function Gi(){typeof document>"u"||wt||(wt=document.getElementById(_i),wt||(wt=document.createElement("div"),wt.id=_i,document.body.appendChild(wt)));}var ce={max:5,position:"bottom-right",gutter:10,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false},G={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},Bt=()=>{G.sync(),G.notify();},ef=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2);function Go(e,t){if(t===null)return;let n=t??e.duration;if(n==null||G.timers.has(e.id))return;let o=Date.now(),r=G.remaining.get(e.id),i=r!=null?Math.max(0,r):n;G.expiry.set(e.id,o+i);let a=window.setTimeout(()=>we.dismiss(e.id),i);G.timers.set(e.id,a);}function Xo(e){let t=G.timers.get(e);t&&(clearTimeout(t),G.timers.delete(e));}function tf(){for(;G.displayed.length<ce.max&&G.queue.length;){let e=G.queue.shift();G.displayed=[e,...G.displayed],G.enterFrom[e.id]="head",G.entering[e.id]=true,Bt(),requestAnimationFrame(()=>{delete G.entering[e.id],Bt();}),Go(e);}}function nf(){if(G.displayed.length<ce.max)return;let e=G.displayed.filter(o=>!G.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=G.expiry.get(t.id);n!=null&&G.remaining.set(t.id,Math.max(0,n-Date.now())),Xo(t.id),G.exiting[t.id]=true,G.displayed=G.displayed.filter(o=>o.id!==t.id),delete G.enterFrom[t.id],G.queue.push(t),Bt();}var of=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function rf(e,t){let n=of(t),o=e.surface?.panelBg??"#fff",r=e.text?.primary??"#111",i=e.surface?.border;if(n==="default"||n==="info")return {bg:o,fg:r,border:i};let a=e.text?.onColors??{},l=(s,c,d)=>({bg:e.colors?.[s]??e.palette?.[s]?.[700]??c,fg:a?.[s]??d,border:"transparent"});return n==="success"?l("success","#22C55E","#fff"):n==="warning"?l("warning","#F59E0B","#fff"):n==="error"?l("error","#EF4444","#fff"):{bg:o,fg:r,border:i}}var we=Object.assign((e,t)=>{Gi();let n;qm(e)?n=e:n={content:e,...t||{}},n.content==null&&(n.title!=null||n.description!=null)&&(n.content=jsxs("div",{children:[n.title&&jsx("strong",{style:{display:"block",marginBottom:2},children:n.title}),n.description]}));let o=n.id??ef(),r=a=>{let l=a.findIndex(d=>d.id===o);if(l===-1)return false;let s=a[l],c={...s,status:n.status??s.status,content:n.content??s.content,title:n.title??s.title,description:n.description??s.description,startIcon:n.startIcon??s.startIcon,endIcon:n.endIcon??s.endIcon,action:n.action??s.action,onClose:n.onClose??s.onClose,duration:n.duration===void 0?s.duration:n.duration,pauseOnHover:n.pauseOnHover??s.pauseOnHover,showDismiss:n.showDismiss??s.showDismiss,render:n.render??s.render,bare:n.bare??s.bare,onClick:n.onClick??s.onClick,width:n.width??s.width};return a[l]=c,Xo(o),G.remaining.delete(o),G.paused.has(o)||Go(c),Bt(),true};if(r(G.displayed)||r(G.queue))return o;let i={id:o,status:n.status??"default",content:n.content,title:n.title,description:n.description,startIcon:n.startIcon,endIcon:n.endIcon,action:n.action,duration:n.duration===void 0?ce.duration:n.duration,onClose:n.onClose,createdAt:Date.now(),pauseOnHover:n.pauseOnHover??true,showDismiss:n.showDismiss,render:n.render,bare:n.bare,onClick:n.onClick,width:n.width??300};return G.displayed.length>=ce.max&&nf(),G.displayed=[...G.displayed,i],G.enterFrom[i.id]="tail",G.entering[i.id]=true,Bt(),requestAnimationFrame(()=>{delete G.entering[i.id],Bt();}),Go(i),o},{success:(e,t={})=>we(e,{...t,status:"success"}),error:(e,t={})=>we(e,{...t,status:"error"}),warning:(e,t={})=>we(e,{...t,status:"warning"}),info:(e,t={})=>we(e,{...t,status:"info"}),custom:(e,t={})=>we(e,{...t}),update:(e,t)=>we({id:e,...t}),dismiss:e=>{if(!e){let n=G.displayed.find(o=>!G.exiting[o.id])?.id;n&&we.dismiss(n);return}Xo(e),G.remaining.delete(e),G.paused.delete(e),G.exiting[e]=true;let t=G.displayed.find(n=>n.id===e);G.displayed=G.displayed.filter(n=>n.id!==e),delete G.enterFrom[e],Bt(),window.setTimeout(()=>t?.onClose?.(),120),tf();},clear:()=>{[...G.displayed.map(t=>t.id)].forEach(t=>we.dismiss(t));},pause:e=>{if(G.paused.has(e))return;let t=G.expiry.get(e);t!=null&&G.remaining.set(e,Math.max(0,t-Date.now())),G.paused.add(e),Xo(e);},resume:e=>{if(!G.paused.has(e))return;G.paused.delete(e);let t=G.displayed.find(o=>o.id===e)??G.queue.find(o=>o.id===e),n=G.remaining.get(e);t&&Go(t,n??void 0),G.remaining.delete(e);},pauseLatest:()=>{let e=G.displayed.length?G.displayed[G.displayed.length-1]:void 0;e&&we.pause(e.id);},resumeLatest:()=>{let e=G.displayed.length?G.displayed[G.displayed.length-1]:void 0;e&&we.resume(e.id);},promise:(e,t,n={})=>{let o=we(t.loading,{...n,status:"info",duration:null});return e.then(r=>{we.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{we.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ce.max=e.max),e.position&&(ce.position=e.position),e.gutter!=null&&(ce.gutter=e.gutter),e.zIndex!=null&&(ce.zIndex=e.zIndex),e.duration!==void 0&&(ce.duration=e.duration),e.showDismiss&&(ce.showDismiss=e.showDismiss),e.styles&&(ce.styles={...ce.styles,...e.styles}),e.renderer!==void 0&&(ce.renderer=e.renderer),e.bareRenderer!==void 0&&(ce.bareRenderer=e.bareRenderer);}});function sf(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ce.showDismiss}function af(e){return {"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}}[e]}var lf=css({display:"flex",alignItems:"flex-start",gap:10}),Ki=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),cf=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),df=css({display:"flex",alignItems:"center",gap:6,marginRight:-2});function uf(){let e=useSyncExternalStore(G.subscribe.bind(G),()=>G.snapshot,()=>G.snapshot),t=j(),n=Zm(t),o=ce.position.startsWith("bottom"),r=o?e.displayed:[...e.displayed].reverse(),i={position:"fixed",zIndex:ce.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...af(ce.position),...ce.styles.stack??{}};return jsx("div",{className:"plainframe-ui-toast-stack",css:css(i),children:jsx(AnimatePresence,{initial:false,children:r.map((a,l)=>{let s=e.enterFrom[a.id]||"tail",c=o?s==="head"?-16:16:s==="head"?16:-16,d=l>0?ce.gutter:0,m={toast:a,close:we.dismiss,pause:we.pause,resume:we.resume},{bg:g,fg:u,border:b}=rf(t,a.status),C={position:"relative",overflow:"hidden",borderRadius:n.radius,boxShadow:n.shadow,padding:`${n.padY} calc(${n.padX} + 30px) ${n.padY} ${n.padX}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:g,color:u,cursor:a.onClick?"pointer":"default",border:b?`1px solid ${b}`:"1px solid transparent"},R=typeof ce.styles.surface=="function"?ce.styles.surface(a):ce.styles.surface??{},h=sf(a.showDismiss),y={},p="& .plainframe-ui-toast-close",f="&:hover .plainframe-ui-toast-close";h==="hover"?(y[p]={opacity:0,pointerEvents:"none"},y[f]={opacity:1,pointerEvents:"auto"}):h==="always"?y[p]={opacity:1,pointerEvents:"auto"}:h==="never"&&(y[p]={display:"none"});let x=css({...C,...R,...y}),S=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:u,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...ce.styles.close??{}}),v;if(a.bare&&a.render){let M=typeof a.render=="function"?a.render(m):a.render;v=jsx("div",{style:{pointerEvents:"auto"},onClick:P=>a.onClick?.(a.id,P),children:M});}else if(ce.bareRenderer&&ce.renderer){let M=typeof ce.renderer=="function"?ce.renderer(m):ce.renderer;v=jsx("div",{style:{pointerEvents:"auto"},onClick:P=>a.onClick?.(a.id,P),children:M});}else {let M;ce.renderer?M=typeof ce.renderer=="function"?ce.renderer(m):ce.renderer:a.render&&!a.bare?M=typeof a.render=="function"?a.render(m):a.render:M=jsxs(Fragment,{children:[jsxs("div",{css:lf,children:[a.startIcon&&jsx("div",{css:Ki,children:a.startIcon}),jsx("div",{css:cf,children:a.content}),a.endIcon&&jsx("div",{css:Ki,children:a.endIcon})]}),a.action&&jsx("div",{css:df,children:a.action})]}),v=jsxs("div",{css:x,onClick:P=>a.onClick?.(a.id,P),children:[M,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:S,onClick:P=>{P.stopPropagation(),we.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(pf,{id:a.id,isBottom:o,mt:d,enterY:c,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:v},a.id)})})})}function pf(e){let{id:t,isBottom:n,mt:o,enterY:r,width:i,pauseOnHover:a,children:l}=e,s=useAnimationControls();useEffect(()=>{s.start({opacity:1,y:0,height:"auto",x:0,transition:Jm});},[s]);let c={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:o,width:"100%",maxWidth:i!=null?typeof i=="number"?`${i}px`:i:"none",...ce.styles.item??{}};return jsx(motion.div,{layout:true,className:"plainframe-ui-toast-item",css:css(c),initial:{opacity:0,y:r,height:"auto",x:0},animate:s,exit:{opacity:0,y:n?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(d,m)=>{let g=Math.abs(m.offset.x),u=Math.abs(m.velocity.x);if(!(g>60||u>600)){s.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let R=(m.offset.x!==0?Math.sign(m.offset.x):Math.sign(m.velocity.x||1))*(window.innerWidth+160);s.start({x:R,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:m.velocity.x/10}}).then(()=>we.dismiss(t));},onMouseEnter:a?()=>we.pause(t):void 0,onMouseLeave:a?()=>we.resume(t):void 0,children:l})}function mf(){return Gi(),wt?createPortal(jsx(uf,{}),wt):null}var Bf=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},qi=createContext(null),Ji=()=>{let e=useContext(qi);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Lf=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:i=80,arrow:a=true,autoWidth:l=false,disableHoverListener:s=false})=>{let[c,d]=useState(!!o),m=n??c,g=v=>{n===void 0&&d(v),r?.(v);},u=useRef(null),b=useFloating({placement:t,open:m,onOpenChange:g,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:u,padding:4}):void 0].filter(Boolean)}),C=useHover(b.context,{enabled:!s,delay:{open:i,close:60},handleClose:safePolygon(),restMs:20}),R=useFocus(b.context),h=useDismiss(b.context,{escapeKey:true,outsidePress:true}),y=useRole(b.context,{role:"tooltip"}),{getReferenceProps:p,getFloatingProps:f}=useInteractions([C,R,h,y]),x=useId(),S=useMemo(()=>({open:m,setOpen:g,id:x,placement:b.placement,autoWidth:l,allowArrow:!!a,refs:b.refs,floatingStyles:b.floatingStyles,middlewareData:b.middlewareData,getReferenceProps:p,getFloatingProps:f,arrowRef:u}),[m,l,a,b.placement,b.refs,b.floatingStyles,b.middlewareData,p,f]);return jsx(qi.Provider,{value:S,children:e})},$f=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:i,id:a}=Ji(),l=ie.isValidElement(t),s=l&&typeof t.type=="string";if(e&&l&&s){let c=t,d=i({...c.props,"aria-describedby":a,ref:Bf(c.ref,r.setReference),className:[c.props?.className||"",n||""].join(" ").trim()||void 0}),m=[c.props?.css||void 0,o].filter(Boolean);return ie.cloneElement(c,{...d,css:m})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...i({"aria-describedby":a}),children:t})},zf=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:i,floatingStyles:a,middlewareData:l,getFloatingProps:s,placement:c,id:d,autoWidth:m,allowArrow:g,arrowRef:u}=Ji(),b=j(),C=c.split("-")[0]||"top",h=C==="bottom"?{opacity:0,y:-8,scale:.98}:C==="top"?{opacity:0,y:8,scale:.98}:C==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},y=h,p=C==="bottom"?"center top":C==="top"?"center bottom":C==="left"?"right center":"left center",f=css({zIndex:1300,backgroundColor:b.neutral[900],color:b.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:m?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:p}),x=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:b.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),S=l.arrow,v={top:"bottom",bottom:"top",left:"right",right:"left"}[C];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:d,ref:i.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[f,n],style:a,initial:h,animate:{opacity:1,x:0,y:0,scale:1},exit:y,transition:{scale:{type:"spring",stiffness:520,damping:36,mass:.6},x:{type:"spring",stiffness:420,damping:32,mass:.6},y:{type:"spring",stiffness:420,damping:32,mass:.6},opacity:{duration:.14,ease:"linear"}},...s(),children:[e,g&&jsx("div",{ref:u,className:"plainframe-ui-tooltip-arrow",css:[x,o],style:{left:S?.x!=null?`${S.x}px`:void 0,top:S?.y!=null?`${S.y}px`:void 0,[v]:"-3px"}})]})})})};function Vf(){let e=j();return jsx(Global,{styles:css`
20
+ `,kf=me.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:u,css:i})=>{let l=U(),c=l.surface.subtleBg,p=l.neutral[200],R=Qs(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":Qs(r,String(r)),height:s==null?"fit-content":Qs(s,String(s))}),v=css({position:"absolute",inset:0,borderRadius:R,pointerEvents:"none",background:c,willChange:"background-position, opacity"}),k=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${c} 25%, ${p} 50%, ${c} 75%)`,backgroundSize:"200% 100%",animation:`${wf} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Ef} 1.2s ease-in-out infinite`}):css({}),C=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:R});return jsxs("span",{className:["plainframe-ui-skeleton",u||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[v,k]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:C,children:o})]})});var Pr=8,ea=20,Xn=4,Vl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:u=false,showValue:i=false,showStepper:l=false,label:c,fullWidth:p=false,css:R,trackCss:f,thumbCss:v,direction:k="horizontal",className:C,...T})=>{let h=U(),d=k==="vertical",m=useRef(null),[y,N]=useState(false),[x,w]=useState(false),[P,$]=useState(false),W=e!==void 0,K=useCallback(Z=>Math.min(r,Math.max(o,Z)),[o,r]),I=useCallback(Z=>K(Math.round((Z-o)/s)*s+o),[o,s,K]),[F,S]=useState(()=>I(t??o)),g=W?I(e):F;useEffect(()=>{W||S(Z=>I(Z));},[o,r,s,W,I]);let b=h.palette.primary[600],A=h.surface.panelBg,H=h.neutral[500],B=useMemo(()=>{let Z=r-o||1;return (g-o)/Z*100},[g,o,r]),M=useCallback(Z=>{W||S(Z),n?.(Z);},[W,n]),E=useCallback((Z,Ee)=>{let Q=m.current;if(!Q)return g;let ee=Q.getBoundingClientRect(),se=d?(ee.bottom-Ee)/ee.height:(Z-ee.left)/ee.width;return se=Math.max(0,Math.min(1,se)),I(o+se*(r-o))},[g,d,o,r,I]),L=useCallback(Z=>{a||(Z.currentTarget.setPointerCapture?.(Z.pointerId),M(E(Z.clientX,Z.clientY)),N(true));},[a,M,E]),z=useCallback(Z=>{a||(Z.currentTarget.setPointerCapture?.(Z.pointerId),N(true));},[a]),O=useCallback(Z=>{!y||a||M(E(Z.clientX,Z.clientY));},[y,a,M,E]),_=useCallback(()=>N(false),[]);useEffect(()=>{if(y)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_);}},[y,O,_]);let D=useCallback(Z=>{if(a)return;let Ee=g;if(Z.key==="ArrowRight"||Z.key==="ArrowUp")Ee=g+s;else if(Z.key==="ArrowLeft"||Z.key==="ArrowDown")Ee=g-s;else if(Z.key==="Home")Ee=o;else if(Z.key==="End")Ee=r;else return;Z.preventDefault(),M(I(Ee));},[a,g,s,o,r,M,I]),j=y||x||P,J=(x||y)&&!a,ae=`color-mix(in srgb, ${b} 25%, transparent)`,q=css({display:"flex",flexDirection:d?"row":"column",alignItems:"center",padding:d?"1rem":"1rem 0",width:d?"fit-content":p?"100%":350,height:d?250:"auto",boxSizing:"border-box"}),X=css({marginBottom:d?0:4,marginRight:d?8:0,color:h.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?Pr:"100%",height:d?"100%":Pr,backgroundColor:h.neutral[200],borderRadius:h.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),ie=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?Pr:`calc(100% - ${Xn*.5}px)`,height:d?`calc(100% - ${Xn*.5}px)`:Pr,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),be=css({width:Xn,height:Xn,borderRadius:"50%",backgroundColor:h.text.primary,opacity:.15,flex:"0 0 auto"}),Pe=css({position:"absolute",left:0,top:d?`calc(${100-B}% )`:0,bottom:0,width:d?"100%":`${B}%`,height:d?`${B}%`:"100%",backgroundColor:a?H:b,borderRadius:h.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Re=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:A,width:ea,height:ea,left:d?"50%":`calc(${B}% - ${ea/2}px)`,bottom:d?`${B}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:u?h.radius.full:`calc(${h.radius.md} * 0.75)`,border:`2px solid ${a?H:b}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:J?`0 0 0 ${y?4:8}px ${ae}`:`0 0 0 0px ${ae}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${ae}`,outline:"none"}}),Ce=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ie=css({position:"absolute",top:d?`calc(50% - ${Xn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Xn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:h.neutral[800],color:h.neutral[0],padding:"0.6rem 0.25rem",fontSize:12,borderRadius:6,whiteSpace:"nowrap",pointerEvents:"auto",zIndex:6,"&::after":{content:'""',position:"absolute",width:6,height:6,backgroundColor:h.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),Te=R,we=f,he=v,Ve=Math.floor((r-o)/s)+1;return jsxs("div",{...T,role:"group","aria-label":c,className:["plainframe-ui-slider",C||""].join(" ").trim(),css:[q,Te],"data-orientation":d?"vertical":"horizontal",children:[c&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:X,children:c}),jsxs("div",{ref:m,className:"plainframe-ui-slider-track",css:[le,we],onPointerDown:L,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ie,children:Array.from({length:Ve}).map((Z,Ee)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:be},Ee))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Pe}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":g,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:D,onPointerDown:z,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>w(true),onMouseLeave:()=>w(false),className:"plainframe-ui-slider-thumb",css:[Re,he],children:[jsx(AnimatePresence,{children:j&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:Ce,initial:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},animate:{opacity:1,scale:1,y:0,x:0},exit:{opacity:0,scale:.9,y:d?0:4,x:d?4:0},transition:{duration:.16,ease:"easeOut"},children:jsx(motion.div,{className:"plainframe-ui-slider-tooltip",css:Ie,initial:{opacity:0,y:d?0:4,x:d?-4:0},animate:{opacity:1,y:0,x:0},exit:{opacity:0,y:d?0:4,x:d?-4:0},transition:{duration:.16,ease:"easeOut"},onMouseEnter:()=>$(true),onMouseLeave:()=>$(false),children:g})})}),null]})]}),c&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[X,{marginLeft:8}],children:c})]})};Vl.displayName="Slider";var Pf=e=>css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",maxWidth:e==null?"100%":typeof e=="number"?`${e}px`:e,width:"100%"}),Nf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Df=e=>css({display:"flex",minWidth:0,flex:"0 0 auto",alignItems:"center",justifyContent:"center",gap:8,flexDirection:e==="left"?"row-reverse":e==="right"?"row":e==="top"?"column-reverse":"column"}),Hf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Lf=(e,t,n)=>css({position:"absolute",inset:0,transformOrigin:"left center",transform:`scaleX(${e})`,background:t,transition:n?"all .28s var(--pf-ease)":"none",willChange:"transform"}),Bf=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),$f=(e,t,n,o,r)=>css({position:"relative",appearance:"none",border:`2px solid ${o}`,width:e,height:e,minWidth:e,minHeight:e,borderRadius:r,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:"pointer",userSelect:"none",background:t,color:n,transition:"all .22s var(--pf-ease)","&:disabled, &[aria-disabled='true']":{opacity:.55,cursor:"not-allowed"}}),zf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),jl=e=>css({position:"absolute",inset:0,display:"inline-flex",alignItems:"center",justifyContent:"center",transform:`scale(${e?1:.3})`,opacity:e?1:0,transition:"background .22s var(--pf-ease), transform .16s var(--pf-ease), opacity .16s var(--pf-ease)",willChange:"transform, opacity"}),Of=(e,t,n,o,r)=>css({fontSize:14,color:e?t:n,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"all .16s ease",textAlign:"center",fontWeight:700,margin:`0 ${r}px`,borderRadius:o}),Wf=me.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:u,completed:i,disabled:l,connectorColor:c,showConnector:p,animate:R,separator:f,canGoToIndex:v,setSelected:k}){let C=U(),T=xe(),{MAIN:h,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:m,COMPLETE_BG:y,COMPLETE_FG:N,UPCOMING_BG_FILLED:x,UPCOMING_OUTLINE:w,UPCOMING_FG:P}=r,$="transparent",W=P,K=w;s==="subtle"?i?($=y,W=N,K=y):u?($=h,W=d,K=h):($=x,W=P,K=x):i?($=y,W=N,K=y):u?($="transparent",W=m,K=h):($="transparent",W=P,K=w);let I=n.label,F=n.icon??jsx("span",{css:zf,children:typeof I=="number"?I:t+1}),S=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Df(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[$f(o,$,W,K,String(C.radius.full)),!l&&T({color:u?"primary":"neutral"})],onClick:()=>{!l&&v(t)&&k(n.value);},tabIndex:l?-1:0,"aria-current":u?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof I=="string"?I:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:jl(!i),children:F}),jsx("span",{className:"plainframe-ui-step-check",css:jl(!!i),children:S})]}),I&&jsx("span",{className:"plainframe-ui-step-label",css:Of(i||u,C.text.primary,C.text.secondary,String(C.radius.xs),Number(C.spacing.xs)),children:I})]}),p&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:Bf,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Hf(C.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Lf(i?1:0,c,R),"aria-hidden":"true"})}))]})},(e,t)=>e.isActive===t.isActive&&e.completed===t.completed&&e.disabled===t.disabled&&e.variant===t.variant&&e.separator===t.separator&&e.connectorColor===t.connectorColor&&e.titlePosition===t.titlePosition&&e.size===t.size),oa=()=>null;oa.displayName="PlainframeUIStep";var Kf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:u,activeBgColor:i,activeColor:l,completeBgColor:c,completeColor:p,separator:R,titlePosition:f="right",width:v,css:k,className:C,children:T,...h})=>{let d=U(),m=e==="outlined"?"outlined":"subtle",y=me.useMemo(()=>{let E=me.Children.toArray(T).filter(L=>me.isValidElement(L)&&L.type===oa);return E.length?E.map((L,z)=>({index:z,...L.props})):[{value:1},{value:2},{value:3}]},[T]),N=me.useCallback((E,L)=>E?d.palette?.[E]??E:L,[d.palette]),x=me.useMemo(()=>({MAIN:String(N(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(N(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(N(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(N(c,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(N(p,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),UPCOMING_BG_FILLED:String(typeof d.neutral[100]=="string"?d.neutral[100]:""),UPCOMING_OUTLINE:String(typeof d.neutral[300]=="string"?d.neutral[300]:""),UPCOMING_FG:String(typeof d.text.secondary=="string"?d.text.secondary:"")}),[N,i,l,c,p,d.palette.primary,d.neutral,d.text]),w=me.useMemo(()=>{let E=N(u,d.palette.primary[600]);return typeof E=="string"?E:String(E)},[N,u,d.palette.primary]),[P,$]=me.useState(()=>y.some(L=>L?.value===n)?n:y[0]?.value),W=t!==void 0,K=W?t:P,{activeIndex:I,afterLast:F}=me.useMemo(()=>{let E=y.findIndex(L=>L.value===K);if(E!==-1)return {activeIndex:E,afterLast:false};if(typeof K=="number"){let L=Math.floor(K)-1;if(L>=y.length)return {activeIndex:y.length-1,afterLast:true};if(L>=0)return {activeIndex:L,afterLast:false}}return {activeIndex:0,afterLast:false}},[y,K]),S=me.useCallback(E=>{r||(W||$(E),o?.(E));},[r,W,o]),g=me.useCallback(E=>a||!!y[E]?.complete||(F?true:E<I),[a,y,F,I]),b=me.useCallback(E=>{if(r)return false;let L=y[E];if(!L||L.disabled)return false;if(typeof s=="boolean"){if(s===false&&E>I)return false}else if(typeof s=="function"&&!s(I,E))return false;return true},[r,y,s,I]),[A,H]=me.useState(false);me.useEffect(()=>{let E=requestAnimationFrame(()=>H(true));return ()=>cancelAnimationFrame(E)},[]);let B=me.useCallback(E=>{if(!y.length||r)return;let L=I;if(E.key==="ArrowRight")L=Math.min(y.length-1,I+1);else if(E.key==="ArrowLeft")L=Math.max(0,I-1);else if(E.key==="Home")L=0;else if(E.key==="End")L=y.length-1;else return;E.preventDefault(),b(L)&&S(y[L].value);},[y,r,I,b,S]),M=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",C||""].join(" ").trim(),css:[Pf(v),k],...h,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:B,css:Nf,children:y.map((E,L)=>jsx(me.Fragment,{children:jsx(Wf,{i:L,item:E,size:M,tokens:x,variant:m,titlePosition:f,isActive:!F&&L===I,completed:g(L),disabled:r||!!E.disabled,connectorColor:w,showConnector:L<y.length-1,animate:A,separator:R,canGoToIndex:b,setSelected:S})},String(E.value??L)))})})};var Nr=()=>null;Nr.displayName="PF.Tab";var Dr=({children:e})=>jsx(Fragment,{children:e});Dr.displayName="PF.TabContent";function Vf(e){let t=e.props;return {type:t?.__EMOTION_TYPE_PLEASE_DO_NOT_USE__??e.type,props:t}}var jf=({children:e,defaultValue:t,value:n,onChange:o,variant:r="subtle",direction:s="horizontal",className:a,shadow:u=false,width:i,fullWidth:l=false,rounded:c=false,titlePosition:p="right",align:R,css:f,trackCss:v,thumbCss:k,activeTabCss:C,activeIndicatorCss:T})=>{let h=U(),d=xe(),m=s==="vertical",y=l||i!=null,N=R??(m?"left":"center"),x={left:"flex-start",center:"center",right:"flex-end"},{tabs:w,contents:P}=me.useMemo(()=>{let Q=[],ee=[];return me.Children.forEach(e,se=>{if(!me.isValidElement(se))return;let{type:pe,props:Se}=Vf(se),Ne=pe===Nr||pe?.displayName===Nr.displayName,Y=pe===Dr||pe?.displayName===Dr.displayName;if(Ne){let oe=Se;if(oe?.value===void 0)return;Q.push({value:oe.value,disabled:oe.disabled,node:oe.children,className:oe.className,css:oe.css,activeCss:oe.activeCss});}else if(Y){let oe=Se;if(oe?.value===void 0)return;ee.push({value:oe.value,node:oe.children,className:oe.className,css:oe.css});}}),{tabs:Q,contents:ee}},[e]),$=me.useMemo(()=>w.find(Q=>!Q.disabled)?.value,[w]),[W,K]=me.useState(()=>t!==void 0&&w.some(ee=>ee.value===t&&!ee.disabled)?t:$),I=n!==void 0,F=I?n:W,S=me.useRef(null),g=me.useRef([]),b=Math.max(0,w.findIndex(Q=>Q.value===F)),[A,H]=me.useState({left:0,top:0,width:0,height:0}),[B,M]=me.useState(false),[E,L]=me.useState(false),z=me.useCallback(()=>{let Q=S.current,ee=g.current[b];if(!Q||!ee)return;let se=Q.getBoundingClientRect(),pe=ee.getBoundingClientRect();H({left:pe.left-se.left,top:pe.top-se.top,width:pe.width,height:pe.height});},[b]);me.useLayoutEffect(()=>{z(),B||(M(true),requestAnimationFrame(()=>L(true)));},[z,B]),me.useEffect(()=>{let Q=new ResizeObserver(()=>z());S.current&&Q.observe(S.current);let ee=g.current[b];ee&&Q.observe(ee);let se=()=>z();return window.addEventListener("resize",se),()=>{Q.disconnect(),window.removeEventListener("resize",se);}},[z,b]);let O=(Q,ee)=>{if(!w.length)return Q;let se=Q;for(let pe=0;pe<w.length;pe++)if(se=(se+ee+w.length)%w.length,!w[se].disabled)return se;return Q},_=Q=>{I||K(Q),o?.(Q);},D=Q=>{if(!w.length)return;let ee=b;if(Q.key===(m?"ArrowDown":"ArrowRight"))ee=O(b,1);else if(Q.key===(m?"ArrowUp":"ArrowLeft"))ee=O(b,-1);else if(Q.key==="Home")ee=w.findIndex(pe=>!pe.disabled);else if(Q.key==="End"){let pe=[...w].reverse().findIndex(Se=>!Se.disabled);ee=pe===-1?b:w.length-1-pe;}else return;Q.preventDefault();let se=w[ee]?.value;se!==void 0&&_(se),requestAnimationFrame(()=>g.current[ee]?.focus());},j=h.text.primary,J=h.text.secondary,ae=h.neutral[500],q=r==="subtle"?h.surface.subtleBg:"transparent",X=r==="subtle"?h.surface.panelBg??h.surface.panelBg:r==="ghost"?h.surface.subtleBg:"transparent",le=h.text.primary,ie=r==="subtle"||r==="ghost"||r==="underlined",be=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":i==null?"auto":typeof i=="number"?`${i}px`:i}),Pe=r==="subtle",Re=css({position:"relative",display:y?"flex":"inline-flex",width:y?"100%":"auto",flexDirection:m?"column":"row",alignItems:m?"stretch":"center",flexWrap:"nowrap",gap:h.spacing.xs,padding:Pe?h.spacing.xs:0,background:q,borderRadius:r==="subtle"?c?m?h.radius.lg:h.radius.full:h.radius.lg:"none"}),Ce=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:B?1:0,visibility:B?"visible":"hidden",transition:E?`${m?"top":"left"} .24s var(--pf-ease), ${m?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?c?h.radius.full:h.radius.md:0,background:r==="underlined"?"transparent":X,...m?{top:`${A.top}px`,height:`${A.height}px`,left:h.spacing.xs,right:h.spacing.xs}:{left:`${A.left}px`,width:`${A.width}px`,top:h.spacing.xs,bottom:h.spacing.xs},boxShadow:u&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Ie=css(r!=="underlined"?{}:m?{background:"transparent",top:`${A.top}px`,height:`${A.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${A.left}px`,width:`${A.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),Te=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${h.spacing.md}`:r==="ghost"&&s!=="vertical"?`${h.spacing.md}`:`${h.spacing.xs} ${h.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&c?h.radius.full:h.radius.md,minHeight:h.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...m?{width:y?"100%":"auto",flex:"0 0 auto",textAlign:N}:y?{flex:"1 1 0",minWidth:0,textAlign:"center"}:{flex:"0 0 auto",minWidth:"max-content",textAlign:"center"},whiteSpace:"nowrap",boxSizing:"border-box",cursor:"pointer",userSelect:"none",fontSize:h.typography.sizes.sm,fontWeight:600,color:J,"&[aria-selected='true']":{color:j},"&:hover":{color:j},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:ae}}),we=css({display:"inline-flex",alignItems:"center",justifyContent:m?x[N]:"center",gap:6,width:"100%",flexDirection:p==="top"?"column-reverse":p==="bottom"?"column":p==="left"?"row-reverse":"row"}),he=css({marginTop:h.spacing.sm,width:"100%"}),Ve=me.useId(),Z=new Map;P.forEach((Q,ee)=>Z.set(Q.value,`${Ve}-panel-${ee}`));let Ee=Q=>`${Ve}-tab-${Q}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[be,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:S,role:"tablist","aria-orientation":m?"vertical":"horizontal",onKeyDown:D,css:[Re,v],children:[ie&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[Ce,Ie,k,T]}),w.map((Q,ee)=>{let se=F===Q.value;return jsx("button",{ref:pe=>{g.current[ee]=pe;},role:"tab",id:Ee(ee),"aria-selected":se,"aria-controls":Z.get(Q.value),"aria-disabled":Q.disabled||void 0,disabled:Q.disabled,tabIndex:Q.disabled?-1:ee===b?0:-1,className:["plainframe-ui-tab",Q.className||""].join(" ").trim(),onClick:()=>{Q.disabled||_(Q.value);},css:[Te,!Q.disabled&&d(),Q.css,se?Q.activeCss??C:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:we,children:Q.node})},String(Q.value??ee))})]}),P.map((Q,ee)=>{let se=Q.value===F,pe=w.findIndex(Ne=>Ne.value===Q.value),Se=pe>=0?Ee(pe):void 0;return jsx("div",{role:"tabpanel",id:Z.get(Q.value),"aria-labelledby":Se,hidden:!se,className:["plainframe-ui-tab-panel",Q.className||""].join(" ").trim(),css:[he,Q.css],children:se?Q.node:null},ee)})]})};var Po=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,kn=e=>e==null?[]:Array.isArray(e)?e:[e],No=(...e)=>css(e.filter(Boolean)),Zf=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:u=false,fullWidth:i=false,width:l=235,size:c="md",variant:p="subtle",rounded:R=false,rows:f=3,maxRows:v,maxLength:k,showCharCount:C,focusRingMode:T="always",resizable:h=false,className:d,wrapperCss:m,inputCss:y,labelCss:N,helperRowCss:x,helperTextCss:w,charCountCss:P,css:$,onBlur:W,onFocus:K,onKeyDown:I,autoFocus:F,name:S,id:g,tabIndex:b,autoComplete:A,readOnly:H,required:B})=>{let M=U(),E=Yo(),L=useId(),z=useMemo(()=>({sm:{fontSize:M.typography.sizes.sm,minHeight:M.componentHeights.sm,labelFont:M.typography.sizes.xs,helperFont:M.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:M.spacing.md},md:{fontSize:M.typography.sizes.sm,minHeight:M.componentHeights.md,labelFont:M.typography.sizes.sm,helperFont:M.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:M.spacing.md},lg:{fontSize:M.typography.sizes.sm,minHeight:M.componentHeights.lg,labelFont:M.typography.sizes.md,helperFont:M.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:M.spacing.md}}),[M]),O=["sm","md","lg"].includes(c)?c:"md",_=z[O],D=M.neutral,j=M.text,J=t!==void 0,[ae,q]=useState(n),X=J?t:ae,le=useCallback(se=>{J||q(se),o?.(se);},[J,o]),ie=useMemo(()=>u?D[200]:s&&p==="outlined"?M.palette.danger?.[50]??M.surface.panelBg:s&&p==="subtle"?M.palette.danger?.[50]??M.surface.subtleBg:p==="outlined"?M.surface.panelBg:p==="subtle"?M.surface.subtleBg:"transparent",[u,s,p,D,M.surface,M.palette.danger]),be=M.componentHeights.border,Pe=useMemo(()=>p==="outlined"?`${be} solid ${s?M.palette.danger?.[300]??M.surface.border:M.surface.border}`:"none",[p,be,s,M.palette.danger,M.surface.border]),Re=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Po(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),Ce=useMemo(()=>No({fontSize:_.labelFont,fontWeight:500,color:s?M.palette.danger?.[700]??j.primary:u?D[500]:j.primary,marginBottom:4,display:"inline-block"},...kn(N)),[_.labelFont,s,u,D,j,M.palette.danger,N]),Ie=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:M.spacing.sm,padding:`${Po(_.paddingY)} 0 ${Po(_.paddingY)} ${Po(_.paddingX)}`,background:ie,border:Pe,borderRadius:R?M.radius.full:M.radius.md,minHeight:_.minHeight,width:"100%",cursor:u?"not-allowed":"text",opacity:u?.65:1,transition:"box-shadow .18s, border-color .16s"},...kn(m),...kn($)],[M,_,ie,Pe,be,R,u,m,$]),Te=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,we=useMemo(()=>No({width:"100%",minWidth:0,flex:1,resize:h?"vertical":"none",font:"inherit",fontWeight:500,fontSize:_.fontSize,lineHeight:1.5,color:u?D[500]:s?M.palette.danger?.[800]??j.primary:j.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Po(_.paddingX),overflowY:"auto",minHeight:Te,"&::placeholder":{color:s?M.palette.danger?.[700]??j.secondary:j.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?M.palette.danger?.[800]??j.primary:j.primary} !important`,boxShadow:`0 0 0 1000px ${ie} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?M.palette.danger?.[800]??j.primary:j.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${Te} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...kn(y)),[h,_,u,s,D,j,M.palette.danger,Te,ie,f,y]),he=useMemo(()=>No({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...kn(x)),[x]),Ve=useMemo(()=>No({fontSize:_.helperFont,color:s?M.palette.danger?.[700]??j.secondary:j.secondary,flex:1,minWidth:0},...kn(w)),[_.helperFont,s,M.palette.danger,j,w]),Z=useMemo(()=>No({fontSize:_.helperFont,color:k&&X.length>k?M.palette.danger?.[700]??j.secondary:j.secondary,flexShrink:0},...kn(P)),[_.helperFont,k,X.length,M.palette.danger,j,P]),Ee=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let se=Ee.current;if(!se)return;if(h){let Se=window.getComputedStyle(se),Ne=parseFloat(Se.lineHeight||"20"),Y=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(Ne*(f??1),Y);se.style.setProperty("--pf-minh",`${oe}px`);return}(()=>{let Se=window.getComputedStyle(se),Ne=parseFloat(Se.lineHeight||"20"),Y=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(Ne*(f??1),Y);se.style.setProperty("--pf-minh",`${oe}px`);let re=v?Ne*v:1/0;se.style.height="auto",se.style.height=`${Math.min(se.scrollHeight,re)}px`;})();},[X,f,v,_.minHeight,h]);let Q=a!=null||C?`${g??L}-help`:void 0,ee=g??L;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Re,children:[e&&jsx("label",{htmlFor:ee,className:"plainframe-ui-textarea-label",css:Ce,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[E({enabled:T!=="none",disabled:u,color:s?"danger":void 0}),Ie],"aria-invalid":!!s||void 0,"aria-disabled":u||void 0,onClick:()=>!u&&Ee.current?.focus(),children:jsx("textarea",{ref:Ee,id:ee,className:"plainframe-ui-textarea-input",css:we,rows:f,value:X,onChange:se=>{let pe=se.target.value;k&&pe.length>k||le(pe);},placeholder:r||"",disabled:u,onBlur:W,onFocus:K,onKeyDown:I,autoFocus:F,name:S,tabIndex:b,autoComplete:A,readOnly:H,required:B,"aria-invalid":!!s||void 0,"aria-describedby":Q})}),(a!=null||C&&k!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:he,children:[jsx("span",{id:Q,className:"plainframe-ui-textarea-helper-text",css:Ve,children:a}),C&&k!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:Z,children:[X.length,"/",k]})]})]})};var ag=jo,ig={type:"spring",stiffness:920,damping:100},Gl="__toast_root__",lg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Lr=(e,t)=>{for(let n of t){let o=lg(e,n);if(o!=null&&o!=="")return o}},sa=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function cg(e){let t=Lr(e,["radius.md","shape.borderRadius","radii.md"]),n=Lr(e,["spacing.lg","space.4","spacing.4"]),o=Lr(e,["spacing.md","space.3","spacing.3"]),r=Lr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:sa(t,16),padX:sa(n,14),padY:sa(o,12),shadow:String(r)}}var ug=cg(ag),Wt=null,Yn=null,ye={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function Jl(){typeof document>"u"||(Wt||(Wt=document.getElementById("toast-host"),Wt||(Wt=document.createElement("div"),Wt.id="toast-host",document.body.appendChild(Wt))),Yn||(Yn=Wt[Gl]??null,Yn||(Yn=createRoot(Wt),Wt[Gl]=Yn,Yn.render(jsx(Da,{children:jsx(Cg,{})})))));}var te={displayed:[],queue:[],entering:{},exiting:{},enterFrom:{},timers:new Map,expiry:new Map,remaining:new Map,paused:new Set,listeners:new Set,snapshot:{displayed:[],entering:{},exiting:{},enterFrom:{}},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},notify(){this.listeners.forEach(e=>e());},sync(){this.snapshot={displayed:[...this.displayed],entering:{...this.entering},exiting:{...this.exiting},enterFrom:{...this.enterFrom}};}},In=()=>{te.sync(),te.notify();},dg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Br(e,t){if(t===null)return;let n=t??e.duration;if(n==null||te.timers.has(e.id))return;let o=Date.now(),r=te.remaining.get(e.id),s=r!=null?Math.max(0,r):n;te.expiry.set(e.id,o+s);let a=window.setTimeout(()=>Le.dismiss(e.id),s);te.timers.set(e.id,a);}function $r(e){let t=te.timers.get(e);t&&(clearTimeout(t),te.timers.delete(e));}function pg(){let e=false;for(;te.displayed.length<ye.max&&te.queue.length;){let t=te.queue.shift();te.displayed=[t,...te.displayed],te.enterFrom[t.id]="head",te.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete te.entering[t.id],In();}),Br(t);}e&&In();}function mg(){if(te.displayed.length<ye.max)return;let e=te.displayed.filter(o=>!te.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=te.expiry.get(t.id);n!=null&&te.remaining.set(t.id,Math.max(0,n-Date.now())),$r(t.id),te.exiting[t.id]=true,te.displayed=te.displayed.filter(o=>o.id!==t.id),delete te.enterFrom[t.id],te.queue.push(t),In();}var fg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function gg(e,t){let n=fg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",u=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:u,border:i};let l=s?.onColors??{},c=(p,R,f)=>{let v=o.colors,k=o.palette;return {bg:v?.[p]??k?.[p]?.[700]??R,fg:l?.[p]??f,border:"transparent"}};return n==="success"?c("success","#22C55E","#fff"):n==="warning"?c("warning","#F59E0B","#fff"):n==="error"?c("error","#EF4444","#fff"):{bg:a,fg:u,border:i}}var Le=Object.assign((e,t)=>{Jl();let n=i=>i!=null&&typeof i[Symbol.iterator]=="function",o=i=>!!i&&(typeof i=="object"||typeof i=="function")&&typeof i.then=="function",r;typeof e=="object"&&e!=null&&!me.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(me.isValidElement(e),e),...t||{}},r.content==null&&(r.title!=null||r.description!=null)&&(r.content=jsxs("div",{children:[r.title&&jsx("strong",{style:{display:"block",marginBottom:2},children:r.title}),r.description]}));let s=r.id??dg(),a=i=>{let l=i.findIndex(R=>R.id===s);if(l===-1)return false;let c=i[l],p={...c,status:r.status??c.status,content:r.content??c.content,title:r.title??c.title,description:r.description??c.description,startIcon:r.startIcon??c.startIcon,endIcon:r.endIcon??c.endIcon,action:r.action??c.action,onClose:r.onClose??c.onClose,duration:r.duration===void 0?c.duration:r.duration,pauseOnHover:r.pauseOnHover??c.pauseOnHover,showDismiss:r.showDismiss??c.showDismiss,render:r.render??c.render,bare:r.bare??c.bare,onClick:r.onClick??c.onClick,width:r.width??c.width};return i[l]=p,$r(s),te.remaining.delete(s),te.paused.has(s)||Br(p),In(),true};if(a(te.displayed)||a(te.queue))return s;let u={id:s,status:r.status??"default",content:r.content,title:r.title,description:r.description,startIcon:r.startIcon,endIcon:r.endIcon,action:r.action,duration:r.duration===void 0?ye.duration:r.duration,onClose:r.onClose,createdAt:Date.now(),pauseOnHover:r.pauseOnHover??true,showDismiss:r.showDismiss,render:r.render,bare:r.bare,onClick:r.onClick,width:r.width??300};return te.displayed.length>=ye.max&&mg(),te.displayed=[...te.displayed,u],te.enterFrom[u.id]="tail",te.entering[u.id]=true,requestAnimationFrame(()=>{delete te.entering[u.id],In();}),In(),Br(u),s},{success:(e,t={})=>Le(e,{...t,status:"success"}),error:(e,t={})=>Le(e,{...t,status:"error"}),warning:(e,t={})=>Le(e,{...t,status:"warning"}),info:(e,t={})=>Le(e,{...t,status:"info"}),custom:(e,t={})=>Le(e,{...t}),update:(e,t)=>Le({id:e,...t}),dismiss:e=>{if(!e){let n=te.displayed.find(o=>!te.exiting[o.id])?.id;n&&Le.dismiss(n);return}$r(e),te.remaining.delete(e),te.paused.delete(e),te.exiting[e]=true;let t=te.displayed.find(n=>n.id===e);te.displayed=te.displayed.filter(n=>n.id!==e),delete te.enterFrom[e],In(),window.setTimeout(()=>t?.onClose?.(),120),pg();},clear:()=>{[...te.displayed.map(t=>t.id)].forEach(t=>Le.dismiss(t));},pause:e=>{if(te.paused.has(e))return;let t=te.expiry.get(e);t!=null&&te.remaining.set(e,Math.max(0,t-Date.now())),te.paused.add(e),$r(e);},resume:e=>{if(!te.paused.has(e))return;te.paused.delete(e);let t=te.displayed.find(o=>o.id===e)??te.queue.find(o=>o.id===e),n=te.remaining.get(e);t&&Br(t,n??void 0),te.remaining.delete(e);},pauseLatest:()=>{let e=te.displayed.at(-1);e&&Le.pause(e.id);},resumeLatest:()=>{let e=te.displayed.at(-1);e&&Le.resume(e.id);},promise:(e,t,n={})=>{let o=Le(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Le.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Le.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ye.max=e.max),e.position&&(ye.position=e.position),e.gutter!=null&&(ye.gutter=e.gutter),e.zIndex!=null&&(ye.zIndex=e.zIndex),e.duration!==void 0&&(ye.duration=e.duration),e.showDismiss&&(ye.showDismiss=e.showDismiss),e.styles&&(ye.styles={...ye.styles,...e.styles}),e.renderer!==void 0&&(ye.renderer=e.renderer),e.bareRenderer!==void 0&&(ye.bareRenderer=e.bareRenderer);}});function bg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ye.showDismiss}function hg(e){return {"top-left":{top:16,left:16,alignItems:"flex-start"},"top-center":{top:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"top-right":{top:16,right:16,alignItems:"flex-end"},"bottom-left":{bottom:16,left:16,alignItems:"flex-start"},"bottom-center":{bottom:16,left:"50%",transform:"translateX(-50%)",alignItems:"center"},"bottom-right":{bottom:16,right:16,alignItems:"flex-end"}}[e]}var yg=css({display:"flex",alignItems:"flex-start",gap:10}),Xl=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),xg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),vg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Cg=me.memo(function(){let t=useSyncExternalStore(te.subscribe.bind(te),()=>te.snapshot,()=>te.snapshot),n=U(),o=ye.position.startsWith("bottom"),r=me.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=me.useMemo(()=>({position:"fixed",zIndex:ye.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...hg(ye.position),...ye.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((a,u)=>{let i=t.enterFrom[a.id]||"tail",l=o?i==="head"?-16:16:i==="head"?16:-16,c=u>0?ye.gutter:0,p={toast:a,close:Le.dismiss,pause:Le.pause,resume:Le.resume},{bg:R,fg:f,border:v}=gg(n,a.status),k={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:ug.shadow,padding:`${n.spacing.md} calc(${n.spacing.lg} + 30px) ${n.spacing.md} ${n.spacing.lg}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:R,color:f,cursor:a.onClick?"pointer":"default",border:v?`1px solid ${v}`:"1px solid transparent"},C=typeof ye.styles.surface=="function"?ye.styles.surface(a):ye.styles.surface??{},T=bg(a.showDismiss),h={},d="& .plainframe-ui-toast-close",m="&:hover .plainframe-ui-toast-close";T==="hover"?(h[d]={opacity:0,pointerEvents:"none"},h[m]={opacity:1,pointerEvents:"auto"}):T==="always"?h[d]={opacity:1,pointerEvents:"auto"}:T==="never"&&(h[d]={display:"none"});let y=css({...k,...C,...h}),N=css({position:"absolute",top:8,right:8,appearance:"none",border:0,background:"transparent",color:f,width:28,height:28,borderRadius:8,cursor:"pointer",lineHeight:1,transition:"opacity .12s ease",display:"grid",placeItems:"center",...ye.styles.close??{}}),x;if(a.bare&&a.render){let w=typeof a.render=="function"?a.render(p):a.render;x=jsx("div",{style:{pointerEvents:"auto"},onClick:P=>a.onClick?.(a.id,P),children:w});}else if(ye.bareRenderer&&ye.renderer){let w=typeof ye.renderer=="function"?ye.renderer(p):ye.renderer;x=jsx("div",{style:{pointerEvents:"auto"},onClick:P=>a.onClick?.(a.id,P),children:w});}else {let w;ye.renderer?w=typeof ye.renderer=="function"?ye.renderer(p):ye.renderer:a.render&&!a.bare?w=typeof a.render=="function"?a.render(p):a.render:w=jsxs(Fragment,{children:[jsxs("div",{css:yg,children:[a.startIcon&&jsx("div",{css:Xl,children:a.startIcon}),jsx("div",{css:xg,children:a.content}),a.endIcon&&jsx("div",{css:Xl,children:a.endIcon})]}),a.action&&jsx("div",{css:vg,children:a.action})]}),x=jsxs("div",{css:y,onClick:P=>a.onClick?.(a.id,P),children:[w,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:N,onClick:P=>{P.stopPropagation(),Le.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Rg,{id:a.id,isBottom:o,mt:c,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:x},a.id)})})})}),Rg=me.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:a,pauseOnHover:u,children:i}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:ig});},[l]);let c={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:a!=null?typeof a=="number"?`${a}px`:a:"none",...ye.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(c),initial:{opacity:0,y:s,height:"auto",x:0},animate:l,exit:{opacity:0,y:o?6:-6,height:0,marginTop:0,transition:{type:"tween",ease:"easeInOut",duration:.14}},drag:"x",dragElastic:.2,dragMomentum:true,whileDrag:{scale:.98,opacity:.95},onDragEnd:(p,R)=>{let f=Math.abs(R.offset.x),v=Math.abs(R.velocity.x);if(!(f>60||v>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let T=(R.offset.x!==0?Math.sign(R.offset.x):Math.sign(R.velocity.x||1))*(window.innerWidth+160),h=typeof R.velocity.x=="number"?R.velocity.x/10:0;l.start({x:T,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:h}}).then(()=>Le.dismiss(n));},onMouseEnter:u?()=>Le.pause(n):void 0,onMouseLeave:u?()=>Le.resume(n):void 0,children:i})}),Yl=false;(function(){Yl||(Yl=true,Jl());})();var jg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},ec=createContext(null),tc=()=>{let e=useContext(ec);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Ug=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:u=false,disableHoverListener:i=false})=>{let[l,c]=useState(!!o),p=n??l,R=x=>{n===void 0&&c(x),r?.(x);},f=useRef(null),v=useFloating({placement:t,open:p,onOpenChange:R,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),a?arrow({element:f,padding:4}):void 0].filter(Boolean)}),k=useHover(v.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),C=useFocus(v.context),T=useDismiss(v.context,{escapeKey:true,outsidePress:true}),h=useRole(v.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:m}=useInteractions([k,C,T,h]),y=useId(),N=useMemo(()=>({open:p,setOpen:R,id:y,placement:v.placement,autoWidth:u,allowArrow:!!a,refs:v.refs,floatingStyles:v.floatingStyles,middlewareData:v.middlewareData,getReferenceProps:d,getFloatingProps:m,arrowRef:f}),[p,u,a,v.placement,v.refs,v.floatingStyles,v.middlewareData,d,m]);return jsx(ec.Provider,{value:N,children:e})},qg=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=tc(),u=me.isValidElement(t),i=u&&typeof t.type=="string";if(e&&u&&i){let l=t,c="ref"in l?l.ref:void 0,p=s({...l.props,"aria-describedby":a,ref:jg(c,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),R=[l.props?.css||void 0,o].filter(Boolean);return me.cloneElement(l,{...p,css:R})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":a}),children:t})},Gg=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:a,middlewareData:u,getFloatingProps:i,placement:l,id:c,autoWidth:p,allowArrow:R,arrowRef:f}=tc(),v=U(),k=l.split("-")[0]||"top",T=k==="bottom"?{opacity:0,y:-8,scale:.98}:k==="top"?{opacity:0,y:8,scale:.98}:k==="left"?{opacity:0,x:8,scale:.98}:{opacity:0,x:-8,scale:.98},h=T,d=k==="bottom"?"center top":k==="top"?"center bottom":k==="left"?"right center":"left center",m=css({zIndex:1300,backgroundColor:v.neutral[900],color:v.neutral[0],borderRadius:8,padding:"6px 9px",fontSize:12,fontWeight:500,lineHeight:1.25,maxWidth:260,whiteSpace:p?"nowrap":"normal",boxShadow:"0 10px 30px rgba(0,0,0,.18)",pointerEvents:"auto",transformOrigin:d}),y=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:v.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),N=u.arrow,x={top:"bottom",bottom:"top",left:"right",right:"left"}[k];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:c,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[m,n],style:a,initial:T,animate:{opacity:1,x:0,y:0,scale:1},exit:h,transition:{scale:{type:"spring",stiffness:520,damping:36,mass:.6},x:{type:"spring",stiffness:420,damping:32,mass:.6},y:{type:"spring",stiffness:420,damping:32,mass:.6},opacity:{duration:.14,ease:"linear"}},...i(),children:[e,R&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[y,o],style:{left:N?.x!=null?`${N.x}px`:void 0,top:N?.y!=null?`${N.y}px`:void 0,[x]:"-3px"}})]})})})};function Zg(){let e=U();return jsx(Global,{styles:css`
37
21
  *,*::before,*::after{box-sizing:border-box}
38
- :where(html){-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
39
- html,body,#root{height:100%}
22
+
40
23
  body{
41
24
  margin:0;
42
- padding:0;
43
- font-family:${e.fonts.sans};
44
- line-height:1.3;
25
+ font-family:${e.typography.fonts.sans};
45
26
  -webkit-font-smoothing:antialiased;
46
27
  -moz-osx-font-smoothing:grayscale;
47
28
  text-rendering:optimizeLegibility;
48
29
  background:${e.surface.appBg};
49
30
  color:${e.text.primary};
50
31
  }
51
- :focus-visible{outline:2px solid var(--pf-focus-main);outline-offset:2px}
32
+
33
+ :focus-visible{outline:2px solid var(--pf-focus-accent-main); outline-offset: 4px;}
52
34
  ::selection{background:var(--pf-neutral-300);color:var(--pf-neutral-900)}
53
- a{color:inherit;text-decoration:none}
35
+
36
+ a{color:${e.text.primary}}
54
37
  a:hover{text-decoration:underline}
55
- button,input,select,textarea{font:inherit;color:inherit;letter-spacing:inherit;background:none;border:0}
56
- input,select,textarea{border-radius:0}
57
- img,svg,video,canvas,iframe{display:block;max-width:100%}
58
- table{border-collapse:collapse;border-spacing:0}
59
- ul,ol{margin:0;padding:0;list-style:none}
60
- h1,h2,h3,h4,h5,h6,p,figure{margin:0}
61
- code,kbd,pre,samp{font-family:${e.fonts.mono}}
62
- hr{border:0;border-top:1px solid ${e.surface.border};margin:0}
63
38
 
64
- html,body{scrollbar-width:none}
65
- html:hover,body:hover{scrollbar-width:thin;scrollbar-color:var(--pf-neutral-400) transparent}
39
+ button,input,select,textarea{font:inherit;color:inherit;letter-spacing:inherit}
66
40
 
67
- html::-webkit-scrollbar{width:0;height:0}
68
- html:hover::-webkit-scrollbar{width:12px;height:12px}
69
- html::-webkit-scrollbar-track{background:transparent}
70
- html::-webkit-scrollbar-thumb{
71
- background:transparent;
72
- border:3px solid transparent;
73
- background-clip:content-box;
74
- border-radius:9999px
75
- }
76
- html:hover::-webkit-scrollbar-thumb{background:var(--pf-neutral-300)}
77
- html:hover::-webkit-scrollbar-thumb:hover{background:var(--pf-neutral-400)}
41
+ h1,h2,h3,h4,h5,h6,p,figure{margin:0}
42
+ code,kbd,pre,samp{font-family:${e.typography.fonts.mono}}
43
+ hr{border:0;border-top: ${e.componentHeights.border} solid ${e.surface.border};margin:0}
78
44
 
79
45
  @media (prefers-reduced-motion:reduce){
80
46
  *{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important;scroll-behavior:auto!important}
81
47
  }
82
- `})}export{js as Accordion,ir as AccordionDetails,_s as AccordionGroup,ar as AccordionSummary,Xs as ActionBar,Dl as Alert,Bl as AlertDescription,Hl as AlertTitle,_c as Autocomplete,va as Avatar,od as AvatarGroup,Pr as Backdrop,cd as Badge,To as BreadCrumbItem,gd as BreadCrumbs,Ma as Button,Ba as ButtonGroup,In as Card,bo as CardContent,vo as CardDescription,yo as CardEnd,za as CardGroup,ho as CardStart,xo as CardTitle,uo as Checkbox,Va as Chip,Yd as CodeField,qd as ColorPatches,Xt as Container,Qd as ContextZone,Vf as CssBaseline,tu as Divider,ri as Drawer,Ut as DropdownMenu,kt as DropdownMenuContent,ia as DropdownMenuSub,ca as DropdownMenuSubContent,la as DropdownMenuSubTrigger,_t as DropdownMenuTrigger,Ur as Fade,ai as Flex,_r as Grow,ci as Image,zu as ImageStack,Vu as Kbd,ea as Menu,Fc as MenuCheckboxGroup,fo as MenuCheckboxItem,Kt as MenuItem,Gt as MenuLabel,ha as MenuRadioGroup,Pc as MenuRadioItem,Mc as MenuSeparator,ga as MenuSwitchItem,so as MenuVariantCtx,np as Modal,Ci as ModalContent,vi as ModalTrigger,up as Pagination,Mp as Popover,Ei as PopoverAnchor,ki as PopoverContent,Si as PopoverTrigger,Nr as Progress,Bp as Quote,jp as RadioGroup,Vp as RadioItem,Xp as Rotate,Zp as Select,om as Skeleton,qr as Slide,Bi as Slider,cs as Step,xm as Stepper,ec as SubMenu,nc as SubMenuContent,tc as SubMenuTrigger,ji as Swap,ps as SwapItem,yr as Switch,Vo as Tab,Uo as TabContent,Am as Tabs,zm as TextArea,no as TextField,Jf as ThemeProvider,mf as ToastViewport,Lf as Tooltip,zf as TooltipContent,$f as TooltipTrigger,tn as Typography,Ss as defaultDarkTheme,Ts as defaultLightTheme,mn as surfaceFromNeutral,qn as textDark,Yn as textLight,we as toast,Yf as useColorMode,tl as useColorModeValue,br as useDropdownMenuActiveIndex,j as usePlainframeUITheme,Np as usePopoverContext,nl as usePrimary,qf as usePrimitives};
48
+ `})}export{Wa as Accordion,ns as AccordionDetails,Va as AccordionGroup,ts as AccordionSummary,Ua as ActionBar,Qa as Alert,is as AlertDescription,as as AlertTitle,Pi as Autocomplete,Ni as Avatar,Vd as AvatarGroup,ks as Backdrop,Jd as Badge,yr as BreadCrumbItem,op as BreadCrumbs,Ki as Button,qi as ButtonGroup,Yi as Card,Qi as CardGroup,sr as Checkbox,nl as Chip,$p as CodeField,_n as Container,Op as ContextZone,Zg as CssBaseline,Vp as Divider,bl as Drawer,$n as DropdownMenu,hn as DropdownMenuContent,Ei as DropdownMenuSub,Ii as DropdownMenuSubContent,ki as DropdownMenuSubTrigger,zn as DropdownMenuTrigger,Ks as Fade,Cl as Flex,_s as Grow,wl as Image,Mm as ImageStack,Nm as Kbd,ai as Menu,bs as MenuCheckboxGroup,co as MenuCheckboxItem,pn as MenuItem,mn as MenuLabel,lr as MenuRadioGroup,Zu as MenuRadioItem,Qu as MenuSeparator,xi as MenuSwitchItem,er as MenuVariantCtx,Vm as Modal,Hl as ModalContent,Dl as ModalTrigger,Qm as Pagination,Lu as Popover,ui as PopoverAnchor,di as PopoverContent,ci as PopoverTrigger,no as Progress,sf as Quote,pf as RadioGroup,mf as RadioItem,yf as Rotate,Rf as Select,kf as Skeleton,Gs as Slide,Vl as Slider,oa as Step,Kf as Stepper,fs as Switch,Nr as Tab,Dr as TabContent,jf as Tabs,Zf as TextArea,Qo as TextField,Da as ThemeProvider,Ug as Tooltip,Gg as TooltipContent,qg as TooltipTrigger,Un as Typography,wa as defaultDarkTheme,jo as defaultLightTheme,Qn as surfaceFromNeutral,Vo as textDark,_o as textLight,Le as toast,rb as useColorMode,hc as useColorModeValue,yd as useDropdownMenuActiveIndex,U as usePlainframeUITheme,$u as usePopoverContext,yc as usePrimary,sb as usePrimitives};