plainframe-ui 0.1.56 → 0.1.58

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 (2) hide show
  1. package/dist/index.js +9 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import de,{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 xa={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},va={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},Ca={sm:32,md:36,lg:40,border:"1px"},Ra={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"}},jr={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#d7d7d7ff",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},Vr={0:"#080808",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ha={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"}},ya={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"}},Ta=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}),Jn=(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]},Ko=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),_o=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),yc=["danger","success","warning","info","amber","orange","yellow","lime","green","teal","cyan","blue","indigo","purple","magenta","pink","rose"],wa=e=>yc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:jr,palette:{...Ta(ha),primary:ha.mono},surface:Jn("light",jr),text:{...Ko(jr),onColors:{primary:"#FFFFFF",...wa({yellow:"#000000"})}}},Ea={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:Vr,palette:{...Ta(ya),primary:ya.mono},surface:Jn("dark",Vr),text:{..._o(Vr),onColors:{primary:"#FFFFFF",...wa({yellow:"#000000"})}}};function Ia(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 Aa={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},ut=e=>Aa[e]??e;function nn(e){let t={...e};return Object.entries(Aa).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var qr=de.createContext(null),Fa=de.createContext(null),Gr=de.createContext({setMode:e=>{},toggleMode:()=>{}}),Pa=de.createContext({setPrimary:e=>{}}),Da=de.createContext(null);function j(){return useTheme()}function Cc(){let e=de.useContext(qr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=de.useContext(Gr),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Rc(){let e=de.useContext(Fa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=de.useContext(Pa),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function cb(e){let t=de.useContext(Da);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Cc(),{primary:o}=Rc(),r=de.useMemo(()=>{let s=n==="light"?t.light:t.dark,a=s.palette[ut(o)]??s.palette.primary,c=nn(s.text.onColors)[ut(o)]??Xr(a[600]);return {...s,palette:{...s.palette,primary:a},text:{...s.text,onColors:{...nn(s.text.onColors),primary:c,[ut(o)]:c,[o]:c}}}},[t,n,o]);return e?e(r):r}function Vo(e,t){if(!t)return e;let n={...e.palette};if(t.palette)for(let o of Object.keys(t.palette)){let r=t.palette[o];r&&(n[o]={...e.palette[o]??{},...r});}return {...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:n,neutral:t.neutral?{...e.neutral,...t.neutral}:e.neutral,surface:{...e.surface,...t.surface??{}},text:{...e.text,...t.text??{},onColors:{...e.text.onColors,...t.text?.onColors??{}}}}}function Xr(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=c=>{let i=c/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 ka(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function Ur(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Yr(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(([u,m])=>{o.push(`--pf-palette-${i}-${u}:${m};`);});});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 c=e.text.onColors[a]??(()=>{let l=(e.palette[a]?.[600]??e.palette.primary[600]).replace("#",""),u=parseInt(l.slice(0,2),16),m=parseInt(l.slice(2,4),16),h=parseInt(l.slice(4,6),16),f=k=>{let y=k/255;return y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)};return .2126*f(u)+.7152*f(m)+.0722*f(h)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${c};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function Uo(e,t,n){return Yr(e,t,n).join("")}var Jr=e=>{for(let t=e.style.length-1;t>=0;t--){let n=e.style.item(t);n&&n.startsWith("--pf-")&&e.style.removeProperty(n);}},Ma=(e,t)=>{Jr(e);for(let n of t){let o=n.indexOf(":");if(o===-1)continue;let r=n.slice(0,o).trim(),s=n.slice(o+1).trim();s.endsWith(";")&&(s=s.slice(0,-1)),r&&e.style.setProperty(r,s);}},qo=(e,t)=>{e.classList.toggle("pf-light",t==="light"),e.classList.toggle("pf-dark",t==="dark");},Na=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let s=!!r,a=t?.primaryKey??"mono",c=de.useContext(qr),i=de.useContext(Gr),l=!!c,m=useRef((()=>{if(!s)try{let E=JSON.parse(localStorage.getItem(o)||"null");if(E?.mode==="light"||E?.mode==="dark")return E.mode}catch{}return n==="system"?window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":n??"light"})()),h=de.useMemo(()=>c??Ia(m.current),[c]),f=de.useMemo(()=>Ia(a),[]);de.useLayoutEffect(()=>{f.get()!==a&&f.set(a);},[a,f]);let T=useRef(null),k=useRef(0),y=useRef(r??"__root__");de.useLayoutEffect(()=>{let E=0,g=T.current;for(;g&&g!==document.body;)g.hasAttribute("data-pfui-scope")&&E++,g=g.parentElement;k.current=E;},[r]);let x=useMemo(()=>{let E=Vo(jo,t),g=Vo(E,t?.light),v=t?.light?.primaryKey??a,L=ut(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=nn({...Ko(g.neutral).onColors,...g.text.onColors}),_=O[L]??Xr(H[600]),N=t?.surface||t?.light?.surface?g.surface:Jn("light",g.neutral),G={...t?.text||t?.light?.text?g.text:Ko(g.neutral),onColors:nn({...O,primary:_,[L]:_})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,a]),b=useMemo(()=>{let E=Vo(Ea,t),g=Vo(E,t?.dark),v=t?.dark?.primaryKey??a,L=ut(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=nn({..._o(g.neutral).onColors,...g.text.onColors}),_=O[L]??Xr(H[600]),N=t?.surface||t?.dark?.surface?g.surface:Jn("dark",g.neutral),G={...t?.text||t?.dark?.text?g.text:_o(g.neutral),onColors:nn({...O,primary:_,[L]:_})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,a]),d=useRef(null),p=useRef(null),C=de.useInsertionEffect||de.useLayoutEffect,F=useCallback(()=>{let E=Ur(r);ka(p,s?`pfui-guard-${r}`:"pfui-guard-root"),p.current.textContent=`${E} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{p.current.textContent="";});},[r,s]);C(()=>{ka(d,s?`pfui-vars-${r}`:"pfui-vars-root");let E=t?.light?.primaryKey??t?.primaryKey??a,g=t?.dark?.primaryKey??t?.primaryKey??a,v=Ur(r),L=Uo(x,ut(E),"light"),H=Uo(b,ut(g),"dark");d.current.textContent=`${v}.pf-light{${L}}
2
- ${v}.pf-dark{${H}}`+(s?`
3
- ${v}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[x,b,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,s,a]);let R=useRef(false);de.useLayoutEffect(()=>{if(R.current)return;R.current=true;let E=s?T.current:document.documentElement;if(!E)return;let g=h.get();Jr(E),qo(E,g),E.setAttribute("data-pfui-mode",g),E.setAttribute("data-pfui-primary",f.get()),l||h.set(g);},[s,h,f,l]);let w=useCallback(()=>{window.__pfuiActiveScope={id:y.current,depth:k.current,ts:Date.now()};},[]),M=useCallback(()=>{let E=s?T.current:document.documentElement,g={capture:true},v=()=>w();return E?.addEventListener("pointerdown",v,g),E?.addEventListener("mouseenter",v,g),E?.addEventListener("focusin",v,g),E?.addEventListener("keydown",v,g),()=>{E?.removeEventListener("pointerdown",v,g),E?.removeEventListener("mouseenter",v,g),E?.removeEventListener("focusin",v,g),E?.removeEventListener("keydown",v,g);}},[s,w]),$=useCallback(E=>{let g=window.__pfuiActiveScope,v=g&&Date.now()-g.ts<1500;if(!g||!v||g.id!==y.current)return;let L=h.get(),H=f.get(),_=Yr(L==="light"?x:b,ut(H),L);Ma(E,_),qo(E,L),E.setAttribute("data-pfui-portal-owner",y.current),E.setAttribute("data-pfui-mode",L),E.setAttribute("data-pfui-primary",H);},[h,f,x,b]),K=E=>{if(E.getAttribute("data-floating-ui-portal")==="true"||E.getAttribute("data-radix-portal")==="true"||E.getAttribute("data-portal")==="true")return true;let g=E.getAttribute("role");if(g==="tooltip"||g==="dialog")return true;let v=window.getComputedStyle(E);return v.position==="fixed"||v.position==="absolute"},W=useCallback(()=>{let E=new MutationObserver(g=>{for(let v of g)v.addedNodes.forEach(L=>{L instanceof HTMLElement&&(K(L)&&$(L),L.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(H=>$(H)));});});return E.observe(document.body,{childList:true,subtree:true}),()=>E.disconnect()},[$]);de.useEffect(()=>{let E=M(),g=W();return ()=>{E(),g();}},[M,W]);let S=useCallback(E=>{let g=s?T.current:document.documentElement;g&&(Jr(g),qo(g,E),g.setAttribute("data-pfui-mode",E),g.setAttribute("data-pfui-primary",f.get()));},[s,f]),A=useCallback(E=>{let g=ut(f.get()),L=Yr(E==="light"?x:b,g,E);document.querySelectorAll(`[data-pfui-portal-owner="${y.current}"]`).forEach(H=>{Ma(H,L),qo(H,E),H.setAttribute("data-pfui-mode",E),H.setAttribute("data-pfui-primary",g);});},[x,b,f]);de.useLayoutEffect(()=>{A(h.get());},[A,x,b,a,h]),de.useLayoutEffect(()=>{if(!l)return;let E=()=>{let v=h.get();F(),S(v),A(v);};E();let g=h.subscribe(E);return ()=>g()},[l,h,F,S,A]);let I=useCallback(E=>{if(h.get()!==E&&(F(),h.set(E),S(E),A(E),!s))try{let g=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...g,mode:E}));}catch{}},[h,s,o,F,S,A]),P=useCallback(()=>I(h.get()==="light"?"dark":"light"),[I,h]),D=useCallback(E=>{f.set(E);let g=Ur(r),v=Uo(x,ut(E),"light"),L=Uo(b,ut(E),"dark");d.current&&(d.current.textContent=`${g}.pf-light{${v}}
4
- ${g}.pf-dark{${L}}`+(s?`
5
- ${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),F();let H=h.get();if(S(H),A(H),!s)try{let O=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...O,primary:E}));}catch{}},[x,b,r,s,h,f,F,S,A]),B=l?i:{setMode:I,toggleMode:P},z=jsx(Da.Provider,{value:{light:x,dark:b},children:jsx(qr.Provider,{value:h,children:jsx(Fa.Provider,{value:f,children:jsx(Gr.Provider,{value:B,children:jsx(Pa.Provider,{value:{setPrimary:D},children:jsx(ThemeProvider,{theme:Tc(x),children:e})})})})})});return s?jsx("div",{ref:T,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:z}):jsx("div",{ref:T,children:z})};function Tc(e){let t=(l,u)=>Object.fromEntries(Object.keys(l).map(m=>[m,u(m)])),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)"},c=t(e.neutral,l=>`var(--pf-neutral-${l})`),i={};return Object.keys(e.palette).forEach(l=>{i[l]={},Object.keys(e.palette[l]).forEach(u=>{i[l][u]=`var(--pf-palette-${l}-${u})`;});}),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:c,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(nn(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var wc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ha=(e,t)=>{let n=wc(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 he(){let e=j();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,c=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[c]={boxShadow:`0 0 0 ${s}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:a,zIndex:1e4},css(i)}}function Xo(){let e=j();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,c=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[c]={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},c)=>{let i=j(),l=i.typography.sizes.sm,u=20,m=10,h=i.spacing.lg,f=i.spacing.md,T=Number(i.componentHeights?.md),k=i.text,y=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:T,padding:`${f} ${h}`,gap:m,fontSize:l,color:k.primary}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),b=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:c,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[y,s],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[b,a],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:x,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:u,height:u}})})]})});ts.__PFUI_SLOT="AccordionSummary";ts.displayName="AccordionSummary";var ns=({children:e,className:t,css:n})=>{let o=j(),r=o.typography.sizes.sm,s=o.spacing.lg,a="0.15rem",c=o.spacing.md,i=css({padding:`${a} ${s} ${c} ${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:c=false,css:i,children:l})=>{let u=j(),m=useId(),h=useId(),f=u.radius?.md,T=u.text,k=u.componentHeights?.border??1,y=za(k)??"1px",x=e!==void 0,[b,d]=useState(!!t),p=x?!!e:b,C=he(),[F,R]=useState(0),[w,M]=useState(false),$=useRef(null),K=useRef(null),W=useRef(null),S=()=>{if(!p)return;let N=document.activeElement;K.current?.contains(N)&&W.current?.focus();},A=()=>{s||(S(),x?n?.(!e):d(N=>{let U=!N;return n?.(U),U}));},I=de.Children.toArray(l).filter(N=>isValidElement(N)),P=I.findIndex(N=>Oa(N)==="AccordionSummary"),D=I.findIndex(N=>Oa(N)==="AccordionDetails");P===-1&&I.length&&(P=0),D===-1&&(D=I.findIndex((N,U)=>U!==P),D===-1&&I.length>=2&&(D=1));let B=I[P]??null,z=I[D]??null,E=r==="subtle"?u.surface.subtleBg:r==="outlined"?u.surface.panelBg:"transparent",g=css({backgroundColor:E,color:T.primary,borderRadius:f,border:r==="outlined"?`${y} solid ${u.surface.border}`:"none",outline:"none",marginBottom:u.spacing.sm,maxWidth:a!=null?za(a):void 0,width:c?"100%":a!=null?void 0:"auto",boxSizing:"border-box",opacity:s?.55:1,cursor:s?"not-allowed":void 0});useLayoutEffect(()=>{let N=$.current;N&&R(N.scrollHeight);},[p,l]),useEffect(()=>{let N=$.current;if(!N)return;let U=new ResizeObserver(()=>R(N.scrollHeight));return U.observe(N),()=>U.disconnect()},[]),useEffect(()=>{F>0&&!w&&M(true);},[F,w]),useLayoutEffect(()=>{if(!p&&K.current){let N=document.activeElement;K.current.contains(N)&&W.current?.focus();}},[p]),useLayoutEffect(()=>{let N=K.current;if(!N)return;let U=Array.from(N.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]"));p?(U.forEach(G=>{let se=G.dataset.accordionTabindex;se!=null&&(se===""?G.removeAttribute("tabindex"):G.tabIndex=Number(se),delete G.dataset.accordionTabindex);}),N.removeAttribute("inert")):(U.forEach(G=>{G.dataset.accordionTabindex==null&&(G.dataset.accordionTabindex=G.hasAttribute("tabindex")?G.getAttribute("tabindex")??"":""),G.tabIndex=-1;}),N.setAttribute("inert",""));},[p]);let v=css({maxHeight:p?F||"none":0,overflow:p&&!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:p?1:0,transform:p?"translateY(0)":"translateY(1rem)",transition:w?"transform 0.28s ease, opacity 0.28s ease":"none"}),H=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:p?"rotate(180deg)":"rotate(0deg)"}}),O=B&&cloneElement(B,{...typeof B.props=="object"&&B.props?B.props:{},className:[B.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),_=z;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":p?"true":"false","data-disabled":s?"true":"false",css:[C(),g,i],tabIndex:s?-1:0,ref:W,role:"button","aria-expanded":p,"aria-controls":m,"aria-labelledby":h,"aria-disabled":s||void 0,onClick:N=>{N.detail===0&&document.activeElement!==W.current||A();},onKeyDown:N=>{s||document.activeElement===W.current&&N.target===W.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),A());},children:[jsx("div",{id:h,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:s?"not-allowed":"pointer"}),H],children:O}),jsx("div",{id:m,"aria-hidden":!p,className:"plainframe-ui-accordion-details-clip",css:v,tabIndex:-1,ref:K,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:$,className:"plainframe-ui-accordion-details-inner",css:L,children:_})})]})};Wa.displayName="Accordion";var Hc=e=>isValidElement(e),Lc=e=>Hc(e)?e.type?.displayName||e.type?.name:void 0,_a=e=>Lc(e)==="Accordion",Bc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,$c=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,ja=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:s,onOpenIndexChange:a,disabled:c=false,width:i,fullWidth:l=false,className:u,role:m="group",css:h})=>{let f=j(),T=useRef(null),k=Children.toArray(e),y=k.filter(_a),x=y.length,b=o&&r!==void 0,[d,p]=useState(()=>{if(!o)return null;if(s!==void 0)return s;for(let A=0;A<y.length;A++){let I=y[A].props;if(I.open||I.defaultOpen)return A}return null}),C=o?b?r??null:d:null,F=$c(f.componentHeights?.border,1),R=f.surface.border,w=f.radius.md,M=n,$=M==="outlined";useEffect(()=>{let A=T.current;if(!A)return;let I=P=>{if(P.key!=="ArrowDown"&&P.key!=="ArrowUp"&&P.key!=="Home"&&P.key!=="End")return;let B=Array.from(A.querySelectorAll(".plainframe-ui-accordion")).filter(v=>v.getAttribute("data-disabled")!=="true");if(B.length===0)return;let z=document.activeElement,E=B.findIndex(v=>v.contains(z));if(E===-1)return;P.preventDefault();let g=E;P.key==="ArrowDown"?g=(E+1)%B.length:P.key==="ArrowUp"?g=(E-1+B.length)%B.length:P.key==="Home"?g=0:P.key==="End"&&(g=B.length-1),B[g]?.focus();};return A.addEventListener("keydown",I),()=>A.removeEventListener("keydown",I)},[x]);let K=css({display:"flex",flexDirection:"column",maxWidth:i!=null?Bc(i):void 0,width:l?"100%":i!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&$?`${F} solid ${R}`:"none",borderRadius:t&&$?w:void 0,background:t&&$?f.surface.panelBg:"transparent"}),W=0,S=[];return k.forEach((A,I)=>{if(!_a(A)){S.push(A);return}let P=A.props,D=W++,B=D===0,z=D===x-1,E=c||!!P.disabled,g=M??P.variant,v=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:B?w:0,borderTopRightRadius:B?w:0,borderBottomLeftRadius:z?w:0,borderBottomRightRadius:z?w:0}):css({width:"100%",marginBottom:0}),L=!B&&x>1&&t?css({borderTop:`${F} solid ${R}`}):null,H=$?css({border:"1px solid transparent"}):null,O={variant:g,disabled:E,width:"100%",css:[P.css,v,H,L],className:[P.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=P.onChange,N=C===D;O.open=N,O.defaultOpen=void 0,O.onChange=U=>{let G=U?D:null;b||p(G),a?.(G),_?.(U);};}S.push(cloneElement(A,{...P,...O,key:A?.key??I}));}),jsx("div",{ref:T,role:m,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",u||""].join(" ").trim(),css:[K,h],children:S})};ja.displayName="AccordionGroup";var Wt=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:c=0,offsetX:i=0,offsetY:l=0,elevated:u=true,unstyled:m=false,fullWidth:h=false,width:f,height:T,role:k="toolbar","aria-label":y,onClose:x})=>{let b=j(),d=useRef(null),p=useRef(null),C=useRef(false),F=useRef(t),R=n.horizontal??"center",w=n.vertical??"bottom",M=g=>typeof g=="string"?b.spacing[g]??g:g,$=g=>typeof g=="string"?b.radius[g]??g:g,K=Wt(M(c)),W=Wt(M(i)),S=Wt(M(l)),A={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:R==="left"?"flex-start":R==="right"?"flex-end":"center",alignItems:w==="top"?"flex-start":w==="bottom"?"flex-end":"center"},I=()=>`${R==="left"?"left":R==="right"?"right":"center"} ${w==="top"?"top":w==="bottom"?"bottom":"center"}`,P=()=>w==="top"||w==="bottom"?`translateY(${w==="bottom"?100:-100}px) scale(0.98)`:w==="center"?R==="left"?"translateX(-100px) scale(0.98)":R==="right"?"translateX(100px) scale(0.98)":"scale(0.95)":"scale(0.98)",D=()=>w==="center"&&R==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",B=24,z={margin:B,marginTop:w==="top"?`calc(${B}px + ${K} + ${S})`:B,marginBottom:w==="bottom"?`calc(${B}px + ${K} + ${S})`:B,marginLeft:R==="left"?`calc(${B}px + ${K} + ${W})`:B,marginRight:R==="right"?`calc(${B}px + ${K} + ${W})`:B,padding:m?0:Wt(M(r)),background:m?"transparent":b.surface.panelBg,border:m?"none":`1px solid ${b.surface.border}`,borderRadius:m?0:Wt($(a)),boxShadow:m||!u?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Wt(M(s)),transformOrigin:I(),pointerEvents:t?"auto":"none",width:h?"calc(100% - 48px)":f?Wt(f):"auto",height:T?Wt(T):"auto",maxWidth:h?"100%":"none"},E=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let g=d.current;if(!g)return;let v=P(),L=D();if(!C.current){C.current=true,F.current=t,g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}if(F.current===t){g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}F.current=t,p.current&&p.current.cancel();let H=t?[{opacity:0,transform:v},{opacity:1,transform:L}]:[{opacity:1,transform:L},{opacity:0,transform:v}];return p.current=g.animate(H,{duration:250,easing:"ease",fill:"forwards"}),()=>{p.current&&p.current.cancel();}},[t,R,w]),useEffect(()=>{if(!t||!x)return;let g=v=>{v.key==="Escape"&&x();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t,x]),jsx("div",{css:A,children:jsx("div",{ref:d,css:E,style:z,role:k,"aria-label":y,"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,jc=keyframes`100% { transform: rotate(360deg); }`,Vc=keyframes`
1
+ import de,{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 xa={xxs:"0.15rem",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem",xl:"1.5rem"},va={xxs:"0.3rem",xs:"0.4rem",sm:"0.6rem",md:"0.7rem",lg:"1rem",xl:"2rem",full:"9999px"},Ca={sm:32,md:36,lg:40,border:"1px"},Ra={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"}},Vr={0:"#ffffff",50:"#f9f9f9",100:"#f5f5f5",200:"#eeeeee",300:"#e5e5e5",400:"#d7d7d7ff",500:"#b3b3b3",600:"#737373",700:"#4a4a4a",800:"#2b2b2b",900:"#111111"},Ur={0:"#080808",50:"#121212",100:"#1a1a1a",200:"#222222",300:"#2b2b2b",400:"#333333",500:"#444444",600:"#6e6e6e",700:"#a6a6a6",800:"#e5e5e5",900:"#ffffff"},ha={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"}},ya={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"}},Ta=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}),Jn=(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]},Ko=e=>({primary:e[900],secondary:e[600],muted:e[500],onColors:{}}),_o=e=>({primary:e[900],secondary:e[700],muted:e[600],onColors:{}}),yc=["danger","success","warning","info","amber","orange","yellow","lime","green","teal","cyan","blue","indigo","purple","magenta","pink","rose"],wa=e=>yc.reduce((t,n)=>(t[n]=e[n]??"#FFFFFF",t),{}),jo={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:Vr,palette:{...Ta(ha),primary:ha.mono},surface:Jn("light",Vr),text:{...Ko(Vr),onColors:{primary:"#FFFFFF",...wa({yellow:"#000000"})}}},Ea={spacing:xa,radius:va,componentHeights:Ca,typography:Ra,neutral:Ur,palette:{...Ta(ya),primary:ya.mono},surface:Jn("dark",Ur),text:{..._o(Ur),onColors:{primary:"#FFFFFF",...wa({yellow:"#000000"})}}};function Ia(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 Fa={destructive:"danger",error:"danger",violet:"purple",fuchsia:"magenta",gray:"mono",grey:"mono",neutral:"mono"},ct=e=>Fa[e]??e;function tn(e){let t={...e};return Object.entries(Fa).forEach(([n,o])=>{t[o]!=null&&t[n]==null&&(t[n]=t[o]);}),t}var Gr=de.createContext(null),Aa=de.createContext(null),Xr=de.createContext({setMode:e=>{},toggleMode:()=>{}}),Pa=de.createContext({setPrimary:e=>{}}),Da=de.createContext(null);function j(){return useTheme()}function Cc(){let e=de.useContext(Gr);if(!e)throw new Error("useColorMode must be used within ThemeProvider");let t=de.useContext(Xr),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{mode:n,setMode:t.setMode,toggleMode:t.toggleMode}}function Rc(){let e=de.useContext(Aa);if(!e)throw new Error("usePrimary must be used within ThemeProvider");let t=de.useContext(Pa),[n,o]=de.useState(()=>e.get());return de.useEffect(()=>{o(e.get());let r=e.subscribe(()=>o(e.get()));return ()=>{r();}},[e]),{primary:n,setPrimary:t.setPrimary}}function cb(e){let t=de.useContext(Da);if(!t)throw new Error("usePrimitives must be used within ThemeProvider");let{mode:n}=Cc(),{primary:o}=Rc(),r=de.useMemo(()=>{let a=n==="light"?t.light:t.dark,i=a.palette[ct(o)]??a.palette.primary,c=tn(a.text.onColors)[ct(o)]??Yr(i[600]);return {...a,palette:{...a.palette,primary:i},text:{...a.text,onColors:{...tn(a.text.onColors),primary:c,[ct(o)]:c,[o]:c}}}},[t,n,o]);return e?e(r):r}function Vo(e,t){if(!t)return e;let n={...e.palette};if(t.palette)for(let o of Object.keys(t.palette)){let r=t.palette[o];r&&(n[o]={...e.palette[o]??{},...r});}return {...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:n,neutral:t.neutral?{...e.neutral,...t.neutral}:e.neutral,surface:{...e.surface,...t.surface??{}},text:{...e.text,...t.text??{},onColors:{...e.text.onColors,...t.text?.onColors??{}}}}}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),a=c=>{let s=c/255;return s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)};return .2126*a(n)+.7152*a(o)+.0722*a(r)>.53?"#000":"#FFF"}function ka(e,t){if(e.current)return;let n=document.createElement("style");n.id=t,document.head.appendChild(n),e.current=n;}function qr(e){return e?`[data-pfui-scope="${e}"]`:":root"}function Jr(e,t,n){let o=[],r=s=>s.startsWith("var(")?s.replace(/^var\([^,]+,\s*/,"").replace(/\)\s*$/,"").trim():s;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(([s,l])=>o.push(`--pf-text-on-${s}:${l};`)),Object.entries(e.spacing).forEach(([s,l])=>o.push(`--pf-space-${s}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.radius).forEach(([s,l])=>o.push(`--pf-radius-${s}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.typography.sizes).forEach(([s,l])=>o.push(`--pf-fontSize-${s}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.componentHeights).forEach(([s,l])=>o.push(`--pf-cmph-${s}:${typeof l=="number"?`${l}px`:l};`)),Object.entries(e.neutral).forEach(([s,l])=>o.push(`--pf-neutral-${s}:${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(([s,l])=>{Object.entries(l).forEach(([u,p])=>{o.push(`--pf-palette-${s}-${u}:${p};`);});});let a="300";Object.keys(e.palette).forEach(s=>{o.push(`--pf-focus-${s}-main: var(--pf-palette-${s}-${a});`),o.push(`--pf-focus-${s}-soft: transparent;`);});let i=t;[0,50,100,200,300,400,500,600,700,800,900].forEach(s=>o.push(`--pf-primary-${s}:var(--pf-palette-${i}-${s});`)),o.push("--pf-focus-accent-main:var(--pf-primary-300);"),o.push("--pf-focus-accent-soft: transparent;");let c=e.text.onColors[i]??(()=>{let l=(e.palette[i]?.[600]??e.palette.primary[600]).replace("#",""),u=parseInt(l.slice(0,2),16),p=parseInt(l.slice(2,4),16),b=parseInt(l.slice(4,6),16),f=k=>{let y=k/255;return y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4)};return .2126*f(u)+.7152*f(p)+.0722*f(b)>.53?"#000":"#FFF"})();return o.push(`--pf-text-on-primary:${c};`),o.push(`color-scheme:${n==="dark"?"dark":"light"};`),o}function Uo(e,t,n){return Jr(e,t,n).join("")}var Zr=e=>{for(let t=e.style.length-1;t>=0;t--){let n=e.style.item(t);n&&n.startsWith("--pf-")&&e.style.removeProperty(n);}},Ma=(e,t)=>{Zr(e);for(let n of t){let o=n.indexOf(":");if(o===-1)continue;let r=n.slice(0,o).trim(),a=n.slice(o+1).trim();a.endsWith(";")&&(a=a.slice(0,-1)),r&&e.style.setProperty(r,a);}},qo=(e,t)=>{e.classList.toggle("pf-light",t==="light"),e.classList.toggle("pf-dark",t==="dark");},Na=({children:e,theme:t,initialMode:n="light",storageKey:o="pfui:pref",scope:r})=>{let a=!!r,i=t?.primaryKey??"mono",c=de.useContext(Gr),s=de.useContext(Xr),l=!!c,p=useRef((()=>{if(!a)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"})()),b=de.useMemo(()=>c??Ia(p.current),[c]),f=de.useMemo(()=>Ia(i),[]);de.useLayoutEffect(()=>{f.get()!==i&&f.set(i);},[i,f]);let R=useRef(null),k=useRef(0),y=useRef(r??"__root__");de.useLayoutEffect(()=>{let w=0,g=R.current;for(;g&&g!==document.body;)g.hasAttribute("data-pfui-scope")&&w++,g=g.parentElement;k.current=w;},[r]);let x=useMemo(()=>{let w=Vo(jo,t),g=Vo(w,t?.light),v=t?.light?.primaryKey??i,L=ct(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=tn({...Ko(g.neutral).onColors,...g.text.onColors}),_=O[L]??Yr(H[600]),N=t?.surface||t?.light?.surface?g.surface:Jn("light",g.neutral),G={...t?.text||t?.light?.text?g.text:Ko(g.neutral),onColors:tn({...O,primary:_,[L]:_})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,i]),h=useMemo(()=>{let w=Vo(Ea,t),g=Vo(w,t?.dark),v=t?.dark?.primaryKey??i,L=ct(v),H=g.palette.primary??g.palette[L]??g.palette.mono,O=tn({..._o(g.neutral).onColors,...g.text.onColors}),_=O[L]??Yr(H[600]),N=t?.surface||t?.dark?.surface?g.surface:Jn("dark",g.neutral),G={...t?.text||t?.dark?.text?g.text:_o(g.neutral),onColors:tn({...O,primary:_,[L]:_})};return {...g,palette:{...g.palette,primary:H},surface:N,text:G}},[t,i]),d=useRef(null),m=useRef(null),C=de.useInsertionEffect||de.useLayoutEffect,A=useCallback(()=>{let w=qr(r);ka(m,a?`pfui-guard-${r}`:"pfui-guard-root"),m.current.textContent=`${w} *{transition:none!important;animation:none!important}`,requestAnimationFrame(()=>{m.current.textContent="";});},[r,a]);C(()=>{ka(d,a?`pfui-vars-${r}`:"pfui-vars-root");let w=t?.light?.primaryKey??t?.primaryKey??i,g=t?.dark?.primaryKey??t?.primaryKey??i,v=qr(r),L=Uo(x,ct(w),"light"),H=Uo(h,ct(g),"dark");d.current.textContent=`${v}.pf-light{${L}}
2
+ ${v}.pf-dark{${H}}`+(a?`
3
+ ${v}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"");},[x,h,t?.primaryKey,t?.light?.primaryKey,t?.dark?.primaryKey,r,a,i]);let T=useRef(false);de.useLayoutEffect(()=>{if(T.current)return;T.current=true;let w=a?R.current:document.documentElement;if(!w)return;let g=b.get();Zr(w),qo(w,g),w.setAttribute("data-pfui-mode",g),w.setAttribute("data-pfui-primary",f.get()),l||b.set(g);},[a,b,f,l]);let E=useCallback(()=>{window.__pfuiActiveScope={id:y.current,depth:k.current,ts:Date.now()};},[]),M=useCallback(()=>{let w=a?R.current:document.documentElement,g={capture:true},v=()=>E();return w?.addEventListener("pointerdown",v,g),w?.addEventListener("mouseenter",v,g),w?.addEventListener("focusin",v,g),w?.addEventListener("keydown",v,g),()=>{w?.removeEventListener("pointerdown",v,g),w?.removeEventListener("mouseenter",v,g),w?.removeEventListener("focusin",v,g),w?.removeEventListener("keydown",v,g);}},[a,E]),$=useCallback(w=>{let g=window.__pfuiActiveScope,v=g&&Date.now()-g.ts<1500;if(!g||!v||g.id!==y.current)return;let L=b.get(),H=f.get(),_=Jr(L==="light"?x:h,ct(H),L);Ma(w,_),qo(w,L),w.setAttribute("data-pfui-portal-owner",y.current),w.setAttribute("data-pfui-mode",L),w.setAttribute("data-pfui-primary",H);},[b,f,x,h]),K=w=>{if(w.getAttribute("data-floating-ui-portal")==="true"||w.getAttribute("data-radix-portal")==="true"||w.getAttribute("data-portal")==="true")return true;let g=w.getAttribute("role");if(g==="tooltip"||g==="dialog")return true;let v=window.getComputedStyle(w);return v.position==="fixed"||v.position==="absolute"},W=useCallback(()=>{let w=new MutationObserver(g=>{for(let v of g)v.addedNodes.forEach(L=>{L instanceof HTMLElement&&(K(L)&&$(L),L.querySelectorAll('[data-floating-ui-portal="true"],[data-radix-portal="true"],[data-portal="true"],[role="tooltip"],[role="dialog"]').forEach(H=>$(H)));});});return w.observe(document.body,{childList:true,subtree:true}),()=>w.disconnect()},[$]);de.useEffect(()=>{let w=M(),g=W();return ()=>{w(),g();}},[M,W]);let S=useCallback(w=>{let g=a?R.current:document.documentElement;g&&(Zr(g),qo(g,w),g.setAttribute("data-pfui-mode",w),g.setAttribute("data-pfui-primary",f.get()));},[a,f]),F=useCallback(w=>{let g=ct(f.get()),L=Jr(w==="light"?x:h,g,w);document.querySelectorAll(`[data-pfui-portal-owner="${y.current}"]`).forEach(H=>{Ma(H,L),qo(H,w),H.setAttribute("data-pfui-mode",w),H.setAttribute("data-pfui-primary",g);});},[x,h,f]);de.useLayoutEffect(()=>{F(b.get());},[F,x,h,i,b]),de.useLayoutEffect(()=>{if(!l)return;let w=()=>{let v=b.get();A(),S(v),F(v);};w();let g=b.subscribe(w);return ()=>g()},[l,b,A,S,F]);let I=useCallback(w=>{if(b.get()!==w&&(A(),b.set(w),S(w),F(w),!a))try{let g=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...g,mode:w}));}catch{}},[b,a,o,A,S,F]),P=useCallback(()=>I(b.get()==="light"?"dark":"light"),[I,b]),D=useCallback(w=>{f.set(w);let g=qr(r),v=Uo(x,ct(w),"light"),L=Uo(h,ct(w),"dark");d.current&&(d.current.textContent=`${g}.pf-light{${v}}
4
+ ${g}.pf-dark{${L}}`+(a?`
5
+ ${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),A();let H=b.get();if(S(H),F(H),!a)try{let O=JSON.parse(localStorage.getItem(o)||"{}");localStorage.setItem(o,JSON.stringify({...O,primary:w}));}catch{}},[x,h,r,a,b,f,A,S,F]),B=l?s:{setMode:I,toggleMode:P},z=jsx(Da.Provider,{value:{light:x,dark:h},children:jsx(Gr.Provider,{value:b,children:jsx(Aa.Provider,{value:f,children:jsx(Xr.Provider,{value:B,children:jsx(Pa.Provider,{value:{setPrimary:D},children:jsx(ThemeProvider,{theme:Tc(x),children:e})})})})})});return a?jsx("div",{ref:R,"data-pfui-scope":r,style:{background:"var(--pf-surface-appBg)",color:"var(--pf-text-primary)"},children:z}):jsx("div",{ref:R,children:z})};function Tc(e){let t=(l,u)=>Object.fromEntries(Object.keys(l).map(p=>[p,u(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})`),a=t(e.componentHeights,l=>`var(--pf-cmph-${l})`),i={sans:"var(--pf-font-sans)",mono:"var(--pf-font-mono)"},c=t(e.neutral,l=>`var(--pf-neutral-${l})`),s={};return Object.keys(e.palette).forEach(l=>{s[l]={},Object.keys(e.palette[l]).forEach(u=>{s[l][u]=`var(--pf-palette-${l}-${u})`;});}),s.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:a,typography:{fonts:i,sizes:r},neutral:c,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(tn(e.text.onColors)).map(l=>[l,`var(--pf-text-on-${l})`]))}}}var wc=(e,t)=>{let n=e?.palette??{};return !t||t==="neutral"?"neutral":n[t]?t:"neutral"},Ha=(e,t)=>{let n=wc(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 he(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),a=t?.haloWidth??3,i=t?.offset??0,c=t?.mode==="always"?"&:focus":"&:focus-visible",s={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 s[c]={boxShadow:`0 0 0 ${a}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:i,zIndex:1e4},css(s)}}function Xo(){let e=j();return t=>{if(!((t?.enabled??true)&&!t?.disabled)||t?.mode==="none")return css({});let{soft:o,main:r}=Ha(e,t?.color),a=t?.haloWidth??3,i=t?.offset??0,c=t?.mode==="always"?"&:focus-within":"&:has(:focus-visible)",s={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 s[c]={boxShadow:`0 0 0 ${a}px ${o}`,borderColor:r,outlineColor:r,outlineOffset:i,zIndex:1e3},css(s)}}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||""},ns=forwardRef(({children:e,expandIcon:t,expandIconPosition:n="right",hideExpandIcon:o=false,className:r,css:a,expandIconCss:i},c)=>{let s=j(),l=s.typography.sizes.sm,u=20,p=10,b=s.spacing.lg,f=s.spacing.md,R=Number(s.componentHeights?.md),k=s.text,y=css({display:"flex",alignItems:"center",outline:"none",userSelect:"none",fontWeight:500,minHeight:R,padding:`${f} ${b}`,gap:p,fontSize:l,color:k.primary}),x=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",gap:8}),h=css({marginRight:0,marginLeft:-2,lineHeight:0,color:s.text.secondary}),d=css({marginLeft:5,marginRight:-2,lineHeight:0,color:s.text.secondary});return jsxs("div",{ref:c,role:"presentation",tabIndex:-1,className:["plainframe-ui-accordion-summary",r||""].join(" ").trim(),css:[y,a],children:[!o&&n==="left"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-left",css:[h,i],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})}),jsx("span",{className:"plainframe-ui-accordion-content",css:x,children:e}),!o&&n==="right"&&jsx("span",{className:"plainframe-ui-accordion-icon plainframe-ui-accordion-icon-right",css:[d,i],children:t??jsx(ChevronDown,{strokeWidth:2,css:{width:u,height:u}})})]})});ns.__PFUI_SLOT="AccordionSummary";ns.displayName="AccordionSummary";var os=({children:e,className:t,css:n})=>{let o=j(),r=o.typography.sizes.sm,a=o.spacing.lg,i="0.15rem",c=o.spacing.md,s=css({padding:`${i} ${a} ${c} ${a}`,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})};os.__PFUI_SLOT="AccordionDetails";os.displayName="AccordionDetails";var Wa=({open:e,defaultOpen:t=false,onChange:n,className:o,variant:r="subtle",disabled:a=false,width:i,fullWidth:c=false,css:s,children:l})=>{let u=j(),p=useId(),b=useId(),f=u.radius?.md,R=u.text,k=u.componentHeights?.border??1,y=za(k)??"1px",x=e!==void 0,[h,d]=useState(!!t),m=x?!!e:h,C=he(),[A,T]=useState(0),[E,M]=useState(false),$=useRef(null),K=useRef(null),W=useRef(null),S=()=>{if(!m)return;let N=document.activeElement;K.current?.contains(N)&&W.current?.focus();},F=()=>{a||(S(),x?n?.(!e):d(N=>{let U=!N;return n?.(U),U}));},I=de.Children.toArray(l).filter(N=>isValidElement(N)),P=I.findIndex(N=>Oa(N)==="AccordionSummary"),D=I.findIndex(N=>Oa(N)==="AccordionDetails");P===-1&&I.length&&(P=0),D===-1&&(D=I.findIndex((N,U)=>U!==P),D===-1&&I.length>=2&&(D=1));let B=I[P]??null,z=I[D]??null,w=r==="subtle"?u.surface.subtleBg:r==="outlined"?u.surface.panelBg:"transparent",g=css({backgroundColor:w,color:R.primary,borderRadius:f,border:r==="outlined"?`${y} solid ${u.surface.border}`:"none",outline:"none",marginBottom:u.spacing.sm,maxWidth:i!=null?za(i):void 0,width:c?"100%":i!=null?void 0:"auto",boxSizing:"border-box",opacity:a?.55:1,cursor:a?"not-allowed":void 0});useLayoutEffect(()=>{let N=$.current;N&&T(N.scrollHeight);},[m,l]),useEffect(()=>{let N=$.current;if(!N)return;let U=new ResizeObserver(()=>T(N.scrollHeight));return U.observe(N),()=>U.disconnect()},[]),useEffect(()=>{A>0&&!E&&M(true);},[A,E]),useLayoutEffect(()=>{if(!m&&K.current){let N=document.activeElement;K.current.contains(N)&&W.current?.focus();}},[m]),useLayoutEffect(()=>{let N=K.current;if(!N)return;let U=Array.from(N.querySelectorAll("a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, [tabindex]"));m?(U.forEach(G=>{let se=G.dataset.accordionTabindex;se!=null&&(se===""?G.removeAttribute("tabindex"):G.tabIndex=Number(se),delete G.dataset.accordionTabindex);}),N.removeAttribute("inert")):(U.forEach(G=>{G.dataset.accordionTabindex==null&&(G.dataset.accordionTabindex=G.hasAttribute("tabindex")?G.getAttribute("tabindex")??"":""),G.tabIndex=-1;}),N.setAttribute("inert",""));},[m]);let v=css({maxHeight:m?A||"none":0,overflow:m&&!E?"visible":"hidden",transition:E?"max-height 0.36s cubic-bezier(.25,.8,.4,1)":"none",willChange:E?"max-height":void 0}),L=css({opacity:m?1:0,transform:m?"translateY(0)":"translateY(1rem)",transition:E?"transform 0.28s ease, opacity 0.28s ease":"none"}),H=css({"& .plainframe-ui-accordion-icon":{transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1)",transform:m?"rotate(180deg)":"rotate(0deg)"}}),O=B&&cloneElement(B,{...typeof B.props=="object"&&B.props?B.props:{},className:[B.props?.className,"plainframe-ui-accordion-summary-managed"].filter(Boolean).join(" ")}),_=z;return jsxs("div",{className:["plainframe-ui-accordion",`plainframe-ui-accordion-${r}`,o||""].join(" ").trim(),"data-variant":r,"data-open":m?"true":"false","data-disabled":a?"true":"false",css:[C(),g,s],tabIndex:a?-1:0,ref:W,role:"button","aria-expanded":m,"aria-controls":p,"aria-labelledby":b,"aria-disabled":a||void 0,onClick:N=>{N.detail===0&&document.activeElement!==W.current||F();},onKeyDown:N=>{a||document.activeElement===W.current&&N.target===W.current&&(N.key==="Enter"||N.key===" ")&&(N.preventDefault(),F());},children:[jsx("div",{id:b,className:"plainframe-ui-accordion-summary-wrapper",css:[css({cursor:a?"not-allowed":"pointer"}),H],children:O}),jsx("div",{id:p,"aria-hidden":!m,className:"plainframe-ui-accordion-details-clip",css:v,tabIndex:-1,ref:K,onClick:N=>N.stopPropagation(),children:jsx("div",{ref:$,className:"plainframe-ui-accordion-details-inner",css:L,children:_})})]})};Wa.displayName="Accordion";var Hc=e=>isValidElement(e),Lc=e=>Hc(e)?e.type?.displayName||e.type?.name:void 0,_a=e=>Lc(e)==="Accordion",Bc=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,$c=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,ja=({children:e,attached:t=false,variant:n,exclusive:o=false,openIndex:r,defaultOpenIndex:a,onOpenIndexChange:i,disabled:c=false,width:s,fullWidth:l=false,className:u,role:p="group",css:b})=>{let f=j(),R=useRef(null),k=Children.toArray(e),y=k.filter(_a),x=y.length,h=o&&r!==void 0,[d,m]=useState(()=>{if(!o)return null;if(a!==void 0)return a;for(let F=0;F<y.length;F++){let I=y[F].props;if(I.open||I.defaultOpen)return F}return null}),C=o?h?r??null:d:null,A=$c(f.componentHeights?.border,1),T=f.surface.border,E=f.radius.md,M=n,$=M==="outlined";useEffect(()=>{let F=R.current;if(!F)return;let I=P=>{if(P.key!=="ArrowDown"&&P.key!=="ArrowUp"&&P.key!=="Home"&&P.key!=="End")return;let B=Array.from(F.querySelectorAll(".plainframe-ui-accordion")).filter(v=>v.getAttribute("data-disabled")!=="true");if(B.length===0)return;let z=document.activeElement,w=B.findIndex(v=>v.contains(z));if(w===-1)return;P.preventDefault();let g=w;P.key==="ArrowDown"?g=(w+1)%B.length:P.key==="ArrowUp"?g=(w-1+B.length)%B.length:P.key==="Home"?g=0:P.key==="End"&&(g=B.length-1),B[g]?.focus();};return F.addEventListener("keydown",I),()=>F.removeEventListener("keydown",I)},[x]);let K=css({display:"flex",flexDirection:"column",maxWidth:s!=null?Bc(s):void 0,width:l?"100%":s!=null?void 0:"auto",gap:t?0:f.spacing.sm,border:t&&$?`${A} solid ${T}`:"none",borderRadius:t&&$?E:void 0,background:t&&$?f.surface.panelBg:"transparent"}),W=0,S=[];return k.forEach((F,I)=>{if(!_a(F)){S.push(F);return}let P=F.props,D=W++,B=D===0,z=D===x-1,w=c||!!P.disabled,g=M??P.variant,v=t?css({width:"100%",marginBottom:0,borderTopLeftRadius:B?E:0,borderTopRightRadius:B?E:0,borderBottomLeftRadius:z?E:0,borderBottomRightRadius:z?E:0}):css({width:"100%",marginBottom:0}),L=!B&&x>1&&t?css({borderTop:`${A} solid ${T}`}):null,H=$?css({border:"1px solid transparent"}):null,O={variant:g,disabled:w,width:"100%",css:[P.css,v,H,L],className:[P.className,"plainframe-ui-accordion-group-item"].filter(Boolean).join(" ")};if(o){let _=P.onChange,N=C===D;O.open=N,O.defaultOpen=void 0,O.onChange=U=>{let G=U?D:null;h||m(G),i?.(G),_?.(U);};}S.push(cloneElement(F,{...P,...O,key:F?.key??I}));}),jsx("div",{ref:R,role:p,"aria-orientation":"vertical","data-attached":t||void 0,"data-exclusive":o||void 0,className:["plainframe-ui-accordion-group",u||""].join(" ").trim(),css:[K,b],children:S})};ja.displayName="AccordionGroup";var Ot=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:a="xs",radius:i="lg",offset:c=0,offsetX:s=0,offsetY:l=0,elevated:u=true,unstyled:p=false,fullWidth:b=false,width:f,height:R,role:k="toolbar","aria-label":y,onClose:x})=>{let h=j(),d=useRef(null),m=useRef(null),C=useRef(false),A=useRef(t),T=n.horizontal??"center",E=n.vertical??"bottom",M=g=>typeof g=="string"?h.spacing[g]??g:g,$=g=>typeof g=="string"?h.radius[g]??g:g,K=Ot(M(c)),W=Ot(M(s)),S=Ot(M(l)),F={position:"fixed",left:0,right:0,top:0,bottom:0,display:"flex",pointerEvents:"none",zIndex:1e3,justifyContent:T==="left"?"flex-start":T==="right"?"flex-end":"center",alignItems:E==="top"?"flex-start":E==="bottom"?"flex-end":"center"},I=()=>`${T==="left"?"left":T==="right"?"right":"center"} ${E==="top"?"top":E==="bottom"?"bottom":"center"}`,P=()=>E==="top"||E==="bottom"?`translateY(${E==="bottom"?100:-100}px) scale(0.98)`:E==="center"?T==="left"?"translateX(-100px) scale(0.98)":T==="right"?"translateX(100px) scale(0.98)":"scale(0.95)":"scale(0.98)",D=()=>E==="center"&&T==="center"?"scale(1)":"translateX(0) translateY(0) scale(1)",B=24,z={margin:B,marginTop:E==="top"?`calc(${B}px + ${K} + ${S})`:B,marginBottom:E==="bottom"?`calc(${B}px + ${K} + ${S})`:B,marginLeft:T==="left"?`calc(${B}px + ${K} + ${W})`:B,marginRight:T==="right"?`calc(${B}px + ${K} + ${W})`:B,padding:p?0:Ot(M(r)),background:p?"transparent":h.surface.panelBg,border:p?"none":`1px solid ${h.surface.border}`,borderRadius:p?0:Ot($(i)),boxShadow:p||!u?"none":"0 20px 40px rgba(0,0,0,.08)",display:"flex",flexDirection:o==="vertical"?"column":"row",gap:Ot(M(a)),transformOrigin:I(),pointerEvents:t?"auto":"none",width:b?"calc(100% - 48px)":f?Ot(f):"auto",height:R?Ot(R):"auto",maxWidth:b?"100%":"none"},w=css({"& .plainframe-ui-textfield":{flex:1,minWidth:0}});return useLayoutEffect(()=>{let g=d.current;if(!g)return;let v=P(),L=D();if(!C.current){C.current=true,A.current=t,g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}if(A.current===t){g.style.opacity=t?"1":"0",g.style.transform=t?L:v;return}A.current=t,m.current&&m.current.cancel();let H=t?[{opacity:0,transform:v},{opacity:1,transform:L}]:[{opacity:1,transform:L},{opacity:0,transform:v}];return m.current=g.animate(H,{duration:250,easing:"ease",fill:"forwards"}),()=>{m.current&&m.current.cancel();}},[t,T,E]),useEffect(()=>{if(!t||!x)return;let g=v=>{v.key==="Escape"&&x();};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[t,x]),jsx("div",{css:F,children:jsx("div",{ref:d,css:w,style:z,role:k,"aria-label":y,"aria-hidden":!t,...!t&&{inert:true},children:e})})};Ua.displayName="ActionBar";var Ga=(e,t,n)=>Math.min(n,Math.max(t,e)),rs=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,qa=1,jc=keyframes`100% { transform: rotate(360deg); }`,Vc=keyframes`
6
6
  0% { left: -35%; right: 100%; }
7
7
  60% { left: 100%; right: -90%; }
8
8
  100% { left: 100%; right: -90%; }
@@ -10,14 +10,14 @@ ${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),F()
10
10
  0% { left: -200%; right: 100%; }
11
11
  60% { left: 107%; right: -8%; }
12
12
  100% { left: 107%; right: -8%; }
13
- `,qc=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("),Gc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Xc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(qc(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]&&Gc.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 Qn=de.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:s,thickness:a,spinDuration:c=.75,wrapperCss:i,trackCss:l,barCss:u,circleCss:m,"aria-label":h})=>{let f=j(),T=typeof t=="number",k=Math.max(o-n,1),y=T?Ga(t,n,o):void 0,x=T?(y-n)/k*100:void 0,b=Xc(f,r),d=f.surface.subtleBg,p=f.radius?.md;return e==="circular"?jsx(Jc,{size:s,active:b,isDeterminate:T,percent:x,spinDuration:c,wrapperCss:i,trackCss:l,circleCss:m,ariaLabel:h,thickness:a}):jsx(Yc,{thickness:a,active:b,track:d,radius:p,isDeterminate:T,percent:x,wrapperCss:i,trackCss:l,barCss:u,ariaLabel:h,min:n,max:o,value:y})}),Yc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:s,wrapperCss:a,trackCss:c,barCss:i,ariaLabel:l,min:u,max:m,value:h})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),T=css([{display:"inline-block",width:"100%"},...Array.isArray(a)?a:a?[a]:[]]),k=css([{position:"relative",width:"100%",height:os(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),y=r?Math.max(s??0,qa):qa,x=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${y/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(i)?i:i?[i]:[]]),b={position:"absolute",top:0,bottom:0,backgroundColor:t,borderRadius:"inherit",willChange:"left,right","@media (prefers-reduced-motion: reduce)":{animation:"none"}},d=css([{...b,left:"-35%",right:"100%",animation:`${Vc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(i)?i:i?[i]:[]]),p=css([{...b,left:"-200%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(i)?i:i?[i]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":m,"aria-valuenow":h}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:T,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:k,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:x}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:p})]})})})},Jc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:s,wrapperCss:a,trackCss:c,circleCss:i,ariaLabel:l})=>{let u=j(),m=40,h=(m-t)/2,f=2*Math.PI*h,k=`${(o?Ga((r??0)/100,.01,1):.7)*f} ${f}`,y=css([{display:"inline-block",width:os(e,`${u.componentHeights.md}`),height:os(e,`${u.componentHeights.md}`)},...Array.isArray(a)?a:a?[a]:[]]),x=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),b=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":`${jc} ${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:y,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:x,viewBox:`0 0 ${m} ${m}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:m/2,cy:m/2,r:h,strokeWidth:t,css:b})})})};var Ja=createContext(null),Za=()=>{let e=useContext(Ja);if(!e)throw new Error("AlertTitle and AlertDescription must be used inside <Alert>.");return e},iu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),lu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),cu=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:c="md",loading:i=false,css:l,children:u,...m},h){let f=j(),T=useId(),k=useId(),y=useMemo(()=>{let A={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?A[c]:A.md},[c,f.typography,f.radius,f.spacing]),x=f.palette??{},b=f.neutral??{},d=useMemo(()=>{let I=(v=>v==="danger"?x.danger??x.error??b:v==="warning"?x.warning??b:v==="success"?x.success??b:v==="info"?x.info??x.primary??b:b)(t),P=I?.[50]??b[50],D=I?.[300]??b[300],B=I?.[600]??I?.[500]??b[600],z=I?.[700]??B,E=I?.[800]??f.text?.primary??"#000",g=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:B,fg:g,border:void 0,iconColor:g}:n==="outlined"?{bg:P,fg:E,border:`1px solid ${D}`,iconColor:E}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:P,fg:E,border:void 0,iconColor:z}},[t,n,b,x,f.text]),p=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>i?jsx(Qn,{variant:"circular",color:d.iconColor,size:y.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):jsx(Info,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor})),[i,o,t,y.iconSize,d.iconColor]),F=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${y.paddingY} ${y.paddingX}`,gap:y.gap,borderRadius:y.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:y.fontSize,fontWeight:500,maxWidth:typeof a=="number"?`${a}px`:a,width:"100%"}),[d.bg,d.border,d.fg,y.fontSize,y.gap,y.paddingX,y.paddingY,y.radius,a]),R=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:y.gap,minWidth:0,flex:1}),[y.gap]),w=useMemo(()=>[lu,{color:d.iconColor}],[d.iconColor]),M=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[cu,{color:d.fg}],[d.fg]),K=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:T,descId:k}),[d.fg,d.iconColor,y,T,k]),W=de.Children.toArray(u).some(A=>de.isValidElement(A)&&A.type===as),S=de.Children.toArray(u).some(A=>de.isValidElement(A)&&A.type===is);return jsx(Ja.Provider,{value:K,children:jsxs("div",{ref:h,role:p,"aria-live":p==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":i,"aria-labelledby":W?T:void 0,"aria-describedby":S?k:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[F,l],...m,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:R,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:w,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:iu,children:u})]}),s&&jsx("div",{className:"plainframe-ui-alert-actions",css:M,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:y.iconSize-2})})})]})})});Qa.displayName="Alert";var as=forwardRef(function({children:t,css:n,...o},r){let{fg:s,s:a,titleId:c}=Za(),i=useMemo(()=>css({color:s,fontWeight:a.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[s,a.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[i,n],...o,children:t})});as.displayName="AlertTitle";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:s,descId:a}=Za(),c=useMemo(()=>css({color:s,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[s]);return jsx("span",{ref:r,id:a,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});is.displayName="AlertDescription";var ls=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Vt=e=>e==null?[]:Array.isArray(e)?e:[e],Ut=(...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 Zo=de.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:s,error:a,helperText:c,disabled:i=false,fullWidth:l=false,width:u=250,size:m="md",variant:h="subtle",rounded:f=false,startIcon:T,endIcon:k,togglePasswordVisible:y=false,showClear:x,type:b="text",step:d,focusRingMode:p="always",className:C,wrapperCss:F,inputCss:R,labelCss:w,helperRowCss:M,helperTextCss:$,startIconCss:K,endIconCss:W,css:S,onBlur:A,onFocus:I,onKeyDown:P,autoFocus:D,name:B,id:z,tabIndex:E,autoComplete:g,readOnly:v,required:L,maxLength:H,onSurfaceClick:O},_){let N=j(),U=Xo(),G=useId(),se=useMemo(()=>{let ce={sm:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.sm,labelFont:N.typography.sizes.xs,helperFont:N.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:21},md:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.md,labelFont:N.typography.sizes.sm,helperFont:N.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:24},lg:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.lg,labelFont:N.typography.sizes.md,helperFont:N.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:28}},Te=["sm","md","lg"].includes(m)?m:"md";return ce[Te]},[m,N]),V=N.neutral,J=N.text,le=b==="number",ue=b==="password",pe=n!==void 0,[Me,Ce]=useState(o),ve=pe?n:Me,Ee=useCallback(ce=>{pe||Ce(ce),r?.(ce);},[pe,r]),Re=/^-?\d*(?:[.,]\d*)?$/,Z=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(ve??"")),ie=le?Z?"decimal":"numeric":void 0,be=le?Z?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,Y=useCallback(ce=>{(ce===""||Re.test(ce))&&Ee(ce);},[Ee]),ye=i?V[200]:a&&h==="outlined"?N.palette.danger?.[50]??N.surface.panelBg:a&&h==="subtle"?N.palette.danger?.[50]??N.surface.subtleBg:h==="outlined"?N.surface.panelBg:h==="subtle"?N.surface.subtleBg:"transparent",Q=N.componentHeights.border,oe=h==="outlined"?`${Q} solid ${a?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Ut({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?ls(u):void 0,flex:"0 0 auto",fontWeight:500}),me=useMemo(()=>Ut({fontSize:se.labelFont,fontWeight:500,color:a?N.palette.danger?.[700]??J.primary:i?V[500]:J.primary,marginBottom:4,display:"inline-block"},...Vt(w)),[se.labelFont,a,i,V,J,N.palette.danger,w]),Fe=useMemo(()=>Ut({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${ls(se.paddingY)} ${ls(se.paddingX)}`,background:ye,border:oe,borderRadius:f?N.radius.full:N.radius.md,minHeight:se.minHeight,boxSizing:"border-box",width:"100%",cursor:i?"not-allowed":"text",opacity:i?.65:1,transition:"box-shadow .18s, border-color .16s"},...Vt(F),...Vt(S)),[N,se.minHeight,se.paddingX,se.paddingY,ye,oe,f,i,F,S]),Le=useMemo(()=>Ut({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:i?V[500]:a?N.palette.danger?.[800]??J.primary:J.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:i?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:a?N.palette.danger?.[700]??J.secondary:J.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?N.palette.danger?.[800]??J.primary:J.primary} !important`,boxShadow:`0 0 0 1000px ${ye} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?N.palette.danger?.[800]??J.primary:J.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...Vt(R)),[se.fontSize,i,V,J,a,N.palette.danger,le,ye,R]),X$1=useMemo(()=>Ut({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,marginLeft:-3},...Vt(K)),[a,N.palette.danger,J.secondary,K]),ee=useMemo(()=>Ut({display:"inline-flex",alignItems:"center",color:a?N.palette.danger?.[800]??J.secondary:J.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...Vt(W)),[a,N.palette.danger,J.secondary,i,W]),re=useMemo(()=>Ut({minHeight:16,fontSize:se.helperFont,color:a?N.palette.danger?.[700]??J.secondary:J.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Vt(M)),[se.helperFont,a,N.palette.danger,J.secondary,M]),Be=useMemo(()=>Ut({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...Vt($)),[$]),Pe=useRef(null),Qe=useCallback(ce=>{Pe.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),pt=useCallback(ce=>{let Te=ce.target.value;if(le){Y(Te);return}H&&Te.length>H||Ee(Te);},[le,H,Ee,Y]),[_e,Rn]=useState(false),lt=useCallback(()=>{i||Rn(ce=>!ce);},[i]),Tn=useCallback(()=>{i||(Ee(""),Pe.current?.focus());},[i,Ee]),It=useMemo(()=>{let ce=se.fontSize;if(typeof ce=="number")return ce;let Te=parseFloat(String(ce));return Number.isFinite(Te)?Te:16},[se.fontSize]),wn=useMemo(()=>T?jsx("span",{css:X$1,children:ti(T,It)}):null,[T,X$1,It]),Gn=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),Po=useMemo(()=>{let ce=[];if(ue&&y){let ct=_e?jsx(Eye,{strokeWidth:2.5,size:It}):jsx(EyeOff,{strokeWidth:2.5,size:It});ce.push(jsx("button",{type:"button",css:ee,onMouseDown:Yn=>Yn.preventDefault(),onClick:Yn=>{Yn.stopPropagation(),lt();},tabIndex:-1,"aria-label":_e?"Hide password":"Show password",disabled:i,children:ct},"pw-toggle"));}x&&ve&&ve.length>0&&!i&&ce.push(jsx("button",{type:"button",css:ee,onMouseDown:ct=>ct.preventDefault(),onClick:ct=>{ct.stopPropagation(),Tn();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:It})},"clear"));let Te=k?jsx("span",{css:ee,children:ti(k,It)},"user-end"):null,et=ce.length>0,Ae=!!Te;return !et&&!Ae?null:!et&&Ae?Te:et&&!Ae?ce.length===1?ce[0]:jsx("span",{css:Gn,children:ce}):jsxs("span",{css:Gn,children:[ce,Te]})},[ue,y,_e,It,ee,Gn,i,x,ve,k,lt,Tn]),Do=c!=null?`${z??G}-help`:void 0,Xn=z??G,Ue=useCallback(ce=>{if(i)return;ce.stopPropagation();let Te=Pe.current;if(!Te)return;let et=ce.target;if(!(Te.contains(et)||et.closest("button,[role='button']"))){if(document.activeElement===Te){ce.preventDefault();return}ce.preventDefault();}},[i]),mt=useCallback(ce=>{if(i)return;let Te=Pe.current;if(Te&&(O?.(ce),document.activeElement!==Te)){Te.focus({preventScroll:true});try{let et=Te.value?.length??0;Te.setSelectionRange?.(et,et);}catch{}}},[i,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Xn,className:"plainframe-ui-textfield-label",css:me,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:p!=="none",color:a?"danger":void 0}),Fe],onPointerDownCapture:Ue,onClick:mt,"aria-invalid":!!a||void 0,children:[wn,jsx("input",{ref:Qe,id:Xn,className:"plainframe-ui-textfield-input",css:Le,type:ue?_e?"text":"password":b==="number"?"text":b,inputMode:ie,pattern:be,value:ve,maxLength:le?void 0:H,onChange:le?ce=>Y(ce.target.value):pt,placeholder:s||"",disabled:i,onBlur:A,onFocus:I,onKeyDown:P,autoFocus:D,name:B,tabIndex:E,autoComplete:g,readOnly:v,required:L,"aria-invalid":!!a||void 0,"aria-describedby":Do}),Po]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:re,children:jsx("span",{id:Do,className:"plainframe-ui-textfield-helper-text",css:Be,children:c})})]})}));Zo.displayName="TextField";var Qo=de.createContext("ghost"),ht=de.createContext(false),ai=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:s=false,className:a,css:c,children:i,label:l,allItemsTabbable:u=false,...m},h){let f=j(),[T,k]=useState(false),y=useRef(null),x=typeof f.spacing.xs=="number"?`${f.spacing.xs}px`:String(f.spacing.xs),b=t==="outlined"?f.surface.panelBg:t==="subtle"?f.surface.subtleBg??f.neutral[50]:"transparent",d=s?void 0:css({background:b,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":x,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"}}),p=n==="sm",C=useMemo(()=>({isKeyboardNav:T,setIsKeyboardNav:k}),[T]),F=useMemo(()=>({allItemsTabbable:u}),[u]),R=useCallback(I=>Array.from(I.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(P=>{if(P.closest('[role="menu"]')!==I)return false;let D=window.getComputedStyle(P);return D.display!=="none"&&D.visibility!=="hidden"}),[]),w=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),k(false);},[]),M=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(M.current){M.current=false;return}let P=I.currentTarget,D=R(P);D.length>0&&(k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(B=>B.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(B=>B.removeAttribute("data-hovered")),D[0].setAttribute("data-highlighted",""),D[0].focus({preventScroll:true}));},[R]),K=useCallback(I=>{let P=I.currentTarget,D=R(P);if(D.length===0)return;if(I.key==="Tab"){M.current=true,P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),P.tabIndex=-1,requestAnimationFrame(()=>{P.tabIndex=0,M.current=false;});return}let B=P.querySelector("[data-highlighted]"),z=P.querySelector("[data-hovered]"),E=B||z,g=E?D.indexOf(E):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),g===-1&&(g=I.key==="ArrowDown"?-1:D.length);let v=I.key==="ArrowDown"?1:-1,L=(g+v+D.length)%D.length;D[L].setAttribute("data-highlighted",""),D[L].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),D[0].setAttribute("data-highlighted",""),D[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),D[D.length-1].setAttribute("data-highlighted",""),D[D.length-1].focus({preventScroll:true});return}if(I.key==="Escape"){I.preventDefault(),P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),P.blur();return}},[R]),W=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&w(P);},[w]),S=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&w(P);},[w]),A=useCallback(I=>{y.current=I,typeof h=="function"?h(I):h&&(h.current=I);},[h]);return jsx(eo.Provider,{value:C,children:jsx(to.Provider,{value:F,children:jsx(ht.Provider,{value:p,children:jsx(Qo.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:A,role:"menu","data-keyboard-nav":T?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",a||""].join(" ").trim(),css:[d,c],onFocus:$,onKeyDown:K,onPointerMove:W,onPointerDown:S,...m,children:i})]})})})})})});ai.displayName="Menu";var li=createContext(null),nr=()=>{let e=useContext(li);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function $u(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ro=(...e)=>t=>{for(let n of e)$u(n,t);},us=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,zu=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]);},er=(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}},Ou=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:s=true,children:a})=>{let[c,i]=useState(!!t),l=e??c,u=y=>{e===void 0&&i(y),n?.(y);},m=useRef(null),h=useRef(null),f=(y=120)=>{h.current!=null&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>u(false),y);},T=()=>{h.current!=null&&(window.clearTimeout(h.current),h.current=null);};zu(r&&l),useEffect(()=>{if(!s||!l||typeof document>"u")return;let y=x=>{if(x.key!=="Tab")return;let b=document.querySelector(".plainframe-ui-popover");if(!b)return;let d=Array.from(b.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(R=>{let w=window.getComputedStyle(R);return w.display!=="none"&&w.visibility!=="hidden"});if(d.length===0)return;let p=d[0],C=d[d.length-1],F=document.activeElement;x.shiftKey&&F===p?(x.preventDefault(),C.focus()):!x.shiftKey&&F===C&&(x.preventDefault(),p.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[s,l]);let k=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:m,scheduleClose:f,cancelClose:T}),[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:c,scheduleClose:i,cancelClose:l}=nr(),u=de.Children.only(t),m=u.props||{},h=ro(c,o,u.ref),f=a==="click"?{onClick:k=>{k.stopPropagation(),s(!r),m.onClick?.(k);}}:{onMouseEnter:k=>{l(),r||s(true),m.onMouseEnter?.(k);},onMouseLeave:k=>{i(),m.onMouseLeave?.(k);}},T={"aria-haspopup":"dialog","aria-expanded":r};if(e){let k=u.props?.css;return de.cloneElement(u,{...f,...T,ref:h,css:[k,n].filter(Boolean)})}return de.createElement("button",{ref:h,type:"button",css:[n],...f,...T,children:u})});ci.displayName="PopoverTrigger";var ui=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:s}=nr(),a=de.Children.only(o),c=ro(s,r,a.ref);if(e){let l=a.props?.css;return de.cloneElement(a,{ref:c,css:[l,n].filter(Boolean)})}let i=css({display:"inline-block",width:us(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:i,children:a})});ui.displayName="PopoverAnchor";function Wu(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:c,padding:i,paddingX:l,paddingY:u,radius:m="lg",css:h,...f},T)=>{let{open:k,setOpen:y,triggerOn:x,referenceRef:b,scheduleClose:d,cancelClose:p}=nr(),C=j(),F=Wu(e),{refs:R,x:w,y:M,strategy:$,context:K}=useFloating({open:k,onOpenChange:y,whileElementsMounted:autoUpdate,placement:F,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{b.current&&R.setReference(b.current);},[R,b]);let W=useDismiss(K,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(K,{role:"dialog"}),{getFloatingProps:A}=useInteractions([W,S]),[I]=K.placement.split("-"),P=I,D=`${P==="left"?"right":P==="right"?"left":"center"} ${P==="top"?"bottom":P==="bottom"?"top":"center"}`,B=8,z=P==="top"?{y:B}:P==="bottom"?{y:-B}:P==="left"?{x:B}:{x:-B},E={initial:{opacity:0,scale:.96,...z},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...z},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"}}},g=C.surface.panelBg,v=C.text.primary,L=`${C.componentHeights.border} solid ${C.surface.border}`,H=er(i,C.spacing),O=er(l,C.spacing),_=er(u,C.spacing),N={};H&&(N.padding=H),O&&(N.paddingInline=O),_&&(N.paddingBlock=_);let U=er(m,C.radius)??C.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:$,top:M??0,left:w??0,zIndex:1e3,transformOrigin:D,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:us(a)??"fit-content",height:us(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),V=r?css({}):css({background:g,color:v,border:L,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),J=x==="hover"?{onMouseEnter:p,onMouseLeave:()=>d()}:{},le=ro(R.setFloating,T),ue=jsx(motion.div,{className:"plainframe-ui-popover",...A({...f,ref:le,...J}),...E,css:[se,V,h],children:s});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:k?ue:null})})});di.displayName="PopoverContent";var Ku=()=>{let e=nr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var fs=de.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:s="md",label:a,className:c,css:i,trackCss:l,thumbCss:u,labelCss:m,...h},f){let T=j(),k=he(),y={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}},x={slideMs:250,pressMs:150,easing:"ease"},b=t!==void 0,[d,p]=useState(n),C=b?!!t:d,[F,R]=useState(false);useEffect(()=>{if(r)return;R(true);let O=setTimeout(()=>R(false),x.pressMs);return ()=>clearTimeout(O)},[C,r]);let w=["sm","md","lg"].includes(s)?s:"md",M=y[w],$=`${x.slideMs}ms ${x.easing}`,K=T.palette?.primary?.[600]??T.neutral[900],W=T.neutral[300],S=C?K:W,A=C?T.text.onColors.primary:"#ffffff",{trackW:I,trackH:P,thumb:D}=M,B=(P-D)/2,z=css({display:"inline-flex",alignItems:"center",gap:M.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:T.spacing.xs,borderRadius:T.radius.sm,outline:"none"}),E=css({position:"relative",width:I,height:P,backgroundColor:S,borderRadius:T.radius.xl,transition:`background-color ${$}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),g=css({position:"absolute",top:B,left:C?I-D-B:B,width:D,height:D,backgroundColor:A,borderRadius:T.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:F?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:T.typography.sizes.sm,fontWeight:500,color:r?T.text.muted:T.text.primary}),L=()=>{if(r)return;let O=!C;b||p(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:L,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,k({color:C?"primary":"neutral"}),i],...h,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[E,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[g,u]})}),a!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[v,m],children:a})]})}));var Yu=(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},rr=de.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:s,description:a,rounded:c=false,checkedIcon:i,color:l="primary",css:u,boxCss:m,checkCss:h,labelCss:f,descriptionCss:T,className:k,...y},x)=>{let b=j(),d=he(),p=typeof e=="boolean",[C,F]=useState(t),R=p?e:C,w=r==="sm"||r==="lg"?r:"md",M=useMemo(()=>Yu(b,w),[b,w]),{checkedBg:$,checkColor:K,borderCol:W,hoverBg:S,gapPx:A}=useMemo(()=>{let O=b.palette||{},_=b.neutral||{},N=b.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=_,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(U=O[l]||O.primary||_,G=l):(U=O.primary||_,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??b.palette.primary[600],V=N[G]??N.primary??b.text?.onColors?.primary??b.text.primary,J=typeof M.gap=="number"?M.gap+2:M.gap;return {checkedBg:se,checkColor:V,borderCol:b.surface.border,hoverBg:b.surface.panelHover,gapPx:J}},[M.gap,l,b]),I=useMemo(()=>css({display:"inline-flex",alignItems:s&&a?"flex-start":"center",gap:A,cursor:o?"not-allowed":"pointer",userSelect:"auto",position:"relative",width:"fit-content",borderRadius:b.radius.sm,padding:b.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:W,backgroundColor:S},"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)"}}),[W,$,a,o,A,S,s,b.radius.sm,b.spacing.xs]),P=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),D=useMemo(()=>css({width:M.box,height:M.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${M.borderWidth} solid ${W}`,outlineOffset:`-${M.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?b.radius.full:M.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"}),[M.box,M.borderRadius,M.borderWidth,W,c,b.radius.full]),B=useMemo(()=>({w:Math.round(M.box*M.iconRatioW),h:Math.round(M.box*M.iconRatioH)}),[M.box,M.iconRatioH,M.iconRatioW]),z=useMemo(()=>css({width:B.w,height:B.h,transition:"opacity .14s ease, transform .14s ease",color:K,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[K,B.h,B.w]),E=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),g=useMemo(()=>css({fontSize:M.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:b.text.primary}),[M.labelFont,b.text.primary]),v=useMemo(()=>css({fontSize:M.labelFont,lineHeight:1.25,color:b.text.secondary,fontWeight:400,marginTop:s&&a?b.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[M.labelFont,a,s,b.spacing.xs,b.text.secondary]),L=useCallback(()=>{o||(p?n?.(!R):F(O=>{let _=!O;return n?.(_),_}));},[o,p,R,n]),H=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},[o,L]);return jsxs("label",{ref:x,role:"checkbox","aria-checked":R,"aria-disabled":o||void 0,"data-state":R?"checked":"unchecked",className:["plainframe-ui-checkbox",k||""].join(" ").trim(),css:[I,d({color:R?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:H,children:[jsx("input",{type:"checkbox",checked:R,onChange:L,disabled:o,css:P,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[D,m],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,h],children:R&&(i||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:K,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",css:css({width:"100%",height:"100%",display:"block"}),"aria-hidden":"true",focusable:"false",children:jsx("polyline",{points:"20 6 9 17 4 12"})}))})}),(s||a)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:E,children:[s&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[g,f],children:s}),a&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[v,T],children:a})]})]})}));rr.displayName="Checkbox";var Qu=()=>useContext(cn),ed=()=>useContext(to),td=()=>useContext(lr),an=null,bi=(e,t=35)=>{an!==null&&window.clearTimeout(an),an=window.setTimeout(()=>{e(),an=null;},t);},so=()=>{an!==null&&(window.clearTimeout(an),an=null);},At=de.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:s,children:a,className:c,css:i,startIcon:l,endIcon:u,selected:m=false,active:h,meta:f,__index:T,__skipListReg:k,...y},x){let b=Qu(),d=td(),p=ir(),C=io(),F=ed(),R=j(),M=!!useContext(ht),$=y["data-subtrigger"]!==void 0,K=$&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,A=useContext(Qo),I=A==="subtle"?R.surface?.subtleHover??R.neutral[100]:R.surface?.subtleBg??R.neutral[100],P=useMemo(()=>css({width:"100%",borderRadius:R.radius.md,padding:`${R.spacing.sm} ${R.spacing.sm}`,paddingLeft:S>0?`calc(${R.spacing.md} + (${R.spacing.xl} * ${S}))`:R.spacing.md,minHeight:M?R.componentHeights.sm:R.componentHeights.md,display:"flex",alignItems:"center",gap:R.spacing.sm,fontWeight:500,fontSize:R.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?R.palette.danger[800]:R.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?R.palette.danger[50]:I},"&[data-highlighted]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-active]":t?{}:{background:n?R.palette.danger[50]:I},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?R.palette.danger[50]:I},"[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:R.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[R,M,S,t,n,I]),D=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"}}),[]),B=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:R.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:R.text.secondary}),[R.text.secondary,R.spacing.sm]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:R.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[R.palette.primary]),E=[];M&&E.push({minHeight:R.componentHeights.sm,paddingLeft:R.spacing.sm,paddingRight:R.spacing.xs,paddingTop:R.spacing.xs,paddingBottom:R.spacing.xs});let g=()=>{s?.(),r&&!$&&d?.closeAll();},v=(H,O)=>{let _=H.closest('[role="menu"]');if(!_)return;let N=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(J=>{if(J.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(J);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf(H),G=U>=0?U:0,se=O(N.length,G),V=N[se];V&&(document.querySelectorAll("[data-highlighted]").forEach(J=>{J.removeAttribute("data-highlighted");}),V.setAttribute("data-highlighted",""),V.focus(),b&&T!=null&&b.setActiveIndex(se));},L=t?-1:F?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":h?"":void 0,tabIndex:L,ref:H=>{if(b&&!k){let O=b.listRef.current;H&&(T!=null?O[T]=H:O.includes(H)||O.push(H));}typeof x=="function"?x(H):x&&"current"in x&&(x.current=H);},onMouseMove:H=>{if(H.currentTarget.hasAttribute("data-hovered"))return;let O=!!H.currentTarget.closest("[data-submenu-content]");!$&&p&&!O&&bi(p.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");}),H.currentTarget.setAttribute("data-hovered","");let _=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&b&&T!=null&&b.setActiveIndex(T),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)so();else {let N=!!H.currentTarget.closest("[data-submenu-content]");p&&!N&&bi(p.closeAllSubMenus);}H.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");})),H.currentTarget.setAttribute("data-hovered","");let _=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');!t&&b&&T!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),b.setActiveIndex(T)),!t&&!F?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{b&&b.setActiveIndex(null);},onKeyDown:H=>{if(t)return;let O=H.currentTarget;if(H.key==="Tab"&&b&&!F?.allItemsTabbable){H.preventDefault();return}if(H.key==="Tab"&&!b){let _=O.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let N=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=N>=0?N:0;});}C&&C.setIsKeyboardNav(false);return}if(H.key==="Enter"||H.key===" "||H.key==="ArrowRight"){$||H.key!=="ArrowRight"&&(H.preventDefault(),H.stopPropagation(),g());return}if(H.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){H.preventDefault(),H.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(V=>V.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(V=>V.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(H.key==="ArrowDown"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U+1)%N);return}if(H.key==="ArrowUp"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U-1+N)%N);return}if(H.key==="Home"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,()=>0);return}if(H.key==="End"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,N=>N-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[P,...E,i].flat()),...y,onClick:H=>{t||(H.currentTarget.removeAttribute("data-highlighted"),g());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:D,children:l}),a,(f!=null||K||m)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:B,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:R.typography.sizes.sm,color:R.text.secondary,whiteSpace:"nowrap"}),children:f}):null,K,m&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:z,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),yi=de.createContext(null),bs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,s]=useState(t??[]),a=e!==void 0,c=a?e:r,i=useRef(c);i.current=c;let l=useRef(n);l.current=n;let u=useCallback(h=>{let f=i.current,k=f.some(y=>Object.is(y,h))?f.filter(y=>!Object.is(y,h)):[...f,h];a||s(k),l.current?.(k);},[a]),m=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(yi.Provider,{value:m,children:o})},ao=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:s,__index:a,disabled:c=false,css:i,className:l,startIcon:u,endIcon:m,...h},f){let T=useContext(yi),k=!!T&&r!==void 0,y=!k&&t!==void 0,[x,b]=useState(()=>k?T.values.some(W=>Object.is(W,r)):!!n),d=k?T.values.some(W=>Object.is(W,r)):y?!!t:x,p=j(),F=!!useContext(ht),R=()=>{if(!c)if(k)T.toggle(r);else {let W=!d;y||b(W),o?.(W);}},w=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:F?-1:-3,borderRadius:p.radius.xs,transition:"background-color .12s ease"}),M=css({pointerEvents:"none"}),$=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),K=jsxs(Fragment,{children:[jsx("span",{ref:$,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:w,"aria-hidden":"true",children:jsx(rr,{size:"sm",checked:d,css:M})}),u]});return jsx(At,{...h,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:a,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:R,disabled:c,startIcon:K,endIcon:m,css:i,selected:false,children:s})});ao.displayName="MenuCheckboxItem";var xi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:s,disabled:a=false,css:c,switchSize:i="md",switchCss:l,startIcon:u,className:m,...h},f){let T=t!==void 0,[k,y]=useState(!!n),x=T?!!t:k,d=!!useContext(ht),p=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),F=()=>{if(a)return;let w=!x;T||y(w),o?.(w);},R=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(At,{...h,className:["plainframe-ui-menu-switch-item",m||""].join(" ").trim(),ref:f,__index:s,disabled:a,closeOnSelect:false,onSelect:F,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:R,children:u}),jsx("span",{"data-label":true,css:p,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(fs,{checked:x,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:i})})]})});xi.displayName="MenuSwitchItem";var vi=de.createContext(null),Ci=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,s]=useState(t),a=e??r,c=l=>{e!==void 0||s(l),n?.(l);},i=useMemo(()=>({value:a,onChange:c}),[a]);return jsx(vi.Provider,{value:i,children:o})};Ci.displayName="MenuRadioGroup";var nd=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:s,className:a,...c},i){let l=useContext(vi),u=l?.value===t,m=j(),h=css({width:m.spacing.md,display:"inline-flex",justifyContent:"center",alignItems:"center",marginLeft:-1}),f=css({width:7,height:7,borderRadius:"100%",backgroundColor:m.palette.primary[600],transform:u?"scale(1)":"scale(0.4)",opacity:u?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),T=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(At,{...c,className:["plainframe-ui-menu-radio-item",a||""].join(" ").trim(),ref:i,__index:o,role:"menuitemradio","aria-checked":u,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:s,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:h,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:T,children:n})]})}),ln=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:s,endIcon:a,wrap:c=false,color:i="primary",...l},u){let m=j(),f=!!useContext(ht),T=i==="primary"?m.text.primary:i==="secondary"?m.text.secondary:m.palette[i]?.[700]??m.text.primary,k=css({display:"flex",alignItems:"center",padding:f?`${m.spacing.sm} ${m.spacing.md}`:`${m.spacing.sm} ${m.spacing.md}`,fontSize:m.typography.sizes.sm,color:T,fontWeight:500,...t?{paddingLeft:`calc(${m.spacing.lg} * 2)`}:null,gap:m.spacing.xs}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),x=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:u,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:x,children:s}),jsx("span",{className:"plainframe-ui-menu-label-text",css:y,children:r}),a&&jsx("span",{className:"plainframe-ui-menu-label-end",css:b,children:a})]})});ln.displayName="MenuLabel";var od=({className:e,css:t,variant:n="full",...o})=>{let r=j(),s=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,a=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),i=css({height:1,background:r.surface.border,marginTop:s,marginBottom:s,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?a:n==="middle"?c:i;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var hs=ro,lo=0,cr=null,ur=null,bd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function hd(){if(!(typeof document>"u")){if(lo===0){let e=document.body;cr=e.style.overflow||"",ur=e.style.paddingRight||"";let t=bd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}lo+=1;}}function yd(){if(!(typeof document>"u")&&(lo>0&&(lo-=1),lo===0)){let e=document.body;cr!==null&&(e.style.overflow=cr),ur!==null&&(e.style.paddingRight=ur),cr=null,ur=null;}}var cn=createContext(null),dr=()=>{let e=useContext(cn);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},co=createContext(null),xd=()=>useContext(co),eo=createContext(null),io=()=>useContext(eo),Ti=createContext(null),ir=()=>useContext(Ti),wi=createContext(false),vd=()=>useContext(wi),to=createContext({allItemsTabbable:true}),lr=de.createContext(null),ys=()=>useContext(lr);function Cd(){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 Rd=()=>xd()?.activeIndex??null,Ei=0,Dn=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:s="md",children:a})=>{let[c,i]=useState(!!t),l=e??c,u=useCallback(A=>{e===void 0&&i(A),n?.(A);},[e,n]),m=useRef(`pfui-menu-${++Ei}`),h=useRef(null),f=useRef([]),T=useRef(null),[k,y]=useState(null),[x,b]=useState(false);useEffect(()=>{l||(y(null),f.current=[],b(false));},[l]);let d=useRef(null),p=useCallback((A,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let P=I??20;d.current=window.setTimeout(()=>u(A),P);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return hd(),()=>yd()},[l,r]);let F=ys(),[R]=useState(()=>F??Cd()),w=useRef(new Set),M=useMemo(()=>({registerSubMenu:A=>(w.current.add(A),()=>w.current.delete(A)),closeAllSubMenus:()=>{w.current.forEach(A=>A());}}),[]),$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:h,listRef:f,floatingRef:T,setActiveIndex:y,scheduleSubmenuHover:p,clearSubmenuHover:C,menuId:m.current}),[l,u,o,y,p,C]),K=useMemo(()=>({activeIndex:k,setActiveIndex:y}),[k,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:b}),[x]),S=s==="sm";return jsx(lr.Provider,{value:R,children:jsx(ht.Provider,{value:S,children:jsx(eo.Provider,{value:W,children:jsx(Ti.Provider,{value:M,children:jsx(co.Provider,{value:K,children:jsx(cn.Provider,{value:$,children:a})})})})})})};Dn.displayName="DropdownMenu";var Nn=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,listRef:m,setActiveIndex:h,scheduleSubmenuHover:f,clearSubmenuHover:T,floatingRef:k,menuId:y}=dr(),x=io(),b=ir(),d=!!e&&isValidElement(t),p=d?t:null,C=p&&p.props&&typeof p.props=="object"&&"onKeyDown"in p.props?p.props.onKeyDown:void 0,F=p&&p.props&&typeof p.props=="object"&&"onClick"in p.props?p.props.onClick:void 0,{onKeyDown:R,onClick:w,...M}=s,$=useMemo(()=>hs(a,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[a,d,t,u]),K=useCallback(()=>m.current.filter(Boolean),[m]),W=useCallback(D=>{let B=K();requestAnimationFrame(()=>B[D]?.focus());},[K]),S=useCallback(D=>{if(D.key==="Tab"&&c){D.preventDefault(),x?.setIsKeyboardNav(true);let B=k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=B.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])');z&&(document.querySelectorAll("[data-highlighted]").forEach(E=>E.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(D.key==="ArrowRight"&&c){let B=document.querySelector("[data-subtrigger][data-hovered]");if(B){D.preventDefault(),D.stopPropagation(),x?.setIsKeyboardNav(true),B.removeAttribute("data-hovered"),B.setAttribute("data-highlighted",""),B.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});B.dispatchEvent(z);});return}}if(D.key==="ArrowDown"||D.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){D.preventDefault(),i(true),requestAnimationFrame(()=>{let B=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=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=>{let g=E.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(E);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let E=D.key==="ArrowDown"?0:z.length-1;h(E),z[E]?.setAttribute("data-highlighted",""),z[E]?.focus();}}}),C?.(D),R?.(D);return}if(c){D.preventDefault();let B=document.querySelectorAll("[data-hovered]");for(let E of Array.from(B))if(E.closest("[data-submenu-content]")){let v=E.closest('[role="menu"]');if(v){v.setAttribute("data-keyboard-nav","");let L=Array.from(v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==v)return false;let _=window.getComputedStyle(O);return _.display!=="none"&&_.visibility!=="hidden"}),H=L.indexOf(E);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),E.removeAttribute("data-hovered"),H!==-1&&L.length>0){let O=D.key==="ArrowDown"?1:-1,_=(H+O+L.length)%L.length;L[_]?.setAttribute("data-highlighted",""),L[_]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(z){z.setAttribute("data-keyboard-nav",""),b?.closeAllSubMenus();let E=Array.from(z.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"]')!==z)return false;let v=window.getComputedStyle(g);return v.display!=="none"&&v.visibility!=="hidden"});if(E.length>0){let g=z.querySelector("[data-highlighted]"),v=z.querySelector("[data-hovered]"),L=-1;g?L=E.indexOf(g):v&&(L=E.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),v&&v.removeAttribute("data-hovered"),L===-1&&(L=D.key==="ArrowDown"?-1:E.length);let H=D.key==="ArrowDown"?1:-1,O=(L+H+E.length)%E.length;h(O),E[O]?.setAttribute("data-highlighted",""),E[O]?.focus();}}C?.(D),R?.(D);return}}if((D.key==="Enter"||D.key===" ")&&!c){D.preventDefault(),x?.setIsKeyboardNav(true),i(true),requestAnimationFrame(()=>{let B=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=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=>{let g=E.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(E);return v.display!=="none"&&v.visibility!=="hidden"});z.length>0&&(h(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),C?.(D),R?.(D);return}C?.(D),R?.(D);},[c,i,h,C,R,K,W,m,x,y,k,b]),A=useCallback(D=>{l==="click"&&((D.nativeEvent.composedPath?.()??[]).some(g=>{let v=g;if(!v||!("tagName"in v))return false;let L=String(v.tagName).toUpperCase();if(L==="INPUT"||L==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let H="getAttribute"in v?v.getAttribute("role"):null;return H==="textbox"||H==="combobox"})||(D.stopPropagation(),i(!c))),F?.(D),w?.(D);},[l,c,i,F,w]),I=l==="hover"?{onMouseEnter:()=>{T(),i(true);},onMouseLeave:()=>{f(false);}}:{},P=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&p){let D=p.props,B=D.css,z=typeof D.className=="string"?D.className:void 0,E=typeof D.tabIndex=="number"?D.tabIndex:0,g={ref:$,tabIndex:E,className:[z,o].filter(Boolean).join(" ")||void 0,css:[B,P,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:A,onKeyDown:S,...I,...M};return cloneElement(p,g)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),P,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:A,onKeyDown:S,...I,...M,children:t})});Nn.displayName="DropdownMenuTrigger";var pn=de.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:s=8,sameWidth:a=false,width:c,height:i,maxHeight:l,unstyled:u=false,closeOnBlur:m=false,allItemsTabbable:h=false,className:f,css:T,children:k,exitPlacement:y,animateOnBusClose:x=true,gap:b,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:p=false,returnFocus:C=false,...F},R)=>{let{open:w,setOpen:M,referenceRef:$,clearSubmenuHover:K,setActiveIndex:W,floatingRef:S,menuId:A}=dr(),I=j(),P=ys(),D=io();useEffect(()=>{if(!P)return;let X=P.registerCloser(()=>M(false));return ()=>{X&&X();}},[P,M]);let B=typeof o=="string"?parseFloat(o):o,z=typeof r=="string"?parseFloat(r):r,E=typeof s=="string"?parseFloat(s):s,g=`${t}${n==="center"?"":`-${n}`}`,v=useCallback(X=>({getBoundingClientRect:()=>{let ee=Math.round(X.x),re=Math.round(X.y);return {x:ee,y:re,left:ee,top:re,right:ee,bottom:re,width:0,height:0,toJSON:()=>({x:ee,y:re,left:ee,top:re,right:ee,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 X=e;return v({x:X.x,y:X.y})},[e,v]),{refs:H,x:O,y:_,strategy:N,context:U,update:G}=useFloating({open:w,onOpenChange:M,placement:g,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:B??0,crossAxis:z??0}),flip({padding:E??8}),shift({padding:E??8}),size({apply({rects:X,elements:ee}){let re=ee.floating;re.style.boxSizing="border-box",i!=null?re.style.height=typeof i=="number"?`${i}px`:String(i):re.style.removeProperty("height"),c!=null?re.style.width=typeof c=="number"?`${c}px`:String(c):a?re.style.width=`${Math.round(X.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?H.setReference(L):$.current&&H.setReference($.current);},[H,L,$]),useEffect(()=>{if(!w)return;let X=L||$.current,ee=H.floating.current;if(!(!X||!ee))return autoUpdate(X,ee,G)},[w,L,$,H,G]),useEffect(()=>{G();},[G,a,c,i,l]),useEffect(()=>{w&&!h&&W(0);},[w,h,W]),useEffect(()=>{if(!m||!w)return;let X=()=>{let ee=document.activeElement,re=$.current,Be=H.floating.current;ee&&(re?.contains(ee)||Be?.contains(ee)||M(false));};return document.addEventListener("focusin",X,true),()=>document.removeEventListener("focusin",X,true)},[m,w,M,$,H.floating]),useEffect(()=>{if(!w)return;let X=H.floating.current;if(!X||X.hasAttribute("data-pfui-portal-owner"))return;let ee=document.querySelector("[data-pfui-portal-owner]");if(!ee)return;let re=ee.getAttribute("data-pfui-portal-owner");re&&X.setAttribute("data-pfui-portal-owner",re);let Be=ee.getAttribute("data-pfui-mode");Be&&(X.setAttribute("data-pfui-mode",Be),X.classList.toggle("pf-light",Be==="light"),X.classList.toggle("pf-dark",Be==="dark"));let Pe=ee.getAttribute("data-pfui-primary");Pe&&X.setAttribute("data-pfui-primary",Pe);for(let Qe=0;Qe<ee.style.length;Qe++){let pt=ee.style.item(Qe);pt&&pt.startsWith("--pf-")&&X.style.setProperty(pt,ee.style.getPropertyValue(pt));}},[w,H.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:p?false:X=>{if(d?.length){let ee=X.target;for(let re of d)if(re.current?.contains(ee))return false}return true}}),V=useRole(U,{role:"menu"}),{getFloatingProps:J}=useInteractions([se,V]),le=useRef(false);useEffect(()=>{w?le.current=true:le.current&&$.current&&C&&(P?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[w,$,P,C]);let ue=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),pe=b===void 0?void 0:typeof b=="number"?b:I.spacing[b]??b,Me=u?void 0:css({boxSizing:"border-box",background:I.surface.panelBg,border:`${I.componentHeights.border} solid ${I.surface.border}`,borderRadius:I.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":ue,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:pe,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Ce=-1,ve=X=>{if(!X||typeof X!="object"||!isValidElement(X))return X;let re=X.type?.displayName;if(re==="DropdownMenu"||re==="DropdownMenuSub")return X;if(re==="MenuItem"||re==="MenuCheckboxItem"||re==="MenuRadioItem"||re==="MenuSwitchItem")return Ce+=1,cloneElement(X,{__index:Ce,key:X.key??Ce});if(re==="DropdownMenuTrigger"){let Pe=X.props.children;return cloneElement(X,{children:de.Children.map(Pe,ve)})}if(re==="DropdownMenuSubTrigger"){Ce+=1;let Pe=Ce;return cloneElement(X,{__index:Pe,key:X.key??Pe})}let Be=X.props.children;return Be==null?X:cloneElement(X,{children:de.Children.map(Be,ve)})},Ee=de.Children.map(k,ve),Z=U.placement.split("-")[0]||"bottom",ie=Z==="bottom"?"center top":Z==="top"?"center bottom":Z==="left"?"right center":"left center",be=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},Y=y??Z,ye=Y==="bottom"?{opacity:0,y:-8,scale:.96}:Y==="top"?{opacity:0,y:8,scale:.96}:Y==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},oe=!!P?.isBusClosingRef.current&&!x?{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"}},ae=css({position:N,top:_??0,left:O??0,zIndex:1e3,transformOrigin:ie}),me=useCallback(X=>{if(X.key==="Tab"){X.preventDefault();return}if(X.key==="ArrowDown"||X.key==="ArrowUp"){X.preventDefault(),D?.setIsKeyboardNav(true);let ee=X.currentTarget;ee.setAttribute("data-keyboard-nav","");let re=Array.from(ee.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(Be=>{if(Be.closest('[role="menu"]')!==ee)return false;let Pe=window.getComputedStyle(Be);return Pe.display!=="none"&&Pe.visibility!=="hidden"});if(re.length>0){let Be=ee.querySelector("[data-highlighted]"),Pe=ee.querySelector("[data-hovered]"),Qe=-1;Be?Qe=re.indexOf(Be):Pe&&(Qe=re.indexOf(Pe)),document.querySelectorAll("[data-highlighted]").forEach(Rn=>Rn.removeAttribute("data-highlighted")),Pe&&Pe.removeAttribute("data-hovered"),Qe===-1&&(Qe=X.key==="ArrowDown"?-1:re.length);let pt=X.key==="ArrowDown"?1:-1,_e=(Qe+pt+re.length)%re.length;W(_e),re[_e]?.setAttribute("data-highlighted",""),re[_e]?.focus();}}},[D,W]),Fe=useCallback(X=>{let ee=X.currentTarget;ee.removeAttribute("data-keyboard-nav"),ee.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]),Le=useCallback(X=>{X.removeAttribute("data-keyboard-nav"),X.querySelectorAll("[data-highlighted]").forEach(ee=>ee.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:w?jsx(to.Provider,{value:{allItemsTabbable:h},children:jsx(motion.div,{...J({...F,ref:hs(R,H.setFloating,X=>{S&&(S.current=X);})}),"data-menu-id":A,"data-keyboard-nav":D?.isKeyboardNav?"":void 0,className:f,css:[Me,ae,T],initial:be,animate:{opacity:1,x:0,y:0,scale:1},exit:ye,transition:oe,onPointerMove:X=>Le(X.currentTarget),onPointerDown:X=>Le(X.currentTarget),onKeyDown:me,onMouseMove:Fe,onMouseEnter:()=>{K(),P?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(X=>X.removeAttribute("data-hovered"));},children:Ee})}):null})})});pn.displayName="DropdownMenuContent";var Si=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:s})=>{let a=vd(),[c,i]=useState(!!t),l=e??c,u=useCallback(S=>{e===void 0&&i(S),n?.(S);},[e,n]),m=useRef(null),h=useRef(false),f=useCallback((S,A)=>{if(o!=="hover")return;window.clearTimeout(m.current??0),h.current=S;let I=A??20;m.current=window.setTimeout(()=>{h.current=false,u(S);},I);},[o,u]),T=useCallback(()=>{m.current&&(window.clearTimeout(m.current),m.current=null,h.current=false);},[]);useEffect(()=>()=>T(),[T]);let k=ir();useEffect(()=>{if(!k)return;let S=()=>{T(),u(false);};return k.registerSubMenu(S)},[k,u,T]);let y=useRef(`pfui-submenu-${++Ei}`),x=useRef(null),b=useRef([]),d=useRef(null),[p,C]=useState(null),[F,R]=useState(false);useEffect(()=>{l||(C(null),b.current=[],R(false));},[l]);let w=useContext(ht),M=r??w,$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:x,listRef:b,floatingRef:d,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:T,pendingOpenRef:h,menuId:y.current}),[l,u,o,C,f,T]),K=useMemo(()=>({activeIndex:p,setActiveIndex:C}),[p,C]),W=useMemo(()=>({isKeyboardNav:F,setIsKeyboardNav:R}),[F]);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:de.Children.map(s,S=>{if(!isValidElement(S))return S;let A=S.type;return A?.displayName==="DropdownMenuSubTrigger"||A?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(wi.Provider,{value:true,children:jsx(ht.Provider,{value:M,children:jsx(co.Provider,{value:K,children:jsx(eo.Provider,{value:W,children:jsx(cn.Provider,{value:$,children:s})})})})})};Si.displayName="DropdownMenuSub";var Ii=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...s},a)=>{let{open:c,setOpen:i,trigger:l,referenceRef:u,scheduleSubmenuHover:m,clearSubmenuHover:h,pendingOpenRef:f,menuId:T}=dr(),k=io(),y=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>i(false));},[i]),x=!!e&&isValidElement(t),b=x?t:null,d=b?.props,p=d?.onKeyDown,C=d?.onClick,{onKeyDown:F,onClick:R,...w}=s,M=useMemo(()=>hs(a,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,y),[a,x,t,u,y]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,K=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let A=S.currentTarget,I=P=>{k?.setIsKeyboardNav(true);let D=A.closest("[data-menu-id]");if(!D)return;D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let B=Array.from(D.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==D)return false;let L=window.getComputedStyle(v);return L.display!=="none"&&L.visibility!=="hidden"});if(!B.length)return;let z=B.indexOf(A),E=z>=0?z:0,g=P==="next"?(E+1)%B.length:(E-1+B.length)%B.length;B[g]?.setAttribute("data-highlighted",""),B[g]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&i(false),I("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),k?.setIsKeyboardNav(true);let P=S.currentTarget;i(true),requestAnimationFrame(()=>{let D=T?document.querySelector(`[data-menu-id="${T}"]`):document.querySelector("[data-submenu-content]");if(D){D.setAttribute("data-keyboard-nav",""),P.removeAttribute("data-highlighted"),P.removeAttribute("data-hovered");let B=D.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])');B&&(B.setAttribute("data-highlighted",""),B.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&i(false);let P=A.closest("[data-menu-id]");P&&P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),A.setAttribute("data-highlighted",""),A.focus(),k&&k.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),p?.(S);return}p?.(S),F?.(S);},[c,i,p,F,u,k,T]),W=l==="hover"?{onMouseEnter:S=>{let A=S.currentTarget;so(),h(),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),A.setAttribute("data-hovered",""),A.focus({preventScroll:true});let I=A.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),k&&k.setIsKeyboardNav(false),c||m(true,90);},onMouseMove:S=>{let A=S.currentTarget;so(),A.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),A.setAttribute("data-hovered","")),!c&&!f?.current&&m(true,90);},onMouseLeave:()=>{m(false,60);}}:{onClick:S=>{S.stopPropagation(),i(!c),C?.(S),R?.(S);}};if(x&&b){let S=d?.css,A=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,P={ref:M,tabIndex:I,className:[A,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:K,onFocus:D=>{if(D.target.hasAttribute("data-highlighted")){let B=D.target.closest("[data-menu-id]");B&&!B.hasAttribute("data-keyboard-nav")&&(B.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(D);},...W,...w};return cloneElement(b,P)}return jsx("div",{ref:M,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:K,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let A=S.currentTarget.closest("[data-menu-id]");A&&!A.hasAttribute("data-keyboard-nav")&&(A.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}},...W,...w,children:t})});Ii.displayName="DropdownMenuSubTrigger";var ki=de.forwardRef((e,t)=>{let n=ys(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:s}=dr(),a=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(pn,{ref:t,side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:a,"data-submenu-content":"",anchor:o.current,onMouseEnter:c=>{r(),n?.clearAllHover(),so(),e.onMouseEnter?.(c);},onMouseLeave:c=>{s(false,60),e.onMouseLeave?.(c);}})});ki.displayName="DropdownMenuSubContent";var pr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Ed=css({display:"inline"}),Ai=css({display:"inline",fontWeight:700}),Sd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Id=css({display:"flex",alignItems:"center",gap:4}),kd=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"}),Md=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Ad=()=>{},Fd=e=>e,Pd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Dd=e=>{e.preventDefault(),e.stopPropagation();},Nd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Hd=e=>{e.preventDefault(),e.stopPropagation();},Pi=de.memo(({onCapture:e})=>{let t=useContext(cn),n=useContext(co),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Pi.displayName="CtxCapture";var xs=de.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:s,paint:a,cls:c,closeOnSelect:i,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:m,descriptionColor:h})=>{let f=o(),T=useMemo(()=>{let x=String(e.title??e.value);return s?x:a(x)},[a,e.title,e.value,s]),k=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:kd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Fi,children:T}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Md,{color:h}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Fi,children:T}),[T,e.description,h]),y=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let x=f.some(b=>Object.is(b,e.value));return s?jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,children:s(e,x)},e.value):jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:m,startIcon:e.startIcon,endIcon:e.endIcon,children:k},e.value)}return s?jsx(At,{__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,selected:r,children:s(e,r)},e.value):jsx(At,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:i,onMouseDown:m,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 Di=de.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:s,focusRingMode:a,css:c,inputCss:i,containerCss:l,label:u,helperText:m,variant:h,startIcon:f,endIcon:T,size:k,disabled:y=false,error:x=false,showClear:b=false,open:d,onOpenChange:p,openOnFocus:C=false,openOnType:F=true,openOnClick:R=true,closeOnSelect:w=true,closeOnBlur:M=true,blurOnSelect:$=false,freeSolo:K=false,customValueLabel:W=false,maxHeight:S,maxItems:A,noResultsText:I="No Items Found",highlightTypedValue:P,typedValueHighlightCss:D,showNoResults:B=true,noResultsLabelCss:z,loadingLabelCss:E,loadItems:g,loading:v,loadingText:L="Loading\u2026",debounceMs:H=200,multiple:O=false,selectedValues:_,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:V,textFieldWrapperCss:J,textFieldInputCss:le,textFieldLabelCss:ue,textFieldHelperRowCss:pe,textFieldHelperTextCss:Me,textFieldStartIconCss:Ce,textFieldEndIconCss:ve,menuContentCss:Ee})=>{let Z=j().text.secondary,[ie,be]=useState(""),Y=typeof d=="boolean",[ye,Q]=useState(false),oe=Y?d:ye,ae=useRef(null),me=useRef(null),Fe=useRef(null),Le=useRef(null),X=useRef(false),ee=useRef(null),re=useRef(false),Be=useRef(0),Pe=useMemo(()=>[me],[]),[Qe,pt]=useState(N??[]),_e=_??Qe,Rn=useRef(_e);Rn.current=_e;let[lt,Tn]=useState(null),It=useRef(lt);It.current=lt;let wn=useCallback(()=>Rn.current,[]),[Gn,Po]=useState([]),[Do,Xn]=useState(false),Ue=typeof g=="function",mt=Ue?Gn:e,ce=useRef(mt);ce.current=mt;let Te=!!v||Do&&Ue,et=useRef(p);useEffect(()=>{et.current=p;},[p]);let Ae=useCallback(q=>{Y||Q(q),et.current?.(q);},[Y]),ct=useRef(null);useEffect(()=>{if(!Ue)return;ct.current&&window.clearTimeout(ct.current);let q=ie;return ct.current=window.setTimeout(async()=>{Xn(true);try{let ne=await g(q)||[];Po(Array.isArray(ne)?ne:[]);}catch{Po([]);}finally{Xn(false);}},Math.max(0,H)),()=>{ct.current&&window.clearTimeout(ct.current);}},[ie,Ue,g,H]);let Yn=useMemo(()=>{let q=pr(ie);return q?mt.some(ne=>pr(ne.title??ne.value)===q):false},[mt,ie]),ia=K&&!!W&&ie.trim().length>0&&!Yn,ac=q=>{if(typeof W=="object"){let ne=Object.prototype.hasOwnProperty.call(W,"prefix"),xe=Object.prototype.hasOwnProperty.call(W,"suffix");if(ne||xe){let Se=ne?W.prefix??"":"",fe=xe?W.suffix??"":"";return `${Se}${q}${fe}`}return `Add "${q}"`}return `Add "${q}"`},Br=useMemo(()=>{if(Ue)return mt;let q=pr(ie);if(!q)return mt;let ne=[],xe=[];for(let Se of mt){let fe=pr(Se.title??Se.value);fe.split(" ").some(qe=>qe.startsWith(q))?ne.push(Se):fe.includes(q)&&xe.push(Se);}return ne.length>0?ne:xe},[mt,ie,Ue]),la=useMemo(()=>{if(ia){let q=ie.trim();return [...Br,{value:q,title:ac(q),__pfui_free__:true}]}return Br},[Br,ia,ie]),zt=useMemo(()=>{let q=[],ne=new Map;for(let rt of la){let qe=rt.group??"__ungrouped__";ne.has(qe)||(ne.set(qe,[]),q.push(qe)),ne.get(qe).push(rt);}let Se=typeof A=="number"?Math.max(0,A):1/0,fe=[];for(let rt of q){if(Se<=0)break;let en=ne.get(rt).slice(0,Se);en.length>0&&(fe.push({label:rt==="__ungrouped__"?void 0:rt,items:en}),Se-=en.length);}return fe},[la,A]),En=useMemo(()=>zt.reduce((q,ne)=>(q.push(...ne.items),q),[]),[zt]),No=En.length>0,$r=!No&&!!B&&!Te&&ie.trim().length>0,Sn=Te||No||$r,Ho=Sn||Ue;useEffect(()=>{!Ue&&oe&&!Sn&&(re.current=true,Ae(false),setTimeout(()=>{re.current=false;},150));},[Ue,oe,Sn,Ae]);let zr=useRef(null),Or=useRef(false);useEffect(()=>{if(K&&!O){if(Or.current){Or.current=false;return}let q=ie.trim();if(zr.current===q)return;zr.current=q,t?.({value:q,title:q});}},[ie,K,O,t]);let Wr=useCallback(q=>{let ne=ce.current,xe=new Map(ne.map(fe=>[fe.value,fe])),Se=q.map(fe=>xe.get(fe)??{value:fe,title:fe});U?.(Se);},[U]),Lo=useCallback(q=>{let ne=q.map(String);_||pt(ne),Wr(ne);},[_,Wr]),ca=useCallback(q=>{let xe=_e.includes(q)?_e.filter(Se=>Se!==q):[..._e,q];Lo(xe);},[_e,Lo]),Bo=useCallback(q=>{let ne=ce.current.find(xe=>xe.value===q)??{value:q,title:q};ne.disabled||(Or.current=true,zr.current=(ne.title??ne.value).trim(),Tn(ne),be(ne.title??ne.value),t?.(ne),Y||(w?(X.current=false,re.current=true,Q(false),et.current?.(false),setTimeout(()=>{re.current=false;},150)):X.current=true),!w&&Fe.current?.setActiveIndex&&Fe.current.setActiveIndex(null),$?(X.current=false,setTimeout(()=>{Le.current&&ae.current?(Le.current.tabIndex=0,Le.current.focus(),Le.current.blur(),Le.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,Y,w,$]),ic=useCallback(q=>{if(y)return;be(q);let ne=!q.trim();O||(ne?(Tn(null),t?.(null)):K&&Tn(null)),!Y&&!ne&&F&&!oe&&Ae(true);},[O,Y,F,oe,Ae,y,K,t]),tt=Pd,ua=Ad,lc=Fd,da=useMemo(()=>D?[Ai,D]:Ai,[D]),cc=useCallback(q=>{let ne=ie.trim();if(!ne||ne.length<1)return q;let xe=ne.toLowerCase(),fe=q.toLowerCase().indexOf(xe);return fe<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Ed,children:[q.slice(0,fe),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:da,children:q.slice(fe,fe+ne.length)}),q.slice(fe+ne.length)]})},[ie,da]),$o=P?cc:lc,uc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Dd,Oo=Nd,dc=useCallback(q=>{Fe.current=q;},[]),pa=useCallback(q=>{let ne=Fe.current;if(!ne)return;let xe=En.length;if(xe===0)return;let Se=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),fe=-1;if(Se){let qe=Se.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),en=Se.querySelector("[data-active]")||Se.querySelector("[data-hovered]");en&&(fe=Array.from(qe).indexOf(en));}fe<0&&typeof ne.activeIndex=="number"&&(fe=ne.activeIndex);let rt=fe<0?q===1?0:xe-1:(fe+q+xe)%xe;ne.setActiveIndex?.(rt),requestAnimationFrame(()=>{let qe=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!qe)return;qe.setAttribute("data-keyboard-nav",""),qe.querySelectorAll("[data-active]").forEach(_r=>_r.removeAttribute("data-active")),qe.querySelectorAll("[data-hovered]").forEach(_r=>_r.removeAttribute("data-hovered"));let Kr=qe.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[rt];Kr&&(Kr.setAttribute("data-active",""),Kr.scrollIntoView?.({block:"nearest"}));});},[En.length]),pc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(y||!Sn&&!Ue)return;q.preventDefault(),!oe&&!Y&&Ae(true),pa(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(y)return;let ne=Fe.current&&typeof Fe.current.activeIndex=="number"?Fe.current.activeIndex:-1,xe=ne>=0&&ne<En.length?En[ne]:null;if(oe&&xe&&ne>=0){q.preventDefault(),q.stopPropagation(),O?(ca(xe.value),w||requestAnimationFrame(()=>ae.current?.focus())):Bo(xe.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),oe&&!Y&&(re.current=true,Ae(false),q.target.focus(),setTimeout(()=>{re.current=false;},150))):q.key==="Tab"&&oe&&!Y&&Ae(false);},[Sn,Ue,oe,Y,En,O,w,pa,ca,Bo,Ae,y]),mc=useCallback(()=>{y||re.current||C&&Ho&&(Be.current=Date.now(),Y||Ae(true));},[Y,C,Ho,Ae,y]),fc=useCallback(()=>{if(X.current){X.current=false;return}M&&Ae(false),!K&&!O&&(lt?be(lt.title??lt.value):ie.trim()&&be(""));},[M,K,O,lt,ie,Ae]),ma=useCallback(()=>{let q=[],ne=0;return zt.forEach((xe,Se)=>{xe.label&&q.push(jsx(ln,{className:tt("group-label"),children:xe.label},`g-${Se}`)),xe.items.forEach(fe=>{q.push(jsx(xs,{item:fe,absIndex:ne,multiple:true,getCurrentMulti:wn,isSelected:false,renderItem:s,paint:$o,cls:tt,closeOnSelect:false,pickSingle:ua,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),ne+=1;});}),jsx(bs,{values:_e,onValuesChange:Lo,children:q},"multi-group")},[zt,tt,wn,s,$o,_e,Lo,ua,Oo,zo,Z]),fa=useCallback(()=>{let q=[],ne=0;return zt.forEach((xe,Se)=>{xe.label&&q.push(jsx(ln,{className:tt("group-label"),children:xe.label},`g-${Se}`)),xe.items.forEach(fe=>{let rt=lt?.value===fe.value;q.push(jsx(xs,{item:fe,absIndex:ne,multiple:false,getCurrentMulti:wn,isSelected:rt,renderItem:s,paint:$o,cls:tt,closeOnSelect:w,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),ne+=1;});}),q},[zt,tt,lt,wn,s,$o,w,Bo,Oo,zo,Z]),gc=useMemo(()=>Te?jsx(ln,{css:E,className:tt("label-loading"),children:L},"loading"):$r?jsx(ln,{css:z,className:tt("label-empty"),children:I},"empty"):zt.length===0?null:O?ma():fa(),[Te,$r,zt.length,tt,L,I,O,ma,fa]),Qt=oe?false:y||!Ue&&!No&&!B,ga=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(Qt||y)&&(Y||(oe?(re.current=true,Ae(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{re.current=false;},150)):(Ae(true),queueMicrotask(()=>ae.current?.focus()))));},[oe,No,Ue,Ae,Qt,y,Y]),ba=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:oe?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:Qt?"not-allowed":"pointer",userSelect:"none",opacity:Qt?.5:1}),[oe,Qt]),Wo=useMemo(()=>se?jsx("span",{ref:ee,role:"button",tabIndex:-1,css:[ba,V],"aria-disabled":Qt||void 0,onMouseDown:Hd,onClick:ga,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ba,V,Qt,ga,G]),bc=useMemo(()=>T&&Wo?jsxs("span",{css:Id,children:[T,Wo]}):T??Wo,[T,Wo]),hc=useCallback(q=>{if(!(ee.current&&ee.current.contains(q.target)||re.current||y||Date.now()-Be.current<300)){if(oe){!ie.trim()&&!Y&&(re.current=true,Ae(false),setTimeout(()=>{re.current=false;},150));return}R&&Ho&&(!Y||R)&&Ae(true);}},[oe,ie,R,Ho,Ae,y,Y]);return jsx("div",{ref:me,className:tt(""),css:[uc,l,c],children:jsxs(Dn,{open:y?false:oe,onOpenChange:y?void 0:Ae,children:[jsx(Pi,{onCapture:dc}),jsx(Nn,{asChild:true,children:jsx("span",{className:tt("anchor"),css:Sd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Zo,{ref:ae,className:tt("input"),focusRingMode:a,value:ie,onChange:ic,onKeyDown:pc,onFocus:mc,onBlur:fc,onSurfaceClick:hc,placeholder:r,label:u,helperText:m,variant:h,startIcon:f,endIcon:bc,size:k,width:n,fullWidth:o,disabled:y,error:x,showClear:b,css:i,wrapperCss:J,inputCss:le,labelCss:ue,helperRowCss:pe,helperTextCss:Me,startIconCss:Ce,endIconCss:ve}),jsx("span",{ref:Le,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}}),Sn&&jsx(pn,{className:tt("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ee,ignoreOutsidePressRefs:Pe,disableOutsidePressDismiss:Y,returnFocus:!$,children:gc})]})})});Di.displayName="Autocomplete";var Od=["sm","md","lg"],Wd=(e,t)=>typeof e=="number"?e:Od.includes(e)?t.componentHeights[e]:t.componentHeights.md,Kd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},_d=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},jd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Ni=de.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:s,css:a,children:c,...i},l)=>{let u=j(),[m,h]=useState(!!e);useEffect(()=>{h(!!e);},[e]);let f=Wd(n,u),T=typeof f=="number"?f:Number.parseFloat(String(f))||0,k=T?Math.round(T*(T<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=Kd(u,o),b=_d(u,o),d=jd(c,t),p=css({width:f,height:f,borderRadius:y,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:m?"transparent":x,color:m?"inherit":b,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),F=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:[p,a],role:m?void 0:"img","aria-label":m?void 0:t,...i,children:m&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>h(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:F,children:d})})}));Ni.displayName="Avatar";var Hi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:s=true,bgColor:a,extraLabelCss:c,outlineThickness:i=4,className:l})=>{let u=j(),m=he(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let R=(u.componentHeights&&u.componentHeights[n])??(u.spacing&&u.spacing[n]);return Hi(R??n)}return "32px"})(),T=Children.toArray(e).filter(Boolean),k=typeof t=="number"&&t>=0,y=k&&T.length>t?T.slice(0,t):T,x=k&&T.length>t?T.length-t:0,b=a==="panel"?u.surface.panelBg:a==="subtle"?u.surface.subtleBg:a??u.surface.appBg,d=Hi(i)??"4px",p=css({display:"flex",alignItems:"center"}),C=R=>css({marginLeft:R===0?0:o,zIndex:y.length-R,boxShadow:`0 0 0 ${d} ${b}`,backgroundColor:b,borderRadius:s?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),F=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:[p,r,m()],children:[y.map((R,w)=>{if(!isValidElement(R))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(w),children:jsx("span",{css:F,children:R})},w);let M=R,$=M.props?.css,K=$==null?F:[F,$],W=cloneElement(M,{size:n,rounded:s,css:K,style:{...M.props?.style,width:"100%",height:"100%",objectFit:M.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(w),children:W},w)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${x} more`,children:["+",x]})]})};var $i=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=(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"}},Jd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",Zd=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",Qd=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",ep=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),tp=de.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:s="dot",max:a=99,showZero:c=false,visible:i=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:m,animate:h=true,size:f,outline:T=false,outlineColor:k,className:y,badgeClassName:x,css:b,badgeCss:d,offsetX:p,offsetY:C})=>{let F=j(),R=s==="dot",w=f??(R?8:17),M=r??(R?0:10),{scale:$,onKey:K}=Yd(F,t),W=Jd($),S=F.text?.onColors||{},A=Zd(F,S,K,n),I=Qd(e,a,s),P=ep(i,s,e,c),D=css({position:"relative",display:"inline-block"}),B=u==="circular"?R?"12.5%":"5%":R?"5%":"2.5%",z=$i(p??B),E=$i(C??B),g=l.vertical||"top",v=l.horizontal||"right",L={},H="0",O="0";g==="center"?(L.top="50%",O="-50%"):g==="top"?(L.top=E,O="-45%"):(L.bottom=E,O="45%"),v==="center"?(L.left="50%",H="-50%"):v==="right"?(L.right=z,H="45%"):(L.left=z,H="-45%");let _=P?1:.8,N=css({minWidth:R?w:w/2,height:w,background:W,color:A,fontSize:typeof M=="number"?`${M}px`:M,fontWeight:o,borderRadius:999,padding:R?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",...T?{boxShadow:`0 0 0 2px ${k??F.surface?.appBg}`}:{},opacity:P?1:0,transform:`translate(${H}, ${O}) scale(${P?_:.5})`,...h?{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",y||""].join(" ").trim(),css:[D,b],children:[m,jsx("span",{"aria-hidden":!P,className:["plainframe-ui-badge",x||""].join(" ").trim(),css:[N,d],children:I})]})});var Ss=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:s=1e3,css:a,contentCss:c,overlayCss:i,children:l,transitionDuration:u=300,keepMounted:m=true,className:h,contentClassName:f,lockScroll:T=true,...k})=>{let y=j(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[b,d]=useState(e),[p,C]=useState(e),F=useRef(null),R=useRef(null),w=useRef(null);useEffect(()=>(F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null),e?(d(true),R.current=requestAnimationFrame(()=>{C(true),R.current=null;})):(C(false),F.current=setTimeout(()=>{d(false),F.current=null;},u)),()=>{F.current&&(clearTimeout(F.current),F.current=null),R.current!=null&&(cancelAnimationFrame(R.current),R.current=null);}),[e,u]),useEffect(()=>{if(!T||!e)return;let A=document.body,I=A.style.overflow,P=A.style.paddingRight,D=window.innerWidth-document.documentElement.clientWidth,B=parseFloat(getComputedStyle(A).paddingRight||"0");return A.style.overflow="hidden",D>0&&(A.style.paddingRight=`${B+D}px`),()=>{A.style.overflow=I,A.style.paddingRight=P;}},[e,T]),useEffect(()=>{if(!p||!t)return;let A=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)},[p,t]);let M=A=>{if(!p||!t||!w.current)return;let I=A.target;I&&!w.current.contains(I)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!m&&!b)return null;let K=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:s,display:"grid",placeItems:"center",pointerEvents:p?"auto":"none",visibility:b?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:x,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:p?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:p?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:p?"auto":"none"});return jsxs("div",{"aria-hidden":!b||void 0,className:["plainframe-ui-backdrop",h||""].join(" ").trim(),css:[K,a],onPointerDown:M,...k,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[W,i],role:"presentation"}),jsx("div",{ref:w,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[S,c],children:l})]})};var br=()=>null;Object.defineProperty(br,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function ap(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 ip=de.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:s,linkCrumbCss:a,separatorCss:c,hover:i=true,className:l,...u})=>{let m=j(),h=he(),f=de.useMemo(()=>de.Children.toArray(e).flatMap(d=>{if(!de.isValidElement(d))return [];let{type:p,props:C}=ap(d);if(!(p===br||typeof p=="function"&&"displayName"in p&&p.displayName===br.displayName))return [];let R=C;return [{href:R.href,disabled:R.disabled,node:R.children,className:R.className,css:R.css,onClick:R.onClick,startIcon:R.startIcon,endIcon:R.endIcon}]}),[e]),T=de.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:m.typography.sizes.sm,fontWeight:500,gap:m.spacing.xs,cursor:"default"}),[m]),k=de.useMemo(()=>css({margin:"0 0.15rem",color:m.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[m]),y=de.useCallback((d,p,C)=>{let F=d?m.text.primary:m.text.secondary,R=i&&p&&!C;return css({display:"inline-flex",alignItems:"center",gap:m.spacing.xs,color:F,cursor:p&&!C?"pointer":"default",textDecoration:"none",borderRadius:m.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":R?{textDecoration:"underline",color:m.text.primary}:{textDecoration:"none"}})},[m,i]),x=de.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),b=de.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[T,n],...u,children:f.map((d,p)=>{let C=p===f.length-1,F=!!d.href&&!d.disabled&&!C,R=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",F?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),w=[y(C,F,d.disabled),o,C?r:s,F?a:void 0,h(),d.css],M=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:x,children:d.startIcon}),jsx("span",{className:"plainframe-ui-breadcrumb-label",css:b,children:d.node}),d.endIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-end",css:x,children:d.endIcon})]});return jsxs(de.Fragment,{children:[p!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[k,c],children:t}),F?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:R,css:w,children:M}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:R,css:w,children:M})]},p)})})});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})},ks=e=>typeof e=="number"?`${e}px`:e,Ki=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Ki(n)&&(t=true));}),t};function dp(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 pp(e,t){let n=e.neutral,o=e.text,r=e.palette,s=r.primary||n,a=r.danger||r.error||s,c=e.text.onColors||{},i=c.primary??o.onColors.primary,l=c.danger??i,u=(m,h,f)=>m&&m[h]||f;if(t==="primary"){let m=s,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,fg:i,hoverBg:f,border:"none"}}if(t==="destructive"){let m=a,h=u(m,600,n[900])||u(m,500,n[900]),f=u(m,500,n[800])||u(m,600,n[800]);return {bg:h,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 _i=de.memo(de.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:s=false,disabled:a=false,loading:c=false,loadingIndicator:i,loadingPosition:l="center",children:u,className:m,hoverEffect:h=true,icon:f,onClick:T,css:k,...y},x)=>{let b=j(),d=he(),p=useMemo(()=>dp(b,t),[b,t]),C=useMemo(()=>pp(b,e),[b,e]),F=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Ki(u)&&de.Children.count(u)===1,[f,n,o,u]),R=p.iconSize,w=useMemo(()=>Is(n,R),[n,R]),M=useMemo(()=>Is(o,R),[o,R]),$=useMemo(()=>i??jsx(Qn,{color:C.fg,variant:"circular",size:14,thickness:5}),[i,C]),K=useMemo(()=>F?"center":l??"center",[F,l]),W=!!c&&K==="center",S=!!c&&K==="start",A=!!c&&K==="end",I=a||c,P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:s?"100%":"auto",minHeight:p.minHeight,lineHeight:1,fontWeight:600,cursor:I?"not-allowed":"pointer",opacity:I?.5:1,userSelect:"none",position:"relative",borderRadius:r?b.radius.full:p.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[s,p,r,b,I]),D=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),B=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":h&&!I?{":hover::before":{opacity:1}}:{}}),[C,h,I]),z=useMemo(()=>css(F&&!s?{width:"100%",height:"100%",maxWidth:p.minHeight,minWidth:p.minHeight,maxHeight:p.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:ks(p.iconSize)}:{fontSize:ks(p.fontSize),padding:n||o?`${p.paddingY} ${p.paddingXIcon}`:`${p.paddingY} ${p.paddingX}`}),[F,s,p,n,o]),E=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:ks(b.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[b,W]),g=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),v=useMemo(()=>typeof p.iconSize=="number"?p.iconSize:Math.max(12,Math.round(parseFloat(String(p.iconSize))||16)),[p.iconSize]),L=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),H=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),O=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]),_=useMemo(()=>()=>{if(F)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:L,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!S),children:G?w||n:null}),jsx("span",{css:H(!!S),children:$})]})},[F,n,S,L,H,w,c,$]),N=useMemo(()=>()=>{if(F)return null;let G=!!o;return !G&&!A?null:jsxs("span",{css:L,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!A),children:G?M||o:null}),jsx("span",{css:H(!!A),children:$})]})},[F,o,A,L,H,M,c,$]),U=!(a||c);return jsxs("button",{ref:x,type:"type"in y&&y.type?y.type:"button","data-variant":e,className:["plainframe-ui-button",m||""].join(" ").trim(),css:[P,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),D,B,z,k],onClick:U?T:void 0,disabled:a||void 0,tabIndex:c?-1:void 0,"aria-disabled":a||void 0,"aria-busy":c||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:E,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:g,children:F?c?$:Is(u,p.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));_i.displayName="Button";var vr=e=>isValidElement(e),mp=e=>{let t=e.type;return t.displayName??t.name},Ps=(e,t)=>mp(e)===t,Ui=e=>Ps(e,"ButtonGroup"),qi=e=>Ps(e,"DropdownMenu"),As=e=>Ps(e,"DropdownMenuTrigger"),Bn=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,fp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,gp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),Fs=(e,t)=>{if(!vr(e))return null;if(Ui(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?Fs(t?n[0]:n[n.length-1],t):null}if(qi(e)){let o=Children.toArray(e.props.children).filter(isValidElement).find(As);return o?Fs(o,t):null}if(As(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=Fs(e,t==="left"),o=n&&n.props&&typeof n.props=="object"?n.props.variant:void 0;return gp(o)},Gi=de.memo(de.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:s=false,size:a="md",rounded:c=false,gap:i,width:l,className:u,role:m="group",css:h,__clipLeft:f,__clipRight:T,...k},y){let x=j(),b=a==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:b,p=o==="vertical",C=fp(x.componentHeights.border,1),F=x.surface.border,R=n&&!!f,w=n&&!!T,M=css({display:"flex",flexDirection:p?"column":"row",width:r?"100%":l!=null?Bn(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Bn(i??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(vr).length,S=0,A=false,I=[];for(let P of $){if(!vr(P)){I.push(P);continue}let D=S===0,B=S===W-1,z=P.props??{},E=z.disabled??s,g=z.size??a,v=0,L=0,H=0,O=0;n&&(p?(v=D?R?0:d:0,L=D?w?0:d:0,O=B?R?0:d:0,H=B?w?0:d:0):(v=D?R?0:d:0,O=D?R?0:d:0,L=B?w?0:d:0,H=B?w?0:d:0));let _=Vi(P,"left"),N=Vi(P,"right"),se=n&&!D&&!(A&&_)&&!(A||_)?css({[p?"borderTop":"borderLeft"]:`${C} solid ${F}`}):null,V=n&&!D&&A&&_?css(p?{borderTopWidth:0}:{borderLeftWidth:0}):null,J=n?css({borderTopLeftRadius:Bn(v),borderTopRightRadius:Bn(L),borderBottomRightRadius:Bn(H),borderBottomLeftRadius:Bn(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ue=css([J,se,V,le]);if(!qi(P)){let ve=z.css,Ee=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Re=Ui(P)&&n?{__clipLeft:!D,__clipRight:!B}:{},Z=cloneElement(P,{...z,disabled:E,size:g,className:Ee,css:[ve,ue],...Re});I.push(Z),A=N,S+=1;continue}let pe=z.children,Me=Children.map(pe,ve=>{if(!vr(ve)||!As(ve))return ve;let Ee=ve.props,Re=[Ee.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(ve,{...Ee,css:[Ee.css,ue],className:Re,disabled:E,size:g})}),Ce=cloneElement(P,{...z,children:Me});I.push(Ce),A=N,S+=1;}return jsx("div",{ref:y,role:m,"aria-orientation":p?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[M,h],...k,children:I})}));Gi.displayName="ButtonGroup";var Cr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Cp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Cr(n?.[e]??e)}}},Rp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Cr(n?.[e]??e)}}},Tp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},wp=(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=de.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:s,className:a,hoverable:c,selectable:i,selected:l,defaultSelected:u,onSelectedChange:m,width:h,height:f,onClick:T,onKeyDown:k,role:y,tabIndex:x,...b},d){let p=j(),C=p.surface??{},[F,R]=useState(!!u),w=l!=null,M=w?!!l:F,$=useMemo(()=>Tp(o,p),[o,p]),K=useMemo(()=>wp(o,p,$),[o,p,$]),W=K,S=useMemo(()=>Cp(r,p),[r,p]),A=useMemo(()=>Rp(s,p),[s,p]),I=!!c||!!i,P=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:A,border:o==="outlined"?`${p.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:h?"100%":void 0,maxWidth:Cr(h),height:Cr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:I?"pointer":void 0,...I?{"&:hover":{backgroundColor:K}}:{},'&[data-selected="true"]':{backgroundColor:W},...I?{'&[data-selected="true"]:hover':{backgroundColor:W}}:{}}),[$,S,A,o,p.componentHeights,C.border,h,f,I,K,W]),D=useCallback(()=>{if(!i)return;let g=!M;w||R(g),m?.(g);},[w,m,i,M]),B=useCallback(g=>{i&&D(),T?.(g);},[i,D,T]),z=useCallback(g=>{i&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),D()),k?.(g);},[i,D,k]),E=he();return jsx("div",{ref:d,"data-variant":o,"data-selected":i&&M?"true":void 0,"aria-pressed":i?M:void 0,className:["plainframe-ui-container",a||""].join(" ").trim(),css:[E(),P,n],onClick:B,onKeyDown:z,role:i?y??"button":y,tabIndex:i?x??0:x,...b,children:t})}));$n.displayName="Container";var Sp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Ns(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return Sp(o)}return e}}}function go(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 Ip(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 bo(e,t,n,o){let r=Ns(t,e),s=Ns(n,e),a=Ns(o,e),c={};return r&&!s&&!a&&(c.padding=r),s&&(c.paddingLeft=s,c.paddingRight=s),a&&(c.paddingTop=a,c.paddingBottom=a),c}function Xi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Yi=de.createContext("horizontal"),Ls=()=>de.useContext(Yi),Ji=de.memo(de.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u="100%",height:m,gap:h,direction:f="horizontal",className:T,onClick:k,...y},x)=>{let b=j(),d=he(),p=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:p?"column":"row",gap:Ip(h,b),alignItems:p?"stretch":"center",transition:"all .16s ease"});return jsx(Yi.Provider,{value:f,children:jsx($n,{ref:x,variant:n,padding:o,radius:r,hoverable:s,selectable:a,selected:c,defaultSelected:i,onSelectedChange:l,width:u,height:m,className:["plainframe-ui-card",T||""].join(" ").trim(),css:[d(),C,t],onClick:k,tabIndex:k?0:void 0,...y,children:e})})}));Ji.displayName="Card";var kp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=j(),u=Ls()==="vertical",m=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:go(o),textAlign:Hs(o),...u?{width:"100%"}:{flex:1,minWidth:0},...bo(i,r,s,a)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Mp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=j(),u=Ls()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...u?{width:"100%"}:{},...bo(i,r,s,a)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Ap=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,...c})=>{let i=j(),u=Ls()==="vertical",m=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...u?{width:"100%"}:{},gap:i.spacing.xs,color:i.text.secondary,...bo(i,r,s,a)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[m,t],...c,children:e})}),Fp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=j(),h=css({fontWeight:c??500,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"1rem"),color:Xi(m,l)??m.text?.primary,textAlign:Hs(o),...bo(m,r,s,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:[h,t],...u,children:e})}),Pp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:s,paddingY:a,weight:c,size:i,color:l,...u})=>{let m=j(),h=css({fontWeight:c??400,fontSize:i??(m.typography?.sizes?.sm!==void 0?m.typography.sizes.sm:"0.875rem"),color:Xi(m,l)??m.text?.secondary,marginTop:m.spacing?.xxs??2,textAlign:Hs(o),...bo(m,r,s,a)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[h,t],...u,children:e})});var Qi=e=>isValidElement(e),Lp=e=>Qi(e)?e.type?.displayName||e.type?.name:void 0,Zi=e=>Lp(e)==="Card",Bp=e=>typeof e=="number"?`${e}px`:e,el=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:s,className:a,role:c="group",css:i})=>{let l=j(),u=r==="vertical",m=String(l.componentHeights?.border??"1px"),h=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?Bp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},T=Children.toArray(e),y=T.filter(Zi).length,x=0,b=T.map((d,p)=>{if(!Zi(d)||!Qi(d))return d;let C=d.props,F=x++,R=F===0,w=F===y-1,M=s??C.variant,$=t?u?{borderTopLeftRadius:R?C.radius:0,borderTopRightRadius:R?C.radius:0,borderBottomLeftRadius:w?C.radius:0,borderBottomRightRadius:w?C.radius:0}:{borderTopLeftRadius:R?C.radius:0,borderBottomLeftRadius:R?C.radius:0,borderTopRightRadius:w?C.radius:0,borderBottomRightRadius:w?C.radius:0}:void 0,K=t&&!R?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=M==="subtle"&&y>1&&!R?u?{borderTop:`${m} solid ${h}`}:{borderLeft:`${m} solid ${h}`}:null,A=[$,K,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),I=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...C,variant:M??C.variant,css:[C.css,...A],className:I,key:typeof d=="object"&&"key"in d?d.key:p})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",a||""].join(" ").trim(),css:[f,i],children:b})};el.displayName="CardGroup";var De=e=>typeof e=="number"?`${e}px`:e,nl=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&nl(n)&&(t=true));}),t},Wp=(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"},ol=de.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:s=false,startIcon:a,endIcon:c,size:i="md",onClick:l,onDelete:u,deleteIcon:m,disabled:h,cursor:f,className:T,css:k},y){let x=j(),b=he(),d=["sm","md","lg"].includes(i)?i:"md",p=useMemo(()=>Wp(x,d),[x,d]),C=!!l&&!h,F=h?"not-allowed":f||(C?"pointer":"inherit"),R=String(x.componentHeights?.border??"1px"),w=useMemo(()=>{let G=x.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,x.palette]),M=useCallback(G=>{let se=x.palette;return (w==="neutral"?x.neutral[G]:se[w]?.[G])??se.primary?.[G]},[w,x.neutral,x.palette]),$=useMemo(()=>w==="neutral"?x.neutral[100]:M(50),[w,M,x.neutral]),K=useMemo(()=>w==="neutral"?x.text.secondary:M(800),[w,M,x.text.secondary]),W=useMemo(()=>w==="neutral"?x.neutral[100]:M(50),[w,M,x.neutral]),S=useMemo(()=>w==="neutral"?x.text.secondary:M(800),[w,M,x.text.secondary]),A=useMemo(()=>w==="neutral"?x.neutral[400]:M(300),[w,M,x.neutral]),I=useMemo(()=>w==="neutral"?x.surface.subtleBg:M(600),[w,M,x.surface.subtleBg]),P=useMemo(()=>(x.text.onColors??{})[w]??(w==="neutral"?x.neutral[900]:x.neutral[0]??"#fff"),[w,x.text.onColors,x.neutral]),D="transparent",B=useMemo(()=>w==="neutral"?x.text.secondary:M(700)??x.text.primary,[w,M,x.text.primary,x.text.secondary]),z=useMemo(()=>!a&&!c&&t!=null&&!nl(t)&&de.Children.count(t)===1,[a,c,t]),E=useMemo(()=>o==="filled"?css({backgroundColor:I,color:P,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:W,color:S,border:"none",boxShadow:`inset 0 0 0 ${R} ${A}`}):o==="ghost"?css({backgroundColor:D,color:B,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:K,border:"none",boxShadow:"none"}),[I,P,B,W,S,A,$,K,R,o]),g=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:De(p.gap),padding:o==="ghost"?0:z||t==null?De(p.soloPadding):`${De(p.paddingY)} ${De(p.paddingX)}`,borderRadius:s?x.radius.full:p.radius,fontWeight:600,cursor:F,opacity:h?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${De(p.iconSize)} + ${De(p.soloPadding)} * 2)`,minHeight:`calc(${De(p.iconSize)} + ${De(p.soloPadding)} * 2)`,justifyContent:"center"}:null}),[p,F,t,h,z,s,x.radius.full,o]),v=useMemo(()=>css({fontSize:De(z?p.iconSize:p.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?De(p.iconSize):void 0,height:z?De(p.iconSize):void 0,display:z?"block":void 0}}),[p.fontSize,p.iconSize,z]),L=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:De(p.iconSize),lineHeight:0,"& > svg":{width:De(p.iconSize),height:De(p.iconSize),display:"block"}}),[p.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:De(p.gap),marginLeft:z||t==null?0:De(p.iconOffset)}),[p.gap,p.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:De(p.gap),marginRight:z||t==null?0:De(s?p.iconOffsetRounded:p.iconOffset)}),[p.gap,p.iconOffset,p.iconOffsetRounded,t,z,s]),_=useMemo(()=>css({marginRight:s?0:De(p.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:h?"not-allowed":"pointer",color:"currentColor",opacity:h?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:De(p.iconSize),borderRadius:x.radius.xs}),[p.iconOffset,p.iconSize,h,s,x.radius.xs]),N=useCallback(G=>{C&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:p.iconSize,height:p.iconSize},strokeWidth:2.5}),[p.iconSize]);return jsxs("div",{ref:y,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",T||""].join(" ").trim(),css:[g,E,C?b({color:r??"primary"}):null,k],onClick:C?l:void 0,onKeyDown:N,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":h||void 0,"data-variant":o,"data-color":w,"data-size":i,"data-icon-only":z||void 0,children:[a&&jsx("span",{css:[L,H],className:"plainframe-ui-chip-icon-left",children:a}),t!=null&&jsx("span",{css:[v,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[L,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:h,tabIndex:0,onClick:G=>{G.stopPropagation(),h||u?.();},css:[_,b({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:m||U})]})}));ol.displayName="Chip";var Vp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Up=de.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:s,s:a,variant:c,error:i,disabled:l,ringEnabled:u,focusRingMode:m,placeholder:h,separator:f,gapPx:T}){let k=he(),y=r.neutral,x=r.text,b=r.componentHeights.border,d=useRef([]),[p,C]=useState(0),F=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),R=useMemo(()=>{if(!h)return Array(o).fill("");if(h.length===1)return Array(o).fill(h);let z=h.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[h,o]),w=useMemo(()=>{let z=r.componentHeights[s];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,s]),M=l?y[200]:i&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:i&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",$=c==="outlined"?`${b} solid ${i?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",K=z=>css({width:w,height:w,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:M,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:a.codeFontSize,fontWeight:600,color:l?y[500]:i?r.palette.danger?.[800]??x.primary:x.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:i?r.palette.danger?.[800]??x.primary:x.primary,"&::placeholder":{color:i?r.palette.danger?.[700]??x.secondary:x.secondary,opacity:.85}},u?k({enabled:true,disabled:l,mode:m==="always"?"always":"visible",color:i?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:T,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:x.secondary,userSelect:"none"}),A=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),I=useCallback(z=>{let E=Math.max(0,Math.min(o-1,z));C(E),d.current[E]?.focus();},[o]),P=useCallback((z,E)=>{let g=A(E).slice(0,1),v=[...F];v[z]=g,n(v.join("")),g&&z<o-1&&I(z+1);},[F,o,n,I]),D=useCallback((z,E)=>{if(E.key==="Backspace")if(!F[z]&&z>0){let g=[...F];g[z-1]="",n(g.join("")),I(z-1),E.preventDefault();return}else {let g=[...F];g[z]="",n(g.join(""));return}if(E.key==="ArrowLeft"&&z>0){E.preventDefault(),I(z-1);return}if(E.key==="ArrowRight"&&z<o-1){E.preventDefault(),I(z+1);return}if(E.key==="Home"){E.preventDefault(),I(0);return}if(E.key==="End"){E.preventDefault(),I(o-1);return}},[F,o,n,I]),B=useCallback(z=>{let E=A(z.clipboardData.getData("text")).slice(0,o);E&&(n(E),requestAnimationFrame(()=>{let g=Math.min(E.length,o-1);I(g);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,E)=>jsxs(de.Fragment,{children:[jsx("input",{ref:g=>{d.current[E]=g;},type:"text",inputMode:"text",maxLength:1,value:F[E]||"",placeholder:F[E]?"":R[E]||"",disabled:l,onChange:g=>P(E,g.target.value),onKeyDown:g=>D(E,g),onFocus:()=>C(E),onPaste:E===0?B:void 0,className:"plainframe-ui-code-box",css:K(E===p),"aria-label":`Code character ${E+1}`,tabIndex:E===p?0:-1}),f&&E<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:S,children:f}):null]},E))})}),qp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:s,error:a,helperText:c,disabled:i=false,gap:l,size:u="md",variant:m="subtle",length:h=4,focusRingMode:f="always",className:T,wrapperCss:k,labelCss:y,helperRowCss:x,helperTextCss:b,css:d})=>{let p=j(),C=useId(),F=useMemo(()=>({sm:{labelFont:p.typography.sizes.xs,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.sm,paddingY:0,paddingX:p.spacing.md,codeFontSize:21},md:{labelFont:p.typography.sizes.sm,helperFont:p.typography.sizes.xs,minHeight:p.componentHeights.md,paddingY:0,paddingX:p.spacing.md,codeFontSize:24},lg:{labelFont:p.typography.sizes.md,helperFont:p.typography.sizes.sm,minHeight:p.componentHeights.lg,paddingY:0,paddingX:p.spacing.md,codeFontSize:28}}),[p]),R=["sm","md","lg"].includes(u)?u:"md",w=F[R],M=p.neutral,$=p.text,K=t!=null,[W,S]=useState(n),A=K?t:W,I=H=>{K||S(H),o?.(H);},P=Math.max(2,Math.min(h,10)),D=p.spacing.sm,B=Vp(l??D)??"0px",z=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]:[]),E=css({fontSize:w.labelFont,fontWeight:500,color:a?p.palette.danger?.[700]??$.primary:i?M[500]:$.primary,marginBottom:4,display:"block",cursor:i?"not-allowed":"auto"},...Array.isArray(y)?y:y?[y]:[]),g=css({display:"flex",alignItems:"center",justifyContent:"center",gap:B,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),v=css({minHeight:16,fontSize:w.helperFont,color:a?p.palette.danger?.[700]??$.secondary:$.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(x)?x:x?[x]:[]),L=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:a?p.palette.danger?.[700]??$.primary:i?M[500]:$.primary},...Array.isArray(b)?b:b?[b]:[]);return jsxs("div",{className:["plainframe-ui-codefield",T||""].join(" ").trim(),css:z,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:E,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:g,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Up,{value:A||"",onChange:I,len:P,theme:p,sizeKey:R,s:{codeFontSize:w.codeFontSize},variant:m,error:!!a,disabled:i,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:s,gapPx:B})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:L,children:c})})]})};var ll=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=ll(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)},Xp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:s=10})=>{let a=de.useRef(null),[c,i]=de.useState(false),l=de.useCallback(v=>{i(v),o?.(v);},[o]),u=de.useCallback(()=>l(false),[l]),m=de.useRef({x:0,y:0}),h=de.useRef(null),f=de.useRef(null),T=de.useCallback(()=>{f.current=null;let v=h.current;if(!v)return;let L=Math.round(m.current.x),H=Math.round(m.current.y);v.style.transform=`translate3d(${L}px, ${H}px, 0)`;},[]),k=de.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(T));},[T]);de.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=de.useMemo(()=>({getBoundingClientRect:()=>{let v=Math.round(m.current.x),L=Math.round(m.current.y);return {x:v,y:L,left:v,top:L,right:v,bottom:L,width:0,height:0,toJSON:()=>({x:v,y:L})}}}),[]),x=de.useRef(`cz-${Math.random().toString(36).slice(2)}`),b=de.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=de.useRef(null),p=de.useRef(null),C=de.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),F=de.useCallback(()=>{p.current!=null&&clearTimeout(p.current),p.current=null;},[]),R=de.useCallback(()=>{F(),p.current=window.setTimeout(()=>l(false),0);},[F,l]),w=de.useCallback(()=>{let v=a.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),M=de.useCallback((v,L)=>{m.current={x:v,y:L},k(),l(true);},[k,l]),$=typeof t=="function"?t({close:u}):t,K=$s($),W=v=>{if(!de.isValidElement(v))return v;let L=ll(v),H=v,O=H.props.children,_=O==null?O:Array.isArray(O)?O.map(N=>de.isValidElement(N)?W(N):N):de.isValidElement(O)?W(O):O;if(L==="DropdownMenu"){let N=H.props.onOpenChange;return de.cloneElement(H,{...H.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:_})}if(L==="DropdownMenuContent"){let N=H.props.onMouseEnter,U=H.props.onMouseLeave;return de.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{F(),N?.(G);},onMouseLeave:G=>{R(),U?.(G);},children:_})}return _===O?H:de.cloneElement(H,{...H.props,children:_})},S=K?W($):$,A=de.useCallback(v=>{v.preventDefault(),M(v.clientX,v.clientY);},[M]),I=de.useCallback(v=>{n==="contextmenu"&&A(v);},[n,A]),P=de.useCallback(v=>{n==="dblclick"&&A(v);},[n,A]),D=de.useCallback(v=>{n==="click"&&A(v);},[n,A]),B=de.useCallback(v=>{if(n!=="hover")return;C(),F();let L=r==="center"?w():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let H=L.x+(r==="cursor"?s:0),O=L.y+(r==="cursor"?s:0);M(H,O);},0);},[n,r,s,w,M,C,F]),z=de.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!K&&(m.current={x:v.clientX+s,y:v.clientY+s},k());},[n,c,r,K,s,k]),E=de.useCallback(()=>{n==="hover"&&(C(),R());},[n,C,R]);de.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let L=a.current?.matches(":hover"),H=b()?.matches?.(":hover");L||H?F():R();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,b,F,R]),de.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let L=a.current?.matches(":hover"),H=b()?.matches?.(":hover");if(L||H?F():R(),r==="center"&&a.current){let O=w();m.current={x:O.x,y:O.y},k();}}else l(false);};return window.addEventListener("scroll",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,w,k,l,F,R,b]),de.useEffect(()=>()=>{C(),F();},[C,F]);let g=({children:v})=>c?jsx("div",{ref:h,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"&&F(),onMouseLeave:()=>n==="hover"&&R(),children:v}):null;return jsxs("div",{ref:a,onContextMenu:I,onDoubleClick:P,onClick:D,onMouseEnter:B,onMouseMove:z,onMouseLeave:E,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,K?S:jsx(g,{children:S})]})};var On=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,Qp=de.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:s=1,width:a,middleMargin:c="5px",insetMargin:i="10px",chip:l=false,chipVariant:u="subtle",rounded:m=false,margin:h=10,css:f,labelCss:T,strokeCss:k,className:y,...x},b){let d=j(),{t:p,strokeColor:C,labelTextColor:F,chipSubtleBg:R,chipOutlinedBg:w,outerM:M,padX:$,verticalStrokeMargin:K}=useMemo(()=>{let P=typeof s=="number"?`${s}px`:s,D=d.surface.border,B=d.text.secondary,z=d.surface.subtleBg,E=d.surface.panelBg,g=On(h,"10px"),v=o==="horizontal"?n==="middle"?On(c):n==="inset"?On(i,"0px"):"0":"0",L=o==="vertical"?n==="middle"?On(c):n==="inset"?On(i,"0px"):"0":"0";return {t:P,strokeColor:D,labelTextColor:B,chipSubtleBg:z,chipOutlinedBg:E,outerM:g,padX:v,verticalStrokeMargin:L}},[s,d,o,n,c,i,h]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":p,minWidth:t?"max-content":p,marginLeft:M,marginRight:M}:{flexDirection:"row",width:a?On(a):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:M,marginBottom:M},...Array.isArray(f)?f:f?[f]:[]]),[o,t,p,M,a,$,n,f]),S=useMemo(()=>css([{background:C,borderRadius:m?d.radius.full:d.radius.xs},o==="vertical"?{width:p,minHeight:18,flex:1,marginTop:K,marginBottom:K}:{height:p,flex:1}]),[C,m,d.radius.full,d.radius.xs,o,p,K]),A=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?m?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:F,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:R,border:"none"}:{background:w,border:`${p} solid ${C}`}:{}},...Array.isArray(T)?T:T?[T]:[]]),[l,o,m,d.radius.full,d.radius.sm,F,u,R,w,p,C,T]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,k]}),[S,k]);return o==="vertical"?jsxs("div",{ref:b,"data-direction":"vertical","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper","is-vertical",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:b,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:A,children:t}),t&&r!=="right"&&I,!t&&I]})}));var gl=de.createContext(null),bl=()=>{let e=useContext(gl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},hl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]),u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(gl.Provider,{value:u,children:e})},nm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=bl(),c=!!e&&de.isValidElement(t),i=useCallback(u=>{if(c){let m;de.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;de.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return de.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,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})});nm.displayName="DrawerTrigger";var vo=0,yl="",xl="",om=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function rm(){if(!(typeof document>"u")){if(vo===0){let e=document.body;yl=e.style.overflow||"",xl=e.style.paddingRight||"";let t=om();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}vo+=1;}}function sm(){if(!(typeof document>"u")&&(vo>0&&(vo-=1),vo===0)){let e=document.body;e.style.overflow=yl,e.style.paddingRight=xl;}}var am=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,vl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:s="inset",margin:a=10,radius:c,backdropBlur:i=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:m,snapClosePct:h=.33,velocityClosePxS:f=950,dragElasticOut:T=.2,className:k,css:y,...x},b){let d=j(),{open:p,setOpen:C,lockScroll:F,closeOnEscape:R}=bl();useEffect(()=>{if(!(!F||!p))return rm(),()=>sm()},[p,F]);let w=useMemo(()=>am(a,0),[a]),M=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),K=useMemo(()=>n??(r==="left"||r==="right"?320:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[n,r,s,w]),W=useMemo(()=>o??(r==="top"||r==="bottom"?420:s==="inset"?`calc(100% - ${w*2}px)`:"100%"),[o,r,s,w]),S=useMemo(()=>{let V=String(d.radius.lg);switch(r){case "left":return `0 ${V} ${V} 0`;case "right":return `${V} 0 0 ${V}`;case "top":return `0 0 ${V} ${V}`;default:return `${V} ${V} 0 0`}},[r,d.radius.lg]),A=useMemo(()=>c??(s==="inset"?d.radius.lg:S),[c,s,d.radius.lg,S]),I=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]),P=useRef(null),D=useCallback(()=>{let V=P.current;if(!V)return 1;let J=V.getBoundingClientRect();return M==="x"?J.width:J.height},[M]),B=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),z=useMemo(()=>({duration:(m??280)/1e3,ease:[.22,1,.36,1]}),[m]),E=useMemo(()=>$*1.1,[$]),g=useMemo(()=>M==="x"?{x:`${E*100}%`,y:0}:{y:`${E*100}%`,x:0},[M,E]),v=useMemo(()=>css({position:"fixed",zIndex:1100,...I,width:K,height:W,backgroundColor:d.surface.panelBg,borderRadius:A,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:p?"auto":"none",touchAction:M==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,K,W,d.surface,A,p,M]),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]),H=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>M==="x"?{left:$===-1?T:0,right:$===1?T:0}:{top:$===-1?T:0,bottom:$===1?T:0},[M,$,T]),_=useMemo(()=>M==="x"?{left:0,right:0}:{top:0,bottom:0},[M]),N=useMemo(()=>Math.max(0,Math.min(1,h)),[h]),U=useCallback((V,J)=>{let le=M==="x"?J.offset.x:J.offset.y,ue=M==="x"?J.velocity.x:J.velocity.y,pe=$*le>0,Me=Math.abs(le)>=D()*N,Ce=$*ue>f;pe&&(Me||Ce)&&C(false);},[M,$,D,N,f,C]),G=useRef(null);useEffect(()=>{if(!p)return;G.current=document.activeElement;let V=setTimeout(()=>{let ue=P.current;if(!ue)return;let pe=ue.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');pe.length>0?pe[0].focus():ue.focus();},100),J=ue=>{let pe=P.current;if(!pe||!ue.target)return;let Me=ue.target;if(!pe.contains(Me)){ue.preventDefault();let Ce=pe.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Ce.length>0?Ce[0].focus():pe.focus();}},le=ue=>{ue.key==="Escape"&&R&&(ue.stopPropagation(),C(false));};return document.addEventListener("focusin",J,true),window.addEventListener("keydown",le),()=>{clearTimeout(V),document.removeEventListener("focusin",J,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[p,C,R]);let{...se}=x;return jsx(AnimatePresence,{children:p?jsxs(Fragment,{children:[jsx(motion.div,{role:"presentation","aria-hidden":true,css:L,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:m?z:{duration:.18,ease:"linear"},onClick:H},"overlay"),jsx(motion.div,{ref:V=>{P.current=V,typeof b=="function"?b(V):b&&(b.current=V);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":s,className:["plainframe-ui-drawer",k||""].join(" ").trim(),css:[v,y],drag:M,dragConstraints:_,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...g,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...g,opacity:.98},transition:m?z:B,...se,children:t},"panel")]}):null})});vl.displayName="DrawerContent";var im=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:s,onClose:a,children:c,...i},l){let u=t!==void 0?t:n,m=o!==void 0?o:r,h=u!==void 0,[f,T]=useState(!!m),k=h?!!u:f,y=useCallback(x=>{h||T(x),x||a?.(),s?.(x);},[h,a,s]);return jsx(hl,{open:k,onOpenChange:y,children:jsx(vl,{ref:l,...i,children:c})})});im.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:s=false,className:a,blur:c=false})=>{let i={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=m=>h=>{h.target===h.currentTarget&&(h.propertyName==="opacity"||h.propertyName==="filter")&&r?.(),m?.(h);};if(s&&isValidElement(e)){let m=e,h=m.props.css,f=Array.isArray(h)?[...h,i]:h?[h,i]:[i],T=["plainframe-ui-transition-fade",m.props.className||"",a||""].join(" ").trim(),k=m.props.onTransitionEnd;return cloneElement(m,{...m.props,css:f,className:T,onTransitionEnd:l(k)})}let u=css(i);return jsx("div",{className:["plainframe-ui-transition-fade",a||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var Cl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Rl=de.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:s,children:a,width:c,height:i,...l})=>{let u=j(),m=e==="vertical"||e==="column"?"column":"row",h=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:m,gap:h,justifyContent:n,alignItems:o,maxWidth:Cl(c),width:c?"100%":void 0,maxHeight:Cl(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})});Rl.displayName="Flex";var _s=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:s=1,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:o?`scale(${s})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=h.props.onTransitionEnd,y=["plainframe-ui-transition-grow",h.props.className||"",i||""].join(" ").trim();return cloneElement(h,{...h.props,css:T,className:y,onTransitionEnd:u(k)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var Tl={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"}},Rm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Tm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},Wn=de.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:s,letterSpacing:a,align:c="left",textTransform:i="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:m="solid",decorationThickness:h=1,decorationColor:f,italic:T,className:k,style:y,as:x})=>{let b=j(),d=Tl[e]??Tl.body,p=x??Tm[e]??"span",C=A=>A==null?d.size:typeof A=="number"?A:b?.typography?.sizes?.[A]??A,F=C(o)??C(d.size),R=r??d.weight,w=s??d.lh,M=a??d.ls,$=n==="secondary"?b.text.secondary:n==="primary"?b.text.primary:n??"inherit",K=f??b.surface.border,W=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:b?.typography?.fonts?.sans||"inherit",fontSize:F,fontWeight:R,lineHeight:w,letterSpacing:M,color:$,textTransform:i,whiteSpace:l,fontStyle:T?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:m,textDecorationColor:K,textDecorationThickness:Rm(h),textDecorationSkipInk:"auto"});return jsx(p,{className:[`pfui-typo-${e}`,k||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});Wn.displayName="Typography";var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,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 qs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},El=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:s="md",shadow:a=false,hoverEffect:c="none",label:i,labelAlign:l="center",aspectRatio:u,loading:m="lazy",decoding:h="async",fetchPriority:f,srcSet:T,sizes:k,placeholder:y,blurDataURL:x,placeholderColor:b="#f1f1f1",fallbackSrc:d,className:p,css:C,onClick:F,onLoad:R,onError:w,...M},$){let[K,W]=useState(false),[S,A]=useState(false),[I,P]=useState(false),D=j(),B=Sm(s,D)??"0px",z=i?"figure":"div",E=css({display:"flex",flexDirection:"column",gap:i?D.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${B})`}),g=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${B})`,maxWidth:o?qs(o):"100%",maxHeight:r?qs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:u,boxShadow:a?"0 12px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.04)":"none",overflow:"hidden",padding:0,lineHeight:0,transition:"transform 0.3s ease",willChange:"transform",transform:K&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:F?"pointer":void 0}),v=css({position:"absolute",inset:0,background:y==="color"?b:void 0,backgroundImage:y==="blur"&&x?`url(${x})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:y==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:I?0:1,pointerEvents:"none"}),L=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:K&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(z,{className:["plainframe-ui-image",p||""].join(" ").trim(),css:[E,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:g,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:F,children:[!I&&y&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css:L,src:S&&d?d:t,alt:n,srcSet:T,sizes:k,loading:m,decoding:h,fetchPriority:f,onLoad:H=>{P(true),R?.(H);},onError:H=>{A(true),w?.(H);},...M})]}),i&&jsx(Wn,{as:"figcaption",variant:"caption",align:l,children:i})]})});El.displayName="Image";var Sl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Am=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}},Fm=e=>e*Math.PI/180,Pm=(e,t,n)=>{let o=Math.abs(Fm(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 Dm(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 Nm=(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,Il=[1.02,1.03,1.02],kl=[1.06,1.08,1.06],Hm={sm:150,md:200,lg:260,xl:340},Lm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Bm(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 Lm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var $m=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:s="md",hoverEffect:a="none",hovering:c,maxItems:i=3,shadow:l=false,cursor:u,outline:m,outlineColor:h,outlineWidth:f=3,outlineOffset:T=0,radius:k="md",label:y,labelAlign:x="center",css:b,className:d,...p}){let C=j(),F=Am(r)??4/5,R=typeof o=="string"?o:void 0,w=typeof o=="number"?o:R&&/px$/.test(R)?parseFloat(R):Hm[s],M=Math.max(1,w/F),K=Children.toArray(t).filter(isValidElement).slice(0,i),W=K.length,S=Dm(n,W),A=K.map((V,J)=>Nm(n,W,J)),I=V=>M*.6*A[V],P=V=>I(V)*F,D=0,B=0;for(let V=0;V<W;V++){let J=P(V),le=I(V),ue=Math.max(Math.abs(S.base.ang[V]??0),Math.abs(S.exp.ang[V]??0)),pe=Math.max(Math.abs(S.base.dx[V]??0),Math.abs(S.exp.dx[V]??0)),Me=Math.max(Math.abs(S.base.dy[V]??0),Math.abs(S.exp.dy[V]??0)),Ce=a==="expand"?kl[V]??1.08:a==="reveal"?Il[V]??1.03:1,ve=Pm(J,le,ue),Ee=ve.w*Ce,Re=ve.h*Ce,Z=pe/100*J*Ce,ie=Me/100*le*Ce;D=Math.max(D,Ee/2+Z),B=Math.max(B,Re/2+ie);}let z=Math.max(1,2*D),E=Math.max(1,2*B),g=Math.min(1,w/z,M/E),v=c===void 0?"pointer":"controlled",L=c?"true":void 0,H=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?C.spacing.xs:0}),O=css({position:"relative",width:Sl(typeof o=="number"?o:w)??(typeof o=="string"?o:void 0),height:Sl(M)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${z}px`,height:`${E}px`,transform:`translate(-50%, -50%) scale(${g})`,transformOrigin:"center center"}),N=Bm(k,C)??"0px",U=V=>{let J=n==="fan"?`rotate(${S.base.ang[V]}deg) translate(${S.base.dx[V]}%, ${S.base.dy[V]}%)`:n==="slide"?`translate(${S.base.dx[V]}%, ${S.base.dy[V]}%) rotate(${S.base.ang[V]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[V]}%)`:`translate(${S.base.dx[V]}%, ${S.base.dy[V]}%) rotate(${S.base.ang[V]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[V]}deg) translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%)`:n==="slide"?`translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%) rotate(${S.exp.ang[V]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[V]}%)`:`translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%) rotate(${S.exp.ang[V]}deg)`,ue=a==="reveal"?"translate(0,0) rotate(0) scale(1)":`${J} scale(1)`,pe=a==="expand"?`${le} scale(${kl[V]??1.06})`:a==="reveal"?`${J} scale(${Il[V]??1.03})`:`${J} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${ue}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&V===1?10:V+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:m?`${f}px solid ${h??C.surface.appBg}`:void 0,outlineOffset:m?T:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${pe}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${pe}`}})},G=V=>css({width:`${P(V)}px`,aspectRatio:`${F}`,position:"relative",overflow:"hidden",borderRadius:N,"--pfui-image-radius":N,"& > *":{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(y?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":L,css:[H,b],tabIndex:-1,...p,children:[jsx("div",{className:"plainframe-ui-image-stack",css:O,children:jsx("div",{className:"plainframe-ui-image-stack-stage",css:_,children:K.map((V,J)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(J),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(J),children:V})},J))})}),y&&jsx(Wn,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Ml=e=>typeof e=="number"?`${e}px`:e,Al={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Wm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Ml(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Ml(n)}return e}function Km(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var _m=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:s=true,uppercase:a=false,symbolBoost:c=2,css:i,className:l="plainframe-ui-kbd",...u},m){let h=j(),f=he(),T=Al[o]??Al.sm,k=Wm(r,h),y={br:h.neutral[300],txt:h.neutral[800],inset:h.neutral[0]},x=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${T.h}px !important`,paddingInline:n==="ghost"?0:`${T.px}px !important`,paddingBlock:"0 !important",fontFamily:s?h.typography.fonts.mono:"inherit",fontSize:`${T.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:a?"uppercase":"none",borderRadius:k,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),b=css({"&&":{background:h.surface.subtleBg,border:"none",boxShadow:"none",color:y.txt}}),d=css({"&&":{background:"transparent",color:y.txt,border:"none",boxShadow:"none"}}),p=css({"&&":{background:h.surface.panelBg,color:y.txt,border:`1px solid ${y.br}`,boxShadow:`inset 0 1px 0 ${y.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?b:n==="ghost"?d:p,R=s&&c>0&&Km(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${T.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:m,className:l,css:[f(),x,C,i],...u,children:R})});var qm=(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=false,className:c,distance:i})=>{let u=qm(i,t==="left"||t==="right"?"100vw":"100vh"),m=t==="left"?`-${u}`:t==="right"?u:"0",h=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${m}, ${h}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},T=y=>x=>{x.target===x.currentTarget&&x.propertyName==="transform"&&s?.(),y?.(x);};if(a&&isValidElement(e)){let y=e,x=y.props.css,b=Array.isArray(x)?[...x,f]:x?[x,f]:[f],d=["plainframe-ui-transition-slide",y.props.className||"",c||""].join(" ").trim(),p=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:b,className:d,onTransitionEnd:T(p)})}let k=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:k,onTransitionEnd:T(),children:e})};var Xs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Nl=de.createContext(null),Hl=()=>{let e=useContext(Nl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},Qm=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:s=true})=>{let[a,c]=useState(!!n),i=t??a,l=useCallback(m=>{t===void 0&&c(m),o?.(m);},[t,o]);useEffect(()=>{if(!i||!s)return;let m=h=>{h.key==="Escape"&&(h.stopPropagation(),l(false));};return window.addEventListener("keydown",m,true),()=>window.removeEventListener("keydown",m,true)},[i,s,l]);let u=useMemo(()=>({open:i,setOpen:l,lockScroll:r,closeOnEscape:s}),[i,l,r,s]);return jsx(Nl.Provider,{value:u,children:e})},Ll=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},s)=>{let{setOpen:a}=Hl(),c=!!e&&de.isValidElement(t),i=useCallback(u=>{if(c){let m;de.isValidElement(t)&&(m=t.props.onClick),m?.(u);}r.onClick?.(u),u.defaultPrevented||a(true);},[c,t,r.onClick,a]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),a(true)),c){let m;de.isValidElement(t)&&(m=t.props.onKeyDown),m?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,a]);if(c){let u=t,m=u.props.css;return de.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[m,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})});Ll.displayName="ModalTrigger";var Bl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:s="lg",backdrop:a=true,backdropBlur:c=true,backdropBlurDepth:i=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:m="up",transitionDuration:h=300,containerCss:f,backdropCss:T,className:k,...y},x)=>{let b=j(),{open:d,setOpen:p,lockScroll:C}=Hl(),F=de.useRef(null),R=de.useRef(null);de.useEffect(()=>{if(!d)return;R.current=document.activeElement;let S=setTimeout(()=>{let I=F.current;if(!I)return;let P=I.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');P.length>0?P[0].focus():I.focus();},100),A=I=>{let P=F.current;if(!P||!I.target)return;let D=I.target;if(!P.contains(D)){I.preventDefault();let B=P.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');B.length>0?B[0].focus():P.focus();}};return document.addEventListener("focusin",A,true),()=>{clearTimeout(S),document.removeEventListener("focusin",A,true),R.current&&typeof R.current.focus=="function"&&R.current.focus();}},[d]);let w=typeof b.spacing.sm=="number"?`${b.spacing.sm}px`:String(b.spacing.sm),M=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:[M,f],ref:S=>{F.current=S,typeof x=="function"?x(S):x&&(x.current=S);},...y,children:e}),K=u==="none"?$:u==="slide"?jsx(Gs,{on:d,direction:m,duration:h,children:$}):u==="grow"?jsx(_s,{initialScale:.75,on:d,duration:h,children:$}):jsx(Ks,{on:d,duration:h,children:$});if(!a)return jsx(Fragment,{children:K});let W=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Ss,{on:d,blur:c,blurDepth:i,onClickAway:l?()=>p(false):void 0,css:[W,T].filter(Boolean),contentCss:W,lockScroll:C,children:K})});Bl.displayName="ModalContent";var lf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:s=1,disabled:a=false,showFirstLast:c=false,loop:i=false,variant:l="subtle",gap:u,className:m,css:h})=>{let f=j(),T=he(),k=t!==void 0,[y,x]=useState(n),b=Math.max(1,e),d=Sr(k?t:y,1,b),p=useCallback(g=>{let v=Sr(g,1,b);k||x(v),o?.(v);},[k,b,o]),C=useMemo(()=>cf({count:b,page:d,siblingCount:r,boundaryCount:s}),[b,d,r,s]),F=f.palette?.primary?.[600],R=f.surface?.border,w=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,M=f.text?.primary??"#111",$=l==="subtle"?f.surface?.subtleBg:"transparent",K=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:$,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(h)?h:h?[h]:[]),W=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:M,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:a?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),A=(g=false)=>css([W,T({color:g?"primary":"neutral"}),l==="outlined"?g?{background:F,color:f.text.onColors.primary,borderColor:F}:{background:"transparent",borderColor:R,":hover":{background:w}}:l==="ghost"?g?{background:F,color:f.text.onColors.primary}:{":hover":{background:w}}:g?{background:F,color:f.text.onColors.primary,borderColor:F}:{":hover":{background:w}}]),I=useCallback(()=>p(1),[p]),P=useCallback(()=>p(b),[p,b]),D=useCallback(()=>{d===1?i&&p(b):p(d-1);},[d,i,b,p]),B=useCallback(()=>{d===b?i&&p(1):p(d+1);},[d,i,b,p]),z=a||d===1&&!i,E=a||d===b&&!i;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",m||""].join(" ").trim(),css:K,onKeyDown:g=>{a||(g.key==="ArrowLeft"&&(g.preventDefault(),D()),g.key==="ArrowRight"&&(g.preventDefault(),B()),g.key==="Home"&&(g.preventDefault(),I()),g.key==="End"&&(g.preventDefault(),P()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[A(false),S],onClick:I,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":z,disabled:z,css:[A(false),S],onClick:D,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((g,v)=>typeof g=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":g===d?`Page ${g}, current page`:`Go to page ${g}`,"aria-current":g===d?"page":void 0,css:A(g===d),onClick:()=>p(g),children:g},g):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,T(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${v}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":E,disabled:E,css:[A(false),S],onClick:B,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":E,disabled:E,css:[A(false),S],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Sr(e,t,n){return Math.max(t,Math.min(n,e))}function cf({count:e,page:t,siblingCount:n,boundaryCount:o}){if(e<=0)return [1];let r=2*o+2*n+3;if(e<=r)return Er(1,e);let s=Er(1,Math.min(o,e)),a=Er(Math.max(e-o+1,o+1),e),c=Sr(t-n,o+2,Math.max(o+2,e-o-2*n-1)),i=Sr(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],u=m=>{let h=l[l.length-1];h!==m&&(h==="ellipsis"&&m==="ellipsis"||l.push(m));};return s.forEach(u),c>o+2?u("ellipsis"):o+1<c&&u(o+1),Er(c,i).forEach(u),i<e-o-1?u("ellipsis"):e-o>i&&u(e-o),a.forEach(u),l}function Er(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var mf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,ff=de.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:s})=>{let a=j(),c=a.surface.border,i=css({display:"inline-block",boxSizing:"border-box",maxWidth:mf(n,"fit-content"),width:"100%",padding:`0 ${a.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(s)?s:s?[s]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:i,children:e})});var Wl=createContext(null),yf=()=>{let e=useContext(Wl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},xf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},vf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:s="horizontal",variant:a="filled",className:c,children:i,anchorOrigin:l,css:u})=>{let m=j(),h=e!==void 0&&n!==void 0,[f,T]=useState(t),k=h?e:f,y=useRef([]),[x,b]=useState(0),d=()=>b(A=>A+1),p=useCallback(A=>{h||T(A),n?.(A);},[h,n]),C=useCallback(A=>(y.current.push(A),d(),y.current.length-1),[]),F=useCallback((A,I)=>{let P=y.current[A];P&&(y.current[A]={...P,...I},d());},[]),R=()=>y.current.map((A,I)=>({it:A,i:I})).filter(({it:A})=>A.ref&&!A.disabled).map(({i:A})=>A),w=useCallback((A,I)=>{let P=R();if(!P.length)return;let D=Math.max(0,P.indexOf(A)),B=P[(D+I+P.length)%P.length],z=y.current[B]?.ref;if(z){z.focus();let E=y.current[B]?.value;E!==void 0&&p(E);}},[p]),M=useCallback(A=>{let I=R();if(!I.length)return;let P=A==="first"?I[0]:I[I.length-1],D=y.current[P]?.ref;if(D){D.focus();let B=y.current[P]?.value;B!==void 0&&p(B);}},[p]),$=useMemo(()=>{let A=y.current.filter(P=>P.ref&&!P.disabled);return A.length?A.some(P=>P.value===k)?k:A[0]?.value:void 0},[k,x]),K=useMemo(()=>({selected:k,setSelected:p,disabled:o,size:r,direction:s,variant:a,register:C,update:F,moveFocusBy:w,moveToEdge:M,focusValue:$,theme:m,anchorOrigin:xf(l)}),[k,p,o,r,s,a,C,F,w,M,$,m,l]),W=css({width:"fit-content"}),S=css({display:"flex",flexDirection:s==="vertical"?"column":"row",gap:m.spacing.sm,width:"fit-content",alignItems:s==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[W,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(Wl.Provider,{value:K,children:i})})})},Cf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:s,setSelected:a,disabled:c,size:i,register:l,update:u,moveFocusBy:m,moveToEdge:h,theme:f,variant:T,focusValue:k,anchorOrigin:y}=yf(),x=c||t,b=s===e,d=["sm","md","lg"].includes(i)?i:"md",p=d==="sm"?16:d==="lg"?24:20,C=O=>f.palette?.primary?.[O],F=C(600),R=C(100),w=f.neutral[300],M=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],K="transparent",W=M,S=$;T==="soft"?(K=R,W=null,S=F):T==="outlined"?(K=C(50),W=M,S=F):(K=f.neutral[200],W="transparent",S=$),b&&(T==="outlined"?(K=R,W=M,S=F):T==="filled"?(K=F,W=null,S=$):(K=R,W=null,S=F));let A=T==="filled"?w:f.palette.primary[100],I=useRef(null),P=useRef(-1);useEffect(()=>{P.current=l({ref:I.current,value:e,disabled:!!x});},[l]),useEffect(()=>{u(P.current,{ref:I.current,value:e,disabled:!!x});},[u,x,e]);let D=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:y.vertical==="center"?f.spacing.sm:0,rowGap:y.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:x?.5:1,borderRadius:f.radius.md,cursor:x?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":x||b?{}:{background:A,boxShadow:T==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${M}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),B=css({width:p,height:p,minWidth:p,minHeight:p,borderRadius:f.radius.full,background:K,boxShadow:W?`inset 0 0 0 ${f.componentHeights.border} ${W}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),z=css({width:b?p*.45:0,height:b?p*.45:0,borderRadius:f.radius.full,background:b?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:b?"scale(1)":"scale(0.6)",opacity:b?1:0}),E=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),g=(()=>{let O=y.horizontal,_=y.vertical;return _==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),L=!x&&k===e?0:-1,H=he();return jsxs("button",{ref:I,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":b,"aria-disabled":x||void 0,disabled:x,tabIndex:L,onClick:()=>{x||a(e);},onKeyDown:O=>{x||(O.key==="Enter"||O.key===" "?(O.preventDefault(),a(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),m(P.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),m(P.current,-1)):O.key==="Home"?(O.preventDefault(),h("first")):O.key==="End"&&(O.preventDefault(),h("last")));},css:[D,H({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[B,css({gridColumn:g.col,gridRow:g.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:z})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:E,children:o})]})};var Sf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:s=0,onAnimationEnd:a,asChild:c=false,className:i})=>{let l={transform:`rotate(${o?s:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=h=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&a?.(),h?.(f);};if(c&&isValidElement(e)){let h=e,f=h.props.css,T=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=["plainframe-ui-transition-rotate",h.props.className||"",i||""].join(" ").trim(),y=h.props.onTransitionEnd;return cloneElement(h,{...h.props,css:T,className:k,onTransitionEnd:u(y)})}let m=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",i||""].join(" ").trim(),css:m,onTransitionEnd:u(),children:e})};var Qs=e=>null;Qs.displayName="SelectItem";var Io=(...e)=>e.filter(Boolean).flat();function Zs(e,t){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let n of e)Zs(n,t);return}if(de.isValidElement(e)){if(e.type===Qs){t.push(e);return}if(e.type===de.Fragment){Zs(e.props.children,t);return}}}}var _l=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:s,endIcon:a,multiple:c=false,disabled:i=false,size:l="md",variant:u="subtle",fullWidth:m,width:h=200,menuAlign:f="left",menuWidth:T,menuMaxHeight:k=280,wrapperCss:y,labelCss:x,triggerCss:b,menuCss:d,optionCss:p,children:C,className:F,menuSize:R="md",triggerRender:w})=>{let M=j(),$=he(),K=de.useId(),W=`${K}-label`,S=`${K}-menu`,A={sm:{minHeight:M.componentHeights.sm,radius:M.radius.sm},md:{minHeight:M.componentHeights.md,radius:M.radius.md},lg:{minHeight:M.componentHeights.lg,radius:M.radius.md}},I=A[l]||A.md,[P,D]=de.useState(false),B=Z=>D(!!Z),z=typeof e<"u",E=c||Array.isArray(e)||Array.isArray(t),[g,v]=de.useState(()=>typeof t<"u"?t:E?[]:void 0),L=z?e:g,H=Z=>{z||v(Z),n?.(Z);},O=[];Zs(C,O);let _=O.map((Z,ie)=>{let be=Z.props,Y=typeof be.children=="string"||typeof be.children=="number"?String(be.children):void 0;return {key:Z.key??ie,value:be.value,startIcon:be.startIcon,endIcon:be.endIcon,node:be.children,labelText:Y}}),N=Z=>E?(Array.isArray(L)?L:[]).some(be=>Object.is(be,Z)):Object.is(L,Z),U=de.useMemo(()=>{if(E){let ie=Array.isArray(L)?L:[];return _.filter(Y=>ie.some(ye=>Object.is(ye,Y.value))).map(Y=>Y.labelText??Y.node)}let Z=_.find(ie=>Object.is(ie.value,L));if(Z)return Z.labelText??Z.node},[L,E,_]),G=Z=>{i||(Object.is(Z,L)||H(Z),B(false));},se=Z=>{if(i)return;let ie=Array.isArray(L)?L:[],Y=ie.some(ye=>Object.is(ye,Z))?ie.filter(ye=>!Object.is(ye,Z)):[...ie,Z];H(Y);},V={position:"relative",width:m?"100%":typeof h=="number"?`${h}px`:h,maxWidth:"100%"},J={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:I.radius,minHeight:I.minHeight,fontSize:M.typography.sizes.sm,padding:`0 ${typeof M.spacing.sm=="number"?`${M.spacing.sm}px`:M.spacing.sm} 0 ${typeof M.spacing.md=="number"?`${M.spacing.md}px`:M.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:i?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:M.text.primary,background:"transparent",whiteSpace:"nowrap"},le=u==="subtle"?{background:M.surface.subtleBg}:u==="outlined"?{background:M.surface.panelBg,border:`1px solid ${M.surface.border}`}:{background:"transparent"},ue={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},pe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Me={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Ce=jsx(ChevronsUpDown,{size:16,css:css({color:M.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),ve=()=>{if(w)return w(U);if(Array.isArray(U)){let ie=U.map(Y=>typeof Y=="string"?Y:"").filter(Boolean),be=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(pe),children:s}),jsx("span",{css:css(Me),title:be,children:be})]})}let Z=U??String(r);return jsxs(Fragment,{children:[s&&jsx("span",{css:css(pe),children:s}),jsx("span",{css:css(Me),title:typeof Z=="string"?Z:void 0,children:Z})]})},Ee={left:"start",center:"center",right:"end"},Re=Z=>{i||(Z.key==="ArrowDown"||Z.key==="ArrowUp"||Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),B(true));};return jsxs("div",{css:Io(V,y),className:["plainframe-ui-select-wrapper",F||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Io({marginBottom:6,fontSize:M.typography.sizes.sm,fontWeight:500,color:M.text.secondary},x),children:o}),jsxs(Dn,{size:R,open:P,onOpenChange:B,children:[jsx(Nn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:i,"aria-haspopup":"menu","aria-expanded":P||void 0,"aria-controls":S,"aria-labelledby":o?W:void 0,onKeyDown:Re,onClick:()=>B(!P),className:"plainframe-ui-select-trigger",css:Io(css(J),css(le),b,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(ue),children:ve()}),a??Ce]})}),jsx(pn,{id:S,gap:"xs",align:Ee[f],sameWidth:T==null,width:T??h,className:"plainframe-ui-select-menu",css:Io({maxHeight:typeof k=="number"?`${k}px`:k,overflowY:"auto"},d),children:_.map((Z,ie)=>{let be=N(Z.value);return jsx(At,{startIcon:Z.startIcon,endIcon:Z.endIcon,selected:be,disabled:i,closeOnSelect:!E,onSelect:()=>E?se(Z.value):G(Z.value),css:Io(p),className:"plainframe-ui-select-option",children:Z.node},Z.key??ie)})})]})]})};_l.displayName="Select";var ea=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Af=keyframes`
13
+ `,qc=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("),Gc=new Set(["0","50","100","200","300","400","500","600","700","800","900"]);function Xc(e,t){if(!t||t.trim()==="")return e.text.primary;let n=t.trim();if(qc(n))return n;let o=n.match(/^([a-zA-Z0-9_-]+)[\.\-:\s]?([0-9]{1,3})?$/);if(o){let r=o[1],a=o[2]&&Gc.has(o[2])?o[2]:"600";if(r==="primary"&&e.palette.primary?.[a])return e.palette.primary[a];let i=e.palette[r];if(i&&i[a]!=null)return i[a];if(r==="neutral"||r==="secondary"&&e.neutral[a]!=null)return e.neutral[a]}return e.palette.primary[600]}var Qn=de.memo(({variant:e="circular",value:t,min:n=0,max:o=100,color:r,size:a,thickness:i,spinDuration:c=.75,wrapperCss:s,trackCss:l,barCss:u,circleCss:p,"aria-label":b})=>{let f=j(),R=typeof t=="number",k=Math.max(o-n,1),y=R?Ga(t,n,o):void 0,x=R?(y-n)/k*100:void 0,h=Xc(f,r),d=f.surface.subtleBg,m=f.radius?.md;return e==="circular"?jsx(Jc,{size:a,active:h,isDeterminate:R,percent:x,spinDuration:c,wrapperCss:s,trackCss:l,circleCss:p,ariaLabel:b,thickness:i}):jsx(Yc,{thickness:i,active:h,track:d,radius:m,isDeterminate:R,percent:x,wrapperCss:s,trackCss:l,barCss:u,ariaLabel:b,min:n,max:o,value:y})}),Yc=({thickness:e=4,active:t,track:n,radius:o,isDeterminate:r,percent:a,wrapperCss:i,trackCss:c,barCss:s,ariaLabel:l,min:u,max:p,value:b})=>{let f=o==null?"8px":typeof o=="number"?`${o}px`:String(o),R=css([{display:"inline-block",width:"100%"},...Array.isArray(i)?i:i?[i]:[]]),k=css([{position:"relative",width:"100%",height:rs(e,"6px"),backgroundColor:n,borderRadius:f,overflow:"hidden"},...Array.isArray(c)?c:c?[c]:[]]),y=r?Math.max(a??0,qa):qa,x=css([{position:"absolute",inset:0,backgroundColor:t,borderRadius:"inherit",transformOrigin:"left",transform:`scaleX(${y/100})`,transition:"transform 160ms cubic-bezier(.2,0,.2,1)",willChange:"transform"},...Array.isArray(s)?s:s?[s]:[]]),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:`${Vc} 2.1s cubic-bezier(.65,.815,.735,.395) infinite`},...Array.isArray(s)?s:s?[s]:[]]),m=css([{...h,left:"-200%",right:"100%",animation:`${Uc} 2.1s cubic-bezier(.165,.84,.44,1) 1.15s infinite`},...Array.isArray(s)?s:s?[s]:[]]),C=r?{role:"progressbar","aria-valuemin":u,"aria-valuemax":p,"aria-valuenow":b}:{role:"progressbar","aria-busy":true};return l&&(C["aria-label"]=l),jsx("span",{css:R,...C,children:jsx("div",{className:"plainframe-ui-progress-linear-track",css:k,children:r?jsx("div",{className:"plainframe-ui-progress-linear-fill",css:x}):jsxs(Fragment,{children:[jsx("div",{className:"plainframe-ui-progress-linear-runner1",css:d}),jsx("div",{className:"plainframe-ui-progress-linear-runner2",css:m})]})})})},Jc=({size:e,thickness:t=4,active:n,isDeterminate:o,percent:r,spinDuration:a,wrapperCss:i,trackCss:c,circleCss:s,ariaLabel:l})=>{let u=j(),p=40,b=(p-t)/2,f=2*Math.PI*b,k=`${(o?Ga((r??0)/100,.01,1):.7)*f} ${f}`,y=css([{display:"inline-block",width:rs(e,`${u.componentHeights.md}`),height:rs(e,`${u.componentHeights.md}`)},...Array.isArray(i)?i:i?[i]:[]]),x=css([{width:"100%",height:"100%",transform:"rotate(-90deg)",transformBox:"fill-box",transformOrigin:"50% 50%"},...Array.isArray(c)?c:c?[c]:[]]),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":`${jc} ${a}s linear infinite`,"@media (prefers-reduced-motion: reduce)":{animation:"none"}},...Array.isArray(s)?s:s?[s]:[]]),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:y,className:"plainframe-ui-progress-circular",...d,children:jsx("svg",{css:x,viewBox:`0 0 ${p} ${p}`,focusable:"false","aria-hidden":true,children:jsx("circle",{cx:p/2,cy:p/2,r:b,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},iu=css({display:"flex",flexDirection:"column",textAlign:"left",minWidth:0,flex:1}),lu=css({lineHeight:0,display:"flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto"}),cu=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:a,width:i="100%",size:c="md",loading:s=false,css:l,children:u,...p},b){let f=j(),R=useId(),k=useId(),y=useMemo(()=>{let F={sm:{paddingX:f.spacing?.md,paddingY:f.spacing?.md,gap:f.spacing?.sm,radius:f.radius?.md,fontSize:f.typography?.sizes?.xs,titleWeight:600,iconSize:16},md:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.sm,titleWeight:600,iconSize:20},lg:{paddingX:f.spacing?.lg,paddingY:f.spacing?.lg,gap:f.spacing?.md,radius:f.radius?.md,fontSize:f.typography?.sizes?.md,titleWeight:600,iconSize:24}};return ["sm","md","lg"].includes(c)?F[c]:F.md},[c,f.typography,f.radius,f.spacing]),x=f.palette??{},h=f.neutral??{},d=useMemo(()=>{let I=(v=>v==="danger"?x.danger??x.error??h:v==="warning"?x.warning??h:v==="success"?x.success??h:v==="info"?x.info??x.primary??h:h)(t),P=I?.[50]??h[50],D=I?.[300]??h[300],B=I?.[600]??I?.[500]??h[600],z=I?.[700]??B,w=I?.[800]??f.text?.primary??"#000",g=f.text?.onColors?.[t]??f.text?.onColors?.primary??f.text?.primary??"#fff";return n==="filled"?{bg:B,fg:g,border:void 0,iconColor:g}:n==="outlined"?{bg:P,fg:w,border:`1px solid ${D}`,iconColor:w}:n==="ghost"?{bg:"transparent",fg:z,border:"none",iconColor:z}:{bg:P,fg:w,border:void 0,iconColor:z}},[t,n,h,x,f.text]),m=t==="danger"||t==="warning"?"alert":"status",C=useMemo(()=>s?jsx(Qn,{variant:"circular",color:d.iconColor,size:y.iconSize/1.25,thickness:4.5}):o??(t==="danger"?jsx(CircleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="warning"?jsx(TriangleAlert,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):t==="success"?jsx(CircleCheckBig,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor}):jsx(Info,{css:{width:y.iconSize,height:y.iconSize},color:d.iconColor})),[s,o,t,y.iconSize,d.iconColor]),A=useMemo(()=>css({display:"flex",alignItems:"flex-start",justifyContent:"space-between",padding:`${y.paddingY} ${y.paddingX}`,gap:y.gap,borderRadius:y.radius,backgroundColor:d.bg,color:d.fg,border:d.border,fontSize:y.fontSize,fontWeight:500,maxWidth:typeof i=="number"?`${i}px`:i,width:"100%"}),[d.bg,d.border,d.fg,y.fontSize,y.gap,y.paddingX,y.paddingY,y.radius,i]),T=useMemo(()=>css({display:"flex",alignItems:"flex-start",gap:y.gap,minWidth:0,flex:1}),[y.gap]),E=useMemo(()=>[lu,{color:d.iconColor}],[d.iconColor]),M=useMemo(()=>css({display:"flex",alignItems:"center",gap:y.gap,marginLeft:y.gap,flex:"0 0 auto"}),[y.gap]),$=useMemo(()=>[cu,{color:d.fg}],[d.fg]),K=useMemo(()=>({fg:d.fg,iconColor:d.iconColor,s:y,titleId:R,descId:k}),[d.fg,d.iconColor,y,R,k]),W=de.Children.toArray(u).some(F=>de.isValidElement(F)&&F.type===is),S=de.Children.toArray(u).some(F=>de.isValidElement(F)&&F.type===ls);return jsx(Ja.Provider,{value:K,children:jsxs("div",{ref:b,role:m,"aria-live":m==="alert"?"assertive":"polite","aria-atomic":"true","aria-busy":s,"aria-labelledby":W?R:void 0,"aria-describedby":S?k:void 0,className:`plainframe-ui-alert plainframe-ui-alert-${t} plainframe-ui-alert-${n}`,css:[A,l],...p,children:[jsxs("div",{className:"plainframe-ui-alert-left",css:T,children:[C&&jsx("span",{className:"plainframe-ui-alert-icon",css:E,children:C}),jsx("div",{className:"plainframe-ui-alert-content",css:iu,children:u})]}),a&&jsx("div",{className:"plainframe-ui-alert-actions",css:M,children:jsx("button",{type:"button","aria-label":"Close alert",onClick:a,disabled:s,className:"plainframe-ui-alert-close",css:$,children:r??jsx(X,{strokeWidth:2,size:y.iconSize-2})})})]})})});Qa.displayName="Alert";var is=forwardRef(function({children:t,css:n,...o},r){let{fg:a,s:i,titleId:c}=Za(),s=useMemo(()=>css({color:a,fontWeight:i.titleWeight,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),[a,i.titleWeight]);return jsx("span",{ref:r,id:c,className:"plainframe-ui-alert-title",css:[s,n],...o,children:t})});is.displayName="AlertTitle";var ls=forwardRef(function({children:t,css:n,...o},r){let{fg:a,descId:i}=Za(),c=useMemo(()=>css({color:a,marginTop:2,lineHeight:1.35,wordBreak:"break-word"}),[a]);return jsx("span",{ref:r,id:i,className:"plainframe-ui-alert-desc",css:[c,n],...o,children:t})});ls.displayName="AlertDescription";var cs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,jt=e=>e==null?[]:Array.isArray(e)?e:[e],Vt=(...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 a=o.style;return a?.fontSize==null&&(r.style={...a||{},fontSize:t}),cloneElement(e,{...o,...r})}var Zo=de.memo(forwardRef(function({label:t,value:n,defaultValue:o="",onChange:r,placeholder:a,error:i,helperText:c,disabled:s=false,fullWidth:l=false,width:u=250,size:p="md",variant:b="subtle",rounded:f=false,startIcon:R,endIcon:k,togglePasswordVisible:y=false,showClear:x,type:h="text",step:d,focusRingMode:m="always",className:C,wrapperCss:A,inputCss:T,labelCss:E,helperRowCss:M,helperTextCss:$,startIconCss:K,endIconCss:W,css:S,onBlur:F,onFocus:I,onKeyDown:P,autoFocus:D,name:B,id:z,tabIndex:w,autoComplete:g,readOnly:v,required:L,maxLength:H,onSurfaceClick:O},_){let N=j(),U=Xo(),G=useId(),se=useMemo(()=>{let ce={sm:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.sm,labelFont:N.typography.sizes.xs,helperFont:N.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:21},md:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.md,labelFont:N.typography.sizes.sm,helperFont:N.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:24},lg:{fontSize:N.typography.sizes.sm,minHeight:N.componentHeights.lg,labelFont:N.typography.sizes.md,helperFont:N.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:N.spacing.md,iconSize:N.typography.sizes.xs,codeFontSize:28}},Te=["sm","md","lg"].includes(p)?p:"md";return ce[Te]},[p,N]),V=N.neutral,Y=N.text,le=h==="number",ue=h==="password",pe=n!==void 0,[Me,Ce]=useState(o),ve=pe?n:Me,Ee=useCallback(ce=>{pe||Ce(ce),r?.(ce);},[pe,r]),Re=/^-?\d*(?:[.,]\d*)?$/,Z=le&&(d!=null&&String(d).includes(".")||/[.,]/.test(ve??"")),ie=le?Z?"decimal":"numeric":void 0,be=le?Z?"[0-9]*[.,]?[0-9]*":"[0-9]*":void 0,X$1=useCallback(ce=>{(ce===""||Re.test(ce))&&Ee(ce);},[Ee]),ye=s?V[200]:i&&b==="outlined"?N.palette.danger?.[50]??N.surface.panelBg:i&&b==="subtle"?N.palette.danger?.[50]??N.surface.subtleBg:b==="outlined"?N.surface.panelBg:b==="subtle"?N.surface.subtleBg:"transparent",Q=N.componentHeights.border,ne=b==="outlined"?`${Q} solid ${i?N.palette.danger?.[300]??N.surface.border:N.surface.border}`:"none",ae=Vt({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:l?"100%":u!=null?cs(u):void 0,flex:"0 0 auto",fontWeight:500}),me=useMemo(()=>Vt({fontSize:se.labelFont,fontWeight:500,color:i?N.palette.danger?.[700]??Y.primary:s?V[500]:Y.primary,marginBottom:4,display:"inline-block"},...jt(E)),[se.labelFont,i,s,V,Y,N.palette.danger,E]),Ae=useMemo(()=>Vt({display:"flex",alignItems:"center",gap:N.spacing.sm,padding:`${cs(se.paddingY)} ${cs(se.paddingX)}`,background:ye,border:ne,borderRadius:f?N.radius.full:N.radius.md,minHeight:se.minHeight,boxSizing:"border-box",width:"100%",cursor:s?"not-allowed":"text",opacity:s?.65:1,transition:"box-shadow .18s, border-color .16s"},...jt(A),...jt(S)),[N,se.minHeight,se.paddingX,se.paddingY,ye,ne,f,s,A,S]),He=useMemo(()=>Vt({flex:1,minWidth:0,fontSize:se.fontSize,fontWeight:500,fontFamily:"inherit",color:s?V[500]:i?N.palette.danger?.[800]??Y.primary:Y.primary,background:"transparent",border:"none",outline:"none",padding:0,lineHeight:1.25,cursor:s?"not-allowed":"text",appearance:le?"textfield":"auto","&::placeholder":{color:i?N.palette.danger?.[700]??Y.secondary:Y.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${i?N.palette.danger?.[800]??Y.primary:Y.primary} !important`,boxShadow:`0 0 0 1000px ${ye} inset !important`,transition:"opacity 99999s ease-out",caretColor:i?N.palette.danger?.[800]??Y.primary:Y.primary},":focus-within":{outline:"none",border:"none",boxShadow:"none"}},...jt(T)),[se.fontSize,s,V,Y,i,N.palette.danger,le,ye,T]),J=useMemo(()=>Vt({display:"inline-flex",alignItems:"center",color:i?N.palette.danger?.[800]??Y.secondary:Y.secondary,marginLeft:-3},...jt(K)),[i,N.palette.danger,Y.secondary,K]),oe=useMemo(()=>Vt({display:"inline-flex",alignItems:"center",color:i?N.palette.danger?.[800]??Y.secondary:Y.secondary,border:"none",background:"transparent",lineHeight:0,cursor:"inherit",padding:0},...jt(W)),[i,N.palette.danger,Y.secondary,s,W]),re=useMemo(()=>Vt({minHeight:16,fontSize:se.helperFont,color:i?N.palette.danger?.[700]??Y.secondary:Y.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...jt(M)),[se.helperFont,i,N.palette.danger,Y.secondary,M]),Ve=useMemo(()=>Vt({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400},...jt($)),[$]),Le=useRef(null),Et=useCallback(ce=>{Le.current=ce,_&&(typeof _=="function"?_(ce):_.current=ce);},[_]),qn=useCallback(ce=>{let Te=ce.target.value;if(le){X$1(Te);return}H&&Te.length>H||Ee(Te);},[le,H,Ee,X$1]),[Ke,Cn]=useState(false),it=useCallback(()=>{s||Cn(ce=>!ce);},[s]),Rn=useCallback(()=>{s||(Ee(""),Le.current?.focus());},[s,Ee]),St=useMemo(()=>{let ce=se.fontSize;if(typeof ce=="number")return ce;let Te=parseFloat(String(ce));return Number.isFinite(Te)?Te:16},[se.fontSize]),Tn=useMemo(()=>R?jsx("span",{css:J,children:ti(R,St)}):null,[R,J,St]),Gn=useMemo(()=>css({display:"flex",alignItems:"center",gap:4}),[]),Po=useMemo(()=>{let ce=[];if(ue&&y){let lt=Ke?jsx(Eye,{strokeWidth:2.5,size:St}):jsx(EyeOff,{strokeWidth:2.5,size:St});ce.push(jsx("button",{type:"button",css:oe,onMouseDown:Yn=>Yn.preventDefault(),onClick:Yn=>{Yn.stopPropagation(),it();},tabIndex:-1,"aria-label":Ke?"Hide password":"Show password",disabled:s,children:lt},"pw-toggle"));}x&&ve&&ve.length>0&&!s&&ce.push(jsx("button",{type:"button",css:oe,onMouseDown:lt=>lt.preventDefault(),onClick:lt=>{lt.stopPropagation(),Rn();},tabIndex:-1,"aria-label":"Clear",children:jsx(X,{strokeWidth:2.5,size:St})},"clear"));let Te=k?jsx("span",{css:oe,children:ti(k,St)},"user-end"):null,et=ce.length>0,Fe=!!Te;return !et&&!Fe?null:!et&&Fe?Te:et&&!Fe?ce.length===1?ce[0]:jsx("span",{css:Gn,children:ce}):jsxs("span",{css:Gn,children:[ce,Te]})},[ue,y,Ke,St,oe,Gn,s,x,ve,k,it,Rn]),Do=c!=null?`${z??G}-help`:void 0,Xn=z??G,Ue=useCallback(ce=>{if(s)return;ce.stopPropagation();let Te=Le.current;if(!Te)return;let et=ce.target;if(!(Te.contains(et)||et.closest("button,[role='button']"))){if(document.activeElement===Te){ce.preventDefault();return}ce.preventDefault();}},[s]),dt=useCallback(ce=>{if(s)return;let Te=Le.current;if(Te&&(O?.(ce),document.activeElement!==Te)){Te.focus({preventScroll:true});try{let et=Te.value?.length??0;Te.setSelectionRange?.(et,et);}catch{}}},[s,O]);return jsxs("div",{className:["plainframe-ui-textfield",C||""].join(" ").trim(),css:ae,children:[t&&jsx("label",{htmlFor:Xn,className:"plainframe-ui-textfield-label",css:me,children:t}),jsxs("div",{className:"plainframe-ui-textfield-surface",css:[U({enabled:m!=="none",color:i?"danger":void 0}),Ae],onPointerDownCapture:Ue,onClick:dt,"aria-invalid":!!i||void 0,children:[Tn,jsx("input",{ref:Et,id:Xn,className:"plainframe-ui-textfield-input",css:He,type:ue?Ke?"text":"password":h==="number"?"text":h,inputMode:ie,pattern:be,value:ve,maxLength:le?void 0:H,onChange:le?ce=>X$1(ce.target.value):qn,placeholder:a||"",disabled:s,onBlur:F,onFocus:I,onKeyDown:P,autoFocus:D,name:B,tabIndex:w,autoComplete:g,readOnly:v,required:L,"aria-invalid":!!i||void 0,"aria-describedby":Do}),Po]}),c!=null&&jsx("div",{className:"plainframe-ui-textfield-helper-row",css:re,children:jsx("span",{id:Do,className:"plainframe-ui-textfield-helper-text",css:Ve,children:c})})]})}));Zo.displayName="TextField";var Qo=de.createContext("ghost"),gt=de.createContext(false),ai=forwardRef(function({variant:t="ghost",size:n="md",width:o,maxHeight:r,unstyled:a=false,className:i,css:c,children:s,label:l,allItemsTabbable:u=false,...p},b){let f=j(),[R,k]=useState(false),y=useRef(null),x=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=a?void 0:css({background:h,border:t==="outlined"?`${f.componentHeights.border} solid ${f.surface.border}`:"none",borderRadius:f.radius.lg,"--pfui-panel-pad":x,padding:t==="ghost"?0:"var(--pfui-panel-pad)",color:f.text.primary,width:"100%",maxHeight:r,overflowY:r!=null?"auto":void 0,display:"flex",flexDirection:"column",outline:"none",position:"relative","&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),m=n==="sm",C=useMemo(()=>({isKeyboardNav:R,setIsKeyboardNav:k}),[R]),A=useMemo(()=>({allItemsTabbable:u}),[u]),T=useCallback(I=>Array.from(I.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(P=>{if(P.closest('[role="menu"]')!==I)return false;let D=window.getComputedStyle(P);return D.display!=="none"&&D.visibility!=="hidden"}),[]),E=useCallback(I=>{I.removeAttribute("data-keyboard-nav"),I.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),k(false);},[]),M=useRef(false),$=useCallback(I=>{if(I.target!==I.currentTarget)return;if(M.current){M.current=false;return}let P=I.currentTarget,D=T(P);D.length>0&&(k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(B=>B.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(B=>B.removeAttribute("data-hovered")),D[0].setAttribute("data-highlighted",""),D[0].focus({preventScroll:true}));},[T]),K=useCallback(I=>{let P=I.currentTarget,D=T(P);if(D.length===0)return;if(I.key==="Tab"){M.current=true,P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),P.tabIndex=-1,requestAnimationFrame(()=>{P.tabIndex=0,M.current=false;});return}let B=P.querySelector("[data-highlighted]"),z=P.querySelector("[data-hovered]"),w=B||z,g=w?D.indexOf(w):-1;if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(H=>H.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(H=>H.removeAttribute("data-hovered")),g===-1&&(g=I.key==="ArrowDown"?-1:D.length);let v=I.key==="ArrowDown"?1:-1,L=(g+v+D.length)%D.length;D[L].setAttribute("data-highlighted",""),D[L].focus({preventScroll:true});return}if(I.key==="Home"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),D[0].setAttribute("data-highlighted",""),D[0].focus({preventScroll:true});return}if(I.key==="End"){I.preventDefault(),I.stopPropagation(),k(true),P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(v=>v.removeAttribute("data-hovered")),D[D.length-1].setAttribute("data-highlighted",""),D[D.length-1].focus({preventScroll:true});return}if(I.key==="Escape"){I.preventDefault(),P.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted")),k(false),P.blur();return}},[T]),W=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&E(P);},[E]),S=useCallback(I=>{let P=I.currentTarget;P.hasAttribute("data-keyboard-nav")&&E(P);},[E]),F=useCallback(I=>{y.current=I,typeof b=="function"?b(I):b&&(b.current=I);},[b]);return jsx(eo.Provider,{value:C,children:jsx(to.Provider,{value:A,children:jsx(gt.Provider,{value:m,children:jsx(Qo.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":R?"":void 0,tabIndex:0,"aria-label":l||void 0,className:["plainframe-ui-menu",i||""].join(" ").trim(),css:[d,c],onFocus:$,onKeyDown:K,onPointerMove:W,onPointerDown:S,...p,children:s})]})})})})})});ai.displayName="Menu";var li=createContext(null),nr=()=>{let e=useContext(li);if(!e)throw new Error("Popover components must be used inside <Popover>.");return e};function $u(e,t){e&&(typeof e=="function"?e(t):e.current=t);}var ro=(...e)=>t=>{for(let n of e)$u(n,t);},ds=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,zu=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,a=parseFloat(getComputedStyle(t).paddingRight||"0");return t.style.overflow="hidden",r>0&&(t.style.paddingRight=`${a+r}px`),()=>{t.style.overflow=n,t.style.paddingRight=o;}},[e]);},er=(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}},Ou=({open:e,defaultOpen:t,onOpenChange:n,triggerOn:o="click",lockScroll:r=true,trapFocus:a=true,children:i})=>{let[c,s]=useState(!!t),l=e??c,u=y=>{e===void 0&&s(y),n?.(y);},p=useRef(null),b=useRef(null),f=(y=120)=>{b.current!=null&&window.clearTimeout(b.current),b.current=window.setTimeout(()=>u(false),y);},R=()=>{b.current!=null&&(window.clearTimeout(b.current),b.current=null);};zu(r&&l),useEffect(()=>{if(!a||!l||typeof document>"u")return;let y=x=>{if(x.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(T=>{let E=window.getComputedStyle(T);return E.display!=="none"&&E.visibility!=="hidden"});if(d.length===0)return;let m=d[0],C=d[d.length-1],A=document.activeElement;x.shiftKey&&A===m?(x.preventDefault(),C.focus()):!x.shiftKey&&A===C&&(x.preventDefault(),m.focus());};return document.addEventListener("keydown",y,true),()=>document.removeEventListener("keydown",y,true)},[a,l]);let k=useMemo(()=>({open:l,setOpen:u,triggerOn:o,referenceRef:p,scheduleClose:f,cancelClose:R}),[l,o]);return jsx(li.Provider,{value:k,children:i})},ci=forwardRef(({asChild:e=true,children:t,css:n},o)=>{let{open:r,setOpen:a,triggerOn:i,referenceRef:c,scheduleClose:s,cancelClose:l}=nr(),u=de.Children.only(t),p=u.props||{},b=ro(c,o,u.ref),f=i==="click"?{onClick:k=>{k.stopPropagation(),a(!r),p.onClick?.(k);}}:{onMouseEnter:k=>{l(),r||a(true),p.onMouseEnter?.(k);},onMouseLeave:k=>{s(),p.onMouseLeave?.(k);}},R={"aria-haspopup":"dialog","aria-expanded":r};if(e){let k=u.props?.css;return de.cloneElement(u,{...f,...R,ref:b,css:[k,n].filter(Boolean)})}return de.createElement("button",{ref:b,type:"button",css:[n],...f,...R,children:u})});ci.displayName="PopoverTrigger";var ui=forwardRef(({asChild:e=true,width:t,css:n,children:o},r)=>{let{referenceRef:a}=nr(),i=de.Children.only(o),c=ro(a,r,i.ref);if(e){let l=i.props?.css;return de.cloneElement(i,{ref:c,css:[l,n].filter(Boolean)})}let s=css({display:"inline-block",width:ds(t),verticalAlign:"middle",...n});return jsx("span",{ref:c,css:s,children:i})});ui.displayName="PopoverAnchor";function Wu(e){let t=e?.vertical??"bottom",n=e?.horizontal??"center";if(t==="top"||t==="bottom"){let a=t,i=n==="left"?"start":n==="right"?"end":"center";return i==="center"?a:`${a}-${i}`}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:a,width:i,height:c,padding:s,paddingX:l,paddingY:u,radius:p="lg",css:b,...f},R)=>{let{open:k,setOpen:y,triggerOn:x,referenceRef:h,scheduleClose:d,cancelClose:m}=nr(),C=j(),A=Wu(e),{refs:T,x:E,y:M,strategy:$,context:K}=useFloating({open:k,onOpenChange:y,whileElementsMounted:autoUpdate,placement:A,strategy:"fixed",middleware:[offset({mainAxis:t,crossAxis:n}),flip({padding:o}),shift({padding:o})]});useEffect(()=>{h.current&&T.setReference(h.current);},[T,h]);let W=useDismiss(K,{outsidePressEvent:"pointerdown",escapeKey:true}),S=useRole(K,{role:"dialog"}),{getFloatingProps:F}=useInteractions([W,S]),[I]=K.placement.split("-"),P=I,D=`${P==="left"?"right":P==="right"?"left":"center"} ${P==="top"?"bottom":P==="bottom"?"top":"center"}`,B=8,z=P==="top"?{y:B}:P==="bottom"?{y:-B}:P==="left"?{x:B}:{x:-B},w={initial:{opacity:0,scale:.96,...z},animate:{opacity:1,scale:1,x:0,y:0},exit:{opacity:0,scale:.96,...z},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"}}},g=C.surface.panelBg,v=C.text.primary,L=`${C.componentHeights.border} solid ${C.surface.border}`,H=er(s,C.spacing),O=er(l,C.spacing),_=er(u,C.spacing),N={};H&&(N.padding=H),O&&(N.paddingInline=O),_&&(N.paddingBlock=_);let U=er(p,C.radius)??C.radius.md,G="0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)",se=css({position:$,top:M??0,left:E??0,zIndex:1e3,transformOrigin:D,pointerEvents:"auto",display:"inline-flex",flexDirection:"column",width:ds(i)??"fit-content",height:ds(c)??"fit-content",boxSizing:"border-box",willChange:"opacity, transform"}),V=r?css({}):css({background:g,color:v,border:L,borderRadius:U,boxShadow:G,...N,...N.padding||N.paddingInline||N.paddingBlock?{}:{padding:typeof C.spacing?.sm=="number"?`${C.spacing.sm}px ${C.spacing.md}px`:`${C.spacing?.sm??"0.5rem"} ${C.spacing?.md??"1rem"}`}}),Y=x==="hover"?{onMouseEnter:m,onMouseLeave:()=>d()}:{},le=ro(T.setFloating,R),ue=jsx(motion.div,{className:"plainframe-ui-popover",...F({...f,ref:le,...Y}),...w,css:[se,V,b],children:a});return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:k?ue:null})})});di.displayName="PopoverContent";var Ku=()=>{let e=nr();return {open:e.open,close:()=>e.setOpen(false),setOpen:e.setOpen}};var gs=de.memo(forwardRef(function({checked:t,defaultChecked:n=false,onChange:o,disabled:r=false,size:a="md",label:i,className:c,css:s,trackCss:l,thumbCss:u,labelCss:p,...b},f){let R=j(),k=he(),y={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}},x={slideMs:250,pressMs:150,easing:"ease"},h=t!==void 0,[d,m]=useState(n),C=h?!!t:d,[A,T]=useState(false);useEffect(()=>{if(r)return;T(true);let O=setTimeout(()=>T(false),x.pressMs);return ()=>clearTimeout(O)},[C,r]);let E=["sm","md","lg"].includes(a)?a:"md",M=y[E],$=`${x.slideMs}ms ${x.easing}`,K=R.palette?.primary?.[600]??R.neutral[900],W=R.neutral[300],S=C?K:W,F=C?R.text.onColors.primary:"#ffffff",{trackW:I,trackH:P,thumb:D}=M,B=(P-D)/2,z=css({display:"inline-flex",alignItems:"center",gap:M.labelGap,cursor:r?"not-allowed":"pointer",width:"fit-content",padding:R.spacing.xs,borderRadius:R.radius.sm,outline:"none"}),w=css({position:"relative",width:I,height:P,backgroundColor:S,borderRadius:R.radius.xl,transition:`background-color ${$}, opacity 120ms ease`,willChange:"background-color",cursor:r?"not-allowed":"pointer",opacity:r?.5:1}),g=css({position:"absolute",top:B,left:C?I-D-B:B,width:D,height:D,backgroundColor:F,borderRadius:R.radius.xl,transition:`left ${$}, transform ${$}, background-color 0.25s ease`,transform:A?"scaleX(1.2)":"scaleX(1)",transformOrigin:C?"right center":"left center"}),v=css({fontSize:R.typography.sizes.sm,fontWeight:500,color:r?R.text.muted:R.text.primary}),L=()=>{if(r)return;let O=!C;h||m(O),o?.(O);};return jsxs("label",{ref:f,role:"switch","aria-checked":C,"aria-disabled":r||void 0,"data-checked":C?"":void 0,"data-disabled":r?"":void 0,tabIndex:r?-1:0,onClick:L,onKeyDown:O=>{r||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},className:["plainframe-ui-switch",c||""].join(" ").trim(),css:[z,k({color:C?"primary":"neutral"}),s],...b,children:[jsx("div",{className:"plainframe-ui-switch-track",css:[w,l],children:jsx("div",{className:"plainframe-ui-switch-thumb",css:[g,u]})}),i!=null&&jsx("span",{className:"plainframe-ui-switch-label",css:[v,p],children:i})]})}));var Yu=(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},rr=de.memo(forwardRef(({checked:e,defaultChecked:t=false,onChange:n,disabled:o=false,size:r="md",label:a,description:i,rounded:c=false,checkedIcon:s,color:l="primary",css:u,boxCss:p,checkCss:b,labelCss:f,descriptionCss:R,className:k,...y},x)=>{let h=j(),d=he(),m=typeof e=="boolean",[C,A]=useState(t),T=m?e:C,E=r==="sm"||r==="lg"?r:"md",M=useMemo(()=>Yu(h,E),[h,E]),{checkedBg:$,checkColor:K,borderCol:W,hoverBg:S,gapPx:F}=useMemo(()=>{let O=h.palette||{},_=h.neutral||{},N=h.text?.onColors||{},U,G;l==="neutral"||l==="secondary"?(U=_,G="neutral"):typeof l=="string"&&Object.prototype.hasOwnProperty.call(O,l)?(U=O[l]||O.primary||_,G=l):(U=O.primary||_,G="primary");let se=U[600]??U[500]??U[400]??Object.values(U)[0]??h.palette.primary[600],V=N[G]??N.primary??h.text?.onColors?.primary??h.text.primary,Y=typeof M.gap=="number"?M.gap+2:M.gap;return {checkedBg:se,checkColor:V,borderCol:h.surface.border,hoverBg:h.surface.panelHover,gapPx:Y}},[M.gap,l,h]),I=useMemo(()=>css({display:"inline-flex",alignItems:a&&i?"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:W,backgroundColor:S},"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)"}}),[W,$,i,o,F,S,a,h.radius.sm,h.spacing.xs]),P=useMemo(()=>css({position:"absolute",opacity:0,width:0,height:0,margin:0,padding:0,pointerEvents:"none"}),[]),D=useMemo(()=>css({width:M.box,height:M.box,display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:"transparent",outline:`${M.borderWidth} solid ${W}`,outlineOffset:`-${M.borderWidth}`,boxShadow:"inset 0 0 0 0.5px var(--pfui-bleed, transparent)",borderRadius:c?h.radius.full:M.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"}),[M.box,M.borderRadius,M.borderWidth,W,c,h.radius.full]),B=useMemo(()=>({w:Math.round(M.box*M.iconRatioW),h:Math.round(M.box*M.iconRatioH)}),[M.box,M.iconRatioH,M.iconRatioW]),z=useMemo(()=>css({width:B.w,height:B.h,transition:"opacity .14s ease, transform .14s ease",color:K,display:"flex",alignItems:"center",justifyContent:"center",lineHeight:0,pointerEvents:"none","& > svg, & > img":{width:"100%",height:"100%",display:"block"}}),[K,B.h,B.w]),w=useMemo(()=>css({display:"flex",flexDirection:"column",minWidth:0,userSelect:"text",WebkitUserSelect:"text"}),[]),g=useMemo(()=>css({fontSize:M.labelFont,lineHeight:1.1,fontWeight:500,userSelect:"text",WebkitUserSelect:"text",color:h.text.primary}),[M.labelFont,h.text.primary]),v=useMemo(()=>css({fontSize:M.labelFont,lineHeight:1.25,color:h.text.secondary,fontWeight:400,marginTop:a&&i?h.spacing.xs:0,userSelect:"text",WebkitUserSelect:"text"}),[M.labelFont,i,a,h.spacing.xs,h.text.secondary]),L=useCallback(()=>{o||(m?n?.(!T):A(O=>{let _=!O;return n?.(_),_}));},[o,m,T,n]),H=useCallback(O=>{o||(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),L());},[o,L]);return jsxs("label",{ref:x,role:"checkbox","aria-checked":T,"aria-disabled":o||void 0,"data-state":T?"checked":"unchecked",className:["plainframe-ui-checkbox",k||""].join(" ").trim(),css:[I,d({color:T?"primary":"neutral"}),u,o?css({opacity:.6}):null],"data-disabled":o?"true":"false",tabIndex:o?-1:0,onKeyDown:H,children:[jsx("input",{type:"checkbox",checked:T,onChange:L,disabled:o,css:P,...y,tabIndex:-1}),jsx("span",{className:"plainframe-ui-checkbox-box",css:[D,p],"aria-hidden":"true",children:jsx("span",{className:"plainframe-ui-checkbox-check",css:[z,b],children:T&&(s||jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:K,strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",css:css({width:"100%",height:"100%",display:"block"}),"aria-hidden":"true",focusable:"false",children:jsx("polyline",{points:"20 6 9 17 4 12"})}))})}),(a||i)&&jsxs("span",{className:"plainframe-ui-checkbox-text",css:w,children:[a&&jsx("span",{className:"plainframe-ui-checkbox-label",css:[g,f],children:a}),i&&jsx("span",{className:"plainframe-ui-checkbox-description",css:[v,R],children:i})]})]})}));rr.displayName="Checkbox";var Qu=()=>useContext(ln),ed=()=>useContext(to),td=()=>useContext(lr),sn=null,bi=(e,t=35)=>{sn!==null&&window.clearTimeout(sn),sn=window.setTimeout(()=>{e(),sn=null;},t);},so=()=>{sn!==null&&(window.clearTimeout(sn),sn=null);},Mt=de.forwardRef(function({disabled:t=false,destructive:n=false,inset:o,closeOnSelect:r=true,onSelect:a,children:i,className:c,css:s,startIcon:l,endIcon:u,selected:p=false,active:b,meta:f,__index:R,__skipListReg:k,...y},x){let h=Qu(),d=td(),m=ir(),C=io(),A=ed(),T=j(),M=!!useContext(gt),$=y["data-subtrigger"]!==void 0,K=$&&u===void 0?jsx(ChevronRight,{size:18,strokeWidth:2.5}):u,S=typeof o=="number"?o:o===false?0:0,F=useContext(Qo),I=F==="subtle"?T.surface?.subtleHover??T.neutral[100]:T.surface?.subtleBg??T.neutral[100],P=useMemo(()=>css({width:"100%",borderRadius:T.radius.md,padding:`${T.spacing.sm} ${T.spacing.sm}`,paddingLeft:S>0?`calc(${T.spacing.md} + (${T.spacing.xl} * ${S}))`:T.spacing.md,minHeight:M?T.componentHeights.sm:T.componentHeights.md,display:"flex",alignItems:"center",gap:T.spacing.sm,fontWeight:500,fontSize:T.typography.sizes.sm,cursor:t?"not-allowed":"pointer",opacity:t?.55:1,userSelect:"none",background:"transparent",color:n?T.palette.danger[800]:T.text.primary,transition:"background-color .16s ease, color .16s ease",outline:"none","[role='menu']:not([data-keyboard-nav]) &:hover":t?{}:{background:n?T.palette.danger[50]:I},"&[data-highlighted]":t?{}:{background:n?T.palette.danger[50]:I},"&[data-active]":t?{}:{background:n?T.palette.danger[50]:I},"&[data-subtrigger][aria-expanded='true']":t?{}:{background:n?T.palette.danger[50]:I},"[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:T.surface.border},"& > [data-label]":{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),[T,M,S,t,n,I]),D=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"}}),[]),B=useMemo(()=>css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,whiteSpace:"nowrap",lineHeight:0,gap:T.spacing.sm,"& > svg":{width:16,height:16,display:"block"},color:T.text.secondary}),[T.text.secondary,T.spacing.sm]),z=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:T.palette.primary[600],"& > svg":{width:16,height:16,display:"block"}}),[T.palette.primary]),w=[];M&&w.push({minHeight:T.componentHeights.sm,paddingLeft:T.spacing.sm,paddingRight:T.spacing.xs,paddingTop:T.spacing.xs,paddingBottom:T.spacing.xs});let g=()=>{a?.(),r&&!$&&d?.closeAll();},v=(H,O)=>{let _=H.closest('[role="menu"]');if(!_)return;let N=Array.from(_.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(Y=>{if(Y.closest('[role="menu"]')!==_)return false;let le=window.getComputedStyle(Y);return le.display!=="none"&&le.visibility!=="hidden"});if(!N.length)return;let U=N.indexOf(H),G=U>=0?U:0,se=O(N.length,G),V=N[se];V&&(document.querySelectorAll("[data-highlighted]").forEach(Y=>{Y.removeAttribute("data-highlighted");}),V.setAttribute("data-highlighted",""),V.focus(),h&&R!=null&&h.setActiveIndex(se));},L=t?-1:A?.allItemsTabbable?0:-1;return jsxs("div",{role:"menuitem","aria-disabled":t||void 0,"data-disabled":t?"":void 0,"data-active":b?"":void 0,tabIndex:L,ref:H=>{if(h&&!k){let O=h.listRef.current;H&&(R!=null?O[R]=H:O.includes(H)||O.push(H));}typeof x=="function"?x(H):x&&"current"in x&&(x.current=H);},onMouseMove:H=>{if(H.currentTarget.hasAttribute("data-hovered"))return;let O=!!H.currentTarget.closest("[data-submenu-content]");!$&&m&&!O&&bi(m.closeAllSubMenus),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");}),H.currentTarget.setAttribute("data-hovered","");let _=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');_?.hasAttribute("data-keyboard-nav")&&_.removeAttribute("data-keyboard-nav"),!t&&h&&R!=null&&h.setActiveIndex(R),!t&&!A?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onMouseEnter:H=>{if($)so();else {let N=!!H.currentTarget.closest("[data-submenu-content]");m&&!N&&bi(m.closeAllSubMenus);}H.currentTarget.hasAttribute("data-hovered")||(document.querySelectorAll("[data-highlighted]").forEach(N=>{N.removeAttribute("data-highlighted");}),document.querySelectorAll("[data-hovered]").forEach(N=>{N.removeAttribute("data-hovered");}),document.querySelectorAll("[data-active]").forEach(N=>{N.removeAttribute("data-active");})),H.currentTarget.setAttribute("data-hovered","");let _=H.currentTarget.closest("[data-menu-id]")||H.currentTarget.closest('[role="menu"]');!t&&h&&R!=null&&(_?.hasAttribute("data-keyboard-nav")&&(_.removeAttribute("data-keyboard-nav"),C&&C.setIsKeyboardNav(false)),h.setActiveIndex(R)),!t&&!A?.allItemsTabbable&&H.currentTarget.focus({preventScroll:true});},onFocus:()=>{},onMouseLeave:()=>{h&&h.setActiveIndex(null);},onKeyDown:H=>{if(t)return;let O=H.currentTarget;if(H.key==="Tab"&&h&&!A?.allItemsTabbable){H.preventDefault();return}if(H.key==="Tab"&&!h){let _=O.closest('[role="menu"]');if(_){_.removeAttribute("data-keyboard-nav"),document.querySelectorAll("[data-highlighted]").forEach(U=>U.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(U=>U.removeAttribute("data-hovered"));let N=_.tabIndex;_.tabIndex=-1,requestAnimationFrame(()=>{_.tabIndex=N>=0?N:0;});}C&&C.setIsKeyboardNav(false);return}if(H.key==="Enter"||H.key===" "||H.key==="ArrowRight"){$||H.key!=="ArrowRight"&&(H.preventDefault(),H.stopPropagation(),g());return}if(H.key==="ArrowLeft"&&O.closest('[role="menu"]')?.closest("[data-submenu-content]")){H.preventDefault(),H.stopPropagation();let U=document.querySelector('[data-subtrigger][aria-expanded="true"]');if(U){let G=U.__pfuiCloseSubmenu;G&&G(),document.querySelectorAll("[data-highlighted]").forEach(V=>V.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(V=>V.removeAttribute("data-hovered")),U.setAttribute("data-highlighted",""),U.focus();let se=U.closest("[data-menu-id]");se&&se.setAttribute("data-keyboard-nav","");}return}if(H.key==="Escape"){H.preventDefault(),H.stopPropagation(),d?.closeAll(),O.closest('[role="menu"]')&&document.querySelector('[aria-expanded="true"][aria-haspopup="menu"]')?.focus();return}if(H.key==="ArrowDown"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U+1)%N);return}if(H.key==="ArrowUp"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');if(!_)return;_.setAttribute("data-keyboard-nav",""),C&&C.setIsKeyboardNav(true),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,(N,U)=>(U-1+N)%N);return}if(H.key==="Home"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,()=>0);return}if(H.key==="End"){H.preventDefault(),H.stopPropagation();let _=O.closest("[data-menu-id]")||O.closest('[role="menu"]');_&&_.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(N=>N.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(N=>N.removeAttribute("data-hovered")),v(O,N=>N-1);return}},className:["plainframe-ui-menu-item",c||""].join(" ").trim(),css:css(...[P,...w,s].flat()),...y,onClick:H=>{t||(H.currentTarget.removeAttribute("data-highlighted"),g());},children:[l&&jsx("span",{className:"plainframe-ui-menu-item-start",css:D,children:l}),i,(f!=null||K||p)&&jsxs("span",{className:"plainframe-ui-menu-item-end",css:B,children:[f!=null?jsx("span",{className:"plainframe-ui-menu-item-meta",css:css({lineHeight:1,fontSize:T.typography.sizes.sm,color:T.text.secondary,whiteSpace:"nowrap"}),children:f}):null,K,p&&jsx("span",{className:"plainframe-ui-menu-item-selected",css:z,children:jsx(Check,{size:16,strokeWidth:2.5})})]})]})}),yi=de.createContext(null),hs=({values:e,defaultValues:t,onValuesChange:n,children:o})=>{let[r,a]=useState(t??[]),i=e!==void 0,c=i?e:r,s=useRef(c);s.current=c;let l=useRef(n);l.current=n;let u=useCallback(b=>{let f=s.current,k=f.some(y=>Object.is(y,b))?f.filter(y=>!Object.is(y,b)):[...f,b];i||a(k),l.current?.(k);},[i]),p=useMemo(()=>({values:c,toggle:u}),[c,u]);return jsx(yi.Provider,{value:p,children:o})},ao=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,value:r,children:a,__index:i,disabled:c=false,css:s,className:l,startIcon:u,endIcon:p,...b},f){let R=useContext(yi),k=!!R&&r!==void 0,y=!k&&t!==void 0,[x,h]=useState(()=>k?R.values.some(W=>Object.is(W,r)):!!n),d=k?R.values.some(W=>Object.is(W,r)):y?!!t:x,m=j(),A=!!useContext(gt),T=()=>{if(!c)if(k)R.toggle(r);else {let W=!d;y||h(W),o?.(W);}},E=css({width:18,height:18,display:"inline-flex",alignItems:"center",justifyContent:"center",flex:"0 0 auto",lineHeight:0,marginLeft:A?-1:-3,borderRadius:m.radius.xs,transition:"background-color .12s ease"}),M=css({pointerEvents:"none"}),$=useCallback(W=>{W&&(W.querySelectorAll("[tabindex]").forEach(S=>{S.tabIndex=-1;}),W.querySelectorAll('input, button, a, [role="checkbox"]').forEach(S=>{S.tabIndex=-1;}));},[]),K=jsxs(Fragment,{children:[jsx("span",{ref:$,"data-menu-checkbox-wrapper":true,className:"plainframe-ui-menu-checkbox-wrapper",css:E,"aria-hidden":"true",children:jsx(rr,{size:"sm",checked:d,css:M})}),u]});return jsx(Mt,{...b,className:["plainframe-ui-menu-checkbox-item",l||""].join(" ").trim(),ref:f,__index:i,role:"menuitemcheckbox","aria-checked":d,closeOnSelect:false,onSelect:T,disabled:c,startIcon:K,endIcon:p,css:s,selected:false,children:a})});ao.displayName="MenuCheckboxItem";var xi=forwardRef(function({checked:t,defaultChecked:n=false,onCheckedChange:o,children:r,__index:a,disabled:i=false,css:c,switchSize:s="md",switchCss:l,startIcon:u,className:p,...b},f){let R=t!==void 0,[k,y]=useState(!!n),x=R?!!t:k,d=!!useContext(gt),m=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),C=css({marginLeft:"auto",display:"inline-flex",alignItems:"center",justifyContent:"flex-end",flex:"0 0 auto",flexShrink:0,paddingRight:d?2:void 0}),A=()=>{if(i)return;let E=!x;R||y(E),o?.(E);},T=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(Mt,{...b,className:["plainframe-ui-menu-switch-item",p||""].join(" ").trim(),ref:f,__index:a,disabled:i,closeOnSelect:false,onSelect:A,css:c,selected:false,children:[u&&jsx("span",{className:"plainframe-ui-menu-item-start",css:T,children:u}),jsx("span",{"data-label":true,css:m,className:"plainframe-ui-menu-item-label",children:r}),jsx("span",{className:"plainframe-ui-menu-switch-wrap",css:C,children:jsx(gs,{checked:x,css:css({pointerEvents:"none",padding:0,marginRight:-1},l),className:"plainframe-ui-menu-switch",tabIndex:-1,size:s})})]})});xi.displayName="MenuSwitchItem";var vi=de.createContext(null),Ci=({value:e,defaultValue:t,onValueChange:n,children:o})=>{let[r,a]=useState(t),i=e??r,c=l=>{e!==void 0||a(l),n?.(l);},s=useMemo(()=>({value:i,onChange:c}),[i]);return jsx(vi.Provider,{value:s,children:o})};Ci.displayName="MenuRadioGroup";var nd=forwardRef(function({value:t,children:n,__index:o,disabled:r=false,css:a,className:i,...c},s){let l=useContext(vi),u=l?.value===t,p=j(),b=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:u?"scale(1)":"scale(0.4)",opacity:u?1:0,transition:"transform 140ms ease-out, opacity 140ms linear",transformOrigin:"center center"}),R=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"});return jsxs(Mt,{...c,className:["plainframe-ui-menu-radio-item",i||""].join(" ").trim(),ref:s,__index:o,role:"menuitemradio","aria-checked":u,closeOnSelect:false,onSelect:()=>{r||l?.onChange?.(t);},disabled:r,css:a,selected:false,children:[jsx("span",{className:"plainframe-ui-menu-radio-dotbox",css:b,children:jsx("span",{className:"plainframe-ui-menu-radio-dot",css:f})}),jsx("span",{className:"plainframe-ui-menu-item-label",css:R,children:n})]})}),an=forwardRef(function({inset:t,className:n,css:o,children:r,startIcon:a,endIcon:i,wrap:c=false,color:s="primary",...l},u){let p=j(),f=!!useContext(gt),R=s==="primary"?p.text.primary:s==="secondary"?p.text.secondary:p.palette[s]?.[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:R,fontWeight:500,...t?{paddingLeft:`calc(${p.spacing.lg} * 2)`}:null,gap:p.spacing.xs}),y=css({flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:c?"normal":"nowrap"}),x=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:u,role:"presentation",className:["plainframe-ui-menu-label",n||""].join(" ").trim(),css:css(k,o),...l,children:[a&&jsx("span",{className:"plainframe-ui-menu-label-start",css:x,children:a}),jsx("span",{className:"plainframe-ui-menu-label-text",css:y,children:r}),i&&jsx("span",{className:"plainframe-ui-menu-label-end",css:h,children:i})]})});an.displayName="MenuLabel";var od=({className:e,css:t,variant:n="full",...o})=>{let r=j(),a=`var(--pfui-panel-pad, ${typeof r.spacing.xs=="number"?r.spacing.xs+"px":String(r.spacing.xs)})`,i=css({height:1,background:r.surface.border,marginTop:a,marginBottom:a,marginLeft:"calc(var(--pfui-panel-pad, 0px) * -1)",marginRight:"calc(var(--pfui-panel-pad, 0px) * -1)"}),c=css({height:1,background:r.surface.border,marginTop:a,marginBottom:a,marginLeft:`${r.spacing.md}`,marginRight:`${r.spacing.md}`}),s=css({height:1,background:r.surface.border,marginTop:a,marginBottom:a,marginLeft:`${r.spacing.lg}`,marginRight:0}),l=n==="full"?i:n==="middle"?c:s;return jsx("div",{role:"separator",className:["plainframe-ui-menu-separator",e||""].join(" ").trim(),css:css(l,t),...o})};var dr=ro,lo=0,cr=null,ur=null,bd=()=>typeof window>"u"||typeof document>"u"?0:window.innerWidth-document.documentElement.clientWidth;function hd(){if(!(typeof document>"u")){if(lo===0){let e=document.body;cr=e.style.overflow||"",ur=e.style.paddingRight||"";let t=bd();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}lo+=1;}}function yd(){if(!(typeof document>"u")&&(lo>0&&(lo-=1),lo===0)){let e=document.body;cr!==null&&(e.style.overflow=cr),ur!==null&&(e.style.paddingRight=ur),cr=null,ur=null;}}var ln=createContext(null),pr=()=>{let e=useContext(ln);if(!e)throw new Error("DropdownMenu components must be used inside <DropdownMenu>.");return e},co=createContext(null),xd=()=>useContext(co),eo=createContext(null),io=()=>useContext(eo),Ti=createContext(null),ir=()=>useContext(Ti),wi=createContext(false),vd=()=>useContext(wi),to=createContext({allItemsTabbable:true}),lr=de.createContext(null),ys=()=>useContext(lr);function Cd(){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 Rd=()=>xd()?.activeIndex??null,Ei=0,Pn=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="click",lockScroll:r=true,size:a="md",children:i})=>{let[c,s]=useState(!!t),l=e??c,u=useCallback(F=>{e===void 0&&s(F),n?.(F);},[e,n]),p=useRef(`pfui-menu-${++Ei}`),b=useRef(null),f=useRef([]),R=useRef(null),[k,y]=useState(null),[x,h]=useState(false);useEffect(()=>{l||(y(null),f.current=[],h(false));},[l]);let d=useRef(null),m=useCallback((F,I)=>{if(o!=="hover")return;window.clearTimeout(d.current??0);let P=I??20;d.current=window.setTimeout(()=>u(F),P);},[o,u]),C=useCallback(()=>{d.current&&(window.clearTimeout(d.current),d.current=null);},[]);useEffect(()=>()=>C(),[C]),useEffect(()=>{if(!(!r||!l))return hd(),()=>yd()},[l,r]);let A=ys(),[T]=useState(()=>A??Cd()),E=useRef(new Set),M=useMemo(()=>({registerSubMenu:F=>(E.current.add(F),()=>E.current.delete(F)),closeAllSubMenus:()=>{E.current.forEach(F=>F());}}),[]),$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:b,listRef:f,floatingRef:R,setActiveIndex:y,scheduleSubmenuHover:m,clearSubmenuHover:C,menuId:p.current}),[l,u,o,y,m,C]),K=useMemo(()=>({activeIndex:k,setActiveIndex:y}),[k,y]),W=useMemo(()=>({isKeyboardNav:x,setIsKeyboardNav:h}),[x]),S=a==="sm";return jsx(lr.Provider,{value:T,children:jsx(gt.Provider,{value:S,children:jsx(eo.Provider,{value:W,children:jsx(Ti.Provider,{value:M,children:jsx(co.Provider,{value:K,children:jsx(ln.Provider,{value:$,children:i})})})})})})};Pn.displayName="DropdownMenu";var Dn=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...a},i)=>{let{open:c,setOpen:s,trigger:l,referenceRef:u,listRef:p,setActiveIndex:b,scheduleSubmenuHover:f,clearSubmenuHover:R,floatingRef:k,menuId:y}=pr(),x=io(),h=ir(),d=!!e&&isValidElement(t),m=d?t:null,C=m&&m.props&&typeof m.props=="object"&&"onKeyDown"in m.props?m.props.onKeyDown:void 0,A=m&&m.props&&typeof m.props=="object"&&"onClick"in m.props?m.props.onClick:void 0,{onKeyDown:T,onClick:E,...M}=a,$=useMemo(()=>dr(i,d&&isValidElement(t)&&"ref"in t?t.ref:void 0,u),[i,d,t,u]),K=useCallback(()=>p.current.filter(Boolean),[p]),W=useCallback(D=>{let B=K();requestAnimationFrame(()=>B[D]?.focus());},[K]),S=useCallback(D=>{if(D.key==="Tab"&&c){D.preventDefault(),x?.setIsKeyboardNav(true);let B=k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=B.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])');z&&(document.querySelectorAll("[data-highlighted]").forEach(w=>w.removeAttribute("data-highlighted")),z.setAttribute("data-highlighted",""),z.focus());}return}if(D.key==="ArrowRight"&&c){let B=document.querySelector("[data-subtrigger][data-hovered]");if(B){D.preventDefault(),D.stopPropagation(),x?.setIsKeyboardNav(true),B.removeAttribute("data-hovered"),B.setAttribute("data-highlighted",""),B.focus(),requestAnimationFrame(()=>{let z=new KeyboardEvent("keydown",{key:"ArrowRight",bubbles:true,cancelable:true});B.dispatchEvent(z);});return}}if(D.key==="ArrowDown"||D.key==="ArrowUp"){if(x?.setIsKeyboardNav(true),!c){D.preventDefault(),s(true),requestAnimationFrame(()=>{let B=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=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(w=>{let g=w.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});if(z.length>0){let w=D.key==="ArrowDown"?0:z.length-1;b(w),z[w]?.setAttribute("data-highlighted",""),z[w]?.focus();}}}),C?.(D),T?.(D);return}if(c){D.preventDefault();let B=document.querySelectorAll("[data-hovered]");for(let w of Array.from(B))if(w.closest("[data-submenu-content]")){let v=w.closest('[role="menu"]');if(v){v.setAttribute("data-keyboard-nav","");let L=Array.from(v.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled])')).filter(O=>{if(O.closest('[role="menu"]')!==v)return false;let _=window.getComputedStyle(O);return _.display!=="none"&&_.visibility!=="hidden"}),H=L.indexOf(w);if(document.querySelectorAll("[data-highlighted]").forEach(O=>O.removeAttribute("data-highlighted")),w.removeAttribute("data-hovered"),H!==-1&&L.length>0){let O=D.key==="ArrowDown"?1:-1,_=(H+O+L.length)%L.length;L[_]?.setAttribute("data-highlighted",""),L[_]?.focus();}return}}let z=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(z){z.setAttribute("data-keyboard-nav",""),h?.closeAllSubMenus();let w=Array.from(z.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"]')!==z)return false;let v=window.getComputedStyle(g);return v.display!=="none"&&v.visibility!=="hidden"});if(w.length>0){let g=z.querySelector("[data-highlighted]"),v=z.querySelector("[data-hovered]"),L=-1;g?L=w.indexOf(g):v&&(L=w.indexOf(v)),document.querySelectorAll("[data-highlighted]").forEach(_=>_.removeAttribute("data-highlighted")),v&&v.removeAttribute("data-hovered"),L===-1&&(L=D.key==="ArrowDown"?-1:w.length);let H=D.key==="ArrowDown"?1:-1,O=(L+H+w.length)%w.length;b(O),w[O]?.setAttribute("data-highlighted",""),w[O]?.focus();}}C?.(D),T?.(D);return}}if((D.key==="Enter"||D.key===" ")&&!c){D.preventDefault(),x?.setIsKeyboardNav(true),s(true),requestAnimationFrame(()=>{let B=y?document.querySelector(`[data-menu-id="${y}"]`):k?.current;if(B){B.setAttribute("data-keyboard-nav","");let z=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(w=>{let g=w.closest("[data-submenu-content]");if(g&&g!==B)return false;let v=window.getComputedStyle(w);return v.display!=="none"&&v.visibility!=="hidden"});z.length>0&&(b(0),z[0]?.setAttribute("data-highlighted",""),z[0]?.focus());}}),C?.(D),T?.(D);return}C?.(D),T?.(D);},[c,s,b,C,T,K,W,p,x,y,k,h]),F=useCallback(D=>{l==="click"&&((D.nativeEvent.composedPath?.()??[]).some(g=>{let v=g;if(!v||!("tagName"in v))return false;let L=String(v.tagName).toUpperCase();if(L==="INPUT"||L==="TEXTAREA"||"isContentEditable"in v&&v.isContentEditable)return true;let H="getAttribute"in v?v.getAttribute("role"):null;return H==="textbox"||H==="combobox"})||(D.stopPropagation(),s(!c))),A?.(D),E?.(D);},[l,c,s,A,E]),I=l==="hover"?{onMouseEnter:()=>{R(),s(true);},onMouseLeave:()=>{f(false);}}:{},P=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0;if(d&&m){let D=m.props,B=D.css,z=typeof D.className=="string"?D.className:void 0,w=typeof D.tabIndex=="number"?D.tabIndex:0,g={ref:$,tabIndex:w,className:[z,o].filter(Boolean).join(" ")||void 0,css:[B,P,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,onClick:F,onKeyDown:S,...I,...M};return cloneElement(m,g)}return jsx("button",{ref:$,className:o,css:[css({display:"inline-block"}),P,r],type:"button",tabIndex:0,"aria-haspopup":"menu","aria-expanded":c,onClick:F,onKeyDown:S,...I,...M,children:t})});Dn.displayName="DropdownMenuTrigger";var dn=de.forwardRef(({anchor:e,side:t="bottom",align:n="start",sideOffset:o=6,alignOffset:r=0,collisionPadding:a=8,sameWidth:i=false,width:c,height:s,maxHeight:l,unstyled:u=false,closeOnBlur:p=false,allItemsTabbable:b=false,className:f,css:R,children:k,exitPlacement:y,animateOnBusClose:x=true,gap:h,ignoreOutsidePressRefs:d,disableOutsidePressDismiss:m=false,returnFocus:C=false,...A},T)=>{let{open:E,setOpen:M,referenceRef:$,clearSubmenuHover:K,setActiveIndex:W,floatingRef:S,menuId:F}=pr(),I=j(),P=ys(),D=io();useEffect(()=>{if(!P)return;let J=P.registerCloser(()=>M(false));return ()=>{J&&J();}},[P,M]);let B=typeof o=="string"?parseFloat(o):o,z=typeof r=="string"?parseFloat(r):r,w=typeof a=="string"?parseFloat(a):a,g=`${t}${n==="center"?"":`-${n}`}`,v=useCallback(J=>({getBoundingClientRect:()=>{let oe=Math.round(J.x),re=Math.round(J.y);return {x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0,toJSON:()=>({x:oe,y:re,left:oe,top:re,right:oe,bottom:re,width:0,height:0})}},contextElement:void 0}),[]),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 J=e;return v({x:J.x,y:J.y})},[e,v]),{refs:H,x:O,y:_,strategy:N,context:U,update:G}=useFloating({open:E,onOpenChange:M,placement:g,whileElementsMounted:autoUpdate,middleware:[offset({mainAxis:B??0,crossAxis:z??0}),flip({padding:w??8}),shift({padding:w??8}),size({apply({rects:J,elements:oe}){let re=oe.floating;re.style.boxSizing="border-box",s!=null?re.style.height=typeof s=="number"?`${s}px`:String(s):re.style.removeProperty("height"),c!=null?re.style.width=typeof c=="number"?`${c}px`:String(c):i?re.style.width=`${Math.round(J.reference.width)}px`:re.style.width="200px",l!=null?re.style.maxHeight=typeof l=="number"?`${l}px`:String(l):re.style.removeProperty("max-height");}})]});useEffect(()=>{L?H.setReference(L):$.current&&H.setReference($.current);},[H,L,$]),useEffect(()=>{if(!E)return;let J=L||$.current,oe=H.floating.current;if(!(!J||!oe))return autoUpdate(J,oe,G)},[E,L,$,H,G]),useEffect(()=>{G();},[G,i,c,s,l]),useEffect(()=>{E&&!b&&W(0);},[E,b,W]),useEffect(()=>{if(!p||!E)return;let J=()=>{let oe=document.activeElement,re=$.current,Ve=H.floating.current;oe&&(re?.contains(oe)||Ve?.contains(oe)||M(false));};return document.addEventListener("focusin",J,true),()=>document.removeEventListener("focusin",J,true)},[p,E,M,$,H.floating]);let se=useDismiss(U,{outsidePressEvent:"pointerdown",escapeKey:true,outsidePress:m?false:J=>{if(d?.length){let oe=J.target;for(let re of d)if(re.current?.contains(oe))return false}return true}}),V=useRole(U,{role:"menu"}),{getFloatingProps:Y}=useInteractions([se,V]),le=useRef(false);useEffect(()=>{E?le.current=true:le.current&&$.current&&C&&(P?.isBusClosingRef.current||requestAnimationFrame(()=>{$.current?.focus();}));},[E,$,P,C]);let ue=typeof I.spacing.xs=="number"?`${I.spacing.xs}px`:String(I.spacing.xs),pe=h===void 0?void 0:typeof h=="number"?h:I.spacing[h]??h,Me=u?void 0:css({boxSizing:"border-box",background:I.surface.panelBg,border:`${I.componentHeights.border} solid ${I.surface.border}`,borderRadius:I.radius.lg,boxShadow:"0 8px 32px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.02)","--pfui-panel-pad":ue,padding:"var(--pfui-panel-pad)",color:I.text.primary,maxHeight:l,overflowY:"auto",display:"flex",flexDirection:"column",gap:pe,"& > *":{flexShrink:0},"&[data-keyboard-nav]":{cursor:"none"},"&[data-keyboard-nav] *":{cursor:"none !important",pointerEvents:"none"}}),Ce=-1,ve=J=>{if(!J||typeof J!="object"||!isValidElement(J))return J;let re=J.type?.displayName;if(re==="DropdownMenu"||re==="DropdownMenuSub")return J;if(re==="MenuItem"||re==="MenuCheckboxItem"||re==="MenuRadioItem"||re==="MenuSwitchItem")return Ce+=1,cloneElement(J,{__index:Ce,key:J.key??Ce});if(re==="DropdownMenuTrigger"){let Le=J.props.children;return cloneElement(J,{children:de.Children.map(Le,ve)})}if(re==="DropdownMenuSubTrigger"){Ce+=1;let Le=Ce;return cloneElement(J,{__index:Le,key:J.key??Le})}let Ve=J.props.children;return Ve==null?J:cloneElement(J,{children:de.Children.map(Ve,ve)})},Ee=de.Children.map(k,ve),Z=U.placement.split("-")[0]||"bottom",ie=Z==="bottom"?"center top":Z==="top"?"center bottom":Z==="left"?"right center":"left center",be=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},X=y??Z,ye=X==="bottom"?{opacity:0,y:-8,scale:.96}:X==="top"?{opacity:0,y:8,scale:.96}:X==="left"?{opacity:0,x:8,scale:.96}:{opacity:0,x:-8,scale:.96},ne=!!P?.isBusClosingRef.current&&!x?{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"}},ae=css({position:N,top:_??0,left:O??0,zIndex:1e3,transformOrigin:ie}),me=useCallback(J=>{if(J.key==="Tab"){J.preventDefault();return}if(J.key==="ArrowDown"||J.key==="ArrowUp"){J.preventDefault(),D?.setIsKeyboardNav(true);let oe=J.currentTarget;oe.setAttribute("data-keyboard-nav","");let re=Array.from(oe.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(Ve=>{if(Ve.closest('[role="menu"]')!==oe)return false;let Le=window.getComputedStyle(Ve);return Le.display!=="none"&&Le.visibility!=="hidden"});if(re.length>0){let Ve=oe.querySelector("[data-highlighted]"),Le=oe.querySelector("[data-hovered]"),Et=-1;Ve?Et=re.indexOf(Ve):Le&&(Et=re.indexOf(Le)),document.querySelectorAll("[data-highlighted]").forEach(Cn=>Cn.removeAttribute("data-highlighted")),Le&&Le.removeAttribute("data-hovered"),Et===-1&&(Et=J.key==="ArrowDown"?-1:re.length);let qn=J.key==="ArrowDown"?1:-1,Ke=(Et+qn+re.length)%re.length;W(Ke),re[Ke]?.setAttribute("data-highlighted",""),re[Ke]?.focus();}}},[D,W]),Ae=useCallback(J=>{let oe=J.currentTarget;oe.removeAttribute("data-keyboard-nav"),oe.querySelectorAll("[data-highlighted]").forEach(re=>re.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]),He=useCallback(J=>{J.removeAttribute("data-keyboard-nav"),J.querySelectorAll("[data-highlighted]").forEach(oe=>oe.removeAttribute("data-highlighted")),D?.isKeyboardNav&&D.setIsKeyboardNav(false);},[D]);return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:E?jsx(to.Provider,{value:{allItemsTabbable:b},children:jsx(motion.div,{...Y({...A,ref:dr(T,H.setFloating,J=>{S&&(S.current=J);})}),"data-menu-id":F,"data-keyboard-nav":D?.isKeyboardNav?"":void 0,className:f,css:[Me,ae,R],initial:be,animate:{opacity:1,x:0,y:0,scale:1},exit:ye,transition:ne,onPointerMove:J=>He(J.currentTarget),onPointerDown:J=>He(J.currentTarget),onKeyDown:me,onMouseMove:Ae,onMouseEnter:()=>{K(),P?.clearAllHover();},onMouseLeave:()=>{document.querySelectorAll("[data-hovered]").forEach(J=>J.removeAttribute("data-hovered"));},children:Ee})}):null})})});dn.displayName="DropdownMenuContent";var Si=({open:e,defaultOpen:t,onOpenChange:n,trigger:o="hover",dense:r,children:a})=>{let i=vd(),[c,s]=useState(!!t),l=e??c,u=useCallback(S=>{e===void 0&&s(S),n?.(S);},[e,n]),p=useRef(null),b=useRef(false),f=useCallback((S,F)=>{if(o!=="hover")return;window.clearTimeout(p.current??0),b.current=S;let I=F??20;p.current=window.setTimeout(()=>{b.current=false,u(S);},I);},[o,u]),R=useCallback(()=>{p.current&&(window.clearTimeout(p.current),p.current=null,b.current=false);},[]);useEffect(()=>()=>R(),[R]);let k=ir();useEffect(()=>{if(!k)return;let S=()=>{R(),u(false);};return k.registerSubMenu(S)},[k,u,R]);let y=useRef(`pfui-submenu-${++Ei}`),x=useRef(null),h=useRef([]),d=useRef(null),[m,C]=useState(null),[A,T]=useState(false);useEffect(()=>{l||(C(null),h.current=[],T(false));},[l]);let E=useContext(gt),M=r??E,$=useMemo(()=>({open:l,setOpen:u,trigger:o,referenceRef:x,listRef:h,floatingRef:d,setActiveIndex:C,scheduleSubmenuHover:f,clearSubmenuHover:R,pendingOpenRef:b,menuId:y.current}),[l,u,o,C,f,R]),K=useMemo(()=>({activeIndex:m,setActiveIndex:C}),[m,C]),W=useMemo(()=>({isKeyboardNav:A,setIsKeyboardNav:T}),[A]);return i?(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:de.Children.map(a,S=>{if(!isValidElement(S))return S;let F=S.type;return F?.displayName==="DropdownMenuSubTrigger"||F?.displayName==="DropdownMenuSubContent"?null:S})})):jsx(wi.Provider,{value:true,children:jsx(gt.Provider,{value:M,children:jsx(co.Provider,{value:K,children:jsx(eo.Provider,{value:W,children:jsx(ln.Provider,{value:$,children:a})})})})})};Si.displayName="DropdownMenuSub";var Ii=de.forwardRef(({asChild:e=true,children:t,width:n,className:o,css:r,...a},i)=>{let{open:c,setOpen:s,trigger:l,referenceRef:u,scheduleSubmenuHover:p,clearSubmenuHover:b,pendingOpenRef:f,menuId:R}=pr(),k=io(),y=useCallback(S=>{S&&(S.__pfuiCloseSubmenu=()=>s(false));},[s]),x=!!e&&isValidElement(t),h=x?t:null,d=h?.props,m=d?.onKeyDown,C=d?.onClick,{onKeyDown:A,onClick:T,...E}=a,M=useMemo(()=>dr(i,x&&isValidElement(t)&&"ref"in t?t.ref:void 0,u,y),[i,x,t,u,y]),$=n!=null?css({width:typeof n=="number"?`${n}px`:n}):void 0,K=useCallback(S=>{if(S.key==="Tab"){S.preventDefault();return}let F=S.currentTarget,I=P=>{k?.setIsKeyboardNav(true);let D=F.closest("[data-menu-id]");if(!D)return;D.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(v=>v.removeAttribute("data-highlighted"));let B=Array.from(D.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemcheckbox"]:not([aria-disabled="true"]):not([data-disabled]), [role="menuitemradio"]:not([aria-disabled="true"]):not([data-disabled])')).filter(v=>{if(v.closest("[data-menu-id]")!==D)return false;let L=window.getComputedStyle(v);return L.display!=="none"&&L.visibility!=="hidden"});if(!B.length)return;let z=B.indexOf(F),w=z>=0?z:0,g=P==="next"?(w+1)%B.length:(w-1+B.length)%B.length;B[g]?.setAttribute("data-highlighted",""),B[g]?.focus();};if(S.key==="ArrowDown"){S.preventDefault(),S.stopPropagation(),c&&s(false),I("next");return}if(S.key==="ArrowUp"){S.preventDefault(),S.stopPropagation(),c&&s(false),I("prev");return}if(S.key==="ArrowRight"||S.key==="Enter"||S.key===" "){S.preventDefault(),S.stopPropagation(),k?.setIsKeyboardNav(true);let P=S.currentTarget;s(true),requestAnimationFrame(()=>{let D=R?document.querySelector(`[data-menu-id="${R}"]`):document.querySelector("[data-submenu-content]");if(D){D.setAttribute("data-keyboard-nav",""),P.removeAttribute("data-highlighted"),P.removeAttribute("data-hovered");let B=D.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])');B&&(B.setAttribute("data-highlighted",""),B.focus());}});return}if(S.key==="ArrowLeft"){S.preventDefault(),S.stopPropagation(),c&&s(false);let P=F.closest("[data-menu-id]");P&&P.setAttribute("data-keyboard-nav",""),document.querySelectorAll("[data-highlighted]").forEach(D=>D.removeAttribute("data-highlighted")),document.querySelectorAll("[data-hovered]").forEach(D=>D.removeAttribute("data-hovered")),F.setAttribute("data-highlighted",""),F.focus(),k&&k.setIsKeyboardNav(true);return}if(S.key==="Escape"){S.preventDefault(),S.stopPropagation(),m?.(S);return}m?.(S),A?.(S);},[c,s,m,A,u,k,R]),W=l==="hover"?{onMouseEnter:S=>{let F=S.currentTarget;so(),b(),document.querySelectorAll("[data-hovered]").forEach(P=>P.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(P=>P.removeAttribute("data-highlighted")),F.setAttribute("data-hovered",""),F.focus({preventScroll:true});let I=F.closest("[data-menu-id]");I?.hasAttribute("data-keyboard-nav")&&I.removeAttribute("data-keyboard-nav"),k&&k.setIsKeyboardNav(false),c||p(true,90);},onMouseMove:S=>{let F=S.currentTarget;so(),F.hasAttribute("data-hovered")||(document.querySelectorAll("[data-hovered]").forEach(I=>I.removeAttribute("data-hovered")),document.querySelectorAll("[data-highlighted]").forEach(I=>I.removeAttribute("data-highlighted")),F.setAttribute("data-hovered","")),!c&&!f?.current&&p(true,90);},onMouseLeave:()=>{p(false,60);}}:{onClick:S=>{S.stopPropagation(),s(!c),C?.(S),T?.(S);}};if(x&&h){let S=d?.css,F=typeof d?.className=="string"?d.className:void 0,I=typeof d?.tabIndex=="number"?d.tabIndex:0,P={ref:M,tabIndex:I,className:[F,o].filter(Boolean).join(" ")||void 0,css:[S,$,r].filter(Boolean),"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",__skipListReg:true,onKeyDown:K,onFocus:D=>{if(D.target.hasAttribute("data-highlighted")){let B=D.target.closest("[data-menu-id]");B&&!B.hasAttribute("data-keyboard-nav")&&(B.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}d&&"onFocus"in d&&typeof d.onFocus=="function"&&d.onFocus(D);},...W,...E};return cloneElement(h,P)}return jsx("div",{ref:M,role:"menuitem",tabIndex:0,className:o,css:[css({display:"flex",alignItems:"center",gap:8,cursor:"pointer"}),$,r],"aria-haspopup":"menu","aria-expanded":c,"data-subtrigger":"",onKeyDown:K,onFocus:S=>{if(S.currentTarget.hasAttribute("data-highlighted")){let F=S.currentTarget.closest("[data-menu-id]");F&&!F.hasAttribute("data-keyboard-nav")&&(F.setAttribute("data-keyboard-nav",""),k&&k.setIsKeyboardNav(true));}},...W,...E,children:t})});Ii.displayName="DropdownMenuSubTrigger";var ki=de.forwardRef((e,t)=>{let n=ys(),{referenceRef:o,clearSubmenuHover:r,scheduleSubmenuHover:a}=pr(),i=useRef(null);useEffect(()=>{let s=i.current;if(!s)return;let l=()=>{let b=document.querySelector("[data-pfui-portal-owner]");if(!b||b===s)return;let f=b.getAttribute("data-pfui-portal-owner");f&&s.setAttribute("data-pfui-portal-owner",f);let R=b.getAttribute("data-pfui-mode");R&&(s.setAttribute("data-pfui-mode",R),s.classList.remove("pf-light","pf-dark"),s.classList.add(R==="light"?"pf-light":"pf-dark"));let k=b.getAttribute("data-pfui-primary");k&&s.setAttribute("data-pfui-primary",k);for(let y=0;y<b.style.length;y++){let x=b.style.item(y);x?.startsWith("--pf-")&&s.style.setProperty(x,b.style.getPropertyValue(x));}};l();let u=new MutationObserver(()=>l()),p=document.querySelector("[data-pfui-portal-owner]");return p&&p!==s&&u.observe(p,{attributes:true,attributeFilter:["data-pfui-mode","data-pfui-primary","style","class"]}),()=>u.disconnect()},[]);let c=[e.className,"plainframe-ui-submenu-content"].filter(Boolean).join(" ");return jsx(dn,{ref:dr(t,i),side:"right",align:"start",exitPlacement:"bottom",animateOnBusClose:true,...e,className:c,"data-submenu-content":"",anchor:o.current,onMouseEnter:s=>{r(),n?.clearAllHover(),so(),e.onMouseEnter?.(s);},onMouseLeave:s=>{a(false,60),e.onMouseLeave?.(s);}})});ki.displayName="DropdownMenuSubContent";var mr=e=>e.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").trim().toLowerCase(),Ed=css({display:"inline"}),Fi=css({display:"inline",fontWeight:700}),Sd=css({position:"absolute",inset:0,pointerEvents:"none",opacity:0,zIndex:-1,outline:"none"}),Id=css({display:"flex",alignItems:"center",gap:4}),kd=css({flex:"1 1 auto",minWidth:0,display:"flex",flexDirection:"column",gap:2}),Ai=css({fontWeight:500,overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word"}),Md=css({fontSize:"0.875em",overflow:"hidden",overflowWrap:"break-word",wordBreak:"break-word",fontWeight:400}),Fd=()=>{},Ad=e=>e,Pd=e=>`plainframe-ui-autocomplete${e?`-${e}`:""}`,Dd=e=>{e.preventDefault(),e.stopPropagation();},Nd=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation());},Hd=e=>{e.preventDefault(),e.stopPropagation();},Pi=de.memo(({onCapture:e})=>{let t=useContext(ln),n=useContext(co),o=useMemo(()=>({...t,activeIndex:n?.activeIndex??null,setActiveIndex:n?.setActiveIndex??t?.setActiveIndex}),[t,n]);return useEffect(()=>{e(o);},[o,e]),null});Pi.displayName="CtxCapture";var xs=de.memo(({item:e,absIndex:t,multiple:n,getCurrentMulti:o,isSelected:r,renderItem:a,paint:i,cls:c,closeOnSelect:s,pickSingle:l,handleItemKeyDown:u,handleItemMouseDown:p,descriptionColor:b})=>{let f=o(),R=useMemo(()=>{let x=String(e.title??e.value);return a?x:i(x)},[i,e.title,e.value,a]),k=useMemo(()=>e.description?jsxs("span",{className:"plainframe-ui-autocomplete-item-content",css:kd,children:[jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ai,children:R}),jsx("span",{className:"plainframe-ui-autocomplete-item-description",css:[Md,{color:b}],children:e.description})]}):jsx("span",{className:"plainframe-ui-autocomplete-item-title",css:Ai,children:R}),[R,e.description,b]),y=useCallback(()=>{e.disabled||l(e.value);},[e.disabled,e.value,l]);if(n){let x=f.some(h=>Object.is(h,e.value));return a?jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:p,children:a(e,x)},e.value):jsx(ao,{__index:t,value:e.value,disabled:!!e.disabled,closeOnSelect:false,"aria-disabled":!!e.disabled,className:`plainframe-ui-select-option ${c("checkbox-item")}`.trim(),css:e.css,onMouseDown:p,startIcon:e.startIcon,endIcon:e.endIcon,children:k},e.value)}return a?jsx(Mt,{__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:s,onMouseDown:p,selected:r,children:a(e,r)},e.value):jsx(Mt,{startIcon:e.startIcon,endIcon:e.endIcon,__index:t,onClick:y,onSelect:y,onKeyDown:u,"aria-disabled":!!e.disabled,disabled:!!e.disabled,className:c("item"),css:e.css,closeOnSelect:s,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 Di=de.memo(({items:e=[],onSelect:t,width:n=300,fullWidth:o=false,placeholder:r,renderItem:a,focusRingMode:i,css:c,inputCss:s,containerCss:l,label:u,helperText:p,variant:b,startIcon:f,endIcon:R,size:k,disabled:y=false,error:x=false,showClear:h=false,open:d,onOpenChange:m,openOnFocus:C=false,openOnType:A=true,openOnClick:T=true,closeOnSelect:E=true,closeOnBlur:M=true,blurOnSelect:$=false,freeSolo:K=false,customValueLabel:W=false,maxHeight:S,maxItems:F,noResultsText:I="No Items Found",highlightTypedValue:P,typedValueHighlightCss:D,showNoResults:B=true,noResultsLabelCss:z,loadingLabelCss:w,loadItems:g,loading:v,loadingText:L="Loading\u2026",debounceMs:H=200,multiple:O=false,selectedValues:_,defaultSelectedValues:N,onChangeSelected:U,expandIcon:G,showExpandIcon:se=true,expandIconCss:V,textFieldWrapperCss:Y,textFieldInputCss:le,textFieldLabelCss:ue,textFieldHelperRowCss:pe,textFieldHelperTextCss:Me,textFieldStartIconCss:Ce,textFieldEndIconCss:ve,menuContentCss:Ee})=>{let Z=j().text.secondary,[ie,be]=useState(""),X=typeof d=="boolean",[ye,Q]=useState(false),ne=X?d:ye,ae=useRef(null),me=useRef(null),Ae=useRef(null),He=useRef(null),J=useRef(false),oe=useRef(null),re=useRef(false),Ve=useRef(0),Le=useMemo(()=>[me],[]),[Et,qn]=useState(N??[]),Ke=_??Et,Cn=useRef(Ke);Cn.current=Ke;let[it,Rn]=useState(null),St=useRef(it);St.current=it;let Tn=useCallback(()=>Cn.current,[]),[Gn,Po]=useState([]),[Do,Xn]=useState(false),Ue=typeof g=="function",dt=Ue?Gn:e,ce=useRef(dt);ce.current=dt;let Te=!!v||Do&&Ue,et=useRef(m);useEffect(()=>{et.current=m;},[m]);let Fe=useCallback(q=>{X||Q(q),et.current?.(q);},[X]),lt=useRef(null);useEffect(()=>{if(!Ue)return;lt.current&&window.clearTimeout(lt.current);let q=ie;return lt.current=window.setTimeout(async()=>{Xn(true);try{let te=await g(q)||[];Po(Array.isArray(te)?te:[]);}catch{Po([]);}finally{Xn(false);}},Math.max(0,H)),()=>{lt.current&&window.clearTimeout(lt.current);}},[ie,Ue,g,H]);let Yn=useMemo(()=>{let q=mr(ie);return q?dt.some(te=>mr(te.title??te.value)===q):false},[dt,ie]),ia=K&&!!W&&ie.trim().length>0&&!Yn,ac=q=>{if(typeof W=="object"){let te=Object.prototype.hasOwnProperty.call(W,"prefix"),xe=Object.prototype.hasOwnProperty.call(W,"suffix");if(te||xe){let Se=te?W.prefix??"":"",fe=xe?W.suffix??"":"";return `${Se}${q}${fe}`}return `Add "${q}"`}return `Add "${q}"`},$r=useMemo(()=>{if(Ue)return dt;let q=mr(ie);if(!q)return dt;let te=[],xe=[];for(let Se of dt){let fe=mr(Se.title??Se.value);fe.split(" ").some(qe=>qe.startsWith(q))?te.push(Se):fe.includes(q)&&xe.push(Se);}return te.length>0?te:xe},[dt,ie,Ue]),la=useMemo(()=>{if(ia){let q=ie.trim();return [...$r,{value:q,title:ac(q),__pfui_free__:true}]}return $r},[$r,ia,ie]),$t=useMemo(()=>{let q=[],te=new Map;for(let ot of la){let qe=ot.group??"__ungrouped__";te.has(qe)||(te.set(qe,[]),q.push(qe)),te.get(qe).push(ot);}let Se=typeof F=="number"?Math.max(0,F):1/0,fe=[];for(let ot of q){if(Se<=0)break;let Qt=te.get(ot).slice(0,Se);Qt.length>0&&(fe.push({label:ot==="__ungrouped__"?void 0:ot,items:Qt}),Se-=Qt.length);}return fe},[la,F]),wn=useMemo(()=>$t.reduce((q,te)=>(q.push(...te.items),q),[]),[$t]),No=wn.length>0,zr=!No&&!!B&&!Te&&ie.trim().length>0,En=Te||No||zr,Ho=En||Ue;useEffect(()=>{!Ue&&ne&&!En&&(re.current=true,Fe(false),setTimeout(()=>{re.current=false;},150));},[Ue,ne,En,Fe]);let Or=useRef(null),Wr=useRef(false);useEffect(()=>{if(K&&!O){if(Wr.current){Wr.current=false;return}let q=ie.trim();if(Or.current===q)return;Or.current=q,t?.({value:q,title:q});}},[ie,K,O,t]);let Kr=useCallback(q=>{let te=ce.current,xe=new Map(te.map(fe=>[fe.value,fe])),Se=q.map(fe=>xe.get(fe)??{value:fe,title:fe});U?.(Se);},[U]),Lo=useCallback(q=>{let te=q.map(String);_||qn(te),Kr(te);},[_,Kr]),ca=useCallback(q=>{let xe=Ke.includes(q)?Ke.filter(Se=>Se!==q):[...Ke,q];Lo(xe);},[Ke,Lo]),Bo=useCallback(q=>{let te=ce.current.find(xe=>xe.value===q)??{value:q,title:q};te.disabled||(Wr.current=true,Or.current=(te.title??te.value).trim(),Rn(te),be(te.title??te.value),t?.(te),X||(E?(J.current=false,re.current=true,Q(false),et.current?.(false),setTimeout(()=>{re.current=false;},150)):J.current=true),!E&&Ae.current?.setActiveIndex&&Ae.current.setActiveIndex(null),$?(J.current=false,setTimeout(()=>{He.current&&ae.current?(He.current.tabIndex=0,He.current.focus(),He.current.blur(),He.current.tabIndex=-1):ae.current?.blur();},0)):requestAnimationFrame(()=>ae.current?.focus()));},[t,X,E,$]),ic=useCallback(q=>{if(y)return;be(q);let te=!q.trim();O||(te?(Rn(null),t?.(null)):K&&Rn(null)),!X&&!te&&A&&!ne&&Fe(true);},[O,X,A,ne,Fe,y,K,t]),tt=Pd,ua=Fd,lc=Ad,da=useMemo(()=>D?[Fi,D]:Fi,[D]),cc=useCallback(q=>{let te=ie.trim();if(!te||te.length<1)return q;let xe=te.toLowerCase(),fe=q.toLowerCase().indexOf(xe);return fe<0?q:jsxs("span",{className:"plainframe-ui-autocomplete-highlight-wrap",css:Ed,children:[q.slice(0,fe),jsx("span",{className:"plainframe-ui-autocomplete-highlight",css:da,children:q.slice(fe,fe+te.length)}),q.slice(fe+te.length)]})},[ie,da]),$o=P?cc:lc,uc=useMemo(()=>css({position:"relative",display:o?"block":"inline-block",width:"100%",maxWidth:o?"100%":n}),[o,n]),zo=Dd,Oo=Nd,dc=useCallback(q=>{Ae.current=q;},[]),pa=useCallback(q=>{let te=Ae.current;if(!te)return;let xe=wn.length;if(xe===0)return;let Se=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]"),fe=-1;if(Se){let qe=Se.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]'),Qt=Se.querySelector("[data-active]")||Se.querySelector("[data-hovered]");Qt&&(fe=Array.from(qe).indexOf(Qt));}fe<0&&typeof te.activeIndex=="number"&&(fe=te.activeIndex);let ot=fe<0?q===1?0:xe-1:(fe+q+xe)%xe;te.setActiveIndex?.(ot),requestAnimationFrame(()=>{let qe=me.current?.querySelector("[data-menu-id]")??document.querySelector("[data-menu-id]");if(!qe)return;qe.setAttribute("data-keyboard-nav",""),qe.querySelectorAll("[data-active]").forEach(jr=>jr.removeAttribute("data-active")),qe.querySelectorAll("[data-hovered]").forEach(jr=>jr.removeAttribute("data-hovered"));let _r=qe.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"]')[ot];_r&&(_r.setAttribute("data-active",""),_r.scrollIntoView?.({block:"nearest"}));});},[wn.length]),pc=useCallback(q=>{if(q.key===" "||q.code==="Space"||q.key==="Spacebar"){q.stopPropagation();return}if(q.key==="ArrowDown"||q.key==="ArrowUp"){if(y||!En&&!Ue)return;q.preventDefault(),!ne&&!X&&Fe(true),pa(q.key==="ArrowDown"?1:-1);return}if(q.key==="Enter"){if(y)return;let te=Ae.current&&typeof Ae.current.activeIndex=="number"?Ae.current.activeIndex:-1,xe=te>=0&&te<wn.length?wn[te]:null;if(ne&&xe&&te>=0){q.preventDefault(),q.stopPropagation(),O?(ca(xe.value),E||requestAnimationFrame(()=>ae.current?.focus())):Bo(xe.value);return}}else q.key==="Escape"?(q.preventDefault(),q.stopPropagation(),ne&&!X&&(re.current=true,Fe(false),q.target.focus(),setTimeout(()=>{re.current=false;},150))):q.key==="Tab"&&ne&&!X&&Fe(false);},[En,Ue,ne,X,wn,O,E,pa,ca,Bo,Fe,y]),mc=useCallback(()=>{y||re.current||C&&Ho&&(Ve.current=Date.now(),X||Fe(true));},[X,C,Ho,Fe,y]),fc=useCallback(()=>{if(J.current){J.current=false;return}M&&Fe(false),!K&&!O&&(it?be(it.title??it.value):ie.trim()&&be(""));},[M,K,O,it,ie,Fe]),ma=useCallback(()=>{let q=[],te=0;return $t.forEach((xe,Se)=>{xe.label&&q.push(jsx(an,{className:tt("group-label"),children:xe.label},`g-${Se}`)),xe.items.forEach(fe=>{q.push(jsx(xs,{item:fe,absIndex:te,multiple:true,getCurrentMulti:Tn,isSelected:false,renderItem:a,paint:$o,cls:tt,closeOnSelect:false,pickSingle:ua,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),te+=1;});}),jsx(hs,{values:Ke,onValuesChange:Lo,children:q},"multi-group")},[$t,tt,Tn,a,$o,Ke,Lo,ua,Oo,zo,Z]),fa=useCallback(()=>{let q=[],te=0;return $t.forEach((xe,Se)=>{xe.label&&q.push(jsx(an,{className:tt("group-label"),children:xe.label},`g-${Se}`)),xe.items.forEach(fe=>{let ot=it?.value===fe.value;q.push(jsx(xs,{item:fe,absIndex:te,multiple:false,getCurrentMulti:Tn,isSelected:ot,renderItem:a,paint:$o,cls:tt,closeOnSelect:E,pickSingle:Bo,handleItemKeyDown:Oo,handleItemMouseDown:zo,descriptionColor:Z},`${fe.group??"__"}|${fe.value}`)),te+=1;});}),q},[$t,tt,it,Tn,a,$o,E,Bo,Oo,zo,Z]),gc=useMemo(()=>Te?jsx(an,{css:w,className:tt("label-loading"),children:L},"loading"):zr?jsx(an,{css:z,className:tt("label-empty"),children:I},"empty"):$t.length===0?null:O?ma():fa(),[Te,zr,$t.length,tt,L,I,O,ma,fa]),Zt=ne?false:y||!Ue&&!No&&!B,ga=useCallback(q=>{q.preventDefault(),q.stopPropagation(),!(Zt||y)&&(X||(ne?(re.current=true,Fe(false),queueMicrotask(()=>ae.current?.focus()),setTimeout(()=>{re.current=false;},150)):(Fe(true),queueMicrotask(()=>ae.current?.focus()))));},[ne,No,Ue,Fe,Zt,y,X]),ba=useMemo(()=>css({transition:"transform 0.3s cubic-bezier(.6,1.3,.5,1), opacity 0.15s ease",transform:ne?"rotate(180deg)":"rotate(0deg)",display:"flex",alignItems:"center",justifyContent:"center",cursor:Zt?"not-allowed":"pointer",userSelect:"none",opacity:Zt?.5:1}),[ne,Zt]),Wo=useMemo(()=>se?jsx("span",{ref:oe,role:"button",tabIndex:-1,css:[ba,V],"aria-disabled":Zt||void 0,onMouseDown:Hd,onClick:ga,children:G??jsx(ChevronDown,{size:18,strokeWidth:2})}):null,[se,ba,V,Zt,ga,G]),bc=useMemo(()=>R&&Wo?jsxs("span",{css:Id,children:[R,Wo]}):R??Wo,[R,Wo]),hc=useCallback(q=>{if(!(oe.current&&oe.current.contains(q.target)||re.current||y||Date.now()-Ve.current<300)){if(ne){!ie.trim()&&!X&&(re.current=true,Fe(false),setTimeout(()=>{re.current=false;},150));return}T&&Ho&&(!X||T)&&Fe(true);}},[ne,ie,T,Ho,Fe,y,X]);return jsx("div",{ref:me,className:tt(""),css:[uc,l,c],children:jsxs(Pn,{open:y?false:ne,onOpenChange:y?void 0:Fe,children:[jsx(Pi,{onCapture:dc}),jsx(Dn,{asChild:true,children:jsx("span",{className:tt("anchor"),css:Sd,style:{pointerEvents:"none",position:"absolute",visibility:"hidden"},tabIndex:-1})}),jsx(Zo,{ref:ae,className:tt("input"),focusRingMode:i,value:ie,onChange:ic,onKeyDown:pc,onFocus:mc,onBlur:fc,onSurfaceClick:hc,placeholder:r,label:u,helperText:p,variant:b,startIcon:f,endIcon:bc,size:k,width:n,fullWidth:o,disabled:y,error:x,showClear:h,css:s,wrapperCss:Y,inputCss:le,labelCss:ue,helperRowCss:pe,helperTextCss:Me,startIconCss:Ce,endIconCss:ve}),jsx("span",{ref:He,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}}),En&&jsx(dn,{className:tt("menu"),side:"bottom",align:"start",sameWidth:true,allItemsTabbable:true,maxHeight:typeof S=="number"?`${S}px`:S,css:Ee,ignoreOutsidePressRefs:Le,disableOutsidePressDismiss:X,returnFocus:!$,children:gc})]})})});Di.displayName="Autocomplete";var Od=["sm","md","lg"],Wd=(e,t)=>typeof e=="number"?e:Od.includes(e)?t.componentHeights[e]:t.componentHeights.md,Kd=(e,t)=>{let n=e.palette?.[t??"primary"]??e.palette.primary;return n?.[600]??n?.[500]??e.neutral?.[600]??e.neutral?.[500]},_d=(e,t)=>{let n=e.text?.onColors??{};return n[t??"primary"]??n.primary??e.text?.primary??"#fff"},jd=(e,t)=>typeof e=="string"?e:(t?.trim()?.[0]||"").toUpperCase(),Ni=de.memo(forwardRef(({src:e,alt:t,size:n="md",color:o="primary",rounded:r=true,className:a,css:i,children:c,...s},l)=>{let u=j(),[p,b]=useState(!!e);useEffect(()=>{b(!!e);},[e]);let f=Wd(n,u),R=typeof f=="number"?f:Number.parseFloat(String(f))||0,k=R?Math.round(R*(R<=28?.55:.52)):void 0,y=r?u.radius.full:u.radius.md,x=Kd(u,o),h=_d(u,o),d=jd(c,t),m=css({width:f,height:f,borderRadius:y,display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",background:p?"transparent":x,color:p?"inherit":h,boxSizing:"border-box",userSelect:"none"}),C=css({width:"100%",height:"100%",display:"block",objectFit:"cover"}),A=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",a||""].join(" ").trim(),css:[m,i],role:p?void 0:"img","aria-label":p?void 0:t,...s,children:p&&e?jsx("img",{className:"plainframe-ui-avatar-img",src:e,alt:t,css:C,onError:()=>b(false),decoding:"async",loading:"lazy"}):typeof c=="string"?jsx("span",{className:"plainframe-ui-avatar-initials",css:A,children:c}):c||jsx("span",{className:"plainframe-ui-avatar-initials",css:A,children:d})})}));Ni.displayName="Avatar";var Hi=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Gd=({children:e,max:t,size:n="md",overlap:o=-7,css:r,rounded:a=true,bgColor:i,extraLabelCss:c,outlineThickness:s=4,className:l})=>{let u=j(),p=he(),f=(()=>{if(typeof n=="number")return `${n}px`;if(typeof n=="string"){let T=(u.componentHeights&&u.componentHeights[n])??(u.spacing&&u.spacing[n]);return Hi(T??n)}return "32px"})(),R=Children.toArray(e).filter(Boolean),k=typeof t=="number"&&t>=0,y=k&&R.length>t?R.slice(0,t):R,x=k&&R.length>t?R.length-t:0,h=i==="panel"?u.surface.panelBg:i==="subtle"?u.surface.subtleBg:i??u.surface.appBg,d=Hi(s)??"4px",m=css({display:"flex",alignItems:"center"}),C=T=>css({marginLeft:T===0?0:o,zIndex:y.length-T,boxShadow:`0 0 0 ${d} ${h}`,backgroundColor:h,borderRadius:a?u.radius.full:u.radius.md,display:"inline-flex",width:f,height:f,overflow:"hidden",alignItems:"center",justifyContent:"center",lineHeight:0,flex:"0 0 auto"}),A=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:[y.map((T,E)=>{if(!isValidElement(T))return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:jsx("span",{css:A,children:T})},E);let M=T,$=M.props?.css,K=$==null?A:[A,$],W=cloneElement(M,{size:n,rounded:a,css:K,style:{...M.props?.style,width:"100%",height:"100%",objectFit:M.props?.objectFit??"cover"}});return jsx("div",{className:"plainframe-ui-avatar-group-item",css:C(E),children:W},E)}),x>0&&jsxs("span",{className:"plainframe-ui-avatar-group-extra",css:[css({marginLeft:5,fontSize:u.typography.sizes.sm,fontWeight:600,lineHeight:1,padding:"2px 1px",zIndex:2,color:u.text.secondary}),c],"aria-label":`+${x} more`,children:["+",x]})]})};var $i=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Yd=(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"}},Jd=e=>e[600]??e[500]??e[400]??Object.values(e)[0]??"#000",Zd=(e,t,n,o)=>o??t[n]??t.primary??e.text?.primary??"#fff",Qd=(e,t,n)=>n==="dot"?"":typeof e=="number"&&typeof t=="number"&&e>t?`${t}+`:e??"",ep=(e,t,n,o)=>e&&(t==="dot"||!!n||n===0&&o),tp=de.memo(({content:e,color:t="primary",fontColor:n,fontWeight:o=600,fontSize:r,variant:a="dot",max:i=99,showZero:c=false,visible:s=true,anchorOrigin:l={vertical:"top",horizontal:"right"},overlap:u="rectangular",children:p,animate:b=true,size:f,outline:R=false,outlineColor:k,className:y,badgeClassName:x,css:h,badgeCss:d,offsetX:m,offsetY:C})=>{let A=j(),T=a==="dot",E=f??(T?8:17),M=r??(T?0:10),{scale:$,onKey:K}=Yd(A,t),W=Jd($),S=A.text?.onColors||{},F=Zd(A,S,K,n),I=Qd(e,i,a),P=ep(s,a,e,c),D=css({position:"relative",display:"inline-block"}),B=u==="circular"?T?"12.5%":"5%":T?"5%":"2.5%",z=$i(m??B),w=$i(C??B),g=l.vertical||"top",v=l.horizontal||"right",L={},H="0",O="0";g==="center"?(L.top="50%",O="-50%"):g==="top"?(L.top=w,O="-45%"):(L.bottom=w,O="45%"),v==="center"?(L.left="50%",H="-50%"):v==="right"?(L.right=z,H="45%"):(L.left=z,H="-45%");let _=P?1:.8,N=css({minWidth:T?E:E/2,height:E,background:W,color:F,fontSize:typeof M=="number"?`${M}px`:M,fontWeight:o,borderRadius:999,padding:T?0:`0 ${E/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",...R?{boxShadow:`0 0 0 2px ${k??A.surface?.appBg}`}:{},opacity:P?1:0,transform:`translate(${H}, ${O}) scale(${P?_:.5})`,...b?{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",y||""].join(" ").trim(),css:[D,h],children:[p,jsx("span",{"aria-hidden":!P,className:["plainframe-ui-badge",x||""].join(" ").trim(),css:[N,d],children:I})]})});var Ss=({on:e,onClickAway:t,blur:n=false,blurDepth:o=2.5,color:r,zIndex:a=1e3,css:i,contentCss:c,overlayCss:s,children:l,transitionDuration:u=300,keepMounted:p=true,className:b,contentClassName:f,lockScroll:R=true,...k})=>{let y=j(),x=useMemo(()=>r??y.surface.overlayBg,[r,y.surface.overlayBg]),[h,d]=useState(e),[m,C]=useState(e),A=useRef(null),T=useRef(null),E=useRef(null);useEffect(()=>(A.current&&(clearTimeout(A.current),A.current=null),T.current!=null&&(cancelAnimationFrame(T.current),T.current=null),e?(d(true),T.current=requestAnimationFrame(()=>{C(true),T.current=null;})):(C(false),A.current=setTimeout(()=>{d(false),A.current=null;},u)),()=>{A.current&&(clearTimeout(A.current),A.current=null),T.current!=null&&(cancelAnimationFrame(T.current),T.current=null);}),[e,u]),useEffect(()=>{if(!R||!e)return;let F=document.body,I=F.style.overflow,P=F.style.paddingRight,D=window.innerWidth-document.documentElement.clientWidth,B=parseFloat(getComputedStyle(F).paddingRight||"0");return F.style.overflow="hidden",D>0&&(F.style.paddingRight=`${B+D}px`),()=>{F.style.overflow=I,F.style.paddingRight=P;}},[e,R]),useEffect(()=>{if(!m||!t)return;let F=I=>{I.key==="Escape"&&t();};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[m,t]);let M=F=>{if(!m||!t||!E.current)return;let I=F.target;I&&!E.current.contains(I)&&t();},$=n&&o?typeof o=="number"?`${o}px`:o:void 0;if(!p&&!h)return null;let K=css({position:"fixed",inset:0,width:"100vw",height:"100vh",zIndex:a,display:"grid",placeItems:"center",pointerEvents:m?"auto":"none",visibility:h?"visible":"hidden"}),W=css({position:"absolute",inset:0,background:x,backdropFilter:$?`blur(${$})`:void 0,WebkitBackdropFilter:$?`blur(${$})`:void 0,opacity:m?1:0,transition:`opacity ${u}ms cubic-bezier(.4,0,.2,1)`,pointerEvents:m?"auto":"none"}),S=css({position:"relative",zIndex:1,pointerEvents:m?"auto":"none"});return jsxs("div",{"aria-hidden":!h||void 0,className:["plainframe-ui-backdrop",b||""].join(" ").trim(),css:[K,i],onPointerDown:M,...k,children:[jsx("div",{className:"plainframe-ui-backdrop-overlay",css:[W,s],role:"presentation"}),jsx("div",{ref:E,className:["plainframe-ui-backdrop-content",f||""].join(" ").trim(),css:[S,c],children:l})]})};var hr=()=>null;Object.defineProperty(hr,"displayName",{value:"PF.BreadCrumbItem",configurable:true});function ap(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 ip=de.memo(({children:e,separator:t="/",css:n,crumbCss:o,activeCrumbCss:r,inactiveCrumbCss:a,linkCrumbCss:i,separatorCss:c,hover:s=true,className:l,...u})=>{let p=j(),b=he(),f=de.useMemo(()=>de.Children.toArray(e).flatMap(d=>{if(!de.isValidElement(d))return [];let{type:m,props:C}=ap(d);if(!(m===hr||typeof m=="function"&&"displayName"in m&&m.displayName===hr.displayName))return [];let T=C;return [{href:T.href,disabled:T.disabled,node:T.children,className:T.className,css:T.css,onClick:T.onClick,startIcon:T.startIcon,endIcon:T.endIcon}]}),[e]),R=de.useMemo(()=>css({display:"flex",alignItems:"center",fontSize:p.typography.sizes.sm,fontWeight:500,gap:p.spacing.xs,cursor:"default"}),[p]),k=de.useMemo(()=>css({margin:"0 0.15rem",color:p.neutral[500],flex:"0 0 auto",justifyContent:"center",alignItems:"center",display:"flex"}),[p]),y=de.useCallback((d,m,C)=>{let A=d?p.text.primary:p.text.secondary,T=s&&m&&!C;return css({display:"inline-flex",alignItems:"center",gap:p.spacing.xs,color:A,cursor:m&&!C?"pointer":"default",textDecoration:"none",borderRadius:p.radius.xs,fontWeight:500,outline:"none",transition:"all .16s ease !important","&:hover":T?{textDecoration:"underline",color:p.text.primary}:{textDecoration:"none"}})},[p,s]),x=de.useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0}),[]),h=de.useMemo(()=>css({display:"inline-block"}),[]);return jsx("nav",{"aria-label":"Breadcrumb",className:["plainframe-ui-breadcrumbs",l||""].join(" ").trim(),css:[R,n],...u,children:f.map((d,m)=>{let C=m===f.length-1,A=!!d.href&&!d.disabled&&!C,T=["plainframe-ui-breadcrumb",C?"plainframe-ui-breadcrumb--active":"plainframe-ui-breadcrumb--inactive",A?"plainframe-ui-breadcrumb--link":"",d.className||""].join(" ").trim(),E=[y(C,A,d.disabled),o,C?r:a,A?i:void 0,b(),d.css],M=jsxs(Fragment,{children:[d.startIcon&&jsx("span",{className:"plainframe-ui-breadcrumb-icon-start",css:x,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:x,children:d.endIcon})]});return jsxs(de.Fragment,{children:[m!==0&&jsx("span",{className:"plainframe-ui-breadcrumb-separator",css:[k,c],children:t}),A?jsx("a",{href:d.href,onClick:d.onClick,tabIndex:0,"data-active":C?"true":"false","data-link":"true",className:T,css:E,children:M}):jsx("span",{"aria-current":C?"page":void 0,tabIndex:C?-1:0,"data-active":C?"true":"false","data-link":"false",className:T,css:E,children:M})]},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})},ks=e=>typeof e=="number"?`${e}px`:e,Ki=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&Ki(n)&&(t=true));}),t};function dp(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 pp(e,t){let n=e.neutral,o=e.text,r=e.palette,a=r.primary||n,i=r.danger||r.error||a,c=e.text.onColors||{},s=c.primary??o.onColors.primary,l=c.danger??s,u=(p,b,f)=>p&&p[b]||f;if(t==="primary"){let p=a,b=u(p,600,n[900])||u(p,500,n[900]),f=u(p,500,n[800])||u(p,600,n[800]);return {bg:b,fg:s,hoverBg:f,border:"none"}}if(t==="destructive"){let p=i,b=u(p,600,n[900])||u(p,500,n[900]),f=u(p,500,n[800])||u(p,600,n[800]);return {bg:b,fg:l,hoverBg:f,border:"none"}}return t==="ghost-destructive"?{bg:"transparent",fg:i[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 _i=de.memo(de.forwardRef(({variant:e="primary",size:t="md",startIcon:n,endIcon:o,rounded:r=false,fullWidth:a=false,disabled:i=false,loading:c=false,loadingIndicator:s,loadingPosition:l="center",children:u,className:p,hoverEffect:b=true,icon:f,onClick:R,css:k,...y},x)=>{let h=j(),d=he(),m=useMemo(()=>dp(h,t),[h,t]),C=useMemo(()=>pp(h,e),[h,e]),A=useMemo(()=>f===true?true:f===false?false:!n&&!o&&!Ki(u)&&de.Children.count(u)===1,[f,n,o,u]),T=m.iconSize,E=useMemo(()=>Is(n,T),[n,T]),M=useMemo(()=>Is(o,T),[o,T]),$=useMemo(()=>s??jsx(Qn,{color:C.fg,variant:"circular",size:14,thickness:5}),[s,C]),K=useMemo(()=>A?"center":l??"center",[A,l]),W=!!c&&K==="center",S=!!c&&K==="start",F=!!c&&K==="end",I=i||c,P=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:0,width:a?"100%":"auto",minHeight:m.minHeight,lineHeight:1,fontWeight:600,cursor:I?"not-allowed":"pointer",opacity:I?.5:1,userSelect:"none",position:"relative",borderRadius:r?h.radius.full:m.radius,outline:"none",willChange:"box-shadow, transform, outline-offset",transition:"box-shadow 140ms ease, transform 90ms ease, outline-offset 140ms ease"}),[a,m,r,h,I]),D=useMemo(()=>css({backgroundColor:C.bg,color:C.fg,border:C.border}),[C]),B=useMemo(()=>css({overflow:"hidden","::before":{content:'""',position:"absolute",inset:0,backgroundColor:C.hoverBg,opacity:0,pointerEvents:"none",transition:"opacity 140ms ease",zIndex:0},"@media (hover: hover) and (pointer: fine)":b&&!I?{":hover::before":{opacity:1}}:{}}),[C,b,I]),z=useMemo(()=>css(A&&!a?{width:"100%",height:"100%",maxWidth:m.minHeight,minWidth:m.minHeight,maxHeight:m.minHeight,display:"flex",alignItems:"center",justifyContent:"center",fontSize:ks(m.iconSize)}:{fontSize:ks(m.fontSize),padding:n||o?`${m.paddingY} ${m.paddingXIcon}`:`${m.paddingY} ${m.paddingX}`}),[A,a,m,n,o]),w=useMemo(()=>css({position:"relative",zIndex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:ks(h.spacing.sm),opacity:W?0:1,transition:"opacity 140ms ease"}),[h,W]),g=useMemo(()=>css({height:"100%",display:"flex",alignItems:"center",justifyContent:"center"}),[]),v=useMemo(()=>typeof m.iconSize=="number"?m.iconSize:Math.max(12,Math.round(parseFloat(String(m.iconSize))||16)),[m.iconSize]),L=useMemo(()=>css({position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:v,minWidth:v,maxWidth:v,height:"1em"}),[v]),H=useMemo(()=>G=>css({position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",opacity:G?1:0,transition:"opacity 140ms ease"}),[]),O=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]),_=useMemo(()=>()=>{if(A)return null;let G=!!n;return !G&&!S?null:jsxs("span",{css:L,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!S),children:G?E||n:null}),jsx("span",{css:H(!!S),children:$})]})},[A,n,S,L,H,E,c,$]),N=useMemo(()=>()=>{if(A)return null;let G=!!o;return !G&&!F?null:jsxs("span",{css:L,"aria-hidden":c?true:void 0,children:[jsx("span",{css:H(!F),children:G?M||o:null}),jsx("span",{css:H(!!F),children:$})]})},[A,o,F,L,H,M,c,$]),U=!(i||c);return jsxs("button",{ref:x,type:"type"in y&&y.type?y.type:"button","data-variant":e,className:["plainframe-ui-button",p||""].join(" ").trim(),css:[P,d({color:e==="primary"?"primary":e==="destructive"||e==="ghost-destructive"?"danger":"neutral"}),D,B,z,k],onClick:U?R:void 0,disabled:i||void 0,tabIndex:c?-1:void 0,"aria-disabled":i||void 0,"aria-busy":c||void 0,...y,children:[jsxs("span",{className:"plainframe-ui-button-content",css:w,children:[_(),jsx("span",{className:"plainframe-ui-button-label",css:g,children:A?c?$:Is(u,m.iconSize):u}),N()]}),jsx("span",{className:"plainframe-ui-button-center-overlay",css:O,"aria-hidden":"true",children:W?$:null})]})}));_i.displayName="Button";var Cr=e=>isValidElement(e),mp=e=>{let t=e.type;return t.displayName??t.name},Ps=(e,t)=>mp(e)===t,Ui=e=>Ps(e,"ButtonGroup"),qi=e=>Ps(e,"DropdownMenu"),Fs=e=>Ps(e,"DropdownMenuTrigger"),Ln=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,fp=(e,t=1)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:/^\d+(\.\d+)?$/.test(e)?`${e}px`:e,gp=e=>typeof e=="string"&&/^(outlined|outlined-soft|outline-soft)$/i.test(e),As=(e,t)=>{if(!Cr(e))return null;if(Ui(e)){let n=Children.toArray(e.props.children).filter(isValidElement);return n.length?As(t?n[0]:n[n.length-1],t):null}if(qi(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 gp(o)},Gi=de.memo(de.forwardRef(function({children:t,attached:n=false,direction:o="horizontal",fullWidth:r=false,disabled:a=false,size:i="md",rounded:c=false,gap:s,width:l,className:u,role:p="group",css:b,__clipLeft:f,__clipRight:R,...k},y){let x=j(),h=i==="sm"?x.radius.sm:x.radius.md,d=c?x.radius.full:h,m=o==="vertical",C=fp(x.componentHeights.border,1),A=x.surface.border,T=n&&!!f,E=n&&!!R,M=css({display:"flex",flexDirection:m?"column":"row",width:r?"100%":l!=null?Ln(l):"auto",maxWidth:"none",backgroundColor:"transparent",gap:n?0:Ln(s??x.spacing.sm)}),$=Children.toArray(t),W=$.filter(Cr).length,S=0,F=false,I=[];for(let P of $){if(!Cr(P)){I.push(P);continue}let D=S===0,B=S===W-1,z=P.props??{},w=z.disabled??a,g=z.size??i,v=0,L=0,H=0,O=0;n&&(m?(v=D?T?0:d:0,L=D?E?0:d:0,O=B?T?0:d:0,H=B?E?0:d:0):(v=D?T?0:d:0,O=D?T?0:d:0,L=B?E?0:d:0,H=B?E?0:d:0));let _=Vi(P,"left"),N=Vi(P,"right"),se=n&&!D&&!(F&&_)&&!(F||_)?css({[m?"borderTop":"borderLeft"]:`${C} solid ${A}`}):null,V=n&&!D&&F&&_?css(m?{borderTopWidth:0}:{borderLeftWidth:0}):null,Y=n?css({borderTopLeftRadius:Ln(v),borderTopRightRadius:Ln(L),borderBottomRightRadius:Ln(H),borderBottomLeftRadius:Ln(O)}):null,le=r?css({flex:"1 1 0%",minWidth:0,width:"100%"}):null,ue=css([Y,se,V,le]);if(!qi(P)){let ve=z.css,Ee=[z.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" "),Re=Ui(P)&&n?{__clipLeft:!D,__clipRight:!B}:{},Z=cloneElement(P,{...z,disabled:w,size:g,className:Ee,css:[ve,ue],...Re});I.push(Z),F=N,S+=1;continue}let pe=z.children,Me=Children.map(pe,ve=>{if(!Cr(ve)||!Fs(ve))return ve;let Ee=ve.props,Re=[Ee.className,"plainframe-ui-button-group-item"].filter(Boolean).join(" ");return cloneElement(ve,{...Ee,css:[Ee.css,ue],className:Re,disabled:w,size:g})}),Ce=cloneElement(P,{...z,children:Me});I.push(Ce),F=N,S+=1;}return jsx("div",{ref:y,role:p,"aria-orientation":m?"vertical":"horizontal","data-attached":n||void 0,"data-direction":o,className:["plainframe-ui-button-group",u||""].join(" ").trim(),css:[M,b],...k,children:I})}));Gi.displayName="ButtonGroup";var Rr=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Cp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;return Rr(n?.[e]??e)}}},Rp=(e,t)=>{if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius??t.radii;return Rr(n?.[e]??e)}}},Tp=(e,t)=>{let n=t.surface??{};return e==="panel"||e==="outlined"?n.panelBg??"transparent":e==="subtle"?n.subtleBg??"transparent":"transparent"},wp=(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},Bn=de.memo(forwardRef(function({children:t,css:n,variant:o="ghost",padding:r,radius:a,className:i,hoverable:c,selectable:s,selected:l,defaultSelected:u,onSelectedChange:p,width:b,height:f,onClick:R,onKeyDown:k,role:y,tabIndex:x,...h},d){let m=j(),C=m.surface??{},[A,T]=useState(!!u),E=l!=null,M=E?!!l:A,$=useMemo(()=>Tp(o,m),[o,m]),K=useMemo(()=>wp(o,m,$),[o,m,$]),W=K,S=useMemo(()=>Cp(r,m),[r,m]),F=useMemo(()=>Rp(a,m),[a,m]),I=!!c||!!s,P=useMemo(()=>css({backgroundColor:$,padding:S,borderRadius:F,border:o==="outlined"?`${m.componentHeights?.border??"1px"} solid ${C.border??"transparent"}`:void 0,backgroundClip:"padding-box",boxSizing:"border-box",width:b?"100%":void 0,maxWidth:Rr(b),height:Rr(f),outline:"none",transition:"background-color .16s ease, border-color .16s ease",cursor:I?"pointer":void 0,...I?{"&:hover":{backgroundColor:K}}:{},'&[data-selected="true"]':{backgroundColor:W},...I?{'&[data-selected="true"]:hover':{backgroundColor:W}}:{}}),[$,S,F,o,m.componentHeights,C.border,b,f,I,K,W]),D=useCallback(()=>{if(!s)return;let g=!M;E||T(g),p?.(g);},[E,p,s,M]),B=useCallback(g=>{s&&D(),R?.(g);},[s,D,R]),z=useCallback(g=>{s&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),D()),k?.(g);},[s,D,k]),w=he();return jsx("div",{ref:d,"data-variant":o,"data-selected":s&&M?"true":void 0,"aria-pressed":s?M:void 0,className:["plainframe-ui-container",i||""].join(" ").trim(),css:[w(),P,n],onClick:B,onKeyDown:z,role:s?y??"button":y,tabIndex:s?x??0:x,...h,children:t})}));Bn.displayName="Container";var Sp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Ns(e,t){if(e!=null){if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.spacing??t.space;if(n&&e in n){let o=n[e];return Sp(o)}return e}}}function go(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 Ip(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 bo(e,t,n,o){let r=Ns(t,e),a=Ns(n,e),i=Ns(o,e),c={};return r&&!a&&!i&&(c.padding=r),a&&(c.paddingLeft=a,c.paddingRight=a),i&&(c.paddingTop=i,c.paddingBottom=i),c}function Xi(e,t){if(t)return t==="primary"?e.text?.primary:t==="secondary"?e.text?.secondary:t}var Yi=de.createContext("horizontal"),Ls=()=>de.useContext(Yi),Ji=de.memo(de.forwardRef(({children:e,css:t,variant:n="ghost",padding:o="md",radius:r="lg",hoverable:a,selectable:i,selected:c,defaultSelected:s,onSelectedChange:l,width:u="100%",height:p,gap:b,direction:f="horizontal",className:R,onClick:k,...y},x)=>{let h=j(),d=he(),m=f==="vertical",C=css({position:"relative",display:"flex",flexDirection:m?"column":"row",gap:Ip(b,h),alignItems:m?"stretch":"center",transition:"all .16s ease"});return jsx(Yi.Provider,{value:f,children:jsx(Bn,{ref:x,variant:n,padding:o,radius:r,hoverable:a,selectable:i,selected:c,defaultSelected:s,onSelectedChange:l,width:u,height:p,className:["plainframe-ui-card",R||""].join(" ").trim(),css:[d(),C,t],onClick:k,tabIndex:k?0:void 0,...y,children:e})})}));Ji.displayName="Card";var kp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:a,paddingY:i,...c})=>{let s=j(),u=Ls()==="vertical",p=css({display:"flex",flexDirection:"column",justifyContent:"center",alignItems:go(o),textAlign:Hs(o),...u?{width:"100%"}:{flex:1,minWidth:0},...bo(s,r,a,i)});return jsx("div",{"data-slot":"card-content",className:["plainframe-ui-card-content",n||""].join(" ").trim(),css:[p,t],...c,children:e})}),Mp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:a,paddingY:i,...c})=>{let s=j(),u=Ls()==="vertical",p=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...u?{width:"100%"}:{},...bo(s,r,a,i)});return jsx("div",{"data-slot":"card-start",className:["plainframe-ui-card-start",n||""].join(" ").trim(),css:[p,t],...c,children:e})}),Fp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:a,paddingY:i,...c})=>{let s=j(),u=Ls()==="vertical",p=css({display:"flex",flexShrink:0,justifyContent:go(o),alignItems:go(o),...u?{width:"100%"}:{},gap:s.spacing.xs,color:s.text.secondary,...bo(s,r,a,i)});return jsx("div",{"data-slot":"card-end",className:["plainframe-ui-card-end",n||""].join(" ").trim(),css:[p,t],...c,children:e})}),Ap=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:a,paddingY:i,weight:c,size:s,color:l,...u})=>{let p=j(),b=css({fontWeight:c??500,fontSize:s??(p.typography?.sizes?.sm!==void 0?p.typography.sizes.sm:"1rem"),color:Xi(p,l)??p.text?.primary,textAlign:Hs(o),...bo(p,r,a,i),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:[b,t],...u,children:e})}),Pp=de.memo(({children:e,css:t,className:n,align:o="start",padding:r,paddingX:a,paddingY:i,weight:c,size:s,color:l,...u})=>{let p=j(),b=css({fontWeight:c??400,fontSize:s??(p.typography?.sizes?.sm!==void 0?p.typography.sizes.sm:"0.875rem"),color:Xi(p,l)??p.text?.secondary,marginTop:p.spacing?.xxs??2,textAlign:Hs(o),...bo(p,r,a,i)});return jsx("div",{"data-slot":"card-description",className:["plainframe-ui-card-description",n||""].join(" ").trim(),css:[b,t],...u,children:e})});var Qi=e=>isValidElement(e),Lp=e=>Qi(e)?e.type?.displayName||e.type?.name:void 0,Zi=e=>Lp(e)==="Card",Bp=e=>typeof e=="number"?`${e}px`:e,el=({children:e,attached:t=false,gap:n,width:o,direction:r="vertical",variant:a,className:i,role:c="group",css:s})=>{let l=j(),u=r==="vertical",p=String(l.componentHeights?.border??"1px"),b=l.surface.border,f={display:"flex",flexDirection:u?"column":"row",width:typeof o=="string"||typeof o=="number"?Bp(o):"auto",maxWidth:"none",gap:t?0:n??l.spacing?.sm},R=Children.toArray(e),y=R.filter(Zi).length,x=0,h=R.map((d,m)=>{if(!Zi(d)||!Qi(d))return d;let C=d.props,A=x++,T=A===0,E=A===y-1,M=a??C.variant,$=t?u?{borderTopLeftRadius:T?C.radius:0,borderTopRightRadius:T?C.radius:0,borderBottomLeftRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:{borderTopLeftRadius:T?C.radius:0,borderBottomLeftRadius:T?C.radius:0,borderTopRightRadius:E?C.radius:0,borderBottomRightRadius:E?C.radius:0}:void 0,K=t&&!T?u?{borderTopWidth:0}:{borderLeftWidth:0}:void 0,W=M==="subtle"&&y>1&&!T?u?{borderTop:`${p} solid ${b}`}:{borderLeft:`${p} solid ${b}`}:null,F=[$,K,W,t?{width:"100%"}:{width:"100%",marginBottom:u?0:void 0,marginRight:u?void 0:0}].filter(Boolean),I=[C.className,"plainframe-ui-card-group-item"].filter(Boolean).join(" ");return cloneElement(d,{...C,variant:M??C.variant,css:[C.css,...F],className:I,key:typeof d=="object"&&"key"in d?d.key:m})});return jsx("div",{role:c,"aria-orientation":u?"vertical":"horizontal","data-attached":t||void 0,"data-direction":r,className:["plainframe-ui-card-group",i||""].join(" ").trim(),css:[f,s],children:h})};el.displayName="CardGroup";var Pe=e=>typeof e=="number"?`${e}px`:e,nl=e=>{let t=false;return de.Children.forEach(e,n=>{t||(typeof n=="string"||typeof n=="number"?String(n).trim()!==""&&(t=true):Array.isArray(n)&&nl(n)&&(t=true));}),t},Wp=(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"},ol=de.memo(forwardRef(function({children:t,labelCss:n,variant:o="soft",color:r="primary",rounded:a=false,startIcon:i,endIcon:c,size:s="md",onClick:l,onDelete:u,deleteIcon:p,disabled:b,cursor:f,className:R,css:k},y){let x=j(),h=he(),d=["sm","md","lg"].includes(s)?s:"md",m=useMemo(()=>Wp(x,d),[x,d]),C=!!l&&!b,A=b?"not-allowed":f||(C?"pointer":"inherit"),T=String(x.componentHeights?.border??"1px"),E=useMemo(()=>{let G=x.palette;return r==="secondary"||r==="neutral"?"neutral":r&&G[r]?r:"primary"},[r,x.palette]),M=useCallback(G=>{let se=x.palette;return (E==="neutral"?x.neutral[G]:se[E]?.[G])??se.primary?.[G]},[E,x.neutral,x.palette]),$=useMemo(()=>E==="neutral"?x.neutral[100]:M(50),[E,M,x.neutral]),K=useMemo(()=>E==="neutral"?x.text.secondary:M(800),[E,M,x.text.secondary]),W=useMemo(()=>E==="neutral"?x.neutral[100]:M(50),[E,M,x.neutral]),S=useMemo(()=>E==="neutral"?x.text.secondary:M(800),[E,M,x.text.secondary]),F=useMemo(()=>E==="neutral"?x.neutral[400]:M(300),[E,M,x.neutral]),I=useMemo(()=>E==="neutral"?x.surface.subtleBg:M(600),[E,M,x.surface.subtleBg]),P=useMemo(()=>(x.text.onColors??{})[E]??(E==="neutral"?x.neutral[900]:x.neutral[0]??"#fff"),[E,x.text.onColors,x.neutral]),D="transparent",B=useMemo(()=>E==="neutral"?x.text.secondary:M(700)??x.text.primary,[E,M,x.text.primary,x.text.secondary]),z=useMemo(()=>!i&&!c&&t!=null&&!nl(t)&&de.Children.count(t)===1,[i,c,t]),w=useMemo(()=>o==="filled"?css({backgroundColor:I,color:P,border:"none",boxShadow:"none"}):o==="outlined"?css({backgroundColor:W,color:S,border:"none",boxShadow:`inset 0 0 0 ${T} ${F}`}):o==="ghost"?css({backgroundColor:D,color:B,border:"none",boxShadow:"none"}):css({backgroundColor:$,color:K,border:"none",boxShadow:"none"}),[I,P,B,W,S,F,$,K,T,o]),g=useMemo(()=>css({display:"inline-flex",alignItems:"center",gap:Pe(m.gap),padding:o==="ghost"?0:z||t==null?Pe(m.soloPadding):`${Pe(m.paddingY)} ${Pe(m.paddingX)}`,borderRadius:a?x.radius.full:m.radius,fontWeight:600,cursor:A,opacity:b?.55:1,transition:"outline .16s ease, outline-offset .16s ease",overflow:o==="ghost"?"visible":"hidden",...z?{lineHeight:1,minWidth:`calc(${Pe(m.iconSize)} + ${Pe(m.soloPadding)} * 2)`,minHeight:`calc(${Pe(m.iconSize)} + ${Pe(m.soloPadding)} * 2)`,justifyContent:"center"}:null}),[m,A,t,b,z,a,x.radius.full,o]),v=useMemo(()=>css({fontSize:Pe(z?m.iconSize:m.fontSize),lineHeight:1.2,minWidth:0,display:"inline-flex",alignItems:"center",justifyContent:"center","& > svg":{width:z?Pe(m.iconSize):void 0,height:z?Pe(m.iconSize):void 0,display:z?"block":void 0}}),[m.fontSize,m.iconSize,z]),L=useMemo(()=>css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:Pe(m.iconSize),lineHeight:0,"& > svg":{width:Pe(m.iconSize),height:Pe(m.iconSize),display:"block"}}),[m.iconSize]),H=useMemo(()=>css({marginRight:z||t==null?0:Pe(m.gap),marginLeft:z||t==null?0:Pe(m.iconOffset)}),[m.gap,m.iconOffset,t,z]),O=useMemo(()=>css({marginLeft:z||t==null?0:Pe(m.gap),marginRight:z||t==null?0:Pe(a?m.iconOffsetRounded:m.iconOffset)}),[m.gap,m.iconOffset,m.iconOffsetRounded,t,z,a]),_=useMemo(()=>css({marginRight:a?0:Pe(m.iconOffset),padding:0,border:"none",outline:"none",background:"transparent",display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:b?"not-allowed":"pointer",color:"currentColor",opacity:b?.4:.85,transition:"background-color .16s ease, color .16s ease, opacity .16s ease, outline .16s ease, outline-offset .16s ease",fontSize:Pe(m.iconSize),borderRadius:x.radius.xs}),[m.iconOffset,m.iconSize,b,a,x.radius.xs]),N=useCallback(G=>{C&&(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),l?.());},[C,l]),U=useMemo(()=>jsx(X,{css:{width:m.iconSize,height:m.iconSize},strokeWidth:2.5}),[m.iconSize]);return jsxs("div",{ref:y,className:["plainframe-ui-chip",C?"plainframe-ui-chip-clickable":"",R||""].join(" ").trim(),css:[g,w,C?h({color:r??"primary"}):null,k],onClick:C?l:void 0,onKeyDown:N,role:C?"button":void 0,tabIndex:C?0:void 0,"aria-disabled":b||void 0,"data-variant":o,"data-color":E,"data-size":s,"data-icon-only":z||void 0,children:[i&&jsx("span",{css:[L,H],className:"plainframe-ui-chip-icon-left",children:i}),t!=null&&jsx("span",{css:[v,n],className:"plainframe-ui-chip-label",children:t}),c&&jsx("span",{css:[L,O],className:"plainframe-ui-chip-icon-right",children:c}),u&&jsx("button",{type:"button","aria-label":"Delete",disabled:b,tabIndex:0,onClick:G=>{G.stopPropagation(),b||u?.();},css:[_,h({color:r??"primary"})],className:"plainframe-ui-chip-delete",children:p||U})]})}));ol.displayName="Chip";var Vp=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Up=de.memo(function({value:t,onChange:n,len:o,theme:r,sizeKey:a,s:i,variant:c,error:s,disabled:l,ringEnabled:u,focusRingMode:p,placeholder:b,separator:f,gapPx:R}){let k=he(),y=r.neutral,x=r.text,h=r.componentHeights.border,d=useRef([]),[m,C]=useState(0),A=useMemo(()=>(t??"").padEnd(o,"").slice(0,o).split(""),[t,o]),T=useMemo(()=>{if(!b)return Array(o).fill("");if(b.length===1)return Array(o).fill(b);let z=b.slice(0,o).split("");for(;z.length<o;)z.push("");return z},[b,o]),E=useMemo(()=>{let z=r.componentHeights[a];return `calc(${typeof z=="number"?`${z}px`:z} * 1.5)`},[r.componentHeights,a]),M=l?y[200]:s&&c==="outlined"?r.palette.danger?.[50]??r.surface.panelBg:s&&c==="subtle"?r.palette.danger?.[50]??r.surface.subtleBg:c==="subtle"?r.surface.subtleBg:c==="outlined"?r.surface.panelBg:"transparent",$=c==="outlined"?`${h} solid ${s?r.palette.danger?.[300]??r.surface.border:r.surface.border}`:"none",K=z=>css({width:E,height:E,display:"inline-flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:M,border:$,borderRadius:r.radius.lg,transition:"box-shadow .16s, border-color .16s, background .16s",fontSize:i.codeFontSize,fontWeight:600,color:l?y[500]:s?r.palette.danger?.[800]??x.primary:x.primary,textAlign:"center",backgroundClip:"padding-box",appearance:"textfield",outline:"none",caretColor:s?r.palette.danger?.[800]??x.primary:x.primary,"&::placeholder":{color:s?r.palette.danger?.[700]??x.secondary:x.secondary,opacity:.85}},u?k({enabled:true,disabled:l,mode:p==="always"?"always":"visible",color:s?"danger":void 0}):void 0,z?css({}):null),W=css({display:"flex",gap:R,justifyContent:"center",width:"auto",pointerEvents:l?"none":"auto",opacity:l?.65:1}),S=css({display:"inline-flex",alignItems:"center",justifyContent:"center",color:x.secondary,userSelect:"none"}),F=z=>z.replace(/[^a-zA-Z0-9]/g,"").toUpperCase(),I=useCallback(z=>{let w=Math.max(0,Math.min(o-1,z));C(w),d.current[w]?.focus();},[o]),P=useCallback((z,w)=>{let g=F(w).slice(0,1),v=[...A];v[z]=g,n(v.join("")),g&&z<o-1&&I(z+1);},[A,o,n,I]),D=useCallback((z,w)=>{if(w.key==="Backspace")if(!A[z]&&z>0){let g=[...A];g[z-1]="",n(g.join("")),I(z-1),w.preventDefault();return}else {let g=[...A];g[z]="",n(g.join(""));return}if(w.key==="ArrowLeft"&&z>0){w.preventDefault(),I(z-1);return}if(w.key==="ArrowRight"&&z<o-1){w.preventDefault(),I(z+1);return}if(w.key==="Home"){w.preventDefault(),I(0);return}if(w.key==="End"){w.preventDefault(),I(o-1);return}},[A,o,n,I]),B=useCallback(z=>{let w=F(z.clipboardData.getData("text")).slice(0,o);w&&(n(w),requestAnimationFrame(()=>{let g=Math.min(w.length,o-1);I(g);}),z.preventDefault());},[o,n,I]);return jsx("div",{className:"plainframe-ui-code-boxes",css:W,children:Array.from({length:o}).map((z,w)=>jsxs(de.Fragment,{children:[jsx("input",{ref:g=>{d.current[w]=g;},type:"text",inputMode:"text",maxLength:1,value:A[w]||"",placeholder:A[w]?"":T[w]||"",disabled:l,onChange:g=>P(w,g.target.value),onKeyDown:g=>D(w,g),onFocus:()=>C(w),onPaste:w===0?B:void 0,className:"plainframe-ui-code-box",css:K(w===m),"aria-label":`Code character ${w+1}`,tabIndex:w===m?0:-1}),f&&w<o-1?jsx("span",{"aria-hidden":true,role:"presentation",css:S,children:f}):null]},w))})}),qp=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,separator:a,error:i,helperText:c,disabled:s=false,gap:l,size:u="md",variant:p="subtle",length:b=4,focusRingMode:f="always",className:R,wrapperCss:k,labelCss:y,helperRowCss:x,helperTextCss:h,css:d})=>{let m=j(),C=useId(),A=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]),T=["sm","md","lg"].includes(u)?u:"md",E=A[T],M=m.neutral,$=m.text,K=t!=null,[W,S]=useState(n),F=K?t:W,I=H=>{K||S(H),o?.(H);},P=Math.max(2,Math.min(b,10)),D=m.spacing.sm,B=Vp(l??D)??"0px",z=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(k)?k:k?[k]:[]),w=css({fontSize:E.labelFont,fontWeight:500,color:i?m.palette.danger?.[700]??$.primary:s?M[500]:$.primary,marginBottom:4,display:"block",cursor:s?"not-allowed":"auto"},...Array.isArray(y)?y:y?[y]:[]),g=css({display:"flex",alignItems:"center",justifyContent:"center",gap:B,width:"auto",background:"transparent",outline:"none",boxShadow:"none"},...Array.isArray(d)?d:d?[d]:[]),v=css({minHeight:16,fontSize:E.helperFont,color:i?m.palette.danger?.[700]??$.secondary:$.secondary,paddingTop:3,display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:8,width:"100%"},...Array.isArray(x)?x:x?[x]:[]),L=css({flex:1,wordBreak:"break-word",whiteSpace:"pre-wrap",minWidth:0,fontWeight:400,color:i?m.palette.danger?.[700]??$.primary:s?M[500]:$.primary},...Array.isArray(h)?h:h?[h]:[]);return jsxs("div",{className:["plainframe-ui-codefield",R||""].join(" ").trim(),css:z,children:[e&&jsx("span",{id:C,className:"plainframe-ui-codefield-label",css:w,children:e}),jsx("div",{className:"plainframe-ui-codefield-row",css:g,role:"group","aria-labelledby":e?C:void 0,tabIndex:-1,children:jsx(Up,{value:F||"",onChange:I,len:P,theme:m,sizeKey:T,s:{codeFontSize:E.codeFontSize},variant:p,error:!!i,disabled:s,ringEnabled:f!=="none",focusRingMode:f,placeholder:r,separator:a,gapPx:B})}),c!=null&&jsx("div",{className:"plainframe-ui-codefield-helper",css:v,children:jsx("span",{className:"plainframe-ui-codefield-helper-text",css:L,children:c})})]})};var ll=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=ll(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)},Xp=({children:e,content:t,trigger:n="contextmenu",onOpenChange:o,hoverPosition:r="cursor",hoverOffset:a=10})=>{let i=de.useRef(null),[c,s]=de.useState(false),l=de.useCallback(v=>{s(v),o?.(v);},[o]),u=de.useCallback(()=>l(false),[l]),p=de.useRef({x:0,y:0}),b=de.useRef(null),f=de.useRef(null),R=de.useCallback(()=>{f.current=null;let v=b.current;if(!v)return;let L=Math.round(p.current.x),H=Math.round(p.current.y);v.style.transform=`translate3d(${L}px, ${H}px, 0)`;},[]),k=de.useCallback(()=>{f.current==null&&(f.current=requestAnimationFrame(R));},[R]);de.useEffect(()=>()=>{f.current&&cancelAnimationFrame(f.current);},[]);let y=de.useMemo(()=>({getBoundingClientRect:()=>{let v=Math.round(p.current.x),L=Math.round(p.current.y);return {x:v,y:L,left:v,top:L,right:v,bottom:L,width:0,height:0,toJSON:()=>({x:v,y:L})}}}),[]),x=de.useRef(`cz-${Math.random().toString(36).slice(2)}`),h=de.useCallback(()=>typeof document<"u"?document.querySelector(`[data-cz-id="${x.current}"]`):null,[]),d=de.useRef(null),m=de.useRef(null),C=de.useCallback(()=>{d.current!=null&&clearTimeout(d.current),d.current=null;},[]),A=de.useCallback(()=>{m.current!=null&&clearTimeout(m.current),m.current=null;},[]),T=de.useCallback(()=>{A(),m.current=window.setTimeout(()=>l(false),0);},[A,l]),E=de.useCallback(()=>{let v=i.current?.getBoundingClientRect();return v?{x:v.left+v.width/2,y:v.top+v.height/2}:{x:0,y:0}},[]),M=de.useCallback((v,L)=>{p.current={x:v,y:L},k(),l(true);},[k,l]),$=typeof t=="function"?t({close:u}):t,K=$s($),W=v=>{if(!de.isValidElement(v))return v;let L=ll(v),H=v,O=H.props.children,_=O==null?O:Array.isArray(O)?O.map(N=>de.isValidElement(N)?W(N):N):de.isValidElement(O)?W(O):O;if(L==="DropdownMenu"){let N=H.props.onOpenChange;return de.cloneElement(H,{...H.props,open:c,onOpenChange:U=>{N?.(U),l(U);},children:_})}if(L==="DropdownMenuContent"){let N=H.props.onMouseEnter,U=H.props.onMouseLeave;return de.cloneElement(H,{...H.props,anchor:y,"data-cz-id":x.current,onMouseEnter:G=>{A(),N?.(G);},onMouseLeave:G=>{T(),U?.(G);},children:_})}return _===O?H:de.cloneElement(H,{...H.props,children:_})},S=K?W($):$,F=de.useCallback(v=>{v.preventDefault(),M(v.clientX,v.clientY);},[M]),I=de.useCallback(v=>{n==="contextmenu"&&F(v);},[n,F]),P=de.useCallback(v=>{n==="dblclick"&&F(v);},[n,F]),D=de.useCallback(v=>{n==="click"&&F(v);},[n,F]),B=de.useCallback(v=>{if(n!=="hover")return;C(),A();let L=r==="center"?E():{x:v.clientX,y:v.clientY};d.current=window.setTimeout(()=>{let H=L.x+(r==="cursor"?a:0),O=L.y+(r==="cursor"?a:0);M(H,O);},0);},[n,r,a,E,M,C,A]),z=de.useCallback(v=>{n==="hover"&&c&&r==="cursor"&&!K&&(p.current={x:v.clientX+a,y:v.clientY+a},k());},[n,c,r,K,a,k]),w=de.useCallback(()=>{n==="hover"&&(C(),T());},[n,C,T]);de.useEffect(()=>{if(n!=="hover")return;let v=()=>{if(!c)return;let L=i.current?.matches(":hover"),H=h()?.matches?.(":hover");L||H?A():T();};return window.addEventListener("pointermove",v,{passive:true,capture:true}),()=>window.removeEventListener("pointermove",v,{capture:true})},[c,n,h,A,T]),de.useEffect(()=>{let v=()=>{if(c)if(n==="hover"){let L=i.current?.matches(":hover"),H=h()?.matches?.(":hover");if(L||H?A():T(),r==="center"&&i.current){let O=E();p.current={x:O.x,y:O.y},k();}}else l(false);};return window.addEventListener("scroll",v,true),window.addEventListener("resize",v,true),()=>{window.removeEventListener("scroll",v,true),window.removeEventListener("resize",v,true);}},[c,n,r,E,k,l,A,T,h]),de.useEffect(()=>()=>{C(),A();},[C,A]);let g=({children:v})=>c?jsx("div",{ref:b,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"&&A(),onMouseLeave:()=>n==="hover"&&T(),children:v}):null;return jsxs("div",{ref:i,onContextMenu:I,onDoubleClick:P,onClick:D,onMouseEnter:B,onMouseMove:z,onMouseLeave:w,css:css({position:"relative"}),className:"plainframe-ui-context-zone-wrapper",children:[e,K?S:jsx(g,{children:S})]})};var zn=(e,t="0px")=>e==null?t:typeof e=="number"?`${e}px`:e,Qp=de.memo(forwardRef(function({label:t,variant:n="full",direction:o="horizontal",labelPosition:r="center",thickness:a=1,width:i,middleMargin:c="5px",insetMargin:s="10px",chip:l=false,chipVariant:u="subtle",rounded:p=false,margin:b=10,css:f,labelCss:R,strokeCss:k,className:y,...x},h){let d=j(),{t:m,strokeColor:C,labelTextColor:A,chipSubtleBg:T,chipOutlinedBg:E,outerM:M,padX:$,verticalStrokeMargin:K}=useMemo(()=>{let P=typeof a=="number"?`${a}px`:a,D=d.surface.border,B=d.text.secondary,z=d.surface.subtleBg,w=d.surface.panelBg,g=zn(b,"10px"),v=o==="horizontal"?n==="middle"?zn(c):n==="inset"?zn(s,"0px"):"0":"0",L=o==="vertical"?n==="middle"?zn(c):n==="inset"?zn(s,"0px"):"0":"0";return {t:P,strokeColor:D,labelTextColor:B,chipSubtleBg:z,chipOutlinedBg:w,outerM:g,padX:v,verticalStrokeMargin:L}},[a,d,o,n,c,s,b]),W=useMemo(()=>css([{display:"flex",alignItems:"center"},o==="vertical"?{flexDirection:"column",alignSelf:"stretch",width:t?"max-content":m,minWidth:t?"max-content":m,marginLeft:M,marginRight:M}:{flexDirection:"row",width:i?zn(i):"100%",minWidth:0,paddingLeft:$,paddingRight:n==="middle"?$:"0",marginTop:M,marginBottom:M},...Array.isArray(f)?f:f?[f]:[]]),[o,t,m,M,i,$,n,f]),S=useMemo(()=>css([{background:C,borderRadius:p?d.radius.full:d.radius.xs},o==="vertical"?{width:m,minHeight:18,flex:1,marginTop:K,marginBottom:K}:{height:m,flex:1}]),[C,p,d.radius.full,d.radius.xs,o,m,K]),F=useMemo(()=>css([{margin:l?o==="vertical"?"4px 0":0:o==="vertical"?"2px 0":0,padding:l?"3px 7px":0,borderRadius:l?p?d.radius.full:`calc(${d.radius.sm} * 0.75)`:`calc(${d.radius.sm} * 0.75)`,color:A,fontWeight:500,fontSize:13,textAlign:"center",alignSelf:"center",whiteSpace:o==="vertical"?"normal":"pre",wordBreak:o==="vertical"?"break-all":void 0,...l?u==="subtle"?{background:T,border:"none"}:{background:E,border:`${m} solid ${C}`}:{}},...Array.isArray(R)?R:R?[R]:[]]),[l,o,p,d.radius.full,d.radius.sm,A,u,T,E,m,C,R]),I=useMemo(()=>jsx("div",{className:"plainframe-ui-divider-stroke",css:[S,k]}),[S,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",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="top"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="bottom"&&I,!t&&I]}):jsxs("div",{ref:h,"data-direction":"horizontal","data-variant":n,"data-chip":l?"true":void 0,className:["plainframe-ui-divider-wrapper",y||""].join(" ").trim(),css:W,...x,children:[t&&r!=="left"&&I,t&&jsx("span",{className:"plainframe-ui-divider-label",css:F,children:t}),t&&r!=="right"&&I,!t&&I]})}));var gl=de.createContext(null),bl=()=>{let e=useContext(gl);if(!e)throw new Error("Drawer components must be used within <Drawer>.");return e},hl=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:a=true})=>{let[i,c]=useState(!!n),s=t??i,l=useCallback(p=>{t===void 0&&c(p),o?.(p);},[t,o]),u=useMemo(()=>({open:s,setOpen:l,lockScroll:r,closeOnEscape:a}),[s,l,r,a]);return jsx(gl.Provider,{value:u,children:e})},nm=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},a)=>{let{setOpen:i}=bl(),c=!!e&&de.isValidElement(t),s=useCallback(u=>{if(c){let p;de.isValidElement(t)&&(p=t.props.onClick),p?.(u);}r.onClick?.(u),u.defaultPrevented||i(true);},[c,t,r.onClick,i]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),i(true)),c){let p;de.isValidElement(t)&&(p=t.props.onKeyDown),p?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,i]);if(c){let u=t,p=u.props.css;return de.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[p,o].filter(Boolean),onClick:s,onKeyDown:l,...r})}return jsx("button",{ref:a,type:"button",className:n,css:o,onClick:s,onKeyDown:l,...r,children:t})});nm.displayName="DrawerTrigger";var vo=0,yl="",xl="",om=()=>typeof window>"u"?0:window.innerWidth-document.documentElement.clientWidth;function rm(){if(!(typeof document>"u")){if(vo===0){let e=document.body;yl=e.style.overflow||"",xl=e.style.paddingRight||"";let t=om();e.style.overflow="hidden",t>0&&(e.style.paddingRight=`${t}px`);}vo+=1;}}function sm(){if(!(typeof document>"u")&&(vo>0&&(vo-=1),vo===0)){let e=document.body;e.style.overflow=yl,e.style.paddingRight=xl;}}var am=(e,t=0)=>e==null?t:typeof e=="number"?e:parseFloat(String(e))||t,vl=forwardRef(function({children:t,width:n,height:o,position:r="left",variant:a="inset",margin:i=10,radius:c,backdropBlur:s=true,backdropBlurDepth:l,closeOnClickAway:u=true,transitionMs:p,snapClosePct:b=.33,velocityClosePxS:f=950,dragElasticOut:R=.2,className:k,css:y,...x},h){let d=j(),{open:m,setOpen:C,lockScroll:A,closeOnEscape:T}=bl();useEffect(()=>{if(!(!A||!m))return rm(),()=>sm()},[m,A]);let E=useMemo(()=>am(i,0),[i]),M=useMemo(()=>r==="left"||r==="right"?"x":"y",[r]),$=useMemo(()=>r==="left"||r==="top"?-1:1,[r]),K=useMemo(()=>n??(r==="left"||r==="right"?320:a==="inset"?`calc(100% - ${E*2}px)`:"100%"),[n,r,a,E]),W=useMemo(()=>o??(r==="top"||r==="bottom"?420:a==="inset"?`calc(100% - ${E*2}px)`:"100%"),[o,r,a,E]),S=useMemo(()=>{let V=String(d.radius.lg);switch(r){case "left":return `0 ${V} ${V} 0`;case "right":return `${V} 0 0 ${V}`;case "top":return `0 0 ${V} ${V}`;default:return `${V} ${V} 0 0`}},[r,d.radius.lg]),F=useMemo(()=>c??(a==="inset"?d.radius.lg:S),[c,a,d.radius.lg,S]),I=useMemo(()=>a==="inset"?{top:r==="bottom"?void 0:E,bottom:r==="top"?void 0:E,left:r==="right"?void 0:E,right:r==="left"?void 0:E}:{top:r==="bottom"?void 0:0,bottom:r==="top"?void 0:0,left:r==="right"?void 0:0,right:r==="left"?void 0:0},[a,r,E]),P=useRef(null),D=useCallback(()=>{let V=P.current;if(!V)return 1;let Y=V.getBoundingClientRect();return M==="x"?Y.width:Y.height},[M]),B=useMemo(()=>({type:"spring",stiffness:520,damping:40,mass:.7}),[]),z=useMemo(()=>({duration:(p??280)/1e3,ease:[.22,1,.36,1]}),[p]),w=useMemo(()=>$*1.1,[$]),g=useMemo(()=>M==="x"?{x:`${w*100}%`,y:0}:{y:`${w*100}%`,x:0},[M,w]),v=useMemo(()=>css({position:"fixed",zIndex:1100,...I,width:K,height:W,backgroundColor:d.surface.panelBg,borderRadius:F,overflowY:"auto",WebkitOverflowScrolling:"touch",overscrollBehavior:"contain",willChange:"transform, box-shadow, opacity",backfaceVisibility:"hidden",pointerEvents:m?"auto":"none",touchAction:M==="x"?"pan-y":"pan-x","@media (prefers-reduced-motion: reduce)":{transition:"none"}}),[I,K,W,d.surface,F,m,M]),L=useMemo(()=>css({position:"fixed",inset:0,zIndex:1099,background:d.surface.overlayBg,transition:"all .3s ease",...s?{backdropFilter:`blur(${l??"2px"})`}:null}),[s,l,d.surface]),H=useCallback(()=>{u&&C(false);},[u,C]),O=useMemo(()=>M==="x"?{left:$===-1?R:0,right:$===1?R:0}:{top:$===-1?R:0,bottom:$===1?R:0},[M,$,R]),_=useMemo(()=>M==="x"?{left:0,right:0}:{top:0,bottom:0},[M]),N=useMemo(()=>Math.max(0,Math.min(1,b)),[b]),U=useCallback((V,Y)=>{let le=M==="x"?Y.offset.x:Y.offset.y,ue=M==="x"?Y.velocity.x:Y.velocity.y,pe=$*le>0,Me=Math.abs(le)>=D()*N,Ce=$*ue>f;pe&&(Me||Ce)&&C(false);},[M,$,D,N,f,C]),G=useRef(null);useEffect(()=>{if(!m)return;G.current=document.activeElement;let V=setTimeout(()=>{let ue=P.current;if(!ue)return;let pe=ue.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');pe.length>0?pe[0].focus():ue.focus();},100),Y=ue=>{let pe=P.current;if(!pe||!ue.target)return;let Me=ue.target;if(!pe.contains(Me)){ue.preventDefault();let Ce=pe.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');Ce.length>0?Ce[0].focus():pe.focus();}},le=ue=>{ue.key==="Escape"&&T&&(ue.stopPropagation(),C(false));};return document.addEventListener("focusin",Y,true),window.addEventListener("keydown",le),()=>{clearTimeout(V),document.removeEventListener("focusin",Y,true),window.removeEventListener("keydown",le),G.current&&typeof G.current.focus=="function"&&G.current.focus();}},[m,C,T]);let{...se}=x;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?z:{duration:.18,ease:"linear"},onClick:H},"overlay"),jsx(motion.div,{ref:V=>{P.current=V,typeof h=="function"?h(V):h&&(h.current=V);},role:"dialog","aria-modal":"true",tabIndex:-1,"data-position":r,"data-variant":a,className:["plainframe-ui-drawer",k||""].join(" ").trim(),css:[v,y],drag:M,dragConstraints:_,dragElastic:O,dragMomentum:false,dragDirectionLock:true,onDragEnd:U,initial:{...g,opacity:.98},animate:{x:0,y:0,opacity:1},exit:{...g,opacity:.98},transition:p?z:B,...se,children:t},"panel")]}):null})});vl.displayName="DrawerContent";var im=forwardRef(function({open:t,on:n,defaultOpen:o,defaultOn:r,onOpenChange:a,onClose:i,children:c,...s},l){let u=t!==void 0?t:n,p=o!==void 0?o:r,b=u!==void 0,[f,R]=useState(!!p),k=b?!!u:f,y=useCallback(x=>{b||R(x),x||i?.(),a?.(x);},[b,i,a]);return jsx(hl,{open:k,onOpenChange:y,children:jsx(vl,{ref:l,...s,children:c})})});im.displayName="DrawerLegacy";var Ks=({children:e,duration:t=300,delay:n=0,on:o=false,onAnimationEnd:r,asChild:a=false,className:i,blur:c=false})=>{let s={opacity:o?1:0,filter:c?o?"none":"blur(10px)":"none",transition:`opacity ${t}ms ease ${n}ms, filter ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"opacity, filter",backfaceVisibility:"hidden"},l=p=>b=>{b.target===b.currentTarget&&(b.propertyName==="opacity"||b.propertyName==="filter")&&r?.(),p?.(b);};if(a&&isValidElement(e)){let p=e,b=p.props.css,f=Array.isArray(b)?[...b,s]:b?[b,s]:[s],R=["plainframe-ui-transition-fade",p.props.className||"",i||""].join(" ").trim(),k=p.props.onTransitionEnd;return cloneElement(p,{...p.props,css:f,className:R,onTransitionEnd:l(k)})}let u=css(s);return jsx("div",{className:["plainframe-ui-transition-fade",i||""].join(" ").trim(),css:u,onTransitionEnd:l(),children:e})};var Cl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Rl=de.memo(({direction:e="row",gap:t="sm",justify:n,align:o="center",className:r,css:a,children:i,width:c,height:s,...l})=>{let u=j(),p=e==="vertical"||e==="column"?"column":"row",b=t===void 0?void 0:typeof t=="number"?t:u.spacing[t]??t,f=css({display:"flex",flexDirection:p,gap:b,justifyContent:n,alignItems:o,maxWidth:Cl(c),width:c?"100%":void 0,maxHeight:Cl(s),height:s?"100%":void 0,boxSizing:"border-box"});return jsx("div",{className:["plainframe-ui-flex",r||""].join(" ").trim(),css:[f,a],...l,children:i})});Rl.displayName="Flex";var _s=({children:e,duration:t=300,delay:n=0,on:o=false,initialScale:r=0,finalScale:a=1,onAnimationEnd:i,asChild:c=false,className:s})=>{let l={transform:o?`scale(${a})`:`scale(${r})`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},u=b=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&i?.(),b?.(f);};if(c&&isValidElement(e)){let b=e,f=b.props.css,R=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=b.props.onTransitionEnd,y=["plainframe-ui-transition-grow",b.props.className||"",s||""].join(" ").trim();return cloneElement(b,{...b.props,css:R,className:y,onTransitionEnd:u(k)})}let p=css(l);return jsx("div",{className:["plainframe-ui-transition-grow",s||""].join(" ").trim(),css:p,onTransitionEnd:u(),children:e})};var Tl={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"}},Rm=e=>e==null?void 0:typeof e=="number"?`${e}px`:String(e),Tm={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",body:"span",caption:"span"},On=de.memo(({variant:e="body",children:t,color:n,size:o,weight:r,lineHeight:a,letterSpacing:i,align:c="left",textTransform:s="none",whiteSpace:l="normal",decoration:u="none",decorationStyle:p="solid",decorationThickness:b=1,decorationColor:f,italic:R,className:k,style:y,as:x})=>{let h=j(),d=Tl[e]??Tl.body,m=x??Tm[e]??"span",C=F=>F==null?d.size:typeof F=="number"?F:h?.typography?.sizes?.[F]??F,A=C(o)??C(d.size),T=r??d.weight,E=a??d.lh,M=i??d.ls,$=n==="secondary"?h.text.secondary:n==="primary"?h.text.primary:n??"inherit",K=f??h.surface.border,W=css({boxSizing:"border-box",display:c==="left"?"inline":"block",textAlign:c==="left"?void 0:c,fontFamily:h?.typography?.fonts?.sans||"inherit",fontSize:A,fontWeight:T,lineHeight:E,letterSpacing:M,color:$,textTransform:s,whiteSpace:l,fontStyle:R?"italic":"normal",margin:0,padding:0}),S=u==="none"?css({textDecoration:"none"}):css({textDecorationLine:u,textDecorationStyle:p,textDecorationColor:K,textDecorationThickness:Rm(b),textDecorationSkipInk:"auto"});return jsx(m,{className:[`pfui-typo-${e}`,k||""].join(" ").trim(),css:[W,S],style:y,"data-variant":e,children:t})});On.displayName="Typography";var qs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,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 qs(typeof n=="number"||typeof n=="string"?n:e)}return e}}},El=forwardRef(function({src:t,alt:n="",width:o,height:r,radius:a="md",shadow:i=false,hoverEffect:c="none",label:s,labelAlign:l="center",aspectRatio:u,loading:p="lazy",decoding:b="async",fetchPriority:f,srcSet:R,sizes:k,placeholder:y,blurDataURL:x,placeholderColor:h="#f1f1f1",fallbackSrc:d,className:m,css:C,onClick:A,onLoad:T,onError:E,...M},$){let[K,W]=useState(false),[S,F]=useState(false),[I,P]=useState(false),D=j(),B=Sm(a,D)??"0px",z=s?"figure":"div",w=css({display:"flex",flexDirection:"column",gap:s?D.spacing.xs:0,width:"fit-content",borderRadius:`var(--pfui-image-radius, ${B})`}),g=css({position:"relative",borderRadius:`var(--pfui-image-radius, ${B})`,maxWidth:o?qs(o):"100%",maxHeight:r?qs(r):void 0,width:o?"100%":void 0,height:r?"100%":void 0,aspectRatio:u,boxShadow:i?"0 12px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.04)":"none",overflow:"hidden",padding:0,lineHeight:0,transition:"transform 0.3s ease",willChange:"transform",transform:K&&(c==="rotate"||c==="scale-rotate")?"rotate(3deg)":"none",cursor:A?"pointer":void 0}),v=css({position:"absolute",inset:0,background:y==="color"?h:void 0,backgroundImage:y==="blur"&&x?`url(${x})`:void 0,backgroundSize:"cover",backgroundPosition:"center",filter:y==="blur"?"blur(8px)":void 0,transition:"opacity 0.3s ease",opacity:I?0:1,pointerEvents:"none"}),L=css({width:"100%",height:"100%",display:"block",objectFit:"cover",transform:K&&(c==="scale"||c==="scale-rotate")?"scale(1.08)":"none",transition:"transform 0.3s ease",willChange:"transform"});return jsxs(z,{className:["plainframe-ui-image",m||""].join(" ").trim(),css:[w,C],tabIndex:-1,children:[jsxs("div",{className:"plainframe-ui-image-frame",css:g,onMouseEnter:()=>W(true),onMouseLeave:()=>W(false),onClick:A,children:[!I&&y&&jsx("div",{"aria-hidden":true,className:"plainframe-ui-image-placeholder",css:v}),jsx("img",{ref:$,className:"plainframe-ui-image-img",css:L,src:S&&d?d:t,alt:n,srcSet:R,sizes:k,loading:p,decoding:b,fetchPriority:f,onLoad:H=>{P(true),T?.(H);},onError:H=>{F(true),E?.(H);},...M})]}),s&&jsx(On,{as:"figcaption",variant:"caption",align:l,children:s})]})});El.displayName="Image";var Sl=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Fm=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}},Am=e=>e*Math.PI/180,Pm=(e,t,n)=>{let o=Math.abs(Am(n)),r=Math.cos(o),a=Math.sin(o);return {w:Math.abs(e*r)+Math.abs(t*a),h:Math.abs(t*r)+Math.abs(e*a)}};function Dm(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 Nm=(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,Il=[1.02,1.03,1.02],kl=[1.06,1.08,1.06],Hm={sm:150,md:200,lg:260,xl:340},Lm=e=>e==null?void 0:typeof e=="number"?`${e}px`:e;function Bm(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 Lm(typeof n=="number"||typeof n=="string"?n:e)}return e}}}var $m=memo(function({children:t,variant:n="fan",width:o,aspectRatio:r="4/5",size:a="md",hoverEffect:i="none",hovering:c,maxItems:s=3,shadow:l=false,cursor:u,outline:p,outlineColor:b,outlineWidth:f=3,outlineOffset:R=0,radius:k="md",label:y,labelAlign:x="center",css:h,className:d,...m}){let C=j(),A=Fm(r)??4/5,T=typeof o=="string"?o:void 0,E=typeof o=="number"?o:T&&/px$/.test(T)?parseFloat(T):Hm[a],M=Math.max(1,E/A),K=Children.toArray(t).filter(isValidElement).slice(0,s),W=K.length,S=Dm(n,W),F=K.map((V,Y)=>Nm(n,W,Y)),I=V=>M*.6*F[V],P=V=>I(V)*A,D=0,B=0;for(let V=0;V<W;V++){let Y=P(V),le=I(V),ue=Math.max(Math.abs(S.base.ang[V]??0),Math.abs(S.exp.ang[V]??0)),pe=Math.max(Math.abs(S.base.dx[V]??0),Math.abs(S.exp.dx[V]??0)),Me=Math.max(Math.abs(S.base.dy[V]??0),Math.abs(S.exp.dy[V]??0)),Ce=i==="expand"?kl[V]??1.08:i==="reveal"?Il[V]??1.03:1,ve=Pm(Y,le,ue),Ee=ve.w*Ce,Re=ve.h*Ce,Z=pe/100*Y*Ce,ie=Me/100*le*Ce;D=Math.max(D,Ee/2+Z),B=Math.max(B,Re/2+ie);}let z=Math.max(1,2*D),w=Math.max(1,2*B),g=Math.min(1,E/z,M/w),v=c===void 0?"pointer":"controlled",L=c?"true":void 0,H=css({display:"flex",flexDirection:"column",cursor:u||"auto",lineHeight:0,position:"relative",isolation:"isolate",gap:y?C.spacing.xs:0}),O=css({position:"relative",width:Sl(typeof o=="number"?o:E)??(typeof o=="string"?o:void 0),height:Sl(M)}),_=css({position:"absolute",inset:0,left:"50%",top:"50%",width:`${z}px`,height:`${w}px`,transform:`translate(-50%, -50%) scale(${g})`,transformOrigin:"center center"}),N=Bm(k,C)??"0px",U=V=>{let Y=n==="fan"?`rotate(${S.base.ang[V]}deg) translate(${S.base.dx[V]}%, ${S.base.dy[V]}%)`:n==="slide"?`translate(${S.base.dx[V]}%, ${S.base.dy[V]}%) rotate(${S.base.ang[V]}deg)`:n==="domino"?`translate(0%, ${S.base.dy[V]}%)`:`translate(${S.base.dx[V]}%, ${S.base.dy[V]}%) rotate(${S.base.ang[V]}deg)`,le=n==="fan"?`rotate(${S.exp.ang[V]}deg) translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%)`:n==="slide"?`translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%) rotate(${S.exp.ang[V]}deg)`:n==="domino"?`translate(0%, ${S.exp.dy[V]}%)`:`translate(${S.exp.dx[V]}%, ${S.exp.dy[V]}%) rotate(${S.exp.ang[V]}deg)`,ue=i==="reveal"?"translate(0,0) rotate(0) scale(1)":`${Y} scale(1)`,pe=i==="expand"?`${le} scale(${kl[V]??1.06})`:i==="reveal"?`${Y} scale(${Il[V]??1.03})`:`${Y} scale(1)`;return css({position:"absolute",top:"50%",left:"50%",transform:`translate(-50%, -50%) ${ue}`,transition:"transform .22s ease",willChange:"transform",backfaceVisibility:"hidden",zIndex:n==="fan"&&V===1?10:V+1,lineHeight:0,boxShadow:l?"rgba(0,0,0,.12) 0 8px 20px":"none",outline:p?`${f}px solid ${b??C.surface.appBg}`:void 0,outlineOffset:p?R:void 0,pointerEvents:"auto",".plainframe-ui-image-stack-wrapper[data-hover-mode='pointer']:hover &":{transform:`translate(-50%, -50%) ${pe}`},".plainframe-ui-image-stack-wrapper[data-hover-mode='controlled'][data-hovered='true'] &":{transform:`translate(-50%, -50%) ${pe}`}})},G=V=>css({width:`${P(V)}px`,aspectRatio:`${A}`,position:"relative",overflow:"hidden",borderRadius:N,"--pfui-image-radius":N,"& > *":{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(y?"figure":"div",{className:["plainframe-ui-image-stack-wrapper",d||""].join(" ").trim(),"data-hover-mode":v,"data-hovered":L,css:[H,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:K.map((V,Y)=>jsx("div",{className:"plainframe-ui-image-stack-item",css:U(Y),children:jsx("div",{className:"plainframe-ui-image-stack-frame",css:G(Y),children:V})},Y))})}),y&&jsx(On,{as:"figcaption",variant:"caption",align:x,children:y})]})});var Ml=e=>typeof e=="number"?`${e}px`:e,Fl={sm:{h:20,px:6,font:10},md:{h:24,px:7,font:12},lg:{h:28,px:8,font:14}};function Wm(e,t){if(e==null){let n=t.radius?.xs??t.radius?.sm??3;return Ml(n)}if(typeof e=="number")return `${e}px`;if(typeof e=="string"){let n=t.radius?.[e]??t.radii?.[e];if(n!=null)return Ml(n)}return e}function Km(e){if(typeof e!="string")return false;let t=e.trim();return !(!t||t.length>4||/[A-Za-z0-9]/.test(t))}var _m=forwardRef(function({children:t,variant:n="outlined",size:o="sm",radius:r,mono:a=true,uppercase:i=false,symbolBoost:c=2,css:s,className:l="plainframe-ui-kbd",...u},p){let b=j(),f=he(),R=Fl[o]??Fl.sm,k=Wm(r,b),y={br:b.neutral[300],txt:b.neutral[800],inset:b.neutral[0]},x=css({all:"unset",boxSizing:"border-box",display:"inline-flex !important",alignItems:"center",justifyContent:"center",minHeight:n==="ghost"?void 0:`${R.h}px !important`,paddingInline:n==="ghost"?0:`${R.px}px !important`,paddingBlock:"0 !important",fontFamily:a?b.typography.fonts.mono:"inherit",fontSize:`${R.font}px !important`,fontWeight:600,letterSpacing:.2,textTransform:i?"uppercase":"none",borderRadius:k,userSelect:"none",verticalAlign:"baseline",position:"relative",outline:"none"}),h=css({"&&":{background:b.surface.subtleBg,border:"none",boxShadow:"none",color:y.txt}}),d=css({"&&":{background:"transparent",color:y.txt,border:"none",boxShadow:"none"}}),m=css({"&&":{background:b.surface.panelBg,color:y.txt,border:`1px solid ${y.br}`,boxShadow:`inset 0 1px 0 ${y.inset}AA, 0 1px 0 rgba(0,0,0,0.03)`}}),C=n==="subtle"?h:n==="ghost"?d:m,T=a&&c>0&&Km(t)?jsx("span",{css:css({display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:`${R.font+c}px`,lineHeight:1}),children:t}):t;return jsx("kbd",{ref:p,className:l,css:[f(),x,C,s],...u,children:T})});var qm=(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:a,asChild:i=false,className:c,distance:s})=>{let u=qm(s,t==="left"||t==="right"?"100vw":"100vh"),p=t==="left"?`-${u}`:t==="right"?u:"0",b=t==="up"?u:t==="down"?`-${u}`:"0",f={transform:r?"translate3d(0,0,0)":`translate3d(${p}, ${b}, 0)`,transition:`transform ${n}ms ease ${o}ms`,pointerEvents:r?"auto":"none",willChange:"transform",backfaceVisibility:"hidden"},R=y=>x=>{x.target===x.currentTarget&&x.propertyName==="transform"&&a?.(),y?.(x);};if(i&&isValidElement(e)){let y=e,x=y.props.css,h=Array.isArray(x)?[...x,f]:x?[x,f]:[f],d=["plainframe-ui-transition-slide",y.props.className||"",c||""].join(" ").trim(),m=y.props.onTransitionEnd;return cloneElement(y,{...y.props,css:h,className:d,onTransitionEnd:R(m)})}let k=css(f);return jsx("div",{className:["plainframe-ui-transition-slide",c||""].join(" ").trim(),css:k,onTransitionEnd:R(),children:e})};var Xs=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,Nl=de.createContext(null),Hl=()=>{let e=useContext(Nl);if(!e)throw new Error("Modal components must be used within <Modal>.");return e},Qm=({children:e,open:t,defaultOpen:n,onOpenChange:o,lockScroll:r=true,closeOnEscape:a=true})=>{let[i,c]=useState(!!n),s=t??i,l=useCallback(p=>{t===void 0&&c(p),o?.(p);},[t,o]);useEffect(()=>{if(!s||!a)return;let p=b=>{b.key==="Escape"&&(b.stopPropagation(),l(false));};return window.addEventListener("keydown",p,true),()=>window.removeEventListener("keydown",p,true)},[s,a,l]);let u=useMemo(()=>({open:s,setOpen:l,lockScroll:r,closeOnEscape:a}),[s,l,r,a]);return jsx(Nl.Provider,{value:u,children:e})},Ll=forwardRef(({asChild:e=true,children:t,className:n,css:o,...r},a)=>{let{setOpen:i}=Hl(),c=!!e&&de.isValidElement(t),s=useCallback(u=>{if(c){let p;de.isValidElement(t)&&(p=t.props.onClick),p?.(u);}r.onClick?.(u),u.defaultPrevented||i(true);},[c,t,r.onClick,i]),l=useCallback(u=>{if((u.key==="Enter"||u.key===" ")&&(u.preventDefault(),i(true)),c){let p;de.isValidElement(t)&&(p=t.props.onKeyDown),p?.(u);}r.onKeyDown?.(u);},[c,t,r.onKeyDown,i]);if(c){let u=t,p=u.props.css;return de.cloneElement(u,{...u.props||{},className:[u.props.className,n].filter(Boolean).join(" ")||void 0,css:[p,o].filter(Boolean),"aria-haspopup":"dialog",onClick:s,onKeyDown:l,...r})}return jsx("button",{ref:a,type:"button",className:n,css:o,"aria-haspopup":"dialog",onClick:s,onKeyDown:l,...r,children:t})});Ll.displayName="ModalTrigger";var Bl=forwardRef(({children:e,variant:t="inset",width:n=500,height:o="auto",radius:r="lg",padding:a="lg",backdrop:i=true,backdropBlur:c=true,backdropBlurDepth:s=5,closeOnClickAway:l=true,transitionVariant:u="fade",direction:p="up",transitionDuration:b=300,containerCss:f,backdropCss:R,className:k,...y},x)=>{let h=j(),{open:d,setOpen:m,lockScroll:C}=Hl(),A=de.useRef(null),T=de.useRef(null);de.useEffect(()=>{if(!d)return;T.current=document.activeElement;let S=setTimeout(()=>{let I=A.current;if(!I)return;let P=I.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');P.length>0?P[0].focus():I.focus();},100),F=I=>{let P=A.current;if(!P||!I.target)return;let D=I.target;if(!P.contains(D)){I.preventDefault();let B=P.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');B.length>0?B[0].focus():P.focus();}};return document.addEventListener("focusin",F,true),()=>{clearTimeout(S),document.removeEventListener("focusin",F,true),T.current&&typeof T.current.focus=="function"&&T.current.focus();}},[d]);let E=typeof h.spacing.sm=="number"?`${h.spacing.sm}px`:String(h.spacing.sm),M=css({width:"100%",height:Xs(o),maxWidth:t==="inset"?`min(${Xs(n)||"100%"}, calc(100% - ${E} * 2))`:Xs(n),maxHeight:t==="inset"?`calc(100% - ${E} * 2)`:"100%",margin:t==="inset"?E:void 0}),$=jsx(Bn,{role:"dialog","aria-modal":"true",tabIndex:-1,className:["plainframe-ui-modal",k||""].join(" ").trim(),padding:a,radius:r,variant:"panel",css:[M,f],ref:S=>{A.current=S,typeof x=="function"?x(S):x&&(x.current=S);},...y,children:e}),K=u==="none"?$:u==="slide"?jsx(Gs,{on:d,direction:p,duration:b,children:$}):u==="grow"?jsx(_s,{initialScale:.75,on:d,duration:b,children:$}):jsx(Ks,{on:d,duration:b,children:$});if(!i)return jsx(Fragment,{children:K});let W=css(t==="full"?{alignItems:"start",justifyItems:"start",justifyContent:"start"}:{alignItems:"center",justifyItems:"center",justifyContent:"center"});return jsx(Ss,{on:d,blur:c,blurDepth:s,onClickAway:l?()=>m(false):void 0,css:[W,R].filter(Boolean),contentCss:W,lockScroll:C,children:K})});Bl.displayName="ModalContent";var lf=({count:e,page:t,defaultPage:n=1,onChange:o,siblingCount:r=1,boundaryCount:a=1,disabled:i=false,showFirstLast:c=false,loop:s=false,variant:l="subtle",gap:u,className:p,css:b})=>{let f=j(),R=he(),k=t!==void 0,[y,x]=useState(n),h=Math.max(1,e),d=Ir(k?t:y,1,h),m=useCallback(g=>{let v=Ir(g,1,h);k||x(v),o?.(v);},[k,h,o]),C=useMemo(()=>cf({count:h,page:d,siblingCount:r,boundaryCount:a}),[h,d,r,a]),A=f.palette?.primary?.[600],T=f.surface?.border,E=l==="subtle"?f.surface.subtleHover:l==="ghost"?f.surface?.subtleBg:f.surface.panelHover,M=f.text?.primary??"#111",$=l==="subtle"?f.surface?.subtleBg:"transparent",K=css({display:"inline-flex",alignItems:"center",gap:u??6,flexWrap:"wrap",borderRadius:f.radius?.md,background:$,padding:l==="subtle"?f.spacing.xs:0,userSelect:"none"},...Array.isArray(b)?b:b?[b]:[]),W=css({minWidth:28,height:28,padding:"0 10px",borderRadius:f.radius.sm,fontSize:13,lineHeight:1,border:"1px solid transparent",background:"transparent",color:M,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:i?"not-allowed":"pointer",outline:"none",transition:"all .16s ease !important","&[aria-disabled='true']":{opacity:.55,pointerEvents:"none",cursor:"not-allowed"},fontWeight:600}),S=css({width:28,minWidth:28,height:28,padding:0}),F=(g=false)=>css([W,R({color:g?"primary":"neutral"}),l==="outlined"?g?{background:A,color:f.text.onColors.primary,borderColor:A}:{background:"transparent",borderColor:T,":hover":{background:E}}:l==="ghost"?g?{background:A,color:f.text.onColors.primary}:{":hover":{background:E}}:g?{background:A,color:f.text.onColors.primary,borderColor:A}:{":hover":{background:E}}]),I=useCallback(()=>m(1),[m]),P=useCallback(()=>m(h),[m,h]),D=useCallback(()=>{d===1?s&&m(h):m(d-1);},[d,s,h,m]),B=useCallback(()=>{d===h?s&&m(1):m(d+1);},[d,s,h,m]),z=i||d===1&&!s,w=i||d===h&&!s;return jsxs("nav",{"aria-label":"Pagination",className:["plainframe-ui-pagination",p||""].join(" ").trim(),css:K,onKeyDown:g=>{i||(g.key==="ArrowLeft"&&(g.preventDefault(),D()),g.key==="ArrowRight"&&(g.preventDefault(),B()),g.key==="Home"&&(g.preventDefault(),I()),g.key==="End"&&(g.preventDefault(),P()));},children:[c&&jsx("button",{className:"plainframe-ui-pagination-first-button",type:"button","aria-label":"First page","aria-disabled":z,disabled:z,css:[F(false),S],onClick:I,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronFirst,{strokeWidth:3,css:{width:14,height:14}})}),jsx("button",{className:"plainframe-ui-pagination-previous-button",type:"button","aria-label":"Previous page","aria-disabled":z,disabled:z,css:[F(false),S],onClick:D,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLeft,{strokeWidth:3,css:{width:14,height:14}})}),C.map((g,v)=>typeof g=="number"?jsx("button",{className:"plainframe-ui-pagination-page-button",type:"button","aria-label":g===d?`Page ${g}, current page`:`Go to page ${g}`,"aria-current":g===d?"page":void 0,css:F(g===d),onClick:()=>m(g),children:g},g):jsx("span",{className:"plainframe-ui-pagination-ellipsis","aria-hidden":true,css:css([W,R(),{borderColor:"transparent",cursor:"default",opacity:.8,padding:0,minWidth:28}]),children:"\u2026"},`e${v}`)),jsx("button",{className:"plainframe-ui-pagination-next-button",type:"button","aria-label":"Next page","aria-disabled":w,disabled:w,css:[F(false),S],onClick:B,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronRight,{strokeWidth:3,css:{width:14,height:14}})}),c&&jsx("button",{className:"plainframe-ui-pagination-last-button",type:"button","aria-label":"Last page","aria-disabled":w,disabled:w,css:[F(false),S],onClick:P,style:{backgroundColor:l==="subtle"?f.surface?.panelBg:void 0},children:jsx(ChevronLast,{strokeWidth:3,css:{width:14,height:14}})})]})};function Ir(e,t,n){return Math.max(t,Math.min(n,e))}function cf({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 a=Sr(1,Math.min(o,e)),i=Sr(Math.max(e-o+1,o+1),e),c=Ir(t-n,o+2,Math.max(o+2,e-o-2*n-1)),s=Ir(t+n,Math.min(o+2+2*n,e-o-1),e-o-1),l=[],u=p=>{let b=l[l.length-1];b!==p&&(b==="ellipsis"&&p==="ellipsis"||l.push(p));};return a.forEach(u),c>o+2?u("ellipsis"):o+1<c&&u(o+1),Sr(c,s).forEach(u),s<e-o-1?u("ellipsis"):e-o>s&&u(e-o),i.forEach(u),l}function Sr(e,t){if(t<e)return [];let n=[];for(let o=e;o<=t;o++)n.push(o);return n}var mf=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,ff=de.memo(({children:e,direction:t="left",width:n,variant:o="solid",className:r,css:a})=>{let i=j(),c=i.surface.border,s=css({display:"inline-block",boxSizing:"border-box",maxWidth:mf(n,"fit-content"),width:"100%",padding:`0 ${i.spacing.md}`,borderLeft:t==="left"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none",borderRight:t==="right"?`3px ${o==="dashed"?"dashed":"solid"} ${c}`:"none"},...Array.isArray(a)?a:a?[a]:[]);return jsx("div",{className:r??"plainframe-ui-quote",css:s,children:e})});var Wl=createContext(null),yf=()=>{let e=useContext(Wl);if(!e)throw new Error("RadioItem must be used within a RadioGroup");return e},xf=e=>{let t=e?.horizontal??"left",n=e?.vertical??"center";return t==="center"&&n==="center"?{horizontal:"left",vertical:"center"}:{horizontal:t,vertical:n}},vf=({value:e,defaultValue:t,onChange:n,disabled:o=false,size:r="md",direction:a="horizontal",variant:i="filled",className:c,children:s,anchorOrigin:l,css:u})=>{let p=j(),b=e!==void 0&&n!==void 0,[f,R]=useState(t),k=b?e:f,y=useRef([]),[x,h]=useState(0),d=()=>h(F=>F+1),m=useCallback(F=>{b||R(F),n?.(F);},[b,n]),C=useCallback(F=>(y.current.push(F),d(),y.current.length-1),[]),A=useCallback((F,I)=>{let P=y.current[F];P&&(y.current[F]={...P,...I},d());},[]),T=()=>y.current.map((F,I)=>({it:F,i:I})).filter(({it:F})=>F.ref&&!F.disabled).map(({i:F})=>F),E=useCallback((F,I)=>{let P=T();if(!P.length)return;let D=Math.max(0,P.indexOf(F)),B=P[(D+I+P.length)%P.length],z=y.current[B]?.ref;if(z){z.focus();let w=y.current[B]?.value;w!==void 0&&m(w);}},[m]),M=useCallback(F=>{let I=T();if(!I.length)return;let P=F==="first"?I[0]:I[I.length-1],D=y.current[P]?.ref;if(D){D.focus();let B=y.current[P]?.value;B!==void 0&&m(B);}},[m]),$=useMemo(()=>{let F=y.current.filter(P=>P.ref&&!P.disabled);return F.length?F.some(P=>P.value===k)?k:F[0]?.value:void 0},[k,x]),K=useMemo(()=>({selected:k,setSelected:m,disabled:o,size:r,direction:a,variant:i,register:C,update:A,moveFocusBy:E,moveToEdge:M,focusValue:$,theme:p,anchorOrigin:xf(l)}),[k,m,o,r,a,i,C,A,E,M,$,p,l]),W=css({width:"fit-content"}),S=css({display:"flex",flexDirection:a==="vertical"?"column":"row",gap:p.spacing.sm,width:"fit-content",alignItems:a==="vertical"?"stretch":"center"});return jsx("div",{className:c??"plainframe-ui-radio-group",css:[W,u],children:jsx("div",{className:"plainframe-ui-radio-row",role:"radiogroup","aria-disabled":o||void 0,css:S,children:jsx(Wl.Provider,{value:K,children:s})})})},Cf=({value:e,disabled:t=false,className:n,children:o,css:r})=>{let{selected:a,setSelected:i,disabled:c,size:s,register:l,update:u,moveFocusBy:p,moveToEdge:b,theme:f,variant:R,focusValue:k,anchorOrigin:y}=yf(),x=c||t,h=a===e,d=["sm","md","lg"].includes(s)?s:"md",m=d==="sm"?16:d==="lg"?24:20,C=O=>f.palette?.primary?.[O],A=C(600),T=C(100),E=f.neutral[300],M=f.palette.primary[300],$=f.text.onColors?.primary??f.neutral[0],K="transparent",W=M,S=$;R==="soft"?(K=T,W=null,S=A):R==="outlined"?(K=C(50),W=M,S=A):(K=f.neutral[200],W="transparent",S=$),h&&(R==="outlined"?(K=T,W=M,S=A):R==="filled"?(K=A,W=null,S=$):(K=T,W=null,S=A));let F=R==="filled"?E:f.palette.primary[100],I=useRef(null),P=useRef(-1);useEffect(()=>{P.current=l({ref:I.current,value:e,disabled:!!x});},[l]),useEffect(()=>{u(P.current,{ref:I.current,value:e,disabled:!!x});},[u,x,e]);let D=css({border:"none",background:"transparent",display:"inline-grid",gridTemplateColumns:"auto auto auto",gridTemplateRows:"auto auto auto",columnGap:y.vertical==="center"?f.spacing.sm:0,rowGap:y.vertical==="center"?0:f.spacing.xs,justifyItems:"center",alignItems:"center",opacity:x?.5:1,borderRadius:f.radius.md,cursor:x?"not-allowed":"pointer",transition:"transform .16s ease",fontSize:f.typography.sizes.sm,fontWeight:500,padding:f.spacing.sm,"&:hover .plainframe-ui-radio-circle-outer":x||h?{}:{background:F,boxShadow:R==="outlined"?`inset 0 0 0 ${f.componentHeights.border} ${M}`:"none"},"&:focus-visible .plainframe-ui-radio-circle-outer":{outline:"none"}}),B=css({width:m,height:m,minWidth:m,minHeight:m,borderRadius:f.radius.full,background:K,boxShadow:W?`inset 0 0 0 ${f.componentHeights.border} ${W}`:"none",transition:"background-color .16s ease, box-shadow .16s ease, filter .16s ease",display:"inline-flex",alignItems:"center",justifyContent:"center"}),z=css({width:h?m*.45:0,height:h?m*.45:0,borderRadius:f.radius.full,background:h?S:"transparent",transition:"all 250ms cubic-bezier(.72,1.6,.32,1)",transform:h?"scale(1)":"scale(0.6)",opacity:h?1:0}),w=css({gridColumn:2,gridRow:2,minWidth:0,maxWidth:"100%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",textAlign:"left"}),g=(()=>{let O=y.horizontal,_=y.vertical;return _==="center"?{col:O==="right"?3:1,row:2}:{col:2,row:_==="top"?1:3}})(),L=!x&&k===e?0:-1,H=he();return jsxs("button",{ref:I,className:n??"plainframe-ui-radio-item",type:"button",role:"radio","aria-checked":h,"aria-disabled":x||void 0,disabled:x,tabIndex:L,onClick:()=>{x||i(e);},onKeyDown:O=>{x||(O.key==="Enter"||O.key===" "?(O.preventDefault(),i(e)):O.key==="ArrowRight"||O.key==="ArrowDown"?(O.preventDefault(),p(P.current,1)):O.key==="ArrowLeft"||O.key==="ArrowUp"?(O.preventDefault(),p(P.current,-1)):O.key==="Home"?(O.preventDefault(),b("first")):O.key==="End"&&(O.preventDefault(),b("last")));},css:[D,H({color:"primary"}),r],children:[jsx("span",{className:"plainframe-ui-radio-circle-outer",css:[B,css({gridColumn:g.col,gridRow:g.row})],children:jsx("span",{className:"plainframe-ui-radio-circle-dot",css:z})}),o!=null&&jsx("span",{className:"plainframe-ui-radio-label",css:w,children:o})]})};var Sf=({children:e,duration:t=400,delay:n=0,on:o=false,initialAngle:r=360,finalAngle:a=0,onAnimationEnd:i,asChild:c=false,className:s})=>{let l={transform:`rotate(${o?a:r}deg)`,transition:`transform ${t}ms ease ${n}ms`,pointerEvents:o?"auto":"none",transformOrigin:"center center",willChange:"transform",backfaceVisibility:"hidden"},u=b=>f=>{f.target===f.currentTarget&&f.propertyName==="transform"&&i?.(),b?.(f);};if(c&&isValidElement(e)){let b=e,f=b.props.css,R=Array.isArray(f)?[...f,l]:f?[f,l]:[l],k=["plainframe-ui-transition-rotate",b.props.className||"",s||""].join(" ").trim(),y=b.props.onTransitionEnd;return cloneElement(b,{...b.props,css:R,className:k,onTransitionEnd:u(y)})}let p=css(l);return jsx("div",{className:["plainframe-ui-transition-rotate",s||""].join(" ").trim(),css:p,onTransitionEnd:u(),children:e})};var Qs=e=>null;Qs.displayName="SelectItem";var Io=(...e)=>e.filter(Boolean).flat();function Zs(e,t){if(!(e==null||typeof e=="boolean")){if(Array.isArray(e)){for(let n of e)Zs(n,t);return}if(de.isValidElement(e)){if(e.type===Qs){t.push(e);return}if(e.type===de.Fragment){Zs(e.props.children,t);return}}}}var _l=({value:e,defaultValue:t,onChange:n,label:o,placeholder:r="Select\u2026",startIcon:a,endIcon:i,multiple:c=false,disabled:s=false,size:l="md",variant:u="subtle",fullWidth:p,width:b=200,menuAlign:f="left",menuWidth:R,menuMaxHeight:k=280,wrapperCss:y,labelCss:x,triggerCss:h,menuCss:d,optionCss:m,children:C,className:A,menuSize:T="md",triggerRender:E})=>{let M=j(),$=he(),K=de.useId(),W=`${K}-label`,S=`${K}-menu`,F={sm:{minHeight:M.componentHeights.sm,radius:M.radius.sm},md:{minHeight:M.componentHeights.md,radius:M.radius.md},lg:{minHeight:M.componentHeights.lg,radius:M.radius.md}},I=F[l]||F.md,[P,D]=de.useState(false),B=Z=>D(!!Z),z=typeof e<"u",w=c||Array.isArray(e)||Array.isArray(t),[g,v]=de.useState(()=>typeof t<"u"?t:w?[]:void 0),L=z?e:g,H=Z=>{z||v(Z),n?.(Z);},O=[];Zs(C,O);let _=O.map((Z,ie)=>{let be=Z.props,X=typeof be.children=="string"||typeof be.children=="number"?String(be.children):void 0;return {key:Z.key??ie,value:be.value,startIcon:be.startIcon,endIcon:be.endIcon,node:be.children,labelText:X}}),N=Z=>w?(Array.isArray(L)?L:[]).some(be=>Object.is(be,Z)):Object.is(L,Z),U=de.useMemo(()=>{if(w){let ie=Array.isArray(L)?L:[];return _.filter(X=>ie.some(ye=>Object.is(ye,X.value))).map(X=>X.labelText??X.node)}let Z=_.find(ie=>Object.is(ie.value,L));if(Z)return Z.labelText??Z.node},[L,w,_]),G=Z=>{s||(Object.is(Z,L)||H(Z),B(false));},se=Z=>{if(s)return;let ie=Array.isArray(L)?L:[],X=ie.some(ye=>Object.is(ye,Z))?ie.filter(ye=>!Object.is(ye,Z)):[...ie,Z];H(X);},V={position:"relative",width:p?"100%":typeof b=="number"?`${b}px`:b,maxWidth:"100%"},Y={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",borderRadius:I.radius,minHeight:I.minHeight,fontSize:M.typography.sizes.sm,padding:`0 ${typeof M.spacing.sm=="number"?`${M.spacing.sm}px`:M.spacing.sm} 0 ${typeof M.spacing.md=="number"?`${M.spacing.md}px`:M.spacing.md}`,fontWeight:500,lineHeight:1,userSelect:"none",cursor:s?"not-allowed":"pointer",border:"none",outline:"none",transition:"box-shadow .16s ease",color:M.text.primary,background:"transparent",whiteSpace:"nowrap"},le=u==="subtle"?{background:M.surface.subtleBg}:u==="outlined"?{background:M.surface.panelBg,border:`1px solid ${M.surface.border}`}:{background:"transparent"},ue={flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",display:"flex",alignItems:"center",textAlign:"left",gap:8},pe={flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},Me={flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontWeight:500,display:"block"},Ce=jsx(ChevronsUpDown,{size:16,css:css({color:M.text.secondary,flexShrink:0}),strokeWidth:2.5,className:"plainframe-ui-select-chevron"}),ve=()=>{if(E)return E(U);if(Array.isArray(U)){let ie=U.map(X=>typeof X=="string"?X:"").filter(Boolean),be=ie.length>0?ie.join(", "):U.length>0?`${U.length} selected`:String(r);return jsxs(Fragment,{children:[a&&jsx("span",{css:css(pe),children:a}),jsx("span",{css:css(Me),title:be,children:be})]})}let Z=U??String(r);return jsxs(Fragment,{children:[a&&jsx("span",{css:css(pe),children:a}),jsx("span",{css:css(Me),title:typeof Z=="string"?Z:void 0,children:Z})]})},Ee={left:"start",center:"center",right:"end"},Re=Z=>{s||(Z.key==="ArrowDown"||Z.key==="ArrowUp"||Z.key==="Enter"||Z.key===" ")&&(Z.preventDefault(),B(true));};return jsxs("div",{css:Io(V,y),className:["plainframe-ui-select-wrapper",A||""].join(" ").trim(),children:[o&&jsx("div",{id:W,className:"plainframe-ui-select-label",css:Io({marginBottom:6,fontSize:M.typography.sizes.sm,fontWeight:500,color:M.text.secondary},x),children:o}),jsxs(Pn,{size:T,open:P,onOpenChange:B,children:[jsx(Dn,{width:"100%",asChild:true,children:jsxs("button",{type:"button",disabled:s,"aria-haspopup":"menu","aria-expanded":P||void 0,"aria-controls":S,"aria-labelledby":o?W:void 0,onKeyDown:Re,onClick:()=>B(!P),className:"plainframe-ui-select-trigger",css:Io(css(Y),css(le),h,$()),children:[jsx("div",{className:"plainframe-ui-select-trigger-content",css:css(ue),children:ve()}),i??Ce]})}),jsx(dn,{id:S,gap:"xs",align:Ee[f],sameWidth:R==null,width:R??b,className:"plainframe-ui-select-menu",css:Io({maxHeight:typeof k=="number"?`${k}px`:k,overflowY:"auto"},d),children:_.map((Z,ie)=>{let be=N(Z.value);return jsx(Mt,{startIcon:Z.startIcon,endIcon:Z.endIcon,selected:be,disabled:s,closeOnSelect:!w,onSelect:()=>w?se(Z.value):G(Z.value),css:Io(m),className:"plainframe-ui-select-option",children:Z.node},Z.key??ie)})})]})]})};_l.displayName="Select";var ea=(e,t)=>e==null?t:typeof e=="number"?`${e}px`:e,Ff=keyframes`
14
14
  0% { background-position: -200% 0; }
15
15
  100% { background-position: 200% 0; }
16
- `,Ff=keyframes`
16
+ `,Af=keyframes`
17
17
  0% { opacity: .6; }
18
18
  50% { opacity: 1; }
19
19
  100% { opacity: .6; }
20
- `,Pf=de.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:s,style:a,className:c,css:i})=>{let l=j(),u=l.surface.subtleBg,m=l.neutral[200],h=ea(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":ea(r,String(r)),height:s==null?"fit-content":ea(s,String(s))}),T=css({position:"absolute",inset:0,borderRadius:h,pointerEvents:"none",background:u,willChange:"background-position, opacity"}),k=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${m} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Af} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Ff} 1.2s ease-in-out infinite`}):css({}),y=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:h});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,i],style:a,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[T,k]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:y,children:o})]})});var kr=8,ta=20,Vn=4,Gl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:s=1,disabled:a=false,rounded:c=false,showValue:i=false,showStepper:l=false,label:u,fullWidth:m=false,css:h,trackCss:f,thumbCss:T,direction:k="horizontal",className:y,...x})=>{let b=j(),d=k==="vertical",p=useRef(null),[C,F]=useState(false),[R,w]=useState(false),[M,$]=useState(false),K=e!==void 0,W=useCallback(Y=>Math.min(r,Math.max(o,Y)),[o,r]),S=useCallback(Y=>W(Math.round((Y-o)/s)*s+o),[o,s,W]),[A,I]=useState(()=>S(t??o)),P=K?S(e):A;useEffect(()=>{K||I(Y=>S(Y));},[o,r,s,K,S]);let D=b.palette.primary[600];b.surface.panelBg;let z=b.neutral[500],E=useMemo(()=>{let Y=r-o||1;return (P-o)/Y*100},[P,o,r]),g=useCallback(Y=>{K||I(Y),n?.(Y);},[K,n]),v=useCallback((Y,ye)=>{let Q=p.current;if(!Q)return P;let oe=Q.getBoundingClientRect(),ae=d?(oe.bottom-ye)/oe.height:(Y-oe.left)/oe.width;return ae=Math.max(0,Math.min(1,ae)),S(o+ae*(r-o))},[P,d,o,r,S]),L=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),g(v(Y.clientX,Y.clientY)),F(true));},[a,g,v]),H=useCallback(Y=>{a||(Y.currentTarget.setPointerCapture?.(Y.pointerId),F(true));},[a]),O=useCallback(Y=>{!C||a||g(v(Y.clientX,Y.clientY));},[C,a,g,v]),_=useCallback(()=>F(false),[]);useEffect(()=>{if(C)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_);}},[C,O,_]);let N=useCallback(Y=>{if(a)return;let ye=P;if(Y.key==="ArrowRight"||Y.key==="ArrowUp")ye=P+s;else if(Y.key==="ArrowLeft"||Y.key==="ArrowDown")ye=P-s;else if(Y.key==="Home")ye=o;else if(Y.key==="End")ye=r;else return;Y.preventDefault(),g(S(ye));},[a,P,s,o,r,g,S]),U=C||R||M,G=(R||C)&&!a,se=`color-mix(in srgb, ${D} 25%, transparent)`,V=css({display:"flex",flexDirection:d?"row":"column",alignItems:"center",padding:d?"1rem":"1rem 0",width:d?"fit-content":m?"100%":350,height:d?250:"auto",boxSizing:"border-box"}),J=css({marginBottom:d?0:4,marginRight:d?8:0,color:b.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?kr:"100%",height:d?"100%":kr,backgroundColor:b.neutral[200],borderRadius:b.radius.xs,cursor:a?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),ue=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?kr:`calc(100% - ${Vn*.5}px)`,height:d?`calc(100% - ${Vn*.5}px)`:kr,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),pe=css({width:Vn,height:Vn,borderRadius:"50%",backgroundColor:b.text.primary,opacity:.15,flex:"0 0 auto"}),Me=css({position:"absolute",left:0,top:d?`calc(${100-E}% )`:0,bottom:0,width:d?"100%":`${E}%`,height:d?`${E}%`:"100%",backgroundColor:a?z:D,borderRadius:b.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Ce=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:b.text.onColors.primary,width:ta,height:ta,left:d?"50%":`calc(${E}% - ${ta/2}px)`,bottom:d?`${E}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?b.radius.full:`calc(${b.radius.md} * 0.75)`,border:`2px solid ${a?z:D}`,cursor:a?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${C?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),ve=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ee=css({position:"absolute",top:d?`calc(50% - ${Vn*2.5}px)`:0,left:d?"auto":`calc(50% - ${Vn*3}px)`,transform:d?"translateY(-50%)":"translateX(-50%)",backgroundColor:b.neutral[800],color:b.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:b.neutral[800],borderRadius:2,bottom:d?"50%":-2,left:d?-2.5:"50%",transform:d?"translateY(50%) rotate(45deg)":"translateX(-50%) rotate(45deg)"}}),Re=h,Z=f,ie=T,be=Math.floor((r-o)/s)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[V,Re],"data-orientation":d?"vertical":"horizontal",children:[u&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:J,children:u}),jsxs("div",{ref:p,className:"plainframe-ui-slider-track",css:[le,Z],onPointerDown:L,children:[l&&s>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ue,children:Array.from({length:be}).map((Y,ye)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:pe},ye))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Me}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":P,"aria-disabled":a||void 0,tabIndex:a?-1:0,onKeyDown:N,onPointerDown:H,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>w(true),onMouseLeave:()=>w(false),className:"plainframe-ui-slider-thumb",css:[Ce,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:ve,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:Ee,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:P})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[J,{marginLeft:8}],children:u})]})};Gl.displayName="Slider";var $f=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%"}),zf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Of=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"}),Wf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Kf=(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"}),_f=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),jf=(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"}}),Vf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Xl=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"}),Uf=(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}),qf=de.memo(function({i:t,item:n,size:o,tokens:r,variant:s,titlePosition:a,isActive:c,completed:i,disabled:l,connectorColor:u,showConnector:m,animate:h,separator:f,canGoToIndex:T,setSelected:k}){let y=j(),x=he(),{MAIN:b,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:p,COMPLETE_BG:C,COMPLETE_FG:F,UPCOMING_BG_FILLED:R,UPCOMING_OUTLINE:w,UPCOMING_FG:M}=r,$="transparent",K=M,W=w;s==="subtle"?i?($=C,K=F,W=C):c?($=b,K=d,W=b):($=R,K=M,W=R):i?($=C,K=F,W=C):c?($="transparent",K=p,W=b):($="transparent",K=M,W=w);let S=n.label,A=n.icon??jsx("span",{css:Vf,children:typeof S=="number"?S:t+1}),I=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Of(a),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[jf(o,$,K,W,String(y.radius.full)),!l&&x({color:c?"primary":"neutral"})],onClick:()=>{!l&&T(t)&&k(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof S=="string"?S:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Xl(!i),children:A}),jsx("span",{className:"plainframe-ui-step-check",css:Xl(!!i),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Uf(i||c,y.text.primary,y.text.secondary,String(y.radius.xs),Number(y.spacing.xs)),children:S})]}),m&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:_f,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Wf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Kf(i?1:0,u,h),"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),ra=()=>null;ra.displayName="PlainframeUIStep";var Gf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:s=true,allComplete:a=false,color:c,activeBgColor:i,activeColor:l,completeBgColor:u,completeColor:m,separator:h,titlePosition:f="right",width:T,css:k,className:y,children:x,...b})=>{let d=j(),p=e==="outlined"?"outlined":"subtle",C=de.useMemo(()=>{let v=de.Children.toArray(x).filter(L=>de.isValidElement(L)&&L.type===ra);return v.length?v.map((L,H)=>({index:H,...L.props})):[{value:1},{value:2},{value:3}]},[x]),F=de.useCallback((v,L)=>v?d.palette?.[v]??v:L,[d.palette]),R=de.useMemo(()=>({MAIN:String(F(i,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(F(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(F(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(F(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(F(m,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:"")}),[F,i,l,u,m,d.palette.primary,d.neutral,d.text]),w=de.useMemo(()=>{let v=F(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[F,c,d.palette.primary]),[M,$]=de.useState(()=>C.some(L=>L?.value===n)?n:C[0]?.value),K=t!==void 0,W=K?t:M,{activeIndex:S,afterLast:A}=de.useMemo(()=>{let v=C.findIndex(L=>L.value===W);if(v!==-1)return {activeIndex:v,afterLast:false};if(typeof W=="number"){let L=Math.floor(W)-1;if(L>=C.length)return {activeIndex:C.length-1,afterLast:true};if(L>=0)return {activeIndex:L,afterLast:false}}return {activeIndex:0,afterLast:false}},[C,W]),I=de.useCallback(v=>{r||(K||$(v),o?.(v));},[r,K,o]),P=de.useCallback(v=>a||!!C[v]?.complete||(A?true:v<S),[a,C,A,S]),D=de.useCallback(v=>{if(r)return false;let L=C[v];if(!L||L.disabled)return false;if(typeof s=="boolean"){if(s===false&&v>S)return false}else if(typeof s=="function"&&!s(S,v))return false;return true},[r,C,s,S]),[B,z]=de.useState(false);de.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let E=de.useCallback(v=>{if(!C.length||r)return;let L=S;if(v.key==="ArrowRight")L=Math.min(C.length-1,S+1);else if(v.key==="ArrowLeft")L=Math.max(0,S-1);else if(v.key==="Home")L=0;else if(v.key==="End")L=C.length-1;else return;v.preventDefault(),D(L)&&I(C[L].value);},[C,r,S,D,I]),g=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[$f(T),k],...b,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:E,css:zf,children:C.map((v,L)=>jsx(de.Fragment,{children:jsx(qf,{i:L,item:v,size:g,tokens:R,variant:p,titlePosition:f,isActive:!A&&L===S,completed:P(L),disabled:r||!!v.disabled,connectorColor:w,showConnector:L<C.length-1,animate:B,separator:h,canGoToIndex:D,setSelected:I})},String(v.value??L)))})})};var Ar=()=>null;Ar.displayName="PF.Tab";var Fr=()=>null;Fr.displayName="PF.TabContent";function Yf(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:c=false,width:i,fullWidth:l=false,rounded:u=false,titlePosition:m="right",align:h,css:f,trackCss:T,thumbCss:k,activeTabCss:y,activeIndicatorCss:x})=>{let b=j(),d=he(),p=s==="vertical",C=l||i!=null,F=h??(p?"left":"center"),R={left:"flex-start",center:"center",right:"flex-end"},{tabs:w,contents:M}=de.useMemo(()=>{let Q=[],oe=[];return de.Children.forEach(e,ae=>{if(!de.isValidElement(ae))return;let{type:me,props:Fe}=Yf(ae),Le=me===Ar||me?.displayName===Ar.displayName,X=me===Fr||me?.displayName===Fr.displayName;if(Le){let ee=Fe;if(ee?.value===void 0)return;Q.push({value:ee.value,disabled:ee.disabled,node:ee.children,className:ee.className,css:ee.css,activeCss:ee.activeCss});}else if(X){let ee=Fe;if(ee?.value===void 0)return;oe.push({value:ee.value,node:ee.children,className:ee.className,css:ee.css});}}),{tabs:Q,contents:oe}},[e]),$=de.useMemo(()=>w.find(Q=>!Q.disabled)?.value,[w]),[K,W]=de.useState(()=>t!==void 0&&w.some(oe=>oe.value===t&&!oe.disabled)?t:$),S=n!==void 0,A=S?n:K,I=de.useRef(null),P=de.useRef([]),D=Math.max(0,w.findIndex(Q=>Q.value===A)),[B,z]=de.useState({left:0,top:0,width:0,height:0}),[E,g]=de.useState(false),[v,L]=de.useState(false),H=de.useCallback(()=>{let Q=I.current,oe=P.current[D];if(!Q||!oe)return;let ae=Q.getBoundingClientRect(),me=oe.getBoundingClientRect();z({left:me.left-ae.left,top:me.top-ae.top,width:me.width,height:me.height});},[D]);de.useLayoutEffect(()=>{H(),E||(g(true),requestAnimationFrame(()=>L(true)));},[H,E]),de.useEffect(()=>{let Q=new ResizeObserver(()=>H());I.current&&Q.observe(I.current);let oe=P.current[D];oe&&Q.observe(oe);let ae=()=>H();return window.addEventListener("resize",ae),()=>{Q.disconnect(),window.removeEventListener("resize",ae);}},[H,D]);let O=(Q,oe)=>{if(!w.length)return Q;let ae=Q;for(let me=0;me<w.length;me++)if(ae=(ae+oe+w.length)%w.length,!w[ae].disabled)return ae;return Q},_=Q=>{S||W(Q),o?.(Q);},N=Q=>{if(!w.length)return;let oe=D;if(Q.key===(p?"ArrowDown":"ArrowRight"))oe=O(D,1);else if(Q.key===(p?"ArrowUp":"ArrowLeft"))oe=O(D,-1);else if(Q.key==="Home")oe=w.findIndex(me=>!me.disabled);else if(Q.key==="End"){let me=[...w].reverse().findIndex(Fe=>!Fe.disabled);oe=me===-1?D:w.length-1-me;}else return;Q.preventDefault();let ae=w[oe]?.value;ae!==void 0&&_(ae),requestAnimationFrame(()=>P.current[oe]?.focus());},U=b.text.primary,G=b.text.secondary,se=b.neutral[500],V=r==="subtle"?b.surface.subtleBg:"transparent",J=r==="subtle"?b.surface.panelBg??b.surface.panelBg:r==="ghost"?b.surface.subtleBg:"transparent",le=b.text.primary,ue=r==="subtle"||r==="ghost"||r==="underlined",pe=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}),Me=r==="subtle",Ce=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:p?"column":"row",alignItems:p?"stretch":"center",flexWrap:"nowrap",gap:b.spacing.xs,padding:Me?b.spacing.xs:0,background:V,borderRadius:r==="subtle"?u?p?b.radius.lg:b.radius.full:b.radius.lg:"none"}),ve=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:E?1:0,visibility:E?"visible":"hidden",transition:v?`${p?"top":"left"} .24s var(--pf-ease), ${p?"height":"width"} .24s var(--pf-ease), background-color .18s var(--pf-ease)`:"none",borderRadius:r==="subtle"||r==="ghost"?u?b.radius.full:b.radius.md:0,background:r==="underlined"?"transparent":J,...p?{top:`${B.top}px`,height:`${B.height}px`,left:b.spacing.xs,right:b.spacing.xs}:{left:`${B.left}px`,width:`${B.width}px`,top:b.spacing.xs,bottom:b.spacing.xs},boxShadow:c&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Ee=css(r!=="underlined"?{}:p?{background:"transparent",top:`${B.top}px`,height:`${B.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${B.left}px`,width:`${B.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),Re=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&s!=="vertical"?`${b.spacing.md}`:r==="ghost"&&s!=="vertical"?`${b.spacing.md}`:`${b.spacing.xs} ${b.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&u?b.radius.full:b.radius.md,minHeight:b.componentHeights.sm,outline:"none",transition:"color .16s ease !important",display:"flex",alignItems:"center",justifyContent:"center",...p?{width:C?"100%":"auto",flex:"0 0 auto",textAlign:F}:C?{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:b.typography.sizes.sm,fontWeight:600,color:G,"&[aria-selected='true']":{color:U},"&:hover":{color:U},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:se}}),Z=css({display:"inline-flex",alignItems:"center",justifyContent:p?R[F]:"center",gap:6,width:"100%",flexDirection:m==="top"?"column-reverse":m==="bottom"?"column":m==="left"?"row-reverse":"row"}),ie=css({marginTop:b.spacing.sm,width:"100%"}),be=de.useId(),Y=new Map;M.forEach((Q,oe)=>Y.set(Q.value,`${be}-panel-${oe}`));let ye=Q=>`${be}-tab-${Q}`;return jsxs("div",{className:["plainframe-ui-tabs",a||""].join(" ").trim(),css:[pe,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":p?"vertical":"horizontal",onKeyDown:N,css:[Ce,T],children:[ue&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[ve,Ee,k,x]}),w.map((Q,oe)=>{let ae=A===Q.value;return jsx("button",{ref:me=>{P.current[oe]=me;},role:"tab",id:ye(oe),"aria-selected":ae,"aria-controls":Y.get(Q.value),"aria-disabled":Q.disabled||void 0,disabled:Q.disabled,tabIndex:Q.disabled?-1:oe===D?0:-1,className:["plainframe-ui-tab",Q.className||""].join(" ").trim(),onClick:()=>{Q.disabled||_(Q.value);},css:[Re,!Q.disabled&&d(),Q.css,ae?Q.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Z,children:Q.node})},String(Q.value??oe))})]}),M.map((Q,oe)=>{let ae=Q.value===A;if(!ae)return null;let me=w.findIndex(Le=>Le.value===Q.value),Fe=me>=0?ye(me):void 0;return console.log("rendering panel for",Q.value,"active:",ae),jsx("div",{role:"tabpanel",id:Y.get(Q.value),"aria-labelledby":Fe,className:["plainframe-ui-tab-panel",Q.className||""].join(" ").trim(),css:[ie,Q.css],children:Q.node},oe)})]})};var Mo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,vn=e=>e==null?[]:Array.isArray(e)?e:[e],Ao=(...e)=>css(e.filter(Boolean)),og=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:s,helperText:a,disabled:c=false,fullWidth:i=false,width:l=235,size:u="md",variant:m="subtle",rounded:h=false,rows:f=3,maxRows:T,maxLength:k,showCharCount:y,focusRingMode:x="always",resizable:b=false,className:d,wrapperCss:p,inputCss:C,labelCss:F,helperRowCss:R,helperTextCss:w,charCountCss:M,css:$,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:A,name:I,id:P,tabIndex:D,autoComplete:B,readOnly:z,required:E})=>{let g=j(),v=Xo(),L=useId(),H=useMemo(()=>({sm:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.sm,labelFont:g.typography.sizes.xs,helperFont:g.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:g.spacing.md},md:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.md,labelFont:g.typography.sizes.sm,helperFont:g.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:g.spacing.md},lg:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.lg,labelFont:g.typography.sizes.md,helperFont:g.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:g.spacing.md}}),[g]),O=["sm","md","lg"].includes(u)?u:"md",_=H[O],N=g.neutral,U=g.text,G=t!==void 0,[se,V]=useState(n),J=G?t:se,le=useCallback(ae=>{G||V(ae),o?.(ae);},[G,o]),ue=useMemo(()=>c?N[200]:s&&m==="outlined"?g.palette.danger?.[50]??g.surface.panelBg:s&&m==="subtle"?g.palette.danger?.[50]??g.surface.subtleBg:m==="outlined"?g.surface.panelBg:m==="subtle"?g.surface.subtleBg:"transparent",[c,s,m,N,g.surface,g.palette.danger]),pe=g.componentHeights.border,Me=useMemo(()=>m==="outlined"?`${pe} solid ${s?g.palette.danger?.[300]??g.surface.border:g.surface.border}`:"none",[m,pe,s,g.palette.danger,g.surface.border]),Ce=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:i?"100%":l!=null?Mo(l):void 0,flex:"0 0 auto",fontWeight:500}),[i,l]),ve=useMemo(()=>Ao({fontSize:_.labelFont,fontWeight:500,color:s?g.palette.danger?.[700]??U.primary:c?N[500]:U.primary,marginBottom:4,display:"inline-block"},...vn(F)),[_.labelFont,s,c,N,U,g.palette.danger,F]),Ee=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:g.spacing.sm,padding:`${Mo(_.paddingY)} 0 ${Mo(_.paddingY)} ${Mo(_.paddingX)}`,background:ue,border:Me,borderRadius:h?g.radius.full:g.radius.md,minHeight:_.minHeight,width:"100%",cursor:c?"not-allowed":"text",opacity:c?.65:1,transition:"box-shadow .18s, border-color .16s"},...vn(p),...vn($)],[g,_,ue,Me,pe,h,c,p,$]),Re=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,Z=useMemo(()=>Ao({width:"100%",minWidth:0,flex:1,resize:b?"vertical":"none",font:"inherit",fontWeight:500,fontSize:_.fontSize,lineHeight:1.5,color:c?N[500]:s?g.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Mo(_.paddingX),overflowY:"auto",minHeight:Re,"&::placeholder":{color:s?g.palette.danger?.[700]??U.secondary:U.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${s?g.palette.danger?.[800]??U.primary:U.primary} !important`,boxShadow:`0 0 0 1000px ${ue} inset !important`,transition:"opacity 99999s ease-out",caretColor:s?g.palette.danger?.[800]??U.primary:U.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${Re} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...vn(C)),[b,_,c,s,N,U,g.palette.danger,Re,ue,f,C]),ie=useMemo(()=>Ao({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...vn(R)),[R]),be=useMemo(()=>Ao({fontSize:_.helperFont,color:s?g.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...vn(w)),[_.helperFont,s,g.palette.danger,U,w]),Y=useMemo(()=>Ao({fontSize:_.helperFont,color:k&&J.length>k?g.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...vn(M)),[_.helperFont,k,J.length,g.palette.danger,U,M]),ye=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=ye.current;if(!ae)return;if(b){let Fe=window.getComputedStyle(ae),Le=parseFloat(Fe.lineHeight||"20"),X=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),ee=Math.max(Le*(f??1),X);ae.style.setProperty("--pf-minh",`${ee}px`);return}(()=>{let Fe=window.getComputedStyle(ae),Le=parseFloat(Fe.lineHeight||"20"),X=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),ee=Math.max(Le*(f??1),X);ae.style.setProperty("--pf-minh",`${ee}px`);let re=T?Le*T:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,re)}px`;})();},[J,f,T,_.minHeight,b]);let Q=a!=null||y?`${P??L}-help`:void 0,oe=P??L;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Ce,children:[e&&jsx("label",{htmlFor:oe,className:"plainframe-ui-textarea-label",css:ve,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:s?"danger":void 0}),Ee],"aria-invalid":!!s||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&ye.current?.focus(),children:jsx("textarea",{ref:ye,id:oe,className:"plainframe-ui-textarea-input",css:Z,rows:f,value:J,onChange:ae=>{let me=ae.target.value;k&&me.length>k||le(me);},placeholder:r||"",disabled:c,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:A,name:I,tabIndex:D,autoComplete:B,readOnly:z,required:E,"aria-invalid":!!s||void 0,"aria-describedby":Q})}),(a!=null||y&&k!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:Q,className:"plainframe-ui-textarea-helper-text",css:be,children:a}),y&&k!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:Y,children:[J.length,"/",k]})]})]})};var dg=jo,pg={type:"spring",stiffness:920,damping:100},Zl="__toast_root__",mg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Dr=(e,t)=>{for(let n of t){let o=mg(e,n);if(o!=null&&o!=="")return o}},aa=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function fg(e){let t=Dr(e,["radius.md","shape.borderRadius","radii.md"]),n=Dr(e,["spacing.lg","space.4","spacing.4"]),o=Dr(e,["spacing.md","space.3","spacing.3"]),r=Dr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:aa(t,16),padX:aa(n,14),padY:aa(o,12),shadow:String(r)}}var gg=fg(dg),$t=null,Un=null,ge={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function tc(){typeof document>"u"||($t||($t=document.getElementById("toast-host"),$t||($t=document.createElement("div"),$t.id="toast-host",document.body.appendChild($t))),Un||(Un=$t[Zl]??null,Un||(Un=createRoot($t),$t[Zl]=Un,Un.render(jsx(Na,{children:jsx(Sg,{})})))));}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}};}},Cn=()=>{te.sync(),te.notify();},bg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Nr(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(()=>Ne.dismiss(e.id),s);te.timers.set(e.id,a);}function Hr(e){let t=te.timers.get(e);t&&(clearTimeout(t),te.timers.delete(e));}function hg(){let e=false;for(;te.displayed.length<ge.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],Cn();}),Nr(t);}e&&Cn();}function yg(){if(te.displayed.length<ge.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())),Hr(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),Cn();}var xg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function vg(e,t){let n=xg(t),o=e,r=o.surface,s=o.text,a=r?.panelBg??"#fff",c=s?.primary??"#111",i=r?.border;if(n==="default"||n==="info")return {bg:a,fg:c,border:i};let l=s?.onColors??{},u=(m,h,f)=>{let T=o.colors,k=o.palette;return {bg:T?.[m]??k?.[m]?.[700]??h,fg:l?.[m]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:a,fg:c,border:i}}var Ne=Object.assign((e,t)=>{tc();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&&!de.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(de.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??bg(),a=i=>{let l=i.findIndex(h=>h.id===s);if(l===-1)return false;let u=i[l],m={...u,status:r.status??u.status,content:r.content??u.content,title:r.title??u.title,description:r.description??u.description,startIcon:r.startIcon??u.startIcon,endIcon:r.endIcon??u.endIcon,action:r.action??u.action,onClose:r.onClose??u.onClose,duration:r.duration===void 0?u.duration:r.duration,pauseOnHover:r.pauseOnHover??u.pauseOnHover,showDismiss:r.showDismiss??u.showDismiss,render:r.render??u.render,bare:r.bare??u.bare,onClick:r.onClick??u.onClick,width:r.width??u.width};return i[l]=m,Hr(s),te.remaining.delete(s),te.paused.has(s)||Nr(m),Cn(),true};if(a(te.displayed)||a(te.queue))return s;let c={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?ge.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>=ge.max&&yg(),te.displayed=[...te.displayed,c],te.enterFrom[c.id]="tail",te.entering[c.id]=true,requestAnimationFrame(()=>{delete te.entering[c.id],Cn();}),Cn(),Nr(c),s},{success:(e,t={})=>Ne(e,{...t,status:"success"}),error:(e,t={})=>Ne(e,{...t,status:"error"}),warning:(e,t={})=>Ne(e,{...t,status:"warning"}),info:(e,t={})=>Ne(e,{...t,status:"info"}),custom:(e,t={})=>Ne(e,{...t}),update:(e,t)=>Ne({id:e,...t}),dismiss:e=>{if(!e){let n=te.displayed.find(o=>!te.exiting[o.id])?.id;n&&Ne.dismiss(n);return}Hr(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],Cn(),window.setTimeout(()=>t?.onClose?.(),120),hg();},clear:()=>{[...te.displayed.map(t=>t.id)].forEach(t=>Ne.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),Hr(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&&Nr(t,n??void 0),te.remaining.delete(e);},pauseLatest:()=>{let e=te.displayed.at(-1);e&&Ne.pause(e.id);},resumeLatest:()=>{let e=te.displayed.at(-1);e&&Ne.resume(e.id);},promise:(e,t,n={})=>{let o=Ne(t.loading,{...n,status:"info",duration:null});return e.then(r=>{Ne.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{Ne.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ge.max=e.max),e.position&&(ge.position=e.position),e.gutter!=null&&(ge.gutter=e.gutter),e.zIndex!=null&&(ge.zIndex=e.zIndex),e.duration!==void 0&&(ge.duration=e.duration),e.showDismiss&&(ge.showDismiss=e.showDismiss),e.styles&&(ge.styles={...ge.styles,...e.styles}),e.renderer!==void 0&&(ge.renderer=e.renderer),e.bareRenderer!==void 0&&(ge.bareRenderer=e.bareRenderer);}});function Cg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ge.showDismiss}function Rg(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 Tg=css({display:"flex",alignItems:"flex-start",gap:10}),Ql=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),wg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Eg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Sg=de.memo(function(){let t=useSyncExternalStore(te.subscribe.bind(te),()=>te.snapshot,()=>te.snapshot),n=j(),o=ge.position.startsWith("bottom"),r=de.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),s=de.useMemo(()=>({position:"fixed",zIndex:ge.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Rg(ge.position),...ge.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(s),children:jsx(AnimatePresence,{initial:false,children:r.map((a,c)=>{let i=t.enterFrom[a.id]||"tail",l=o?i==="head"?-16:16:i==="head"?16:-16,u=c>0?ge.gutter:0,m={toast:a,close:Ne.dismiss,pause:Ne.pause,resume:Ne.resume},{bg:h,fg:f,border:T}=vg(n,a.status),k={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:gg.shadow,padding:`${n.spacing.md} calc(${n.spacing.lg} + 30px) ${n.spacing.md} ${n.spacing.lg}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:h,color:f,cursor:a.onClick?"pointer":"default",border:T?`1px solid ${T}`:"1px solid transparent"},y=typeof ge.styles.surface=="function"?ge.styles.surface(a):ge.styles.surface??{},x=Cg(a.showDismiss),b={},d="& .plainframe-ui-toast-close",p="&:hover .plainframe-ui-toast-close";x==="hover"?(b[d]={opacity:0,pointerEvents:"none"},b[p]={opacity:1,pointerEvents:"auto"}):x==="always"?b[d]={opacity:1,pointerEvents:"auto"}:x==="never"&&(b[d]={display:"none"});let C=css({...k,...y,...b}),F=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",...ge.styles.close??{}}),R;if(a.bare&&a.render){let w=typeof a.render=="function"?a.render(m):a.render;R=jsx("div",{style:{pointerEvents:"auto"},onClick:M=>a.onClick?.(a.id,M),children:w});}else if(ge.bareRenderer&&ge.renderer){let w=typeof ge.renderer=="function"?ge.renderer(m):ge.renderer;R=jsx("div",{style:{pointerEvents:"auto"},onClick:M=>a.onClick?.(a.id,M),children:w});}else {let w;ge.renderer?w=typeof ge.renderer=="function"?ge.renderer(m):ge.renderer:a.render&&!a.bare?w=typeof a.render=="function"?a.render(m):a.render:w=jsxs(Fragment,{children:[jsxs("div",{css:Tg,children:[a.startIcon&&jsx("div",{css:Ql,children:a.startIcon}),jsx("div",{css:wg,children:a.content}),a.endIcon&&jsx("div",{css:Ql,children:a.endIcon})]}),a.action&&jsx("div",{css:Eg,children:a.action})]}),R=jsxs("div",{css:C,onClick:M=>a.onClick?.(a.id,M),children:[w,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:F,onClick:M=>{M.stopPropagation(),Ne.dismiss(a.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Ig,{id:a.id,isBottom:o,mt:u,enterY:l,width:a.width,pauseOnHover:a.pauseOnHover!==false,children:R},a.id)})})})}),Ig=de.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:s,width:a,pauseOnHover:c,children:i}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:pg});},[l]);let u={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",...ge.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(u),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:(m,h)=>{let f=Math.abs(h.offset.x),T=Math.abs(h.velocity.x);if(!(f>60||T>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let x=(h.offset.x!==0?Math.sign(h.offset.x):Math.sign(h.velocity.x||1))*(window.innerWidth+160),b=typeof h.velocity.x=="number"?h.velocity.x/10:0;l.start({x,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:b}}).then(()=>Ne.dismiss(n));},onMouseEnter:c?()=>Ne.pause(n):void 0,onMouseLeave:c?()=>Ne.resume(n):void 0,children:i})}),ec=false;(function(){ec||(ec=true,tc());})();var Yg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},rc=createContext(null),sc=()=>{let e=useContext(rc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Jg=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:s=80,arrow:a=true,autoWidth:c=false,disableHoverListener:i=false})=>{let[l,u]=useState(!!o),m=n??l,h=R=>{n===void 0&&u(R),r?.(R);},f=useRef(null),T=useFloating({placement:t,open:m,onOpenChange:h,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(T.context,{enabled:!i,delay:{open:s,close:60},handleClose:safePolygon(),restMs:20}),y=useFocus(T.context),x=useDismiss(T.context,{escapeKey:true,outsidePress:true}),b=useRole(T.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:p}=useInteractions([k,y,x,b]),C=useId(),F=useMemo(()=>({open:m,setOpen:h,id:C,placement:T.placement,autoWidth:c,allowArrow:!!a,refs:T.refs,floatingStyles:T.floatingStyles,middlewareData:T.middlewareData,getReferenceProps:d,getFloatingProps:p,arrowRef:f}),[m,c,a,T.placement,T.refs,T.floatingStyles,T.middlewareData,d,p]);return jsx(rc.Provider,{value:F,children:e})},Zg=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:s,id:a}=sc(),c=de.isValidElement(t),i=c&&typeof t.type=="string";if(e&&c&&i){let l=t,u="ref"in l?l.ref:void 0,m=s({...l.props,"aria-describedby":a,ref:Yg(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),h=[l.props?.css||void 0,o].filter(Boolean);return de.cloneElement(l,{...m,css:h})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...s({"aria-describedby":a}),children:t})},Qg=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:s,floatingStyles:a,middlewareData:c,getFloatingProps:i,placement:l,id:u,autoWidth:m,allowArrow:h,arrowRef:f}=sc(),T=j(),k=l.split("-")[0]||"top",x=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},b=x,d=k==="bottom"?"center top":k==="top"?"center bottom":k==="left"?"right center":"left center",p=css({zIndex:1300,backgroundColor:T.neutral[900],color:T.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:d}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:T.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),F=c.arrow,R={top:"bottom",bottom:"top",left:"right",right:"left"}[k];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:s.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[p,n],style:a,initial:x,animate:{opacity:1,x:0,y:0,scale:1},exit:b,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,h&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[C,o],style:{left:F?.x!=null?`${F.x}px`:void 0,top:F?.y!=null?`${F.y}px`:void 0,[R]:"-3px"}})]})})})};function ob(){let e=j();return jsx(Global,{styles:css`
20
+ `,Pf=de.memo(({isLoading:e=true,radius:t,animation:n="wave",children:o,width:r,height:a,style:i,className:c,css:s})=>{let l=j(),u=l.surface.subtleBg,p=l.neutral[200],b=ea(t??l.radius?.lg??8,"8px"),f=css({position:"relative",display:"inline-block",verticalAlign:"middle",width:r==null?"fit-content":ea(r,String(r)),height:a==null?"fit-content":ea(a,String(a))}),R=css({position:"absolute",inset:0,borderRadius:b,pointerEvents:"none",background:u,willChange:"background-position, opacity"}),k=n==="wave"?css({backgroundImage:`linear-gradient(90deg, ${u} 25%, ${p} 50%, ${u} 75%)`,backgroundSize:"200% 100%",animation:`${Ff} 1.4s ease-in-out infinite`}):n==="pulse"?css({animation:`${Af} 1.2s ease-in-out infinite`}):css({}),y=css({visibility:e?"hidden":"visible",display:"inline-block",borderRadius:b});return jsxs("span",{className:["plainframe-ui-skeleton",c||""].join(" ").trim(),css:[f,s],style:i,"aria-busy":e||void 0,children:[e&&jsx("span",{"aria-hidden":true,css:[R,k]}),jsx("span",{className:"plainframe-ui-skeleton-content",css:y,children:o})]})});var Mr=8,ta=20,jn=4,Gl=({value:e,defaultValue:t,onChange:n,min:o=0,max:r=100,step:a=1,disabled:i=false,rounded:c=false,showValue:s=false,showStepper:l=false,label:u,fullWidth:p=false,css:b,trackCss:f,thumbCss:R,direction:k="horizontal",className:y,...x})=>{let h=j(),d=k==="vertical",m=useRef(null),[C,A]=useState(false),[T,E]=useState(false),[M,$]=useState(false),K=e!==void 0,W=useCallback(X=>Math.min(r,Math.max(o,X)),[o,r]),S=useCallback(X=>W(Math.round((X-o)/a)*a+o),[o,a,W]),[F,I]=useState(()=>S(t??o)),P=K?S(e):F;useEffect(()=>{K||I(X=>S(X));},[o,r,a,K,S]);let D=h.palette.primary[600];h.surface.panelBg;let z=h.neutral[500],w=useMemo(()=>{let X=r-o||1;return (P-o)/X*100},[P,o,r]),g=useCallback(X=>{K||I(X),n?.(X);},[K,n]),v=useCallback((X,ye)=>{let Q=m.current;if(!Q)return P;let ne=Q.getBoundingClientRect(),ae=d?(ne.bottom-ye)/ne.height:(X-ne.left)/ne.width;return ae=Math.max(0,Math.min(1,ae)),S(o+ae*(r-o))},[P,d,o,r,S]),L=useCallback(X=>{i||(X.currentTarget.setPointerCapture?.(X.pointerId),g(v(X.clientX,X.clientY)),A(true));},[i,g,v]),H=useCallback(X=>{i||(X.currentTarget.setPointerCapture?.(X.pointerId),A(true));},[i]),O=useCallback(X=>{!C||i||g(v(X.clientX,X.clientY));},[C,i,g,v]),_=useCallback(()=>A(false),[]);useEffect(()=>{if(C)return window.addEventListener("pointermove",O),window.addEventListener("pointerup",_),window.addEventListener("pointercancel",_),()=>{window.removeEventListener("pointermove",O),window.removeEventListener("pointerup",_),window.removeEventListener("pointercancel",_);}},[C,O,_]);let N=useCallback(X=>{if(i)return;let ye=P;if(X.key==="ArrowRight"||X.key==="ArrowUp")ye=P+a;else if(X.key==="ArrowLeft"||X.key==="ArrowDown")ye=P-a;else if(X.key==="Home")ye=o;else if(X.key==="End")ye=r;else return;X.preventDefault(),g(S(ye));},[i,P,a,o,r,g,S]),U=C||T||M,G=(T||C)&&!i,se=`color-mix(in srgb, ${D} 25%, transparent)`,V=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"}),Y=css({marginBottom:d?0:4,marginRight:d?8:0,color:h.text.primary,userSelect:"none"}),le=css({position:"relative",width:d?Mr:"100%",height:d?"100%":Mr,backgroundColor:h.neutral[200],borderRadius:h.radius.xs,cursor:i?"not-allowed":"pointer",touchAction:"none",outline:"none",overflow:"visible"}),ue=css({position:"absolute",left:d?"50%":0,top:d?2:"50%",transform:d?"translateX(-50%)":"translateY(-50%)",width:d?Mr:`calc(100% - ${jn*.5}px)`,height:d?`calc(100% - ${jn*.5}px)`:Mr,display:"flex",flexDirection:d?"column":"row",justifyContent:"space-between",alignItems:"center",pointerEvents:"none",zIndex:0,padding:0}),pe=css({width:jn,height:jn,borderRadius:"50%",backgroundColor:h.text.primary,opacity:.15,flex:"0 0 auto"}),Me=css({position:"absolute",left:0,top:d?`calc(${100-w}% )`:0,bottom:0,width:d?"100%":`${w}%`,height:d?`${w}%`:"100%",backgroundColor:i?z:D,borderRadius:h.radius.sm,zIndex:1,transition:"none",pointerEvents:"none"}),Ce=css({position:"absolute",appearance:"none",WebkitAppearance:"none",background:h.text.onColors.primary,width:ta,height:ta,left:d?"50%":`calc(${w}% - ${ta/2}px)`,bottom:d?`${w}%`:"auto",top:d?"auto":"50%",transform:d?"translate(-50%, 50%)":"translateY(-50%)",borderRadius:c?h.radius.full:`calc(${h.radius.md} * 0.75)`,border:`2px solid ${i?z:D}`,cursor:i?"not-allowed":"grab",zIndex:5,padding:0,lineHeight:0,transition:"box-shadow .16s ease",boxShadow:G?`0 0 0 ${C?4:8}px ${se}`:`0 0 0 0px ${se}`,"&:focus-visible":{boxShadow:`0 0 0 4px ${se}`,outline:"none"}}),ve=css({position:"relative",backgroundColor:"transparent",padding:"1rem",top:d?-7.5:-28,left:d?9:-7.5,pointerEvents:"none"}),Ee=css({position:"absolute",top:d?`calc(50% - ${jn*2.5}px)`:0,left:d?"auto":`calc(50% - ${jn*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)"}}),Re=b,Z=f,ie=R,be=Math.floor((r-o)/a)+1;return jsxs("div",{...x,role:"group","aria-label":u,className:["plainframe-ui-slider",y||""].join(" ").trim(),css:[V,Re],"data-orientation":d?"vertical":"horizontal",children:[u&&!d&&jsx("div",{className:"plainframe-ui-slider-label",css:Y,children:u}),jsxs("div",{ref:m,className:"plainframe-ui-slider-track",css:[le,Z],onPointerDown:L,children:[l&&a>0&&jsx("div",{className:"plainframe-ui-slider-stepper",css:ue,children:Array.from({length:be}).map((X,ye)=>jsx("span",{className:"plainframe-ui-slider-step-dot",css:pe},ye))}),jsx("div",{className:"plainframe-ui-slider-fill",css:Me}),jsxs("button",{type:"button",role:"slider","aria-valuemin":o,"aria-valuemax":r,"aria-valuenow":P,"aria-disabled":i||void 0,tabIndex:i?-1:0,onKeyDown:N,onPointerDown:H,onPointerUp:_,onPointerCancel:_,onMouseEnter:()=>E(true),onMouseLeave:()=>E(false),className:"plainframe-ui-slider-thumb",css:[Ce,ie],children:[jsx(AnimatePresence,{children:U&&jsx(motion.div,{className:"plainframe-ui-slider-tooltip-anchor",css:ve,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:Ee,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:P})})}),null]})]}),u&&d&&jsx("div",{className:"plainframe-ui-slider-label",css:[Y,{marginLeft:8}],children:u})]})};Gl.displayName="Slider";var $f=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%"}),zf=css({display:"flex",alignItems:"center",width:"100%",gap:12}),Of=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"}),Wf=e=>css({position:"relative",flex:"1 1 24px",minWidth:6,height:2,borderRadius:1,background:e,overflow:"hidden"}),Kf=(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"}),_f=css({flex:"1 1 24px",minWidth:2,display:"flex",alignItems:"center",justifyContent:"center"}),jf=(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"}}),Vf=css({fontWeight:700,fontSize:14,lineHeight:1,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis"}),Xl=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"}),Uf=(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}),qf=de.memo(function({i:t,item:n,size:o,tokens:r,variant:a,titlePosition:i,isActive:c,completed:s,disabled:l,connectorColor:u,showConnector:p,animate:b,separator:f,canGoToIndex:R,setSelected:k}){let y=j(),x=he(),{MAIN:h,ACTIVE_TEXT:d,ACTIVE_TEXT_OUTLINED:m,COMPLETE_BG:C,COMPLETE_FG:A,UPCOMING_BG_FILLED:T,UPCOMING_OUTLINE:E,UPCOMING_FG:M}=r,$="transparent",K=M,W=E;a==="subtle"?s?($=C,K=A,W=C):c?($=h,K=d,W=h):($=T,K=M,W=T):s?($=C,K=A,W=C):c?($="transparent",K=m,W=h):($="transparent",K=M,W=E);let S=n.label,F=n.icon??jsx("span",{css:Vf,children:typeof S=="number"?S:t+1}),I=n.completedIcon??jsx(Check,{strokeWidth:3.25,size:16});return jsxs(Fragment,{children:[jsxs("div",{className:"plainframe-ui-step",css:Of(i),children:[jsxs("button",{className:"plainframe-ui-step-node",css:[jf(o,$,K,W,String(y.radius.full)),!l&&x({color:c?"primary":"neutral"})],onClick:()=>{!l&&R(t)&&k(n.value);},tabIndex:l?-1:0,"aria-current":c?"step":void 0,"aria-disabled":l||void 0,disabled:l,"aria-label":typeof S=="string"?S:`Step ${t+1}`,children:[jsx("span",{className:"plainframe-ui-step-content",css:Xl(!s),children:F}),jsx("span",{className:"plainframe-ui-step-check",css:Xl(!!s),children:I})]}),S&&jsx("span",{className:"plainframe-ui-step-label",css:Uf(s||c,y.text.primary,y.text.secondary,String(y.radius.xs),Number(y.spacing.xs)),children:S})]}),p&&(f?jsx("div",{className:"plainframe-ui-stepper-separator",css:_f,children:f}):jsx("div",{className:"plainframe-ui-step-connector",css:Wf(y.neutral[300]),children:jsx("div",{className:"plainframe-ui-step-connector-fill",css:Kf(s?1:0,u,b),"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),ra=()=>null;ra.displayName="PlainframeUIStep";var Gf=({variant:e="subtle",value:t,defaultValue:n,onChange:o,disabled:r=false,allowForward:a=true,allComplete:i=false,color:c,activeBgColor:s,activeColor:l,completeBgColor:u,completeColor:p,separator:b,titlePosition:f="right",width:R,css:k,className:y,children:x,...h})=>{let d=j(),m=e==="outlined"?"outlined":"subtle",C=de.useMemo(()=>{let v=de.Children.toArray(x).filter(L=>de.isValidElement(L)&&L.type===ra);return v.length?v.map((L,H)=>({index:H,...L.props})):[{value:1},{value:2},{value:3}]},[x]),A=de.useCallback((v,L)=>v?d.palette?.[v]??v:L,[d.palette]),T=de.useMemo(()=>({MAIN:String(A(s,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),ACTIVE_TEXT:String(A(l,typeof d.text.onColors?.primary=="string"?d.text.onColors?.primary:"")),ACTIVE_TEXT_OUTLINED:String(A(l,typeof d.text.primary=="string"?d.text.primary:"")),COMPLETE_BG:String(A(u,typeof d.palette.primary[600]=="string"?d.palette.primary[600]:"")),COMPLETE_FG:String(A(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:"")}),[A,s,l,u,p,d.palette.primary,d.neutral,d.text]),E=de.useMemo(()=>{let v=A(c,d.palette.primary[600]);return typeof v=="string"?v:String(v)},[A,c,d.palette.primary]),[M,$]=de.useState(()=>C.some(L=>L?.value===n)?n:C[0]?.value),K=t!==void 0,W=K?t:M,{activeIndex:S,afterLast:F}=de.useMemo(()=>{let v=C.findIndex(L=>L.value===W);if(v!==-1)return {activeIndex:v,afterLast:false};if(typeof W=="number"){let L=Math.floor(W)-1;if(L>=C.length)return {activeIndex:C.length-1,afterLast:true};if(L>=0)return {activeIndex:L,afterLast:false}}return {activeIndex:0,afterLast:false}},[C,W]),I=de.useCallback(v=>{r||(K||$(v),o?.(v));},[r,K,o]),P=de.useCallback(v=>i||!!C[v]?.complete||(F?true:v<S),[i,C,F,S]),D=de.useCallback(v=>{if(r)return false;let L=C[v];if(!L||L.disabled)return false;if(typeof a=="boolean"){if(a===false&&v>S)return false}else if(typeof a=="function"&&!a(S,v))return false;return true},[r,C,a,S]),[B,z]=de.useState(false);de.useEffect(()=>{let v=requestAnimationFrame(()=>z(true));return ()=>cancelAnimationFrame(v)},[]);let w=de.useCallback(v=>{if(!C.length||r)return;let L=S;if(v.key==="ArrowRight")L=Math.min(C.length-1,S+1);else if(v.key==="ArrowLeft")L=Math.max(0,S-1);else if(v.key==="Home")L=0;else if(v.key==="End")L=C.length-1;else return;v.preventDefault(),D(L)&&I(C[L].value);},[C,r,S,D,I]),g=34;return jsx("div",{tabIndex:-1,className:["plainframe-ui-stepper",y||""].join(" ").trim(),css:[$f(R),k],...h,children:jsx("div",{tabIndex:-1,className:"plainframe-ui-stepper-track",role:"list",onKeyDown:w,css:zf,children:C.map((v,L)=>jsx(de.Fragment,{children:jsx(qf,{i:L,item:v,size:g,tokens:T,variant:m,titlePosition:f,isActive:!F&&L===S,completed:P(L),disabled:r||!!v.disabled,connectorColor:E,showConnector:L<C.length-1,animate:B,separator:b,canGoToIndex:D,setSelected:I})},String(v.value??L)))})})};var Ar=()=>null;Ar.displayName="PF.Tab";var Pr=()=>null;Pr.displayName="PF.TabContent";function Yf(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:a="horizontal",className:i,shadow:c=false,width:s,fullWidth:l=false,rounded:u=false,titlePosition:p="right",align:b,css:f,trackCss:R,thumbCss:k,activeTabCss:y,activeIndicatorCss:x})=>{let h=j(),d=he(),m=a==="vertical",C=l||s!=null,A=b??(m?"left":"center"),T={left:"flex-start",center:"center",right:"flex-end"},{tabs:E,contents:M}=de.useMemo(()=>{let Q=[],ne=[];return de.Children.forEach(e,ae=>{if(!de.isValidElement(ae))return;let{type:me,props:Ae}=Yf(ae),He=me===Ar||me?.displayName===Ar.displayName,J=me===Pr||me?.displayName===Pr.displayName;if(He){let oe=Ae;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(J){let oe=Ae;if(oe?.value===void 0)return;ne.push({value:oe.value,node:oe.children,className:oe.className,css:oe.css});}}),{tabs:Q,contents:ne}},[e]),$=de.useMemo(()=>E.find(Q=>!Q.disabled)?.value,[E]),[K,W]=de.useState(()=>t!==void 0&&E.some(ne=>ne.value===t&&!ne.disabled)?t:$),S=n!==void 0,F=S?n:K,I=de.useRef(null),P=de.useRef([]),D=Math.max(0,E.findIndex(Q=>Q.value===F)),[B,z]=de.useState({left:0,top:0,width:0,height:0}),[w,g]=de.useState(false),[v,L]=de.useState(false),H=de.useCallback(()=>{let Q=I.current,ne=P.current[D];if(!Q||!ne)return;let ae=Q.getBoundingClientRect(),me=ne.getBoundingClientRect();z({left:me.left-ae.left,top:me.top-ae.top,width:me.width,height:me.height});},[D]);de.useLayoutEffect(()=>{H(),w||(g(true),requestAnimationFrame(()=>L(true)));},[H,w]),de.useEffect(()=>{let Q=new ResizeObserver(()=>H());I.current&&Q.observe(I.current);let ne=P.current[D];ne&&Q.observe(ne);let ae=()=>H();return window.addEventListener("resize",ae),()=>{Q.disconnect(),window.removeEventListener("resize",ae);}},[H,D]);let O=(Q,ne)=>{if(!E.length)return Q;let ae=Q;for(let me=0;me<E.length;me++)if(ae=(ae+ne+E.length)%E.length,!E[ae].disabled)return ae;return Q},_=Q=>{S||W(Q),o?.(Q);},N=Q=>{if(!E.length)return;let ne=D;if(Q.key===(m?"ArrowDown":"ArrowRight"))ne=O(D,1);else if(Q.key===(m?"ArrowUp":"ArrowLeft"))ne=O(D,-1);else if(Q.key==="Home")ne=E.findIndex(me=>!me.disabled);else if(Q.key==="End"){let me=[...E].reverse().findIndex(Ae=>!Ae.disabled);ne=me===-1?D:E.length-1-me;}else return;Q.preventDefault();let ae=E[ne]?.value;ae!==void 0&&_(ae),requestAnimationFrame(()=>P.current[ne]?.focus());},U=h.text.primary,G=h.text.secondary,se=h.neutral[500],V=r==="subtle"?h.surface.subtleBg:"transparent",Y=r==="subtle"?h.surface.panelBg??h.surface.panelBg:r==="ghost"?h.surface.subtleBg:"transparent",le=h.text.primary,ue=r==="subtle"||r==="ghost"||r==="underlined",pe=css({"--pf-ease":"cubic-bezier(.4,0,.2,1)",display:"flex",flexDirection:"column",width:l?"100%":s==null?"auto":typeof s=="number"?`${s}px`:s}),Me=r==="subtle",Ce=css({position:"relative",display:C?"flex":"inline-flex",width:C?"100%":"auto",flexDirection:m?"column":"row",alignItems:m?"stretch":"center",flexWrap:"nowrap",gap:h.spacing.xs,padding:Me?h.spacing.xs:0,background:V,borderRadius:r==="subtle"?u?m?h.radius.lg:h.radius.full:h.radius.lg:"none"}),ve=css({position:"absolute",zIndex:0,pointerEvents:"none",opacity:w?1:0,visibility:w?"visible":"hidden",transition:v?`${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"?u?h.radius.full:h.radius.md:0,background:r==="underlined"?"transparent":Y,...m?{top:`${B.top}px`,height:`${B.height}px`,left:h.spacing.xs,right:h.spacing.xs}:{left:`${B.left}px`,width:`${B.width}px`,top:h.spacing.xs,bottom:h.spacing.xs},boxShadow:c&&r==="subtle"?"0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04)":"none"}),Ee=css(r!=="underlined"?{}:m?{background:"transparent",top:`${B.top}px`,height:`${B.height}px`,left:0,width:0,borderLeft:`2px solid ${le}`,borderBottom:"none",borderRadius:2}:{background:"transparent",left:`${B.left}px`,width:`${B.width}px`,bottom:0,top:"auto",height:0,borderBottom:`2px solid ${le}`,borderLeft:"none",borderRadius:2}),Re=css({position:"relative",zIndex:1,border:"none",background:"transparent",padding:r==="underlined"&&a!=="vertical"?`${h.spacing.md}`:r==="ghost"&&a!=="vertical"?`${h.spacing.md}`:`${h.spacing.xs} ${h.spacing.md}`,borderRadius:(r==="subtle"||r==="ghost")&&u?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:C?"100%":"auto",flex:"0 0 auto",textAlign:A}:C?{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:G,"&[aria-selected='true']":{color:U},"&:hover":{color:U},"&[aria-disabled='true'], &:disabled":{opacity:.55,cursor:"not-allowed",color:se}}),Z=css({display:"inline-flex",alignItems:"center",justifyContent:m?T[A]:"center",gap:6,width:"100%",flexDirection:p==="top"?"column-reverse":p==="bottom"?"column":p==="left"?"row-reverse":"row"}),ie=css({marginTop:h.spacing.sm,width:"100%"}),be=de.useId(),X=new Map;M.forEach((Q,ne)=>X.set(Q.value,`${be}-panel-${ne}`));let ye=Q=>`${be}-tab-${Q}`;return jsxs("div",{className:["plainframe-ui-tabs",i||""].join(" ").trim(),css:[pe,f],children:[jsxs("div",{className:"plainframe-ui-tabs-track",ref:I,role:"tablist","aria-orientation":m?"vertical":"horizontal",onKeyDown:N,css:[Ce,R],children:[ue&&jsx("div",{className:"plainframe-ui-tabs-thumb",css:[ve,Ee,k,x]}),E.map((Q,ne)=>{let ae=F===Q.value;return jsx("button",{ref:me=>{P.current[ne]=me;},role:"tab",id:ye(ne),"aria-selected":ae,"aria-controls":X.get(Q.value),"aria-disabled":Q.disabled||void 0,disabled:Q.disabled,tabIndex:Q.disabled?-1:ne===D?0:-1,className:["plainframe-ui-tab",Q.className||""].join(" ").trim(),onClick:()=>{Q.disabled||_(Q.value);},css:[Re,!Q.disabled&&d(),Q.css,ae?Q.activeCss??y:void 0],children:jsx("span",{className:"plainframe-ui-tab-content",css:Z,children:Q.node})},String(Q.value??ne))})]}),M.map((Q,ne)=>{let ae=Q.value===F;if(!ae)return null;let me=E.findIndex(He=>He.value===Q.value),Ae=me>=0?ye(me):void 0;return console.log("rendering panel for",Q.value,"active:",ae),jsx("div",{role:"tabpanel",id:X.get(Q.value),"aria-labelledby":Ae,className:["plainframe-ui-tab-panel",Q.className||""].join(" ").trim(),css:[ie,Q.css],children:Q.node},ne)})]})};var Mo=e=>e==null?void 0:typeof e=="number"?`${e}px`:e,xn=e=>e==null?[]:Array.isArray(e)?e:[e],Fo=(...e)=>css(e.filter(Boolean)),og=({label:e,value:t,defaultValue:n="",onChange:o,placeholder:r,error:a,helperText:i,disabled:c=false,fullWidth:s=false,width:l=235,size:u="md",variant:p="subtle",rounded:b=false,rows:f=3,maxRows:R,maxLength:k,showCharCount:y,focusRingMode:x="always",resizable:h=false,className:d,wrapperCss:m,inputCss:C,labelCss:A,helperRowCss:T,helperTextCss:E,charCountCss:M,css:$,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:F,name:I,id:P,tabIndex:D,autoComplete:B,readOnly:z,required:w})=>{let g=j(),v=Xo(),L=useId(),H=useMemo(()=>({sm:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.sm,labelFont:g.typography.sizes.xs,helperFont:g.typography.sizes.xs,width:"12.5rem",paddingY:0,paddingX:g.spacing.md},md:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.md,labelFont:g.typography.sizes.sm,helperFont:g.typography.sizes.xs,width:"15rem",paddingY:0,paddingX:g.spacing.md},lg:{fontSize:g.typography.sizes.sm,minHeight:g.componentHeights.lg,labelFont:g.typography.sizes.md,helperFont:g.typography.sizes.sm,width:"18.125rem",paddingY:0,paddingX:g.spacing.md}}),[g]),O=["sm","md","lg"].includes(u)?u:"md",_=H[O],N=g.neutral,U=g.text,G=t!==void 0,[se,V]=useState(n),Y=G?t:se,le=useCallback(ae=>{G||V(ae),o?.(ae);},[G,o]),ue=useMemo(()=>c?N[200]:a&&p==="outlined"?g.palette.danger?.[50]??g.surface.panelBg:a&&p==="subtle"?g.palette.danger?.[50]??g.surface.subtleBg:p==="outlined"?g.surface.panelBg:p==="subtle"?g.surface.subtleBg:"transparent",[c,a,p,N,g.surface,g.palette.danger]),pe=g.componentHeights.border,Me=useMemo(()=>p==="outlined"?`${pe} solid ${a?g.palette.danger?.[300]??g.surface.border:g.surface.border}`:"none",[p,pe,a,g.palette.danger,g.surface.border]),Ce=useMemo(()=>css({boxSizing:"border-box",display:"block",minWidth:0,width:"100%",maxWidth:s?"100%":l!=null?Mo(l):void 0,flex:"0 0 auto",fontWeight:500}),[s,l]),ve=useMemo(()=>Fo({fontSize:_.labelFont,fontWeight:500,color:a?g.palette.danger?.[700]??U.primary:c?N[500]:U.primary,marginBottom:4,display:"inline-block"},...xn(A)),[_.labelFont,a,c,N,U,g.palette.danger,A]),Ee=useMemo(()=>[{display:"flex",alignItems:"stretch",gap:g.spacing.sm,padding:`${Mo(_.paddingY)} 0 ${Mo(_.paddingY)} ${Mo(_.paddingX)}`,background:ue,border:Me,borderRadius:b?g.radius.full:g.radius.md,minHeight:_.minHeight,width:"100%",cursor:c?"not-allowed":"text",opacity:c?.65:1,transition:"box-shadow .18s, border-color .16s"},...xn(m),...xn($)],[g,_,ue,Me,pe,b,c,m,$]),Re=typeof _.minHeight=="number"?`${_.minHeight}px`:_.minHeight,Z=useMemo(()=>Fo({width:"100%",minWidth:0,flex:1,resize:h?"vertical":"none",font:"inherit",fontWeight:500,fontSize:_.fontSize,lineHeight:1.5,color:c?N[500]:a?g.palette.danger?.[800]??U.primary:U.primary,background:"transparent",border:"none",outline:"none",padding:0,paddingRight:Mo(_.paddingX),overflowY:"auto",minHeight:Re,"&::placeholder":{color:a?g.palette.danger?.[700]??U.secondary:U.secondary},"&:-webkit-autofill,&:-webkit-autofill:hover,&:-webkit-autofill:focus":{WebkitTextFillColor:`${a?g.palette.danger?.[800]??U.primary:U.primary} !important`,boxShadow:`0 0 0 1000px ${ue} inset !important`,transition:"opacity 99999s ease-out",caretColor:a?g.palette.danger?.[800]??U.primary:U.primary},":focus-within":{outline:"none",boxShadow:"none"},...f===1?{paddingBlock:`calc((${Re} - 1.5em) / 2)`}:{paddingBlock:"clamp(4px, 0.5em, 12px)"}},...xn(C)),[h,_,c,a,N,U,g.palette.danger,Re,ue,f,C]),ie=useMemo(()=>Fo({display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:8,paddingTop:3},...xn(T)),[T]),be=useMemo(()=>Fo({fontSize:_.helperFont,color:a?g.palette.danger?.[700]??U.secondary:U.secondary,flex:1,minWidth:0},...xn(E)),[_.helperFont,a,g.palette.danger,U,E]),X=useMemo(()=>Fo({fontSize:_.helperFont,color:k&&Y.length>k?g.palette.danger?.[700]??U.secondary:U.secondary,flexShrink:0},...xn(M)),[_.helperFont,k,Y.length,g.palette.danger,U,M]),ye=useRef(null);useLayoutEffect(()=>{if(typeof window>"u")return;let ae=ye.current;if(!ae)return;if(h){let Ae=window.getComputedStyle(ae),He=parseFloat(Ae.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(He*(f??1),J);ae.style.setProperty("--pf-minh",`${oe}px`);return}(()=>{let Ae=window.getComputedStyle(ae),He=parseFloat(Ae.lineHeight||"20"),J=typeof _.minHeight=="number"?_.minHeight:parseFloat(String(_.minHeight)),oe=Math.max(He*(f??1),J);ae.style.setProperty("--pf-minh",`${oe}px`);let re=R?He*R:1/0;ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,re)}px`;})();},[Y,f,R,_.minHeight,h]);let Q=i!=null||y?`${P??L}-help`:void 0,ne=P??L;return jsxs("div",{className:["plainframe-ui-textarea",d||""].join(" ").trim(),css:Ce,children:[e&&jsx("label",{htmlFor:ne,className:"plainframe-ui-textarea-label",css:ve,children:e}),jsx("div",{className:"plainframe-ui-textarea-surface",css:[v({enabled:x!=="none",disabled:c,color:a?"danger":void 0}),Ee],"aria-invalid":!!a||void 0,"aria-disabled":c||void 0,onClick:()=>!c&&ye.current?.focus(),children:jsx("textarea",{ref:ye,id:ne,className:"plainframe-ui-textarea-input",css:Z,rows:f,value:Y,onChange:ae=>{let me=ae.target.value;k&&me.length>k||le(me);},placeholder:r||"",disabled:c,onBlur:K,onFocus:W,onKeyDown:S,autoFocus:F,name:I,tabIndex:D,autoComplete:B,readOnly:z,required:w,"aria-invalid":!!a||void 0,"aria-describedby":Q})}),(i!=null||y&&k!=null)&&jsxs("div",{className:"plainframe-ui-textarea-helper-row",css:ie,children:[jsx("span",{id:Q,className:"plainframe-ui-textarea-helper-text",css:be,children:i}),y&&k!=null&&jsxs("span",{className:"plainframe-ui-textarea-char-count",css:X,children:[Y.length,"/",k]})]})]})};var dg=jo,pg={type:"spring",stiffness:920,damping:100},Zl="__toast_root__",mg=(e,t)=>t.split(".").reduce((n,o)=>n!=null&&typeof n=="object"?n[o]:void 0,e),Nr=(e,t)=>{for(let n of t){let o=mg(e,n);if(o!=null&&o!=="")return o}},aa=(e,t)=>e==null?`${t}px`:typeof e=="number"?`${e}px`:String(e);function fg(e){let t=Nr(e,["radius.md","shape.borderRadius","radii.md"]),n=Nr(e,["spacing.lg","space.4","spacing.4"]),o=Nr(e,["spacing.md","space.3","spacing.3"]),r=Nr(e,["shadows.lg","elevation.lg"])??"0 8px 24px rgba(0,0,0,.03), 0 2px 8px rgba(0,0,0,.05)";return {radius:aa(t,16),padX:aa(n,14),padY:aa(o,12),shadow:String(r)}}var gg=fg(dg),Bt=null,Vn=null,ge={max:5,position:"bottom-right",gutter:5,zIndex:1e3,duration:5e3,showDismiss:"hover",styles:{},renderer:void 0,bareRenderer:false};function tc(){typeof document>"u"||(Bt||(Bt=document.getElementById("toast-host"),Bt||(Bt=document.createElement("div"),Bt.id="toast-host",document.body.appendChild(Bt))),Vn||(Vn=Bt[Zl]??null,Vn||(Vn=createRoot(Bt),Bt[Zl]=Vn,Vn.render(jsx(Na,{children:jsx(Sg,{})})))));}var ee={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}};}},vn=()=>{ee.sync(),ee.notify();},bg=()=>typeof crypto<"u"&&"randomUUID"in crypto&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Math.random().toString(36).slice(2);function Hr(e,t){if(t===null)return;let n=t??e.duration;if(n==null||ee.timers.has(e.id))return;let o=Date.now(),r=ee.remaining.get(e.id),a=r!=null?Math.max(0,r):n;ee.expiry.set(e.id,o+a);let i=window.setTimeout(()=>De.dismiss(e.id),a);ee.timers.set(e.id,i);}function Lr(e){let t=ee.timers.get(e);t&&(clearTimeout(t),ee.timers.delete(e));}function hg(){let e=false;for(;ee.displayed.length<ge.max&&ee.queue.length;){let t=ee.queue.shift();ee.displayed=[t,...ee.displayed],ee.enterFrom[t.id]="head",ee.entering[t.id]=true,e=true,requestAnimationFrame(()=>{delete ee.entering[t.id],vn();}),Hr(t);}e&&vn();}function yg(){if(ee.displayed.length<ge.max)return;let e=ee.displayed.filter(o=>!ee.exiting[o.id]);if(!e.length)return;let t=e.reduce((o,r)=>o.createdAt<=r.createdAt?o:r),n=ee.expiry.get(t.id);n!=null&&ee.remaining.set(t.id,Math.max(0,n-Date.now())),Lr(t.id),ee.exiting[t.id]=true,ee.displayed=ee.displayed.filter(o=>o.id!==t.id),delete ee.enterFrom[t.id],ee.queue.push(t),vn();}var xg=e=>e==="danger"?"error":["default","success","error","warning","info"].includes(e)?e:"default";function vg(e,t){let n=xg(t),o=e,r=o.surface,a=o.text,i=r?.panelBg??"#fff",c=a?.primary??"#111",s=r?.border;if(n==="default"||n==="info")return {bg:i,fg:c,border:s};let l=a?.onColors??{},u=(p,b,f)=>{let R=o.colors,k=o.palette;return {bg:R?.[p]??k?.[p]?.[700]??b,fg:l?.[p]??f,border:"transparent"}};return n==="success"?u("success","#22C55E","#fff"):n==="warning"?u("warning","#F59E0B","#fff"):n==="error"?u("error","#EF4444","#fff"):{bg:i,fg:c,border:s}}var De=Object.assign((e,t)=>{tc();let n=s=>s!=null&&typeof s[Symbol.iterator]=="function",o=s=>!!s&&(typeof s=="object"||typeof s=="function")&&typeof s.then=="function",r;typeof e=="object"&&e!=null&&!de.isValidElement(e)&&!n(e)&&!o(e)?r=e:r={content:(de.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 a=r.id??bg(),i=s=>{let l=s.findIndex(b=>b.id===a);if(l===-1)return false;let u=s[l],p={...u,status:r.status??u.status,content:r.content??u.content,title:r.title??u.title,description:r.description??u.description,startIcon:r.startIcon??u.startIcon,endIcon:r.endIcon??u.endIcon,action:r.action??u.action,onClose:r.onClose??u.onClose,duration:r.duration===void 0?u.duration:r.duration,pauseOnHover:r.pauseOnHover??u.pauseOnHover,showDismiss:r.showDismiss??u.showDismiss,render:r.render??u.render,bare:r.bare??u.bare,onClick:r.onClick??u.onClick,width:r.width??u.width};return s[l]=p,Lr(a),ee.remaining.delete(a),ee.paused.has(a)||Hr(p),vn(),true};if(i(ee.displayed)||i(ee.queue))return a;let c={id:a,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?ge.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 ee.displayed.length>=ge.max&&yg(),ee.displayed=[...ee.displayed,c],ee.enterFrom[c.id]="tail",ee.entering[c.id]=true,requestAnimationFrame(()=>{delete ee.entering[c.id],vn();}),vn(),Hr(c),a},{success:(e,t={})=>De(e,{...t,status:"success"}),error:(e,t={})=>De(e,{...t,status:"error"}),warning:(e,t={})=>De(e,{...t,status:"warning"}),info:(e,t={})=>De(e,{...t,status:"info"}),custom:(e,t={})=>De(e,{...t}),update:(e,t)=>De({id:e,...t}),dismiss:e=>{if(!e){let n=ee.displayed.find(o=>!ee.exiting[o.id])?.id;n&&De.dismiss(n);return}Lr(e),ee.remaining.delete(e),ee.paused.delete(e),ee.exiting[e]=true;let t=ee.displayed.find(n=>n.id===e);ee.displayed=ee.displayed.filter(n=>n.id!==e),delete ee.enterFrom[e],vn(),window.setTimeout(()=>t?.onClose?.(),120),hg();},clear:()=>{[...ee.displayed.map(t=>t.id)].forEach(t=>De.dismiss(t));},pause:e=>{if(ee.paused.has(e))return;let t=ee.expiry.get(e);t!=null&&ee.remaining.set(e,Math.max(0,t-Date.now())),ee.paused.add(e),Lr(e);},resume:e=>{if(!ee.paused.has(e))return;ee.paused.delete(e);let t=ee.displayed.find(o=>o.id===e)??ee.queue.find(o=>o.id===e),n=ee.remaining.get(e);t&&Hr(t,n??void 0),ee.remaining.delete(e);},pauseLatest:()=>{let e=ee.displayed.at(-1);e&&De.pause(e.id);},resumeLatest:()=>{let e=ee.displayed.at(-1);e&&De.resume(e.id);},promise:(e,t,n={})=>{let o=De(t.loading,{...n,status:"info",duration:null});return e.then(r=>{De.update(o,{status:"success",content:t.success(r),duration:n.duration??2500});}).catch(r=>{De.update(o,{status:"error",content:t.error(r),duration:n.duration??3e3});}),e},config:e=>{e.max!=null&&(ge.max=e.max),e.position&&(ge.position=e.position),e.gutter!=null&&(ge.gutter=e.gutter),e.zIndex!=null&&(ge.zIndex=e.zIndex),e.duration!==void 0&&(ge.duration=e.duration),e.showDismiss&&(ge.showDismiss=e.showDismiss),e.styles&&(ge.styles={...ge.styles,...e.styles}),e.renderer!==void 0&&(ge.renderer=e.renderer),e.bareRenderer!==void 0&&(ge.bareRenderer=e.bareRenderer);}});function Cg(e){return typeof e=="string"?e:e===true?"always":e===false?"never":ge.showDismiss}function Rg(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 Tg=css({display:"flex",alignItems:"flex-start",gap:10}),Ql=css({flex:"0 0 auto",paddingTop:1,lineHeight:0,marginLeft:-3,"& svg, & img, & canvas, & video":{display:"block"}}),wg=css({fontSize:14,lineHeight:1.4,fontWeight:500,flex:1,minWidth:0}),Eg=css({display:"flex",alignItems:"center",gap:6,marginRight:-2}),Sg=de.memo(function(){let t=useSyncExternalStore(ee.subscribe.bind(ee),()=>ee.snapshot,()=>ee.snapshot),n=j(),o=ge.position.startsWith("bottom"),r=de.useMemo(()=>o?t.displayed:[...t.displayed].reverse(),[t.displayed,o]),a=de.useMemo(()=>({position:"fixed",zIndex:ge.zIndex,pointerEvents:"none",width:"100%",display:"flex",flexDirection:"column",...Rg(ge.position),...ge.styles.stack??{}}),[]);return jsx("div",{className:"plainframe-ui-toast-stack",css:css(a),children:jsx(AnimatePresence,{initial:false,children:r.map((i,c)=>{let s=t.enterFrom[i.id]||"tail",l=o?s==="head"?-16:16:s==="head"?16:-16,u=c>0?ge.gutter:0,p={toast:i,close:De.dismiss,pause:De.pause,resume:De.resume},{bg:b,fg:f,border:R}=vg(n,i.status),k={position:"relative",overflow:"hidden",borderRadius:n.radius.md,boxShadow:gg.shadow,padding:`${n.spacing.md} calc(${n.spacing.lg} + 30px) ${n.spacing.md} ${n.spacing.lg}`,display:"grid",gridTemplateColumns:"1fr auto",gap:10,background:b,color:f,cursor:i.onClick?"pointer":"default",border:R?`1px solid ${R}`:"1px solid transparent"},y=typeof ge.styles.surface=="function"?ge.styles.surface(i):ge.styles.surface??{},x=Cg(i.showDismiss),h={},d="& .plainframe-ui-toast-close",m="&:hover .plainframe-ui-toast-close";x==="hover"?(h[d]={opacity:0,pointerEvents:"none"},h[m]={opacity:1,pointerEvents:"auto"}):x==="always"?h[d]={opacity:1,pointerEvents:"auto"}:x==="never"&&(h[d]={display:"none"});let C=css({...k,...y,...h}),A=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",...ge.styles.close??{}}),T;if(i.bare&&i.render){let E=typeof i.render=="function"?i.render(p):i.render;T=jsx("div",{style:{pointerEvents:"auto"},onClick:M=>i.onClick?.(i.id,M),children:E});}else if(ge.bareRenderer&&ge.renderer){let E=typeof ge.renderer=="function"?ge.renderer(p):ge.renderer;T=jsx("div",{style:{pointerEvents:"auto"},onClick:M=>i.onClick?.(i.id,M),children:E});}else {let E;ge.renderer?E=typeof ge.renderer=="function"?ge.renderer(p):ge.renderer:i.render&&!i.bare?E=typeof i.render=="function"?i.render(p):i.render:E=jsxs(Fragment,{children:[jsxs("div",{css:Tg,children:[i.startIcon&&jsx("div",{css:Ql,children:i.startIcon}),jsx("div",{css:wg,children:i.content}),i.endIcon&&jsx("div",{css:Ql,children:i.endIcon})]}),i.action&&jsx("div",{css:Eg,children:i.action})]}),T=jsxs("div",{css:C,onClick:M=>i.onClick?.(i.id,M),children:[E,jsx("button",{className:"plainframe-ui-toast-close","aria-label":"Close",css:A,onClick:M=>{M.stopPropagation(),De.dismiss(i.id);},children:jsx(X,{strokeWidth:2.5,size:14})})]});}return jsx(Ig,{id:i.id,isBottom:o,mt:u,enterY:l,width:i.width,pauseOnHover:i.pauseOnHover!==false,children:T},i.id)})})})}),Ig=de.memo(function(t){let{id:n,isBottom:o,mt:r,enterY:a,width:i,pauseOnHover:c,children:s}=t,l=useAnimationControls();useEffect(()=>{l.start({opacity:1,y:0,height:"auto",x:0,transition:pg});},[l]);let u={pointerEvents:"auto",willChange:"transform, opacity, height, margin, scale, width, max-width",marginTop:r,width:"100%",maxWidth:i!=null?typeof i=="number"?`${i}px`:i:"none",...ge.styles.item??{}};return jsx(motion.div,{layout:"position",className:"plainframe-ui-toast-item",css:css(u),initial:{opacity:0,y:a,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,b)=>{let f=Math.abs(b.offset.x),R=Math.abs(b.velocity.x);if(!(f>60||R>600)){l.start({x:0,opacity:1,transition:{type:"spring",stiffness:700,damping:40}});return}let x=(b.offset.x!==0?Math.sign(b.offset.x):Math.sign(b.velocity.x||1))*(window.innerWidth+160),h=typeof b.velocity.x=="number"?b.velocity.x/10:0;l.start({x,opacity:.9,transition:{type:"spring",stiffness:280,damping:24,velocity:h}}).then(()=>De.dismiss(n));},onMouseEnter:c?()=>De.pause(n):void 0,onMouseLeave:c?()=>De.resume(n):void 0,children:s})}),ec=false;(function(){ec||(ec=true,tc());})();var Yg=(...e)=>t=>{for(let n of e)if(n)if(typeof n=="function")n(t);else try{n.current=t;}catch{}},rc=createContext(null),sc=()=>{let e=useContext(rc);if(!e)throw new Error("TooltipTrigger/TooltipContent must be inside <Tooltip>.");return e},Jg=({children:e,placement:t="top",open:n,defaultOpen:o=false,onOpenChange:r,delay:a=80,arrow:i=true,autoWidth:c=false,disableHoverListener:s=false})=>{let[l,u]=useState(!!o),p=n??l,b=T=>{n===void 0&&u(T),r?.(T);},f=useRef(null),R=useFloating({placement:t,open:p,onOpenChange:b,whileElementsMounted:autoUpdate,strategy:"fixed",transform:false,middleware:[offset(8),flip({padding:8}),shift({padding:8}),i?arrow({element:f,padding:4}):void 0].filter(Boolean)}),k=useHover(R.context,{enabled:!s,delay:{open:a,close:60},handleClose:safePolygon(),restMs:20}),y=useFocus(R.context),x=useDismiss(R.context,{escapeKey:true,outsidePress:true}),h=useRole(R.context,{role:"tooltip"}),{getReferenceProps:d,getFloatingProps:m}=useInteractions([k,y,x,h]),C=useId(),A=useMemo(()=>({open:p,setOpen:b,id:C,placement:R.placement,autoWidth:c,allowArrow:!!i,refs:R.refs,floatingStyles:R.floatingStyles,middlewareData:R.middlewareData,getReferenceProps:d,getFloatingProps:m,arrowRef:f}),[p,c,i,R.placement,R.refs,R.floatingStyles,R.middlewareData,d,m]);return jsx(rc.Provider,{value:A,children:e})},Zg=({asChild:e=true,children:t,className:n,css:o})=>{let{refs:r,getReferenceProps:a,id:i}=sc(),c=de.isValidElement(t),s=c&&typeof t.type=="string";if(e&&c&&s){let l=t,u="ref"in l?l.ref:void 0,p=a({...l.props,"aria-describedby":i,ref:Yg(u,r.setReference),className:[l.props?.className||"",n||""].join(" ").trim()||void 0}),b=[l.props?.css||void 0,o].filter(Boolean);return de.cloneElement(l,{...p,css:b})}return jsx("span",{ref:r.setReference,className:n,css:o,style:{display:"inline-flex"},...a({"aria-describedby":i}),children:t})},Qg=({children:e,className:t,css:n,arrowCss:o})=>{let {open:r,refs:a,floatingStyles:i,middlewareData:c,getFloatingProps:s,placement:l,id:u,autoWidth:p,allowArrow:b,arrowRef:f}=sc(),R=j(),k=l.split("-")[0]||"top",x=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=x,d=k==="bottom"?"center top":k==="top"?"center bottom":k==="left"?"right center":"left center",m=css({zIndex:1300,backgroundColor:R.neutral[900],color:R.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}),C=css({position:"absolute",width:10,height:10,borderRadius:2,backgroundColor:R.neutral[900],transform:"rotate(45deg)",pointerEvents:"none"}),A=c.arrow,T={top:"bottom",bottom:"top",left:"right",right:"left"}[k];return jsx(FloatingPortal,{children:jsx(AnimatePresence,{children:r&&jsxs(motion.div,{id:u,ref:a.setFloating,role:"tooltip","data-state":"open",className:["plainframe-ui-tooltip",t||""].join(" ").trim(),css:[m,n],style:i,initial:x,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"}},...s(),children:[e,b&&jsx("div",{ref:f,className:"plainframe-ui-tooltip-arrow",css:[C,o],style:{left:A?.x!=null?`${A.x}px`:void 0,top:A?.y!=null?`${A.y}px`:void 0,[T]:"-3px"}})]})})})};function ob(){let e=j();return jsx(Global,{styles:css`
21
21
  *,*::before,*::after{box-sizing:border-box}
22
22
 
23
23
  body{
@@ -45,4 +45,4 @@ ${g}{background:var(--pf-surface-appBg);color:var(--pf-text-primary);}`:"")),F()
45
45
  @media (prefers-reduced-motion:reduce){
46
46
  *{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important;scroll-behavior:auto!important}
47
47
  }
48
- `})}export{Wa as Accordion,ns as AccordionDetails,ja as AccordionGroup,ts as AccordionSummary,Ua as ActionBar,Qa as Alert,is as AlertDescription,as as AlertTitle,Di as Autocomplete,Ni as Avatar,Gd as AvatarGroup,Ss as Backdrop,tp as Badge,br as BreadCrumbItem,ip as BreadCrumbs,_i as Button,Gi as ButtonGroup,Ji as Card,kp as CardContent,Pp as CardDescription,Ap as CardEnd,el as CardGroup,Mp as CardStart,Fp as CardTitle,rr as Checkbox,ol as Chip,qp as CodeField,$n as Container,Xp as ContextZone,ob as CssBaseline,Qp as Divider,hl as Drawer,Dn as DropdownMenu,pn as DropdownMenuContent,Si as DropdownMenuSub,ki as DropdownMenuSubContent,Ii as DropdownMenuSubTrigger,Nn as DropdownMenuTrigger,Ks as Fade,Rl as Flex,_s as Grow,El as Image,$m as ImageStack,_m as Kbd,ai as Menu,bs as MenuCheckboxGroup,ao as MenuCheckboxItem,At as MenuItem,ln as MenuLabel,Ci as MenuRadioGroup,nd as MenuRadioItem,od as MenuSeparator,xi as MenuSwitchItem,Qo as MenuVariantCtx,Qm as Modal,Bl as ModalContent,Ll as ModalTrigger,lf as Pagination,Ou as Popover,ui as PopoverAnchor,di as PopoverContent,ci as PopoverTrigger,Qn as Progress,ff as Quote,vf as RadioGroup,Cf as RadioItem,Sf as Rotate,_l as Select,Qs as SelectItem,Pf as Skeleton,Gs as Slide,Gl as Slider,ra as Step,Gf as Stepper,fs as Switch,Ar as Tab,Fr as TabContent,Jf as Tabs,og as TextArea,Zo as TextField,Na as ThemeProvider,Jg as Tooltip,Qg as TooltipContent,Zg as TooltipTrigger,Wn as Typography,Ea as defaultDarkTheme,jo as defaultLightTheme,Jn as surfaceFromNeutral,_o as textDark,Ko as textLight,Ne as toast,Cc as useColorMode,Rd as useDropdownMenuActiveIndex,j as usePlainframeUITheme,Ku as usePopoverContext,Rc as usePrimary,cb as usePrimitives};
48
+ `})}export{Wa as Accordion,os as AccordionDetails,ja as AccordionGroup,ns as AccordionSummary,Ua as ActionBar,Qa as Alert,ls as AlertDescription,is as AlertTitle,Di as Autocomplete,Ni as Avatar,Gd as AvatarGroup,Ss as Backdrop,tp as Badge,hr as BreadCrumbItem,ip as BreadCrumbs,_i as Button,Gi as ButtonGroup,Ji as Card,kp as CardContent,Pp as CardDescription,Fp as CardEnd,el as CardGroup,Mp as CardStart,Ap as CardTitle,rr as Checkbox,ol as Chip,qp as CodeField,Bn as Container,Xp as ContextZone,ob as CssBaseline,Qp as Divider,hl as Drawer,Pn as DropdownMenu,dn as DropdownMenuContent,Si as DropdownMenuSub,ki as DropdownMenuSubContent,Ii as DropdownMenuSubTrigger,Dn as DropdownMenuTrigger,Ks as Fade,Rl as Flex,_s as Grow,El as Image,$m as ImageStack,_m as Kbd,ai as Menu,hs as MenuCheckboxGroup,ao as MenuCheckboxItem,Mt as MenuItem,an as MenuLabel,Ci as MenuRadioGroup,nd as MenuRadioItem,od as MenuSeparator,xi as MenuSwitchItem,Qo as MenuVariantCtx,Qm as Modal,Bl as ModalContent,Ll as ModalTrigger,lf as Pagination,Ou as Popover,ui as PopoverAnchor,di as PopoverContent,ci as PopoverTrigger,Qn as Progress,ff as Quote,vf as RadioGroup,Cf as RadioItem,Sf as Rotate,_l as Select,Qs as SelectItem,Pf as Skeleton,Gs as Slide,Gl as Slider,ra as Step,Gf as Stepper,gs as Switch,Ar as Tab,Pr as TabContent,Jf as Tabs,og as TextArea,Zo as TextField,Na as ThemeProvider,Jg as Tooltip,Qg as TooltipContent,Zg as TooltipTrigger,On as Typography,Ea as defaultDarkTheme,jo as defaultLightTheme,Jn as surfaceFromNeutral,_o as textDark,Ko as textLight,De as toast,Cc as useColorMode,Rd as useDropdownMenuActiveIndex,j as usePlainframeUITheme,Ku as usePopoverContext,Rc as usePrimary,cb as usePrimitives};